Index: tags/1.0.5/.pc/.quilt_patches =================================================================== --- tags/1.0.5/.pc/.quilt_patches (nonexistent) +++ tags/1.0.5/.pc/.quilt_patches (revision 953) @@ -0,0 +1 @@ +debian/patches Index: tags/1.0.5/.pc/.quilt_series =================================================================== --- tags/1.0.5/.pc/.quilt_series (nonexistent) +++ tags/1.0.5/.pc/.quilt_series (revision 953) @@ -0,0 +1 @@ +series Index: tags/1.0.5/.pc/.version =================================================================== --- tags/1.0.5/.pc/.version (nonexistent) +++ tags/1.0.5/.pc/.version (revision 953) @@ -0,0 +1 @@ +2 Index: tags/1.0.5/.pc/0001-Fixed-command-line-batch-output-for-some-exporters.patch/src/main.c =================================================================== --- tags/1.0.5/.pc/0001-Fixed-command-line-batch-output-for-some-exporters.patch/src/main.c (nonexistent) +++ tags/1.0.5/.pc/0001-Fixed-command-line-batch-output-for-some-exporters.patch/src/main.c (revision 953) @@ -0,0 +1,1968 @@ +/* $Id$ */ + +/* + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + */ + + +/* main program, initializes some stuff and handles user input + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#ifdef HAVE_STRING_H +#include +#endif +#include +#include +#include +#include /* Seed for srand() */ + +#include "global.h" +#include "data.h" +#include "buffer.h" +#include "create.h" +#include "crosshair.h" +#include "draw.h" +#include "error.h" +#include "file.h" +#include "set.h" +#include "action.h" +#include "misc.h" +#include "lrealpath.h" +#include "free_atexit.h" +#include "polygon.h" +#include "pcb-printf.h" + +#include "hid/common/actions.h" + +/* This next one is so we can print the help messages. */ +#include "hid/hidint.h" + +#ifdef HAVE_DBUS +#include "dbus.h" +#endif + +#if ENABLE_NLS +#include +#endif + +#ifdef HAVE_LIBDMALLOC +#include +#endif + +RCSID ("$Id$"); + + +#define PCBLIBPATH ".:" PCBLIBDIR + + +#ifdef HAVE_LIBSTROKE +extern void stroke_init (void); +#endif + + +/* ---------------------------------------------------------------------- + * initialize signal and error handlers + */ +static void +InitHandler (void) +{ +/* + signal(SIGHUP, CatchSignal); + signal(SIGQUIT, CatchSignal); + signal(SIGABRT, CatchSignal); + signal(SIGSEGV, CatchSignal); + signal(SIGTERM, CatchSignal); + signal(SIGINT, CatchSignal); +*/ + + /* calling external program by popen() may cause a PIPE signal, + * so we ignore it + */ +#ifdef SIGPIPE + signal (SIGPIPE, SIG_IGN); +#endif +} + + + /* ---------------------------------------------------------------------- + | command line and rc file processing. + */ +static char *command_line_pcb; + +void +copyright (void) +{ + printf ("\n" + " COPYRIGHT for %s version %s\n\n" + " PCB, interactive printed circuit board design\n" + " Copyright (C) 1994,1995,1996,1997 Thomas Nau\n" + " Copyright (C) 1998, 1999, 2000 Harry Eaton\n\n" + " This program is free software; you can redistribute it and/or modify\n" + " it under the terms of the GNU General Public License as published by\n" + " the Free Software Foundation; either version 2 of the License, or\n" + " (at your option) any later version.\n\n" + " This program is distributed in the hope that it will be useful,\n" + " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + " GNU General Public License for more details.\n\n" + " You should have received a copy of the GNU General Public License\n" + " along with this program; if not, write to the Free Software\n" + " Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n", + Progname, VERSION); + exit (0); +} + +static inline void +u (const char *fmt, ...) +{ + va_list ap; + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + fputc ('\n', stderr); + va_end (ap); +} + +typedef struct UsageNotes { + struct UsageNotes *next; + HID_Attribute *seen; +} UsageNotes; + +static UsageNotes *usage_notes = NULL; + +static void +usage_attr (HID_Attribute * a) +{ + int i, n; + const Unit *unit_list; + static char buf[200]; + + if (a->help_text == ATTR_UNDOCUMENTED) + return; + + switch (a->type) + { + case HID_Label: + return; + case HID_Integer: + case HID_Real: + sprintf (buf, "--%s ", a->name); + break; + case HID_Coord: + sprintf (buf, "--%s ", a->name); + break; + case HID_String: + sprintf (buf, "--%s ", a->name); + break; + case HID_Boolean: + sprintf (buf, "--%s", a->name); + break; + case HID_Mixed: + case HID_Enum: + sprintf (buf, "--%s ", a->name); + if (a->type == HID_Mixed) + strcat (buf, " "); + for (i = 0; a->enumerations[i]; i++) + { + strcat (buf, i ? "|" : "<"); + strcat (buf, a->enumerations[i]); + } + strcat (buf, ">"); + break; + case HID_Path: + sprintf (buf, "--%s ", a->name); + break; + case HID_Unit: + unit_list = get_unit_list (); + n = get_n_units (); + sprintf (buf, "--%s ", a->name); + for (i = 0; i < n; i++) + { + strcat (buf, i ? "|" : "<"); + strcat (buf, unit_list[i].suffix); + } + strcat (buf, ">"); + break; + } + + if (strlen (buf) <= 30) + { + if (a->help_text) + fprintf (stderr, " %-30s\t%s\n", buf, a->help_text); + else + fprintf (stderr, " %-30s\n", buf); + } + else if (a->help_text && strlen (a->help_text) + strlen (buf) < 72) + fprintf (stderr, " %s\t%s\n", buf, a->help_text); + else if (a->help_text) + fprintf (stderr, " %s\n\t\t\t%s\n", buf, a->help_text); + else + fprintf (stderr, " %s\n", buf); +} + +static void +usage_hid (HID * h) +{ + HID_Attribute *attributes; + int i, n_attributes = 0; + UsageNotes *note; + + if (h->gui) + { + fprintf (stderr, "\n%s gui options:\n", h->name); + attributes = h->get_export_options (&n_attributes); + } + else + { + fprintf (stderr, "\n%s options:\n", h->name); + exporter = h; + attributes = exporter->get_export_options (&n_attributes); + exporter = NULL; + } + + note = (UsageNotes *)malloc (sizeof (UsageNotes)); + note->next = usage_notes; + note->seen = attributes; + usage_notes = note; + + for (i = 0; i < n_attributes; i++) + usage_attr (attributes + i); +} + +static void +usage (void) +{ + HID **hl = hid_enumerate (); + HID_AttrNode *ha; + UsageNotes *note; + int i; + int n_printer = 0, n_gui = 0, n_exporter = 0; + + for (i = 0; hl[i]; i++) + { + if (hl[i]->gui) + n_gui++; + if (hl[i]->printer) + n_printer++; + if (hl[i]->exporter) + n_exporter++; + } + + u ("PCB Printed Circuit Board editing program, http://pcb.gpleda.org"); + u ("%s [-h|-V|--copyright]\t\t\tHelp, version, copyright", Progname); + u ("%s [gui options] \t\tto edit", Progname); + u ("Available GUI hid%s:", n_gui == 1 ? "" : "s"); + for (i = 0; hl[i]; i++) + if (hl[i]->gui) + fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description); + u ("%s -p [printing options] \tto print", Progname); + u ("Available printing hid%s:", n_printer == 1 ? "" : "s"); + for (i = 0; hl[i]; i++) + if (hl[i]->printer) + fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description); + u ("%s -x hid [export options] \tto export", Progname); + u ("Available export hid%s:", n_exporter == 1 ? "" : "s"); + for (i = 0; hl[i]; i++) + if (hl[i]->exporter) + fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description); + + for (i = 0; hl[i]; i++) + if (hl[i]->gui) + usage_hid (hl[i]); + for (i = 0; hl[i]; i++) + if (hl[i]->printer) + usage_hid (hl[i]); + for (i = 0; hl[i]; i++) + if (hl[i]->exporter) + usage_hid (hl[i]); + + u ("\nCommon options:"); + for (ha = hid_attr_nodes; ha; ha = ha->next) + { + for (note = usage_notes; note && note->seen != ha->attributes; note = note->next) + ; + if (note) + continue; + for (i = 0; i < ha->n; i++) + { + usage_attr (ha->attributes + i); + } + } + + exit (1); +} + +static void +print_defaults_1 (HID_Attribute * a, void *value) +{ + int i; + Coord c; + double d; + const char *s; + + /* Remember, at this point we've parsed the command line, so they + may be in the global variable instead of the default_val. */ + switch (a->type) + { + case HID_Integer: + i = value ? *(int *) value : a->default_val.int_value; + fprintf (stderr, "%s %d\n", a->name, i); + break; + case HID_Boolean: + i = value ? *(char *) value : a->default_val.int_value; + fprintf (stderr, "%s %s\n", a->name, i ? "yes" : "no"); + break; + case HID_Real: + d = value ? *(double *) value : a->default_val.real_value; + fprintf (stderr, "%s %g\n", a->name, d); + break; + case HID_Coord: + c = value ? *(Coord *) value : a->default_val.coord_value; + pcb_fprintf (stderr, "%s %$mS\n", a->name, c); + break; + case HID_String: + case HID_Path: + s = value ? *(char **) value : a->default_val.str_value; + fprintf (stderr, "%s \"%s\"\n", a->name, s); + break; + case HID_Enum: + i = value ? *(int *) value : a->default_val.int_value; + fprintf (stderr, "%s %s\n", a->name, a->enumerations[i]); + break; + case HID_Mixed: + i = value ? + ((HID_Attr_Val*)value)->int_value : a->default_val.int_value; + d = value ? + ((HID_Attr_Val*)value)->real_value : a->default_val.real_value; + fprintf (stderr, "%s %g%s\n", a->name, d, a->enumerations[i]); + break; + case HID_Label: + break; + case HID_Unit: + i = value ? *(int *) value : a->default_val.int_value; + fprintf (stderr, "%s %s\n", a->name, get_unit_list()[i].suffix); + } +} + +static void +print_defaults () +{ + HID **hl = hid_enumerate (); + HID_Attribute *e; + int i, n, hi; + + for (hi = 0; hl[hi]; hi++) + { + HID *h = hl[hi]; + if (h->gui) + { + HID_AttrNode *ha; + fprintf (stderr, "\ngui defaults:\n"); + for (ha = hid_attr_nodes; ha; ha = ha->next) + for (i = 0; i < ha->n; i++) + print_defaults_1 (ha->attributes + i, ha->attributes[i].value); + } + else + { + fprintf (stderr, "\n%s defaults:\n", h->name); + exporter = h; + e = exporter->get_export_options (&n); + exporter = NULL; + if (e) + for (i = 0; i < n; i++) + print_defaults_1 (e + i, 0); + } + } + exit (1); +} + +#define SSET(F,D,N,H) { N, H, \ + HID_String, 0, 0, { 0, D, 0 }, 0, &Settings.F } +#define ISET(F,D,N,H) { N, H, \ + HID_Integer, 0, 0, { D, 0, 0 }, 0, &Settings.F } +#define BSET(F,D,N,H) { N, H, \ + HID_Boolean, 0, 0, { D, 0, 0 }, 0, &Settings.F } +#define RSET(F,D,N,H) { N, H, \ + HID_Real, 0, 0, { 0, 0, D }, 0, &Settings.F } +#define CSET(F,D,N,H) { N, H, \ + HID_Coord, 0, 0, { 0, 0, 0, D }, 0, &Settings.F } + +#define COLOR(F,D,N,H) { N, H, \ + HID_String, 0, 0, { 0, D, 0 }, 0, &Settings.F } +#define LAYERCOLOR(N,D) { "layer-color-" #N, "Color for layer " #N, \ + HID_String, 0, 0, { 0, D, 0 }, 0, &Settings.LayerColor[N-1] } +#define LAYERNAME(N,D) { "layer-name-" #N, "Name for layer " #N, \ + HID_String, 0, 0, { 0, D, 0 }, 0, &Settings.DefaultLayerName[N-1] } +#define LAYERSELCOLOR(N) { "layer-selected-color-" #N, "Color for layer " #N " when selected", \ + HID_String, 0, 0, { 0, "#00ffff", 0 }, 0, &Settings.LayerSelectedColor[N-1] } + +static int show_help = 0; +static int show_version = 0; +static int show_copyright = 0; +static int show_defaults = 0; +static int show_actions = 0; +static int do_dump_actions = 0; +static char *grid_units; + +HID_Attribute main_attribute_list[] = { + +/* %start-doc options "1 General Options" +@ftable @code +@item --help +Show help on command line options. +@end ftable +%end-doc +*/ + {"help", "Show help on command line options", HID_Boolean, 0, 0, {0, 0, 0}, 0, + &show_help}, + +/* %start-doc options "1 General Options" +@ftable @code +@item --version +Show version. +@end ftable +%end-doc +*/ + {"version", "Show version", HID_Boolean, 0, 0, {0, 0, 0}, 0, &show_version}, + +/* %start-doc options "1 General Options" +@ftable @code +@item --verbose +Be verbose on stdout. +@end ftable +%end-doc +*/ + {"verbose", "Be verbose on stdout", HID_Boolean, 0, 0, {0, 0, 0}, 0, + &Settings.verbose}, + +/* %start-doc options "1 General Options" +@ftable @code +@item --copyright +Show copyright. +@end ftable +%end-doc +*/ + {"copyright", "Show Copyright", HID_Boolean, 0, 0, {0, 0, 0}, 0, + &show_copyright}, + +/* %start-doc options "1 General Options" +@ftable @code +@item --show-defaults +Show option defaults. +@end ftable +%end-doc +*/ + {"show-defaults", "Show option defaults", HID_Boolean, 0, 0, {0, 0, 0}, 0, + &show_defaults}, + +/* %start-doc options "1 General Options" +@ftable @code +@item --show-actions +Show available actions and exit. +@end ftable +%end-doc +*/ + {"show-actions", "Show available actions", HID_Boolean, 0, 0, {0, 0, 0}, 0, + &show_actions}, + +/* %start-doc options "1 General Options" +@ftable @code +@item --dump-actions +Dump actions (for documentation). +@end ftable +%end-doc +*/ + {"dump-actions", "Dump actions (for documentation)", HID_Boolean, 0, 0, + {0, 0, 0}, 0, &do_dump_actions}, + +/* %start-doc options "1 General Options" +@ftable @code +@item --grid-units-mm +Set default grid units. Can be mm or mil. Defaults to mil. +@end ftable +%end-doc +*/ + {"grid-units", "Default grid units (mm|mil)", HID_String, 0, 0, {0, "mil", 0}, + 0, &grid_units}, + +/* %start-doc options "3 Colors" +@ftable @code +@item --black-color +Color value for black. Default: @samp{#000000} +@end ftable +%end-doc +*/ + COLOR (BlackColor, "#000000", "black-color", "color value of 'black'"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --black-color +Color value for white. Default: @samp{#ffffff} +@end ftable +%end-doc +*/ + COLOR (WhiteColor, "#ffffff", "white-color", "color value of 'white'"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --background-color +Background color of the canvas. Default: @samp{#e5e5e5} +@end ftable +%end-doc +*/ + COLOR (BackgroundColor, "#e5e5e5", "background-color", + "color for background"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --crosshair-color +Color of the crosshair. Default: @samp{#ff0000} +@end ftable +%end-doc +*/ + COLOR (CrosshairColor, "#ff0000", "crosshair-color", + "color for the crosshair"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --cross-color +Color of the cross. Default: @samp{#cdcd00} +@end ftable +%end-doc +*/ + COLOR (CrossColor, "#cdcd00", "cross-color", "color of the cross"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --via-color +Color of vias. Default: @samp{#7f7f7f} +@end ftable +%end-doc +*/ + COLOR (ViaColor, "#7f7f7f", "via-color", "color of vias"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --via-selected-color +Color of selected vias. Default: @samp{#00ffff} +@end ftable +%end-doc +*/ + COLOR (ViaSelectedColor, "#00ffff", "via-selected-color", + "color for selected vias"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --pin-color +Color of pins. Default: @samp{#4d4d4d} +@end ftable +%end-doc +*/ + COLOR (PinColor, "#4d4d4d", "pin-color", "color of pins"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --pin-selected-color +Color of selected pins. Default: @samp{#00ffff} +@end ftable +%end-doc +*/ + COLOR (PinSelectedColor, "#00ffff", "pin-selected-color", + "color of selected pins"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --pin-name-color +Color of pin names and pin numbers. Default: @samp{#ff0000} +@end ftable +%end-doc +*/ + COLOR (PinNameColor, "#ff0000", "pin-name-color", + "color for pin names and pin numbers"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --element-color +Color of components. Default: @samp{#000000} +@end ftable +%end-doc +*/ + COLOR (ElementColor, "#000000", "element-color", "color of components"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --rat-color +Color of ratlines. Default: @samp{#b8860b} +@end ftable +%end-doc +*/ + COLOR (RatColor, "#b8860b", "rat-color", "color of ratlines"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --invisible-objects-color +Color of invisible objects. Default: @samp{#cccccc} +@end ftable +%end-doc +*/ + COLOR (InvisibleObjectsColor, "#cccccc", "invisible-objects-color", + "color of invisible objects"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --invisible-mark-color +Color of invisible marks. Default: @samp{#cccccc} +@end ftable +%end-doc +*/ + COLOR (InvisibleMarkColor, "#cccccc", "invisible-mark-color", + "color of invisible marks"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --element-selected-color +Color of selected components. Default: @samp{#00ffff} +@end ftable +%end-doc +*/ + COLOR (ElementSelectedColor, "#00ffff", "element-selected-color", + "color of selected components"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --rat-selected-color +Color of selected rats. Default: @samp{#00ffff} +@end ftable +%end-doc +*/ + COLOR (RatSelectedColor, "#00ffff", "rat-selected-color", + "color of selected rats"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --connected-color +Color to indicate connections. Default: @samp{#00ff00} +@end ftable +%end-doc +*/ + COLOR (ConnectedColor, "#00ff00", "connected-color", + "color to indicate connections"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --off-limit-color +Color of off-canvas area. Default: @samp{#cccccc} +@end ftable +%end-doc +*/ + COLOR (OffLimitColor, "#cccccc", "off-limit-color", + "color of off-canvas area"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --grid-color +Color of the grid. Default: @samp{#ff0000} +@end ftable +%end-doc +*/ + COLOR (GridColor, "#ff0000", "grid-color", "color of the grid"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --layer-color- +Color of layer @code{}, where @code{} is an integer from 1 to 16. +@end ftable +%end-doc +*/ + LAYERCOLOR (1, "#8b2323"), + LAYERCOLOR (2, "#3a5fcd"), + LAYERCOLOR (3, "#104e8b"), + LAYERCOLOR (4, "#cd3700"), + LAYERCOLOR (5, "#548b54"), + LAYERCOLOR (6, "#8b7355"), + LAYERCOLOR (7, "#00868b"), + LAYERCOLOR (8, "#228b22"), + LAYERCOLOR (9, "#8b2323"), + LAYERCOLOR (10, "#3a5fcd"), + LAYERCOLOR (11, "#104e8b"), + LAYERCOLOR (12, "#cd3700"), + LAYERCOLOR (13, "#548b54"), + LAYERCOLOR (14, "#8b7355"), + LAYERCOLOR (15, "#00868b"), + LAYERCOLOR (16, "#228b22"), +/* %start-doc options "3 Colors" +@ftable @code +@item --layer-selected-color- +Color of layer @code{}, when selected. @code{} is an integer from 1 to 16. +@end ftable +%end-doc +*/ + LAYERSELCOLOR (1), + LAYERSELCOLOR (2), + LAYERSELCOLOR (3), + LAYERSELCOLOR (4), + LAYERSELCOLOR (5), + LAYERSELCOLOR (6), + LAYERSELCOLOR (7), + LAYERSELCOLOR (8), + LAYERSELCOLOR (9), + LAYERSELCOLOR (10), + LAYERSELCOLOR (11), + LAYERSELCOLOR (12), + LAYERSELCOLOR (13), + LAYERSELCOLOR (14), + LAYERSELCOLOR (15), + LAYERSELCOLOR (16), + +/* %start-doc options "3 Colors" +@ftable @code +@item --warn-color +Color of offending objects during DRC. Default value is @code{"#ff8000"} +@end ftable +%end-doc +*/ + COLOR (WarnColor, "#ff8000", "warn-color", "color of offending objects during DRC"), + +/* %start-doc options "3 Colors" +@ftable @code +@item --mask-color +Color of the mask layer. Default value is @code{"#ff0000"} +@end ftable +%end-doc +*/ + COLOR (MaskColor, "#ff0000", "mask-color", "color for solder mask"), + + +/* %start-doc options "5 Sizes" +All parameters should be given with an unit. If no unit is given, 1/100 mil +(cmil) will be used. Write units without space to the +number like @code{3mm}, not @code{3 mm}. +Valid Units are: + @table @samp + @item km + Kilometer + @item m + Meter + @item cm + Centimeter + @item mm + Millimeter + @item um + Micrometer + @item nm + Nanometer + @item in + Inch (1in = 0.0254m) + @item mil + Mil (1000mil = 1in) + @item cmil + Centimil (1/100 mil) +@end table + +@ftable @code +@item --via-thickness +Default diameter of vias. Default value is @code{60mil}. +@end ftable +%end-doc +*/ + CSET (ViaThickness, MIL_TO_COORD(60), "via-thickness", + "default diameter of vias in 1/100 mil"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --via-drilling-hole +Default diameter of holes. Default value is @code{28mil}. +@end ftable +%end-doc +*/ + CSET (ViaDrillingHole, MIL_TO_COORD(28), "via-drilling-hole", + "default diameter of holes"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --line-thickness +Default thickness of new lines. Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (LineThickness, MIL_TO_COORD(10), "line-thickness", + "initial thickness of new lines"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --rat-thickness +Thickness of rats. Values from 1 to 19 are fixed width in screen pixels. +Anything larger means PCB units (i.e. 100 means "1 mil"). Default value +is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (RatThickness, MIL_TO_COORD(10), "rat-thickness", "thickness of rat lines"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --keepaway +Default minimum distance between a track and adjacent copper. +Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (Keepaway, MIL_TO_COORD(10), "keepaway", "minimum distance between adjacent copper"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --default-PCB-width +Default width of the canvas. Default value is @code{6000mil}. +@end ftable +%end-doc +*/ + CSET (MaxWidth, MIL_TO_COORD(6000), "default-PCB-width", + "default width of the canvas"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --default-PCB-height +Default height of the canvas. Default value is @code{5000mil}. +@end ftable +%end-doc +*/ + CSET (MaxHeight, MIL_TO_COORD(5000), "default-PCB-height", + "default height of the canvas"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --text-scale +Default text scale. This value is in percent. Default value is @code{100}. +@end ftable +%end-doc +*/ + ISET (TextScale, 100, "text-scale", "default text scale in percent"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --alignment-distance +Specifies the distance between the board outline and alignment targets. +Default value is @code{2mil}. +@end ftable +%end-doc +*/ + CSET (AlignmentDistance, MIL_TO_COORD(2), "alignment-distance", + "distance between the boards outline and alignment targets"), + +/* %start-doc options "7 DRC Options" +All parameters should be given with an unit. If no unit is given, 1/100 mil +(cmil) will be used for backward compability. Valid units are given in section +@ref{Sizes}. +%end-doc +*/ + + +/* %start-doc options "7 DRC Options" +@ftable @code +@item --bloat +Minimum spacing. Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (Bloat, MIL_TO_COORD(10), "bloat", "DRC minimum spacing in 1/100 mil"), + +/* %start-doc options "7 DRC Options" +@ftable @code +@item --shrink +Minimum touching overlap. Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (Shrink, MIL_TO_COORD(10), "shrink", "DRC minimum overlap in 1/100 mils"), + +/* %start-doc options "7 DRC Options" +@ftable @code +@item --min-width +Minimum width of copper. Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (minWid, MIL_TO_COORD(10), "min-width", "DRC minimum copper spacing"), + +/* %start-doc options "7 DRC Options" +@ftable @code +@item --min-silk +Minimum width of lines in silk. Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (minSlk, MIL_TO_COORD(10), "min-silk", "DRC minimum silk width"), + +/* %start-doc options "7 DRC Options" +@ftable @code +@item --min-drill +Minimum diameter of holes. Default value is @code{15mil}. +@end ftable +%end-doc +*/ + CSET (minDrill, MIL_TO_COORD(15), "min-drill", "DRC minimum drill diameter"), + +/* %start-doc options "7 DRC Options" +@ftable @code +@item --min-ring +Minimum width of annular ring. Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (minRing, MIL_TO_COORD(10), "min-ring", "DRC minimum annular ring"), + + +/* %start-doc options "5 Sizes" +@ftable @code +@item --grid +Initial grid size. Default value is @code{10mil}. +@end ftable +%end-doc +*/ + CSET (Grid, MIL_TO_COORD(10), "grid", "Initial grid size in 1/100 mil"), + +/* %start-doc options "5 Sizes" +@ftable @code +@item --minimum polygon area +Minimum polygon area. +@end ftable +%end-doc +*/ + RSET (IsleArea, MIL_TO_COORD(100) * MIL_TO_COORD(100), "minimum polygon area", 0), + + +/* %start-doc options "1 General Options" +@ftable @code +@item --backup-interval +Time between automatic backups in seconds. Set to @code{0} to disable. +The default value is @code{60}. +@end ftable +%end-doc +*/ + ISET (BackupInterval, 60, "backup-interval", + "Time between automatic backups in seconds. Set to 0 to disable"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-1 +Name of the 1st Layer. Default is @code{"top"}. +@end ftable +%end-doc +*/ + LAYERNAME (1, "top"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-2 +Name of the 2nd Layer. Default is @code{"ground"}. +@end ftable +%end-doc +*/ + LAYERNAME (2, "ground"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-3 +Name of the 3nd Layer. Default is @code{"signal2"}. +@end ftable +%end-doc +*/ + LAYERNAME (3, "signal2"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-4 +Name of the 4rd Layer. Default is @code{"signal3"}. +@end ftable +%end-doc +*/ + LAYERNAME (4, "signal3"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-5 +Name of the 5rd Layer. Default is @code{"power"}. +@end ftable +%end-doc +*/ + LAYERNAME (5, "power"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-6 +Name of the 6rd Layer. Default is @code{"bottom"}. +@end ftable +%end-doc +*/ + LAYERNAME (6, "bottom"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-7 +Name of the 7rd Layer. Default is @code{"outline"}. +@end ftable +%end-doc +*/ + LAYERNAME (7, "outline"), + +/* %start-doc options "4 Layer Names" +@ftable @code +@item --layer-name-8 +Name of the 8rd Layer. Default is @code{"spare"}. +@end ftable +%end-doc +*/ + LAYERNAME (8, "spare"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --groups +Layer group string. Defaults to @code{"1,c:2:3:4:5:6,s:7:8"}. +@end ftable +%end-doc +*/ + SSET (Groups, "1,c:2:3:4:5:6,s:7:8", "groups", "Layer group string"), + + +/* %start-doc options "6 Commands" +pcb uses external commands for input output operations. These commands can be +configured at start-up to meet local requirements. The command string may include +special sequences @code{%f}, @code{%p} or @code{%a}. These are replaced when the +command is called. The sequence @code{%f} is replaced by the file name, +@code{%p} gets the path and @code{%a} indicates a package name. +%end-doc +*/ + +/* %start-doc options "6 Commands" +@ftable @code +@item --font-command +Command to load a font. +@end ftable +%end-doc +*/ + SSET (FontCommand, "", "font-command", "Command to load a font"), + +/* %start-doc options "6 Commands" +@ftable @code +@item --file-command +Command to read a file. +@end ftable +%end-doc +*/ + SSET (FileCommand, "", "file-command", "Command to read a file"), + +/* %start-doc options "6 Commands" +@ftable @code +@item --element-command +Command to read a footprint. @* +Defaults to @code{"M4PATH='%p';export M4PATH;echo 'include(%f)' | m4"} +@end ftable +%end-doc +*/ + SSET (ElementCommand, + "M4PATH='%p';export M4PATH;echo 'include(%f)' | " GNUM4, + "element-command", "Command to read a footprint"), + +/* %start-doc options "6 Commands" +@ftable @code +@item --print-file +Command to print to a file. +@end ftable +%end-doc +*/ + SSET (PrintFile, "%f.output", "print-file", "Command to print to a file"), + +/* %start-doc options "6 Commands" +@ftable @code +@item --lib-command-dir +Path to the command that queries the library. +@end ftable +%end-doc +*/ + SSET (LibraryCommandDir, PCBLIBDIR, "lib-command-dir", + "Path to the command that queries the library"), + +/* %start-doc options "6 Commands" +@ftable @code +@item --lib-command +Command to query the library. @* +Defaults to @code{"QueryLibrary.sh '%p' '%f' %a"} +@end ftable +%end-doc +*/ + SSET (LibraryCommand, "QueryLibrary.sh '%p' '%f' %a", + "lib-command", "Command to query the library"), + +/* %start-doc options "6 Commands" +@ftable @code +@item --lib-contents-command +Command to query the contents of the library. @* +Defaults to @code{"ListLibraryContents.sh %p %f"} or, +on Windows builds, an empty string (to disable this feature). +@end ftable +%end-doc +*/ + SSET (LibraryContentsCommand, +#ifdef __WIN32__ + "", +#else + "ListLibraryContents.sh '%p' '%f'", +#endif + "lib-contents-command", "Command to query the contents of the library"), + +/* %start-doc options "5 Paths" +@ftable @code +@item --lib-newlib +Top level directory for the newlib style library. +@end ftable +%end-doc +*/ + SSET (LibraryTree, PCBTREEPATH, "lib-newlib", + "Top level directory for the newlib style library"), + +/* %start-doc options "6 Commands" +@ftable @code +@item --save-command +Command to save to a file. +@end ftable +%end-doc +*/ + SSET (SaveCommand, "", "save-command", "Command to save to a file"), + +/* %start-doc options "5 Paths" +@ftable @code +@item --lib-name +The default filename for the library. +@end ftable +%end-doc +*/ + SSET (LibraryFilename, LIBRARYFILENAME, "lib-name", + "The default filename for the library"), + +/* %start-doc options "5 Paths" +@ftable @code +@item --default-font +The name of the default font. +@end ftable +%end-doc +*/ + SSET (FontFile, "default_font", "default-font", + "File name of default font"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --route-styles +A string that defines the route styles. Defaults to @* +@code{"Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000 + :Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600"} +@end ftable +%end-doc +*/ + SSET (Routes, "Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000" + ":Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600", "route-styles", + "A string that defines the route styles"), + +/* %start-doc options "5 Paths" +@ftable @code +@item --file-path +A colon separated list of directories or commands (starts with '|'). The path +is passed to the program specified in @option{--file-command} together with the selected +filename. +@end ftable +%end-doc +*/ + SSET (FilePath, "", "file-path", 0), + +/* %start-doc options "6 Commands" +@ftable @code +@item --rat-command +Command for reading a netlist. Sequence @code{%f} is replaced by the netlist filename. +@end ftable +%end-doc +*/ + SSET (RatCommand, "", "rat-command", "Command for reading a netlist"), + +/* %start-doc options "5 Paths" +@ftable @code +@item --font-path +A colon separated list of directories to search the default font. Defaults to +the default library path. +@end ftable +%end-doc +*/ + SSET (FontPath, PCBLIBPATH, "font-path", + "Colon separated list of directories to search the default font"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --element-path +A colon separated list of directories or commands (starts with '|'). +The path is passed to the program specified in @option{--element-command}. +@end ftable +%end-doc +*/ + SSET(ElementPath, PCBLIBPATH, "element-path", + "A colon separated list of directories or commands (starts with '|')"), + +/* %start-doc options "5 Paths" +@ftable @code +@item --lib-path +A colon separated list of directories that will be passed to the commands specified +by @option{--element-command} and @option{--element-contents-command}. +@end ftable +%end-doc +*/ + SSET (LibraryPath, PCBLIBPATH, "lib-path", + "A colon separated list of directories"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --action-script +If set, this file is executed at startup. +@end ftable +%end-doc +*/ + SSET (ScriptFilename, 0, "action-script", + "If set, this file is executed at startup"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --action-string +If set, this string of actions is executed at startup. +@end ftable +%end-doc +*/ + SSET (ActionString, 0, "action-string", + "If set, this is executed at startup"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --fab-author +Name of author to be put in the Gerber files. +@end ftable +%end-doc +*/ + SSET (FabAuthor, "", "fab-author", + "Name of author to be put in the Gerber files"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --layer-stack +Initial layer stackup, for setting up an export. A comma separated list of layer +names, layer numbers and layer groups. +@end ftable +%end-doc +*/ + SSET (InitialLayerStack, "", "layer-stack", + "Initial layer stackup, for setting up an export."), + + SSET (MakeProgram, NULL, "make-program", + "Sets the name and optionally full path to a make(3) program"), + SSET (GnetlistProgram, NULL, "gnetlist", + "Sets the name and optionally full path to the gnetlist(3) program"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --pinout-offset-x +Horizontal offset of the pin number display. Defaults to @code{100mil}. +@end ftable +%end-doc +*/ + CSET (PinoutOffsetX, MIL_TO_COORD(1), "pinout-offset-x", + "Horizontal offset of the pin number display in mil"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --pinout-offset-y +Vertical offset of the pin number display. Defaults to @code{100mil}. +@end ftable +%end-doc +*/ + CSET (PinoutOffsetY, MIL_TO_COORD(1), "pinout-offset-y", + "Vertical offset of the pin number display in mil"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --pinout-text-offset-x +Horizontal offset of the pin name display. Defaults to @code{800mil}. +@end ftable +%end-doc +*/ + CSET (PinoutTextOffsetX, MIL_TO_COORD(8), "pinout-text-offset-x", + "Horizontal offset of the pin name display in mil"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --pinout-text-offset-y +Vertical offset of the pin name display. Defaults to @code{-100mil}. +@end ftable +%end-doc +*/ + CSET (PinoutTextOffsetY, MIL_TO_COORD(-1), "pinout-text-offset-y", + "Vertical offset of the pin name display in mil"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --draw-grid +If set, draw the grid at start-up. +@end ftable +%end-doc +*/ + BSET (DrawGrid, 0, "draw-grid", "If set, draw the grid at start-up"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --clear-line +If set, new lines clear polygons. +@end ftable +%end-doc +*/ + BSET (ClearLine, 1, "clear-line", "If set, new lines clear polygons"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --full-poly +If set, new polygons are full ones. +@end ftable +%end-doc +*/ + BSET (FullPoly, 0, "full-poly", 0), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --unique-names +If set, you will not be permitted to change the name of an component to match that +of another component. +@end ftable +%end-doc +*/ + BSET (UniqueNames, 1, "unique-names", "Prevents identical component names"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --snap-pin +If set, pin centers and pad end points are treated as additional grid points +that the cursor can snap to. +@end ftable +%end-doc +*/ + BSET (SnapPin, 1, "snap-pin", + "If set, the cursor snaps to pads and pin centers"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --save-last-command +If set, the last user command is saved. +@end ftable +%end-doc +*/ + BSET (SaveLastCommand, 0, "save-last-command", 0), + +/* %start-doc options "1 General Options" +@ftable @code +@item --save-in-tmp +If set, all data which would otherwise be lost are saved in a temporary file +@file{/tmp/PCB.%i.save} . Sequence @samp{%i} is replaced by the process ID. +@end ftable +%end-doc +*/ + BSET (SaveInTMP, 0, "save-in-tmp", + "When set, all data which would otherwise be lost are saved in /tmp"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --all-direction-lines +Allow all directions, when drawing new lines. +@end ftable +%end-doc +*/ + BSET (AllDirectionLines, 0, "all-direction-lines", + "Allow all directions, when drawing new lines"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --show-number +Pinout shows number. +@end ftable +%end-doc +*/ + BSET (ShowNumber, 0, "show-number", "Pinout shows number"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --reset-after-element +If set, all found connections are reset before a new component is scanned. +@end ftable +%end-doc +*/ + BSET (ResetAfterElement, 1, "reset-after-element", + "If set, all found connections are reset before a new component is scanned"), + +/* %start-doc options "1 General Options" +@ftable @code +@item --ring-bell-finished +Execute the bell command when all rats are routed. +@end ftable +%end-doc +*/ + BSET (RingBellWhenFinished, 0, "ring-bell-finished", + "Execute the bell command when all rats are routed"), +}; + +REGISTER_ATTRIBUTES (main_attribute_list) +/* ---------------------------------------------------------------------- + * post-process settings. + */ + static void settings_post_process () +{ + char *tmps; + + if (Settings.LibraryCommand != NULL && + Settings.LibraryCommand[0] != '\0' && + Settings.LibraryCommand[0] != PCB_DIR_SEPARATOR_C && + Settings.LibraryCommand[0] != '.') + { + Settings.LibraryCommand + = + Concat (Settings.LibraryCommandDir, PCB_DIR_SEPARATOR_S, + Settings.LibraryCommand, + NULL); + } + if (Settings.LibraryContentsCommand != NULL && + Settings.LibraryContentsCommand[0] != '\0' && + Settings.LibraryContentsCommand[0] != PCB_DIR_SEPARATOR_C && + Settings.LibraryContentsCommand[0] != '.') + { + Settings.LibraryContentsCommand + = + Concat (Settings.LibraryCommandDir, PCB_DIR_SEPARATOR_S, + Settings.LibraryContentsCommand, NULL); + } + + if (Settings.LineThickness > MAX_LINESIZE + || Settings.LineThickness < MIN_LINESIZE) + Settings.LineThickness = MIL_TO_COORD(10); + + if (Settings.ViaThickness > MAX_PINORVIASIZE + || Settings.ViaThickness < MIN_PINORVIASIZE) + Settings.ViaThickness = MIL_TO_COORD(40); + + if (Settings.ViaDrillingHole <= 0) + Settings.ViaDrillingHole = + DEFAULT_DRILLINGHOLE * Settings.ViaThickness / 100; + + Settings.MaxWidth = CLAMP (Settings.MaxWidth, MIN_SIZE, MAX_COORD); + Settings.MaxHeight = CLAMP (Settings.MaxHeight, MIN_SIZE, MAX_COORD); + + ParseRouteString (Settings.Routes, &Settings.RouteStyle[0], "cmil"); + + /* + * Make sure we have settings for some various programs we may wish + * to call + */ + if (Settings.MakeProgram == NULL) { + tmps = getenv ("PCB_MAKE_PROGRAM"); + if (tmps != NULL) + Settings.MakeProgram = strdup (tmps); + } + if (Settings.MakeProgram == NULL) { + Settings.MakeProgram = strdup ("make"); + } + + if (Settings.GnetlistProgram == NULL) { + tmps = getenv ("PCB_GNETLIST"); + if (tmps != NULL) + Settings.GnetlistProgram = strdup (tmps); + } + if (Settings.GnetlistProgram == NULL) { + Settings.GnetlistProgram = strdup ("gnetlist"); + } + + if (grid_units) + Settings.grid_unit = get_unit_struct (grid_units); + if (!grid_units || Settings.grid_unit == NULL) + Settings.grid_unit = get_unit_struct ("mil"); + + Settings.increments = get_increments_struct (Settings.grid_unit->suffix); +} + +/* ---------------------------------------------------------------------- + * Print help or version messages. + */ + +static void +print_version () +{ + printf ("PCB version %s\n", VERSION); + exit (0); +} + +/* ---------------------------------------------------------------------- + * Figure out the canonical name of the executed program + * and fix up the defaults for various paths + */ +char *bindir = NULL; +char *exec_prefix = NULL; +char *pcblibdir = NULL; +char *pcblibpath = NULL; +char *pcbtreedir = NULL; +char *pcbtreepath = NULL; +char *homedir = NULL; + +static void +InitPaths (char *argv0) +{ + size_t l; + int i; + int haspath; + char *t1, *t2; + int found_bindir = 0; + + /* see if argv0 has enough of a path to let lrealpath give the + * real path. This should be the case if you invoke pcb with + * something like /usr/local/bin/pcb or ./pcb or ./foo/pcb + * but if you just use pcb and it exists in your path, you'll + * just get back pcb again. + */ + + haspath = 0; + for (i = 0; i < strlen (argv0) ; i++) + { + if (argv0[i] == PCB_DIR_SEPARATOR_C) + haspath = 1; + } + +#ifdef DEBUG + printf ("InitPaths (%s): haspath = %d\n", argv0, haspath); +#endif + + if (haspath) + { + bindir = strdup (lrealpath (argv0)); + found_bindir = 1; + } + else + { + char *path, *p, *tmps; + struct stat sb; + int r; + + tmps = getenv ("PATH"); + + if (tmps != NULL) + { + path = strdup (tmps); + + /* search through the font path for a font file */ + for (p = strtok (path, PCB_PATH_DELIMETER); p && *p; + p = strtok (NULL, PCB_PATH_DELIMETER)) + { +#ifdef DEBUG + printf ("Looking for %s in %s\n", argv0, p); +#endif + if ( (tmps = (char *)malloc ( (strlen (argv0) + strlen (p) + 2) * sizeof (char))) == NULL ) + { + fprintf (stderr, "InitPaths(): malloc failed\n"); + exit (1); + } + sprintf (tmps, "%s%s%s", p, PCB_DIR_SEPARATOR_S, argv0); + r = stat (tmps, &sb); + if (r == 0) + { +#ifdef DEBUG + printf ("Found it: \"%s\"\n", tmps); +#endif + bindir = lrealpath (tmps); + found_bindir = 1; + free (tmps); + break; + } + free (tmps); + } + free (path); + } + } + +#ifdef DEBUG + printf ("InitPaths(): bindir = \"%s\"\n", bindir); +#endif + + if (found_bindir) + { + /* strip off the executible name leaving only the path */ + t2 = NULL; + t1 = strchr (bindir, PCB_DIR_SEPARATOR_C); + while (t1 != NULL && *t1 != '\0') + { + t2 = t1; + t1 = strchr (t2 + 1, PCB_DIR_SEPARATOR_C); + } + if (t2 != NULL) + *t2 = '\0'; + +#ifdef DEBUG + printf ("After stripping off the executible name, we found\n"); + printf ("bindir = \"%s\"\n", bindir); +#endif + } + else + { + /* we have failed to find out anything from argv[0] so fall back to the original + * install prefix + */ + bindir = strdup (BINDIR); + } + + /* now find the path to exec_prefix */ + l = strlen (bindir) + 1 + strlen (BINDIR_TO_EXECPREFIX) + 1; + if ( (exec_prefix = (char *) malloc (l * sizeof (char) )) == NULL ) + { + fprintf (stderr, "InitPaths(): malloc failed\n"); + exit (1); + } + sprintf (exec_prefix, "%s%s%s", bindir, PCB_DIR_SEPARATOR_S, + BINDIR_TO_EXECPREFIX); + + /* now find the path to PCBLIBDIR */ + l = strlen (bindir) + 1 + strlen (BINDIR_TO_PCBLIBDIR) + 1; + if ( (pcblibdir = (char *) malloc (l * sizeof (char) )) == NULL ) + { + fprintf (stderr, "InitPaths(): malloc failed\n"); + exit (1); + } + sprintf (pcblibdir, "%s%s%s", bindir, PCB_DIR_SEPARATOR_S, + BINDIR_TO_PCBLIBDIR); + + /* and the path to PCBTREEDIR */ + l = strlen (bindir) + 1 + strlen (BINDIR_TO_PCBTREEDIR) + 1; + if ( (pcbtreedir = (char *) malloc (l * sizeof (char) )) == NULL ) + { + fprintf (stderr, "InitPaths(): malloc failed\n"); + exit (1); + } + sprintf (pcbtreedir, "%s%s%s", bindir, PCB_DIR_SEPARATOR_S, + BINDIR_TO_PCBTREEDIR); + + /* and the search path including PCBLIBDIR */ + l = strlen (pcblibdir) + 3; + if ( (pcblibpath = (char *) malloc (l * sizeof (char) )) == NULL ) + { + fprintf (stderr, "InitPaths(): malloc failed\n"); + exit (1); + } + sprintf (pcblibpath, ".%s%s", PCB_PATH_DELIMETER, pcblibdir); + + /* and the newlib search path */ + l = strlen (pcblibdir) + 1 + strlen (pcbtreedir) + + strlen ("pcblib-newlib") + 2; + if ( (pcbtreepath = (char *) malloc (l * sizeof (char) )) == NULL ) + { + fprintf (stderr, "InitPaths(): malloc failed\n"); + exit (1); + } + sprintf (pcbtreepath, "%s%s%s%spcblib-newlib", pcbtreedir, + PCB_PATH_DELIMETER, pcblibdir, + PCB_DIR_SEPARATOR_S); + +#ifdef DEBUG + printf ("bindir = %s\n", bindir); + printf ("pcblibdir = %s\n", pcblibdir); + printf ("pcblibpath = %s\n", pcblibpath); + printf ("pcbtreedir = %s\n", pcbtreedir); + printf ("pcbtreepath = %s\n", pcbtreepath); +#endif + + l = sizeof (main_attribute_list) / sizeof (main_attribute_list[0]); + for (i = 0; i < l ; i++) + { + if (NSTRCMP (main_attribute_list[i].name, "lib-command-dir") == 0) + { + main_attribute_list[i].default_val.str_value = pcblibdir; + } + + if ( (NSTRCMP (main_attribute_list[i].name, "font-path") == 0) + || (NSTRCMP (main_attribute_list[i].name, "element-path") == 0) + || (NSTRCMP (main_attribute_list[i].name, "lib-path") == 0) ) + { + main_attribute_list[i].default_val.str_value = pcblibpath; + } + + if (NSTRCMP (main_attribute_list[i].name, "lib-newlib") == 0) + { + main_attribute_list[i].default_val.str_value = pcbtreepath; + } + + } + + { + char *tmps; + + tmps = getenv ("HOME"); + + if (tmps == NULL) { + tmps = getenv ("USERPROFILE"); + } + + if (tmps != NULL) { + homedir = strdup (tmps); + } else { + homedir = NULL; + } + + } +} + +/* ---------------------------------------------------------------------- + * main program + */ + +char *program_name = 0; +char *program_basename = 0; +char *program_directory = 0; + +#include "dolists.h" + +int +main (int argc, char *argv[]) +{ + int i; + + /* init application: + * - make program name available for error handlers + * - evaluate special options + * - initialize toplevel shell and resources + * - create an empty PCB with default symbols + * - initialize all other widgets + * - update screen and get size of drawing area + * - evaluate command-line arguments + * - register 'call on exit()' function + */ + +#include "core_lists.h" + setbuf (stdout, 0); + InitPaths (argv[0]); + + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + textdomain(GETTEXT_PACKAGE); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + setlocale(LC_ALL,""); + + srand ( time(NULL) ); /* Set seed for rand() */ + + initialize_units(); + polygon_init (); + hid_init (); + + hid_load_settings (); + + program_name = argv[0]; + program_basename = strrchr (program_name, PCB_DIR_SEPARATOR_C); + if (program_basename) + { + program_directory = strdup (program_name); + *strrchr (program_directory, PCB_DIR_SEPARATOR_C) = 0; + program_basename++; + } + else + { + program_directory = "."; + program_basename = program_name; + } + Progname = program_basename; + + /* Print usage or version if requested. Then exit. */ + if (argc > 1 && + (strcmp (argv[1], "-h") == 0 || + strcmp (argv[1], "-?") == 0 || + strcmp (argv[1], "--help") == 0)) + usage (); + if (argc > 1 && strcmp (argv[1], "-V") == 0) + print_version (); + /* Export pcb from command line if requested. */ + if (argc > 1 && strcmp (argv[1], "-p") == 0) + { + exporter = gui = hid_find_printer (); + argc--; + argv++; + } + else if (argc > 2 && strcmp (argv[1], "-x") == 0) + { + exporter = gui = hid_find_exporter (argv[2]); + argc -= 2; + argv += 2; + } + /* Otherwise start GUI. */ + else + gui = hid_find_gui (); + + /* Exit with error if GUI failed to start. */ + if (!gui) + exit (1); + + /* Set up layers. */ + for (i = 0; i < MAX_LAYER; i++) + { + char buf[20]; + sprintf (buf, "signal%d", i + 1); + Settings.DefaultLayerName[i] = strdup (buf); + Settings.LayerColor[i] = "#c49350"; + Settings.LayerSelectedColor[i] = "#00ffff"; + } + + gui->parse_arguments (&argc, &argv); + + if (show_help || (argc > 1 && argv[1][0] == '-')) + usage (); + if (show_version) + print_version (); + if (show_defaults) + print_defaults (); + if (show_copyright) + copyright (); + + settings_post_process (); + + + if (show_actions) + { + print_actions (); + exit (0); + } + + if (do_dump_actions) + { + extern void dump_actions (void); + dump_actions (); + exit (0); + } + + /* Create a new PCB object in memory */ + PCB = CreateNewPCB (true); + PCB->Data->LayerN = DEF_LAYER; + ParseGroupString (Settings.Groups, &PCB->LayerGroups, DEF_LAYER); + /* Add silk layers to newly created PCB */ + CreateNewPCBPost (PCB, 1); + if (argc > 1) + command_line_pcb = argv[1]; + + ResetStackAndVisibility (); + + if (gui->gui) + InitCrosshair (); + InitHandler (); + InitBuffers (); + SetMode (ARROW_MODE); + + if (command_line_pcb) + { + /* keep filename even if initial load command failed; + * file might not exist + */ + if (LoadPCB (command_line_pcb)) + PCB->Filename = strdup (command_line_pcb); + } + + if (Settings.InitialLayerStack + && Settings.InitialLayerStack[0]) + { + LayerStringToLayerStack (Settings.InitialLayerStack); + } + + /* 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 (); + + /* Register a function to be called when the program terminates. + * This makes sure that data is saved even if LEX/YACC routines + * abort the program. + * If the OS doesn't have at least one of them, + * the critical sections will be handled by parse_l.l + */ + atexit (EmergencySave); + + /* read the library file and display it if it's not empty + */ + if (!ReadLibraryContents () && Library.MenuN) + hid_action ("LibraryChanged"); + +#ifdef HAVE_LIBSTROKE + stroke_init (); +#endif + + if (Settings.ScriptFilename) + { + Message (_("Executing startup script file %s\n"), + Settings.ScriptFilename); + hid_actionl ("ExecuteFile", Settings.ScriptFilename, NULL); + } + if (Settings.ActionString) + { + Message (_("Executing startup action %s\n"), Settings.ActionString); + hid_parse_actions (Settings.ActionString); + } + + if (gui->printer || gui->exporter) + { + gui->do_export (0); + exit (0); + } + +#if HAVE_DBUS + pcb_dbus_setup(); +#endif + + EnableAutosave (); + +#ifdef DEBUG + printf ("Settings.LibraryCommandDir = \"%s\"\n", + Settings.LibraryCommandDir); + printf ("Settings.FontPath = \"%s\"\n", + Settings.FontPath); + printf ("Settings.ElementPath = \"%s\"\n", + Settings.ElementPath); + printf ("Settings.LibraryPath = \"%s\"\n", + Settings.LibraryPath); + printf ("Settings.LibraryTree = \"%s\"\n", + Settings.LibraryTree); + printf ("Settings.MakeProgram = \"%s\"\n", + UNKNOWN (Settings.MakeProgram)); + printf ("Settings.GnetlistProgram = \"%s\"\n", + UNKNOWN (Settings.GnetlistProgram)); +#endif + + gui->do_export (0); +#if HAVE_DBUS + pcb_dbus_finish(); +#endif + + return (0); +} + Index: tags/1.0.5/.pc/applied-patches =================================================================== --- tags/1.0.5/.pc/applied-patches (nonexistent) +++ tags/1.0.5/.pc/applied-patches (revision 953) @@ -0,0 +1,9 @@ +fix_typo.diff +outdated_config.diff +fix_pan_action.diff +pcbtest_paths.diff +default_GtkFileChooser_cwd.diff +disable_hid_png3_test.diff +0001-Fixed-command-line-batch-output-for-some-exporters.patch +drop_check_global_included.patch +fix_CPPFLAGS.diff Index: tags/1.0.5/.pc/default_GtkFileChooser_cwd.diff/po/POTFILES.skip =================================================================== --- tags/1.0.5/.pc/default_GtkFileChooser_cwd.diff/po/POTFILES.skip (nonexistent) +++ tags/1.0.5/.pc/default_GtkFileChooser_cwd.diff/po/POTFILES.skip (revision 953) @@ -0,0 +1 @@ +.pc/fix_pan_action.diff/src/hid/gtk/gtkhid-main.c Index: tags/1.0.5/.pc/default_GtkFileChooser_cwd.diff/src/hid/gtk/gtkhid-main.c =================================================================== --- tags/1.0.5/.pc/default_GtkFileChooser_cwd.diff/src/hid/gtk/gtkhid-main.c (nonexistent) +++ tags/1.0.5/.pc/default_GtkFileChooser_cwd.diff/src/hid/gtk/gtkhid-main.c (revision 953) @@ -0,0 +1,2190 @@ +/* $Id$ */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#ifdef HAVE_STRING_H +#include +#endif +#include +#include + + +#include "action.h" +#include "crosshair.h" +#include "error.h" +#include "../hidint.h" +#include "gui.h" +#include "hid/common/hidnogui.h" +#include "hid/common/draw_helpers.h" +#include "pcb-printf.h" + +#ifdef HAVE_LIBDMALLOC +#include +#endif + + +RCSID ("$Id$"); + + +static void +pan_common (GHidPort *port) +{ + int event_x, event_y; + + /* We need to fix up the PCB coordinates corresponding to the last + * event so convert it back to event coordinates temporarily. */ + ghid_pcb_to_event_coords (gport->pcb_x, gport->pcb_y, &event_x, &event_y); + + /* Don't pan so far the board is completely off the screen */ + port->view.x0 = MAX (-port->view.width, port->view.x0); + port->view.y0 = MAX (-port->view.height, port->view.y0); + port->view.x0 = MIN ( port->view.x0, PCB->MaxWidth); + port->view.y0 = MIN ( port->view.y0, PCB->MaxHeight); + + /* Fix up noted event coordinates to match where we clamped. Alternatively + * we could call ghid_note_event_location (NULL); to get a new pointer + * location, but this costs us an xserver round-trip (on X11 platforms) + */ + ghid_event_to_pcb_coords (event_x, event_y, &gport->pcb_x, &gport->pcb_y); + + ghidgui->adjustment_changed_holdoff = TRUE; + gtk_range_set_value (GTK_RANGE (ghidgui->h_range), gport->view.x0); + gtk_range_set_value (GTK_RANGE (ghidgui->v_range), gport->view.y0); + ghidgui->adjustment_changed_holdoff = FALSE; + + ghid_port_ranges_changed(); +} + +static void +ghid_pan_view_abs (Coord pcb_x, Coord 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; + + pan_common (gport); +} + +void +ghid_pan_view_rel (Coord dx, Coord dy) +{ + gport->view.x0 += dx; + gport->view.y0 += dy; + + pan_common (gport); +} + + +/* gport->view.coord_per_px: + * zoom value is PCB units per screen pixel. Larger numbers mean zooming + * out - the largest value means you are looking at the whole board. + * + * gport->view_width and gport->view_height are in PCB coordinates + */ + +#define ALLOW_ZOOM_OUT_BY 10 /* Arbitrary, and same as the lesstif HID */ +static void +ghid_zoom_view_abs (Coord center_x, Coord center_y, double new_zoom) +{ + double min_zoom, max_zoom; + double xtmp, ytmp; + + /* Limit the "minimum" zoom constant (maximum zoom), at 1 pixel per PCB + * unit, and set the "maximum" zoom constant (minimum zoom), such that + * the entire board just fits inside the viewport + */ + min_zoom = 1; + max_zoom = MAX (PCB->MaxWidth / gport->width, + PCB->MaxHeight / gport->height) * ALLOW_ZOOM_OUT_BY; + new_zoom = MIN (MAX (min_zoom, new_zoom), max_zoom); + + if (gport->view.coord_per_px == new_zoom) + return; + + xtmp = (SIDE_X (center_x) - gport->view.x0) / (double)gport->view.width; + ytmp = (SIDE_Y (center_y) - gport->view.y0) / (double)gport->view.height; + + gport->view.coord_per_px = new_zoom; + pixel_slop = new_zoom; + ghid_port_ranges_scale (); + + gport->view.x0 = SIDE_X (center_x) - xtmp * gport->view.width; + gport->view.y0 = SIDE_Y (center_y) - ytmp * gport->view.height; + + pan_common (gport); + + ghid_set_status_line_label (); +} + +static void +ghid_zoom_view_rel (Coord center_x, Coord center_y, double factor) +{ + ghid_zoom_view_abs (center_x, center_y, gport->view.coord_per_px * factor); +} + +static void +ghid_zoom_view_fit (void) +{ + ghid_pan_view_abs (SIDE_X (0), SIDE_Y (0), 0, 0); + 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, bool flip_x, bool flip_y) +{ + int widget_x, widget_y; + + /* Work out where on the screen the flip point is */ + ghid_pcb_to_event_coords (center_x, center_y, &widget_x, &widget_y); + + gport->view.flip_x = gport->view.flip_x != flip_x; + gport->view.flip_y = gport->view.flip_y != flip_y; + + /* Pan the board so the center location remains in the same place */ + ghid_pan_view_abs (center_x, center_y, widget_x, widget_y); + + ghid_invalidate_all (); +} + +/* ------------------------------------------------------------ */ + +static const char zoom_syntax[] = +"Zoom()\n" +"Zoom(factor)"; + + +static const char zoom_help[] = +N_("Various zoom factor changes."); + +/* %start-doc actions Zoom +Changes the zoom (magnification) of the view of the board. If no +arguments are passed, the view is scaled such that the board just fits +inside the visible window (i.e. ``view all''). Otherwise, +@var{factor} specifies a change in zoom factor. It may be prefixed by +@code{+}, @code{-}, or @code{=} to change how the zoom factor is +modified. The @var{factor} is a floating point number, such as +@code{1.5} or @code{0.75}. + +@table @code + +@item +@var{factor} +Values greater than 1.0 cause the board to be drawn smaller; more of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn bigger; less of the board will be visible. + +@item -@var{factor} +Values greater than 1.0 cause the board to be drawn bigger; less of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn smaller; more of the board will be visible. + +@item =@var{factor} + +The @var{factor} is an absolute zoom factor; the unit for this value +is "PCB units per screen pixel". Since PCB units are 0.01 mil, a +@var{factor} of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, +about the actual resolution of most screens - resulting in an "actual +size" board. Similarly, a @var{factor} of 100 gives you a 10x actual +size. + +@end table + +Note that zoom factors of zero are silently ignored. + + + +%end-doc */ + +static int +Zoom (int argc, char **argv, Coord x, Coord y) +{ + const char *vp; + double v; + + if (argc > 1) + AFAIL (zoom); + + if (argc < 1) + { + ghid_zoom_view_fit (); + return 0; + } + + vp = argv[0]; + if (*vp == '+' || *vp == '-' || *vp == '=') + vp++; + v = g_ascii_strtod (vp, 0); + if (v <= 0) + return 1; + switch (argv[0][0]) + { + case '-': + ghid_zoom_view_rel (x, y, 1 / v); + break; + default: + case '+': + ghid_zoom_view_rel (x, y, v); + break; + case '=': + ghid_zoom_view_abs (x, y, v); + break; + } + + return 0; +} + +/* ------------------------------------------------------------ */ + +void +ghid_calibrate (double xval, double yval) +{ + printf (_("ghid_calibrate() -- not implemented\n")); +} + +static int ghid_gui_is_up = 0; + +void +ghid_notify_gui_is_up () +{ + ghid_gui_is_up = 1; +} + +int +ghid_shift_is_pressed () +{ + GdkModifierType mask; + GHidPort *out = &ghid_port; + + if( ! ghid_gui_is_up ) + return 0; + + gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area), + NULL, NULL, &mask); + return (mask & GDK_SHIFT_MASK) ? TRUE : FALSE; +} + +int +ghid_control_is_pressed () +{ + GdkModifierType mask; + GHidPort *out = &ghid_port; + + if( ! ghid_gui_is_up ) + return 0; + + gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area), + NULL, NULL, &mask); + return (mask & GDK_CONTROL_MASK) ? TRUE : FALSE; +} + +int +ghid_mod1_is_pressed () +{ + GdkModifierType mask; + GHidPort *out = &ghid_port; + + if( ! ghid_gui_is_up ) + return 0; + + gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area), + NULL, NULL, &mask); +#ifdef __APPLE__ + return (mask & ( 1 << 13 ) ) ? TRUE : FALSE; // The option key is not MOD1, although it should be... +#else + return (mask & GDK_MOD1_MASK) ? TRUE : FALSE; +#endif +} + +void +ghid_set_crosshair (int x, int y, int action) +{ + GdkDisplay *display; + GdkScreen *screen; + int offset_x, offset_y; + int widget_x, widget_y; + int pointer_x, pointer_y; + Coord pcb_x, pcb_y; + + if (gport->crosshair_x != x || gport->crosshair_y != y) + { + ghid_set_cursor_position_labels (); + gport->crosshair_x = x; + gport->crosshair_y = y; + + /* FIXME - does this trigger the idle_proc stuff? It is in the + * lesstif HID. Maybe something is needed here? + * + * need_idle_proc (); + */ + } + + if (action != HID_SC_PAN_VIEWPORT && + action != HID_SC_WARP_POINTER) + return; + + /* Find out where the drawing area is on the screen. gdk_display_get_pointer + * and gdk_display_warp_pointer work relative to the whole display, whilst + * our coordinates are relative to the drawing area origin. + */ + gdk_window_get_origin (gtk_widget_get_window (gport->drawing_area), + &offset_x, &offset_y); + display = gdk_display_get_default (); + + switch (action) { + case HID_SC_PAN_VIEWPORT: + /* Pan the board in the viewport so that the crosshair (who's location + * relative on the board was set above) lands where the pointer is. + * We pass the request to pan a particular point on the board to a + * given widget coordinate of the viewport into the rendering code + */ + + /* Find out where the pointer is relative to the display */ + gdk_display_get_pointer (display, NULL, &pointer_x, &pointer_y, NULL); + + widget_x = pointer_x - offset_x; + widget_y = pointer_y - offset_y; + + ghid_event_to_pcb_coords (widget_x, widget_y, &pcb_x, &pcb_y); + ghid_pan_view_abs (pcb_x, pcb_y, widget_x, widget_y); + + /* Just in case we couldn't pan the board the whole way, + * we warp the pointer to where the crosshair DID land. + */ + /* Fall through */ + + case HID_SC_WARP_POINTER: + screen = gdk_display_get_default_screen (display); + + ghid_pcb_to_event_coords (x, y, &widget_x, &widget_y); + + pointer_x = offset_x + widget_x; + pointer_y = offset_y + widget_y; + + gdk_display_warp_pointer (display, screen, pointer_x, pointer_y); + + break; + } +} + +typedef struct +{ + void (*func) (hidval); + guint id; + hidval user_data; +} +GuiTimer; + + /* We need a wrapper around the hid timer because a gtk timer needs + | to return FALSE else the timer will be restarted. + */ +static gboolean +ghid_timer (GuiTimer * timer) +{ + (*timer->func) (timer->user_data); + ghid_mode_cursor (Settings.Mode); + return FALSE; /* Turns timer off */ +} + +hidval +ghid_add_timer (void (*func) (hidval user_data), + unsigned long milliseconds, hidval user_data) +{ + GuiTimer *timer = g_new0 (GuiTimer, 1); + hidval ret; + + timer->func = func; + timer->user_data = user_data; + timer->id = g_timeout_add (milliseconds, (GSourceFunc) ghid_timer, timer); + ret.ptr = (void *) timer; + return ret; +} + +void +ghid_stop_timer (hidval timer) +{ + void *ptr = timer.ptr; + + g_source_remove (((GuiTimer *) ptr)->id); + g_free( ptr ); +} + +typedef struct +{ + void (*func) ( hidval, int, unsigned int, hidval ); + hidval user_data; + int fd; + GIOChannel *channel; + gint id; +} +GuiWatch; + + /* We need a wrapper around the hid file watch to pass the correct flags + */ +static gboolean +ghid_watch (GIOChannel *source, GIOCondition condition, gpointer data) +{ + unsigned int pcb_condition = 0; + hidval x; + GuiWatch *watch = (GuiWatch*)data; + + if (condition & G_IO_IN) + pcb_condition |= PCB_WATCH_READABLE; + if (condition & G_IO_OUT) + pcb_condition |= PCB_WATCH_WRITABLE; + if (condition & G_IO_ERR) + pcb_condition |= PCB_WATCH_ERROR; + if (condition & G_IO_HUP) + pcb_condition |= PCB_WATCH_HANGUP; + + x.ptr = (void *) watch; + watch->func (x, watch->fd, pcb_condition, watch->user_data); + ghid_mode_cursor (Settings.Mode); + + 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) +{ + GuiWatch *watch = g_new0 (GuiWatch, 1); + hidval ret; + unsigned int glib_condition = 0; + + if (condition & PCB_WATCH_READABLE) + glib_condition |= G_IO_IN; + if (condition & PCB_WATCH_WRITABLE) + glib_condition |= G_IO_OUT; + if (condition & PCB_WATCH_ERROR) + glib_condition |= G_IO_ERR; + if (condition & PCB_WATCH_HANGUP) + glib_condition |= G_IO_HUP; + + watch->func = func; + watch->user_data = user_data; + watch->fd = fd; + watch->channel = g_io_channel_unix_new( fd ); + watch->id = g_io_add_watch( watch->channel, (GIOCondition)glib_condition, ghid_watch, watch ); + + ret.ptr = (void *) watch; + return ret; +} + +void +ghid_unwatch_file (hidval data) +{ + GuiWatch *watch = (GuiWatch*)data.ptr; + + g_io_channel_shutdown( watch->channel, TRUE, NULL ); + g_io_channel_unref( watch->channel ); + g_free( watch ); +} + +typedef struct +{ + GSource source; + void (*func) (hidval user_data); + hidval user_data; +} BlockHookSource; + +static gboolean ghid_block_hook_prepare (GSource *source, + gint *timeout); +static gboolean ghid_block_hook_check (GSource *source); +static gboolean ghid_block_hook_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data); + +static GSourceFuncs ghid_block_hook_funcs = { + ghid_block_hook_prepare, + ghid_block_hook_check, + ghid_block_hook_dispatch, + NULL // No destroy notification +}; + +static gboolean +ghid_block_hook_prepare (GSource *source, + gint *timeout) +{ + hidval data = ((BlockHookSource *)source)->user_data; + ((BlockHookSource *)source)->func( data ); + return FALSE; +} + +static gboolean +ghid_block_hook_check (GSource *source) +{ + return FALSE; +} + +static gboolean +ghid_block_hook_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data) +{ + return FALSE; +} + +static hidval +ghid_add_block_hook (void (*func) (hidval data), + hidval user_data) +{ + hidval ret; + BlockHookSource *source; + + source = (BlockHookSource *)g_source_new (&ghid_block_hook_funcs, sizeof( BlockHookSource )); + + source->func = func; + source->user_data = user_data; + + g_source_attach ((GSource *)source, NULL); + + ret.ptr = (void *) source; + return ret; +} + +static void +ghid_stop_block_hook (hidval mlpoll) +{ + GSource *source = (GSource *)mlpoll.ptr; + g_source_destroy( source ); +} + +int +ghid_confirm_dialog (char *msg, ...) +{ + int rv = 0; + va_list ap; + char *cancelmsg = NULL, *okmsg = NULL; + static gint x = -1, y = -1; + GtkWidget *dialog; + GHidPort *out = &ghid_port; + + va_start (ap, msg); + cancelmsg = va_arg (ap, char *); + okmsg = va_arg (ap, char *); + va_end (ap); + + if (!cancelmsg) + { + cancelmsg = _("_Cancel"); + okmsg = _("_OK"); + } + + dialog = gtk_message_dialog_new (GTK_WINDOW (out->top_window), + (GtkDialogFlags) (GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + "%s", msg); + gtk_dialog_add_button (GTK_DIALOG (dialog), + cancelmsg, GTK_RESPONSE_CANCEL); + if (okmsg) + { + gtk_dialog_add_button (GTK_DIALOG (dialog), + okmsg, GTK_RESPONSE_OK); + } + + if(x != -1) { + gtk_window_move(GTK_WINDOW (dialog), x, y); + } + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) + rv = 1; + + gtk_window_get_position(GTK_WINDOW (dialog), &x, &y); + + gtk_widget_destroy (dialog); + return rv; +} + +int +ghid_close_confirm_dialog () +{ + switch (ghid_dialog_close_confirm ()) + { + case GUI_DIALOG_CLOSE_CONFIRM_SAVE: + { + if (hid_actionl ("Save", NULL)) + { /* Save failed */ + return 0; /* Cancel */ + } else { + return 1; /* Close */ + } + } + case GUI_DIALOG_CLOSE_CONFIRM_NOSAVE: + { + return 1; /* Close */ + } + case GUI_DIALOG_CLOSE_CONFIRM_CANCEL: + default: + { + return 0; /* Cancel */ + } + } +} + +void +ghid_report_dialog (char *title, char *msg) +{ + ghid_dialog_report (title, msg); +} + +char * +ghid_prompt_for (const char *msg, const char *default_string) +{ + char *rv; + + rv = ghid_dialog_input (msg, default_string); + return rv; +} + +/* FIXME -- implement a proper file select dialog */ +#ifdef FIXME +char * +ghid_fileselect (const char *title, const char *descr, + char *default_file, char *default_ext, + const char *history_tag, int flags) +{ + char *rv; + + rv = ghid_dialog_input (title, default_file); + return rv; +} +#endif + +void +ghid_show_item (void *item) +{ + ghid_pinout_window_show (&ghid_port, (ElementTypePtr) item); +} + +void +ghid_beep () +{ + gdk_beep (); +} + +struct progress_dialog +{ + GtkWidget *dialog; + GtkWidget *message; + GtkWidget *progress; + gint response_id; + GMainLoop *loop; + gboolean destroyed; + gboolean started; + GTimer *timer; + + gulong response_handler; + gulong destroy_handler; + gulong delete_handler; +}; + +static void +run_response_handler (GtkDialog *dialog, + gint response_id, + gpointer data) +{ + struct progress_dialog *pd = data; + + pd->response_id = response_id; +} + +static gint +run_delete_handler (GtkDialog *dialog, + GdkEventAny *event, + gpointer data) +{ + struct progress_dialog *pd = data; + + pd->response_id = GTK_RESPONSE_DELETE_EVENT; + + return TRUE; /* Do not destroy */ +} + +static void +run_destroy_handler (GtkDialog *dialog, gpointer data) +{ + struct progress_dialog *pd = data; + + pd->destroyed = TRUE; +} + +static struct progress_dialog * +make_progress_dialog (void) +{ + struct progress_dialog *pd; + GtkWidget *content_area; + GtkWidget *alignment; + GtkWidget *vbox; + + pd = g_new0 (struct progress_dialog, 1); + pd->response_id = GTK_RESPONSE_NONE; + + pd->dialog = gtk_dialog_new_with_buttons (_("Progress"), + GTK_WINDOW (gport->top_window), + /* Modal so nothing else can get events whilst + the main mainloop isn't running */ + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + NULL); + + gtk_window_set_deletable (GTK_WINDOW (pd->dialog), FALSE); + gtk_window_set_skip_pager_hint (GTK_WINDOW (pd->dialog), TRUE); + gtk_window_set_skip_taskbar_hint (GTK_WINDOW (pd->dialog), TRUE); + gtk_widget_set_size_request (pd->dialog, 300, -1); + + pd->message = gtk_label_new (NULL); + gtk_misc_set_alignment (GTK_MISC (pd->message), 0., 0.); + + pd->progress = gtk_progress_bar_new (); + gtk_widget_set_size_request (pd->progress, -1, 26); + + vbox = gtk_vbox_new (false, 0); + gtk_box_pack_start (GTK_BOX (vbox), pd->message, true, true, 8); + gtk_box_pack_start (GTK_BOX (vbox), pd->progress, false, true, 8); + + alignment = gtk_alignment_new (0., 0., 1., 1.); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 8, 8, 8, 8); + gtk_container_add (GTK_CONTAINER (alignment), vbox); + + content_area = gtk_dialog_get_content_area (GTK_DIALOG (pd->dialog)); + gtk_box_pack_start (GTK_BOX (content_area), alignment, true, true, 0); + + gtk_widget_show_all (alignment); + + g_object_ref (pd->dialog); + gtk_window_present (GTK_WINDOW (pd->dialog)); + + pd->response_handler = + g_signal_connect (pd->dialog, "response", + G_CALLBACK (run_response_handler), pd); + pd->delete_handler = + g_signal_connect (pd->dialog, "delete-event", + G_CALLBACK (run_delete_handler), pd); + pd->destroy_handler = + g_signal_connect (pd->dialog, "destroy", + G_CALLBACK (run_destroy_handler), pd); + + pd->loop = g_main_loop_new (NULL, FALSE); + pd->timer = g_timer_new (); + + return pd; +} + +static void +destroy_progress_dialog (struct progress_dialog *pd) +{ + if (pd == NULL) + return; + + if (!pd->destroyed) + { + g_signal_handler_disconnect (pd->dialog, pd->response_handler); + g_signal_handler_disconnect (pd->dialog, pd->delete_handler); + g_signal_handler_disconnect (pd->dialog, pd->destroy_handler); + } + + g_timer_destroy (pd->timer); + g_object_unref (pd->dialog); + g_main_loop_unref (pd->loop); + + gtk_widget_destroy (pd->dialog); + + pd->loop = NULL; + g_free (pd); +} + +static void +handle_progress_dialog_events (struct progress_dialog *pd) +{ + GMainContext * context = g_main_loop_get_context (pd->loop); + + /* Process events */ + while (g_main_context_pending (context)) + { + g_main_context_iteration (context, FALSE); + } +} + +#define MIN_TIME_SEPARATION (50./1000.) /* 50ms */ +static int +ghid_progress (int so_far, int total, const char *message) +{ + static struct progress_dialog *pd = NULL; + + /* If we are finished, destroy any dialog */ + if (so_far == 0 && total == 0 && message == NULL) + { + destroy_progress_dialog (pd); + pd = NULL; + return 0; + } + + if (pd == NULL) + pd = make_progress_dialog (); + + /* We don't want to keep the underlying process too busy whilst we + * process events. If we get called quickly after the last progress + * update, wait a little bit before we respond - perhaps the next + * time progress is reported. + + * The exception here is that we always want to process the first + * batch of events after having shown the dialog for the first time + */ + if (pd->started && g_timer_elapsed (pd->timer, NULL) < MIN_TIME_SEPARATION) + return 0; + + gtk_label_set_text (GTK_LABEL (pd->message), message); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pd->progress), + (double)so_far / (double)total); + + handle_progress_dialog_events (pd); + g_timer_start (pd->timer); + + pd->started = TRUE; + + return (pd->response_id == GTK_RESPONSE_CANCEL || + pd->response_id == GTK_RESPONSE_DELETE_EVENT) ? 1 : 0; +} + +/* ---------------------------------------------------------------------- */ + + +typedef struct { + GtkWidget *del; + GtkWidget *w_name; + GtkWidget *w_value; +} AttrRow; + +static AttrRow *attr_row = 0; +static int attr_num_rows = 0; +static int attr_max_rows = 0; +static AttributeListType *attributes_list; +static GtkWidget *attributes_dialog, *attr_table; + +static void attributes_delete_callback (GtkWidget *w, void *v); + +#define GA_RESPONSE_REVERT 1 +#define GA_RESPONSE_NEW 2 + +static void +ghid_attr_set_table_size () +{ + gtk_table_resize (GTK_TABLE (attr_table), attr_num_rows > 0 ? attr_num_rows : 1, 3); +} + +static void +ghid_attributes_need_rows (int new_max) +{ + if (attr_max_rows < new_max) + { + if (attr_row) + attr_row = (AttrRow *) realloc (attr_row, new_max * sizeof(AttrRow)); + else + attr_row = (AttrRow *) malloc (new_max * sizeof(AttrRow)); + } + while (attr_max_rows < new_max) + { + /* add [attr_max_rows] */ + attr_row[attr_max_rows].del = gtk_button_new_with_label ("del"); + gtk_table_attach (GTK_TABLE (attr_table), attr_row[attr_max_rows].del, + 0, 1, + attr_max_rows, attr_max_rows+1, + (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), + GTK_FILL, + 0, 0); + g_signal_connect (G_OBJECT (attr_row[attr_max_rows].del), "clicked", + G_CALLBACK (attributes_delete_callback), GINT_TO_POINTER (attr_max_rows) ); + + attr_row[attr_max_rows].w_name = gtk_entry_new (); + gtk_table_attach (GTK_TABLE (attr_table), attr_row[attr_max_rows].w_name, + 1, 2, + attr_max_rows, attr_max_rows+1, + (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), + GTK_FILL, + 0, 0); + + attr_row[attr_max_rows].w_value = gtk_entry_new (); + gtk_table_attach (GTK_TABLE (attr_table), attr_row[attr_max_rows].w_value, + 2, 3, + attr_max_rows, attr_max_rows+1, + (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), + GTK_FILL, + 0, 0); + + attr_max_rows ++; + } + + /* Manage any previously unused rows we now need to show. */ + while (attr_num_rows < new_max) + { + /* manage attr_num_rows */ + gtk_widget_show (attr_row[attr_num_rows].del); + gtk_widget_show (attr_row[attr_num_rows].w_name); + gtk_widget_show (attr_row[attr_num_rows].w_value); + attr_num_rows ++; + } +} + +static void +ghid_attributes_revert () +{ + int i; + + ghid_attributes_need_rows (attributes_list->Number); + + /* Unmanage any previously used rows we don't need. */ + while (attr_num_rows > attributes_list->Number) + { + attr_num_rows --; + gtk_widget_hide (attr_row[attr_num_rows].del); + gtk_widget_hide (attr_row[attr_num_rows].w_name); + gtk_widget_hide (attr_row[attr_num_rows].w_value); + } + + /* Fill in values */ + for (i=0; iNumber; i++) + { + /* create row [i] */ + gtk_entry_set_text (GTK_ENTRY (attr_row[i].w_name), attributes_list->List[i].name); + gtk_entry_set_text (GTK_ENTRY (attr_row[i].w_value), attributes_list->List[i].value); +#if 0 +#endif + } + ghid_attr_set_table_size (); +} + +static void +attributes_delete_callback (GtkWidget *w, void *v) +{ + int i, n; + + n = GPOINTER_TO_INT (v); + + for (i=n; iNumber, 3, 0); + + content_area = gtk_dialog_get_content_area (GTK_DIALOG (attributes_dialog)); + gtk_box_pack_start (GTK_BOX (content_area), attr_table, FALSE, FALSE, 0); + + gtk_widget_show (attr_table); + + ghid_attributes_revert (); + + while (1) + { + response = gtk_dialog_run (GTK_DIALOG (attributes_dialog)); + + if (response == GTK_RESPONSE_CANCEL) + break; + + if (response == GTK_RESPONSE_OK) + { + int i; + /* Copy the values back */ + for (i=0; iNumber; i++) + { + if (attributes_list->List[i].name) + free (attributes_list->List[i].name); + if (attributes_list->List[i].value) + free (attributes_list->List[i].value); + } + if (attributes_list->Max < attr_num_rows) + { + int sz = attr_num_rows * sizeof (AttributeType); + if (attributes_list->List == NULL) + attributes_list->List = (AttributeType *) malloc (sz); + else + attributes_list->List = (AttributeType *) realloc (attributes_list->List, sz); + attributes_list->Max = attr_num_rows; + } + for (i=0; iList[i].name = strdup (gtk_entry_get_text (GTK_ENTRY (attr_row[i].w_name))); + attributes_list->List[i].value = strdup (gtk_entry_get_text (GTK_ENTRY (attr_row[i].w_value))); + attributes_list->Number = attr_num_rows; + } + + break; + } + + if (response == GA_RESPONSE_REVERT) + { + /* Revert */ + ghid_attributes_revert (); + } + + if (response == GA_RESPONSE_NEW) + { + ghid_attributes_need_rows (attr_num_rows + 1); /* also bumps attr_num_rows */ + + gtk_entry_set_text (GTK_ENTRY (attr_row[attr_num_rows-1].w_name), ""); + gtk_entry_set_text (GTK_ENTRY (attr_row[attr_num_rows-1].w_value), ""); + + ghid_attr_set_table_size (); + } + } + + gtk_widget_destroy (attributes_dialog); + free (attr_row); + attr_row = NULL; +} + +/* ---------------------------------------------------------------------- */ + +HID_DRC_GUI ghid_drc_gui = { + 1, /* log_drc_overview */ + 0, /* log_drc_details */ + ghid_drc_window_reset_message, + ghid_drc_window_append_violation, + ghid_drc_window_throw_dialog, +}; + +extern HID_Attribute *ghid_get_export_options (int *); + + +/* ------------------------------------------------------------ + * + * Actions specific to the GTK HID follow from here + * + */ + + +/* ------------------------------------------------------------ */ +static const char about_syntax[] = +"About()"; + +static const char about_help[] = +N_("Tell the user about this version of PCB."); + +/* %start-doc actions About + +This just pops up a dialog telling the user which version of +@code{pcb} they're running. + +%end-doc */ + + +static int +About (int argc, char **argv, Coord x, Coord y) +{ + ghid_dialog_about (); + return 0; +} + +/* ------------------------------------------------------------ */ +static const char getxy_syntax[] = +"GetXY()"; + +static const char getxy_help[] = +N_("Get a coordinate."); + +/* %start-doc actions GetXY + +Prompts the user for a coordinate, if one is not already selected. + +%end-doc */ + +static int +GetXY (int argc, char **argv, Coord x, Coord y) +{ + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int PointCursor (int argc, char **argv, Coord x, Coord y) +{ + if (!ghidgui) + return 0; + + if (argc > 0) + ghid_point_cursor (); + else + ghid_mode_cursor (Settings.Mode); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +RouteStylesChanged (int argc, char **argv, Coord x, Coord y) +{ + if (!ghidgui || !ghidgui->route_style_selector) + return 0; + + ghid_route_style_selector_sync + (GHID_ROUTE_STYLE_SELECTOR (ghidgui->route_style_selector), + Settings.LineThickness, Settings.ViaDrillingHole, + Settings.ViaThickness, Settings.Keepaway); + + return 0; +} + +/* ---------------------------------------------------------------------- */ + +int +PCBChanged (int argc, char **argv, Coord x, Coord y) +{ + if (!ghidgui) + return 0; + + ghid_window_set_name_label (PCB->Name); + + if (!gport->pixmap) + return 0; + + 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); + + ghid_port_ranges_scale (); + ghid_zoom_view_fit (); + ghid_sync_with_new_layout (); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +LayerGroupsChanged (int argc, char **argv, Coord x, Coord y) +{ + printf (_("LayerGroupsChanged -- not implemented\n")); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +LibraryChanged (int argc, 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, char **argv, Coord x, Coord y) +{ + ghid_handle_user_command (TRUE); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +Load (int argc, char **argv, Coord x, Coord y) +{ + char *function; + char *name = NULL; + + static gchar *current_element_dir = NULL; + static gchar *current_layout_dir = NULL; + static gchar *current_netlist_dir = NULL; + + /* we've been given the file name */ + if (argc > 1) + return hid_actionv ("LoadFrom", argc, argv); + + function = argc ? argv[0] : (char *)"Layout"; + + if (strcasecmp (function, "Netlist") == 0) + { + name = ghid_dialog_file_select_open (_("Load netlist file"), + ¤t_netlist_dir, + Settings.FilePath); + } + else if (strcasecmp (function, "ElementToBuffer") == 0) + { + name = ghid_dialog_file_select_open (_("Load element to buffer"), + ¤t_element_dir, + Settings.LibraryTree); + } + else if (strcasecmp (function, "LayoutToBuffer") == 0) + { + name = ghid_dialog_file_select_open (_("Load layout file to buffer"), + ¤t_layout_dir, + Settings.FilePath); + } + else if (strcasecmp (function, "Layout") == 0) + { + name = ghid_dialog_file_select_open (_("Load layout file"), + ¤t_layout_dir, + Settings.FilePath); + } + + if (name) + { + if (Settings.verbose) + fprintf (stderr, "%s: Calling LoadFrom(%s, %s)\n", __FUNCTION__, + function, name); + hid_actionl ("LoadFrom", function, name, NULL); + g_free (name); + } + + return 0; +} + + +/* ---------------------------------------------------------------------- */ +static const char save_syntax[] = +"Save()\n" +"Save(Layout|LayoutAs)\n" +"Save(AllConnections|AllUnusedPins|ElementConnections)\n" +"Save(PasteBuffer)"; + +static const char save_help[] = +N_("Save layout and/or element data to a user-selected file."); + +/* %start-doc actions Save + +This action is a GUI front-end to the core's @code{SaveTo} action +(@pxref{SaveTo Action}). If you happen to pass a filename, like +@code{SaveTo}, then @code{SaveTo} is called directly. Else, the +user is prompted for a filename to save, and then @code{SaveTo} is +called with that filename. + +%end-doc */ + +static int +Save (int argc, char **argv, Coord x, Coord y) +{ + char *function; + char *name; + char *prompt; + + static gchar *current_dir = NULL; + + if (argc > 1) + return hid_actionv ("SaveTo", argc, argv); + + function = argc ? argv[0] : (char *)"Layout"; + + if (strcasecmp (function, "Layout") == 0) + if (PCB->Filename) + return hid_actionl ("SaveTo", "Layout", PCB->Filename, NULL); + + if (strcasecmp (function, "PasteBuffer") == 0) + prompt = _("Save element as"); + else + prompt = _("Save layout as"); + + name = ghid_dialog_file_select_save (prompt, + ¤t_dir, + PCB->Filename, Settings.FilePath); + + if (name) + { + if (Settings.verbose) + fprintf (stderr, "%s: Calling SaveTo(%s, %s)\n", + __FUNCTION__, function, name); + + if (strcasecmp (function, "PasteBuffer") == 0) + hid_actionl ("PasteBuffer", "Save", name, NULL); + else + { + /* + * if we got this far and the function is Layout, then + * we really needed it to be a LayoutAs. Otherwise + * ActionSaveTo() will ignore the new file name we + * just obtained. + */ + if (strcasecmp (function, "Layout") == 0) + hid_actionl ("SaveTo", "LayoutAs", name, NULL); + else + hid_actionl ("SaveTo", function, name, NULL); + } + g_free (name); + } + else + { + return 1; + } + + return 0; +} + +/* ---------------------------------------------------------------------- */ +static const char swapsides_syntax[] = +"SwapSides(|v|h|r)"; + +static const char swapsides_help[] = +N_("Swaps the side of the board you're looking at."); + +/* %start-doc actions SwapSides + +This action changes the way you view the board. + +@table @code + +@item v +Flips the board over vertically (up/down). + +@item h +Flips the board over horizontally (left/right), like flipping pages in +a book. + +@item r +Rotates the board 180 degrees without changing sides. + +@end table + +If no argument is given, the board isn't moved but the opposite side +is shown. + +Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + +As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the ``working +side'' of the board. + +%end-doc */ + + +static int +SwapSides (int argc, char **argv, Coord x, Coord y) +{ + int active_group = GetLayerGroupNumberByNumber (LayerStack[0]); + int comp_group = GetLayerGroupNumberByNumber (component_silk_layer); + int solder_group = GetLayerGroupNumberByNumber (solder_silk_layer); + bool comp_on = LAYER_PTR (PCB->LayerGroups.Entries[comp_group][0])->On; + bool solder_on = LAYER_PTR (PCB->LayerGroups.Entries[solder_group][0])->On; + + if (argc > 0) + { + switch (argv[0][0]) { + case 'h': + case 'H': + ghid_flip_view (gport->pcb_x, gport->pcb_y, true, false); + break; + case 'v': + case 'V': + ghid_flip_view (gport->pcb_x, gport->pcb_y, false, true); + break; + case 'r': + case 'R': + ghid_flip_view (gport->pcb_x, gport->pcb_y, true, true); + Settings.ShowSolderSide = !Settings.ShowSolderSide; /* Swapped back below */ + break; + default: + return 1; + } + } + + Settings.ShowSolderSide = !Settings.ShowSolderSide; + + if ((active_group == comp_group && comp_on && !solder_on) || + (active_group == solder_group && solder_on && !comp_on)) + { + bool new_solder_vis = Settings.ShowSolderSide; + + 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); + } + + return 0; +} + +/* ------------------------------------------------------------ */ + +static const char print_syntax[] = +"Print()"; + +static const char print_help[] = +N_("Print the layout."); + +/* %start-doc actions Print + +This will find the default printing HID, prompt the user for its +options, and print the layout. + +%end-doc */ + +static int +Print (int argc, char **argv, Coord x, Coord y) +{ + HID **hids; + int i; + HID *printer = NULL; + + hids = 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")); + return -1; + } + + /* check if layout is empty */ + if (!IsDataEmpty (PCB->Data)) + { + ghid_dialog_print (printer); + } + else + gui->log (_("Can't print empty layout")); + + return 0; +} + + +/* ------------------------------------------------------------ */ + +static HID_Attribute +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"), + HID_Real, 0.5, 25, {0, 0, 1.00}, 0, 0}, + {N_("y-calibration"), N_("Y scale for calibrating your printer"), + HID_Real, 0.5, 25, {0, 0, 1.00}, 0, 0} +}; +static HID_Attr_Val printer_calibrate_values[3]; + +static const char printcalibrate_syntax[] = +"PrintCalibrate()"; + +static const char printcalibrate_help[] = +N_("Calibrate the printer."); + +/* %start-doc actions PrintCalibrate + +This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + +%end-doc */ + +static int +PrintCalibrate (int argc, char **argv, Coord x, Coord y) +{ + HID *printer = hid_find_printer (); + printer->calibrate (0.0, 0.0); + + if (gui->attribute_dialog (printer_calibrate_attrs, 3, + printer_calibrate_values, + _("Printer Calibration Values"), + _("Enter calibration values for your printer"))) + return 1; + printer->calibrate (printer_calibrate_values[1].real_value, + printer_calibrate_values[2].real_value); + return 0; +} + +/* ------------------------------------------------------------ */ + +static int +Export (int argc, char **argv, Coord x, Coord y) +{ + + /* check if layout is empty */ + if (!IsDataEmpty (PCB->Data)) + { + ghid_dialog_export (); + } + else + gui->log (_("Can't export empty layout")); + + return 0; +} + +/* ------------------------------------------------------------ */ + +static int +Benchmark (int argc, char **argv, Coord x, Coord y) +{ + int i = 0; + time_t start, end; + GdkDisplay *display; + + display = gdk_drawable_get_display (gport->drawable); + + gdk_display_sync (display); + time (&start); + do + { + ghid_invalidate_all (); + gdk_window_process_updates (gtk_widget_get_window (gport->drawing_area), + FALSE); + time (&end); + i++; + } + while (end - start < 10); + + printf (_("%g redraws per second\n"), i / 10.0); + + return 0; +} + +/* ------------------------------------------------------------ */ + +static const char center_syntax[] = +"Center()\n"; + +static const char center_help[] = +N_("Moves the pointer to the center of the window."); + +/* %start-doc actions Center + +Move the pointer to the center of the window, but only if it's +currently within the window already. + +%end-doc */ + +static int +Center(int argc, char **argv, Coord pcb_x, Coord pcb_y) +{ + GdkDisplay *display; + GdkScreen *screen; + int offset_x, offset_y; + int widget_x, widget_y; + int pointer_x, pointer_y; + + if (argc != 0) + AFAIL (center); + + /* Aim to put the given x, y PCB coordinates in the center of the widget */ + widget_x = gport->width / 2; + widget_y = gport->height / 2; + + ghid_pan_view_abs (pcb_x, pcb_y, widget_x, widget_y); + + /* Now move the mouse pointer to the place where the board location + * actually ended up. + * + * XXX: Should only do this if we confirm we are inside our window? + */ + + ghid_pcb_to_event_coords (pcb_x, pcb_y, &widget_x, &widget_y); + gdk_window_get_origin (gtk_widget_get_window (gport->drawing_area), + &offset_x, &offset_y); + + pointer_x = offset_x + widget_x; + pointer_y = offset_y + widget_y; + + display = gdk_display_get_default (); + screen = gdk_display_get_default_screen (display); + gdk_display_warp_pointer (display, screen, pointer_x, pointer_y); + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char cursor_syntax[] = +"Cursor(Type,DeltaUp,DeltaRight,Units)"; + +static const char cursor_help[] = +N_("Move the cursor."); + +/* %start-doc actions Cursor + +This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive @var{DeltaUp} may move the +cursor towards the board origin if the board is inverted. + +Type is one of @samp{Pan} or @samp{Warp}. @samp{Pan} causes the +viewport to move such that the crosshair is under the mouse cursor. +@samp{Warp} causes the mouse cursor to move to be above the crosshair. + +@var{Units} can be one of the following: + +@table @samp + +@item mil +@itemx mm +The cursor is moved by that amount, in board units. + +@item grid +The cursor is moved by that many grid points. + +@item view +The values are percentages of the viewport's view. Thus, a pan of +@samp{100} would scroll the viewport by exactly the width of the +current view. + +@item board +The values are percentages of the board size. Thus, a move of +@samp{50,50} moves you halfway across the board. + +@end table + +%end-doc */ + +static int +CursorAction(int argc, char **argv, Coord x, Coord y) +{ + UnitList extra_units_x = { + { "grid", PCB->Grid, 0 }, + { "view", gport->view.width, UNIT_PERCENT }, + { "board", PCB->MaxWidth, UNIT_PERCENT }, + { "", 0, 0 } + }; + UnitList extra_units_y = { + { "grid", PCB->Grid, 0 }, + { "view", gport->view.height, UNIT_PERCENT }, + { "board", PCB->MaxHeight, UNIT_PERCENT }, + { "", 0, 0 } + }; + int pan_warp = HID_SC_DO_NOTHING; + double dx, dy; + + if (argc != 4) + AFAIL (cursor); + + if (strcasecmp (argv[0], "pan") == 0) + pan_warp = HID_SC_PAN_VIEWPORT; + else if (strcasecmp (argv[0], "warp") == 0) + pan_warp = HID_SC_WARP_POINTER; + else + AFAIL (cursor); + + dx = GetValueEx (argv[1], argv[3], NULL, extra_units_x, ""); + if (gport->view.flip_x) + dx = -dx; + dy = GetValueEx (argv[2], argv[3], NULL, extra_units_y, ""); + if (!gport->view.flip_y) + dy = -dy; + + EventMoveCrosshair (Crosshair.X + dx, Crosshair.Y + dy); + gui->set_crosshair (Crosshair.X, Crosshair.Y, pan_warp); + + return 0; +} +/* ------------------------------------------------------------ */ + +static const char dowindows_syntax[] = +"DoWindows(1|2|3|4|5|6)\n" +"DoWindows(Layout|Library|Log|Netlist|Preferences|DRC)"; + +static const char dowindows_help[] = +N_("Open various GUI windows."); + +/* %start-doc actions DoWindows + +@table @code + +@item 1 +@itemx Layout +Open the layout window. Since the layout window is always shown +anyway, this has no effect. + +@item 2 +@itemx Library +Open the library window. + +@item 3 +@itemx Log +Open the log window. + +@item 4 +@itemx Netlist +Open the netlist window. + +@item 5 +@itemx Preferences +Open the preferences window. + +@item 6 +@itemx DRC +Open the DRC violations window. + +@end table + +%end-doc */ + +static int +DoWindows (int argc, char **argv, Coord x, Coord y) +{ + char *a = argc == 1 ? argv[0] : (char *)""; + + if (strcmp (a, "1") == 0 || strcasecmp (a, "Layout") == 0) + { + } + else if (strcmp (a, "2") == 0 || strcasecmp (a, "Library") == 0) + { + ghid_library_window_show (gport, TRUE); + } + else if (strcmp (a, "3") == 0 || strcasecmp (a, "Log") == 0) + { + ghid_log_window_show (TRUE); + } + else if (strcmp (a, "4") == 0 || strcasecmp (a, "Netlist") == 0) + { + ghid_netlist_window_show (gport, TRUE); + } + else if (strcmp (a, "5") == 0 || strcasecmp (a, "Preferences") == 0) + { + ghid_config_window_show (); + } + else if (strcmp (a, "6") == 0 || strcasecmp (a, "DRC") == 0) + { + ghid_drc_window_show (TRUE); + } + else + { + AFAIL (dowindows); + } + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char setunits_syntax[] = +"SetUnits(mm|mil)"; + +static const char setunits_help[] = +N_("Set the default measurement units."); + +/* %start-doc actions SetUnits + +@table @code + +@item mil +Sets the display units to mils (1/1000 inch). + +@item mm +Sets the display units to millimeters. + +@end table + +%end-doc */ + +static int +SetUnits (int argc, char **argv, Coord x, Coord y) +{ + const Unit *new_unit; + if (argc == 0) + return 0; + + new_unit = get_unit_struct (argv[0]); + if (new_unit != NULL && new_unit->allow != NO_PRINT) + { + Settings.grid_unit = new_unit; + Settings.increments = get_increments_struct (Settings.grid_unit->suffix); + AttributePut (PCB, "PCB::grid::unit", argv[0]); + } + + ghid_config_handle_units_changed (); + + ghid_set_status_line_label (); + + /* FIXME ? + * lesstif_sizes_reset (); + * lesstif_styles_update_values (); + */ + return 0; +} + +/* ------------------------------------------------------------ */ +static const char scroll_syntax[] = +"Scroll(up|down|left|right, [div])"; + +static const char scroll_help[] = +N_("Scroll the viewport."); + +/* % start-doc actions Scroll + +@item up|down|left|right +Specifies the direction to scroll + +@item div +Optional. Specifies how much to scroll by. The viewport is scrolled +by 1/div of what is visible, so div = 1 scrolls a whole page. If not +default is given, div=40. + +%end-doc */ + +static int +ScrollAction (int argc, char **argv, Coord x, Coord y) +{ + gdouble dx = 0.0, dy = 0.0; + int div = 40; + + if (!ghidgui) + return 0; + + if (argc != 1 && argc != 2) + AFAIL (scroll); + + if (argc == 2) + div = atoi(argv[1]); + + if (strcasecmp (argv[0], "up") == 0) + dy = -gport->view.height / div; + else if (strcasecmp (argv[0], "down") == 0) + dy = gport->view.height / div; + else if (strcasecmp (argv[0], "right") == 0) + dx = gport->view.width / div; + else if (strcasecmp (argv[0], "left") == 0) + dx = -gport->view.width / div; + else + AFAIL (scroll); + + ghid_pan_view_rel (dx, dy); + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char pan_syntax[] = +"Pan([thumb], Mode)"; + +static const char pan_help[] = +N_("Start or stop panning (Mode = 1 to start, 0 to stop)\n" +"Optional thumb argument is ignored for now in gtk hid.\n"); + +/* %start-doc actions Pan + +Start or stop panning. To start call with Mode = 1, to stop call with +Mode = 0. + +%end-doc */ + +static int +PanAction (int argc, char **argv, Coord x, Coord y) +{ + int mode; + + if (!ghidgui) + return 0; + + if (argc != 1 && argc != 2) + AFAIL (pan); + + if (argc == 1) + mode = atoi(argv[0]); + else + { + mode = atoi(argv[1]); + Message (_("The gtk gui currently ignores the optional first argument " + "to the Pan action.\nFeel free to provide patches.\n")); + } + + gport->panning = mode; + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char popup_syntax[] = +"Popup(MenuName, [Button])"; + +static const char popup_help[] = +N_("Bring up the popup menu specified by @code{MenuName}.\n" +"If called by a mouse event then the mouse button number\n" +"must be specified as the optional second argument."); + +/* %start-doc actions Popup + +This just pops up the specified menu. The menu must have been defined +as a named subresource of the Popups resource in the menu resource +file. + +%end-doc */ + + +static int +Popup (int argc, char **argv, Coord x, Coord y) +{ + GtkMenu *menu; + + if (argc != 1 && argc != 2) + AFAIL (popup); + + menu = ghid_main_menu_get_popup (GHID_MAIN_MENU (ghidgui->menu_bar), argv[0]); + if (! GTK_IS_MENU (menu)) + { + Message (_("The specified popup menu \"%s\" has not been defined.\n"), argv[0]); + return 1; + } + else + { + ghidgui->in_popup = TRUE; + gtk_widget_grab_focus (ghid_port.drawing_area); + gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 0, + gtk_get_current_event_time()); + } + return 0; +} +/* ------------------------------------------------------------ */ +static const char importgui_syntax[] = +"ImportGUI()"; + +static const char importgui_help[] = +N_("Asks user which schematics to import into PCB.\n"); + +/* %start-doc actions ImportGUI + +Asks user which schematics to import into PCB. + +%end-doc */ + + +static int +ImportGUI (int argc, char **argv, Coord x, Coord y) +{ + char *name = NULL; + static gchar *current_layout_dir = NULL; + static int I_am_recursing = 0; + int rv; + + if (I_am_recursing) + return 1; + + + name = ghid_dialog_file_select_open (_("Load schematics"), + ¤t_layout_dir, + Settings.FilePath); + +#ifdef DEBUG + printf("File selected = %s\n", name); +#endif + + AttributePut (PCB, "import::src0", name); + free (name); + + I_am_recursing = 1; + rv = hid_action ("Import"); + I_am_recursing = 0; + + return rv; +} + +/* ------------------------------------------------------------ */ +static int +Busy (int argc, char **argv, Coord x, Coord y) +{ + ghid_watch_cursor (); + return 0; +} + +HID_Action 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}, + {"Cursor", 0, CursorAction, cursor_help, cursor_syntax}, + {"DoWindows", 0, DoWindows, dowindows_help, dowindows_syntax}, + {"Export", 0, Export}, + {"GetXY", "", GetXY, getxy_help, getxy_syntax}, + {"ImportGUI", 0, ImportGUI, importgui_help, importgui_syntax}, + {"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, + print_help, print_syntax}, + {"PrintCalibrate", 0, PrintCalibrate, + printcalibrate_help, printcalibrate_syntax}, + {"RouteStylesChanged", 0, RouteStylesChanged}, + {"Save", 0, Save, save_help, save_syntax}, + {"Scroll", N_("Click on a place to scroll"), ScrollAction, scroll_help, scroll_syntax}, + {"SetUnits", 0, SetUnits, setunits_help, setunits_syntax}, + {"SwapSides", 0, SwapSides, swapsides_help, swapsides_syntax}, + {"Zoom", N_("Click on zoom focus"), Zoom, zoom_help, zoom_syntax} +}; + +REGISTER_ACTIONS (ghid_main_action_list) + + +static int +flag_flipx (int x) +{ + return gport->view.flip_x; +} + +static int +flag_flipy (int x) +{ + return gport->view.flip_y; +} + +HID_Flag ghid_main_flag_list[] = { + {"flip_x", flag_flipx, 0}, + {"flip_y", flag_flipy, 0} +}; + +REGISTER_FLAGS (ghid_main_flag_list) + +#include "dolists.h" + +/* + * We will need these for finding the windows installation + * directory. Without that we can't find our fonts and + * footprint libraries. + */ +#ifdef WIN32 +#include +#include +#endif + +HID ghid_hid; + +void +hid_gtk_init () +{ +#ifdef WIN32 + char * tmps; + char * share_dir; + char *loader_cache; + FILE *loader_file; +#endif + +#ifdef WIN32 + tmps = g_win32_get_package_installation_directory (PACKAGE "-" VERSION, NULL); +#define REST_OF_PATH G_DIR_SEPARATOR_S "share" G_DIR_SEPARATOR_S PACKAGE +#define REST_OF_CACHE G_DIR_SEPARATOR_S "loaders.cache" + share_dir = (char *) malloc(strlen(tmps) + + strlen(REST_OF_PATH) + + 1); + sprintf (share_dir, "%s%s", tmps, REST_OF_PATH); + + /* Point to our gdk-pixbuf loader cache. */ + loader_cache = (char *) malloc (strlen (bindir) + + strlen (REST_OF_CACHE) + + 1); + sprintf (loader_cache, "%s%s", bindir, REST_OF_CACHE); + loader_file = fopen (loader_cache, "r"); + if (loader_file) + { + fclose (loader_file); + g_setenv ("GDK_PIXBUF_MODULE_FILE", loader_cache, TRUE); + } + + free (tmps); +#undef REST_OF_PATH + printf ("\"Share\" installation path is \"%s\"\n", share_dir); +#endif + + memset (&ghid_hid, 0, sizeof (HID)); + + common_nogui_init (&ghid_hid); + common_draw_helpers_init (&ghid_hid); + + ghid_hid.struct_size = sizeof (HID); + ghid_hid.name = "gtk"; + ghid_hid.description = "Gtk - The Gimp Toolkit"; + ghid_hid.gui = 1; + ghid_hid.poly_after = 1; + + ghid_hid.get_export_options = ghid_get_export_options; + ghid_hid.do_export = ghid_do_export; + ghid_hid.parse_arguments = ghid_parse_arguments; + ghid_hid.invalidate_lr = ghid_invalidate_lr; + 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.make_gc = ghid_make_gc; + ghid_hid.destroy_gc = ghid_destroy_gc; + ghid_hid.use_mask = ghid_use_mask; + ghid_hid.set_color = ghid_set_color; + ghid_hid.set_line_cap = ghid_set_line_cap; + ghid_hid.set_line_width = ghid_set_line_width; + ghid_hid.set_draw_xor = ghid_set_draw_xor; + ghid_hid.draw_line = ghid_draw_line; + ghid_hid.draw_arc = ghid_draw_arc; + ghid_hid.draw_rect = ghid_draw_rect; + ghid_hid.fill_circle = ghid_fill_circle; + ghid_hid.fill_polygon = ghid_fill_polygon; + ghid_hid.fill_rect = ghid_fill_rect; + + ghid_hid.calibrate = ghid_calibrate; + ghid_hid.shift_is_pressed = ghid_shift_is_pressed; + ghid_hid.control_is_pressed = ghid_control_is_pressed; + ghid_hid.mod1_is_pressed = ghid_mod1_is_pressed, + ghid_hid.get_coords = ghid_get_coords; + ghid_hid.set_crosshair = ghid_set_crosshair; + ghid_hid.add_timer = ghid_add_timer; + ghid_hid.stop_timer = ghid_stop_timer; + ghid_hid.watch_file = ghid_watch_file; + ghid_hid.unwatch_file = ghid_unwatch_file; + ghid_hid.add_block_hook = ghid_add_block_hook; + ghid_hid.stop_block_hook = ghid_stop_block_hook; + + ghid_hid.log = ghid_log; + ghid_hid.logv = ghid_logv; + ghid_hid.confirm_dialog = ghid_confirm_dialog; + ghid_hid.close_confirm_dialog = ghid_close_confirm_dialog; + ghid_hid.report_dialog = ghid_report_dialog; + ghid_hid.prompt_for = ghid_prompt_for; + ghid_hid.fileselect = ghid_fileselect; + ghid_hid.attribute_dialog = ghid_attribute_dialog; + 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.request_debug_draw = ghid_request_debug_draw; + ghid_hid.flush_debug_draw = ghid_flush_debug_draw; + ghid_hid.finish_debug_draw = ghid_finish_debug_draw; + + ghid_hid.notify_save_pcb = ghid_notify_save_pcb; + ghid_hid.notify_filename_changed = ghid_notify_filename_changed; + + hid_register_hid (&ghid_hid); +#include "gtk_lists.h" +} Index: tags/1.0.5/.pc/disable_hid_png3_test.diff/tests/tests.list =================================================================== --- tags/1.0.5/.pc/disable_hid_png3_test.diff/tests/tests.list (nonexistent) +++ tags/1.0.5/.pc/disable_hid_png3_test.diff/tests/tests.list (revision 953) @@ -0,0 +1,166 @@ +# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2009, 2010 Dan McMahill +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111 USA +# All rights reserved. +# +# This code was derived from code written by Dan McMahill as part of the +# latex-mk testsuite. The original code was covered by a BSD license +# but the copyright holder is releasing the version for pcb under the GPL. +# +# +# Format: +# +# test_name | layout file(s) | [export hid name] | [optional arguments to pcb] | [mismatch] +# | output file(s) +# +# test_name - a single string with no spaces, tabs, *, +, ? (i.e. any "special" +# characters) that identifies the test. +# +# layout file(s) - a list of layout files. Files listed are relative to +# the $(top_srcdir)/tests/inputs directory. +# +# [export hid name] - the name of the export HID to use. This is used both for +# running pcb as well as determining how we process the output +# +# [optional arguments to pcb] - a list of additional arguments to be passed to pcb. +# This is where one would specify additional options which are specific to a particular +# export HID. +# +# [mismatch] If specified as "mismatch" (no quotes), then the result +# should *not* match the reference. This can be thought of as a test +# on the testsuite to make sure we can properly detect when a change has +# occurred. +# +# output file(s) - a list of output files and their associated types. For +# example: +# bom:bom_general.bom xy:test.txt +# specifies that "bom_general.bom" is created and it is a bill of materials file +# and that "test.txt" is created and it is a centroid (X-Y) file. +# +# File types grouped by which HID produces them are: +# +# BOM +# +# bom -- PCB bill of materials file +# xy -- PCB centroid file +# +# GCODE +# +# gcode -- G-Code file. Note that these typically have .cnc as the +# extension but we're already using the 'cnc' type for +# Excellon drill files. +# +# GERBER +# +# cnc -- Excellon drill file +# gbx -- RS274-X (Gerber) file +# +# PNG +# +# gif -- GIF file +# jpg -- JPEG file +# png -- Portable network graphics (PNG) file +# +###################################################################### +# --------------------------------------------- +# BOM export HID +# --------------------------------------------- +###################################################################### +# +# options: +# --bomfile BOM output file +# --xyfile XY output file +# --xy-in-mm XY dimensions in mm instead of mils +# +# +# Produces a bill of materials (BOM) file and a centroid (XY) file +# +hid_bom1 | bom_general.pcb | bom | | | bom:bom_general.bom xy:bom_general.xy +hid_bom2 | bom_general.pcb | bom | --bomfile test.bom | | bom:test.bom xy:bom_general.xy +hid_bom3 | bom_general.pcb | bom | --xyfile test.xy | | bom:bom_general.bom xy:test.xy +hid_bom4 | bom_general.pcb | bom | --xy-in-mm | | bom:bom_general.bom xy:bom_general.xy +# +###################################################################### +# --------------------------------------------- +# Gcode export HID +# --------------------------------------------- +###################################################################### +# +# options: +# --basename File name prefix +# --dpi Resolution of intermediate image (pixels/inch). +# --mill depth Milling depth. +# --safe Z Safe Z for traverse move. +# --tool radius Milling tool radius compensation. +# --drill depth Drilling depth. +# --measurement unit Measurement unit +# +hid_gcode1 | gcode_oneline.pcb | gcode | | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode2 | gcode_oneline.pcb | gcode | --basename out | | gcode:out.top.cnc gcode:out.bottom.cnc gcode:out.drill.cnc +hid_gcode3 | gcode_oneline.pcb | gcode | --dpi 1200 | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode4 | gcode_oneline.pcb | gcode | --mill-depth 5 | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode5 | gcode_oneline.pcb | gcode | --safe-Z 10 | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode6 | gcode_oneline.pcb | gcode | --tool-radius 15 | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode7 | gcode_oneline.pcb | gcode | --drill-depth 70 | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode8 | gcode_oneline.pcb | gcode | --measurement-unit mm | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode9 | gcode_oneline.pcb | gcode | --measurement-unit mil | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode10 | gcode_oneline.pcb | gcode | --measurement-unit um | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +hid_gcode11 | gcode_oneline.pcb | gcode | --measurement-unit inch | | gcode:gcode_oneline.gcode.top.cnc gcode:gcode_oneline.gcode.bottom.cnc gcode:gcode_oneline.gcode.drill.cnc +# +###################################################################### +# --------------------------------------------- +# Gerber export HID +# --------------------------------------------- +###################################################################### +# +# options: +# --gerberfile Basename for output file +# +# Produces RS274-X (a.k.a. gerber) photo plot files and Excellon drill files +# +# we can't include gbx:gerber_oneline.fab.gbr yet because it has a name and a date stamp +hid_gerber1 | gerber_oneline.pcb | gerber | | | gbx:gerber_oneline.bottom.gbr gbx:gerber_oneline.top.gbr cnc:gerber_oneline.plated-drill.cnc +hid_gerber2 | gerber_oneline.pcb | gerber | --gerberfile out | | gbx:out.bottom.gbr gbx:out.top.gbr cnc:out.plated-drill.cnc +hid_gerber3 | gerber_arcs.pcb | gerber | --gerberfile arcs | | gbx:arcs.bottom.gbr gbx:arcs.top.gbr gbx:arcs.group1.gbr gbx:arcs.group4.gbr cnc:arcs.plated-drill.cnc +# + + +###################################################################### +# --------------------------------------------- +# PNG export HID +# --------------------------------------------- +###################################################################### +# +# options: +# --outfile Graphics output file +# --dpi Scale factor (pixels/inch). 0 to scale to fix specified size +# --x-max Maximum width (pixels). 0 to not constrain. +# --y-max Maximum height (pixels). 0 to not constrain. +# --xy-max Maximum width and height (pixels). 0 to not constrain. +# --as-shown Export layers as shown on screen +# --monochrome Convert to monochrome +# --only-visible Limit the bounds of the PNG file to the visible items +# --use-alpha Make the bottomground and any holes transparent +# --format Graphics file format +# --photo-mode Photo-realistic mode +# --photo-flip-x Show reverse side of the board, left-right flip +# --photo-flip-y Show reverse side of the board, up-down flip +# +# Produces GIF/JPEG/PNG (image) files +# +hid_png1 | gerber_oneline.pcb | png | | | png:gerber_oneline.png +hid_png2 | gerber_oneline.pcb | png | --outfile myfile.png | | png:myfile.png +hid_png3 | gerber_oneline.pcb | png | --dpi 300 | | png:gerber_oneline.png +# + Index: tags/1.0.5/.pc/drop_check_global_included.patch/src/hid/hidint.h =================================================================== --- tags/1.0.5/.pc/drop_check_global_included.patch/src/hid/hidint.h (nonexistent) +++ tags/1.0.5/.pc/drop_check_global_included.patch/src/hid/hidint.h (revision 953) @@ -0,0 +1,75 @@ +/* $Id$ */ + +/* HID internal interfaces. These may ONLY be called from the HID + modules, not from the common PCB code. */ + +/* 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)) + +/* Called by the init funcs, used to set up hid_list. */ +extern void hid_register_hid (HID * hid); + +/* NULL terminated list of all static HID structures. Built by + hid_register_hid, used by hid_find_*() and hid_enumerate(). The + order in this list is the same as the order of hid_register_hid + calls. */ +extern HID **hid_list; + +/* Count of entries in the above. */ +extern int hid_num_hids; + +/* Used to cache color lookups. If set is zero, it looks up the name + 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); + +typedef struct HID_AttrNode +{ + struct HID_AttrNode *next; + HID_Attribute *attributes; + int n; +} HID_AttrNode; + +extern HID_AttrNode *hid_attr_nodes; + +HID_Action *hid_find_action (const char *name); + +HID_Flag *hid_find_flag (const char *name); + +/* 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); + +/* 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); +/* Use this to restore them. */ +void hid_restore_layer_ons (int *save_array); + +enum File_Name_Style { + /* Files for copper layers are named top, groupN, bottom. */ + FNS_fixed, + /* Groups with multiple layers are named as above, else the single + layer name is used. */ + FNS_single, + /* The name of the first layer in each group is used. */ + FNS_first, +}; + +/* Returns a filename base that can be used to output the layer. */ +const char *layer_type_to_file_name (int idx, int style); + +#ifdef __GLOBAL_INCLUDED__ + +/* Convenience function that calls the expose callback for the item, + and returns the extents of what was drawn. */ +BoxType *hid_get_extents (void *item); + +#endif + +void derive_default_filename(const char *pcbfile, HID_Attribute *filename_attrib, const char *suffix, char **memory); Index: tags/1.0.5/.pc/fix_CPPFLAGS.diff/configure =================================================================== --- tags/1.0.5/.pc/fix_CPPFLAGS.diff/configure (nonexistent) +++ tags/1.0.5/.pc/fix_CPPFLAGS.diff/configure (revision 953) @@ -0,0 +1,19226 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.66 for pcb 20110918. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='pcb' +PACKAGE_TARNAME='pcb' +PACKAGE_VERSION='20110918' +PACKAGE_STRING='pcb 20110918' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/draw.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +TOPDIRS +BTNMOD +PCBTREEPATH +PCBTREEDIR +LIBRARYFILENAME +PCBLIBDIR +FONTFILENAME +CC_OR_CXX_FLAGS +CC_OR_CXX +DEBUG_BUILD_FALSE +DEBUG_BUILD_TRUE +PCB +BUILD_PCBLIB_NEWLIB_FALSE +BUILD_PCBLIB_NEWLIB_TRUE +PNG_PREVIEW_FALSE +PNG_PREVIEW_TRUE +GIF_FALSE +GIF_TRUE +PNG_FALSE +PNG_TRUE +GDLIB_CONFIG +GTKGLEXT_LIBS +GTKGLEXT_CFLAGS +GTK_LIBS +GTK_CFLAGS +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +GLIB_LIBS +GLIB_CFLAGS +HAVE_TEST_TOOLS_FALSE +HAVE_TEST_TOOLS_TRUE +GERBV +IM_MONTAGE +IM_DISPLAY +IM_CONVERT +IM_COMPOSITE +IM_COMPARE +IM_ANIMATE +MISSING_GSCHEM_FALSE +MISSING_GSCHEM_TRUE +GSCHEM +MISSING_PS2PDF_FALSE +MISSING_PS2PDF_TRUE +PS2PDF +MISSING_TEXI2DVI_FALSE +MISSING_TEXI2DVI_TRUE +MISSING_PDFLATEX_FALSE +MISSING_PDFLATEX_TRUE +PDFLATEX +GNUM4 +WISH +M4 +UPDATE_MIME_DATABASE +ENABLE_UPDATE_MIME_DATABASE_FALSE +ENABLE_UPDATE_MIME_DATABASE_TRUE +UPDATE_DESKTOP_DATABASE +ENABLE_UPDATE_DESKTOP_DATABASE_FALSE +ENABLE_UPDATE_DESKTOP_DATABASE_TRUE +KDEDATADIR +XDGDATADIR +GTK_UPDATE_ICON_CACHE_BIN +SETENV +HIDLIBS +HIDLIST +GLU_LIBS +GLU_CFLAGS +GL_LIBS +GL_CFLAGS +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config +SED +XMKMF +USE_GL_FALSE +USE_GL_TRUE +DBUS_LIBS +DBUS_CFLAGS +WITH_DBUS_FALSE +WITH_DBUS_TRUE +CAIRO_LIBS +CAIRO_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +WITH_TOPOROUTER_FALSE +WITH_TOPOROUTER_TRUE +KPSEWHICH +PERL +TEXI2DVI +MKINFO +CONVERT +PPMTOWINICON +XPMTOPPM +YACC_PATH +YFLAGS +YACC +LEX_PATH +LEXLIB +LEX_OUTPUT_ROOT +LEX +ALL_LINGUAS +INTLTOOL_PERL +INTLTOOL_POLICY_RULE +INTLTOOL_SERVICE_RULE +INTLTOOL_THEME_RULE +INTLTOOL_SCHEMAS_RULE +INTLTOOL_CAVES_RULE +INTLTOOL_XML_NOMERGE_RULE +INTLTOOL_XML_RULE +INTLTOOL_KBD_RULE +INTLTOOL_XAM_RULE +INTLTOOL_UI_RULE +INTLTOOL_SOUNDLIST_RULE +INTLTOOL_SHEET_RULE +INTLTOOL_SERVER_RULE +INTLTOOL_PONG_RULE +INTLTOOL_OAF_RULE +INTLTOOL_PROP_RULE +INTLTOOL_KEYS_RULE +INTLTOOL_DIRECTORY_RULE +INTLTOOL_DESKTOP_RULE +INTLTOOL_EXTRACT +INTLTOOL_MERGE +INTLTOOL_UPDATE +POSUB +LTLIBINTL +LIBINTL +INTLLIBS +INTL_LIBTOOL_SUFFIX_PREFIX +INTLOBJS +GENCAT +INSTOBJEXT +DATADIRNAME +CATOBJEXT +USE_INCLUDED_LIBINTL +BUILD_INCLUDED_LIBINTL +INTLBISON +LTLIBICONV +LIBICONV +HAVE_WPRINTF +HAVE_SNPRINTF +HAVE_ASPRINTF +HAVE_POSIX_PRINTF +GLIBC21 +ALLOCA +RANLIB +MSGMERGE +XGETTEXT +GMSGFMT +MSGFMT +USE_NLS +MKINSTALLDIRS +GETTEXT_PACKAGE +WINDRES +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +WIN32_FALSE +WIN32_TRUE +WIN32 +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +DOC +GIT_OR_CVS_VERSION_FALSE +GIT_OR_CVS_VERSION_TRUE +CVS_VERSION_FALSE +CVS_VERSION_TRUE +GIT_VERSION_FALSE +GIT_VERSION_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_doc +enable_maintainer_mode +enable_nls +with_gnu_ld +enable_rpath +with_libiconv_prefix +with_included_gettext +with_libintl_prefix +with_gui +enable_toporouter +enable_toporouter_output +enable_dbus +enable_gl +with_x +with_printer +with_exporters +with_xdgdatadir +with_kdedatadir +enable_update_desktop_database +enable_update_mime_database +enable_gif +enable_jpeg +enable_png +enable_m4lib_png +enable_xrender +enable_xinerama +enable_dmalloc +enable_efence +enable_debug +enable_coord64 +enable_coord32 +enable_build_with_cxx +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +YACC +YFLAGS +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +CAIRO_CFLAGS +CAIRO_LIBS +DBUS_CFLAGS +DBUS_LIBS +XMKMF +GLIB_CFLAGS +GLIB_LIBS +GTK_CFLAGS +GTK_LIBS +GTKGLEXT_CFLAGS +GTKGLEXT_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures pcb 20110918 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/pcb] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of pcb 20110918:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-doc Build and install the documentation [default=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths + --enable-toporouter build toporouter [default=yes] + + --enable-toporouter-output + enable toporouter graphical output [default=no] + + --enable-dbus Enable DBUS IPC + --enable-gl Enable GL drawing (with GTK HID) + --disable-update-desktop-database + do not update desktop database after installation + --disable-update-mime-database + do not update mime database after installation + --disable-gif Disable support for gif output when the png HID is used [default=include gif support] + --disable-jpeg Disable support for JPEG output when the png HID is used [default=include JPEG support] + --disable-png Disable support for PNG output when the png HID is used [default=include PNG support] + --enable-m4lib-png Enable creating png previews for the m4 library + --disable-xrender Compile and link with Xrender default=yes + --disable-xinerama Compile and link with Xinerama default=yes + --enable-dmalloc Compile and link with dmalloc for malloc debugging default=no + --enable-efence Link with ElectricFence for malloc debugging default=no + --enable-debug Enable debugging code + --enable-coord64 Force 64-bit coordinate types + --enable-coord32 Force 32-bit coordinate types + --enable-build-with-cxx build with C++ compiler instead of C compiler + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-included-gettext use the GNU gettext library included here + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + --with-gui= Specify the GUI to use: batch gtk lesstif [default=gtk] + --with-x use the X Window System + --with-printer= Specify the printer: lpr [default=lpr] + --with-exporters= Enable export devices: bom gerber gcode nelma png ps [default=bom gerber gcode nelma png ps] + --with-xdgdatadir=path Change where the theme icons +and mime registrations are installed [DATADIR] + --with-kdedatadir=path Change where the KDE mime reg +istrations are installed [DATADIR] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + YACC The `Yet Another C Compiler' implementation to use. Defaults to + the first program found out of: `bison -y', `byacc', `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + CAIRO_CFLAGS + C compiler flags for CAIRO, overriding pkg-config + CAIRO_LIBS linker flags for CAIRO, overriding pkg-config + DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config + DBUS_LIBS linker flags for DBUS, overriding pkg-config + XMKMF Path to xmkmf, Makefile generator for X Window System + GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config + GLIB_LIBS linker flags for GLIB, overriding pkg-config + GTK_CFLAGS C compiler flags for GTK, overriding pkg-config + GTK_LIBS linker flags for GTK, overriding pkg-config + GTKGLEXT_CFLAGS + C compiler flags for GTKGLEXT, overriding pkg-config + GTKGLEXT_LIBS + linker flags for GTKGLEXT, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +pcb configure 20110918 +generated by GNU Autoconf 2.66 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval "test \"\${$3+set}\"" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by pcb $as_me 20110918, which was +generated by GNU Autoconf 2.66. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='pcb' + VERSION='20110918' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = x""yes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +ac_config_headers="$ac_config_headers config.h" + + +########################################################################## +# +# Try to figure out if we are building from git sources. +# If we are then unless building of the documentation has +# been disabled then just require the user have all the right +# tools. Users building from a tarball won't need latex, makeinfo, +# etc. but if you're already downloading development sources, then +# it is not unreasonable to require development tools. What motivated +# this is that using maintainer mode proved to cause regular confusion. + +pcb_sources="tarball" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you are building from a git checkout" >&5 +$as_echo_n "checking if you are building from a git checkout... " >&6; } +pcb_git_version=no +if test -f $srcdir/.gitignore ; then + pcb_git_version=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + pcb_sources="GIT" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test x$pcb_git_version = xyes; then + GIT_VERSION_TRUE= + GIT_VERSION_FALSE='#' +else + GIT_VERSION_TRUE='#' + GIT_VERSION_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you are building from a anoncvs checkout" >&5 +$as_echo_n "checking if you are building from a anoncvs checkout... " >&6; } +pcb_cvs_version=no +if test -f $srcdir/CVS/Root ; then + pcb_cvs_version=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + pcb_sources="CVS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test x$pcb_cvs_version = xyes; then + CVS_VERSION_TRUE= + CVS_VERSION_FALSE='#' +else + CVS_VERSION_TRUE='#' + CVS_VERSION_FALSE= +fi + + if test x$pcb_git_version = xyes -o x$pcb_cvs_version = xyes; then + GIT_OR_CVS_VERSION_TRUE= + GIT_OR_CVS_VERSION_FALSE='#' +else + GIT_OR_CVS_VERSION_TRUE='#' + GIT_OR_CVS_VERSION_FALSE= +fi + + + +########################################################################## +# +# See if we are supposed to build the docs +# + +docs_yesno=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the documentation should be built" >&5 +$as_echo_n "checking if the documentation should be built... " >&6; } +# Check whether --enable-doc was given. +if test "${enable_doc+set}" = set; then : + enableval=$enable_doc; +if test "X$enable_doc" = "Xno" ; then + DOC="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + docs_yesno=no +else + DOC=doc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + docs_yesno=yes +fi + +else + +DOC=doc +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +docs_yesno=yes + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if maintainer mode is required" >&5 +$as_echo_n "checking if maintainer mode is required... " >&6; } +if test "$docs_yesno" = "yes" -a "$pcb_git_version" = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes -- the documentation build is enabled and your sources are from git" >&5 +$as_echo "yes -- the documentation build is enabled and your sources are from git" >&6; } + enable_maintainer_mode=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows" >&5 +$as_echo_n "checking for windows... " >&6; } +PCB_PATH_DELIMETER=":" +PCB_DIR_SEPARATOR_S="/" +PCB_DIR_SEPARATOR_C='/' +case $host in + *-*-cygwin* ) + CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}" + CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}" + ;; + + *-*-mingw* ) + WIN32=yes + CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}" + CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}" + ;; + + * ) + WIN32=no + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WIN32" >&5 +$as_echo "$WIN32" >&6; } + + if test x$WIN32 = xyes; then + WIN32_TRUE= + WIN32_FALSE='#' +else + WIN32_TRUE='#' + WIN32_FALSE= +fi + +if test "x$WIN32" = "xyes" ; then + PCB_PATH_DELIMETER=";" + PCB_DIR_SEPARATOR_S="\\\\" + PCB_DIR_SEPARATOR_C='\\' +fi + + +cat >>confdefs.h <<_ACEOF +#define PCB_DIR_SEPARATOR_C '$PCB_DIR_SEPARATOR_C' +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PCB_DIR_SEPARATOR_S "$PCB_DIR_SEPARATOR_S" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PCB_PATH_DELIMETER "$PCB_PATH_DELIMETER" +_ACEOF + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +if test "x$WIN32" = "xyes" ; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_WINDRES+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 +$as_echo "$WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_WINDRES"; then + ac_ct_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_WINDRES"; then + ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_WINDRES="windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES +if test -n "$ac_ct_WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5 +$as_echo "$ac_ct_WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_WINDRES" = x; then + WINDRES="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + WINDRES=$ac_ct_WINDRES + fi +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + if test "$WINDRES" = "no" ; then + as_fn_error $? "*** Could not find an implementation of windres in your PATH." "$LINENO" 5 + fi +fi + +# i18n +GETTEXT_PACKAGE=$PACKAGE + +cat >>confdefs.h <<_ACEOF +#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" +_ACEOF + + + + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + rm -f messages.po + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGMERGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +$as_echo "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 +$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } + XGETTEXT=":" + fi + rm -f messages.po + fi + + ac_config_commands="$ac_config_commands default-1" + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror in -lcposix" >&5 +$as_echo_n "checking for strerror in -lcposix... " >&6; } +if test "${ac_cv_lib_cposix_strerror+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcposix $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cposix_strerror=yes +else + ac_cv_lib_cposix_strerror=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cposix_strerror" >&5 +$as_echo "$ac_cv_lib_cposix_strerror" >&6; } +if test "x$ac_cv_lib_cposix_strerror" = x""yes; then : + LIBS="$LIBS -lcposix" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed" >&5 +$as_echo_n "checking for signed... " >&6; } +if test "${bh_cv_c_signed+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +signed char x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bh_cv_c_signed=yes +else + bh_cv_c_signed=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bh_cv_c_signed" >&5 +$as_echo "$bh_cv_c_signed" >&6; } + if test $bh_cv_c_signed = no; then + +$as_echo "#define signed /**/" >>confdefs.h + + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long" >&5 +$as_echo_n "checking for long long... " >&6; } +if test "${ac_cv_type_long_long+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +long long ll = 1LL; int i = 63; +int +main () +{ +long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_type_long_long=yes +else + ac_cv_type_long_long=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long" >&5 +$as_echo "$ac_cv_type_long_long" >&6; } + if test $ac_cv_type_long_long = yes; then + +$as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 +$as_echo_n "checking for long double... " >&6; } +if test "${gt_cv_c_long_double+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$GCC" = yes; then + gt_cv_c_long_double=yes + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* The Stardent Vistra knows sizeof(long double), but does not support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + int array [2*(sizeof(long double) >= sizeof(double)) - 1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_long_double=yes +else + gt_cv_c_long_double=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_long_double" >&5 +$as_echo "$gt_cv_c_long_double" >&6; } + if test $gt_cv_c_long_double = yes; then + +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } +if test "${gt_cv_c_wchar_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wchar_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wchar_t=yes +else + gt_cv_c_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +$as_echo_n "checking for wint_t... " >&6; } +if test "${gt_cv_c_wint_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wint_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wint_t=yes +else + gt_cv_c_wint_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +$as_echo "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if test "${jm_ac_cv_header_inttypes_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +uintmax_t i = (uintmax_t) -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + jm_ac_cv_header_inttypes_h=yes +else + jm_ac_cv_header_inttypes_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $jm_ac_cv_header_inttypes_h" >&5 +$as_echo "$jm_ac_cv_header_inttypes_h" >&6; } + if test $jm_ac_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +$as_echo_n "checking for stdint.h... " >&6; } +if test "${jm_ac_cv_header_stdint_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +uintmax_t i = (uintmax_t) -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + jm_ac_cv_header_stdint_h=yes +else + jm_ac_cv_header_stdint_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $jm_ac_cv_header_stdint_h" >&5 +$as_echo "$jm_ac_cv_header_stdint_h" >&6; } + if test $jm_ac_cv_header_stdint_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +$as_echo_n "checking for intmax_t... " >&6; } +if test "${gt_cv_c_intmax_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + +int +main () +{ +intmax_t x = -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_intmax_t=yes +else + gt_cv_c_intmax_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +$as_echo "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf() supports POSIX/XSI format strings" >&5 +$as_echo_n "checking whether printf() supports POSIX/XSI format strings... " >&6; } +if test "${gt_cv_func_printf_posix+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ + notposix +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "notposix" >/dev/null 2>&1; then : + gt_cv_func_printf_posix="guessing no" +else + gt_cv_func_printf_posix="guessing yes" +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gt_cv_func_printf_posix=yes +else + gt_cv_func_printf_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_printf_posix" >&5 +$as_echo "$gt_cv_func_printf_posix" >&6; } + case $gt_cv_func_printf_posix in + *yes) + +$as_echo "#define HAVE_POSIX_PRINTF 1" >>confdefs.h + + ;; + esac + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if test "${ac_cv_working_alloca_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if test "${ac_cv_func_alloca_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if test "${ac_cv_os_cray+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if test "${ac_cv_c_stack_direction+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +main () +{ + return find_stack_direction () < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5 +$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } +if test "${ac_cv_gnu_library_2_1+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky GNU user" >/dev/null 2>&1; then : + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* + + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether integer division by zero raises SIGFPE" >&5 +$as_echo_n "checking whether integer division by zero raises SIGFPE... " >&6; } +if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + # Guess based on the CPU. + case "$host_cpu" in + alpha* | i3456786 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +static void +#ifdef __cplusplus +sigfpe_handler (int sig) +#else +sigfpe_handler (sig) int sig; +#endif +{ + /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ + exit (sig != SIGFPE); +} + +int x = 1; +int y = 0; +int z; +int nan; + +int main () +{ + signal (SIGFPE, sigfpe_handler); +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) + signal (SIGTRAP, sigfpe_handler); +#endif +/* Linux/SPARC yields signal SIGILL. */ +#if defined (__sparc__) && defined (__linux__) + signal (SIGILL, sigfpe_handler); +#endif + + z = x / y; + nan = y / y; + exit (1); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gt_cv_int_divbyzero_sigfpe=yes +else + gt_cv_int_divbyzero_sigfpe=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_int_divbyzero_sigfpe" >&5 +$as_echo "$gt_cv_int_divbyzero_sigfpe" >&6; } + case "$gt_cv_int_divbyzero_sigfpe" in + *yes) value=1;; + *) value=0;; + esac + +cat >>confdefs.h <<_ACEOF +#define INTDIV0_RAISES_SIGFPE $value +_ACEOF + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long" >&5 +$as_echo_n "checking for unsigned long long... " >&6; } +if test "${ac_cv_type_unsigned_long_long+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned long long ull = 1ULL; int i = 63; +int +main () +{ +unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_type_unsigned_long_long=yes +else + ac_cv_type_unsigned_long_long=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long" >&5 +$as_echo "$ac_cv_type_unsigned_long_long" >&6; } + if test $ac_cv_type_unsigned_long_long = yes; then + +$as_echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>confdefs.h + + fi + + + + + if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then + + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + +cat >>confdefs.h <<_ACEOF +#define uintmax_t $ac_type +_ACEOF + + else + +$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if test "${gt_cv_header_inttypes_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_header_inttypes_h=yes +else + gt_cv_header_inttypes_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_header_inttypes_h" >&5 +$as_echo "$gt_cv_header_inttypes_h" >&6; } + if test $gt_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H 1 +_ACEOF + + fi + + + + if test $gt_cv_header_inttypes_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if test "${gt_cv_inttypes_pri_broken+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_inttypes_pri_broken=no +else + gt_cv_inttypes_pri_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +$as_echo "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +cat >>confdefs.h <<_ACEOF +#define PRI_MACROS_BROKEN 1 +_ACEOF + + fi + + + for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +$as_echo_n "checking for SIZE_MAX... " >&6; } + result= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1; then : + result=yes +fi +rm -f conftest* + + if test -z "$result"; then + if ac_fn_c_compute_int "$LINENO" "~(size_t)0 / 10" "res_hi" "#include "; then : + +else + result=? +fi + + + if ac_fn_c_compute_int "$LINENO" "~(size_t)0 % 10" "res_lo" "#include "; then : + +else + result=? +fi + + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include "; then : + +else + result=? +fi + + + if test "$fits_in_uint" = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern size_t foo; + extern unsigned long foo; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test -z "$result"; then + if test "$fits_in_uint" = 1; then + result="$res_hi$res_lo"U + else + result="$res_hi$res_lo"UL + fi + else + result='~(size_t)0' + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 +$as_echo "$result" >&6; } + if test "$result" != yes; then + +cat >>confdefs.h <<_ACEOF +#define SIZE_MAX $result +_ACEOF + + fi + + + + for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +$as_echo_n "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${acl_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${acl_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if test "${acl_cv_rpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + for ac_func in asprintf fwprintf getcwd getegid geteuid getgid getuid \ +mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ +strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ +__fsetlocking +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _snprintf is declared" >&5 +$as_echo_n "checking whether _snprintf is declared... " >&6; } +if test "${ac_cv_have_decl__snprintf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifndef _snprintf + char *p = (char *) _snprintf; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_decl__snprintf=yes +else + ac_cv_have_decl__snprintf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl__snprintf" >&5 +$as_echo "$ac_cv_have_decl__snprintf" >&6; } + if test $ac_cv_have_decl__snprintf = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF $gt_value +_ACEOF + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _snwprintf is declared" >&5 +$as_echo_n "checking whether _snwprintf is declared... " >&6; } +if test "${ac_cv_have_decl__snwprintf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifndef _snwprintf + char *p = (char *) _snwprintf; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_decl__snwprintf=yes +else + ac_cv_have_decl__snwprintf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl__snwprintf" >&5 +$as_echo "$ac_cv_have_decl__snwprintf" >&6; } + if test $ac_cv_have_decl__snwprintf = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNWPRINTF $gt_value +_ACEOF + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether feof_unlocked is declared" >&5 +$as_echo_n "checking whether feof_unlocked is declared... " >&6; } +if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifndef feof_unlocked + char *p = (char *) feof_unlocked; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_decl_feof_unlocked=yes +else + ac_cv_have_decl_feof_unlocked=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_feof_unlocked" >&5 +$as_echo "$ac_cv_have_decl_feof_unlocked" >&6; } + if test $ac_cv_have_decl_feof_unlocked = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED $gt_value +_ACEOF + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fgets_unlocked is declared" >&5 +$as_echo_n "checking whether fgets_unlocked is declared... " >&6; } +if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifndef fgets_unlocked + char *p = (char *) fgets_unlocked; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_decl_fgets_unlocked=yes +else + ac_cv_have_decl_fgets_unlocked=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_fgets_unlocked" >&5 +$as_echo "$ac_cv_have_decl_fgets_unlocked" >&6; } + if test $ac_cv_have_decl_fgets_unlocked = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED $gt_value +_ACEOF + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getc_unlocked is declared" >&5 +$as_echo_n "checking whether getc_unlocked is declared... " >&6; } +if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifndef getc_unlocked + char *p = (char *) getc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_decl_getc_unlocked=yes +else + ac_cv_have_decl_getc_unlocked=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_getc_unlocked" >&5 +$as_echo "$ac_cv_have_decl_getc_unlocked" >&6; } + if test $ac_cv_have_decl_getc_unlocked = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED $gt_value +_ACEOF + + + + case $gt_cv_func_printf_posix in + *yes) HAVE_POSIX_PRINTF=1 ;; + *) HAVE_POSIX_PRINTF=0 ;; + esac + + if test "$ac_cv_func_asprintf" = yes; then + HAVE_ASPRINTF=1 + else + HAVE_ASPRINTF=0 + fi + + if test "$ac_cv_func_snprintf" = yes; then + HAVE_SNPRINTF=1 + else + HAVE_SNPRINTF=0 + fi + + if test "$ac_cv_func_wprintf" = yes; then + HAVE_WPRINTF=1 + else + HAVE_WPRINTF=0 + fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } +if test "${am_cv_func_iconv+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +$as_echo_n "checking for iconv declaration... " >&6; } + if test "${am_cv_proto_iconv+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_cv_proto_iconv_arg1="" +else + am_cv_proto_iconv_arg1="const" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +$as_echo "${ac_t:- + }$am_cv_proto_iconv" >&6; } + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if test "${am_cv_langinfo_codeset+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char* cs = nl_langinfo(CODESET); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_langinfo_codeset=yes +else + am_cv_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + if test $ac_cv_header_locale_h = yes; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if test "${am_cv_val_LC_MESSAGES+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_val_LC_MESSAGES=yes +else + am_cv_val_LC_MESSAGES=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 +$as_echo "$am_cv_val_LC_MESSAGES" >&6; } + if test $am_cv_val_LC_MESSAGES = yes; then + +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h + + fi + + fi + + for ac_prog in bison +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_INTLBISON+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$INTLBISON"; then + ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_INTLBISON="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +INTLBISON=$ac_cv_prog_INTLBISON +if test -n "$INTLBISON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLBISON" >&5 +$as_echo "$INTLBISON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$INTLBISON" && break +done + + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of bison" >&5 +$as_echo_n "checking version of bison... " >&6; } + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 +$as_echo "$ac_prog_version" >&6; } + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + + LIBINTL= + LTLIBINTL= + POSUB= + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether included gettext is requested" >&5 +$as_echo_n "checking whether included gettext is requested... " >&6; } + +# Check whether --with-included-gettext was given. +if test "${with_included_gettext+set}" = set; then : + withval=$with_included_gettext; nls_cv_force_use_gnu_gettext=$withval +else + nls_cv_force_use_gnu_gettext=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nls_cv_force_use_gnu_gettext" >&5 +$as_echo "$nls_cv_force_use_gnu_gettext" >&6; } + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +$as_echo_n "checking for GNU gettext in libc... " >&6; } +if test "${gt_cv_func_gnugettext1_libc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_gnugettext1_libc=yes +else + gt_cv_func_gnugettext1_libc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libc" >&5 +$as_echo "$gt_cv_func_gnugettext1_libc" >&6; } + + if test "$gt_cv_func_gnugettext1_libc" != "yes"; then + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test "${with_libintl_prefix+set}" = set; then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +$as_echo_n "checking for GNU gettext in libintl... " >&6; } +if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_gnugettext1_libintl=yes +else + gt_cv_func_gnugettext1_libintl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext1_libintl=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libintl" >&5 +$as_echo "$gt_cv_func_gnugettext1_libintl" >&6; } + fi + + if test "$gt_cv_func_gnugettext1_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV" + LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + CATOBJEXT=.gmo + fi + + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +$as_echo_n "checking whether to use NLS... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +$as_echo_n "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +$as_echo "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +$as_echo_n "checking how to link with libintl... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +$as_echo "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + +$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + + + + + nls_cv_header_intl= + nls_cv_header_libgt= + + DATADIRNAME=share + + + INSTOBJEXT=.mo + + + GENCAT=gencat + + + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + + + INTL_LIBTOOL_SUFFIX_PREFIX= + + + + INTLLIBS="$LIBINTL" + + + + + + + + +case "$am__api_version" in + 1.01234) + as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 + ;; + *) + ;; +esac + +if test -n "0.35.0"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= 0.35.0" >&5 +$as_echo_n "checking for intltool >= 0.35.0... " >&6; } + + INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.35.0 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 +$as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } + test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || + as_fn_error $? "Your intltool is too old. You need intltool 0.35.0 or later." "$LINENO" 5 +fi + +# Extract the first word of "intltool-update", so it can be a program name with args. +set dummy intltool-update; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_UPDATE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_UPDATE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE +if test -n "$INTLTOOL_UPDATE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 +$as_echo "$INTLTOOL_UPDATE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "intltool-merge", so it can be a program name with args. +set dummy intltool-merge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_MERGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_MERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE +if test -n "$INTLTOOL_MERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 +$as_echo "$INTLTOOL_MERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "intltool-extract", so it can be a program name with args. +set dummy intltool-extract; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_EXTRACT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_EXTRACT in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT +if test -n "$INTLTOOL_EXTRACT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 +$as_echo "$INTLTOOL_EXTRACT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 +fi + + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< $@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< $@' + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# Check the gettext tools to make sure they are GNU +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $XGETTEXT in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +XGETTEXT=$ac_cv_path_XGETTEXT +if test -n "$XGETTEXT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGMERGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MSGMERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGMERGE=$ac_cv_path_MSGMERGE +if test -n "$MSGMERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGFMT=$ac_cv_path_MSGFMT +if test -n "$MSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_PERL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL +if test -n "$INTLTOOL_PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 +$as_echo "$INTLTOOL_PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$INTLTOOL_PERL"; then + as_fn_error $? "perl not found" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 +$as_echo_n "checking for perl >= 5.8.1... " >&6; } +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 +$as_echo "$IT_PERL_VERSION" >&6; } +fi +if test "x" != "xno-xml"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 +$as_echo_n "checking for XML::Parser... " >&6; } + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + else + as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile + + +# Set DATADIRNAME correctly if it is not set yet +# (copied from glib-gettext.m4) +if test -z "$DATADIRNAME"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + DATADIRNAME=share +else + case $host in + *-*-solaris*) + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + DATADIRNAME=share +else + DATADIRNAME=lib +fi + + ;; + *) + DATADIRNAME=lib + ;; + esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if test "${ac_cv_prog_cc_c99+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if test "${ac_cv_prog_cc_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LEX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LEX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +$as_echo "$LEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { yyless (input () != 0); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; +#endif +int +main (void) +{ + return ! yylex () + ! yywrap (); +} +_ACEOF +{ { ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 +$as_echo_n "checking lex output file root... " >&6; } +if test "${ac_cv_prog_lex_root+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +$as_echo "$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test -z "${LEXLIB+set}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 +$as_echo_n "checking lex library... " >&6; } +if test "${ac_cv_lib_lex+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' + for ac_lib in '' -lfl -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lex=$ac_lib +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +$as_echo "$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +$as_echo_n "checking whether yytext is a pointer... " >&6; } +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +ac_save_LIBS=$LIBS +LIBS="$LEXLIB $ac_save_LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define YYTEXT_POINTER 1 +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_prog_lex_yytext_pointer=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h + +fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c + +fi +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi +# Extract the first word of "$LEX", so it can be a program name with args. +set dummy $LEX; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_LEX_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $LEX_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_LEX_PATH="$LEX_PATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_LEX_PATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_LEX_PATH" && ac_cv_path_LEX_PATH="notfound" + ;; +esac +fi +LEX_PATH=$ac_cv_path_LEX_PATH +if test -n "$LEX_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX_PATH" >&5 +$as_echo "$LEX_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$LEX_PATH" = "notfound" ; then + as_fn_error $? "Couldn't find a usable lex program. +Please install flex which is available from +ftp://ftp.gnu.org/pub/non-gnu/flex/ +" "$LINENO" 5 +fi + + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_YACC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +# Extract the first word of "$YACC", so it can be a program name with args. +set dummy $YACC; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_YACC_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $YACC_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_YACC_PATH="$YACC_PATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_YACC_PATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_YACC_PATH" && ac_cv_path_YACC_PATH="notfound" + ;; +esac +fi +YACC_PATH=$ac_cv_path_YACC_PATH +if test -n "$YACC_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC_PATH" >&5 +$as_echo "$YACC_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$YACC_PATH" = "notfound" ; then + as_fn_error $? "Couldn't find a usable yacc program. +Please install bison which is available from +ftp://ftp.gnu.org/pub/gnu/bison/ +" "$LINENO" 5 +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +# +# Used for building the icons +# +# Extract the first word of "xpmtoppm", so it can be a program name with args. +set dummy xpmtoppm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XPMTOPPM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $XPMTOPPM in + [\\/]* | ?:[\\/]*) + ac_cv_path_XPMTOPPM="$XPMTOPPM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XPMTOPPM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_XPMTOPPM" && ac_cv_path_XPMTOPPM="notfound" + ;; +esac +fi +XPMTOPPM=$ac_cv_path_XPMTOPPM +if test -n "$XPMTOPPM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XPMTOPPM" >&5 +$as_echo "$XPMTOPPM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ppmtowinicon", so it can be a program name with args. +set dummy ppmtowinicon; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PPMTOWINICON+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PPMTOWINICON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PPMTOWINICON="$PPMTOWINICON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PPMTOWINICON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PPMTOWINICON" && ac_cv_path_PPMTOWINICON="notfound" + ;; +esac +fi +PPMTOWINICON=$ac_cv_path_PPMTOWINICON +if test -n "$PPMTOWINICON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PPMTOWINICON" >&5 +$as_echo "$PPMTOWINICON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "convert", so it can be a program name with args. +set dummy convert; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CONVERT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $CONVERT in + [\\/]* | ?:[\\/]*) + ac_cv_path_CONVERT="$CONVERT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CONVERT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CONVERT" && ac_cv_path_CONVERT="notfound" + ;; +esac +fi +CONVERT=$ac_cv_path_CONVERT +if test -n "$CONVERT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONVERT" >&5 +$as_echo "$CONVERT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +########################################################################## +# +# +if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then + # Extract the first word of "makeinfo", so it can be a program name with args. +set dummy makeinfo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MKINFO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MKINFO in + [\\/]* | ?:[\\/]*) + ac_cv_path_MKINFO="$MKINFO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MKINFO="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_MKINFO" && ac_cv_path_MKINFO="no" + ;; +esac +fi +MKINFO=$ac_cv_path_MKINFO +if test -n "$MKINFO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKINFO" >&5 +$as_echo "$MKINFO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "X$MKINFO" != "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU makeinfo version >= 4.6" >&5 +$as_echo_n "checking for GNU makeinfo version >= 4.6... " >&6; } + v=`$MKINFO --version | grep "GNU texinfo"` + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: non-GNU" >&5 +$as_echo "non-GNU" >&6; } + MKINFO="no" + fi + fi + if test "X$MKINFO" != "Xno"; then + vmajor=`echo "$v" | sed 's/.* \([0-9]*\)\.\([0-9]*\)$/\1/'` + vminor=`echo "$v" | sed 's/.* \([0-9]*\)\.\([0-9]*\)$/\2/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vmajor.$vminor" >&5 +$as_echo "$vmajor.$vminor" >&6; } + if test "$vmajor" -lt 4 \ + || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then + MKINFO=no + fi + fi + if test "X$MKINFO" = "Xno"; then + as_fn_error $? "You have requested a build +of the documentation. For this to work, you must have version 4.6 or newer of +the GNU texinfo package. You seem to have + +$v + +Please update to a newer version of texinfo or disable building of +the documentation with --disable-doc +" "$LINENO" 5 + fi + + # Extract the first word of "texi2dvi", so it can be a program name with args. +set dummy texi2dvi; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_TEXI2DVI+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $TEXI2DVI in + [\\/]* | ?:[\\/]*) + ac_cv_path_TEXI2DVI="$TEXI2DVI" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_TEXI2DVI="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_TEXI2DVI" && ac_cv_path_TEXI2DVI="no" + ;; +esac +fi +TEXI2DVI=$ac_cv_path_TEXI2DVI +if test -n "$TEXI2DVI"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2DVI" >&5 +$as_echo "$TEXI2DVI" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "X$TEXI2DVI" = "Xno"; then + as_fn_error $? "You have requested a build +of the documentation. For this to work, you must have the texi2dvi program +installed. Alternatively, you can disable building the documentation with +--disable-doc." "$LINENO" 5 + fi + + + # Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PERL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="notfound" + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "X$PERL" = "Xnotfound"; then + as_fn_error $? "You have requested a build +of the documentation. For this to work, you must have perl installed. +Alternatively, you can disable building the documentation with +--disable-doc. +" "$LINENO" 5 + fi + + + # Extract the first word of "kpsewhich", so it can be a program name with args. +set dummy kpsewhich; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_KPSEWHICH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $KPSEWHICH in + [\\/]* | ?:[\\/]*) + ac_cv_path_KPSEWHICH="$KPSEWHICH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_KPSEWHICH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_KPSEWHICH" && ac_cv_path_KPSEWHICH="no" + ;; +esac +fi +KPSEWHICH=$ac_cv_path_KPSEWHICH +if test -n "$KPSEWHICH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KPSEWHICH" >&5 +$as_echo "$KPSEWHICH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "X$KPSEWHICH" = "Xno"; then + as_fn_error $? "You have requested a build +of the documentation. For this to work, you must have a functional install of +TeX and LaTeX. kpsewhich is part of TeX. +Alternatively, you can disable building the documentation with +--disable-doc." "$LINENO" 5 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking If your TeX installation contains epsf.tex" >&5 +$as_echo_n "checking If your TeX installation contains epsf.tex... " >&6; } + f=`$KPSEWHICH epsf.tex` + if test $? -eq 0 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($f)" >&5 +$as_echo "yes ($f)" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "You have requested a build +of the documentation. For this to work, you must have a functional install of +TeX and LaTeX that includes epsf.tex. On some linux distributions this is +part of the texlive-generic-recommended package. +Alternatively, you can disable building the documentation with +--disable-doc." "$LINENO" 5 + fi + +fi + +########################################################################## +# +# + +# FIXME: for now, only try to add -rdynamic if we're using gcc. We really +# need to figure out what the correct test is here. In the mean time, this +# should let things build with SunPRO again. +if test "x$GCC" = "xyes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking If the compiler accepts -rdynamic" >&5 +$as_echo_n "checking If the compiler accepts -rdynamic... " >&6; } +old_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -rdynamic" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + LDFLAGS="$old_LDFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +# ------------- HID config ------------------- + +hid_guis="" +hid_printers="" +hid_exporters="" +hid_always="" + +for hid in `cd $srcdir/src/hid; echo *`; do + F=$srcdir/src/hid/$hid/hid.conf + if test -f $F + then + echo checking $F + . $F + case $type in + gui ) hid_guis="$hid_guis $hid" ;; + printer ) hid_printers="$hid_printers $hid" ;; + export ) hid_exporters="$hid_exporters $hid" ;; + always ) hid_always="$hid_always $hid" ;; + esac + fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which gui to use" >&5 +$as_echo_n "checking for which gui to use... " >&6; } + +# Check whether --with-gui was given. +if test "${with_gui+set}" = set; then : + withval=$with_gui; +else + with_gui=gtk + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gui" >&5 +$as_echo "$with_gui" >&6; } +case " $hid_guis no none " in + *\ $with_gui\ * ) HIDLIST="$with_gui" ;; + * ) as_fn_error $? "$with_gui is not a valid gui" "$LINENO" 5 ;; +esac + +if test x"$with_gui" = x"none" -o x"$with_gui" = x"no" +then + HIDLIST= +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable toporouter" >&5 +$as_echo_n "checking whether to enable toporouter... " >&6; } +# Check whether --enable-toporouter was given. +if test "${enable_toporouter+set}" = set; then : + enableval=$enable_toporouter; +fi + +case "x$enable_toporouter" in #( + xyes | xno) : + ;; #( + *) : + enable_toporouter=yes + + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_toporouter" >&5 +$as_echo "$enable_toporouter" >&6; } + if test $enable_toporouter != no; then + WITH_TOPOROUTER_TRUE= + WITH_TOPOROUTER_FALSE='#' +else + WITH_TOPOROUTER_TRUE='#' + WITH_TOPOROUTER_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable toporouter output" >&5 +$as_echo_n "checking whether to enable toporouter output... " >&6; } +# Check whether --enable-toporouter-output was given. +if test "${enable_toporouter_output+set}" = set; then : + enableval=$enable_toporouter_output; +fi + +case "z$enable_toporouter_output" in #( + zyes | zno) : + ;; #( + *) : + enable_toporouter_output=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_toporouter_output" >&5 +$as_echo "$enable_toporouter_output" >&6; } +case $enable_toporouter_output in #( + yes) : + + topo_output_enabled=1 + ;; #( + *) : + + topo_output_enabled=0 + + ;; +esac + +cat >>confdefs.h <<_ACEOF +#define TOPO_OUTPUT_ENABLED $topo_output_enabled +_ACEOF + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +if test "x$enable_toporouter_output" = "xyes"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 +$as_echo_n "checking for CAIRO... " >&6; } + +if test -n "$CAIRO_CFLAGS"; then + pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CAIRO_LIBS"; then + pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "cairo" 2>&1` + else + CAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors "cairo" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CAIRO_PKG_ERRORS" >&5 + + as_fn_error $? "Cannot find cairo, needed by the toporouter +Please review the following errors: +$CAIRO_PKG_ERRORS" "$LINENO" 5 + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Cannot find cairo, needed by the toporouter +Please review the following errors: +$CAIRO_PKG_ERRORS" "$LINENO" 5 + +else + CAIRO_CFLAGS=$pkg_cv_CAIRO_CFLAGS + CAIRO_LIBS=$pkg_cv_CAIRO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use DBUS" >&5 +$as_echo_n "checking for whether to use DBUS... " >&6; } +# Check whether --enable-dbus was given. +if test "${enable_dbus+set}" = set; then : + enableval=$enable_dbus; +else + + case " $with_gui " in + *\ gtk\ *) enable_dbus=yes ;; + *\ lesstif\ *) enable_dbus=yes ;; + * ) enable_dbus=no ;; + esac + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dbus" >&5 +$as_echo "$enable_dbus" >&6; } + if test x$enable_dbus = xyes; then + WITH_DBUS_TRUE= + WITH_DBUS_FALSE='#' +else + WITH_DBUS_TRUE='#' + WITH_DBUS_FALSE= +fi + + +if test "x$enable_dbus" = "xyes"; then + case " $with_gui " in + *\ gtk\ *) ;; + *\ lesstif\ *) ;; + * ) as_fn_error $? "DBUS enabled but only works with a mainloop capable GUI HID. +Either do not use --enable-dbus or enable the gtk or lesstif GUI HID." "$LINENO" 5 + esac + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 +$as_echo_n "checking for DBUS... " >&6; } + +if test -n "$DBUS_CFLAGS"; then + pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.61\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.61") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 0.61" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DBUS_LIBS"; then + pkg_cv_DBUS_LIBS="$DBUS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.61\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.61") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 0.61" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-1 >= 0.61" 2>&1` + else + DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-1 >= 0.61" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DBUS_PKG_ERRORS" >&5 + + as_fn_error $? "Cannot find dbus-1 >= 0.61, install it and rerun ./configure +Please review the following errors: +$DBUS_PKG_ERRORS" "$LINENO" 5 + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Cannot find dbus-1 >= 0.61, install it and rerun ./configure +Please review the following errors: +$DBUS_PKG_ERRORS" "$LINENO" 5 + +else + DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS + DBUS_LIBS=$pkg_cv_DBUS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + saved_LIBS="$LIBS" + LIBS="$LIBS $DBUS_LIBS" + for ac_func in dbus_watch_get_unix_fd +do : + ac_fn_c_check_func "$LINENO" "dbus_watch_get_unix_fd" "ac_cv_func_dbus_watch_get_unix_fd" +if test "x$ac_cv_func_dbus_watch_get_unix_fd" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DBUS_WATCH_GET_UNIX_FD 1 +_ACEOF + +fi +done + + LIBS="$saved_LIBS" +fi + DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion` + + +$as_echo "#define HAVE_DBUS 1" >>confdefs.h + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use GL drawing" >&5 +$as_echo_n "checking for whether to use GL drawing... " >&6; } +# Check whether --enable-gl was given. +if test "${enable_gl+set}" = set; then : + enableval=$enable_gl; +else + + case " $with_gui " in + *\ gtk\ *) enable_gl=yes;; + * ) enable_gl=no;; + esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gl" >&5 +$as_echo "$enable_gl" >&6; } + if test x$enable_gl = xyes; then + USE_GL_TRUE= + USE_GL_FALSE='#' +else + USE_GL_TRUE='#' + USE_GL_FALSE= +fi + + +if test "x$enable_gl" = "xyes"; then + case " $with_gui " in + *\ gtk\ *) ;; + * ) as_fn_error $? "GL drawing enabled but only works with the GTK HID. +Either do not use --enable-gl or enable the gtk HID." "$LINENO" 5 + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R7/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R7 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R7/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R7 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # We can compile using X headers with no special include directory. +ac_x_includes= +else + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +$as_echo_n "checking whether pthreads work with $flag... " >&6; } + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ax_pthread_config+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static void routine(void* a) {a=0;} + static void* start_routine(void* a) {return a;} +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_create(&th,0,start_routine,0); + pthread_cleanup_pop(0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int attr=$attr; return attr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + attr_name=$attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +$as_echo "$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 +$as_echo "${flag}" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + for ac_prog in xlc_r cc_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" + + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Microsoft C compiler" >&5 +$as_echo_n "checking whether we are using the Microsoft C compiler... " >&6; } +if test "${ax_cv_c_compiler_ms+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef _MSC_VER + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_compiler_ms=yes +else + ax_compiler_ms=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ax_cv_c_compiler_ms=$ax_compiler_ms + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_ms" >&5 +$as_echo "$ax_cv_c_compiler_ms" >&6; } +if test X$ax_compiler_ms = Xno; then : + GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS}" +fi + +# +# Use x_includes and x_libraries if they have been set (presumably by +# AC_PATH_X). +# +if test X$no_x != Xyes -a -n "$x_includes"; then : + GL_CFLAGS="-I$x_includes $GL_CFLAGS" +fi + +for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + +fi + +done + + +ax_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$GL_CFLAGS $CPPFLAGS" +for ac_header in GL/gl.h OpenGL/gl.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif + +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +CPPFLAGS=$ax_save_CPPFLAGS + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL library" >&5 +$as_echo_n "checking for OpenGL library... " >&6; } +if test "${ax_cv_check_gl_libgl+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_check_gl_libgl=no +case $host_cpu in + x86_64) ax_check_gl_libdir=lib64 ;; + *) ax_check_gl_libdir=lib ;; +esac +ax_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $GL_CFLAGS" +ax_save_LDFLAGS=$LDFLAGS +if test X$no_x != Xyes -a -n "$x_libraries"; then : + LDFLAGS="$LDFLAGS -L$x_libraries" +fi +ax_save_LIBS=$LIBS +ax_check_libs="-lopengl32 -lGL" +for ax_lib in $ax_check_libs; do + if test X$ax_compiler_ms = Xyes; then : + ax_try_lib=`echo $ax_lib | $SED -e 's/^-l//' -e 's/$/.lib/'` +else + ax_try_lib=$ax_lib +fi + LDFLAGS="$ax_save_LDFLAGS $GL_LIBS" + LIBS="$ax_try_lib $ax_save_LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl=$ax_try_lib; break +else + ax_check_gl_nvidia_flags="-L/usr/$ax_check_gl_libdir/nvidia" + LDFLAGS="$ax_save_LDFLAGS $GL_LIBS $ax_check_gl_nvidia_flags" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl="$ax_check_gl_nvidia_flags $ax_try_lib"; break +else + ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' + LDFLAGS="$ax_save_LDFLAGS $GL_LIBS $ax_check_gl_dylib_flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl="$ax_check_gl_dylib_flag $ax_try_lib"; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +done + +# +# If no_x is "yes", we don't want to wind up using a libGL that is +# linked with X11. Test to see if the found libGL includes GLX +# functions. If it does and no_x is "yes", we want to reset +# ax_cv_check_gl_libgl back to "no". +# +# Note that LDFLAGS and LIBS should still have whatever values they +# had when we broke out of the test loop above; use that. +# +if test "X$ax_cv_check_gl_libgl" != Xno; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glXQueryVersion(0, 0, 0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if test X$no_x = Xyes; then : + ax_cv_check_gl_libgl=no +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +LIBS=$ax_save_LIBS +if test "X$ax_cv_check_gl_libgl" = Xno -a X$no_x = Xyes; then : + LDFLAGS="$ax_save_LDFLAGS -framework OpenGL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl='-framework OpenGL' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +LDFLAGS=$ax_save_LDFLAGS +CPPFLAGS=$ax_save_CPPFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_libgl" >&5 +$as_echo "$ax_cv_check_gl_libgl" >&6; } + +if test "X$ax_cv_check_gl_libgl" = Xno; then : + no_gl=yes; GL_CFLAGS=""; GL_LIBS="" +else + GL_LIBS="$ax_cv_check_gl_libgl $GL_LIBS" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + if test X$no_gl = Xyes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "OpenGL is required. +See \`config.log' for more details" "$LINENO" 5; } +fi + + +GLU_CFLAGS=$GL_CFLAGS + +ax_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$GL_CFLAGS $CPPFLAGS" +for ac_header in GL/glu.h OpenGL/glu.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif + +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +CPPFLAGS=$ax_save_CPPFLAGS + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility library" >&5 +$as_echo_n "checking for OpenGL Utility library... " >&6; } +if test "${ax_cv_check_glu_libglu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_check_glu_libglu=no +ax_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$GL_CFLAGS $CPPFLAGS" +ax_save_LDFLAGS=$LDFLAGS +ax_save_LIBS=$LIBS + +# +# First, check for the possibility that everything we need is already in +# GL_LIBS. +# +LDFLAGS="$ax_save_LDFLAGS $GL_LIBS" +# +# libGLU typically links with libstdc++ on POSIX platforms. +# However, setting the language to C++ means that test program +# source is named "conftest.cc"; and Microsoft cl doesn't know what +# to do with such a file. +# +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test X$ax_compiler_ms = Xyes; then : + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLU_H +# include +# elif defined(HAVE_OPENGL_GLU_H) +# include +# else +# error no glu.h +# endif +int +main () +{ +gluBeginCurve(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_glu_libglu=yes +else + LIBS="" + ax_check_libs="-lglu32 -lGLU" + for ax_lib in ${ax_check_libs}; do + if test X$ax_compiler_ms = Xyes; then : + ax_try_lib=`echo $ax_lib | $SED -e 's/^-l//' -e 's/$/.lib/'` +else + ax_try_lib=$ax_lib +fi + LIBS="$ax_try_lib $ax_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLU_H +# include +# elif defined(HAVE_OPENGL_GLU_H) +# include +# else +# error no glu.h +# endif +int +main () +{ +gluBeginCurve(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_glu_libglu=$ax_try_lib; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test X$ax_compiler_ms = Xyes; then : + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +LIBS=$ax_save_LIBS +LDFLAGS=$ax_save_LDFLAGS +CPPFLAGS=$ax_save_CPPFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_libglu" >&5 +$as_echo "$ax_cv_check_glu_libglu" >&6; } +if test "X$ax_cv_check_glu_libglu" = Xno; then : + no_glu=yes; GLU_CFLAGS=""; GLU_LIBS="" +else + if test "X$ax_cv_check_glu_libglu" = Xyes; then : + GLU_LIBS="" +else + GLU_LIBS="$ax_cv_check_glu_libglu" +fi +fi + + + +# +# Some versions of Mac OS X include a broken interpretation of the GLU +# tesselation callback function signature when using the C++ compiler. +# +if test "X$ax_cv_check_glu_libglu" != Xno; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for varargs GLU tesselator callback function type" >&5 +$as_echo_n "checking for varargs GLU tesselator callback function type... " >&6; } +if test "${ax_cv_varargs_glu_tesscb+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ax_cv_varargs_glu_tesscb=no + ax_save_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$GL_CFLAGS $CXXFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# ifdef HAVE_GL_GLU_H +# include +# else +# include +# endif +int +main () +{ +GLvoid (*func)(...); gluTessCallback(0, 0, func) + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_varargs_glu_tesscb=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_save_CXXFLAGS + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5 +$as_echo "$ax_cv_varargs_glu_tesscb" >&6; } + if test X$ax_cv_varargs_glu_tesscb = Xyes; then : + +$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h + +fi +fi + + if test X$no_glu = Xyes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The OpenGL GLU library is required. +See \`config.log' for more details" "$LINENO" 5; } +fi + + +$as_echo "#define ENABLE_GL 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which printer to use" >&5 +$as_echo_n "checking for which printer to use... " >&6; } + +# Check whether --with-printer was given. +if test "${with_printer+set}" = set; then : + withval=$with_printer; +else + with_printer=lpr +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_printer" >&5 +$as_echo "$with_printer" >&6; } +case " $hid_printers " in + *\ $with_printer\ * ) + HIDLIST="$HIDLIST $with_printer" + ;; + * ) as_fn_error $? "$with_printer is not a valid printer" "$LINENO" 5 ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which exporters to use" >&5 +$as_echo_n "checking for which exporters to use... " >&6; } + +# Check whether --with-exporters was given. +if test "${with_exporters+set}" = set; then : + withval=$with_exporters; +else + with_exporters=$hid_exporters +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_exporters" >&5 +$as_echo "$with_exporters" >&6; } +for e in `echo $with_exporters | sed 's/,/ /g'`; do + case " $hid_exporters " in + *\ $e\ * ) + HIDLIST="$HIDLIST $e" + ;; + * ) as_fn_error $? "$e is not a valid exporter" "$LINENO" 5 ;; + esac +done + +if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then + case " ${HIDLIST} " in + *\ png\ *) + as_fn_error $? "you have requested the png HID but turned off all output +formats! If you do not want gif/jpeg/png output, use --with-exporters to list +which exporters you want and do not list png there." "$LINENO" 5 + ;; + + *) + ;; + esac +fi + +for hid in $HIDLIST; do + F=$srcdir/src/hid/$hid/hid.conf + if test -f $F ; then + echo checking $hid depedencies + deps= + . $F + for dep in $deps; do + if test "X`echo $HIDLIST | grep $dep`" = "X"; then + as_fn_error $? "you have requested the $hid HID but not the $dep HID, which it depends on" "$LINENO" 5 + fi + done + fi +done + +for e in $HIDLIST; do + HIDLIBS="$HIDLIBS lib$e.a" +done + + + + +# ------------- end HID config ------------------- + +###################################################################### +# +# desktop integration +# + +# Extract the first word of "env", so it can be a program name with args. +set dummy env; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SETENV+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $SETENV in + [\\/]* | ?:[\\/]*) + ac_cv_path_SETENV="$SETENV" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SETENV="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +SETENV=$ac_cv_path_SETENV +if test -n "$SETENV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETENV" >&5 +$as_echo "$SETENV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gtk-update-icon-path", so it can be a program name with args. +set dummy gtk-update-icon-path; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GTK_UPDATE_ICON_CACHE_BIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GTK_UPDATE_ICON_CACHE_BIN in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTK_UPDATE_ICON_CACHE_BIN="$GTK_UPDATE_ICON_CACHE_BIN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GTK_UPDATE_ICON_CACHE_BIN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GTK_UPDATE_ICON_CACHE_BIN" && ac_cv_path_GTK_UPDATE_ICON_CACHE_BIN="true" + ;; +esac +fi +GTK_UPDATE_ICON_CACHE_BIN=$ac_cv_path_GTK_UPDATE_ICON_CACHE_BIN +if test -n "$GTK_UPDATE_ICON_CACHE_BIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_UPDATE_ICON_CACHE_BIN" >&5 +$as_echo "$GTK_UPDATE_ICON_CACHE_BIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +# Change default location for XDG files (MIME and Icons) + +# Check whether --with-xdgdatadir was given. +if test "${with_xdgdatadir+set}" = set; then : + withval=$with_xdgdatadir; opt_xdgdatadir=$withval +fi + + +# Change default location for KDE data files (KDE MIME registrations) + +# Check whether --with-kdedatadir was given. +if test "${with_kdedatadir+set}" = set; then : + withval=$with_kdedatadir; opt_kdedatadir=$withval +fi + + +if test x$opt_xdgdatadir = x; then + # path was not specified with --with-xdgdatadir + XDGDATADIR='${datadir}' +else + # path WAS specified with --with-xdgdatadir + XDGDATADIR="$opt_xdgdatadir" +fi + + +if test x$opt_kdedatadir = x; then + # path was not specified with --with-kdedatadir + KDEDATADIR='${datadir}' +else + # path WAS specified with --with-kdedatadir + KDEDATADIR="$opt_kdedatadir" +fi + + +# Check whether --enable-update-desktop-database was given. +if test "${enable_update_desktop_database+set}" = set; then : + enableval=$enable_update_desktop_database; +else + enable_update_desktop_database=yes +fi + + + if test x$enable_update_desktop_database = xyes; then + ENABLE_UPDATE_DESKTOP_DATABASE_TRUE= + ENABLE_UPDATE_DESKTOP_DATABASE_FALSE='#' +else + ENABLE_UPDATE_DESKTOP_DATABASE_TRUE='#' + ENABLE_UPDATE_DESKTOP_DATABASE_FALSE= +fi + + +if test x$enable_update_desktop_database = xyes ; then + # Extract the first word of "update-desktop-database", so it can be a program name with args. +set dummy update-desktop-database; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_UPDATE_DESKTOP_DATABASE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $UPDATE_DESKTOP_DATABASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_UPDATE_DESKTOP_DATABASE="$UPDATE_DESKTOP_DATABASE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_UPDATE_DESKTOP_DATABASE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_UPDATE_DESKTOP_DATABASE" && ac_cv_path_UPDATE_DESKTOP_DATABASE="no" + ;; +esac +fi +UPDATE_DESKTOP_DATABASE=$ac_cv_path_UPDATE_DESKTOP_DATABASE +if test -n "$UPDATE_DESKTOP_DATABASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UPDATE_DESKTOP_DATABASE" >&5 +$as_echo "$UPDATE_DESKTOP_DATABASE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test $UPDATE_DESKTOP_DATABASE = no; then + as_fn_error $? "Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database" "$LINENO" 5 + fi +fi + +# Check whether --enable-update-mime-database was given. +if test "${enable_update_mime_database+set}" = set; then : + enableval=$enable_update_mime_database; +else + enable_update_mime_database=yes +fi + + + if test x$enable_update_mime_database = xyes; then + ENABLE_UPDATE_MIME_DATABASE_TRUE= + ENABLE_UPDATE_MIME_DATABASE_FALSE='#' +else + ENABLE_UPDATE_MIME_DATABASE_TRUE='#' + ENABLE_UPDATE_MIME_DATABASE_FALSE= +fi + + +if test x$enable_update_mime_database = xyes ; then + # Extract the first word of "update-mime-database", so it can be a program name with args. +set dummy update-mime-database; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_UPDATE_MIME_DATABASE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $UPDATE_MIME_DATABASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_UPDATE_MIME_DATABASE="$UPDATE_MIME_DATABASE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_UPDATE_MIME_DATABASE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_UPDATE_MIME_DATABASE" && ac_cv_path_UPDATE_MIME_DATABASE="no" + ;; +esac +fi +UPDATE_MIME_DATABASE=$ac_cv_path_UPDATE_MIME_DATABASE +if test -n "$UPDATE_MIME_DATABASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UPDATE_MIME_DATABASE" >&5 +$as_echo "$UPDATE_MIME_DATABASE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test $UPDATE_MIME_DATABASE = no; then + as_fn_error $? "Cannot find update-mime-database, make sure it is installed and in your PATH, or configure with --disable-update-mime-database" "$LINENO" 5 + fi +fi + +# +###################################################################### + +for ac_prog in gm4 m4 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_M4+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $M4 in + [\\/]* | ?:[\\/]*) + ac_cv_path_M4="$M4" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_M4="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +M4=$ac_cv_path_M4 +if test -n "$M4"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4" >&5 +$as_echo "$M4" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$M4" && break +done +test -n "$M4" || M4="none" + +if test "X$M4" = "Xnone" ; then + as_fn_error $? "Did not find a m4 executible. You need to make sure + that m4 is installed on your system and that m4 is in your path" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $M4 has the division involving negative numbers bug" >&5 +$as_echo_n "checking if $M4 has the division involving negative numbers bug... " >&6; } +pcb_m4_r=`echo "eval(-2/2)" | $M4` +if test "$pcb_m4_r" != "-1" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + as_fn_error $? "It appears that $M4 has a bug involving division +with negative numbers. In particular it just returned the result that +-2/2 = $pcb_m4_r instead of -1. This is a known bug in GNU m4-1.4.9. Please +install a non-broken m4." "$LINENO" 5 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +for ac_prog in wish wish85 wish8.5 wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_WISH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $WISH in + [\\/]* | ?:[\\/]*) + ac_cv_path_WISH="$WISH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_WISH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +WISH=$ac_cv_path_WISH +if test -n "$WISH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WISH" >&5 +$as_echo "$WISH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$WISH" && break +done +test -n "$WISH" || WISH="none" + +if test "X$WISH" = "Xnone" ; then + as_fn_error $? "Did not find the wish executible. You need to make sure + that tcl is installed on your system and that wish is in your path" "$LINENO" 5 +fi + + +cat >>confdefs.h <<_ACEOF +#define M4 $M4 +_ACEOF + +GNUM4=$M4 + + +cat >>confdefs.h <<_ACEOF +#define GNUM4 "$M4" +_ACEOF + + +# Extract the first word of "pdflatex", so it can be a program name with args. +set dummy pdflatex; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PDFLATEX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_PDFLATEX="$PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PDFLATEX" && ac_cv_path_PDFLATEX="notfound" + ;; +esac +fi +PDFLATEX=$ac_cv_path_PDFLATEX +if test -n "$PDFLATEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFLATEX" >&5 +$as_echo "$PDFLATEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$PDFLATEX = xnotfound; then + MISSING_PDFLATEX_TRUE= + MISSING_PDFLATEX_FALSE='#' +else + MISSING_PDFLATEX_TRUE='#' + MISSING_PDFLATEX_FALSE= +fi + + +# Extract the first word of "texi2dvi", so it can be a program name with args. +set dummy texi2dvi; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_TEXI2DVI+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $TEXI2DVI in + [\\/]* | ?:[\\/]*) + ac_cv_path_TEXI2DVI="$TEXI2DVI" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_TEXI2DVI="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_TEXI2DVI" && ac_cv_path_TEXI2DVI="notfound" + ;; +esac +fi +TEXI2DVI=$ac_cv_path_TEXI2DVI +if test -n "$TEXI2DVI"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2DVI" >&5 +$as_echo "$TEXI2DVI" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$TEXI2DVI = xnotfound; then + MISSING_TEXI2DVI_TRUE= + MISSING_TEXI2DVI_FALSE='#' +else + MISSING_TEXI2DVI_TRUE='#' + MISSING_TEXI2DVI_FALSE= +fi + + +# Extract the first word of "ps2pdf", so it can be a program name with args. +set dummy ps2pdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PS2PDF+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PS2PDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_PS2PDF="$PS2PDF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PS2PDF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PS2PDF" && ac_cv_path_PS2PDF="notfound" + ;; +esac +fi +PS2PDF=$ac_cv_path_PS2PDF +if test -n "$PS2PDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PS2PDF" >&5 +$as_echo "$PS2PDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$PS2PDF = xnotfound; then + MISSING_PS2PDF_TRUE= + MISSING_PS2PDF_FALSE='#' +else + MISSING_PS2PDF_TRUE='#' + MISSING_PS2PDF_FALSE= +fi + + +# used to build some of the getting started guide +# Extract the first word of "gschem", so it can be a program name with args. +set dummy gschem; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GSCHEM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GSCHEM in + [\\/]* | ?:[\\/]*) + ac_cv_path_GSCHEM="$GSCHEM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GSCHEM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GSCHEM" && ac_cv_path_GSCHEM="notfound" + ;; +esac +fi +GSCHEM=$ac_cv_path_GSCHEM +if test -n "$GSCHEM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSCHEM" >&5 +$as_echo "$GSCHEM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$GSCHEM = xnotfound; then + MISSING_GSCHEM_TRUE= + MISSING_GSCHEM_FALSE='#' +else + MISSING_GSCHEM_TRUE='#' + MISSING_GSCHEM_FALSE= +fi + + +if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then + if test "$PDFLATEX" = "notfound" -o "$TEXI2DVI" = "notfound" -o "$PS2PDF" = "notfound" ; then + as_fn_error $? "It appears that you are building from a source tree obtained +via git but you do not have the required tools installed to build the documentation. Here +is a list of tools and the detected values: +PDFLATEX: $PDFLATEX +TEXI2DVI: $TEXI2DVI +PS2PDF: $PS2PDF +GSCHEM: $GSCHEM + +Either make sure these tools are installed or disable building and installing the documentation +by using the --disable-doc configure option. +" "$LINENO" 5 + fi +fi + +############################################################################ +# +# These checks are for tools used by the testsuite. It will not be fatal +# if these are missing because this is primarily for developer use. It is +# possible that we might add some --enable flag in the future that forces +# full tools for development work. + +# Check for ImageMagick tools used by the testsuite +# Extract the first word of "animate", so it can be a program name with args. +set dummy animate; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_IM_ANIMATE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $IM_ANIMATE in + [\\/]* | ?:[\\/]*) + ac_cv_path_IM_ANIMATE="$IM_ANIMATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_IM_ANIMATE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_IM_ANIMATE" && ac_cv_path_IM_ANIMATE="notfound" + ;; +esac +fi +IM_ANIMATE=$ac_cv_path_IM_ANIMATE +if test -n "$IM_ANIMATE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IM_ANIMATE" >&5 +$as_echo "$IM_ANIMATE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "compare", so it can be a program name with args. +set dummy compare; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_IM_COMPARE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $IM_COMPARE in + [\\/]* | ?:[\\/]*) + ac_cv_path_IM_COMPARE="$IM_COMPARE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_IM_COMPARE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_IM_COMPARE" && ac_cv_path_IM_COMPARE="notfound" + ;; +esac +fi +IM_COMPARE=$ac_cv_path_IM_COMPARE +if test -n "$IM_COMPARE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IM_COMPARE" >&5 +$as_echo "$IM_COMPARE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "composite", so it can be a program name with args. +set dummy composite; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_IM_COMPOSITE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $IM_COMPOSITE in + [\\/]* | ?:[\\/]*) + ac_cv_path_IM_COMPOSITE="$IM_COMPOSITE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_IM_COMPOSITE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_IM_COMPOSITE" && ac_cv_path_IM_COMPOSITE="notfound" + ;; +esac +fi +IM_COMPOSITE=$ac_cv_path_IM_COMPOSITE +if test -n "$IM_COMPOSITE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IM_COMPOSITE" >&5 +$as_echo "$IM_COMPOSITE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "convert", so it can be a program name with args. +set dummy convert; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_IM_CONVERT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $IM_CONVERT in + [\\/]* | ?:[\\/]*) + ac_cv_path_IM_CONVERT="$IM_CONVERT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_IM_CONVERT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_IM_CONVERT" && ac_cv_path_IM_CONVERT="notfound" + ;; +esac +fi +IM_CONVERT=$ac_cv_path_IM_CONVERT +if test -n "$IM_CONVERT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IM_CONVERT" >&5 +$as_echo "$IM_CONVERT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "display", so it can be a program name with args. +set dummy display; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_IM_DISPLAY+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $IM_DISPLAY in + [\\/]* | ?:[\\/]*) + ac_cv_path_IM_DISPLAY="$IM_DISPLAY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_IM_DISPLAY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_IM_DISPLAY" && ac_cv_path_IM_DISPLAY="notfound" + ;; +esac +fi +IM_DISPLAY=$ac_cv_path_IM_DISPLAY +if test -n "$IM_DISPLAY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IM_DISPLAY" >&5 +$as_echo "$IM_DISPLAY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "montage", so it can be a program name with args. +set dummy montage; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_IM_MONTAGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $IM_MONTAGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_IM_MONTAGE="$IM_MONTAGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_IM_MONTAGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_IM_MONTAGE" && ac_cv_path_IM_MONTAGE="notfound" + ;; +esac +fi +IM_MONTAGE=$ac_cv_path_IM_MONTAGE +if test -n "$IM_MONTAGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IM_MONTAGE" >&5 +$as_echo "$IM_MONTAGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +missing_magick="" +test "${IM_ANIMATE}" != "notfound" || missing_magick="${missing_magick} animate" +test "${IM_COMPARE}" != "notfound" || missing_magick="${missing_magick} compare" +test "${IM_COMPOSITE}" != "notfound" || missing_magick="${missing_magick} composite" +test "${IM_CONVERT}" != "notfound" || missing_magick="${missing_magick} convert" +test "${IM_DISPLAY}" != "notfound" || missing_magick="${missing_magick} display" +test "${IM_MONTAGE}" != "notfound" || missing_magick="${missing_magick} montage" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if all ImageMagick tools needed for the testsuite were found" >&5 +$as_echo_n "checking if all ImageMagick tools needed for the testsuite were found... " >&6; } +if test "X${missing_magick}" != "X" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no. The testsuite will be disabled because the following +tools from the ImageMagick suite were not found: +${missing_magick} +No loss in pcb functionality should be experienced, you just will not +be able to run the full regression testsuite. +" >&5 +$as_echo "no. The testsuite will be disabled because the following +tools from the ImageMagick suite were not found: +${missing_magick} +No loss in pcb functionality should be experienced, you just will not +be able to run the full regression testsuite. +" >&6; } + have_magick=no +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_magick=yes +fi + +have_test_tools=yes + +test $have_magick = yes || have_test_tools=no + +# the RS274-X export HID is partially checked by looking at the result with +# gerbv +# Extract the first word of "gerbv", so it can be a program name with args. +set dummy gerbv; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GERBV+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GERBV in + [\\/]* | ?:[\\/]*) + ac_cv_path_GERBV="$GERBV" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GERBV="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GERBV" && ac_cv_path_GERBV="notfound" + ;; +esac +fi +GERBV=$ac_cv_path_GERBV +if test -n "$GERBV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GERBV" >&5 +$as_echo "$GERBV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +test $GERBV != notfound || have_test_tools=no + + + if test x$have_test_tools = xyes; then + HAVE_TEST_TOOLS_TRUE= + HAVE_TEST_TOOLS_FALSE='#' +else + HAVE_TEST_TOOLS_TRUE='#' + HAVE_TEST_TOOLS_FALSE= +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if all the requried testsuite tools were found" >&5 +$as_echo_n "checking if all the requried testsuite tools were found... " >&6; } +if test x$have_test_tools = xyes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no -- the testsuite will be disabled" >&5 +$as_echo "no -- the testsuite will be disabled" >&6; } +fi + + +# +############################################################################ + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 +$as_echo_n "checking for sqrt in -lm... " >&6; } +if test "${ac_cv_lib_m_sqrt+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqrt (); +int +main () +{ +return sqrt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_sqrt=yes +else + ac_cv_lib_m_sqrt=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 +$as_echo "$ac_cv_lib_m_sqrt" >&6; } +if test "x$ac_cv_lib_m_sqrt" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lxnet" >&5 +$as_echo_n "checking for gethostbyname in -lxnet... " >&6; } +if test "${ac_cv_lib_xnet_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxnet $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_xnet_gethostbyname=yes +else + ac_cv_lib_xnet_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_gethostbyname" >&5 +$as_echo "$ac_cv_lib_xnet_gethostbyname" >&6; } +if test "x$ac_cv_lib_xnet_gethostbyname" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXNET 1 +_ACEOF + + LIBS="-lxnet $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for yywrap in -lfl" >&5 +$as_echo_n "checking for yywrap in -lfl... " >&6; } +if test "${ac_cv_lib_fl_yywrap+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char yywrap (); +int +main () +{ +return yywrap (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_fl_yywrap=yes +else + ac_cv_lib_fl_yywrap=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fl_yywrap" >&5 +$as_echo "$ac_cv_lib_fl_yywrap" >&6; } +if test "x$ac_cv_lib_fl_yywrap" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBFL 1 +_ACEOF + + LIBS="-lfl $LIBS" + +fi + +for ac_func in strerror +do : + ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRERROR 1 +_ACEOF + +fi +done + +for ac_func in regcomp re_comp +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in logf expf rint +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in vsnprintf +do : + ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VSNPRINTF 1 +_ACEOF + +fi +done + +for ac_func in getpwuid getcwd +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in rand random +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in stat +do : + ac_fn_c_check_func "$LINENO" "stat" "ac_cv_func_stat" +if test "x$ac_cv_func_stat" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STAT 1 +_ACEOF + +fi +done + + +for ac_func in mkdtemp +do : + ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp" +if test "x$ac_cv_func_mkdtemp" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MKDTEMP 1 +_ACEOF + +fi +done + + +# normally used for all file i/o +for ac_func in popen +do : + ac_fn_c_check_func "$LINENO" "popen" "ac_cv_func_popen" +if test "x$ac_cv_func_popen" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POPEN 1 +_ACEOF + +fi +done + + +# for lrealpath.c +for ac_func in realpath canonicalize_file_name +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether canonicalize_file_name must be declared" >&5 +$as_echo_n "checking whether canonicalize_file_name must be declared... " >&6; } +if test "${libiberty_cv_decl_needed_canonicalize_file_name+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include "confdefs.h" +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int +main () +{ +char *(*pfn) = (char *(*)) canonicalize_file_name + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libiberty_cv_decl_needed_canonicalize_file_name=no +else + libiberty_cv_decl_needed_canonicalize_file_name=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libiberty_cv_decl_needed_canonicalize_file_name" >&5 +$as_echo "$libiberty_cv_decl_needed_canonicalize_file_name" >&6; } +if test $libiberty_cv_decl_needed_canonicalize_file_name = yes; then + +$as_echo "#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1" >>confdefs.h + +fi + + +# for pcb_spawnvp in action.c on Windows +for ac_func in _spawnvp +do : + ac_fn_c_check_func "$LINENO" "_spawnvp" "ac_cv_func__spawnvp" +if test "x$ac_cv_func__spawnvp" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE__SPAWNVP 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in limits.h locale.h string.h sys/types.h regex.h pwd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h sys/wait.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + +if test "x${WIN32}" = "xyes" ; then + for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + +fi + +done + +fi +# Search for glib + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } + +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0" 2>&1` + else + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLIB_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Note: cannot find glib-2.0. +You may want to review the following errors: +$GLIB_PKG_ERRORS" >&5 +$as_echo "Note: cannot find glib-2.0. +You may want to review the following errors: +$GLIB_PKG_ERRORS" >&6; } + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Note: cannot find glib-2.0. +You may want to review the following errors: +$GLIB_PKG_ERRORS" >&5 +$as_echo "Note: cannot find glib-2.0. +You may want to review the following errors: +$GLIB_PKG_ERRORS" >&6; } + +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + +for e in $HIDLIST; do + case $e in + lesstif ) + if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" +else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +$as_echo "neither works" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (); +int +main () +{ +return XOpenDisplay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_dnet_ntoa=yes +else + ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = x""yes; then : + +fi + + if test $ac_cv_func_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bsd_gethostbyname=yes +else + ac_cv_lib_bsd_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = x""yes; then : + +fi + + if test $ac_cv_func_connect = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if test "${ac_cv_lib_socket_connect+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_connect=yes +else + ac_cv_lib_socket_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = x""yes; then : + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" +if test "x$ac_cv_func_remove" = x""yes; then : + +fi + + if test $ac_cv_func_remove = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } +if test "${ac_cv_lib_posix_remove+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char remove (); +int +main () +{ +return remove (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix_remove=yes +else + ac_cv_lib_posix_remove=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = x""yes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" +if test "x$ac_cv_func_shmat" = x""yes; then : + +fi + + if test $ac_cv_func_shmat = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } +if test "${ac_cv_lib_ipc_shmat+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (); +int +main () +{ +return shmat (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ipc_shmat=yes +else + ac_cv_lib_ipc_shmat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = x""yes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (); +int +main () +{ +return IceConnectionNumber (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ICE_IceConnectionNumber=yes +else + ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then : + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + + CPPFLAGS="$CFLAGS $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 +$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } +if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (); +int +main () +{ +return XOpenDisplay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_X11_XOpenDisplay=yes +else + ac_cv_lib_X11_XOpenDisplay=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } +if test "x$ac_cv_lib_X11_XOpenDisplay" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBX11 1 +_ACEOF + + LIBS="-lX11 $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lICE" >&5 +$as_echo_n "checking for main in -lICE... " >&6; } +if test "${ac_cv_lib_ICE_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ICE_main=yes +else + ac_cv_lib_ICE_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_main" >&5 +$as_echo "$ac_cv_lib_ICE_main" >&6; } +if test "x$ac_cv_lib_ICE_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBICE 1 +_ACEOF + + LIBS="-lICE $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lSM" >&5 +$as_echo_n "checking for main in -lSM... " >&6; } +if test "${ac_cv_lib_SM_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lSM $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_SM_main=yes +else + ac_cv_lib_SM_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SM_main" >&5 +$as_echo "$ac_cv_lib_SM_main" >&6; } +if test "x$ac_cv_lib_SM_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSM 1 +_ACEOF + + LIBS="-lSM $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXext" >&5 +$as_echo_n "checking for main in -lXext... " >&6; } +if test "${ac_cv_lib_Xext_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXext $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xext_main=yes +else + ac_cv_lib_Xext_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_main" >&5 +$as_echo "$ac_cv_lib_Xext_main" >&6; } +if test "x$ac_cv_lib_Xext_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXEXT 1 +_ACEOF + + LIBS="-lXext $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtOpenDisplay in -lXt" >&5 +$as_echo_n "checking for XtOpenDisplay in -lXt... " >&6; } +if test "${ac_cv_lib_Xt_XtOpenDisplay+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXt $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XtOpenDisplay (); +int +main () +{ +return XtOpenDisplay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xt_XtOpenDisplay=yes +else + ac_cv_lib_Xt_XtOpenDisplay=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtOpenDisplay" >&5 +$as_echo "$ac_cv_lib_Xt_XtOpenDisplay" >&6; } +if test "x$ac_cv_lib_Xt_XtOpenDisplay" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXT 1 +_ACEOF + + LIBS="-lXt $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXmu" >&5 +$as_echo_n "checking for main in -lXmu... " >&6; } +if test "${ac_cv_lib_Xmu_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXmu $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xmu_main=yes +else + ac_cv_lib_Xmu_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_main" >&5 +$as_echo "$ac_cv_lib_Xmu_main" >&6; } +if test "x$ac_cv_lib_Xmu_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXMU 1 +_ACEOF + + LIBS="-lXmu $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXpm" >&5 +$as_echo_n "checking for main in -lXpm... " >&6; } +if test "${ac_cv_lib_Xpm_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXpm $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xpm_main=yes +else + ac_cv_lib_Xpm_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_main" >&5 +$as_echo "$ac_cv_lib_Xpm_main" >&6; } +if test "x$ac_cv_lib_Xpm_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXPM 1 +_ACEOF + + LIBS="-lXpm $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreateMainWindow in -lXm" >&5 +$as_echo_n "checking for XmCreateMainWindow in -lXm... " >&6; } +if test "${ac_cv_lib_Xm_XmCreateMainWindow+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXm $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XmCreateMainWindow (); +int +main () +{ +return XmCreateMainWindow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xm_XmCreateMainWindow=yes +else + ac_cv_lib_Xm_XmCreateMainWindow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmCreateMainWindow" >&5 +$as_echo "$ac_cv_lib_Xm_XmCreateMainWindow" >&6; } +if test "x$ac_cv_lib_Xm_XmCreateMainWindow" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXM 1 +_ACEOF + + LIBS="-lXm $LIBS" + +fi + + case $ac_cv_lib_Xm_XmCreateMainWindow in + no ) + as_fn_error $? "You don't seem to have the Lesstif development environment installed." "$LINENO" 5 + ;; + * ) ;; + esac + for ac_header in Xm/Xm.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default" +if test "x$ac_cv_header_Xm_Xm_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_XM_XM_H 1 +_ACEOF + +fi + +done + + case $ac_cv_header_Xm_Xm_h in + no ) + as_fn_error $? "You don't seem to have the Lesstif development environment installed." "$LINENO" 5 + ;; + * ) ;; + esac + ;; + + gtk ) + # Check for pkg-config + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "$PKG_CONFIG" = "no"; then + as_fn_error $? "Cannot find pkg-config, make sure it is installed and in your PATH" "$LINENO" 5 + fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK" >&5 +$as_echo_n "checking for GTK... " >&6; } + +if test -n "$GTK_CFLAGS"; then + pkg_cv_GTK_CFLAGS="$GTK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.18.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.18.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.18.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTK_LIBS"; then + pkg_cv_GTK_LIBS="$GTK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.18.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.18.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.18.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-2.0 >= 2.18.0" 2>&1` + else + GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-2.0 >= 2.18.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTK_PKG_ERRORS" >&5 + + as_fn_error $? "Cannot find gtk+ >= 2.18.0, install it and rerun ./configure +Please review the following errors: +$GTK_PKG_ERRORS" "$LINENO" 5 + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Cannot find gtk+ >= 2.18.0, install it and rerun ./configure +Please review the following errors: +$GTK_PKG_ERRORS" "$LINENO" 5 + +else + GTK_CFLAGS=$pkg_cv_GTK_CFLAGS + GTK_LIBS=$pkg_cv_GTK_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion` + GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion` + + if test "x$enable_gl" = "xyes"; then + # Check for GtkGLExt + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKGLEXT" >&5 +$as_echo_n "checking for GTKGLEXT... " >&6; } + +if test -n "$GTKGLEXT_CFLAGS"; then + pkg_cv_GTKGLEXT_CFLAGS="$GTKGLEXT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglext-1.0 >= 1.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtkglext-1.0 >= 1.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKGLEXT_CFLAGS=`$PKG_CONFIG --cflags "gtkglext-1.0 >= 1.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTKGLEXT_LIBS"; then + pkg_cv_GTKGLEXT_LIBS="$GTKGLEXT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglext-1.0 >= 1.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtkglext-1.0 >= 1.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKGLEXT_LIBS=`$PKG_CONFIG --libs "gtkglext-1.0 >= 1.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTKGLEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtkglext-1.0 >= 1.0.0" 2>&1` + else + GTKGLEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtkglext-1.0 >= 1.0.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTKGLEXT_PKG_ERRORS" >&5 + + as_fn_error $? " +*** Required version of gtkglext is not installed - please install first *** +Please review the following errors: +$GTKGLEXT_PKG_ERRORS" "$LINENO" 5 + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? " +*** Required version of gtkglext is not installed - please install first *** +Please review the following errors: +$GTKGLEXT_PKG_ERRORS" "$LINENO" 5 + +else + GTKGLEXT_CFLAGS=$pkg_cv_GTKGLEXT_CFLAGS + GTKGLEXT_LIBS=$pkg_cv_GTKGLEXT_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + GTKGLEXT_VER=`$PKG_CONFIG gtkglext-1.0 --modversion` + fi + + ;; + + gcode|nelma|png ) + # Check for gdlib-config for gd (www.boutell.com/gd) + # Extract the first word of "gdlib-config", so it can be a program name with args. +set dummy gdlib-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GDLIB_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GDLIB_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GDLIB_CONFIG="$GDLIB_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GDLIB_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GDLIB_CONFIG" && ac_cv_path_GDLIB_CONFIG="no" + ;; +esac +fi +GDLIB_CONFIG=$ac_cv_path_GDLIB_CONFIG +if test -n "$GDLIB_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDLIB_CONFIG" >&5 +$as_echo "$GDLIB_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "$GDLIB_CONFIG" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cannot find gdlib-config. +Make sure it is installed and in your PATH. +gdlib-config is part of the GD library available from www.boutell.com/gd. +This is needed for the png HID. I will look for libgd anyway and maybe +you will get lucky. +" >&5 +$as_echo "Cannot find gdlib-config. +Make sure it is installed and in your PATH. +gdlib-config is part of the GD library available from www.boutell.com/gd. +This is needed for the png HID. I will look for libgd anyway and maybe +you will get lucky. +" >&6; } + if test "$WIN32" != "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgd" >&5 +$as_echo_n "checking for main in -lgd... " >&6; } +if test "${ac_cv_lib_gd_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gd_main=yes +else + ac_cv_lib_gd_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gd_main" >&5 +$as_echo "$ac_cv_lib_gd_main" >&6; } +if test "x$ac_cv_lib_gd_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGD 1 +_ACEOF + + LIBS="-lgd $LIBS" + +else + as_fn_error $? "You have requested gcode, nelma, or png HIDs but -lgd could not be found" "$LINENO" 5 +fi + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lbgd" >&5 +$as_echo_n "checking for main in -lbgd... " >&6; } +if test "${ac_cv_lib_bgd_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbgd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bgd_main=yes +else + ac_cv_lib_bgd_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bgd_main" >&5 +$as_echo "$ac_cv_lib_bgd_main" >&6; } +if test "x$ac_cv_lib_bgd_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBBGD 1 +_ACEOF + + LIBS="-lbgd $LIBS" + +else + as_fn_error $? "You have requested gcode, nelma, or png HIDs but -lbgd could not be found" "$LINENO" 5 +fi + + fi + else + if test "$WIN32" = "yes" ; then + GD=bgd + else + GD=gd + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgd cflags" >&5 +$as_echo_n "checking for libgd cflags... " >&6; } + GD_CFLAGS="`$GDLIB_CONFIG --cflags`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GD_CFLAGS" >&5 +$as_echo "$GD_CFLAGS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgd libs" >&5 +$as_echo_n "checking for libgd libs... " >&6; } + GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GD_LIBS" >&5 +$as_echo "$GD_LIBS" >&6; } + fi + + # since some linux systems evidently install gdlib-config but fail to + # install the headers (nice), check for the header too and fail if it + # is not there. + CFLAGS="$CFLAGS $GD_CFLAGS" + CPPFLAGS="$CPPFLAGS $GD_CFLAGS" + for ac_header in gd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "gd.h" "ac_cv_header_gd_h" "$ac_includes_default" +if test "x$ac_cv_header_gd_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GD_H 1 +_ACEOF + +fi + +done + + case $ac_cv_header_gd_h in + no ) + as_fn_error $? " +You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd. +This is needed for the nelma and/or png HID. +" "$LINENO" 5 + ;; + * ) ;; + esac + + # Some versions of gd (prior to the expiration of the + # patent related to gif compression) do not support + # gif output. Check for that here. + save_LIBS="$LIBS" + LIBS="$save_LIBS $GD_LIBS $X_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GIF output from the png HID is desired" >&5 +$as_echo_n "checking if GIF output from the png HID is desired... " >&6; } + # Check whether --enable-gif was given. +if test "${enable_gif+set}" = set; then : + enableval=$enable_gif; + if test "X$enable_gif" != "Xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_gif=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_gif=no + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_gif=yes + +fi + + if test "X$with_gif" = "Xyes" ; then + for ac_func in gdImageGif +do : + ac_fn_c_check_func "$LINENO" "gdImageGif" "ac_cv_func_gdImageGif" +if test "x$ac_cv_func_gdImageGif" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GDIMAGEGIF 1 +_ACEOF + +fi +done + + if test "$ac_cv_func_gdImageGif" != "yes"; then + as_fn_error $? "Your gd installation does not appear to include gif support. +You may need to update your installation of gd or disable +gif export with --disable-gif" "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if JPEG output from the png HID is desired" >&5 +$as_echo_n "checking if JPEG output from the png HID is desired... " >&6; } + # Check whether --enable-jpeg was given. +if test "${enable_jpeg+set}" = set; then : + enableval=$enable_jpeg; + if test "X$enable_jpeg" != "Xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_jpeg=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_jpeg=no + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_jpeg=yes + +fi + + if test "X$with_jpeg" = "Xyes" ; then + for ac_func in gdImageJpeg +do : + ac_fn_c_check_func "$LINENO" "gdImageJpeg" "ac_cv_func_gdImageJpeg" +if test "x$ac_cv_func_gdImageJpeg" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GDIMAGEJPEG 1 +_ACEOF + +fi +done + + if test "$ac_cv_func_gdImageJpeg" != "yes"; then + as_fn_error $? "Your gd installation does not appear to include JPEG support. +You may need to update your installation of gd or disable +JPEG export with --disable-jpeg" "$LINENO" 5 + fi + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PNG output from the png HID is desired" >&5 +$as_echo_n "checking if PNG output from the png HID is desired... " >&6; } + # Check whether --enable-png was given. +if test "${enable_png+set}" = set; then : + enableval=$enable_png; + if test "X$enable_png" != "Xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_png=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_png=no + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_png=yes + +fi + + if test "X$with_png" = "Xyes" ; then + for ac_func in gdImagePng +do : + ac_fn_c_check_func "$LINENO" "gdImagePng" "ac_cv_func_gdImagePng" +if test "x$ac_cv_func_gdImagePng" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GDIMAGEPNG 1 +_ACEOF + +fi +done + + if test "$ac_cv_func_gdImagePng" != "yes"; then + as_fn_error $? "Your gd installation does not appear to include PNG support. +You may need to update your installation of gd or disable +PNG export with --disable-png" "$LINENO" 5 + fi + fi + LIBS="$save_LIBS" + ;; + + esac +done + + + if test x$with_png = xyes; then + PNG_TRUE= + PNG_FALSE='#' +else + PNG_TRUE='#' + PNG_FALSE= +fi + + if test x$with_gif = xyes; then + GIF_TRUE= + GIF_FALSE='#' +else + GIF_TRUE='#' + GIF_FALSE= +fi + + +# ------------- check if png previews should be built for pcblib-newlib +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the m4lib to newlib export should create png previews" >&5 +$as_echo_n "checking if the m4lib to newlib export should create png previews... " >&6; } +# Check whether --enable-m4lib-png was given. +if test "${enable_m4lib_png+set}" = set; then : + enableval=$enable_m4lib_png; +else + enable_m4lib_png=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_m4lib_png" >&5 +$as_echo "$enable_m4lib_png" >&6; } + if test x$enable_m4lib_png = xyes; then + PNG_PREVIEW_TRUE= + PNG_PREVIEW_FALSE='#' +else + PNG_PREVIEW_TRUE='#' + PNG_PREVIEW_FALSE= +fi + + + +# Run away.... more ugly stuff here. By default we don't actually build +# pcblib-newlib from pcblib unless we are building from cvs or git sources. +# The reason is it takes a while and requires the png HID. The problem is, +# what if someone wants to use --enable-m4lib-png but the tarball was built +# without the previews. Or, what if someone does not want the PNG previews +# but the person building the tarball included them. Ugh! So what the following +# code attempts to do is detect that mismatch situation. Note that we only +# want to kick this code in when *not* building from git or cvs sources. +build_pcblib_newlib=no +if test "$pcb_sources" = "tarball" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking If pcblib-newlib was built with png previews" >&5 +$as_echo_n "checking If pcblib-newlib was built with png previews... " >&6; } + stamp=$srcdir/lib/pcblib-newlib.stamp + if test ! -f ${stamp} ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown, missing ${stamp}" >&5 +$as_echo "unknown, missing ${stamp}" >&6; } + build_pcblib_newlib=yes + else + if test "`cat ${stamp}`" = "png-preview=yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + # lib exists and built with preview. + # if we don't want the preview, than rebuild + if test x$enable_m4lib_png != xyes ; then + build_pcblib_newlib=yes + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + # lib exists and built without preview. + # if we want the preview, than rebuild + if test x$enable_m4lib_png = xyes ; then + build_pcblib_newlib=yes + fi + fi + fi +else + build_pcblib_newlib=yes +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking If pcblib-newlib needs to be rebuilt" >&5 +$as_echo_n "checking If pcblib-newlib needs to be rebuilt... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_pcblib_newlib" >&5 +$as_echo "$build_pcblib_newlib" >&6; } + if test x$build_pcblib_newlib = xyes; then + BUILD_PCBLIB_NEWLIB_TRUE= + BUILD_PCBLIB_NEWLIB_FALSE='#' +else + BUILD_PCBLIB_NEWLIB_TRUE='#' + BUILD_PCBLIB_NEWLIB_FALSE= +fi + + +if test "X$cross_compiling" = "Xyes" ; then + # we are cross compiling so we will need a build host binary for pcb + # Extract the first word of "pcb", so it can be a program name with args. +set dummy pcb; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PCB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PCB in + [\\/]* | ?:[\\/]*) + ac_cv_path_PCB="$PCB" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PCB="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PCB" && ac_cv_path_PCB="notfound" + ;; +esac +fi +PCB=$ac_cv_path_PCB +if test -n "$PCB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCB" >&5 +$as_echo "$PCB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +else + PCB="\${top_builddir}/src/pcb" +fi + + +# now make see how essential it was that we have a pcb executable for the build +# host +if test "X$pcb_git_version" = "Xyes" ; then + if test "X$docs_yesno" = "Xyes" -o "X$enable_m4lib_png" = "Xyes" ; then + if test "$PCB" = "notfound" ; then + as_fn_error $? "You have selected a build with m4lib png +previews enabled and/or with building the documentation enabled but you also +appear to be cross-compiling. For this to work, you must have a pcb installed that +can run on this machine (the build machine) because it is needed for generating +library footprint png previews as well as some of the figures in the documentation. +If you wish to skip building the documentation and the footprint previews then add +--disable-doc --disable-m4lib-png +This will allow your cross build to work." "$LINENO" 5 + fi + fi +fi + +# ------------- Xrender ------------------- +have_xrender=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderQueryExtension in -lXrender" >&5 +$as_echo_n "checking for XRenderQueryExtension in -lXrender... " >&6; } +if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXrender $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XRenderQueryExtension (); +int +main () +{ +return XRenderQueryExtension (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xrender_XRenderQueryExtension=yes +else + ac_cv_lib_Xrender_XRenderQueryExtension=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5 +$as_echo "$ac_cv_lib_Xrender_XRenderQueryExtension" >&6; } +if test "x$ac_cv_lib_Xrender_XRenderQueryExtension" = x""yes; then : + have_xrender=yes +else + have_xrender=no +fi + + +# Check whether --enable-xrender was given. +if test "${enable_xrender+set}" = set; then : + enableval=$enable_xrender; +fi + +case "$have_xrender:$enable_xrender" in + no:* ) ;; + *:no ) ;; + * ) + X_LIBS="-lXrender $X_LIBS" + +$as_echo "#define HAVE_XRENDER 1" >>confdefs.h + + ;; +esac + +# ------------- Xinerama ------------------- +have_xinerama=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaQueryExtension in -lXinerama" >&5 +$as_echo_n "checking for XineramaQueryExtension in -lXinerama... " >&6; } +if test "${ac_cv_lib_Xinerama_XineramaQueryExtension+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXinerama $X_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XineramaQueryExtension (); +int +main () +{ +return XineramaQueryExtension (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xinerama_XineramaQueryExtension=yes +else + ac_cv_lib_Xinerama_XineramaQueryExtension=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5 +$as_echo "$ac_cv_lib_Xinerama_XineramaQueryExtension" >&6; } +if test "x$ac_cv_lib_Xinerama_XineramaQueryExtension" = x""yes; then : + have_xinerama=yes +else + have_xinerama=no +fi + + +# Check whether --enable-xinerama was given. +if test "${enable_xinerama+set}" = set; then : + enableval=$enable_xinerama; +fi + +case "$have_xinerama:$enable_xinerama" in + no:* ) ;; + *:no ) ;; + * ) + X_LIBS="-lXinerama $X_LIBS" + +$as_echo "#define HAVE_XINERAMA 1" >>confdefs.h + + ;; +esac + +# ------------- dmalloc ------------------- +with_dmalloc=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if dmalloc debugging should be enabled" >&5 +$as_echo_n "checking if dmalloc debugging should be enabled... " >&6; } +# Check whether --enable-dmalloc was given. +if test "${enable_dmalloc+set}" = set; then : + enableval=$enable_dmalloc; +if test "X$enable_dmalloc" != "Xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_fn_c_check_header_mongrel "$LINENO" "dmalloc.h" "ac_cv_header_dmalloc_h" "$ac_includes_default" +if test "x$ac_cv_header_dmalloc_h" = x""yes; then : + +else + as_fn_error $? "You have requested dmalloc debugging but dmalloc.h could not be found" "$LINENO" 5 +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldmalloc" >&5 +$as_echo_n "checking for main in -ldmalloc... " >&6; } +if test "${ac_cv_lib_dmalloc_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldmalloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dmalloc_main=yes +else + ac_cv_lib_dmalloc_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dmalloc_main" >&5 +$as_echo "$ac_cv_lib_dmalloc_main" >&6; } +if test "x$ac_cv_lib_dmalloc_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDMALLOC 1 +_ACEOF + + LIBS="-ldmalloc $LIBS" + +else + as_fn_error $? "You have requested dmalloc debugging but -ldmalloc could not be found" "$LINENO" 5 +fi + + DMALLOC_LIBS="-ldmalloc" + with_dmalloc=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + DMALLOC_LIBS="" +fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + DMALLOC_LIBS="" + +fi + + +# ------------- ElectricFence ------------------- +with_efence=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ElectricFence debugging should be enabled" >&5 +$as_echo_n "checking if ElectricFence debugging should be enabled... " >&6; } +# Check whether --enable-efence was given. +if test "${enable_efence+set}" = set; then : + enableval=$enable_efence; +if test "X$enable_efence" != "Xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lefence" >&5 +$as_echo_n "checking for main in -lefence... " >&6; } +if test "${ac_cv_lib_efence_main+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lefence $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_efence_main=yes +else + ac_cv_lib_efence_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_efence_main" >&5 +$as_echo "$ac_cv_lib_efence_main" >&6; } +if test "x$ac_cv_lib_efence_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBEFENCE 1 +_ACEOF + + LIBS="-lefence $LIBS" + +else + as_fn_error $? "You have requested ElectricFence debugging but -lefence could not be found" "$LINENO" 5 +fi + + with_efence=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +else + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + +# ------------- Enable Debug code ------------------- +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to enable debugging code" >&5 +$as_echo_n "checking for whether to enable debugging code... " >&6; } +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +else + enable_debug=no +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5 +$as_echo "$enable_debug" >&6; } + if test x$enable_debug = xyes; then + DEBUG_BUILD_TRUE= + DEBUG_BUILD_FALSE='#' +else + DEBUG_BUILD_TRUE='#' + DEBUG_BUILD_FALSE= +fi + + +# ------------- mkdir required for win32 compatibility ------------ +# WIN32 mkdir takes only one argument, POSIX takes two. +# #include "misc.h" where mkdir is required. +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_func_mkdir.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_FUNC_MKDIR +# +# DESCRIPTION +# +# Check whether mkdir() is mkdir or _mkdir, and whether it takes one or +# two arguments. +# +# This macro can define HAVE_MKDIR, HAVE__MKDIR, and MKDIR_TAKES_ONE_ARG, +# which are expected to be used as follows: +# +# #if HAVE_MKDIR +# # if MKDIR_TAKES_ONE_ARG +# /* MinGW32 */ +# # define mkdir(a, b) mkdir(a) +# # endif +# #else +# # if HAVE__MKDIR +# /* plain Windows 32 */ +# # define mkdir(a, b) _mkdir(a) +# # else +# # error "Don't know how to create a directory on this system." +# # endif +# #endif +# +# LICENSE +# +# Copyright (c) 2008 Alexandre Duret-Lutz +# +# 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 . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +# This is what autoupdate's m4 run will expand. It fires +# the warning (with _au_warn_XXX), outputs it into the +# updated configure.ac (with AC_DIAGNOSE), and then outputs +# the replacement expansion. + + +# This is an auxiliary macro that is also run when +# autoupdate runs m4. It simply calls m4_warning, but +# we need a wrapper so that each warning is emitted only +# once. We break the quoting in m4_warning's argument in +# order to expand this macro's arguments, not AU_DEFUN's. + + +# Finally, this is the expansion that is picked up by +# autoconf. It tells the user to run autoupdate, and +# then outputs the replacement expansion. We do not care +# about autoupdate's warning because that contains +# information on what to do *after* running autoupdate. + + + + +for ac_func in mkdir _mkdir +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir takes one argument" >&5 +$as_echo_n "checking whether mkdir takes one argument... " >&6; } +if test "${ac_cv_mkdir_takes_one_arg+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_UNISTD_H +# include +#endif + +int +main () +{ +mkdir ("."); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_mkdir_takes_one_arg=yes +else + ac_cv_mkdir_takes_one_arg=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mkdir_takes_one_arg" >&5 +$as_echo "$ac_cv_mkdir_takes_one_arg" >&6; } +if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then + +$as_echo "#define MKDIR_TAKES_ONE_ARG 1" >>confdefs.h + +fi + + +# ------------- Type used for "Coord" type ------------------- + +for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + +# Check whether --enable-coord64 was given. +if test "${enable_coord64+set}" = set; then : + enableval=$enable_coord64; +else + enable_coord64=no +fi + +# Check whether --enable-coord32 was given. +if test "${enable_coord32+set}" = set; then : + enableval=$enable_coord32; +else + enable_coord32=no +fi + + +COORDTYPE="long" + +echo "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" +case "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" in + yes:no:yes ) + COORD_TYPE="int32_t" + COORD_MAX="INT32_MAX" + ;; + no:yes:yes ) + COORD_TYPE="int64_t" + COORD_MAX="INT64_MAX" + ;; + yes:no:no ) + COORD_TYPE="int" + COORD_MAX="INT_MAX" + ;; + no:yes:no ) + COORD_TYPE="long long" + COORD_MAX="LLONG_MAX" + ;; + yes:yes:* ) + as_fn_error $? "\"*** cannot require both 32 and 64 bit coordinates\"" "$LINENO" 5 + ;; + *:*:* ) + COORD_TYPE="long" + COORD_MAX="LONG_MAX" + ;; +esac + +cat >>confdefs.h <<_ACEOF +#define COORD_TYPE $COORD_TYPE +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define COORD_MAX $COORD_MAX +_ACEOF + + +# ------------- Complete set of CFLAGS and LIBS ------------------- + +CFLAGS="$CFLAGS $X_CFLAGS $DBUS_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS $CAIRO_CFLAGS $GTKGLEXT_CFLAGS $GLU_CFLAGS $GL_CFLAGS" +LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GLIB_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS $INTLLIBS $CAIRO_LIBS $GTKGLEXT_LIBS $GLU_LIBS $GL_LIBS" + + +# if we have gcc then add -Wall +if test "x$GCC" = "xyes"; then + # see about adding some extra checks if the compiler takes them + for flag in -Wall ; do + case " ${CFLAGS} " in + *\ ${flag}\ *) + # flag is already present + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts ${flag}" >&5 +$as_echo_n "checking if the compiler accepts ${flag}... " >&6; } + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS ${flag}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$ac_save_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac + done +fi + +CXXFLAGS="$CFLAGS" + +# Now add C-specific flags +if test "x$GCC" = "xyes"; then + # see about adding some extra checks if the compiler takes them + for flag in -Wdeclaration-after-statement ; do + case " ${CFLAGS} " in + *\ ${flag}\ *) + # flag is already present + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts ${flag}" >&5 +$as_echo_n "checking if the compiler accepts ${flag}... " >&6; } + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS ${flag}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$ac_save_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac + done +fi + +# See if we are building gcc with C++. +# Check whether --enable-build-with-cxx was given. +if test "${enable_build_with_cxx+set}" = set; then : + enableval=$enable_build_with_cxx; ENABLE_BUILD_WITH_CXX=$enableval +else + ENABLE_BUILD_WITH_CXX=no +fi + + +case "$ENABLE_BUILD_WITH_CXX" in + yes) + CC_OR_CXX="$CXX" + CC_OR_CXX_FLAGS="$CXXFLAGS" + ;; + no) + CC_OR_CXX="$CC" + CC_OR_CXX_FLAGS="$CFLAGS" + ;; +esac + + + +# font filename +FONTFILENAME=${FONTFILENAME:-"default_font"} + + +cat >>confdefs.h <<_ACEOF +#define FONTFILENAME "$FONTFILENAME" +_ACEOF + + +# standard autoconf variables +CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\"" +CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\"" +CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\"" + +# directory for old-style library and for fonts +PCBLIBDIR=${datadir}/pcb + +#AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory]) +CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\"" + +# name for old-style library +LIBRARYFILENAME=pcblib + + +cat >>confdefs.h <<_ACEOF +#define LIBRARYFILENAME "$LIBRARYFILENAME" +_ACEOF + + + +# directory for new library +PCBTREEDIR=${datadir}/pcb/newlib +PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib +PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"} + + +#AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library]) +CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\"" +CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\"" + +# Figure out relative paths +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the bindir to pcblibdir relative path" >&5 +$as_echo_n "checking for the bindir to pcblibdir relative path... " >&6; } +for _lcl_i in bindir:PCBLIBDIR:bindir_to_pcblibdir; do + _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'` + _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'` + _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'` + _lcl_receval="$_lcl_from" +_lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + _lcl_receval_old='' + while test "$_lcl_receval_old" != "$_lcl_receval"; do + _lcl_receval_old="$_lcl_receval" + eval _lcl_receval="\"$_lcl_receval\"" + done + echo "$_lcl_receval")` + _lcl_receval="$_lcl_to" +_lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + _lcl_receval_old='' + while test "$_lcl_receval_old" != "$_lcl_receval"; do + _lcl_receval_old="$_lcl_receval" + eval _lcl_receval="\"$_lcl_receval\"" + done + echo "$_lcl_receval")` + _lcl_notation="$_lcl_from$_lcl_to" + case ":$_lcl_from:" in +# change empty paths to '.' + ::) _lcl_from='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case '/' in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + case ":$_lcl_to:" in +# change empty paths to '.' + ::) _lcl_to='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case '/' in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + _lcl_common_prefix='' +_lcl_second_prefix_match='' +while test "$_lcl_second_prefix_match" != 0; do + _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"` + _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"` + if test "$_lcl_second_prefix_match" != 0; then + if test "$_lcl_first_prefix" != "$_lcl_common_prefix"; then + _lcl_common_prefix="$_lcl_first_prefix" + else + _lcl_second_prefix_match=0 + fi + fi +done +_lcl_first_suffix=`expr "x$_lcl_from" : "x$_lcl_common_prefix/*\(.*\)"` +_lcl_first_rel='' +_lcl_tmp='xxx' +while test "$_lcl_tmp" != ''; do + _lcl_tmp=`expr "x$_lcl_first_suffix" : "x[^/]*/*\(.*\)"` + if test "$_lcl_first_suffix" != ''; then + _lcl_first_suffix="$_lcl_tmp" + _lcl_first_rel="../$_lcl_first_rel" + fi +done +_lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"` +_lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix" + case ":$_lcl_result_tmp:" in +# change empty paths to '.' + ::) _lcl_result_tmp='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case "$_lcl_notation" in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + eval $_lcl_result_var='$_lcl_result_tmp' +done +case ":$bindir_to_pcblibdir:" in +# change empty paths to '.' + ::) bindir_to_pcblibdir='.' ;; +# strip trailing slashes + :*[\\/]:) bindir_to_pcblibdir=`echo "$bindir_to_pcblibdir" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case $PCB_DIR_SEPARATOR_S in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) bindir_to_pcblibdir=`echo "$bindir_to_pcblibdir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) bindir_to_pcblibdir=`echo "$bindir_to_pcblibdir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bindir_to_pcblibdir" >&5 +$as_echo "$bindir_to_pcblibdir" >&6; } + +cat >>confdefs.h <<_ACEOF +#define BINDIR_TO_PCBLIBDIR "$bindir_to_pcblibdir" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the bindir to pcbtreedir relative path" >&5 +$as_echo_n "checking for the bindir to pcbtreedir relative path... " >&6; } +for _lcl_i in bindir:PCBTREEDIR:bindir_to_pcbtreedir; do + _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'` + _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'` + _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'` + _lcl_receval="$_lcl_from" +_lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + _lcl_receval_old='' + while test "$_lcl_receval_old" != "$_lcl_receval"; do + _lcl_receval_old="$_lcl_receval" + eval _lcl_receval="\"$_lcl_receval\"" + done + echo "$_lcl_receval")` + _lcl_receval="$_lcl_to" +_lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + _lcl_receval_old='' + while test "$_lcl_receval_old" != "$_lcl_receval"; do + _lcl_receval_old="$_lcl_receval" + eval _lcl_receval="\"$_lcl_receval\"" + done + echo "$_lcl_receval")` + _lcl_notation="$_lcl_from$_lcl_to" + case ":$_lcl_from:" in +# change empty paths to '.' + ::) _lcl_from='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case '/' in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + case ":$_lcl_to:" in +# change empty paths to '.' + ::) _lcl_to='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case '/' in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + _lcl_common_prefix='' +_lcl_second_prefix_match='' +while test "$_lcl_second_prefix_match" != 0; do + _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"` + _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"` + if test "$_lcl_second_prefix_match" != 0; then + if test "$_lcl_first_prefix" != "$_lcl_common_prefix"; then + _lcl_common_prefix="$_lcl_first_prefix" + else + _lcl_second_prefix_match=0 + fi + fi +done +_lcl_first_suffix=`expr "x$_lcl_from" : "x$_lcl_common_prefix/*\(.*\)"` +_lcl_first_rel='' +_lcl_tmp='xxx' +while test "$_lcl_tmp" != ''; do + _lcl_tmp=`expr "x$_lcl_first_suffix" : "x[^/]*/*\(.*\)"` + if test "$_lcl_first_suffix" != ''; then + _lcl_first_suffix="$_lcl_tmp" + _lcl_first_rel="../$_lcl_first_rel" + fi +done +_lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"` +_lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix" + case ":$_lcl_result_tmp:" in +# change empty paths to '.' + ::) _lcl_result_tmp='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case "$_lcl_notation" in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + eval $_lcl_result_var='$_lcl_result_tmp' +done +case ":$bindir_to_pcbtreedir:" in +# change empty paths to '.' + ::) bindir_to_pcbtreedir='.' ;; +# strip trailing slashes + :*[\\/]:) bindir_to_pcbtreedir=`echo "$bindir_to_pcbtreedir" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case $PCB_DIR_SEPARATOR_S in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) bindir_to_pcbtreedir=`echo "$bindir_to_pcbtreedir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) bindir_to_pcbtreedir=`echo "$bindir_to_pcbtreedir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bindir_to_pcbtreedir" >&5 +$as_echo "$bindir_to_pcbtreedir" >&6; } + +cat >>confdefs.h <<_ACEOF +#define BINDIR_TO_PCBTREEDIR "$bindir_to_pcbtreedir" +_ACEOF + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the bindir to exec_prefix relative path" >&5 +$as_echo_n "checking for the bindir to exec_prefix relative path... " >&6; } +for _lcl_i in bindir:exec_prefix:bindir_to_execprefix; do + _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'` + _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'` + _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'` + _lcl_receval="$_lcl_from" +_lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + _lcl_receval_old='' + while test "$_lcl_receval_old" != "$_lcl_receval"; do + _lcl_receval_old="$_lcl_receval" + eval _lcl_receval="\"$_lcl_receval\"" + done + echo "$_lcl_receval")` + _lcl_receval="$_lcl_to" +_lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + _lcl_receval_old='' + while test "$_lcl_receval_old" != "$_lcl_receval"; do + _lcl_receval_old="$_lcl_receval" + eval _lcl_receval="\"$_lcl_receval\"" + done + echo "$_lcl_receval")` + _lcl_notation="$_lcl_from$_lcl_to" + case ":$_lcl_from:" in +# change empty paths to '.' + ::) _lcl_from='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case '/' in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + case ":$_lcl_to:" in +# change empty paths to '.' + ::) _lcl_to='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case '/' in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + _lcl_common_prefix='' +_lcl_second_prefix_match='' +while test "$_lcl_second_prefix_match" != 0; do + _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"` + _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"` + if test "$_lcl_second_prefix_match" != 0; then + if test "$_lcl_first_prefix" != "$_lcl_common_prefix"; then + _lcl_common_prefix="$_lcl_first_prefix" + else + _lcl_second_prefix_match=0 + fi + fi +done +_lcl_first_suffix=`expr "x$_lcl_from" : "x$_lcl_common_prefix/*\(.*\)"` +_lcl_first_rel='' +_lcl_tmp='xxx' +while test "$_lcl_tmp" != ''; do + _lcl_tmp=`expr "x$_lcl_first_suffix" : "x[^/]*/*\(.*\)"` + if test "$_lcl_first_suffix" != ''; then + _lcl_first_suffix="$_lcl_tmp" + _lcl_first_rel="../$_lcl_first_rel" + fi +done +_lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"` +_lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix" + case ":$_lcl_result_tmp:" in +# change empty paths to '.' + ::) _lcl_result_tmp='.' ;; +# strip trailing slashes + :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case "$_lcl_notation" in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac + eval $_lcl_result_var='$_lcl_result_tmp' +done +case ":$bindir_to_execprefix:" in +# change empty paths to '.' + ::) bindir_to_execprefix='.' ;; +# strip trailing slashes + :*[\\/]:) bindir_to_execprefix=`echo "$bindir_to_execprefix" | sed 's,[\\/]*$,,'` ;; + :*:) ;; +esac +# squeze repeated slashes +case $PCB_DIR_SEPARATOR_S in +# if the path contains any backslashes, turn slashes into backslashes + *\\*) bindir_to_execprefix=`echo "$bindir_to_execprefix" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g'` ;; +# if the path contains slashes, also turn backslashes into slashes + *) bindir_to_execprefix=`echo "$bindir_to_execprefix" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bindir_to_execprefix" >&5 +$as_echo "$bindir_to_execprefix" >&6; } + +cat >>confdefs.h <<_ACEOF +#define BINDIR_TO_EXECPREFIX "$bindir_to_execprefix" +_ACEOF + + + +BTNMOD=${BTNMOD:-"Mod1"} + + +TOPDIRS= +for dir in src lib newlib doc example tools tutorial README_FILES +do + test -d $dir/. && TOPDIRS="$TOPDIRS $dir" +done + + +ac_config_files="$ac_config_files Makefile data/Makefile intl/Makefile po/Makefile.in" + + +if test -d $srcdir/README_FILES; then + ac_config_files="$ac_config_files README_FILES/Makefile" + +fi +if test -d $srcdir/doc; then + ac_config_files="$ac_config_files doc/Makefile" + +fi +if test -d $srcdir/doc/gs; then + ac_config_files="$ac_config_files doc/gs/Makefile" + + ac_config_files="$ac_config_files doc/gs/gafrc" + + ac_config_files="$ac_config_files doc/gs/gschemrc" + +fi +if test -d $srcdir/example; then + ac_config_files="$ac_config_files example/Makefile" + + ac_config_files="$ac_config_files example/libraries/Makefile" + +fi +if test -d $srcdir/lib; then + ac_config_files="$ac_config_files lib/CreateLibraryContents.sh" + + ac_config_files="$ac_config_files lib/CreateLibrary.sh" + + ac_config_files="$ac_config_files lib/ListLibraryContents.sh" + + ac_config_files="$ac_config_files lib/Makefile" + + ac_config_files="$ac_config_files lib/QueryLibrary.sh" + + ac_config_files="$ac_config_files lib/qfp-ui" + +fi +if test -d $srcdir/newlib; then + ac_config_files="$ac_config_files newlib/2_pin_thru-hole_packages/Makefile" + + ac_config_files="$ac_config_files newlib/Makefile" + + ac_config_files="$ac_config_files newlib/connectors/Makefile" + + ac_config_files="$ac_config_files newlib/crystal/Makefile" + + ac_config_files="$ac_config_files newlib/electro-optics/Makefile" + + ac_config_files="$ac_config_files newlib/headers/Makefile" + + ac_config_files="$ac_config_files newlib/keystone/Makefile" + + ac_config_files="$ac_config_files newlib/msp430/Makefile" + + ac_config_files="$ac_config_files newlib/not_vetted_ingo/Makefile" + + ac_config_files="$ac_config_files newlib/sockets/Makefile" + + ac_config_files="$ac_config_files newlib/tests/Makefile" + +fi +ac_config_files="$ac_config_files src/Makefile" + +ac_config_files="$ac_config_files src/icons/Makefile" + +if test -d $srcdir/tools; then + ac_config_files="$ac_config_files tools/Makefile" + +fi +if test -d $srcdir/tutorial; then + ac_config_files="$ac_config_files tutorial/Makefile" + +fi + +ac_config_files="$ac_config_files tests/inputs/Makefile" + +ac_config_files="$ac_config_files tests/golden/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_bom1/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_bom2/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_bom3/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_bom4/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode1/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode2/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode3/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode4/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode5/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode6/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode7/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode8/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode9/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode10/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gcode11/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gerber1/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gerber2/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_gerber3/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_png1/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_png2/Makefile" + +ac_config_files="$ac_config_files tests/golden/hid_png3/Makefile" + +ac_config_files="$ac_config_files tests/Makefile" + + +ac_config_files="$ac_config_files gts/Makefile" + + +ac_config_files="$ac_config_files w32/Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GIT_VERSION_TRUE}" && test -z "${GIT_VERSION_FALSE}"; then + as_fn_error $? "conditional \"GIT_VERSION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CVS_VERSION_TRUE}" && test -z "${CVS_VERSION_FALSE}"; then + as_fn_error $? "conditional \"CVS_VERSION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GIT_OR_CVS_VERSION_TRUE}" && test -z "${GIT_OR_CVS_VERSION_FALSE}"; then + as_fn_error $? "conditional \"GIT_OR_CVS_VERSION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then + as_fn_error $? "conditional \"WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + ac_config_commands="$ac_config_commands po/stamp-it" + + +if test -z "${WITH_TOPOROUTER_TRUE}" && test -z "${WITH_TOPOROUTER_FALSE}"; then + as_fn_error $? "conditional \"WITH_TOPOROUTER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DBUS_TRUE}" && test -z "${WITH_DBUS_FALSE}"; then + as_fn_error $? "conditional \"WITH_DBUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_GL_TRUE}" && test -z "${USE_GL_FALSE}"; then + as_fn_error $? "conditional \"USE_GL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_UPDATE_DESKTOP_DATABASE_TRUE}" && test -z "${ENABLE_UPDATE_DESKTOP_DATABASE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_UPDATE_DESKTOP_DATABASE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_UPDATE_MIME_DATABASE_TRUE}" && test -z "${ENABLE_UPDATE_MIME_DATABASE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_UPDATE_MIME_DATABASE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MISSING_PDFLATEX_TRUE}" && test -z "${MISSING_PDFLATEX_FALSE}"; then + as_fn_error $? "conditional \"MISSING_PDFLATEX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MISSING_TEXI2DVI_TRUE}" && test -z "${MISSING_TEXI2DVI_FALSE}"; then + as_fn_error $? "conditional \"MISSING_TEXI2DVI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MISSING_PS2PDF_TRUE}" && test -z "${MISSING_PS2PDF_FALSE}"; then + as_fn_error $? "conditional \"MISSING_PS2PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MISSING_GSCHEM_TRUE}" && test -z "${MISSING_GSCHEM_FALSE}"; then + as_fn_error $? "conditional \"MISSING_GSCHEM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_TEST_TOOLS_TRUE}" && test -z "${HAVE_TEST_TOOLS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_TEST_TOOLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PNG_TRUE}" && test -z "${PNG_FALSE}"; then + as_fn_error $? "conditional \"PNG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GIF_TRUE}" && test -z "${GIF_FALSE}"; then + as_fn_error $? "conditional \"GIF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PNG_PREVIEW_TRUE}" && test -z "${PNG_PREVIEW_FALSE}"; then + as_fn_error $? "conditional \"PNG_PREVIEW\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_PCBLIB_NEWLIB_TRUE}" && test -z "${BUILD_PCBLIB_NEWLIB_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PCBLIB_NEWLIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEBUG_BUILD_TRUE}" && test -z "${DEBUG_BUILD_FALSE}"; then + as_fn_error $? "conditional \"DEBUG_BUILD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by pcb $as_me 20110918, which was +generated by GNU Autoconf 2.66. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +pcb config.status 20110918 +configured by $0, generated by GNU Autoconf 2.66, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; + "intl/Makefile") CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "README_FILES/Makefile") CONFIG_FILES="$CONFIG_FILES README_FILES/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "doc/gs/Makefile") CONFIG_FILES="$CONFIG_FILES doc/gs/Makefile" ;; + "doc/gs/gafrc") CONFIG_FILES="$CONFIG_FILES doc/gs/gafrc" ;; + "doc/gs/gschemrc") CONFIG_FILES="$CONFIG_FILES doc/gs/gschemrc" ;; + "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; + "example/libraries/Makefile") CONFIG_FILES="$CONFIG_FILES example/libraries/Makefile" ;; + "lib/CreateLibraryContents.sh") CONFIG_FILES="$CONFIG_FILES lib/CreateLibraryContents.sh" ;; + "lib/CreateLibrary.sh") CONFIG_FILES="$CONFIG_FILES lib/CreateLibrary.sh" ;; + "lib/ListLibraryContents.sh") CONFIG_FILES="$CONFIG_FILES lib/ListLibraryContents.sh" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "lib/QueryLibrary.sh") CONFIG_FILES="$CONFIG_FILES lib/QueryLibrary.sh" ;; + "lib/qfp-ui") CONFIG_FILES="$CONFIG_FILES lib/qfp-ui" ;; + "newlib/2_pin_thru-hole_packages/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/2_pin_thru-hole_packages/Makefile" ;; + "newlib/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/Makefile" ;; + "newlib/connectors/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/connectors/Makefile" ;; + "newlib/crystal/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/crystal/Makefile" ;; + "newlib/electro-optics/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/electro-optics/Makefile" ;; + "newlib/headers/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/headers/Makefile" ;; + "newlib/keystone/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/keystone/Makefile" ;; + "newlib/msp430/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/msp430/Makefile" ;; + "newlib/not_vetted_ingo/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/not_vetted_ingo/Makefile" ;; + "newlib/sockets/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/sockets/Makefile" ;; + "newlib/tests/Makefile") CONFIG_FILES="$CONFIG_FILES newlib/tests/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/icons/Makefile") CONFIG_FILES="$CONFIG_FILES src/icons/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "tutorial/Makefile") CONFIG_FILES="$CONFIG_FILES tutorial/Makefile" ;; + "tests/inputs/Makefile") CONFIG_FILES="$CONFIG_FILES tests/inputs/Makefile" ;; + "tests/golden/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/Makefile" ;; + "tests/golden/hid_bom1/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_bom1/Makefile" ;; + "tests/golden/hid_bom2/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_bom2/Makefile" ;; + "tests/golden/hid_bom3/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_bom3/Makefile" ;; + "tests/golden/hid_bom4/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_bom4/Makefile" ;; + "tests/golden/hid_gcode1/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode1/Makefile" ;; + "tests/golden/hid_gcode2/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode2/Makefile" ;; + "tests/golden/hid_gcode3/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode3/Makefile" ;; + "tests/golden/hid_gcode4/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode4/Makefile" ;; + "tests/golden/hid_gcode5/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode5/Makefile" ;; + "tests/golden/hid_gcode6/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode6/Makefile" ;; + "tests/golden/hid_gcode7/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode7/Makefile" ;; + "tests/golden/hid_gcode8/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode8/Makefile" ;; + "tests/golden/hid_gcode9/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode9/Makefile" ;; + "tests/golden/hid_gcode10/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode10/Makefile" ;; + "tests/golden/hid_gcode11/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gcode11/Makefile" ;; + "tests/golden/hid_gerber1/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gerber1/Makefile" ;; + "tests/golden/hid_gerber2/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gerber2/Makefile" ;; + "tests/golden/hid_gerber3/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_gerber3/Makefile" ;; + "tests/golden/hid_png1/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_png1/Makefile" ;; + "tests/golden/hid_png2/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_png2/Makefile" ;; + "tests/golden/hid_png3/Makefile") CONFIG_FILES="$CONFIG_FILES tests/golden/hid_png3/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "gts/Makefile") CONFIG_FILES="$CONFIG_FILES gts/Makefile" ;; + "w32/Makefile") CONFIG_FILES="$CONFIG_FILES w32/Makefile" ;; + "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "default-1":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + "po/stamp-it":C) + if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then + as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 + fi + rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" + >"po/stamp-it.tmp" + sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" + + sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r po/POTFILES + } + ' "po/Makefile.in" >"po/Makefile" + rm -f "po/Makefile.tmp" + mv "po/stamp-it.tmp" "po/stamp-it" + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +with_gui=`echo $with_gui` +with_printer=`echo $with_printer` +with_exporters=`echo $with_exporters | sed 's/,/ /g'` + +expandedXDGDATADIR=`eval "echo $XDGDATADIR"` +expandedKDEDATADIR=`eval "echo $KDEDATADIR"` + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: +** Configuration summary for $PACKAGE $VERSION: + + GUI: $with_gui + Printer: $with_printer + Exporters: $with_exporters + Coordinate type: $COORD_TYPE + Source tree distribution: $pcb_sources + Build documentation: $docs_yesno + Build toporouter: $enable_toporouter + Enable toporouter output: $enable_toporouter_output + xdg data directory: $expandedXDGDATADIR + KDE data directory: $expandedKDEDATADIR + dmalloc debugging: $with_dmalloc + ElectricFence debugging: $with_efence + + Cross Compiling: $cross_compiling + CC: $CC + CXX: $CXX + CPPFLAGS: $CPPFLAGS + CFLAGS: $CFLAGS + CXXFLAGS: $CXXFLAGS + LIBS: $LIBS + PCB: $PCB + +" >&5 +$as_echo " +** Configuration summary for $PACKAGE $VERSION: + + GUI: $with_gui + Printer: $with_printer + Exporters: $with_exporters + Coordinate type: $COORD_TYPE + Source tree distribution: $pcb_sources + Build documentation: $docs_yesno + Build toporouter: $enable_toporouter + Enable toporouter output: $enable_toporouter_output + xdg data directory: $expandedXDGDATADIR + KDE data directory: $expandedKDEDATADIR + dmalloc debugging: $with_dmalloc + ElectricFence debugging: $with_efence + + Cross Compiling: $cross_compiling + CC: $CC + CXX: $CXX + CPPFLAGS: $CPPFLAGS + CFLAGS: $CFLAGS + CXXFLAGS: $CXXFLAGS + LIBS: $LIBS + PCB: $PCB + +" >&6; } Property changes on: tags/1.0.5/.pc/fix_CPPFLAGS.diff/configure ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/.pc/fix_CPPFLAGS.diff/configure.ac =================================================================== --- tags/1.0.5/.pc/fix_CPPFLAGS.diff/configure.ac (nonexistent) +++ tags/1.0.5/.pc/fix_CPPFLAGS.diff/configure.ac (revision 953) @@ -0,0 +1,1360 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT([pcb], [20110918]) +AC_CONFIG_SRCDIR([src/draw.c]) +AC_PREREQ([2.60]) +AM_INIT_AUTOMAKE([1.9]) +AC_GNU_SOURCE +AM_CONFIG_HEADER([config.h]) + +########################################################################## +# +# Try to figure out if we are building from git sources. +# If we are then unless building of the documentation has +# been disabled then just require the user have all the right +# tools. Users building from a tarball won't need latex, makeinfo, +# etc. but if you're already downloading development sources, then +# it is not unreasonable to require development tools. What motivated +# this is that using maintainer mode proved to cause regular confusion. + +pcb_sources="tarball" +AC_MSG_CHECKING([if you are building from a git checkout]) +pcb_git_version=no +if test -f $srcdir/.gitignore ; then + pcb_git_version=yes + AC_MSG_RESULT([yes]) + pcb_sources="GIT" +else + AC_MSG_RESULT([no]) +fi +AM_CONDITIONAL(GIT_VERSION, test x$pcb_git_version = xyes) + +AC_MSG_CHECKING([if you are building from a anoncvs checkout]) +pcb_cvs_version=no +if test -f $srcdir/CVS/Root ; then + pcb_cvs_version=yes + AC_MSG_RESULT([yes]) + pcb_sources="CVS" +else + AC_MSG_RESULT([no]) +fi +AM_CONDITIONAL(CVS_VERSION, test x$pcb_cvs_version = xyes) +AM_CONDITIONAL(GIT_OR_CVS_VERSION, test x$pcb_git_version = xyes -o x$pcb_cvs_version = xyes) + + +########################################################################## +# +# See if we are supposed to build the docs +# + +docs_yesno=yes +AC_MSG_CHECKING([if the documentation should be built]) +AC_ARG_ENABLE([doc], +[ --enable-doc Build and install the documentation [[default=yes]]], +[ +if test "X$enable_doc" = "Xno" ; then + DOC="" + AC_MSG_RESULT([no]) + docs_yesno=no +else + DOC=doc + AC_MSG_RESULT([yes]) + docs_yesno=yes +fi +], +[ +DOC=doc +AC_MSG_RESULT([yes]) +docs_yesno=yes +]) +AC_SUBST(DOC) + + +AC_MSG_CHECKING([if maintainer mode is required]) +if test "$docs_yesno" = "yes" -a "$pcb_git_version" = "yes" ; then + AC_MSG_RESULT([yes -- the documentation build is enabled and your sources are from git]) + enable_maintainer_mode=yes +else + AC_MSG_RESULT([no]) +fi + +AM_MAINTAINER_MODE + + +dnl determine host type +AC_CANONICAL_HOST +AC_MSG_CHECKING(for windows) +PCB_PATH_DELIMETER=":" +PCB_DIR_SEPARATOR_S="/" +PCB_DIR_SEPARATOR_C='/' +case $host in + *-*-cygwin* ) + CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}" + CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}" + ;; + + *-*-mingw* ) + WIN32=yes + CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}" + CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}" + ;; + + * ) + WIN32=no + ;; +esac + +AC_MSG_RESULT($WIN32) +AC_SUBST(WIN32) +AM_CONDITIONAL(WIN32, test x$WIN32 = xyes) +if test "x$WIN32" = "xyes" ; then + PCB_PATH_DELIMETER=";" + PCB_DIR_SEPARATOR_S="\\\\" + PCB_DIR_SEPARATOR_C='\\' +fi + +AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char]) +AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string]) +AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string]) + + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX + +if test "x$WIN32" = "xyes" ; then + AC_CHECK_TOOL(WINDRES, windres, [no]) + if test "$WINDRES" = "no" ; then + AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.]) + fi +fi + +# i18n +GETTEXT_PACKAGE=$PACKAGE +AH_TEMPLATE([GETTEXT_PACKAGE], [Name of this program's gettext domain]) +AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"]) +AC_SUBST(GETTEXT_PACKAGE) + +AM_GNU_GETTEXT_VERSION([0.14]) +AM_GNU_GETTEXT +IT_PROG_INTLTOOL([0.35.0]) + +AC_C_INLINE +AC_PROG_CC_STDC +AM_PROG_CC_C_O +AC_PROG_CPP +AC_PROG_AWK +AC_PROG_MKDIR_P + +AM_PROG_LEX +AC_PATH_PROG(LEX_PATH, $LEX, [notfound]) +if test "$LEX_PATH" = "notfound" ; then + AC_MSG_ERROR([Couldn't find a usable lex program. +Please install flex which is available from +ftp://ftp.gnu.org/pub/non-gnu/flex/ +]) +fi + + +AC_PROG_YACC +AC_PATH_PROG(YACC_PATH, $YACC, [notfound]) +if test "$YACC_PATH" = "notfound" ; then + AC_MSG_ERROR([Couldn't find a usable yacc program. +Please install bison which is available from +ftp://ftp.gnu.org/pub/gnu/bison/ +]) +fi + +AC_PROG_INSTALL +AC_PROG_RANLIB + +# +# Used for building the icons +# +AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound) +AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound) +AC_PATH_PROG(CONVERT, convert, notfound) + +########################################################################## +# +# +if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then + AC_PATH_PROG(MKINFO, makeinfo, no) + if test "X$MKINFO" != "Xno"; then + AC_MSG_CHECKING([for GNU makeinfo version >= 4.6]) + v=`$MKINFO --version | grep "GNU texinfo"` + if test $? -ne 0; then + AC_MSG_RESULT([non-GNU]) + MKINFO="no" + fi + fi + if test "X$MKINFO" != "Xno"; then + vmajor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\1/'` + vminor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\2/'` + AC_MSG_RESULT([$vmajor.$vminor]) + if test "$vmajor" -lt 4 \ + || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then + MKINFO=no + fi + fi + if test "X$MKINFO" = "Xno"; then + AC_MSG_ERROR([You have requested a build +of the documentation. For this to work, you must have version 4.6 or newer of +the GNU texinfo package. You seem to have + +$v + +Please update to a newer version of texinfo or disable building of +the documentation with --disable-doc +]) + fi + + AC_PATH_PROG(TEXI2DVI, texi2dvi, no) + if test "X$TEXI2DVI" = "Xno"; then + AC_MSG_ERROR([You have requested a build +of the documentation. For this to work, you must have the texi2dvi program +installed. Alternatively, you can disable building the documentation with +--disable-doc.]) + fi + + + AC_PATH_PROG(PERL, perl, notfound) + if test "X$PERL" = "Xnotfound"; then + AC_MSG_ERROR([You have requested a build +of the documentation. For this to work, you must have perl installed. +Alternatively, you can disable building the documentation with +--disable-doc. +]) + fi + + + AC_PATH_PROG([KPSEWHICH], [kpsewhich], [no]) + if test "X$KPSEWHICH" = "Xno"; then + AC_MSG_ERROR([You have requested a build +of the documentation. For this to work, you must have a functional install of +TeX and LaTeX. kpsewhich is part of TeX. +Alternatively, you can disable building the documentation with +--disable-doc.]) + fi + + AC_MSG_CHECKING([If your TeX installation contains epsf.tex]) + f=`$KPSEWHICH epsf.tex` + if test $? -eq 0 ; then + AC_MSG_RESULT([yes ($f)]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([You have requested a build +of the documentation. For this to work, you must have a functional install of +TeX and LaTeX that includes epsf.tex. On some linux distributions this is +part of the texlive-generic-recommended package. +Alternatively, you can disable building the documentation with +--disable-doc.]) + fi + +fi + +########################################################################## +# +# + +# FIXME: for now, only try to add -rdynamic if we're using gcc. We really +# need to figure out what the correct test is here. In the mean time, this +# should let things build with SunPRO again. +if test "x$GCC" = "xyes"; then +AC_MSG_CHECKING([If the compiler accepts -rdynamic]) +old_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -rdynamic" +AC_LINK_IFELSE([AC_LANG_PROGRAM()], + [AC_MSG_RESULT([yes])], + [LDFLAGS="$old_LDFLAGS" + AC_MSG_RESULT([no]) + ]) +fi + +# ------------- HID config ------------------- + +hid_guis="" +hid_printers="" +hid_exporters="" +hid_always="" + +for hid in `cd $srcdir/src/hid; echo *`; do + F=$srcdir/src/hid/$hid/hid.conf + if test -f $F + then + echo checking $F + . $F + case $type in + gui ) hid_guis="$hid_guis $hid" ;; + printer ) hid_printers="$hid_printers $hid" ;; + export ) hid_exporters="$hid_exporters $hid" ;; + always ) hid_always="$hid_always $hid" ;; + esac + fi +done + +AC_MSG_CHECKING([for which gui to use]) +AC_ARG_WITH([gui], +[ --with-gui= Specify the GUI to use: batch gtk lesstif [[default=gtk]]], +[], +[with_gui=gtk] +) +AC_MSG_RESULT([$with_gui]) +case " $hid_guis no none " in + *\ $with_gui\ * ) HIDLIST="$with_gui" ;; + * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;; +esac + +if test x"$with_gui" = x"none" -o x"$with_gui" = x"no" +then + HIDLIST= +fi + +AC_MSG_CHECKING([whether to enable toporouter]) +AC_ARG_ENABLE([toporouter], + [AS_HELP_STRING([--enable-toporouter], [build toporouter [default=yes]]) ] +) +AS_CASE(["x$enable_toporouter"],[xyes | xno],, + [enable_toporouter=yes + ] +) +AC_MSG_RESULT([$enable_toporouter]) +AM_CONDITIONAL([WITH_TOPOROUTER], test $enable_toporouter != no) + +AC_MSG_CHECKING([whether to enable toporouter output]) +AC_ARG_ENABLE([toporouter-output], + [AS_HELP_STRING([--enable-toporouter-output], [enable toporouter graphical output [default=no]]) ] +) +AS_CASE(["z$enable_toporouter_output"],[zyes | zno],, + [enable_toporouter_output=no] +) +AC_MSG_RESULT([$enable_toporouter_output]) +AS_CASE([$enable_toporouter_output],[yes], + [ + topo_output_enabled=1 + ], + [ + topo_output_enabled=0 + ] +) +AC_DEFINE_UNQUOTED([TOPO_OUTPUT_ENABLED], [$topo_output_enabled], + [Define to 1 to enable toporouter graphical output] +) + +PKG_PROG_PKG_CONFIG() + +if test "x$enable_toporouter_output" = "xyes"; then + PKG_CHECK_MODULES(CAIRO, cairo,, + [AC_MSG_ERROR([Cannot find cairo, needed by the toporouter +Please review the following errors: +$CAIRO_PKG_ERRORS])] + ) +fi + +AC_MSG_CHECKING([for whether to use DBUS]) +AC_ARG_ENABLE([dbus], +[ --enable-dbus Enable DBUS IPC], +[],[ + case " $with_gui " in + *\ gtk\ *) enable_dbus=yes ;; + *\ lesstif\ *) enable_dbus=yes ;; + * ) enable_dbus=no ;; + esac +]) + +AC_MSG_RESULT([$enable_dbus]) +AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes) + +if test "x$enable_dbus" = "xyes"; then + case " $with_gui " in + *\ gtk\ *) ;; + *\ lesstif\ *) ;; + * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID. +Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.]) + esac + + PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61, + [saved_LIBS="$LIBS" + LIBS="$LIBS $DBUS_LIBS" + AC_CHECK_FUNCS(dbus_watch_get_unix_fd) + LIBS="$saved_LIBS" ], + [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure +Please review the following errors: +$DBUS_PKG_ERRORS])] + ) + DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion` + + AC_DEFINE([HAVE_DBUS], 1, + [Define to 1 if DBUS IPC is to be compiled in]) + +fi + + +AC_MSG_CHECKING([for whether to use GL drawing]) +AC_ARG_ENABLE([gl], +[ --enable-gl Enable GL drawing (with GTK HID)], +[],[ + case " $with_gui " in + *\ gtk\ *) enable_gl=yes;; + * ) enable_gl=no;; + esac +]) +AC_MSG_RESULT([$enable_gl]) +AM_CONDITIONAL(USE_GL, test x$enable_gl = xyes) + +if test "x$enable_gl" = "xyes"; then + case " $with_gui " in + *\ gtk\ *) ;; + * ) AC_MSG_ERROR([GL drawing enabled but only works with the GTK HID. +Either do not use --enable-gl or enable the gtk HID.]) + ;; + esac + + AX_CHECK_GL + AS_IF([test X$no_gl = Xyes], + [AC_MSG_FAILURE([OpenGL is required.])]) + + AX_CHECK_GLU + AS_IF([test X$no_glu = Xyes], + [AC_MSG_FAILURE([The OpenGL GLU library is required.])]) + + AC_DEFINE([ENABLE_GL], 1, + [Define to 1 if GL support is to be compiled in]) +fi + +AC_MSG_CHECKING([for which printer to use]) +AC_ARG_WITH([printer], +[ --with-printer= Specify the printer: lpr [[default=lpr]]], +[],[with_printer=lpr]) +AC_MSG_RESULT([$with_printer]) +case " $hid_printers " in + *\ $with_printer\ * ) + HIDLIST="$HIDLIST $with_printer" + ;; + * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;; +esac + +AC_MSG_CHECKING([for which exporters to use]) +AC_ARG_WITH([exporters], +[ --with-exporters= Enable export devices: bom gerber gcode nelma png ps [[default=bom gerber gcode nelma png ps]]], +[],[with_exporters=$hid_exporters]) +AC_MSG_RESULT([$with_exporters]) +for e in `echo $with_exporters | sed 's/,/ /g'`; do + case " $hid_exporters " in + *\ $e\ * ) + HIDLIST="$HIDLIST $e" + ;; + * ) AC_MSG_ERROR([$e is not a valid exporter]) ;; + esac +done + +if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then + case " ${HIDLIST} " in + *\ png\ *) + AC_MSG_ERROR([you have requested the png HID but turned off all output +formats! If you do not want gif/jpeg/png output, use --with-exporters to list +which exporters you want and do not list png there.]) + ;; + + *) + ;; + esac +fi + +for hid in $HIDLIST; do + F=$srcdir/src/hid/$hid/hid.conf + if test -f $F ; then + echo checking $hid depedencies + deps= + . $F + for dep in $deps; do + if test "X`echo $HIDLIST | grep $dep`" = "X"; then + AC_MSG_ERROR([you have requested the $hid HID but not the $dep HID, which it depends on]) + fi + done + fi +done + +for e in $HIDLIST; do + HIDLIBS="$HIDLIBS lib$e.a" +done + +AC_SUBST(HIDLIST) +AC_SUBST(HIDLIBS) + +# ------------- end HID config ------------------- + +###################################################################### +# +# desktop integration +# + +AC_PATH_PROG(SETENV, env, []) +AC_PATH_PROG(GTK_UPDATE_ICON_CACHE_BIN, gtk-update-icon-path, [true]) + +# Change default location for XDG files (MIME and Icons) +AC_ARG_WITH(xdgdatadir, [ --with-xdgdatadir=path Change where the theme icons +and mime registrations are installed [[DATADIR]]], [opt_xdgdatadir=$withval]) + +# Change default location for KDE data files (KDE MIME registrations) +AC_ARG_WITH(kdedatadir, [ --with-kdedatadir=path Change where the KDE mime reg +istrations are installed [[DATADIR]]], [opt_kdedatadir=$withval]) + +if test x$opt_xdgdatadir = x; then + # path was not specified with --with-xdgdatadir + XDGDATADIR='${datadir}' +else + # path WAS specified with --with-xdgdatadir + XDGDATADIR="$opt_xdgdatadir" +fi +AC_SUBST(XDGDATADIR) + +if test x$opt_kdedatadir = x; then + # path was not specified with --with-kdedatadir + KDEDATADIR='${datadir}' +else + # path WAS specified with --with-kdedatadir + KDEDATADIR="$opt_kdedatadir" +fi +AC_SUBST(KDEDATADIR) + +AC_ARG_ENABLE(update-desktop-database, + AC_HELP_STRING([--disable-update-desktop-database], + [do not update desktop database after installation]),, + enable_update_desktop_database=yes) + +AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes) + +if test x$enable_update_desktop_database = xyes ; then + AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no) + if test $UPDATE_DESKTOP_DATABASE = no; then + AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database]) + fi +fi + +AC_ARG_ENABLE(update-mime-database, + AC_HELP_STRING([--disable-update-mime-database], + [do not update mime database after installation]),, + enable_update_mime_database=yes) + +AM_CONDITIONAL(ENABLE_UPDATE_MIME_DATABASE, test x$enable_update_mime_database = xyes) + +if test x$enable_update_mime_database = xyes ; then + AC_PATH_PROG(UPDATE_MIME_DATABASE, [update-mime-database], no) + if test $UPDATE_MIME_DATABASE = no; then + AC_MSG_ERROR([Cannot find update-mime-database, make sure it is installed and in your PATH, or configure with --disable-update-mime-database]) + fi +fi + +# +###################################################################### + +AC_PATH_PROGS(M4, gm4 m4, [none]) +if test "X$M4" = "Xnone" ; then + AC_MSG_ERROR([Did not find a m4 executible. You need to make sure + that m4 is installed on your system and that m4 is in your path]) +fi +AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug]) +pcb_m4_r=`echo "eval(-2/2)" | $M4` +if test "$pcb_m4_r" != "-1" ; then + AC_MSG_RESULT([yes]) + AC_MSG_ERROR([It appears that $M4 has a bug involving division +with negative numbers. In particular it just returned the result that +-2/2 = $pcb_m4_r instead of -1. This is a known bug in GNU m4-1.4.9. Please +install a non-broken m4.]) +else + AC_MSG_RESULT([no]) +fi + + +AC_PATH_PROGS(WISH, wish wish85 wish8.5 wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none]) +if test "X$WISH" = "Xnone" ; then + AC_MSG_ERROR([Did not find the wish executible. You need to make sure + that tcl is installed on your system and that wish is in your path]) +fi + +AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible]) +GNUM4=$M4 +AC_SUBST(GNUM4) +AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb]) + +AC_PATH_PROG(PDFLATEX, pdflatex, notfound) +AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound) + +AC_PATH_PROG(TEXI2DVI, texi2dvi, notfound) +AM_CONDITIONAL(MISSING_TEXI2DVI, test x$TEXI2DVI = xnotfound) + +AC_PATH_PROG(PS2PDF, ps2pdf, notfound) +AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound) + +# used to build some of the getting started guide +AC_PATH_PROG(GSCHEM, gschem, notfound) +AM_CONDITIONAL(MISSING_GSCHEM, test x$GSCHEM = xnotfound) + +if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then + if test "$PDFLATEX" = "notfound" -o "$TEXI2DVI" = "notfound" -o "$PS2PDF" = "notfound" ; then + AC_MSG_ERROR([It appears that you are building from a source tree obtained +via git but you do not have the required tools installed to build the documentation. Here +is a list of tools and the detected values: +PDFLATEX: $PDFLATEX +TEXI2DVI: $TEXI2DVI +PS2PDF: $PS2PDF +GSCHEM: $GSCHEM + +Either make sure these tools are installed or disable building and installing the documentation +by using the --disable-doc configure option. +]) + fi +fi + +############################################################################ +# +# These checks are for tools used by the testsuite. It will not be fatal +# if these are missing because this is primarily for developer use. It is +# possible that we might add some --enable flag in the future that forces +# full tools for development work. + +# Check for ImageMagick tools used by the testsuite +AC_PATH_PROG(IM_ANIMATE, animate, notfound) +AC_PATH_PROG(IM_COMPARE, compare, notfound) +AC_PATH_PROG(IM_COMPOSITE, composite, notfound) +AC_PATH_PROG(IM_CONVERT, convert, notfound) +AC_PATH_PROG(IM_DISPLAY, display, notfound) +AC_PATH_PROG(IM_MONTAGE, montage, notfound) +missing_magick="" +test "${IM_ANIMATE}" != "notfound" || missing_magick="${missing_magick} animate" +test "${IM_COMPARE}" != "notfound" || missing_magick="${missing_magick} compare" +test "${IM_COMPOSITE}" != "notfound" || missing_magick="${missing_magick} composite" +test "${IM_CONVERT}" != "notfound" || missing_magick="${missing_magick} convert" +test "${IM_DISPLAY}" != "notfound" || missing_magick="${missing_magick} display" +test "${IM_MONTAGE}" != "notfound" || missing_magick="${missing_magick} montage" + +AC_MSG_CHECKING([if all ImageMagick tools needed for the testsuite were found]) +if test "X${missing_magick}" != "X" ; then + AC_MSG_RESULT([no. The testsuite will be disabled because the following +tools from the ImageMagick suite were not found: +${missing_magick} +No loss in pcb functionality should be experienced, you just will not +be able to run the full regression testsuite. +]) + have_magick=no +else + AC_MSG_RESULT([yes]) + have_magick=yes +fi + +have_test_tools=yes + +test $have_magick = yes || have_test_tools=no + +# the RS274-X export HID is partially checked by looking at the result with +# gerbv +AC_PATH_PROG(GERBV, gerbv, notfound) +test $GERBV != notfound || have_test_tools=no + + +AM_CONDITIONAL(HAVE_TEST_TOOLS, test x$have_test_tools = xyes) +AC_MSG_CHECKING([if all the requried testsuite tools were found]) +if test x$have_test_tools = xyes ; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no -- the testsuite will be disabled]) +fi + + +# +############################################################################ + + +dnl Checks for libraries. +AC_CHECK_LIB(m, sqrt) +AC_CHECK_LIB(dl, dlopen) +AC_CHECK_LIB(xnet, gethostbyname) +AC_CHECK_LIB(fl, yywrap) +AC_CHECK_FUNCS(strerror) +AC_CHECK_FUNCS(regcomp re_comp) +AC_CHECK_FUNCS(logf expf rint) +AC_CHECK_FUNCS(vsnprintf) +AC_CHECK_FUNCS(getpwuid getcwd) +AC_CHECK_FUNCS(rand random) +AC_CHECK_FUNCS(stat) + +AC_CHECK_FUNCS(mkdtemp) + +# normally used for all file i/o +AC_CHECK_FUNCS(popen) + +# for lrealpath.c +AC_CHECK_FUNCS(realpath canonicalize_file_name) +libiberty_NEED_DECLARATION(canonicalize_file_name) + +# for pcb_spawnvp in action.c on Windows +AC_CHECK_FUNCS(_spawnvp) + +AC_HEADER_STDC +AC_CHECK_HEADERS(limits.h locale.h string.h sys/types.h regex.h pwd.h) +AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h sys/wait.h) +AC_CHECK_HEADERS(dlfcn.h) + +if test "x${WIN32}" = "xyes" ; then + AC_CHECK_HEADERS(windows.h) +fi +# Search for glib +PKG_CHECK_MODULES(GLIB, glib-2.0, , + [AC_MSG_RESULT([Note: cannot find glib-2.0. +You may want to review the following errors: +$GLIB_PKG_ERRORS])] +) + +for e in $HIDLIST; do + case $e in + lesstif ) + AC_PATH_XTRA + CPPFLAGS="$CFLAGS $X_CFLAGS" + AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS) + AC_CHECK_LIB(ICE, main, , , $X_LIBS) + AC_CHECK_LIB(SM, main, , , $X_LIBS) + AC_CHECK_LIB(Xext, main, , , $X_LIBS) + AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS) + AC_CHECK_LIB(Xmu, main, , , $X_LIBS) + AC_CHECK_LIB(Xpm, main, , , $X_LIBS) + AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS) + case $ac_cv_lib_Xm_XmCreateMainWindow in + no ) + AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.]) + ;; + * ) ;; + esac + AC_CHECK_HEADERS(Xm/Xm.h) + case $ac_cv_header_Xm_Xm_h in + no ) + AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.]) + ;; + * ) ;; + esac + ;; + + gtk ) + # Check for pkg-config + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + if test "$PKG_CONFIG" = "no"; then + AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH]) + fi + + PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0, , + [AC_MSG_ERROR([Cannot find gtk+ >= 2.18.0, install it and rerun ./configure +Please review the following errors: +$GTK_PKG_ERRORS])] + ) + GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion` + GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion` + + if test "x$enable_gl" = "xyes"; then + # Check for GtkGLExt + PKG_CHECK_MODULES(GTKGLEXT, gtkglext-1.0 >= 1.0.0, , [AC_MSG_ERROR([ +*** Required version of gtkglext is not installed - please install first *** +Please review the following errors: +$GTKGLEXT_PKG_ERRORS])] + ) + GTKGLEXT_VER=`$PKG_CONFIG gtkglext-1.0 --modversion` + fi + + ;; + + gcode|nelma|png ) + # Check for gdlib-config for gd (www.boutell.com/gd) + AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no) + if test "$GDLIB_CONFIG" = "no"; then + AC_MSG_RESULT([Cannot find gdlib-config. +Make sure it is installed and in your PATH. +gdlib-config is part of the GD library available from www.boutell.com/gd. +This is needed for the png HID. I will look for libgd anyway and maybe +you will get lucky. +]) + if test "$WIN32" != "yes" ; then + AC_CHECK_LIB(gd,main,, + AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs but -lgd could not be found]])) + else + AC_CHECK_LIB(bgd,main,, + AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs but -lbgd could not be found]])) + fi + else + if test "$WIN32" = "yes" ; then + GD=bgd + else + GD=gd + fi + AC_MSG_CHECKING([for libgd cflags]) + GD_CFLAGS="`$GDLIB_CONFIG --cflags`" + AC_MSG_RESULT([$GD_CFLAGS]) + AC_MSG_CHECKING([for libgd libs]) + GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}" + AC_MSG_RESULT([$GD_LIBS]) + fi + + # since some linux systems evidently install gdlib-config but fail to + # install the headers (nice), check for the header too and fail if it + # is not there. + CFLAGS="$CFLAGS $GD_CFLAGS" + CPPFLAGS="$CPPFLAGS $GD_CFLAGS" + AC_CHECK_HEADERS(gd.h) + case $ac_cv_header_gd_h in + no ) + AC_MSG_ERROR([ +You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd. +This is needed for the nelma and/or png HID. +]) + ;; + * ) ;; + esac + + # Some versions of gd (prior to the expiration of the + # patent related to gif compression) do not support + # gif output. Check for that here. + save_LIBS="$LIBS" + LIBS="$save_LIBS $GD_LIBS $X_LIBS" + + AC_MSG_CHECKING([if GIF output from the png HID is desired]) + AC_ARG_ENABLE([gif], + [ --disable-gif Disable support for gif output when the png HID is used [[default=include gif support]]], + [ + if test "X$enable_gif" != "Xno" ; then + AC_MSG_RESULT([yes]) + with_gif=yes + else + AC_MSG_RESULT([no]) + with_gif=no + fi + ], + [ + AC_MSG_RESULT([yes]) + with_gif=yes + ]) + if test "X$with_gif" = "Xyes" ; then + AC_CHECK_FUNCS(gdImageGif) + if test "$ac_cv_func_gdImageGif" != "yes"; then + AC_MSG_ERROR([Your gd installation does not appear to include gif support. +You may need to update your installation of gd or disable +gif export with --disable-gif]) + fi + fi + + AC_MSG_CHECKING([if JPEG output from the png HID is desired]) + AC_ARG_ENABLE([jpeg], + [ --disable-jpeg Disable support for JPEG output when the png HID is used [[default=include JPEG support]]], + [ + if test "X$enable_jpeg" != "Xno" ; then + AC_MSG_RESULT([yes]) + with_jpeg=yes + else + AC_MSG_RESULT([no]) + with_jpeg=no + fi + ], + [ + AC_MSG_RESULT([yes]) + with_jpeg=yes + ]) + if test "X$with_jpeg" = "Xyes" ; then + AC_CHECK_FUNCS(gdImageJpeg) + if test "$ac_cv_func_gdImageJpeg" != "yes"; then + AC_MSG_ERROR([Your gd installation does not appear to include JPEG support. +You may need to update your installation of gd or disable +JPEG export with --disable-jpeg]) + fi + fi + + + AC_MSG_CHECKING([if PNG output from the png HID is desired]) + AC_ARG_ENABLE([png], + [ --disable-png Disable support for PNG output when the png HID is used [[default=include PNG support]]], + [ + if test "X$enable_png" != "Xno" ; then + AC_MSG_RESULT([yes]) + with_png=yes + else + AC_MSG_RESULT([no]) + with_png=no + fi + ], + [ + AC_MSG_RESULT([yes]) + with_png=yes + ]) + if test "X$with_png" = "Xyes" ; then + AC_CHECK_FUNCS(gdImagePng) + if test "$ac_cv_func_gdImagePng" != "yes"; then + AC_MSG_ERROR([Your gd installation does not appear to include PNG support. +You may need to update your installation of gd or disable +PNG export with --disable-png]) + fi + fi + LIBS="$save_LIBS" + ;; + + esac +done + + +AM_CONDITIONAL(PNG, test x$with_png = xyes) +AM_CONDITIONAL(GIF, test x$with_gif = xyes) + +# ------------- check if png previews should be built for pcblib-newlib +AC_MSG_CHECKING([if the m4lib to newlib export should create png previews]) +AC_ARG_ENABLE( + [m4lib-png], + [ --enable-m4lib-png Enable creating png previews for the m4 library], + [],[enable_m4lib_png=no]) +AC_MSG_RESULT([$enable_m4lib_png]) +AM_CONDITIONAL(PNG_PREVIEW, test x$enable_m4lib_png = xyes) + + +# Run away.... more ugly stuff here. By default we don't actually build +# pcblib-newlib from pcblib unless we are building from cvs or git sources. +# The reason is it takes a while and requires the png HID. The problem is, +# what if someone wants to use --enable-m4lib-png but the tarball was built +# without the previews. Or, what if someone does not want the PNG previews +# but the person building the tarball included them. Ugh! So what the following +# code attempts to do is detect that mismatch situation. Note that we only +# want to kick this code in when *not* building from git or cvs sources. +build_pcblib_newlib=no +if test "$pcb_sources" = "tarball" ; then + AC_MSG_CHECKING([If pcblib-newlib was built with png previews]) + stamp=$srcdir/lib/pcblib-newlib.stamp + if test ! -f ${stamp} ; then + AC_MSG_RESULT([unknown, missing ${stamp}]) + build_pcblib_newlib=yes + else + if test "`cat ${stamp}`" = "png-preview=yes" ; then + AC_MSG_RESULT([yes]) + # lib exists and built with preview. + # if we don't want the preview, than rebuild + if test x$enable_m4lib_png != xyes ; then + build_pcblib_newlib=yes + fi + else + AC_MSG_RESULT([no]) + # lib exists and built without preview. + # if we want the preview, than rebuild + if test x$enable_m4lib_png = xyes ; then + build_pcblib_newlib=yes + fi + fi + fi +else + build_pcblib_newlib=yes +fi +AC_MSG_CHECKING([If pcblib-newlib needs to be rebuilt]) +AC_MSG_RESULT([$build_pcblib_newlib]) +AM_CONDITIONAL(BUILD_PCBLIB_NEWLIB, test x$build_pcblib_newlib = xyes) + +if test "X$cross_compiling" = "Xyes" ; then + # we are cross compiling so we will need a build host binary for pcb + AC_PATH_PROG(PCB, [pcb], [notfound]) +else + PCB="\${top_builddir}/src/pcb" +fi +AC_SUBST(PCB) + +# now make see how essential it was that we have a pcb executable for the build +# host +if test "X$pcb_git_version" = "Xyes" ; then + if test "X$docs_yesno" = "Xyes" -o "X$enable_m4lib_png" = "Xyes" ; then + if test "$PCB" = "notfound" ; then + AC_MSG_ERROR([You have selected a build with m4lib png +previews enabled and/or with building the documentation enabled but you also +appear to be cross-compiling. For this to work, you must have a pcb installed that +can run on this machine (the build machine) because it is needed for generating +library footprint png previews as well as some of the figures in the documentation. +If you wish to skip building the documentation and the footprint previews then add +--disable-doc --disable-m4lib-png +This will allow your cross build to work.]) + fi + fi +fi + +# ------------- Xrender ------------------- +have_xrender=no +AC_CHECK_LIB(Xrender,XRenderQueryExtension,have_xrender=yes,have_xrender=no,$X_LIBS) + +AC_ARG_ENABLE([xrender], +[ --disable-xrender Compile and link with Xrender [default=yes]]) +case "$have_xrender:$enable_xrender" in + no:* ) ;; + *:no ) ;; + * ) + X_LIBS="-lXrender $X_LIBS" + AC_DEFINE([HAVE_XRENDER], 1, + [Define to 1 if Xrender is available]) + ;; +esac + +# ------------- Xinerama ------------------- +have_xinerama=no +AC_CHECK_LIB(Xinerama,XineramaQueryExtension,have_xinerama=yes,have_xinerama=no,$X_LIBS) + +AC_ARG_ENABLE([xinerama], +[ --disable-xinerama Compile and link with Xinerama [default=yes]]) +case "$have_xinerama:$enable_xinerama" in + no:* ) ;; + *:no ) ;; + * ) + X_LIBS="-lXinerama $X_LIBS" + AC_DEFINE([HAVE_XINERAMA], 1, + [Define to 1 if Xinerama is available]) + ;; +esac + +# ------------- dmalloc ------------------- +dnl dmalloc checks +with_dmalloc=no +AC_MSG_CHECKING([if dmalloc debugging should be enabled]) +AC_ARG_ENABLE([dmalloc], +[ --enable-dmalloc Compile and link with dmalloc for malloc debugging [default=no]], +[ +if test "X$enable_dmalloc" != "Xno" ; then + AC_MSG_RESULT([yes]) + AC_CHECK_HEADER(dmalloc.h,, + AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found])) + AC_CHECK_LIB(dmalloc,main,, + AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found])) + DMALLOC_LIBS="-ldmalloc" + with_dmalloc=yes +else + AC_MSG_RESULT([no]) + DMALLOC_LIBS="" +fi +], +[ + AC_MSG_RESULT([no]) + DMALLOC_LIBS="" +]) + +# ------------- ElectricFence ------------------- +dnl ElectricFence checks +with_efence=no +AC_MSG_CHECKING([if ElectricFence debugging should be enabled]) +AC_ARG_ENABLE([efence], +[ --enable-efence Link with ElectricFence for malloc debugging [default=no]], +[ +if test "X$enable_efence" != "Xno" ; then + AC_MSG_RESULT([yes]) + AC_CHECK_LIB(efence,main,, + AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found])) + with_efence=yes +else + AC_MSG_RESULT([no]) +fi +], +[ +AC_MSG_RESULT([no]) +]) + +# ------------- Enable Debug code ------------------- +AC_MSG_CHECKING([for whether to enable debugging code]) +AC_ARG_ENABLE([debug], +[ --enable-debug Enable debugging code], +[],[enable_debug=no]) + +AC_MSG_RESULT([$enable_debug]) +AM_CONDITIONAL(DEBUG_BUILD, test x$enable_debug = xyes) + +# ------------- mkdir required for win32 compatibility ------------ +# WIN32 mkdir takes only one argument, POSIX takes two. +# #include "misc.h" where mkdir is required. +m4_include([m4/m4_ax_func_mkdir.m4]) +AX_FUNC_MKDIR + +# ------------- Type used for "Coord" type ------------------- + +AC_CHECK_HEADERS(stdint.h) +AC_ARG_ENABLE([coord64], +[ --enable-coord64 Force 64-bit coordinate types], +[],[enable_coord64=no]) +AC_ARG_ENABLE([coord32], +[ --enable-coord32 Force 32-bit coordinate types], +[],[enable_coord32=no]) + +COORDTYPE="long" + +echo "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" +case "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" in + yes:no:yes ) + COORD_TYPE="int32_t" + COORD_MAX="INT32_MAX" + ;; + no:yes:yes ) + COORD_TYPE="int64_t" + COORD_MAX="INT64_MAX" + ;; + yes:no:no ) + COORD_TYPE="int" + COORD_MAX="INT_MAX" + ;; + no:yes:no ) + COORD_TYPE="long long" + COORD_MAX="LLONG_MAX" + ;; + yes:yes:* ) + AC_MSG_ERROR("*** cannot require both 32 and 64 bit coordinates") + ;; + *:*:* ) + COORD_TYPE="long" + COORD_MAX="LONG_MAX" + ;; +esac +AC_DEFINE_UNQUOTED([COORD_TYPE],[$COORD_TYPE], + [C type for Coordinates]) +AC_DEFINE_UNQUOTED([COORD_MAX],[$COORD_MAX], + [Maximum value of coordinate type]) + +# ------------- Complete set of CFLAGS and LIBS ------------------- + +CFLAGS="$CFLAGS $X_CFLAGS $DBUS_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS $CAIRO_CFLAGS $GTKGLEXT_CFLAGS $GLU_CFLAGS $GL_CFLAGS" +LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GLIB_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS $INTLLIBS $CAIRO_LIBS $GTKGLEXT_LIBS $GLU_LIBS $GL_LIBS" + + +# if we have gcc then add -Wall +if test "x$GCC" = "xyes"; then + # see about adding some extra checks if the compiler takes them + for flag in -Wall ; do + case " ${CFLAGS} " in + *\ ${flag}\ *) + # flag is already present + ;; + *) + AC_MSG_CHECKING([if the compiler accepts ${flag}]) + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS ${flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + CFLAGS="$ac_save_CFLAGS" + ] + ) + ;; + esac + done +fi + +CXXFLAGS="$CFLAGS" + +# Now add C-specific flags +if test "x$GCC" = "xyes"; then + # see about adding some extra checks if the compiler takes them + for flag in -Wdeclaration-after-statement ; do + case " ${CFLAGS} " in + *\ ${flag}\ *) + # flag is already present + ;; + *) + AC_MSG_CHECKING([if the compiler accepts ${flag}]) + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS ${flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + CFLAGS="$ac_save_CFLAGS" + ] + ) + ;; + esac + done +fi + +# See if we are building gcc with C++. +AC_ARG_ENABLE(build-with-cxx, +[ --enable-build-with-cxx build with C++ compiler instead of C compiler], +ENABLE_BUILD_WITH_CXX=$enableval, +ENABLE_BUILD_WITH_CXX=no) + +case "$ENABLE_BUILD_WITH_CXX" in + yes) + CC_OR_CXX="$CXX" + CC_OR_CXX_FLAGS="$CXXFLAGS" + ;; + no) + CC_OR_CXX="$CC" + CC_OR_CXX_FLAGS="$CFLAGS" + ;; +esac +AC_SUBST(CC_OR_CXX) +AC_SUBST(CC_OR_CXX_FLAGS) + +# font filename +FONTFILENAME=${FONTFILENAME:-"default_font"} +AC_SUBST(FONTFILENAME) +AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font]) + +# standard autoconf variables +CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\"" +CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\"" +CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\"" + +# directory for old-style library and for fonts +PCBLIBDIR=${datadir}/pcb +AC_SUBST(PCBLIBDIR) +#AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory]) +CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\"" + +# name for old-style library +LIBRARYFILENAME=pcblib +AC_SUBST(LIBRARYFILENAME) +AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name]) + + +# directory for new library +PCBTREEDIR=${datadir}/pcb/newlib +PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib +PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"} +AC_SUBST(PCBTREEDIR) +AC_SUBST(PCBTREEPATH) +#AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library]) +CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\"" +CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\"" + +# Figure out relative paths +AC_MSG_CHECKING([for the bindir to pcblibdir relative path]) +adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir]) +adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S]) +AC_MSG_RESULT([$bindir_to_pcblibdir]) +AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir]) + +AC_MSG_CHECKING([for the bindir to pcbtreedir relative path]) +adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir]) +adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S]) +AC_MSG_RESULT([$bindir_to_pcbtreedir]) +AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir]) + + +AC_MSG_CHECKING([for the bindir to exec_prefix relative path]) +adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix]) +adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S]) +AC_MSG_RESULT([$bindir_to_execprefix]) +AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix]) + + +BTNMOD=${BTNMOD:-"Mod1"} +AC_SUBST(BTNMOD) + +TOPDIRS= +for dir in src lib newlib doc example tools tutorial README_FILES +do + test -d $dir/. && TOPDIRS="$TOPDIRS $dir" +done +AC_SUBST(TOPDIRS) + +AC_CONFIG_FILES(Makefile data/Makefile intl/Makefile po/Makefile.in) + +if test -d $srcdir/README_FILES; then + AC_CONFIG_FILES(README_FILES/Makefile) +fi +if test -d $srcdir/doc; then + AC_CONFIG_FILES(doc/Makefile) +fi +if test -d $srcdir/doc/gs; then + AC_CONFIG_FILES(doc/gs/Makefile) + AC_CONFIG_FILES(doc/gs/gafrc) + AC_CONFIG_FILES(doc/gs/gschemrc) +fi +if test -d $srcdir/example; then + AC_CONFIG_FILES(example/Makefile) + AC_CONFIG_FILES(example/libraries/Makefile) +fi +if test -d $srcdir/lib; then + AC_CONFIG_FILES(lib/CreateLibraryContents.sh) + AC_CONFIG_FILES(lib/CreateLibrary.sh) + AC_CONFIG_FILES(lib/ListLibraryContents.sh) + AC_CONFIG_FILES(lib/Makefile) + AC_CONFIG_FILES(lib/QueryLibrary.sh) + AC_CONFIG_FILES(lib/qfp-ui) +fi +if test -d $srcdir/newlib; then + AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile) + AC_CONFIG_FILES(newlib/Makefile) + AC_CONFIG_FILES(newlib/connectors/Makefile) + AC_CONFIG_FILES(newlib/crystal/Makefile) + AC_CONFIG_FILES(newlib/electro-optics/Makefile) + AC_CONFIG_FILES(newlib/headers/Makefile) + AC_CONFIG_FILES(newlib/keystone/Makefile) + AC_CONFIG_FILES(newlib/msp430/Makefile) + AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile) + AC_CONFIG_FILES(newlib/sockets/Makefile) + AC_CONFIG_FILES(newlib/tests/Makefile) +fi +AC_CONFIG_FILES(src/Makefile) +AC_CONFIG_FILES(src/icons/Makefile) +if test -d $srcdir/tools; then + AC_CONFIG_FILES(tools/Makefile) +fi +if test -d $srcdir/tutorial; then + AC_CONFIG_FILES(tutorial/Makefile) +fi + +dnl testsuite +AC_CONFIG_FILES(tests/inputs/Makefile) +AC_CONFIG_FILES(tests/golden/Makefile) +AC_CONFIG_FILES(tests/golden/hid_bom1/Makefile) +AC_CONFIG_FILES(tests/golden/hid_bom2/Makefile) +AC_CONFIG_FILES(tests/golden/hid_bom3/Makefile) +AC_CONFIG_FILES(tests/golden/hid_bom4/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode1/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode2/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode3/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode4/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode5/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode6/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode7/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode8/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode9/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode10/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gcode11/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gerber1/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gerber2/Makefile) +AC_CONFIG_FILES(tests/golden/hid_gerber3/Makefile) +AC_CONFIG_FILES(tests/golden/hid_png1/Makefile) +AC_CONFIG_FILES(tests/golden/hid_png2/Makefile) +AC_CONFIG_FILES(tests/golden/hid_png3/Makefile) +AC_CONFIG_FILES(tests/Makefile) + +dnl GTS 0.7.6 - http://gts.sourceforge.net/ +AC_CONFIG_FILES(gts/Makefile) + +dnl win32 build scripts +AC_CONFIG_FILES(w32/Makefile) + +AC_OUTPUT + +with_gui=`echo $with_gui` +with_printer=`echo $with_printer` +with_exporters=`echo $with_exporters | sed 's/,/ /g'` + +expandedXDGDATADIR=`eval "echo $XDGDATADIR"` +expandedKDEDATADIR=`eval "echo $KDEDATADIR"` + +AC_MSG_RESULT([ +** Configuration summary for $PACKAGE $VERSION: + + GUI: $with_gui + Printer: $with_printer + Exporters: $with_exporters + Coordinate type: $COORD_TYPE + Source tree distribution: $pcb_sources + Build documentation: $docs_yesno + Build toporouter: $enable_toporouter + Enable toporouter output: $enable_toporouter_output + xdg data directory: $expandedXDGDATADIR + KDE data directory: $expandedKDEDATADIR + dmalloc debugging: $with_dmalloc + ElectricFence debugging: $with_efence + + Cross Compiling: $cross_compiling + CC: $CC + CXX: $CXX + CPPFLAGS: $CPPFLAGS + CFLAGS: $CFLAGS + CXXFLAGS: $CXXFLAGS + LIBS: $LIBS + PCB: $PCB + +]) Index: tags/1.0.5/.pc/fix_pan_action.diff/po/POTFILES.skip =================================================================== Index: tags/1.0.5/.pc/fix_pan_action.diff/src/hid/gtk/gtkhid-main.c =================================================================== --- tags/1.0.5/.pc/fix_pan_action.diff/src/hid/gtk/gtkhid-main.c (nonexistent) +++ tags/1.0.5/.pc/fix_pan_action.diff/src/hid/gtk/gtkhid-main.c (revision 953) @@ -0,0 +1,2190 @@ +/* $Id$ */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#ifdef HAVE_STRING_H +#include +#endif +#include +#include + + +#include "action.h" +#include "crosshair.h" +#include "error.h" +#include "../hidint.h" +#include "gui.h" +#include "hid/common/hidnogui.h" +#include "hid/common/draw_helpers.h" +#include "pcb-printf.h" + +#ifdef HAVE_LIBDMALLOC +#include +#endif + + +RCSID ("$Id$"); + + +static void +pan_common (GHidPort *port) +{ + int event_x, event_y; + + /* We need to fix up the PCB coordinates corresponding to the last + * event so convert it back to event coordinates temporarily. */ + ghid_pcb_to_event_coords (gport->pcb_x, gport->pcb_y, &event_x, &event_y); + + /* Don't pan so far the board is completely off the screen */ + port->view.x0 = MAX (-port->view.width, port->view.x0); + port->view.y0 = MAX (-port->view.height, port->view.y0); + port->view.x0 = MIN ( port->view.x0, PCB->MaxWidth); + port->view.y0 = MIN ( port->view.y0, PCB->MaxHeight); + + /* Fix up noted event coordinates to match where we clamped. Alternatively + * we could call ghid_note_event_location (NULL); to get a new pointer + * location, but this costs us an xserver round-trip (on X11 platforms) + */ + ghid_event_to_pcb_coords (event_x, event_y, &gport->pcb_x, &gport->pcb_y); + + ghidgui->adjustment_changed_holdoff = TRUE; + gtk_range_set_value (GTK_RANGE (ghidgui->h_range), gport->view.x0); + gtk_range_set_value (GTK_RANGE (ghidgui->v_range), gport->view.y0); + ghidgui->adjustment_changed_holdoff = FALSE; + + ghid_port_ranges_changed(); +} + +static void +ghid_pan_view_abs (Coord pcb_x, Coord 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; + + pan_common (gport); +} + +void +ghid_pan_view_rel (Coord dx, Coord dy) +{ + gport->view.x0 += dx; + gport->view.y0 += dy; + + pan_common (gport); +} + + +/* gport->view.coord_per_px: + * zoom value is PCB units per screen pixel. Larger numbers mean zooming + * out - the largest value means you are looking at the whole board. + * + * gport->view_width and gport->view_height are in PCB coordinates + */ + +#define ALLOW_ZOOM_OUT_BY 10 /* Arbitrary, and same as the lesstif HID */ +static void +ghid_zoom_view_abs (Coord center_x, Coord center_y, double new_zoom) +{ + double min_zoom, max_zoom; + double xtmp, ytmp; + + /* Limit the "minimum" zoom constant (maximum zoom), at 1 pixel per PCB + * unit, and set the "maximum" zoom constant (minimum zoom), such that + * the entire board just fits inside the viewport + */ + min_zoom = 1; + max_zoom = MAX (PCB->MaxWidth / gport->width, + PCB->MaxHeight / gport->height) * ALLOW_ZOOM_OUT_BY; + new_zoom = MIN (MAX (min_zoom, new_zoom), max_zoom); + + if (gport->view.coord_per_px == new_zoom) + return; + + xtmp = (SIDE_X (center_x) - gport->view.x0) / (double)gport->view.width; + ytmp = (SIDE_Y (center_y) - gport->view.y0) / (double)gport->view.height; + + gport->view.coord_per_px = new_zoom; + pixel_slop = new_zoom; + ghid_port_ranges_scale (); + + gport->view.x0 = SIDE_X (center_x) - xtmp * gport->view.width; + gport->view.y0 = SIDE_Y (center_y) - ytmp * gport->view.height; + + pan_common (gport); + + ghid_set_status_line_label (); +} + +static void +ghid_zoom_view_rel (Coord center_x, Coord center_y, double factor) +{ + ghid_zoom_view_abs (center_x, center_y, gport->view.coord_per_px * factor); +} + +static void +ghid_zoom_view_fit (void) +{ + ghid_pan_view_abs (SIDE_X (0), SIDE_Y (0), 0, 0); + 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, bool flip_x, bool flip_y) +{ + int widget_x, widget_y; + + /* Work out where on the screen the flip point is */ + ghid_pcb_to_event_coords (center_x, center_y, &widget_x, &widget_y); + + gport->view.flip_x = gport->view.flip_x != flip_x; + gport->view.flip_y = gport->view.flip_y != flip_y; + + /* Pan the board so the center location remains in the same place */ + ghid_pan_view_abs (center_x, center_y, widget_x, widget_y); + + ghid_invalidate_all (); +} + +/* ------------------------------------------------------------ */ + +static const char zoom_syntax[] = +"Zoom()\n" +"Zoom(factor)"; + + +static const char zoom_help[] = +N_("Various zoom factor changes."); + +/* %start-doc actions Zoom +Changes the zoom (magnification) of the view of the board. If no +arguments are passed, the view is scaled such that the board just fits +inside the visible window (i.e. ``view all''). Otherwise, +@var{factor} specifies a change in zoom factor. It may be prefixed by +@code{+}, @code{-}, or @code{=} to change how the zoom factor is +modified. The @var{factor} is a floating point number, such as +@code{1.5} or @code{0.75}. + +@table @code + +@item +@var{factor} +Values greater than 1.0 cause the board to be drawn smaller; more of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn bigger; less of the board will be visible. + +@item -@var{factor} +Values greater than 1.0 cause the board to be drawn bigger; less of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn smaller; more of the board will be visible. + +@item =@var{factor} + +The @var{factor} is an absolute zoom factor; the unit for this value +is "PCB units per screen pixel". Since PCB units are 0.01 mil, a +@var{factor} of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, +about the actual resolution of most screens - resulting in an "actual +size" board. Similarly, a @var{factor} of 100 gives you a 10x actual +size. + +@end table + +Note that zoom factors of zero are silently ignored. + + + +%end-doc */ + +static int +Zoom (int argc, char **argv, Coord x, Coord y) +{ + const char *vp; + double v; + + if (argc > 1) + AFAIL (zoom); + + if (argc < 1) + { + ghid_zoom_view_fit (); + return 0; + } + + vp = argv[0]; + if (*vp == '+' || *vp == '-' || *vp == '=') + vp++; + v = g_ascii_strtod (vp, 0); + if (v <= 0) + return 1; + switch (argv[0][0]) + { + case '-': + ghid_zoom_view_rel (x, y, 1 / v); + break; + default: + case '+': + ghid_zoom_view_rel (x, y, v); + break; + case '=': + ghid_zoom_view_abs (x, y, v); + break; + } + + return 0; +} + +/* ------------------------------------------------------------ */ + +void +ghid_calibrate (double xval, double yval) +{ + printf (_("ghid_calibrate() -- not implemented\n")); +} + +static int ghid_gui_is_up = 0; + +void +ghid_notify_gui_is_up () +{ + ghid_gui_is_up = 1; +} + +int +ghid_shift_is_pressed () +{ + GdkModifierType mask; + GHidPort *out = &ghid_port; + + if( ! ghid_gui_is_up ) + return 0; + + gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area), + NULL, NULL, &mask); + return (mask & GDK_SHIFT_MASK) ? TRUE : FALSE; +} + +int +ghid_control_is_pressed () +{ + GdkModifierType mask; + GHidPort *out = &ghid_port; + + if( ! ghid_gui_is_up ) + return 0; + + gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area), + NULL, NULL, &mask); + return (mask & GDK_CONTROL_MASK) ? TRUE : FALSE; +} + +int +ghid_mod1_is_pressed () +{ + GdkModifierType mask; + GHidPort *out = &ghid_port; + + if( ! ghid_gui_is_up ) + return 0; + + gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area), + NULL, NULL, &mask); +#ifdef __APPLE__ + return (mask & ( 1 << 13 ) ) ? TRUE : FALSE; // The option key is not MOD1, although it should be... +#else + return (mask & GDK_MOD1_MASK) ? TRUE : FALSE; +#endif +} + +void +ghid_set_crosshair (int x, int y, int action) +{ + GdkDisplay *display; + GdkScreen *screen; + int offset_x, offset_y; + int widget_x, widget_y; + int pointer_x, pointer_y; + Coord pcb_x, pcb_y; + + if (gport->crosshair_x != x || gport->crosshair_y != y) + { + ghid_set_cursor_position_labels (); + gport->crosshair_x = x; + gport->crosshair_y = y; + + /* FIXME - does this trigger the idle_proc stuff? It is in the + * lesstif HID. Maybe something is needed here? + * + * need_idle_proc (); + */ + } + + if (action != HID_SC_PAN_VIEWPORT && + action != HID_SC_WARP_POINTER) + return; + + /* Find out where the drawing area is on the screen. gdk_display_get_pointer + * and gdk_display_warp_pointer work relative to the whole display, whilst + * our coordinates are relative to the drawing area origin. + */ + gdk_window_get_origin (gtk_widget_get_window (gport->drawing_area), + &offset_x, &offset_y); + display = gdk_display_get_default (); + + switch (action) { + case HID_SC_PAN_VIEWPORT: + /* Pan the board in the viewport so that the crosshair (who's location + * relative on the board was set above) lands where the pointer is. + * We pass the request to pan a particular point on the board to a + * given widget coordinate of the viewport into the rendering code + */ + + /* Find out where the pointer is relative to the display */ + gdk_display_get_pointer (display, NULL, &pointer_x, &pointer_y, NULL); + + widget_x = pointer_x - offset_x; + widget_y = pointer_y - offset_y; + + ghid_event_to_pcb_coords (widget_x, widget_y, &pcb_x, &pcb_y); + ghid_pan_view_abs (pcb_x, pcb_y, widget_x, widget_y); + + /* Just in case we couldn't pan the board the whole way, + * we warp the pointer to where the crosshair DID land. + */ + /* Fall through */ + + case HID_SC_WARP_POINTER: + screen = gdk_display_get_default_screen (display); + + ghid_pcb_to_event_coords (x, y, &widget_x, &widget_y); + + pointer_x = offset_x + widget_x; + pointer_y = offset_y + widget_y; + + gdk_display_warp_pointer (display, screen, pointer_x, pointer_y); + + break; + } +} + +typedef struct +{ + void (*func) (hidval); + guint id; + hidval user_data; +} +GuiTimer; + + /* We need a wrapper around the hid timer because a gtk timer needs + | to return FALSE else the timer will be restarted. + */ +static gboolean +ghid_timer (GuiTimer * timer) +{ + (*timer->func) (timer->user_data); + ghid_mode_cursor (Settings.Mode); + return FALSE; /* Turns timer off */ +} + +hidval +ghid_add_timer (void (*func) (hidval user_data), + unsigned long milliseconds, hidval user_data) +{ + GuiTimer *timer = g_new0 (GuiTimer, 1); + hidval ret; + + timer->func = func; + timer->user_data = user_data; + timer->id = g_timeout_add (milliseconds, (GSourceFunc) ghid_timer, timer); + ret.ptr = (void *) timer; + return ret; +} + +void +ghid_stop_timer (hidval timer) +{ + void *ptr = timer.ptr; + + g_source_remove (((GuiTimer *) ptr)->id); + g_free( ptr ); +} + +typedef struct +{ + void (*func) ( hidval, int, unsigned int, hidval ); + hidval user_data; + int fd; + GIOChannel *channel; + gint id; +} +GuiWatch; + + /* We need a wrapper around the hid file watch to pass the correct flags + */ +static gboolean +ghid_watch (GIOChannel *source, GIOCondition condition, gpointer data) +{ + unsigned int pcb_condition = 0; + hidval x; + GuiWatch *watch = (GuiWatch*)data; + + if (condition & G_IO_IN) + pcb_condition |= PCB_WATCH_READABLE; + if (condition & G_IO_OUT) + pcb_condition |= PCB_WATCH_WRITABLE; + if (condition & G_IO_ERR) + pcb_condition |= PCB_WATCH_ERROR; + if (condition & G_IO_HUP) + pcb_condition |= PCB_WATCH_HANGUP; + + x.ptr = (void *) watch; + watch->func (x, watch->fd, pcb_condition, watch->user_data); + ghid_mode_cursor (Settings.Mode); + + 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) +{ + GuiWatch *watch = g_new0 (GuiWatch, 1); + hidval ret; + unsigned int glib_condition = 0; + + if (condition & PCB_WATCH_READABLE) + glib_condition |= G_IO_IN; + if (condition & PCB_WATCH_WRITABLE) + glib_condition |= G_IO_OUT; + if (condition & PCB_WATCH_ERROR) + glib_condition |= G_IO_ERR; + if (condition & PCB_WATCH_HANGUP) + glib_condition |= G_IO_HUP; + + watch->func = func; + watch->user_data = user_data; + watch->fd = fd; + watch->channel = g_io_channel_unix_new( fd ); + watch->id = g_io_add_watch( watch->channel, (GIOCondition)glib_condition, ghid_watch, watch ); + + ret.ptr = (void *) watch; + return ret; +} + +void +ghid_unwatch_file (hidval data) +{ + GuiWatch *watch = (GuiWatch*)data.ptr; + + g_io_channel_shutdown( watch->channel, TRUE, NULL ); + g_io_channel_unref( watch->channel ); + g_free( watch ); +} + +typedef struct +{ + GSource source; + void (*func) (hidval user_data); + hidval user_data; +} BlockHookSource; + +static gboolean ghid_block_hook_prepare (GSource *source, + gint *timeout); +static gboolean ghid_block_hook_check (GSource *source); +static gboolean ghid_block_hook_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data); + +static GSourceFuncs ghid_block_hook_funcs = { + ghid_block_hook_prepare, + ghid_block_hook_check, + ghid_block_hook_dispatch, + NULL // No destroy notification +}; + +static gboolean +ghid_block_hook_prepare (GSource *source, + gint *timeout) +{ + hidval data = ((BlockHookSource *)source)->user_data; + ((BlockHookSource *)source)->func( data ); + return FALSE; +} + +static gboolean +ghid_block_hook_check (GSource *source) +{ + return FALSE; +} + +static gboolean +ghid_block_hook_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data) +{ + return FALSE; +} + +static hidval +ghid_add_block_hook (void (*func) (hidval data), + hidval user_data) +{ + hidval ret; + BlockHookSource *source; + + source = (BlockHookSource *)g_source_new (&ghid_block_hook_funcs, sizeof( BlockHookSource )); + + source->func = func; + source->user_data = user_data; + + g_source_attach ((GSource *)source, NULL); + + ret.ptr = (void *) source; + return ret; +} + +static void +ghid_stop_block_hook (hidval mlpoll) +{ + GSource *source = (GSource *)mlpoll.ptr; + g_source_destroy( source ); +} + +int +ghid_confirm_dialog (char *msg, ...) +{ + int rv = 0; + va_list ap; + char *cancelmsg = NULL, *okmsg = NULL; + static gint x = -1, y = -1; + GtkWidget *dialog; + GHidPort *out = &ghid_port; + + va_start (ap, msg); + cancelmsg = va_arg (ap, char *); + okmsg = va_arg (ap, char *); + va_end (ap); + + if (!cancelmsg) + { + cancelmsg = _("_Cancel"); + okmsg = _("_OK"); + } + + dialog = gtk_message_dialog_new (GTK_WINDOW (out->top_window), + (GtkDialogFlags) (GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + "%s", msg); + gtk_dialog_add_button (GTK_DIALOG (dialog), + cancelmsg, GTK_RESPONSE_CANCEL); + if (okmsg) + { + gtk_dialog_add_button (GTK_DIALOG (dialog), + okmsg, GTK_RESPONSE_OK); + } + + if(x != -1) { + gtk_window_move(GTK_WINDOW (dialog), x, y); + } + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) + rv = 1; + + gtk_window_get_position(GTK_WINDOW (dialog), &x, &y); + + gtk_widget_destroy (dialog); + return rv; +} + +int +ghid_close_confirm_dialog () +{ + switch (ghid_dialog_close_confirm ()) + { + case GUI_DIALOG_CLOSE_CONFIRM_SAVE: + { + if (hid_actionl ("Save", NULL)) + { /* Save failed */ + return 0; /* Cancel */ + } else { + return 1; /* Close */ + } + } + case GUI_DIALOG_CLOSE_CONFIRM_NOSAVE: + { + return 1; /* Close */ + } + case GUI_DIALOG_CLOSE_CONFIRM_CANCEL: + default: + { + return 0; /* Cancel */ + } + } +} + +void +ghid_report_dialog (char *title, char *msg) +{ + ghid_dialog_report (title, msg); +} + +char * +ghid_prompt_for (const char *msg, const char *default_string) +{ + char *rv; + + rv = ghid_dialog_input (msg, default_string); + return rv; +} + +/* FIXME -- implement a proper file select dialog */ +#ifdef FIXME +char * +ghid_fileselect (const char *title, const char *descr, + char *default_file, char *default_ext, + const char *history_tag, int flags) +{ + char *rv; + + rv = ghid_dialog_input (title, default_file); + return rv; +} +#endif + +void +ghid_show_item (void *item) +{ + ghid_pinout_window_show (&ghid_port, (ElementTypePtr) item); +} + +void +ghid_beep () +{ + gdk_beep (); +} + +struct progress_dialog +{ + GtkWidget *dialog; + GtkWidget *message; + GtkWidget *progress; + gint response_id; + GMainLoop *loop; + gboolean destroyed; + gboolean started; + GTimer *timer; + + gulong response_handler; + gulong destroy_handler; + gulong delete_handler; +}; + +static void +run_response_handler (GtkDialog *dialog, + gint response_id, + gpointer data) +{ + struct progress_dialog *pd = data; + + pd->response_id = response_id; +} + +static gint +run_delete_handler (GtkDialog *dialog, + GdkEventAny *event, + gpointer data) +{ + struct progress_dialog *pd = data; + + pd->response_id = GTK_RESPONSE_DELETE_EVENT; + + return TRUE; /* Do not destroy */ +} + +static void +run_destroy_handler (GtkDialog *dialog, gpointer data) +{ + struct progress_dialog *pd = data; + + pd->destroyed = TRUE; +} + +static struct progress_dialog * +make_progress_dialog (void) +{ + struct progress_dialog *pd; + GtkWidget *content_area; + GtkWidget *alignment; + GtkWidget *vbox; + + pd = g_new0 (struct progress_dialog, 1); + pd->response_id = GTK_RESPONSE_NONE; + + pd->dialog = gtk_dialog_new_with_buttons (_("Progress"), + GTK_WINDOW (gport->top_window), + /* Modal so nothing else can get events whilst + the main mainloop isn't running */ + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + NULL); + + gtk_window_set_deletable (GTK_WINDOW (pd->dialog), FALSE); + gtk_window_set_skip_pager_hint (GTK_WINDOW (pd->dialog), TRUE); + gtk_window_set_skip_taskbar_hint (GTK_WINDOW (pd->dialog), TRUE); + gtk_widget_set_size_request (pd->dialog, 300, -1); + + pd->message = gtk_label_new (NULL); + gtk_misc_set_alignment (GTK_MISC (pd->message), 0., 0.); + + pd->progress = gtk_progress_bar_new (); + gtk_widget_set_size_request (pd->progress, -1, 26); + + vbox = gtk_vbox_new (false, 0); + gtk_box_pack_start (GTK_BOX (vbox), pd->message, true, true, 8); + gtk_box_pack_start (GTK_BOX (vbox), pd->progress, false, true, 8); + + alignment = gtk_alignment_new (0., 0., 1., 1.); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 8, 8, 8, 8); + gtk_container_add (GTK_CONTAINER (alignment), vbox); + + content_area = gtk_dialog_get_content_area (GTK_DIALOG (pd->dialog)); + gtk_box_pack_start (GTK_BOX (content_area), alignment, true, true, 0); + + gtk_widget_show_all (alignment); + + g_object_ref (pd->dialog); + gtk_window_present (GTK_WINDOW (pd->dialog)); + + pd->response_handler = + g_signal_connect (pd->dialog, "response", + G_CALLBACK (run_response_handler), pd); + pd->delete_handler = + g_signal_connect (pd->dialog, "delete-event", + G_CALLBACK (run_delete_handler), pd); + pd->destroy_handler = + g_signal_connect (pd->dialog, "destroy", + G_CALLBACK (run_destroy_handler), pd); + + pd->loop = g_main_loop_new (NULL, FALSE); + pd->timer = g_timer_new (); + + return pd; +} + +static void +destroy_progress_dialog (struct progress_dialog *pd) +{ + if (pd == NULL) + return; + + if (!pd->destroyed) + { + g_signal_handler_disconnect (pd->dialog, pd->response_handler); + g_signal_handler_disconnect (pd->dialog, pd->delete_handler); + g_signal_handler_disconnect (pd->dialog, pd->destroy_handler); + } + + g_timer_destroy (pd->timer); + g_object_unref (pd->dialog); + g_main_loop_unref (pd->loop); + + gtk_widget_destroy (pd->dialog); + + pd->loop = NULL; + g_free (pd); +} + +static void +handle_progress_dialog_events (struct progress_dialog *pd) +{ + GMainContext * context = g_main_loop_get_context (pd->loop); + + /* Process events */ + while (g_main_context_pending (context)) + { + g_main_context_iteration (context, FALSE); + } +} + +#define MIN_TIME_SEPARATION (50./1000.) /* 50ms */ +static int +ghid_progress (int so_far, int total, const char *message) +{ + static struct progress_dialog *pd = NULL; + + /* If we are finished, destroy any dialog */ + if (so_far == 0 && total == 0 && message == NULL) + { + destroy_progress_dialog (pd); + pd = NULL; + return 0; + } + + if (pd == NULL) + pd = make_progress_dialog (); + + /* We don't want to keep the underlying process too busy whilst we + * process events. If we get called quickly after the last progress + * update, wait a little bit before we respond - perhaps the next + * time progress is reported. + + * The exception here is that we always want to process the first + * batch of events after having shown the dialog for the first time + */ + if (pd->started && g_timer_elapsed (pd->timer, NULL) < MIN_TIME_SEPARATION) + return 0; + + gtk_label_set_text (GTK_LABEL (pd->message), message); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pd->progress), + (double)so_far / (double)total); + + handle_progress_dialog_events (pd); + g_timer_start (pd->timer); + + pd->started = TRUE; + + return (pd->response_id == GTK_RESPONSE_CANCEL || + pd->response_id == GTK_RESPONSE_DELETE_EVENT) ? 1 : 0; +} + +/* ---------------------------------------------------------------------- */ + + +typedef struct { + GtkWidget *del; + GtkWidget *w_name; + GtkWidget *w_value; +} AttrRow; + +static AttrRow *attr_row = 0; +static int attr_num_rows = 0; +static int attr_max_rows = 0; +static AttributeListType *attributes_list; +static GtkWidget *attributes_dialog, *attr_table; + +static void attributes_delete_callback (GtkWidget *w, void *v); + +#define GA_RESPONSE_REVERT 1 +#define GA_RESPONSE_NEW 2 + +static void +ghid_attr_set_table_size () +{ + gtk_table_resize (GTK_TABLE (attr_table), attr_num_rows > 0 ? attr_num_rows : 1, 3); +} + +static void +ghid_attributes_need_rows (int new_max) +{ + if (attr_max_rows < new_max) + { + if (attr_row) + attr_row = (AttrRow *) realloc (attr_row, new_max * sizeof(AttrRow)); + else + attr_row = (AttrRow *) malloc (new_max * sizeof(AttrRow)); + } + while (attr_max_rows < new_max) + { + /* add [attr_max_rows] */ + attr_row[attr_max_rows].del = gtk_button_new_with_label ("del"); + gtk_table_attach (GTK_TABLE (attr_table), attr_row[attr_max_rows].del, + 0, 1, + attr_max_rows, attr_max_rows+1, + (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), + GTK_FILL, + 0, 0); + g_signal_connect (G_OBJECT (attr_row[attr_max_rows].del), "clicked", + G_CALLBACK (attributes_delete_callback), GINT_TO_POINTER (attr_max_rows) ); + + attr_row[attr_max_rows].w_name = gtk_entry_new (); + gtk_table_attach (GTK_TABLE (attr_table), attr_row[attr_max_rows].w_name, + 1, 2, + attr_max_rows, attr_max_rows+1, + (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), + GTK_FILL, + 0, 0); + + attr_row[attr_max_rows].w_value = gtk_entry_new (); + gtk_table_attach (GTK_TABLE (attr_table), attr_row[attr_max_rows].w_value, + 2, 3, + attr_max_rows, attr_max_rows+1, + (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), + GTK_FILL, + 0, 0); + + attr_max_rows ++; + } + + /* Manage any previously unused rows we now need to show. */ + while (attr_num_rows < new_max) + { + /* manage attr_num_rows */ + gtk_widget_show (attr_row[attr_num_rows].del); + gtk_widget_show (attr_row[attr_num_rows].w_name); + gtk_widget_show (attr_row[attr_num_rows].w_value); + attr_num_rows ++; + } +} + +static void +ghid_attributes_revert () +{ + int i; + + ghid_attributes_need_rows (attributes_list->Number); + + /* Unmanage any previously used rows we don't need. */ + while (attr_num_rows > attributes_list->Number) + { + attr_num_rows --; + gtk_widget_hide (attr_row[attr_num_rows].del); + gtk_widget_hide (attr_row[attr_num_rows].w_name); + gtk_widget_hide (attr_row[attr_num_rows].w_value); + } + + /* Fill in values */ + for (i=0; iNumber; i++) + { + /* create row [i] */ + gtk_entry_set_text (GTK_ENTRY (attr_row[i].w_name), attributes_list->List[i].name); + gtk_entry_set_text (GTK_ENTRY (attr_row[i].w_value), attributes_list->List[i].value); +#if 0 +#endif + } + ghid_attr_set_table_size (); +} + +static void +attributes_delete_callback (GtkWidget *w, void *v) +{ + int i, n; + + n = GPOINTER_TO_INT (v); + + for (i=n; iNumber, 3, 0); + + content_area = gtk_dialog_get_content_area (GTK_DIALOG (attributes_dialog)); + gtk_box_pack_start (GTK_BOX (content_area), attr_table, FALSE, FALSE, 0); + + gtk_widget_show (attr_table); + + ghid_attributes_revert (); + + while (1) + { + response = gtk_dialog_run (GTK_DIALOG (attributes_dialog)); + + if (response == GTK_RESPONSE_CANCEL) + break; + + if (response == GTK_RESPONSE_OK) + { + int i; + /* Copy the values back */ + for (i=0; iNumber; i++) + { + if (attributes_list->List[i].name) + free (attributes_list->List[i].name); + if (attributes_list->List[i].value) + free (attributes_list->List[i].value); + } + if (attributes_list->Max < attr_num_rows) + { + int sz = attr_num_rows * sizeof (AttributeType); + if (attributes_list->List == NULL) + attributes_list->List = (AttributeType *) malloc (sz); + else + attributes_list->List = (AttributeType *) realloc (attributes_list->List, sz); + attributes_list->Max = attr_num_rows; + } + for (i=0; iList[i].name = strdup (gtk_entry_get_text (GTK_ENTRY (attr_row[i].w_name))); + attributes_list->List[i].value = strdup (gtk_entry_get_text (GTK_ENTRY (attr_row[i].w_value))); + attributes_list->Number = attr_num_rows; + } + + break; + } + + if (response == GA_RESPONSE_REVERT) + { + /* Revert */ + ghid_attributes_revert (); + } + + if (response == GA_RESPONSE_NEW) + { + ghid_attributes_need_rows (attr_num_rows + 1); /* also bumps attr_num_rows */ + + gtk_entry_set_text (GTK_ENTRY (attr_row[attr_num_rows-1].w_name), ""); + gtk_entry_set_text (GTK_ENTRY (attr_row[attr_num_rows-1].w_value), ""); + + ghid_attr_set_table_size (); + } + } + + gtk_widget_destroy (attributes_dialog); + free (attr_row); + attr_row = NULL; +} + +/* ---------------------------------------------------------------------- */ + +HID_DRC_GUI ghid_drc_gui = { + 1, /* log_drc_overview */ + 0, /* log_drc_details */ + ghid_drc_window_reset_message, + ghid_drc_window_append_violation, + ghid_drc_window_throw_dialog, +}; + +extern HID_Attribute *ghid_get_export_options (int *); + + +/* ------------------------------------------------------------ + * + * Actions specific to the GTK HID follow from here + * + */ + + +/* ------------------------------------------------------------ */ +static const char about_syntax[] = +"About()"; + +static const char about_help[] = +N_("Tell the user about this version of PCB."); + +/* %start-doc actions About + +This just pops up a dialog telling the user which version of +@code{pcb} they're running. + +%end-doc */ + + +static int +About (int argc, char **argv, Coord x, Coord y) +{ + ghid_dialog_about (); + return 0; +} + +/* ------------------------------------------------------------ */ +static const char getxy_syntax[] = +"GetXY()"; + +static const char getxy_help[] = +N_("Get a coordinate."); + +/* %start-doc actions GetXY + +Prompts the user for a coordinate, if one is not already selected. + +%end-doc */ + +static int +GetXY (int argc, char **argv, Coord x, Coord y) +{ + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int PointCursor (int argc, char **argv, Coord x, Coord y) +{ + if (!ghidgui) + return 0; + + if (argc > 0) + ghid_point_cursor (); + else + ghid_mode_cursor (Settings.Mode); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +RouteStylesChanged (int argc, char **argv, Coord x, Coord y) +{ + if (!ghidgui || !ghidgui->route_style_selector) + return 0; + + ghid_route_style_selector_sync + (GHID_ROUTE_STYLE_SELECTOR (ghidgui->route_style_selector), + Settings.LineThickness, Settings.ViaDrillingHole, + Settings.ViaThickness, Settings.Keepaway); + + return 0; +} + +/* ---------------------------------------------------------------------- */ + +int +PCBChanged (int argc, char **argv, Coord x, Coord y) +{ + if (!ghidgui) + return 0; + + ghid_window_set_name_label (PCB->Name); + + if (!gport->pixmap) + return 0; + + 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); + + ghid_port_ranges_scale (); + ghid_zoom_view_fit (); + ghid_sync_with_new_layout (); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +LayerGroupsChanged (int argc, char **argv, Coord x, Coord y) +{ + printf (_("LayerGroupsChanged -- not implemented\n")); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +LibraryChanged (int argc, 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, char **argv, Coord x, Coord y) +{ + ghid_handle_user_command (TRUE); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int +Load (int argc, char **argv, Coord x, Coord y) +{ + char *function; + char *name = NULL; + + static gchar *current_element_dir = NULL; + static gchar *current_layout_dir = NULL; + static gchar *current_netlist_dir = NULL; + + /* we've been given the file name */ + if (argc > 1) + return hid_actionv ("LoadFrom", argc, argv); + + function = argc ? argv[0] : (char *)"Layout"; + + if (strcasecmp (function, "Netlist") == 0) + { + name = ghid_dialog_file_select_open (_("Load netlist file"), + ¤t_netlist_dir, + Settings.FilePath); + } + else if (strcasecmp (function, "ElementToBuffer") == 0) + { + name = ghid_dialog_file_select_open (_("Load element to buffer"), + ¤t_element_dir, + Settings.LibraryTree); + } + else if (strcasecmp (function, "LayoutToBuffer") == 0) + { + name = ghid_dialog_file_select_open (_("Load layout file to buffer"), + ¤t_layout_dir, + Settings.FilePath); + } + else if (strcasecmp (function, "Layout") == 0) + { + name = ghid_dialog_file_select_open (_("Load layout file"), + ¤t_layout_dir, + Settings.FilePath); + } + + if (name) + { + if (Settings.verbose) + fprintf (stderr, "%s: Calling LoadFrom(%s, %s)\n", __FUNCTION__, + function, name); + hid_actionl ("LoadFrom", function, name, NULL); + g_free (name); + } + + return 0; +} + + +/* ---------------------------------------------------------------------- */ +static const char save_syntax[] = +"Save()\n" +"Save(Layout|LayoutAs)\n" +"Save(AllConnections|AllUnusedPins|ElementConnections)\n" +"Save(PasteBuffer)"; + +static const char save_help[] = +N_("Save layout and/or element data to a user-selected file."); + +/* %start-doc actions Save + +This action is a GUI front-end to the core's @code{SaveTo} action +(@pxref{SaveTo Action}). If you happen to pass a filename, like +@code{SaveTo}, then @code{SaveTo} is called directly. Else, the +user is prompted for a filename to save, and then @code{SaveTo} is +called with that filename. + +%end-doc */ + +static int +Save (int argc, char **argv, Coord x, Coord y) +{ + char *function; + char *name; + char *prompt; + + static gchar *current_dir = NULL; + + if (argc > 1) + return hid_actionv ("SaveTo", argc, argv); + + function = argc ? argv[0] : (char *)"Layout"; + + if (strcasecmp (function, "Layout") == 0) + if (PCB->Filename) + return hid_actionl ("SaveTo", "Layout", PCB->Filename, NULL); + + if (strcasecmp (function, "PasteBuffer") == 0) + prompt = _("Save element as"); + else + prompt = _("Save layout as"); + + name = ghid_dialog_file_select_save (prompt, + ¤t_dir, + PCB->Filename, Settings.FilePath); + + if (name) + { + if (Settings.verbose) + fprintf (stderr, "%s: Calling SaveTo(%s, %s)\n", + __FUNCTION__, function, name); + + if (strcasecmp (function, "PasteBuffer") == 0) + hid_actionl ("PasteBuffer", "Save", name, NULL); + else + { + /* + * if we got this far and the function is Layout, then + * we really needed it to be a LayoutAs. Otherwise + * ActionSaveTo() will ignore the new file name we + * just obtained. + */ + if (strcasecmp (function, "Layout") == 0) + hid_actionl ("SaveTo", "LayoutAs", name, NULL); + else + hid_actionl ("SaveTo", function, name, NULL); + } + g_free (name); + } + else + { + return 1; + } + + return 0; +} + +/* ---------------------------------------------------------------------- */ +static const char swapsides_syntax[] = +"SwapSides(|v|h|r)"; + +static const char swapsides_help[] = +N_("Swaps the side of the board you're looking at."); + +/* %start-doc actions SwapSides + +This action changes the way you view the board. + +@table @code + +@item v +Flips the board over vertically (up/down). + +@item h +Flips the board over horizontally (left/right), like flipping pages in +a book. + +@item r +Rotates the board 180 degrees without changing sides. + +@end table + +If no argument is given, the board isn't moved but the opposite side +is shown. + +Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + +As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the ``working +side'' of the board. + +%end-doc */ + + +static int +SwapSides (int argc, char **argv, Coord x, Coord y) +{ + int active_group = GetLayerGroupNumberByNumber (LayerStack[0]); + int comp_group = GetLayerGroupNumberByNumber (component_silk_layer); + int solder_group = GetLayerGroupNumberByNumber (solder_silk_layer); + bool comp_on = LAYER_PTR (PCB->LayerGroups.Entries[comp_group][0])->On; + bool solder_on = LAYER_PTR (PCB->LayerGroups.Entries[solder_group][0])->On; + + if (argc > 0) + { + switch (argv[0][0]) { + case 'h': + case 'H': + ghid_flip_view (gport->pcb_x, gport->pcb_y, true, false); + break; + case 'v': + case 'V': + ghid_flip_view (gport->pcb_x, gport->pcb_y, false, true); + break; + case 'r': + case 'R': + ghid_flip_view (gport->pcb_x, gport->pcb_y, true, true); + Settings.ShowSolderSide = !Settings.ShowSolderSide; /* Swapped back below */ + break; + default: + return 1; + } + } + + Settings.ShowSolderSide = !Settings.ShowSolderSide; + + if ((active_group == comp_group && comp_on && !solder_on) || + (active_group == solder_group && solder_on && !comp_on)) + { + bool new_solder_vis = Settings.ShowSolderSide; + + 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); + } + + return 0; +} + +/* ------------------------------------------------------------ */ + +static const char print_syntax[] = +"Print()"; + +static const char print_help[] = +N_("Print the layout."); + +/* %start-doc actions Print + +This will find the default printing HID, prompt the user for its +options, and print the layout. + +%end-doc */ + +static int +Print (int argc, char **argv, Coord x, Coord y) +{ + HID **hids; + int i; + HID *printer = NULL; + + hids = 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")); + return -1; + } + + /* check if layout is empty */ + if (!IsDataEmpty (PCB->Data)) + { + ghid_dialog_print (printer); + } + else + gui->log (_("Can't print empty layout")); + + return 0; +} + + +/* ------------------------------------------------------------ */ + +static HID_Attribute +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"), + HID_Real, 0.5, 25, {0, 0, 1.00}, 0, 0}, + {N_("y-calibration"), N_("Y scale for calibrating your printer"), + HID_Real, 0.5, 25, {0, 0, 1.00}, 0, 0} +}; +static HID_Attr_Val printer_calibrate_values[3]; + +static const char printcalibrate_syntax[] = +"PrintCalibrate()"; + +static const char printcalibrate_help[] = +N_("Calibrate the printer."); + +/* %start-doc actions PrintCalibrate + +This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + +%end-doc */ + +static int +PrintCalibrate (int argc, char **argv, Coord x, Coord y) +{ + HID *printer = hid_find_printer (); + printer->calibrate (0.0, 0.0); + + if (gui->attribute_dialog (printer_calibrate_attrs, 3, + printer_calibrate_values, + _("Printer Calibration Values"), + _("Enter calibration values for your printer"))) + return 1; + printer->calibrate (printer_calibrate_values[1].real_value, + printer_calibrate_values[2].real_value); + return 0; +} + +/* ------------------------------------------------------------ */ + +static int +Export (int argc, char **argv, Coord x, Coord y) +{ + + /* check if layout is empty */ + if (!IsDataEmpty (PCB->Data)) + { + ghid_dialog_export (); + } + else + gui->log (_("Can't export empty layout")); + + return 0; +} + +/* ------------------------------------------------------------ */ + +static int +Benchmark (int argc, char **argv, Coord x, Coord y) +{ + int i = 0; + time_t start, end; + GdkDisplay *display; + + display = gdk_drawable_get_display (gport->drawable); + + gdk_display_sync (display); + time (&start); + do + { + ghid_invalidate_all (); + gdk_window_process_updates (gtk_widget_get_window (gport->drawing_area), + FALSE); + time (&end); + i++; + } + while (end - start < 10); + + printf (_("%g redraws per second\n"), i / 10.0); + + return 0; +} + +/* ------------------------------------------------------------ */ + +static const char center_syntax[] = +"Center()\n"; + +static const char center_help[] = +N_("Moves the pointer to the center of the window."); + +/* %start-doc actions Center + +Move the pointer to the center of the window, but only if it's +currently within the window already. + +%end-doc */ + +static int +Center(int argc, char **argv, Coord pcb_x, Coord pcb_y) +{ + GdkDisplay *display; + GdkScreen *screen; + int offset_x, offset_y; + int widget_x, widget_y; + int pointer_x, pointer_y; + + if (argc != 0) + AFAIL (center); + + /* Aim to put the given x, y PCB coordinates in the center of the widget */ + widget_x = gport->width / 2; + widget_y = gport->height / 2; + + ghid_pan_view_abs (pcb_x, pcb_y, widget_x, widget_y); + + /* Now move the mouse pointer to the place where the board location + * actually ended up. + * + * XXX: Should only do this if we confirm we are inside our window? + */ + + ghid_pcb_to_event_coords (pcb_x, pcb_y, &widget_x, &widget_y); + gdk_window_get_origin (gtk_widget_get_window (gport->drawing_area), + &offset_x, &offset_y); + + pointer_x = offset_x + widget_x; + pointer_y = offset_y + widget_y; + + display = gdk_display_get_default (); + screen = gdk_display_get_default_screen (display); + gdk_display_warp_pointer (display, screen, pointer_x, pointer_y); + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char cursor_syntax[] = +"Cursor(Type,DeltaUp,DeltaRight,Units)"; + +static const char cursor_help[] = +N_("Move the cursor."); + +/* %start-doc actions Cursor + +This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive @var{DeltaUp} may move the +cursor towards the board origin if the board is inverted. + +Type is one of @samp{Pan} or @samp{Warp}. @samp{Pan} causes the +viewport to move such that the crosshair is under the mouse cursor. +@samp{Warp} causes the mouse cursor to move to be above the crosshair. + +@var{Units} can be one of the following: + +@table @samp + +@item mil +@itemx mm +The cursor is moved by that amount, in board units. + +@item grid +The cursor is moved by that many grid points. + +@item view +The values are percentages of the viewport's view. Thus, a pan of +@samp{100} would scroll the viewport by exactly the width of the +current view. + +@item board +The values are percentages of the board size. Thus, a move of +@samp{50,50} moves you halfway across the board. + +@end table + +%end-doc */ + +static int +CursorAction(int argc, char **argv, Coord x, Coord y) +{ + UnitList extra_units_x = { + { "grid", PCB->Grid, 0 }, + { "view", gport->view.width, UNIT_PERCENT }, + { "board", PCB->MaxWidth, UNIT_PERCENT }, + { "", 0, 0 } + }; + UnitList extra_units_y = { + { "grid", PCB->Grid, 0 }, + { "view", gport->view.height, UNIT_PERCENT }, + { "board", PCB->MaxHeight, UNIT_PERCENT }, + { "", 0, 0 } + }; + int pan_warp = HID_SC_DO_NOTHING; + double dx, dy; + + if (argc != 4) + AFAIL (cursor); + + if (strcasecmp (argv[0], "pan") == 0) + pan_warp = HID_SC_PAN_VIEWPORT; + else if (strcasecmp (argv[0], "warp") == 0) + pan_warp = HID_SC_WARP_POINTER; + else + AFAIL (cursor); + + dx = GetValueEx (argv[1], argv[3], NULL, extra_units_x, ""); + if (gport->view.flip_x) + dx = -dx; + dy = GetValueEx (argv[2], argv[3], NULL, extra_units_y, ""); + if (!gport->view.flip_y) + dy = -dy; + + EventMoveCrosshair (Crosshair.X + dx, Crosshair.Y + dy); + gui->set_crosshair (Crosshair.X, Crosshair.Y, pan_warp); + + return 0; +} +/* ------------------------------------------------------------ */ + +static const char dowindows_syntax[] = +"DoWindows(1|2|3|4|5|6)\n" +"DoWindows(Layout|Library|Log|Netlist|Preferences|DRC)"; + +static const char dowindows_help[] = +N_("Open various GUI windows."); + +/* %start-doc actions DoWindows + +@table @code + +@item 1 +@itemx Layout +Open the layout window. Since the layout window is always shown +anyway, this has no effect. + +@item 2 +@itemx Library +Open the library window. + +@item 3 +@itemx Log +Open the log window. + +@item 4 +@itemx Netlist +Open the netlist window. + +@item 5 +@itemx Preferences +Open the preferences window. + +@item 6 +@itemx DRC +Open the DRC violations window. + +@end table + +%end-doc */ + +static int +DoWindows (int argc, char **argv, Coord x, Coord y) +{ + char *a = argc == 1 ? argv[0] : (char *)""; + + if (strcmp (a, "1") == 0 || strcasecmp (a, "Layout") == 0) + { + } + else if (strcmp (a, "2") == 0 || strcasecmp (a, "Library") == 0) + { + ghid_library_window_show (gport, TRUE); + } + else if (strcmp (a, "3") == 0 || strcasecmp (a, "Log") == 0) + { + ghid_log_window_show (TRUE); + } + else if (strcmp (a, "4") == 0 || strcasecmp (a, "Netlist") == 0) + { + ghid_netlist_window_show (gport, TRUE); + } + else if (strcmp (a, "5") == 0 || strcasecmp (a, "Preferences") == 0) + { + ghid_config_window_show (); + } + else if (strcmp (a, "6") == 0 || strcasecmp (a, "DRC") == 0) + { + ghid_drc_window_show (TRUE); + } + else + { + AFAIL (dowindows); + } + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char setunits_syntax[] = +"SetUnits(mm|mil)"; + +static const char setunits_help[] = +N_("Set the default measurement units."); + +/* %start-doc actions SetUnits + +@table @code + +@item mil +Sets the display units to mils (1/1000 inch). + +@item mm +Sets the display units to millimeters. + +@end table + +%end-doc */ + +static int +SetUnits (int argc, char **argv, Coord x, Coord y) +{ + const Unit *new_unit; + if (argc == 0) + return 0; + + new_unit = get_unit_struct (argv[0]); + if (new_unit != NULL && new_unit->allow != NO_PRINT) + { + Settings.grid_unit = new_unit; + Settings.increments = get_increments_struct (Settings.grid_unit->suffix); + AttributePut (PCB, "PCB::grid::unit", argv[0]); + } + + ghid_config_handle_units_changed (); + + ghid_set_status_line_label (); + + /* FIXME ? + * lesstif_sizes_reset (); + * lesstif_styles_update_values (); + */ + return 0; +} + +/* ------------------------------------------------------------ */ +static const char scroll_syntax[] = +"Scroll(up|down|left|right, [div])"; + +static const char scroll_help[] = +N_("Scroll the viewport."); + +/* % start-doc actions Scroll + +@item up|down|left|right +Specifies the direction to scroll + +@item div +Optional. Specifies how much to scroll by. The viewport is scrolled +by 1/div of what is visible, so div = 1 scrolls a whole page. If not +default is given, div=40. + +%end-doc */ + +static int +ScrollAction (int argc, char **argv, Coord x, Coord y) +{ + gdouble dx = 0.0, dy = 0.0; + int div = 40; + + if (!ghidgui) + return 0; + + if (argc != 1 && argc != 2) + AFAIL (scroll); + + if (argc == 2) + div = atoi(argv[1]); + + if (strcasecmp (argv[0], "up") == 0) + dy = -gport->view.height / div; + else if (strcasecmp (argv[0], "down") == 0) + dy = gport->view.height / div; + else if (strcasecmp (argv[0], "right") == 0) + dx = gport->view.width / div; + else if (strcasecmp (argv[0], "left") == 0) + dx = -gport->view.width / div; + else + AFAIL (scroll); + + ghid_pan_view_rel (dx, dy); + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char pan_syntax[] = +"Pan([thumb], Mode)"; + +static const char pan_help[] = +N_("Start or stop panning (Mode = 1 to start, 0 to stop)\n" +"Optional thumb argument is ignored for now in gtk hid.\n"); + +/* %start-doc actions Pan + +Start or stop panning. To start call with Mode = 1, to stop call with +Mode = 0. + +%end-doc */ + +static int +PanAction (int argc, char **argv, Coord x, Coord y) +{ + int mode; + + if (!ghidgui) + return 0; + + if (argc != 1 && argc != 2) + AFAIL (pan); + + if (argc == 1) + mode = atoi(argv[0]); + else + { + mode = atoi(argv[1]); + Message (_("The gtk gui currently ignores the optional first argument " + "to the Pan action.\nFeel free to provide patches.\n")); + } + + gport->panning = mode; + + return 0; +} + +/* ------------------------------------------------------------ */ +static const char popup_syntax[] = +"Popup(MenuName, [Button])"; + +static const char popup_help[] = +N_("Bring up the popup menu specified by @code{MenuName}.\n" +"If called by a mouse event then the mouse button number\n" +"must be specified as the optional second argument."); + +/* %start-doc actions Popup + +This just pops up the specified menu. The menu must have been defined +as a named subresource of the Popups resource in the menu resource +file. + +%end-doc */ + + +static int +Popup (int argc, char **argv, Coord x, Coord y) +{ + GtkMenu *menu; + + if (argc != 1 && argc != 2) + AFAIL (popup); + + menu = ghid_main_menu_get_popup (GHID_MAIN_MENU (ghidgui->menu_bar), argv[0]); + if (! GTK_IS_MENU (menu)) + { + Message (_("The specified popup menu \"%s\" has not been defined.\n"), argv[0]); + return 1; + } + else + { + ghidgui->in_popup = TRUE; + gtk_widget_grab_focus (ghid_port.drawing_area); + gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 0, + gtk_get_current_event_time()); + } + return 0; +} +/* ------------------------------------------------------------ */ +static const char importgui_syntax[] = +"ImportGUI()"; + +static const char importgui_help[] = +N_("Asks user which schematics to import into PCB.\n"); + +/* %start-doc actions ImportGUI + +Asks user which schematics to import into PCB. + +%end-doc */ + + +static int +ImportGUI (int argc, char **argv, Coord x, Coord y) +{ + char *name = NULL; + static gchar *current_layout_dir = NULL; + static int I_am_recursing = 0; + int rv; + + if (I_am_recursing) + return 1; + + + name = ghid_dialog_file_select_open (_("Load schematics"), + ¤t_layout_dir, + Settings.FilePath); + +#ifdef DEBUG + printf("File selected = %s\n", name); +#endif + + AttributePut (PCB, "import::src0", name); + free (name); + + I_am_recursing = 1; + rv = hid_action ("Import"); + I_am_recursing = 0; + + return rv; +} + +/* ------------------------------------------------------------ */ +static int +Busy (int argc, char **argv, Coord x, Coord y) +{ + ghid_watch_cursor (); + return 0; +} + +HID_Action 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}, + {"Cursor", 0, CursorAction, cursor_help, cursor_syntax}, + {"DoWindows", 0, DoWindows, dowindows_help, dowindows_syntax}, + {"Export", 0, Export}, + {"GetXY", "", GetXY, getxy_help, getxy_syntax}, + {"ImportGUI", 0, ImportGUI, importgui_help, importgui_syntax}, + {"LayerGroupsChanged", 0, LayerGroupsChanged}, + {"LibraryChanged", 0, LibraryChanged}, + {"Load", 0, Load}, + {"Pan", N_("Click on a place to pan"), PanAction, pan_help, pan_syntax}, + {"PCBChanged", 0, PCBChanged}, + {"PointCursor", 0, PointCursor}, + {"Popup", 0, Popup, popup_help, popup_syntax}, + {"Print", 0, Print, + print_help, print_syntax}, + {"PrintCalibrate", 0, PrintCalibrate, + printcalibrate_help, printcalibrate_syntax}, + {"RouteStylesChanged", 0, RouteStylesChanged}, + {"Save", 0, Save, save_help, save_syntax}, + {"Scroll", N_("Click on a place to scroll"), ScrollAction, scroll_help, scroll_syntax}, + {"SetUnits", 0, SetUnits, setunits_help, setunits_syntax}, + {"SwapSides", 0, SwapSides, swapsides_help, swapsides_syntax}, + {"Zoom", N_("Click on zoom focus"), Zoom, zoom_help, zoom_syntax} +}; + +REGISTER_ACTIONS (ghid_main_action_list) + + +static int +flag_flipx (int x) +{ + return gport->view.flip_x; +} + +static int +flag_flipy (int x) +{ + return gport->view.flip_y; +} + +HID_Flag ghid_main_flag_list[] = { + {"flip_x", flag_flipx, 0}, + {"flip_y", flag_flipy, 0} +}; + +REGISTER_FLAGS (ghid_main_flag_list) + +#include "dolists.h" + +/* + * We will need these for finding the windows installation + * directory. Without that we can't find our fonts and + * footprint libraries. + */ +#ifdef WIN32 +#include +#include +#endif + +HID ghid_hid; + +void +hid_gtk_init () +{ +#ifdef WIN32 + char * tmps; + char * share_dir; + char *loader_cache; + FILE *loader_file; +#endif + +#ifdef WIN32 + tmps = g_win32_get_package_installation_directory (PACKAGE "-" VERSION, NULL); +#define REST_OF_PATH G_DIR_SEPARATOR_S "share" G_DIR_SEPARATOR_S PACKAGE +#define REST_OF_CACHE G_DIR_SEPARATOR_S "loaders.cache" + share_dir = (char *) malloc(strlen(tmps) + + strlen(REST_OF_PATH) + + 1); + sprintf (share_dir, "%s%s", tmps, REST_OF_PATH); + + /* Point to our gdk-pixbuf loader cache. */ + loader_cache = (char *) malloc (strlen (bindir) + + strlen (REST_OF_CACHE) + + 1); + sprintf (loader_cache, "%s%s", bindir, REST_OF_CACHE); + loader_file = fopen (loader_cache, "r"); + if (loader_file) + { + fclose (loader_file); + g_setenv ("GDK_PIXBUF_MODULE_FILE", loader_cache, TRUE); + } + + free (tmps); +#undef REST_OF_PATH + printf ("\"Share\" installation path is \"%s\"\n", share_dir); +#endif + + memset (&ghid_hid, 0, sizeof (HID)); + + common_nogui_init (&ghid_hid); + common_draw_helpers_init (&ghid_hid); + + ghid_hid.struct_size = sizeof (HID); + ghid_hid.name = "gtk"; + ghid_hid.description = "Gtk - The Gimp Toolkit"; + ghid_hid.gui = 1; + ghid_hid.poly_after = 1; + + ghid_hid.get_export_options = ghid_get_export_options; + ghid_hid.do_export = ghid_do_export; + ghid_hid.parse_arguments = ghid_parse_arguments; + ghid_hid.invalidate_lr = ghid_invalidate_lr; + 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.make_gc = ghid_make_gc; + ghid_hid.destroy_gc = ghid_destroy_gc; + ghid_hid.use_mask = ghid_use_mask; + ghid_hid.set_color = ghid_set_color; + ghid_hid.set_line_cap = ghid_set_line_cap; + ghid_hid.set_line_width = ghid_set_line_width; + ghid_hid.set_draw_xor = ghid_set_draw_xor; + ghid_hid.draw_line = ghid_draw_line; + ghid_hid.draw_arc = ghid_draw_arc; + ghid_hid.draw_rect = ghid_draw_rect; + ghid_hid.fill_circle = ghid_fill_circle; + ghid_hid.fill_polygon = ghid_fill_polygon; + ghid_hid.fill_rect = ghid_fill_rect; + + ghid_hid.calibrate = ghid_calibrate; + ghid_hid.shift_is_pressed = ghid_shift_is_pressed; + ghid_hid.control_is_pressed = ghid_control_is_pressed; + ghid_hid.mod1_is_pressed = ghid_mod1_is_pressed, + ghid_hid.get_coords = ghid_get_coords; + ghid_hid.set_crosshair = ghid_set_crosshair; + ghid_hid.add_timer = ghid_add_timer; + ghid_hid.stop_timer = ghid_stop_timer; + ghid_hid.watch_file = ghid_watch_file; + ghid_hid.unwatch_file = ghid_unwatch_file; + ghid_hid.add_block_hook = ghid_add_block_hook; + ghid_hid.stop_block_hook = ghid_stop_block_hook; + + ghid_hid.log = ghid_log; + ghid_hid.logv = ghid_logv; + ghid_hid.confirm_dialog = ghid_confirm_dialog; + ghid_hid.close_confirm_dialog = ghid_close_confirm_dialog; + ghid_hid.report_dialog = ghid_report_dialog; + ghid_hid.prompt_for = ghid_prompt_for; + ghid_hid.fileselect = ghid_fileselect; + ghid_hid.attribute_dialog = ghid_attribute_dialog; + 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.request_debug_draw = ghid_request_debug_draw; + ghid_hid.flush_debug_draw = ghid_flush_debug_draw; + ghid_hid.finish_debug_draw = ghid_finish_debug_draw; + + ghid_hid.notify_save_pcb = ghid_notify_save_pcb; + ghid_hid.notify_filename_changed = ghid_notify_filename_changed; + + hid_register_hid (&ghid_hid); +#include "gtk_lists.h" +} Index: tags/1.0.5/.pc/fix_typo.diff/src/hid/common/hidgl.c =================================================================== --- tags/1.0.5/.pc/fix_typo.diff/src/hid/common/hidgl.c (nonexistent) +++ tags/1.0.5/.pc/fix_typo.diff/src/hid/common/hidgl.c (revision 953) @@ -0,0 +1,793 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 2009-2011 PCB Contributers (See ChangeLog for details) + * + * 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. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#ifdef HAVE_STRING_H +#include +#endif +#include +#include + +/* The Linux OpenGL ABI 1.0 spec requires that we define + * GL_GLEXT_PROTOTYPES before including gl.h or glx.h for extensions + * in order to get prototypes: + * http://www.opengl.org/registry/ABI/ + */ +#define GL_GLEXT_PROTOTYPES 1 +#ifdef HAVE_OPENGL_GL_H +# include +#else +# include +#endif + +#ifdef HAVE_OPENGL_GLU_H +# include +#else +# include +#endif + +#include "action.h" +#include "crosshair.h" +#include "data.h" +#include "error.h" +#include "global.h" +#include "mymem.h" +#include "clip.h" + +#include "hid.h" +#include "hidgl.h" +#include "rtree.h" + +#ifdef HAVE_LIBDMALLOC +#include +#endif + + +triangle_buffer buffer; +float global_depth = 0; + +void +hidgl_init_triangle_array (triangle_buffer *buffer) +{ + buffer->triangle_count = 0; + buffer->coord_comp_count = 0; +} + +void +hidgl_flush_triangles (triangle_buffer *buffer) +{ + if (buffer->triangle_count == 0) + return; + + glEnableClientState (GL_VERTEX_ARRAY); + glVertexPointer (3, GL_FLOAT, 0, buffer->triangle_array); + glDrawArrays (GL_TRIANGLES, 0, buffer->triangle_count * 3); + glDisableClientState (GL_VERTEX_ARRAY); + + buffer->triangle_count = 0; + buffer->coord_comp_count = 0; +} + +void +hidgl_ensure_triangle_space (triangle_buffer *buffer, int count) +{ + if (count > TRIANGLE_ARRAY_SIZE) + { + fprintf (stderr, "Not enough space in vertex buffer\n"); + fprintf (stderr, "Requested %i triangles, %i available\n", + count, TRIANGLE_ARRAY_SIZE); + exit (1); + } + if (count > TRIANGLE_ARRAY_SIZE - buffer->triangle_count) + hidgl_flush_triangles (buffer); +} + +void +hidgl_set_depth (float depth) +{ + global_depth = depth; +} + +void +hidgl_draw_grid (BoxType *drawn_area) +{ + static GLfloat *points = 0; + static int npoints = 0; + Coord 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); + + if (x1 > x2) + { + Coord tmp = x1; + x1 = x2; + x2 = tmp; + } + + if (y1 > y2) + { + Coord tmp = y1; + y1 = y2; + y2 = tmp; + } + + n = (int) ((x2 - x1) / PCB->Grid + 0.5) + 1; + if (n > npoints) + { + npoints = n + 10; + points = realloc (points, npoints * 3 * sizeof (GLfloat)); + } + + glEnableClientState (GL_VERTEX_ARRAY); + glVertexPointer (3, GL_FLOAT, 0, points); + + n = 0; + for (x = x1; x <= x2; x += PCB->Grid) + { + points[3 * n + 0] = x; + points[3 * n + 2] = global_depth; + n++; + } + for (y = y1; y <= y2; y += PCB->Grid) + { + for (i = 0; i < n; i++) + points[3 * i + 1] = y; + glDrawArrays (GL_POINTS, 0, n); + } + + glDisableClientState (GL_VERTEX_ARRAY); +} + +#define MAX_PIXELS_ARC_TO_CHORD 0.5 +#define MIN_SLICES 6 +int calc_slices (float pix_radius, float sweep_angle) +{ + float slices; + + if (pix_radius <= MAX_PIXELS_ARC_TO_CHORD) + return MIN_SLICES; + + slices = sweep_angle / acosf (1 - MAX_PIXELS_ARC_TO_CHORD / pix_radius) / 2.; + return (int)ceilf (slices); +} + +#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) +{ + float last_capx, last_capy; + float capx, capy; + float radius = width / 2.; + int slices = calc_slices (radius / scale, M_PI); + int i; + + if (slices < MIN_TRIANGLES_PER_CAP) + slices = MIN_TRIANGLES_PER_CAP; + + if (slices > MAX_TRIANGLES_PER_CAP) + slices = MAX_TRIANGLES_PER_CAP; + + hidgl_ensure_triangle_space (&buffer, slices); + + last_capx = radius * cosf (angle * M_PI / 180.) + x; + last_capy = -radius * sinf (angle * M_PI / 180.) + y; + for (i = 0; i < slices; i++) { + capx = radius * cosf (angle * M_PI / 180. + ((float)(i + 1)) * M_PI / (float)slices) + x; + capy = -radius * sinf (angle * M_PI / 180. + ((float)(i + 1)) * M_PI / (float)slices) + y; + hidgl_add_triangle (&buffer, last_capx, last_capy, capx, capy, x, y); + last_capx = capx; + last_capy = capy; + } +} + +void +hidgl_draw_line (int cap, Coord width, Coord x1, Coord y1, Coord x2, Coord y2, double scale) +{ + double angle; + float deltax, deltay, length; + float wdx, wdy; + int circular_caps = 0; + int hairline = 0; + + if (width == 0.0) + hairline = 1; + + if (width < scale) + width = scale; + + deltax = x2 - x1; + deltay = y2 - y1; + + length = sqrt (deltax * deltax + deltay * deltay); + + if (length == 0) { + /* Assume the orientation of the line is horizontal */ + angle = 0; + wdx = -width / 2.; + wdy = 0; + length = 1.; + deltax = 1.; + deltay = 0.; + } else { + wdy = deltax * width / 2. / length; + wdx = -deltay * width / 2. / length; + + if (deltay == 0.) + angle = (deltax < 0) ? 270. : 90.; + else + angle = 180. / M_PI * atanl (deltax / deltay); + + if (deltay < 0) + angle += 180.; + } + + switch (cap) { + case Trace_Cap: + case Round_Cap: + circular_caps = 1; + break; + + case Square_Cap: + case Beveled_Cap: + x1 -= deltax * width / 2. / length; + y1 -= deltay * width / 2. / length; + x2 += deltax * width / 2. / length; + y2 += deltay * width / 2. / length; + break; + } + + hidgl_ensure_triangle_space (&buffer, 2); + hidgl_add_triangle (&buffer, x1 - wdx, y1 - wdy, + x2 - wdx, y2 - wdy, + x2 + wdx, y2 + wdy); + hidgl_add_triangle (&buffer, x1 - wdx, y1 - wdy, + x2 + wdx, y2 + wdy, + x1 + wdx, y1 + wdy); + + /* Don't bother capping hairlines */ + if (circular_caps && !hairline) + { + draw_cap (width, x1, y1, angle, scale); + draw_cap (width, x2, y2, angle + 180., scale); + } +} + +#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) +{ + float last_inner_x, last_inner_y; + float last_outer_x, last_outer_y; + float inner_x, inner_y; + float outer_x, outer_y; + float inner_r; + float outer_r; + float cos_ang, sin_ang; + float start_angle_rad; + float delta_angle_rad; + float angle_incr_rad; + int slices; + int i; + int hairline = 0; + + if (width == 0.0) + hairline = 1; + + if (width < scale) + width = scale; + + inner_r = rx - width / 2.; + outer_r = rx + width / 2.; + + if (delta_angle < 0) { + start_angle += delta_angle; + delta_angle = - delta_angle; + } + + start_angle_rad = start_angle * M_PI / 180.; + delta_angle_rad = delta_angle * M_PI / 180.; + + slices = calc_slices ((rx + width / 2.) / scale, delta_angle_rad); + + if (slices < MIN_SLICES_PER_ARC) + slices = MIN_SLICES_PER_ARC; + + if (slices > MAX_SLICES_PER_ARC) + slices = MAX_SLICES_PER_ARC; + + hidgl_ensure_triangle_space (&buffer, 2 * slices); + + angle_incr_rad = delta_angle_rad / (float)slices; + + cos_ang = cosf (start_angle_rad); + sin_ang = sinf (start_angle_rad); + last_inner_x = -inner_r * cos_ang + x; last_inner_y = inner_r * sin_ang + y; + last_outer_x = -outer_r * cos_ang + x; last_outer_y = outer_r * sin_ang + y; + for (i = 1; i <= slices; i++) { + cos_ang = cosf (start_angle_rad + ((float)(i)) * angle_incr_rad); + sin_ang = sinf (start_angle_rad + ((float)(i)) * angle_incr_rad); + inner_x = -inner_r * cos_ang + x; inner_y = inner_r * sin_ang + y; + outer_x = -outer_r * cos_ang + x; outer_y = outer_r * sin_ang + y; + hidgl_add_triangle (&buffer, last_inner_x, last_inner_y, + last_outer_x, last_outer_y, + outer_x, outer_y); + hidgl_add_triangle (&buffer, last_inner_x, last_inner_y, + inner_x, inner_y, + outer_x, outer_y); + last_inner_x = inner_x; last_inner_y = inner_y; + last_outer_x = outer_x; last_outer_y = outer_y; + } + + /* Don't bother capping hairlines */ + if (hairline) + return; + + draw_cap (width, x + rx * -cosf (start_angle_rad), + y + rx * sinf (start_angle_rad), + start_angle, scale); + draw_cap (width, x + rx * -cosf (start_angle_rad + delta_angle_rad), + 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) +{ + glBegin (GL_LINE_LOOP); + glVertex3f (x1, y1, global_depth); + glVertex3f (x1, y2, global_depth); + glVertex3f (x2, y2, global_depth); + glVertex3f (x2, y1, global_depth); + glEnd (); +} + + +void +hidgl_fill_circle (Coord vx, Coord vy, Coord vr, double scale) +{ +#define MIN_TRIANGLES_PER_CIRCLE 6 +#define MAX_TRIANGLES_PER_CIRCLE 360 + float last_x, last_y; + float radius = vr; + int slices; + int i; + + slices = calc_slices (vr / scale, 2 * M_PI); + + if (slices < MIN_TRIANGLES_PER_CIRCLE) + slices = MIN_TRIANGLES_PER_CIRCLE; + + if (slices > MAX_TRIANGLES_PER_CIRCLE) + slices = MAX_TRIANGLES_PER_CIRCLE; + + hidgl_ensure_triangle_space (&buffer, slices); + + last_x = vx + vr; + last_y = vy; + + for (i = 0; i < slices; i++) { + float x, y; + x = radius * cosf (((float)(i + 1)) * 2. * M_PI / (float)slices) + vx; + y = radius * sinf (((float)(i + 1)) * 2. * M_PI / (float)slices) + vy; + hidgl_add_triangle (&buffer, vx, vy, last_x, last_y, x, y); + last_x = x; + last_y = y; + } +} + +#define MAX_COMBINED_MALLOCS 2500 +static void *combined_to_free [MAX_COMBINED_MALLOCS]; +static int combined_num_to_free = 0; + +static GLenum tessVertexType; +static int stashed_vertices; +static int triangle_comp_idx; + + +static void +myError (GLenum errno) +{ + printf ("gluTess error: %s\n", gluErrorString (errno)); +} + +static void +myFreeCombined () +{ + while (combined_num_to_free) + free (combined_to_free [-- combined_num_to_free]); +} + +static void +myCombine ( GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **dataOut ) +{ +#define MAX_COMBINED_VERTICES 2500 + static GLdouble combined_vertices [3 * MAX_COMBINED_VERTICES]; + static int num_combined_vertices = 0; + + GLdouble *new_vertex; + + if (num_combined_vertices < MAX_COMBINED_VERTICES) + { + new_vertex = &combined_vertices [3 * num_combined_vertices]; + num_combined_vertices ++; + } + else + { + new_vertex = malloc (3 * sizeof (GLdouble)); + + if (combined_num_to_free < MAX_COMBINED_MALLOCS) + combined_to_free [combined_num_to_free ++] = new_vertex; + else + printf ("myCombine leaking %lu bytes of memory\n", 3 * sizeof (GLdouble)); + } + + new_vertex[0] = coords[0]; + new_vertex[1] = coords[1]; + new_vertex[2] = coords[2]; + + *dataOut = new_vertex; +} + +static void +myBegin (GLenum type) +{ + tessVertexType = type; + stashed_vertices = 0; + triangle_comp_idx = 0; +} + +static double global_scale; + +static void +myVertex (GLdouble *vertex_data) +{ + static GLfloat triangle_vertices [2 * 3]; + + if (tessVertexType == GL_TRIANGLE_STRIP || + tessVertexType == GL_TRIANGLE_FAN) + { + if (stashed_vertices < 2) + { + triangle_vertices [triangle_comp_idx ++] = vertex_data [0]; + triangle_vertices [triangle_comp_idx ++] = vertex_data [1]; + stashed_vertices ++; + } + else + { + hidgl_ensure_triangle_space (&buffer, 1); + hidgl_add_triangle (&buffer, + triangle_vertices [0], triangle_vertices [1], + triangle_vertices [2], triangle_vertices [3], + vertex_data [0], vertex_data [1]); + + if (tessVertexType == GL_TRIANGLE_STRIP) + { + /* STRIP saves the last two vertices for re-use in the next triangle */ + triangle_vertices [0] = triangle_vertices [2]; + triangle_vertices [1] = triangle_vertices [3]; + } + /* Both FAN and STRIP save the last vertex for re-use in the next triangle */ + triangle_vertices [2] = vertex_data [0]; + triangle_vertices [3] = vertex_data [1]; + } + } + else if (tessVertexType == GL_TRIANGLES) + { + triangle_vertices [triangle_comp_idx ++] = vertex_data [0]; + triangle_vertices [triangle_comp_idx ++] = vertex_data [1]; + stashed_vertices ++; + if (stashed_vertices == 3) + { + hidgl_ensure_triangle_space (&buffer, 1); + hidgl_add_triangle (&buffer, + triangle_vertices [0], triangle_vertices [1], + triangle_vertices [2], triangle_vertices [3], + triangle_vertices [4], triangle_vertices [5]); + triangle_comp_idx = 0; + stashed_vertices = 0; + } + } + else + printf ("Vertex recieved with unknown type\n"); +} + +void +hidgl_fill_polygon (int n_coords, Coord *x, Coord *y) +{ + int i; + GLUtesselator *tobj; + GLdouble *vertices; + + assert (n_coords > 0); + + vertices = malloc (sizeof(GLdouble) * n_coords * 3); + + tobj = gluNewTess (); + gluTessCallback(tobj, GLU_TESS_BEGIN, (_GLUfuncptr)myBegin); + gluTessCallback(tobj, GLU_TESS_VERTEX, (_GLUfuncptr)myVertex); + gluTessCallback(tobj, GLU_TESS_COMBINE, (_GLUfuncptr)myCombine); + gluTessCallback(tobj, GLU_TESS_ERROR, (_GLUfuncptr)myError); + + gluTessBeginPolygon (tobj, NULL); + gluTessBeginContour (tobj); + + for (i = 0; i < n_coords; i++) + { + vertices [0 + i * 3] = x[i]; + vertices [1 + i * 3] = y[i]; + vertices [2 + i * 3] = 0.; + gluTessVertex (tobj, &vertices [i * 3], &vertices [i * 3]); + } + + gluTessEndContour (tobj); + gluTessEndPolygon (tobj); + gluDeleteTess (tobj); + + myFreeCombined (); + free (vertices); +} + +void +tesselate_contour (GLUtesselator *tobj, PLINE *contour, GLdouble *vertices, + double scale) +{ + VNODE *vn = &contour->head; + int offset = 0; + + /* If the contour is round, and hidgl_fill_circle would use + * less slices than we have vertices to draw it, then call + * hidgl_fill_circle to draw this contour. + */ + if (contour->is_round) { + double slices = calc_slices (contour->radius / scale, 2 * M_PI); + if (slices < contour->Count) { + hidgl_fill_circle (contour->cx, contour->cy, contour->radius, scale); + return; + } + } + + gluTessBeginPolygon (tobj, NULL); + gluTessBeginContour (tobj); + do { + vertices [0 + offset] = vn->point[0]; + vertices [1 + offset] = vn->point[1]; + vertices [2 + offset] = 0.; + gluTessVertex (tobj, &vertices [offset], &vertices [offset]); + offset += 3; + } while ((vn = vn->next) != &contour->head); + gluTessEndContour (tobj); + gluTessEndPolygon (tobj); +} + +struct do_hole_info { + GLUtesselator *tobj; + GLdouble *vertices; + double scale; +}; + +static int +do_hole (const BoxType *b, void *cl) +{ + struct do_hole_info *info = cl; + PLINE *curc = (PLINE *) b; + + /* Ignore the outer contour - we draw it first explicitly*/ + if (curc->Flags.orient == PLF_DIR) { + return 0; + } + + tesselate_contour (info->tobj, curc, info->vertices, info->scale); + return 1; +} + +static GLint stencil_bits; +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) +{ + int vertex_count = 0; + PLINE *contour; + struct do_hole_info info; + int stencil_bit; + + info.scale = scale; + global_scale = scale; + + if (poly->Clipped == NULL) + { + fprintf (stderr, "hidgl_fill_pcb_polygon: poly->Clipped == NULL\n"); + return; + } + + stencil_bit = hidgl_assign_clear_stencil_bit (); + if (!stencil_bit) + { + printf ("hidgl_fill_pcb_polygon: No free stencil bits, aborting polygon\n"); + return; + } + + /* Flush out any existing geoemtry to be rendered */ + hidgl_flush_triangles (&buffer); + + /* Walk the polygon structure, counting vertices */ + /* This gives an upper bound on the amount of storage required */ + for (contour = poly->Clipped->contours; + contour != NULL; contour = contour->next) + vertex_count = MAX (vertex_count, contour->Count); + + info.vertices = malloc (sizeof(GLdouble) * vertex_count * 3); + info.tobj = gluNewTess (); + gluTessCallback(info.tobj, GLU_TESS_BEGIN, (_GLUfuncptr)myBegin); + gluTessCallback(info.tobj, GLU_TESS_VERTEX, (_GLUfuncptr)myVertex); + gluTessCallback(info.tobj, GLU_TESS_COMBINE, (_GLUfuncptr)myCombine); + gluTessCallback(info.tobj, GLU_TESS_ERROR, (_GLUfuncptr)myError); + + glPushAttrib (GL_STENCIL_BUFFER_BIT); /* Save the write mask etc.. for final restore */ + glEnable (GL_STENCIL_TEST); + glPushAttrib (GL_STENCIL_BUFFER_BIT | /* Resave the stencil write-mask etc.., and */ + GL_COLOR_BUFFER_BIT); /* the colour buffer write mask etc.. for part way restore */ + glStencilMask (stencil_bit); /* Only write to our stencil bit */ + glStencilFunc (GL_ALWAYS, stencil_bit, stencil_bit); /* Always pass stencil test, ref value is our bit */ + glColorMask (0, 0, 0, 0); /* Disable writting in color buffer */ + + glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE); /* Stencil pass => replace stencil value */ + + /* Drawing operations now set our reference bit in the stencil buffer */ + + r_search (poly->Clipped->contour_tree, clip_box, NULL, do_hole, &info); + hidgl_flush_triangles (&buffer); + + glPopAttrib (); /* Restore the colour and stencil buffer write-mask etc.. */ + + glStencilOp (GL_KEEP, GL_KEEP, GL_INVERT); /* This allows us to toggle the bit on any subcompositing bitplane */ + /* If the stencil test has passed, we know that bit is 0, so we're */ + /* effectively just setting it to 1. */ + + glStencilFunc (GL_GEQUAL, 0, assigned_bits); /* Pass stencil test if all assigned bits clear, */ + /* reference is all assigned bits so we set */ + /* any bits permitted by the stencil writemask */ + + /* Drawing operations as masked to areas where the stencil buffer is '0' */ + + /* Draw the polygon outer */ + tesselate_contour (info.tobj, poly->Clipped->contours, info.vertices, scale); + hidgl_flush_triangles (&buffer); + + /* Unassign our stencil buffer bit */ + hidgl_return_stencil_bit (stencil_bit); + + glPopAttrib (); /* Restore the stencil buffer write-mask etc.. */ + + gluDeleteTess (info.tobj); + myFreeCombined (); + free (info.vertices); +} + +void +hidgl_fill_rect (Coord x1, Coord y1, Coord x2, Coord y2) +{ + hidgl_ensure_triangle_space (&buffer, 2); + hidgl_add_triangle (&buffer, x1, y1, x1, y2, x2, y2); + hidgl_add_triangle (&buffer, x2, y1, x2, y2, x1, y1); +} + +void +hidgl_init (void) +{ + glGetIntegerv (GL_STENCIL_BITS, &stencil_bits); + + if (stencil_bits == 0) + { + printf ("No stencil bits available.\n" + "Cannot mask polygon holes or subcomposite layers\n"); + /* TODO: Flag this to the HID so it can revert to the dicer? */ + } + else if (stencil_bits == 1) + { + printf ("Only one stencil bitplane avilable\n" + "Cannot use stencil buffer to sub-composite layers.\n"); + /* Do we need to disable that somewhere? */ + } +} + +int +hidgl_stencil_bits (void) +{ + return stencil_bits; +} + +static void +hidgl_clean_unassigned_stencil (void) +{ + glPushAttrib (GL_STENCIL_BUFFER_BIT); + glStencilMask (~assigned_bits); + glClearStencil (0); + glClear (GL_STENCIL_BUFFER_BIT); + glPopAttrib (); +} + +int +hidgl_assign_clear_stencil_bit (void) +{ + int stencil_bitmask = (1 << stencil_bits) - 1; + int test; + int first_dirty = 0; + + if (assigned_bits == stencil_bitmask) + { + printf ("No more stencil bits available, total of %i already assigned\n", + stencil_bits); + return 0; + } + + /* Look for a bitplane we don't have to clear */ + for (test = 1; test & stencil_bitmask; test <<= 1) + { + if (!(test & dirty_bits)) + { + assigned_bits |= test; + dirty_bits |= test; + return test; + } + else if (!first_dirty && !(test & assigned_bits)) + { + first_dirty = test; + } + } + + /* Didn't find any non dirty planes. Clear those dirty ones which aren't in use */ + hidgl_clean_unassigned_stencil (); + assigned_bits |= first_dirty; + dirty_bits = assigned_bits; + + return first_dirty; +} + +void +hidgl_return_stencil_bit (int bit) +{ + assigned_bits &= ~bit; +} + +void +hidgl_reset_stencil_usage (void) +{ + assigned_bits = 0; + dirty_bits = 0; +} Index: tags/1.0.5/.pc/outdated_config.diff/config.guess =================================================================== --- tags/1.0.5/.pc/outdated_config.diff/config.guess (nonexistent) +++ tags/1.0.5/.pc/outdated_config.diff/config.guess (revision 953) @@ -0,0 +1,1463 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Property changes on: tags/1.0.5/.pc/outdated_config.diff/config.guess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/.pc/outdated_config.diff/config.sub =================================================================== --- tags/1.0.5/.pc/outdated_config.diff/config.sub (nonexistent) +++ tags/1.0.5/.pc/outdated_config.diff/config.sub (revision 953) @@ -0,0 +1,1579 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ms1 \ + | msp430 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | ms1-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Property changes on: tags/1.0.5/.pc/outdated_config.diff/config.sub ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/.pc/pcbtest_paths.diff/src/pcbtest.sh.in =================================================================== --- tags/1.0.5/.pc/pcbtest_paths.diff/src/pcbtest.sh.in (nonexistent) +++ tags/1.0.5/.pc/pcbtest_paths.diff/src/pcbtest.sh.in (revision 953) @@ -0,0 +1,95 @@ +#! /bin/sh +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# +# +# starts a test installation of pcb + +# execute pcb + +# If the first argument is "-gdb" then run PCB inside the gdb +# debugger. +# +# Use --g-fatal-warnings with the gtk HID to cause gtk-WARNING's to +# abort. + +TEST_PATHS="--lib-path @TOP_BUILDDIR@/lib --lib-newlib @TOPSRCDIR@/newlib:@TOP_BUILDDIR@/lib/pcblib-newlib --element-path @TOP_BUILDDIR@/lib --font-path @TOPSRCDIR@/src" +TEST_CMDS="--lib-command-dir @TOP_BUILDDIR@/lib" + +# note: To do command line exporting, pcb requires the "-x " command to appear first. For example +# +# pcb -x bom [other args] pcbfile +# +# as opposed to +# +# pcb [other args] -x bom pcbfile +# + +use_gdb=no +if [ "X$1" = "X-gdb" ]; then + use_gdb=yes + shift +fi + +args="" +export_args="" + +while test $# -ne 0 ; do + case $1 in + -x) + export_args="$1 $2" + shift 2 + ;; + *) + args="$args $1" + shift + ;; + esac +done + +# build up the complete argument list +arg_list="$export_args $TEST_PATHS $TEST_CMDS $args" + +if test $use_gdb = yes ; then + tmpd=/tmp/pcbtest.$$ + tmpf=${tmpd}/pcbtest.gdb + mkdir -p -m 0700 ${tmpd} + rc=$? + if test $rc -ne 0 ; then + echo "$0: Could not create ${tmpd} with mode = 0700" + echo " mkdir returned $rc" + exit 1 + fi + cat > $tmpf << EOF +set args $arg_list +EOF + exec gdb -x $tmpf ./pcb + rm -fr $tmpd +else + exec @TOP_BUILDDIR@/src/pcb $arg_list +fi + Property changes on: tags/1.0.5/.pc/pcbtest_paths.diff/src/pcbtest.sh.in ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/AUTHORS =================================================================== --- tags/1.0.5/AUTHORS (nonexistent) +++ tags/1.0.5/AUTHORS (revision 953) @@ -0,0 +1,9 @@ +pcb-rnd maintainer: Tibor 'Igor2' Palinkas +email: pcb-rnd (at) igor2.repo.hu + +PCB was originally written by Thomas Nau +Development was later taken over by harry eaton +The port to GTK was done by Bill Wilson +Dan McMahill converted the build system from imake to autoconf/automake. +DJ Delorie wrote the trace optimizer, added symbolic flag support and +many other improvements. Index: tags/1.0.5/COPYING =================================================================== --- tags/1.0.5/COPYING (nonexistent) +++ tags/1.0.5/COPYING (revision 953) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Index: tags/1.0.5/Changelog =================================================================== --- tags/1.0.5/Changelog (nonexistent) +++ tags/1.0.5/Changelog (revision 953) @@ -0,0 +1,204 @@ +pcb-rnd 1.0.5 +~~~~~~~~~~~~~ + [onpoint] + -Add: Robert Drehmel's on-point patch adapted for pcb-rnd + + [scconfig] + -Fix: properly configure and build and install even if there's space + in the source path (thanks to Jason White) + -Fix: take genht from the local copy, don't depend it being installed + +pcb-rnd 1.0.4 +~~~~~~~~~~~~~ + [ba] + -Add: back annotation + + [core] + -Fix: suppress no-font error message while loading default.pcb - the actual font is coming from the default font file + + [pcblib-param] + -Add: screw(), low level + -Fix: typo in the help of rcy() + + [mincut] + -Fix: solve debug works again + -Fix: make debug pngs during load optional + -Fix: don't use function-in-function - that's a gcc-specific feature + -Fix: don't use alloca(), use malloc() (C99) + -Add: Makefile to test against known refs + + [pcb-fp] + -Fix: gtk lib window tag print doesn't segfault if there are no tags for a footprint + -Del: local hash and library search implementation for footprint names in buffer.c - libpcb_fp should handle this + +pcb-rnd 1.0.3 +~~~~~~~~~~~~~ + [gpmi] + -Add: GPMI plugin/buildin for scripiting (import of project pcb-gpmi) + + [tostyle] + -Add: new feature to adjust the sizes of object(s) to the values of the current routing style + + [pcb-fp] + -Add: support for parsing and caching footprint tags (file elements) + -Add: the gtk HID displays tags + -Add: the gtk HID can filter for tags + + [pcblib-param] + -Add: bga() + -Add: generic qf() generator + -Add: qfn() - based on qf() + -Add: qfp() - based on qf() + -Add: plcc() - based on qf() + -Add: qsop() - based on so() + -Add: silkmark: accept multiple values + -Add: silkmark: can be external + -Add: silkmark: new styles exteranl45, dot, circle, and arc + -Add: connector() has a sequence option to change pin numbering + -Add: some tunings for connector sequence=zigzag to do something usable with etrunc=1 + + [hid] + -Add: dynamic menus: create_menu(), menu paths, runtime insertion of menus in core + -Add: dynamic menus in gtk + -Add: dynamic menus in lesstif + -Fix: more const correctness in dialog box code + + [scconfig] + -Add: ./configure --help + -Add: print configuration summary at the end + -Add: autodetect HOST (use sys/sysid) + -Add: src/3rd for central hosting of 3rd party software libs + -Add: support "buildins": plugins built into the code + -Change: move genht to src/3rd; policy: prefer genht over glib hash + -Fix: tests try to run pcb-rnd, not pcb + -Fix: central LDFLAGS and CFLAGS should contain the ldflags/cflags detected for generic use + + [pcb-mincut] + -Merge: pcb-mincut is imported in pcb-rnd, the extern repo will be removed + + [core] + -Add: event subsystem + -Add: gui_init event + -Add: generic plugin support: track plugins loaded, have a menu for managing them + -Add: more accessors to query unit details - for the gpmi scripts + -Add: pcb-printf %mI prints coordinate in internal coord format + -Add: calls for removing actions + -Add: calls for removing a hid (useful for removing exporter hids registered by scripts) + -Add: path resolution: support ~ in paths + -Add: real regex search and real string list search (in search by name actions) + -Change: switch over actions from bsearch() to a genht hash - simpler code, potentially also faster + -Fix: don't allow the registration of an action with a name that's already registered + + + [fp2anim] + -Add: optional dimension lines + -Add: more fine grained annotation control + -Change: switch over to vector fonts for better scaling + -Fix: draw rounded pads (new pad syntax only) + -Fix: make sure to generate sane arcs + + [doc-rnd] + -Add: official central key list + +pcb-rnd 1.0.2 +~~~~~~~~~~~~~ + [pcblib-param] + -Fix: central bool handling (connector() etrunc), values: on/off, true/false, 1/0 + -Fix: typo in so() parameter descriptions + -Fix: connector() typo in error() + -Add: more elaborate help syntax: easier to read with scripts + + [fp2anim] + -Fix: read multiline directives properly - a newline after each directive is still needed, tho + -Fix: allow whitepsace between directive name and opening bracket + -Fix: create all layers in advance - this fixes the case when the fp doesn't draw on some layers (the macro still exists) + -Fix: rline() is extended by width/2 if there are no rounding; it seems this how pcb defines lines + -Fix: leave extra margin in photo mode for the 3d edges + -Add: support for old-style pad() + -Add: support for Mark() (relocate the diamond) + -Add: options to turn off the grid and annotation - useful for thumbnails + + [scconfig] + -Fix: always have config.h, don't ifdef it + -Fix: glib is a core dependency that should be added even if the gtk hid is not used + -Fix: make clean removes pcb-rnd, not pcb (executable file name typo) + -Add: make clean in util/ + -Add: options to disable gd and/or jpeg or png or gif + -Add: be able to detect and configure lesstif + -Add: --disable-gtk and --disable-lesstif; --disable-xinerama and --disable-xrender for lesstif + -Add: use detected -rdynamic so that plugins can link against the executable + -Change: detect both gtk and lesstif as optional dependencies + -Cleanup: generate hidlist.h from tmpasm instead of shell to remove shell dependency + -Del: a bunch of obsolete #defines inherited from auto* + + [core] + -Add: --gui explicitly selects a gui hid + -Add: don't leave preferred order of GUIs to the chance, make it explicit + + +pcb-rnd 1.0.1 +~~~~~~~~~~~~~ + [core] + -Fix: don't read beyond the common part of the struct in IsPointInPad (since it's called for lines too, and those have much less fields) + -Fix: where stdarg is avaialble, also print messages to stderr - useful if things go wrong before a GUI is working + + [gtk] + -Fix: don't crash but write error message and exit if gpcb-menu.res is empty + + [square] + -Fix: 90 deg rotation rotates shape style + -Add: action.c and change.c code to get shaped vias + -Fix: don't change pin shape for square and octagon in rotation + + [mincut] + -Add: command line setting --enable-mincut (0 or 1) as mincut can be slow + it is a global disbale setting and make a local, per pcb setting + for enabling mincut; also add a per pcb setting/flag + -Fix: disable debug draw by default + -Fix: fall back to the old short warn method when mincut fails + -Fix: avoid segfaults by detecting broken graph early + -Workaround: if mincut sees a graph with multiple unconnected components, doesn't try to solve but falls back to randomly highlight something + + [intconn] + -Workaround: find intconn pads only on the same layer + + [nonetlist] + -Workaround: ignore nonetlist pads even if the flag is in the element name + + [scconfig] + -Add: scconfig/ - switch over from autotools to scconfig + + [pcblib] + -Cleanup: new, trimmed back pcblib/ with essential footprints only + + [pcblib-param] + -Add: new parametric footprints - no more m4-hardwiring, use your + preferred language! + -Add: acy(), alf(), rcy(), connector(), dip() + -Add: so(), tssop(), msop(), ssop() + + [pcb-fp] + -Add: central lib for footprint search and load in pcb and gsch2pcb + + [util] + -Add: gsch2pcb fork to support [nonetlist] and [pcblib-param] + + [fp2anim] + -Add: fp to animator script for fast preview + + [polygrid] + -Add: ps output: draw grid in polys instead of fill (doesn't fully work) + -Fix: set proper max value so the control is enabled + + + [debian] + -Update: build the package with scconfig and footprint changes + + +pcb-rnd 1.0.0 +~~~~~~~~~~~~~ + [square] -Add: initial implementation + [intconn] -Add: initial implementation + [nonetlist] -Add: initial implementation + [flagcomp] -Add: initial implementation + [mincut] -Add: initial implementation Index: tags/1.0.5/INSTALL =================================================================== --- tags/1.0.5/INSTALL (nonexistent) +++ tags/1.0.5/INSTALL (revision 953) @@ -0,0 +1,140 @@ +Run ./configure. + +You may want to edit config.manual.h and globalconst.h to change +user preference defaults. + +Run make. + +Run make install. + +-- + +PCB is organized into a core program that deals with all of the +internal database procedures and a collection of Human Interface +Devices (HID's). The HID's provide exporting/printing capability +as well as a graphical user interface. At the time of writing +this document PCB includes the following HIDs: + +TODO: this doesn't work with scconfig: +GUI HID's: + gtk -- GTK based GUI. This is the default GUI. You will + need gtk-2.4 or newer installed (both the runtime + files as well as the developer headers). You only + need gtk if you want the gtk HID. + + lesstif -- motif/lesstif based GUI. To use the lesstif HID + you will need Motif, OpenMotif, or Lesstif installed. + Again you need both libraries and headers. + + The choice of which gui to use (if you want something other than + the default of GTK) is indicated with the --with-gui configure + option. Examples are: + --with-gui=lesstif = picks the lesstif HID + --with-gui=gtk = picks the GTK HID + --without-gui = specifies that no GUI will be built. This + option is primarily intended for use in a + web server environment where you may wish + to export .pcb files to graphical files on + the fly but you do not want to install + X11 or any GUI tooliks on the server. + +Export HID's: + ps -- Postscript and Encapsulated Postscript output. No + additional libraries are needed for this. + + gcode -- CNC G-CODE output (experimental). The gdlib library + is used by this HID. gdlib may be found at + http://www.libgd.org + + gerber -- RS-274-X (Gerber) and Excellon drill output. No + additional libraries are needed for this. + + bom -- Bill of materials (BOM) and Centroid (X-Y) output. + No additional libraries are needed for this. + + png -- png/gif/jpeg output. This HID uses gdlib to do + the majority of the work. gdlib may be obtained + from http://www.libgd.org. At the time of + writing this document, I have tested with + gd-2.0.23 and gd-2.0.33. Other versions may + work as well. + + Since some installations of gdlib may not support + all three of the formats mentioned here (png, gif, + and jpeg), PCB provides configure options to individually + turn off each of these output formats. These options + are: + --disable-gif, --disable-jpeg, and --disable-png + By having you, the user, explicitly turn off the different + formats hopefully it will avoid suprises when the + disabled formats are not available at runtime. + + The choice of which export HID's to compile is indicated with: + + --with-exporters="ps gerber bom png" + + By default all available exporters will be configured in if --with-exporters + is not given. + +Printer HID's: + lpr -- Unix line printer support. No additional libraries are + needed for this. + + The choice of which printer HID's to compile is indicated with: + + --with-printers="lpr" + + By default all available printers will be configured in if --with-printers + is not given. + +In addition to the libraries listed above, there is a graphical QFP footprint +creator which uses TCL/TK. If you do not wish to use this feature, and you +do not have TCL/TK installed on your system, you may simply set WISH to +/usr/bin/true in your configure environment. For example: + + env WISH=/usr/bin/true ./configure + + +Please refer to the output of + + ./configure --help + +for the most up to date details on the options. + +After running ./configure with your selected options, run + + make + +to build PCB. You can try out the program by running + + cd src + ./pcbtest.sh + +prior to installation. + +To install PCB after it has been built run: + + make install + +from the top level directory. + +-------- Summary of dependencies -------------------- + +- GNU m4. In particular your m4 must support -F for frozen files. + +- wish (part of tcl/tk). If not installed, set WISH=/bin/false in + your configure environment and you just won't get the graphical + QFP footprint builder + +- gtk if you are using the gtk frontend + +(- motif or lesstif if you are using the lesstif frontend) + +- gdlib if you are using the png HID + +- (GNU) make for building + +- flex + +- bison + Index: tags/1.0.5/Makefile =================================================================== --- tags/1.0.5/Makefile (nonexistent) +++ tags/1.0.5/Makefile (revision 953) @@ -0,0 +1,38 @@ +all: + cd gts && make + cd src && make + cd util && make + cd pcblib && make + cd tutorial && make + +clean: + cd gts && make clean + cd src && make clean + cd util && make clean + cd pcblib && make clean + cd tutorial && make clean + +install: + cd src && make install + cd util && make install + cd pcblib && make install + cd tutorial && make install + +linstall: + cd src && make linstall + cd util && make linstall + cd pcblib && make linstall + cd tutorial && make linstall + +uninstall: + cd src && make uninstall + cd util && make uninstall + cd pcblib && make uninstall + cd tutorial && make uninstall + +deb: + fakeroot debian/rules clean + fakeroot debian/rules binary + +debclean: + fakeroot debian/rules clean Index: tags/1.0.5/Makefile.conf.in =================================================================== --- tags/1.0.5/Makefile.conf.in (nonexistent) +++ tags/1.0.5/Makefile.conf.in (revision 953) @@ -0,0 +1,12 @@ +print [@# generated by ./configure, do not modify +# 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 +RM=@fstools/rm@ +CP=@fstools/cp@ +LN=@fstools/ln@ +MKDIR=@fstools/mkdir@ +@] Index: tags/1.0.5/README =================================================================== --- tags/1.0.5/README (nonexistent) +++ tags/1.0.5/README (revision 953) @@ -0,0 +1,27 @@ +Pcb-rnd is a fork of PCB, adding a lot of random features and patches, +hosted at http://repo.hu/projects/pcb-rnd (src: svn://repo.hu/pcb-rnd/trunk). + +Pcb is a CAD (computer aided design) program for the physical +design of printed circuit boards. + +For installing the release refer to the file 'INSTALL'. +For additional information read the manual (doc/pcb.pdf) + +If you are updating you may wish to read the ChangeLog + +There is also a bug tracking system available which can +be found from http://pcb.gpleda.org. + + +------------------------------------------------------------------------- + COPYRIGHT + +PCB is covered by the GNU General Public License. See the individual +files for the exact copyright notices. + + Contact addresses for paper mail and Email: + harry eaton + 6697 Buttonhole Court + Columbia, MD 21044 + haceaton@aplcomm.jhuapl.edu + Index: tags/1.0.5/README.w32 =================================================================== --- tags/1.0.5/README.w32 (nonexistent) +++ tags/1.0.5/README.w32 (revision 953) @@ -0,0 +1,22 @@ +Building PCB for Windows with a MinGW cross-compiler + +1) Install a MinGW cross-compiler. +On Debian and derivatives, you can type 'sudo apt-get install mingw32.'. +You can also build your own by using the build script provided by the +MinGW project. + +2) Install native (non-cross) dependencies. + +* autoconf, automake, libtool, gettext, intltool. +* glib and gtk+. + +3) Edit the w32/minipack.conf file to suit your compiler setup. + +4) Enter the w32 directory and run ./build_all. + +5) Wait while the script fetches and compiles the PCB dependencies and PCB itself. + +6) Run the result with wine: wine result/bin/pcb.exe + +7) Copy the result directory to a Windows installation (packaging script is not supplied). + Index: tags/1.0.5/Release_notes =================================================================== --- tags/1.0.5/Release_notes (nonexistent) +++ tags/1.0.5/Release_notes (revision 953) @@ -0,0 +1,4 @@ +pcb-rnd 1.0.5 +~~~~~~~~~~~~~ +The main features are bugfixes in the build system and adaptation of +Robert Drehmel's on-point patch. Index: tags/1.0.5/config.auto.h.in =================================================================== --- tags/1.0.5/config.auto.h.in (nonexistent) +++ tags/1.0.5/config.auto.h.in (revision 953) @@ -0,0 +1,294 @@ +print [@ /***** Generated by scconfig - DO NOT EDIT *****/ + + +/**** GL ****/ + +/* Define to 1 if GL support is to be compiled in */ +/* #undef ENABLE_GL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GL_GLU_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GL_GL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENGL_GLU_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENGL_GL_H */ + +/**** DBUS ****/ + +/* Define to 1 if DBUS IPC is to be compiled in */ +/* #undef HAVE_DBUS */ + +/* Define to 1 if you have the `dbus_watch_get_unix_fd' function. */ +/* #undef HAVE_DBUS_WATCH_GET_UNIX_FD */ + + +/**** TODO ****/ + +/* Define to 1 if you have the `canonicalize_file_name' function. */ +#define HAVE_CANONICALIZE_FILE_NAME 1 + + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `getpwuid' function. */ +#define HAVE_GETPWUID 1 + +/* Define to 1 if you have the `mkdir' function. */ +#define HAVE_MKDIR 1 + +/* Define to 1 if you have the `_mkdir' function. */ +/* #undef HAVE__MKDIR */ + + +/* Define to 1 if you have the `mkdtemp' function. */ +#define HAVE_MKDTEMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PWD_H 1 + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the `realpath' function. */ +#define HAVE_REALPATH 1 + +/* Define to 1 if you have the `regcomp' function. */ +#define HAVE_REGCOMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_REGEX_H 1 + +/* Define to 1 if you have the `re_comp' function. */ +#define HAVE_RE_COMP 1 + +/* Define to 1 if you have the `rint' function. */ +#define HAVE_RINT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIMES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + + +/* Define to 1 if you have the `_spawnvp' function. */ +/* #undef HAVE__SPAWNVP */ + + +/* Define if mkdir takes only one argument. */ +/* #undef MKDIR_TAKES_ONE_ARG */ + +/* Define if canonicalize_file_name is not declared in system header files. */ +/* #undef NEED_DECLARATION_CANONICALIZE_FILE_NAME */ + +/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +/* #undef SIZE_MAX */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + +/****************************************************************************/ +/* These are all in C89 - pcb-rnd does not support anything below C89, so + these are safe to hardwire */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/****************************************************************************/ +/* Package properties */ + +/* Name of package */ +#define PACKAGE "pcb" + +/* Name of this program's gettext domain */ +#define GETTEXT_PACKAGE "pcb" + +/****************************************************************************/ +/* These ones are already autodetected by scconfig */ +@] + + + +print {\n\n/* Define to 1 if you have `alloca', as a function or macro. */ \n} +print_ternary cc/alloca/presents {#define HAVE_ALLOCA 1} {/* #undef HAVE_ALLOCA */} + +print {\n\n/* Define to 1 if you have the `putenv' function. */\n} +print_ternary libs/env/putenv/presents {#define HAVE_PUTENV 1} {/* #undef HAVE_PUTENV */} + +print {\n\n/* Define to 1 if you have the `setenv' function. */\n} +print_ternary libs/env/setenv/presents {#define HAVE_SETENV 1} {/* #undef HAVE_SETENV */} + +print {\n\n/* Define to 1 if you have the `snprintf' function. */\n} +print_ternary libs/snprintf {#define HAVE_SNPRINTF 1} {/* #undef HAVE_SNPRINTF */} + +print {\n\n/* Define to 1 if you have the `vsnprintf' function. */\n} +print_ternary libs/vsnprintf {#define HAVE_VSNPRINTF 1} {/* #undef HAVE_VSNPRINTF */} + +print {\n\n/* Define to 1 if you have the `getcwd' function. */\n} +print_ternary libs/fs/getcwd/presents {#define HAVE_GETCWD 1} {/* #undef HAVE_GETCWD */} + +print {\n\n/* Define to 1 if you have the `expf' function. */\n} +print_ternary libs/math/expf/presents {#define HAVE_EXPF 1} {/* #undef HAVE_EXPF */} + +print {\n\n/* Define to 1 if you have the `logf' function. */\n} +print_ternary libs/math/logf/presents {#define HAVE_LOGF 1} {/* #undef HAVE_LOGF */} + +print {\n\n/* Define to 1 if you have the header file. */\n} +print_ternary libs/gui/gd/presents {#define HAVE_GD_H 1} {/* #undef HAVE_GD_H */} + +print {\n\n/* Define to 1 if you have the `gdImageGif' function. */\n} +print_ternary libs/gui/gd/gdImageGif/presents {#define HAVE_GDIMAGEGIF 1} {/* #undef HAVE_GDIMAGEGIF */} + +print {\n\n/* Define to 1 if you have the `gdImageJpeg' function. */\n} +print_ternary libs/gui/gd/gdImageJpeg/presents {#define HAVE_GDIMAGEJPEG 1} {/* #undef HAVE_GDIMAGEGIF */} + +print {\n\n/* Define to 1 if you have the `gdImagePng' function. */\n} +print_ternary libs/gui/gd/gdImagePng/presents {#define HAVE_GDIMAGEPNG 1} {/* #undef HAVE_GDIMAGEGIF */} + +print {\n\n/* Wrapper for S_ISLNK(x); always return 0 if S_ISLNK doesn't exist */\n} +switch /target/libs/fs/stat/macros/S_ISLNK + case {} print {#define WRAP_S_ISLNK(x) 0}; end; + default print [@#define WRAP_S_ISLNK(x) @/target/libs/fs/stat/macros/S_ISLNK@(x)@]; end; +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 {\n\n/* Define to 1 if Xrender is available */\n} +print_ternary libs/gui/xrender/presents {#define HAVE_XRENDER 1} {/*#undef HAVE_XRENDER */} + + + +print [@ + +/* The host "triplet" - it's really a pair now: machine-os */ +#define HOST "@sys/sysid@" + + +/* Directory separator char */ +#define PCB_DIR_SEPARATOR_C '@sys/path_sep@' + +/* Directory separator string */ +#define PCB_DIR_SEPARATOR_S "@sys/path_sep@" + +/* Search path separator string */ +#define PCB_PATH_DELIMETER ":" + +/* m4 program used by pcb */ +#define GNUM4 "@libs/script/m4/bin/path@" + + +/****************************************************************************/ +/* Paths */ + +/* library file name */ +#define LIBRARYFILENAME "pcblib" + +#define PCB_PREFIX "@/local/prefix@" +#define PCBSHAREDIR PCB_PREFIX "/share/pcb-rnd" +#define PCBLIBDIR PCB_PREFIX "/lib/pcb-rnd" +#define PCB_LIBRARY_SHELL NULL +#define PCB_LIBRARY_SEARCH_PATHS \ + "./pcblib"\ + ":" \ + "./footprints"\ + ":" \ + "../pcblib"\ + ":" \ + PCB_PREFIX "/share/pcb-rnd/pcblib"\ + ":"\ + PCB_PREFIX "/share/pcb/pcblib-newlib" + +/* NOTE: /share/pcb/pcblib-newlib is kept as a temporary hack for compatibility */ + +#define PCB_DEFAULT_PCB_FILE PCBSHAREDIR "/default.pcb" +#define PCB_DEFAULT_PCB_FILE_SRC "./default.pcb" + +#define BINDIR PCB_PREFIX "/bin" + +/* Relative path from bindir to exec_prefix */ +#define BINDIR_TO_EXECPREFIX ".." + +/* Relative path from bindir to pcbsharedir TODO: do we still need this? */ +#define BINDIR_TO_PCBSHAREDIR "../share/pcb-rnd" + +/* Version number of package */ +#define VERSION "@/local/version@" +#define REVISION "@/local/revision@" + +@] + + + + + Index: tags/1.0.5/config.h =================================================================== --- tags/1.0.5/config.h (nonexistent) +++ tags/1.0.5/config.h (revision 953) @@ -0,0 +1,2 @@ +#include "config.manual.h" +#include "config.auto.h" Index: tags/1.0.5/config.manual.h.in =================================================================== --- tags/1.0.5/config.manual.h.in (nonexistent) +++ tags/1.0.5/config.manual.h.in (revision 953) @@ -0,0 +1,29 @@ +print [@ +/**** User preferences - feel free to edit this file any time ****/ + +/* Fake binary path, bypassing the clever heuristics that determine it + using the real path of the binary. The heuristics fails if the binary + is a symlink to the source, taking the source dir instead of /usr/bin. + + You need this if you want to use make linstall. +*/ +/* #define FAKE_BINDIR BINDIR */ + +/* Maximum value of coordinate type */ +#define COORD_MAX LONG_MAX + +/* C type for Coordinates */ +#define COORD_TYPE long + +/* Define to 1 if you have the `dmalloc' library (-ldmalloc); + (memory debugging without valgrind) */ +/* #undef HAVE_LIBDMALLOC */ + +/* Define to 1 to enable toporouter graphical output */ +#define TOPO_OUTPUT_ENABLED 0 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +@] Index: tags/1.0.5/configure =================================================================== --- tags/1.0.5/configure (nonexistent) +++ tags/1.0.5/configure (revision 953) @@ -0,0 +1,5 @@ +#!/bin/sh +cd scconfig +make +./configure $* + Property changes on: tags/1.0.5/configure ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/data/Makefile =================================================================== --- tags/1.0.5/data/Makefile (nonexistent) +++ tags/1.0.5/data/Makefile (revision 953) @@ -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 + +theme = hicolor + +app_icon = pcb + +mime_icons = \ + application-x-pcb-layout \ + application-x-pcb-footprint \ + application-x-pcb-netlist \ + application-x-gerber \ + application-x-excellon + +app_icon_files = \ + $(app_icon:%=%-48.png) \ + $(app_icon:%=%.svg) +# $(app_icon:%=%-16.png) +# $(app_icon:%=%-22.png) +# $(app_icon:%=%-24.png) +# $(app_icon:%=%-32.png) + +mime_icon_files = \ + $(mime_icons:%=%-16.png) \ + $(mime_icons:%=%-22.png) \ + $(mime_icons:%=%-24.png) \ + $(mime_icons:%=%-32.png) \ + $(mime_icons:%=%-48.png) \ + $(mime_icons:%=%.svg) + +mime_icon_sources = \ + $(mime_icons:%=%-16.svg) \ + $(mime_icons:%=%-22.svg) \ + $(mime_icons:%=%-32.svg) \ + $(mime_icons:%=%-48.svg) + +theme_icons = \ + $(mime_icon_files:%=mimetypes,%) \ + $(app_icon_files:%=apps,%) + +all: + +install_: + ./icon-theme-installer \ + -t $(theme) \ + -m "$(MKDIR)" \ + -s `pwd` \ + -d x \ + -b "$(themedir)" \ + -x "$(CPC)" \ + -i $(theme_icons) + +install: + make install_ CPC="$(CP)" + +linstall: + make install_ CPC="$(LN)" + +uninstall: + $(RM) $(DOCDIR)/examples/tut1.pcb + +include ../Makefile.conf +themedir=$(DATADIR)/icons/$(theme) + Index: tags/1.0.5/data/README =================================================================== --- tags/1.0.5/data/README (nonexistent) +++ tags/1.0.5/data/README (revision 953) @@ -0,0 +1,56 @@ + +PCB +------------------------------------------------------------------------------ + +README for icon data + +This file describes where the various icons came from and their license. + +The PCB layout and gerber icons and mime registration data were contributed +by Tomaz Solc, and subsequently modified by Peter Clifton, including +creation of an excellon icon file with a ruler element taken from +Tomaz's gerber icon. The footprint and netlist icons were drawn by +Peter Clifton. + +The page outline featured in all the above icons is from the GNOME icon +theme's text-x-generic icon by Jakub Steiner. + +The icons are licensed under the GPL2 license. + +Scalable versions: (128x128 canvas for the "hicolor" fallback theme). +These were scaled up from the 48x48 pixel targeted version. + +application-x-excellon.svg +application-x-gerber.svg +application-x-pcb-footprint.svg +application-x-pcb-layout.svg +application-x-pcb-netlist.svg + +Pixel targeted varients: + +application-x-excellon-{16,22,32,48}.svg +application-x-gerber-{16,22,32,48}.svg +application-x-pcb-footprint-{16,22,32,48}.svg +application-x-pcb-layout-{16,22,32,48}.svg +application-x-pcb-netlist-{16,22,32,48}.svg + + +PNG versions of the above icons were exported from Inkscape. The 24x24 pixel +versions are copied from the 22x22 version, with a 1 pixel border added: + +application-x-excellon-{16,22,24,32,48}.png +application-x-gerber-{16,22,24,32,48}.png +application-x-pcb-footprint-{16,22,24,32,48}.png +application-x-pcb-layout-{16,22,24,32,48}.png +application-x-pcb-netlist-{16,22,24,32,48}.png + +The script "regen_files" will re-export the SVG drawings to PNG and also +regenerate the windows icon file. + +The PCB application icons were created by Peter Clifton, based upon the +Gnome "text-editor" icon created by Lapo Calamandrei. The PCB specific +additions are from the mime-type icons by Tomaz Solc. +These icons are licensed under the GPL2 license. + +pcb.svg +pcb-48.png Index: tags/1.0.5/data/application-x-excellon-16.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-excellon-16.png =================================================================== --- tags/1.0.5/data/application-x-excellon-16.png (nonexistent) +++ tags/1.0.5/data/application-x-excellon-16.png (revision 953) Property changes on: tags/1.0.5/data/application-x-excellon-16.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-excellon-16.svg =================================================================== --- tags/1.0.5/data/application-x-excellon-16.svg (nonexistent) +++ tags/1.0.5/data/application-x-excellon-16.svg (revision 953) @@ -0,0 +1,1271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Excellon file + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-excellon-22.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-excellon-22.png =================================================================== --- tags/1.0.5/data/application-x-excellon-22.png (nonexistent) +++ tags/1.0.5/data/application-x-excellon-22.png (revision 953) Property changes on: tags/1.0.5/data/application-x-excellon-22.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-excellon-22.svg =================================================================== --- tags/1.0.5/data/application-x-excellon-22.svg (nonexistent) +++ tags/1.0.5/data/application-x-excellon-22.svg (revision 953) @@ -0,0 +1,1571 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Excellon file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-excellon-24.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-excellon-24.png =================================================================== --- tags/1.0.5/data/application-x-excellon-24.png (nonexistent) +++ tags/1.0.5/data/application-x-excellon-24.png (revision 953) Property changes on: tags/1.0.5/data/application-x-excellon-24.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-excellon-32.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-excellon-32.png =================================================================== --- tags/1.0.5/data/application-x-excellon-32.png (nonexistent) +++ tags/1.0.5/data/application-x-excellon-32.png (revision 953) Property changes on: tags/1.0.5/data/application-x-excellon-32.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-excellon-32.svg =================================================================== --- tags/1.0.5/data/application-x-excellon-32.svg (nonexistent) +++ tags/1.0.5/data/application-x-excellon-32.svg (revision 953) @@ -0,0 +1,1406 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Excellon file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-excellon-48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-excellon-48.png =================================================================== --- tags/1.0.5/data/application-x-excellon-48.png (nonexistent) +++ tags/1.0.5/data/application-x-excellon-48.png (revision 953) Property changes on: tags/1.0.5/data/application-x-excellon-48.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-excellon-48.svg =================================================================== --- tags/1.0.5/data/application-x-excellon-48.svg (nonexistent) +++ tags/1.0.5/data/application-x-excellon-48.svg (revision 953) @@ -0,0 +1,1283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Excellon file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-excellon.svg =================================================================== --- tags/1.0.5/data/application-x-excellon.svg (nonexistent) +++ tags/1.0.5/data/application-x-excellon.svg (revision 953) @@ -0,0 +1,1289 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Excellon file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-gerber-16.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-gerber-16.png =================================================================== --- tags/1.0.5/data/application-x-gerber-16.png (nonexistent) +++ tags/1.0.5/data/application-x-gerber-16.png (revision 953) Property changes on: tags/1.0.5/data/application-x-gerber-16.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-gerber-16.svg =================================================================== --- tags/1.0.5/data/application-x-gerber-16.svg (nonexistent) +++ tags/1.0.5/data/application-x-gerber-16.svg (revision 953) @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Gerber file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-gerber-22.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-gerber-22.png =================================================================== --- tags/1.0.5/data/application-x-gerber-22.png (nonexistent) +++ tags/1.0.5/data/application-x-gerber-22.png (revision 953) Property changes on: tags/1.0.5/data/application-x-gerber-22.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-gerber-22.svg =================================================================== --- tags/1.0.5/data/application-x-gerber-22.svg (nonexistent) +++ tags/1.0.5/data/application-x-gerber-22.svg (revision 953) @@ -0,0 +1,608 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Gerber file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-gerber-24.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-gerber-24.png =================================================================== --- tags/1.0.5/data/application-x-gerber-24.png (nonexistent) +++ tags/1.0.5/data/application-x-gerber-24.png (revision 953) Property changes on: tags/1.0.5/data/application-x-gerber-24.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-gerber-32.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-gerber-32.png =================================================================== --- tags/1.0.5/data/application-x-gerber-32.png (nonexistent) +++ tags/1.0.5/data/application-x-gerber-32.png (revision 953) Property changes on: tags/1.0.5/data/application-x-gerber-32.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-gerber-32.svg =================================================================== --- tags/1.0.5/data/application-x-gerber-32.svg (nonexistent) +++ tags/1.0.5/data/application-x-gerber-32.svg (revision 953) @@ -0,0 +1,544 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Gerber file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-gerber-48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-gerber-48.png =================================================================== --- tags/1.0.5/data/application-x-gerber-48.png (nonexistent) +++ tags/1.0.5/data/application-x-gerber-48.png (revision 953) Property changes on: tags/1.0.5/data/application-x-gerber-48.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-gerber-48.svg =================================================================== --- tags/1.0.5/data/application-x-gerber-48.svg (nonexistent) +++ tags/1.0.5/data/application-x-gerber-48.svg (revision 953) @@ -0,0 +1,707 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Gerber file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-gerber.svg =================================================================== --- tags/1.0.5/data/application-x-gerber.svg (nonexistent) +++ tags/1.0.5/data/application-x-gerber.svg (revision 953) @@ -0,0 +1,712 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Gerber file + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-footprint-16.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-footprint-16.png =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-16.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-16.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-footprint-16.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-footprint-16.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-16.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-16.svg (revision 953) @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB footprint + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-footprint-22.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-footprint-22.png =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-22.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-22.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-footprint-22.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-footprint-22.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-22.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-22.svg (revision 953) @@ -0,0 +1,573 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB footprint + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-footprint-24.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-footprint-24.png =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-24.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-24.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-footprint-24.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-footprint-32.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-footprint-32.png =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-32.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-32.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-footprint-32.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-footprint-32.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-32.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-32.svg (revision 953) @@ -0,0 +1,2302 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB footprint + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-footprint-48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-footprint-48.png =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-48.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-48.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-footprint-48.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-footprint-48.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint-48.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint-48.svg (revision 953) @@ -0,0 +1,674 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB footprint + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-footprint.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-footprint.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-footprint.svg (revision 953) @@ -0,0 +1,680 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB footprint + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-layout-16.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-layout-16.png =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-16.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-16.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-layout-16.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-layout-16.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-16.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-16.svg (revision 953) @@ -0,0 +1,1333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB layout + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-layout-22.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-layout-22.png =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-22.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-22.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-layout-22.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-layout-22.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-22.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-22.svg (revision 953) @@ -0,0 +1,1423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB layout + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-layout-24.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-layout-24.png =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-24.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-24.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-layout-24.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-layout-32.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-layout-32.png =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-32.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-32.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-layout-32.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-layout-32.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-32.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-32.svg (revision 953) @@ -0,0 +1,1362 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB layout + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-layout-48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-layout-48.png =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-48.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-48.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-layout-48.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-layout-48.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-layout-48.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout-48.svg (revision 953) @@ -0,0 +1,1341 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB layout + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-layout.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-layout.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-layout.svg (revision 953) @@ -0,0 +1,1346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB layout + + + + + + + Peter Clifton, Tomaz Solc, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-netlist-16.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-netlist-16.png =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-16.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-16.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-netlist-16.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-netlist-16.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-16.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-16.svg (revision 953) @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB netlist + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-netlist-22.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-netlist-22.png =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-22.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-22.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-netlist-22.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-netlist-22.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-22.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-22.svg (revision 953) @@ -0,0 +1,567 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB netlist + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-netlist-24.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-netlist-24.png =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-24.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-24.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-netlist-24.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-netlist-32.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-netlist-32.png =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-32.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-32.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-netlist-32.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-netlist-32.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-32.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-32.svg (revision 953) @@ -0,0 +1,1310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB netlist + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-netlist-48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/application-x-pcb-netlist-48.png =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-48.png (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-48.png (revision 953) Property changes on: tags/1.0.5/data/application-x-pcb-netlist-48.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/application-x-pcb-netlist-48.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist-48.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist-48.svg (revision 953) @@ -0,0 +1,451 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB netlist + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/application-x-pcb-netlist.svg =================================================================== --- tags/1.0.5/data/application-x-pcb-netlist.svg (nonexistent) +++ tags/1.0.5/data/application-x-pcb-netlist.svg (revision 953) @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + PCB netlist + + + + + + + Peter Clifton, Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/icon-theme-installer =================================================================== --- tags/1.0.5/data/icon-theme-installer (nonexistent) +++ tags/1.0.5/data/icon-theme-installer (revision 953) @@ -0,0 +1,183 @@ +#!/bin/sh + +# icon-theme-installer +# Copyright (C) 2006 Novell, Inc. +# Written by Aaron Bockover +# Licensed under the MIT/X11 license +# +# Modified by Peter Clifton to allow icons with numerals in the filename +# +# This script is meant to be invoked from within a Makefile/Makefile.am +# in the install-data-local and uninstall-data sections. It handles the +# task of properly installing icons into the icon theme. It requires a +# few arguments to set up its environment, and a list of files to be +# installed. The format of the file list is critical: +# +# , +# +# apps,music-player-banshee.svg +# apps,music-player-banshee-16.png +# apps,music-player-banshee-22.png +# +# is the icon theme category, for instance, apps, devices, +# actions, emblems... +# +# must have a basename in the form of: +# +# proper-theme-name[-]. +# +# Where should be either nothing, which will default to scalable +# or \-[0-9]{2}, which will expand to x. For example: +# +# music-player-banshee-16.png +# +# The here is -16 and will expand to 16x16 per the icon theme spec +# +# What follows is an example Makefile.am for icon theme installation: +# +# --------------- +# theme=hicolor +# themedir=$(datadir)/icons/$(theme) +# theme_icons = \ +# apps,music-player-banshee.svg \ +# apps,music-player-banshee-16.png \ +# apps,music-player-banshee-22.png \ +# apps,music-player-banshee-24.png \ +# apps,music-player-banshee-32.png +# +# install_icon_exec = $(top_srcdir)/build/icon-theme-installer -t $(theme) -s $(srcdir) -d "x$(DESTDIR)" -b $(themedir) -m "$(mkinstalldirs)" -x "$(INSTALL_DATA)" +# install-data-local: +# $(install_icon_exec) -i $(theme_icons) +# +# uninstall-hook: +# $(install_icon_exec) -u $(theme_icons) +# +# MAINTAINERCLEANFILES = Makefile.in +# EXTRA_DIST = $(wildcard *.svg *.png) +# --------------- +# +# Arguments to this program: +# +# -i : Install +# -u : Uninstall +# -t : Theme name (hicolor) +# -b : Theme installation dest directory [x$(DESTDIR)] - Always prefix +# this argument with x; it will be stripped but will act as a +# placeholder for zero $DESTDIRs (only set by packagers) +# -d : Theme installation directory [$(hicolordir)] +# -s : Source directory [$(srcdir)] +# -m : Command to exec for directory creation [$(mkinstalldirs)] +# -x : Command to exec for single file installation [$(INSTALL_DATA)] +# : All remainging should be category,filename pairs + +while getopts "iut:b:d:s:m:x:" flag; do + case "$flag" in + i) INSTALL=yes ;; + u) UNINSTALL=yes ;; + t) THEME_NAME=$OPTARG ;; + d) INSTALL_DEST_DIR="`echo $OPTARG | sed 's;^x;;'`" ;; + b) INSTALL_BASE_DIR=$OPTARG ;; + s) SRC_DIR=$OPTARG ;; + m) MKINSTALLDIRS_EXEC=$OPTARG ;; + x) INSTALL_DATA_EXEC=$OPTARG ;; + esac +done + +shift `expr $OPTIND - 1` + +if test "x$INSTALL" = "xyes" -a "x$UNINSTALL" = "xyes"; then + echo "Cannot pass both -i and -u" + exit 1 +elif test "x$INSTALL" = "x" -a "x$UNINSTALL" = "x"; then + echo "Must path either -i or -u" + exit 1 +fi + +if test -z "$THEME_NAME"; then + echo "Theme name required (-t hicolor)" + exit 1 +fi + +if test -z "$INSTALL_BASE_DIR"; then + echo "Base theme directory required [-d \$(hicolordir)]" + exit 1 +fi + +#if test ! -x `echo "$MKINSTALLDIRS_EXEC" | cut -f1 -d' '`; then +# echo "Cannot find '$MKINSTALLDIRS_EXEC'; You probably want to pass -m \$(mkinstalldirs)" +# exit 1 +#fi + +#if test ! -x `echo "$INSTALL_DATA_EXEC" | cut -f1 -d' '`; then +# echo "Cannot find '$INSTALL_DATA_EXEC'; You probably want to pass -x \$(INSTALL_DATA)" +# exit 1 +#fi + +if test -z "$SRC_DIR"; then + SRC_DIR=. +fi + +for icon in $@; do + size=`echo $icon | sed -n 's/.*-\([0-9]*\).*/\1/p'` + category=`echo $icon | cut -d, -f1` + build_name=`echo $icon | cut -d, -f2` + install_name=`echo $build_name | sed 's/-[0-9]\+//g'` + install_name=`basename $install_name` + + if test -z $size; then + size=scalable; + else + size=${size}x${size}; + fi + + install_dir=${INSTALL_DEST_DIR}${INSTALL_BASE_DIR}/$size/$category + install_path=$install_dir/$install_name + + if test "x$INSTALL" = "xyes"; then + echo "Installing $size $install_name into $THEME_NAME icon theme" + + $MKINSTALLDIRS_EXEC $install_dir || { + echo "Failed to create directory $install_dir" + exit 1 + } + + $INSTALL_DATA_EXEC $SRC_DIR/$build_name $install_path || { + echo "Failed to install $SRC_DIR/$build_name into $install_path" + exit 1 + } + + if test ! -e $install_path; then + echo "Failed to install $SRC_DIR/$build_name into $install_path" + exit 1 + fi + else + if test -e $install_path; then + echo "Removing $size $install_name from $THEME_NAME icon theme" + + rm $install_path || { + echo "Failed to remove $install_path" + exit 1 + } + fi + fi +done + +if test "x$INSTALL" = "xyes"; then + gtk_update_icon_cache_bin="`(which gtk-update-icon-cache || echo /opt/gnome/bin/gtk-update-icon-cache)2>/dev/null`" + gtk_update_icon_cache_bin="${GTK_UPDATE_ICON_CACHE_BIN:-$gtk_update_icon_cache_bin}" + + gtk_update_icon_cache="$gtk_update_icon_cache_bin -f -t $INSTALL_BASE_DIR" + + if test -z "$INSTALL_DEST_DIR"; then + if test -x $gtk_update_icon_cache_bin; then + echo "Updating GTK icon cache" + $gtk_update_icon_cache + else + echo "*** Icon cache not updated. Could not execute $gtk_update_icon_cache_bin" + fi + else + echo "*** Icon cache not updated. After install, run this:" + echo "*** $gtk_update_icon_cache" + fi +fi + Property changes on: tags/1.0.5/data/icon-theme-installer ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/data/pcb-48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/pcb-48.png =================================================================== --- tags/1.0.5/data/pcb-48.png (nonexistent) +++ tags/1.0.5/data/pcb-48.png (revision 953) Property changes on: tags/1.0.5/data/pcb-48.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/pcb.desktop =================================================================== --- tags/1.0.5/data/pcb.desktop (nonexistent) +++ tags/1.0.5/data/pcb.desktop (revision 953) @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=PCB Designer +GenericName=PCB Design +Comment=Create and edit printed circuit board designs +Type=Application +Exec=pcb %f +Icon=pcb +MimeType=application/x-pcb-layout;application/x-pcb-footprint; +Categories=Engineering;Electronics; Index: tags/1.0.5/data/pcb.svg =================================================================== --- tags/1.0.5/data/pcb.svg (nonexistent) +++ tags/1.0.5/data/pcb.svg (revision 953) @@ -0,0 +1,1070 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Lapo Calamandrei + + + + Text editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: tags/1.0.5/data/pcb.xml =================================================================== --- tags/1.0.5/data/pcb.xml (nonexistent) +++ tags/1.0.5/data/pcb.xml (revision 953) @@ -0,0 +1,40 @@ + + + + + PCB layout + + + + + + + + PCB footprint + + + + + + + + PCB netlist + + + + + Gerber file + + + + + + + + Excellon drill file + + + + + + Index: tags/1.0.5/data/pcb_icon.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/data/pcb_icon.ico =================================================================== --- tags/1.0.5/data/pcb_icon.ico (nonexistent) +++ tags/1.0.5/data/pcb_icon.ico (revision 953) Property changes on: tags/1.0.5/data/pcb_icon.ico ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/data/regen_files =================================================================== --- tags/1.0.5/data/regen_files (nonexistent) +++ tags/1.0.5/data/regen_files (revision 953) @@ -0,0 +1,165 @@ +#!/bin/sh +# + +CONVERT=${CONVERT:-convert} +COMPOSITE=${COMPOSITE:-composite} +INKSCAPE=${INKSCAPE:-inkscape} +PPMTOWINICON=${PPMTOWINICON:-ppmtowinicon} + +do_inkscape=yes +do_convert=yes +do_winicon=yes + +usage() { +cat << EOF + +$0 -- Regenerate desktop icon files and windows icon files + +Options + + --help Displays this message and exits + + --skip-png Skips the regeneration of the .png file(s) + + --skip-winicon Skips the regneration of the Windows icon file(s) + +EOF + +} + +while test $# -ne 0 ; do + case $1 in + --help) + usage + exit 0 + ;; + + --skip-png) + do_inkscape=no + shift + ;; + + --skip-winicon) + do_convert=no + do_winicon=no + shift + ;; + + -*) + echo "$0: Unknown option $1" + usage + exit 1 + ;; + + *) + break + ;; + esac +done + +if test $? -ne 0 ; then + usage + exit 1 +fi + +## +## Export the SVG graphics +## + +# see if we have inkscape +if test $do_inkscape = yes ; then +${INKSCAPE} --version 2>&1 >/dev/null +if test $? -ne 0 ; then + echo "\"${INKSCAPE} --version\" failed." + echo "Make sure that inkscape is installed and functional on your system." + echo "Skipping the SVG -> PNG conversion." + do_inkscape=no +fi +fi + +if test $do_inkscape = yes ; then + echo "Export SVG graphics to png..." + + for r in 16 22 24 32 48 ; do + case ${r} in + 24) + x=-1 + y=23 + rs=22 + ;; + *) + x=0 + y=${r} + rs=${r} + ;; + esac + for f in *-${rs}.svg ; do + fb=`basename ${f} ${rs}.svg` + p="${fb}${r}.png" + echo "${f} -> ${p}" + ${INKSCAPE} --export-png=${p} --export-area=${x}:${x}:${y}:${y} ${f} + done + done +fi + +## +## Generate the windows icon file +## + +app_icon="application-x-pcb-layout" + +if test $do_convert = yes ; then +# see if we have ImageMagick +${CONVERT} --version 2>&1 >/dev/null +if test $? -ne 0 ; then + echo "\"${CONVERT} --version\" failed." + echo "Make sure that ImageMagick is installed and functional on your system." + echo "Skipping the PNG -> PPM conversion." + do_convert=no +fi +fi + +if test $do_convert = yes ; then +echo "Creating windows pbm mask files..." +${CONVERT} -channel matte -separate +matte ${app_icon}-48.png - | + ${CONVERT} -threshold 65534 -negate - 48_mask.pbm +${CONVERT} -channel matte -separate +matte ${app_icon}-32.png - | + ${CONVERT} -threshold 65534 -negate - 32_mask.pbm +${CONVERT} -channel matte -separate +matte ${app_icon}-16.png - | + ${CONVERT} -threshold 65534 -negate - 16_mask.pbm + +echo "Creating windows ppm flattened files..." +${CONVERT} -flatten -colors 16 ${app_icon}-48.png 48_16.ppm +${CONVERT} -flatten -colors 256 ${app_icon}-48.png 48_256.ppm +${CONVERT} -flatten -colors 16 ${app_icon}-32.png 32_16.ppm +${CONVERT} -flatten -colors 256 ${app_icon}-32.png 32_256.ppm +${CONVERT} -flatten -colors 16 ${app_icon}-16.png 16_16.ppm +${CONVERT} -flatten -colors 256 ${app_icon}-16.png 16_256.ppm +fi + +# see if we have netpbm +if test $do_winicon = yes ; then +${PPMTOWINICON} --version 2>&1 >/dev/null +if test $? -ne 0 ; then + echo "\"${PPMTOWINICON} --version\" failed." + echo "Make sure that netpbm is installed and functional on your system." + echo "Skipping the pbm -> windows icon conversion." + do_winicon=no +fi +fi + +if test $do_winicon = yes ; then +echo "Creating windows icon file..." +${PPMTOWINICON} -output pcb_icon.ico -andpgms\ + 48_16.ppm 48_mask.pbm 48_256.ppm 48_mask.pbm\ + 32_16.ppm 32_mask.pbm 32_256.ppm 32_mask.pbm\ + 16_16.ppm 16_mask.pbm 16_256.ppm 16_mask.pbm +fi + +rm -f \ + 48_16.ppm 48_256.ppm 48_mask.pbm\ + 32_16.ppm 32_256.ppm 32_mask.pbm\ + 16_16.ppm 16_256.ppm 16_mask.pbm + +echo "All done" + Property changes on: tags/1.0.5/data/regen_files ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/data/x-excellon.desktop =================================================================== --- tags/1.0.5/data/x-excellon.desktop (nonexistent) +++ tags/1.0.5/data/x-excellon.desktop (revision 953) @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Comment=Excellon drill file +MimeType=application/x-excellon +Type=MimeType +Icon=application-x-excellon +Patterns=*.cnc +X-KDE-IsAlso=text/plain Index: tags/1.0.5/data/x-gerber.desktop =================================================================== --- tags/1.0.5/data/x-gerber.desktop (nonexistent) +++ tags/1.0.5/data/x-gerber.desktop (revision 953) @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Comment=Gerber file +MimeType=application/x-gerber +Type=MimeType +Icon=application-x-gerber +Patterns=*.gbr +X-KDE-IsAlso=text/plain Index: tags/1.0.5/data/x-pcb-footprint.desktop =================================================================== --- tags/1.0.5/data/x-pcb-footprint.desktop (nonexistent) +++ tags/1.0.5/data/x-pcb-footprint.desktop (revision 953) @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Comment=PCB footprint +MimeType=application/x-pcb-footprint +Type=MimeType +Icon=application-x-pcb-footprint +Patterns=*.fp +X-KDE-IsAlso=text/plain Index: tags/1.0.5/data/x-pcb-layout.desktop =================================================================== --- tags/1.0.5/data/x-pcb-layout.desktop (nonexistent) +++ tags/1.0.5/data/x-pcb-layout.desktop (revision 953) @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Comment=PCB layout +MimeType=application/x-pcb-layout +Type=MimeType +Icon=application-x-pcb-layout +Patterns=*.pcb +X-KDE-IsAlso=text/plain Index: tags/1.0.5/data/x-pcb-netlist.desktop =================================================================== --- tags/1.0.5/data/x-pcb-netlist.desktop (nonexistent) +++ tags/1.0.5/data/x-pcb-netlist.desktop (revision 953) @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Comment=PCB netlist +MimeType=application/x-pcb-netlist +Type=MimeType +Icon=application-x-pcb-netlist +Patterns=*.net +X-KDE-IsAlso=text/plain Index: tags/1.0.5/debian/README.Debian =================================================================== --- tags/1.0.5/debian/README.Debian (nonexistent) +++ tags/1.0.5/debian/README.Debian (revision 953) @@ -0,0 +1,17 @@ +PCB for Debian +-------------- + +Documentation for PCB is available in several forms: + + - Info ('info pcb') + + - Manual page ('man pcb') + + - PDF (pcb.pdf and refcard.pdf) + + - HTML (/usr/share/doc/pcb/html/index.html) + +Information about PCB is available online at http://pcb.sourceforge.net/ + +Hamish Moffatt , based on original by +Hartmut Koptein , Wed, 9 Jul 1997 02:50:56 +0200 Index: tags/1.0.5/debian/README.source =================================================================== --- tags/1.0.5/debian/README.source (nonexistent) +++ tags/1.0.5/debian/README.source (revision 953) @@ -0,0 +1,3 @@ +The used patch system is quilt. + +See /usr/share/doc/quilt/README.source for more information. Index: tags/1.0.5/debian/changelog =================================================================== --- tags/1.0.5/debian/changelog (nonexistent) +++ tags/1.0.5/debian/changelog (revision 953) @@ -0,0 +1,39 @@ +pcb-rnd (1.0.4-r951) unstable; urgency=low + + * New upstream release (1.0.5) + + -- Tibor Palinkas Sat, 24 Oct 2015 16:55:56 +0200 + +pcb-rnd (1.0.4-r944) unstable; urgency=low + + * New upstream release (1.0.4) + + -- Tibor Palinkas Sun, 11 Oct 2015 10:50:20 +0200 + +pcb-rnd (1.0.3-r880) unstable; urgency=low + + * New upstream release (1.0.3) + + -- Tibor Palinkas Sun, 30 Aug 2015 07:55:42 +0200 + +pcb-rnd (1.0.2-r492) unstable; urgency=low + + * New upstream release (1.0.2) + + -- Tibor Palinkas Wed, 29 Jul 2015 08:39:30 +0200 + +pcb-rnd (1.0.1-r431) unstable; urgency=low + + * New upstream release (1.0.1) + + -- Tibor Palinkas Sat, 25 Jul 2015 11:46:44 +0200 + + +pcb-rnd (1.0.0-r84) unstable; urgency=low + + * First release (1.0.0) of the fork + + -- Tibor Palinkas Sat, 07 Sep 2013 05:35:02 +0200 + + + Index: tags/1.0.5/debian/compat =================================================================== --- tags/1.0.5/debian/compat (nonexistent) +++ tags/1.0.5/debian/compat (revision 953) @@ -0,0 +1 @@ +9 Index: tags/1.0.5/debian/control =================================================================== --- tags/1.0.5/debian/control (nonexistent) +++ tags/1.0.5/debian/control (revision 953) @@ -0,0 +1,46 @@ +Source: pcb-rnd +Section: electronics +Priority: optional +Maintainer: Tibor Palinkas +Build-Depends: debhelper (>= 9), bison, flex, libgtkglext1-dev, tk8.5, libgd-dev, libdbus-1-dev, libmotif-dev, libxmu-dev, libxml-parser-perl, intltool, imagemagick, gerbv +Homepage: http://repo.hu/projects/pcb-rnd +Vcs-Svn: svn://repo.hu/pcb-rnd/trunk + +Package: pcb-rnd +Architecture: all +Depends: ${misc:Depends}, pcb-rnd-gtk, pcb-rnd-common +Description: printed circuit board (pcb) design program - meta-package + PCB is an interactive printed circuit board editor for the X11 window + system. PCB includes a rats nest feature, design rule checking, and can + provide industry standard RS-274-X (Gerber), NC drill, and centroid data + (X-Y data) output for use in the board fabrication and assembly process. + PCB offers high end features such as an autorouter and trace optimizer + which can tremendously reduce layout time. + +Package: pcb-rnd-common +Architecture: all +Replaces: pcb +Depends: ${misc:Depends}, m4, tk8.5 | wish, tcl8.5 | tclsh, pcb-rnd-gtk +Recommends: extra-xdg-menus +Description: printed circuit board (pcb) design program - common files + PCB is an interactive printed circuit board editor for the X11 window + system. PCB includes a rats nest feature, design rule checking, and can + provide industry standard RS-274-X (Gerber), NC drill, and centroid data + (X-Y data) output for use in the board fabrication and assembly process. + PCB offers high end features such as an autorouter and trace optimizer + which can tremendously reduce layout time. + . + This package contains the common files. + +Package: pcb-rnd-gtk +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, pcb-rnd-common +Description: printed circuit board (pcb) design program - GTK+ interface + PCB is an interactive printed circuit board editor for the X11 window + system. PCB includes a rats nest feature, design rule checking, and can + provide industry standard RS-274-X (Gerber), NC drill, and centroid data + (X-Y data) output for use in the board fabrication and assembly process. + PCB offers high end features such as an autorouter and trace optimizer + which can tremendously reduce layout time. + . + This package contains the GTK+ user-interface for pcb. Index: tags/1.0.5/debian/copyright =================================================================== --- tags/1.0.5/debian/copyright (nonexistent) +++ tags/1.0.5/debian/copyright (revision 953) @@ -0,0 +1,44 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 +Upstream-Name: pcb +Upstream-Contact: harry eaton +Source: http://pcb.gpleda.org + + +Files: * +Copyright: 1994-1997,2010 Thomas Nau + 1998-2007,2009 harry eaton + 2001 C. Scott Ananian + 2003-2008 DJ Delorie + 2009-2011 PCB Contributers (See ChangeLog for details) + 2009 Anthony Blake + 2011 Andrew Poelstra + 2010 Alberto Maccioni + 2003-2010 Dan McMahill +License: GPL-2+ + +Files: debian/* +Copyright: 2003-2008 Hamish Moffatt + 1996 Michael Mattice + 1997-1999 Hartmut Koptein + 2009-2013 أحمد المحمودي (Ahmed El-Mahmoudy) +License: GPL-2+ + +License: GPL-2+ + 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. + . + On Debian systems, the complete text of the GNU GPL2 licenses can be found at + `/usr/share/common-licenses/GPL-2'. + Index: tags/1.0.5/debian/patches/0001-Fixed-command-line-batch-output-for-some-exporters.patch =================================================================== --- tags/1.0.5/debian/patches/0001-Fixed-command-line-batch-output-for-some-exporters.patch (nonexistent) +++ tags/1.0.5/debian/patches/0001-Fixed-command-line-batch-output-for-some-exporters.patch (revision 953) @@ -0,0 +1,17 @@ +Description: Fixed command line batch output for some exporters +Author: Vladimir Zhbanov +Origin: http://git.geda-project.org/pcb/commit/?id=63068cafd8da99b442c87aa084944faaacf81cfc +Bug: https://bugs.launchpad.net/pcb/+bug/905968 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/pcb/+bug/988503 + +--- a/src/main.c ++++ b/src/main.c +@@ -1931,6 +1931,8 @@ + + if (gui->printer || gui->exporter) + { ++ // Workaround to fix batch output for non-C locales ++ setlocale(LC_NUMERIC,"C"); + gui->do_export (0); + exit (0); + } Index: tags/1.0.5/debian/patches/default_GtkFileChooser_cwd.diff =================================================================== --- tags/1.0.5/debian/patches/default_GtkFileChooser_cwd.diff (nonexistent) +++ tags/1.0.5/debian/patches/default_GtkFileChooser_cwd.diff (revision 953) @@ -0,0 +1,55 @@ +Description: Set default path in GTK file choosers to cwd +Author: أحمد المحمودي (Ahmed El-Mahmoudy) +Bug: https://bugs.launchpad.net/pcb/+bug/855621 +Bug-Debian: http://bugs.debian.org/642060 +Forwarded: https://bugs.launchpad.net/pcb/+bug/855621/+attachment/2436146/+files/default_GtkFileChooser_cwd.diff + +--- a/src/hid/gtk/gtkhid-main.c ++++ b/src/hid/gtk/gtkhid-main.c +@@ -11,6 +11,7 @@ + #endif + #include + #include ++#include + + + #include "action.h" +@@ -1230,6 +1231,13 @@ + static gchar *current_layout_dir = NULL; + static gchar *current_netlist_dir = NULL; + ++ if(!current_element_dir) ++ current_element_dir = get_current_dir_name(); ++ if(!current_layout_dir) ++ current_layout_dir = get_current_dir_name(); ++ if(!current_netlist_dir) ++ current_netlist_dir = get_current_dir_name(); ++ + /* we've been given the file name */ + if (argc > 1) + return hid_actionv ("LoadFrom", argc, argv); +@@ -1303,6 +1311,9 @@ + + static gchar *current_dir = NULL; + ++ if(!current_dir) ++ current_dir = get_current_dir_name(); ++ + if (argc > 1) + return hid_actionv ("SaveTo", argc, argv); + +@@ -1986,6 +1997,9 @@ + static int I_am_recursing = 0; + int rv; + ++ if(!current_layout_dir) ++ current_layout_dir = get_current_dir_name(); ++ + if (I_am_recursing) + return 1; + +--- a/po/POTFILES.skip ++++ b/po/POTFILES.skip +@@ -1 +1,2 @@ + .pc/fix_pan_action.diff/src/hid/gtk/gtkhid-main.c ++.pc/default_GtkFileChooser_cwd.diff/src/hid/gtk/gtkhid-main.c Index: tags/1.0.5/debian/patches/disable_hid_png3_test.diff =================================================================== --- tags/1.0.5/debian/patches/disable_hid_png3_test.diff (nonexistent) +++ tags/1.0.5/debian/patches/disable_hid_png3_test.diff (revision 953) @@ -0,0 +1,16 @@ +Description: Disable hid_png3 test + According to upstream, the problem is in the hid_png3 test +Author: أحمد المحمودي (Ahmed El-Mahmoudy) +Forwarded: not-needed +Bug: https://bugs.launchpad.net/bugs/860037 +Bug-Debian: http://bugs.debian.org/642923 +--- a/tests/tests.list ++++ b/tests/tests.list +@@ -161,6 +161,6 @@ + # + hid_png1 | gerber_oneline.pcb | png | | | png:gerber_oneline.png + hid_png2 | gerber_oneline.pcb | png | --outfile myfile.png | | png:myfile.png +-hid_png3 | gerber_oneline.pcb | png | --dpi 300 | | png:gerber_oneline.png ++#hid_png3 | gerber_oneline.pcb | png | --dpi 300 | | png:gerber_oneline.png + # + Index: tags/1.0.5/debian/patches/drop_check_global_included.patch =================================================================== --- tags/1.0.5/debian/patches/drop_check_global_included.patch (nonexistent) +++ tags/1.0.5/debian/patches/drop_check_global_included.patch (revision 953) @@ -0,0 +1,21 @@ +Description: Drop the #if check for the declaration of hid_get_extents() +Author: Michael Bienia +Bug: https://bugs.launchpad.net/pcb/+bug/1002964 +Forwarded: https://bugs.launchpad.net/pcb/+bug/1002964/+attachment/3158021/+files/drop_check_global_included.patch +Index: pcb-20110918/src/hid/hidint.h +=================================================================== +--- pcb-20110918.orig/src/hid/hidint.h 2011-05-20 06:36:57.000000000 +0200 ++++ pcb-20110918/src/hid/hidint.h 2012-05-20 16:03:09.000000000 +0200 +@@ -64,12 +64,8 @@ + /* Returns a filename base that can be used to output the layer. */ + const char *layer_type_to_file_name (int idx, int style); + +-#ifdef __GLOBAL_INCLUDED__ +- + /* Convenience function that calls the expose callback for the item, + and returns the extents of what was drawn. */ + BoxType *hid_get_extents (void *item); + +-#endif +- + void derive_default_filename(const char *pcbfile, HID_Attribute *filename_attrib, const char *suffix, char **memory); Index: tags/1.0.5/debian/patches/fix_CPPFLAGS.diff =================================================================== --- tags/1.0.5/debian/patches/fix_CPPFLAGS.diff (nonexistent) +++ tags/1.0.5/debian/patches/fix_CPPFLAGS.diff (revision 953) @@ -0,0 +1,26 @@ +Description: Append input CPPFLAGS for lesstif target +Author: أحمد المحمودي (Ahmed El-Mahmoudy) +Bug: https://bugs.launchpad.net/pcb/+bug/1003355 +Forwarded: https://bugs.launchpad.net/pcb/+bug/1003355/+attachment/3159260/+files/fix_CPPFLAGS.diff +--- a/configure ++++ b/configure +@@ -15260,7 +15260,7 @@ + + fi + +- CPPFLAGS="$CFLAGS $X_CFLAGS" ++ CPPFLAGS="$CPPFLAGS $CFLAGS $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 + $as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } + if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then : +--- a/configure.ac ++++ b/configure.ac +@@ -710,7 +710,7 @@ + case $e in + lesstif ) + AC_PATH_XTRA +- CPPFLAGS="$CFLAGS $X_CFLAGS" ++ CPPFLAGS="$CPPFLAGS $CFLAGS $X_CFLAGS" + AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS) + AC_CHECK_LIB(ICE, main, , , $X_LIBS) + AC_CHECK_LIB(SM, main, , , $X_LIBS) Index: tags/1.0.5/debian/patches/fix_pan_action.diff =================================================================== --- tags/1.0.5/debian/patches/fix_pan_action.diff (nonexistent) +++ tags/1.0.5/debian/patches/fix_pan_action.diff (revision 953) @@ -0,0 +1,28 @@ +Description: Fix Pan action to stop after button release outside window master + Previously, we required in-view coordinates to stop and start the + pan-action, and when the button was released outside the viewport, + the code was querying the user to click at a particular location. + + Since the pan action doesn't even use the passed in coordinates, + simply remove the requirement for the x-y coordinates from this + action. +Origin: http://git.gpleda.org/?p=pcb.git;a=commit;h=ed9a9d0cd9d054e6fc4a075ec1b8d9a12f1cb376 +Author: Peter Clifton [Mon, 19 Sep 2011 10:16:49 +0000 (11:16 +0100)] +Bug: https://launchpad.net/bugs/699307 +Bug-Debian: http://bugs.debian.org/562641 + +--- a/src/hid/gtk/gtkhid-main.c ++++ b/src/hid/gtk/gtkhid-main.c +@@ -2030,7 +2030,7 @@ + {"LayerGroupsChanged", 0, LayerGroupsChanged}, + {"LibraryChanged", 0, LibraryChanged}, + {"Load", 0, Load}, +- {"Pan", N_("Click on a place to pan"), PanAction, pan_help, pan_syntax}, ++ {"Pan", 0, PanAction, pan_help, pan_syntax}, + {"PCBChanged", 0, PCBChanged}, + {"PointCursor", 0, PointCursor}, + {"Popup", 0, Popup, popup_help, popup_syntax}, +--- /dev/null ++++ b/po/POTFILES.skip +@@ -0,0 +1 @@ ++.pc/fix_pan_action.diff/src/hid/gtk/gtkhid-main.c Index: tags/1.0.5/debian/patches/fix_typo.diff =================================================================== --- tags/1.0.5/debian/patches/fix_typo.diff (nonexistent) +++ tags/1.0.5/debian/patches/fix_typo.diff (revision 953) @@ -0,0 +1,16 @@ +Description: Fix typo (recieved -> received) +Author: أحمد المحمودي (Ahmed El-Mahmoudy) +Bug: https://bugs.launchpad.net/pcb/+bug/855398 +Forwarded: https://bugs.launchpad.net/pcb/+bug/855398/+attachment/2435156/+files/fix_typo.diff + +--- a/src/hid/common/hidgl.c ++++ b/src/hid/common/hidgl.c +@@ -521,7 +521,7 @@ + } + } + else +- printf ("Vertex recieved with unknown type\n"); ++ printf ("Vertex received with unknown type\n"); + } + + void Index: tags/1.0.5/debian/patches/outdated_config.diff =================================================================== --- tags/1.0.5/debian/patches/outdated_config.diff (nonexistent) +++ tags/1.0.5/debian/patches/outdated_config.diff (revision 953) @@ -0,0 +1,24 @@ +Description: Patch config.{sub,guess} to call their up-to-date versions. +Author: أحمد المحمودي (Ahmed El-Mahmoudy) +--- a/config.guess ++++ b/config.guess +@@ -1,4 +1,8 @@ + #! /bin/sh ++if [ -x /usr/share/misc/config.guess ]; then ++ exec /usr/share/misc/config.guess "$@" ++fi ++ + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +--- a/config.sub ++++ b/config.sub +@@ -1,4 +1,8 @@ + #! /bin/sh ++if [ -x /usr/share/misc/config.sub ]; then ++ exec /usr/share/misc/config.sub "$@" ++fi ++ + # Configuration validation subroutine script. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Index: tags/1.0.5/debian/patches/pcbtest_paths.diff =================================================================== --- tags/1.0.5/debian/patches/pcbtest_paths.diff (nonexistent) +++ tags/1.0.5/debian/patches/pcbtest_paths.diff (revision 953) @@ -0,0 +1,15 @@ +Description: lib/pcblib-newlib is in TOPSRCDIR not in TOP_BUILDDIR +Author: أحمد المحمودي (Ahmed El-Mahmoudy) +Bug: https://bugs.launchpad.net/pcb/+bug/855405 +Forwarded: https://bugs.launchpad.net/pcb/+bug/855405/+attachment/2435173/+files/pcbtest_paths.diff +--- a/src/pcbtest.sh.in ++++ b/src/pcbtest.sh.in +@@ -37,7 +37,7 @@ + # Use --g-fatal-warnings with the gtk HID to cause gtk-WARNING's to + # abort. + +-TEST_PATHS="--lib-path @TOP_BUILDDIR@/lib --lib-newlib @TOPSRCDIR@/newlib:@TOP_BUILDDIR@/lib/pcblib-newlib --element-path @TOP_BUILDDIR@/lib --font-path @TOPSRCDIR@/src" ++TEST_PATHS="--lib-path @TOP_BUILDDIR@/lib --lib-newlib @TOPSRCDIR@/newlib:@TOPSRCDIR@/lib/pcblib-newlib --element-path @TOP_BUILDDIR@/lib --font-path @TOPSRCDIR@/src" + TEST_CMDS="--lib-command-dir @TOP_BUILDDIR@/lib" + + # note: To do command line exporting, pcb requires the "-x " command to appear first. For example Index: tags/1.0.5/debian/patches/series =================================================================== --- tags/1.0.5/debian/patches/series (nonexistent) +++ tags/1.0.5/debian/patches/series (revision 953) @@ -0,0 +1,9 @@ +fix_typo.diff +outdated_config.diff +fix_pan_action.diff +pcbtest_paths.diff +default_GtkFileChooser_cwd.diff +disable_hid_png3_test.diff +0001-Fixed-command-line-batch-output-for-some-exporters.patch +drop_check_global_included.patch +fix_CPPFLAGS.diff Index: tags/1.0.5/debian/pcb-rnd-common.dirs =================================================================== --- tags/1.0.5/debian/pcb-rnd-common.dirs (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-common.dirs (revision 953) @@ -0,0 +1 @@ +usr/share/doc/pcb-common Index: tags/1.0.5/debian/pcb-rnd-common.doc-base =================================================================== --- tags/1.0.5/debian/pcb-rnd-common.doc-base (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-common.doc-base (revision 953) @@ -0,0 +1,20 @@ +Document: pcb +Title: Pcb Manual +Author: harry eaton +Abstract: This document is a manual for Pcb, the interactive printed circuit + board layout system for X11. +Section: Science/Electronics + +Format: HTML +Index: /usr/share/doc/pcb-common/pcb.html +Files: /usr/share/doc/pcb-common/pcb.html + +Format: Info +Index: /usr/share/info/pcb.info.gz +Files: /usr/share/info/pcb.info* + +Format: PDF +Files: /usr/share/doc/pcb-common/pcb.pdf.gz + +Format: DVI +Files: /usr/share/doc/pcb-common/refcard.pdf.gz Index: tags/1.0.5/debian/pcb-rnd-common.docs =================================================================== --- tags/1.0.5/debian/pcb-rnd-common.docs (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-common.docs (revision 953) @@ -0,0 +1,5 @@ +Release_notes +Changelog +doc/*.png +doc/*.pdf +doc/*.html Index: tags/1.0.5/debian/pcb-rnd-common.examples =================================================================== --- tags/1.0.5/debian/pcb-rnd-common.examples (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-common.examples (revision 953) @@ -0,0 +1,2 @@ +example/* +tutorial/* Index: tags/1.0.5/debian/pcb-rnd-common.info =================================================================== --- tags/1.0.5/debian/pcb-rnd-common.info (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-common.info (revision 953) @@ -0,0 +1 @@ +doc/*.info* Index: tags/1.0.5/debian/pcb-rnd-common.install =================================================================== --- tags/1.0.5/debian/pcb-rnd-common.install (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-common.install (revision 953) @@ -0,0 +1,2 @@ +usr/ +debian/pcb.xpm usr/share/pixmaps/ Index: tags/1.0.5/debian/pcb-rnd-common.lintian-overrides =================================================================== --- tags/1.0.5/debian/pcb-rnd-common.lintian-overrides (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-common.lintian-overrides (revision 953) @@ -0,0 +1,3 @@ +# /usr/bin/pcb is an alternative installed by postinst script of either pcb-gtk +# or pcb-lesstiff +pcb-common: desktop-command-not-in-package usr/share/applications/pcb.desktop pcb Index: tags/1.0.5/debian/pcb-rnd-gtk.dirs =================================================================== --- tags/1.0.5/debian/pcb-rnd-gtk.dirs (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-gtk.dirs (revision 953) @@ -0,0 +1 @@ +usr/bin Index: tags/1.0.5/debian/pcb-rnd-gtk.links =================================================================== --- tags/1.0.5/debian/pcb-rnd-gtk.links (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-gtk.links (revision 953) @@ -0,0 +1 @@ +usr/share/man/man1/pcb.1.gz usr/share/man/man1/pcb-gtk.1.gz Index: tags/1.0.5/debian/pcb-rnd-gtk.lintian-overrides =================================================================== --- tags/1.0.5/debian/pcb-rnd-gtk.lintian-overrides (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-gtk.lintian-overrides (revision 953) @@ -0,0 +1,2 @@ +# Not a spelling mistake, ang is for angle +pcb-gtk: spelling-error-in-binary usr/bin/pcb-gtk ang and Index: tags/1.0.5/debian/pcb-rnd-gtk.menu =================================================================== --- tags/1.0.5/debian/pcb-rnd-gtk.menu (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-gtk.menu (revision 953) @@ -0,0 +1,5 @@ +?package(pcb-gtk):needs="x11" section="Applications/Science/Electronics" \ + title="PCB-rnd (GTK+ interface)" \ + longtitle="Printed Circuit Board Design Program" \ + hotkey="P" icon="/usr/share/pixmaps/pcb.xpm" \ + command="/usr/bin/pcb-rnd-gtk" Index: tags/1.0.5/debian/pcb-rnd-gtk.postinst =================================================================== --- tags/1.0.5/debian/pcb-rnd-gtk.postinst (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-gtk.postinst (revision 953) @@ -0,0 +1,22 @@ +#! /bin/sh +set -e + +case "$1" in + configure) + update-alternatives --quiet --install /usr/bin/pcb pcb /usr/bin/pcb-rnd-gtk 20 + update-alternatives --quiet --install /usr/bin/gsch2pcb gsch2pcb /usr/bin/gsch2pcb-rnd 20 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +#DEBHELPER# + +exit 0 Index: tags/1.0.5/debian/pcb-rnd-gtk.prerm =================================================================== --- tags/1.0.5/debian/pcb-rnd-gtk.prerm (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-gtk.prerm (revision 953) @@ -0,0 +1,20 @@ +#! /bin/sh +set -e + +case "$1" in + remove) + update-alternatives --quiet --remove pcb /usr/bin/pcb-gtk + ;; + upgrade|failed-upgrade|deconfigure) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +#DEBHELPER# + +exit 0 + + Index: tags/1.0.5/debian/pcb-rnd-lesstif.dirs =================================================================== --- tags/1.0.5/debian/pcb-rnd-lesstif.dirs (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-lesstif.dirs (revision 953) @@ -0,0 +1 @@ +usr/bin Index: tags/1.0.5/debian/pcb-rnd-lesstif.links =================================================================== --- tags/1.0.5/debian/pcb-rnd-lesstif.links (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-lesstif.links (revision 953) @@ -0,0 +1 @@ +usr/share/man/man1/pcb.1.gz usr/share/man/man1/pcb-lesstif.1.gz Index: tags/1.0.5/debian/pcb-rnd-lesstif.lintian-overrides =================================================================== --- tags/1.0.5/debian/pcb-rnd-lesstif.lintian-overrides (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-lesstif.lintian-overrides (revision 953) @@ -0,0 +1,2 @@ +# Not a spelling mistake, ang is for angle +pcb-lesstif: spelling-error-in-binary usr/bin/pcb-lesstif ang and Index: tags/1.0.5/debian/pcb-rnd-lesstif.menu =================================================================== --- tags/1.0.5/debian/pcb-rnd-lesstif.menu (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-lesstif.menu (revision 953) @@ -0,0 +1,5 @@ +?package(pcb-lesstif):needs="x11" section="Applications/Science/Electronics" \ + title="PCB-rnd (LessTif interface)" \ + longtitle="Printed Circuit Board Design Program" \ + hotkey="P" icon="/usr/share/pixmaps/pcb.xpm" \ + command="/usr/bin/pcb-rnd-lesstif" Index: tags/1.0.5/debian/pcb-rnd-lesstif.postinst =================================================================== --- tags/1.0.5/debian/pcb-rnd-lesstif.postinst (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-lesstif.postinst (revision 953) @@ -0,0 +1,23 @@ +#! /bin/sh +set -e + +case "$1" in + configure) + update-alternatives --quiet --install /usr/bin/pcb pcb /usr/bin/pcb-rnd-lesstif 40 + update-alternatives --quiet --install /usr/bin/gsch2pcb gsch2pcb /usr/bin/gsch2pcb-rnd 20 + ;; + + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +#DEBHELPER# + +exit 0 Index: tags/1.0.5/debian/pcb-rnd-lesstif.prerm =================================================================== --- tags/1.0.5/debian/pcb-rnd-lesstif.prerm (nonexistent) +++ tags/1.0.5/debian/pcb-rnd-lesstif.prerm (revision 953) @@ -0,0 +1,20 @@ +#! /bin/sh +set -e + +case "$1" in + remove) + update-alternatives --quiet --remove pcb /usr/bin/pcb-lesstif + ;; + upgrade|failed-upgrade|deconfigure) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +#DEBHELPER# + +exit 0 + + Index: tags/1.0.5/debian/pcb.xpm =================================================================== --- tags/1.0.5/debian/pcb.xpm (nonexistent) +++ tags/1.0.5/debian/pcb.xpm (revision 953) @@ -0,0 +1,357 @@ +/* XPM */ +static char * pcb_xpm[] = { +"32 32 322 2", +" c None", +". c #3B7305", +"+ c #3B7403", +"@ c #A0C081", +"# c #C5DEAD", +"$ c #C2D9AC", +"% c #C4DDAC", +"& c #C9DFB4", +"* c #3C7303", +"= c #C1D9AB", +"- c #4E9A06", +"; c #50A005", +"> c #57B103", +", c #55AC03", +"' c #4E9B06", +") c #54AA04", +"! c #4F9B06", +"~ c #54A804", +"{ c #B9D79C", +"] c #4C7E1A", +"^ c #D4680C", +"/ c #3A7206", +"( c #C0D7AB", +"_ c #489005", +": c #52A105", +"< c #4C9804", +"[ c #57B003", +"} c #53A803", +"| c #55AC04", +"1 c #478E05", +"2 c #5ABA02", +"3 c #59B602", +"4 c #A9CA8A", +"5 c #5A8A2D", +"6 c #DF8128", +"7 c #FCC068", +"8 c #E99943", +"9 c #387103", +"0 c #C3DBAC", +"a c #5AB902", +"b c #5DC101", +"c c #5EC201", +"d c #56AD04", +"e c #54A904", +"f c #5BBB02", +"g c #59B702", +"h c #9FC878", +"i c #8E842C", +"j c #E08229", +"k c #FCBD60", +"l c #F6A537", +"m c #EDA657", +"n c #D06309", +"o c #397007", +"p c #C3DAAE", +"q c #59B901", +"r c #5FC500", +"s c #5DC100", +"t c #4C9904", +"u c #59B802", +"v c #478F05", +"w c #5AB702", +"x c #A49F48", +"y c #D8842C", +"z c #FCBC5F", +"A c #EC9D47", +"B c #D67420", +"C c #40720F", +"D c #C0DBA6", +"E c #5CBD01", +"F c #5FC300", +"G c #52A604", +"H c #59B502", +"I c #509E05", +"J c #58B203", +"K c #788906", +"L c #D9872E", +"M c #D67520", +"N c #527E25", +"O c #B0CE93", +"P c #5BBE01", +"Q c #4C9A04", +"R c #4A9305", +"S c #58B303", +"T c #4A9604", +"U c #56AE03", +"V c #738105", +"W c #D48427", +"X c #FCBC5E", +"Y c #EC9D46", +"Z c #D77521", +"` c #618939", +" . c #A6CC82", +".. c #62C10A", +"+. c #A5CB80", +"@. c #BAD99C", +"#. c #B9D49D", +"$. c #BCD99E", +"%. c #BAD69E", +"&. c #BCD89E", +"*. c #BBD79E", +"=. c #66A727", +"-. c #F6A538", +";. c #EC9C46", +">. c #D57521", +",. c #71954E", +"'. c #96BF71", +"). c #5CC000", +"!. c #AEDA83", +"~. c #6BAA2F", +"{. c #58AD07", +"]. c #529F0A", +"^. c #56AA08", +"/. c #54A30C", +"(. c #55A706", +"_. c #57A70F", +":. c #61AD1A", +"<. c #AFC995", +"[. c #D48528", +"}. c #D47B2A", +"|. c #AA5D04", +"1. c #7F9F5F", +"2. c #8DBE5F", +"3. c #51A205", +"4. c #BEDF9E", +"5. c #74A844", +"6. c #72A93E", +"7. c #78AA4A", +"8. c #6CA635", +"9. c #7FAC54", +"0. c #65A42C", +"a. c #88AE62", +"b. c #66A42B", +"c. c #B1CE94", +"d. c #CD7921", +"e. c #C2A364", +"f. c #8CA971", +"g. c #7AAD4B", +"h. c #53A704", +"i. c #5FC400", +"j. c #BFDF9F", +"k. c #539317", +"l. c #559D12", +"m. c #55941B", +"n. c #549C10", +"o. c #549319", +"p. c #509A0A", +"q. c #57951E", +"r. c #67A62C", +"s. c #AFA357", +"t. c #CD7920", +"u. c #7C7A03", +"v. c #C1D6AC", +"w. c #9CB682", +"x. c #73AF3B", +"y. c #60C502", +"z. c #BDDD9C", +"A. c #93972D", +"B. c #D98830", +"C. c #818204", +"D. c #C2D8AD", +"E. c #A8C191", +"F. c #619E28", +"G. c #6BC815", +"H. c #AFD789", +"I. c #8D8F1F", +"J. c #DA8833", +"K. c #EC9C45", +"L. c #7B7A03", +"M. c #4C9506", +"N. c #448905", +"O. c #C1D7AC", +"P. c #375E13", +"Q. c #B7CCA2", +"R. c #5AA118", +"S. c #5BB802", +"T. c #7BCD2E", +"U. c #9FCF73", +"V. c #79A84E", +"W. c #7EA953", +"X. c #81AB59", +"Y. c #DCAA5C", +"Z. c #FDF4E6", +"`. c #F9BD6E", +" + c #CC7821", +".+ c #7B7403", +"++ c #448505", +"@+ c #468A05", +"#+ c #499006", +"$+ c #C0D7AA", +"%+ c #395E14", +"&+ c #C1D5AE", +"*+ c #5BBB01", +"=+ c #87D043", +"-+ c #8FC65C", +";+ c #81B056", +">+ c #82B256", +",+ c #81B154", +"'+ c #629E13", +")+ c #E8BC7E", +"!+ c #F7E6CD", +"~+ c #EFC78E", +"{+ c #CF7E28", +"]+ c #726503", +"^+ c #3D7A05", +"/+ c #3A7604", +"(+ c #448605", +"_+ c #418205", +":+ c #B9D29F", +"<+ c #355716", +"[+ c #BBD2A5", +"}+ c #71C81F", +"|+ c #BFD7A7", +"1+ c #8AC850", +"2+ c #83B653", +"3+ c #8AC950", +"4+ c #86B956", +"5+ c #94CC5F", +"6+ c #6F6439", +"7+ c #A27D49", +"8+ c #E1AA5F", +"9+ c #CF9E4A", +"0+ c #88791B", +"a+ c #3B7405", +"b+ c #407F05", +"c+ c #458806", +"d+ c #488E06", +"e+ c #4A9206", +"f+ c #ABCD8B", +"g+ c #3E5F1F", +"h+ c #375919", +"i+ c #B3CE98", +"j+ c #5DC001", +"k+ c #5BBC01", +"l+ c #53A703", +"m+ c #69B028", +"n+ c #88C450", +"o+ c #84B852", +"p+ c #87C350", +"q+ c #7EB54A", +"r+ c #80C640", +"s+ c #58642D", +"t+ c #647A32", +"u+ c #468708", +"v+ c #418105", +"w+ c #458905", +"x+ c #4B9506", +"y+ c #9BC473", +"z+ c #4D6A31", +"A+ c #375718", +"B+ c #ACCC8E", +"C+ c #56AF03", +"D+ c #5BB902", +"E+ c #55AD03", +"F+ c #53A604", +"G+ c #4E9906", +"H+ c #8CBE5E", +"I+ c #58743E", +"J+ c #37551B", +"K+ c #A4C981", +"L+ c #4FA103", +"M+ c #4F9F03", +"N+ c #499105", +"O+ c #499404", +"P+ c #7EB549", +"Q+ c #5E7944", +"R+ c #334E1A", +"S+ c #93B770", +"T+ c #418005", +"U+ c #428105", +"V+ c #438107", +"W+ c #448309", +"X+ c #47830B", +"Y+ c #48840E", +"Z+ c #4A8610", +"`+ c #4C8711", +" @ c #4C8813", +".@ c #4D8915", +"+@ c #508A17", +"@@ c #518A18", +"#@ c #528C1A", +"$@ c #528D1B", +"%@ c #558D1D", +"&@ c #558E1F", +"*@ c #568E20", +"=@ c #578F20", +"-@ c #589022", +";@ c #589122", +">@ c #7CA851", +",@ c #627D4A", +"'@ c #283C15", +")@ c #A3C087", +"!@ c #659535", +"~@ c #669637", +"{@ c #67963A", +"]@ c #6A973C", +"^@ c #6A983F", +"/@ c #6C9941", +"(@ c #6E9A43", +"_@ c #6F9A45", +":@ c #6F9B47", +"<@ c #719B4A", +"[@ c #729B4A", +"}@ c #749C4C", +"|@ c #749D4E", +"1@ c #769D50", +"2@ c #779D51", +"3@ c #789D52", +"4@ c #789E53", +"5@ c #789E54", +"6@ c #96B37A", +"7@ c #5F744A", +"8@ c #705914", +"9@ c #A07A1E", +"0@ c #9E791D", +"a@ c #9E791E", +"b@ c #9E791F", +"c@ c #A0791F", +"d@ c #A0781F", +"e@ c #A07821", +"f@ c #A07721", +"g@ c #946A19", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" . . . . . . . . . . . . . . . . . . . + ", +" @ # $ % $ % $ % $ % $ % $ % $ % $ % $ % & * ", +" = - ; > > , - ' ) - ! ) - ~ - - - - - - { ] ^ ", +" / ( - _ : < [ } - } | 1 2 1 3 1 - 1 - 1 - 4 5 6 7 8 ", +" 9 0 - a b c d > e - f - g - g - - - - - - h i j k l m n ", +" o p - q r r s t f 1 g 1 u v w 1 - 1 - 1 - x y z l A B ", +" C D - E r r F G w ' w ! H I J - - - - - K L z l A M ", +" N O - P r r c Q H R S T > t U 1 - 1 - V W X l Y Z ", +" ` .' b r r ..+.@.#.$.%.&.*.{ =.- - K W X -.;.>. ", +" ,.'.I ).r r !.~.{.].^./.(._.:.<.- V [.X -.;.}.|. ", +" 1.2.3.b r r 4.5.6.7.8.9.0.a.b.c.K [.X -.;.d.e. ", +" f.g.h.i.r r j.k.l.m.n.o.p.q.r.s.[.X -.;.t.u.v. ", +" w.x.| r r y.z.- - - - - - - A.B.X -.;.t.C.- D. ", +" E.F.S r r G.H.1 - 1 - 1 - I.J.X l K.d.L.M.N.O.P. ", +" Q.R.S.r r T.U.V.- W.- X.- Y.Z.`.K. +.+++@+#+$+%+ ", +" &+1 *+r r =+-+;+- >+- ,+'+)+!+~+{+]+^+/+(+_+:+<+ ", +" [+- E r r }+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+ ", +" h+i+1 j+k+j+l+m+n+o+p+q+r+s+t+u+v+e+w+x+N.x+N.y+z+ ", +" A+B+- G e e U 3 ! 3.C+- h.D+E+U F+- - G+G+G+- H+I+ ", +" J+K+1 h.L+e M+- 1 - N+- 1 3.t 3.O+- 1 - 1 - 1 P+Q+ ", +" R+S+T+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@ ", +" '@)@!@!@!@~@{@]@^@/@(@_@:@<@[@}@|@1@1@2@3@4@5@6@7@ ", +" 8@9@0@0@0@0@a@a@a@a@b@c@c@d@c@d@e@e@e@e@e@e@e@f@g@ ", +" ", +" "}; Index: tags/1.0.5/debian/rules =================================================================== --- tags/1.0.5/debian/rules (nonexistent) +++ tags/1.0.5/debian/rules (revision 953) @@ -0,0 +1,79 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# debian/rules file for the Debian/GNU Linux pcb package +# Copyright 1997-99 by Hartmut Koptein + +package = pcb-rnd + +CONFIGURE_OPTS=--disable-doc --disable-gl --disable-rpath --disable-dbus --disable-update-desktop-database --disable-update-mime-database --enable-dependency-tracking --disable-coord64 LDFLAGS="$(LDFLAGS) -Wl,--as-needed" + +%: + dh $@ + +override_dh_auto_configure: + ./configure --prefix=/usr + +override_dh_auto_build: + make +# dh_auto_build --builddirectory build_gtk +# dh_auto_build --builddirectory build_lesstif + +override_dh_auto_test: + dh_auto_test --builddirectory build_gtk +# dh_auto_test --builddirectory build_lesstif + +override_dh_auto_install: + make install install_root=`pwd`/debian/tmp + +override_dh_auto_clean: + dh_auto_clean --builddirectory build_gtk +# dh_auto_clean --builddirectory build_lesstif + -make distclean + +override_dh_install: + # Remove needlessly installed static library and header file before + # installing common files: + rm -rf $(CURDIR)/debian/tmp/usr/lib + rm -rf $(CURDIR)/debian/tmp/usr/include + dh_install -Xusr/bin -Xusr/share/pcb-rnd- -Xusr/share/doc -Xexamples -Xtutorial -Xusr/share/info + + # Install pcb-gtk binary: + install debian/tmp/usr/bin/pcb-rnd debian/$(package)-gtk/usr/bin/pcb-rnd-gtk + + + # Install pcb-lesstif binary: +# install build_lesstif/src/pcb-rnd debian/$(package)-lesstif/usr/bin/pcb-rnd-lesstif + + # Install common binaries: + mkdir debian/$(package)-common/usr/bin + install debian/tmp/usr/bin/gsch2pcb-rnd debian/$(package)-common/usr/bin/gsch2pcb-rnd + + # Set executable bit for pcb tools: + -[ ! -d debian/$(package)-common ] || chmod a+x debian/$(package)-common/usr/share/pcb-rnd/tools/MergePCBPS + -[ ! -d debian/$(package)-common ] || chmod a+x debian/$(package)-common/usr/share/pcb-rnd/tools/Merge_dimPCBPS + -[ ! -d debian/$(package)-common ] || chmod a+x debian/$(package)-common/usr/share/pcb-rnd/tools/tgo2pcb.tcl + -[ ! -d debian/$(package)-common ] || chmod a+x debian/$(package)-common/usr/share/pcb-rnd/tools/PCB2HPGL + + # Remove empty dirs: + [ ! -d debian/$(package)-common ] || find debian/$(package)-common -type d -empty -delete + +override_dh_fixperms: + dh_fixperms + # Fix permissions of a couple of example files: +# -[ ! -d debian/$(package)-common ] || chmod -x debian/$(package)-common/usr/share/doc/$(package)-common/examples/LED.pcb +# -[ ! -d debian/$(package)-common ] || chmod -x debian/$(package)-common/usr/share/doc/$(package)-common/examples/LED.net + +override_dh_installexamples: + dh_installexamples -XMakefile + +override_dh_installchangelogs: + dh_installchangelogs -p$(package)-common + +override_dh_installdocs: + # Only install docs in $(package)-common & link other packages' docs to + # $(package)-common: + dh_installdocs --link-doc=$(package)-common + +override_dh_compress: + # exclude example files from compression + dh_compress -X.pcb -XLED Property changes on: tags/1.0.5/debian/rules ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/debian/source/format =================================================================== --- tags/1.0.5/debian/source/format (nonexistent) +++ tags/1.0.5/debian/source/format (revision 953) @@ -0,0 +1 @@ +3.0 (quilt) Index: tags/1.0.5/debian/source.lintian-overrides =================================================================== --- tags/1.0.5/debian/source.lintian-overrides (nonexistent) +++ tags/1.0.5/debian/source.lintian-overrides (revision 953) @@ -0,0 +1,3 @@ +# Added a patch to use updated config.{sub,guess} +pcb source: outdated-autotools-helper-file config.sub 2005-07-08 +pcb source: outdated-autotools-helper-file config.guess 2005-07-08 Index: tags/1.0.5/debian/watch =================================================================== --- tags/1.0.5/debian/watch (nonexistent) +++ tags/1.0.5/debian/watch (revision 953) @@ -0,0 +1,3 @@ +version=3 +http://sf.net/pcb/pcb-(.*)\.tar\.gz +http://geda.seul.org/dist/pcb-(.*)\.tar\.gz Index: tags/1.0.5/doc/Makefile =================================================================== --- tags/1.0.5/doc/Makefile (nonexistent) +++ tags/1.0.5/doc/Makefile (revision 953) @@ -0,0 +1,155 @@ +## -*- makefile -*- +## +## COPYRIGHT +## +## PCB, interactive printed circuit board design +## Copyright (C) 1994,1995,1996 Thomas Nau +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## +## Contact addresses for paper mail and Email: +## Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +## Thomas.Nau@rz.uni-ulm.de +## + +## not until it is fully fixed up in terms of building +##SUBDIRS= gs + +info_TEXINFOS= pcb.texi +pcb_TEXINFOS= ${inline_texi} ${pcb_output} ${tab_texi} ${images_output} + +dist_html_DATA= ${html_docs} ${pcb_output_inst} ${images_output_inst} +dist_pdf_DATA= ${pdf_docs} + +dist_man_MANS= pcb.1 + +html_docs= ${info_TEXINFOS:.texi=.html} +pdf_docs= ${info_TEXINFOS:.texi=.pdf} refcard.pdf + +DVIS= + +# put the html manual into 1 file instead of multiple files? +AM_MAKEINFOHTMLFLAGS= --css-include=pcb.css --no-split + +EXTRA_DIST= \ + ascii2texi.awk \ + eps2png \ + extract-docs \ + refcard.tex \ + pcb.css \ + ${inline_texi} \ + ${pcb_files} \ + ${pcb_output_noinst} \ + ${tab_files} \ + ${tab_texi} \ + ${images} + +all: $(html_docs) $(pdf_docs) + +# use this to avoid having the clean target delete pcb.{dvi,html,pdf,ps} +# which unfortunately deletes files which are part of the distfile +clean: + -rm -rf pcb.aux pcb.cp pcb.cps pcb.fn pcb.fns pcb.ky pcb.kys pcb.log pcb.pg \ + pcb.pgs pcb.tmp pcb.toc pcb.tp pcb.tps pcb.vr pcb.vrs + + +BUILT_SOURCES= ${tab_texi} ${pcb_output} ${inline_texi} +CLEANFILES= \ + refcard.aux refcard.log refcard.pdf \ + ${pcb_output} ${tab_texi} ${inline_texi} pcb.html pcb.pdf \ + ${images_output} + +inline_texi= \ + options.texi \ + actions.texi \ + pcbfile.texi + +ASCII2TEXI= ${AWK} -f $(srcdir)/ascii2texi.awk ncol=3 + +# Tables +tab_files= \ + fractional_size.tab \ + letter_size.tab \ + metric_size.tab \ + wire_size.tab +tab_texi= ${tab_files:.tab=.texi} + +# PCB Drawings +pcb_files= \ + pad.pcb \ + puller.pcb \ + thermal.pcb \ + gcode.pcb + +pcb_output_noinst= \ + ${pcb_files:.pcb=.pdf} + +pcb_output_inst= \ + ${pcb_files:.pcb=.png} + +pcb_output= ${pcb_output_inst} ${pcb_output_noinst} + +# Additional images +images= \ + gcode_control_img.eps \ + gcode_tool_path.eps + +images_output_noinst= \ + ${images:.eps=.pdf} + +images_output_inst= \ + ${images:.eps=.png} + +images_output= ${images_output_noinst} ${images_output_inst} + +${inline_texi} : extracted-docs + +# no need to build these when building via a tarball. They're not used then +# anyway. +.PHONY : extracted-docs +extracted-docs : + ${PERL} $(srcdir)/extract-docs $(srcdir) + +SUFFIXES = .eps .pcb .pdf .png .tab .tex .html .texi + +.pcb.eps : + ${PCB} -x eps --only-visible --font-path $(top_srcdir)/src --eps-file $@ $< + +.pcb.png : + ${PCB} -x png --only-visible --font-path $(top_srcdir)/src --outfile $@ $< + +.eps.pdf : + ${PS2PDF} `${AWK} 'BEGIN{s=8}; /BoundingBox/ {printf("-r%d -g%dx%d", s*72, s*$$4, s*$$5);}' $<` $< $@ + +.tab.texi: + ${ASCII2TEXI} $< > $@ + +.tex.pdf: + ${PDFLATEX} $< + ${PDFLATEX} $< + ${PDFLATEX} $< + +.eps.png: + ${PERL} $(srcdir)/eps2png --png $< > $@ + +%.html: %.texi + rm $@ 2>/dev/null; true + makeinfo --html --css-include=pcb.css --no-split --output=$@ $^ + + +%.pdf: %.texi + rm $@ 2>/dev/null; true + makeinfo --pdf --css-include=pcb.css --no-split --output=$@ $^ + Index: tags/1.0.5/doc/README =================================================================== --- tags/1.0.5/doc/README (nonexistent) +++ tags/1.0.5/doc/README (revision 953) @@ -0,0 +1,11 @@ +This is the original doc dir of pcb. Currently it does not compile. + +For the modifications introduced by pcb-rnd, check ../doc-rnd + + +Most of the original documentation is in texi; makeinfo fails to +produce pdf from pcb.texi and even generating html throws +a large amount of warnings. + +It may be that pcb-rnd will switch from texi to html for documentation +source format. Index: tags/1.0.5/doc/actions.texi =================================================================== --- tags/1.0.5/doc/actions.texi (nonexistent) +++ tags/1.0.5/doc/actions.texi (revision 953) @@ -0,0 +1,3574 @@ +@c key actions +@c ./../src/action.c 225 + +Many actions take a @code{delta} parameter as the last parameter, +which is an amount to change something. That @code{delta} may include +units, as an additional parameter, such as @code{Action(Object,5,mm)}. +If no units are specified, the default is PCB's native units +(currently 1/100 mil). Also, if the delta is prefixed by @code{+} or +@code{-}, the size is increased or decreased by that amount. +Otherwise, the size size is set to the given amount. + +@example +Action(Object,5,mil) +Action(Object,+0.5,mm) +Action(Object,-1) +@end example + +Actions which take a @code{delta} parameter which do not accept all +these options will specify what they do take. + +@c ./../src/action.c 229 + +@macro pinshapes + +Pins, pads, and vias can have various shapes. All may be round. Pins +and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a +shape flag of an element, you actually change all of its pins and +pads. + +Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + +@end macro + +@c ./../src/command.c 64 + +@macro colonaction + +This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (@code{:}) and thus the syntax +is documented for that purpose. + +@end macro + +@c ./../src/action.c 227 + +Many actions act on indicated objects on the board. They will have +parameters like @code{ToggleObject} or @code{SelectedVias} to indicate +what group of objects they act on. Unless otherwise specified, these +parameters are defined as follows: + +@table @code + +@item Object +@itemx ToggleObject +Affects the object under the mouse pointer. If this action is invoked +from a menu or script, the user will be prompted to click on an +object, which is then the object affected. + +@item Selected +@itemx SelectedObjects + +Affects all objects which are currently selected. At least, all +selected objects for which the given action makes sense. + +@item SelectedPins +@itemx SelectedVias +@itemx Selected@var{Type} +@itemx @i{etc} +Affects all objects which are both selected and of the @var{Type} specified. + +@end table + + +@menu +* core actions:: +* common actions:: +* gtk actions:: +* lesstif actions:: +@end menu + +@node core actions +@section Core actions +@menu +* AddRats Action:: Add one or more rat lines to the board. +* ApplyVendor Action:: Applies the currently loaded vendor drill table to the current design. +* Atomic Action:: Save or restore the undo serial number. +* Attributes Action:: Let the user edit the attributes of the layout, current or given +layer, or selected element. +* AutoPlaceSelected Action:: Auto-place selected components. +* AutoRoute Action:: Auto-route some or all rat lines. +* ChangeClearSize Action:: Changes the clearance size of objects. +* ChangeDrillSize Action:: Changes the drilling hole size of objects. +* ChangeFlag Action:: Sets or clears flags on objects. +* ChangeHole Action:: Changes the hole flag of objects. +* ChangeJoin Action:: Changes the join (clearance through polygons) of objects. +* ChangeName Action:: Sets the name of objects. +* ChangeOctagon Action:: Changes the octagon-flag of pins and vias. +* ChangePaste Action:: Changes the no paste flag of objects. +* ChangePinName Action:: Sets the name of a specific pin on a specific element. +* ChangeSize Action:: Changes the size of objects. +* ChangeSquare Action:: Changes the square flag of pins and pads. +* ClearOctagon Action:: Clears the octagon-flag of pins and vias. +* ClearSquare Action:: Clears the square-flag of pins and pads. +* ClrFlag Action:: Clears flags on objects. +* Connection Action:: Searches connections of the object at the cursor position. +* Delete Action:: Delete stuff. +* DeleteRats Action:: Delete rat lines. +* DisableVendor Action:: Disables automatic drill size mapping. +* DisperseElements Action:: Disperses elements. +* Display Action:: Several display-related actions. +* djopt Action:: Perform various optimizations on the current board. +* DRC Action:: Invoke the DRC check. +* DumpLibrary Action:: Display the entire contents of the libraries. +* elementlist Action:: Adds the given element if it doesn't already exist. +* elementsetattr Action:: Sets or clears an element-specific attribute. +* EnableVendor Action:: Enables automatic drill size mapping. +* execcommand Action:: Runs a command. +* ExecuteFile Action:: Run actions from the given file. +* Flip Action:: Flip an element to the opposite side of the board. +* FontEdit Action:: Convert the current font to a PCB for editing. +* FontSave Action:: Convert the current PCB back to a font. +* FreeRotateBuffer Action:: Rotates the current paste buffer contents by the specified angle. The +angle is given in degrees. If no angle is given, the user is prompted +for one. + +* GlobalPuller Action:: Pull all traces tight. +* h Action:: Print a help message for commands. +* Import Action:: Import schematics. +* l Action:: Loads layout data. +* le Action:: Loads an element into the current buffer. +* LoadFootprint Action:: Loads a single footprint by name. +* LoadFrom Action:: Load layout data from a file. +* LoadVendorFrom Action:: Loads the specified vendor resource file. +* m Action:: Loads a layout into the current buffer. +* MarkCrosshair Action:: Set/Reset the Crosshair mark. +* Message Action:: Writes a message to the log window. +* MinClearGap Action:: Ensures that polygons are a minimum distance from objects. +* MinMaskGap Action:: Ensures the mask is a minimum distance from pins and pads. +* Mode Action:: Change or use the tool mode. +* MorphPolygon Action:: Converts dead polygon islands into separate polygons. +* MoveLayer Action:: Moves/Creates/Deletes Layers. +* MoveObject Action:: Moves the object under the crosshair. +* MoveToCurrentLayer Action:: Moves objects to the current layer. +* Netlist Action:: Perform various actions on netlists. +* New Action:: Starts a new layout. +* OptAutoOnly Action:: Toggles the optimize-only-autorouted flag. +* PasteBuffer Action:: Various operations on the paste buffer. +* Polygon Action:: Some polygon related stuff. +* Puller Action:: Pull an arc-line junction tight. +* q Action:: Quits the application after confirming. +* q! Action:: Quits the application without confirming. +* Quit Action:: Quits the application after confirming. +* Redo Action:: Redo recent``undo''operations. +* RemoveSelected Action:: Removes any selected objects. +* Renumber Action:: Renumber all elements. The changes will be recorded to filename +for use in backannotating these changes to the schematic. +* Report Action:: Produce various report. +* ReportDialog Action:: Report on the object under the crosshair +* RipUp Action:: Ripup auto-routed tracks, or convert an element to parts. +* rn Action:: Reads netlist. +* RouteStyle Action:: Copies the indicated routing style into the current sizes. +* s Action:: Saves layout data. +* SaveSettings Action:: Saves settings. +* SaveTo Action:: Saves data to a file. +* Select Action:: Toggles or sets the selection. +* SetFlag Action:: Sets flags on objects. +* SetOctagon Action:: Sets the octagon-flag of objects. +* SetSame Action:: Sets current layer and sizes to match indicated item. +* SetSquare Action:: sets the square-flag of objects. +* SetThermal Action:: Set the thermal (on the current layer) of pins or vias to the given style. +Style = 0 means no thermal. +Style = 1 has diagonal fingers with sharp edges. +Style = 2 has horizontal and vertical fingers with sharp edges. +Style = 3 is a solid connection to the plane.Style = 4 has diagonal fingers with rounded edges. +Style = 5 has horizontal and vertical fingers with rounded edges. + +* SetValue Action:: Change various board-wide values and sizes. +* ToggleHideName Action:: Toggles the visibility of element names. +* ToggleVendor Action:: Toggles the state of automatic drill size mapping. +* Undo Action:: Undo recent changes. +* UnloadVendor Action:: Unloads the current vendor drill mapping table. +* Unselect Action:: Unselects the object at the pointer location or the specified objects. +* w Action:: Saves layout data. +* wq Action:: Saves the layout data and quits. +@end menu +@node AddRats Action +@subsection AddRats +@c key AddRats in hid +@cartouche +@format +AddRats(AllRats|SelectedRats|Close)@end format +@end cartouche + +Add one or more rat lines to the board. +@c ./../src/action.c 3310 + +@table @code + +@item AllRats +Create rat lines for all loaded nets that aren't already connected on +with copper. + +@item SelectedRats +Similarly, but only add rat lines for nets connected to selected pins +and pads. + +@item Close +Selects the shortest unselected rat on the board. + +@end table + + +@node ApplyVendor Action +@subsection ApplyVendor +@c key ApplyVendor in hid +@cartouche +@format +ApplyVendor()@end format +@end cartouche + +Applies the currently loaded vendor drill table to the current design. +@c ./../src/vendor.c 112 +@cindex vendor map +@cindex vendor drill table +@findex ApplyVendor() + +This will modify all of your drill holes to match the list of allowed +sizes for your vendor. + +@node Atomic Action +@subsection Atomic +@c key Atomic in hid +@cartouche +@format +Atomic(Save|Restore|Close|Block)@end format +@end cartouche + +Save or restore the undo serial number. +@c ./../src/action.c 1720 + +This action allows making multiple-action bindings into an atomic +operation that will be undone by a single Undo command. For example, +to optimize rat lines, you'd delete the rats and re-add them. To +group these into a single undo, you'd want the deletions and the +additions to have the same undo serial number. So, you @code{Save}, +delete the rats, @code{Restore}, add the rats - using the same serial +number as the deletes, then @code{Block}, which checks to see if the +deletions or additions actually did anything. If not, the serial +number is set to the saved number, as there's nothing to undo. If +something did happen, the serial number is incremented so that these +actions are counted as a single undo step. + +@table @code + +@item Save +Saves the undo serial number. + +@item Restore +Returns it to the last saved number. + +@item Close +Sets it to 1 greater than the last save. + +@item Block +Does a Restore if there was nothing to undo, else does a Close. + +@end table + + +@node Attributes Action +@subsection Attributes +@c key Attributes in hid +@cartouche +@format +Attributes(Layout|Layer|Element) +Attributes(Layer,layername)@end format +@end cartouche + +Let the user edit the attributes of the layout, current or given +layer, or selected element. +@c ./../src/action.c 6761 + +This just pops up a dialog letting the user edit the attributes of the +pcb, an element, or a layer. + + +@node AutoPlaceSelected Action +@subsection AutoPlaceSelected +@c key AutoPlaceSelected in hid +@cartouche +@format +AutoPlaceSelected()@end format +@end cartouche + +Auto-place selected components. +@c ./../src/action.c 3450 + +Attempts to re-arrange the selected components such that the nets +connecting them are minimized. Note that you cannot undo this. + + +@node AutoRoute Action +@subsection AutoRoute +@c key AutoRoute in hid +@cartouche +@format +AutoRoute(AllRats|SelectedRats)@end format +@end cartouche + +Auto-route some or all rat lines. +@c ./../src/action.c 3471 + +@table @code + +@item AllRats +Attempt to autoroute all rats. + +@item SelectedRats +Attempt to autoroute the selected rats. + +@end table + +Before autorouting, it's important to set up a few things. First, +make sure any layers you aren't using are disabled, else the +autorouter may use them. Next, make sure the current line and via +styles are set accordingly. Last, make sure "new lines clear +polygons" is set, in case you eventually want to add a copper pour. + +Autorouting takes a while. During this time, the program may not be +responsive. + + +@node ChangeClearSize Action +@subsection ChangeClearSize +@c key ChangeClearSize in hid +@cartouche +@format +ChangeClearSize(Object, delta) +ChangeClearSize(SelectedPins|SelectedPads|SelectedVias, delta) +ChangeClearSize(SelectedLines|SelectedArcs, delta +ChangeClearSize(Selected|SelectedObjects, delta)@end format +@end cartouche + +Changes the clearance size of objects. +@c ./../src/action.c 3686 + +If the solder mask is currently showing, this action changes the +solder mask clearance. If the mask is not showing, this action +changes the polygon clearance. + + +@node ChangeDrillSize Action +@subsection ChangeDrillSize +@c key ChangeDrillSize in hid +@cartouche +@format +ChangeDrillSize(Object, delta) +ChangeDrillSize(SelectedPins|SelectedVias|Selected|SelectedObjects, delta)@end format +@end cartouche + +Changes the drilling hole size of objects. +@c ./../src/action.c 3630 + + +@node ChangeFlag Action +@subsection ChangeFlag +@c key ChangeFlag in hid +@cartouche +@format +ChangeFlag(Object|Selected|SelectedObjects, flag, value) +ChangeFlag(SelectedLines|SelectedPins|SelectedVias, flag, value) +ChangeFlag(SelectedPads|SelectedTexts|SelectedNames, flag, value) +ChangeFlag(SelectedElements, flag, value) +flag = square | octagon | thermal | join +value = 0 | 1@end format +@end cartouche + +Sets or clears flags on objects. +@c ./../src/action.c 5750 + +Toggles the given flag on the indicated object(s). The flag may be +one of the flags listed above (square, octagon, thermal, join). The +value may be the number 0 or 1. If the value is 0, the flag is +cleared. If the value is 1, the flag is set. + + +@node ChangeHole Action +@subsection ChangeHole +@c key ChangeHole in hid +@cartouche +@format +ChangeHole(ToggleObject|Object|SelectedVias|Selected)@end format +@end cartouche + +Changes the hole flag of objects. +@c ./../src/action.c 4571 + +The "hole flag" of a via determines whether the via is a +plated-through hole (not set), or an unplated hole (set). + + +@node ChangeJoin Action +@subsection ChangeJoin +@c key ChangeJoin in hid +@cartouche +@format +ChangeJoin(ToggleObject|SelectedLines|SelectedArcs|Selected)@end format +@end cartouche + +Changes the join (clearance through polygons) of objects. +@c ./../src/action.c 4199 + +The join flag determines whether a line or arc, drawn to intersect a +polygon, electrically connects to the polygon or not. When joined, +the line/arc is simply drawn over the polygon, making an electrical +connection. When not joined, a gap is drawn between the line and the +polygon, insulating them from each other. + + +@node ChangeName Action +@subsection ChangeName +@c key ChangeName in hid +@cartouche +@format +ChangeName(Object) +ChangeName(Layout|Layer)@end format +@end cartouche + +Sets the name of objects. +@c ./../src/action.c 4005 + +@table @code + +@item Object +Changes the name of the element under the cursor. + +@item Layout +Changes the name of the layout. This is printed on the fab drawings. + +@item Layer +Changes the name of the currently active layer. + +@end table + + +@node ChangeOctagon Action +@subsection ChangeOctagon +@c key ChangeOctagon in hid +@cartouche +@format +ChangeOctagon(Object|ToggleObject|SelectedObjects|Selected) +ChangeOctagon(SelectedElements|SelectedPins|SelectedVias)@end format +@end cartouche + +Changes the octagon-flag of pins and vias. +@c ./../src/action.c 4403 + +@pinshapes + + +@node ChangePaste Action +@subsection ChangePaste +@c key ChangePaste in hid +@cartouche +@format +ChangePaste(ToggleObject|Object|SelectedPads|Selected)@end format +@end cartouche + +Changes the no paste flag of objects. +@c ./../src/action.c 4611 + +The "no paste flag" of a pad determines whether the solderpaste + stencil will have an opening for the pad (no set) or if there wil be + no solderpaste on the pad (set). This is used for things such as + fiducial pads. + + +@node ChangePinName Action +@subsection ChangePinName +@c key ChangePinName in hid +@cartouche +@format +ChangePinName(ElementName,PinNumber,PinName)@end format +@end cartouche + +Sets the name of a specific pin on a specific element. +@c ./../src/action.c 3924 + +This can be especially useful for annotating pin names from a +schematic to the layout without requiring knowledge of the pcb file +format. + +@example +ChangePinName(U3, 7, VCC) +@end example + + +@node ChangeSize Action +@subsection ChangeSize +@c key ChangeSize in hid +@cartouche +@format +ChangeSize(Object, delta) +ChangeSize(SelectedObjects|Selected, delta) +ChangeSize(SelectedLines|SelectedPins|SelectedVias, delta) +ChangeSize(SelectedPads|SelectedTexts|SelectedNames, delta) +ChangeSize(SelectedElements, delta)@end format +@end cartouche + +Changes the size of objects. +@c ./../src/action.c 3543 + +For lines and arcs, this changes the width. For pins and vias, this +changes the overall diameter of the copper annulus. For pads, this +changes the width and, indirectly, the length. For texts and names, +this changes the scaling factor. For elements, this changes the width +of the silk layer lines and arcs for this element. + + +@node ChangeSquare Action +@subsection ChangeSquare +@c key ChangeSquare in hid +@cartouche +@format +ChangeSquare(ToggleObject) +ChangeSquare(SelectedElements|SelectedPins) +ChangeSquare(Selected|SelectedObjects)@end format +@end cartouche + +Changes the square flag of pins and pads. +@c ./../src/action.c 4250 + +Note that @code{Pins} means both pins and pads. + +@pinshapes + + +@node ClearOctagon Action +@subsection ClearOctagon +@c key ClearOctagon in hid +@cartouche +@format +ClearOctagon(ToggleObject|Object|SelectedObjects|Selected) +ClearOctagon(SelectedElements|SelectedPins|SelectedVias)@end format +@end cartouche + +Clears the octagon-flag of pins and vias. +@c ./../src/action.c 4515 + +@pinshapes + + +@node ClearSquare Action +@subsection ClearSquare +@c key ClearSquare in hid +@cartouche +@format +ClearSquare(ToggleObject|SelectedElements|SelectedPins)@end format +@end cartouche + +Clears the square-flag of pins and pads. +@c ./../src/action.c 4352 + +Note that @code{Pins} means pins and pads. + +@pinshapes + + +@node ClrFlag Action +@subsection ClrFlag +@c key ClrFlag in hid +@cartouche +@format +ClrFlag(Object|Selected|SelectedObjects, flag) +ClrFlag(SelectedLines|SelectedPins|SelectedVias, flag) +ClrFlag(SelectedPads|SelectedTexts|SelectedNames, flag) +ClrFlag(SelectedElements, flag) +flag = square | octagon | thermal | join@end format +@end cartouche + +Clears flags on objects. +@c ./../src/action.c 5733 + +Turns the given flag off, regardless of its previous setting. See +@code{ChangeFlag}. + +@example +ClrFlag(SelectedLines,join) +@end example + + +@node Connection Action +@subsection Connection +@c key Connection in hid +@cartouche +@format +Connection(Find|ResetLinesAndPolygons|ResetPinsAndVias|Reset)@end format +@end cartouche + +Searches connections of the object at the cursor position. +@c ./../src/action.c 2093 + +Connections found with this action will be highlighted in the +``connected-color'' color and will have the ``found'' flag set. + +@table @code + +@item Find +The net under the cursor is ``found''. + +@item ResetLinesAndPolygons +Any ``found'' lines and polygons are marked ``not found''. + +@item ResetPinsAndVias +Any ``found'' pins and vias are marked ``not found''. + +@item Reset +All ``found'' objects are marked ``not found''. + +@end table + + +@node Delete Action +@subsection Delete +@c key Delete in hid +@cartouche +@format +Delete(Object|Selected) +Delete(AllRats|SelectedRats)@end format +@end cartouche + +Delete stuff. +@c ./../src/action.c 3371 + + +@node DeleteRats Action +@subsection DeleteRats +@c key DeleteRats in hid +@cartouche +@format +DeleteRats(AllRats|Selected|SelectedRats)@end format +@end cartouche + +Delete rat lines. +@c ./../src/action.c 3418 + + +@node DisableVendor Action +@subsection DisableVendor +@c key DisableVendor in hid +@cartouche +@format +DisableVendor()@end format +@end cartouche + +Disables automatic drill size mapping. +@c ./../src/vendor.c 161 + +@cindex vendor map +@cindex vendor drill table +@findex DisableVendor() + +When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. + + +@node DisperseElements Action +@subsection DisperseElements +@c key DisperseElements in hid +@cartouche +@format +DisperseElements(All|Selected)@end format +@end cartouche + +Disperses elements. +@c ./../src/action.c 2146 + +Normally this is used when starting a board, by selecting all elements +and then dispersing them. This scatters the elements around the board +so that you can pick individual ones, rather than have all the +elements at the same 0,0 coordinate and thus impossible to choose +from. + + +@node Display Action +@subsection Display +@c key Display in hid +@cartouche +@format +Display(NameOnPCB|Description|Value) +Display(Grid|Redraw) +Display(CycleClip|CycleCrosshair|Toggle45Degree|ToggleStartDirection) +Display(ToggleGrid|ToggleRubberBandMode|ToggleUniqueNames) +Display(ToggleMask|ToggleName|ToggleClearLine|ToggleFullPoly|ToggleSnapPin) +Display(ToggleThindraw|ToggleThindrawPoly|ToggleOrthoMove|ToggleLocalRef) +Display(ToggleCheckPlanes|ToggleShowDRC|ToggleAutoDRC) +Display(ToggleLiveRoute|LockNames|OnlyNames) +Display(Pinout|PinOrPadName)@end format +@end cartouche + +Several display-related actions. +@c ./../src/action.c 2262 + +@table @code + +@item NameOnPCB +@item Description +@item Value +Specify whether all elements show their name, description, or value. + +@item Redraw +Redraw the whole board. + +@item Toggle45Degree +When clear, lines can be drawn at any angle. When set, lines are +restricted to multiples of 45 degrees and requested lines may be +broken up according to the clip setting. + +@item CycleClip +Changes the way lines are restricted to 45 degree increments. The +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, +8-ray and 12-ray cross. + +@item ToggleRubberBandMode +If set, moving an object moves all the lines attached to it too. + +@item ToggleStartDirection +If set, each time you set a point in a line, the Clip toggles between +orth-angle and angle-ortho. + +@item ToggleUniqueNames +If set, you will not be permitted to change the name of an element to +match that of another element. + +@item ToggleSnapPin +If set, pin centers and pad end points are treated as additional grid +points that the cursor can snap to. + +@item ToggleLocalRef +If set, the mark is automatically set to the beginning of any move, so +you can see the relative distance you've moved. + +@item ToggleThindraw +If set, objects on the screen are drawn as outlines (lines are drawn +as center-lines). This lets you see line endpoints hidden under pins, +for example. + +@item ToggleThindrawPoly +If set, polygons on the screen are drawn as outlines. + +@item ToggleShowDRC +If set, pending objects (i.e. lines you're in the process of drawing) +will be drawn with an outline showing how far away from other copper +you need to be. + +@item ToggleLiveRoute +If set, the progress of the autorouter will be visible on the screen. + +@item ToggleAutoDRC +If set, you will not be permitted to make connections which violate +the current DRC and netlist settings. + +@item ToggleCheckPlanes +If set, lines and arcs aren't drawn, which usually leaves just the +polygons. If you also disable all but the layer you're interested in, +this allows you to check for isolated regions. + +@item ToggleOrthoMove +If set, the crosshair is only allowed to move orthogonally from its +previous position. I.e. you can move an element or line up, down, +left, or right, but not up+left or down+right. + +@item ToggleName +Selects whether the pinouts show the pin names or the pin numbers. + +@item ToggleLockNames +If set, text will ignore left mouse clicks and actions that work on +objects under the mouse. You can still select text with a lasso (left +mouse drag) and perform actions on the selection. + +@item ToggleOnlyNames +If set, only text will be sensitive for mouse clicks and actions that +work on objects under the mouse. You can still select other objects +with a lasso (left mouse drag) and perform actions on the selection. + +@item ToggleMask +Turns the solder mask on or off. + +@item ToggleClearLine +When set, the clear-line flag causes new lines and arcs to have their +``clear polygons'' flag set, so they won't be electrically connected +to any polygons they overlap. + +@item ToggleFullPoly +When set, the full-poly flag causes new polygons to have their +``full polygon'' flag set, so all parts of them will be displayed +instead of only the biggest one. + +@item ToggleGrid +Resets the origin of the current grid to be wherever the mouse pointer +is (not where the crosshair currently is). If you provide two numbers +after this, the origin is set to that coordinate. + +@item Grid +Toggles whether the grid is displayed or not. + +@item Pinout +Causes the pinout of the element indicated by the cursor to be +displayed, usually in a separate window. + +@item PinOrPadName +Toggles whether the names of pins, pads, or (yes) vias will be +displayed. If the cursor is over an element, all of its pins and pads +are affected. + +@end table + + +@node djopt Action +@subsection djopt +@c key djopt in hid +@cartouche +@format +djopt(debumpify|unjaggy|simple|vianudge|viatrim|orthopull) +djopt(auto) - all of the above +djopt(miter)@end format +@end cartouche + +Perform various optimizations on the current board. +@c ./../src/djopt.c 2853 + +The different types of optimizations change your board in order to +reduce the total trace length and via count. + +@table @code + +@item debumpify +Looks for U-shaped traces that can be shortened or eliminated. + +@item unjaggy +Looks for corners which could be flipped to eliminate one or more +corners (i.e. jaggy lines become simpler). + +@item simple +Removing uneeded vias, replacing two or more trace segments in a row +with a single segment. This is usually performed automatically after +other optimizations. + +@item vianudge +Looks for vias where all traces leave in the same direction. Tries to +move via in that direction to eliminate one of the traces (and thus a +corner). + +@item viatrim +Looks for traces that go from via to via, where moving that trace to a +different layer eliminates one or both vias. + +@item orthopull +Looks for chains of traces all going in one direction, with more +traces orthogonal on one side than on the other. Moves the chain in +that direction, causing a net reduction in trace length, possibly +eliminating traces and/or corners. + +@item splitlines +Looks for lines that pass through vias, pins, or pads, and splits them +into separate lines so they can be managed separately. + +@item auto +Performs the above options, repeating until no further optimizations +can be made. + +@item miter +Replaces 90 degree corners with a pair of 45 degree corners, to reduce +RF losses and trace length. + +@end table + + +@node DRC Action +@subsection DRC +@c key DRC in hid +@cartouche +@format +DRC()@end format +@end cartouche + +Invoke the DRC check. +@c ./../src/action.c 1755 + +Note that the design rule check uses the current board rule settings, +not the current style settings. + + +@node DumpLibrary Action +@subsection DumpLibrary +@c key DumpLibrary in hid +@cartouche +@format +DumpLibrary()@end format +@end cartouche + +Display the entire contents of the libraries. +@c ./../src/action.c 1791 + + + +@node elementlist Action +@subsection elementlist +@c key elementlist in hid +@cartouche +@format +ElementList(Start|Done|Need,,,)@end format +@end cartouche + +Adds the given element if it doesn't already exist. +@c ./../src/action.c 5983 + +@table @code + +@item Start +Indicates the start of an element list; call this before any Need +actions. + +@item Need +Searches the board for an element with a matching refdes. + +If found, the value and footprint are updated. + +If not found, a new element is created with the given footprint and value. + +@item Done +Compares the list of elements needed since the most recent +@code{start} with the list of elements actually on the board. Any +elements that weren't listed are selected, so that the user may delete +them. + +@end table + + +@node elementsetattr Action +@subsection elementsetattr +@c key elementsetattr in hid +@cartouche +@format +ElementSetAttr(refdes,name[,value])@end format +@end cartouche + +Sets or clears an element-specific attribute. +@c ./../src/action.c 6176 + +If a value is specified, the named attribute is added (if not already +present) or changed (if it is) to the given value. If the value is +not specified, the given attribute is removed if present. + + +@node EnableVendor Action +@subsection EnableVendor +@c key EnableVendor in hid +@cartouche +@format +EnableVendor()@end format +@end cartouche + +Enables automatic drill size mapping. +@c ./../src/vendor.c 146 + +@cindex vendor map +@cindex vendor drill table +@findex EnableVendor() + +When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor resource file containing a drill table must be +loaded first. + + +@node execcommand Action +@subsection execcommand +@c key execcommand in hid +@cartouche +@format +ExecCommand(command)@end format +@end cartouche + +Runs a command. +@c ./../src/action.c 6234 + +Runs the given command, which is a system executable. + + +@node ExecuteFile Action +@subsection ExecuteFile +@c key ExecuteFile in hid +@cartouche +@format +ExecuteFile(filename)@end format +@end cartouche + +Run actions from the given file. +@c ./../src/action.c 5861 + +Lines starting with @code{#} are ignored. + + +@node Flip Action +@subsection Flip +@c key Flip in hid +@cartouche +@format +Flip(Object|Selected|SelectedElements)@end format +@end cartouche + +Flip an element to the opposite side of the board. +@c ./../src/action.c 1841 + +Note that the location of the element will be symmetric about the +cursor location; i.e. if the part you are pointing at will still be at +the same spot once the element is on the other side. When flipping +multiple elements, this retains their positions relative to each +other, not their absolute positions on the board. + + +@node FontEdit Action +@subsection FontEdit +@c key FontEdit in hid +@cartouche +@format +FontEdit()@end format +@end cartouche + +Convert the current font to a PCB for editing. +@c ./../src/fontmode.c 73 + + +@node FontSave Action +@subsection FontSave +@c key FontSave in hid +@cartouche +@format +FontSave()@end format +@end cartouche + +Convert the current PCB back to a font. +@c ./../src/fontmode.c 173 + + +@node FreeRotateBuffer Action +@subsection FreeRotateBuffer +@c key FreeRotateBuffer in hid +@cartouche +@format +FreeRotateBuffer([Angle])@end format +@end cartouche + +Rotates the current paste buffer contents by the specified angle. The +angle is given in degrees. If no angle is given, the user is prompted +for one. + +@c ./../src/buffer.c 1370 + +Rotates the contents of the pastebuffer by an arbitrary angle. If no +angle is given, the user is prompted for one. + + +@node GlobalPuller Action +@subsection GlobalPuller +@c key GlobalPuller in hid +@cartouche +@format +GlobalPuller()@end format +@end cartouche + +Pull all traces tight. +@c ./../src/puller.c 534 + + +@node h Action +@subsection h +@c key h in hid +@cartouche +@format +h@end format +@end cartouche + +Print a help message for commands. +@c ./../src/command.c 72 + +@colonaction + + +@node Import Action +@subsection Import +@c key Import in hid +@cartouche +@format +Import() +Import([gnetlist|make[,source,source,...]]) +Import(setnewpoint[,(mark|center|X,Y)]) +Import(setdisperse,D,units) +@end format +@end cartouche + +Import schematics. +@c ./../src/action.c 6464 + +Imports element and netlist data from the schematics (or some other +source). The first parameter, which is optional, is the mode. If not +specified, the @code{import::mode} attribute in the PCB is used. +@code{gnetlist} means gnetlist is used to obtain the information from +the schematics. @code{make} invokes @code{make}, assuming the user +has a @code{Makefile} in the current directory. The @code{Makefile} +will be invoked with the following variables set: + +@table @code + +@item PCB +The name of the .pcb file + +@item SRCLIST +A space-separated list of source files + +@item OUT +The name of the file in which to put the command script, which may +contain any @pcb{} actions. By default, this is a temporary file +selected by @pcb{}, but if you specify an @code{import::outfile} +attribute, that file name is used instead (and not automatically +deleted afterwards). + +@end table + +The target specified to be built is the first of these that apply: + +@itemize @bullet + +@item +The target specified by an @code{import::target} attribute. + +@item +The output file specified by an @code{import::outfile} attribute. + +@item +If nothing else is specified, the target is @code{pcb_import}. + +@end itemize + +If you specify an @code{import::makefile} attribute, then "-f " will be added to the command line. + +If you specify the mode, you may also specify the source files +(schematics). If you do not specify any, the list of schematics is +obtained by reading the @code{import::src@var{N}} attributes (like +@code{import::src0}, @code{import::src1}, etc). + +For compatibility with future extensions to the import file format, +the generated file @emph{must not} start with the two characters +@code{#%}. + +If a temporary file is needed the @code{TMPDIR} environment variable +is used to select its location. + +Note that the programs @code{gnetlist} and @code{make} may be +overridden by the user via the @code{make-program} and @code{gnetlist} +@code{pcb} settings (i.e. in @code{~/.pcb/settings} or on the command +line). + +If @pcb{} cannot determine which schematic(s) to import from, the GUI +is called to let user choose (see @code{ImportGUI()}). + +Note that Import() doesn't delete anything - after an Import, elements +which shouldn't be on the board are selected and may be removed once +it's determined that the deletion is appropriate. + +If @code{Import()} is called with @code{setnewpoint}, then the location +of new components can be specified. This is where parts show up when +they're added to the board. The default is the center of the board. + +@table @code + +@item Import(setnewpoint) + +Prompts the user to click on the board somewhere, uses that point. If +called by a hotkey, uses the current location of the crosshair. + +@item Import(setnewpoint,mark) + +Uses the location of the mark. If no mark is present, the point is +not changed. + +@item Import(setnewpoint,center) + +Resets the point to the center of the board. + +@item Import(setnewpoint,X,Y,units) + +Sets the point to the specific coordinates given. Example: +@code{Import(setnewpoint,50,25,mm)} + +@end table + +Note that the X and Y locations are stored in attributes named +@code{import::newX} and @code{import::newY} so you could change them +manually if you wished. + +Calling @code{Import(setdisperse,D,units)} sets how much the newly +placed elements are dispersed relative to the set point. For example, +@code{Import(setdisperse,10,mm)} will offset each part randomly up to +10mm away from the point. The default dispersion is 1/10th of the +smallest board dimension. Dispersion is saved in the +@code{import::disperse} attribute. + + +@node l Action +@subsection l +@c key l in hid +@cartouche +@format +l [name]@end format +@end cartouche + +Loads layout data. +@c ./../src/command.c 99 + +Loads a new datafile (layout) and, if confirmed, overwrites any +existing unsaved data. The filename and the searchpath +(@emph{filePath}) are passed to the command defined by +@emph{fileCommand}. If no filename is specified a file select box +will popup. + +@colonaction + + +@node le Action +@subsection le +@c key le in hid +@cartouche +@format +le [name]@end format +@end cartouche + +Loads an element into the current buffer. +@c ./../src/command.c 129 + +The filename and the searchpath (@emph{elementPath}) are passed to the +command defined by @emph{elementCommand}. If no filename is specified +a file select box will popup. + +@colonaction + + +@node LoadFootprint Action +@subsection LoadFootprint +@c key LoadFootprint in hid +@cartouche +@format +LoadFootprint(filename[,refdes,value])@end format +@end cartouche + +Loads a single footprint by name. +@c ./../src/buffer.c 809 + +Loads a single footprint by name, rather than by reference or through +the library. If a refdes and value are specified, those are inserted +into the footprint as well. The footprint remains in the paste buffer. + + +@node LoadFrom Action +@subsection LoadFrom +@c key LoadFrom in hid +@cartouche +@format +LoadFrom(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert,filename)@end format +@end cartouche + +Load layout data from a file. +@c ./../src/action.c 5031 + +This action assumes you know what the filename is. The various GUIs +should have a similar @code{Load} action where the filename is +optional, and will provide their own file selection mechanism to let +you choose the file name. + +@table @code + +@item Layout +Loads an entire PCB layout, replacing the current one. + +@item LayoutToBuffer +Loads an entire PCB layout to the paste buffer. + +@item ElementToBuffer +Loads the given element file into the paste buffer. Element files +contain only a single @code{Element} definition, such as the +``newlib'' library uses. + +@item Netlist +Loads a new netlist, replacing any current netlist. + +@item Revert +Re-loads the current layout from its disk file, reverting any changes +you may have made. + +@end table + + +@node LoadVendorFrom Action +@subsection LoadVendorFrom +@c key LoadVendorFrom in hid +@cartouche +@format +LoadVendorFrom(filename)@end format +@end cartouche + +Loads the specified vendor resource file. +@c ./../src/vendor.c 201 + +@cindex vendor map +@cindex vendor drill table +@findex LoadVendorFrom() + +@table @var +@item filename +Name of the vendor resource file. If not specified, the user will +be prompted to enter one. +@end table + + +@node m Action +@subsection m +@c key m in hid +@cartouche +@format +m [name]@end format +@end cartouche + +Loads a layout into the current buffer. +@c ./../src/command.c 157 + +The filename and the searchpath (@emph{filePath}) are passed to the +command defined by @emph{fileCommand}. +If no filename is specified a file select box will popup. + +@colonaction + + +@node MarkCrosshair Action +@subsection MarkCrosshair +@c key MarkCrosshair in hid +@cartouche +@format +MarkCrosshair() +MarkCrosshair(Center)@end format +@end cartouche + +Set/Reset the Crosshair mark. +@c ./../src/action.c 3502 + +The ``mark'' is a small X-shaped target on the display which is +treated like a second origin (the normal origin is the upper let +corner of the board). The GUI will display a second set of +coordinates for this mark, which tells you how far you are from it. + +If no argument is given, the mark is toggled - disabled if it was +enabled, or enabled at the current cursor position of disabled. If +the @code{Center} argument is given, the mark is moved to the current +cursor location. + + +@node Message Action +@subsection Message +@c key Message in hid +@cartouche +@format +Message(message)@end format +@end cartouche + +Writes a message to the log window. +@c ./../src/action.c 1886 + +This action displays a message to the log window. This action is primarily +provided for use by other programs which may interface with PCB. If +multiple arguments are given, each one is sent to the log window +followed by a newline. + + +@node MinClearGap Action +@subsection MinClearGap +@c key MinClearGap in hid +@cartouche +@format +MinClearGap(delta) +MinClearGap(Selected, delta)@end format +@end cartouche + +Ensures that polygons are a minimum distance from objects. +@c ./../src/action.c 3827 + +Checks all specified objects, and increases the polygon clearance if +needed to ensure a minimum distance between their edges and the +polygon edges. + + +@node MinMaskGap Action +@subsection MinMaskGap +@c key MinMaskGap in hid +@cartouche +@format +MinMaskGap(delta) +MinMaskGap(Selected, delta)@end format +@end cartouche + +Ensures the mask is a minimum distance from pins and pads. +@c ./../src/action.c 3752 + +Checks all specified pins and/or pads, and increases the mask if +needed to ensure a minimum distance between the pin or pad edge and +the mask edge. + + +@node Mode Action +@subsection Mode +@c key Mode in hid +@cartouche +@format +Mode(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer) +Mode(Polygon|Rectangle|Remove|Rotate|Text|Thermal|Via) +Mode(Notify|Release|Cancel|Stroke) +Mode(Save|Restore)@end format +@end cartouche + +Change or use the tool mode. +@c ./../src/action.c 2612 + +@table @code + +@item Arc +@itemx Arrow +@itemx Copy +@itemx InsertPoint +@itemx Line +@itemx Lock +@itemx Move +@itemx None +@itemx PasteBuffer +@itemx Polygon +@itemx Rectangle +@itemx Remove +@itemx Rotate +@itemx Text +@itemx Thermal +@itemx Via +Select the indicated tool. + +@item Notify +Called when you press the mouse button, or move the mouse. + +@item Release +Called when you release the mouse button. + +@item Cancel +Cancels any pending tool activity, allowing you to restart elsewhere. +For example, this allows you to start a new line rather than attach a +line to the previous line. + +@item Escape +Similar to Cancel but calling this action a second time will return +to the Arrow tool. + +@item Stroke +If your @code{pcb} was built with libstroke, this invokes the stroke +input method. If not, this will restart a drawing mode if you were +drawing, else it will select objects. + +@item Save +Remembers the current tool. + +@item Restore +Restores the tool to the last saved tool. + +@end table + + +@node MorphPolygon Action +@subsection MorphPolygon +@c key MorphPolygon in hid +@cartouche +@format +MorphPolygon(Object|Selected)@end format +@end cartouche + +Converts dead polygon islands into separate polygons. +@c ./../src/action.c 4087 + +If a polygon is divided into unconnected "islands", you can use +this command to convert the otherwise disappeared islands into +separate polygons. Be sure the cursor is over a portion of the +polygon that remains visible. Very small islands that may flake +off are automatically deleted. + + +@node MoveLayer Action +@subsection MoveLayer +@c key MoveLayer in hid +@cartouche +@format +MoveLayer(old,new)@end format +@end cartouche + +Moves/Creates/Deletes Layers. +@c ./../src/move.c 1091 + +Moves a layer, creates a new layer, or deletes a layer. + +@table @code + +@item old +The is the layer number to act upon. Allowed values are: +@table @code + +@item c +Currently selected layer. + +@item -1 +Create a new layer. + +@item number +An existing layer number. + +@end table + +@item new +Specifies where to move the layer to. Allowed values are: +@table @code +@item -1 +Deletes the layer. + +@item up +Moves the layer up. + +@item down +Moves the layer down. + +@item c +Creates a new layer. + +@end table + +@end table + + +@node MoveObject Action +@subsection MoveObject +@c key MoveObject in hid +@cartouche +@format +MoveObject(X,Y,dim)@end format +@end cartouche + +Moves the object under the crosshair. +@c ./../src/action.c 5567 + +The @code{X} and @code{Y} are treated like @code{delta} is for many +other objects. For each, if it's prefixed by @code{+} or @code{-}, +then that amount is relative. Otherwise, it's absolute. Units can be +@code{mil} or @code{mm}; if unspecified, units are PCB's internal +units, currently 1/100 mil. + + +@node MoveToCurrentLayer Action +@subsection MoveToCurrentLayer +@c key MoveToCurrentLayer in hid +@cartouche +@format +MoveToCurrentLayer(Object|SelectedObjects)@end format +@end cartouche + +Moves objects to the current layer. +@c ./../src/action.c 5609 + +Note that moving an element from a component layer to a solder layer, +or from solder to component, won't automatically flip it. Use the +@code{Flip()} action to do that. + + +@node Netlist Action +@subsection Netlist +@c key Netlist in hid +@cartouche +@format +Net(find|select|rats|norats|clear[,net[,pin]]) +Net(freeze|thaw|forcethaw) +Net(add,net,pin)@end format +@end cartouche + +Perform various actions on netlists. +@c ./../src/netlist.c 289 + +Each of these actions apply to a specified set of nets. @var{net} and +@var{pin} are patterns which match one or more nets or pins; these +patterns may be full names or regular expressions. If an exact match +is found, it is the only match; if no exact match is found, +@emph{then} the pattern is tried as a regular expression. + +If neither @var{net} nor @var{pin} are specified, all nets apply. If +@var{net} is specified but not @var{pin}, all nets matching @var{net} +apply. If both are specified, nets which match @var{net} and contain +a pin matching @var{pin} apply. + +@table @code + +@item find +Nets which apply are marked @emph{found} and are drawn in the +@code{connected-color} color. + +@item select +Nets which apply are selected. + +@item rats +Nets which apply are marked as available for the rats nest. + +@item norats +Nets which apply are marked as not available for the rats nest. + +@item clear +Clears the netlist. + +@item add +Add the given pin to the given netlist, creating either if needed. + +@item sort +Called after a list of add's, this sorts the netlist. + +@item freeze +@itemx thaw +@itemx forcethaw +Temporarily prevents changes to the netlist from being reflected in +the GUI. For example, if you need to make multiple changes, you +freeze the netlist, make the changes, then thaw it. Note that +freeze/thaw requests may nest, with the netlist being fully thawed +only when all pending freezes are thawed. You can bypass the nesting +by using forcethaw, which resets the freeze count and immediately +updates the GUI. + +@end table + + +@node New Action +@subsection New +@c key New in hid +@cartouche +@format +New([name])@end format +@end cartouche + +Starts a new layout. +@c ./../src/action.c 5093 + +If a name is not given, one is prompted for. + + +@node OptAutoOnly Action +@subsection OptAutoOnly +@c key OptAutoOnly in hid +@cartouche +@format +OptAutoOnly()@end format +@end cartouche + +Toggles the optimize-only-autorouted flag. +@c ./../src/djopt.c 129 + +The original purpose of the trace optimizer was to clean up the traces +created by the various autorouters that have been used with PCB. When +a board has a mix of autorouted and carefully hand-routed traces, you +don't normally want the optimizer to move your hand-routed traces. +But, sometimes you do. By default, the optimizer only optimizes +autorouted traces. This action toggles that setting, so that you can +optimize hand-routed traces also. + + +@node PasteBuffer Action +@subsection PasteBuffer +@c key PasteBuffer in hid +@cartouche +@format +PasteBuffer(AddSelected|Clear|1..MAX_BUFFER) +PasteBuffer(Rotate, 1..3) +PasteBuffer(Convert|Save|Restore|Mirror) +PasteBuffer(ToLayout, X, Y, units)@end format +@end cartouche + +Various operations on the paste buffer. +@c ./../src/action.c 5153 + +There are a number of paste buffers; the actual limit is a +compile-time constant @code{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. + +@table @code + +@item AddSelected +Copies the selected objects to the current paste buffer. + +@item Clear +Remove all objects from the current paste buffer. + +@item Convert +Convert the current paste buffer to an element. Vias are converted to +pins, lines are converted to pads. + +@item Restore +Convert any elements in the paste buffer back to vias and lines. + +@item Mirror +Flip all objects in the paste buffer vertically (up/down flip). To mirror +horizontally, combine this with rotations. + +@item Rotate +Rotates the current buffer. The number to pass is 1..3, where 1 means +90 degrees counter clockwise, 2 means 180 degrees, and 3 means 90 +degrees clockwise (270 CCW). + +@item Save +Saves any elements in the current buffer to the indicated file. + +@item ToLayout +Pastes any elements in the current buffer to the indicated X, Y +coordinates in the layout. The @code{X} and @code{Y} are treated like +@code{delta} is for many other objects. For each, if it's prefixed by +@code{+} or @code{-}, then that amount is relative to the last +location. Otherwise, it's absolute. Units can be +@code{mil} or @code{mm}; if unspecified, units are PCB's internal +units, currently 1/100 mil. + + +@item 1..MAX_BUFFER +Selects the given buffer to be the current paste buffer. + +@end table + + +@node Polygon Action +@subsection Polygon +@c key Polygon in hid +@cartouche +@format +Polygon(Close|PreviousPoint)@end format +@end cartouche + +Some polygon related stuff. +@c ./../src/action.c 5503 + +Polygons need a special action routine to make life easier. + +@table @code + +@item Close +Creates the final segment of the polygon. This may fail if clipping +to 45 degree lines is switched on, in which case a warning is issued. + +@item PreviousPoint +Resets the newly entered corner to the previous one. The Undo action +will call Polygon(PreviousPoint) when appropriate to do so. + +@end table + + +@node Puller Action +@subsection Puller +@c key Puller in hid +@cartouche +@format +Puller()@end format +@end cartouche + +Pull an arc-line junction tight. +@c ./../src/puller.c 411 + +The @code{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, +the left side is ``before'' with the black target marking where to put +the crosshair: + +@center @image{puller,,,Example of how puller works,png} + +The right side is ``after'' with the black target marking where the +arc-line intersection was moved to. + + +@node q Action +@subsection q +@c key q in hid +@cartouche +@format +q@end format +@end cartouche + +Quits the application after confirming. +@c ./../src/command.c 185 + +If you have unsaved changes, you will be prompted to confirm (or +save) before quitting. + +@colonaction + + +@node q! Action +@subsection q! +@c key q! in hid +@cartouche +@format +q!@end format +@end cartouche + +Quits the application without confirming. +@c ./../src/command.c 199 + +Note that this command neither saves your data nor prompts for +confirmation. + +@colonaction + + +@node Quit Action +@subsection Quit +@c key Quit in hid +@cartouche +@format +Quit()@end format +@end cartouche + +Quits the application after confirming. +@c ./../src/action.c 2071 + +If you have unsaved changes, you will be prompted to confirm (or +save) before quitting. + + +@node Redo Action +@subsection Redo +@c key Redo in hid +@cartouche +@format +Redo()@end format +@end cartouche + +Redo recent``undo''operations. +@c ./../src/action.c 5468 + +This routine allows you to recover from the last undo command. You +might want to do this if you thought that undo was going to revert +something other than what it actually did (in case you are confused +about which operations are un-doable), or if you have been backing up +through a long undo list and over-shoot your stopping point. Any +change that is made since the undo in question will trim the redo +list. For example if you add ten lines, then undo three of them you +could use redo to put them back, but if you move a line on the board +before performing the redo, you will lose the ability to "redo" the +three "undone" lines. + + +@node RemoveSelected Action +@subsection RemoveSelected +@c key RemoveSelected in hid +@cartouche +@format +RemoveSelected()@end format +@end cartouche + +Removes any selected objects. +@c ./../src/action.c 2832 + + +@node Renumber Action +@subsection Renumber +@c key Renumber in hid +@cartouche +@format +Renumber() +Renumber(filename)@end format +@end cartouche + +Renumber all elements. The changes will be recorded to filename +for use in backannotating these changes to the schematic. +@c ./../src/action.c 2848 + + +@node Report Action +@subsection Report +@c key Report in hid +@cartouche +@format +Report(Object|DrillReport|FoundPins|NetLength|AllNetLengths|[,name])@end format +@end cartouche + +Produce various report. +@c ./../src/report.c 942 + +@table @code + +@item Object +The object under the crosshair will be reported, describing various +aspects of the object. + +@item DrillReport +A report summarizing the number of drill sizes used, and how many of +each, will be produced. + +@item FoundPins +A report listing all pins and pads which are marked as ``found'' will +be produced. + +@item NetLength +The name and length of the net under the crosshair will be reported to +the message log. + +@item AllNetLengths +The name and length of the net under the crosshair will be reported to +the message log. An optional parameter specifies mm, mil, pcb, or in +units + +@end table + + +@node ReportDialog Action +@subsection ReportDialog +@c key ReportDialog in hid +@cartouche +@format +ReportDialog()@end format +@end cartouche + +Report on the object under the crosshair +@c ./../src/report.c 125 + +This is a shortcut for @code{Report(Object)}. + + +@node RipUp Action +@subsection RipUp +@c key RipUp in hid +@cartouche +@format +RipUp(All|Selected|Element)@end format +@end cartouche + +Ripup auto-routed tracks, or convert an element to parts. +@c ./../src/action.c 3199 + +@table @code + +@item All +Removes all lines and vias which were created by the autorouter. + +@item Selected +Removes all selected lines and vias which were created by the +autorouter. + +@item Element +Converts the element under the cursor to parts (vias and lines). Note +that this uses the highest numbered paste buffer. + +@end table + + +@node rn Action +@subsection rn +@c key rn in hid +@cartouche +@format +rn [name]@end format +@end cartouche + +Reads netlist. +@c ./../src/command.c 214 + +If no filename is given a file select box will pop up. The file is +read via the command defined by the @emph{RatCommand} resource. The +command must send its output to @emph{stdout}. + +Netlists are used for generating rat's nests (see @ref{Rats Nest}) and +for verifying the board layout (which is also accomplished by the +@emph{Ratsnest} command). + +@colonaction + + +@node RouteStyle Action +@subsection RouteStyle +@c key RouteStyle in hid +@cartouche +@format +RouteStyle(1|2|3|4)@end format +@end cartouche + +Copies the indicated routing style into the current sizes. +@c ./../src/action.c 5535 + + +@node s Action +@subsection s +@c key s in hid +@cartouche +@format +s [name]@end format +@end cartouche + +Saves layout data. +@c ./../src/command.c 244 + +Data and the filename are passed to the command defined by the +resource @emph{saveCommand}. It must read the layout data from +@emph{stdin}. If no filename is entered, either the last one is used +again or, if it is not available, a file select box will pop up. + +@colonaction + + +@node SaveSettings Action +@subsection SaveSettings +@c key SaveSettings in hid +@cartouche +@format +SaveSettings() +SaveSettings(local)@end format +@end cartouche + +Saves settings. +@c ./../src/action.c 5015 + +If you pass no arguments, the settings are stored in +@code{$HOME/.pcb/settings}. If you pass the word @code{local} they're +saved in @code{./pcb.settings}. + + +@node SaveTo Action +@subsection SaveTo +@c key SaveTo in hid +@cartouche +@format +SaveTo(Layout|LayoutAs,filename) +SaveTo(AllConnections|AllUnusedPins|ElementConnections,filename) +SaveTo(PasteBuffer,filename)@end format +@end cartouche + +Saves data to a file. +@c ./../src/action.c 4919 + +@table @code + +@item Layout +Saves the current layout. + +@item LayoutAs +Saves the current layout, and remembers the filename used. + +@item AllConnections +Save all connections to a file. + +@item AllUnusedPins +List all unused pins to a file. + +@item ElementConnections +Save connections to the element at the cursor to a file. + +@item PasteBuffer +Save the content of the active Buffer to a file. This is the graphical way to create a footprint. + +@end table + + +@node Select Action +@subsection Select +@c key Select in hid +@cartouche +@format +Select(Object|ToggleObject) +Select(All|Block|Connection) +Select(ElementByName|ObjectByName|PadByName|PinByName) +Select(ElementByName|ObjectByName|PadByName|PinByName, Name) +Select(TextByName|ViaByName|NetByName) +Select(TextByName|ViaByName|NetByName, Name) +Select(Convert)@end format +@end cartouche + +Toggles or sets the selection. +@c ./../src/action.c 4651 + +@table @code + +@item ElementByName +@item ObjectByName +@item PadByName +@item PinByName +@item TextByName +@item ViaByName +@item NetByName + +These all rely on having a regular expression parser built into +@code{pcb}. If the name is not specified then the user is prompted +for a pattern, and all objects that match the pattern and are of the +type specified are selected. + +@item Object +@item ToggleObject +Selects the object under the cursor. + +@item Block +Selects all objects in a rectangle indicated by the cursor. + +@item All +Selects all objects on the board. + +@item Connection +Selects all connections with the ``found'' flag set. + +@item Convert +Converts the selected objects to an element. This uses the highest +numbered paste buffer. + +@end table + + +@node SetFlag Action +@subsection SetFlag +@c key SetFlag in hid +@cartouche +@format +SetFlag(Object|Selected|SelectedObjects, flag) +SetFlag(SelectedLines|SelectedPins|SelectedVias, flag) +SetFlag(SelectedPads|SelectedTexts|SelectedNames, flag) +SetFlag(SelectedElements, flag) +flag = square | octagon | thermal | join@end format +@end cartouche + +Sets flags on objects. +@c ./../src/action.c 5716 + +Turns the given flag on, regardless of its previous setting. See +@code{ChangeFlag}. + +@example +SetFlag(SelectedPins,thermal) +@end example + + +@node SetOctagon Action +@subsection SetOctagon +@c key SetOctagon in hid +@cartouche +@format +SetOctagon(Object|ToggleObject|SelectedElements|Selected)@end format +@end cartouche + +Sets the octagon-flag of objects. +@c ./../src/action.c 4459 + +@pinshapes + + +@node SetSame Action +@subsection SetSame +@c key SetSame in hid +@cartouche +@format +SetSame()@end format +@end cartouche + +Sets current layer and sizes to match indicated item. +@c ./../src/action.c 5648 + +When invoked over any line, arc, polygon, or via, this changes the +current layer to be the layer that item is on, and changes the current +sizes (thickness, keepaway, drill, etc) according to that item. + + +@node SetSquare Action +@subsection SetSquare +@c key SetSquare in hid +@cartouche +@format +SetSquare(ToggleObject|SelectedElements|SelectedPins)@end format +@end cartouche + +sets the square-flag of objects. +@c ./../src/action.c 4301 + +Note that @code{Pins} means pins and pads. + +@pinshapes + + +@node SetThermal Action +@subsection SetThermal +@c key SetThermal in hid +@cartouche +@format +SetThermal(Object|SelectedPins|SelectedVias|Selected, Style)@end format +@end cartouche + +Set the thermal (on the current layer) of pins or vias to the given style. +Style = 0 means no thermal. +Style = 1 has diagonal fingers with sharp edges. +Style = 2 has horizontal and vertical fingers with sharp edges. +Style = 3 is a solid connection to the plane.Style = 4 has diagonal fingers with rounded edges. +Style = 5 has horizontal and vertical fingers with rounded edges. + +@c ./../src/action.c 1912 + +This changes how/whether pins or vias connect to any rectangle or polygon +on the current layer. The first argument can specify one object, or all +selected pins, or all selected vias, or all selected pins and vias. +The second argument specifies the style of connection. +There are 5 possibilities: +0 - no connection, +1 - 45 degree fingers with sharp edges, +2 - horizontal & vertical fingers with sharp edges, +3 - solid connection, +4 - 45 degree fingers with rounded corners, +5 - horizontal & vertical fingers with rounded corners. + +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. + +@node SetValue Action +@subsection SetValue +@c key SetValue in hid +@cartouche +@format +SetValue(Grid|Line|LineSize|Text|TextScale|ViaDrillingHole|Via|ViaSize, delta)@end format +@end cartouche + +Change various board-wide values and sizes. +@c ./../src/action.c 1996 + +@table @code + +@item ViaDrillingHole +Changes the diameter of the drill for new vias. + +@item Grid +Sets the grid spacing. + +@item Line +@item LineSize +Changes the thickness of new lines. + +@item Via +@item ViaSize +Changes the diameter of new vias. + +@item Text +@item TextScale +Changes the size of new text. + +@end table + + +@node ToggleHideName Action +@subsection ToggleHideName +@c key ToggleHideName in hid +@cartouche +@format +ToggleHideName(Object|SelectedElements)@end format +@end cartouche + +Toggles the visibility of element names. +@c ./../src/action.c 4134 + +If names are hidden you won't see them on the screen and they will not +appear on the silk layer when you print the layout. + + +@node ToggleVendor Action +@subsection ToggleVendor +@c key ToggleVendor in hid +@cartouche +@format +ToggleVendor()@end format +@end cartouche + +Toggles the state of automatic drill size mapping. +@c ./../src/vendor.c 128 + +@cindex vendor map +@cindex vendor drill table +@findex ToggleVendor() + +When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor resource file containing a drill table must be +loaded first. + + +@node Undo Action +@subsection Undo +@c key Undo in hid +@cartouche +@format +Undo() +Undo(ClearList)@end format +@end cartouche + +Undo recent changes. +@c ./../src/action.c 5304 + +The unlimited undo feature of @code{Pcb} allows you to recover from +most operations that materially affect you work. Calling +@code{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}. + +Note that undo groups operations by serial number; changes with the +same serial number will be undone (or redone) as a group. See +@code{Atomic}. + + +@node UnloadVendor Action +@subsection UnloadVendor +@c key UnloadVendor in hid +@cartouche +@format +UnloadVendor()@end format +@end cartouche + +Unloads the current vendor drill mapping table. +@c ./../src/vendor.c 176 + +@cindex vendor map +@cindex vendor drill table +@findex UnloadVendor() + + +@node Unselect Action +@subsection Unselect +@c key Unselect in hid +@cartouche +@format +Unselect(All|Block|Connection) +Unselect(ElementByName|ObjectByName|PadByName|PinByName) +Unselect(ElementByName|ObjectByName|PadByName|PinByName, Name) +Unselect(TextByName|ViaByName) +Unselect(TextByName|ViaByName, Name) +@end format +@end cartouche + +Unselects the object at the pointer location or the specified objects. +@c ./../src/action.c 4803 + +@table @code + +@item All +Unselect all objects. + +@item Block +Unselect all objects in a rectangle given by the cursor. + +@item Connection +Unselect all connections with the ``found'' flag set. + +@item ElementByName +@item ObjectByName +@item PadByName +@item PinByName +@item TextByName +@item ViaByName + +These all rely on having a regular expression parser built into +@code{pcb}. If the name is not specified then the user is prompted +for a pattern, and all objects that match the pattern and are of the +type specified are unselected. + + +@end table + + +@node w Action +@subsection w +@c key w in hid +@cartouche +@format +w [name]@end format +@end cartouche + +Saves layout data. +@c ./../src/command.c 250 + +This commands has been added for the convenience of @code{vi} users +and has the same functionality as @code{s}. + +@colonaction + + +@node wq Action +@subsection wq +@c key wq in hid +@cartouche +@format +wq@end format +@end cartouche + +Saves the layout data and quits. +@c ./../src/command.c 291 + +This command has been added for the convenience of @code{vi} users and +has the same functionality as @code{s} combined with @code{q}. + +@colonaction + + +@node common actions +@section common actions +@c ./../src/hid/common/actions.c 425 + +@macro hidaction + +This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + +@end macro + +@menu +* LayersChanged Action:: Tells the GUI that the layers have changed. +* LibraryChanged Action:: Tells the GUI that the libraries have changed. +* NetlistChanged Action:: Tells the GUI that the netlist has changed. +* PCBChanged Action:: 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 beingreloaded, and that it might keep some viewport settings +* RouteStylesChanged Action:: Tells the GUI that the routing styles have changed. +@end menu +@node LayersChanged Action +@subsection LayersChanged +@c key LayersChanged in hid common +@cartouche +@format +LayersChanged()@end format +@end cartouche + +Tells the GUI that the layers have changed. +@c ./../src/hid/common/actions.c 446 + +This includes layer names, colors, stacking order, visibility, etc. + +@hidaction + + +@node LibraryChanged Action +@subsection LibraryChanged +@c key LibraryChanged in hid common +@cartouche +@format +LibraryChanged()@end format +@end cartouche + +Tells the GUI that the libraries have changed. +@c ./../src/hid/common/actions.c 451 + +@hidaction + + +@node NetlistChanged Action +@subsection NetlistChanged +@c key NetlistChanged in hid common +@cartouche +@format +NetlistChanged()@end format +@end cartouche + +Tells the GUI that the netlist has changed. +@c ./../src/hid/common/actions.c 441 + +@hidaction + + +@node PCBChanged Action +@subsection PCBChanged +@c key PCBChanged in hid common +@cartouche +@format +PCBChanged([revert])@end format +@end cartouche + +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 beingreloaded, and that it might keep some viewport settings +@c ./../src/hid/common/actions.c 431 + +@hidaction + + +@node RouteStylesChanged Action +@subsection RouteStylesChanged +@c key RouteStylesChanged in hid common +@cartouche +@format +RouteStylesChanged()@end format +@end cartouche + +Tells the GUI that the routing styles have changed. +@c ./../src/hid/common/actions.c 436 + +@hidaction + + +@node gtk actions +@section gtk actions +@menu +* gtk About Action:: N_("Tell the user about this version of PCB."); +* gtk AdjustStyle Action:: Open the window which allows editing of the route styles. +* gtk Center Action:: N_("Moves the pointer to the center of the window."); +* gtk Cursor Action:: N_("Move the cursor."); +* gtk DoWindows Action:: N_("Open various GUI windows."); +* gtk EditLayerGroups Action:: Open the preferences window which allows editing of the layer groups. +* gtk GetXY Action:: N_("Get a coordinate."); +* gtk ImportGUI Action:: N_("Asks user which schematics to import into PCB. +"); +* gtk Pan Action:: N_("Start or stop panning (Mode = 1 to start, 0 to stop) +Optional thumb argument is ignored for now in gtk hid. +"); +* gtk Popup Action:: N_("Bring up the popup menu specified by @code{MenuName}. +If called by a mouse event then the mouse button number +must be specified as the optional second argument."); +* gtk Print Action:: N_("Print the layout."); +* gtk PrintCalibrate Action:: N_("Calibrate the printer."); +* gtk Save Action:: N_("Save layout and/or element data to a user-selected file."); +* gtk SelectLayer Action:: Select which layer is the current layer. +* gtk SetUnits Action:: N_("Set the default measurement units."); +* gtk SwapSides Action:: N_("Swaps the side of the board you're looking at."); +* gtk ToggleView Action:: Toggle the visibility of the specified layer or layer group. +* gtk Zoom Action:: N_("Various zoom factor changes."); +@end menu +@node gtk About Action +@subsection gtk About +@c key gtk About in hid gtk +@cartouche +@format +About()@end format +@end cartouche + +N_("Tell the user about this version of PCB."); +@c ./../src/hid/gtk/gtkhid-main.c 1059 + +This just pops up a dialog telling the user which version of +@code{pcb} they're running. + + +@node gtk AdjustStyle Action +@subsection gtk AdjustStyle +@c key gtk AdjustStyle in hid gtk +@cartouche +@format +AdjustStyle() +@end format +@end cartouche + +Open the window which allows editing of the route styles. +@c ./../src/hid/gtk/gui-top-window.c 2081 + +Opens the window which allows editing of the route styles. + + +@node gtk Center Action +@subsection gtk Center +@c key gtk Center in hid gtk +@cartouche +@format +Center() +@end format +@end cartouche + +N_("Moves the pointer to the center of the window."); +@c ./../src/hid/gtk/gtkhid-main.c 1470 + +Move the pointer to the center of the window, but only if it's +currently within the window already. + + +@node gtk Cursor Action +@subsection gtk Cursor +@c key gtk Cursor in hid gtk +@cartouche +@format +Cursor(Type,DeltaUp,DeltaRight,Units)@end format +@end cartouche + +N_("Move the cursor."); +@c ./../src/hid/gtk/gtkhid-main.c 1515 + +This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive @var{DeltaUp} may move the +cursor towards the board origin if the board is inverted. + +Type is one of @samp{Pan} or @samp{Warp}. @samp{Pan} causes the +viewport to move such that the crosshair is under the mouse cursor. +@samp{Warp} causes the mouse cursor to move to be above the crosshair. + +@var{Units} can be one of the following: + +@table @samp + +@item mil +@itemx mm +The cursor is moved by that amount, in board units. + +@item grid +The cursor is moved by that many grid points. + +@item view +The values are percentages of the viewport's view. Thus, a pan of +@samp{100} would scroll the viewport by exactly the width of the +current view. + +@item board +The values are percentages of the board size. Thus, a move of +@samp{50,50} moves you halfway across the board. + +@end table + + +@node gtk DoWindows Action +@subsection gtk DoWindows +@c key gtk DoWindows in hid gtk +@cartouche +@format +DoWindows(1|2|3|4|5|6) +DoWindows(Layout|Library|Log|Netlist|Preferences|DRC)@end format +@end cartouche + +N_("Open various GUI windows."); +@c ./../src/hid/gtk/gtkhid-main.c 1563 + +@table @code + +@item 1 +@itemx Layout +Open the layout window. Since the layout window is always shown +anyway, this has no effect. + +@item 2 +@itemx Library +Open the library window. + +@item 3 +@itemx Log +Open the log window. + +@item 4 +@itemx Netlist +Open the netlist window. + +@item 5 +@itemx Preferences +Open the preferences window. + +@item 6 +@itemx DRC +Open the DRC violations window. + +@end table + + +@node gtk EditLayerGroups Action +@subsection gtk EditLayerGroups +@c key gtk EditLayerGroups in hid gtk +@cartouche +@format +EditLayerGroups() +@end format +@end cartouche + +Open the preferences window which allows editing of the layer groups. +@c ./../src/hid/gtk/gui-top-window.c 2100 + +Opens the preferences window which is where the layer groups +are edited. This action is primarily provides to provide menu +resource compatibility with the lesstif HID. + + +@node gtk GetXY Action +@subsection gtk GetXY +@c key gtk GetXY in hid gtk +@cartouche +@format +GetXY()@end format +@end cartouche + +N_("Get a coordinate."); +@c ./../src/hid/gtk/gtkhid-main.c 1074 + +Prompts the user for a coordinate, if one is not already selected. + + +@node gtk ImportGUI Action +@subsection gtk ImportGUI +@c key gtk ImportGUI in hid gtk +@cartouche +@format +ImportGUI()@end format +@end cartouche + +N_("Asks user which schematics to import into PCB. +"); +@c ./../src/hid/gtk/gtkhid-main.c 1750 + +Asks user which schematics to import into PCB. + + +@node gtk Pan Action +@subsection gtk Pan +@c key gtk Pan in hid gtk +@cartouche +@format +Pan([thumb], Mode)@end format +@end cartouche + +N_("Start or stop panning (Mode = 1 to start, 0 to stop) +Optional thumb argument is ignored for now in gtk hid. +"); +@c ./../src/hid/gtk/gtkhid-main.c 1687 + +Start or stop panning. To start call with Mode = 1, to stop call with +Mode = 0. + + +@node gtk Popup Action +@subsection gtk Popup +@c key gtk Popup in hid gtk +@cartouche +@format +Popup(MenuName, [Button])@end format +@end cartouche + +N_("Bring up the popup menu specified by @code{MenuName}. +If called by a mouse event then the mouse button number +must be specified as the optional second argument."); +@c ./../src/hid/gtk/gtkhid-main.c 1719 + +This just pops up the specified menu. The menu must have been defined +as a named subresource of the Popups resource in the menu resource +file. + + +@node gtk Print Action +@subsection gtk Print +@c key gtk Print in hid gtk +@cartouche +@format +Print()@end format +@end cartouche + +N_("Print the layout."); +@c ./../src/hid/gtk/gtkhid-main.c 1350 + +This will find the default printing HID, prompt the user for its +options, and print the layout. + + +@node gtk PrintCalibrate Action +@subsection gtk PrintCalibrate +@c key gtk PrintCalibrate in hid gtk +@cartouche +@format +PrintCalibrate()@end format +@end cartouche + +N_("Calibrate the printer."); +@c ./../src/hid/gtk/gtkhid-main.c 1401 + +This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + + +@node gtk Save Action +@subsection gtk Save +@c key gtk Save in hid gtk +@cartouche +@format +Save() +Save(Layout|LayoutAs) +Save(AllConnections|AllUnusedPins|ElementConnections) +Save(PasteBuffer)@end format +@end cartouche + +N_("Save layout and/or element data to a user-selected file."); +@c ./../src/hid/gtk/gtkhid-main.c 1230 + +This action is a GUI front-end to the core's @code{SaveTo} action +(@pxref{SaveTo Action}). If you happen to pass a filename, like +@code{SaveTo}, then @code{SaveTo} is called directly. Else, the +user is prompted for a filename to save, and then @code{SaveTo} is +called with that filename. + + +@node gtk SelectLayer Action +@subsection gtk SelectLayer +@c key gtk SelectLayer in hid gtk +@cartouche +@format +SelectLayer(1..MAXLAYER|Silk|Rats)@end format +@end cartouche + +Select which layer is the current layer. +@c ./../src/hid/gtk/gui-top-window.c 1851 + +The specified layer becomes the currently active layer. It is made +visible if it is not already visible + + +@node gtk SetUnits Action +@subsection gtk SetUnits +@c key gtk SetUnits in hid gtk +@cartouche +@format +SetUnits(mm|mil)@end format +@end cartouche + +N_("Set the default measurement units."); +@c ./../src/hid/gtk/gtkhid-main.c 1606 + +@table @code + +@item mil +Sets the display units to mils (1/1000 inch). + +@item mm +Sets the display units to millimeters. + +@end table + + +@node gtk SwapSides Action +@subsection gtk SwapSides +@c key gtk SwapSides in hid gtk +@cartouche +@format +SwapSides(|v|h|r)@end format +@end cartouche + +N_("Swaps the side of the board you're looking at."); +@c ./../src/hid/gtk/gtkhid-main.c 1295 + +This action changes the way you view the board. + +@table @code + +@item v +Flips the board over vertically (up/down). + +@item h +Flips the board over horizontally (left/right), like flipping pages in +a book. + +@item r +Rotates the board 180 degrees without changing sides. + +@end table + +If no argument is given, the board isn't moved but the opposite side +is shown. + +Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + +As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the ``working +side'' of the board. + + +@node gtk ToggleView Action +@subsection gtk ToggleView +@c key gtk ToggleView in hid gtk +@cartouche +@format +ToggleView(1..MAXLAYER) +ToggleView(layername) +ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide)@end format +@end cartouche + +Toggle the visibility of the specified layer or layer group. +@c ./../src/hid/gtk/gui-top-window.c 1792 + +If you pass an integer, that layer is specified by index (the first +layer is @code{1}, etc). If you pass a layer name, that layer is +specified by name. When a layer is specified, the visibility of the +layer group containing that layer is toggled. + +If you pass a special layer name, the visibility of those components +(silk, rats, etc) is toggled. Note that if you have a layer named +the same as a special layer, the layer is chosen over the special layer. + + +@node gtk Zoom Action +@subsection gtk Zoom +@c key gtk Zoom in hid gtk +@cartouche +@format +Zoom() +Zoom(factor)@end format +@end cartouche + +N_("Various zoom factor changes."); +@c ./../src/hid/gtk/gtkhid-main.c 161 +Changes the zoom (magnification) of the view of the board. If no +arguments are passed, the view is scaled such that the board just fits +inside the visible window (i.e. ``view all''). Otherwise, +@var{factor} specifies a change in zoom factor. It may be prefixed by +@code{+}, @code{-}, or @code{=} to change how the zoom factor is +modified. The @var{factor} is a floating point number, such as +@code{1.5} or @code{0.75}. + +@table @code + +@item +@var{factor} +Values greater than 1.0 cause the board to be drawn smaller; more of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn bigger; less of the board will be visible. + +@item -@var{factor} +Values greater than 1.0 cause the board to be drawn bigger; less of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn smaller; more of the board will be visible. + +@item =@var{factor} + +The @var{factor} is an absolute zoom factor; the unit for this value +is "PCB units per screen pixel". Since PCB units are 0.01 mil, a +@var{factor} of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, +about the actual resolution of most screens - resulting in an "actual +size" board. Similarly, a @var{factor} of 100 gives you a 10x actual +size. + +@end table + +Note that zoom factors of zero are silently ignored. + + + + +@node lesstif actions +@section lesstif actions +@menu +* lesstif About Action:: Tell the user about this version of PCB. +* lesstif AdjustSizes Action:: Let the user change the board size, DRC parameters, etc +* lesstif AdjustStyle Action:: Displays the route style adjustment window. +* lesstif Benchmark Action:: Benchmark the GUI speed. +* lesstif Command Action:: Displays the command line input window. +* lesstif Cursor Action:: Move the cursor. +* lesstif Debug Action:: Debug action. +* lesstif DebugXY Action:: Debug action, with coordinates +* lesstif DoWindows Action:: Open various GUI windows. +* lesstif DumpKeys Action:: Dump Lesstif key bindings. +* lesstif EditLayerGroups Action:: Let the user change the layer groupings +* lesstif Export Action:: Export the layout. +* lesstif GetXY Action:: Get a coordinate. +* lesstif ImportGUI Action:: Lets the user choose the schematics to import from +* lesstif LibraryShow Action:: Displays the library window. +* lesstif Load Action:: Load layout data from a user-selected file. +* lesstif LoadVendor Action:: Loads a user-selected vendor resource file. +* lesstif NetlistShow Action:: Selects the given pinname or netname in the netlist window. +* lesstif Print Action:: Print the layout. +* lesstif PrintCalibrate Action:: Calibrate the printer. +* lesstif PromptFor Action:: Prompt for a response. +* lesstif Return Action:: Simulate a passing or failing action. +* lesstif Save Action:: Save layout data to a user-selected file. +* lesstif SelectLayer Action:: Select which layer is the current layer. +* lesstif SetUnits Action:: Set the default measurement units. +* lesstif SwapSides Action:: Swaps the side of the board you're looking at. +* lesstif ToggleView Action:: Toggle the visibility of the specified layer or layer group. +* lesstif Zoom Action:: Various zoom factor changes. +@end menu +@node lesstif About Action +@subsection lesstif About +@c key lesstif About in hid lesstif +@cartouche +@format +About()@end format +@end cartouche + +Tell the user about this version of PCB. +@c ./../src/hid/lesstif/dialogs.c 867 + +This just pops up a dialog telling the user which version of +@code{pcb} they're running. + + +@node lesstif AdjustSizes Action +@subsection lesstif AdjustSizes +@c key lesstif AdjustSizes in hid lesstif +@cartouche +@format +AdjustSizes()@end format +@end cartouche + +Let the user change the board size, DRC parameters, etc +@c ./../src/hid/lesstif/dialogs.c 1136 + +Displays a dialog box that lets the user change the board +size, DRC parameters, and text scale. + +The units are determined by the default display units. + + +@node lesstif AdjustStyle Action +@subsection lesstif AdjustStyle +@c key lesstif AdjustStyle in hid lesstif +@cartouche +@format +AdjustStyle()@end format +@end cartouche + +Displays the route style adjustment window. +@c ./../src/hid/lesstif/styles.c 344 + + +@node lesstif Benchmark Action +@subsection lesstif Benchmark +@c key lesstif Benchmark in hid lesstif +@cartouche +@format +Benchmark()@end format +@end cartouche + +Benchmark the GUI speed. +@c ./../src/hid/lesstif/main.c 659 + +This action is used to speed-test the Lesstif graphics subsystem. It +redraws the current screen as many times as possible in ten seconds. +It reports the amount of time needed to draw the screen once. + + +@node lesstif Command Action +@subsection lesstif Command +@c key lesstif Command in hid lesstif +@cartouche +@format +Command()@end format +@end cartouche + +Displays the command line input window. +@c ./../src/hid/lesstif/main.c 644 + +The command window allows the user to manually enter actions to be +executed. Action syntax can be done one of two ways: + +@table @code + +@item +Follow the action name by an open parenthesis, arguments separated by +commas, end with a close parenthesis. Example: @code{Abc(1,2,3)} + +@item +Separate the action name and arguments by spaces. Example: @code{Abc +1 2 3}. + +@end table + +The first option allows you to have arguments with spaces in them, +but the second is more ``natural'' to type for most people. + +Note that action names are not case sensitive, but arguments normally +are. However, most actions will check for ``keywords'' in a case +insensitive way. + +There are three ways to finish with the command window. If you press +the @code{Enter} key, the command is invoked, the window goes away, +and the next time you bring up the command window it's empty. If you +press the @code{Esc} key, the window goes away without invoking +anything, and the next time you bring up the command window it's +empty. If you change focus away from the command window (i.e. click +on some other window), the command window goes away but the next time +you bring it up it resumes entering the command you were entering +before. + + +@node lesstif Cursor Action +@subsection lesstif Cursor +@c key lesstif Cursor in hid lesstif +@cartouche +@format +Cursor(Type,DeltaUp,DeltaRight,Units)@end format +@end cartouche + +Move the cursor. +@c ./../src/hid/lesstif/main.c 716 + +This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive @var{DeltaUp} may move the +cursor towards the board origin if the board is inverted. + +Type is one of @samp{Pan} or @samp{Warp}. @samp{Pan} causes the +viewport to move such that the crosshair is under the mouse cursor. +@samp{Warp} causes the mouse cursor to move to be above the crosshair. + +@var{Units} can be one of the following: + +@table @samp + +@item mil +@itemx mm +The cursor is moved by that amount, in board units. + +@item grid +The cursor is moved by that many grid points. + +@item view +The values are percentages of the viewport's view. Thus, a pan of +@samp{100} would scroll the viewport by exactly the width of the +current view. + +@item board +The values are percentages of the board size. Thus, a move of +@samp{50,50} moves you halfway across the board. + +@end table + + +@node lesstif Debug Action +@subsection lesstif Debug +@c key lesstif Debug in hid lesstif +@cartouche +@format +Debug(...)@end format +@end cartouche + +Debug action. +@c ./../src/hid/lesstif/menu.c 66 + +This action exists to help debug scripts; it simply prints all its +arguments to stdout. + + +@node lesstif DebugXY Action +@subsection lesstif DebugXY +@c key lesstif DebugXY in hid lesstif +@cartouche +@format +DebugXY(...)@end format +@end cartouche + +Debug action, with coordinates +@c ./../src/hid/lesstif/menu.c 72 + +Like @code{Debug}, but requires a coordinate. If the user hasn't yet +indicated a location on the board, the user will be prompted to click +on one. + + +@node lesstif DoWindows Action +@subsection lesstif DoWindows +@c key lesstif DoWindows in hid lesstif +@cartouche +@format +DoWindows(1|2|3|4) +DoWindows(Layout|Library|Log|Netlist)@end format +@end cartouche + +Open various GUI windows. +@c ./../src/hid/lesstif/dialogs.c 831 + +@table @code + +@item 1 +@itemx Layout +Open the layout window. Since the layout window is always shown +anyway, this has no effect. + +@item 2 +@itemx Library +Open the library window. + +@item 3 +@itemx Log +Open the log window. + +@item 4 +@itemx Netlist +Open the netlist window. + +@end table + + +@node lesstif DumpKeys Action +@subsection lesstif DumpKeys +@c key lesstif DumpKeys in hid lesstif +@cartouche +@format +DumpKeys()@end format +@end cartouche + +Dump Lesstif key bindings. +@c ./../src/hid/lesstif/menu.c 101 + +Causes the list of key bindings (from @code{pcb-menu.res}) to be +dumped to stdout. This is most useful when invoked from the command +line like this: + +@example +pcb --action-string DumpKeys +@end example + + +@node lesstif EditLayerGroups Action +@subsection lesstif EditLayerGroups +@c key lesstif EditLayerGroups in hid lesstif +@cartouche +@format +EditLayerGroups()@end format +@end cartouche + +Let the user change the layer groupings +@c ./../src/hid/lesstif/dialogs.c 1448 + +Displays a dialog that lets the user view and change the layer +groupings. Each layer (row) can be a member of any one layer group +(column). Note the special layers @code{solder} and @code{component} +allow you to specify which groups represent the top and bottom of the +board. + +See @ref{ChangeName Action}. + + +@node lesstif Export Action +@subsection lesstif Export +@c key lesstif Export in hid lesstif +@cartouche +@format +Export()@end format +@end cartouche + +Export the layout. +@c ./../src/hid/lesstif/dialogs.c 957 + +Prompts the user for an exporter to use. Then, prompts the user for +that exporter's options, and exports the layout. + + +@node lesstif GetXY Action +@subsection lesstif GetXY +@c key lesstif GetXY in hid lesstif +@cartouche +@format +GetXY()@end format +@end cartouche + +Get a coordinate. +@c ./../src/hid/lesstif/menu.c 54 + +Prompts the user for a coordinate, if one is not already selected. + + +@node lesstif ImportGUI Action +@subsection lesstif ImportGUI +@c key lesstif ImportGUI in hid lesstif +@cartouche +@format +ImportGUI()@end format +@end cartouche + +Lets the user choose the schematics to import from +@c ./../src/hid/lesstif/dialogs.c 1882 + +Displays a dialog that lets the user select the schematic(s) to import +from, then saves that information in the layout's attributes for +future imports. + + +@node lesstif LibraryShow Action +@subsection lesstif LibraryShow +@c key lesstif LibraryShow in hid lesstif +@cartouche +@format +LibraryShow()@end format +@end cartouche + +Displays the library window. +@c ./../src/hid/lesstif/library.c 151 + + +@node lesstif Load Action +@subsection lesstif Load +@c key lesstif Load in hid lesstif +@cartouche +@format +Load() +Load(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert)@end format +@end cartouche + +Load layout data from a user-selected file. +@c ./../src/hid/lesstif/dialogs.c 99 + +This action is a GUI front-end to the core's @code{LoadFrom} action +(@pxref{LoadFrom Action}). If you happen to pass a filename, like +@code{LoadFrom}, then @code{LoadFrom} is called directly. Else, the +user is prompted for a filename to load, and then @code{LoadFrom} is +called with that filename. + + +@node lesstif LoadVendor Action +@subsection lesstif LoadVendor +@c key lesstif LoadVendor in hid lesstif +@cartouche +@format +LoadVendor()@end format +@end cartouche + +Loads a user-selected vendor resource file. +@c ./../src/hid/lesstif/dialogs.c 152 + +The user is prompted for a file to load, and then +@code{LoadVendorFrom} is called (@pxref{LoadVendorFrom Action}) to +load that vendor file. + + +@node lesstif NetlistShow Action +@subsection lesstif NetlistShow +@c key lesstif NetlistShow in hid lesstif +@cartouche +@format +NetlistShow(pinname|netname)@end format +@end cartouche + +Selects the given pinname or netname in the netlist window. +@c ./../src/hid/lesstif/netlist.c 415 + + +@node lesstif Print Action +@subsection lesstif Print +@c key lesstif Print in hid lesstif +@cartouche +@format +Print()@end format +@end cartouche + +Print the layout. +@c ./../src/hid/lesstif/dialogs.c 894 + +This will find the default printing HID, prompt the user for its +options, and print the layout. + + +@node lesstif PrintCalibrate Action +@subsection lesstif PrintCalibrate +@c key lesstif PrintCalibrate in hid lesstif +@cartouche +@format +PrintCalibrate()@end format +@end cartouche + +Calibrate the printer. +@c ./../src/hid/lesstif/dialogs.c 937 + +This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + + +@node lesstif PromptFor Action +@subsection lesstif PromptFor +@c key lesstif PromptFor in hid lesstif +@cartouche +@format +PromptFor([message[,default]])@end format +@end cartouche + +Prompt for a response. +@c ./../src/hid/lesstif/dialogs.c 560 + +This is mostly for testing the lesstif HID interface. The parameters +are passed to the @code{prompt_for()} HID function, causing the user +to be prompted for a response. The respose is simply printed to the +user's stdout. + + +@node lesstif Return Action +@subsection lesstif Return +@c key lesstif Return in hid lesstif +@cartouche +@format +Return(0|1)@end format +@end cartouche + +Simulate a passing or failing action. +@c ./../src/hid/lesstif/menu.c 89 + +This is for testing. If passed a 0, does nothing and succeeds. If +passed a 1, does nothing but pretends to fail. + + +@node lesstif Save Action +@subsection lesstif Save +@c key lesstif Save in hid lesstif +@cartouche +@format +Save() +Save(Layout|LayoutAs) +Save(AllConnections|AllUnusedPins|ElementConnections) +Save(PasteBuffer)@end format +@end cartouche + +Save layout data to a user-selected file. +@c ./../src/hid/lesstif/dialogs.c 197 + +This action is a GUI front-end to the core's @code{SaveTo} action +(@pxref{SaveTo Action}). If you happen to pass a filename, like +@code{SaveTo}, then @code{SaveTo} is called directly. Else, the +user is prompted for a filename to save, and then @code{SaveTo} is +called with that filename. + + +@node lesstif SelectLayer Action +@subsection lesstif SelectLayer +@c key lesstif SelectLayer in hid lesstif +@cartouche +@format +SelectLayer(1..MAXLAYER|Silk|Rats)@end format +@end cartouche + +Select which layer is the current layer. +@c ./../src/hid/lesstif/menu.c 387 + +The specified layer becomes the currently active layer. It is made +visible if it is not already visible + + +@node lesstif SetUnits Action +@subsection lesstif SetUnits +@c key lesstif SetUnits in hid lesstif +@cartouche +@format +SetUnits(mm|mil)@end format +@end cartouche + +Set the default measurement units. +@c ./../src/hid/lesstif/main.c 395 + +@table @code + +@item mil +Sets the display units to mils (1/1000 inch). + +@item mm +Sets the display units to millimeters. + +@end table + + +@node lesstif SwapSides Action +@subsection lesstif SwapSides +@c key lesstif SwapSides in hid lesstif +@cartouche +@format +SwapSides(|v|h|r)@end format +@end cartouche + +Swaps the side of the board you're looking at. +@c ./../src/hid/lesstif/main.c 494 + +This action changes the way you view the board. + +@table @code + +@item v +Flips the board over vertically (up/down). + +@item h +Flips the board over horizontally (left/right), like flipping pages in +a book. + +@item r +Rotates the board 180 degrees without changing sides. + +@end table + +If no argument is given, the board isn't moved but the opposite side +is shown. + +Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + +As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the ``working +side'' of the board. + + +@node lesstif ToggleView Action +@subsection lesstif ToggleView +@c key lesstif ToggleView in hid lesstif +@cartouche +@format +ToggleView(1..MAXLAYER) +ToggleView(layername) +ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide)@end format +@end cartouche + +Toggle the visibility of the specified layer or layer group. +@c ./../src/hid/lesstif/menu.c 409 + +If you pass an integer, that layer is specified by index (the first +layer is @code{1}, etc). If you pass a layer name, that layer is +specified by name. When a layer is specified, the visibility of the +layer group containing that layer is toggled. + +If you pass a special layer name, the visibility of those components +(silk, rats, etc) is toggled. Note that if you have a layer named +the same as a special layer, the layer is chosen over the special layer. + + +@node lesstif Zoom Action +@subsection lesstif Zoom +@c key lesstif Zoom in hid lesstif +@cartouche +@format +Zoom() +Zoom(factor)@end format +@end cartouche + +Various zoom factor changes. +@c ./../src/hid/lesstif/main.c 419 + +Changes the zoom (magnification) of the view of the board. If no +arguments are passed, the view is scaled such that the board just fits +inside the visible window (i.e. ``view all''). Otherwise, +@var{factor} specifies a change in zoom factor. It may be prefixed by +@code{+}, @code{-}, or @code{=} to change how the zoom factor is +modified. The @var{factor} is a floating point number, such as +@code{1.5} or @code{0.75}. + +@table @code + +@item +@var{factor} +Values greater than 1.0 cause the board to be drawn smaller; more of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn bigger; less of the board will be visible. + +@item -@var{factor} +Values greater than 1.0 cause the board to be drawn bigger; less of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn smaller; more of the board will be visible. + +@item =@var{factor} + +The @var{factor} is an absolute zoom factor; the unit for this value +is "PCB units per screen pixel". Since PCB units are 0.01 mil, a +@var{factor} of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, +about the actual resolution of most screens - resulting in an "actual +size" board. Similarly, a @var{factor} of 100 gives you a 10x actual +size. + +@end table + +Note that zoom factors of zero are silently ignored. + + Index: tags/1.0.5/doc/ascii2texi.awk =================================================================== --- tags/1.0.5/doc/ascii2texi.awk (nonexistent) +++ tags/1.0.5/doc/ascii2texi.awk (revision 953) @@ -0,0 +1,77 @@ +#!/usr/bin/awk -f +# +# $Id$ +# + +BEGIN { + first = 1; + col = 1; +} + +/^[ \t]*#/ { + # skip comment lines + next; +} + +/^[ \t]*$/ { + # skip blank + next; +} + +# we do this 'first' song and dance because variables set +# on the command line are not available in the BEGIN section +first == 1 { + first = 0; + printf("@c Generated file. Do not edit directly\n"); + printf("@c $" "Id" "$\n"); + printf("@multitable @columnfractions "); + for(i = 1 ; i <= 2*ncol ; i = i + 1) { + printf("%.3g ", 0.5 / ncol); + } + printf("\n"); + + printf("@item "); + for(i = 1 ; i <= ncol ; i = i + 1) { + if( i > 1 ) { printf("@tab "); } + printf("Drill @tab Diameter "); + } + printf("\n"); + + printf("@item "); + for(i = 1 ; i <= ncol ; i = i + 1) { + if( i > 1 ) { printf("@tab "); } + printf("Size @tab (inches) "); + } + printf("\n"); + + printf("\n"); +} + +{ + if( col == 1 ) { + printf("@item "); + } else { + printf("@tab "); + } + drl = $1; + dia = $2; + gsub(/_/, " ", drl); + printf("%s @tab %s ", drl, dia); + col = col + 1; + if( col > ncol ) { + col = 1; + printf("\n"); + } +} + +END { + while( (col > 1) && (col <= ncol ) ) { + printf("@tab @tab "); + col = col + 1; + } + + printf("@end multitable\n\n"); +} + + + Property changes on: tags/1.0.5/doc/ascii2texi.awk ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/doc/eps2png =================================================================== --- tags/1.0.5/doc/eps2png (nonexistent) +++ tags/1.0.5/doc/eps2png (revision 953) @@ -0,0 +1,495 @@ +#!/usr/bin/perl + +my $RCS_Id = '$Id$ '; + +# Author : Johan Vromans +# Created On : Tue Sep 15 15:59:04 1992 +# Last Modified By: Johan Vromans +# Last Modified On: Sun Jun 24 17:07:29 2001 +# Update Count : 155 +# Status : Okay + +################ Common stuff ################ + +use strict; +use Getopt::Long 2.1; + +my $my_package = "Sciurix"; +my ($my_name, $my_version) = $RCS_Id =~ /: (.+).pl,v ([\d.]+)/; +$my_version .= '*' if length('$Locker$ ') > 12; + +use vars qw($VERSION); +( $VERSION ) = '$Revision$ ' =~ /\$Revision:\s+([^\s]+)/; + +################ Program parameters ################ + +### CONFIG +# Some GhostScript programs can produce GIF directly. +# If not, we need the PBM package for the conversion. +my $use_pbm = 1; # GhostScript can not produce GIF +### END CONFIG + +my $res = 82; # default resolution +my $scale = 1; # default scaling +my $mono = 0; # produce BW images if non-zero +my $format; # output format +my $gs_format; # GS output type +my $output; # output, defaults to STDOUT +my $antialias = 4; # antialiasing +my $width; # desired widht +my $height; # desired height + +my ($verbose,$trace,$test,$debug) = (0,0,0,0); +handle_options (); +unless ( defined $format ) { + if ( $0 =~ /2(gif|jpg|png)$/ ) { + set_out_type ($1); + } + else { + set_out_type ('png') unless defined $format; + } +} +print STDERR ("Producing $format ($gs_format) image.\n") if $verbose; + +$trace |= $test | $debug; +$verbose |= $trace; + +################ Presets ################ + +################ The Process ################ + +my $eps_file; +my $err = 0; + +foreach $eps_file ( @ARGV ) { + + unless ( open (EPS, $eps_file) ) { + print STDERR ("Cannot open $eps_file [$!], skipped\n"); + $err++; + next; + } + + my $line = ; + unless ( $line =~ /^%!PS-Adobe.*EPSF-/ ) { + print STDERR ("Not EPS file: $eps_file, skipped\n"); + $err++; + next; + } + + my $ps = ""; # PostScript input data + my $xscale; + my $yscale; + + while ( $line = ) { + + # Search for BoundingBox. + if ( $line =~ /^%%BoundingBox:\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i ) { + + print STDERR ("$eps_file: x0=$1, y0=$2, w=", $3-$1, ", h=", $4-$2) + if $verbose; + + if ( defined $width ) { + $res = 72; + $xscale = $width / ($3 - $1); + if ( defined $height ) { + $yscale = $height / ($4 - $2); + } + else { + $yscale = $xscale; + $height = ($4 - $2) * $yscale; + } + } + elsif ( defined $height ) { + $res = 72; + $yscale = $height / ($4 - $2); + if ( defined $width ) { + $xscale = $width / ($3 - $1); + } + else { + $xscale = $yscale; + $width = ($3 - $1) * $xscale; + } + } + unless ( defined $xscale ) { + $xscale = $yscale = $scale; + # Calculate actual width. + $width = $3 - $1; + $height = $4 - $2; + # Normal PostScript resolution is 72. + $width *= $res/72 * $xscale; + $height *= $res/72 * $yscale; + # Round up. + $width = int ($width + 0.5) + 1; + $height = int ($height + 0.5) + 1; + } + print STDERR (", width=$width, height=$height\n") if $verbose; + + # Scale. + $ps .= "$xscale $yscale scale\n" + if $xscale != 1 || $yscale != 1; + + # Create PostScript code to translate coordinates. + $ps .= (0-$1) . " " . (0-$2) . " translate\n" + unless $1 == 0 && $2 == 0; + + # Include the image, show and quit. + $ps .= "($eps_file) run\n". + "showpage\n". + "quit\n"; + + last; + } + elsif ( $line =~ /^%%EndComments/i ) { + print STDERR ("No bounding box in $eps_file\n"); + $err++; + last; + } + } + close (EPS); + + my $out_file; # output file + my $pbm_file; # temporary file for PBM conversion + + # Note the temporary PBM file is created where the output file is + # located, since that will guarantee accessibility (and a valid + # filename). + if ( defined $output ) { + $out_file = $output; + $pbm_file = $output.".ppm"; + } + elsif ( $eps_file =~ /^(.+).epsf?$/i ) { + $out_file = "$1.$format"; + $pbm_file = $1.".ppm"; + } + else { + $out_file = $eps_file . ".$format"; + $pbm_file = $eps_file . ".ppm"; + } + print STDERR ("Creating $out_file\n") if $verbose; + + my $gs0 = "gs -q -dNOPAUSE -r$res -g${width}x$height"; + my $gs1 = "-"; + $gs0 .= " -dTextAlphaBits=$antialias -dGraphicsAlphaBits=$antialias" + if $antialias; + if ( $format eq 'png' ) { + mysystem ("$gs0 -sDEVICE=". ($mono ? "pngmono" : $gs_format). + " -sOutputFile=$out_file $gs1", $ps); + } + elsif ( $format eq 'jpg' ) { + mysystem ("$gs0 -sDEVICE=". ($mono ? "jpeggray" : $gs_format). + " -sOutputFile=$out_file $gs1", $ps); + } + elsif ( $format eq 'gif' ) { + if ( $use_pbm ) { + # Convert to PPM and use some of the PBM converters. + mysystem ("$gs0 -sDEVICE=". ($mono ? "pbm" : "ppm"). + " -sOutputFile=$pbm_file $gs1", $ps); + # mysystem ("pnmcrop $pbm_file | ppmtogif > $out_file"); + mysystem ("ppmtogif $pbm_file > $out_file"); + unlink ($pbm_file); + } + else { + # GhostScript has GIF drivers built-in. + mysystem ("$gs0 -sDEVICE=". ($mono ? "gifmono" : "gif8"). + " -sOutputFile=$out_file $gs1", $ps); + } + } + else { + print STDERR ("ASSERT ERROR: Unhandled output type: $format\n"); + exit (1); + } + + unless ( -s $out_file ) { + print STDERR ("Problem creating $out_file for $eps_file\n"); + $err++; + } + +} + +exit 1 if $err; + +################ Subroutines ################ + +sub mysystem { + my ($cmd, $data) = @_; + print STDERR ("+ $cmd\n") if $trace; + if ( $data ) { + if ( $trace ) { + my $dp = ">> " . $data; + $dp =~ s/\n(.)/\n>> $1/g; + print STDERR ("$dp"); + } + open (CMD, "|$cmd") or die ("cmd: $!\n"); + print CMD $data; + close CMD or die ("cmd close: $!\n"); + } + else { + system ($cmd); + } +} + +sub set_out_type { + my ($opt) = lc (shift (@_)); + if ( $opt =~ /^png(mono|gray|16|256|16m)?$/ ) { + $format = 'png'; + $gs_format = $format.(defined $1 ? $1 : '16m'); + } + elsif ( $opt =~ /^gif(mono)?$/ ) { + $format = 'gif'; + $gs_format = $format.(defined $1 ? $1 : ''); + } + elsif ( $opt =~ /^(jpg|jpeg)(gray)?$/ ) { + $format = 'jpg'; + $gs_format = 'jpeg'.(defined $2 ? $2 : ''); + } + else { + print STDERR ("ASSERT ERROR: Invalid value to set_out_type: $opt\n"); + exit (1); + } +} + +sub handle_options { + my ($help) = 0; # handled locally + my ($ident) = 0; # handled locally + + # Process options. + if ( @ARGV > 0 && $ARGV[0] =~ /^[-+]/ ) { + usage () + unless GetOptions ('ident' => \$ident, + 'verbose' => \$verbose, + 'antialias|aa=i' => \$antialias, + 'noantialias|noaa' => sub { $antialias = 0 }, + 'scale=f' => \$scale, + 'width=i' => \$width, + 'height=i' => \$height, + 'output=s' => \$output, + 'png' => \&set_out_type, + 'pngmono' => \&set_out_type, + 'pnggray' => \&set_out_type, + 'png16' => \&set_out_type, + 'png256' => \&set_out_type, + 'png16m' => \&set_out_type, + 'jpg' => \&set_out_type, + 'jpggray' => \&set_out_type, + 'jpeg' => \&set_out_type, + 'jpeggray' => \&set_out_type, + 'gif' => \&set_out_type, + 'gifmono' => \&set_out_type, + 'mono!' => \$mono, + 'resolution=i' => \$res, + 'pbm!' => \$use_pbm, + 'trace' => \$trace, + 'help' => \$help, + 'debug' => \$debug) + && !$help; + } + print STDERR ("This is $my_package [$my_name $my_version]\n") + if $ident; + die ("Only one file argument is allowed when -output is used\n") + if @ARGV > 1 && defined $output; + die ("At least one input file name must be specified\n") + unless @ARGV; + die ("Antialias value must be 0, 1, 2, 4, or 8\n") + unless "$antialias" =~ /^[01248]$/; +} + +sub usage { + print STDERR < (the default), it produces PNG images by +default. Likewise, C defaults to GIF images and C +defaults to JPG. Note that the normal installation procedure will +I install C. + +It uses GhostScript to produce the images. Since modern GhostScript +programs do not support GIF anymore, GIF images are produced via the +Portable PixMap converters (PBM-package). In this case, a temporary +file is created, named after the output file, with the extension +replaced by ".ppm". It is deleted upon completion. + +=head1 ARGUMENTS + +B always requires at least one argument: the name of the EPS +file to be converted. It is possible to specify more than one file +name. This will cause all named files to be converted into separate +files, e.g., "C" will be converted to "C" and +so on. + +=over 4 + +=item B<-png -pngmono -pnggray -png16 -png256 -png16m> + +Each of these options will instruct Ghostscript to use the +corresponding bitmap generator, and supply a C<.png> default +extension for output files. + +=item B<-jpg -jpggray -jpeg -jpeggray> + +Same, but with a C<.jpg> default extension for output files. + +=item B<-gif -gifmono> + +Same, but with a C<.gif> default extension for output files. + +Note: Since modern Ghostscript versions no longer support the GIF +format due to copyright restrictions, B will request +Ghostscript to produce a Portable Bitmap File (.ppm or .pbm) instead +and run the B converter to produce the actual GIF file. + +=item B<-mono> + +This option will select monochrome (BW or gray) output. It forces the +Ghostscript driver to C, C, C, or C. + +=item B<-nomono> + +Produces colour images. This is the default. + +=item B<-width> I + +The desired width of the output image. + +If B<-height> is not specified, the image will be scaled proportionally. + +=item B<-height> I + +The desired height of the output image. + +If B<-width> is not specified, the image will be scaled proportionally. + +=item B<-resolution> I + +Specifies the resolution for the output image. This is the width, in +pixels, of the bitmap image for an EPS image of one inch wide (72 +PostScript points). + +Note that for best results, use the B<-width> and B<-height> options +instead. + +Default value is 82, which causes the converted image to be of more +or less the same size as the EPS image. On my screen, that is. + +=item B<-scale> I + +Specify a scaling factor. This may be a fractional number. + +For a one-inch EPS image, the resultant bitmap image will be +I times I. + +Note that for best results, use the B<-width> and B<-height> options +instead. + +=item B<-antialias> I + +Sets the antialiasing depth. I must be 0 (no antialiasing), 1, 2, +4, or 8. Default value is 4. + +=item B<-noantialias> + +Sets the antialiasing depth to 0. + +=item B<-pbm> + +Forces GIF conversion through the PBM converters. + +=item B<-nopbm> + +Forces GIF conversion through Ghostscript. + +=item B<-output> I + +Stores the output in this file. Only one input file may be supplied if +this option is specified. + +=item B<-help> + +Prints a help message and exits. + +=item B<-ident> + +Prints the program version before doing anything else. + +=item B<-verbose> + +Provides more verbose information. + +=back + +=head1 AUTHOR + +Johan Vromans, . + +=head1 BUGS + +GhostScript and, if required, the PBM package, need to be installed and +accessible through the user's C. + +GhostScript is assumed to be capable of handling all the image types +listed above. + +The EPS should be well-behaving. + +=head1 COPYRIGHT AND DISCLAIMER + +This program is Copyright 1994,2001 by Johan Vromans. +This program is free software; you can redistribute it and/or +modify it under the terms of the Perl Artistic License or 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. + +If you do not have a copy of the GNU General Public License write to +the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, +MA 02139, USA. + +=cut Property changes on: tags/1.0.5/doc/eps2png ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/doc/extract-docs =================================================================== --- tags/1.0.5/doc/extract-docs (nonexistent) +++ tags/1.0.5/doc/extract-docs (revision 953) @@ -0,0 +1,322 @@ +#!/usr/bin/perl +# -*- perl -*- +# +# $Id$ +# +################################################################# +# This script extracts special comments from the source. It assembles +# them in texinfo files that are included in the manual. +################################################################# +# +# The general format of what this script looks for is thusly: +# +# %start-doc category sort-key +# texi stuff goes here +# %end-doc +# +# The lines with the %start-doc and %end-doc are not included in the +# texi extraction; only the lines between them. The category is used +# to determine the file that's created; a category of "foo" causes a +# file "foo.texi" to be created. The sort-keys are case insensitive. +# The text extracted is sorte according to the key and put into the +# file according to the category. Each unique sort-key causes a @node +# to be created, unless that sort-key's text already has a @node in +# it. +# If the sort-key contains space characters, it should be enclosed by +# quotation marks ("). Leading digits in the sort key optionally followed +# by space are removed after sort but before creation of nodes. This +# allows to manipulate the order of nodes in the manual. +# +# Note that we synthesize a special @syntax command, which should be +# used for all things syntax. We change those to whatever the current +# desired style is for syntaxes (currently, a cartouche box of +# non-wrapped but variable-pitch font). +# +# For extracting actions, this script expects a very specific syntax +# to be used. It looks like this, with one or more lines +# (continuations are like this example): +# +# static const char some_string_help[] = +# "some text\n" +# "some text"; +# +# Repeat for some_string_syntax[], then follow those with the usual +# %start-doc. Note that the %start-doc for actions must use the +# category "actions" and the sort key must match the action name. +# +# Within start-doc/end-doc pairs, you can use two special @-lines +# to control the generated node names and document structure. +# +# @nodetype section +# You can specify section, subsection, unnumberedsubsec, etc. Each +# unique sort key within each category is assigned one of these. +# @nodename pattern +# A sprintf-like pattern to use to modify the sort-key to make a +# node name. Since node names must be unique and have various +# restrictions as to what characters you can use in them, this +# allows you to use a pattern for various categories which will help +# keep node names unique without requiring lots of repetetive typing +# in the source files. + +$docdir = shift; +$docdir = "." unless $docdir; +$srcdir = "$docdir/../src"; +$docdir = "."; + +my $debug = 0; + +open(FIND, "find $srcdir -type f -name '*.[chly]' -print | sort |"); +while () { + s/[\r\n]+$//; + &scan_file($_); +} +close (FIND); + +sub dsort { + my ($a, $b) = @_; + $a =~ tr/A-Z/a-z/; + $b =~ tr/A-Z/a-z/; + return $a cmp $b; +} + +for $cat (sort keys %text) { + print "$cat\n"; + @k = sort {&dsort($a,$b)} keys %{$text{$cat}}; + $new = ''; + $new .= "\@c key $cat\n"; + if ($cat eq "actions") { + &dump_00_keys($cat, "\0\$"); + $new .= "\n\@menu\n"; + for $hid (sort keys %{$hids{$cat}}) { + if ($hid =~ /../) { + $new .= "* ${hid} actions::\n"; + } else { + $new .= "* core actions::\n"; + } + } + $new .= "\@end menu\n\n"; + for $hid (sort keys %{$hids{$cat}}) { + if ($hid =~ /../) { + $new .= "\@node $hid actions\n"; + $new .= "\@section $hid actions\n"; + &dump_00_keys($cat, "\0$hid\$"); + } else { + $new .= "\@node core actions\n"; + $new .= "\@section Core actions\n"; + } + $new .= "\@menu\n"; + for $key (@k) { + next unless $key =~ /\0$hid$/; + next if $key =~ /^00/; + $k2 = $title{$cat}{$key}; + if ($hid =~ /\S/ && $hid !~ /common/) { + $k2 = "$hid $k2"; + } + $new .= "* ${k2} Action:: $desc{$key}\n"; + } + $new .= "\@end menu\n"; + for $key (@k) { + next unless $key =~ /\0$hid$/; + next if $key =~ /^00/; + $k2 = $title{$cat}{$key}; + if ($hid =~ /\S/ && $hid !~ /common/) { + $k2 = "$hid $k2"; + } + if ($key !~ /^00/) { + $new .= "\@node $k2 Action\n"; + $new .= "\@subsection $k2\n"; + } + $new .= "\@c key $k2 in hid $hid\n"; + if ($synt{$key}) { + $new .= "\@cartouche\n\@format\n"; + $new .= $synt{$key}; + $new .= "\@end format\n\@end cartouche\n\n"; + } + if ($desc{$key}) { + $new .= $desc{$key} . "\n"; + } + $new .= $text{$cat}{$key}; + if (! $desc{$key} && ! $text{$cat}{$key} ) { + $new .= "No documentation yet.\n"; + } + $new .= "\n"; + } + } + } else { + $nodetype = "section"; + &dump_00_keys($cat, ""); + $new .= "\@menu\n"; + $nodename = "%s"; + for $key (@k) { + if ($nodename{$cat}{$key}) { + $nodename = $nodename{$cat}{$key}; + } + next if $key =~ /^00/; + $k2 = $title{$cat}{$key}; + # strip leading digits from the key string + $k2 =~ s/\A\d+\s*//g; + $k2 = sprintf($nodename, $k2); + if ($text{$cat}{$key} !~ /\@node/) { + $new .="* ${k2}::\n"; + } + } + $new .= "\@end menu\n"; + $nodename = "%s"; + for $key (@k) { + if ($nodetype{$cat}{$key}) { + $nodetype = $nodetype{$cat}{$key}; + } + if ($nodename{$cat}{$key}) { + $nodename = $nodename{$cat}{$key}; + } + next if $key =~ /^00/; + $k2 = $title{$cat}{$key}; + # strip leading digits from the key string + $k2 =~ s/\A\d+\s*//g; + $k2n = sprintf($nodename, $k2); + $new .= "\@c $cat $k2\n"; + if ($text{$cat}{$key} !~ /\@node/) { + $new .= "\@node $k2n\n"; + $new .= "\@$nodetype $k2\n"; + } + $new .= $text{$cat}{$key}; + } + } + $^A = ""; + $line = join(' ', @k); + formline(" ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~\n", $line); + print $^A; + + $old = ''; + if ( -f "$docdir/$cat.texi") { + open(CAT, "$docdir/$cat.texi"); + $old = join('', ); + close CAT; + } + if ($old ne $new) { + open(CAT, ">$docdir/$cat.texi"); + print CAT $new; + close CAT; + } +} + +sub dump_00_keys { + my($cat, $regex) = @_; + for $k (@k) { + next unless $k =~ /00.*$regex/; + $new .= $text{$cat}{$k}; + } +} + +sub scan_file { + my ($name) = @_; + print "DEBUG: sub_scan($name)\n" if ($debug); + + # if the source file was in $(srcdir)/hid// then + # pick out the name of the hid and put it into $srcdir. + if ($name =~ m@hid/([^/]+)/@) { + $hid = "$1"; + } else { + $hid = ""; + } + $lineno = 0; + + # skip processing of lex/yacc output files + if ($name =~ /\.[ch]$/) { + $new = $name; + $new =~ s/\.[ch]$/\.y/; + return if -f $new; + $new =~ s/\.y$/\.l/; + return if -f $new; + } + + open(F, $name); + while () { + $lineno ++; + if (/^static\s+const\s+char\s+.*_(help|syntax)\[\]\s*=(.*)/) { + $tag = $1; + $last = 0; + $pending{$tag} = ''; + + # note that the help/syntax string may start on the same line + # as the "static const char"... bit so we pick out that part and + # process it first. + $_ = $2; + LOOP: { + do { + # eat trailing whitespace, new-lines, and carriage returns + s/[\r\n\s]+$//; + + # we're done if we found the terminating ";" + $last = 1 if /;$/; + + # otherwise we need to eat leading whitespace and the leading quote + s/^[\s]*\"//; #" + + # convert \n to a newline + s/\\n/\n/g; + + # eat trailing quotes + s/\";?$//; #" + s/\\\"/\"/g; #" + s/ "/``/g; + s/" /''/g; + $pending{$tag} .= $_; + last if $last; + } while (); + } + # spit out a warning in case we have a malformed help + if ($pending{$tag} =~ /%(start|end)-doc/) { + print "WARNING: $name line $lineno has a $1 string that includes a %start-doc or %end-doc\n"; + print " tag:\n$pending{$tag}\n\n"; + } + next; + } + + if (/%start-doc\s+(\S+)\s+([^"^\s]+|".*?")(\s+(.*))?/) { + # pattern to look for: + # start-doc -> "%start-doc" + # \s+ -> one ore more whitespace + # (\S+) -> string with no whitespace, goes to $1 + # \s+ -> one ore more whitespace + # ([^"^\s]+|".*?") -> a space-less string, or a string delimited by ", goes to $2 + # (\s+(.*))? -> zero or more space separated strings + + $cat = $1; + $key = $2; + # strip leading and trailing quotation marks from the key string + $key =~ s/\A"//g; + $key =~ s/"\Z//g; + $title = $4; + if ($title) { + $title{$cat}{"$key\0$hid"} = $title; + } else { + $title{$cat}{"$key\0$hid"} = $key; + } + $text{$cat}{"$key\0$hid"} .= "\@c $name $lineno\n"; + $hids{$cat}{$hid} = 1; + if ($cat =~ /^(.*_)?actions/) { + $desc{"$key\0$hid"} = $pending{'help'}; + $synt{"$key\0$hid"} = $pending{'syntax'}; + %pending = (); + } + while () { + next if /^\*\/$/; + next if /^\/\*$/; + last if /%end-doc/; + s/\@syntax/\@cartouche\n\@format/g; + s/\@end syntax/\@end format\n\@end cartouche/g; + if (/^\@nodetype\s*(\S+)/) { + $nodetype{$cat}{"$key\0$hid"} = $1; + next; + } + if (/^\@nodename\s*(.+)/) { + $nodename{$cat}{"$key\0$hid"} = $1; + next; + } + $text{$cat}{"$key\0$hid"} .= $_; + } + } + } + close (F); +} Property changes on: tags/1.0.5/doc/extract-docs ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/doc/fractional_size.tab =================================================================== --- tags/1.0.5/doc/fractional_size.tab (nonexistent) +++ tags/1.0.5/doc/fractional_size.tab (revision 953) @@ -0,0 +1,68 @@ +# $Id$ +# + +1/64 .0156 +1/32 .0313 +3/64 .0469 +1/16 .0625 +5/64 .0781 +3/32 .0938 +7/64 .1094 +1/8 .1250 +9/64 .1406 +5/32 .1562 +11/64 .1719 +3/16 .1875 +13/64 .2031 +7/32 .2188 +15/64 .2344 +1/4 .2500 +17/64 .2656 +9/32 .2812 +19/64 .2969 +5/16 .3125 +21/64 .3281 +11/32 .3438 +23/64 .3594 +3/8 .3750 +25/64 .3906 +13/32 .4062 +27/64 .4219 +7/16 .4375 +29/64 .4531 +15/32 .4688 +31/64 .4844 +1/2 .5000 +33/64 .5156 +17/32 .5313 +35/64 .5469 +9/16 .5625 +37/64 .5781 +19/32 .5938 +39/64 .6094 +5/8 .6250 +41/64 .6406 +21/32 .6562 +43/64 .6719 +11/16 .6875 +45/64 .7031 +23/32 .7188 +47/64 .7344 +3/4 .7500 +49/64 .7656 +25/32 .7812 +51/64 .7969 +13/16 .8125 +53/64 .8281 +27/32 .8438 +55/64 .8594 +7/8 .8750 +57/64 .8906 +29/32 .9062 +59/64 .9219 +15/16 .9375 +61/64 .9531 +31/32 .9688 +63/64 .9844 +1 1.0000 + Index: tags/1.0.5/doc/fractional_size.texi =================================================================== --- tags/1.0.5/doc/fractional_size.texi (nonexistent) +++ tags/1.0.5/doc/fractional_size.texi (revision 953) @@ -0,0 +1,29 @@ +@c Generated file. Do not edit directly +@c $Id$ +@multitable @columnfractions 0.167 0.167 0.167 0.167 0.167 0.167 +@item Drill @tab Diameter @tab Drill @tab Diameter @tab Drill @tab Diameter +@item Size @tab (inches) @tab Size @tab (inches) @tab Size @tab (inches) + +@item 1/64 @tab .0156 @tab 1/32 @tab .0313 @tab 3/64 @tab .0469 +@item 1/16 @tab .0625 @tab 5/64 @tab .0781 @tab 3/32 @tab .0938 +@item 7/64 @tab .1094 @tab 1/8 @tab .1250 @tab 9/64 @tab .1406 +@item 5/32 @tab .1562 @tab 11/64 @tab .1719 @tab 3/16 @tab .1875 +@item 13/64 @tab .2031 @tab 7/32 @tab .2188 @tab 15/64 @tab .2344 +@item 1/4 @tab .2500 @tab 17/64 @tab .2656 @tab 9/32 @tab .2812 +@item 19/64 @tab .2969 @tab 5/16 @tab .3125 @tab 21/64 @tab .3281 +@item 11/32 @tab .3438 @tab 23/64 @tab .3594 @tab 3/8 @tab .3750 +@item 25/64 @tab .3906 @tab 13/32 @tab .4062 @tab 27/64 @tab .4219 +@item 7/16 @tab .4375 @tab 29/64 @tab .4531 @tab 15/32 @tab .4688 +@item 31/64 @tab .4844 @tab 1/2 @tab .5000 @tab 33/64 @tab .5156 +@item 17/32 @tab .5313 @tab 35/64 @tab .5469 @tab 9/16 @tab .5625 +@item 37/64 @tab .5781 @tab 19/32 @tab .5938 @tab 39/64 @tab .6094 +@item 5/8 @tab .6250 @tab 41/64 @tab .6406 @tab 21/32 @tab .6562 +@item 43/64 @tab .6719 @tab 11/16 @tab .6875 @tab 45/64 @tab .7031 +@item 23/32 @tab .7188 @tab 47/64 @tab .7344 @tab 3/4 @tab .7500 +@item 49/64 @tab .7656 @tab 25/32 @tab .7812 @tab 51/64 @tab .7969 +@item 13/16 @tab .8125 @tab 53/64 @tab .8281 @tab 27/32 @tab .8438 +@item 55/64 @tab .8594 @tab 7/8 @tab .8750 @tab 57/64 @tab .8906 +@item 29/32 @tab .9062 @tab 59/64 @tab .9219 @tab 15/16 @tab .9375 +@item 61/64 @tab .9531 @tab 31/32 @tab .9688 @tab 63/64 @tab .9844 +@item 1 @tab 1.0000 @tab @tab @tab @tab @end multitable + Index: tags/1.0.5/doc/gcode.pcb =================================================================== --- tags/1.0.5/doc/gcode.pcb (nonexistent) +++ tags/1.0.5/doc/gcode.pcb (revision 953) @@ -0,0 +1,1000 @@ +# release: pcb 20091103 +# date: Tue Feb 9 17:50:10 2010 +# user: amc (amc,/home/alberto,S-1-5-21-3544562028-792812758-4257637587-9314) +# host: ni28979b.office.amsiag.com + +# To read pcb files, the pcb version (or the cvs source date) must be >= the file version +FileVersion[20070407] + +PCB["" 280000 160000] + +Grid[1000.000000 0 0 0] +Cursor[0 0 0.000000] +PolyArea[200000000.000000] +Thermal[0.500000] +DRC[1000 1000 1000 1000 1500 1000] +Flags("showdrc,nameonpcb,swapstartdir,clearnew,snappin") +Groups("1,c:2,s:3:4:5:6:7:8") +Styles["Signal,4000,8000,3000,2000:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600"] + +Symbol(' ' 18) +( +) +Symbol('!' 12) +( + SymbolLine(0 45 0 50 8) + SymbolLine(0 10 0 35 8) +) +Symbol('"' 12) +( + SymbolLine(0 10 0 20 8) + SymbolLine(10 10 10 20 8) +) +Symbol('#' 12) +( + SymbolLine(0 35 20 35 8) + SymbolLine(0 25 20 25 8) + SymbolLine(15 20 15 40 8) + SymbolLine(5 20 5 40 8) +) +Symbol('$' 12) +( + SymbolLine(15 15 20 20 8) + SymbolLine(5 15 15 15 8) + SymbolLine(0 20 5 15 8) + SymbolLine(0 20 0 25 8) + SymbolLine(0 25 5 30 8) + SymbolLine(5 30 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(20 35 20 40 8) + SymbolLine(15 45 20 40 8) + SymbolLine(5 45 15 45 8) + SymbolLine(0 40 5 45 8) + SymbolLine(10 10 10 50 8) +) +Symbol('%' 12) +( + SymbolLine(0 15 0 20 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 10 10 8) + SymbolLine(10 10 15 15 8) + SymbolLine(15 15 15 20 8) + SymbolLine(10 25 15 20 8) + SymbolLine(5 25 10 25 8) + SymbolLine(0 20 5 25 8) + SymbolLine(0 50 40 10 8) + SymbolLine(35 50 40 45 8) + SymbolLine(40 40 40 45 8) + SymbolLine(35 35 40 40 8) + SymbolLine(30 35 35 35 8) + SymbolLine(25 40 30 35 8) + SymbolLine(25 40 25 45 8) + SymbolLine(25 45 30 50 8) + SymbolLine(30 50 35 50 8) +) +Symbol('&' 12) +( + SymbolLine(0 45 5 50 8) + SymbolLine(0 15 0 25 8) + SymbolLine(0 15 5 10 8) + SymbolLine(0 35 15 20 8) + SymbolLine(5 50 10 50 8) + SymbolLine(10 50 20 40 8) + SymbolLine(0 25 25 50 8) + SymbolLine(5 10 10 10 8) + SymbolLine(10 10 15 15 8) + SymbolLine(15 15 15 20 8) + SymbolLine(0 35 0 45 8) +) +Symbol(''' 12) +( + SymbolLine(0 20 10 10 8) +) +Symbol('(' 12) +( + SymbolLine(0 45 5 50 8) + SymbolLine(0 15 5 10 8) + SymbolLine(0 15 0 45 8) +) +Symbol(')' 12) +( + SymbolLine(0 10 5 15 8) + SymbolLine(5 15 5 45 8) + SymbolLine(0 50 5 45 8) +) +Symbol('*' 12) +( + SymbolLine(0 20 20 40 8) + SymbolLine(0 40 20 20 8) + SymbolLine(0 30 20 30 8) + SymbolLine(10 20 10 40 8) +) +Symbol('+' 12) +( + SymbolLine(0 30 20 30 8) + SymbolLine(10 20 10 40 8) +) +Symbol(',' 12) +( + SymbolLine(0 60 10 50 8) +) +Symbol('-' 12) +( + SymbolLine(0 30 20 30 8) +) +Symbol('.' 12) +( + SymbolLine(0 50 5 50 8) +) +Symbol('/' 12) +( + SymbolLine(0 45 30 15 8) +) +Symbol('0' 12) +( + SymbolLine(0 45 5 50 8) + SymbolLine(0 15 0 45 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 15 10 8) + SymbolLine(15 10 20 15 8) + SymbolLine(20 15 20 45 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 40 20 20 8) +) +Symbol('1' 12) +( + SymbolLine(5 50 15 50 8) + SymbolLine(10 10 10 50 8) + SymbolLine(0 20 10 10 8) +) +Symbol('2' 12) +( + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 20 10 8) + SymbolLine(20 10 25 15 8) + SymbolLine(25 15 25 25 8) + SymbolLine(0 50 25 25 8) + SymbolLine(0 50 25 50 8) +) +Symbol('3' 12) +( + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 15 10 8) + SymbolLine(15 10 20 15 8) + SymbolLine(20 15 20 45 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 30 20 30 8) +) +Symbol('4' 12) +( + SymbolLine(0 30 20 10 8) + SymbolLine(0 30 25 30 8) + SymbolLine(20 10 20 50 8) +) +Symbol('5' 12) +( + SymbolLine(0 10 20 10 8) + SymbolLine(0 10 0 30 8) + SymbolLine(0 30 5 25 8) + SymbolLine(5 25 15 25 8) + SymbolLine(15 25 20 30 8) + SymbolLine(20 30 20 45 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 45 5 50 8) +) +Symbol('6' 12) +( + SymbolLine(15 10 20 15 8) + SymbolLine(5 10 15 10 8) + SymbolLine(0 15 5 10 8) + SymbolLine(0 15 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(15 30 20 35 8) + SymbolLine(0 30 15 30 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) + SymbolLine(20 35 20 45 8) +) +Symbol('7' 12) +( + SymbolLine(0 50 25 25 8) + SymbolLine(25 10 25 25 8) + SymbolLine(0 10 25 10 8) +) +Symbol('8' 12) +( + SymbolLine(0 45 5 50 8) + SymbolLine(0 35 0 45 8) + SymbolLine(0 35 5 30 8) + SymbolLine(5 30 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(20 35 20 45 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 25 5 30 8) + SymbolLine(0 15 0 25 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 15 10 8) + SymbolLine(15 10 20 15 8) + SymbolLine(20 15 20 25 8) + SymbolLine(15 30 20 25 8) +) +Symbol('9' 12) +( + SymbolLine(0 50 20 30 8) + SymbolLine(20 15 20 30 8) + SymbolLine(15 10 20 15 8) + SymbolLine(5 10 15 10 8) + SymbolLine(0 15 5 10 8) + SymbolLine(0 15 0 25 8) + SymbolLine(0 25 5 30 8) + SymbolLine(5 30 20 30 8) +) +Symbol(':' 12) +( + SymbolLine(0 25 5 25 8) + SymbolLine(0 35 5 35 8) +) +Symbol(';' 12) +( + SymbolLine(0 50 10 40 8) + SymbolLine(10 25 10 30 8) +) +Symbol('<' 12) +( + SymbolLine(0 30 10 20 8) + SymbolLine(0 30 10 40 8) +) +Symbol('=' 12) +( + SymbolLine(0 25 20 25 8) + SymbolLine(0 35 20 35 8) +) +Symbol('>' 12) +( + SymbolLine(0 20 10 30 8) + SymbolLine(0 40 10 30 8) +) +Symbol('?' 12) +( + SymbolLine(10 30 10 35 8) + SymbolLine(10 45 10 50 8) + SymbolLine(0 15 0 20 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 15 10 8) + SymbolLine(15 10 20 15 8) + SymbolLine(20 15 20 20 8) + SymbolLine(10 30 20 20 8) +) +Symbol('@' 12) +( + SymbolLine(0 10 0 40 8) + SymbolLine(0 40 10 50 8) + SymbolLine(10 50 40 50 8) + SymbolLine(50 35 50 10 8) + SymbolLine(50 10 40 0 8) + SymbolLine(40 0 10 0 8) + SymbolLine(10 0 0 10 8) + SymbolLine(15 20 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(20 35 30 35 8) + SymbolLine(30 35 35 30 8) + SymbolLine(35 30 40 35 8) + SymbolLine(35 30 35 15 8) + SymbolLine(35 20 30 15 8) + SymbolLine(20 15 30 15 8) + SymbolLine(20 15 15 20 8) + SymbolLine(40 35 50 35 8) +) +Symbol('A' 12) +( + SymbolLine(0 15 0 50 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 20 10 8) + SymbolLine(20 10 25 15 8) + SymbolLine(25 15 25 50 8) + SymbolLine(0 30 25 30 8) +) +Symbol('B' 12) +( + SymbolLine(0 50 20 50 8) + SymbolLine(20 50 25 45 8) + SymbolLine(25 35 25 45 8) + SymbolLine(20 30 25 35 8) + SymbolLine(5 30 20 30 8) + SymbolLine(5 10 5 50 8) + SymbolLine(0 10 20 10 8) + SymbolLine(20 10 25 15 8) + SymbolLine(25 15 25 25 8) + SymbolLine(20 30 25 25 8) +) +Symbol('C' 12) +( + SymbolLine(5 50 20 50 8) + SymbolLine(0 45 5 50 8) + SymbolLine(0 15 0 45 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 20 10 8) +) +Symbol('D' 12) +( + SymbolLine(5 10 5 50 8) + SymbolLine(20 10 25 15 8) + SymbolLine(25 15 25 45 8) + SymbolLine(20 50 25 45 8) + SymbolLine(0 50 20 50 8) + SymbolLine(0 10 20 10 8) +) +Symbol('E' 12) +( + SymbolLine(0 30 15 30 8) + SymbolLine(0 50 20 50 8) + SymbolLine(0 10 0 50 8) + SymbolLine(0 10 20 10 8) +) +Symbol('F' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 10 20 10 8) + SymbolLine(0 30 15 30 8) +) +Symbol('G' 12) +( + SymbolLine(20 10 25 15 8) + SymbolLine(5 10 20 10 8) + SymbolLine(0 15 5 10 8) + SymbolLine(0 15 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 20 50 8) + SymbolLine(20 50 25 45 8) + SymbolLine(25 35 25 45 8) + SymbolLine(20 30 25 35 8) + SymbolLine(10 30 20 30 8) +) +Symbol('H' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(25 10 25 50 8) + SymbolLine(0 30 25 30 8) +) +Symbol('I' 12) +( + SymbolLine(0 10 10 10 8) + SymbolLine(5 10 5 50 8) + SymbolLine(0 50 10 50 8) +) +Symbol('J' 12) +( + SymbolLine(0 10 15 10 8) + SymbolLine(15 10 15 45 8) + SymbolLine(10 50 15 45 8) + SymbolLine(5 50 10 50 8) + SymbolLine(0 45 5 50 8) +) +Symbol('K' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 30 20 10 8) + SymbolLine(0 30 20 50 8) +) +Symbol('L' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 50 20 50 8) +) +Symbol('M' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 10 15 25 8) + SymbolLine(15 25 30 10 8) + SymbolLine(30 10 30 50 8) +) +Symbol('N' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 10 0 15 8) + SymbolLine(0 15 25 40 8) + SymbolLine(25 10 25 50 8) +) +Symbol('O' 12) +( + SymbolLine(0 15 0 45 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 15 10 8) + SymbolLine(15 10 20 15 8) + SymbolLine(20 15 20 45 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 45 5 50 8) +) +Symbol('P' 12) +( + SymbolLine(5 10 5 50 8) + SymbolLine(0 10 20 10 8) + SymbolLine(20 10 25 15 8) + SymbolLine(25 15 25 25 8) + SymbolLine(20 30 25 25 8) + SymbolLine(5 30 20 30 8) +) +Symbol('Q' 12) +( + SymbolLine(0 15 0 45 8) + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 15 10 8) + SymbolLine(15 10 20 15 8) + SymbolLine(20 15 20 45 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 45 5 50 8) + SymbolLine(10 40 20 50 8) +) +Symbol('R' 12) +( + SymbolLine(0 10 20 10 8) + SymbolLine(20 10 25 15 8) + SymbolLine(25 15 25 25 8) + SymbolLine(20 30 25 25 8) + SymbolLine(5 30 20 30 8) + SymbolLine(5 10 5 50 8) + SymbolLine(5 30 25 50 8) +) +Symbol('S' 12) +( + SymbolLine(20 10 25 15 8) + SymbolLine(5 10 20 10 8) + SymbolLine(0 15 5 10 8) + SymbolLine(0 15 0 25 8) + SymbolLine(0 25 5 30 8) + SymbolLine(5 30 20 30 8) + SymbolLine(20 30 25 35 8) + SymbolLine(25 35 25 45 8) + SymbolLine(20 50 25 45 8) + SymbolLine(5 50 20 50 8) + SymbolLine(0 45 5 50 8) +) +Symbol('T' 12) +( + SymbolLine(0 10 20 10 8) + SymbolLine(10 10 10 50 8) +) +Symbol('U' 12) +( + SymbolLine(0 10 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) + SymbolLine(20 10 20 45 8) +) +Symbol('V' 12) +( + SymbolLine(0 10 0 40 8) + SymbolLine(0 40 10 50 8) + SymbolLine(10 50 20 40 8) + SymbolLine(20 10 20 40 8) +) +Symbol('W' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 50 15 35 8) + SymbolLine(15 35 30 50 8) + SymbolLine(30 10 30 50 8) +) +Symbol('X' 12) +( + SymbolLine(0 10 0 15 8) + SymbolLine(0 15 25 40 8) + SymbolLine(25 40 25 50 8) + SymbolLine(0 40 0 50 8) + SymbolLine(0 40 25 15 8) + SymbolLine(25 10 25 15 8) +) +Symbol('Y' 12) +( + SymbolLine(0 10 0 15 8) + SymbolLine(0 15 10 25 8) + SymbolLine(10 25 20 15 8) + SymbolLine(20 10 20 15 8) + SymbolLine(10 25 10 50 8) +) +Symbol('Z' 12) +( + SymbolLine(0 10 25 10 8) + SymbolLine(25 10 25 15 8) + SymbolLine(0 40 25 15 8) + SymbolLine(0 40 0 50 8) + SymbolLine(0 50 25 50 8) +) +Symbol('[' 12) +( + SymbolLine(0 10 5 10 8) + SymbolLine(0 10 0 50 8) + SymbolLine(0 50 5 50 8) +) +Symbol('\' 12) +( + SymbolLine(0 15 30 45 8) +) +Symbol(']' 12) +( + SymbolLine(0 10 5 10 8) + SymbolLine(5 10 5 50 8) + SymbolLine(0 50 5 50 8) +) +Symbol('^' 12) +( + SymbolLine(0 15 5 10 8) + SymbolLine(5 10 10 15 8) +) +Symbol('_' 12) +( + SymbolLine(0 50 20 50 8) +) +Symbol('a' 12) +( + SymbolLine(15 30 20 35 8) + SymbolLine(5 30 15 30 8) + SymbolLine(0 35 5 30 8) + SymbolLine(0 35 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(20 30 20 45 8) + SymbolLine(20 45 25 50 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) +) +Symbol('b' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) + SymbolLine(20 35 20 45 8) + SymbolLine(15 30 20 35 8) + SymbolLine(5 30 15 30 8) + SymbolLine(0 35 5 30 8) +) +Symbol('c' 12) +( + SymbolLine(5 30 20 30 8) + SymbolLine(0 35 5 30 8) + SymbolLine(0 35 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 20 50 8) +) +Symbol('d' 12) +( + SymbolLine(20 10 20 50 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 45 5 50 8) + SymbolLine(0 35 0 45 8) + SymbolLine(0 35 5 30 8) + SymbolLine(5 30 15 30 8) + SymbolLine(15 30 20 35 8) +) +Symbol('e' 12) +( + SymbolLine(5 50 20 50 8) + SymbolLine(0 45 5 50 8) + SymbolLine(0 35 0 45 8) + SymbolLine(0 35 5 30 8) + SymbolLine(5 30 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(0 40 20 40 8) + SymbolLine(20 40 20 35 8) +) +Symbol('f' 10) +( + SymbolLine(5 15 5 50 8) + SymbolLine(5 15 10 10 8) + SymbolLine(10 10 15 10 8) + SymbolLine(0 30 10 30 8) +) +Symbol('g' 12) +( + SymbolLine(15 30 20 35 8) + SymbolLine(5 30 15 30 8) + SymbolLine(0 35 5 30 8) + SymbolLine(0 35 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) + SymbolLine(0 60 5 65 8) + SymbolLine(5 65 15 65 8) + SymbolLine(15 65 20 60 8) + SymbolLine(20 30 20 60 8) +) +Symbol('h' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 35 5 30 8) + SymbolLine(5 30 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(20 35 20 50 8) +) +Symbol('i' 10) +( + SymbolLine(0 20 0 25 8) + SymbolLine(0 35 0 50 8) +) +Symbol('j' 10) +( + SymbolLine(5 20 5 25 8) + SymbolLine(5 35 5 60 8) + SymbolLine(0 65 5 60 8) +) +Symbol('k' 12) +( + SymbolLine(0 10 0 50 8) + SymbolLine(0 35 15 50 8) + SymbolLine(0 35 10 25 8) +) +Symbol('l' 10) +( + SymbolLine(0 10 0 45 8) + SymbolLine(0 45 5 50 8) +) +Symbol('m' 12) +( + SymbolLine(5 35 5 50 8) + SymbolLine(5 35 10 30 8) + SymbolLine(10 30 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(20 35 20 50 8) + SymbolLine(20 35 25 30 8) + SymbolLine(25 30 30 30 8) + SymbolLine(30 30 35 35 8) + SymbolLine(35 35 35 50 8) + SymbolLine(0 30 5 35 8) +) +Symbol('n' 12) +( + SymbolLine(5 35 5 50 8) + SymbolLine(5 35 10 30 8) + SymbolLine(10 30 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(20 35 20 50 8) + SymbolLine(0 30 5 35 8) +) +Symbol('o' 12) +( + SymbolLine(0 35 0 45 8) + SymbolLine(0 35 5 30 8) + SymbolLine(5 30 15 30 8) + SymbolLine(15 30 20 35 8) + SymbolLine(20 35 20 45 8) + SymbolLine(15 50 20 45 8) + SymbolLine(5 50 15 50 8) + SymbolLine(0 45 5 50 8) +) +Symbol('p' 12) +( + SymbolLine(5 35 5 65 8) + SymbolLine(0 30 5 35 8) + SymbolLine(5 35 10 30 8) + SymbolLine(10 30 20 30 8) + SymbolLine(20 30 25 35 8) + SymbolLine(25 35 25 45 8) + SymbolLine(20 50 25 45 8) + SymbolLine(10 50 20 50 8) + SymbolLine(5 45 10 50 8) +) +Symbol('q' 12) +( + SymbolLine(20 35 20 65 8) + SymbolLine(15 30 20 35 8) + SymbolLine(5 30 15 30 8) + SymbolLine(0 35 5 30 8) + SymbolLine(0 35 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) +) +Symbol('r' 12) +( + SymbolLine(5 35 5 50 8) + SymbolLine(5 35 10 30 8) + SymbolLine(10 30 20 30 8) + SymbolLine(0 30 5 35 8) +) +Symbol('s' 12) +( + SymbolLine(5 50 20 50 8) + SymbolLine(20 50 25 45 8) + SymbolLine(20 40 25 45 8) + SymbolLine(5 40 20 40 8) + SymbolLine(0 35 5 40 8) + SymbolLine(0 35 5 30 8) + SymbolLine(5 30 20 30 8) + SymbolLine(20 30 25 35 8) + SymbolLine(0 45 5 50 8) +) +Symbol('t' 10) +( + SymbolLine(5 10 5 45 8) + SymbolLine(5 45 10 50 8) + SymbolLine(0 25 10 25 8) +) +Symbol('u' 12) +( + SymbolLine(0 30 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) + SymbolLine(20 30 20 45 8) +) +Symbol('v' 12) +( + SymbolLine(0 30 0 40 8) + SymbolLine(0 40 10 50 8) + SymbolLine(10 50 20 40 8) + SymbolLine(20 30 20 40 8) +) +Symbol('w' 12) +( + SymbolLine(0 30 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(5 50 10 50 8) + SymbolLine(10 50 15 45 8) + SymbolLine(15 30 15 45 8) + SymbolLine(15 45 20 50 8) + SymbolLine(20 50 25 50 8) + SymbolLine(25 50 30 45 8) + SymbolLine(30 30 30 45 8) +) +Symbol('x' 12) +( + SymbolLine(0 30 20 50 8) + SymbolLine(0 50 20 30 8) +) +Symbol('y' 12) +( + SymbolLine(0 30 0 45 8) + SymbolLine(0 45 5 50 8) + SymbolLine(20 30 20 60 8) + SymbolLine(15 65 20 60 8) + SymbolLine(5 65 15 65 8) + SymbolLine(0 60 5 65 8) + SymbolLine(5 50 15 50 8) + SymbolLine(15 50 20 45 8) +) +Symbol('z' 12) +( + SymbolLine(0 30 20 30 8) + SymbolLine(0 50 20 30 8) + SymbolLine(0 50 20 50 8) +) +Symbol('{' 12) +( + SymbolLine(5 15 10 10 8) + SymbolLine(5 15 5 25 8) + SymbolLine(0 30 5 25 8) + SymbolLine(0 30 5 35 8) + SymbolLine(5 35 5 45 8) + SymbolLine(5 45 10 50 8) +) +Symbol('|' 12) +( + SymbolLine(0 10 0 50 8) +) +Symbol('}' 12) +( + SymbolLine(0 10 5 15 8) + SymbolLine(5 15 5 25 8) + SymbolLine(5 25 10 30 8) + SymbolLine(5 35 10 30 8) + SymbolLine(5 35 5 45 8) + SymbolLine(0 50 5 45 8) +) +Symbol('~' 12) +( + SymbolLine(0 35 5 30 8) + SymbolLine(5 30 10 30 8) + SymbolLine(10 30 15 35 8) + SymbolLine(15 35 20 35 8) + SymbolLine(20 35 25 30 8) +) +Via[48000 28000 8000 4000 0 3000 "" ""] +Via[63000 86000 8000 4000 0 3000 "" ""] + +Element["" "DIP18" "U5" "16F84" 116500 28500 17000 5000 3 100 ""] +( + Pin[0 0 8000 3000 5600 2800 "1" "1" "square"] + Pin[0 10000 8000 3000 5600 2800 "2" "2" ""] + Pin[0 20000 8000 3000 5600 2800 "3" "3" ""] + Pin[0 30000 8000 3000 5600 2800 "4" "4" ""] + Pin[0 40000 8000 3000 5600 2800 "5" "5" ""] + Pin[0 50000 8000 3000 5600 2800 "6" "6" ""] + Pin[0 60000 8000 3000 5600 2800 "7" "7" ""] + Pin[0 70000 8000 3000 5600 2800 "8" "8" ""] + Pin[0 80000 8000 3000 5600 2800 "9" "9" ""] + Pin[30000 80000 8000 3000 5600 2800 "10" "10" ""] + Pin[30000 70000 8000 3000 5600 2800 "11" "11" ""] + Pin[30000 60000 8000 3000 5600 2800 "12" "12" ""] + Pin[30000 50000 8000 3000 5600 2800 "13" "13" ""] + Pin[30000 40000 8000 3000 5600 2800 "14" "14" ""] + Pin[30000 30000 8000 3000 5600 2800 "15" "15" ""] + Pin[30000 20000 8000 3000 5600 2800 "16" "16" ""] + Pin[30000 10000 8000 3000 5600 2800 "17" "17" ""] + Pin[30000 0 8000 3000 5600 2800 "18" "18" ""] + ElementLine [20000 -5000 35000 -5000 1000] + ElementLine [-5000 -5000 10000 -5000 1000] + ElementLine [35000 85000 35000 -5000 1000] + ElementLine [-5000 85000 35000 85000 1000] + ElementLine [-5000 -5000 -5000 85000 1000] + ElementArc [15000 -5000 5000 5000 0 180 1000] + + ) + +Element["" "TO220" "U6" "unknown" 179500 45000 23000 -15000 0 100 ""] +( + Pin[0 -10000 8000 3000 8600 5000 "1" "1" "square,edge2"] + Pin[0 0 8000 3000 8600 5000 "2" "2" "edge2"] + Pin[0 10000 8000 3000 8600 5000 "3" "3" "edge2"] + Pin[67000 0 17500 3000 15100 13000 "4" "4" "edge2"] + ElementLine [0 -10000 18000 -10000 3000] + ElementLine [0 0 18000 0 3000] + ElementLine [0 10000 18000 10000 3000] + ElementLine [18000 -20000 18000 20000 2000] + ElementLine [18000 20000 55500 20000 2000] + ElementLine [55500 -20000 55500 20000 2000] + ElementLine [18000 -20000 55500 -20000 2000] + ElementLine [55500 -20000 55500 20000 2000] + ElementLine [55500 20000 68000 20000 2000] + ElementLine [68000 18500 68000 20000 2000] + ElementLine [68000 18500 75000 18500 2000] + ElementLine [75000 18500 75000 20000 2000] + ElementLine [75000 20000 79000 20000 2000] + ElementLine [79000 -20000 79000 20000 2000] + ElementLine [75000 -20000 79000 -20000 2000] + ElementLine [75000 -20000 75000 -18500 2000] + ElementLine [68000 -18500 75000 -18500 2000] + ElementLine [68000 -20000 68000 -18500 2000] + ElementLine [55500 -20000 68000 -20000 2000] + + ) + +Element["" "RCY300" "C11" "unknown" 205500 94500 2500 10000 3 100 ""] +( + Pin[0 0 8000 3000 5600 5000 "1" "1" ""] + Pin[0 30000 8000 3000 5600 5000 "2" "2" "square"] + ElementArc [0 15000 30000 30000 270 360 1000] + + ) + +Element["" "ALF400" "Z5" "unknown" 129000 142500 -33800 900 0 100 ""] +( + Pin[0 0 8000 3000 4600 2000 "2" "2" "square,edge2"] + Pin[-40000 0 8000 3000 4600 2000 "1" "1" "edge2"] + ElementLine [-13300 0 0 0 1000] + ElementLine [-40000 0 -26700 0 1000] + ElementLine [-13300 0 -26700 6600 1000] + ElementLine [-26700 -6600 -26700 6600 1000] + ElementLine [-26700 -6600 -13300 0 1000] + ElementLine [-13300 -6600 -13300 6600 1000] + + ) + +Element["" "ACY400" "R21" "unknown" 82500 28000 -5300 32000 3 100 ""] +( + Pin[0 0 8000 3000 5100 3000 "1" "1" "square"] + Pin[0 40000 8000 3000 5100 3000 "2" "2" ""] + ElementLine [0 0 0 10000 1000] + ElementLine [0 30000 0 40000 1000] + ElementLine [3300 10000 3300 30000 1000] + ElementLine [-3300 30000 3300 30000 1000] + ElementLine [-3300 10000 -3300 30000 1000] + ElementLine [-3300 10000 3300 10000 1000] + + ) + +Element["" "AXIAL_LAY-200" "C13" "100n" 87000 110000 -6000 -11400 0 100 ""] +( + Pin[5000 0 8000 3000 8600 3000 "1" "1" "edge2"] + Pin[-15000 0 8000 3000 8600 3000 "2" "2" "edge2"] + ElementLine [0 -1600 0 1600 1000] + ElementLine [-10000 -1600 0 -1600 1000] + ElementLine [-10000 -1600 -10000 1600 1000] + ElementLine [-10000 1600 0 1600 1000] + ElementLine [-15000 0 -10000 0 1000] + ElementLine [0 0 5000 0 1000] + + ) +Layer(1 "component") +( +) +Layer(2 "solder") +( + Line[48000 28000 48000 30000 4000 4000 "clearline"] + Line[48000 30000 69000 51000 4000 4000 "clearline"] + Line[69000 51000 96000 51000 4000 4000 "clearline"] + Line[96000 51000 98000 53000 4000 4000 "clearline"] + Line[98000 53000 98000 60000 4000 4000 "clearline"] + Line[98000 60000 106000 68000 4000 4000 "clearline"] + Line[106000 68000 116000 68000 4000 4000 "clearline"] + Line[116000 68000 116500 68500 4000 4000 "clearline"] + Line[82500 68000 82500 99500 4000 4000 "clearline"] + Line[82500 99500 72000 110000 4000 4000 "clearline"] + Line[92000 110000 93000 110000 4000 4000 "clearline"] + Line[93000 110000 101000 102000 4000 4000 "clearline"] + Line[101000 102000 101000 81000 4000 4000 "clearline"] + Line[101000 81000 103000 79000 4000 4000 "clearline"] + Line[103000 79000 116000 79000 4000 4000 "clearline"] + Line[116000 79000 116500 78500 4000 4000 "clearline"] + Line[116500 48500 129500 48500 4000 4000 "clearline"] + Line[129500 48500 133000 52000 4000 4000 "clearline"] + Line[133000 52000 133000 64000 4000 4000 "clearline"] + Line[133000 64000 137000 68000 4000 4000 "clearline"] + Line[137000 68000 146000 68000 4000 4000 "clearline"] + Line[146000 68000 146500 68500 4000 4000 "clearline"] + Line[146500 88500 137500 88500 4000 4000 "clearline"] + Line[137500 88500 129000 97000 4000 4000 "clearline"] + Line[129000 97000 118000 97000 4000 4000 "clearline"] + Line[118000 97000 116500 98500 4000 4000 "clearline"] + Line[129000 142500 131500 142500 4000 4000 "clearline"] + Line[131500 142500 161000 113000 4000 4000 "clearline"] + Line[161000 113000 161000 63000 4000 4000 "clearline"] + Line[161000 63000 158000 60000 4000 4000 "clearline"] + Line[158000 60000 148000 60000 4000 4000 "clearline"] + Line[148000 60000 146500 58500 4000 4000 "clearline"] + Line[205500 94500 205500 44500 4000 4000 "clearline"] + Line[205500 44500 197000 36000 4000 4000 "clearline"] + Line[197000 36000 180500 36000 4000 4000 "clearline"] + Line[180500 36000 179500 35000 4000 4000 "clearline"] + Line[82500 28000 96500 14000 4000 4000 "clearline"] + Line[96500 14000 128000 14000 4000 4000 "clearline"] + Line[128000 14000 133000 19000 4000 4000 "clearline"] + Line[133000 19000 133000 35000 4000 4000 "clearline"] + Line[133000 35000 136500 38500 4000 4000 "clearline"] + Line[136500 38500 146500 38500 4000 4000 "clearline"] + Line[146500 28500 148000 27000 4000 4000 "clearline"] + Line[148000 27000 166000 27000 4000 4000 "clearline"] + Line[166000 27000 166000 42000 4000 4000 "clearline"] + Line[166000 42000 169000 45000 4000 4000 "clearline"] + Line[169000 45000 179500 45000 4000 4000 "clearline"] + Line[179500 55000 179500 98500 4000 4000 "clearline"] + Line[179500 98500 205500 124500 4000 4000 "clearline"] + Line[89000 142500 107500 124000 4000 4000 "clearline"] + Line[107500 124000 127000 124000 4000 4000 "clearline"] + Line[127000 124000 127000 110000 4000 4000 "clearline"] + Line[127000 110000 138500 98500 4000 4000 "clearline"] + Line[138500 98500 146500 98500 4000 4000 "clearline"] + Line[146500 78500 132500 78500 4000 4000 "clearline"] + Line[132500 78500 132000 78000 4000 4000 "clearline"] + Line[132000 78000 121500 88500 4000 4000 "clearline"] + Line[121500 88500 116500 88500 4000 4000 "clearline"] + Line[63000 86000 63000 72000 4000 4000 "clearline"] + Line[63000 72000 67000 68000 4000 4000 "clearline"] + Line[67000 68000 82500 68000 4000 4000 "clearline"] + Polygon("clearpoly") + ( + [257000 147000] [169000 147000] [169000 10000] [257000 10000] + ) +) +Layer(3 "GND") +( +) +Layer(4 "power") +( +) +Layer(5 "signal1") +( +) +Layer(6 "signal2") +( +) +Layer(7 "signal3") +( +) +Layer(8 "signal4") +( +) +Layer(9 "silk") +( +) +Layer(10 "silk") +( +) Index: tags/1.0.5/doc/gcode.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/gcode.pdf =================================================================== --- tags/1.0.5/doc/gcode.pdf (nonexistent) +++ tags/1.0.5/doc/gcode.pdf (revision 953) Property changes on: tags/1.0.5/doc/gcode.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/gcode.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/gcode.png =================================================================== --- tags/1.0.5/doc/gcode.png (nonexistent) +++ tags/1.0.5/doc/gcode.png (revision 953) Property changes on: tags/1.0.5/doc/gcode.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/gcode_control_img.eps =================================================================== --- tags/1.0.5/doc/gcode_control_img.eps (nonexistent) +++ tags/1.0.5/doc/gcode_control_img.eps (revision 953) @@ -0,0 +1,711 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: GIMP PostScript file plugin V 1,17 by Peter Kirchgessner +%%Title: gcode_control_img.eps +%%CreationDate: Mon May 30 02:37:26 2011 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%Pages: 1 +%%BoundingBox: 0 0 404 231 +%%EndComments +%%BeginProlog +% Use own dictionary to avoid conflicts +10 dict begin +%%EndProlog +%%Page: 1 1 +% Translate for offset +0 0 translate +% Translate to begin of first scanline +0 230.40000000000001 translate +403.20000000000005 -230.40000000000001 scale +% Image geometry +1680 960 1 +% Transformation matrix +[ 1680 0 0 960 0 0 ] +currentfile /ASCII85Decode filter /RunLengthDecode filter +%%BeginData: 51668 ASCII Bytes +image +JcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqR +JcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqR +JcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqR +JcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqRJcDqR +nG`K=^]4@!KE(H@!._ib!'c,9nG`K=^]4@!KE(H@!._ib!'c,9nG`K=^]4@!KE(H@!._ib!'c,9 +nG`K=^]4@!KE(H@!._ib!'c,9nG`K=^]4@!KE(H@!._ib!'c,9nG`K=^]4@!jSo5LklA9onG`K= +^]4@!jSo4qkl:]J])V:"!._ib!'fQEkPtSn])V:"!._ib!'fTF!<20^!!g+8nG`K=^]4@!jo5>Y +kPtSb])V:"!._ib!'fTF!;PaX!!0\2nG`K=^]4@!jo5>Mk5`*nnG`K=^]4@!jo5>=k5YL3]DqC# +!._ib!'fTF!5Rat!'e*qnG`K=^]4@!jo5=2k5YK(]DqC#!._ib!'fTFjo>Al]DqC#!._ib!'fWG +!<2*\!!g.9nG`K=^]4@!k5PGZjo>A`]DqC#!._ib!'fWG!;P[V!!0_3nG`K=^]4@!k5PGNjT)pm +nG`K=^]4@!k5PG>jT#:1]`7L$!._ib!'fWG!5R[r!'e-rnG`K=^]4@!k5PF3jT#9&]`7L$!._ib +!'fWGj8]/j]`7L$!._ib!'fZH!<2$Z!!g1:nG`K=^]4@!kPkP[j8]/^]`7L$!._ib!'fZH!;PUT +!!0b4nG`K=^]4@!kPkPOirHalnG`K=^]4@!kPkP?irB(/^&RU%!._ib!'fZH!5RUp!'e0snG`K= +^]4@!kPkO4irB'$^&RU%!._ib!'fZHiW&rh^&RU%!._ib!'f]I!<1sX!!g4;nG`K=^]4@!kl1Y\ +iW&r\^&RU%!._ib!'f]I!;QKm!"\Dqr;Zfu^&RU%!._ib!'f]I!:]pe!$CP,!.b"J^&RU%!._ib +!'f]I!9!eU!'ffL!5SO5!.V`_nG`K=^]4@!kl1Xur;ZhIli-tCr;Zg^^Am^&!._ib!'f]I!.b"J +lMgkRr;Zg>^Am^&!._ib!'f]Ir;ZfulMgkZr;Zg.^Am^&!._ib!'f`J!<2os!!DNd!;ucq!!g7< +nG`K=^]4@!l2Lb]r;Zg&lMgk`r;Zg"^Am^&!._ib!'f`J!;QKm!"\>or;Zfu^Am^&!._ib!'f`J +!;QKm!$CJ*!.b"J^Am^&!._ib!'f`J!:]pe!'f`J!5SO5!.Vc`nG`K=^]4@!l2LbQr;ZhIl2LbA +r;Zg^^]3g'!._ib!'f`J!9!eUkl1YPr;Zg>^]3g'!._ib!'f`J!9!hV!!2<`!;QKm!"ZjEnG`K= +^]4@!l2LbArVup#kl1Y\r;Zg&^]3g'!._ib!'f`J!9!hV!!h`f!<2os!!C"9nG`K=^]4@!l2LbA +rVup/kPtJ\!!0k7nG`K=^]4@!l2LbArVup?kPkO4r;aV4nG`K=^]4@!l2LbArVup_kPkOtr;ZhI +_#Np(!._ib!'f`J!9!hV!.X23!9!eU!'e:!nG`K=^]4@!l2LbArW)*\!:]pe!$B#VnG`K=^]4@! +l2LbArW)*\!;QKm!"ZmFnG`K=^]4@!l2LbArW)*\!;ucq!!g=>nG`K=^]4@!l2LbArW)*\!<2os +!!C%:nG`K=^]4@!l2LbArW)'[r;Zfu_#Np(!._ib!'f`J!9!hVjo5=2r;aY5nG`K=^]4@!l2LbA +rW)'[!5SO5!.VibnG`K=^]4@!l2LbArW)'[!9!eU!'e="nG`K=^]4@!l2LbArW)'[!:]pe!$B&W +nG`K=^]4@!l2LbArW)'[!;QKm!"ZpGnG`K=^]4@!l2LbArW)'[!;ucq!!g@?nG`K=^]4@!l2LbA +rW)'[!<2os!!C(;nG`K=^]4@!l2LbArW)$Zr;Zfu_>j$)!._ib!'f`J!9!hVjSo41r;a\6nG`K= +^]4@!l2LbArW)$Z!5SO5!.VlcnG`K=^]4@!l2LbArW)$Z!9!eU!'e@#nG`K=^]4@!l2LbArW)$Z +!:]pe!$B)XnG`K=^]4@!l2LbArW)$Z!;QKm!"ZsHnG`K=^]4@!l2LbArW)$Z!;ucq!!gC@nG`K= +^]4@!l2LbArW)$Z!<2os!!C+^L+ +mf*9;r;Zg"i;`i!!!9%rrD!V!;c]q_#"-#s7u]q&+9GtJGfHJ"5s4Krr@Sc!!*?( +mf3=ir;QcTrW)fp!5SI3n,EBPmr;QcTrW)fp!5SI3n,EC_ +qZ$U,n,ECcqZ$VGiW&EI!._lc!>"tn!!%NIrrD!V!;c]q_#"-#rrDuo!!!PurrDuo!!%N-s7$$g +JAD3d&,>Pm!.XtI!9!hVqYpQ2qZ-*b!;u]o!"\Pu!;u]o!.Wu-nG`K=_#OKHq!J+^5Q1T^i;N`Q +rrBk3!:Tpfr;-Ho&+BMur;-HoJ)UFsrr@Sc!!*W*mJm5OrVllUrW)fp!5SI3n,ECcqZ$U,n,EC_ +qZ$U\iW&EI!._lc!>"tn!!#7^rrD!V!;c]q_#"-#rrDuo!!!PurrDik!!#7Bs7$$gJAD3d&,>Pm +!'gG^!9!hVqYpQ2qZ-*b!;u]o!"\Pu!;QEk!'fHBnG`K=_#OKHq!J+^+8u3>i;N`QrrBk3!:Tpf +r;-Ho&+BMuq"k$k5N2Y3rr@Sc!!*W*mJm5/rVllUrW)fp!5SI3n,ECcqZ$U,n,EC_qZ$U\iW&EI +!._lc!>"tn!!",>rrD!V!;c]q_#"-#rrDuo!!!PurrDik!!#7Bs7$$gJAD3d&,>Pm!$D1>!9!hV +qYpQ2qZ-*b!;u]o!"\Pu!;QEk!'fHBnG`K=_#OKHq!J+^+8u3>i;N`QrrBk3!:Tpfr;-Ho&+BMu +q"k$k5N2Y3rr@Sc!!*W*mJm5/rVllUrW)fp!5SI3n,ECcqZ$U,n,EC_qZ$U\iW&EI!._lc!>"tn +!!",>rrD!V!;c]q_#"-#rrDuo!!!PurrDuo!!%N-s7$$gJAD3d&,>Pm!$D1>!9!hVqYpQ2qZ-*b +!;u]o!"\Pu!;u]o!.Wu-nG`K=_#OKHq!J+^+8u3>i;N`QrrBk3!:Tpfr;-Ho&+BMur;-HoJ)UFs +rr@Sc!!*W*mJm5OrVllUrW)fp!5SI3n,ECcqZ$U,n,ECcqZ$VGiW&EI!.`8n!!2us!<2rt!>"u) +!!#7ZrrE&q!!#7^rrD!V!;c]q_#"-#rrDuo!!!PurrE&q!9!nHrr@Sn!!!,ts8E!!&,?,(!'g;Z +!<2iq!'gG^!9!hVqYpQ2qZ-*b!;u]o!"\Pu!<2iqi;`EquHZp!9!hVqYpQ2qZ-*b +!;u]o!"\Mt!.b"J!!D0ZnG`K=bQ%VbqZ$d%huE`fq#16n5PY6YJG]EFrrD!V!;c]q_#"-#rrDuo +!!!Ptrr@TJ!!!8^s7$$gJBRun+8Z$A"5j.Z&,?,(!'g8Y!5SO5!!3#t!9!hVqYpQ2qZ-*b!;u]o +!"\Mtqu?^-i;`!!NJ_!!!Q)rVup_mJd1ErW(%>!5SO5 +!.Wl*nG`K=f)Pf#pAb!i"U!Z_!"\l(!!#7NrrD!V!6G0?JGfK(s7$$gJCaeos8)d""5j.Z&,?,( +!'flN!9!hVaT)2=!!1pUnG`K=fDkmPp&Fmh"U!Z_!"\l(!!#7NrrD!V!6P6@rqufs"5X"Hrr@T% +!!39&r:'aj"5j.Z&,?,(!'flN!9!hVao;A=r;Zg&h>d!E!.`]%!XJbpnGi^phuE`fq#16n5OJIN +i;N_urrDim!!!Pcs7$$gJCji'&-'H8!!NJ_!!!Q)rVup_mJd1ErW((?!:]pe!$C%snG`K=fDksp +s+'V>"U!Z_!"\l(!!#7WrrMToqYpQRrW)]m!<@W"rrD!U!!#7>s7$$gJCji&5QC3Q"U!Z_!"\l( +!!#7Ws8N'!J,B6G_#=?/rrVZi#M&hS_#465J)1.orr@T%!!.TKn,NUohuE`fq#16n5PP0[qu?^= +qu6YHrW)`n!l+d:ec,W"r;bXQnG`K=fDksPr9s[i"5j.Z&,?,(!'g5X"7Q9j#Q+Q"!;QTn!!%N" +s8;ot!Sm_Err@TH!<<'!^u>=q!WVra!!NJ_!!!Q)rVup_p\t?2!!!&trrE&s!;ZWpr;HZr+4pMm +rqufs"5NqGrr@TI!!=>Cs8M!X!X&Jln,NUohuE`fq#16n5PP0XJGoQHrrDuq!;ZWpq#16n&(gg] +r;?Tq#Mf@Krr@TJ!!!-"rrDQK!!3E*i:$^M"5j.Z&,?,(!'g5Xr;ZhIrVllmr;cZn!:]sf!!h-U +!;QKm!"[lbnG`K=r;Zg.rVllqirB,ks1n+("U!Z_!"\l(!!#7YrrE&s!!#7^rrDQe!;ZWpi;N]V +"5!PQnGN=e+5Hncrr@TJ!!%NHs5O(\+9-l\!!NJ_!!!Q)rVup_q#:?lr;Zg>rVllUr;cZn!5SR6 +!!1^O!9!eU!'f9=nG`K=rVup!qu6ZSj8]3Fs6fpk"5j.Z&,?,(!'g8Y!;QKm!"]&.!5SR6!!2oq +!.b"JfDbidr;ZhIh#HmD!.b%K!!iE$!;PUT!It+;!!NJ_!!!Q)rVup_q#:?`r;Zg&rVlkJrVup! +q>^?m!.WZ$!.b"Jg]-dC!.b%K#9X!G^]FK8ro=%[s8;_s7l$_"U!Z_!"\l(!!#7YrrBk,!!!,t +rrDup!!"+orrE&s!!!,Us7$$gJGoQKrr@TK!<<'!^ubUu"97lZ!!NJ_!!!Q)rVup_q#:?0oDejr +qYpQnqu?^=g&D'Mr;Zg&g]-dC"b6RQ!WW)r!!48Bi8t"@#QN`N!!NJ_!!!Q)rVup_q#:>EoDek% +qYpQjqu?^-g&D'Ir;Zg.g]-dC"b6RQ#QN`\!!39&puVPX&-'H6!!NJ_!!!Q)rVup_q#:>EoDek5 +qYpQjqu?^-g&D'Ar;Zg>g]-dC"b6RQ&-%1X!!3,tjo>H)s+'P<"U!Z_!"\l(!!#7Ys763j5PkB[ +nGE7d#MK+Wi;EWU5MQ5-rrdiP!$D4;!!,=`jo>EHs6]jj"5j.Z&,?,(!'g8Yo)Jc?qYpQbqu?^% +g&D&fr;ZhIg]-dC"FpIPJ,K0D!?_@(!!.TKmJmCmhuE`fq#16n5PbUHooDejnq>UHQqu?^!gA_0Pr;Zg"gAg[B +"FpISs+'qG!WVZQ!!39&nEp8["5j.Z&,?,(!'g;Z!<2Tj!!i?"!9!bT!!CsT!;ucq!!h6XnG`T@ +!!iQ"!!.TEkPtYhs5<;F"U!Z_!"\l(!!#7ZrrDuh!!!Q*rrBk4!!!&RrrDim!!!P`s7$$jJ,g,X +q#CF;r9++^&-'H5!!NJ_!!!Q)rVup_q>UHmoDek5q>UH1qu?]tgA_0Br;Zg>gAg[B"+U@nq"Xmj +&,tbm![%GmmJmCmhuE`fq#16n5Pb;!<`Ac!!.TK +r;Zg"q#C3k"U!Z_!"\l(!!#7ZrrDuh!;QQo_#+04!S[PRJGfK$s7$$jJ,k)7q#CHss+'>6!WW)r +!!!9!s8)d""5j.Z&,?,(!'g;Z!;uKi!!2lp!5SL4!!1gRr;Zfug&LRA"+UCOJG9*Fs1mn"!Wi>r +r;Zg.q#C3k"U!Z_!"\l(!!#7ZrrDui!!!,rrrBk4!!!&SrrE&s!!!,Ss7$$iJ-#]E!!.T-l2Ukf +s7#se!$D"9qZ$d%huE`fq#16n5Pb"tj +!!,=ar;ZfunG`XL!!!Q)rVup_q>UHoo`+uAq#:?Pqu?^!g]%8hr;ZhIg&LRA!e:gNpAb4!r9=7_ +J,]BH!!D`j"Mb!;&,?,(!'g;Z!<2Wkp\t6Oqu?^!g]%8(r;bLMnG`Q?&)d0^!<`8b!!3,tr;Zm( +s5<_R!!iB#"FpIP&,?,(!'g8Yp&G'np\t6_qu?^%g].3P!!1aPnG`Q?+5lkn!<`>e!!33$q#(0o +&-'HA!!!,ts8E!!&,?,(!'g8Yp&G'pp\t6_qu?^%h#@BRr;Zg"f`1I@!e;B.pAb3prp'Oc"97lh +!!48BJG9*EJ,]HKrUBdd!>"u)!!#7Yrr@TD!!!8urrDil!!!PbrrDuq!!!8Vs7$$iJ3UjD!!*-# +lMptks5=Hr;ZkJrqHHs!WW&us8Mrs!C-AY!!#7YrrBk/!!#7XrrDup!!"+rrrDQe!!"+ns7$$h +J:I4l!IoXd!!48BJGfHKs8;Wl"UG(C!$D7>!!,=ZrVup_q#:?0pAjpe!;u`p!$C"r!9!eU!'f-9 +nG`N>J+WdBIt6kc!C-V_!!33$q"Ogl&,uV0#Q+N$q#16n5PY6Yi;EWU"7cBkrql`r5MZ8=_#465 +J(XejrrIZLo`,"W_!D%%J,]BH!X&Jlp](F=qu?]tqu6ZkrVup_q#:?`r;Zg&nGiCd!.Wf(!.b"J +fDk@?!J(1B!!,="li7(dr;?Ts#QN`W!!,=RrVuqJr;QcdrVup_q#:?hr;Zg.nG`K=r;bUPr;Zfu +fDk@?!J11A!!+2"m/R1is7lNm!Y>=Hp](=Zi;N]V5Q(N]i;N]V5PY6Yr;?Tq+7T:1_#=<6!Sm\T +rqufs"5!SBrrI]Ko`,"7i9^LG#QO;l!!48BJG9*FJ&)$`!$D.=!5SR6!'g8Y!<2os!'fuQ!9!hV +!!D$V!;ucq!!h-UnG`N?r:L$j+5lMd!XJb`r;Zj_s7ZKos+((K!"]#-!.b%K!'g5Xr;ZhInG`LX +rVup'h#@BLr;Zg.fDk@?!J1%=!!*Vgm/R1us1nR5!It+D!!*-#r;Zg&r;Z]q!'g5X!.b%Kn,EC_ +rVup/h#@BDr;Zg>fDk@?!JC1?!!*W"m/R20s+(%J!WW)m!!*-"r;Zg"rVllsr;Zg^p\t?2!!!&g +rrDur!!"+rrrD!U!!#78s7$$hKD>*>!>"\e!!+2Ar;Zm"s7l?h!<`8u!!!&urrDuq!!#7Xrr_`j +!!hrlrVuqJh#@Air;ZhIfDk@?!JBn7!!*>om/R/Orqufu"97lc!!*2squH]q!;QKm!'g5X"8i-! ++7B.1^]4Dirr@TJ!7q2>rrIcAo`,!tnEg2V5Q(H[!XJb`p](="nFHV[J+ipB!!%N:rrVZi#M]:W +!!!&Ns7$$hKCJO6!=/,]!!,=Zr;Zm0s1nC0!=/,c!!%NBrrMTom/I(dJ)(&(rqufs"4mMArrIo5 +o`,!pq!A%^J+3C:!?_@9!!*Vgo)Q9"!;ucq!!h*TnG`NEi:R'N"8M6`!Is&+!!,=`pAb4)i:?rX +rrDim!!!P\s7$$hLZ%h*!<`,a!!.Sbr;ZkJr:^0l&&@f;!!0S/!:]pe!$BelnG`NEi:R'N"8M6` +!WTt6!!3,ppAb4)_"7U,"1S:1i;EWU5M#l(rrIo5o`,!pq!A%^s+((K!Wi>jpAb49JFigA#Ij^5 +_#465J(FYhrrIo5o`,!pq!A%^s+((K!X&J\pAb49JFigA&%DQ=JGfJus7$$hLVWQ_!'^#OMHk +!.Wi)!<2os!!CdOnG`NM_"@[.!W;?c![KQr;Zg& +ec5.=!KY%h!!*,umJm7gs8;ou5Q:?V!'g&Tp&>-l!!",/rrTt9!T!bUq#(0m&(U^LrrJ1ro`,!n +r9aOc!WW)u!It%@!!#7U!!!&mrr_`j!!hrlrVuqJhZ!TFr;Zg>ec5.=!KY%h!!*,umJm7gs8;ou +s7l9f!'g)U!!Doo"2Fm:!Up$gr;HZr+5["ti;EWU5Lof'rrJ1ro`,!nr9aOc!WW-!!Wi>jp&G(W +oDejrp&>#BrW)Ee!;QNn!"[rd!5SO5!.WQ!nG`NM_"@[.!W;?c!#BquHQm!<2Tj!"\#f!.b"Je,Sq;!JfV+!!*2smJm7gs8E!!#Q45p!>!!>!!",6rr@TI +!;ZWpr:Bsh&)dKd!!!&Ks7$$hLZ%h*!<`,b!!*-#rVus(r:L$j&)d-]!'g/VqZ$VGqYpQjoDejr +iVroWr;Zg"e,Sq;!JB>'!!*2kmJm7gs8E!!#Q45p!=.QV!!%NAs8)crJ,90FnFQ\\#N>[_r;?Tq +#Li_BrrIcAo`,!tnEp8W!WW-!!=/Pq!!*>opAb0op&>$kqZ$U\qYpQRoDejniVroQr;Zg.e,Sq; +!JBn7!!*>omJm7gs8E!!#Q45p!<_ic!!!8srrE&q!!#7[rrBk,!!!,[rrDQe!!"+is7$$hKCJO6 +!=/,^!!*-#rVus(r:L$j"8Mcon,ECeqZ$U\qYpPGoDejniVro9r;Zg^e,Sq;!JC1?!!*W"mJm7g +s8E!!#Q45p!Ie<[A5Ci/%!$iqZ$U$VrqcZq5Q(N]q!nCb"8DfqpuqbY"4@/$kqZ$U\r;Qcdnc/Xlp\t6_kl:\gdJr_9!e:g>pAb3rr9XIb +!WW-!!=/Po!!!Q/rrBk4!!#7VrrE&q!!#7]rrD!J!!!,qrrD!A!!!PWs7$$iJ.LT4!!*3"m/R.f +s8E!!#Q4/n!"])/!5SL4!'g,UqZ$VGr;Qc4nc/Xpp\t6/kl:]*dJr_9!e:OFpAb4!q!A%^!WW-! +!=/Po!!",?rrD!T!!#7Us8)crJ,Kf!!*-#rVus(r:Bsi5N)M@!C-)P!!#7UrrDuq!!",=rrD!U!;c]q_#=<6!VcToJE[%65LBH" +rr[cO+7T(+!=/Vj!!*-#rVus(r:BsiJ&)$`!?_+8!!#7UrrE&s!!#7]rrD!V!!!&rrrD!V!!!,q +s6'F_J'e5brr[cO&,>r#!>#+p!!*-#rVus(r:Bsis+((K!>#,,!!#7Ts8;otJ,K:li7%es8E!! +#Q45p!<`,p!!*&t!!#7Trr`0!!$D+_#=<65O&1Ji;N`BrrDin!!!P@s7$$gJGoNM5Q?95!<<)a!!*-#rVus(r:L$j +++X7h!>",f!!#7JrrD!V!:0Xbq#16n+1hLArr@TK!!aVGn,NFns8M9`!_rVup_o)J^i!.XnG +!9!hVq#:Eb!!i8u!;QNn!'e'pnG`K=r;Zg.rVllqkl:_bs8E!!#Q45p!'g>\!=.Q^!!#7Trr`0! +!$D+\!=/,n!!#7T +rr_`j!!iE$!9!hVq#C\!=/,n +!!#7Ts8;otJ,K-!WW-!!=/Pq!!#7\!!*>orVup_ +o`"pjr;Zg^r;QcTrW)co!9!hV!!E#r!;QNn!'e'pnG`K=hZ*ZXs8E!!#Q45p!$D(UGFr;cWm!;QNn!'e'pnG`K=hZ*ZXs8E!!#Q45p!?Zji!!*VgrVup_o`"p\ +r;Zg&r;QcTrW)coqu?_Hq>UHirVup_])V:"!.`r,!UHirVup_])V:"!.`r,!UHirVup_])V:"!.`r,!UHirVup_])V:"!.`r,!!!D!!+1WrVup_o`"oAquHZp +!9!hVqYpQjqu?^-q>UHirVup_])V:"!.`r,!UHirVup_])V:"!.`r,!UHirVup_])V:"!.`r,!$VrqcZq5Q1T^i;N`Q +rrD!T!!!,srrDin!!#6ps7$$gJDU>-!WW-!!=/Pq!!*2squ?`sr;Zg^p&>$kqZ$U\rVllUrW)fp +!9!bT!!E&s!;QNn!'e'pnG`K=hZ*ZXs8E!!#Q45p!UHirVup_])V:"!.`r,!!9!hVqYpQ2 +qu?]tq>UHirVup_])V:"!.`r,!i;N`QrrBk4 +!!!&qrrDin!!#6ps7$$gJDU>-!WW-!!=/Pp!!.S"rVus0q#(0m5PtH\i:R'M+8u3>i;N`QrrBk4 +!!!&qrrDin!!#6ps7$$gJDU>-!WW-!!=/Pp!!,="rVus@nGN=e5PtH\_"@[-+8u3>i;N`QrrBk4 +!!!&qrrDin!!#6ps7$$gJDU>-!WW-!!=/Pp!!,=BrVus`i;EWU5PtH\JFrmB+8u3>i;N`QrrBk4 +!!!&qrrDin!!#6ps7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655PtKQ!!",>rrD!V!;c]q_#+04 +!Vu`qq#16n5J$marr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7]rrE&j!!",>rrD!V!;c]q_#+04 +!Vu`qq#16n5J$marr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7]rrDuh!!",>rrD!V!;c]q_#+04 +!Vu`qq#16n5J$marr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7]rrDid!!",>rrD!V!;c]q_#+04 +!Vu`qq#16n5J$marr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7]rrDQ\!!#7^rrD!V!;c]qi;-!WW-!!=/Pp!!+22rVutK_#4655Q1T^q""L`rrD!V!;c]qq"t*l&,Q;+q#(0m +5J$marr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7^rrDQ\!!!&trrD!V!;c]qr;6Np+8Z!;nGN=e +J%G[Lrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7^rrD!L!!!&trrD!V!;c]qr;6Np+8Z!;i;EWU +J%G[Lrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7^rrBk,!!!-!rrD!V!;c]qrql`r5PkB[_#48D +s7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q1T^JFigA#Q4T%i;N`Ps82isJ,90FJGfJYs7$$g +JDU>-!WW-!!=/Pp!!+22rVutK_#4655Q1WR!!!Q-rrD!V!;ZWpJGfKDs8;ot!P/7"rr@T,!!*-# +rVus(r:Bsi+7T70!Iqo`!!#7_rrE&i!!",=rrD!V!;ZWp_#=<6!W)frrqufs"1eI$rr@T,!!*-# +rVus(r:Bsi+7T70!Iqo`!!#7_rrDug!!#7]rrD!V!;ZWpi;N]V"8`#tr;?Tq#J'm(rr@T,!!*-# +rVus(r:Bsi+7T70!Iqo`!!#7_rrDic!!%NHrrD!V!;ZWpnGWCf#Q"H#q#(0m&%V`0rr@T,!!*-# +rVus(r:Bsi+7T70!Iqo`!!#7_rrDic!;lcri;N`PrrDin!!!Q+rrDQe!!"+Os7$$gJDU>-!WW-! +!=/Pp!!+22rVutK_#4655Q:Z_nFQ\\!W2lsi;N`PrrDur!!",;rrD!U!!#6os7$$gJDU>-!WW-! +!=/Pp!!+22rVutK_#4655Q:Z_nFQ\\#Q+N$i;N`Os8DuuJ,90F_#465J%>UKrr@T,!!*-#rVus( +r:Bsi+7T70!Iqo`!!#7_rrD!U!;lcuqu?^=qu6ZSrW)`n!l+d:q>UGFr;aA-nG`K=hZ*ZXs8E!! +#Q42o!?^h1!!.Sbr;Zg^rr2uVrVup!qZ$Qq!.XnG!9!hVq#:Eb!!i?"r;Zfu\Gu'u!.`r,!nG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sb +r;Zg^rr2uVrVup?nc&U)rW)Bd!:]pe!$A`NnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uV +rVup_nc&T>rW)Bd!9!eU!'e!nnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrVuqJnc/Of +mf*:&r;ZhIp\t9`#K6Z3rr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!:g'hrquibrr@TJ +!;?Hm!!%Mfs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`HrrDuq!:Kmc!!!&orr`0! +!$B2[nG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)co!Up?krrDim!;HKo!.XnG!<2os +!!Duq"7Q9j#K?`4rr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;ZZp!!%NHrrDQe!;QQq +n,N^jrrDuq!!!8urr^%:!!1(=nG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)fp"8i-! ++8l-=i;EZNrrTt9!W2lsq#(0m&,6)(JGoPfs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_ +i;N`Qrr_`j!!iH%!5SR6!!2lprVuqJr;Qcdr;Zg>p](0l!.W#gnG`K=hZ*ZXs8E!!#Q42o!?^h1 +!!.Sbr;Zg^rr2uVrW)fp"2Fm:!W;rtJGoNK!Vu`qr;HZr+8l-=i;EWU5PY6Yrqufs5K<`mrr@T, +!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;c]qJGoQHs8;ot"8Vrsq#16n&,cG-_#465J,'$D +r;?Tq+3+?Mrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;c`o!!%NJrrE&s!!!,srrDQf +!!!9%rr@TJ!;HKnq#(0m&'"Y=rr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcrrqufs +5Q:Z_r;?Tq#PnB"i;N]V"8r2t!!!&orrDQe!!!8Ds7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`RrrDuq!!",?rrDim!!!Q*rrBk6!!!&urrE&s!!!,qrrD!U!!!,@s7$$gJDU>-!WW-! +!=/Pp!!+22rVutK_#4655Q:Z_i;N`RrrDid!!",:rr@TA!!!8urrBk+!!%Mqs7$$gJDU>-!WW-! +!=/Pp!!+22rVutK_#4655Q:Z_i;N`RrrDQ\!!#7Zs763j&,6)(_".O++41&Wrr@T,!!*-#rVus( +r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcri:I!LJ,90Frpp*i+8>d8JF`a@#LNM?rr@T,!!*-#rVus( +r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcr_"7X&rrDug!!#7Xrr@T@!!!,Js7$$gJDU>-!WW-!!=/Pp +!!+22rVutK_#4655Q:Z_i;N`RrrBk-!!!&qrrDug!!%NCs7--i!RUl9rr@T,!!*-#rVus(r:Bsi ++7T70!Iqo`!!#7_rrD!V!;lcrJFrmB"8Vrsq""LZs7$*9s7$$gJDU>-!WW-!!=/Pp!!+22rVutK +_#4655Q:Z_i;N`Rrr@TB!!!9"rrDid!!!&orrE&g!!%Mrs7$$gJDU>-!WW-!!=/Pp!!+22rVutK +_#4655Q:Z_i;N`Rs7?9k&,H5*nFQ\\"8Dfqrp]sg5LKN#rr@T,!!*-#rVus(r:Bsi+7T70!Iqo` +!!#7_rrD!V!;lfg!!",:rrDQ\!!!8urrE&g!!"+gs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`SrrE&j!!#7ZrrD!L!!!Q(rrE&g!!!PWs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`SrrE&j!!%NErrD!L!!",8rrDue!!!8Os7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`SrrE&j!;QQoi:I!L5PP0Xr:'ae"4@/-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`S +rrDuj!!!&orrBk-!!%NBrrE&f!!!&Js7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`S +rrDuj!!!,qrrBk-!;6?lrpKj8s7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrE&l +!!!8urrD!N!!!&mrrE&e!!%Mts7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrE&l +!!!Q(rrD!N!!!,ns6fpf5L]Z%rr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;uisrq6d8i:[-N#PA&b!!"+is7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrE&l!!#7X +rrD!N!!!Q%rr@T=!!!PYs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rs7QEmJ+rsC +nFch^+8#R5JFEO=#Li_Brr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;lfj!!!&nrrDQ^ +!!%N@rrBk(!!!,Ms7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rrr@TE!!!8trrDig +!!!&krrBk(!!!&Ks7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rrr@TI!:g'hq"t*l +&+9Gti;EWU"8VrsJGfJss7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`RrrBk5!!!&i +rrDup!!",/rrDQe!!!9"rrBk5!!%Mus7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`R +rrBk5!!!&irrDup!!",/rrDim!!!Q*rrD!U!!#75s7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`RrrD!U!!!,krrE&r!!#7OrrDuq!!",:rrDQe!!#75s7$$gJDU>-!WW-!!=/Pp!!+22 +rVutK_#4655Q:Z_i;N`RrrDQe!!!8ns82isJ+!=:rqufs5Pb[rr@T,!!*-#rVus( +r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcrq#(0m&+KT!JGfK7s8;otJ,0*Er;?Tq+4U>[rr@T,!!*-# +rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcrr;?Tq+7T:1_#=<6!UTgdJGoQDrrE&s!!!PZs7$$g +JDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`RrrE&s!!#7QrrD!V!!!,frr^%:!!2ior;Zg. +eGo%^Hp!.XG:!q60pli.(&!!!&orrDur!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_ +i;N`PrrMTom/I(dJ*[+:^]4?8p\t6mrVup/eGo%-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`!rr^%: +!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW(+@"2Fm:!VcTorr)lt +&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!6Y-!WW-!!=/Pp +!!+22rVutK_#4655Q:Z_i;N`!rr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sb +r;Zg^rr2uVrW(+@"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V +!;ZWqn-A=[!<@W8rr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uV +rW)corr<%Kmf*@X!!hii"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_ +rrD!V!;c]tqu?^=mf*@(!!2Ec"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo` +!!#7_rrD!V!;c]tn,NFnmf37d!.XA8"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70 +!Iqo`!!#7_rrD!V!;c]t^]4?8n,ECcrVup?m/I1'!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp +!!+22rVutK_#4655Q:Z_i;N`Qrr@TK!:Tpfq#16n&+';u^]4?8p\t6mrVup/eGo%nG`L(rVup!m/I1'!!!&o +rrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`RrrDim!!!Q+rrMU2q>UGF +r;c3a"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcrnGN=e +#Q"H$^^']8qu?_HmJd:(!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_ +i;N`RrrD!U!!!,trrE*#qYpQpqu?^]mJd:(!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22 +rVutK_#4655Q:Z_i;N`RrrBk+!;c]qr;6Np+79(1^]4?8p\t6mrVup/eGo%- +!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rrr@T@!!#7\rrDil!!!Psrr^%:!!2io!<2rt!"[TZ +nG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)iq!.aY@!$D+-0!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrE&h!!!,u +rrD!L!!!,orr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)lr +!<2Nh!!2us!9!JL!!2cm"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_ +rrD!V!;uisrp^!crrD!K!;6?o^]4?8p\t6mrVup/eGo%-!WW-!!=/Pp!!+22 +rVutK_#4655Q:Z_i;N`SrrDue!!#7]rrBk+!!#7Wrr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!! +#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)lr!;u?e!$D.=!5S1+!$Cq7"2Fm:!VcTorr)lt&(LXKrr@T, +!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;uisr:'ae&,cG-_".O+&,-#*^]4?8p\t6mrVup/ +eGo%-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrDue!!!-!rrBk+!!!,p +rr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)lr!;u?e!!3#t +!5S1+!!2fn"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;uis +r9s^arrBk*!;?Ep^]4?8p\t6mrVup/eGo%p\t?2!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`SrrDud!!#7^rrBk*!!#7Xrr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1 +!!.Sbr;Zg^rr2uVrW)lr!<2Hf!$D1>!9!DJ!$Ct8"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus( +r:Bsi+7T70!Iqo`!!#7_rrD!V!;uisrpTmf&,lM.i:6jJ&,6)+^]4?8p\t6mrVup/eGo%-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrE&f!!!-"rrD!J!!!,qrr^%:!!2io +!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)iqn,NFhrVllenc/Xlp\t?2 +!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rs6fsdrrDQZ!!!&o +rr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)iq!.aP=!.Y"J +!;Q*b!!2io"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcr +JFEO=5Q:Z_q!e@Yrr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uV +rW)iq!5S((!$D4?!;u?ep\t?2!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`RrrBk(!!!Q/rrDue!;HKq^]4?8p\t6mrVup/eGo%^Bn!!3&u!.aV?p\t?2 +!!!&orrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`RrrDuq!!",:rr@TJ +!<)ot_#=<6!W)frJGoQCrr^%:!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^ +rr2uVrW)iq!<2os!'g;Z!5SO5!.Y"J!9!hV!!E)t!5SR6p\t?2!!!&orrE&t!!!PZs7$$gJDU>- +!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Qs8;otJ,0*Ei;EWU5Q:Z_nGWCf#Q"H#i;N`Nrr^%: +!!2io!<2rt!"[TZnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)fp!.b%Kq#:?`r;Zg> +rr2unrVup/qYpQRrW)]m"2Fm:!VcTorr)lt&(LXKrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_ +rrD!V!;c]t^]4?8q#:?hr;Zg.rr2urrVup?qYpQRrW)]m"2Fm:!VcTorr)lt&(LXKrr@T,!!*-# +rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;c]tn,NFnq#:?lr;Zg&rVuis!.XkF!9!hVp\t?2!!!&o +rrE&t!!!PZs7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Qrr`0!!$D"9!<2os!!E3" +!l+d:q>UHQrW)]m"2Fm:!VcTor;HZr#LreCrr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V +!;ZZp!!%NCs8;ot!WE$"n,N^hrrD!V!;HKq^]4?8p\t6grVup#eGo%UKb#PS/tJGfKGrrE+Lq>UHQrW)]m"2Fm:!VcTonGWCf!S%/=rr@T, +!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!:9^c_#465J+N[?i;N`Nrr^%:!!2io!9!eUeGo%< +!.`r,!-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Bs8;ot +!V?-!WW-!!=/Pp!!+22rVutK +_#4655Q:Z_i;N`Ps8N'!J+imB_#46:J,fQ- +!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Qrr`0!!$Cq7!9!eU"[E%e^]4E2rrD!V!;HKq^]4?8 +q#:?hqu?^!ec5.=!.`r,!rr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;c`o!!%NCrrE&s!!39&nGWCf#Q"H# +i;N`Nrr^%:!!2lp!:]md!!1XMnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)iq!<2os +!'g2Wr;Zm"s5-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`RrrDQe!!!8trrD!U!!#7]!!%NG +rrD!V!;HKq^]4?8q#:?PqZ,1HnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)iq!9!eU +!!Drp!:]pe!$;%-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rrr@TE!!!,urrE&m!!!Q,rrD!V!;HKq^]4?8 +q#:?PqZ,1HnG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)iq!.ahE!!2rrpAb1(qu6ZS +rW)]m"2Fm:!VlZpi;3N)s7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rs7QHhrr@TE +!!!9$rrD!V!;HKq^]4?8q#:?`qu?]tec5.=!.`r,!-!WW-!!=/Pp!!+22rVutK +_#4655Q:Z_i;N`SrrE&l!!#7\rrD!P!!!,urrD!V!;HKq^]4?8q#:?`qu?]tec5.=!.`r,!rr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;uisrq6-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_ +i;N`SrrDuj!!!,urrE&n!!!&srrD!V!;HKq^]4?8q#:?lqu?^%ec5.=!.`r,!- +!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrDui!;c]qJGB0F!W2lsi;N`Nrr^%:!!2lp!<2lr +!"[W[nG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uVrW)lr!;uKi!.XnG!5SC1!!2us!9!hV +p\t?2!!!&prrE&r!!!P[s7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrDui!!#7\ +rrD!Q!!!&srrD!V!;HKq^]4?8p](-k!$BbknG`K=hZ*ZXs8E!!#Q42o!?^h1!!.Sbr;Zg^rr2uV +rW)lr!;uKi!$D+-!WW-!!=/Pp!!+22 +rVutK_#4655Q:Z_i;N`SrrDui!!!Q,rrDii!!!&srrD!V!;HKq^]4?8p\t6/r;ZhIec5.=!.`r, +!-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrDui!!!,urrE&o!!!&srrD!V +!;HKq^]4?8p\t6_rVup!eGo%-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_ +i;N`SrrE&j!;c]qJGK6G"8i)ui;N`Nrr^%:!!2io!;ufr!!h$RnG`K=hZ*ZXs8E!!#Q42o!?^h1 +!!.Sbr;Zg^rr2uVrW)lr!<2Tj!.XnG!5SF2!!E,u!9!hVp\t?2!!!&orrE&t!!!PZs7$$gJDU>- +!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`SrrE&j!!#7\rrD!R!!!,urrD!V!;HKq^]4?8pAY5F +!!#75s7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#4655Q:Z_i;N`Rs7?9k+8c'rr@T,!!*-#rVus(r:Bsi+7T70!Iqo`!!#7_rrD!V!;lcr +JFrmB#Q+N$r;$Bn&,ZA,i;N`Nrr^%:!!2cm!J!D`s7$$gJDU>-!WW-!!=/Pp!!+22rVutK_#465 +5Q:Z_i;N`Rrr@TB!!!,urrE&p!!!Q,rrD!V!;HKq^]4?8`W,H-!.`r,!rr2unr;Zg.q>UH1rVup!qYpQRrW)]m"2Fm:!QG*.rr@T,!!+2"r;Zj_i:R'N+7T70!Iqo` +!!#7_rrD!V!;lcrrqufs5Q:Z_r;?Tq#PnB"i;N]V"8`#ti;N`Nrr^%:!!1(=nG`K=hZ*[A_#466 ++7Sq'!?^h1!!.Sbr;Zg^rr2uVrW)fpr;ZhIrr2utr;Zg"q>UHarVup'qYpQRrW)]m"2Fm:!QG*. +rr@T,!!,<7r;Zj/nFZb^+7T70!Iqo`!!#7_rrD!V!;c]qJGoQHs8;ot!Vu`qq#16n&,Q;+i;N`N +rr^%:!!1(=nG`K=hZ*Y+qu?a&q"4Uf+7T70!Iqo`!!#7_rrD!V!;c]t^]4?8r;QbIr;cZn!;ufr +!$D(;!9!hVp\t?2!!!&=s7$$gJDU>,J,B9I#Pdrl!?^h1!!.Sbr;Zg^rr2uVrW)fp"7Q9j#Q4T% +_#465J,0-D!!%NFrrD!V!;HKq^]4?8`W,H-!.`r,!<2lr!<`8m!!+22rVutK_#4655Q:Z_i;N`Q +rr`0!!$D.=!9!eU!'g;Z!l+d:q>UHQrW)]m"2Fm:!QG*.rr@T,!!*#r!!*3"o`,"7nGWCgJ&)!_ +!'gJ_!9!hVq>^Hp!.XqH!:]pe!$D%:!q60pq>UHQrW)]m"2Fm:!QG*.rr@T,!!)rp!!*,uo`,"7 +nGWCgJ&)!_!'gJ_!9!hVq>UKb#Q+N$q#(0m&,?/*!.XhE!9!hVp\t?2!!!&=s7$$gJDU>,r;6Nq +!W;Tj!?^h1!!.Sbr;Zg^rr2uVrW)Kg!;ucq!!hrl!9!hVp\t?2!!!&=s7$$gJD^D.!VlNl!<2Wk +!?^h1!!.Sbr;Zg^rr2uVrW)Kg!<2os!!DZh!9!hVp\t?2!!!&=s7$$gJD^D.!VlNl!<2Wk!?^h1 +!!.Sbr;Zg^rr2uVrW)Hfr;Zfumf*:FrW)]m"2Fm:!QG*.rr@T-!!*,qqZ$Wqo`,"7nGWCgJ&)!_ +!'gJ_!9!hVnG`K=r;c9c!9!hVp\t?2!!!&=s7$$gJD^D.!VlNl!<2Wk!?^h1!!.Sbr;Zg^rr2uV +rW)Hf!5SO5!.XJ;!9!hVp\t?2!!!&=s7$$gJD^D.!V#sd!.OS@!?^h1!!.Sbr;Zg^rr2uVrW)Hf +!9!eU!'frP!9!hVp\t?2!!!&=s7$$gJD^D."7Z0f!.OS@!?^h1!!.Sbr;Zg^rr2uVrW)Hf!:]pe +!$C\0!9!hVp\t?2!!!&=s7$$gJD^D."7Z0f!.XYA!?^h1!!.Sbr;Zg^rr2uVrW)co!Up?jrrDim +!!!Q*rrE+Lq>UHQrW)]m"2Fm:!QG*.rr@T-!!*2kqZ$VGo`,"7nGWCgJ&)!_!'gJ_!9!hVq>^Hp +!.XnG!;ucq!!iB#!q60pq>UHQrW)]m"2Fm:!QG*.rr@T-!!*2kqZ$VGo`,"7nGWCgJ&)!_!'gJ_ +!9!hVqYpZq!!",,r;6Nq!W;Tj!?^h1!!.Sbr;Zg^rr2uVrW)iq!9!eU!!E)tnc/YSqu6ZSrW)]m"2Fm: +!QG*.rr@T,!!)rp!!*,uo`,"7nGWCgJ&)!_!'gJ_!9!hVqu6Z3q#CC*rr2tKo)Jb4qu6ZSrW)]m +"2Fm:!QG*.rr@T,!!*#r!!*3"o`,"7nGWCgJ&)!_!'gJ_!9!hVqu6Z3q#CBsrr2u6o)Jb4qu6ZS +rW)]m"2Fm:!QG*.rr@T,!!%KG!!*2so`,"7nGWCgJ&)!_!'gJ_!9!hVqu6YHp]1,J,B9I#Pdrl!?^h1!!.Sbr;Zg^rr2uVrW)iq!.ahE"+U@NnFHV[ +&,ZA,i;N`Nrr^%:!!1(=nG`K=hZ*X@qu?a&nFZb^+7T70!Iqo`!!#7_rrD!V!;lfj!!>Ics7l0c +!!iE$!9!hVp\t?2!!!&=s7$$gJDU>-5Ci\4!>"\m!!,=RrVutK_#4655Q:Z_i;N`Rs7ZKq+92B= +o)Jaqqu6ZSrW)]m"2Fm:!QG*.rr@T,!!+1Wr;Zj?i:R'NJ+3F;!Iqo`!!#7_rrD!V!;uisrq?Bp +&-)\/o)Jamqu6ZSrW)]m"2Fm:!QG*.rr@T,!!+2"r;Zj__"@[.s7$!f!Iqo`!!#7_rrD!V!;uis +rq?Bm#QFbp!!!,urrD!V!;HKq^]4?8`W,H-!.`r,!>"\u!!.Sbp&G-ps7$!f!Iqo`!!#7_rrD!V +!;uisrq?Bm"9/<#JFigA"8i)ui;N`Nrr^%:!!1(=nG`K=hZ*Z^q#(0ns+'eC!X&JlrVutK_#465 +5Q:Z_i;N`SrrE&m!!!'!rrBk,!!!,urrD!V!;HKq^]4?8`W,H-!.`r,!<`9!!!*-#o`,$us5d`Z +^]4?Vr:L$j5QCZ^!Is&+!!#7_rrD!V!;uisr:U*m+92B=oDejlqu6ZSrW)]m"2Fm:!QG*.rr@T+ +!!RlA!!%NDo`,#BrquftJ)L8*!'gJ_!9!hVr;Qcpp&G1*s8W)j!!!&srrD!V!;HKq^]4?8`W,H- +!.`o+"X!XB!WV*N!!3,tr;ZkJ_#4655Q:Z_i;N`SrrDuj!!!9's7?9k!W2lsi;N`Nrr^%:!!1(= +nG`K=h>d]is1f`V_"Ia0!WVrn!!.Sbr;Zg^rr2uVrW)lr!;uNj!!E6#!.a_B!!2us!9!hVp\t6/ +rW'q;nG`K=h>dN\rVlkJp&G-rs7#se!Iqo`!!#7_rrD!V!;uisr:U*j!WN*!_"@[-!W2lsi;N`N +rrBk6!!%Mgs7$$gJDL8+!WN*!rq-6m#QN`\!!3,8r;Zg^rr2uVrW)lr!;uKirr2ufo`+smqu6ZS +rW)]m!5SR6!'eL'nG`K=h#RHS!;uKi!Y>=Hr;ZluJGfHJ5Q:Z_i;N`SrrE&k!!@`Ns8;Ni!!E,u +!9!hVp\t6/rVup?`rGQ.!.`l*"$chci:R'O+9-lj!!33$JGfHJ5Q:Z_i;N`SrrE&k!!#7YrrD!T +!!!,urrD!V!;HKn_#=<6&'"Y=rr@T*!!p!C-V_!!33$q"t*l5Q:Z_i;N`RrrD!U!!p!It+I!!39&q"t*l5Q:Z_i;N`RrrDQe!!Er;c]o!9!hV!.XbC +r;Zfua8bZ/!.`Aq!Wi>rr;Zm0s1nO4!'gJ_!9!hVqu6Zor;ZpAs8W)s!!!,rrrBk6!!!&rrrD!V +!!#7Xrr@TJ!6>-/rr@Sq!!39&nGN=g+9-lh!!#7_rrD!V!;lcrrqufs5Q:]]!!!&prrD!V!!!,t +rrD!V!!",8rrBk5!!%Mis7$$gJBn2s#QN`\!!,=aqZ$U\rr2uVrW)fpr;ZhIrr2tKr;cWm!:]sf +!!iB#!9!hV!"\i(!9!eU!'eR)nG`K=cN""Ws1nR5!It+G!!#7_rrD!V!;c]qJGoQIrrBk5!!%NE +rrDin!!!Q+rrD!V!!!8urrDQe!!"+^s7$$gJBn2s+9-li!!3,tqZ$U\rr2uVrW)fp"2Fm:!WE#u +i;EWU5PbrrDim!!!Q)rrTt9!Vu`qi;EZMrrE&s!!!,Bs7$$gJBn2rs8;fq!XJb`qZ$U\rr2uV +rW)corr<%KrVllqr;Zg&q#:Eb!!i?"!:]pe!.XbCr;ZfuaT(c0!.`Dr!Wi>rr;Zm0s1nL3!'gJ_ +!9!hVq>UKb#Q4T%rqufs"8Dfr!.XhE!:]pe!'g5X!.b"JaT(c0!.`Dr!X&Jlr;Zm@s+'tH!'gJ_ +!9!hVnc/Of!!2Ke!;QKm!$Ct8!5SO5!.W,jnG`K=ci=+Ps5^L[rr2uVrW)Kg!5SO5!.XG:!;ucq!!i8u +!:]pe!$B>_nG`K=ci=+hs+(%J!WW)o!!#7_rrD!V!:g'hi;EWU5OSOOrqufs"8Dfqq#(0m&'=k@ +rr@Sr!!,=ar;Zm"s7lEj!'gJ_!9!hVnc&UYr;Zg>mJm+b!!2io!;ucq!!gXGnG`K=ci=)rrqufu +"97le!!#7_rrD!V!:g'hq#(0m&+0AsJGfKBrrE&s!!!,Cs7$$gJC"8ss8;fq!XJb`q>^L[rr2uV +rW)Kg!;ucq!!hok!5SO5!.XbCr;ZfuaoCl1!.`Gs!Wi>rr;Zm0s1nI2!'gJ_!9!hVq>UKb#Q+N$ +rqufs"8Mls!.XeD!9!eU!'g5X!.b"JaoCl1!.`Gs!X&Jlr;Zm@s+'qG!'gJ_!9!hVq>^Hp!.XnG +r;Zfuq>UNc!!i=Hr;ZkJrqQNo5Q:Z_i;N`Qrr_`j +!!iE$!5SO5!.XkFrVuqJq>UHmr;Zg&p\t6_r;Zg>b5^u2!.`Gs![%Gmr;Zlur:pUHm +q>^L[qYpQbqZ$U\c2[;5!.`Jt![%Gmr;Zlur:g6l5Q:Z_i;N`RrrBk5!!!&srrD!U!!#7^rrDup +!!",:rrE&p!!!Q+rrDik!!!PSs7$$gJC4Du5QCZ^!Wi>rp](:Yrr2uVrW)iq!5SO5!!2us!:]pe +!$D1>!;u`p!$D"9q>^KtqYpQnqZ$Tuc2[;5!.`Jt!It+I!!39&nFut`5Q:Z_i;N`Rrr@TI!;lcr +q#(0m&,lM.q"t*l&,?/)JGT^9kc2[;5!.`Mu!Wi>rr;Zm0s1nC0!'gJ_!9!hVqu?Nn +!.XqH!<2os!!E3"!:]md!!i[!5SI3!'ed/nG`K=df9FSs5rr2uVqu?^!p]('i!!E)t!;u]o +!!COHnG`K=df9Durqufu"97lb!!#7_rrD!V!;uisr;-Ho+8c'^!!#7_rrD!V!;uisr;-Ho+8c'g?k!9!_ScN!D6!.`Q!!XJb@r;ZkJrq6pnG`K=e,TO\s+(%J!WW)k!!#7_rrD!V!;uis +r;-Ho+8Z!;i;EWX5QCc!qu?]tp\t6mq>^MFqYpQjqZ$VGciIcs1nO4!!2fnq>^MFqYpQnqZ$VGciCs1nO4!!2fn!.aqH!.XkF!;u]o!.W>pnG`K=e,TN!r;?Ts +#QN`U!!#7_rrD!V!;uisrqcZq5PkB[r;?Tt+92B!qu?^!pAY-.qZ$U\qYpQjqZ$U\ci[!;QEk!'eg0 +nG`K=eGoXOs7#se![%Gmp&G(Wrr2uVrW)lr!<2iq!'g;Zr;Zp1s8V$T!!!,prrDQc!!#7[rrDik +!!#70s7$$gJCOW$"97=Ho`+tVrr2uVrW)iq +!5SO5!!2lp!<2rt!tYG3r;6Np+85^7r;-HoJ,90Fr;-HoJ'\/arr@T#!!33$nGN=g+9-la!!#7_ +rrD!V!;lcri;EWU"8Mlrrr)m"&-)\/qu?^]pAY-jqZ$VGqYpQnqZ$VGcipnG`K= +ec5a^s+(%J!WW)i!!#7_rrD!V!;lcrr;?Tq+8Gj9rr)lt&,uS/_#=<6!VQHmrqc]krrE&q!7(W6 +rr@T#!!+2Ar;Zm"s7l3d!'gJ_!9!hVqu6Zqr;Zg^q#:?nrVup/rr2uVrVup#p&>$kqZ-Hl!<2iq +cN!D6!.`W#!C-S^!!39&nFQ\\5Q:Z_i;N`Qs8;otJ,'$Drr)lt&,uS/nGWCf#PA&o!!!&ps82is +!RC`7rr@T#!!.TIr;Zm(s5Er;Zg"cN!D6!.`Z$!Wi>jr;Zm@s+'_A!'gJ_!9!hV!.XnG"7Q9j#P\5urr)lt&,lP-!!%N@ +rr@TJ!!!,rrr@TJ!!!,Hs7$$gJCac&"97!'gJ_!9!hV!$D(;rr<%Kp\t6m +rVup/rVlrg!!i,q!9!eU!"\l)!9!eU!"[BTnG`K=f)Pj_s+(%J!WW)h!!#7_rrD!V!!!Q+rrMTo +pAY-lrVup/r;QctJ+N[?nGN=e+8Gj9nGN=e+3soUrr@T$!!+2Ar;Zm"s7#U[!'gJ_!9!hV!!hok +!<2rt!"\Gr!;QKm!'g8Y!;QKm!'ed/nG`K=f)Ph9rqufu"97<]r;Zluq!nCb5Q:Z_q#(0m&+9Gtrr)lt +&*s5srVurkrrW0"!6kK4rr@T%!!+2Ar;Zm"s7#RZ!'gJ_!;ucq!!hrl!<2rt!"\Ap!T4L\rrM$g +bl@24!.`]%!C-S^!!39&i:6jJ5Q:Z_rqufs"7H0hrr)lt&#B6prr@T%!!.TIr;Zm(s1n1*!'gG^ +r;Zfumf*:drVup/V#Tra!.`]%!WVrn!!3]2JFW[?5Q1T^JGfK9rrE&t!!!P*s7$$gJCso(!WVZf +!!+2AnGiPRrVll5r;ZhIn,ECerVup/V#Tra!.``&!X&J\r;Zj_rp]sg5Q1T^i;EWU5O\UPrr)lt +&#B6prr@T&!!3E*_#466J,Jg:!'gG^!:]pe!$C\0!<2rt!"Yn*nG`K=f`2'as+(%J!WVrb!!#7^ +rrDim!!!PurrE&t!!!P*s7$$gJCso'+929>!Wi>jnGiPRrVllqr;Zg&n,ECerVup/V#Tra!.``& +!C-S^!!39&i:-dI5Q1T^rqufs"7Q6irr)lt&#B6prr@T&!!.TIr;Zm(s1n.)!'gD]r;Zfun,ECe +rVup/V#Tra!.``&!WVrn!!3]2JFNU>5Q(N]JGfK:rrE&t!!!P*s7$$gJD'u)!WVZf!!+2An,NGQ +r;Qc4r;ZhInG`LfrVup/V#Tra!.`c'!X&J\r;Zj_rpTmf5Q(N]i;EWU5Oe[Qrr)lt&#B6prr@T' +!!3E*_#466J,Jd9!'gD]!:]pe!$C_1!<2rt!"Yn*nG`K=g&M0bs+(%J!WVra!!#7]rrDim!!!Q! +rrE&t!!!P*s7$$gJD'u(+929>!Wi>jn,NGQr;Qcpr;Zg&nG`LfrVup/V#Tra!.`c'!C-S^!!39& +i:$^H5Q(N]rqufs"7ZPqu6Z3r;ZhI +nc&UgrVup/V#Tra!.`f(!X&J\r;Zj_rpKge5PtH\i;EWU5OnaRrr)lt&#B6prr@T(!!3E*_#466 +J,Ja8!'gA\!:]pe!$Cb2!<2rt!"Yn*nG`K=gAh9cs+(%J!WVr`!!#7\rrDim!!!Q"rrE&t!!!P* +s7$$gJD1&)+929>!Wi>jmf3>Pqu6Zor;Zg&nc&UgrVup/V#Tra!.`f(!C-S^!!39&i9pXG5PtH\ +rqufs"7cBkrr)lt&#B6prr@T(!!.TIr;Zm(s1n('!'g>[r;Zfunc&UgrVup/V#Tra!.`f(!WVrn +!!3]2JF,+8u3>nGN=f+91a/!'g>[!5SO5!.XS>!<2rt +!"Yn*nG`K=hZ*X@rVllUr;Zj_rpBad5PkB[i;EWU5P"gSrr)lt&#B6prr@T,!!%NIrrBk5!!.TI +mJm5OqYpQbr;Zg>o)A^hrVup/V#Tra!.`r,r;QbIr;Zluq!J+^5PkB[q#(0m&+]`#rr)lt&#B6p +rr@T-!!!&ts8;p!!WVZW!!#7[rrDuq!!!8prrE&t!!!P*s7$$gJD^D-!WE#urqufu"97^Bn!!2Zj!<2rt!"Yn*nG`K=huEcY +nG*%c&-%1J!!#7Zrr@TJ!:p-irr)lt&#B6prr@T-!!*,iq#CF;s6Tdd5Pb^Qts7#CU!'g;Z!;ucq!!i,q!<2rt!"Yn*nG`K=huEcYnG3+d"97^O^O\rp0Ub5PY6Yi;EWU5P4sUrpToms7$$gJD^D.!V#pc!It%6!!#7YrrDQe!!",5rrE&f!!#6h +s7$$gJD^D.!V#pc!WVr]!!#7YrrDim!!!Q%rrE&f!!"+Hs7$$gJD^D.!V#sd!Wi>jli7#Mq#:?l +r;Zg&o`"pjn,NG!ZN'Fo!.`u-!$VrpKgeJ$]1Err@T-!!*,iqZ$X]r9F=_5PP0XnGN=e+8,X6rpKge5I:CZrr@T-!!*,iqZ$X] +q!.n[5PP0Xq#(0m&,#r&rpKge+1)":rr@T-!!*,iqZ$X]nEU&S5PP0Xr;?Tq#PJ)srpKge&$u<* +rr@T-!!*,iqZ$X]i9L@C5PP0Xrqufs"82ZorpKge#IFI"rr@T-!!*,iqZ$X]_!:t#5PG-U!!!&m +rrE&e!!!,-s7$$gJD^D.!V#sd!C),#!!#7Wrr@TJ!;6?lrpKge!OMgqrr@T-!!*2kqZ$U\l2UfK +pAY-.r;ZhIpAY-lmJsTnnG`K=huEc[nG<1c53`+J5PG*Wi;EWU5PG*WrpBadJ$f7Frr@T-!!*2k +qZ$U[l2UfKpAY-^r;Zg>p&FF[!'djjnG`K=huEc[nG<1c53`+J5PG*Wq#(0m&,#tj!!"+Js7$$g +JD^D."7Z0f!']ZJ!'g2W!;ucq!!i2s!.aM$V +JGfK@rrD!G!!!&,s7$$gJD^D."7Z0f!']ZJ!'g/V!5SO5!.X_B!:]CV[/]Xq!.`u-!<_ig!!#4J +!!#7VrrD!U!!#7WrrDi^!!%MVs7$$gJD^D."7Z0f!']ZJ!'g/V!:]pe!$Cq7!;u6b!'dmknG`K= +huEc[nG<1c53`+J5P>$Vq#(0m&,#tj!!"+Ks7$$gJD^D."7Z0f!']ZJ!'g/V!;ucq!!i2s!5S%' +!"ZL;nG`K=huEc[nG<1c53`+J5P>$Vrqufs"6][ar;?Tq#IXU$rr@T-!!*2kqZ$U[l2UfKo`+ji +!!29_!<2os!!BY/nG`K=huEc[nG<1c53`+J5P4sUJGfK1s8;ot!O_ssrr@T-!!*2kqZ$U[l2UfK +o`"p,r;ZhIkPkO4r;a8*nG`K=huEc[nG<1c53`+J5P4sUi;EWU5Ni%H_#465J%#CHrr@T-!!*2k +qZ$U[l2UfKo`"p\r;Zg>kPkP?r;Zg^[f>js!.`u-!<_ig!!#4J!!#7UrrDim!!!PmrrDQe!!"+L +s7$$gJD^D."7Z0f!']ZJ!'g,U!;ucq!!h]e!;QKm!"ZOkPkP?r;Zg^\,Yst +!.`u-!,"8i,_!!#7SrrD!U!!#7HrrBk5!!%MYs7$$gJA;-b5P"gSnGN=e ++6WY(i;EWU5Iga_rr@Sb!!#7SrrDim!!!PmrrDQe!!"+Ns7$$gJA;-b5P"gSr;?Tq#Nu*eq#(0m +&%MZ/rr@Sb!!#7SrrE&s!!!,arrDuq!!!86s7$$gJA;-b5OndP!!!&_rrE&s!!!,2s7$$gJA;-b +5OnaRJGfK1s8;ot!P&1!rr@Sb!!#7RrrBk5!!%N3rr@TJ!4`'urr@Sb!!#7RrrD!U!!#7HrrBk5 +!!%MZs7$$gJA;-b5OnaRnGN=e+6WY(i;EWU5Ipg`rr@Sb!!#7RrrDim!!!PmrrDQe!!"+Os7$$g +JA;-b5OnaRr;?Tq#Nu*eq#(0m&%V`0rr@Sb!!#7RrrE&s!!!,arrDuq!!!87s7$$gJA;-b5Oe^O +!!!&_rrE&s!!!,3s7$$gJA;-b5Oe[QJGfK1s8;ot!P/7"rr@Sb!!#7QrrBk5!!%N3rr@TJ!4i.! +rr@Sb!!#7QrrD!U!!#7HrrBk5!!%M[s7$$gJA;-b5Oe[QnGN=e+6WY(i;EWU5J$marr@Sb!!#7Q +rrDim!!!PmrrDQe!!"+Ps7$$gJA;-b5Oe[Qr;?Tq#Nu*eq#(0m&%_f1rr@Sb!!#7QrrE&s!!!,a +rrDuq!!!88s7$$gJA;-b5O\XN!!!&_rrE&s!!!,4s7$$gJA;-b5O\UPJGfK1s8;ot!P8=#rr@Sb +!!#7PrrBk5!!%N3rr@TJ!4r4"rr@Sb!!#7PrrD!U!!#7HrrBk5!!%M\s7$$gJA;-b5O\UPnGN=e ++6WY(i;EWU5J-sbrr@Sb!!#7PrrDim!!!PmrrDQe!!"+Qs7$$gJA;-b5O\UPr;?Tq#Nu*eq#(0m +&%hl2rr@Sb!!#7PrrE&s!!!,arrDuq!!!89s7$$gJA;-b5OSRM!!!&_rrE&s!!!,5s7$$gJA;-b +5OSOOJGfK1s8;ot!PAC$rr@Sb!!#7OrrBk5!!%N3rr@TJ!5&:#rr@Sb!!#7OrrD!U!!#7HrrBk5 +!!%M]s7$$gJA;-b5OSOOnGN=e+6WY(i;EWU5J7$crr@Sb!!#7OrrDim!!!PmrrDQe!!"+Rs7$$g +JA;-b5OSOOr;?Tq#Nu*eq#(0m&%qr3rr@Sb!!#7OrrE&s!!!,arrDuq!!!8:s7$$gJA;-b5OJLL +!!!&_rrE&s!!!,6s7$$gJA;-b5OJINJGfK1s8;ot!PJI%rr@Sb!!#7NrrBk5!!%N3rr@TJ!5/@$ +rr@Sb!!#7NrrD!U!!#7HrrBk5!!%M^s7$$gJA;-b5OJINnGN=e+6WY(i;EWU5J@*drr@Sb!!#7N +rrDim!!!PmrrDQe!!"+Ss7$$gJA;-b5OJINr;?Tq#Nu*eq#(0m&&rr@Sb!!#7NrrE&s!!!,a +rrDuq!!!8;s7$$gJA;-b5OAFK!!!&_rrE&s!!!,7s7$$gJA;-b5OACMJGfK1s8;ot!PSO&rr@Sb +!!#7MrrBk5!!%N3rr@TJ!58F%rr@Sb!!#7MrrD!U!!#7HrrBk5!!%M_s7$$gJA;-b5OACMnFln_ +#OVNki;EWU5JI0err@Sb!!#7MrrDig!!!8krrDQe!!*o=^]3g'!._ib!'fiM!;uQk!!hok!;QEk +!'e:!nG`K=^]4@!m/I(bpAb0umJd1aqZ$U,_#Np(!._ib!'ffLpAb0umJd1cqZ$Tu_#Np(!._ib +!'ffL!.ahE!!hljq>e>2nG`K=^]4@!li-t#p](:!m/I'9qZ$VG_>j$)!._ib!'ffL!9!VP!!hlj +!5SI3!'e="nG`K=^]4@!li-tSp](:!m/I(DqZ$U<_>j$)!._ib!'ffL!;Qj$)!._ib!'ffL!<2`n!!hlj!;u]o!!C(;nG`K=^]4@! +lMpVZ!!hlj!<2iq!!0q9nG`K=^]4@!lMgj7q#CC"li6e]_>j$)!._ib!'fcK!5SC1!!hii!.aqH +_>j$)!._ib!'fcK!9!YQ!!hii!5SI3!.VlcnG`K=^]4@!lMgkRq#CC"li-tCqZ$VG_Z0-*!._ib +!'fcK!;Q?i!!hii!:]jc!'e@#nG`K=^]4@!lMgk^q#CC"li-t[qZ$U\_Z0-*!._ib!'fcK!<2co +!!hii!;u]o!$B)XnG`K=^]4@!l2UPZ!!hii!<2iq!$B)XnG`K=^]4@!l2La6q>^L#lMp_]!$B)X +nG`K=^]4@!l2Lb!q>^L#lMp_]!$B)XnG`K=^]4@!l2LbAq>^L#li-taqZ$U,_Z0-*!._ib!'f`J +!:]gb!!hii!<2iq!"ZsHnG`K=^]4@!l2LbYq>^L#li-taqZ$U,_Z0-*!._ib!'f`J!;uZn!!hii +!<2iq!"ZsHnG`K=^]4@!l2Lb_q>^L#li-taqZ$U,_Z0-*!._ib!'f]Iq>^L#li-taqZ$U,_Z0-* +!._ib!'f]I!.aqH!!hii!<2iq!"ZsHnG`K=^]4@!kl1XuqZ$U$li-taqZ$U,_Z0-*!._ib!'f]I +!9!_S!!hii!<2iq!"ZsHnG`K=^]4@!kl1YPqZ$U$lMp_]!$B)XnG`K=^]4@!kl1YXqZ$U$lMp_] +!$B)XnG`K=^]4@!kl1Y\qZ$U$lMp_]!$B)XnG`K=^]4@!kl1Y^qZ$U$lMp_]!$B)XnG`K=^]4@! +kl1Y^qZ$U$lMgj7qu?^]_Z0-*!._ib!'f]I!<2iq!!hfh!.atI!'e@#nG`K=^]4@!kl1Y^qZ$U$ +lMgk"qu?_H_Z0-*!._ib!'f]I!<2iq!!hfh!5SL4!.VlcnG`K=^]4@!kl1Y^qZ$U$lMgkBquFS5 +nG`K=^]4@!kl1Y^qZ$U$lMgkBquFS5nG`K=^]4@!kl1Y^qZ$U$lMgkRr;Zfu_>j$)!._ib!'f]I +!<2iq!!hfh!;QKm!!C(;nG`K=^]4@!kl1Y^qZ$U$lMgk^r;Zg&_>j$)!._ib!'f]I!<2iq!!hfh +!<2os!"ZpGnG`K=^]4@!kl1Y^qZ$U$l2U\^!$B&WnG`K=^]4@!kl1Y^qZ$U$l2La6rVup__>j$) +!._ib!'f]I!<2iq!!hcg!5SR6!.VibnG`K=^]4@!kl1Y^qZ$U$l2LbArW'b6nG`K=^]4@!kl1Y^ +qZ$U$l2Lk\!!!,:s7$$gJA;-b5Nr+IrqcZq#O26jrVup/_#Np(!._ib!'f]I!<2iq!!h`f!e:88 +_#Np(!._ib!'f]I!<2iq!!h`f!Vcc3s7$$gJA;-b5D/ues0)HRs0)HRs0)HRs0)HRs0)HRs0)HR +s0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HR +s0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HR +s0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HR +s0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HR +s0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HRs0)HQ~> +%%EndData +showpage +%%Trailer +end +%%EOF Index: tags/1.0.5/doc/gcode_control_img.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/gcode_control_img.pdf =================================================================== --- tags/1.0.5/doc/gcode_control_img.pdf (nonexistent) +++ tags/1.0.5/doc/gcode_control_img.pdf (revision 953) Property changes on: tags/1.0.5/doc/gcode_control_img.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/gcode_control_img.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/gcode_control_img.png =================================================================== --- tags/1.0.5/doc/gcode_control_img.png (nonexistent) +++ tags/1.0.5/doc/gcode_control_img.png (revision 953) Property changes on: tags/1.0.5/doc/gcode_control_img.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/gcode_tool_path.eps =================================================================== --- tags/1.0.5/doc/gcode_tool_path.eps (nonexistent) +++ tags/1.0.5/doc/gcode_tool_path.eps (revision 953) @@ -0,0 +1,415 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: cairo 1.8.10 (http://cairographics.org) +%%CreationDate: Mon May 30 02:27:10 2011 +%%Pages: 1 +%%BoundingBox: 0 0 403 230 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%EndComments +%%BeginProlog +/cairo_eps_state save def +/dict_count countdictstack def +/op_count count 1 sub def +userdict begin +/q { gsave } bind def +/Q { grestore } bind def +/cm { 6 array astore concat } bind def +/w { setlinewidth } bind def +/J { setlinecap } bind def +/j { setlinejoin } bind def +/M { setmiterlimit } bind def +/d { setdash } bind def +/m { moveto } bind def +/l { lineto } bind def +/c { curveto } bind def +/h { closepath } bind def +/re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto + 0 exch rlineto 0 rlineto closepath } bind def +/S { stroke } bind def +/f { fill } bind def +/f* { eofill } bind def +/B { fill stroke } bind def +/B* { eofill stroke } bind def +/n { newpath } bind def +/W { clip } bind def +/W* { eoclip } bind def +/BT { } bind def +/ET { } bind def +/pdfmark where { pop globaldict /?pdfmark /exec load put } + { globaldict begin /?pdfmark /pop load def /pdfmark + /cleartomark load def end } ifelse +/BDC { mark 3 1 roll /BDC pdfmark } bind def +/EMC { mark /EMC pdfmark } bind def +/cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def +/Tj { show currentpoint cairo_store_point } bind def +/TJ { + { + dup + type /stringtype eq + { show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse + } forall + currentpoint cairo_store_point +} bind def +/cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore + cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def +/Tf { pop /cairo_font exch def /cairo_font_matrix where + { pop cairo_selectfont } if } bind def +/Td { matrix translate cairo_font_matrix matrix concatmatrix dup + /cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point + /cairo_font where { pop cairo_selectfont } if } bind def +/Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def + cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def +/g { setgray } bind def +/rg { setrgbcolor } bind def +/d1 { setcachedevice } bind def +%%EndProlog +%%Page: 1 1 +%%BeginPageSetup +%%PageBoundingBox: 0 0 403 230 +%%EndPageSetup +q +1 g +0 0 403 230 rectfill +1 0 0 rg +0.5 w +0 J +0 j +[] 0.0 d +10 M q 1 0 0 1 0 230 cm +0 -230.398 m 32.879 -14.398 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +32.879 -14.398 m 32.879 -211.922 l 159.84 -211.922 l 159.84 -70.559 l +150.238 -70.559 l 148.32 -71.762 l 148.32 -72.238 l 150.238 -73.441 l +152.16 -76.32 l 152.641 -79.441 l 152.16 -81.84 l 150.961 -84 l 150.238 +-84.48 l 150.238 -142.801 l 149.762 -144.238 l 149.039 -145.922 l +114.961 -179.281 l 114.961 -186.238 l 114 -186.961 l 100.559 -186.961 l +99.602 -186 l 99.602 -172.559 l 100.559 -171.359 l 107.52 -171.359 l +138.961 -139.441 l 138.961 -84.48 l 138 -83.281 l 137.281 -81.84 l +136.801 -79.199 l 137.281 -76.559 l 138.238 -74.641 l 139.922 -72.961 l +141.121 -72 l 139.922 -71.039 l 138.238 -69.359 l 137.281 -67.441 l +136.801 -64.801 l 137.281 -62.16 l 138.238 -60.238 l 140.398 -58.078 l +137.762 -58.078 l 137.52 -57.602 l 121.922 -57.602 l 112.801 -66.238 l +112.801 -130.801 l 113.52 -131.281 l 114.719 -133.441 l 115.199 +-136.078 l 114.719 -138.961 l 112.801 -141.84 l 110.641 -143.281 l +109.441 -143.762 l 106.801 -144 l 104.16 -143.52 l 101.52 -141.602 l +100.078 -139.441 l 99.602 -137.52 l 99.602 -134.641 l 100.078 -132.719 +l 101.52 -130.801 l 101.52 -63.84 l 102.48 -60.719 l 116.16 -47.281 l +118.078 -46.32 l 137.039 -46.078 l 137.039 -43.441 l 138.238 -42.48 l +151.441 -42.48 l 152.398 -43.68 l 152.398 -57.359 l 151.441 -58.078 l +149.281 -58.078 l 149.281 -58.559 l 149.762 -59.039 l 157.68 -59.039 l +158.398 -58.32 l 158.398 -38.641 l 159.359 -35.52 l 159.84 -35.281 l +159.84 -14.398 l 32.879 -14.398 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +32.879 -14.398 m 46.078 -50.16 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +46.078 -50.16 m 43.441 -50.879 l 41.281 -51.84 l 38.16 -54 l 36 -56.641 +l 34.32 -60 l 33.602 -64.801 l 34.32 -69.602 l 36 -72.961 l 38.16 +-75.602 l 41.281 -77.762 l 43.441 -78.719 l 46.32 -79.441 l 50.16 +-79.441 l 53.039 -78.719 l 55.68 -77.52 l 58.559 -75.359 l 60.238 +-73.199 l 62.16 -69.602 l 62.879 -65.281 l 62.641 -62.641 l 62.16 -60 l +60.238 -56.398 l 58.559 -54.238 l 55.68 -52.078 l 53.039 -50.879 l +50.16 -50.16 l 46.078 -50.16 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +46.078 -50.16 m 217.922 -16.801 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +217.922 -16.801 m 217.199 -17.281 l 208.801 -25.441 l 208.078 -26.879 l +208.078 -49.199 l 205.441 -52.078 l 197.281 -52.078 l 195.84 -50.398 l +193.922 -49.441 l 190.32 -49.441 l 188.398 -50.398 l 186.719 -52.32 l +186 -53.762 l 186 -57.359 l 186.719 -58.801 l 188.398 -60.719 l 190.32 +-61.68 l 193.922 -61.68 l 195.84 -60.719 l 197.281 -59.039 l 207.121 +-59.039 l 208.559 -58.32 l 214.559 -52.078 l 215.039 -51.121 l 215.039 +-28.801 l 219.84 -23.762 l 263.039 -23.762 l 277.922 -38.879 l 277.922 +-46.801 l 290.879 -46.801 l 290.879 -33.84 l 282.238 -33.84 l 266.16 +-17.52 l 264.719 -16.801 l 217.922 -16.801 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +217.922 -16.801 m 332.879 -34.078 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +332.879 -34.078 m 331.68 -34.559 l 330.238 -35.281 l 328.559 -37.199 l +327.84 -38.641 l 327.84 -42 l 328.559 -43.922 l 302.641 -70.078 l +264.238 -70.078 l 263.281 -70.559 l 259.199 -74.398 l 258.48 -75.84 l +258.48 -85.441 l 249.121 -94.559 l 239.762 -94.559 l 239.039 -93.602 l +237.121 -92.641 l 233.52 -92.641 l 231.602 -93.602 l 229.922 -95.52 l +229.199 -96.961 l 229.199 -100.559 l 229.922 -102 l 231.602 -103.922 l +233.52 -104.879 l 237.121 -104.879 l 239.039 -103.922 l 241.199 -101.52 +l 251.039 -101.52 l 252 -101.039 l 264.719 -88.559 l 265.441 -87.121 l +265.441 -77.52 l 265.922 -77.039 l 304.32 -77.039 l 305.762 -76.32 l +335.039 -46.801 l 337.199 -45.84 l 339.121 -44.16 l 340.078 -42.238 l +340.078 -38.641 l 339.359 -37.199 l 337.68 -35.281 l 335.762 -34.32 l +332.879 -34.078 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +332.879 -34.078 m 228.961 -34.559 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +228.961 -34.559 m 228.961 -47.52 l 241.922 -47.52 l 241.922 -34.559 l +228.961 -34.559 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +228.961 -34.559 m 191.039 -34.801 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +191.039 -34.801 m 189.359 -35.52 l 163.199 -35.52 l 161.762 -36.719 l +160.559 -38.16 l 160.559 -59.52 l 158.398 -61.441 l 149.762 -61.441 l +148.32 -59.762 l 146.398 -58.801 l 142.801 -58.801 l 141.359 -59.52 l +139.441 -61.199 l 138.48 -63.121 l 138.48 -66.719 l 139.441 -68.641 l +141.359 -70.32 l 142.801 -71.039 l 146.398 -71.039 l 148.32 -70.078 l +149.762 -68.398 l 160.32 -68.398 l 161.281 -67.922 l 166.801 -62.641 l +167.52 -61.199 l 167.52 -42.48 l 186 -42.48 l 186.48 -44.16 l 188.398 +-46.32 l 190.32 -47.281 l 193.922 -47.281 l 195.84 -46.32 l 197.52 +-44.398 l 198.238 -42.961 l 198.238 -39.359 l 197.52 -37.922 l 195.84 +-36 l 193.922 -35.039 l 191.039 -34.801 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +191.039 -34.801 m 138.238 -43.922 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +138.238 -43.922 m 138.238 -48.48 l 118.801 -48.48 l 117.84 -48.961 l +104.398 -62.16 l 103.68 -63.602 l 103.68 -131.039 l 102 -132.48 l +101.039 -134.398 l 101.039 -138 l 101.762 -139.441 l 103.441 -141.359 l +105.359 -142.32 l 108.961 -142.32 l 110.879 -141.359 l 112.559 -139.441 +l 113.281 -138 l 113.281 -134.398 l 112.32 -132.48 l 110.641 -131.039 l +110.641 -65.52 l 120.48 -55.441 l 138.238 -55.441 l 138.238 -56.879 l +151.199 -56.879 l 151.199 -43.922 l 138.238 -43.922 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +138.238 -43.922 m 234.238 -49.199 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +234.238 -49.199 m 233.039 -49.68 l 231.602 -50.398 l 229.922 -52.32 l +229.199 -53.762 l 229.199 -57.359 l 230.16 -59.281 l 232.078 -60.961 l +233.52 -61.68 l 237.121 -61.68 l 239.039 -60.719 l 240.719 -58.801 l +241.441 -57.359 l 241.441 -53.762 l 240.719 -52.32 l 239.039 -50.398 l +237.121 -49.441 l 234.238 -49.199 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +234.238 -49.199 m 191.039 -63.602 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +191.039 -63.602 m 189.84 -64.078 l 188.398 -64.801 l 186.719 -66.719 l +186 -68.16 l 186 -71.762 l 186.961 -73.68 l 188.879 -75.359 l 190.32 +-76.078 l 193.922 -76.078 l 195.84 -75.121 l 197.52 -73.199 l 198.238 +-71.762 l 198.238 -68.16 l 197.52 -66.719 l 195.84 -64.801 l 193.922 +-63.84 l 191.039 -63.602 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +191.039 -63.602 m 234.238 -63.602 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +234.238 -63.602 m 233.039 -64.078 l 231.602 -64.801 l 230.16 -66.48 l +216 -66.48 l 215.039 -66.961 l 208.801 -72.961 l 208.078 -74.398 l +208.078 -90.961 l 204.719 -94.559 l 196.559 -94.559 l 195.84 -93.602 l +193.922 -92.641 l 190.32 -92.641 l 188.879 -93.359 l 186.961 -95.039 l +186 -96.961 l 186 -100.559 l 186.961 -102.48 l 188.879 -104.16 l 190.32 +-104.879 l 193.922 -104.879 l 195.84 -103.922 l 198 -101.52 l 206.398 +-101.52 l 207.84 -100.801 l 214.559 -93.84 l 215.039 -92.879 l 215.039 +-76.078 l 217.922 -73.441 l 230.16 -73.441 l 231.602 -75.121 l 233.52 +-76.078 l 237.121 -76.078 l 239.039 -75.121 l 240.719 -73.199 l 241.441 +-71.762 l 241.441 -68.16 l 240.719 -66.719 l 239.039 -64.801 l 237.121 +-63.84 l 234.238 -63.602 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +234.238 -63.602 m 143.52 -72.961 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +143.52 -72.961 m 142.32 -73.441 l 140.879 -74.16 l 139.199 -76.078 l +138.48 -77.52 l 138.48 -81.121 l 139.441 -83.039 l 141.121 -84.48 l +141.121 -140.879 l 108.961 -172.801 l 100.801 -172.801 l 100.801 +-185.762 l 113.762 -185.762 l 113.762 -177.359 l 147.359 -144 l 148.078 +-142.559 l 148.078 -84.48 l 149.762 -83.039 l 150.719 -81.121 l 150.719 +-77.52 l 150 -76.078 l 148.32 -74.16 l 146.398 -73.199 l 143.52 -72.961 +l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +143.52 -72.961 m 191.039 -78 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +191.039 -78 m 189.84 -78.48 l 188.398 -79.199 l 186.48 -81.359 l 186 +-83.039 l 174.961 -83.039 l 174 -83.52 l 168.48 -88.801 l 167.762 +-90.238 l 167.762 -163.441 l 168.48 -164.879 l 210.961 -207.121 l +210.961 -211.68 l 223.922 -211.68 l 223.922 -198.719 l 211.68 -198.719 +l 174.719 -161.52 l 174.719 -92.16 l 176.641 -90 l 189.359 -90 l +191.281 -90.719 l 193.922 -90.48 l 195.84 -89.52 l 197.52 -87.602 l +198.238 -86.16 l 198.238 -82.559 l 197.52 -81.121 l 195.84 -79.199 l +193.922 -78.238 l 191.039 -78 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +191.039 -78 m 234.238 -78 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +234.238 -78 m 233.039 -78.48 l 231.602 -79.199 l 229.922 -81.121 l +229.199 -82.559 l 229.199 -86.16 l 230.16 -88.078 l 232.078 -89.762 l +233.52 -90.48 l 237.121 -90.48 l 239.039 -89.52 l 240.719 -87.602 l +241.441 -86.16 l 241.441 -82.559 l 240.719 -81.121 l 239.039 -79.199 l +237.121 -78.238 l 234.238 -78 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +234.238 -78 m 283.199 -91.68 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +283.199 -91.68 m 282 -92.16 l 280.559 -92.879 l 278.879 -94.801 l +278.16 -96.238 l 278.16 -99.84 l 279.121 -101.762 l 280.801 -103.199 l +280.801 -144 l 281.281 -144.961 l 293.039 -156.961 l 293.281 -160.32 l +294.238 -162.238 l 296.16 -163.922 l 297.602 -164.641 l 301.199 +-164.641 l 303.121 -163.68 l 304.801 -161.762 l 305.52 -160.32 l 305.52 +-156.719 l 304.801 -155.281 l 303.121 -153.359 l 301.199 -152.398 l +297.84 -152.16 l 287.762 -142.32 l 287.762 -103.199 l 289.68 -101.52 l +305.52 -101.52 l 308.879 -105.121 l 308.879 -118.801 l 307.199 -120.238 +l 306.238 -122.16 l 306.238 -125.762 l 306.961 -127.199 l 308.641 +-129.121 l 310.559 -130.078 l 314.16 -130.078 l 316.078 -129.121 l +317.762 -127.199 l 318.48 -125.762 l 318.48 -122.16 l 317.52 -120.238 l +315.84 -118.801 l 315.84 -103.199 l 315.121 -101.762 l 308.16 -95.039 l +307.199 -94.559 l 289.441 -94.559 l 288 -92.879 l 286.078 -91.922 l +283.199 -91.68 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +283.199 -91.68 m 191.039 -106.801 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +191.039 -106.801 m 189.84 -107.281 l 188.398 -108 l 186.719 -109.922 l +186 -111.359 l 186 -114.961 l 186.961 -116.879 l 188.879 -118.559 l +190.32 -119.281 l 193.922 -119.281 l 195.84 -118.32 l 197.281 -116.641 +l 212.641 -116.641 l 226.078 -130.32 l 227.52 -131.039 l 230.16 +-131.039 l 231.602 -132.719 l 233.52 -133.68 l 237.121 -133.68 l +238.559 -132.961 l 240.48 -131.281 l 241.441 -129.359 l 241.441 +-125.762 l 240.48 -123.84 l 238.559 -122.16 l 237.121 -121.441 l 233.52 +-121.441 l 231.602 -122.398 l 230.16 -124.078 l 229.199 -124.078 l +215.039 -109.68 l 213.602 -108.961 l 212.16 -108.961 l 211.199 -109.68 +l 197.281 -109.68 l 195.84 -108 l 193.922 -107.039 l 191.039 -106.801 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +191.039 -106.801 m 234.238 -106.801 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +234.238 -106.801 m 233.039 -107.281 l 231.602 -108 l 229.922 -109.922 l +229.199 -111.359 l 229.199 -114.961 l 230.16 -116.879 l 232.078 +-118.559 l 233.52 -119.281 l 237.121 -119.281 l 239.039 -118.32 l +239.762 -117.359 l 253.68 -117.359 l 254.16 -117.84 l 254.16 -147.602 l +254.641 -148.559 l 264.238 -158.398 l 264.48 -160.32 l 265.199 -161.762 +l 266.879 -163.68 l 268.801 -164.641 l 272.398 -164.641 l 274.32 +-163.68 l 276 -161.762 l 276.719 -160.32 l 276.719 -156.719 l 276 +-155.281 l 274.32 -153.359 l 272.398 -152.398 l 270.238 -152.16 l +268.078 -152.641 l 261.121 -145.922 l 261.121 -116.16 l 260.398 +-114.719 l 256.32 -110.879 l 255.359 -110.398 l 241.199 -110.398 l +239.039 -108 l 237.121 -107.039 l 234.238 -106.801 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +234.238 -106.801 m 191.039 -121.199 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +191.039 -121.199 m 189.84 -121.68 l 188.398 -122.398 l 186.719 -124.32 +l 186 -125.762 l 186 -129.359 l 186.961 -131.281 l 188.879 -132.961 l +190.32 -133.68 l 193.922 -133.68 l 195.84 -132.719 l 197.281 -131.039 l +204 -131.039 l 215.281 -142.559 l 216.719 -143.281 l 229.199 -143.281 l +229.68 -144.961 l 231.602 -147.121 l 233.52 -148.078 l 237.121 -148.078 +l 238.559 -147.359 l 240.48 -145.68 l 241.441 -143.762 l 241.441 +-140.16 l 240.48 -138.238 l 238.559 -136.559 l 237.121 -135.84 l 234.48 +-135.602 l 232.559 -136.32 l 218.398 -136.32 l 207.121 -124.801 l +205.68 -124.078 l 197.281 -124.078 l 195.84 -122.398 l 193.922 -121.441 +l 191.039 -121.199 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +191.039 -121.199 m 191.039 -135.602 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +191.039 -135.602 m 189.84 -136.078 l 188.398 -136.801 l 186.719 +-138.719 l 186 -140.16 l 186 -143.762 l 186.961 -145.68 l 188.879 +-147.359 l 190.32 -148.078 l 193.922 -148.078 l 195.84 -147.121 l +197.281 -145.441 l 202.32 -145.441 l 216.719 -159.602 l 216.719 -179.52 +l 217.922 -180.961 l 219.359 -182.16 l 247.199 -182.16 l 268.559 +-203.762 l 268.801 -207.121 l 269.52 -208.559 l 271.199 -210.48 l +273.121 -211.441 l 276.719 -211.441 l 278.641 -210.48 l 280.32 -208.559 +l 281.039 -207.121 l 281.039 -203.52 l 280.32 -202.078 l 278.641 +-200.16 l 276.719 -199.199 l 273.359 -198.961 l 249.84 -175.68 l +248.879 -175.199 l 223.68 -175.199 l 223.68 -157.922 l 223.199 -156.961 +l 205.68 -139.199 l 204.238 -138.48 l 197.281 -138.48 l 195.84 -136.801 +l 193.922 -135.84 l 191.039 -135.602 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +191.039 -135.602 m 191.039 -150 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +191.039 -150 m 189.84 -150.48 l 188.398 -151.199 l 186.719 -153.121 l +186 -154.559 l 186 -158.16 l 186.961 -160.078 l 188.879 -161.762 l +190.32 -162.48 l 193.922 -162.48 l 195.84 -161.52 l 197.52 -159.602 l +198.238 -158.16 l 198.238 -154.559 l 197.52 -153.121 l 195.84 -151.199 +l 193.922 -150.238 l 191.039 -150 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +191.039 -150 m 234.238 -150 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +234.238 -150 m 233.039 -150.48 l 231.602 -151.199 l 229.922 -153.121 l +229.199 -154.559 l 229.199 -158.16 l 230.16 -160.078 l 232.078 -161.762 +l 233.52 -162.48 l 237.121 -162.48 l 239.039 -161.52 l 240.719 -159.602 +l 241.441 -158.16 l 241.441 -154.559 l 240.719 -153.121 l 239.039 +-151.199 l 237.121 -150.238 l 234.238 -150 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +234.238 -150 m 46.559 -51.84 l S Q +0 g +0.5 w +q 1 0 0 1 0 230 cm +46.559 -51.84 m 44.641 -52.32 l 42.238 -53.281 l 39.602 -54.961 l +37.441 -57.359 l 36 -60 l 35.281 -62.398 l 35.281 -67.441 l 36 -69.84 l +37.441 -72.48 l 39.602 -74.879 l 42.238 -76.559 l 45.359 -77.762 l +50.879 -77.762 l 54 -76.559 l 56.641 -74.879 l 58.801 -72.48 l 60.238 +-69.84 l 60.961 -67.441 l 60.961 -62.398 l 60.238 -60 l 58.801 -57.359 +l 56.641 -54.961 l 54 -53.281 l 50.879 -52.078 l 46.559 -51.84 l S Q +1 0 0 rg +0.5 w +q 1 0 0 1 0 230 cm +46.559 -51.84 m S Q +Q +showpage +%%Trailer +count op_count sub {pop} repeat +countdictstack dict_count sub {end} repeat +cairo_eps_state restore +%%EOF Index: tags/1.0.5/doc/gcode_tool_path.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/gcode_tool_path.pdf =================================================================== --- tags/1.0.5/doc/gcode_tool_path.pdf (nonexistent) +++ tags/1.0.5/doc/gcode_tool_path.pdf (revision 953) Property changes on: tags/1.0.5/doc/gcode_tool_path.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/gcode_tool_path.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/gcode_tool_path.png =================================================================== --- tags/1.0.5/doc/gcode_tool_path.png (nonexistent) +++ tags/1.0.5/doc/gcode_tool_path.png (revision 953) Property changes on: tags/1.0.5/doc/gcode_tool_path.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/letter_size.tab =================================================================== --- tags/1.0.5/doc/letter_size.tab (nonexistent) +++ tags/1.0.5/doc/letter_size.tab (revision 953) @@ -0,0 +1,30 @@ +# $Id$ +# + +A .2340 +B .2380 +C .2420 +D .2460 +E .2500 +F .2570 +G .2610 +H .2660 +I .2720 +J .2770 +K .2810 +L .2900 +M .2950 +N .3020 +O .3160 +P .3230 +Q .3320 +R .3390 +S .3480 +T .3580 +U .3680 +V .3770 +W .3860 +X .3970 +Y .4040 +Z .4130 + Index: tags/1.0.5/doc/letter_size.texi =================================================================== --- tags/1.0.5/doc/letter_size.texi (nonexistent) +++ tags/1.0.5/doc/letter_size.texi (revision 953) @@ -0,0 +1,16 @@ +@c Generated file. Do not edit directly +@c $Id$ +@multitable @columnfractions 0.167 0.167 0.167 0.167 0.167 0.167 +@item Drill @tab Diameter @tab Drill @tab Diameter @tab Drill @tab Diameter +@item Size @tab (inches) @tab Size @tab (inches) @tab Size @tab (inches) + +@item A @tab .2340 @tab B @tab .2380 @tab C @tab .2420 +@item D @tab .2460 @tab E @tab .2500 @tab F @tab .2570 +@item G @tab .2610 @tab H @tab .2660 @tab I @tab .2720 +@item J @tab .2770 @tab K @tab .2810 @tab L @tab .2900 +@item M @tab .2950 @tab N @tab .3020 @tab O @tab .3160 +@item P @tab .3230 @tab Q @tab .3320 @tab R @tab .3390 +@item S @tab .3480 @tab T @tab .3580 @tab U @tab .3680 +@item V @tab .3770 @tab W @tab .3860 @tab X @tab .3970 +@item Y @tab .4040 @tab Z @tab .4130 @tab @tab @end multitable + Index: tags/1.0.5/doc/mdate-sh =================================================================== --- tags/1.0.5/doc/mdate-sh (nonexistent) +++ tags/1.0.5/doc/mdate-sh (revision 953) @@ -0,0 +1,193 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. + +scriptversion=2005-02-07.09 + +# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software +# Foundation, Inc. +# written by Ulrich Drepper , June 1995 +# +# 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No file. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification time of FILE. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit $? + ;; +esac + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +save_arg1="$1" + +# Find out how to get the extended ls output of a file or directory. +if ls -L /dev/null 1>/dev/null 2>&1; then + ls_command='ls -L -l -d' +else + ls_command='ls -l -d' +fi + +# A `ls -l' line looks as follows on OS/2. +# drwxrwx--- 0 Aug 11 2001 foo +# This differs from Unix, which adds ownership information. +# drwxrwx--- 2 root root 4096 Aug 11 2001 foo +# +# To find the date, we split the line on spaces and iterate on words +# until we find a month. This cannot work with files whose owner is a +# user named `Jan', or `Feb', etc. However, it's unlikely that `/' +# will be owned by a user whose name is a month. So we first look at +# the extended ls output of the root directory to decide how many +# words should be skipped to get the date. + +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +set x`ls -l -d /` + +# Find which argument is the month. +month= +command= +until test $month +do + shift + # Add another shift to the command. + command="$command shift;" + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +# Get the extended ls output of the file or directory. +set dummy x`eval "$ls_command \"\$save_arg1\""` + +# Remove all preceding arguments +eval $command + +# Because of the dummy argument above, month is in $2. +# +# On a POSIX system, we should have +# +# $# = 5 +# $1 = file size +# $2 = month +# $3 = day +# $4 = year or time +# $5 = filename +# +# On Darwin 7.7.0 and 7.6.0, we have +# +# $# = 4 +# $1 = day +# $2 = month +# $3 = year or time +# $4 = filename + +# Get the month. +case $2 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; +esac + +case $3 in + ???*) day=$1;; + *) day=$3; shift;; +esac + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Index: tags/1.0.5/doc/metric_size.tab =================================================================== --- tags/1.0.5/doc/metric_size.tab (nonexistent) +++ tags/1.0.5/doc/metric_size.tab (revision 953) @@ -0,0 +1,192 @@ +# $Id$ +# + +0.20_mm .00787 +0.25_mm .00984 +0.30_mm .0118 +0.35_mm .0138 +0.40_mm .0158 +0.45_mm .0177 +0.50_mm .0197 +0.55_mm .0217 +0.60_mm .0236 +0.65_mm .0256 +0.70_mm .0276 +0.75_mm .0295 +0.80_mm .0315 +0.85_mm .0335 +0.90_mm .0354 +0.95_mm .0374 +1.00_mm .0394 +1.05_mm .0413 +1.10_mm .0433 +1.15_mm .0453 +1.20_mm .0472 +1.25_mm .0492 +1.30_mm .0512 +1.35_mm .0531 +1.40_mm .0551 +1.45_mm .0571 +1.50_mm .0591 +1.55_mm .0610 +1.60_mm .0630 +1.65_mm .0650 +1.70_mm .0669 +1.75_mm .0689 +1.80_mm .0709 +1.85_mm .0728 +1.90_mm .0748 +1.95_mm .0768 +2.00_mm .0787 +2.05_mm .0807 +2.10_mm .0827 +2.15_mm .0846 +2.20_mm .0866 +2.25_mm .0886 +2.30_mm .0906 +2.35_mm .0925 +2.40_mm .0945 +2.45_mm .0965 +2.50_mm .0984 +2.55_mm .1004 +2.60_mm .1024 +2.65_mm .1043 +2.70_mm .1063 +2.75_mm .1083 +2.80_mm .1102 +2.85_mm .1122 +2.90_mm .1142 +2.95_mm .1161 +3.00_mm .1181 +3.10_mm .1220 +3.15_mm .1240 +3.20_mm .1260 +3.25_mm .1280 +3.30_mm .1299 +3.40_mm .1339 +3.50_mm .1378 +3.60_mm .1417 +3.70_mm .1457 +3.75_mm .1476 +3.80_mm .1496 +3.90_mm .1535 +4.00_mm .1575 +4.10_mm .1614 +4.20_mm .1654 +4.25_mm .1673 +4.30_mm .1693 +4.40_mm .1732 +4.50_mm .1772 +4.60_mm .1811 +4.70_mm .1850 +4.75_mm .1870 +4.80_mm .1890 +4.90_mm .1929 +5.00_mm .1969 +5.10_mm .2008 +5.20_mm .2047 +5.25_mm .2067 +5.30_mm .2087 +5.40_mm .2126 +5.50_mm .2165 +5.60_mm .2205 +5.70_mm .2244 +5.75_mm .2264 +5.80_mm .2283 +5.90_mm .2323 +6.00_mm .2362 +6.10_mm .2402 +6.20_mm .2441 +6.25_mm .2461 +6.30_mm .2480 +6.40_mm .2520 +6.50_mm .2559 +6.60_mm .2598 +6.70_mm .2638 +6.75_mm .2657 +6.80_mm .2677 +6.90_mm .2717 +7.00_mm .2756 +7.10_mm .2795 +7.20_mm .2835 +7.25_mm .2854 +7.30_mm .2874 +7.40_mm .2914 +7.50_mm .2953 +7.60_mm .2992 +7.70_mm .3031 +8.00_mm .3150 +8.10_mm .3189 +8.20_mm .3228 +8.25_mm .3248 +8.30_mm .3268 +8.40_mm .3307 +8.50_mm .3346 +8.60_mm .3386 +8.70_mm .3425 +8.75_mm .3445 +8.80_mm .3465 +8.90_mm .3504 +9.00_mm .3543 +9.10_mm .3583 +9.20_mm .3622 +9.25_mm .3642 +9.30_mm .3661 +9.40_mm .3701 +9.50_mm .3740 +9.60_mm .3780 +9.70_mm .3819 +9.75_mm .3839 +9.80_mm .3858 +9.90_mm .3898 +10.00_mm .3937 +10.10_mm .3976 +10.20_mm .4016 +10.25_mm .4035 +10.30_mm .4055 +10.40_mm .4094 +10.50_mm .4134 +10.60_mm .4173 +10.70_mm .4213 +10.80_mm .4252 +10.90_mm .4291 +11.00_mm .4331 +11.10_mm .4370 +11.20_mm .4409 +11.25_mm .4429 +11.30_mm .4449 +11.40_mm .4488 +11.50_mm .4528 +11.60_mm .4567 +11.70_mm .4606 +11.75_mm .4626 +11.80_mm .4646 +11.90_mm .4685 +12.00_mm .4724 +12.50_mm .4921 +13.00_mm .5118 +13.50_mm .5315 +14.00_mm .5512 +14.50_mm .5709 +15.00_mm .5906 +15.50_mm .6102 +16.00_mm .6299 +16.50_mm .6496 +17.00_mm .6693 +17.50_mm .6890 +18.00_mm .7087 +18.50_mm .7283 +19.00_mm .7480 +19.50_mm .7677 +20.00_mm .7874 +20.50_mm .8071 +21.00_mm .8268 +21.50_mm .8465 +22.00_mm .8661 +22.50_mm .8858 +23.00_mm .9055 +23.50_mm .9252 +24.00_mm .9449 +24.50_mm .9646 +25.00_mm .9843 + Index: tags/1.0.5/doc/metric_size.texi =================================================================== --- tags/1.0.5/doc/metric_size.texi (nonexistent) +++ tags/1.0.5/doc/metric_size.texi (revision 953) @@ -0,0 +1,70 @@ +@c Generated file. Do not edit directly +@c $Id$ +@multitable @columnfractions 0.167 0.167 0.167 0.167 0.167 0.167 +@item Drill @tab Diameter @tab Drill @tab Diameter @tab Drill @tab Diameter +@item Size @tab (inches) @tab Size @tab (inches) @tab Size @tab (inches) + +@item 0.20 mm @tab .00787 @tab 0.25 mm @tab .00984 @tab 0.30 mm @tab .0118 +@item 0.35 mm @tab .0138 @tab 0.40 mm @tab .0158 @tab 0.45 mm @tab .0177 +@item 0.50 mm @tab .0197 @tab 0.55 mm @tab .0217 @tab 0.60 mm @tab .0236 +@item 0.65 mm @tab .0256 @tab 0.70 mm @tab .0276 @tab 0.75 mm @tab .0295 +@item 0.80 mm @tab .0315 @tab 0.85 mm @tab .0335 @tab 0.90 mm @tab .0354 +@item 0.95 mm @tab .0374 @tab 1.00 mm @tab .0394 @tab 1.05 mm @tab .0413 +@item 1.10 mm @tab .0433 @tab 1.15 mm @tab .0453 @tab 1.20 mm @tab .0472 +@item 1.25 mm @tab .0492 @tab 1.30 mm @tab .0512 @tab 1.35 mm @tab .0531 +@item 1.40 mm @tab .0551 @tab 1.45 mm @tab .0571 @tab 1.50 mm @tab .0591 +@item 1.55 mm @tab .0610 @tab 1.60 mm @tab .0630 @tab 1.65 mm @tab .0650 +@item 1.70 mm @tab .0669 @tab 1.75 mm @tab .0689 @tab 1.80 mm @tab .0709 +@item 1.85 mm @tab .0728 @tab 1.90 mm @tab .0748 @tab 1.95 mm @tab .0768 +@item 2.00 mm @tab .0787 @tab 2.05 mm @tab .0807 @tab 2.10 mm @tab .0827 +@item 2.15 mm @tab .0846 @tab 2.20 mm @tab .0866 @tab 2.25 mm @tab .0886 +@item 2.30 mm @tab .0906 @tab 2.35 mm @tab .0925 @tab 2.40 mm @tab .0945 +@item 2.45 mm @tab .0965 @tab 2.50 mm @tab .0984 @tab 2.55 mm @tab .1004 +@item 2.60 mm @tab .1024 @tab 2.65 mm @tab .1043 @tab 2.70 mm @tab .1063 +@item 2.75 mm @tab .1083 @tab 2.80 mm @tab .1102 @tab 2.85 mm @tab .1122 +@item 2.90 mm @tab .1142 @tab 2.95 mm @tab .1161 @tab 3.00 mm @tab .1181 +@item 3.10 mm @tab .1220 @tab 3.15 mm @tab .1240 @tab 3.20 mm @tab .1260 +@item 3.25 mm @tab .1280 @tab 3.30 mm @tab .1299 @tab 3.40 mm @tab .1339 +@item 3.50 mm @tab .1378 @tab 3.60 mm @tab .1417 @tab 3.70 mm @tab .1457 +@item 3.75 mm @tab .1476 @tab 3.80 mm @tab .1496 @tab 3.90 mm @tab .1535 +@item 4.00 mm @tab .1575 @tab 4.10 mm @tab .1614 @tab 4.20 mm @tab .1654 +@item 4.25 mm @tab .1673 @tab 4.30 mm @tab .1693 @tab 4.40 mm @tab .1732 +@item 4.50 mm @tab .1772 @tab 4.60 mm @tab .1811 @tab 4.70 mm @tab .1850 +@item 4.75 mm @tab .1870 @tab 4.80 mm @tab .1890 @tab 4.90 mm @tab .1929 +@item 5.00 mm @tab .1969 @tab 5.10 mm @tab .2008 @tab 5.20 mm @tab .2047 +@item 5.25 mm @tab .2067 @tab 5.30 mm @tab .2087 @tab 5.40 mm @tab .2126 +@item 5.50 mm @tab .2165 @tab 5.60 mm @tab .2205 @tab 5.70 mm @tab .2244 +@item 5.75 mm @tab .2264 @tab 5.80 mm @tab .2283 @tab 5.90 mm @tab .2323 +@item 6.00 mm @tab .2362 @tab 6.10 mm @tab .2402 @tab 6.20 mm @tab .2441 +@item 6.25 mm @tab .2461 @tab 6.30 mm @tab .2480 @tab 6.40 mm @tab .2520 +@item 6.50 mm @tab .2559 @tab 6.60 mm @tab .2598 @tab 6.70 mm @tab .2638 +@item 6.75 mm @tab .2657 @tab 6.80 mm @tab .2677 @tab 6.90 mm @tab .2717 +@item 7.00 mm @tab .2756 @tab 7.10 mm @tab .2795 @tab 7.20 mm @tab .2835 +@item 7.25 mm @tab .2854 @tab 7.30 mm @tab .2874 @tab 7.40 mm @tab .2914 +@item 7.50 mm @tab .2953 @tab 7.60 mm @tab .2992 @tab 7.70 mm @tab .3031 +@item 8.00 mm @tab .3150 @tab 8.10 mm @tab .3189 @tab 8.20 mm @tab .3228 +@item 8.25 mm @tab .3248 @tab 8.30 mm @tab .3268 @tab 8.40 mm @tab .3307 +@item 8.50 mm @tab .3346 @tab 8.60 mm @tab .3386 @tab 8.70 mm @tab .3425 +@item 8.75 mm @tab .3445 @tab 8.80 mm @tab .3465 @tab 8.90 mm @tab .3504 +@item 9.00 mm @tab .3543 @tab 9.10 mm @tab .3583 @tab 9.20 mm @tab .3622 +@item 9.25 mm @tab .3642 @tab 9.30 mm @tab .3661 @tab 9.40 mm @tab .3701 +@item 9.50 mm @tab .3740 @tab 9.60 mm @tab .3780 @tab 9.70 mm @tab .3819 +@item 9.75 mm @tab .3839 @tab 9.80 mm @tab .3858 @tab 9.90 mm @tab .3898 +@item 10.00 mm @tab .3937 @tab 10.10 mm @tab .3976 @tab 10.20 mm @tab .4016 +@item 10.25 mm @tab .4035 @tab 10.30 mm @tab .4055 @tab 10.40 mm @tab .4094 +@item 10.50 mm @tab .4134 @tab 10.60 mm @tab .4173 @tab 10.70 mm @tab .4213 +@item 10.80 mm @tab .4252 @tab 10.90 mm @tab .4291 @tab 11.00 mm @tab .4331 +@item 11.10 mm @tab .4370 @tab 11.20 mm @tab .4409 @tab 11.25 mm @tab .4429 +@item 11.30 mm @tab .4449 @tab 11.40 mm @tab .4488 @tab 11.50 mm @tab .4528 +@item 11.60 mm @tab .4567 @tab 11.70 mm @tab .4606 @tab 11.75 mm @tab .4626 +@item 11.80 mm @tab .4646 @tab 11.90 mm @tab .4685 @tab 12.00 mm @tab .4724 +@item 12.50 mm @tab .4921 @tab 13.00 mm @tab .5118 @tab 13.50 mm @tab .5315 +@item 14.00 mm @tab .5512 @tab 14.50 mm @tab .5709 @tab 15.00 mm @tab .5906 +@item 15.50 mm @tab .6102 @tab 16.00 mm @tab .6299 @tab 16.50 mm @tab .6496 +@item 17.00 mm @tab .6693 @tab 17.50 mm @tab .6890 @tab 18.00 mm @tab .7087 +@item 18.50 mm @tab .7283 @tab 19.00 mm @tab .7480 @tab 19.50 mm @tab .7677 +@item 20.00 mm @tab .7874 @tab 20.50 mm @tab .8071 @tab 21.00 mm @tab .8268 +@item 21.50 mm @tab .8465 @tab 22.00 mm @tab .8661 @tab 22.50 mm @tab .8858 +@item 23.00 mm @tab .9055 @tab 23.50 mm @tab .9252 @tab 24.00 mm @tab .9449 +@item 24.50 mm @tab .9646 @tab 25.00 mm @tab .9843 @tab @tab @end multitable + Index: tags/1.0.5/doc/options.texi =================================================================== --- tags/1.0.5/doc/options.texi (nonexistent) +++ tags/1.0.5/doc/options.texi (revision 953) @@ -0,0 +1,896 @@ +@c key options +@menu +* General Options:: +* General GUI Options:: +* GTK+ GUI Options:: +* lesstif GUI Options:: +* Colors:: +* Layer Names:: +* Paths:: +* Sizes:: +* Commands:: +* DRC Options:: +* BOM Creation:: +* Gerber Export:: +* Postscript Export:: +* Encapsulated Postscript Export:: +* PNG Options:: +* lpr Printing Options:: +* nelma Options:: +@end menu +@c options General Options +@node General Options +@section General Options +@c ./../src/main.c 434 +@ftable @code +@item --help +Show help on command line options. +@end ftable +@c ./../src/main.c 439 +@ftable @code +@item --version +Show version. +@end ftable +@c ./../src/main.c 443 +@ftable @code +@item --verbose +Be verbose on stdout. +@end ftable +@c ./../src/main.c 448 +@ftable @code +@item --copyright +Show copyright. +@end ftable +@c ./../src/main.c 453 +@ftable @code +@item --show-defaults +Show option defaults. +@end ftable +@c ./../src/main.c 458 +@ftable @code +@item --show-actions +Show available actions and exit. +@end ftable +@c ./../src/main.c 463 +@ftable @code +@item --dump-actions +Dump actions (for documentation). +@end ftable +@c ./../src/main.c 468 +@ftable @code +@item --grid-units-mm +Set default grid units. Can be mm or mil. Defaults to mil. +@end ftable +@c ./../src/main.c 686 +@ftable @code +@item --backup-interval +Time between automatic backups in seconds. Set to @code{0} to disable. +The default value is @code{60}. +@end ftable +@c ./../src/main.c 723 +@ftable @code +@item --groups +Layer group string. Defaults to @code{"1,c:2:3:4:5:6,s:7:8"}. +@end ftable +@c ./../src/main.c 788 +@ftable @code +@item --route-styles +A string that defines the route styles. Defaults to @* +@code{"Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000 + :Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600"} +@end ftable +@c ./../src/main.c 807 +@ftable @code +@item --element-path +A colon separated list of directories or commands (starts with '|'). +The path is passed to the program specified in @option{--element-command}. +@end ftable +@c ./../src/main.c 817 +@ftable @code +@item --action-script +If set, this file is executed at startup. +@end ftable +@c ./../src/main.c 822 +@ftable @code +@item --action-string +If set, this string of actions is executed at startup. +@end ftable +@c ./../src/main.c 827 +@ftable @code +@item --fab-author +Name of author to be put in the Gerber files. +@end ftable +@c ./../src/main.c 832 +@ftable @code +@item --layer-stack +Initial layer stackup, for setting up an export. A comma separated list of layer +names, layer numbers and layer groups. +@end ftable +@c ./../src/main.c 883 +@ftable @code +@item --save-last-command +If set, the last user command is saved. +@end ftable +@c ./../src/main.c 887 +@ftable @code +@item --save-in-tmp +If set, all data which would otherwise be lost are saved in a temporary file +@file{/tmp/PCB.%i.save} . Sequence @samp{%i} is replaced by the process ID. +@end ftable +@c ./../src/main.c 901 +@ftable @code +@item --reset-after-element +If set, all found connections are reset before a new component is scanned. +@end ftable +@c ./../src/main.c 906 +@ftable @code +@item --ring-bell-finished +Execute the bell command when all rats are routed. +@end ftable +@c options General GUI Options +@node General GUI Options +@section General GUI Options +@c ./../src/main.c 842 +@ftable @code +@item --pinout-offset-x +Horizontal offset of the pin number display. Defaults to @code{100mil}. +@end ftable +@c ./../src/main.c 847 +@ftable @code +@item --pinout-offset-y +Vertical offset of the pin number display. Defaults to @code{100mil}. +@end ftable +@c ./../src/main.c 852 +@ftable @code +@item --pinout-text-offset-x +Horizontal offset of the pin name display. Defaults to @code{800mil}. +@end ftable +@c ./../src/main.c 857 +@ftable @code +@item --pinout-text-offset-y +Vertical offset of the pin name display. Defaults to @code{-100mil}. +@end ftable +@c ./../src/main.c 862 +@ftable @code +@item --draw-grid +If set, draw the grid at start-up. +@end ftable +@c ./../src/main.c 866 +@ftable @code +@item --clear-line +If set, new lines clear polygons. +@end ftable +@c ./../src/main.c 870 +@ftable @code +@item --full-poly +If set, new polygons are full ones. +@end ftable +@c ./../src/main.c 874 +@ftable @code +@item --unique-names +If set, you will not be permitted to change the name of an component to match that +of another component. +@end ftable +@c ./../src/main.c 878 +@ftable @code +@item --snap-pin +If set, pin centers and pad end points are treated as additional grid points +that the cursor can snap to. +@end ftable +@c ./../src/main.c 892 +@ftable @code +@item --all-direction-lines +Allow all directions, when drawing new lines. +@end ftable +@c ./../src/main.c 897 +@ftable @code +@item --show-number +Pinout shows number. +@end ftable +@c options GTK+ GUI Options +@node GTK+ GUI Options +@section GTK+ GUI Options +@c ./../src/hid/gtk/gui-top-window.c 1615 +@ftable @code +@item --listen +Listen for actions on stdin. +@end ftable +@c ./../src/hid/gtk/gui-top-window.c 1621 +@ftable @code +@item --bg-image +File name of an image to put into the background of the GUI canvas. The image must +be a color PPM image, in binary (not ASCII) format. It can be any size, and will be +automatically scaled to fit the canvas. +@end ftable +@c ./../src/hid/gtk/gui-top-window.c 1627 +@ftable @code +@item --pcb-menu +Location of the @file{gpcb-menu.res} file which defines the menu for the GTK+ GUI. +@end ftable +@c options lesstif GUI Options +@node lesstif GUI Options +@section lesstif GUI Options +@c ./../src/hid/lesstif/main.c 201 +@ftable @code +@item --listen +Listen for actions on stdin. +@end ftable +@c ./../src/hid/lesstif/main.c 207 +@ftable @code +@item --bg-image +File name of an image to put into the background of the GUI canvas. The image must +be a color PPM image, in binary (not ASCII) format. It can be any size, and will be +automatically scaled to fit the canvas. +@end ftable +@c ./../src/hid/lesstif/main.c 213 +@ftable @code +@item --pcb-menu +Location of the @file{pcb-menu.res} file which defines the menu for the lesstif GUI. +@end ftable +@c options Colors +@node Colors +@section Colors +@c ./../src/main.c 473 +@ftable @code +@item --black-color +Color value for black. Default: @samp{#000000} +@end ftable +@c ./../src/main.c 477 +@ftable @code +@item --black-color +Color value for white. Default: @samp{#ffffff} +@end ftable +@c ./../src/main.c 481 +@ftable @code +@item --background-color +Background color of the canvas. Default: @samp{#e5e5e5} +@end ftable +@c ./../src/main.c 486 +@ftable @code +@item --crosshair-color +Color of the crosshair. Default: @samp{#ff0000} +@end ftable +@c ./../src/main.c 491 +@ftable @code +@item --cross-color +Color of the cross. Default: @samp{#cdcd00} +@end ftable +@c ./../src/main.c 495 +@ftable @code +@item --via-color +Color of vias. Default: @samp{#7f7f7f} +@end ftable +@c ./../src/main.c 499 +@ftable @code +@item --via-selected-color +Color of selected vias. Default: @samp{#00ffff} +@end ftable +@c ./../src/main.c 504 +@ftable @code +@item --pin-color +Color of pins. Default: @samp{#4d4d4d} +@end ftable +@c ./../src/main.c 508 +@ftable @code +@item --pin-selected-color +Color of selected pins. Default: @samp{#00ffff} +@end ftable +@c ./../src/main.c 513 +@ftable @code +@item --pin-name-color +Color of pin names and pin numbers. Default: @samp{#ff0000} +@end ftable +@c ./../src/main.c 518 +@ftable @code +@item --element-color +Color of components. Default: @samp{#000000} +@end ftable +@c ./../src/main.c 522 +@ftable @code +@item --rat-color +Color of ratlines. Default: @samp{#b8860b} +@end ftable +@c ./../src/main.c 526 +@ftable @code +@item --invisible-objects-color +Color of invisible objects. Default: @samp{#cccccc} +@end ftable +@c ./../src/main.c 531 +@ftable @code +@item --invisible-mark-color +Color of invisible marks. Default: @samp{#cccccc} +@end ftable +@c ./../src/main.c 536 +@ftable @code +@item --element-selected-color +Color of selected components. Default: @samp{#00ffff} +@end ftable +@c ./../src/main.c 541 +@ftable @code +@item --rat-selected-color +Color of selected rats. Default: @samp{#00ffff} +@end ftable +@c ./../src/main.c 546 +@ftable @code +@item --connected-color +Color to indicate connections. Default: @samp{#00ff00} +@end ftable +@c ./../src/main.c 551 +@ftable @code +@item --off-limit-color +Color of off-canvas area. Default: @samp{#cccccc} +@end ftable +@c ./../src/main.c 556 +@ftable @code +@item --grid-color +Color of the grid. Default: @samp{#ff0000} +@end ftable +@c ./../src/main.c 560 +@ftable @code +@item --layer-color- +Color of layer @code{}, where @code{} is an integer from 1 to 16. +@end ftable +@c ./../src/main.c 578 +@ftable @code +@item --layer-selected-color- +Color of layer @code{}, when selected. @code{} is an integer from 1 to 16. +@end ftable +@c ./../src/main.c 597 +@ftable @code +@item --warn-color +Color of offending objects during DRC. Default value is @code{"#ff8000"} +@end ftable +@c ./../src/main.c 601 +@ftable @code +@item --mask-color +Color of the mask layer. Default value is @code{"#ff0000"} +@end ftable +@c options Layer Names +@node Layer Names +@section Layer Names +@c ./../src/main.c 691 +@ftable @code +@item --layer-name-1 +Name of the 1st Layer. Default is @code{"top"}. +@end ftable +@c ./../src/main.c 695 +@ftable @code +@item --layer-name-2 +Name of the 2nd Layer. Default is @code{"ground"}. +@end ftable +@c ./../src/main.c 699 +@ftable @code +@item --layer-name-3 +Name of the 3nd Layer. Default is @code{"signal2"}. +@end ftable +@c ./../src/main.c 703 +@ftable @code +@item --layer-name-4 +Name of the 4rd Layer. Default is @code{"signal3"}. +@end ftable +@c ./../src/main.c 707 +@ftable @code +@item --layer-name-5 +Name of the 5rd Layer. Default is @code{"power"}. +@end ftable +@c ./../src/main.c 711 +@ftable @code +@item --layer-name-6 +Name of the 6rd Layer. Default is @code{"bottom"}. +@end ftable +@c ./../src/main.c 715 +@ftable @code +@item --layer-name-7 +Name of the 7rd Layer. Default is @code{"outline"}. +@end ftable +@c ./../src/main.c 719 +@ftable @code +@item --layer-name-8 +Name of the 8rd Layer. Default is @code{"spare"}. +@end ftable +@c options Paths +@node Paths +@section Paths +@c ./../src/main.c 769 +@ftable @code +@item --lib-newlib +Top level directory for the newlib style library. +@end ftable +@c ./../src/main.c 778 +@ftable @code +@item --lib-name +The default filename for the library. +@end ftable +@c ./../src/main.c 783 +@ftable @code +@item --default-font +The name of the default font. +@end ftable +@c ./../src/main.c 794 +@ftable @code +@item --file-path +A colon separated list of directories or commands (starts with '|'). The path +is passed to the program specified in @option{--file-command} together with the selected +filename. +@end ftable +@c ./../src/main.c 802 +@ftable @code +@item --font-path +A colon separated list of directories to search the default font. Defaults to +the default library path. +@end ftable +@c ./../src/main.c 812 +@ftable @code +@item --lib-path +A colon separated list of directories that will be passed to the commands specified +by @option{--element-command} and @option{--element-contents-command}. +@end ftable +@c options Sizes +@node Sizes +@section Sizes +@c ./../src/main.c 606 +All parameters should be given with an unit. If no unit is given, 1/100 mil +(cmil) will be used. Write units without space to the +number like @code{3mm}, not @code{3 mm}. +Valid Units are: + @table @samp + @item km + Kilometer + @item m + Meter + @item cm + Centimeter + @item mm + Millimeter + @item um + Micrometer + @item nm + Nanometer + @item in + Inch (1in = 0.0254m) + @item mil + Mil (1000mil = 1in) + @item cmil + Centimil (1/100 mil) +@end table + +@ftable @code +@item --via-thickness +Default diameter of vias. Default value is @code{60mil}. +@end ftable +@c ./../src/main.c 611 +@ftable @code +@item --via-drilling-hole +Default diameter of holes. Default value is @code{28mil}. +@end ftable +@c ./../src/main.c 616 +@ftable @code +@item --line-thickness +Default thickness of new lines. Default value is @code{10mil}. +@end ftable +@c ./../src/main.c 621 +@ftable @code +@item --rat-thickness +Thickness of rats. Values from 1 to 19 are fixed width in screen pixels. +Anything larger means PCB units (i.e. 100 means "1 mil"). Default value +is @code{10mil}. +@end ftable +@c ./../src/main.c 625 +@ftable @code +@item --keepaway +Default minimum distance between a track and adjacent copper. +Default value is @code{10mil}. +@end ftable +@c ./../src/main.c 629 +@ftable @code +@item --default-PCB-width +Default width of the canvas. Default value is @code{6000mil}. +@end ftable +@c ./../src/main.c 634 +@ftable @code +@item --default-PCB-height +Default height of the canvas. Default value is @code{5000mil}. +@end ftable +@c ./../src/main.c 639 +@ftable @code +@item --text-scale +Default text scale. This value is in percent. Default value is @code{100}. +@end ftable +@c ./../src/main.c 643 +@ftable @code +@item --alignment-distance +Specifies the distance between the board outline and alignment targets. +Default value is @code{2mil}. +@end ftable +@c ./../src/main.c 677 +@ftable @code +@item --grid +Initial grid size. Default value is @code{10mil}. +@end ftable +@c ./../src/main.c 681 +@ftable @code +@item --minimum polygon area +Minimum polygon area. +@end ftable +@c options Commands +@node Commands +@section Commands +@c ./../src/main.c 728 +pcb uses external commands for input output operations. These commands can be +configured at start-up to meet local requirements. The command string may include +special sequences @code{%f}, @code{%p} or @code{%a}. These are replaced when the +command is called. The sequence @code{%f} is replaced by the file name, +@code{%p} gets the path and @code{%a} indicates a package name. +@c ./../src/main.c 731 +@ftable @code +@item --font-command +Command to load a font. +@end ftable +@c ./../src/main.c 735 +@ftable @code +@item --file-command +Command to read a file. +@end ftable +@c ./../src/main.c 739 +@ftable @code +@item --element-command +Command to read a footprint. @* +Defaults to @code{"M4PATH='%p';export M4PATH;echo 'include(%f)' | m4"} +@end ftable +@c ./../src/main.c 745 +@ftable @code +@item --print-file +Command to print to a file. +@end ftable +@c ./../src/main.c 749 +@ftable @code +@item --lib-command-dir +Path to the command that queries the library. +@end ftable +@c ./../src/main.c 754 +@ftable @code +@item --lib-command +Command to query the library. @* +Defaults to @code{"QueryLibrary.sh '%p' '%f' %a"} +@end ftable +@c ./../src/main.c 759 +@ftable @code +@item --lib-contents-command +Command to query the contents of the library. @* +Defaults to @code{"ListLibraryContents.sh %p %f"} or, +on Windows builds, an empty string (to disable this feature). +@end ftable +@c ./../src/main.c 774 +@ftable @code +@item --save-command +Command to save to a file. +@end ftable +@c ./../src/main.c 798 +@ftable @code +@item --rat-command +Command for reading a netlist. Sequence @code{%f} is replaced by the netlist filename. +@end ftable +@c options DRC Options +@node DRC Options +@section DRC Options +@c ./../src/main.c 648 +All parameters should be given with an unit. If no unit is given, 1/100 mil +(cmil) will be used for backward compability. Valid units are given in section +@ref{Sizes}. +@c ./../src/main.c 652 +@ftable @code +@item --bloat +Minimum spacing. Default value is @code{10mil}. +@end ftable +@c ./../src/main.c 656 +@ftable @code +@item --shrink +Minimum touching overlap. Default value is @code{10mil}. +@end ftable +@c ./../src/main.c 660 +@ftable @code +@item --min-width +Minimum width of copper. Default value is @code{10mil}. +@end ftable +@c ./../src/main.c 664 +@ftable @code +@item --min-silk +Minimum width of lines in silk. Default value is @code{10mil}. +@end ftable +@c ./../src/main.c 668 +@ftable @code +@item --min-drill +Minimum diameter of holes. Default value is @code{15mil}. +@end ftable +@c ./../src/main.c 672 +@ftable @code +@item --min-ring +Minimum width of annular ring. Default value is @code{10mil}. +@end ftable +@c options BOM Creation +@node BOM Creation +@section BOM Creation +@c ./../src/hid/bom/bom.c 30 +@ftable @code +@item --bomfile +Name of the BOM output file. +@end ftable +@c ./../src/hid/bom/bom.c 35 +@ftable @code +@item --xyfile +Name of the XY output file. +@end ftable +@c ./../src/hid/bom/bom.c 41 +@ftable @code +@item --xy-unit +Unit of XY dimensions. Defaults to mil. +@end ftable +@c options Gerber Export +@node Gerber Export +@section Gerber Export +@c ./../src/hid/gerber/gerber.c 338 +@ftable @code +@item --gerberfile +Gerber output file prefix. Can include a path. +@end ftable +@c ./../src/hid/gerber/gerber.c 344 +@ftable @code +@item --all-layers +Output contains all layers, even empty ones. +@end ftable +@c ./../src/hid/gerber/gerber.c 350 +@ftable @code +@item --verbose +Print file names and aperture counts on stdout. +@end ftable +@c options Postscript Export +@node Postscript Export +@section Postscript Export +@c ./../src/hid/ps/ps.c 149 +@ftable @code +@item --psfile +Name of the postscript output file. Can contain a path. +@end ftable +@c ./../src/hid/ps/ps.c 155 +@ftable @code +@cindex drill-helper +@item --drill-helper +Print a centering target in large drill holes. +@end ftable +@c ./../src/hid/ps/ps.c 161 +@ftable @code +@cindex align-marks +@item --align-marks +Print alignment marks on each sheet. This is meant to ease alignment during exposure. +@end ftable +@c ./../src/hid/ps/ps.c 167 +@ftable @code +@item --outline +Print the contents of the outline layer on each sheet. +@end ftable +@c ./../src/hid/ps/ps.c 172 +@ftable @code +@item --mirror +Print mirror image. +@end ftable +@c ./../src/hid/ps/ps.c 178 +@ftable @code +@item --fill-page +Scale output to make the board fit the page. +@end ftable +@c ./../src/hid/ps/ps.c 184 +@ftable @code +@item --auto-mirror +Print mirror image of appropriate layers. +@end ftable +@c ./../src/hid/ps/ps.c 190 +@ftable @code +@item --ps-color +Postscript output in color. +@end ftable +@c ./../src/hid/ps/ps.c 196 +@ftable @code +@cindex ps-bloat +@item --ps-bloat +Amount to add to trace/pad/pin edges. +@end ftable +@c ./../src/hid/ps/ps.c 202 +@ftable @code +@cindex ps-invert +@item --ps-invert +Draw objects as white-on-black. +@end ftable +@c ./../src/hid/ps/ps.c 208 +@ftable @code +@item --media +Size of the media, the postscript is fitted to. The parameter +@code{} can be any of the standard names for paper size: @samp{A0} +to @samp{A10}, @samp{B0} to @samp{B10}, @samp{Letter}, @samp{11x17}, +@samp{Ledger}, @samp{Legal}, @samp{Executive}, @samp{A-Size}, @samp{B-size}, +@samp{C-Size}, @samp{D-size}, @samp{E-size}, @samp{US-Business_Card}, +@samp{Intl-Business_Card}. +@end ftable +@c ./../src/hid/ps/ps.c 214 +@ftable @code +@cindex psfade +@item --psfade +Fade amount for assembly drawings (0.0=missing, 1.0=solid). +@end ftable +@c ./../src/hid/ps/ps.c 220 +@ftable @code +@item --scale +Scale value to compensate for printer sizing errors (1.0 = full scale). +@end ftable +@c ./../src/hid/ps/ps.c 226 +@ftable @code +@cindex multi-file +@item --multi-file +Produce multiple files, one per page, instead of a single multi page file. +@end ftable +@c ./../src/hid/ps/ps.c 232 +@ftable @code +@item --xcalib +Paper width. Used for x-Axis calibration. +@end ftable +@c ./../src/hid/ps/ps.c 238 +@ftable @code +@item --ycalib +Paper height. Used for y-Axis calibration. +@end ftable +@c ./../src/hid/ps/ps.c 244 +@ftable @code +@item --drill-copper +Draw drill holes in pins / vias, instead of leaving solid copper. +@end ftable +@c ./../src/hid/ps/ps.c 250 +@ftable @code +@cindex show-legend +@item --show-legend +Print file name and scale on printout. +@end ftable +@c options Encapsulated Postscript Export +@node Encapsulated Postscript Export +@section Encapsulated Postscript Export +@c ./../src/hid/ps/eps.c 78 +@ftable @code +@item --eps-file +Name of the encapsulated postscript output file. Can contain a path. +@end ftable +@c ./../src/hid/ps/eps.c 84 +@ftable @code +@item --eps-scale +Scale EPS output by the parameter @samp{num}. +@end ftable +@c ./../src/hid/ps/eps.c 90 +@ftable @code +@cindex as-shown (EPS) +@item --as-shown +Export layers as shown on screen. +@end ftable +@c ./../src/hid/ps/eps.c 96 +@ftable @code +@item --monochrome +Convert output to monochrome. +@end ftable +@c ./../src/hid/ps/eps.c 102 +@ftable @code +@cindex only-visible +@item --only-visible +Limit the bounds of the EPS file to the visible items. +@end ftable +@c options PNG Options +@node PNG Options +@section PNG Options +@c ./../src/hid/png/png.c 168 +@ftable @code +@item --outfile +Name of the file to be exported to. Can contain a path. +@end ftable +@c ./../src/hid/png/png.c 174 +@ftable @code +@item --dpi +Scale factor in pixels/inch. Set to 0 to scale to size specified in the layout. +@end ftable +@c ./../src/hid/png/png.c 180 +@ftable @code +@item --x-max +Width of the png image in pixels. No constraint, when set to 0. +@end ftable +@c ./../src/hid/png/png.c 186 +@ftable @code +@item --y-max +Height of the png output in pixels. No constraint, when set to 0. +@end ftable +@c ./../src/hid/png/png.c 192 +@ftable @code +@item --xy-max +Maximum width and height of the PNG output in pixels. No constraint, when set to 0. +@end ftable +@c ./../src/hid/png/png.c 198 +@ftable @code +@item --as-shown +Export layers as shown on screen. +@end ftable +@c ./../src/hid/png/png.c 204 +@ftable @code +@item --monochrome +Convert output to monochrome. +@end ftable +@c ./../src/hid/png/png.c 210 +@ftable @code +@item --only-vivible +Limit the bounds of the exported PNG image to the visible items. +@end ftable +@c ./../src/hid/png/png.c 216 +@ftable @code +@item --use-alpha +Make the background and any holes transparent. +@end ftable +@c ./../src/hid/png/png.c 222 +@ftable @code +@item --format +File format to be exported. Parameter @code{} can be @samp{PNG}, +@samp{GIF}, or @samp{JPEG}. +@end ftable +@c ./../src/hid/png/png.c 228 +@ftable @code +@item --png-bloat +Amount of extra thickness to add to traces, pads, or pin edges. The parameter +@samp{} is a number, appended by a dimension @samp{mm}, @samp{mil}, or +@samp{pix}. If no dimension is given, the default dimension is 1/100 mil. +@end ftable +@c ./../src/hid/png/png.c 234 +@ftable @code +@cindex photo-mode +@item --photo-mode +Export a photo realistic image of the layout. +@end ftable +@c ./../src/hid/png/png.c 240 +@ftable @code +@item --photo-flip-x +In photo-realistic mode, export the reverse side of the layout. Left-right flip. +@end ftable +@c ./../src/hid/png/png.c 246 +@ftable @code +@item --photo-flip-y +In photo-realistic mode, export the reverse side of the layout. Up-down flip. +@end ftable +@c options lpr Printing Options +@node lpr Printing Options +@section lpr Printing Options +@c ./../src/hid/lpr/lpr.c 33 +@ftable @code +@item --lprcommand +Command to use for printing. Defaults to @code{lpr}. This can be used to produce +PDF output with a virtual PDF printer. Example: @* +@code{--lprcommand "lp -d CUPS-PDF-Printer"}. +@end ftable +@noindent In addition, all @ref{Postscript Export} options are valid. +@c options nelma Options +@node nelma Options +@section nelma Options +@c ./../src/hid/nelma/nelma.c 157 +@ftable @code +@item -- basename +File name prefix. +@end ftable +@c ./../src/hid/nelma/nelma.c 163 +@ftable @code +@item --dpi +Horizontal scale factor (grid points/inch). +@end ftable +@c ./../src/hid/nelma/nelma.c 169 +@ftable @code +@item --copper-height +Copper layer height (um). +@end ftable +@c ./../src/hid/nelma/nelma.c 175 +@ftable @code +@item --substrate-height +Substrate layer height (um). +@end ftable +@c ./../src/hid/nelma/nelma.c 181 +@ftable @code +@item --substrate-epsilon +Substrate relative epsilon. +@end ftable Index: tags/1.0.5/doc/pad.pcb =================================================================== --- tags/1.0.5/doc/pad.pcb (nonexistent) +++ tags/1.0.5/doc/pad.pcb (revision 953) @@ -0,0 +1,911 @@ +# release: pcb-bin 1.99q + +PCB["pad" 600000 500000] + +Grid[2000.00000000 0 0 1] +Cursor[88600 72400 2.000000] +Thermal[0.500000] +DRC[699 400 800 800 1000 750] +Flags(0x0000000000000840) +Groups("1,s:2,c:3:4:5:6:7:8") +Styles["Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,200,2402,1181,600"] + +Symbol[' ' 1800] +( +) +Symbol['!' 1200] +( + SymbolLine[0 4500 0 5000 800] + SymbolLine[0 1000 0 3500 800] +) +Symbol['"' 1200] +( + SymbolLine[0 1000 0 2000 800] + SymbolLine[1000 1000 1000 2000 800] +) +Symbol['#' 1200] +( + SymbolLine[0 3500 2000 3500 800] + SymbolLine[0 2500 2000 2500 800] + SymbolLine[1500 2000 1500 4000 800] + SymbolLine[500 2000 500 4000 800] +) +Symbol['$' 1200] +( + SymbolLine[1500 1500 2000 2000 800] + SymbolLine[500 1500 1500 1500 800] + SymbolLine[0 2000 500 1500 800] + SymbolLine[0 2000 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4000 800] + SymbolLine[1500 4500 2000 4000 800] + SymbolLine[500 4500 1500 4500 800] + SymbolLine[0 4000 500 4500 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['%' 1200] +( + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[1000 2500 1500 2000 800] + SymbolLine[500 2500 1000 2500 800] + SymbolLine[0 2000 500 2500 800] + SymbolLine[0 5000 4000 1000 800] + SymbolLine[3500 5000 4000 4500 800] + SymbolLine[4000 4000 4000 4500 800] + SymbolLine[3500 3500 4000 4000 800] + SymbolLine[3000 3500 3500 3500 800] + SymbolLine[2500 4000 3000 3500 800] + SymbolLine[2500 4000 2500 4500 800] + SymbolLine[2500 4500 3000 5000 800] + SymbolLine[3000 5000 3500 5000 800] +) +Symbol['&' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 3500 1500 2000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[0 2500 2500 5000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[0 3500 0 4500 800] +) +Symbol[''' 1200] +( + SymbolLine[0 2000 1000 1000 800] +) +Symbol['(' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] +) +Symbol[')' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['*' 1200] +( + SymbolLine[0 2000 2000 4000 800] + SymbolLine[0 4000 2000 2000 800] + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol['+' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol[',' 1200] +( + SymbolLine[0 6000 1000 5000 800] +) +Symbol['-' 1200] +( + SymbolLine[0 3000 2000 3000 800] +) +Symbol['.' 1200] +( + SymbolLine[0 5000 500 5000 800] +) +Symbol['/' 1200] +( + SymbolLine[0 4500 3000 1500 800] +) +Symbol['0' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4000 2000 2000 800] +) +Symbol['1' 1200] +( + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1000 1000 1000 5000 800] + SymbolLine[0 2000 1000 1000 800] +) +Symbol['2' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[0 5000 2500 2500 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['3' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol['4' 1200] +( + SymbolLine[0 3000 2000 1000 800] + SymbolLine[0 3000 2500 3000 800] + SymbolLine[2000 1000 2000 5000 800] +) +Symbol['5' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 1000 0 3000 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[500 2500 1500 2500 800] + SymbolLine[1500 2500 2000 3000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['6' 1200] +( + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[0 3000 1500 3000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3500 2000 4500 800] +) +Symbol['7' 1200] +( + SymbolLine[0 5000 2500 2500 800] + SymbolLine[2500 1000 2500 2500 800] + SymbolLine[0 1000 2500 1000 800] +) +Symbol['8' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2500 800] + SymbolLine[1500 3000 2000 2500 800] +) +Symbol['9' 1200] +( + SymbolLine[0 5000 2000 3000 800] + SymbolLine[2000 1500 2000 3000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol[':' 1200] +( + SymbolLine[0 2500 500 2500 800] + SymbolLine[0 3500 500 3500 800] +) +Symbol[';' 1200] +( + SymbolLine[0 5000 1000 4000 800] + SymbolLine[1000 2500 1000 3000 800] +) +Symbol['<' 1200] +( + SymbolLine[0 3000 1000 2000 800] + SymbolLine[0 3000 1000 4000 800] +) +Symbol['=' 1200] +( + SymbolLine[0 2500 2000 2500 800] + SymbolLine[0 3500 2000 3500 800] +) +Symbol['>' 1200] +( + SymbolLine[0 2000 1000 3000 800] + SymbolLine[0 4000 1000 3000 800] +) +Symbol['?' 1200] +( + SymbolLine[1000 3000 1000 3500 800] + SymbolLine[1000 4500 1000 5000 800] + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2000 800] + SymbolLine[1000 3000 2000 2000 800] +) +Symbol['@' 1200] +( + SymbolLine[0 1000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 4000 5000 800] + SymbolLine[5000 3500 5000 1000 800] + SymbolLine[5000 1000 4000 0 800] + SymbolLine[4000 0 1000 0 800] + SymbolLine[1000 0 0 1000 800] + SymbolLine[1500 2000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 3000 3500 800] + SymbolLine[3000 3500 3500 3000 800] + SymbolLine[3500 3000 4000 3500 800] + SymbolLine[3500 3000 3500 1500 800] + SymbolLine[3500 2000 3000 1500 800] + SymbolLine[2000 1500 3000 1500 800] + SymbolLine[2000 1500 1500 2000 800] + SymbolLine[4000 3500 5000 3500 800] +) +Symbol['A' 1200] +( + SymbolLine[0 1500 0 5000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['B' 1200] +( + SymbolLine[0 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] +) +Symbol['C' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] +) +Symbol['D' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[0 5000 2000 5000 800] + SymbolLine[0 1000 2000 1000 800] +) +Symbol['E' 1200] +( + SymbolLine[0 3000 1500 3000 800] + SymbolLine[0 5000 2000 5000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] +) +Symbol['F' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 3000 1500 3000 800] +) +Symbol['G' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[1000 3000 2000 3000 800] +) +Symbol['H' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[2500 1000 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['I' 1200] +( + SymbolLine[0 1000 1000 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 1000 5000 800] +) +Symbol['J' 1200] +( + SymbolLine[0 1000 1500 1000 800] + SymbolLine[1500 1000 1500 4500 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['K' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3000 2000 1000 800] + SymbolLine[0 3000 2000 5000 800] +) +Symbol['L' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['M' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 1500 2500 800] + SymbolLine[1500 2500 3000 1000 800] + SymbolLine[3000 1000 3000 5000 800] +) +Symbol['N' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 2500 4000 800] + SymbolLine[2500 1000 2500 5000 800] +) +Symbol['O' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['P' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol['Q' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1000 4000 2000 5000 800] +) +Symbol['R' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[500 3000 2500 5000 800] +) +Symbol['S' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['T' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['U' 1200] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 1000 2000 4500 800] +) +Symbol['V' 1200] +( + SymbolLine[0 1000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[2000 1000 2000 4000 800] +) +Symbol['W' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 1500 3500 800] + SymbolLine[1500 3500 3000 5000 800] + SymbolLine[3000 1000 3000 5000 800] +) +Symbol['X' 1200] +( + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 2500 4000 800] + SymbolLine[2500 4000 2500 5000 800] + SymbolLine[0 4000 0 5000 800] + SymbolLine[0 4000 2500 1500 800] + SymbolLine[2500 1000 2500 1500 800] +) +Symbol['Y' 1200] +( + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 1000 2500 800] + SymbolLine[1000 2500 2000 1500 800] + SymbolLine[2000 1000 2000 1500 800] + SymbolLine[1000 2500 1000 5000 800] +) +Symbol['Z' 1200] +( + SymbolLine[0 1000 2500 1000 800] + SymbolLine[2500 1000 2500 1500 800] + SymbolLine[0 4000 2500 1500 800] + SymbolLine[0 4000 0 5000 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['[' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['\' 1200] +( + SymbolLine[0 1500 3000 4500 800] +) +Symbol[']' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['^' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1500 800] +) +Symbol['_' 1200] +( + SymbolLine[0 5000 2000 5000 800] +) +Symbol['a' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[2000 4500 2500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['b' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] +) +Symbol['c' 1200] +( + SymbolLine[500 3000 2000 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] +) +Symbol['d' 1200] +( + SymbolLine[2000 1000 2000 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] +) +Symbol['e' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[0 4000 2000 4000 800] + SymbolLine[2000 4000 2000 3500 800] +) +Symbol['f' 1000] +( + SymbolLine[500 1500 500 5000 800] + SymbolLine[500 1500 1000 1000 800] + SymbolLine[1000 1000 1500 1000 800] + SymbolLine[0 3000 1000 3000 800] +) +Symbol['g' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[2000 3000 2000 6000 800] +) +Symbol['h' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] +) +Symbol['i' 1000] +( + SymbolLine[0 2000 0 2500 800] + SymbolLine[0 3500 0 5000 800] +) +Symbol['j' 1000] +( + SymbolLine[500 2000 500 2500 800] + SymbolLine[500 3500 500 6000 800] + SymbolLine[0 6500 500 6000 800] +) +Symbol['k' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 1500 5000 800] + SymbolLine[0 3500 1000 2500 800] +) +Symbol['l' 1000] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['m' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[2000 3500 2500 3000 800] + SymbolLine[2500 3000 3000 3000 800] + SymbolLine[3000 3000 3500 3500 800] + SymbolLine[3500 3500 3500 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['n' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['o' 1200] +( + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['p' 1200] +( + SymbolLine[500 3500 500 6500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[1000 5000 2000 5000 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['q' 1200] +( + SymbolLine[2000 3500 2000 6500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['r' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['s' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2000 4000 2500 4500 800] + SymbolLine[500 4000 2000 4000 800] + SymbolLine[0 3500 500 4000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['t' 1000] +( + SymbolLine[500 1000 500 4500 800] + SymbolLine[500 4500 1000 5000 800] + SymbolLine[0 2500 1000 2500 800] +) +Symbol['u' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3000 2000 4500 800] +) +Symbol['v' 1200] +( + SymbolLine[0 3000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[2000 3000 2000 4000 800] +) +Symbol['w' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[1500 3000 1500 4500 800] + SymbolLine[1500 4500 2000 5000 800] + SymbolLine[2000 5000 2500 5000 800] + SymbolLine[2500 5000 3000 4500 800] + SymbolLine[3000 3000 3000 4500 800] +) +Symbol['x' 1200] +( + SymbolLine[0 3000 2000 5000 800] + SymbolLine[0 5000 2000 3000 800] +) +Symbol['y' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 6000 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['z' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[0 5000 2000 3000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['{' 1200] +( + SymbolLine[500 1500 1000 1000 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['|' 1200] +( + SymbolLine[0 1000 0 5000 800] +) +Symbol['}' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[500 2500 1000 3000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['~' 1200] +( + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1000 3000 800] + SymbolLine[1000 3000 1500 3500 800] + SymbolLine[1500 3500 2000 3500 800] + SymbolLine[2000 3500 2500 3000 800] +) +Layer(1 "component") +( + Line[106000 144000 262000 144000 1000 2000 "clearline"] + Line[106000 144000 106000 84000 1000 2000 "clearline"] + Line[106000 84000 262000 84000 1000 2000 "clearline"] + Line[262000 84000 262000 144000 1000 2000 "clearline"] +) +Layer(2 "solder") +( + Line[256000 90000 256000 138000 1000 2000 "clearline"] + Line[112000 138000 112000 90000 1000 2000 "clearline"] + Line[112000 90000 256000 90000 1000 2000 "clearline"] + Line[112000 138000 256000 138000 1000 2000 "clearline"] +) +Layer(3 "GND") +( +) +Layer(4 "power") +( +) +Layer(5 "signal1") +( + Polygon("clearpoly") + ( + [118000 96000] [250000 96000] [250000 132000] [118000 132000] + ) +) +Layer(6 "signal2") +( +) +Layer(7 "unused") +( +) +Layer(8 "unused") +( +) +Layer(9 "silk") +( +) +Layer(10 "silk") +( + Line[118000 96000 118000 132000 500 2000 "clearline"] + Line[118000 132000 154000 132000 500 2000 "clearline"] + Line[154000 132000 154000 96000 500 2000 "clearline"] + Line[154000 96000 118000 96000 500 2000 "clearline"] + Line[136000 152000 136000 120000 500 1200 "clearline"] + Line[136000 120000 132000 124000 500 1200 "clearline"] + Line[132000 114000 140000 114000 1010 1200 "clearline"] + Line[140000 124000 136000 120000 500 1200 "clearline"] + Line[98000 90000 94000 94000 500 1200 "clearline"] + Line[214000 76000 250000 76000 500 1200 "clearline"] + Line[98000 138000 98000 90000 500 1200 "clearline"] + Line[270000 96000 266000 100000 500 1200 "clearline"] + Line[136000 110000 136000 118000 1010 1200 "clearline"] + Line[214000 96000 214000 132000 500 2000 "clearline"] + Line[252000 132000 276000 132000 500 1200 "clearline"] + Line[218000 72000 214000 76000 500 1200 "clearline"] + Line[214000 76000 218000 80000 500 1200 "clearline"] + Line[270000 96000 274000 100000 500 1200 "clearline"] + Line[252000 96000 276000 96000 500 1200 "clearline"] + Line[214000 132000 250000 132000 500 2000 "clearline"] + Line[136000 90000 140000 86000 500 1200 "clearline"] + Line[232000 150000 232000 120000 500 1200 "clearline"] + Line[236000 124000 232000 120000 500 1200 "clearline"] + Line[232000 110000 232000 118000 1010 1200 "clearline"] + Line[232000 120000 228000 124000 500 1200 "clearline"] + Line[204000 114000 212000 114000 500 1200 "clearline"] + Line[212000 114000 208000 110000 500 1200 "clearline"] + Line[212000 114000 208000 118000 500 1200 "clearline"] + Line[214000 94000 214000 70000 500 1200 "clearline"] + Line[250000 94000 250000 70000 500 1200 "clearline"] + Line[204000 114000 204000 48000 500 1200 "clearline"] + Line[136000 90000 132000 86000 500 1200 "clearline"] + Line[270000 132000 266000 128000 500 1200 "clearline"] + Line[250000 132000 250000 96000 500 2000 "clearline"] + Line[250000 96000 214000 96000 500 2000 "clearline"] + Line[160000 90000 112000 90000 500 2000 "clearline"] + Line[160000 138000 112000 138000 500 2000 "clearline"] + Line[112000 90000 112000 138000 500 2000 "clearline"] + Line[160000 90000 160000 138000 500 2000 "clearline"] + Line[136000 74000 136000 90000 500 1200 "clearline"] + Line[270000 132000 274000 128000 500 1200 "clearline"] + Line[228000 114000 236000 114000 1010 1200 "clearline"] + Line[270000 132000 270000 96000 500 1200 "clearline"] + Line[250000 76000 246000 72000 500 1200 "clearline"] + Line[250000 76000 246000 80000 500 1200 "clearline"] + Line[92000 90000 110000 90000 500 1200 "clearline"] + Line[186000 96000 190000 92000 500 1200 "clearline"] + Line[186000 96000 182000 92000 500 1200 "clearline"] + Line[186000 64000 186000 96000 500 1200 "clearline"] + Line[98000 138000 94000 134000 500 1200 "clearline"] + Line[98000 138000 102000 134000 500 1200 "clearline"] + Line[98000 90000 102000 94000 500 1200 "clearline"] + Line[92000 138000 110000 138000 500 1200 "clearline"] + Line[214000 138000 210000 142000 500 1200 "clearline"] + Line[218000 142000 214000 138000 500 1200 "clearline"] + Line[214000 168000 214000 138000 500 1200 "clearline"] + Line[192000 144000 188000 148000 500 1200 "clearline"] + Line[196000 148000 192000 144000 500 1200 "clearline"] + Line[192000 184000 192000 144000 500 1200 "clearline"] + Line[168000 144000 164000 148000 500 1200 "clearline"] + Line[172000 148000 168000 144000 500 1200 "clearline"] + Line[168000 176000 168000 144000 500 1200 "clearline"] + Line[168000 132000 172000 128000 500 1200 "clearline"] + Line[168000 132000 164000 128000 500 1200 "clearline"] + Line[168000 120000 168000 132000 500 1200 "clearline"] + Text[106000 152000 0 200 "(X0,Y0)" ""] + Text[224000 150000 0 200 "(X1,Y1)" ""] + Text[226000 72000 1 200 "SIZE" ""] + Text[41000 106000 0 200 "Mask Size" ""] + Text[56000 62000 0 200 "Mask Aperture" ""] + Text[130000 52000 0 200 "Pad Shape" ""] + Text[272000 110000 0 200 "SIZE" ""] + Text[132000 36000 0 200 "Pad Aperture" ""] + Text[210000 168000 0 200 "Soldermask Opening" ""] + Text[188000 186000 0 200 "Clearance to non-connecting" ""] + Text[188000 198000 0 200 "polygons" ""] + Text[102000 176000 0 200 "Clearance/2" ""] +) Index: tags/1.0.5/doc/pad.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/pad.pdf =================================================================== --- tags/1.0.5/doc/pad.pdf (nonexistent) +++ tags/1.0.5/doc/pad.pdf (revision 953) Property changes on: tags/1.0.5/doc/pad.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/pad.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/pad.png =================================================================== --- tags/1.0.5/doc/pad.png (nonexistent) +++ tags/1.0.5/doc/pad.png (revision 953) Property changes on: tags/1.0.5/doc/pad.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/pcb.1 =================================================================== --- tags/1.0.5/doc/pcb.1 (nonexistent) +++ tags/1.0.5/doc/pcb.1 (revision 953) @@ -0,0 +1,45 @@ +.\" +.\" 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. +.\" + +.TH PCB 1 + +.SH NAME +.B pcb +\- Printed circuit board layout tool + +.SH SYNOPSIS +.B pcb [options] [pcb file] + +.SH DESCRIPTION +The +.B pcb +program is a tool for the layout of printed circuit boards. +The complete manual for +.B pcb +is provided in a GNU texinfo format as well as HTML and PDF. +The texinfo version of the manual is typically viewed with the +.B info +program or alternatively with +.B emacs +or a graphical info viewer such as +.B tkinfo. +The PDF and HTML documentation is typically installed as +/usr/local/share/pcb/pcb.html and /usr/local/share/pcb/pcb.pdf. +The prefix "/usr/local" may vary at your site. + + + + Index: tags/1.0.5/doc/pcb.css =================================================================== --- tags/1.0.5/doc/pcb.css (nonexistent) +++ tags/1.0.5/doc/pcb.css (revision 953) @@ -0,0 +1,11 @@ +table.cartouche { + border-collapse: collapse; + border: 1px solid #800000; + width: 100%; +} +table.cartouche td { + padding: 4px; +} +pre.format { + font-family: monospace; +} Index: tags/1.0.5/doc/pcb.html =================================================================== --- tags/1.0.5/doc/pcb.html (nonexistent) +++ tags/1.0.5/doc/pcb.html (revision 953) @@ -0,0 +1,13072 @@ + + +Pcb + + + + + + + + + +

Pcb

+
+ +


+Next: , +Up: (dir) + +
+ +

Pcb

+ +

This document is a manual for Pcb, the open source, interactive printed circuit +board layout system. + +

+ + +
+ +


+Next: , +Previous: Top, +Up: Top + +
+ +

Copying

+ +

Copyright © 1994,1995,1996,1997 Thomas Nau + +

Copyright © 1998,1999,2000,2001,2002 harry eaton + +

This program is free software; you may 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 +MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + + +

+ +


+Next: , +Previous: Copying, +Up: Top + +
+ +

History

+ +

Pcb is a handy tool for laying out printed circuit +boards. + +

Pcb was first written by Thomas Nau for an Atari ST in 1990 and +ported to UNIX and X11 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. + +

The second release 1.2 included menus for the first time. This made +Pcb easier to use and thus a more important tool. + +

Release 1.3 introduced undo for highly-destructive commands, +more straightforward action handling and scalable fonts. Layer-groups +were introduced to group signal-layers together. + +

Release 1.4 provided support for add-on device drivers. +Two layers (the solder and the component side) +were added to support SMD elements. The handling of libraries +was also improved in 1.4.1. Support for additional devices like +GERBER plotters started in 1.4.4. The undo feature was expanded +and the redo-feature added in 1.4.5. + +

harry eaton took over pcb development beginning with Release 1.5, +although he contributed some code beginning with Release 1.4.3 + +

Release 1.5 provides support for rats-nest generation from simple net +lists. It also allows for automatic clearances around pins that pierce +a polygon. A variety of other enhancements including a Gerber RS-274X +driver and NC drill file generation have also been added. + +

Release 1.6 provides automatic screen updates of changed regions. +This should eliminate most of the need for the redraw ((R key). +Also some changes to what order items under the cursor are selected +were made for better consistency - it is no longer possible to +accidentally move a line or line point that is completely obscured +by a polygon laying over top of it. Larger objects on the upper +most layers can be selected ahead of smaller objects on lower layers. +These changes make operations more intuitive. A new mode of line +creation was added that creates two line on 45 degree angles +with a single click. The actual outline of the prospective line(s) are +now shown during line creation. An arc creation mode was added. +Drawn arcs are quarter circles and can be useful for high frequency +controlled impedance lines. (You can have eighth circle arc if the +source is compiled with -DARC45, but be aware that the ends of such +arcs can never intersect a grid point). Two new flags for pins and +vias were created - one indicates that the pin or via is purely a +drill hole and has no copper annulus. You can only toggle this flag +for vias - for elements, it must be an integral part of the element +definition. The other flag controls whether the pad will be round +or octagonal. There is also now a feature for converting the contents +of a buffer into an element. + +

Release 1.6.1 added the ability to make groups of action commands bound to +a single X11 event to be undone by a single undo. Also a simple design rule +checker was added - it checks for minimum spacing and overlap rules. Plus +many fixes for bugs introduced with the many changes of 1.6 + +

Release 1.7 added support for routing tracks through polygons without touching +them. It also added support for unplated drill files, and drawing directly +on the silk layer. A Netlist window for easily working with netlist was also added. + +

Release 2.0 adds an auto-router, a new simpler library mechanism, much improved +support for graphically creating (and editing) elements, viewable solder-mask +layers (and editing), snap to pins and pads, netlist entry by drawing rats, element +files (and libraries) that can contain whole sub-layouts, metric grids, improved +user interface, a GNU autoconf/automake based build system, and a host +of other improvements. + +

Special thanks goes to: +

     Thomas Nau (who started the project and wrote the early versions).
+     C. Scott Ananian (who wrote the auto-router code).
+     Bernhard Daeubler (Bernhard.Daeubler@physik.uni-ulm.de)
+     Harald Daeubler (Harald.Daeubler@physik.uni-ulm.de)
+     DJ Delorie (djdelorie@users.sourceforge.net)
+     Larry Doolittle (ldoolitt@recycle.lbl.gov)
+     Dan McMahill (danmc@users.sourceforge.net)
+     Roland Merk (merk@faw.uni-ulm.de)
+     Erland Unruh (Erland.Unruh@malmo.trab.se)
+     Albert John FitzPatrick III (ajf_nylorac@acm.org)
+     Boerge Strand (borges@ifi.uio.no)
+     Andre M. Hedrick (hedrick@Astro.Dyer.Vanderbilt.Edu)
+
+

who provided all sorts of help including porting Pcb to +several operating systems and platforms, bug fixes, library enhancement, +user interface suggestions and more. In addition to these people, +many others donated time for bug-fixing and +other important work. Some of them can be identified in the source code +files. Thanks to all of them. If you feel left out of this list, I +apologize; please send me an e-mail and I'll try to correct the omission. + + +

+ +


+Next: , +Previous: History, +Up: Top + +
+ +

1 Overview

+ +

+Pcb is an open source printed circuit board editor. +Pcb includes many professional features such as: +

    +
  • Up to 16 copper layer designs by default. By changing a compile time setting, this +can be set as high as needed. +
  • RS-274X (Gerber) output +
  • NC Drill output +
  • Centroid (X-Y) data output +
  • Postscript and Encapsulated Postscript output +
  • Autorouter +
  • Trace optimizer +
  • Rats nest +
  • Design Rule Checker (DRC) +
  • Connectivity verification +
  • Pcb is Free Software +
  • Can interoperate with free schematic capture tools such as gEDA and + xcircuit +
  • Runs under Linux, NetBSD, Solaris, and other similar operating +systems. +
  • Windows version is available +
+ + +
+ +


+Next: , +Previous: Overview, +Up: Top + +
+ +

2 Introduction

+ +

+Each layout consists of several, mostly independent, objects. This chapter +gives an overview of the object types and their relationship to each other. +For a complete description of how to use Pcb, refer to +Getting Started. +The layout is generated on-screen on a grid that can have its origin +at any desired location. +The X coordinate increases to the right, Y increases down to the bottom. +All distances and sizes in Pcb are measured in mils +(0.001 inch). One unit on the coordinate display is one mil in +distance on the board. +The grid may be set on a metric pitch, but is only correct to within +the nearest +/- 0.01 mil because Pcb stores all dimensions as +integer multiples of 1/100 of a mil or 0.00001 inch. + +

The sections in this chapter are sorted by the +order of appearance of the objects within a layout file. + +

+ +
+ +


+Next: , +Up: Intro + +
+ +

2.1 Symbols

+ +

+The top object is the layout itself. It uses a set of symbols +that resides at the first logical level. Each symbol is uniquely identified +by a seven bit ASCII code. All layout objects share the same set of +symbols. These symbols are used to form text objects on the silkscreen +and copper layers. Undefined symbols are drawn as filled rectangles. + +

Every font file is preprocessed by a user-defined command when it is loaded. +For details see ‘fontCommand’, Resources. + +

+ +


+Next: , +Previous: Symbol Objects, +Up: Intro + +
+ +

2.2 Vias

+ +

+Vias provide through-hole connectivity across all layers. +While vias look a lot like element pins, don't use vias +for adding elements to the layout, even if that seems +easier than creating a new element. The default solder-mask +will cover over vias, so you won't be able to solder to them. +Of course, you can change this so that vias also have +solder-mask cut-outs, but it is not the default. +Vias are also useful for defining arbitrary drill points such as +those used for mounting a board. Vias used in this way have +a special flag set so that they have no annular copper ring, +and also appear in the unplated drill file. Ctrl-H key over +a via switches it between being a pure-mounting hole and a regular via. +You can assign a name to a via, which is useful during the creation +of new element definitions. +Each via exists on all copper layers. (i.e. +blind and buried vias are not supported) + +

+ +


+Next: , +Previous: Via Objects, +Up: Intro + +
+ +

2.3 Elements

+ +

+Elements represent the components on a board. +Elements are loaded from ASCII coded files in a +similar manner to the layout file itself, or from the +library selector window. +An element is composed of lines and arcs on the silk-screen +layer (used to define the package outline), pins +(or pads for SMD) and three labels that define the +description, the element's layout-name (which also +appears on the silk-screen layer) and its value. You +can choose which of the names are displayed on the screen +with the Screen menu; however, the silk screen in +the printout will always show the layout-name. +Element pins are contained on the first logical level +and so reside on all layers, but the pads of surface-mount +elements reside on only the component or solder +layers. An element can have a mixture of pins, pads +(on one or both sides), and mounting holes. + +

A mark is used to position the element with +respect to the cross hair during pasting. +The mark will lie on a grid point when the element +is positioned. The mark is drawn as a small diamond +shape, but is only visible when both the silk +and pins/pads layers are visible. +All parts of an element are treated as one unit, except for +the name. +It is not possible to delete a single pin or move +only part of an element on the layout. +You can resize separate pieces of an element, +but doing so is usually a bad idea. You can move/rotate +the element name independently of the element it belongs +to. When you move an element name, a line is draw from +the cursor to the element mark so it is easy to tell +which element the name belongs to. + +

Each pin and pad has two string identifiers, one is the +"name" which is a functional description of the pin +(e.g. "clock in") and the other is the "number" of the +pin which is used to identify it in a netlist. The "number" +is usually an integer, but it can be any string. You +can edit the "name" of each pin of an element, but the +"number" is embedded in the element definition and is +determined when the new element is first created. +Pads are similar to lines on a layer but they must be oriented +either vertically or horizontally. +Pads can have either rounded or square ends. Pins +can be round, square, or octagonal. + +

Elements are supported by several special layers: silk, pins/pads and +far-side. The silk layer shows the package outline and +also holds legend text and element names. The pins/pads layer is used to toggle +whether the element's pins and pads are displayed. The far-side layer controls visibility +of objects (silkscreen and pads) that are on the far (i.e. not currently viewed) side +of the board. + +

The “oldlib” style of footprint libraries distributed with +Pcb rely upon the M4 macro processor. M4 is typically +installed under the name m4 on most unix-like operating +systems. It is recommended that you use the GNU version of M4 to +avoid limitations found in some vendor implementations. See the m4 +man page on your system for more information. +Every element file is preprocessed by a user-defined command when the file is read. +For details see ‘elementCommand’, Resources. m4, the default +value of ‘elementCommand’, allows you to create libraries for +package definitions that are shared by all elements. +The old element libraries distributed with Pcb expect m4 or an +equivalent to be the elementCommand. The new library scheme simply has +each element stored in a self-contained file, so there is no need to learn +m4 to add to the libraries. + +

Pcb can create a list of +all connections from one (or all) elements to the others or a list of +unconnected pins. +It can also verify the layout connections against a netlist file. +The element's ‘layout-name’ is the name used to identify the element +in a netlist file (see Netlist File). + +

The old libraries, or very old (pre-1.6) layout files may have +incorrect pin numbering since there was no concept of pin numbers +when they were created. Pcb uses the order of appearance of +the pin definitions in the layout or library file if it uses the +old format, but there is no guarantee that it will be correct for +these old objects. + +

Be aware that a few of the old library parts may still be incorrectly +implemented regarding pin-numbering. All of the DIL (Dual- +Inline-Pins) parts are correct and most of the others are too, +but you should verify the pin numbering +of any non-DIL part before using an old library part. +(use the ‘generate object report’ in the Info menu +to see what Pcb thinks a pin's number is) +All of the old +library names begin with a ~, so you can easily identify them. +The old libraries also may contain other sorts of errors, +including incorrect pin spacing, silkscreen overlapping solder areas, etc. +Check carefully any element in the old library before using it! +As the new library grows, the old library will be pared down to +at least remove all of the elements with errors, but this will +take time. + +

You can make your own element definitions graphically now. +Simply draw vias for the pins, lines on the solder and/or +component layers for surface-mount pads (they must be either horizontal +or vertical), +and lines and arcs on the silkscreen layer for the silkscreen +outline. You should name (N key) each via and copper line with the pin number. +Once you are happy with the geometry, select everything that is to become part of +the element, then choose ‘convert selection to element’ from the Select menu. +Afterwords you can make pin (or pad) one +square if you like, and give the element its various names. You can also give +the pins and pads their functional names. Note that the +element mark corresponds to the position you click after choosing the +conversion from the menu, so decide where the mark goes and make +sure it falls on a grid point before you request the conversion. +If the vias/lines are not named, then the pin numbering will correspond to the +order in which they were placed. + +

When you create a new element, remember that silkscreen lines +should never overlap the copper part of the +pins or pads, as this can interfere with soldering. The silkscreen +should identify the maximum extent of the element package so it +is easy to see how close elements can be placed together. + +

If you want to make an element similar to an existing one, you can +break an element into constituent pieces from the Buffer menu. +Paste the pieces to the layout, make the necessary changes, then +convert it back into an element. If the pin numbers haven't changed, +there is no need to name each via/line as they are pre-named when +the element was broken apart. When you create a new element, you +can save it to a file in order to have easy access to it the next +time you run Pcb. + +

+ +


+Next: , +Previous: Element Objects, +Up: Intro + +
+ +

2.4 Layers

+ +

+Every layout consists of several layers that can be used independently +or treated as a group. +Layer groups can be used to logically separate (and color-code) +different traces (e.g. power and signal); however, all +layers within a group reside on the same physical +copper layer of a board, so using different layers within the same +group won't provide electrical separation where they touch or overlap. +For details, see ‘layerGroups’, Resources. +Each layer is drawn in a color defined in the resource file +and identified by a name that you can change (for details +see ‘layerColor’, Resources.) +Layers are really just containers for line, arc, polygon, and text objects. The +component and solder layers contain SMD elements as well, but the +file structure doesn't reflect that fact directly. + +

Each layer group +represents a physical layer on the printed circuit board. If you want to make +a four layer board, you'll need to have at least four layer groups. +Connections between layer groups are established only through element pins and vias. +The relationship between a specific layer and the board itself is configurable from +the ‘Edit layer groups’ option in the Settings menu. +The layer groups corresponding to the physical layers: component-side +and solder-side are always defined and you must map at least one +logical layer to each, even if you plan to make a single-sided board. +You are not obligated to put tracks on either of them. +Surface mount elements always reside on either the component-side or the +solder-side layer group. When you paste an element from the buffer, +it will go onto whichever side of the board you are viewing. +You can swap which side of the board you are viewing by pressing +the Tab key, or by selecting ‘view solder side’ from the +Screen menu. +The layer groups just have a name or number associated with them - where +they are sandwiched in the board is left for you to tell the +manufacturer. + +

The silkscreen layer is special because there are actually two silkscreen +layers, one for the top (component) and one for the bottom (solder) side +of the board. Which silk layer you draw on is determined by the side of the +board that you are viewing. If you are viewing the component side, then +drawing on the silk layer draws to the component-side silk layer. + +

The netlist layer is another special layer. It shows rat's-nest lines +(i.e. guides that show how the netlist expects the element to interconnect). +If you make this the active layer, you can use the Line tool to add +entries into the netlist, or to delete connections from the netlist +window. Except for these two purposes, you should not +make the netlist layer the active layer. Usually there is no need to +do this because a separate schematic package should be used to create the +netlist. Pcb can automatically draw all of the rats from +the netlist. In some cases you may want to make a small change without +going to the trouble of modifying the schematic, which is why this +facility is provided. + +

+ +


+Next: , +Previous: Layer Objects, +Up: Intro + +
+ +

2.5 Lines

+ +

+Lines are used to draw tracks on the pc board. +When in the line mode, each Btn1 +press establishes one end of a line. +Once the second point is defined, the line is drawn +and a new line started where the first one ended. +You can abandon the new starting point in favor +of another by pressing Ctrl-Btn1, or +Btn3, but don't use Btn2. +The undo function (U key or ‘undo last operation’ +from the Edit menu) will take you back +point by point if you use it while in the line mode. + +

New lines can be restricted to 45 degree angles if desired. You can toggle this +restriction on and off while creating lines by pressing the period key. +If the 45 degree restriction is turned on, then the / (forward slash) key +can be used to cycle through three different modes of 45 degree line creation. +One mode just creates a single line forced to the nearest 45 degree vector. The next +mode creates two lines from the start to end points such that the first line leaves the +start point at a 90 degree vector, and the second line enters the end point on a 45 +degree vector. The last mode creates two lines such that the first line leaves the +start point on a 45 degree vector and arrives at the end point on a 90 degree vector. +You can temporarily swap between the last two modes by holding the Shift key down. + +

It is simple to edit a line object by breaking it into pieces (insert point mode), +moving an end point or the whole line (Arrow tool), +or changing the layer it resides on (M key moves the line under the pointer +to the active layer). +In the case when two line segments meet at exactly the same +point you can delete the intermediate point, otherwise the delete tool removes an entire line. +Feel free to experiment +since Pcb will allow you to undo and redo anything that materially affects your work. +If you switch active layers in the midst of placing lines a via will automatically be +placed, when necessary, in order to continue the connection. + +

If you draw a line inside a polygon, it will either plow through the +polygon creating a clearance, or touch the polygon. This behavior is +selectable in the Settings menu for new lines. To change the +behavior of an existing line, hit the J key with the cross hair +over the line. You can increase the size of the clearance by 2 mils on +each edge with the with the +K key. Shift-K will decrease the clearance by 2 mils. +The increment may be changed from 2 mils through the application +resource file. +The clearance can be also increased, decreased and set +by the ChangeClearSize action. + +

Lines do not need to intersect the center of a pin, pad, via, or other +line for Pcb to understand that they make electrical connection. +If the connection is too tenuous, running the design rule checker will report +that the connection may break if the line width shrinks slightly. + +

+ +


+Next: , +Previous: Line Objects, +Up: Intro + +
+ +

2.6 Arcs

+ +

+Pcb can handle arcs of any angular extent, but when you +create an arc with the Arc tool, it will +be a quarter circle (this means they always bend a right angle). Arcs are very similar +to lines otherwise. They are created on the active layer and have the same thickness +that new lines will have. The various clicks for creating lines work pretty much the +same way for creating arcs. +In order to make the arc curve in the desired direction, drag the mouse along +the tangent line from the starting position towards the end position. If the grid is +too coarse, it may not be possible to distinguish whether you've moved over then up, +or up then over, so if you can't seem to make the arc go in the direction you want, try pressing +the Shift key while drawing the arc. Decreasing the grid spacing may also help. +Alternatively you can draw the wrong arc, then +rotate and move it where you want. Like the Line tool, after an arc is drawn a new +starting point is established at the end point. + +

Whenever a starting point is established +by either the Line or Arc tools it will be retained if you switch directly between the +tools (e.g. F2 key for Lines, F8 key for Arcs. Arcs can either touch or +clear polygons just like lines do. Of course connection +searches, undo and all the other features you'd expect work with arcs too. + +

+ +


+Next: , +Previous: Arc Objects, +Up: Intro + +
+ +

2.7 Polygons

+ +

+Sometimes it's useful to fill large areas with solid copper. +The way to do this is with polygons. +Polygons can be created in either the polygon mode or the rectangle mode. +In the polygon mode, you'll have to define each corner of the polygon +with a mouse click (Btn1). When the last point is clicked +exactly on top of the starting point, the polygon is finished. +Since this can be hard to do, the Shift-P key will enter the +final point for you, closing the polygon. +If the 45 degree angle restriction is turned on +and you try to close the polygon when it is not possible, you'll get a +warning instead. If you haven't finished entering a polygon, but want to +undo one (or more) of the points that you've already defined, use the +undo command (U key). + +

With the rectangle tool, defining +the two diagonally opposite corners is sufficient, but of course the resulting +polygon is a rectangle. +Like lines, a polygon can by edited by deleting, inserting and moving the points +that define it. Pins and vias always clear through polygons without +touching them when first positioned. You must add a thermal with the thermal +tool in order to connect pins and vias to polygons. Thermals can be added and removed by +clicking Btn1 with the thermal tool over the pin or via. +The thermal tool always +places a thermal to polygons on the active layer, so if the tool doesn't +seem to work, it's probably because the polygon you want to touch is not +on the active layer. You can change the style of thermal used or make +a solid connection by holding down Shift while clicking +Btn1 with the thermal tool over the pin or via. + +

Pcb is capable of handling complex polygons, but +using a number of simpler ones improves performance of the connection tracing code. +You also must be careful not to create polygons that touch or overlap themselves. +The fabricated board may not look the way you expect if you violate this +principle. It is always ok to have two (or more) polygons touch or overlap +each other, but not for points within the same polygon to do so. + +

The great advantage to this new polygon behavior is that simple or complex ground +and/or power planes can be easily made with polygons and seen on the screen. +If you don't want this auto-clearance behavior, or you load a layout created by +an early version of Pcb, the old behavior +(shorts to all piercing pins and vias) is available. A ‘ChangeSize’ +operation (S key) toggles a polygon between the new and old polygon/pin +behavior. + +

+ +


+Next: , +Previous: Polygon Objects, +Up: Intro + +
+ +

2.8 Text

+ +

+Text objects should be used to label a layout or to put additional +information on the board. Elements have their ‘layout-name’ labels on the +silk-screen layer. If you are making a board without a silkscreen, +you can use copper text to label the elements, but you have to do +this manually. + +

Text is always horizontal when first created, but the +rotate mode can align it along 0, 90, 180 and 270 degree angles. +Text on the far side of the board will automatically appear mirror-imaged. + +

Warning: TEXT OBJECTS ON A COPPER LAYER CREATE COPPER LINES BUT THEY ARE NOT SCANNED FOR +CONNECTIONS OR TESTED FOR CREATING SHORTS VS. THE NETLIST. NEITHER ARE TEXT OBJECTS TESTED AGAINST ANY DESIGN RULES. + +

+ +


+Previous: Text Objects, +Up: Intro + +
+ +

2.9 Nets

+ +

+Layout files also contain the netlist that describes how the elements +are supposed to be interconnected. This list of connections can be +loaded from a netlist file (see Netlist File), or +entered by drawing rat-lines as described +previously. Each net has a name and routing style associated with it. +The net contains a list of all element layout-name names and +pin numbers that should +be connected to the net. Loading a netlist file will replace all +existing nets with the ones from the file. +The Netlist window provides an easy way to +browse through the net list. You can display the rat's-nest by selecting +‘optimize rats-nest’ from the Connects menu. If you move or rotate elements, +the rat's-nest will automatically follow the movements, but they won't +necessarily show the shortest paths until you optimize them again. + + +

+ +


+Next: , +Previous: Intro, +Up: Top + +
+ +

3 Getting Started

+ +

+The goal of this chapter is to give you enough information to learn how +Pcb works and how to develop your layouts to make the best use of Pcb's +features. All event translations (i.e. the buttons and keys you +press) refer to the default application resource file shipped with Pcb. +There is probably no need to change this unless your window +manager uses some of the button events itself; however, if you want +to customize the behavior of Pcb then changing the resource file +is usually the best way to do it. + +

Get yourself a printout of this chapter and User Commands, if you +haven't already done so, and follow the examples. + +

Start Pcb (the actual command will use all lower-case letters) +without any additional options. +If you get the error message: + +

         can't find default font-symbol-file 'default_font'
+
+

then the font searchpath or filename in the application resource +file is wrong. Be sure that your m4 program supports search paths. +If not, get GNU m4. +For other messages, see problems. +Another quick-start is provided by pcbtest.sh in the src +directory. If some features don't seem to work, try running pcbtest.sh, +if that works, then Pcb hasn't been installed properly. + +

+ +
+ +


+Next: , +Up: Getting Started + +
+ +

3.1 The Application Window

+ +

The main window consists of five areas: +the menu at the top, the layer control in the upper left, the tool buttons +located below the layer controls, the Layout area to the right of these, and the +status line at the bottom of the window. + +

+ + + +

3.1.1 Menus

+ +

+The menus are located at the top of the Layout area. Most, but not all, +of their functions are also available from the keyboard. Similarly, some +functions are only achievable through the keyboard or command entry. +Some menu entries such as ‘center layout’ in the Screen menu require a certain cross hair position. +In this case a prompt message will popup at the bottom of the screen +with wording similar to the following: +

     move pointer to the appropriate screen position and press a button
+
+

Any mouse button will do the job, whereas any key except the arrow (cursor) keys +will cancel the operation. If it seems like the menu hasn't done what you +expected, check to see if it is waiting for the position click. For details see Actions. + +

Pressing Btn3 in the Layout area also pops up a menu with many of the most common operations (except +when you're in the midst of drawing a line or arc). When +a choice in the Btn3 popup menu needs a cross hair position, it uses the position +where the cross hair was when Btn3 was pressed. For example, to get detailed +information on an object, place the cross hair over the object, press Btn3, then +choose ‘object report’. If you pop up the Btn3 menu but don't want to +take any of the actions, click on one of the headers in the menu. + + + +

File
This menu offers a choice of loading, saving and printing data, saving +connection information to a file or quitting the application. Most +of the entries in the File menu are self explanatory. +Selecting +‘print layout’ pops up a printer control dialog. +A selection of several device drivers is available from the printer control +dialog. Presently PostScript, encapsulated PostScript, +and GerberX are supported. The GerberX driver produces +all of the files necessary to have the board professionally manufactured. +The connection saving features in the File menu produce outputs in an +arcane format that is not too useful. They do not produce netlist +files. + +


Edit
The Edit menu provides the usual cut, copy, paste +which work on selections. To learn how to +create complex selections, see Arrow Tool. +The Edit menu also +provides access to Undo and Redo of the last operation. These +can also be accomplished with the U key and Shift-R +key. Finally, the Edit menu allows you to change the names +of: the layout, the active layer, or text objects on the layout. + +


Screen
The Screen menu supports most functions related to +the whole Layout area. There are various entries to change the grid to some popular +values, the zoom factor, and which kind of element name is displayed. +You can also re-align the grid origin and turn on and off the display +of the grid. +Before changing the grid alignment, I recommend that you zoom in as close as +possible so that you're sure the grid +points appear exactly where you want them. + +

The Screen menu also allows you to turn on and off the +visibility of the solder-mask layer. When the solder-mask layer +is made visible it obscures most of the layout, so only turn +this on when you really want to know what the solder-mask will +look like. The solder-mask that you see belongs to the +side of the board you are viewing, which can be changed with +the ‘view solder side’ option, also found in the Screen menu. +When the solder-mask is displayed, the pin and pad clearance adjustments +(see Line Objects) alter the size of mask cut-outs. + +


Sizes
The Sizes menu allows you to select a group of line thickness, via diameter, via drill +size, and clearance (keepaway) (collectively called a "routing style") to be copied to the "active" sizes. +You can also change the names given to the routing styles and adjust their values from +this menu. The "active" sizes are also adjustable from this menu. +The "active" sizes are shown in the status-line and control the initial size of new vias, +drilling holes, lines, clearances, text-objects and also the maximum dimensions of the +board layout. + +


Settings
The Settings menu controls several operating configuration +parameters. The ‘edit layer groups’ entry brings up a dialog +that allows you to change the way layers are grouped. Layer grouping +is described in Layer Objects. The ‘all-direction lines’ +entry controls +the clipping of lines to 45-degree angles. You can also control +whether moving individual objects causes the attached lines to +"rubber band" with the move or not from the Settings menu. Another +entry controls whether the starting clip angle for the two-line +mode (see Line Objects) alternates every other line. You can +also control whether element names must be unique from the Settings +menu. When unique element names are enforced, copying a new element +will automatically create a unique ‘layout-name’ name for it +provided that the name originally ended with a digit (e.g. +U7 or R6). The Settings menu allows you to control +whether the cross hair will snap to pins and pads even when they +are off-grid. Finally you can control whether new lines and +arcs touch or clear intersecting polygons from this menu. + +


Select
This menu covers most of the operations that work with selected objects. +You may either (un)select all visible objects on a layout or only the ones +which have been found by the last connection scan see + + +. +You can delete all selected objects from this menu. +Other entries in the Select menu change the sizes of selected objects. +Note that a select action only affects those objects that are +selected and have their visibility turned on in the Layer Control +panel. The Select menu also provides a means for selecting objects +by name using unix Regular Expressions. + +


Buffer
From the Buffer menu you may select one out of five +buffers to use, rotate or clear its contents or save the buffer contents +to a file. You can also use the ‘break buffer element to pieces’ entry +to de-compose an element into pieces for editing. +Note: only objects with visibility turned on are pasted to the layout. If +you have something in a buffer, then change which side of the board you +are viewing, the contents of the buffer will automatically be mirrored +for pasting on the side you are viewing. It is not necessary to clear +a buffer before cutting or copying something into it - it will automatically +be cleared first. + +


Connects
The entries available through the Connects menu allow you to find +connections from objects and to manipulate these. +You can also optimize or erase rat's nests from this menu. Finally, +the ‘auto-route all rats’ entry allows you to auto-route +all connections show by the rat's nest. The auto-router will use +any visible copper layer for routing, so turn off the visibility of any +layers you don't want it to use. The auto-router will automatically +understand and avoid any traces that are already on the board, but +it is not restricted to the grid. Finally, +the auto-router routes using the active sizes (except for nets that +have a route-style defined). Pcb always knows which tracks +were routed by the auto-router, and you can selectively remove them +without fear of changing tracks that you have manually routed +with the ‘rip-up all auto-routed tracks’ entry in the Connects +menu. The ‘design rule checker’ entry runs a check for copper +areas that are too close together, or connections that touch too +tenuously for reliable production. The DRC stops when the first +problem is encountered so after fixing a problem be sure to +run it again until no problems are found. +
          Warning: COPPER TEXT IS IGNORED BY THE DRC CHECKER.
+
+


Info
The ‘generate object report’ entry from the Info menu +provides a way to get detailed information +about an object, such as its coordinates, dimensions, etc. +You can also get a report summarizing all of the drills +used on the board with ‘generate drill summary’. Lastly, +you can get a list of all pins, pads and vias that were +found during a connection search. + +


Window
The Window menu provides a way to bring each of Pcb's +windows to the front. The Library window is used to +bring elements from the library into the paste-buffer. The +Message Log window holds the various messages that +Pcb sends to the user. The Netlist window shows +the list of connections desired. + +
+ +

Now that you're familiar with the various menus, it's time +to try some things out. From the File menu choose +‘load layout’, navigate to the tutorial folder, then +load the file ‘tut1.pcb’. + +

+ + +


+Next: , +Previous: Menu, +Up: Application Window + +
+ +

3.1.2 The Status-line and Input-field

+ +

+The status-line is located at the bottom edge of the main window. +During normal operation the status information is visible there. +When a selected menu operation requires an additional button click, the +status-line is replaced by a message telling you to position the cursor +and click. +When a text input is required, the status-line is replaced by the +Input-field which has a prompt for typing the input. + +

The status-line shows, from left to right, the side of the board that you +are viewing (Tab key changes this), the current grid values, +if new lines are restricted to 45 degrees, +which type of 45 degree line mode is active, whether rubberband move and +rotate mode is on (R), and the zoom factor. +This information is followed by the active line-width, via-size +and drilling hole, keepaway spacing, and text scaling. Last is the active buffer number and the +name of the layout. An asterisk appearing at the far left indicates that the +layout has been modified since the last save. +Note that the name of the layout is not the same +thing as the filename of the layout. +Change the grid factor to 1.0 mm from the Screen menu. Observe how the +status line shows the new grid setting. Except for the case of the metric +grid, all dimensions in the status line are in units of 0.001 inch (1 mil). + +

The input-field pops up (temporarily replacing the status-line) whenever user input +is required. Two keys are bound to the input field: the Escape key +aborts the input, Return accepts it. Let's change the name of a component +on the board to see how the input-field works. Position the cross hair over +R5, and press the N key. The input field pops-up showing the name +for you to edit. Go ahead and change the name, then hit return. Notice the name +of the element changed. Now undo the change by pressing the U key. You can +position the cross hair over the name, or the element before pressing the +N key. + +

Now select ‘realign grid’ from the Screen menu. Notice that the +status line has been replaced with an instruction to position the cursor +where you want a grid point to fall. In this case, since the cross hair +can only fall on a grid point, you must move the tip of the finger cursor +to the place where you want a grid point to appear. Do not worry that +the cross hair is not coincident with the cursor. Click Btn1 at +your chosen location. See how the grid has shifted, and the status line +has returned. + +

The present cross hair position is displayed in the upper right corner of the window. +Normally this position is an absolute coordinate, but you can anchor a marker at +the cross hair location by pressing Ctrl-M (try it now) and then the +display will read both the absolute cross hair position as well as the difference +between it and the marker. The numbers enclosed in < > are the X and Y distances +between the cross hair and the mark, while the numbers enclosed in parenthesis +are the distance and angle from the mark to the cross hair. The values displayed +are always in units of 0.001 inch (1 mil). +Pressing Ctrl-M again turns the marker off. + +

+ +

3.1.3 The Layer Controls

+ +

+The layer control panel, located in the upper left, is used to turn on +and off the display of layer groups and to select the active drawing layer. +If a layer hasn't been named, the label "(unknown)" is used as the default. +If this happens, it probably means the application resources are not installed +properly. + +

The upper buttons are used to switch layers on and off. Click +<Btn1> on one or more of them. Each click toggles the setting. +If you turn off the currently active layer, another one that is visible +will become active. If there are no others visible, you will not be +able to turn off the active layer. +When the layers are grouped, clicking on these buttons will toggle +the visibility of all layers in the same group. This is a good idea because +layers in the same group reside on the same physical layer of +the actual board. Notice that this example has 2 groups each having +3 layers, plus two other layers named ‘unused’. +Use the ‘Edit layer groups’ option in the ‘Settings’ menu to +change the layer groupings in the lesstif GUI or the ‘Preferences’ +dialog from the ‘File’ menu in the GTK+ GUI. Note that changing the +groupings can radically alter the connectivity on the board. +Grouping layers is only useful for helping you to color-code +signals in your layout. Note that grouping layers actually reduces the number +of different physical layers available for your board, so to make an eight +layer board, you cannot group any layers. + +

The far side button turns on and off the visibility of elements +(including SMD pads) on the opposite (to the side you're viewing) +board side, as well as silk screening on that side. It does not +hide the x-ray view of the other copper layers, these must be turned off +separately if desired. Use the tab key to view the entire board from the other +side. To see a view of what the back side of the board will actually look like, +make the solder layer the active layer then press tab until the status +line says "solder" on the right, then turn off the visibility of all layers +except solder, pins/pads, vias, and silk. Now turn them all back on. + +

The lowest button, named active, is used to change the active +drawing layer. Pressing <Btn1> on it pops up a menu to select which +layer should be active. +Each entry is labeled with the layer's name and drawn in its color. +The active layer is automatically made visible. The active layer is +always drawn on top of the other layers, so the ordering of layers +on the screen does not generally reflect the ordering of the manufactured +board. Only the solder, component, silkscreen, and solder-mask layers +are always drawn in their physical order. Bringing the active layer +to the top makes it easier to select and change objects on the active layer. +Try changing the active layer's name to ABC by selecting +‘edit name of active layer’ from the ‘Edit’ menu. +Changing the active layer can also be done by pressing keys +1..MAX_LAYER. + +

Turn off the visibility of the component layer. +Now make the component layer the active layer. Notice that it +automatically became visible. Try setting a few +other layers as the active layer. You should also experiment +with turning on and off each of the layers to see what happens. + +

The netlist layer is a special layer for adding connections to +the netlist by drawing rat lines. This is not the recommended +way to add to the netlist, but occasionally may be convenient. +To learn how to use the netlist layer see Net Objects. + +

+ +


+Next: , +Previous: Layer Controls, +Up: Application Window + +
+ +

3.1.4 The Tool Selectors

+ +

+The tool selector buttons reside below the layer controls. +They are used to select which layout tool to use in the drawing +area. Each tool performs its function when Btn1 is pressed. +Every tool gives the cursor a unique shape that identifies it. +The tool selector buttons themselves are icons that illustrate their function. +Each layout tool can also be selected from the keyboard: +

         F1 key       Via tool
+         F2 key       Line tool
+         F3 key       Arc tool
+         F4 key       Text tool
+         F5 key       Rectangle tool
+         F6 key       Polygon tool
+         F7 key       Buffer tool
+         F8 key       Delete tool
+         F9 key       Rotate tool
+         Insert key   Insert-point tool
+         F10 key      Thermal tool
+         F11 key      Arrow tool
+         F12 key      Lock tool
+
+

Some of the tools are very simple, such as the Via tool. Clicking +Btn1 with the Via tool creates a via at the cross hair position. +The via will have the diameter and drill sizes that are active, +as shown in the status line. +The Buffer tool is similar. With it, <Btn1> copies +the contents of the active buffer to the layout, but only +those parts that reside on visible layers are copied. +The Rotate tool allows you to rotate elements, arcs, and text objects +90 degrees counter-clockwise with each click. Holding the Shift +key down changes the Rotate tool to clockwise operation. +Anything including groups of objects +can be rotated inside a buffer using the rotate buffer menu option. + +

The Line tool is explained in detail in Line Objects. Go read +that section if you haven't already. +Activate the Line tool. Set the active layer to the solder layer. +Try drawing some lines. Use the U key to undo some of the +lines you just created. Zoom in a bit closer with the Z key. +Draw some more lines. Be sure to draw some separate lines by starting +a new anchor point with Ctrl-Btn1. Change the ‘crosshair snaps to pin/pads’ +behavior in the Settings menu. Now draw a line. Notice that +the new line points must now always be on a grid point. It might not +be able to reach some pins or pads with this setting. Increase the active line thickness +by pressing the L key. Note that the status line updates +to reflect the new active line thickness. Now draw another line. Before completing the +next line, make the component layer active by pressing the 4 key. +Now finish the line. Notice that a via was automatically placed where +you switched layers. Pcb does not do any checks to make sure that +the via could safely be placed there. Neither does it interfere with +your desire to place lines haphazardly. It is up to you to place +things properly when doing manual routing with the Line tool. + +

The Arc tool is explained in detail in Arc Objects. Its +use is very similar to the Line tool. + +

The Rectangle tool, Polygon tool and Thermal tool are explained in detail in +Polygon Objects. Go read that section. +Remember that the Thermal tool will only create and destroy thermals +to polygons on the active layer. Use the Rectangle tool to make a +small copper plane on the component layer. Now place a via in the +middle of the plane. Notice that it does not touch the plane, and +they are not electrically connected. Use the Thermal tool to make +the via connect to the plane. Thermals allow the via or pin to +be heated by a soldering iron without having to heat the entire +plane. If solid connections were made to the plane, it could be +nearly impossible to solder. Shift-click on the via with the Thermal +tool to change the style of thermal used or to make the connection +solid. Click on the via again with the Thermal tool to remove the +connection to the plane. + +

The Insert-point tool is an editing tool that allows you to add +points into lines and polygons. The +Insert-point tool enforces the 45 degree line +rule. You can force only the shorter line segment to 45 +degrees by holding the Shift key down while inserting the point. +Try adding a point into one of the lines you created. Since line +clipping is turned on, you may need to move the cross hair quite far +from the point where you first clicked on the line. Turn off the +line clipping by selecting ‘all-direction lines’ from the +Settings menu (or hit +the Period key). Now you can place an inserted point anywhere. +Try adding a point to the rectangle you made earlier. Start by clicking +somewhere along an edge of the rectangle, then move the pointer to +a new location and click again. + +

The delete-mode deletes the object beneath the cursor with each +Btn1 click. +If you click at an end-point that two lines have in common, it will replace the two lines with a single line +spanning the two remaining points. This can be used to delete an "inserted" +point in a line, restoring the previous line. Now delete one of the original corner +points of the polygon you were just playing with. To do this, place the cross hair over the +corner and click on it with the Delete tool. You could also use the Backspace key +if some other tool is active. Try deleting some of +the lines and intermediate points that you created earlier. Use undo +repeatedly to undo all the changes that you've made. Use redo +a few times to see what happens. Now add a new line. Notice that +you can no longer use redo since the layout has changed since +the last undo happened. The undo/redo tree is always pruned in this +way (i.e. it has a root, but no branches). + +

The Arrow tool is so important, it has its own section: Arrow Tool. +Go read it now. + +

The Lock tool allows you to lock objects on the layout. When an object +is locked, it can't be selected, moved, rotated, or resized. This is +useful for very large objects like ground planes, or board-outlines that +are defined as an element. With such large objects, nearly anywhere you +click with the Arrow tool will be on the large object, so it could be +hard to draw box selections. If you lock an object, the Arrow tool will +behave as if it didn't exist. You cannot unlock an object with undo. +You must click on it again with the Lock tool. If an object is locked, +previous changes to it cannot be undone either. When you lock +an object, a report message about it is popped up and will always tell +you what object it is, and that it is locked if you just locked it. +Other than noticing your inability to manipulate something, the only +way to tell an object is locked is with a report from the Info +menu. Use the Lock tool sparingly. + +

+ +


+Previous: Tool Selectors, +Up: Application Window + +
+ +

3.1.5 Layout Area

+ +

+The layout area is where you see the layout. The cursor shape depends +on the active tool when the pointer is moved into the layout area. +A cross hair follows the mouse pointer with respect to the grid setting. +Select a new grid from the Screen menu. +The new value is updated in the status line. +A different way to change the grid is +Shift<Key>g to decrease or <Key>g to increase +it, but this only works for English (integer mil) grids. +The grid setting is saved along with the data when you save a pcb layout. +For homemade layouts a value around 50 is a good setting. +The cursor can also be moved in the layout area with the cursor (arrow) keys or, for larger +distances, by pressing the Shift modifier together with a cursor key. + +

+ +


+Next: , +Previous: Application Window, +Up: Getting Started + +
+ +

3.2 Log Window

+ +

+This optional window is used to display all kind of messages including +the ones written to stderr by external commands. The main advantage +of using it is +that its contents are saved in a scrolling list until the +program exits. Disabling this feature by setting the resource +useLogWindow to false will generate popup windows to display +messages. The stderr of external commands will appear on Pcbs +stderr which normally is the parent shell. I suggest you iconify +the log window after startup for example by setting *log.iconic to +true in the resource file. If raiseLogWindow is set true, +the window will deiconify and raise itself whenever new messages are to be +displayed. + +

+ +


+Next: , +Previous: Log Window, +Up: Getting Started + +
+ +

3.3 Library Window

+ +

+The library window makes loading elements (or even partial layouts) easy. +Just click the appropriate library from the list on the left. A list +of its elements then appears on the right. Select an element +from the list by clicking on its description. Selecting an element from the +library will also automatically copy the element into +the active buffer, then invoke the Buffer tool so +you can paste it to the layout. Elements in the old library should be +taken with a grain of salt (i.e. check them carefully before +using). The old library names all begin with ~ so you can easily distinguish between +the old and new libraries. All of the elements in the new library +should be thoroughly vetted, so you +can use them with confidence. The new libraries are stored simply +as directories full of element files, so making additions to the +new library is easy since there is no need to learn m4. +For details on the old libraries, +check-out Library File and Library Contents File. For +details on the format of an element file used for the new libraries, +see Element File. + +

+ +


+Next: , +Previous: Library Window, +Up: Getting Started + +
+ +

3.4 Netlist Window

+ +

+The netlist window is very similar to the library window. On the left +is a list of all of the nets, on the right is the list of connections +belonging to the chosen net. The chosen net is highlighted in the +list and also shown on the second line of the window in red. If the +net name has a star to the left of it then it is "disabled". A disabled +net is treated as if it were not in the net list. This is useful, for +example, if you plan to use a ground plane and don't want the ground +net showing up in the rat's nest. You can enable/disable individual +nets by double-clicking the net name. If you want to enable or disable +all nets at once, there are two buttons at the top of the netlist +window for this purpose. + +

The button labeled ‘Sel Net On Layout’ +can be used to select (on the layout) everything that is connected +(or is supposed to be connected) to the net. If you click on a +connection in the connection list, it will select/deselect +the corresponding pin or pad in the layout and also center the layout +window where it is located. If you "Find" (‘lookup connection +to object’ in the Connects menu [also F key]), a pin +or pad it will also choose the net and connection in the netlist window +if it exists in the netlist. + +

If no netlist exists for the layout, then the netlist window does not +appear. You can load a netlist from a file from the File menu. The +format for netlist files is described in Netlist File. + +

+ +


+Next: , +Previous: Netlist Window, +Up: Getting Started + +
+ +

3.5 Drawing and Removing Basic Objects

+ +

+hace begging gutting here, and do a real-world tutorial example. + +

There are several ways of creating new objects: you can draw them yourself, +you can copy an existing object (or selection), or you can load an element from a file or +from the Library window. Each type of object has a particular tool for creating it. + +

The active tool can be selected from the tool selectors in the bottom +left corner or by one of the function keys listed earlier in this chapter. +Each <Btn1> press with the tool tells the application to create +or change the appropriate object or at least take +the first step to do so. Each tools causes the cursor to take +on a unique shape and also causes the corresponding +tool selector button to be highlighted. You can use either cue +to see which tool is active. + +

Insert mode provides the capability of inserting new points into existing +polygons or lines. The 45 degree line clipping is now enforced when selected. +Press and hold the shift key while positioning the new point to only clip +the line segment to the nearer of the two existing points to 45 degrees. +You can also toggle the 45-degree clipping in the middle of a point +insertion by pressing the <Key>. +If the shift key is not depressed and the 45 degree line clipping mode +is on, both new line segments must be on 45 degree angles - greatly +restricting where the new point may be placed. In some cases this can cause +confusion as to whether an insertion has been started since the two new +lines may be forced to lie parallel on top of the original line until the +pointer is moved far from the end points. + +

Removing objects, changing their size or moving them only applies to objects +that are visible when the command is executed. + +

+ +
+ +


+Next: , +Up: Drawing and Removing + +
+ +

3.5.1 Common Drawing and Removing Methods

+ +

+There are several keystrokes and button events referring to an object +without identifying its type. Here's a list of them: + +

<Btn1> creates (or deletes) an object depending on the +current mode. + +

<Key>BackSpace or <Key>Delete removes the visible +object at the cursor location. When more than one object exists at the +location, the order of removal is: via, line, text, polygon and +element. The drawn layer order also affects the search - whatever is +top - most (except elements) is affected before lower items. Basically +all this means that what is removed is probably just what you expect. +If for some reason it isn't, undo and try again. +Only one object is removed for each keystroke. If two or more +of the same type match, the newest one is removed. + +

Use <Key>s and Shift<Key>s to change the size (width) +of lines, arcs, text objects, pins, pads and vias, or to toggle the style +of polygons (whether pins and vias automatically have clearances). + +

<Key>n changes the name of pins, pads, vias, the +string of a text object, or the currently displayed label of an element. + +

<Key>m moves the line, arc, or polygon under the cross hair to the +active layer if it wasn't on that layer already. + +

<Key>u (undo) recovers from an unlimited number of operations +such as creating, removing, moving, copying, selecting etc. It works like +you'd expect even if you're in the midst of creating something. + +

Shift<Key>r restores the last undone operation provided no other +changes have been made since the undo was performed. + +

<Key>tab changes the board side you are viewing. + +

For a complete list of keystrokes and button events see Translations. + +

+ +


+Next: , +Previous: Common, +Up: Drawing and Removing + +
+ +

3.5.2 Lines

+ +

+To draw new lines you have to be in line-mode. Get there either by +selecting it from the Tool palette or by pressing <Key>F2. +Each successive notify event creates a new line. The +adjustment to 45 degree lines is done automatically if it is selected from the +Display menu. You can toggle the 45 degree mode setting by +pressing the <Key>. (That is the period key). When 45 degree enforcement +is turned on there are three distinct modes of line creation: a single +line on the closest 45 degree vector towards the cross hair (but not necessarily +actually ending at the cross hair), two lines created such that the first leaves +the start point on a 90 degree vector and the second arrives at the cross hair +on a 45 degree vector, and finally two lines created such that the first leaves +the start point on a 45 degree vector and the second arrives at the cross hair +on a 90 degree vector. These last two modes always connect all the way from +the start and end points, and all lines have angles in 45 degree multiples. +The <Key>/ cycles through the three modes. The status line shows a +text icon to indicate which of the modes is active and the lines following +the cross hair motion show the outline of the line(s) that will actually be created. +Press <Key>Escape to leave line-mode. + +

<Key>l, Shift<Key>l and the entries in the +Sizes menu change the initial width of new lines. This width is also +displayed in the status line. + +

+ +


+Next: , +Previous: Lines, +Up: Drawing and Removing + +
+ +

3.5.3 Arcs

+ +

+An Arc is drawn with the arc-tool. Get there either by selecting it +from the Tool palette or by pressing <Key>F8. Press Btn1 to +define the starting point for the arc. Drag the mouse towards the desired +end point along the path you want the arc to follow. The outline of the arc that +will be created is shown on the screen as you move the mouse. Arcs are always +forced to be 90 degrees and have symmetrical length and width ( i.e. they are +a quarter circle). The next Btn1 click creates the arc. It will have +the same width as new lines (displayed in the status line) and appear on the +active layer. The arc leaves the starting point towards the cross hair along +the axis whose distance from the cross hair is largest. Normally this means that +if you drag along the path you want the arc to follow, you'll get what you +want. If the grid is set to the arc radius, then the two distances will be +equal and you won't be able to get all of the possible directions. If this +is thwarting your desires, reduce the grid spacing (!Shift<Key>G) and +try again. + +

+ +


+Next: , +Previous: Arcs, +Up: Drawing and Removing + +
+ +

3.5.4 Polygons and Rectangles

+ +

+A polygon is drawn by defining all of its segments as a series of +consecutive line segments. If the first point matches a new one and if +the number of points is greater than two, then the polygon is closed. +Since matching up with the first point may be difficult, you may use +Shift<Key>p to close the polygon. The Shift<Key>p won't +work if clipping to 45 degree lines is selected +and the final segment cannot match this condition. +I suggest you create simple convex polygons in order to avoid a strong +negative impact on the performance of the connection scanning routines. +The rectangle-mode is just an easy way to generate rectangular polygons. +Polygon-mode also is selected by <Key>F6 whereas +rectangle-mode uses <Key>F4. +Pressing a <Btn1> at two locations creates a rectangle by +defining two of its corners. +<Key>Insert brings you to insert-point-mode which lets you +add additional points to an already existing polygon. +Single points may be removed by moving the cross hair to them and selecting +one of the delete actions (remove-mode, BackSpace, or Delete. This only works +if the remaining polygon will still have three or more corners. +Pressing <Key>u or <Key>p while entering a new polygon +brings you back to the previous corner. Removing a point does not +force clipping to 45 degree angles (because it's not generally possible). +Newly created polygons will not connect to pins or vias +that pierce it unless you create a thermal (using the thermal mode) to make +the connection. If the edge of a polygon gets too close to a pin or via that +lies outside of it, a warning will be issued and the pin will be given a +special color. Increasing the distance between them will remove the warning +color. + +

+ +


+Next: , +Previous: Polygons, +Up: Drawing and Removing + +
+ +

3.5.5 Text

+ +

+Pressing <Key>F5 or clicking one of the text selector buttons +changes to text-mode. +Each successive notify event (<Btn1>) +pops up the input line at the bottom and queries for a string. +Enter it and press <Key>Return to confirm or +<Key>Escape to abort. +The text object is created with its upper left corner at the current pointer +location. +The initial scaling is changed by <Key>t and +Shift<Key>t or from the Sizes menu. + +

Now switch to rotate-mode and press +<Btn1> at the text-objects location. Text objects +on the solder side of the layout are automatically mirrored and +flipped so that they are seen correctly when viewing the solder-side. + +

Use <Key>n to edit the string. + +

TEXT OBJECTS ON COPPER LAYERS CREATE COPPER LINES BUT THEY ARE NOT SCANNED FOR +CONNECTIONS. If they are moved to the silkscreen layer, they +no longer create copper. + +

+ +


+Next: , +Previous: Text, +Up: Drawing and Removing + +
+ +

3.5.6 Vias

+ +

+The initial size of new vias may be changed by <Key>v and +Shift<Key>v or by selecting the appropriate entry from the +Sizes menu. Mod1<Key>v and Mod1 Shift<Key>v do +the same for the drilling hole of the via. +The statusline is updated with the new values. +Creating a via is similar to the other objects. Switch to via-mode +by using either the selector button or <Key>F1 then press +<Key>] or <Btn1> to create one. +<Key>n changes the name of a via. If you want to create a mounting +hole for your board, then you can place a via where you want the hole to +be then convert the via into a hole. The conversion is done by pressing +!Ctrl<Key>h with the cross hair over the via. Conceptually it is +still a via, but it has no copper annulus. If you create such a hole in +the middle of two polygons on different layers, it will short the layers. +Theoretically you could arrange for such a hole not to be plated, but a +metal screw inserted in the hole would still risk shorting the layers. +A good rule is to realize that holes in the board really are vias between +the layers and so place them where they won't interfere with connectivity. +You can convert a hole back into a normal via with the same keystroke used +to convert it in the first place. + +

+ +


+Next: , +Previous: Vias, +Up: Drawing and Removing + +
+ +

3.5.7 Elements

+ +

+Some of the functions related to elements only work if both the package +layer and the pin layer are switched on. + +

Now that you're familiar with many of the basic commands, it is +time to put the first element on the layout. +First of all, you have to load data into the paste buffer. +There are four ways to do this: +

        1) load the data from a library
+        2) load the data from a file
+        3) copy data from an already existing element
+        4) convert objects in the buffer into an element
+
+

We don't have any elements on the screen yet nor anything in the +buffer, so we use number one. + +

Select lsi from the menu in the library window press +<Btn1> twice at the appropriate text-line to get +the MC68030 CPU. +The data is loaded and the mode is switched to pastebuffer-mode. +Each notify event now creates one of these beasts. Leave the mode +by selecting a different one or by <Key>Escape which resets +all modes.. +The cross hair is located at the mark position as defined by +the data file. Rotating the buffer contents is done by selecting +the rotate entry of the Buffer menu or by pressing +Shift<Key>F3. The contents of the buffer +are valid until new data is loaded into it either by a cut-to-buffer +operation, copy-to-buffer operation or by loading a new data file. +There are 5 buffers +available (possibly more or less if changed at compile time +with the MAX_BUFFER variable in globalconfig.h). +Switching between them is done by selecting a menu entry or +by Shift<Key>1..MAX_BUFFER. +Each of the two board sides has its own buffers. + +

The release includes all data files for the circuits that are used +by the demo layout. The elements in the LED example are not found in the library, +but you can lift them from the example itself if you want. +If you have problems with the color of the cross hair, change the resource +cross hairColor setting to a different one. + +

Now load a second circuit, the MC68882 FPU for example. +Create the circuit as explained above. You now have two different unnamed +elements. Unnamed means that the layout-name of the element +hasn't been set yet. Selecting description from the Display +menu displays the description string of the two circuits which +are CPU and FPU. The values of the circuits are set to MC68030 and MC68882. +Each of the names of an element may be changed +by <Key>n at the elements location and editing the old name in +the bottom input line. Naming pins and vias is similar to elements. +You can hide the element name so that it won't appear on the board +silkscreen by pressing <key>h with the cursor over the element. +Doing so again un-hides the element name. + +

Entering :le and selecting an element data file is +the second way to load circuits. + +

The third way to create a new element is to copy an existing one. +Please refer to Moving and Copying. + +

The fourth way to create a new element is to convert a buffer's contents +into an element. Here's how it's done: Select the Via-tool from the +Tool pallet. Set the grid spacing to something appropriate for +the element pin spacing. Now create a series of vias where the pins +go. Create them in pin number order. It is often handy to place a reference +point (!Ctrl<Key>m) in the center of the first pin in order to measure +the location of the other pins. Next make a solder-side layer the active +layer from the active-layer popup menu. Now draw the outline of +the element using lines and arcs. When you're done, select everything that +makes up the element with a box selection (<Btn3Down> drag, +<Btn3Up>). Now select "cut selection to buffer" from the Buffer +menu. Position the cursor over the center of pin 1 and press the left +button to load the data into the buffer. +Finally select "convert buffer to element" from the Buffer menu. +You'll only want to create elements this way if they aren't already in the +library. It's also probably a good idea to do this before starting any of +the other aspects of a layout, but it isn't necessary. + +

To display the pinout of a circuit move to it and press Shift<Key>d +or select show pinout from the Objects menu. A new window +pops up and displays the complete pinout of the element. This display can +be difficult to read if the component has been rotated 90 degrees :-( +therefore, the new window will show an un-rotated view so the pin names +are readable. +<Key>d displays the name of one or all pins/pads inside the +Layout area, this is only for display on-screen, it has no effect on any +printing of the layout. + +

You also may want to change a pin's or pad's current size by pressing +<Key>s to increase or Shift<Key>s to decrease it. While +this is possible, it is not recommended since care was probably taken +to define the element structure in the first place. You can also change the thickness +of the element's silkscreen outline with the same keys. You can +change whether a pin or SMD pad is rounded or square with the <Key>q. +SMD pads should usually have squared ends. Finally, you can change whether +the non-square pins are round or octagonal with the !Ctrl<Key>o. + +

SMD elements and silkscreen objects are drawn in the "invisible object" +color if they are located on the opposite side of the board. + +

For information on element connections refer to Connection Lists. + +

+ +


+Previous: Elements, +Up: Drawing and Removing + +
+ +

3.5.8 Pastebuffer

+ +

+The line-stack and element-buffer of former releases have been replaced +by 5 (possibly more or less if changed at compile time +with the MAX_BUFFER variable in globalconfig.h) +multi-purpose buffers that are selected by +Shift<Key>1..MAX_BUFFER. The status line shows which buffer is +the active one. +You may load data from a file or layout into them. +Cut-and-paste works too. +If you followed the instructions earlier in this chapter you should +now have several objects on the screen. Move the cross hair to one of them +and press <Btn3Down> to toggle its selection flag. (If you drag the +mouse while the button is down, a box selection will be attempted instead +of toggling the selection.) The object +is redrawn in a different color. You also may want to try +moving the pointer while holding the third button down and +release it on a different location. This selects all objects inside the +rectangle and unselects everything else. If you want to add a box selection +to an existing selection, drag with Mod1<Btn3Down> instead. +Dragging Shift Mod1<Btn3Down> unselects objects in a box. +Now change to pastebuffer-mode and select some operations from the +Buffer menu. Copying objects to the buffer is available as +Mod1<Key>c while cutting them uses Mod1<Key>x as +shortcut. Both clear the buffer before new data is added. +If you use the menu entries, you have to supply a cross hair position by +pressing a mouse button. The objects are attached to the pastebuffer +relative to that cross hair location. +Element data or PCB data may be merged into an existing layout by loading +the datafiles into the pastebuffer. Both operations are available from +the File menu or as user commands. + +

+ +


+Next: , +Previous: Drawing and Removing, +Up: Getting Started + +
+ +

3.6 Moving and Copying

+ +

+All objects can be moved including element-names, by +<Btn2Down>, dragging the pointer while holding the button down +and releasing it at the new location of the object. If you use +Mod1<Btn2Down> instead, the object is copied. Copying does not work for +element-names of course. You can move all selected objects with +Shift <Btn1>. This uses the Pastebuffer, so +it will remove whatever was previously in the Pastebuffer. +Please refer to Pastebuffer. +If you want to give a small nudge to an object, but you don't think +that the mouse will give you the fine level of control that you want, +you can position the cursor over the object, press <Key>[, +move it with the arrow keys, then press <Key>] when it's at the +desired position. Remember that all movements are forced onto grid coordinates, so +you may want to change the grid spacing first. + +

To move a trace or group of traces to a different layer, first select +the tracks to be moved. It's easiest to do this if you shut off everything +but that layer first (i.e. silk, pins, other layers, etc). +Now set the current layer to be the new layer. +Press Shift-M to move all the selected tracks to the current layer. +See the MoveToCurrentLayer action for more details. + +

+ +


+Next: , +Previous: Moving and Copying, +Up: Getting Started + +
+ +

3.7 Loading and Saving

+ +

+After your first experience with Pcb you will probably want to save +your work. :s name passes the data to an external program which +is responsible for saving it. For details see saveCommand in +Resources. +Saving also is available from the File menu, either with or +without supplying a filename. Pcb reuses the last +filename if you do not pass a new one to the save routine. + +

To load an existing layout either select load layout data from the +File menu or use :l filename. A file select box pops up if you +don't specify a filename. Merging existing layouts into the new one is +supported either by the File menu or by :m filename. + +

Pcb saves a backup of the current layout at a user specified interval. +The backup filename is created by appending a dash, "-", to the .pcb filename. +For example, if you are editing the layout in projects/board.pcb then the +backup file name will be projects/board.pcb-. If the layout is new and +has not been saved yet, then the backup file name is PCB.####.backup where the "####" +will be replaced by the process ID of the currenting running copy of Pcb. +This default backup file name may be changed at compilation time via the +BACKUP_NAME +variable in globalconfig.h). During critical +sections of the program or when data would be lost it is saved as +PCB.%i.save. This file name may be changed at compile time +with the SAVE_NAME variable in globalconfig.h. + +

+ +


+Next: , +Previous: Loading and Saving, +Up: Getting Started + +
+ +

3.8 Printing

+ +

+Pcb now has support for device drivers, +PostScript, encapsulated PostScript, +and Gerber RS-274X drivers are +available so far. The Gerber RS-274X +driver additionally generates a numerical control (NC) drill file for +automated drilling, +a bill of materials file to assist in materials procurement and +inventory control, and a centroid (X-Y) file which includes the +centroid data needed +by automatic assembly (pick and place) machines. + I recommend the use of GhostScript if you +don't have a PostScript printer for handling the PostScript +output. Printing always generates +a complete set of files for a specified driver. +See the page about +the Print() action for additional information about the filenames. +The control panel offers a number of options. Most of them are not available +for Gerber output because it wouldn't make sense, for example, to scale the gerber output +(you'd get an incorrectly made board!) The options are: + + + + +

device
The top menu button selects from the available device drivers. + +


rotate
Rotate layout 90 degrees counter-clockwise before printing (default). + +


mirror
Mirror layout before printing. Use this option depending +on your production line. + +


color
Created colored output. All colors will be converted to black if this option +is inactive. + +


outline
Add a board outline to the output file. The size is determined by the +maximum board size changeable from the sizes menu. The outline appears +on the top and bottom sides of the board, but not on the internal layers. +An outline can be useful for determining where to shear the board from the +panel, but be aware that it creates a copper line. Thus it has the potential +to cause short circuits if you don't leave enough room from your wiring +to the board edge. Use a viewer to see what the output outline looks like +if you want to know what it looks like. + +


alignment
Additional alignment targets are added to the output. The distances between +the board outline is set by the resource alignmentDistance. Alignment +targets should only be used if you know for certain that YOU WILL BE USING +THEM YOURSELF. It is extremely unlikely that you will want to have alignment +targets if you send gerber files to a commercial pcb manufacture to be made. + +


scaling
It's quite useful to enlarge your printout for checking the layout. +Use the scrollbar to adjust the scaling factor to your needs. + +


media
Select the size of the output media from this menu. The user defined size +may be set by the resource media either from one of the well known +paper sizes or by a X11 geometry specification. +This entry is only available if you use X11R5 or later. +For earlier releases the user defined size or, if not available, A4 +is used. +Well known size are: +
          	A3
+          	A4
+          	A5
+          	letter
+          	tabloid
+          	ledger
+          	legal
+          	executive
+
+


offset
Adjust the offsets of the printout by using the panner at the right side +of the dialog box. +This entry is only available if you use X11R5 or later. A zero +offset is used for earlier releases. + +


8.3 filenames
Select this button to generate DOS compatible filenames for the output files. +The command input area will disappear if selected. + +


commandline
Use this line to enter a command (starts with |) or a filename. +A %f is replaced by the current filename. +The default is set by the resource printCommand. + +
+ +

The created file includes some labels which are guaranteed to stay unchanged +

+
PCBMIN
identifies the lowest x and y coordinates in mil. + +
PCBMAX
identifies the highest x and y coordinates in mil. + +
PCBOFFSET
is set to the x and y offset in mil. + +
PCBSCALE
is a floating point value which identifies the scaling factor. + +
PCBSTARTDATA
PCBENDDATA
all layout data is included between these two marks. You may use them with an +awk script to produce several printouts on one piece of paper by +duplicating the code and putting some translate commands in front. +Note, the normal PostScript units are 1/72 inch. +
+ +
+ +


+Next: , +Previous: Printing, +Up: Getting Started + +
+ +

3.9 Exporting a layout

+ +

+To export a layout choose Export layout from the File menu, then +select the desired exporter. + +

+ +
+ +


+Next: , +Up: Exporting + +
+ +

3.9.1 Bill of materials (bom)

+ +

+Produces a bill of materials (BOM) file and a centroid (XY) file. + +

+ +


+Next: , +Previous: bom, +Up: Exporting + +
+ +

3.9.2 G-code (gcode)

+ +

+The gcode exporter can generate RS274/NGC G-CODE files to be used with a CNC mill to +produce pcb's by mechanically removing copper from the perimeter of all elements. + +

The elements are enlarged in order to compensate for the cutting tool size so +that the remaining copper corresponds to the original size; however all +polygons are left unchanged and will end up being a little smaller; this is not a +problem because the electrical connection is done with traces, which are correctly +enlarged. + +

A .cnc file is generated for every copper layer, with the bottom layer mirrored so +that the milling is done right; of course it's not possible to produce directly +multi-layer (more than 2) pcb's with this method, but the cnc files for +intermediate layers are generated anyways. + +

A drill file is also generated, and it contains all drills regardless of the hole +size; the drilling sequence is optimized in order to require the least amount of +movement. + +

The export function generates an intermediate raster image before extracting the contour +of copper elements, and this image is saved as well (in .png format) for inspection. + +

When the spacing between two elements is less than the tool diameter they will merge +and no isolation will be cut between them; the control image should be checked for +this behaviour. + +

Possible workarounds are: increasing spacing, decreasing the tool size, increasing +the intermediate image resolution. + +

To maximize the chance of producing correct pcb's it would be better to increase +the DRC clearance to at least the tool diameter and use traces as thick as possible; +the rule is: use the largest element that will not prevent the isolation cut. + +

The exporter parameters are: + +

+
basename
base name for generated files + +
dpi
intermediate image resolution; affects precision when extracting contours + +
mill depth
should be the copper depth + +
safe z
Z value when moving between polygons + +
tool radius
copper elements are enlarged by this amount + +
drill depth
depth of drills + +
measurement unit
for all parameters above, can be mm,um,inch,mil; g-code is always mm or inch +
+ +

All .cnc files specify Z values as parameters, so that it's easy to +change them without the need to run the exporter again. + +

Operation was verified with the EMC2 g-code interpreter. + +

Following is a sample layout that is converted with default settings: +

Sample Layout
+ +

The control image shows that the spacing is sufficient: +

Control Image
+ +

The final tool path follows the perimeter of all elements: +

Resulting Tool Path
+ +
+ +


+Next: , +Previous: gcode, +Up: Exporting + +
+ +

3.9.3 Gerber (gerber)

+ +

+Produces RS274-X (a.k.a. gerber) photo plot files and Excellon drill files. + +

+ +


+Next: , +Previous: gerber, +Up: Exporting + +
+ +

3.9.4 Nelma (nelma)

+ +

+Numerical analysis package export. + +

+ +


+Next: , +Previous: nelma, +Up: Exporting + +
+ +

3.9.5 Image (png)

+ +

+Produces GIF/JPEG/PNG image files. + +

+ +


+Next: , +Previous: png, +Up: Exporting + +
+ +

3.9.6 Postscript (ps)

+ +

+Export as postscript. +Can be later converted to pdf. + +

+ +


+Previous: ps, +Up: Exporting + +
+ +

3.9.7 Encapsulated Postscript (eps)

+ +

+Export as eps (encapsulated postscript) for inclusion in other documents. +Can be later converted to pdf. + +

+ +


+Previous: Vendor drill mapping, +Up: Getting Started + +
+ +

3.10 Connection Lists

+ +

+After completing parts of your layout you may want to check if all drawn +connections match the ones you have in mind. This is probably best done +in conjunction with a net-list file: see Rats Nest. +The following examples give more rudimentary ways to examine +the connections. +

         1) create at least two elements and name them
+         2) create some connections between their pins
+         3) optionally add some vias and connections to them
+
+

Now select lookup connection from the Connections menu, +move the cursor to a pin or via and press any mouse button. Pcb +will look for all other pins and/or vias connected to the one you have +selected and display the objects in a different color. +Now try some of the reset options available from the same menu. + +

There also is a way to scan all connections of one element. Select +a single element from the menu and press any button at the +element's location. All connections of this element will be saved +to the specified file. +Either the layout name of the element or its canonical name is used to +identify pins depending on the one which is displayed on the screen +(may be changed by Display menu). + +

An automatic scan of all elements is initiated by choosing +all elements. It behaves in a similar fashion to scanning a single +element except the resource resetAfterElement +is used to determine if connections should be reset before a new element is +scanned. Doing so will produce very long lists because the power lines are +rescanned for every element. By default the resource is set to false +for this reason. + +

To scan for unconnected pins select unused pins from the same +menu. + +

+ +


+Next: , +Previous: Exporting, +Up: Getting Started + +
+ +

3.11 Arrow Tool

+ +

+Some commands mentioned earlier in this chapter also are able to operate on all +selected and visible objects. The Arrow tool is used to select/deselect +objects and also to move objects or selections. If you click and release +on an object with the Arrow tool, it will unselect everything else and +select the object. Selected objects change color to reflect that +they are selected. If you Shift click, it will add the object to +(or remove) the object from the existing selection. If you drag with +the mouse button down with the Arrow tool, one of several things could +happen: if you first pressed the button on a selected object, you +will be moving the selection to where you release the button. If you +first pressed the button on an unselected object, you will be moving +that object. If you first pressed the button over empty space, you +will be drawing a box to select everything inside the box. The Shift +key works the same way with box selections as it does with single objects. + +

Moving a single un-selected object is different from moving a selection. +First of all, you can move the end of line, or a point in a polygon this +way which is impossible by moving selections. Secondly, if rubber banding +is turned on, moving a single object will rubber-band the attached lines. +Finally, it is faster to move a single object this way since there is no need +to select it first. + +

You can select any visible object unless it is locked. If you select an +object, then turn off its visibility with the Layer controls, it won't +be moved if you move the remaining visible selection. + +

If you have not configured to use strokes in the Pcb user interface, then +the middle mouse button is automatically bound to the arrow tool, regardless +of the active tool (which is bound to the first mouse button). So using +the middle button any time is just like using the first mouse button +with the Arrow tool active. + +

The entries of the Selection menu are hopefully self-explanatory. +Many of the Action Commands can take various key words that make +them function on all or some of the selected items. + +

+ +


+Next: , +Previous: Arrow Tool, +Up: Getting Started + +
+ +

3.12 Rats Nest

+ +

+If you have a netlist that corresponds to the layout you are working on, you +can use the rats-nest feature to add rat-lines to the layout. +First you will need to load a netlist file (see :rn, +User Commands). +<Key>w adds rat-lines on the active layer using the current +line thickness shown in the status line (usually you'll want them to be thin lines). +Only those rat-lines that fill in missing connectivity (since you have +probably routed some connections already) are added. +If the layout is already completely wired, nothing will be added, and you will +get a message that the wiring is complete. + +

Rat-lines are lines having the special property that they only connect to pins and +pads at their end points. Rat-lines may be drawn differently to other lines +to make them easier to identify since they have special behavior and cannot +remain in a completed layout. +Rat-lines are added in the minimum length straight-line tree pattern +(always ending on pins or pads) that satisfies the missing connectivity in the circuit. +Used in connection with moves and rotates of the elements, they are extremely useful for +deciding where to place elements on the board. The rat-lines will always automatically +rubberband to the elements whether or not the rubberband mode is on. The only way for +you to move them is by moving the parts they connect to. +This is because it is never desirable to have the rat-lines disconnected from +their element pins. Rat-lines will normally criss-cross +all over which gives rise to the name "rats nest" describing a layout connected with +them. If a SMD pad is unreachable on the active layer, a warning will be issued +about it and the rat-line to that pad will not be generated. + +

A common way to use rats nests is to place some +elements on the board, add the rat-lines, and then use a series of moves/rotates of the +elements until the rats nest appears to have minimum tangling. You may want to iterate this step +several times. Don't worry if the layout looks messy - as long as you can get a sense for whether +the criss-crossing is better or worse as you move things, you're fine. +After moving some elements around, you may want to optimize the rats nest <Key>o +so that the lines are drawn between the closest points (this can change once you've moved components). +Adding rat-lines only to selected pads/pins (Shift<Key>w) +is often useful to layout a circuit a little bit at a time. +Sometimes you'll want to delete all the rat-lines (<Key>e) or +selected rat-lines (Shift<Key>e) in order to reduce confusion. +With a little practice you'll be able to achieve a near optimal component placement with +the use of a rats nest. + +

Rat-lines are not only used for assisting your element placement, they can also help +you to route traces on the board. +Use the <Key>m to convert a rat-line under the cursor into +a normal line on the active layer. +Inserting a point into a rat-line will also cause the two new lines to be normal lines +on the board. +Another way that you can use rat-lines is to +use the <Key>f with the cursor over a pad or pin. All of the pins and +pads and rat-lines belonging to that net will be highlighted. This is a helpful way to +distinguish one net from the rest of the rats nest. You can then route those tracks, +turn off the highlighting (Shift<Key>f) and repeat the process. This will work even +if the layer that the rat-lines reside on is made invisible - so only the pins and pads +are highlighted. +Be sure to erase the rat-lines (<Key>e erases them all) once you've +duplicated their connectivity by adding your own lines. +When in doubt, the <Key>o will delete only those +rat-lines that are no longer needed. + +

If connections exist on the board that are not listed in the netlist when +<Key>w is pressed, warning messages are issued and the affected pins and +pads are drawn in a special warnColor until the next Notify() event. +If the entire layout agrees completely with the netlist, a message informs you that +the layout is complete and no rat-lines will be added (since none are needed). +If the layout is complete, but still has rat-lines then you will be warned +that rat-lines remain. If you get no message at all it's probably because some +elements listed in the net list can't be found and where reported in an earlier +message. +There shouldn't be any rat-lines left in a completed layout, only normal lines. + +

The Shift<Key>w is used to add rat-lines to only those missing connections among +the selected pins and pads. This can be used to add rat-lines in an incremental +manner, or to force a rat-line to route between two points that are not the +closest points within the net. Often it is best to add the rats nest in an incremental fashion, laying +out a sub-section of the board before going further. This is easy to accomplish since +new rat-lines are never added where routed connectivity already makes the necessary +connections. + +

+ +


+Next: , +Previous: Rats Nest, +Up: Getting Started + +
+ +

3.13 Design Rule Checking

+ +

+After you've finished laying out a board, you may want to check +to be certain that none of your interconnections are too closely +spaced or too tenuously touching to be reliably fabricated. The design +rule checking (DRC) function does this for you. Use the command ":DRC()" (without +the quotes of course) to invoke the checker. If there are no problem areas, +you'll get a message to that effect. If any problem is encountered, you will get +a message about it and the affected traces will be highlighted. One part of the +tracks of concern will be selected, while the other parts of concern will have the +"FindConnection" highlighting. The screen will automatically be centered in the +middle of the object having the "FindConnection" (Green) highlighting. The middle of +the object is also the coordinates reported to be "near" the problem. The actual trouble +region will be somewhere on the boundary of this object. If the two parts are +from different nets then there is some place where they approach each +other closer than the minimum rule. If the parts are from the same net, then +there is place where they are only barely connected. Find that place and connect +them better. + +

After a DRC error is found and corrected you must run the DRC again because +the search for errors is halted as soon as the first problem is found. Unless you've +been extremely careless there should be no more than a few design rule errors +in your layout. The DRC checker does not check for minimum spacing rules to +copper text, so always be very careful when adding copper text to a layout. +The rules for the DRC are specified in the application resource file. The minimum +spacing value (in mils) is given by the Settings.Bloat value. The default +is 7 mils. The minimum touching overlap (in mils) is given by the +Settings.Shrink value. This value defaults to 5 mils. Check with your +fabrication process people to determine the values that are right for you. + +

If you want to turn off the highlighting produced by the DRC, perform an +undo (assuming no other changes have been made). To restore the highlighting, +use redo. The redo will restore the highlighting quickly without re-running +the DRC checker. + +

+ +


+Next: , +Previous: Design Rule Checking, +Up: Getting Started + +
+ +

3.14 Trace Optimizer

+ +

+PCB includes a flexible trace optimizer. The trace optimizer can be run +after auto routing or hand routing to clean up the traces. + +

+
Auto-Optimize
Performs debumpify, unjaggy, orthopull, vianudge, and viatrim, in that +order, repeating until no further optimizations are performed. + +
Debumpify
Looks for U shaped traces that can be shortened or eliminated. + +
Unjaggy
Looks for corners which could be flipped to eliminate one or more +corners (i.e. jaggy lines become simpler). + +
Vianudge
Looks for vias where all traces leave in the same direction. Tries to +move via in that direction to eliminate one of the traces (and thus a +corner). + +
Viatrim
Looks for traces that go from via to via, where moving that trace to a +different layer eliminates one or both vias. + +
Orthopull
Looks for chains of traces all going in one direction, with more traces +orthogonal on one side than on the other. Moves the chain in that +direction, causing a net reduction in trace length, possibly eliminating +traces and/or corners. + +
SimpleOpts
Removing unneeded vias, replacing two or more trace segments in a row +with a single segment. This is usually performed automatically after +other optimizations. + +
Miter
Replaces 90 degree corners with a pair of 45 degree corners, to reduce +RF losses and trace length. + +
+ +
+ +


+Next: , +Previous: Trace Optimizer, +Up: Getting Started + +
+ +

3.15 Searching for elements

+ +

+To locate text or a specific element or grouping of similar elements +choose ‘Select by name’ from the Select menu, then choose the +appropriate subsection. At the bottom of the screen the prompt +pattern: appears. Enter the text or Regular Expressions +of the text to be found. Found text will be highlighted. + +

+ +


+Next: , +Previous: Searching for elements, +Up: Getting Started + +
+ +

3.16 Measuring distances

+ +

+To measure distances, for example the pin-to-pin pitch of a part to +validate a footprint, place the cursor at the starting +measurement point, then press !Ctrl<Key>m. This marks the +current location with a X. The X mark is now the zero point +origin for the relative cursor position display. The cursor display +shows both absolute position and position relative to the mark as +the mouse is moved away from the mark. If a mark is already present, +the mark is removed and the cursor display stops displaying relative +cursor coordinates. + +

+ +


+Next: , +Previous: Measuring distances, +Up: Getting Started + +
+ +

3.17 Vendor Drill Mapping

+ +

+Pcb includes support for mapping drill holes to a specified set +of sizes used by a particular vendor. Many PCB manufacturers have a +prefered set of drill sizes and charge extra when others are used. +The mapping can be performed on an existing design and can also be +enabled to automatically map drill holes as vias and elements are +instantiated. + +

The first step in using the vendor drill mapping feature is to create +a resource file describing the capabilities of your vendor. The file +format is the resource file format described in Resource Syntax. +A complete example is given below. + +

     # Optional name of the vendor
+     vendor = "Vendor Name"
+     
+     # units for dimensions in this file.
+     # Allowed values:  mil/inch/mm
+     units = mil
+     
+     # drill table
+     drillmap = {
+        # When mapping drill sizes, select the nearest size
+        # or always round up.  Allowed values:  up/nearest
+        round = up
+     
+        # The list of vendor drill sizes.  Units are as specified
+        # above.
+        20
+        28
+        35
+        38
+        42
+        52
+        59.5
+        86
+       125
+       152
+     
+        # optional section for skipping mapping of certain elements
+        # based on reference designator, value, or description
+        # this is useful for critical parts where you may not
+        # want to change the drill size.  Note that the strings
+        # are regular expressions.
+        skips = {
+           {refdes "^J3$"}  # Skip J3.
+           {refdes "J3"}  # Skip anything with J3 as part of the refdes.
+           {refdes "^U[1-3]$" "^X.*"} # Skip U1, U2, U3, and anything starting with X.
+           {value "^JOHNSTECH_.*"} # Skip all Johnstech footprints based on the value of a part.
+           {descr "^AMP_MICTOR_767054_1$"} # Skip based on the description.
+        }
+     }
+     
+     # If specified, this section will change the current DRC
+     # settings for the design.  Units are as specified above.
+     drc = {
+        copper_space = 7
+        copper_width = 7
+        silk_width = 10
+        copper_overlap = 4
+     }
+
+

The vendor resource is loaded using the LoadVendor action. +This is invoked by entering: +

     :LoadVendor(vendorfile)
+
+

from within Pcb. Substitute the file name of your vendor +resource file for ‘vendorfile’. This action will load the vendor +resource and modify all the drill holes in the design as well as the +default via hole size for the various routing styles. + +

Once a vendor drill map has been loaded, new vias and elements will +automatically have their drill hole sizes mapped to the vendor drill +table. Automatic drill mapping may be disabled under the “Settings” +menu. To re-apply an already loaded vendor drill table to a design, +choose “Apply vendor drill mapping” from the “Connects” menu. + +

See Actions for a complete description of the actions associated +with vendor drill mapping. + +

Note that the expressions used in the skips section are regular +expressions. See Regular Expressions for an introduction to +regular expressions. + + +

+ +


+Next: , +Previous: Getting Started, +Up: Top + +
+ +

4 Autorouter

+ +

+Pcb includes an autorouter which can greatly speed up the +layout of a circuit board. The autorouter is a rectangle-expansion +type of autorouter based on +“A Method for Gridless Routing of Printed Circuit Boards” by +A. C. Finch, K. J. Mackenzie, G. J. Balsdon, and G. Symonds in the +1985 Proceedings of the 22nd ACM/IEEE Design Automation Conference. +This reference is available from the ACM Digital Library at +http://www.acm.org/dl for those with institutional or personal +access to it. It's also available from your local engineering +library. The reference paper is not needed for using the autorouter. + +

Before using the autorouter, all elements need to be loaded into the +layout and placed and the connectivity netlist must be loaded. Once +the elements have been placed and the netlist loaded, the following +steps will autoroute your design. + +

    +
  1. Turn off visibility of any layers that you don't want the router +to use. + +
  2. Turn of via visibility if you don't want the router to use any +new vias. + +
  3. Use only plain rectangles for power/ground planes that you want + the router to use [use the rectangle tool!] + +
  4. Make at least one connection from any plane you want the router to + use to the net you want it to connect to. + +
  5. Draw continuous lines (on all routing layers) to outline keep-out + zones if desired. + +
  6. Use routing styles in the netlist to have per-net routing styles. + Note that the routing style will be used for an entire net. This means + if you have a wide metal setting for a power net you will need to manually + route breakouts from any fine pitch parts on their power pins because + the router will not be able to change to a narrow trace to connect + to the part. + +
  7. Set the current routing style to whatever you'd like the router to + use for any nets not having a defined route style in the netlist. + +
  8. Disable any nets that you don't want the autorouter to route + (double-click them in the netlist window to add/remove the *) + +

    NOTE: If you will be manually routing these later not using + planes, it is usually better to let the autorouter route them then rip + them up yourself afterwards. If you plan to use a ground/power plane + manually, consider making it from one or more pure rectangles and + letting the autorouter have a go at it. + +

  9. Create a fresh rat's nest. ('E' the 'W') + +
  10. Select “show autorouter trials” in the settings menu if you want + to watch what's happening + +
  11. Choose “autoroute all rats” in the connection menu. + +
  12. If you really want to muck with the router because you have a + special design, e.g. all through-hole components you can mess with + layer directional costs by editing the autoroute.c source file and + changing the directional costs in lines 929-940. and try again. Even + more mucking about with costs is possible in lines 4540-4569, but it's + probably not such a good idea unless you really just want to + experiment. + +
+ +

After the design has been autorouted, you may want to run the trace +optimizer. See section Trace Optimizer for more information on +the trace optimizer. + + +

+ +


+Next: , +Previous: Autorouter, +Up: Top + +
+ +

5 User Commands

+ +

The entering of user-commands is initiated by the action routine +Command() (normally bound to the (":") character) which +replaces the bottom statusline with an input area or opens a separate +command window. It is finished by either <Key>Return or +<Key>Escape to confirm or to abort. These two key-bindings +cannot be changed from the resource file. The triggering event, +normally a key press, is ignored. + +

Commands can be entered in one of two styles, command entry syntax: +“Command arg1 arg2” or action script syntax “Action1(arg1, +arg2); Action2(arg1, arg2);”. Quoting arguments works similar to +bash quoting: + +

    +
  • A backslash (\) is the escape character. It preserves the literal +value of the next character that follows. To get a literal '\' use +"\\". + +
  • Enclosing characters in single quotes preserves the literal value of +each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a blackslash. + +
  • Enclosing characters in double quotes preserves the literal value of +all characters within the quotes, with the exception of '\' which +maintains its special meaning as an escape character. +
+ +

There are simple usage dialogs for each command and one for the +complete set of commands. + + + + + +

l [filename]
Loads a new datafile (layout) and, if confirmed, overwrites any existing unsaved data. +The filename and the searchpath (filePath) are passed to the +command defined by fileCommand. +If no filename is specified a file select box will popup. + +


le [filename]
Loads an element description into the paste buffer. +The filename and the searchpath (elementPath) are passed to the +command defined by elementCommand. +If no filename is specified a file select box will popup. + +


m [filename]
Loads an layout file into the paste buffer. +The filename and the searchpath (filePath) are passed to the +command defined by fileCommand. +If no filename is specified a file select box will popup. + +


q[!]
Quits the program without saving any data (after confirmation). +q! doesn't ask for confirmation, it just quits. + +


s [filename]
Data and the filename are passed to the command defined by the resource +saveCommand. It must read the layout data from stdin. +If no filename is entered, either the last one is used +again or, if it is not available, a file select box will pop up. + +


rn [filename]
Reads in a netlist file. If no filename is given +a file select box will pop up. +The file is read via the command defined by the +RatCommand resource. The command must send its output to stdout. + +

Netlists are used for generating rat's nests (see Rats Nest) and for +verifying the board layout (which is also accomplished by the Ratsnest +command). + +


w[q] [filename]
These commands have been added for the convenience of vi users and +have the same functionality as s combined with q. + +


actionCommand
Causes the actionCommand to be executed. This allows you to initiate actions +for which no bindings exist in the resource file. It can be used to initiate any +action with whatever arguments you enter. This makes it possible to do things +that otherwise would be extremely tedious. For example, to change the drilling +hole diameter of all vias in the layout to 32 mils, you could select everything using the +selection menu, then type ":ChangeDrillSize(SelectedVias, 32)". (This will +only work provided the via's diameter is sufficiently large to accommodate a 32 mil hole). +Another example might be to set the grid to 1 mil by typing ":SetValue(Grid, 1)". +Note that some actions use the current cursor location, so be sure to place the cursor +where you want before entering the command. This is one of my favorite new +features in 1.5 and can be a powerful tool. Study the Actions section to +see what actions are available. + +
+ + +
+ + +


+Next: , +Previous: User Commands, +Up: Top + +
+ +

6 Command-Line Options

+ +

+The synopsis of the pcb command is: + +

pcb [OPTION ...] [LAYOUT-FILE.pcb] to start the application in GUI mode, + +

or + +

pcb [-h | -V | --copyright] for a list of options, version, and copyright, + +

or + +

pcb -p [OPTION ...] [LAYOUT-FILE.pcb] to print a layout, + +

or + +

pcb -x HID [OPTION ...] [LAYOUT-FILE.pcb] to export. + +

Possible values for the parameter ‘HID’ are: +

+
bom
Export a bill of materials +
gcode
Export to G-Code +
gerber
Export RS-274X (Gerber) +
nelma
Numerical analysis package export +
png
export GIF/JPEG/PNG +
ps
export postscript +
eps
export encapsulated postscript +
+ +

There are several resources which may be set or reset in addition to the +standard toolkit command-line options. For a complete list refer to +Resources. + + +

+ + + +

6.1 General Options

+ + +
+
--help
Show help on command line options. +
+ +
+
--version
Show version. +
+ +
+
--verbose
Be verbose on stdout. +
+ +
+
--copyright
Show copyright. +
+ +
+
--show-defaults
Show option defaults. +
+ +
+
--show-actions
Show available actions and exit. +
+ +
+
--dump-actions
Dump actions (for documentation). +
+ +
+
--grid-units-mm <string>
Set default grid units. Can be mm or mil. Defaults to mil. +
+ +
+
--backup-interval
Time between automatic backups in seconds. Set to 0 to disable. +The default value is 60. +
+ +
+
--groups <string>
Layer group string. Defaults to "1,c:2:3:4:5:6,s:7:8". +
+ +
+
--route-styles <string>
A string that defines the route styles. Defaults to
+"Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000 + :Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600" +
+ +
+
--element-path <string>
A colon separated list of directories or commands (starts with '|'). +The path is passed to the program specified in --element-command. +
+ +
+
--action-script <string>
If set, this file is executed at startup. +
+ +
+
--action-string <string>
If set, this string of actions is executed at startup. +
+ +
+
--fab-author <string>
Name of author to be put in the Gerber files. +
+ +
+
--layer-stack <string>
Initial layer stackup, for setting up an export. A comma separated list of layer +names, layer numbers and layer groups. +
+ +
+
--save-last-command
If set, the last user command is saved. +
+ +
+
--save-in-tmp
If set, all data which would otherwise be lost are saved in a temporary file +/tmp/PCB.%i.save . Sequence ‘%i’ is replaced by the process ID. +
+ +
+
--reset-after-element
If set, all found connections are reset before a new component is scanned. +
+ +
+
--ring-bell-finished
Execute the bell command when all rats are routed. +
+ +
+ +


+Next: , +Previous: General Options, +Up: Command-Line Options + +
+ +

6.2 General GUI Options

+ + +
+
--pinout-offset-x <num>
Horizontal offset of the pin number display. Defaults to 100mil. +
+ +
+
--pinout-offset-y <num>
Vertical offset of the pin number display. Defaults to 100mil. +
+ +
+
--pinout-text-offset-x <num>
Horizontal offset of the pin name display. Defaults to 800mil. +
+ +
+
--pinout-text-offset-y <num>
Vertical offset of the pin name display. Defaults to -100mil. +
+ +
+
--draw-grid
If set, draw the grid at start-up. +
+ +
+
--clear-line
If set, new lines clear polygons. +
+ +
+
--full-poly
If set, new polygons are full ones. +
+ +
+
--unique-names
If set, you will not be permitted to change the name of an component to match that +of another component. +
+ +
+
--snap-pin
If set, pin centers and pad end points are treated as additional grid points +that the cursor can snap to. +
+ +
+
--all-direction-lines
Allow all directions, when drawing new lines. +
+ +
+
--show-number
Pinout shows number. +
+ +
+ + +


+Next: , +Previous: General GUI Options, +Up: Command-Line Options + +
+ +

6.3 GTK+ GUI Options

+ + +
+
--listen
Listen for actions on stdin. +
+ +
+
--bg-image <string>
File name of an image to put into the background of the GUI canvas. The image must +be a color PPM image, in binary (not ASCII) format. It can be any size, and will be +automatically scaled to fit the canvas. +
+ +
+
--pcb-menu <string>
Location of the gpcb-menu.res file which defines the menu for the GTK+ GUI. +
+ +
+ +


+Next: , +Previous: GTK+ GUI Options, +Up: Command-Line Options + +
+ +

6.4 lesstif GUI Options

+ + +
+
--listen
Listen for actions on stdin. +
+ +
+
--bg-image <string>
File name of an image to put into the background of the GUI canvas. The image must +be a color PPM image, in binary (not ASCII) format. It can be any size, and will be +automatically scaled to fit the canvas. +
+ +
+
--pcb-menu <string>
Location of the pcb-menu.res file which defines the menu for the lesstif GUI. +
+ +
+ +


+Next: , +Previous: lesstif GUI Options, +Up: Command-Line Options + +
+ +

6.5 Colors

+ + +
+
--black-color <string>
Color value for black. Default: ‘#000000’ +
+ +
+
--black-color <string>
Color value for white. Default: ‘#ffffff’ +
+ +
+
--background-color <string>
Background color of the canvas. Default: ‘#e5e5e5’ +
+ +
+
--crosshair-color <string>
Color of the crosshair. Default: ‘#ff0000’ +
+ +
+
--cross-color <string>
Color of the cross. Default: ‘#cdcd00’ +
+ +
+
--via-color <string>
Color of vias. Default: ‘#7f7f7f’ +
+ +
+
--via-selected-color <string>
Color of selected vias. Default: ‘#00ffff’ +
+ +
+
--pin-color <string>
Color of pins. Default: ‘#4d4d4d’ +
+ +
+
--pin-selected-color <string>
Color of selected pins. Default: ‘#00ffff’ +
+ +
+
--pin-name-color <string>
Color of pin names and pin numbers. Default: ‘#ff0000’ +
+ +
+
--element-color <string>
Color of components. Default: ‘#000000’ +
+ +
+
--rat-color <string>
Color of ratlines. Default: ‘#b8860b’ +
+ +
+
--invisible-objects-color <string>
Color of invisible objects. Default: ‘#cccccc’ +
+ +
+
--invisible-mark-color <string>
Color of invisible marks. Default: ‘#cccccc’ +
+ +
+
--element-selected-color <string>
Color of selected components. Default: ‘#00ffff’ +
+ +
+
--rat-selected-color <string>
Color of selected rats. Default: ‘#00ffff’ +
+ +
+
--connected-color <string>
Color to indicate connections. Default: ‘#00ff00’ +
+ +
+
--off-limit-color <string>
Color of off-canvas area. Default: ‘#cccccc’ +
+ +
+
--grid-color <string>
Color of the grid. Default: ‘#ff0000’ +
+ +
+
--layer-color-<n> <string>
Color of layer <n>, where <n> is an integer from 1 to 16. +
+ +
+
--layer-selected-color-<n> <string>
Color of layer <n>, when selected. <n> is an integer from 1 to 16. +
+ +
+
--warn-color <string>
Color of offending objects during DRC. Default value is "#ff8000" +
+ +
+
--mask-color <string>
Color of the mask layer. Default value is "#ff0000" +
+ +
+ +


+Next: , +Previous: Colors, +Up: Command-Line Options + +
+ +

6.6 Layer Names

+ + +
+
--layer-name-1 <string>
Name of the 1st Layer. Default is "top". +
+ +
+
--layer-name-2 <string>
Name of the 2nd Layer. Default is "ground". +
+ +
+
--layer-name-3 <string>
Name of the 3nd Layer. Default is "signal2". +
+ +
+
--layer-name-4 <string>
Name of the 4rd Layer. Default is "signal3". +
+ +
+
--layer-name-5 <string>
Name of the 5rd Layer. Default is "power". +
+ +
+
--layer-name-6 <string>
Name of the 6rd Layer. Default is "bottom". +
+ +
+
--layer-name-7 <string>
Name of the 7rd Layer. Default is "outline". +
+ +
+
--layer-name-8 <string>
Name of the 8rd Layer. Default is "spare". +
+ +
+ +


+Next: , +Previous: Layer Names, +Up: Command-Line Options + +
+ +

6.7 Paths

+ + +
+
--lib-newlib <string>
Top level directory for the newlib style library. +
+ +
+
--lib-name <string>
The default filename for the library. +
+ +
+
--default-font <string>
The name of the default font. +
+ +
+
--file-path <string>
A colon separated list of directories or commands (starts with '|'). The path +is passed to the program specified in --file-command together with the selected +filename. +
+ +
+
--font-path <string>
A colon separated list of directories to search the default font. Defaults to +the default library path. +
+ +
+
--lib-path <string>
A colon separated list of directories that will be passed to the commands specified +by --element-command and --element-contents-command. +
+ +
+ +


+Next: , +Previous: Paths, +Up: Command-Line Options + +
+ +

6.8 Sizes

+ + +

All parameters should be given with an unit. If no unit is given, 1/100 mil +(cmil) will be used. Write units without space to the +number like 3mm, not 3 mm. +Valid Units are: +

+
km
Kilometer +
m
Meter +
cm
Centimeter +
mm
Millimeter +
um
Micrometer +
nm
Nanometer +
in
Inch (1in = 0.0254m) +
mil
Mil (1000mil = 1in) +
cmil
Centimil (1/100 mil) +
+ +
+
--via-thickness <num>
Default diameter of vias. Default value is 60mil. +
+ +
+
--via-drilling-hole <num>
Default diameter of holes. Default value is 28mil. +
+ +
+
--line-thickness <num>
Default thickness of new lines. Default value is 10mil. +
+ +
+
--rat-thickness <num>
Thickness of rats. Values from 1 to 19 are fixed width in screen pixels. +Anything larger means PCB units (i.e. 100 means "1 mil"). Default value +is 10mil. +
+ +
+
--keepaway <num>
Default minimum distance between a track and adjacent copper. +Default value is 10mil. +
+ +
+
--default-PCB-width <num>
Default width of the canvas. Default value is 6000mil. +
+ +
+
--default-PCB-height <num>
Default height of the canvas. Default value is 5000mil. +
+ +
+
--text-scale <num>
Default text scale. This value is in percent. Default value is 100. +
+ +
+
--alignment-distance <num>
Specifies the distance between the board outline and alignment targets. +Default value is 2mil. +
+ +
+
--grid <num>
Initial grid size. Default value is 10mil. +
+ +
+
--minimum polygon area <num>
Minimum polygon area. +
+ +
+ +


+Next: , +Previous: Sizes, +Up: Command-Line Options + +
+ +

6.9 Commands

+ + +

pcb uses external commands for input output operations. These commands can be +configured at start-up to meet local requirements. The command string may include +special sequences %f, %p or %a. These are replaced when the +command is called. The sequence %f is replaced by the file name, +%p gets the path and %a indicates a package name. + +

+
--font-command <string>
Command to load a font. +
+ +
+
--file-command <string>
Command to read a file. +
+ +
+
--element-command <string>
Command to read a footprint.
+Defaults to "M4PATH='%p';export M4PATH;echo 'include(%f)' | m4" +
+ +
+
--print-file <string>
Command to print to a file. +
+ +
+
--lib-command-dir <string>
Path to the command that queries the library. +
+ +
+
--lib-command <string>
Command to query the library.
+Defaults to "QueryLibrary.sh '%p' '%f' %a" +
+ +
+
--lib-contents-command <string>
Command to query the contents of the library.
+Defaults to "ListLibraryContents.sh %p %f" or, +on Windows builds, an empty string (to disable this feature). +
+ +
+
--save-command <string>
Command to save to a file. +
+ +
+
--rat-command <string>
Command for reading a netlist. Sequence %f is replaced by the netlist filename. +
+ +
+ +


+Next: , +Previous: Commands, +Up: Command-Line Options + +
+ +

6.10 DRC Options

+ + +

All parameters should be given with an unit. If no unit is given, 1/100 mil +(cmil) will be used for backward compability. Valid units are given in section +Sizes. + +

+
--bloat <num>
Minimum spacing. Default value is 10mil. +
+ +
+
--shrink <num>
Minimum touching overlap. Default value is 10mil. +
+ +
+
--min-width <num>
Minimum width of copper. Default value is 10mil. +
+ +
+
--min-silk <num>
Minimum width of lines in silk. Default value is 10mil. +
+ +
+
--min-drill <num>
Minimum diameter of holes. Default value is 15mil. +
+ +
+
--min-ring <num>
Minimum width of annular ring. Default value is 10mil. +
+ +
+ +


+Next: , +Previous: DRC Options, +Up: Command-Line Options + +
+ +

6.11 BOM Creation

+ + +
+
--bomfile <string>
Name of the BOM output file. +
+ +
+
--xyfile <string>
Name of the XY output file. +
+ +
+
--xy-unit <unit>
Unit of XY dimensions. Defaults to mil. +
+ +
+ +


+Next: , +Previous: BOM Creation, +Up: Command-Line Options + +
+ +

6.12 Gerber Export

+ + +
+
--gerberfile <string>
Gerber output file prefix. Can include a path. +
+ +
+
--all-layers
Output contains all layers, even empty ones. +
+ +
+
--verbose
Print file names and aperture counts on stdout. +
+ + + +

6.13 Postscript Export

+ + +
+
--psfile <string>
Name of the postscript output file. Can contain a path. +
+ + + +
--drill-helper
Print a centering target in large drill holes. +
+ + + +
--align-marks
Print alignment marks on each sheet. This is meant to ease alignment during exposure. +
+ +
+
--outline
Print the contents of the outline layer on each sheet. +
+ +
+
--mirror
Print mirror image. +
+ +
+
--fill-page
Scale output to make the board fit the page. +
+ +
+
--auto-mirror
Print mirror image of appropriate layers. +
+ +
+
--ps-color
Postscript output in color. +
+ + + +
--ps-bloat <num>
Amount to add to trace/pad/pin edges. +
+ + + +
--ps-invert
Draw objects as white-on-black. +
+ +
+
--media <media-name>
Size of the media, the postscript is fitted to. The parameter +<media-name> can be any of the standard names for paper size: ‘A0’ +to ‘A10’, ‘B0’ to ‘B10’, ‘Letter’, ‘11x17’, +‘Ledger’, ‘Legal’, ‘Executive’, ‘A-Size’, ‘B-size’, +‘C-Size’, ‘D-size’, ‘E-size’, ‘US-Business_Card’, +‘Intl-Business_Card’. +
+ + + +
--psfade <num>
Fade amount for assembly drawings (0.0=missing, 1.0=solid). +
+ +
+
--scale <num>
Scale value to compensate for printer sizing errors (1.0 = full scale). +
+ + + +
--multi-file
Produce multiple files, one per page, instead of a single multi page file. +
+ +
+
--xcalib <num>
Paper width. Used for x-Axis calibration. +
+ +
+
--ycalib <num>
Paper height. Used for y-Axis calibration. +
+ +
+
--drill-copper
Draw drill holes in pins / vias, instead of leaving solid copper. +
+ + + +
--show-legend
Print file name and scale on printout. +
+ +
+ +


+Next: , +Previous: Postscript Export, +Up: Command-Line Options + +
+ +

6.14 Encapsulated Postscript Export

+ + +
+
--eps-file <string>
Name of the encapsulated postscript output file. Can contain a path. +
+ +
+
--eps-scale <num>
Scale EPS output by the parameter ‘num’. +
+ + + +
--as-shown
Export layers as shown on screen. +
+ +
+
--monochrome
Convert output to monochrome. +
+ + + +
--only-visible
Limit the bounds of the EPS file to the visible items. +
+ + + +

6.15 PNG Options

+ + +
+
--outfile <string>
Name of the file to be exported to. Can contain a path. +
+ +
+
--dpi
Scale factor in pixels/inch. Set to 0 to scale to size specified in the layout. +
+ +
+
--x-max
Width of the png image in pixels. No constraint, when set to 0. +
+ +
+
--y-max
Height of the png output in pixels. No constraint, when set to 0. +
+ +
+
--xy-max
Maximum width and height of the PNG output in pixels. No constraint, when set to 0. +
+ +
+
--as-shown
Export layers as shown on screen. +
+ +
+
--monochrome
Convert output to monochrome. +
+ +
+
--only-vivible
Limit the bounds of the exported PNG image to the visible items. +
+ +
+
--use-alpha
Make the background and any holes transparent. +
+ +
+
--format <string>
File format to be exported. Parameter <string> can be ‘PNG’, +‘GIF’, or ‘JPEG’. +
+ +
+
--png-bloat <num><dim>
Amount of extra thickness to add to traces, pads, or pin edges. The parameter +‘<num><dim>’ is a number, appended by a dimension ‘mm’, ‘mil’, or +‘pix’. If no dimension is given, the default dimension is 1/100 mil. +
+ + + +
--photo-mode
Export a photo realistic image of the layout. +
+ +
+
--photo-flip-x
In photo-realistic mode, export the reverse side of the layout. Left-right flip. +
+ +
+
--photo-flip-y
In photo-realistic mode, export the reverse side of the layout. Up-down flip. +
+ +
+ +


+Next: , +Previous: PNG Options, +Up: Command-Line Options + +
+ +

6.16 lpr Printing Options

+ + +
+
--lprcommand <string>
Command to use for printing. Defaults to lpr. This can be used to produce +PDF output with a virtual PDF printer. Example:
+--lprcommand "lp -d CUPS-PDF-Printer". +
+In addition, all Postscript Export options are valid. + +
+ +


+Previous: lpr Printing Options, +Up: Command-Line Options + +
+ +

6.17 nelma Options

+ + +
+
-- basename <string>
File name prefix. +
+ +
+
--dpi <num>
Horizontal scale factor (grid points/inch). +
+ +
+
--copper-height <num>
Copper layer height (um). +
+ +
+
--substrate-height <num>
Substrate layer height (um). +
+ +
+
--substrate-epsilon <num>
Substrate relative epsilon. +
+ + +
+ +


+Next: , +Previous: Command-Line Options, +Up: Top + +
+ +

7 X11 Interface

+ +

+This chapter gives an overview about the additional X11 resources which +are defined by Pcb as well as the defined action routines. + +

+ +
+ +


+Next: , +Up: X11 Interface + +
+ +

7.1 Non-Standard X11 Application Resources

+ +

+In addition to the toolkit resources, Pcb defines the +following resources: + + + + +

absoluteGrid (boolean)
Selects if either the grid is relative to the position where it has changed +last or absolute, the default, to the origin (0,0). + +


alignmentDistance (dimension)
Specifies the distance between the boards outline to the alignment targets. + +


allDirectionLines (boolean)
Enables (default) or disables clipping of new lines to 45 degree angles. + +


backgroundImage (string)
If specified, this image will be drawn as the background for the +board. The purpose of this option is to allow you to use a scan of an +existing layout as a prototype for your new layout. To do this, there +are some limitations as to what this image must be. The image must be +a PPM binary image (magic number ‘P6’). It must have a maximum +pixel value of 255 or less (i.e. no 16-bit images). It must represent +the entire board, as it will be scaled to fit the board dimensions +exactly. Note that it may be scaled unevenly if the image doesn't +have the same aspect ratio of your board. You must ensure that the +image does not use more colors than are available on your system +(mostly this is for pseudo-color displays, like old 8-bit displays). +For best results, I suggest the following procedure using The Gimp: +Load your image (any type). Image->Scale if needed. +Image->Colors->Curves and for each of Red, Green, and Blue channel +move the lower left point up to about the 3/4 line (value 192). This +will make your image pale so it doesn't interfere with the traces +you'll be adding. Image->Mode->Indexed and select, say, 32 colors +with Normal F-S dithering. File->Save As, file type by extension, +use .ppm as the extension. Select Raw formatting. + +


backupInterval (int)
Pcb has an automatic backup feature which saves the current data +every n seconds. The default is 300 seconds. A value of zero disables +the feature. The backup file is named /tmp/PCB.%i.backup by +default (this may have been changed at compilation time via the +BACKUP_NAME +variable in globalconfig.h). +%i is replaced by the process ID. +See also, the command-line option –backup-interval. + +


Bloat (dimension)
Specifies the minimum spacing design rule in mils. + +


connectedColor (color)
All pins, vias, lines and rectangles which are selected during a connection +search are drawn with this color. The default value is determined by +XtDefaultForeground. + +


cross hairColor (color)
This color is used to draw the cross hair cursor. The color is a result of +a XOR operation with the contents of the Layout area. The result +also depends on the default colormap of the X11 server because only +the colormap index is used in the boolean operation and Pcb doesn't +create its own colormap. The default setting is XtDefaultForeground. + +


elementColor (color)
elementSelectedColor (color)
The elements package part is drawn in these colors, for normal and selected +mode, respectively, which both default to XtDefaultForeground. + +


elementCommand (string)
Pcb uses a user defined command to read element files. This resources +is used to set the command which is executed by the users default shell. +Two escape sequences are defined to pass the selected filename (%f) and the +current search path (%p). The command must write the element data +to its standard output. The default value is +
              M4PATH="%p";export M4PATH;echo 'include(%f)' | m4
+
+

Using the GNU version of m4 is highly recommended. +See also, the command-line option –element-command. + +


elementPath (string)
A colon separated list of directories or commands (starts with '|'). +The path is passed to the program specified in elementCommand together +with the selected element name. A specified command will be executed in order +to create entries for the fileselect box. It must write its results to +stdout one entry per line. +See also, the user-command le[!]. + +


fileCommand (string)
The command is executed by the user's default shell whenever existing layout +files are loaded. Data is read from the command's standard output. +Two escape sequences may be specified to pass the selected filename (%f) +and the current search path (%p). The default value is: +
              cat %f
+
+

See also, the command-line option –file-command. + +


filePath (string)
A colon separated list of directories or commands (starts with '|'). +The path is passed to the program specified in fileCommand together +with the selected filename. A specified command will be executed in order +to create entries for the fileselect box. It must write its results to +stdout one entry per line. +See also, the user-command l[!]. + +


fontCommand (string)
Loading new symbol sets also is handled by an external command. You again +may pass the selected filename and the current search path by passing +%f and %p in the command string. Data is read from the commands standard +output. This command defaults to +
              cat %f
+
+

See also, the command-line option –font-command. + +


fontFile (string)
The default font for new layouts is read from this file which is searched +in the directories as defined by the resource fontPath. +Searching is only performed if the filename does not contain a directory +component. +The default filename is default_font. + +


fontPath (string)
This resource, a colon separated list of directories, defines the searchpath +for font files. See also, the resource fontFile. + +


grid (int)
This resources defines the initial value of one cursor step. It defaults +to 100 mil and any changes are saved together with the layout data. + +


gridColor (color)
This color is used to draw the grid. The color is a result of +a INVERT operation with the contents of the Layout area. The result +also depends on the default colormap of the X11 server because only +the colormap index is used in the boolean operation and Pcb doesn't +create its own colormap. The default setting is XtDefaultForeground. + +


invisibleObjectsColor (color)
Elements located on the opposite side of the board are drawn in this color. +The default is XtDefaultForeground. + +


layerColor1..MAX_LAYER (color)
layerSelectedColor1..MAX_LAYER (color)
These resources define the drawing colors of the different layers in +normal and selected state. All values are preset to XtDefaultForeground. + +


layerGroups (string)
The argument to this resource is a colon separated list of comma separated +layer numbers (1..MAX_LAYER). All layers within one group are switched on/off +together. The default setting is 1:2:3:...:MAX_LAYER which means +all layers are handled separately. Grouping layers one to three looks like +1,2,3:4:...:MAX_LAYER + +


layerName1..MAX_LAYER (string)
The default name of the layers in a new layout are determined by these +resources. The defaults are empty strings. + +


libraryCommand (string)
Pcb uses a command to read element data from libraries. +The resources is used to set the command which is executed by the users +default shell. Three escape sequences are defined to pass the selected +filename (%f), the current search path (%p) as well (%a) as the three +parameters template, value and package to the command. +It must write the element data to its standard output. The default value is +
              NONE/share/pcb/oldlib/QueryLibrary.sh %p %f %a
+
+


libraryContentsCommand (string)
Similar to libraryCommand, Pcb uses the command specified +by this resource to list the contents of a library. +
          	NONE/share/pcb/oldlib/ListLibraryContents.sh %p %f
+
+

is the default. + +


libraryFilename (string)
The resource specifies the name of the library. The default value is +pcblib unless changed at compile time +with the LIBRARYFILENAME variable in globalconfig.h. + +


libraryPath (string)
A colon separated list of directories that will be passed to the commands +specified by elementCommand and elementContentsCommand. + +


lineThickness (dimension)
The value, in the range [1..250] (the range may be changed at compile +time with the MIN_LINESIZE and MAX_LINESIZE variables in +globalconfig.h), defines the +initial thickness of new lines. The value is preset to ten mil. + +


media (<predefined> | <width>x<height>+-<left_margin>+-<top_margin>)
The default (user defined) media of the PostScript device. Predefined +values are a3, a4, a5, letter, tabloit, +ledger, legal, and executive. +The second way is to specify the medias width, height and margins in mil. +The resource defaults to a4 size unless changed at compile time +with the DEFAULT_MEDIASIZE variable in globalconfig.h. + +


offLimitColor (color)
The area outside the current maximum settings for width and height is drawn +with this color. The default value is determined by XtDefaultBackground. + +


pinColor (color)
pinSelectedColor(color)
This resource defines the drawing color of pins and pads in both states. +The values are preset to XtDefaultForeground. + +


pinoutFont (string)
This fonts are used to display pin names. There is one font for each zoom +value. The values are preset to XtdefaultFont. + +


pinoutNameLength (int)
This resource limits the number of characters which are displayed for +pin names in the pinout window. By default the string length is limited +to eight characters per name. + +


pinoutOffsetX (int)
pinoutOffsetY (int)
These resources determine the offset in mil of the circuit from the +upper left corner of the window when displaying pinout information. +Both default to 100 mil. + +


pinoutTextOffsetX (int)
pinoutTextOffsetY (int)
The resources determine the distance in mil between the drilling hole of a pin +to the location where its name is displayed in the pinout window. +They default to X:50 and Y:0. + +


pinoutZoom (int)
Sets the zoom factor for the pinout window according to the formula: +scale = 1:(2 power value). Its default value is two which results in +a 1:4 scale. + +


printCommand (string)
Default file for printouts. If the name starts with a '|' the output +is piped through the command. A %f is replaced by the current filename. +There is no default file or command. + +


raiseLogWindow (boolean)
The log window will be raised when new messages arrive if this resource +is set true, the default. + +


ratCommand (string)
Default command for reading a netlist. A %f is replaced by the netlist +filename. Its default value is "cat %f". + +


ratPath (string)
Default path to look for netlist files. It's default value is "." + +


resetAfterElement (boolean)
If set to true, all found connections will be reset before a new +element is scanned. This will produce long lists when scanning the whole +layout for connections. The resource is set to false by default. +The feature is only used while looking up connections of all elements. + +


ringBellWhenFinished (boolean)
Whether to ring the bell (the default) when a possibly lengthy operation +has finished or not. +See also, the command-line option –ring-bell-finished. + +


routeStyle (string)
Default values for the menu of routing styles (seen in the sizes menu). +The string is a comma separated list of name, line thickness, +via diameter, and via drill size. +e.g. "Fat,50,100,40:Skinny,8,35,20:75Ohm,110,110,20" +See also, the command-line option –route-styles and Sizes Menu + +


rubberBandMode (boolean)
Whether rubberband move and rotate (attached lines stretch like +rubberbands) is enabled (the default). + +


saveCommand (string)
This command is used to save data to a layout file. The filename may be +indicated by placing %f in the string. It must read the data from +its standard input. The default command is: +
              cat - > %f
+
+

See also, the command-line option –save-command. + +


saveInTMP (boolean)
Enabling this resource will save all data which would otherwise be lost +in a temporary file /tmp/PCB.%i.save. The file name may +be changed at compile time +with the EMERGENCY_NAME variable in globalconfig.h. +. +%i is replaced by the process ID. +As an example, loading a new layout when the old one hasn't been saved would +use this resource. +See also, the command-line option –save-in-tmp. + +


saveLastCommand (boolean)
Enables the saving of the last entered user command. The option is +disabled by default. +See also, the command-line option –save-last-command. + +


Shrink (dimension)
Specifies the minimum overlap (touching) design rule in mils. + +


size (<width>x<height>)
Defines the width and height of a new layout. The default is +7000x5000 unless changed at compile time +with the DEFAULT_SIZE variable in globalconfig.h. + +


stipllePolygons (boolean)
Determines whether to display polygons on the screen with a stippled +pattern. Stippling can create some amount of transparency so that +you can still (to some extent) see layers beneath polygons. +It defaults to False. + +


textScale (dimension)
The font scaling in percent is defined by this resource. The default is +100 percent. + +


useLogWindow (boolean)
Several subroutines send messages to the user if an error occurs. +This resource determines if they appear inside the log window or as a separate +dialog box. See also, the resource raiseLogWindow and the command line +option -loggeometry. +The default value is true. + +


viaColor (color)
viaSelectedColor (color)
This resource defines the drawing color of vias in both states. +The values are preset to XtDefaultForeground. + +


viaThickness (dimension)
viaDrillingHole (dimension)
The initial thickness and drilling hole of new vias. The values must be in the +range [30..400] (the range may be changed at compile +time with the MIN_PINORVIASIZE and MAX_PINEORVIASIZE variables in +globalconfig.h), with at least 20 +mil of copper. +The default thickness is 40 mil and the default drilling hole is +20 mil. + +


volume (int)
The value is passed to XBell() which sets the volume of the X +speaker. +The value lies in the range -100..100 and it defaults to the maximum volume of +100. + +


warnColor (color)
This resources defines the color to be used for drawing pins and pads when +a warning has been issued about them. + +


zoom (int)
The initial value for output scaling is set according to the following +formula: scale = 1:(2 power value). It defaults to three which results +in an output scale of 1:8. + +
+ +

Refer also to Command-Line Options. + +

+ +


+Next: , +Previous: Resources, +Up: X11 Interface + +
+ +

7.2 Actions

+ +

+All user accessible commands may be bound to almost any X event. Almost +no default binding for commands is done in the binaries, so it is vital for the +application that at least a system-wide application resource file exists. +This file normally resides in the share/pcb directory and +is called Pcb. The bindings to which the manual refers to are the +ones as defined by the shipped resource file. Besides binding an action to +an X11 event, you can also execute any action command using a ":" command +(see User Commands). + +

Take special care about translations related to the functions keys and the +pointer buttons because most of the window managers use them too. +Change the file according to your hardware/software environment. +You may have to replace all occurances of baseTranslations to +translations if you use a X11R4 server. + +

Passing Object as an argument to an action routine causes the object +at the cursor location to be changed, removed or whatever. If more than +one object is located at the cross hair position the smallest type is used. +If there are two of the same type the newer one is taken. +SelectedObjects will handle all selected and visible objects. + + + + + + +

AddRats(AllRats|SelectedRats)
Adds rat-lines to the layout using the loaded netlist file (see the :rn, +User Commands.). Rat lines are added on the active layer using the current +line thickness shown in the status line. +Only missing connectivity is added by the +AddRats command so if, for example, the layout is complete nothing will be added. +Rat lines may be drawn different to other lines on the screen +to make them easier to identify since they cannot appear in a completed layout. +The rat-lines are added in the minimum length straight-line tree pattern +(always ending on pins or pads) that satisfies the missing connectivity in the circuit. +If a SMD pad is unreachable on the active layer, a warning will be issued +about it and the rat-line to that pad will not be generated. +If connections exist on the board which are not listed in the netlist while +AllRats are being added, warning messages will be issued and the affected pins and +pads will be drawn in a special warnColor until the next Notify() event. +If the entire layout agrees completely with the net-list a message informs you that +the layout is complete and no rat-lines are added (since none are needed). +If SelectedRats +is passed as the argument, only those missing connections that might connect among +the selected pins and pads are drawn. +Default: +
          None<Key>w:	AddRats(AllRats)
+          !Shift<Key>w:	AddRats(SelectedRats)
+          None<Key>o:	DeleteRats(AllRats) AddRats(AllRats)
+          !Shift<Key>o:	DeleteRats(SelectedRats) AddRats(SelectedRats)
+
+


ApplyVendor()
Applies an already loaded vendor drill map to the design. +
          ApplyVendor()
+
+


Atomic(Save|Restore|Block|Close)
Controls the undo grouping of sequences of actions. Before the first action +in a group, Atomic(Save) should be issued. After each action that might +be undoable, Atomic(Restore) should be issued. Atomic(Block) concludes +and save the undo grouping if there was anything in the group to undo. +Atomic(Close) concludes and save the undo grouping even if nothing was +actually done. Thus it might produce an "empty" undo. This can be useful +when you want to use undo in a group of actions. + +


Bell([-100..100])
Rings the bell of your display. If no value is passed the setting +of the resource volume will be used. + +


ChangeClearSize(Object, value[, unit])
ChangeClearSize(SelectedPins|SelectedVias, value[, unit])
The effect of this action depends on if the soldermask display is presently +turned on or off. If soldermask is displayed, then the soldermask +relief size will be changed. If soldermask display is turned off, +then the clearance to polygons will be changed. +unit is "mil" or "mm". If not specified the units will default +to the internal unit of 0.01 mil. +
          !Mod1<Key>k:      ChangeClearSize(Object, +2, mil)
+          !Mod1 Shift<Key>k: ChangeClearSize(Object, -2, mil)
+
+


ChangeDrillSize(Object, value[, unit])
ChangeDrillSize(SelectedPins|SelectedVias, value[, unit])
This action routine changes the drilling hole of pins and vias. +If value starts with + or -, then it adds (or subtracts) +value from the current hole diameter, otherwise it sets the +diameter to the value. +unit is "mil" or "mm". If not specified the units will default +to the internal unit of 0.01 mil. +Default: +
          !Mod1<Key>s:       Change2ndSize(Object, +5, mil)
+          !Mod1 Shift<Key>s: Change2ndSize(Object, -5, mil)
+
+

ChangeFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square,0|1)
Sets/clears the indicated flag. This adds/removes thermals, adds/removes the flag +which indicates a pin/pad should be square, or adds/removes the flag which +indicates a pin/pad should be octagonal. +
          :ChangeFlag(SelectedVias,thermal,1)
+          :ChangeFlag(SelectedPads,square,0)
+
+


ChangeHole(Object|SelectedVias)
This action routine converts a via to and from a hole. A hole is +a via that has no copper annulus. The drill size for the via +determines the hole diameter. +
          !Ctrl<Key>h:	ChangeHole(Object)
+
+


ChangeName(Object)
ChangeName(Layer|Layout)
Changes the name of the visible object at the cursor location. A text object +doesn't have a name therefore the text string itself is changed. +The element name currently used for display is always the one changed with this +command. +See Display(Description|NameOnPCB|Value) for details. +Passing Layer changes the current layers name. +Default: +
          None<Key>n: ChangeName(Object)
+
+

ChangeOctagon(Object|SelectElements|SelectedPins|SelectedVias|Selected)
Toggles what shape the affected pin(s) or via(s) will be drawn when they +are not square. The shape will either be round or octagonal. +Default: +
          !Ctrl<Key>o: ChangeOctagon(Object)
+
+


ChangePinName(ElementName, PinNumber, PinName)
Changes the name for a specified pin or pad number on a specified element. +This action is typically used to forward annotate pin/pad names from a schematic +to the layout. +
          ChangePinName(U1, 14, VDD)
+
+


ChangeSize(Object, value[, unit])
ChangeSize(SelectedLines|SelectedPins|SelectedVias, value[, unit])
ChangeSize(SelectedPads|SelectedTexts|SelectedNames, value[, unit])
ChangeSize(SelectedElements, value[, unit])
To change the size of an object you have to bind these action to some +X event (or use :ChangeSize(...)). If value begins with +a + or - then the value will be added (or subtracted) from the current +size, otherwise the size is set equal to value. Range checking is +done to insure that none of the maximum/minimums of any size are violated. +If Object is passed then a single object at the cursor location is +changed. If any of the Selected arguments are passed then all selected +and visible objects of that type are changed. If the type being modified is +an element, then the thickness of the silkscreen lines defining the element +is changed. +unit is "mil" or "mm". If not specified the units will default +to the internal unit of 0.01 mil. +Default: +
          None<Key>s:   ChangeSize(Object, +5)
+          !Shift<Key>s: ChangeSize(Object, -5)
+
+


ChangeSquare(Object|SelectedElements|SelectedPins)
Toggles the setting of the square flag. The flag is used to identify a +certain pin, normally the first one, of circuits. It is also used to +make SMD pads have square ends. +
          None<Key>q:   ChangeSquare(Object)
+
+

ClrFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square)
Clears the indicated flag. This removes thermals, removes the flag +which indicates a pin/pad should be square, or removes the flag which +indicates a pin/pad should be octagonal. +
          :ClrFlag(SelectedVias,thermal)
+
+


Command()
Calling Command() pops up an input line at the bottom of the window +which allows you to enter commands. Including all action commands! +The dialog ends when None<Key>Return +to confirm or None<Key>Escape to abort is entered. +Default: +
          <Key>colon: Command()
+
+


Connection(Find)
Connection(ResetFoundLinesAndRectangles|ResetPinsViasAndPads|Reset)
The Connection() action is used to mark all connections from one pin, +line or via to others. +The ResetFoundLinesAndRectangles, ResetFoundPinsAndVias and +Reset arguments may be used to reset all marked lines and rectangles, +vias and pins or all of them. The search starts with the pin or via +at the cursor position. All found objects are drawn with the color +defined by the resource connectedColor. +See also, Display(Description|NameOnPCB|Value). +Default: +
          !Shift<Key>c: Connection(Reset)
+          None<Key>f:   Connection(Find)
+          !Shift<Key>f: Connection(Reset)
+
+


DeleteRats(AllRats|SelectedRats)
This routine deletes either all rat-lines in the layout, or only +the selected and visible ones. Non-rat-lines and other layout +objects are unaffected. +Default: +
          None<Key>e:   DeleteRats(AllRats)
+          !Shift<Key>e: DeleteRats(SelectedRats)
+
+


DisableVendor()
Disables automatic drill size mapping to the loaded vendor drill table. +
          DisableVendor()
+
+


DisperseElements(All|Selected)
Disperses either all elements or only the selected elements in the +layout. This action should be used at the +start of a design to spread out all footprints before any placement or +routing is done. +
          DisperseElements(All)
+
+


Display(Description|NameOnPCB|Value)
Display(Toggle45Degree|CycleClip)
Display(Grid|ToggleGrid)
Display(ToggleRubberBandMode)
Display(Center|ClearAndRedraw|Redraw)
Display(Pinout|PinOrPadName)
This action routines handles some output related settings. It is +used to center the display around the cursor location and to redraw the +output area optionally after clearing the window. +Centering is done with respect to the grid setting. Displaying the +grid itself may be switched on and off by Grid but only if +the distance between two pixels exceeds 4 pixels. +Pcb is able to handle several labels of an element. One of them +is a description of the functionality (eg resistor), the second should be +a unique identifier (R1) whereas the last one is a value (100k). +The Display() action selects which of the names is displayed. +It also controls which name will be affected by the ChangeName command. +If ToggleGrid is passed, Pcb changes between relative +('rel' in the statusline) and absolute grid (an 'abs' in the statusline). +Relative grid means the pointer position when the command is issued is +used as the grid origin; while (0,0) is used in the absolute grid case. +Passing Pinout displays the pinout of the element at the current +cursor location whereas PinOrPadName toggles displaying of the +pins or pads name under the cursor. If none of them matches but the cursor +is inside of an element, the flags is toggled for all of its pins and pads. +For details about rubberbands see also the details about Mode. +Default: +
          None<Key>c:  Display(Center)
+          None<Key>d:  Display(PinOrPadName)
+          !Shift<Key>d: Display(Pinout)
+          None<Key>r:  Display(ClearAndRedraw)
+          None<Key>.:  Display(Toggle45Degree)
+          None<Key>/:  Display(CycleClip)
+
+


DRC()
Initiates design rule checking of the entire layout. Must be repeated +until no errors are found. + +

ExecuteFile(filename)
Executes the PCB actions contained in the specified file. +This can be used to automate a complex sequence of operations. +
          :ExecuteFile(custom.cmd)
+
+

The command file contains a list of PCB actions. Blank lines +are ignored and lines starting with a # are treated as comment +lines. For example +

          # This is a comment line
+          Display(Grid)
+          SetValue(Zoom,2)
+          DRC()
+
+


EditLayerGroups()
Pops up a dialog box to edit the layergroup setting. The function is also +available from the Objects menu. +There are no defaults. + +


EnableVendor()
Enables automatic drill size mapping to the loaded vendor drill table. +
          EnableVendor()
+
+


Load(ElementToBuffer|Layout|LayoutToBuffer|Nelist)
This routine pops up a fileselect box to load layout, element data, +or netlist. +The passed filename for layout data is saved and may be reused. +ElementToBuffer and LayoutToBuffer load the data into the +current buffer. +There are no defaults. + +


LoadVendor(vendorfile)
Loads the specified vendor resource file. +
          LoadVendor(myvendor.res)
+
+


MarkCrosshair()
This routine marks the current cursor location with an X, and then +the cursor display shows both absolute position and position relative to +the mark. If a mark is already present, this routine removes it and +stops displaying relative cursor coordinates. +Defaults: +
          !Ctrl<key>m:	MarkCrosshair()
+
+


Mode(Copy|InsertPoint|Line|Move|None|PasteBuffer|Polygon|Thermal)
Mode(Remove|Rectangle|RubberbandMove|Text|Via)
Mode(Cycle)
Mode(Notify)
Mode(Save|Restore)
Switches to a new mode of operation. The active mode is displayed by a thick +line around the matching mode selector button. +Most of the functionality of Pcb is implemented by selecting a mode +and calling Mode(Notify). The arguments Line, Polygon, +Rectangle, Text and Via are used to create the +appropriate object whenever Mode(Notify) is called. Some of them, +such as Polygon, need more than one call for one object to be created. +InsertPoint adds points to existing polygons or lines. +Save and Restore are used to temporarily save the mode, switch +to another one, call Mode(Notify) and restore the saved one. Have +a look at the application resource file for examples. +Copy and Move modes are used to change an object's location and, +optionally, to create a new one. The first call of Mode(Notify) attaches +the object at the pointer location to the cross hair whereas the second +one drops it to the layout. The rubberband version of move performs the +move while overriding the current rubberband mode. +Passing PasteBuffer attaches the contents of the currently selected +buffer to the cross hair. Each call to Mode(Notify) pastes this contents +to the layout. Mode(Cycle) cycles through the modes available in the +mode-button pallet. +Mode(None) switches all modes off. +Default: +
          <Key>Escape:             Mode(None)
+          <Key>space:              Mode(Cycle)
+          None<Key>BackSpace:      Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore)
+          None<Key>Delete:         Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore)
+          None<Key>F1:             Mode(Via)
+          None<Key>F2:             Mode(Line)
+          None<Key>F3:             Mode(PasteBuffer)
+          None<Key>F4:             Mode(Rectangle)
+          None<Key>F5:             Mode(Text)
+          None<Key>F6:             Mode(Polygon)
+          None<Key>F7:             Mode(Thermal)
+          None<Key>F8:		 Mode(Arc)
+          None<Key>Insert:         Mode(InsertPoint)
+          None<Key>[:              Mode(Save) Mode(Move) Mode(Notify)
+          None<Key>]:              Mode(Notify) Mode(Restore)
+          None<Btn1>:          Mode(Notify)
+          !Shift Ctrl<Btn1>:   Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore)
+          None<Btn2Down>:          Mode(Save) Mode(Move) Mode(Notify)
+          None<Btn2Up>:            Mode(Notify) Mode(Restore)
+          !Mod1<Btn2Down>:       Mode(Save) Mode(Copy) Mode(Notify)
+          !Mod1<Btn2Up>:         Mode(Notify) Mode(Restore)
+          Shift BTNMOD<Btn2Down>: Mode(Save) Mode(RubberbandMove) Mode(Notify)
+
+


MovePointer(delta_x, delta_y)
With this function it is possible to move the cross hair cursor by using the +cursor keys. The X server's pointer follows because the necessary +events are generated by Pcb. All movements are performed with respect +to the currently set grid value. +Default: +
          None<Key>Up:      MovePointer(0, -1)
+          !Shift<Key>Up:    MovePointer(0, -10)
+          None<Key>Down:    MovePointer(0, 1)
+          !Shift<Key>Down:  MovePointer(0, 10)
+          None<Key>Right:   MovePointer(1, 0)
+          !Shift<Key>Right: MovePointer(10, 0)
+          None<Key>Left:    MovePointer(-1, 0)
+          !Shift<Key>Left:  MovePointer(-10, 0)
+
+


MoveToCurrentLayer(Object|SelectedObjects)
The function moves a single object at the cross hair location or all selected +objects to the current layer. Elements are not movable by this function. +They have to be deleted and replaced on the other side. +If a line segment is moved and the movement would result in a loss of +connectivity to another segment then via(s) are automatically added to +maintain the connectivity. +
          None<Key>m:       MoveToCurrentLayer(Object)
+          !Shift<Key>m:     MoveToCurrentLayer(SelectedObjects)
+
+


New()
Clear the current layout and starts a new one after entering its name. +Refer to the resource backup for more information. +No defaults. + +


PasteBuffer(AddSelected|Clear|1..5)
PasteBuffer(Rotate, 1..3)
PasteBuffer(Convert)
This action routine controls and selects the pastebuffer as well as all +cut-and-paste operations. Passing a buffer number selects one in of the +range 1..5. The statusline is updated with the new number. +Rotate performs a number of 90 degree counter clockwise rotations +of the buffer contents. AddSelected as first argument copies all +selected and visible objects into the buffer. Passing Clear removes +all objects from the currently selected buffer. Convert causes +the contents of the buffer (lines, arc, vias) to be converted into an +element definition. Refer to Pastebuffer +for examples. +Default: +
          !Ctrl<Key>x:       PasteBuffer(Clear) PasteBuffer(AddSelected)
+          		   Mode(PasteBuffer)
+          !Shift Ctrl<Key>x: PasteBuffer(Clear) PasteBuffer(AddSelected)
+          		   RemoveSelected() Mode(PasteBuffer)
+          !Mod1<Key>c:       PasteBuffer(Clear) PasteBuffer(AddSelected)
+          !Mod1<key>x:       PasteBuffer(Clear) PasteBuffer(AddSelected)
+          		   RemoveSelected()
+          !Shift<Key>1:      PasteBuffer(1)
+          !Shift<Key>2:      PasteBuffer(2)
+          !Shift<Key>3:      PasteBuffer(3)
+          !Shift<Key>4:      PasteBuffer(4)
+          !Shift<Key>5:      PasteBuffer(5)
+          None<Key>F3:       Mode(PasteBuffer)
+
+


Polygon((Close|PreviousPoint)
Polygons need a special action routine to make life easier. Calling +Polygon(PreviousPoint) resets the newly entered corner to the +previous one. The Undo action will call Polygon(PreviousPoint) +when appropriate to do so. Close creates the final +segment of the polygon. This may fail if clipping to 45 degree +lines is switched on, in which case a warning is issued. +Default: +
          None<Key>p:             Polygon(Close)
+          !Shift<Key>p:           Polygon(Close)
+
+


Print()
Pops up a print control box that lets you select the output +device, scaling and many more options. Each run creates all +files that are supported by the selected device. These are +mask files as well as drilling files, silk screens and so on. The table +shows the filenames for all possible files: +
          	POSIX (extension)             8.3 filename
+          		---------------------------------------------
+          		*_componentmask.*             cmsk.*
+          		*_componentsilk.*             cslk.*
+          		*_soldermask.*                smsk.*
+          		*_soldersilk.*                sslk.*
+          		*_drill.*                     dril.*
+          		*_groundplane.*               gpl.*
+          		*_group[1..8].*     [..8].*
+
+

The output may be sent to a post-processor by starting the filename with the +pipe ("|") character. Any "%f" in a command is replaced +with the current filename. The function is available from the file menu. +There are no defaults. + +


Quit()
Quits the application after confirming the operation. +Default: +
          <Message>WM_PROTOCOLS: Quit()
+
+


Redo()
This routine allows you to recover from the last undo command. +You might want to do this if you thought that undo was going to +revert something other than what it actually did (in case you +are confused about which operations are un-doable), or if you +have been backing up through a long undo list and over-shoot +your stopping point. Any change that is made since the undo +in question will trim the redo list. For example if you add +ten lines, then undo three of them you could use redo to put +them back, but if you move a line on the board before performing +the redo, you will lose the ability to "redo" the three "undone" lines. +Default: +
          !Shift<Key>r:	Redo()
+
+


RemoveSelected()
This routine removes all visible and selected objects. +There are no defaults. + +


Report(Object|DrillReport)
This routine pops up a dialog box describing the various +characteristics of an object (or piece of an object such as a pad or pin) +in the layout at the cursor position, or a report about all of the +drill holes in the layout. +There are no defaults. + +


RouteStyle(1|2|3|4)
This routine copies the sizes corresponding to the numbered route style +into the active line thickens, via diameter, and via drill size. +Defaults: +
          !Ctrl<Key>1: RouteStyle(1)
+          ...
+          !Ctrl<Key>NUM_STYLES: RouteStyle(NUM_STYLES)
+
+

The variable NUM_STYLES is set at compile time in +globalconfig.h. + +


Save(Layout|LayoutAs)
Save(AllConnections|AllUnusedPins|ElementConnections)
Passing Layout saves the layout using the file from which it was +loaded or, if it is a new layout, calls Save(LayoutAs) which queries +the user for a filename. +The values: AllConnections, AllUnusedPins and +ElementConnections start a connection scan and save all connections, +all unused pins or the connections of a single element to a file. +There are no defaults. + +


Select(All|Block|Connection|ToggleObject)
Select(ElementByName|ObjectByName|PadByName|PinByName)
Select(TextByName|ViaByName)
Toggles either the selection flag of the object at the cross hair position +(ToggleObject) or selects all visible objects, all inside a +rectangle or all objects which have been found during the last connection +scan. The ByName functions use a Regular Expressions search, +always case insensitive, to select the objects. +Default: +
          None<Btn3Down>:  Select(ToggleObject)
+          None<Btn3Down>,None<Btn3Motion>: See resource file - this is complex
+
+

SetFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square)
Sets the indicated flag. This adds thermals, sets the flag +which indicates a pin/pad should be square, or sets the flag which +indicates a pin/pad should be octagonal. +
          :SetFlag(Selected,thermal)
+
+


SetValue(Grid|LineSize|TextScale|ViaDrillingHole|ViaSize|Zoom, value)
Some internal values may be changed online by this function. +The first parameter specifies which data has to be changed. The other one +determines if the resource is set to the passed value, if value is +specified without sign, or increments/decrements if it is specified with +a plus or minus sign. +The function doesn't change any existing object only the initial values of +new objects. Use the ChangeSize() and ChangeDrillSize() +to change existing objects. +Default: +
          None<Key>g:        SetValue(Grid, +5)
+          !Shift<Key>g:      SetValue(Grid, -5)
+          None<Key>l:        SetValue(LineSize, +5)
+          !Shift<Key>l:      SetValue(LineSize, -5)
+          None<Key>t:        SetValue(TextScale, +10)
+          !Shift<Key>t:      SetValue(TextScale, -10)
+          None<Key>v:        SetValue(ViaSize, +5)
+          !Shift<Key>v:      SetValue(ViaSize, -5)
+          !Mod1<Key>v:       SetValue(ViaDrillingHole, +5)
+          !Mod1 Shift<Key>v: SetValue(ViaDrillingHole, -5)
+          None<Key>z:        SetValue(Zoom, -1)
+          !Shift<Key>z:      SetValue(Zoom, +1)
+
+


SwapSides()
This routine changes the board side you are viewing. +Default: +
          None<Key>Tab:      SwapSides()
+
+


SwitchDrawingLayer(value)
Makes layer number 1..MAX_LAYER the current one. +Default: +
          None<Key>1:        SwitchDrawingLayer(1)
+          ...
+          None<Key>MAX_LAYER:        SwitchDrawingLayer(MAX_LAYER)
+
+


ToggleHideName(Object|SelectedElements)
Toggles whether the element's name is displayed or hidden. If it +is hidden you won't see it on the screen and it will not appear +on the silk layer when you print the layout. +
          None<Key>h:	ToggleHideName(Object)
+          !Shift<Key>h:	ToggleHideName(SelectedElements)
+
+


ToggleVendor()
Toggles automatic drill size mapping to the loaded vendor drill table. +
          ToggleVendor()
+
+


ToggleVisibility(Layer)
Toggles the visibility of the layer. +
          Mod1<Key>1:	ToggleVisibility(1)
+          Mod1<Key>2:	ToggleVisibility(2)
+          Mod1<Key>3:	ToggleVisibility(3)
+          Mod1<Key>4:	ToggleVisibility(4)
+
+


Undo()
Undo(ClearList)
The unlimited undo feature of Pcb allows you to recover +from most operations that materially affect you work. +Calling Undo() without any parameter recovers +from the last (non-undo) operation. ClearList is used to release the +allocated memory. ClearList is called whenever a new layout is started +or loaded. See also Redo. +Default: +
          None<Key>u:        Undo()
+          !Shift Ctrl<Key>u: Undo(ClearList)
+
+


UnloadVendor()
Unloads the loaded vendor drill table. +
          UnloadVendor()
+
+


Unselect(All|Block|Connection)
Unselects all visible objects, all inside a rectangle or all objects which +have been found during the last connection scan. +Default: +
          !Shift <Btn3Down>: Mode(Save) Mode(None) Unselect(Block)
+          !Shift <Btn3Up>:   Unselect(Block) Mode(Restore)
+
+
+ +
+ +


+Previous: Actions, +Up: X11 Interface + +
+ +

7.3 Default Translations

+ +

+This section covers some default translations of key and button events as +defined in the shipped default application resource file. Most of them have +already been listed in Actions. Pcb makes use of a nice X11 +feature; calling several action routines for one event. + + + + + + +

None<Key>BackSpace:
None<key>Delete:
!Shift<Key>BackSpace:
!Shift Ctrl<Btn1>:
The object at the cursor location is removed by None<Key>BackSpace or +Shift Ctrl<Btn1> whereas Shift<Key>BackSpace also removes +all other objects that are fully-connected to the one at the cursor location. + +


!Mod1 Ctrl<Key>Left:
!Mod1 Ctrl<Key>Right:
!Mod1 Ctrl<Key>Up:
!Mod1 Ctrl<Key>Down:
Scroll one page in one of the four directions. + +


None<Key>Left:, !Shift<Key>Left:
None<Key>Right:, !Shift<Key>Right:
None<Key>Up:, !Shift<Key>Up:
None<Key>Down:, !Shift<Key>Down:
Move cross hair either one or ten points in grid. + +


None<Key>Return:
Finished user input, selects the 'default' button of dialogs. + +


None<Key>Escape:
Mode(Reset), aborts user input, selects the 'abort' button of +dialogs or resets all modes. + +


None<Btn2Down>, Btn2<Motion>, None<Btn2Up>:
!Mod1<Btn2Down>, Btn2<Motion>, !Mod1<Btn2Up>:
The first sequence moves the object or element name at the cursor location. +The second one copies the objects. Copying isn't available for +element names. + +
+ + +
+ +


+Next: , +Previous: X11 Interface, +Up: Top + +
+ +

8 File Formats

+ +

+All files used by Pcb are read from the standard output of a command +or written to the standard input of one as plain seven bit ASCII. This +makes it possible to use any editor to change the contents of a layout file. +It is the only way for element or font description files to be created. +To do so you'll need to study the example files example/* and +default_font which are shipped with Pcb. +For an overview refer to Intro. + +

The following sections provide the necessary information about the syntax of +the files. +Netlist files are not created by Pcb, but it does use them. For information +on the format of a netlist file see the :rn, +User Commands. +The commands described allow you to add almost any additional +functionality you may need. Examples are compressed read and write access as +well as archives. The commands themselves are defined by the resources +elementCommand, fileCommand, fontCommand, +libraryCommand, libraryContentsCommand and saveCommand. +Note that the commands are not saved along with the data. +It is considered an advantage to have the layout file contain all necessary +information, independent of any other files. + +

One thing common to all files is they may include comments, newlines, +and carriage returns at any place except within quoted strings. + +

+ +
+ +


+Next: , +Up: File Formats + +
+ +

8.1 Pad and Line Representation

+ +

+Pads and lines (copper traces, silk screen lines, etc) are represented by the +line end points and the aperture used to draw the line. It is important to +understand this when creating the pads for a new footprint. The following figure +illustrates a pad or line which is drawn using a square aperture. The end +points (X0,Y0), (X1,Y1) specify the center of the aperture. The size parameter +specifies the size of the aperture. + +

Pad Layout
+ +

Pads and lines are represented in this way because this is how lines are +specified in RS-274X (Gerber) files which are used for creating +the masks used in board manufacturing. In fact, older mask making +equipment created lines in precisely this fashion. A physical aperture was +used to pass light through onto a photosensitive film. + +

+ +


+Next: , +Previous: Pad and Line Representation, +Up: File Formats + +
+ +

8.2 Layout File Format

+ +

+The layout file describes a complete layout including symbols, vias, +elements and layers with lines, rectangles and text. This is the most +complex file of all. As Pcb has evolved, the file format has +changed several times to accommodate new features. Pcb has +always been able to read all older versions of the .pcb file. +This allows the migration of older designs to newer versions of the +program. Obviously older versions of Pcb will not be able +to properly read layout files stored in newer versions of the file +format. + +

In practice it is very common for footprint libraries to contain +elements which have been defined in various versions of the Pcb +file format. When faced with trying to understand an element file or +layout file which includes syntax not defined here, the best approach +is to examine the file src/parse_y.y which is the definitive +definition of the file format. + +

The PCB layout file contains the following contents, in this order (individual items +are defined in File Syntax: + +

+
PCB
This names the board and sets its size + +
Grid
Optional. + +
Cursor
Optional. + +
Flags
Optional. + +
Groups
Optional. + +
Styles
Optional. + +
Symbols
Optional. + +
Vias, Rats, Layers, and Elements
These may occur in any order, at this point in the file. + +
Netlists
Optional. + +
+ +
+ +


+Next: , +Previous: Layout File, +Up: File Formats + +
+ +

8.3 Element File Format

+ +

+Element files are used to describe one component which then may be used +several times within one or more layouts. You will normally split the +file into two parts, one for the pinout and one for the package description. +Using m4 allows you to define pin names as macros in one file and +include a package description file which evaluates the macros. See +the resource elementCommand for more information. The pins (and pads) +must appear in sequential order in the element file (new in 1.5) so that +pin 1 must be the first PIN(...) in the file. + +

Doing things this way makes it possible to use one package file for several +different circuits. See the sample files dil*. + +

The lowest x and y coordinates of all sub-objects of an element are +used as an attachment point for the cross hair cursor of the main +window, unless the element has a mark, in which case that's the +attachment point. + +

+ +


+Next: , +Previous: Element File, +Up: File Formats + +
+ +

8.4 Font File Format

+ +

+A number of user defined Symbols are called a font. There is only one per +layout. All symbols are made of lines. See the file default_font +as an example. + +

The lowest x and y coordinates of all lines of a font are transformed to (0,0). + +

+ +


+Next: , +Previous: Font File, +Up: File Formats + +
+ +

8.5 Netlist File Format

+ +

+Netlists read by Pcb must have this simple text form: + +

     netname [style] NAME-PINNUM NAME2-PINNUM2 NAME3-PINNUM3 ... [\]
+
+

for each net on the layout. +where "netname" is the name of the net which must be unique for each +net, [style] is an optional route-style name, +NAME is the layout-name name given to an element, +and PINNUM is the (usually numeric) +pin number of the element that connects to the net +(for details on pin numbering see Element Objects). +Spaces or tabs separate the fields. +If the line ends with a "\" the +net continues on the next line and the "\" is treated exactly as if it +were a space. If a NAME ends with a lower-case letter, +all lower-case letters are stripped from the end of the NAME to determine the +matching layout-name name. For example: + +

          Data U1-3 U2abc-4 FLOP1a-7 Uabc3-A9
+
+

specifies that the net called "Data" should have +pin 3 of U1 connected to pin 4 of U2, to pin 7 of +FLOP1 and to pin A9 of Uabc3. Note that element name and +pin number strings are case-sensitive. +It is up to you to name the elements so that their layout-name names +agrees with the netlist. + +

+ +


+Next: , +Previous: Netlist File, +Up: File Formats + +
+ +

8.6 Library Contents File Format

+ +

+There is nothing like a special library format. The ones that have been +introduced in 1.4.1 just use some nice (and time consuming) features of GNU +m4. The only predefined format is the one of the contents file +which is read during startup. It is made up of two basic line types: + +

     menu entry      = "TYPE="name
+     contents line   = template":"package":"value":"description
+     name            = String
+     template        = String
+     package         = String
+     value           = String
+     description     = String
+     String          = <anything except ":", "\n" and "\r">
+
+

No leading white spaces or comments are allowed in this file. If you need +either one, define a command that removes them before loading. Have a look +to the libraryContentsCommand resource. + +

The menu entry will appear in the selection menu at the top and of the +library window. + +

+ +


+Next: , +Previous: Library Contents File, +Up: File Formats + +
+ +

8.7 Library File Format

+ +

+This section provides an overview about the existing m4 definitions +of the elements. There are basically two different types of files. One +to define element specific data like the pinout, package and so on, the +other to define the values. For example the static RAM circuits 43256 and +62256 are very similar. They therefore share a common definition in the +macro file but are defined with two different value labels. + +

The macro file entry: +

     define(`Description_43256_dil', `SRAM 32Kx8')
+     define(`Param1_43256_dil', 28)
+     define(`Param2_43256_dil', 600)
+     define(`PinList_43256_dil', ``pin1', `pin2', ...')
+
+

And the list file: +

     43256_dil:N:43256:62256
+
+

The macro must define a description, the pin list and up to two additional +parameters that are passed to the package definitions. The first one is +the number of pins whereas the second one defines for example the width +of a package. + +

It is very important to select a unique identifier for each macro. In +the example this would be 43256_dil which is also the templates name. +It is required by some low-level macros that +Description_, Param1_, Param2_ and PinList_ are perpended. + +

The list file uses a syntax: +

     template:package:value[:more values]
+
+

This means that the shown example will create two element entries with the +same package and pinout but with different names. + +

A number of packages are defined in common.m4. Included are: + +

     DIL packages with suffix D, DW, J, JD, JG, N, NT, P
+     PLCC
+     TO3
+     generic connectors
+     DIN 41.612 connectors
+     zick-zack (SD suffix)
+     15 pin multiwatt
+
+

If you are going to start your own library please take care about m4 +functions. Be aware of quoting and so on and, most important check your +additional entry by calling the macro: + +

     CreateObject(`template', `value', `package suffix')
+
+

If quoting is incorrect an endless loop may occur (broken by a out-of-memory +message). + +

The scripts in the lib directory handle the creation of libraries +as well as of their contents files. Querying is also supported. + +

I know quite well that this description of the library implementation is +not what some out there expect. But in my opinion it's much more useful to +look at the comments and follow the macros step by step. + +

+ +


+Next: , +Previous: Library File, +Up: File Formats + +
+ +

8.8 File Syntax

+ +

+ + + +

A special note about units: Older versions of pcb used mils +(1/1000 inch) as the base unit; a value of 500 in the file meant +half an inch. Newer versions uses a "high resolution" syntax, +where the base unit is 1/100 of a mil (0.000010 inch); a value of 500 in +the file means 5 mils. As a general rule, the variants of each entry +listed below which use square brackets are the high resolution formats +and use the 1/100 mil units, and the ones with parentheses are the older +variants and use 1 mil units. Note that when multiple variants +are listed, the most recent (and most preferred) format is the first +listed. + +

Symbolic and numeric flags (SFlags and NFlags) are described in +Object Flags. + +

+ +
+ +


+Next: , +Up: File Syntax + +
+ +

8.8.1 Arc

+ + +

+
Arc [X Y Width Height Thickness Clearance StartAngle DeltaAngle SFlags]
+Arc (X Y Width Height Thickness Clearance StartAngle DeltaAngle NFlags)
+Arc (X Y Width Height Thickness StartAngle DeltaAngle NFlags)
+
+
+ +

+
X Y
Coordinates of the center of the arc. +
Width Height
The width and height, from the center to the edge. The bounds of the +circle of which this arc is a segment, is thus 2*Width by +2*Height. +
Thickness
The width of the copper trace which forms the arc. +
Clearance
The amount of space cleared around the arc when the line passes +through a polygon. The clearance is added to the thickness to get the +thickness of the clear; thus the space between the arc and the polygon +is Clearance/2 wide. +
StartAngle
The angle of one end of the arc, in degrees. In PCB, an angle of zero +points left (negative X direction), and 90 degrees points down +(positive Y direction). +
DeltaAngle
The sweep of the arc. This may be negative. Positive angles sweep +counterclockwise. +
SFlags
Symbolic or numeric flags. +
NFlags
Numeric flags. +
+ + +
+ +


+Next: , +Previous: Arc syntax, +Up: File Syntax + +
+ +

8.8.2 Attribute

+ + +

+
Attribute ("Name" "Value")
+
+
+ +

Attributes allow boards and elements to have arbitrary data attached +to them, which is not directly used by PCB itself but may be of use by +other programs or users. + +

+
Name
The name of the attribute + +
Value
The value of the attribute. Values are always stored as strings, even +if the value is interpreted as, for example, a number. + +
+ + +
+ +


+Next: , +Previous: Attribute syntax, +Up: File Syntax + +
+ +

8.8.3 Connect

+ + +

+
Connect ("PinPad")
+
+
+ +

+
PinPad
The name of a pin or pad which is included in this net. Pin and Pad +names are named by the refdes and pin name, like "U14-7" for +pin 7 of U14, or "T4-E" for pin E of T4. +
+ + +
+ +


+Next: , +Previous: Connect syntax, +Up: File Syntax + +
+ +

8.8.4 Cursor

+ + +

+
Cursor [X Y Zoom]
+Cursor (X Y Zoom)
+
+
+ +

+
X Y
Location of the cursor when the board was saved. +
Zoom
The current zoom factor. Note that a zoom factor of "0" means 1 mil +per screen pixel, N means 2^N mils per screen pixel, etc. The +first variant accepts floating point numbers. The special value +"1000" means "zoom to fit" +
+ + +
+ +


+Next: , +Previous: Cursor syntax, +Up: File Syntax + +
+ +

8.8.5 DRC

+ + +

+
DRC [Bloat Shrink Line Silk Drill Ring]
+DRC [Bloat Shrink Line Silk]
+DRC [Bloat Shrink Line]
+
+
+ +

+
Bloat
Minimum spacing between copper. +
Shrink
Minimum copper overlap to guarantee connectivity. +
Line
Minimum line thickness. +
Silk
Minimum silk thickness. +
Drill
Minimum drill size. +
Ring
Minimum width of the annular ring around pins and vias. +
+ + +
+ +


+Next: , +Previous: DRC syntax, +Up: File Syntax + +
+ +

8.8.6 Element

+ + +

+
Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags] (
+Element (NFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TNFlags) (
+Element (NFlags "Desc" "Name" "Value" TX TY TDir TScale TNFlags) (
+Element (NFlags "Desc" "Name" TX TY TDir TScale TNFlags) (
+Element ("Desc" "Name" TX TY TDir TScale TNFlags) (
+   ... contents ...
+)
+
+
+ +

+
SFlags
Symbolic or numeric flags, for the element as a whole. +
NFlags
Numeric flags, for the element as a whole. +
Desc
The description of the element. This is one of the three strings +which can be displayed on the screen. +
Name
The name of the element, usually the reference designator. +
Value
The value of the element. +
MX MY
The location of the element's mark. This is the reference point +for placing the element and its pins and pads. +
TX TY
The upper left corner of the text (one of the three strings). +
TDir
The relative direction of the text. 0 means left to right for +an unrotated element, 1 means up, 2 left, 3 down. +
TScale
Size of the text, as a percentage of the “default” size of of the +font (the default font is about 40 mils high). Default is 100 (40 +mils). +
TSFlags
Symbolic or numeric flags, for the text. +
TNFlags
Numeric flags, for the text. +
+ +

Elements may contain pins, pads, element lines, element arcs, +attributes, and (for older elements) an optional mark. Note that +element definitions that have the mark coordinates in the element +line, only support pins and pads which use relative coordinates. The +pin and pad coordinates are relative to the mark. Element definitions +which do not include the mark coordinates in the element line, may +have a Mark definition in their contents, and only use pin and pad +definitions which use absolute coordinates. + + +

+ +


+Next: , +Previous: Element syntax, +Up: File Syntax + +
+ +

8.8.7 ElementArc

+ + +

+
ElementArc [X Y Width Height StartAngle DeltaAngle Thickness]
+ElementArc (X Y Width Height StartAngle DeltaAngle Thickness)
+
+
+ +

+
X Y
Coordinates of the center of the arc. These are relative to the +Element's mark point for new element formats, or absolute for older +formats. +
Width Height
The width and height, from the center to the edge. The bounds of the +circle of which this arc is a segment, is thus 2*Width by +2*Height. +
StartAngle
The angle of one end of the arc, in degrees. In PCB, an angle of zero +points left (negative X direction), and 90 degrees points down +(positive Y direction). +
DeltaAngle
The sweep of the arc. This may be negative. Positive angles sweep +counterclockwise. +
Thickness
The width of the silk line which forms the arc. +
+ + +
+ +


+Next: , +Previous: ElementArc syntax, +Up: File Syntax + +
+ +

8.8.8 ElementLine

+ + +

+
ElementLine [X1 Y1 X2 Y2 Thickness]
+ElementLine (X1 Y1 X2 Y2 Thickness)
+
+
+ +

+
X1 Y1 X2 Y2
Coordinates of the endpoints of the line. These are relative to the +Element's mark point for new element formats, or absolute for older +formats. +
Thickness
The width of the silk for this line. +
+ + +
+ +


+Next: , +Previous: ElementLine syntax, +Up: File Syntax + +
+ +

8.8.9 FileVersion

+ + +

+
FileVersion[Version]
+
+
+ +

+
Version
File format version. This version number represents the date when the pcb file +format was last changed. +
+ +

Any version of pcb build from sources equal to or newer +than this number should be able to read the file. If this line is not present +in the input file then file format compatibility is not checked. + + +

+ +


+Next: , +Previous: FileVersion syntax, +Up: File Syntax + +
+ +

8.8.10 Flags

+ + +

+
Flags(Number)
+
+
+ +

+
Number
A number, whose value is normally given in hex, individual bits of which +represent pcb-wide flags as defined in PCBFlags. + +
+ + +
+ +


+Next: , +Previous: Flags syntax, +Up: File Syntax + +
+ +

8.8.11 Grid

+ + +

+
Grid [Step OffsetX OffsetY Visible]
+Grid (Step OffsetX OffsetY Visible)
+Grid (Step OffsetX OffsetY)
+
+
+ +

+
Step
Distance from one grid point to adjacent points. This value may be a +floating point number for the first two variants. +
OffsetX OffsetY
The "origin" of the grid. Normally zero. +
Visible
If non-zero, the grid will be visible on the screen. +
+ + +
+ +


+Next: , +Previous: Grid syntax, +Up: File Syntax + +
+ +

8.8.12 Groups

+ + +

+
Groups("String")
+
+
+ +

+
String
+Encodes the layer grouping information. Each group is separated by a +colon, each member of each group is separated by a comma. Group +members are either numbers from 1..N for each layer, and +the letters c or s representing the component side and +solder side of the board. Including c or s marks that +group as being the top or bottom side of the board. + +
          Groups("1,2,c:3:4:5,6,s:7,8")
+
+
+ + +
+ +


+Next: , +Previous: Groups syntax, +Up: File Syntax + +
+ +

8.8.13 Layer

+ + +

+
Layer (LayerNum "Name") (
+   ... contents ...
+)
+
+
+ +

+
LayerNum
The layer number. Layers are numbered sequentially, starting with 1. +The last two layers (9 and 10 by default) are solder-side silk and +component-side silk, in that order. +
Name
The layer name. +
contents
The contents of the layer, which may include attributes, lines, arcs, rectangles, +text, and polygons. +
+ + +
+ +


+Next: , +Previous: Layer syntax, +Up: File Syntax + +
+ +

8.8.14 Line

+ + +

+
Line [X1 Y1 X2 Y2 Thickness Clearance SFlags]
+Line (X1 Y1 X2 Y2 Thickness Clearance NFlags)
+Line (X1 Y1 X2 Y2 Thickness NFlags)
+
+
+ +

+
X1 Y1 X2 Y2
The end points of the line +
Thickness
The width of the line +
Clearance
The amount of space cleared around the line when the line passes +through a polygon. The clearance is added to the thickness to get the +thickness of the clear; thus the space between the line and the +polygon is Clearance/2 wide. +
SFlags
Symbolic or numeric flags +
NFlags
Numeric flags. +
+ + +
+ +


+Next: , +Previous: Line syntax, +Up: File Syntax + +
+ +

8.8.15 Mark

+ + +

+
Mark [X Y]
+Mark (X Y)
+
+
+ +

+
X Y
Coordinates of the Mark, for older element formats that don't have +the mark as part of the Element line. +
+ + +
+ +


+Next: , +Previous: Mark syntax, +Up: File Syntax + +
+ +

8.8.16 Net

+ + +

+
Net ("Name" "Style") (
+   ... connects ...
+)
+
+
+ +

+
Name
The name of this net. +
Style
The routing style that should be used when autorouting this net. +
+ + +
+ +


+Next: , +Previous: Net syntax, +Up: File Syntax + +
+ +

8.8.17 Netlist

+ + +

+
Netlist ( ) (
+   ... nets ...
+)
+
+
+ + +

+ +


+Next: , +Previous: Netlist syntax, +Up: File Syntax + +
+ +

8.8.18 Pad

+ + +

+
Pad [rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" SFlags]
+Pad (rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" NFlags)
+Pad (aX1 aY1 aX2 aY2 Thickness "Name" "Number" NFlags)
+Pad (aX1 aY1 aX2 aY2 Thickness "Name" NFlags)
+
+
+ +

+
rX1 rY1 rX2 rY2
Coordinates of the endpoints of the pad, relative to the element's +mark. Note that the copper extends beyond these coordinates by half +the thickness. To make a square or round pad, specify the same +coordinate twice. +
aX1 aY1 aX2 aY2
Same, but absolute coordinates of the endpoints of the pad. +
Thickness
width of the pad. +
Clearance
add to thickness to get clearance width. +
Mask
width of solder mask opening. +
Name
name of pin +
Number
number of pin +
SFlags
symbolic or numerical flags +
NFlags
numerical flags only +
+ + +
+ +


+Next: , +Previous: Pad syntax, +Up: File Syntax + +
+ +

8.8.19 PCB

+ + +

+
PCB ["Name" Width Height]
+PCB ("Name" Width Height]
+PCB ("Name")
+
+
+ +

+
Name
Name of the PCB project +
Width Height
Size of the board +
+ +

If you don't specify the size of the board, a very large default is +chosen. + + +

+ +


+Next: , +Previous: PCB syntax, +Up: File Syntax + +
+ +

8.8.20 Pin

+ + +

+
Pin [rX rY Thickness Clearance Mask Drill "Name" "Number" SFlags]
+Pin (rX rY Thickness Clearance Mask Drill "Name" "Number" NFlags)
+Pin (aX aY Thickness Drill "Name" "Number" NFlags)
+Pin (aX aY Thickness Drill "Name" NFlags)
+Pin (aX aY Thickness "Name" NFlags)
+
+
+ +

+
rX rY
coordinates of center, relative to the element's mark +
aX aY
absolute coordinates of center. +
Thickness
outer diameter of copper annulus +
Clearance
add to thickness to get clearance diameter +
Mask
diameter of solder mask opening +
Drill
diameter of drill +
Name
name of pin +
Number
number of pin +
SFlags
symbolic or numerical flags +
NFlags
numerical flags only +
+ + +
+ +


+Next: , +Previous: Pin syntax, +Up: File Syntax + +
+ +

8.8.21 PolyArea

+ + +

+
PolyArea [Area]
+
+
+ +

+
Area
Minimum area of polygon island to retain. If a polygon has clearances that cause an isolated island to be created, then will only be retained if the area exceeds this minimum area. +
+ + +
+ +


+Next: , +Previous: PolyArea syntax, +Up: File Syntax + +
+ +

8.8.22 Polygon

+ + +

+
Polygon (SFlags) (
+   ... (X Y) ...
+   ... [X Y] ...
+   Hole (
+      ... (X Y) ...
+      ... [X Y] ...
+   )
+   ...
+)
+
+
+ +

+
SFlags
Symbolic or numeric flags. +
X Y
Coordinates of each vertex. You must list at least three coordinates. +
Hole (...)
Defines a hole within the polygon's outer contour. There may be zero or more such sections. +
+ + +
+ +


+Next: , +Previous: Polygon syntax, +Up: File Syntax + +
+ +

8.8.23 Rat

+ + +

+
Rat [X1 Y1 Group1 X2 Y2 Group2 SFlags]
+Rat (X1 Y1 Group1 X2 Y2 Group2 NFlags)
+
+
+ +

+
X1 Y1 X2 Y2
The endpoints of the rat line. +
Group1 Group2
The layer group each end is connected on. +
SFlags
Symbolic or numeric flags. +
NFlags
Numeric flags. +
+ + +
+ +


+Next: , +Previous: Rat syntax, +Up: File Syntax + +
+ +

8.8.24 Styles

+ + +

+
Styles("String")
+
+
+ +

+
String
+Encodes the four routing styles pcb knows about. The four styles +are separated by colons. Each style consists of five parameters as follows: + +
+
Name
The name of the style. +
Thickness
Width of lines and arcs. +
Diameter
Copper diameter of pins and vias. +
Drill
Drill diameter of pins and vias. +
Keepaway
Minimum spacing to other nets. If omitted, 10 mils is the default. + +
+ +
+ +
     Styles("Signal,10,40,20:Power,25,60,35:Fat,40,60,35:Skinny,8,36,20")
+     Styles["Logic,1000,3600,2000,1000:Power,2500,6000,3500,1000:
+        Line,4000,6000,3500,1000:Breakout,600,2402,1181,600"]
+
+

Note that strings in actual files cannot span lines; the above example +is split across lines only to make it readable. + + +

+ +


+Next: , +Previous: Styles syntax, +Up: File Syntax + +
+ +

8.8.25 Symbol

+ + +

+
Symbol [Char Delta] (
+Symbol (Char Delta) (
+   ... symbol lines ...
+)
+
+
+ +

+
Char
The character or numerical character value this symbol represents. +Characters must be in single quotes. +
Delta
Additional space to allow after this character. +
+ + +
+ +


+Next: , +Previous: Symbol syntax, +Up: File Syntax + +
+ +

8.8.26 SymbolLine

+ + +

+
SymbolLine [X1 Y1 X2 Y1 Thickness]
+SymbolLine (X1 Y1 X2 Y1 Thickness)
+
+
+ +

+
X1 Y1 X2 Y2
The endpoints of this line. +
Thickness
The width of this line. +
+ + +
+ +


+Next: , +Previous: SymbolLine syntax, +Up: File Syntax + +
+ +

8.8.27 Text

+ + +

+
Text [X Y Direction Scale "String" SFlags]
+Text (X Y Direction Scale "String" NFlags)
+Text (X Y Direction "String" NFlags)
+
+
+ +

+
X Y
The location of the upper left corner of the text. +
Direction
0 means text is drawn left to right, 1 means up, 2 means right to left +(i.e. upside down), and 3 means down. +
Scale
Size of the text, as a percentage of the “default” size of of the +font (the default font is about 40 mils high). Default is 100 (40 +mils). +
String
The string to draw. +
SFlags
Symbolic or numeric flags. +
NFlags
Numeric flags. +
+ + +
+ +


+Next: , +Previous: Text syntax, +Up: File Syntax + +
+ +

8.8.28 Thermal

+ + +

+
Thermal [Scale]
+
+
+ +

+
Scale
Relative size of thermal fingers. A value of 1.0 makes the finger +width twice the clearance gap width (measured across the gap, not +diameter). The normal value is 0.5, which results in a finger width +the same as the clearance gap width. +
+ + +
+ +


+Previous: Thermal syntax, +Up: File Syntax + +
+ +

8.8.29 Via

+ + +

+
Via [X Y Thickness Clearance Mask Drill "Name" SFlags]
+Via (X Y Thickness Clearance Mask Drill "Name" NFlags)
+Via (X Y Thickness Clearance Drill "Name" NFlags)
+Via (X Y Thickness Drill "Name" NFlags)
+Via (X Y Thickness "Name" NFlags)
+
+
+ +

+
X Y
coordinates of center +
Thickness
outer diameter of copper annulus +
Clearance
add to thickness to get clearance diameter +
Mask
diameter of solder mask opening +
Drill
diameter of drill +
Name
string, name of via (vias have names?) +
SFlags
symbolic or numerical flags +
NFlags
numerical flags only +
+ + + +
+ +


+Next: , +Previous: File Syntax, +Up: File Formats + +
+ +

8.9 Object Flags

+ +

Note that object flags can be given numerically (like 0x0147) +or symbolically (like "found,showname,square". Some numeric +values are reused for different object types. The table below lists +the numeric value followed by the symbolic name. + +

+
0x0001 pin
If set, this object is a pin. This flag is for internal use only. +
0x0002 via
Likewise, for vias. +
0x0004 found
If set, this object has been found by FindConnection(). +
0x0008 hole
For pins and vias, this flag means that the pin or via is a hole +without a copper annulus. +
0x0010 rat
If set for a line, indicates that this line is a rat line instead of a +copper trace. +
0x0010 pininpoly
For pins and pads, this flag is used internally to indicate that the +pin or pad overlaps a polygon on some layer. +
0x0010 clearpoly
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. +
0x0010 hidename
For elements, when set the name of the element is hidden. +
0x0020 showname
For elements, when set the names of pins are shown. +
0x0020 clearline
For lines and arcs, the line/arc will clear polygons instead of +connecting to them. +
0x0020 fullpoly
For polygons, the full polygon is drawn (i.e. all parts instead of only the biggest one). +
0x0040 selected
Set when the object is selected. +
0x0080 onsolder
For elements and pads, indicates that they are on the solder side. +
0x0080 auto
For lines and vias, indicates that these were created by the +autorouter. +
0x0100 square
For pins and pads, indicates a square (vs round) pin/pad. +
0x0200 rubberend
For lines, used internally for rubber band moves. +
0x0200 warn
For pins, vias, and pads, set to indicate a warning. +
0x0400 usetherm
Obsolete, indicates that pins/vias should be drawn with thermal +fingers. +
0x0400
Obsolete, old files used this to indicate lines drawn on silk. +
0x0800 octagon
Draw pins and vias as octagons. +
0x1000 drc
Set for objects that fail DRC. +
0x2000 lock
Set for locked objects. +
0x4000 edge2
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. +
0x8000 marker
Marker used internally to avoid revisiting an object. +
0x10000 nopaste
For pads, set to prevent a solderpaste stencil opening for the +pad. Primarily used for pads used as fiducials. +
+ + +
+ +


+Previous: Object Flags, +Up: File Formats + +
+ +

8.10 PCBFlags

+ +
+
0x00001
Pinout displays pin numbers instead of pin names. +
0x00002
Use local reference for moves, by setting the mark at the beginning of +each move. +
0x00004
When set, only polygons and their clearances are drawn, to see if +polygons have isolated regions. +
0x00008
Display DRC region on crosshair. +
0x00010
Do all move, mirror, rotate with rubberband connections. +
0x00020
Display descriptions of elements, instead of refdes. +
0x00040
Display names of elements, instead of refdes. +
0x00080
Auto-DRC flag. When set, PCB doesn't let you place copper that +violates DRC. +
0x00100
Enable 'all-direction' lines. +
0x00200
Switch starting angle after each click. +
0x00400
Force unique names on board. +
0x00800
New lines/arc clear polygons. +
0x01000
Crosshair snaps to pins and pads. +
0x02000
Show the solder mask layer. +
0x04000
Draw with thin lines. +
0x08000
Move items orthogonally. +
0x10000
Draw autoroute paths real-time. +
0x20000
New polygons are full ones. +
0x40000
Names are locked, the mouse cannot select them. +
0x80000
Everything but names are locked, the mouse cannot select anything else. +
0x100000
New polygons are full polygons. +
0x200000
When set, element names are not drawn. +
+ + +
+ +


+Next: , +Previous: File Formats, +Up: Top + +
+ +

9 Library Creation

+ +

+This chapter provides a detailed look at how footprint libraries are +created and used. The chapter is split into two section, the first +section covers the "old" style libraries which use the m4 macro +processor and the second section covers the "new" style libraries. + +

Despite the names "old" and "new", both styles of libraries are useful +and the "old" style should not be discounted because of its name. The +advantage of the old style libraries is that one can define a family of +footprints, say a DIP package, and then quickly produce all the members +of that family. Because the individual packages make use of a base +definition, corrections made to the base definition propagate to all the +members of a family. The primary drawback to using this library +approach is that the effort to create a single footprint is more than a +graphical interface and may take even longer if the user has not used +the m4 macro language previously. + +

The new style of footprint libraries stores each footprint in its own +file. The footprints are created graphically by placing pads and then +converting a group of pads to a component. This library method has the +advantage of being quick to learn and it is easily to build single +footprints quickly. If you are building a family of parts, however, the +additional effort in creating each one individually makes this approach +undesirable. In addition, creating a part with a large pin count +can be quite tedious when done by hand. + +

9.1 Old Style (m4) Libraries

+ +

The old style libraries for pcb use the m4 macro processor to +allow the definition of a family of parts. There are several files +associated with the old style library. The file common.m4 is the +top level file associated with the library. common.m4 defines a +few utility macros which are used by other portions of the library, +and then includes a predefined set of library files (the lines like +include(geda.inc)). + +

9.1.1 Overview of Oldlib Operation

+ +

The big picture view of the old style library system is that the library +is simply a collection of macro definitions. The macros are written in +the m4 macro language. An example of a macro and what it expands +to is the following. One of the predefined footprints in the library +which comes with PCB is the PKG_SO8 macro. Note that all the +footprint macros begin with PKG_. For this particular example, +PKG_SO8 is a macro for an 8-pin small outline surface mount +package. All of the footprint macros take 3 arguments. The first is the +canonical name of the footprint on the board. In this case "SO8" is an +appropriate name. The second argument is the reference designator on +the board such as "U1" or "U23". The third and final argument is the +value. For an integrated circuit this is usually the part number such +as "MAX4107" or "78L05" and for a component such as a resistor or +capacitor it is the resistance or capacitance. The complete call to the +macro in our example is ‘PKG_SO8(SO8, U1, MAX4107)’. When +processed by m4 using the macros defined in the PCB library, this +macro expands to +

     Element(0x00 "SO8" "U1" "MAX4107" 146 50 3 100 0x00)
+     (
+     	Pad(10 25 38 25 20 "1" 0x00)
+     	Pad(10 75 38 75 20 "2" 0x100)
+     	Pad(10 125 38 125 20 "3" 0x100)
+     	Pad(10 175 38 175 20 "4" 0x100)
+     	Pad(214 175 242 175 20 "5" 0x100)
+     	Pad(214 125 242 125 20 "6" 0x100)
+     	Pad(214 75 242 75 20 "7" 0x100)
+     	Pad(214 25 242 25 20 "8" 0x100)
+     	ElementLine(0 0 151 0 10)
+     	ElementArc(126 0 25 25 0 180 10)
+     	ElementLine(101 0 252 0 10)
+     	ElementLine(252 0 252 200 10)
+     	ElementLine(252 200 0 200 10)
+     	ElementLine(0 200 0 0 10)
+     	Mark(29 25)
+     )
+
+

which is the actual definition of the footprint that the PCB program +works with. As a user of PCB the only time you will need or want to run +m4 directly is when you are debugging a new library addition. In +normal operation, the calls to m4 are made by helper scripts that +come with PCB. + +

Tools such as gsch2pcb (used to interface the gEDA schematic +capture program to PCB layout) will call m4 to produce an initial +PCB layout that includes all the components on a schematic. In +addition, when manually instantiating parts from within PCB, m4 +will be called by PCB's helper scripts to produce the footprints. + +

9.1.2 The Library Scripts

+ +

There are several scripts that are used for processing the m4 +libraries. This section briefly describes these scripts and details how +they are used by PCB. + +

9.1.2.1 Scripts Used During Compilation
+ +

The scripts described in this section are used during compilation of +PCB. They are run automatically by the build system, but are described +here to help document the complete library processing that occurs. +During the build of PCB, the following actions are taken. The +CreateLibrary.sh script is run to produce an M4 "frozen file". +This frozen file is simply a partially processed M4 input file which can +be loaded by M4 more quickly than the original input file. + +

A typical call to CreateLibrary.sh used during the compilation of +PCB is: +

     ./CreateLibrary.sh -I . pcblib ./common.m4 TTL_74xx_DIL.m4
+     connector.m4 crystal.m4 generic.m4 genericsmt.m4 gtag.m4
+     jerry.m4 linear.m4 logic.m4 lsi.m4 memory.m4 optical.m4 pci.m4
+     resistor_0.25W.m4 resistor_adjust.m4 resistor_array.m4
+     texas_inst_amplifier.m4 texas_inst_voltage_reg.m4
+     transistor.m4 geda.m4
+
+

The ‘-I .’ says to search in the current directory for the +.m4 files. The output frozen file is pcblib. The main +common.m4 file is listed as well as all of the *.m4 files +which define the components in the library. + +

In addition, a library contents file is created during the build with +the CreateLibraryContents.sh script. +A typical call to CreateLibrary.sh used during the compilation of +PCB is: +

     ./CreateLibraryContents.sh -I . ./common.m4 TTL_74xx_DIL.list
+     connector.list crystal.list generic.list genericsmt.list gtag.list
+     jerry.list linear.list logic.list lsi.list memory.list optical.list
+     pci.list resistor_0.25W.list resistor_adjust.list resistor_array.list
+     texas_inst_amplifier.list texas_inst_voltage_reg.list transistor.list
+     geda.list > pcblib.contents
+
+

The pcblib.contents file is used by the PCB program to define the +libraries and components which will be displayed when you bring up +the library window from within PCB. An example of part of the +pcblib.contents file is: +

     TYPE=~TTL 74xx DIL
+     7400_dil:N:7400:4 dual-NAND
+     7401_dil:N:7401:4 dual-NAND OC
+     7402_dil:N:7402:4 dual-NOR
+     TYPE=~geda
+     geda_DIP6:DIP6:DIP6:Dual in-line package, narrow (300 mil)
+     geda_DIP8:DIP8:DIP8:Dual in-line package, narrow (300 mil)
+     geda_DIP14:DIP14:DIP14:Dual in-line package, narrow (300 mil)
+     geda_ACY300:ACY300:ACY300:Axial non-polar component,
+
+

The TYPE= lines define the library name that will show up in the +library window in PCB. The other lines define the actual components in +the library. + +

9.1.2.2 Scripts Used by PCB at Runtime
+ +

When PCB is first executed, it makes a call to the +ListLibraryContents.sh script. This script provides the PCB +program with the contents of the library contents file created when PCB +was compiled. A typical call to ListLibraryContents.sh is +

     ../lib/ListLibraryContents.sh .:/tmp/pcb-20030903/src/../lib pcblib
+
+

This command says to search the path +‘.:/tmp/pcb-20030903/src/../lib’ for a file called +pcblib.contents (the .contents part is added +automatically) and display the contents of the file. +PCB parses this output and generates the library window entries. + +

When you pick a library component from the library window, PCB calls the +QueryLibrary.sh script to actually pull the footprint into the +layout. For example, when the ACY300 component is selected from the +~geda library, the generated call may be: + +

     /tmp/pcb-20030903/src/../lib/QueryLibrary.sh
+     .:/tmp/pcb-20030903/src/../lib pcblib geda_ACY300 ACY300
+     ACY300
+
+

If you were to run this command by hand you would see the PCB code for +the element: +

     Element(0x00 "Axial non-polar component," "" "ACY300" 245 70 0 100 0x00)
+     (
+     	Pin(0 25 50 20 "1" 0x101)
+     	Pin(300 25 50 20 "2" 0x01)
+     
+     	ElementLine(0 25 75 25 10)
+     	ElementLine(225 25 300 25 10)
+     
+     	ElementLine(75 0 225 0 10)
+     	ElementLine(225 0 225 50 10)
+     	ElementLine(225 50 75 50 10)
+     	ElementLine(75 50 75 0 10)
+     
+     #       ElementArc(X1 Y 50 50 270 180 10)
+     #       ElementArc(X2 Y 50 50 90 180 10)
+     
+     	Mark(75 25)
+     )
+
+

9.1.3 Creating an Oldlib Footprint

+ +

This section provides a complete example of defining a family of +footprints using the M4 style library. As a vehicle for this example, a +family of footprints for surface mount resistors and capacitors will be +developed. The file example.inc should have been installed on +your system as $prefix/share/examples/oldlib/example.inc where +$prefix is often times /usr/local. + +

The example.inc file defines a macro called +COMMON_PKG_RCSMT which is a generic definition for a surface +mount footprint with two identical, rectangular pads. This macro will +be called with different parameters to fill out the family of parts. +The arguments to the COMMON_PKG_RCSMT are: +

     # -------------------------------------------------------------------
+     # the definition for surface mount resistors and capacitors
+     # $1: canonical name
+     # $2: name on PCB
+     # $3: value
+     # $4: pad width   (in direction perpendicular to part)
+     # $5: pad length  (in direction parallel with part)
+     # $6: pad spacing (center to center)
+     # $7: distance from edge of pad to silk (in direction
+     #     perpendicular to part)
+     # $8: distance from edge of pad to silk (in direction parallel
+     #     with part)
+     # $9: Set to "no" to skip silk screen on the sides of the part
+
+
     define(`COMMON_PKG_RCSMT',
+     	`define(`XMIN', `eval( -1*`$6'/2 - `$5'/2 - `$8')')
+     	define(`XMAX', `eval(  `$6'/2 + `$5'/2 + `$8')')
+     	define(`YMIN', `eval(-1*`$4'/2 - `$7')')
+     	define(`YMAX', `eval(   `$4'/2 + `$7')')
+     Element(0x00 "$1" "$2" "$3" eval(XMIN+20) eval(YMAX+20) 0 100 0x00)
+     (
+     	ifelse(0, eval($4>$5),
+     	# Pads which have the perpendicular pad dimension less
+     	# than or equal to the parallel pad dimension
+     	Pad(eval(-1*(   $6 + $5 - $4)/2) 0
+     	    eval((-1*$6 + $5 - $4)/2) 0 eval($4) "1" 0x100)
+     	Pad(eval(-1*(-1*$6 + $5 - $4)/2) 0
+     	    eval((   $6 + $5 - $4)/2) 0 eval($4) "2" 0x100)
+     	,
+     	# Pads which have the perpendicular pad dimension greater
+     	# than or equal to the parallel pad dimension
+     	Pad(eval(-1*$6/2) eval(-1*($4 - $5)/2)
+     	    eval(-1*$6/2)  eval(($4 - $5)/2) eval($5) "1" 0x100)
+     	Pad(eval(   $6/2) eval(-1*($4 - $5)/2)
+     	    eval(   $6/2)  eval(($4 - $5)/2) eval($5) "2" 0x100)
+     	)
+     
+     	# silk screen
+     	# ends
+     	ElementLine(XMIN YMIN XMIN YMAX 10)
+     	ElementLine(XMAX YMAX XMAX YMIN 10)
+     	# sides
+     ifelse($9,"no",
+     	#skip side silk
+     	,
+     	ElementLine(XMIN YMIN XMAX YMIN 10)
+     	ElementLine(XMAX YMAX XMIN YMAX 10)
+     )
+     	Mark(0 0)
+     )')
+
+

Note that the part has been defined with the mark located at +(0,0) and that the pads have been placed with the mark at the +common centroid of the footprint. While not a requirement, this is +highly desirable when developing a library that will need to interface +with a pick and place machine used for factory assembly of a board. + +

The final part of example.inc defines particular versions of the +generic footprint we have created. These particular versions correspond +to various industry standard package sizes. +

     # 0402 package
+     #
+     # 30x30 mil pad, 15 mil metal-metal spacing=>
+     # 15 + 15 + 15 = 45 center-to-center
+     define(`PKG_RC0402',
+       `COMMON_PKG_RCSMT(`$1', `$2', `$3', 30, 30, 45, 0, 10, "no")')
+     
+     # 0603 package
+     #
+     # 40x40 mil pad, 30 mil metal-metal spacing=>
+     #  30 + 20 + 20 = 70 center-to-center
+     define(`PKG_RC0603',
+       `COMMON_PKG_RCSMT(`$1', `$2', `$3', 40, 40, 70, 10, 10)')
+     
+     # 1206 package
+     #
+     # 40x60 mil pad, 90 mil metal-metal spacing=>
+     #  90 + 20 + 20 = 130 center-to-center
+     define(`PKG_RC1206',
+       `COMMON_PKG_RCSMT(`$1', `$2', `$3', 60, 40, 130, 10, 10)')
+
+

At this point, the example.inc file could be used by third party +tools such as gsch2pcb. However to fully integrate our +footprints into PCB we need to create the example.m4 and +example.list files. The example.m4 file defines +descriptions for the new footprints. +

     define(`Description_my_RC0402',
+       ``Standard SMT resistor/capacitor (0402)'')
+     define(`Description_my_RC0603',
+       ``Standard SMT resistor/capacitor (0603)'')
+     define(`Description_my_RC1206',
+       ``Standard SMT resistor/capacitor (1206)'')
+
+

Finally we need to create the example.list file. +

     my_RC0402:RC0402:RES0402
+     my_RC0402:RC0402:CAP0402
+     my_RC0603:RC0603:RES0603
+     my_RC0603:RC0603:CAP0603
+     my_RC1206:RC1206:RES1206
+     my_RC1206:RC1206:CAP1206
+
+

The first field in the list file has the name corresponding to the +Description definitions in example.m4. The second field is the +template name which corresponds to the macros PKG_* we defined in +example.inc with the leading PKG_ removed. It is the +second field which controls what footprint will actually appear on the +board. The final +field is the name of the part type on the board. The first line in our +example.list file will produce a menu entry in the library window +that reads: +

     CAP0402, Standard SMT resistor/capacitor (0402)
+
+

The CAP0402 portion comes directly from the third field in +example.list and the longer description comes from descriptions +macros in example.m4. Please note that any extra white space +at the end of a line in the .list files will cause them to +not work properly. + +

9.1.4 Troubleshooting Old Style Libraries

+ +

A powerful technique to help debug problems with libraries is to invoke +the m4 processor directly. This approach will provide error +output which is not visible from within PCB. The following example +shows how one might try to debug an 8 pin small outline (SO8) package. The +macro name for the package is PKG_SO8. In this example, the +canonical name that is to be associated with the part is SO8, the +reference designator is U1, and the value is MAX4107 (the part number). + +

     echo "PKG_SO8(SO8, U1, MAX4107)" | \
+        gm4 common.m4 - | \
+        awk '/^[ \t]*$/ {next} {print}' | \
+        more
+
+

The awk call simply removes blank lines which make the output +hard to read. + +

For this particular example, the output is: +

     Element(0x00 "SO8" "U1" "MAX4107" 146 50 3 100 0x00)
+     (
+     	Pad(10 25 38 25 20 "1" 0x00)
+     	Pad(10 75 38 75 20 "2" 0x100)
+     	Pad(10 125 38 125 20 "3" 0x100)
+     	Pad(10 175 38 175 20 "4" 0x100)
+     	Pad(214 175 242 175 20 "5" 0x100)
+     	Pad(214 125 242 125 20 "6" 0x100)
+     	Pad(214 75 242 75 20 "7" 0x100)
+     	Pad(214 25 242 25 20 "8" 0x100)
+     	ElementLine(0 0 151 0 10)
+     	ElementArc(126 0 25 25 0 180 10)
+     	ElementLine(101 0 252 0 10)
+     	ElementLine(252 0 252 200 10)
+     	ElementLine(252 200 0 200 10)
+     	ElementLine(0 200 0 0 10)
+     	Mark(29 25)
+     )
+
+

9.2 New Style Libraries

+ +

Footprints for the new style library are created graphically using the +PCB program. A single footprint is saved in each file. + +

9.2.1 Creating Newlib Footprints

+ +

To create +

    +
  1. Start PCB with an empty layout. +
  2. Make the component layer active. +
  3. For a leaded part, select the via tool and place vias where the +pads for the part should go. For surface mount pads, draw line +segments. Note that until the footprint is completed, the surface +mount pads will remain rounded. Currently a rectangle or polygon +may not be used as a pad. +
  4. For each via and line segment which will become a pad, select it +and press 'n' to be able to enter a name. Enter +the pin number and press enter. +
  5. Make the silk layer active. +
  6. Using the line and arc tools, draw a silk screen outline for the +part. +
  7. Using the selection tool, select all of the pins and silk screen +for the part. +
  8. Place the pointer above the reference point for the part. This is +typically the common centroid. Keeping the pointer there, shift-right-click +to bring up the popup menu and choose "convert +selection to element". +
  9. At this point, the vias, line segments, and silk screen will have +been converted to an element. To change any of the line segments to +have square ends rather than round ends, select the pads by holding +down the shift key and clicking each pad with the center mouse button. +Now under the Select menu, "Change square-flag of selected objects" +section, choose "Pins". +
  10. Select the element, shift-right-click to bring up the popup menu, and +choose "Copy Selection to Buffer". Now left-click on the center of +the new element. +
  11. Under the buffer menu, choose "save buffer elements to file" to +save the new footprint to a file. +
  12. Press ESC to exit from buffer mode. +
+ +

9.2.2 Modifying Newlib Footprints

+ +
    +
  1. In the Pcb program, instantiate the footprint you wish to modify. +
  2. Using the selection tool, select the footprint. +
  3. Now left-click on the selected element, this brings up a popup menu, choose +"Cut Selection to Buffer" from the popup menu. +
  4. Under the buffer menu, choose "break buffer element to pieces", +and then left-click to place the broken apart footprint to an open area of +the layout. Note that you must use the items under the buffer menu, the +items with the same names in the popup menu do not work. +
  5. Make your desired modifications to the footprint and then convert +the pieces back to an element using the same procedure as when starting +from scratch on a new footprint. +
+ + +
+ +


+Next: , +Previous: Library Creation, +Up: Top + +
+ +

10 Schematic Capture for PCB

+ +

+When designing a circuit board of any complexity, a schematic capture +front-end for the design is highly desired. Any schematic capture +program which is able to generate a netlist in a user defined format as +well as a bill of materials can be made to work with PCB. Currently, we +are aware of two freely available schematic capture programs which can +interface with PCB. This chapter shows how a design can be taken from +start to finish using either of these two tools for schematic capture +and PCB for layout. + +

+ +
+ +


+Next: , +Up: Schematic Frontends + +
+ +

10.1 gEDA

+ +

+This section shows how to use gEDA as the schematic capture front-end for +a PCB design. This section is not intended to be complete documentation +on gEDA and it is assumed that the user has at least some familiarity +with the gEDA suite of programs. + +

The basic steps in a gEDA + PCB design flow are: +

    +
  1. Set up project directories +
  2. Set up gEDA (gschem/gnetlist) config files +
  3. Set up gsch2pcb config files +
  4. Capture schematics using gschem (part of gEDA) +
  5. Create any unique PCB footprints needed for the design +
  6. Generate initial PCB design using gsch2pcb (part of gEDA) +
  7. Layout circuit board using pcb +
  8. Make any additional schematic changes with gschem and +forward annotate to PCB with gsch2pcb +
  9. Generate photoplot files (RS-274X, also known as "Gerber") for +board vendor +
+ +

10.1.1 Set Up Project Directories

+ +

Although not required, a typical project directory will contain the +schematics and board layout at the top level. +Schematic symbols and circuit board footprints which are unique to this +project are stored in subdirectories. For this example, sym +contains the project specific schematic symbols and pkg contains +the project specific footprints. Set up the project subdirectory and +subdirectories by executing: +

     mkdir ~/myproj
+     cd ~/myproj
+     mkdir sym
+     mkdir pkg
+     mkdir pkg/newlib
+     mkdir pkg/m4
+
+

10.1.2 Set Up gEDA Config Files

+ +

The gEDA tools, specifically gschem and gnetlist, use +configuration files to set the search path for symbol libraries in +addition to other user preferences. Create a file in the top level +project directory called gschemrc. Add the following lines to +that file: +

     
+     ;; list libraries here.  Order matters as it sets the
+     ;; search order
+     (component-library "./sym")
+     
+
+

This sets the local search path for the schematic capture program +gschem. Now the netlister, gnetlist, must also be +configured. This can be done by copying the file gschemrc to +gnetlistrc by running ‘cp gschemrc gnetlistrc’. +Alternatively, you can create a soft link so only a single file needs to +be updated if additional symbol paths are added. The link is created by +running ‘ln -s gschemrc gnetlistrc’. + +

10.1.3 Set Up gsch2pcb Config Files

+ +

The program gsch2pcb, not to be confused with the older +gschem2pcb script, is used to link the schematic to layout. +gsch2pcb is responsible for creating the netlist used to provide +connectivity information to PCB as well creating an initial layout with +all components instantiated in the design. Forward annotation of +schematic changes to the layout is also done using gsch2pcb. +gsch2pcb uses a project file to set up the schematic file names, +PCB library locations, and output file names. Create a project file +called project using the following as an example: +

     
+     # List all the schematics to be netlisted
+     # and laid out on the pc board.
+     schematics      first.sch second.sch third.sch
+     
+     # For an output-name of foo, gsch2pcb generates files
+     # foo.net, foo.pcb, and foo.new.pcb.  If there is no
+     # output-name specified, the file names are derived from
+     # the first listed schematic, i.e. first.net, etc.
+     output-name  preamp
+     
+
+

10.1.4 Capture Schematics Using gschem

+ +

This section is fairly brief and assumes familiarity with using the +gschem schematic capture program. As you are creating your +schematics, be sure to observe the following rules: +

    +
  • Make sure that each component in the schematic has a +footprint attribute that corresponds to a footprint in the PCB +library or a footprint you plan on creating. +
  • Make sure all reference designators are unique. One way to ensure +this is to run the refdes_renum script (part of gEDA) after the +schematics are created. +
+ +

10.1.5 Create Any Unique PCB Footprints

+ +

Create the new footprints you design needs using either the m4 style or +newlib style of PCB libraries. Refer to Library Creation for details on this +process. For m4 style footprints, store them in the pkg/m4 +subdirectory and for newlib footprints, store them in the +pkg/newlib subdirectory. + +

10.1.6 Generate Initial PCB Design Using gsch2pcb

+ +

The gsch2pcb program connects the schematic and layout. It basic +operation is to call gnetlist to generate the connectivity +netlist that PCB used to verify connectivity and to instantiate all +elements found in the schematic to a new layout. +The default, as of gsch2pcb version 0.9, is to use any found m4 +style parts first and then search for newlib style if no old style part +was found. By using the --use-files or -f flag to gsch2pcb +priority is given to newlib style parts even if m4 style are found. You +may wish to verify this in the gsch2pcb documentation in case +this changes in the future. +To start your layout, +run ‘gsch2pcb project’ where project is the project file +created previously. This will create a new netlist file, +preamp.net, and a new layout file, preamp.pcb. + +

10.1.7 Layout Circuit Board

+ +

Run PCB on the new layout by running ‘pcb preamp.pcb’. +Load the netlist file by selecting "load netlist file" from the "file" +menu. In the file selection dialog box, choose preamp.net. This +loads connectivity information into PCB. + +

Using the selection tool, grab and move apart the various footprints +with the middle mouse button. Once the parts are moved apart from each +other, choose "optimize rats-nest" from the "Connects" menu. This menu +choice will display and optimize the rats nest. Use the rats nest to +help guide placement of the parts. You may wish to re-run the "optimize +rats-nest" command after moving parts around. + +

After the placement is complete, use the line tool to add traces to the +board. As traces are added, the corresponding rats line will disappear. + +

10.1.8 Forward Annotation of Schematic Changes

+ +

If schematic changes are made after the layout has started, +gsch2pcb can be used to forward annotate these changes to the +layout. To forward annotate schematic changes, run ‘gsch2pcb +project’. This command will create the files preamp.new.pcb, +preamp.net, and modify the file preamp.pcb. The +modifications to preamp.pcb include forward annotation of +schematic component value changes, adds any new components, and removes +any deleted components. + +

10.1.9 Generate Photoplot Files (RS-274X)

+ +

After the layout is complete, choose "edit layer-groupings" from the +"Settings" menu. The LayerGroups form lets you specify which layers +will appear in each output layer group. For example, in the default +form, layer group 1 has "front" and "front side" in it. The +output file 1.gbr if DOS file names are used, or +somename_front.gbr if long file names are used will contain the +"front" and "front side" layers in it. Usually the defaults are +sufficient, but this form is still a useful reference. + +

Choose "print layout..." from the "File" menu. In the print dialog box, +select "Gerber/RS-274X" for the device +driver. Select the "outline", "alignment", and "drillhelper" options. +To get DOS compatible file names, select the "DOS (8.3) names" option, +otherwise enter "preamp" for the filename. Press "OK". + +

The following output files should have been created in the project directory. +The names in parentheses correspond to the DOS compatible output file names. +

+
preamp_frontsilk.gbr (csilk.gbr)
Top side silk screen. +
preamp_frontmask.gbr (cmask.gbr)
Top side soldermask relief. +
preamp_front.gbr (1.gbr)
Top copper. +
preamp_backmask.gbr (smask.gbr)
Bottom side soldermask relief. +
preamp_back.gbr (2.gbr)
Bottom Copper. +
preamp_fab.gbr (fab.gbr)
Fabrication drawing. Also known as the drill drawing. This drawing is +used for reference by the board vendor but is not directly used in the +fabrication process. +
preamp_plated-drill.cnc (pdrill.cnc)
NC Drill format file for the plated through holes. +
preamp_unplated-drill.cnc (udrill.cnc)
NC Drill format file for the unplated through holes. +
preamp_bom.txt (bom.txt)
A bill of materials for the layout. +
preamp_xy.txt (xy.txt)
Centroid (X-Y) data for driving automated assembly equipment. +
+ + + +
+ +


+Previous: gEDA, +Up: Schematic Frontends + +
+ +

10.2 xcircuit

+ +

+If anyone cares to contribute this section, it will get added. Please +submit changes to the bug tracking system for PCB which can be found from +the PCB homepage at http://pcb.gpleda.org. + + +

+ +


+Next: , +Previous: Schematic Frontends, +Up: Top + +
+ +

Appendix A Installation and Troubleshooting

+ +

Compiling and installing the package should be straightforward. If any problems +occur, please contact the author Thomas.Nau@rz.uni-ulm.de, or the +current maintainer haceaton@aplcomm.jhuapl.edu to find +a solution and include it into the next release. + +

+ +
+ +


+Next: , +Up: Installation + +
+ +

A.1 Compiling and Installing

+ +

+This section covers the steps which are necessary to compile the package. + +

+ +
+ +


+Next: , +Up: compiling + +
+ +

A.1.1 Quick Start

+ +

+Starting with version 2.0, Pcb has switched to a GNU +autoconf/automake build system. Installation of Pcb consists of +three steps: configuration, building, and installing. +In a typical installation, these steps are as simple as +

     ./configure
+     make
+     make install
+
+
+ +


+Previous: quickstart, +Up: compiling + +
+ +

A.1.2 Running the configure Script

+ +

+The configure script accepts all of the standard GNU configure +options. For a complete list of configuration options, run +./configure --help. + + + +

INFOLIBDIR
must be set to the directory where your GNU info files are located. + +


PCBLIBDIR
is the path of a directory where the font files will be installed. + +


DEFAULTFONT
the name of the default font file. + +


DEFAULTLIBRARY
the name of the default library. + +


GNUM4
the name of GNUs m4 version. + +


BTNMOD
If your window manager has already bound Mod1 together with some +function keys you may want to change this setting. This is true for HP-VUE. + +
+ +

If you find things which must be changed to compile on your system, +please add the appropriate autoconf tests (if you are familiar with +that) and mail a copy to the maintainer, harry eaton, at +haceaton@aplcomm.jhuapl.edu. + +

If you do not have the appropriate permissions you should run +./pcbtest.sh in the src directory to run Pcb from +the installation directory. + +

+ +


+Previous: compiling, +Up: Installation + +
+ +

A.2 Troubleshooting

+ +

+There are some known problems. Most of them are related to +missing parts of a standard X11 distribution. Some others are caused by +third party applications such as X servers. To make this list more +complete please mail your problems and, if available, solutions to the author. +The mail address may be found at the beginning of this chapter. +In any case, read X11. + +

By the way, you MUST HAVE AN ANSI COMPILER to make Pcb work. + +

Another source of problems are older versions of flex and bison. +Pcb definitely works with flex-2.4.7 and bison-1.22 or +later. The problems will result in a syntax error while parsing files. +This should only be a problem if you have modified the flex or +bison input files. + +

The following list gives you just an idea because I'm not able to test +all Pcb releases on all platforms. + +

+ +
+ +


+Next: , +Up: problems + +
+ +

A.2.1 HP Series 700 and 800

+ +

+You have to install several X11 include files +or, better, install a complete X11R5 release. Hewlett-Packard doesn't +support the Athena Widgets. So the header files and libraries are missing +from the application media, but they are available as a patch. +They also do not ship the ANSI compiler with the normal operating +system release so you have to buy one or use GCC. +Some of the tools are available as patches. + +

In addition, Pcb has been successfully tested on these platforms with +HPUX 9.*, 10.* running self-compiled X11R5. + +

+ +


+Next: , +Previous: HP, +Up: problems + +
+ +

A.2.2 Sun SPARC architecture

+ +

+There are no known problems with Sun machines if they use X11R5 instead +of OpenWindows. Pcb compiled successfully with all kinds of +SPARCstations Solaris-2.[345]. + +

For problems with OpenWindows refer to X11. + +

+ +


+Next: , +Previous: Sun, +Up: problems + +
+ +

A.2.3 Silicon Graphics

+ +

+Pcb has been tested on some boxes running either IRIX-4.0.5 or +IRIX-5.3. The former one uses a X11R4 server. +There are no problems. +For known problems +with X11R4, see X11. + +

+ +


+Next: , +Previous: SGI, +Up: problems + +
+ +

A.2.4 DEC Alpha

+ +

+Pcb compiled and runs without problems on DEC UNIX V3.2c. + +

+ +


+Next: , +Previous: DEC Alpha, +Up: problems + +
+ +

A.2.5 SCO Unix

+ +

+John DuBois <spcecdt@deeptht.armory.com> wrote: +

     SCO-ODT-3.0 requires the latest version of tls003, the Athena
+     widget library (available from sosco.sco.com). The main problems
+     I have encountered are it core dumps fairly often, especially
+     while loading/dropping elements...
+
+

I'll see what I am able to do as soon as I have access to an SCO system. + +

+ +


+Next: , +Previous: SCO, +Up: problems + +
+ +

A.2.6 Linux

+ +

+Since the X11 version of Pcb has been developed on a Linux +system here are no known problems. + +

+ +


+Next: , +Previous: Linux, +Up: problems + +
+ +

A.2.7 FreeBSD and NetBSD

+ +

+Pcb has been tested on NetBSD and works without any problems. +You may also be able to find a NetBSD package at +ftp://ftp.netbsd.org/pub/NetBSD/packages/cad/pcb/README.html or a +FreeBSD port at +http://www.freebsd.org/cgi/url.cgi?ports/cad/pcb/pkg-descr. + +

+ +


+Next: , +Previous: BSD, +Up: problems + +
+ +

A.2.8 Problems related to X11

+ +

+There are a some problems related to X11R4 or systems derived from +X11 such as OpenWindows. See Sun. You at least have to change +all occurances of baseTranslations in the resource files to +translations if you are using a X11R4 server. Look at the +X11R5 Intrinsics manual for details. + +

The panner widget (print dialog box) appears only in release X11R5 and +later. It really simplifies adjusting the offsets. +With earlier releases the printout will always appear in the center of the +page. + +

You may have some problems in a mixed X11-OpenWindows +environment. + +

Pcb has been tested successfully with X11R6 under Linux 1.1.59 +and later. + +

+ +


+Previous: X11, +Up: problems + +
+ +

A.2.9 Problems related to TeX

+ +

+If your TeX installation complains about a missing texinfo.tex +file copy the one included in this release (directory doc +to your TeX macro directory. +Note, there are probably newer versions of this file available from some +FTP sites. +TeX-3.0 failed, TeX-3.14 worked just fine. Check our FTP server +ftp.uni-ulm.de for ready-to-print versions of the manuals. + + +

+ +


+Next: , +Previous: Installation, +Up: Top + +
+ +

Appendix B Customizing the Menus

+ +

The menu system is driven off a data file that contains +resources. A resource is a hierarchical description of a data +tree which, in this case, is mapped to the hierarchical menus used by +Pcb. + +

+ +
+ +


+Next: , +Up: Custom Menus + +
+ +

B.1 Resource Syntax

+ +

A resource file is a simple text file. It contains curly braces to +group things, spaces between things, and double quotes when strings +need to include spaces. There are four fundamental ways of adding +data to a resource. + +

First, a string (either a single word or a quoted string with spaces, +we call both “strings” in this appendix) can be added all by itself, +to add a string resource to the current resource. This is used, for +example, to define the string printed on a menu button. In this +example, four strings are added to the File resource: + +

     File = {
+       Sample
+       "longer sample"
+       some text
+     }
+
+

Second, a named string may be added by giving two strings separated by +an equals sign. This is used to specify X resources and a few other +optional parameters of menus, for example. Note that a string all by +itself is thus an “unnamed” string. + +

     {"Layer groups" foreground=red sensitive=false}
+
+

Third, an unnamed subresource may be added. This is used to create +submenus and menu buttons. To add a subresource, simply group other +things in curly braces. This example describes a resource containing +one string and three subresources: + +

     {File
+       {New do_new()}
+       {Save do_save()}
+       {Quit do_quit()}
+     }
+
+

Lastly, a named subresource may be added by prefixing an unnamed +subresource with a string and an equals sign, just as when naming +strings. This syntax is used to name the resources used for the main +menu and popup menus: + +

     MainMenu = {
+       ...
+       }
+
+

Additionally, the menu parser allows for “hooks” whereby portions of +the menu system can be programmatically created at runtime by the +application. These hooks are invoked by a single word proceeded by an +at sign, such as this example where most of the Sizes menu is created +automatically: + +

     {Sizes
+         @sizes
+         {"Adjust active sizes ..." AdjustStyle(0)}
+         }
+
+

In addition to all that, any unquoted pound sign (#) begins a +comment. Commented text continues until the end of the containing +line. Comments may begin at the beginning of a line, or after other +text on the line: + +

     # This is a comment
+     MainMenu = { # This is also a comment
+
+
+ +


+Next: , +Previous: Resource Syntax, +Up: Custom Menus + +
+ +

B.2 Menu Definitions

+ +

To best understand this section, you should find the +pcb-menu.res file that your Pcb uses and refer to it for +examples (see Menu Files and Defaults). Note that the lesstif +GUI uses pcb-menu.res and the GTK+ GUI uses gpcb-menu.res. +The file format is identical however and if so desired, one can make +one file be a soft link to the other. + +

A resource defines a menu when it meets certain semantic requirements. +The menu hierarchy is reflected as a hierarchy of unnamed +subresources, with the first string of each subresource defining the +label used for the menu button. A subresource that itself contains +subresources becomes a submenu, a subresource that does not becomes a +button. + +

A submenu should only contain subresources for the buttons or submenus +within that submenu. Two exceptions are allowed: an initial string +sets the label, and the string “-” (a single dash) will create a +separator. + +

A button should not contain subresources, but will contain many +strings, named and unnamed. The first member shall be an unnamed +string which is the label for the button. Any other unnamed strings +within the button's resource will be used as actions (much like the +.Xdefaults action strings), which are functions that will be called +when the button is pressed (or popped up, or created, depending on the +action). As a convenience, if a left parenthesis is seen, the current +“word” will continue at least until the matching right parenthesis. +This allows you to pass strings with spaces as arguments to actions +without needing to quote the action. + +

Named resources in button resources will be used as X resources. Such +resources can be used to set the font, color, and spacing of buttons. +As a convenience, “fg” can be used as an abbreviation for “foreground”. + +

Within the menu's resource file, Pcb will look for a few key named +subresources. At the moment, the only one it looks for is one called +MainMenu. This will be used for the main menu bar. In the +future, other named subresources will be used for popup resources. + +

Given all this, a small sample pcb-menu.res would be: + +

     MainMenu = {
+       {File
+         {"Load layout" Load(Layout)}
+         -
+         {"Quit Program" Quit() fg=red font=10x20}
+       }
+     }
+
+

Within the Pcb sources are specially crafted comments that mark all +the actions, flags, menu hooks, and whatnot that Pcb offers. Read the +file src/gather-actions in the Pcb source tree for +documentation for these comments. + +

+ +


+Previous: Menu Definitions, +Up: Custom Menus + +
+ +

B.3 Menu Files and Defaults

+ +

Pcb will look for a file which defines its menus, trying the following +names (the example is for the lesstif GUI, the GTK+ GUI has “gpcb-menu.res” +in place of “pcb-menu.res”): + +

     ./pcb-menu.res
+     $HOME/.pcb-menu.res
+     $PCBLIBDIR/pcb-menu.res
+     <internal>
+
+

Note that pcblibdir defaults to /usr/local/share/pcb +(hence, /usr/local/share/pcb/pcb-menu.res). The +<internal> entry refers to a menu definition within the Pcb +application itself. The master file for all this is the file +src/pcb-menu.res in the Pcb source tree. This master source is +used to create the internal menu definition as well as being installed +in $pcblibdir. + + +

+ +


+Next: , +Previous: Custom Menus, +Up: Top + +
+ +

Appendix C Element Search/Regular Expressions

+ +

+ +

C.1 Element Search/Regular Expressions

+ +

Pcb's search is based on POSIX 1003.2 Regular Expressions. Full POSIX +Regular Expressions are supported by Pcb if the regex library was +available when Pcb was built. One difference from the regular +expressions found in tools like awk or grep is that PCB implicitly +adds a “^” to the begining of a regular expression and “$” to the +end of the regular expression. For example, if you enter “C1”, the +actual regular expression used internally is “^C1$”. Another difference +is that search patterns in pcb are not case sensitive. That is, “CON” is +treated the same as “con”. + +

It is easier to show by example how to search than explain +POSIX 1003.2. With regular expressions most characters are just +themselves, but some are special: + +

+
*
Matches 0 or more instances of preceding character. + +
+
Matches 1 or more instances of preceding character. + +
?
Matches 0 or 1 instances of preceding character. + +
.
Matches any single character other than the newline character. + +
|
The vertical bar is the alternation operator. It combines two +regular expressions. The result matches if either of them matches. + +
\
A backslash indicates the next character should not be interpreted literally +if it normally is, and should be interpreted literally if it normally isn't. + +
{n}
An integer n enclosed in curly brackets matches the preceding item if +it occurs exactly n times. + +
[ ]
A pair of square brackets matches every character they contain. Characters +may be given explicitly, or as ranges. + +
-
A hyphen in the context of square brackets denotes the range between the +preceding and the following character. E.g., the range of digits is +“0-9” . The range of letters from C to K is “C-K” . + +
\^ inside square brackets
Inside square brackets the caret is an anti operator. Its presence makes +the square prackets match anything except the contents of the brackets. + +
( )
Round parenthesis group parts of a regular expression. This is very much +like they do in math formulars. + +
+ +

If you need a special character literally, you can escape it with a +backslash. + +

The following examples illustrate how regular expressions can be used to +specify element names (reference designators) to search for. +

+
C5
Select the element whose name is exactly “C5”. + +
C5 | R3
Select C5 and R3. + +
C.*
Select all elements whose name start with the letter “C”, such as C5, or +C42, or CF1. + +
C.*1
Select all elements that start with “C” and end with “1”, such as C1, +or C51 or C5/9B71. + +
R10?
Search for R1 or R10, but will not select R100 or R105. The question mark +is a quantifier for the character “0”. + +
R128+
Selects R128, R1288, R12888, etc. + +
TB.
Select all terminal blocks having exactly one character designator after +“TB” such as TB1, TBA, or TBx but not TB. + +
TB..
Select all terminal blocks having a two character designator such as TB21 or +TB1a. + +
TB.*
Select all terminal blocks with any designator. + +
.*31
Select all items, whose name ends with “31” such as Q31, or R31, or R531. + +
Q[12]
Select Q1 and Q2. + +
[A-D].*
Select all items, whose name starts with “A”, “B”, “C”, or “D”. + +
.*N{2}.*
Select all items, whose name contains two “N” in a row such as +CONN23, or connA, but not CON5 + +
[^D].*
Select all items that do not start with the letter “D”, such as C2, or +R34, but not D34 + +
+ + +
+ +


+Next: , +Previous: Regular Expressions, +Up: Top + +
+ +

Appendix D Standard Drill Size Tables

+ +

+ +

D.1 American Standard Wire Size Drills

+ + + +

Drill Diameter Drill Diameter Drill Diameter +
Size (inches) Size (inches) Size (inches) + +


97 .0059 96 .0063 95 .0067 +
94 .0071 93 .0075 92 .0079 +
91 .0083 90 .0087 89 .0091 +
88 .0095 87 .0100 86 .0105 +
85 .0110 84 .0115 83 .0120 +
82 .0125 81 .0130 80 .0135 +
79 .0145 78 .0160 77 .0180 +
76 .0200 75 .0210 74 .0225 +
73 .0240 72 .0250 71 .0260 +
70 .0280 69 .0292 68 .0310 +
67 .0320 66 .0330 65 .0350 +
64 .0360 63 .0370 62 .0380 +
61 .0390 60 .0400 59 .0410 +
58 .0420 57 .0430 56 .0465 +
55 .0520 54 .0550 53 .0595 +
52 .0635 51 .0670 50 .0700 +
49 .0730 48 .0760 47 .0785 +
46 .0810 45 .0820 44 .0860 +
43 .0890 42 .0935 41 .0960 +
40 .0980 39 .0995 38 .1015 +
37 .1040 36 .1065 35 .1100 +
34 .1110 33 .1130 32 .1160 +
31 .1200 30 .1285 29 .1360 +
28 .1405 27 .1440 26 .1470 +
25 .1495 24 .1520 23 .1540 +
22 .1570 21 .1590 20 .1610 +
19 .1660 18 .1695 17 .1730 +
16 .1770 15 .1800 14 .1820 +
13 .1850 12 .1890 11 .1910 +
10 .1935 9 .1960 8 .1990 +
7 .2010 6 .2040 5 .2055 +
4 .2090 3 .2130 2 .2210 +
1 .2280 +
+ +

D.2 American Standard Letter Size Drills

+ + + +

Drill Diameter Drill Diameter Drill Diameter +
Size (inches) Size (inches) Size (inches) + +


A .2340 B .2380 C .2420 +
D .2460 E .2500 F .2570 +
G .2610 H .2660 I .2720 +
J .2770 K .2810 L .2900 +
M .2950 N .3020 O .3160 +
P .3230 Q .3320 R .3390 +
S .3480 T .3580 U .3680 +
V .3770 W .3860 X .3970 +
Y .4040 Z .4130 +
+ +

D.3 Fractional Inch Size Drills

+ + + +

Drill Diameter Drill Diameter Drill Diameter +
Size (inches) Size (inches) Size (inches) + +


1/64 .0156 1/32 .0313 3/64 .0469 +
1/16 .0625 5/64 .0781 3/32 .0938 +
7/64 .1094 1/8 .1250 9/64 .1406 +
5/32 .1562 11/64 .1719 3/16 .1875 +
13/64 .2031 7/32 .2188 15/64 .2344 +
1/4 .2500 17/64 .2656 9/32 .2812 +
19/64 .2969 5/16 .3125 21/64 .3281 +
11/32 .3438 23/64 .3594 3/8 .3750 +
25/64 .3906 13/32 .4062 27/64 .4219 +
7/16 .4375 29/64 .4531 15/32 .4688 +
31/64 .4844 1/2 .5000 33/64 .5156 +
17/32 .5313 35/64 .5469 9/16 .5625 +
37/64 .5781 19/32 .5938 39/64 .6094 +
5/8 .6250 41/64 .6406 21/32 .6562 +
43/64 .6719 11/16 .6875 45/64 .7031 +
23/32 .7188 47/64 .7344 3/4 .7500 +
49/64 .7656 25/32 .7812 51/64 .7969 +
13/16 .8125 53/64 .8281 27/32 .8438 +
55/64 .8594 7/8 .8750 57/64 .8906 +
29/32 .9062 59/64 .9219 15/16 .9375 +
61/64 .9531 31/32 .9688 63/64 .9844 +
1 1.0000 +
+ +

D.4 Metric Drills

+ + + +

Drill Diameter Drill Diameter Drill Diameter +
Size (inches) Size (inches) Size (inches) + +


0.20 mm .00787 0.25 mm .00984 0.30 mm .0118 +
0.35 mm .0138 0.40 mm .0158 0.45 mm .0177 +
0.50 mm .0197 0.55 mm .0217 0.60 mm .0236 +
0.65 mm .0256 0.70 mm .0276 0.75 mm .0295 +
0.80 mm .0315 0.85 mm .0335 0.90 mm .0354 +
0.95 mm .0374 1.00 mm .0394 1.05 mm .0413 +
1.10 mm .0433 1.15 mm .0453 1.20 mm .0472 +
1.25 mm .0492 1.30 mm .0512 1.35 mm .0531 +
1.40 mm .0551 1.45 mm .0571 1.50 mm .0591 +
1.55 mm .0610 1.60 mm .0630 1.65 mm .0650 +
1.70 mm .0669 1.75 mm .0689 1.80 mm .0709 +
1.85 mm .0728 1.90 mm .0748 1.95 mm .0768 +
2.00 mm .0787 2.05 mm .0807 2.10 mm .0827 +
2.15 mm .0846 2.20 mm .0866 2.25 mm .0886 +
2.30 mm .0906 2.35 mm .0925 2.40 mm .0945 +
2.45 mm .0965 2.50 mm .0984 2.55 mm .1004 +
2.60 mm .1024 2.65 mm .1043 2.70 mm .1063 +
2.75 mm .1083 2.80 mm .1102 2.85 mm .1122 +
2.90 mm .1142 2.95 mm .1161 3.00 mm .1181 +
3.10 mm .1220 3.15 mm .1240 3.20 mm .1260 +
3.25 mm .1280 3.30 mm .1299 3.40 mm .1339 +
3.50 mm .1378 3.60 mm .1417 3.70 mm .1457 +
3.75 mm .1476 3.80 mm .1496 3.90 mm .1535 +
4.00 mm .1575 4.10 mm .1614 4.20 mm .1654 +
4.25 mm .1673 4.30 mm .1693 4.40 mm .1732 +
4.50 mm .1772 4.60 mm .1811 4.70 mm .1850 +
4.75 mm .1870 4.80 mm .1890 4.90 mm .1929 +
5.00 mm .1969 5.10 mm .2008 5.20 mm .2047 +
5.25 mm .2067 5.30 mm .2087 5.40 mm .2126 +
5.50 mm .2165 5.60 mm .2205 5.70 mm .2244 +
5.75 mm .2264 5.80 mm .2283 5.90 mm .2323 +
6.00 mm .2362 6.10 mm .2402 6.20 mm .2441 +
6.25 mm .2461 6.30 mm .2480 6.40 mm .2520 +
6.50 mm .2559 6.60 mm .2598 6.70 mm .2638 +
6.75 mm .2657 6.80 mm .2677 6.90 mm .2717 +
7.00 mm .2756 7.10 mm .2795 7.20 mm .2835 +
7.25 mm .2854 7.30 mm .2874 7.40 mm .2914 +
7.50 mm .2953 7.60 mm .2992 7.70 mm .3031 +
8.00 mm .3150 8.10 mm .3189 8.20 mm .3228 +
8.25 mm .3248 8.30 mm .3268 8.40 mm .3307 +
8.50 mm .3346 8.60 mm .3386 8.70 mm .3425 +
8.75 mm .3445 8.80 mm .3465 8.90 mm .3504 +
9.00 mm .3543 9.10 mm .3583 9.20 mm .3622 +
9.25 mm .3642 9.30 mm .3661 9.40 mm .3701 +
9.50 mm .3740 9.60 mm .3780 9.70 mm .3819 +
9.75 mm .3839 9.80 mm .3858 9.90 mm .3898 +
10.00 mm .3937 10.10 mm .3976 10.20 mm .4016 +
10.25 mm .4035 10.30 mm .4055 10.40 mm .4094 +
10.50 mm .4134 10.60 mm .4173 10.70 mm .4213 +
10.80 mm .4252 10.90 mm .4291 11.00 mm .4331 +
11.10 mm .4370 11.20 mm .4409 11.25 mm .4429 +
11.30 mm .4449 11.40 mm .4488 11.50 mm .4528 +
11.60 mm .4567 11.70 mm .4606 11.75 mm .4626 +
11.80 mm .4646 11.90 mm .4685 12.00 mm .4724 +
12.50 mm .4921 13.00 mm .5118 13.50 mm .5315 +
14.00 mm .5512 14.50 mm .5709 15.00 mm .5906 +
15.50 mm .6102 16.00 mm .6299 16.50 mm .6496 +
17.00 mm .6693 17.50 mm .6890 18.00 mm .7087 +
18.50 mm .7283 19.00 mm .7480 19.50 mm .7677 +
20.00 mm .7874 20.50 mm .8071 21.00 mm .8268 +
21.50 mm .8465 22.00 mm .8661 22.50 mm .8858 +
23.00 mm .9055 23.50 mm .9252 24.00 mm .9449 +
24.50 mm .9646 25.00 mm .9843 +
+ + +

+ +


+Next: , +Previous: Standard Drill Sizes, +Up: Top + +
+ +

Appendix E Centroid (X-Y) File Format

+ +

+ +

E.1 Overview

+ +

E.2 File Format

+ +

The centroid output file is in a standard comma seperated values (CSV) +format. Comment lines begin with a “#”. The output file contains a +header with an RCS Id tag (useful for those who will check the file +into a version control system), a version number for the file format, +some comments containing the author and title of the board, and a +comment describing the remainder of the file format. + +

An example centroid file is shown below. + +

     
+     # $Id$
+     # PcbXY Version 1.0
+     # Date: Fri Jul 22 03:40:08 2005 UTC
+     # Author: PCB User
+     # Title: MyBoard - PCB X-Y
+     # RefDes, Description, Value, X, Y, rotation, top/bottom
+     # X,Y in mils.  rotation in degrees.
+     # --------------------------------------------
+     R61,"0603","10",2610.00,3560.00,90,top
+     J5,"AMPHENOL_ARFX1231","unknown",2390.00,4220.00,180,top
+     C13,"0402","0.01u",2340.00,3014.00,270,top
+     
+
+

E.3 Computation of Centroid and Rotation

+ +

The center of each element is found by averaging the (X,Y) coordinates +for the center of each pin and pad in the element. For example if an +element has 2 pins, 1 at (1,0) and another at (1,4) then the centroid +will be at (1,2). + +

The calculation of rotation is a bit more complex. Currently a +rotation is not stored for each element but rather the rotated element +is stored. In other words if the element from the library has a pin +at (0,0) and (0,2) and it has been rotated by 90 degrees, then the +.pcb file will store (0,0) and (2,0) for the pin locations with +no indication that they have been rotated from the original. + +

In the event that the element has only 1 pin, then the rotation is set +to zero. If the element has only one pad (as opposed to a +through-hole pin), then the rotation of the pad is used. + +

When the element has multiple pins, the location of pin #1 is placed +in the coordinate system which has the centroid of the part at (0,0). +Then which quadrant pin #1 falls in determines the rotation. Zero +degrees of rotation is defined as pin #1 being in the upper left +quadrant. Increasing angles correspond to counterclockwise rotation so a +rotation of 90 degrees places pin #1 in the lower left quadrant. +Currently, the only allowed rotations are 0, 90, 180, and 270 degrees. + +

If pin #1 happens to be at the centroid of the part, then pin #2 is +examined to see which quadrant it is located in. The same rules apply +for the definitions of rotation. In other words, when pin #1 is at +the centroid of the part and pin #2 is in the upper left quadrant, the +rotation is declared to be zero degrees. + + +

+ +


+Next: , +Previous: Centroid File Format, +Up: Top + +
+ +

Appendix F Action Reference

+ +

+ + + +

Many actions take a delta parameter as the last parameter, +which is an amount to change something. That delta may include +units, as an additional parameter, such as Action(Object,5,mm). +If no units are specified, the default is PCB's native units +(currently 1/100 mil). Also, if the delta is prefixed by + or +-, the size is increased or decreased by that amount. +Otherwise, the size size is set to the given amount. + +

     Action(Object,5,mil)
+     Action(Object,+0.5,mm)
+     Action(Object,-1)
+
+

Actions which take a delta parameter which do not accept all +these options will specify what they do take. + + + + +

Many actions act on indicated objects on the board. They will have +parameters like ToggleObject or SelectedVias to indicate +what group of objects they act on. Unless otherwise specified, these +parameters are defined as follows: + +

+
Object
ToggleObject
Affects the object under the mouse pointer. If this action is invoked +from a menu or script, the user will be prompted to click on an +object, which is then the object affected. + +
Selected
SelectedObjects
+Affects all objects which are currently selected. At least, all +selected objects for which the given action makes sense. + +
SelectedPins
SelectedVias
SelectedType
etc
Affects all objects which are both selected and of the Type specified. + +
+ + + +
+ +


+Next: , +Up: Action Reference + +
+ +

F.1 Core actions

+ + +
+ +


+Next: , +Up: core actions + +
+ +

F.1.1 AddRats

+ + +

+
AddRats(AllRats|SelectedRats|Close)
+
+ +

Add one or more rat lines to the board. + + +

+
AllRats
Create rat lines for all loaded nets that aren't already connected on +with copper. + +
SelectedRats
Similarly, but only add rat lines for nets connected to selected pins +and pads. + +
Close
Selects the shortest unselected rat on the board. + +
+ +
+ +


+Next: , +Previous: AddRats Action, +Up: core actions + +
+ +

F.1.2 ApplyVendor

+ + +

+
ApplyVendor()
+
+ +

Applies the currently loaded vendor drill table to the current design. + + +This will modify all of your drill holes to match the list of allowed +sizes for your vendor. + +

+ +


+Next: , +Previous: ApplyVendor Action, +Up: core actions + +
+ +

F.1.3 Atomic

+ + +

+
Atomic(Save|Restore|Close|Block)
+
+ +

Save or restore the undo serial number. + + +

This action allows making multiple-action bindings into an atomic +operation that will be undone by a single Undo command. For example, +to optimize rat lines, you'd delete the rats and re-add them. To +group these into a single undo, you'd want the deletions and the +additions to have the same undo serial number. So, you Save, +delete the rats, Restore, add the rats - using the same serial +number as the deletes, then Block, which checks to see if the +deletions or additions actually did anything. If not, the serial +number is set to the saved number, as there's nothing to undo. If +something did happen, the serial number is incremented so that these +actions are counted as a single undo step. + +

+
Save
Saves the undo serial number. + +
Restore
Returns it to the last saved number. + +
Close
Sets it to 1 greater than the last save. + +
Block
Does a Restore if there was nothing to undo, else does a Close. + +
+ +
+ +


+Next: , +Previous: Atomic Action, +Up: core actions + +
+ +

F.1.4 Attributes

+ + +

+
Attributes(Layout|Layer|Element)
+Attributes(Layer,layername)
+
+ +

Let the user edit the attributes of the layout, current or given +layer, or selected element. + + +

This just pops up a dialog letting the user edit the attributes of the +pcb, an element, or a layer. + +

+ +


+Next: , +Previous: Attributes Action, +Up: core actions + +
+ +

F.1.5 AutoPlaceSelected

+ + +

+
AutoPlaceSelected()
+
+ +

Auto-place selected components. + + +

Attempts to re-arrange the selected components such that the nets +connecting them are minimized. Note that you cannot undo this. + +

+ +


+Next: , +Previous: AutoPlaceSelected Action, +Up: core actions + +
+ +

F.1.6 AutoRoute

+ + +

+
AutoRoute(AllRats|SelectedRats)
+
+ +

Auto-route some or all rat lines. + + +

+
AllRats
Attempt to autoroute all rats. + +
SelectedRats
Attempt to autoroute the selected rats. + +
+ +

Before autorouting, it's important to set up a few things. First, +make sure any layers you aren't using are disabled, else the +autorouter may use them. Next, make sure the current line and via +styles are set accordingly. Last, make sure "new lines clear +polygons" is set, in case you eventually want to add a copper pour. + +

Autorouting takes a while. During this time, the program may not be +responsive. + +

+ +


+Next: , +Previous: AutoRoute Action, +Up: core actions + +
+ +

F.1.7 ChangeClearSize

+ + +

+
ChangeClearSize(Object, delta)
+ChangeClearSize(SelectedPins|SelectedPads|SelectedVias, delta)
+ChangeClearSize(SelectedLines|SelectedArcs, delta
+ChangeClearSize(Selected|SelectedObjects, delta)
+
+ +

Changes the clearance size of objects. + + +

If the solder mask is currently showing, this action changes the +solder mask clearance. If the mask is not showing, this action +changes the polygon clearance. + +

+ +


+Next: , +Previous: ChangeClearSize Action, +Up: core actions + +
+ +

F.1.8 ChangeDrillSize

+ + +

+
ChangeDrillSize(Object, delta)
+ChangeDrillSize(SelectedPins|SelectedVias|Selected|SelectedObjects, delta)
+
+ +

Changes the drilling hole size of objects. + + +

+ +


+Next: , +Previous: ChangeDrillSize Action, +Up: core actions + +
+ +

F.1.9 ChangeFlag

+ + +

+
ChangeFlag(Object|Selected|SelectedObjects, flag, value)
+ChangeFlag(SelectedLines|SelectedPins|SelectedVias, flag, value)
+ChangeFlag(SelectedPads|SelectedTexts|SelectedNames, flag, value)
+ChangeFlag(SelectedElements, flag, value)
+flag = square | octagon | thermal | join
+value = 0 | 1
+
+ +

Sets or clears flags on objects. + + +

Toggles the given flag on the indicated object(s). The flag may be +one of the flags listed above (square, octagon, thermal, join). The +value may be the number 0 or 1. If the value is 0, the flag is +cleared. If the value is 1, the flag is set. + +

+ +


+Next: , +Previous: ChangeFlag Action, +Up: core actions + +
+ +

F.1.10 ChangeHole

+ + +

+
ChangeHole(ToggleObject|Object|SelectedVias|Selected)
+
+ +

Changes the hole flag of objects. + + +

The "hole flag" of a via determines whether the via is a +plated-through hole (not set), or an unplated hole (set). + +

+ +


+Next: , +Previous: ChangeHole Action, +Up: core actions + +
+ +

F.1.11 ChangeJoin

+ + +

+
ChangeJoin(ToggleObject|SelectedLines|SelectedArcs|Selected)
+
+ +

Changes the join (clearance through polygons) of objects. + + +

The join flag determines whether a line or arc, drawn to intersect a +polygon, electrically connects to the polygon or not. When joined, +the line/arc is simply drawn over the polygon, making an electrical +connection. When not joined, a gap is drawn between the line and the +polygon, insulating them from each other. + +

+ +


+Next: , +Previous: ChangeJoin Action, +Up: core actions + +
+ +

F.1.12 ChangeName

+ + +

+
ChangeName(Object)
+ChangeName(Layout|Layer)
+
+ +

Sets the name of objects. + + +

+
Object
Changes the name of the element under the cursor. + +
Layout
Changes the name of the layout. This is printed on the fab drawings. + +
Layer
Changes the name of the currently active layer. + +
+ +
+ +


+Next: , +Previous: ChangeName Action, +Up: core actions + +
+ +

F.1.13 ChangeOctagon

+ + +

+
ChangeOctagon(Object|ToggleObject|SelectedObjects|Selected)
+ChangeOctagon(SelectedElements|SelectedPins|SelectedVias)
+
+ +

Changes the octagon-flag of pins and vias. + + +

Pins, pads, and vias can have various shapes. All may be round. Pins +and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a +shape flag of an element, you actually change all of its pins and +pads. + +

Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + +

+ +


+Next: , +Previous: ChangeOctagon Action, +Up: core actions + +
+ +

F.1.14 ChangePaste

+ + +

+
ChangePaste(ToggleObject|Object|SelectedPads|Selected)
+
+ +

Changes the no paste flag of objects. + + +

The "no paste flag" of a pad determines whether the solderpaste + stencil will have an opening for the pad (no set) or if there wil be + no solderpaste on the pad (set). This is used for things such as + fiducial pads. + +

+ +


+Next: , +Previous: ChangePaste Action, +Up: core actions + +
+ +

F.1.15 ChangePinName

+ + +

+
ChangePinName(ElementName,PinNumber,PinName)
+
+ +

Sets the name of a specific pin on a specific element. + + +

This can be especially useful for annotating pin names from a +schematic to the layout without requiring knowledge of the pcb file +format. + +

     ChangePinName(U3, 7, VCC)
+
+
+ +


+Next: , +Previous: ChangePinName Action, +Up: core actions + +
+ +

F.1.16 ChangeSize

+ + +

+
ChangeSize(Object, delta)
+ChangeSize(SelectedObjects|Selected, delta)
+ChangeSize(SelectedLines|SelectedPins|SelectedVias, delta)
+ChangeSize(SelectedPads|SelectedTexts|SelectedNames, delta)
+ChangeSize(SelectedElements, delta)
+
+ +

Changes the size of objects. + + +

For lines and arcs, this changes the width. For pins and vias, this +changes the overall diameter of the copper annulus. For pads, this +changes the width and, indirectly, the length. For texts and names, +this changes the scaling factor. For elements, this changes the width +of the silk layer lines and arcs for this element. + +

+ +


+Next: , +Previous: ChangeSize Action, +Up: core actions + +
+ +

F.1.17 ChangeSquare

+ + +

+
ChangeSquare(ToggleObject)
+ChangeSquare(SelectedElements|SelectedPins)
+ChangeSquare(Selected|SelectedObjects)
+
+ +

Changes the square flag of pins and pads. + + +

Note that Pins means both pins and pads. + +

Pins, pads, and vias can have various shapes. All may be round. Pins +and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a +shape flag of an element, you actually change all of its pins and +pads. + +

Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + +

+ +


+Next: , +Previous: ChangeSquare Action, +Up: core actions + +
+ +

F.1.18 ClearOctagon

+ + +

+
ClearOctagon(ToggleObject|Object|SelectedObjects|Selected)
+ClearOctagon(SelectedElements|SelectedPins|SelectedVias)
+
+ +

Clears the octagon-flag of pins and vias. + + +

Pins, pads, and vias can have various shapes. All may be round. Pins +and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a +shape flag of an element, you actually change all of its pins and +pads. + +

Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + +

+ +


+Next: , +Previous: ClearOctagon Action, +Up: core actions + +
+ +

F.1.19 ClearSquare

+ + +

+
ClearSquare(ToggleObject|SelectedElements|SelectedPins)
+
+ +

Clears the square-flag of pins and pads. + + +

Note that Pins means pins and pads. + +

Pins, pads, and vias can have various shapes. All may be round. Pins +and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a +shape flag of an element, you actually change all of its pins and +pads. + +

Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + +

+ +


+Next: , +Previous: ClearSquare Action, +Up: core actions + +
+ +

F.1.20 ClrFlag

+ + +

+
ClrFlag(Object|Selected|SelectedObjects, flag)
+ClrFlag(SelectedLines|SelectedPins|SelectedVias, flag)
+ClrFlag(SelectedPads|SelectedTexts|SelectedNames, flag)
+ClrFlag(SelectedElements, flag)
+flag = square | octagon | thermal | join
+
+ +

Clears flags on objects. + + +

Turns the given flag off, regardless of its previous setting. See +ChangeFlag. + +

     ClrFlag(SelectedLines,join)
+
+
+ +


+Next: , +Previous: ClrFlag Action, +Up: core actions + +
+ +

F.1.21 Connection

+ + +

+
Connection(Find|ResetLinesAndPolygons|ResetPinsAndVias|Reset)
+
+ +

Searches connections of the object at the cursor position. + + +

Connections found with this action will be highlighted in the +“connected-color” color and will have the “found” flag set. + +

+
Find
The net under the cursor is “found”. + +
ResetLinesAndPolygons
Any “found” lines and polygons are marked “not found”. + +
ResetPinsAndVias
Any “found” pins and vias are marked “not found”. + +
Reset
All “found” objects are marked “not found”. + +
+ +
+ +


+Next: , +Previous: Connection Action, +Up: core actions + +
+ +

F.1.22 Delete

+ + +

+
Delete(Object|Selected)
+Delete(AllRats|SelectedRats)
+
+ +

Delete stuff. + + +

+ +


+Next: , +Previous: Delete Action, +Up: core actions + +
+ +

F.1.23 DeleteRats

+ + +

+
DeleteRats(AllRats|Selected|SelectedRats)
+
+ +

Delete rat lines. + + +

+ +


+Next: , +Previous: DeleteRats Action, +Up: core actions + +
+ +

F.1.24 DisableVendor

+ + +

+
DisableVendor()
+
+ +

Disables automatic drill size mapping. + + +

+When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. + +

+ +


+Next: , +Previous: DisableVendor Action, +Up: core actions + +
+ +

F.1.25 DisperseElements

+ + +

+
DisperseElements(All|Selected)
+
+ +

Disperses elements. + + +

Normally this is used when starting a board, by selecting all elements +and then dispersing them. This scatters the elements around the board +so that you can pick individual ones, rather than have all the +elements at the same 0,0 coordinate and thus impossible to choose +from. + +

+ +


+Next: , +Previous: DisperseElements Action, +Up: core actions + +
+ +

F.1.26 Display

+ + +

+
Display(NameOnPCB|Description|Value)
+Display(Grid|Redraw)
+Display(CycleClip|CycleCrosshair|Toggle45Degree|ToggleStartDirection)
+Display(ToggleGrid|ToggleRubberBandMode|ToggleUniqueNames)
+Display(ToggleMask|ToggleName|ToggleClearLine|ToggleFullPoly|ToggleSnapPin)
+Display(ToggleThindraw|ToggleThindrawPoly|ToggleOrthoMove|ToggleLocalRef)
+Display(ToggleCheckPlanes|ToggleShowDRC|ToggleAutoDRC)
+Display(ToggleLiveRoute|LockNames|OnlyNames)
+Display(Pinout|PinOrPadName)
+
+ +

Several display-related actions. + + +

+
NameOnPCB
Description
Value
Specify whether all elements show their name, description, or value. + +
Redraw
Redraw the whole board. + +
Toggle45Degree
When clear, lines can be drawn at any angle. When set, lines are +restricted to multiples of 45 degrees and requested lines may be +broken up according to the clip setting. + +
CycleClip
Changes the way lines are restricted to 45 degree increments. The +various settings are: straight only, orthogonal then angled, and angled +then orthogonal. If AllDirections is set, this action disables it. + +
CycleCrosshair
Changes crosshair drawing. Crosshair may accept form of 4-ray, +8-ray and 12-ray cross. + +
ToggleRubberBandMode
If set, moving an object moves all the lines attached to it too. + +
ToggleStartDirection
If set, each time you set a point in a line, the Clip toggles between +orth-angle and angle-ortho. + +
ToggleUniqueNames
If set, you will not be permitted to change the name of an element to +match that of another element. + +
ToggleSnapPin
If set, pin centers and pad end points are treated as additional grid +points that the cursor can snap to. + +
ToggleLocalRef
If set, the mark is automatically set to the beginning of any move, so +you can see the relative distance you've moved. + +
ToggleThindraw
If set, objects on the screen are drawn as outlines (lines are drawn +as center-lines). This lets you see line endpoints hidden under pins, +for example. + +
ToggleThindrawPoly
If set, polygons on the screen are drawn as outlines. + +
ToggleShowDRC
If set, pending objects (i.e. lines you're in the process of drawing) +will be drawn with an outline showing how far away from other copper +you need to be. + +
ToggleLiveRoute
If set, the progress of the autorouter will be visible on the screen. + +
ToggleAutoDRC
If set, you will not be permitted to make connections which violate +the current DRC and netlist settings. + +
ToggleCheckPlanes
If set, lines and arcs aren't drawn, which usually leaves just the +polygons. If you also disable all but the layer you're interested in, +this allows you to check for isolated regions. + +
ToggleOrthoMove
If set, the crosshair is only allowed to move orthogonally from its +previous position. I.e. you can move an element or line up, down, +left, or right, but not up+left or down+right. + +
ToggleName
Selects whether the pinouts show the pin names or the pin numbers. + +
ToggleLockNames
If set, text will ignore left mouse clicks and actions that work on +objects under the mouse. You can still select text with a lasso (left +mouse drag) and perform actions on the selection. + +
ToggleOnlyNames
If set, only text will be sensitive for mouse clicks and actions that +work on objects under the mouse. You can still select other objects +with a lasso (left mouse drag) and perform actions on the selection. + +
ToggleMask
Turns the solder mask on or off. + +
ToggleClearLine
When set, the clear-line flag causes new lines and arcs to have their +“clear polygons” flag set, so they won't be electrically connected +to any polygons they overlap. + +
ToggleFullPoly
When set, the full-poly flag causes new polygons to have their +“full polygon” flag set, so all parts of them will be displayed +instead of only the biggest one. + +
ToggleGrid
Resets the origin of the current grid to be wherever the mouse pointer +is (not where the crosshair currently is). If you provide two numbers +after this, the origin is set to that coordinate. + +
Grid
Toggles whether the grid is displayed or not. + +
Pinout
Causes the pinout of the element indicated by the cursor to be +displayed, usually in a separate window. + +
PinOrPadName
Toggles whether the names of pins, pads, or (yes) vias will be +displayed. If the cursor is over an element, all of its pins and pads +are affected. + +
+ +
+ +


+Next: , +Previous: Display Action, +Up: core actions + +
+ +

F.1.27 djopt

+ + +

+
djopt(debumpify|unjaggy|simple|vianudge|viatrim|orthopull)
+djopt(auto) - all of the above
+djopt(miter)
+
+ +

Perform various optimizations on the current board. + + +

The different types of optimizations change your board in order to +reduce the total trace length and via count. + +

+
debumpify
Looks for U-shaped traces that can be shortened or eliminated. + +
unjaggy
Looks for corners which could be flipped to eliminate one or more +corners (i.e. jaggy lines become simpler). + +
simple
Removing uneeded vias, replacing two or more trace segments in a row +with a single segment. This is usually performed automatically after +other optimizations. + +
vianudge
Looks for vias where all traces leave in the same direction. Tries to +move via in that direction to eliminate one of the traces (and thus a +corner). + +
viatrim
Looks for traces that go from via to via, where moving that trace to a +different layer eliminates one or both vias. + +
orthopull
Looks for chains of traces all going in one direction, with more +traces orthogonal on one side than on the other. Moves the chain in +that direction, causing a net reduction in trace length, possibly +eliminating traces and/or corners. + +
splitlines
Looks for lines that pass through vias, pins, or pads, and splits them +into separate lines so they can be managed separately. + +
auto
Performs the above options, repeating until no further optimizations +can be made. + +
miter
Replaces 90 degree corners with a pair of 45 degree corners, to reduce +RF losses and trace length. + +
+ +
+ +


+Next: , +Previous: djopt Action, +Up: core actions + +
+ +

F.1.28 DRC

+ + +

+
DRC()
+
+ +

Invoke the DRC check. + + +

Note that the design rule check uses the current board rule settings, +not the current style settings. + +

+ +


+Next: , +Previous: DRC Action, +Up: core actions + +
+ +

F.1.29 DumpLibrary

+ + +

+
DumpLibrary()
+
+ +

Display the entire contents of the libraries. + + +

+ +


+Next: , +Previous: DumpLibrary Action, +Up: core actions + +
+ +

F.1.30 elementlist

+ + +

+
ElementList(Start|Done|Need,<refdes>,<footprint>,<value>)
+
+ +

Adds the given element if it doesn't already exist. + + +

+
Start
Indicates the start of an element list; call this before any Need +actions. + +
Need
Searches the board for an element with a matching refdes. + +

If found, the value and footprint are updated. + +

If not found, a new element is created with the given footprint and value. + +

Done
Compares the list of elements needed since the most recent +start with the list of elements actually on the board. Any +elements that weren't listed are selected, so that the user may delete +them. + +
+ +
+ +


+Next: , +Previous: elementlist Action, +Up: core actions + +
+ +

F.1.31 elementsetattr

+ + +

+
ElementSetAttr(refdes,name[,value])
+
+ +

Sets or clears an element-specific attribute. + + +

If a value is specified, the named attribute is added (if not already +present) or changed (if it is) to the given value. If the value is +not specified, the given attribute is removed if present. + +

+ +


+Next: , +Previous: elementsetattr Action, +Up: core actions + +
+ +

F.1.32 EnableVendor

+ + +

+
EnableVendor()
+
+ +

Enables automatic drill size mapping. + + +

+When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor resource file containing a drill table must be +loaded first. + +

+ +


+Next: , +Previous: EnableVendor Action, +Up: core actions + +
+ +

F.1.33 execcommand

+ + +

+
ExecCommand(command)
+
+ +

Runs a command. + + +

Runs the given command, which is a system executable. + +

+ +


+Next: , +Previous: execcommand Action, +Up: core actions + +
+ +

F.1.34 ExecuteFile

+ + +

+
ExecuteFile(filename)
+
+ +

Run actions from the given file. + + +

Lines starting with # are ignored. + +

+ +


+Next: , +Previous: ExecuteFile Action, +Up: core actions + +
+ +

F.1.35 Flip

+ + +

+
Flip(Object|Selected|SelectedElements)
+
+ +

Flip an element to the opposite side of the board. + + +

Note that the location of the element will be symmetric about the +cursor location; i.e. if the part you are pointing at will still be at +the same spot once the element is on the other side. When flipping +multiple elements, this retains their positions relative to each +other, not their absolute positions on the board. + +

+ +


+Next: , +Previous: Flip Action, +Up: core actions + +
+ +

F.1.36 FontEdit

+ + +

+
FontEdit()
+
+ +

Convert the current font to a PCB for editing. + + +

+ +


+Next: , +Previous: FontEdit Action, +Up: core actions + +
+ +

F.1.37 FontSave

+ + +

+
FontSave()
+
+ +

Convert the current PCB back to a font. + + +

+ +


+Next: , +Previous: FontSave Action, +Up: core actions + +
+ +

F.1.38 FreeRotateBuffer

+ + +

+
FreeRotateBuffer([Angle])
+
+ +

Rotates the current paste buffer contents by the specified angle. The +angle is given in degrees. If no angle is given, the user is prompted +for one. + + +

Rotates the contents of the pastebuffer by an arbitrary angle. If no +angle is given, the user is prompted for one. + +

+ +


+Next: , +Previous: FreeRotateBuffer Action, +Up: core actions + +
+ +

F.1.39 GlobalPuller

+ + +

+
GlobalPuller()
+
+ +

Pull all traces tight. + + +

+ +


+Next: , +Previous: GlobalPuller Action, +Up: core actions + +
+ +

F.1.40 h

+ + +

+
h
+
+ +

Print a help message for commands. + + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: h Action, +Up: core actions + +
+ +

F.1.41 Import

+ + +

+
Import()
+Import([gnetlist|make[,source,source,...]])
+Import(setnewpoint[,(mark|center|X,Y)])
+Import(setdisperse,D,units)
+
+
+ +

Import schematics. + + +

Imports element and netlist data from the schematics (or some other +source). The first parameter, which is optional, is the mode. If not +specified, the import::mode attribute in the PCB is used. +gnetlist means gnetlist is used to obtain the information from +the schematics. make invokes make, assuming the user +has a Makefile in the current directory. The Makefile +will be invoked with the following variables set: + +

+
PCB
The name of the .pcb file + +
SRCLIST
A space-separated list of source files + +
OUT
The name of the file in which to put the command script, which may +contain any Pcb actions. By default, this is a temporary file +selected by Pcb, but if you specify an import::outfile +attribute, that file name is used instead (and not automatically +deleted afterwards). + +
+ +

The target specified to be built is the first of these that apply: + +

    +
  • The target specified by an import::target attribute. + +
  • The output file specified by an import::outfile attribute. + +
  • If nothing else is specified, the target is pcb_import. + +
+ +

If you specify an import::makefile attribute, then "-f <that +file>" will be added to the command line. + +

If you specify the mode, you may also specify the source files +(schematics). If you do not specify any, the list of schematics is +obtained by reading the import::srcN attributes (like +import::src0, import::src1, etc). + +

For compatibility with future extensions to the import file format, +the generated file must not start with the two characters +#%. + +

If a temporary file is needed the TMPDIR environment variable +is used to select its location. + +

Note that the programs gnetlist and make may be +overridden by the user via the make-program and gnetlist +pcb settings (i.e. in ~/.pcb/settings or on the command +line). + +

If Pcb cannot determine which schematic(s) to import from, the GUI +is called to let user choose (see ImportGUI()). + +

Note that Import() doesn't delete anything - after an Import, elements +which shouldn't be on the board are selected and may be removed once +it's determined that the deletion is appropriate. + +

If Import() is called with setnewpoint, then the location +of new components can be specified. This is where parts show up when +they're added to the board. The default is the center of the board. + +

+
Import(setnewpoint)
+Prompts the user to click on the board somewhere, uses that point. If +called by a hotkey, uses the current location of the crosshair. + +
Import(setnewpoint,mark)
+Uses the location of the mark. If no mark is present, the point is +not changed. + +
Import(setnewpoint,center)
+Resets the point to the center of the board. + +
Import(setnewpoint,X,Y,units)
+Sets the point to the specific coordinates given. Example: +Import(setnewpoint,50,25,mm) + +
+ +

Note that the X and Y locations are stored in attributes named +import::newX and import::newY so you could change them +manually if you wished. + +

Calling Import(setdisperse,D,units) sets how much the newly +placed elements are dispersed relative to the set point. For example, +Import(setdisperse,10,mm) will offset each part randomly up to +10mm away from the point. The default dispersion is 1/10th of the +smallest board dimension. Dispersion is saved in the +import::disperse attribute. + +

+ +


+Next: , +Previous: Import Action, +Up: core actions + +
+ +

F.1.42 l

+ + +

+
l [name]
+
+ +

Loads layout data. + + +

Loads a new datafile (layout) and, if confirmed, overwrites any +existing unsaved data. The filename and the searchpath +(filePath) are passed to the command defined by +fileCommand. If no filename is specified a file select box +will popup. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: l Action, +Up: core actions + +
+ +

F.1.43 le

+ + +

+
le [name]
+
+ +

Loads an element into the current buffer. + + +

The filename and the searchpath (elementPath) are passed to the +command defined by elementCommand. If no filename is specified +a file select box will popup. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: le Action, +Up: core actions + +
+ +

F.1.44 LoadFootprint

+ + +

+
LoadFootprint(filename[,refdes,value])
+
+ +

Loads a single footprint by name. + + +

Loads a single footprint by name, rather than by reference or through +the library. If a refdes and value are specified, those are inserted +into the footprint as well. The footprint remains in the paste buffer. + +

+ +


+Next: , +Previous: LoadFootprint Action, +Up: core actions + +
+ +

F.1.45 LoadFrom

+ + +

+
LoadFrom(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert,filename)
+
+ +

Load layout data from a file. + + +

This action assumes you know what the filename is. The various GUIs +should have a similar Load action where the filename is +optional, and will provide their own file selection mechanism to let +you choose the file name. + +

+
Layout
Loads an entire PCB layout, replacing the current one. + +
LayoutToBuffer
Loads an entire PCB layout to the paste buffer. + +
ElementToBuffer
Loads the given element file into the paste buffer. Element files +contain only a single Element definition, such as the +“newlib” library uses. + +
Netlist
Loads a new netlist, replacing any current netlist. + +
Revert
Re-loads the current layout from its disk file, reverting any changes +you may have made. + +
+ +
+ +


+Next: , +Previous: LoadFrom Action, +Up: core actions + +
+ +

F.1.46 LoadVendorFrom

+ + +

+
LoadVendorFrom(filename)
+
+ +

Loads the specified vendor resource file. + + +

+

+
filename
Name of the vendor resource file. If not specified, the user will +be prompted to enter one. +
+ +
+ +


+Next: , +Previous: LoadVendorFrom Action, +Up: core actions + +
+ +

F.1.47 m

+ + +

+
m [name]
+
+ +

Loads a layout into the current buffer. + + +

The filename and the searchpath (filePath) are passed to the +command defined by fileCommand. +If no filename is specified a file select box will popup. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: m Action, +Up: core actions + +
+ +

F.1.48 MarkCrosshair

+ + +

+
MarkCrosshair()
+MarkCrosshair(Center)
+
+ +

Set/Reset the Crosshair mark. + + +

The “mark” is a small X-shaped target on the display which is +treated like a second origin (the normal origin is the upper let +corner of the board). The GUI will display a second set of +coordinates for this mark, which tells you how far you are from it. + +

If no argument is given, the mark is toggled - disabled if it was +enabled, or enabled at the current cursor position of disabled. If +the Center argument is given, the mark is moved to the current +cursor location. + +

+ +


+Next: , +Previous: MarkCrosshair Action, +Up: core actions + +
+ +

F.1.49 Message

+ + +

+
Message(message)
+
+ +

Writes a message to the log window. + + +

This action displays a message to the log window. This action is primarily +provided for use by other programs which may interface with PCB. If +multiple arguments are given, each one is sent to the log window +followed by a newline. + +

+ +


+Next: , +Previous: Message Action, +Up: core actions + +
+ +

F.1.50 MinClearGap

+ + +

+
MinClearGap(delta)
+MinClearGap(Selected, delta)
+
+ +

Ensures that polygons are a minimum distance from objects. + + +

Checks all specified objects, and increases the polygon clearance if +needed to ensure a minimum distance between their edges and the +polygon edges. + +

+ +


+Next: , +Previous: MinClearGap Action, +Up: core actions + +
+ +

F.1.51 MinMaskGap

+ + +

+
MinMaskGap(delta)
+MinMaskGap(Selected, delta)
+
+ +

Ensures the mask is a minimum distance from pins and pads. + + +

Checks all specified pins and/or pads, and increases the mask if +needed to ensure a minimum distance between the pin or pad edge and +the mask edge. + +

+ +


+Next: , +Previous: MinMaskGap Action, +Up: core actions + +
+ +

F.1.52 Mode

+ + +

+
Mode(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer)
+Mode(Polygon|Rectangle|Remove|Rotate|Text|Thermal|Via)
+Mode(Notify|Release|Cancel|Stroke)
+Mode(Save|Restore)
+
+ +

Change or use the tool mode. + + +

+
Arc
Arrow
Copy
InsertPoint
Line
Lock
Move
None
PasteBuffer
Polygon
Rectangle
Remove
Rotate
Text
Thermal
Via
Select the indicated tool. + +
Notify
Called when you press the mouse button, or move the mouse. + +
Release
Called when you release the mouse button. + +
Cancel
Cancels any pending tool activity, allowing you to restart elsewhere. +For example, this allows you to start a new line rather than attach a +line to the previous line. + +
Escape
Similar to Cancel but calling this action a second time will return +to the Arrow tool. + +
Stroke
If your pcb was built with libstroke, this invokes the stroke +input method. If not, this will restart a drawing mode if you were +drawing, else it will select objects. + +
Save
Remembers the current tool. + +
Restore
Restores the tool to the last saved tool. + +
+ +
+ +


+Next: , +Previous: Mode Action, +Up: core actions + +
+ +

F.1.53 MorphPolygon

+ + +

+
MorphPolygon(Object|Selected)
+
+ +

Converts dead polygon islands into separate polygons. + + +

If a polygon is divided into unconnected "islands", you can use +this command to convert the otherwise disappeared islands into +separate polygons. Be sure the cursor is over a portion of the +polygon that remains visible. Very small islands that may flake +off are automatically deleted. + +

+ +


+Next: , +Previous: MorphPolygon Action, +Up: core actions + +
+ +

F.1.54 MoveLayer

+ + +

+
MoveLayer(old,new)
+
+ +

Moves/Creates/Deletes Layers. + + +

Moves a layer, creates a new layer, or deletes a layer. + +

+
old
The is the layer number to act upon. Allowed values are: +
+
c
Currently selected layer. + +
-1
Create a new layer. + +
number
An existing layer number. + +
+ +
new
Specifies where to move the layer to. Allowed values are: +
+
-1
Deletes the layer. + +
up
Moves the layer up. + +
down
Moves the layer down. + +
c
Creates a new layer. + +
+ +
+ +
+ +


+Next: , +Previous: MoveLayer Action, +Up: core actions + +
+ +

F.1.55 MoveObject

+ + +

+
MoveObject(X,Y,dim)
+
+ +

Moves the object under the crosshair. + + +

The X and Y are treated like delta is for many +other objects. For each, if it's prefixed by + or -, +then that amount is relative. Otherwise, it's absolute. Units can be +mil or mm; if unspecified, units are PCB's internal +units, currently 1/100 mil. + +

+ +


+Next: , +Previous: MoveObject Action, +Up: core actions + +
+ +

F.1.56 MoveToCurrentLayer

+ + +

+
MoveToCurrentLayer(Object|SelectedObjects)
+
+ +

Moves objects to the current layer. + + +

Note that moving an element from a component layer to a solder layer, +or from solder to component, won't automatically flip it. Use the +Flip() action to do that. + +

+ +


+Next: , +Previous: MoveToCurrentLayer Action, +Up: core actions + +
+ +

F.1.57 Netlist

+ + +

+
Net(find|select|rats|norats|clear[,net[,pin]])
+Net(freeze|thaw|forcethaw)
+Net(add,net,pin)
+
+ +

Perform various actions on netlists. + + +

Each of these actions apply to a specified set of nets. net and +pin are patterns which match one or more nets or pins; these +patterns may be full names or regular expressions. If an exact match +is found, it is the only match; if no exact match is found, +then the pattern is tried as a regular expression. + +

If neither net nor pin are specified, all nets apply. If +net is specified but not pin, all nets matching net +apply. If both are specified, nets which match net and contain +a pin matching pin apply. + +

+
find
Nets which apply are marked found and are drawn in the +connected-color color. + +
select
Nets which apply are selected. + +
rats
Nets which apply are marked as available for the rats nest. + +
norats
Nets which apply are marked as not available for the rats nest. + +
clear
Clears the netlist. + +
add
Add the given pin to the given netlist, creating either if needed. + +
sort
Called after a list of add's, this sorts the netlist. + +
freeze
thaw
forcethaw
Temporarily prevents changes to the netlist from being reflected in +the GUI. For example, if you need to make multiple changes, you +freeze the netlist, make the changes, then thaw it. Note that +freeze/thaw requests may nest, with the netlist being fully thawed +only when all pending freezes are thawed. You can bypass the nesting +by using forcethaw, which resets the freeze count and immediately +updates the GUI. + +
+ +
+ +


+Next: , +Previous: Netlist Action, +Up: core actions + +
+ +

F.1.58 New

+ + +

+
New([name])
+
+ +

Starts a new layout. + + +

If a name is not given, one is prompted for. + +

+ +


+Next: , +Previous: New Action, +Up: core actions + +
+ +

F.1.59 OptAutoOnly

+ + +

+
OptAutoOnly()
+
+ +

Toggles the optimize-only-autorouted flag. + + +

The original purpose of the trace optimizer was to clean up the traces +created by the various autorouters that have been used with PCB. When +a board has a mix of autorouted and carefully hand-routed traces, you +don't normally want the optimizer to move your hand-routed traces. +But, sometimes you do. By default, the optimizer only optimizes +autorouted traces. This action toggles that setting, so that you can +optimize hand-routed traces also. + +

+ +


+Next: , +Previous: OptAutoOnly Action, +Up: core actions + +
+ +

F.1.60 PasteBuffer

+ + +

+
PasteBuffer(AddSelected|Clear|1..MAX_BUFFER)
+PasteBuffer(Rotate, 1..3)
+PasteBuffer(Convert|Save|Restore|Mirror)
+PasteBuffer(ToLayout, X, Y, units)
+
+ +

Various operations on the paste buffer. + + +

There are a number of paste buffers; the actual limit is a +compile-time constant MAX_BUFFER in globalconst.h. It +is currently 5. One of these is the “current” paste buffer, +often referred to as “the” paste buffer. + +

+
AddSelected
Copies the selected objects to the current paste buffer. + +
Clear
Remove all objects from the current paste buffer. + +
Convert
Convert the current paste buffer to an element. Vias are converted to +pins, lines are converted to pads. + +
Restore
Convert any elements in the paste buffer back to vias and lines. + +
Mirror
Flip all objects in the paste buffer vertically (up/down flip). To mirror +horizontally, combine this with rotations. + +
Rotate
Rotates the current buffer. The number to pass is 1..3, where 1 means +90 degrees counter clockwise, 2 means 180 degrees, and 3 means 90 +degrees clockwise (270 CCW). + +
Save
Saves any elements in the current buffer to the indicated file. + +
ToLayout
Pastes any elements in the current buffer to the indicated X, Y +coordinates in the layout. The X and Y are treated like +delta is for many other objects. For each, if it's prefixed by ++ or -, then that amount is relative to the last +location. Otherwise, it's absolute. Units can be +mil or mm; if unspecified, units are PCB's internal +units, currently 1/100 mil. + +
1..MAX_BUFFER
Selects the given buffer to be the current paste buffer. + +
+ +
+ +


+Next: , +Previous: PasteBuffer Action, +Up: core actions + +
+ +

F.1.61 Polygon

+ + +

+
Polygon(Close|PreviousPoint)
+
+ +

Some polygon related stuff. + + +

Polygons need a special action routine to make life easier. + +

+
Close
Creates the final segment of the polygon. This may fail if clipping +to 45 degree lines is switched on, in which case a warning is issued. + +
PreviousPoint
Resets the newly entered corner to the previous one. The Undo action +will call Polygon(PreviousPoint) when appropriate to do so. + +
+ +
+ +


+Next: , +Previous: Polygon Action, +Up: core actions + +
+ +

F.1.62 Puller

+ + +

+
Puller()
+
+ +

Pull an arc-line junction tight. + + +

The 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, +the left side is “before” with the black target marking where to put +the crosshair: + +

Example of how puller works
+ +

The right side is “after” with the black target marking where the +arc-line intersection was moved to. + +

+ +


+Next: , +Previous: Puller Action, +Up: core actions + +
+ +

F.1.63 q

+ + +

+
q
+
+ +

Quits the application after confirming. + + +

If you have unsaved changes, you will be prompted to confirm (or +save) before quitting. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ + +


+Next: , +Previous: q Action, +Up: core actions + +
+ +

F.1.64 q!

+ + +

+
q!
+
+ +

Quits the application without confirming. + + +

Note that this command neither saves your data nor prompts for +confirmation. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: q! Action, +Up: core actions + +
+ +

F.1.65 Quit

+ + +

+
Quit()
+
+ +

Quits the application after confirming. + + +

If you have unsaved changes, you will be prompted to confirm (or +save) before quitting. + +

+ +


+Next: , +Previous: Quit Action, +Up: core actions + +
+ +

F.1.66 Redo

+ + +

+
Redo()
+
+ +

Redo recent“undo”operations. + + +

This routine allows you to recover from the last undo command. You +might want to do this if you thought that undo was going to revert +something other than what it actually did (in case you are confused +about which operations are un-doable), or if you have been backing up +through a long undo list and over-shoot your stopping point. Any +change that is made since the undo in question will trim the redo +list. For example if you add ten lines, then undo three of them you +could use redo to put them back, but if you move a line on the board +before performing the redo, you will lose the ability to "redo" the +three "undone" lines. + +

+ +


+Next: , +Previous: Redo Action, +Up: core actions + +
+ +

F.1.67 RemoveSelected

+ + +

+
RemoveSelected()
+
+ +

Removes any selected objects. + + +

+ +


+Next: , +Previous: RemoveSelected Action, +Up: core actions + +
+ +

F.1.68 Renumber

+ + +

+
Renumber()
+Renumber(filename)
+
+ +

Renumber all elements. The changes will be recorded to filename +for use in backannotating these changes to the schematic. + + +

+ +


+Next: , +Previous: Renumber Action, +Up: core actions + +
+ +

F.1.69 Report

+ + +

+
Report(Object|DrillReport|FoundPins|NetLength|AllNetLengths|[,name])
+
+ +

Produce various report. + + +

+
Object
The object under the crosshair will be reported, describing various +aspects of the object. + +
DrillReport
A report summarizing the number of drill sizes used, and how many of +each, will be produced. + +
FoundPins
A report listing all pins and pads which are marked as “found” will +be produced. + +
NetLength
The name and length of the net under the crosshair will be reported to +the message log. + +
AllNetLengths
The name and length of the net under the crosshair will be reported to +the message log. An optional parameter specifies mm, mil, pcb, or in +units + +
+ +
+ +


+Next: , +Previous: Report Action, +Up: core actions + +
+ +

F.1.70 ReportDialog

+ + +

+
ReportDialog()
+
+ +

Report on the object under the crosshair + + +

This is a shortcut for Report(Object). + +

+ +


+Next: , +Previous: ReportDialog Action, +Up: core actions + +
+ +

F.1.71 RipUp

+ + +

+
RipUp(All|Selected|Element)
+
+ +

Ripup auto-routed tracks, or convert an element to parts. + + +

+
All
Removes all lines and vias which were created by the autorouter. + +
Selected
Removes all selected lines and vias which were created by the +autorouter. + +
Element
Converts the element under the cursor to parts (vias and lines). Note +that this uses the highest numbered paste buffer. + +
+ +
+ +


+Next: , +Previous: RipUp Action, +Up: core actions + +
+ +

F.1.72 rn

+ + +

+
rn [name]
+
+ +

Reads netlist. + + +

If no filename is given a file select box will pop up. The file is +read via the command defined by the RatCommand resource. The +command must send its output to stdout. + +

Netlists are used for generating rat's nests (see Rats Nest) and +for verifying the board layout (which is also accomplished by the +Ratsnest command). + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: rn Action, +Up: core actions + +
+ +

F.1.73 RouteStyle

+ + +

+
RouteStyle(1|2|3|4)
+
+ +

Copies the indicated routing style into the current sizes. + + +

+ +


+Next: , +Previous: RouteStyle Action, +Up: core actions + +
+ +

F.1.74 s

+ + +

+
s [name]
+
+ +

Saves layout data. + + +

Data and the filename are passed to the command defined by the +resource saveCommand. It must read the layout data from +stdin. If no filename is entered, either the last one is used +again or, if it is not available, a file select box will pop up. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: s Action, +Up: core actions + +
+ +

F.1.75 SaveSettings

+ + +

+
SaveSettings()
+SaveSettings(local)
+
+ +

Saves settings. + + +

If you pass no arguments, the settings are stored in +$HOME/.pcb/settings. If you pass the word local they're +saved in ./pcb.settings. + +

+ +


+Next: , +Previous: SaveSettings Action, +Up: core actions + +
+ +

F.1.76 SaveTo

+ + +

+
SaveTo(Layout|LayoutAs,filename)
+SaveTo(AllConnections|AllUnusedPins|ElementConnections,filename)
+SaveTo(PasteBuffer,filename)
+
+ +

Saves data to a file. + + +

+
Layout
Saves the current layout. + +
LayoutAs
Saves the current layout, and remembers the filename used. + +
AllConnections
Save all connections to a file. + +
AllUnusedPins
List all unused pins to a file. + +
ElementConnections
Save connections to the element at the cursor to a file. + +
PasteBuffer
Save the content of the active Buffer to a file. This is the graphical way to create a footprint. + +
+ +
+ +


+Next: , +Previous: SaveTo Action, +Up: core actions + +
+ +

F.1.77 Select

+ + +

+
Select(Object|ToggleObject)
+Select(All|Block|Connection)
+Select(ElementByName|ObjectByName|PadByName|PinByName)
+Select(ElementByName|ObjectByName|PadByName|PinByName, Name)
+Select(TextByName|ViaByName|NetByName)
+Select(TextByName|ViaByName|NetByName, Name)
+Select(Convert)
+
+ +

Toggles or sets the selection. + + +

+
ElementByName
ObjectByName
PadByName
PinByName
TextByName
ViaByName
NetByName
+These all rely on having a regular expression parser built into +pcb. If the name is not specified then the user is prompted +for a pattern, and all objects that match the pattern and are of the +type specified are selected. + +
Object
ToggleObject
Selects the object under the cursor. + +
Block
Selects all objects in a rectangle indicated by the cursor. + +
All
Selects all objects on the board. + +
Connection
Selects all connections with the “found” flag set. + +
Convert
Converts the selected objects to an element. This uses the highest +numbered paste buffer. + +
+ +
+ +


+Next: , +Previous: Select Action, +Up: core actions + +
+ +

F.1.78 SetFlag

+ + +

+
SetFlag(Object|Selected|SelectedObjects, flag)
+SetFlag(SelectedLines|SelectedPins|SelectedVias, flag)
+SetFlag(SelectedPads|SelectedTexts|SelectedNames, flag)
+SetFlag(SelectedElements, flag)
+flag = square | octagon | thermal | join
+
+ +

Sets flags on objects. + + +

Turns the given flag on, regardless of its previous setting. See +ChangeFlag. + +

     SetFlag(SelectedPins,thermal)
+
+
+ +


+Next: , +Previous: SetFlag Action, +Up: core actions + +
+ +

F.1.79 SetOctagon

+ + +

+
SetOctagon(Object|ToggleObject|SelectedElements|Selected)
+
+ +

Sets the octagon-flag of objects. + + +

Pins, pads, and vias can have various shapes. All may be round. Pins +and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a +shape flag of an element, you actually change all of its pins and +pads. + +

Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + +

+ +


+Next: , +Previous: SetOctagon Action, +Up: core actions + +
+ +

F.1.80 SetSame

+ + +

+
SetSame()
+
+ +

Sets current layer and sizes to match indicated item. + + +

When invoked over any line, arc, polygon, or via, this changes the +current layer to be the layer that item is on, and changes the current +sizes (thickness, keepaway, drill, etc) according to that item. + +

+ +


+Next: , +Previous: SetSame Action, +Up: core actions + +
+ +

F.1.81 SetSquare

+ + +

+
SetSquare(ToggleObject|SelectedElements|SelectedPins)
+
+ +

sets the square-flag of objects. + + +

Note that Pins means pins and pads. + +

Pins, pads, and vias can have various shapes. All may be round. Pins +and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a +shape flag of an element, you actually change all of its pins and +pads. + +

Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + +

+ +


+Next: , +Previous: SetSquare Action, +Up: core actions + +
+ +

F.1.82 SetThermal

+ + +

+
SetThermal(Object|SelectedPins|SelectedVias|Selected, Style)
+
+ +

Set the thermal (on the current layer) of pins or vias to the given style. +Style = 0 means no thermal. +Style = 1 has diagonal fingers with sharp edges. +Style = 2 has horizontal and vertical fingers with sharp edges. +Style = 3 is a solid connection to the plane.Style = 4 has diagonal fingers with rounded edges. +Style = 5 has horizontal and vertical fingers with rounded edges. + + +

This changes how/whether pins or vias connect to any rectangle or polygon +on the current layer. The first argument can specify one object, or all +selected pins, or all selected vias, or all selected pins and vias. +The second argument specifies the style of connection. +There are 5 possibilities: +0 - no connection, +1 - 45 degree fingers with sharp edges, +2 - horizontal & vertical fingers with sharp edges, +3 - solid connection, +4 - 45 degree fingers with rounded corners, +5 - horizontal & vertical fingers with rounded corners. + +

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. + +

+ +


+Next: , +Previous: SetThermal Action, +Up: core actions + +
+ +

F.1.83 SetValue

+ + +

+
SetValue(Grid|Line|LineSize|Text|TextScale|ViaDrillingHole|Via|ViaSize, delta)
+
+ +

Change various board-wide values and sizes. + + +

+
ViaDrillingHole
Changes the diameter of the drill for new vias. + +
Grid
Sets the grid spacing. + +
Line
LineSize
Changes the thickness of new lines. + +
Via
ViaSize
Changes the diameter of new vias. + +
Text
TextScale
Changes the size of new text. + +
+ +
+ +


+Next: , +Previous: SetValue Action, +Up: core actions + +
+ +

F.1.84 ToggleHideName

+ + +

+
ToggleHideName(Object|SelectedElements)
+
+ +

Toggles the visibility of element names. + + +

If names are hidden you won't see them on the screen and they will not +appear on the silk layer when you print the layout. + +

+ +


+Next: , +Previous: ToggleHideName Action, +Up: core actions + +
+ +

F.1.85 ToggleVendor

+ + +

+
ToggleVendor()
+
+ +

Toggles the state of automatic drill size mapping. + + +

+When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor resource file containing a drill table must be +loaded first. + +

+ +


+Next: , +Previous: ToggleVendor Action, +Up: core actions + +
+ +

F.1.86 Undo

+ + +

+
Undo()
+Undo(ClearList)
+
+ +

Undo recent changes. + + +

The unlimited undo feature of Pcb allows you to recover from +most operations that materially affect you work. Calling +Undo() without any parameter recovers from the last (non-undo) +operation. ClearList is used to release the allocated +memory. ClearList is called whenever a new layout is started or +loaded. See also Redo and Atomic. + +

Note that undo groups operations by serial number; changes with the +same serial number will be undone (or redone) as a group. See +Atomic. + +

+ +


+Next: , +Previous: Undo Action, +Up: core actions + +
+ +

F.1.87 UnloadVendor

+ + +

+
UnloadVendor()
+
+ +

Unloads the current vendor drill mapping table. + + +

+ +

+ +


+Next: , +Previous: UnloadVendor Action, +Up: core actions + +
+ +

F.1.88 Unselect

+ + +

+
Unselect(All|Block|Connection)
+Unselect(ElementByName|ObjectByName|PadByName|PinByName)
+Unselect(ElementByName|ObjectByName|PadByName|PinByName, Name)
+Unselect(TextByName|ViaByName)
+Unselect(TextByName|ViaByName, Name)
+
+
+ +

Unselects the object at the pointer location or the specified objects. + + +

+
All
Unselect all objects. + +
Block
Unselect all objects in a rectangle given by the cursor. + +
Connection
Unselect all connections with the “found” flag set. + +
ElementByName
ObjectByName
PadByName
PinByName
TextByName
ViaByName
+These all rely on having a regular expression parser built into +pcb. If the name is not specified then the user is prompted +for a pattern, and all objects that match the pattern and are of the +type specified are unselected. + +
+ +
+ +


+Next: , +Previous: Unselect Action, +Up: core actions + +
+ +

F.1.89 w

+ + +

+
w [name]
+
+ +

Saves layout data. + + +

This commands has been added for the convenience of vi users +and has the same functionality as s. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Previous: w Action, +Up: core actions + +
+ +

F.1.90 wq

+ + +

+
wq
+
+ +

Saves the layout data and quits. + + +

This command has been added for the convenience of vi users and +has the same functionality as s combined with q. + +

This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (:) and thus the syntax +is documented for that purpose. + +

+ +


+Next: , +Previous: core actions, +Up: Action Reference + +
+ +

F.2 common actions

+ + + +
+ +


+Next: , +Up: common actions + +
+ +

F.2.1 LayersChanged

+ + +

+
LayersChanged()
+
+ +

Tells the GUI that the layers have changed. + + +

This includes layer names, colors, stacking order, visibility, etc. + +

This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + +

+ +


+Next: , +Previous: LayersChanged Action, +Up: common actions + +
+ +

F.2.2 LibraryChanged

+ + +

+
LibraryChanged()
+
+ +

Tells the GUI that the libraries have changed. + + +

This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + +

+ +


+Next: , +Previous: LibraryChanged Action, +Up: common actions + +
+ +

F.2.3 NetlistChanged

+ + +

+
NetlistChanged()
+
+ +

Tells the GUI that the netlist has changed. + + +

This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + +

+ +

F.2.4 PCBChanged

+ + +

+
PCBChanged([revert])
+
+ +

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 beingreloaded, and that it might keep some viewport settings + + +

This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + +

+ +


+Previous: PCBChanged Action, +Up: common actions + +
+ +

F.2.5 RouteStylesChanged

+ + +

+
RouteStylesChanged()
+
+ +

Tells the GUI that the routing styles have changed. + + +

This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + +

+ +


+Next: , +Previous: common actions, +Up: Action Reference + +
+ +

F.3 gtk actions

+ + +
+ +


+Next: , +Up: gtk actions + +
+ +

F.3.1 gtk About

+ + +

+
About()
+
+ +

N_("Tell the user about this version of PCB."); + + +

This just pops up a dialog telling the user which version of +pcb they're running. + +

+ +


+Next: , +Previous: gtk About Action, +Up: gtk actions + +
+ +

F.3.2 gtk AdjustStyle

+ + +

+
AdjustStyle()
+
+
+ +

Open the window which allows editing of the route styles. + + +

Opens the window which allows editing of the route styles. + +

+ +


+Next: , +Previous: gtk AdjustStyle Action, +Up: gtk actions + +
+ +

F.3.3 gtk Center

+ + +

+
Center()
+
+
+ +

N_("Moves the pointer to the center of the window."); + + +

Move the pointer to the center of the window, but only if it's +currently within the window already. + +

+ +


+Next: , +Previous: gtk Center Action, +Up: gtk actions + +
+ +

F.3.4 gtk Cursor

+ + +

+
Cursor(Type,DeltaUp,DeltaRight,Units)
+
+ +

N_("Move the cursor."); + + +

This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive DeltaUp may move the +cursor towards the board origin if the board is inverted. + +

Type is one of ‘Pan’ or ‘Warp’. ‘Pan’ causes the +viewport to move such that the crosshair is under the mouse cursor. +‘Warp’ causes the mouse cursor to move to be above the crosshair. + +

Units can be one of the following: + +

+
mil
mm
The cursor is moved by that amount, in board units. + +
grid
The cursor is moved by that many grid points. + +
view
The values are percentages of the viewport's view. Thus, a pan of +‘100’ would scroll the viewport by exactly the width of the +current view. + +
board
The values are percentages of the board size. Thus, a move of +‘50,50’ moves you halfway across the board. + +
+ +
+ +


+Next: , +Previous: gtk Cursor Action, +Up: gtk actions + +
+ +

F.3.5 gtk DoWindows

+ + +

+
DoWindows(1|2|3|4|5|6)
+DoWindows(Layout|Library|Log|Netlist|Preferences|DRC)
+
+ +

N_("Open various GUI windows."); + + +

+
1
Layout
Open the layout window. Since the layout window is always shown +anyway, this has no effect. + +
2
Library
Open the library window. + +
3
Log
Open the log window. + +
4
Netlist
Open the netlist window. + +
5
Preferences
Open the preferences window. + +
6
DRC
Open the DRC violations window. + +
+ +
+ +


+Next: , +Previous: gtk DoWindows Action, +Up: gtk actions + +
+ +

F.3.6 gtk EditLayerGroups

+ + +

+
EditLayerGroups()
+
+
+ +

Open the preferences window which allows editing of the layer groups. + + +

Opens the preferences window which is where the layer groups +are edited. This action is primarily provides to provide menu +resource compatibility with the lesstif HID. + +

+ +


+Next: , +Previous: gtk EditLayerGroups Action, +Up: gtk actions + +
+ +

F.3.7 gtk GetXY

+ + +

+
GetXY()
+
+ +

N_("Get a coordinate."); + + +

Prompts the user for a coordinate, if one is not already selected. + +

+ +


+Next: , +Previous: gtk GetXY Action, +Up: gtk actions + +
+ +

F.3.8 gtk ImportGUI

+ + +

+
ImportGUI()
+
+ +

N_("Asks user which schematics to import into PCB. +"); + + +

Asks user which schematics to import into PCB. + +

+ +


+Next: , +Previous: gtk ImportGUI Action, +Up: gtk actions + +
+ +

F.3.9 gtk Pan

+ + +

+
Pan([thumb], Mode)
+
+ +

N_("Start or stop panning (Mode = 1 to start, 0 to stop) +Optional thumb argument is ignored for now in gtk hid. +"); + + +

Start or stop panning. To start call with Mode = 1, to stop call with +Mode = 0. + +

+ +


+Next: , +Previous: gtk Pan Action, +Up: gtk actions + +
+ +

F.3.10 gtk Popup

+ + +

+
Popup(MenuName, [Button])
+
+ +

N_("Bring up the popup menu specified by MenuName. +If called by a mouse event then the mouse button number +must be specified as the optional second argument."); + + +

This just pops up the specified menu. The menu must have been defined +as a named subresource of the Popups resource in the menu resource +file. + +

+ +


+Next: , +Previous: gtk Popup Action, +Up: gtk actions + +
+ +

F.3.11 gtk Print

+ + +

+
Print()
+
+ +

N_("Print the layout."); + + +

This will find the default printing HID, prompt the user for its +options, and print the layout. + +

+ +


+Next: , +Previous: gtk Print Action, +Up: gtk actions + +
+ +

F.3.12 gtk PrintCalibrate

+ + +

+
PrintCalibrate()
+
+ +

N_("Calibrate the printer."); + + +

This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + +

+ +


+Next: , +Previous: gtk PrintCalibrate Action, +Up: gtk actions + +
+ +

F.3.13 gtk Save

+ + +

+
Save()
+Save(Layout|LayoutAs)
+Save(AllConnections|AllUnusedPins|ElementConnections)
+Save(PasteBuffer)
+
+ +

N_("Save layout and/or element data to a user-selected file."); + + +

This action is a GUI front-end to the core's SaveTo action +(see SaveTo Action). If you happen to pass a filename, like +SaveTo, then SaveTo is called directly. Else, the +user is prompted for a filename to save, and then SaveTo is +called with that filename. + +

+ +


+Next: , +Previous: gtk Save Action, +Up: gtk actions + +
+ +

F.3.14 gtk SelectLayer

+ + +

+
SelectLayer(1..MAXLAYER|Silk|Rats)
+
+ +

Select which layer is the current layer. + + +

The specified layer becomes the currently active layer. It is made +visible if it is not already visible + +

+ +


+Next: , +Previous: gtk SelectLayer Action, +Up: gtk actions + +
+ +

F.3.15 gtk SetUnits

+ + +

+
SetUnits(mm|mil)
+
+ +

N_("Set the default measurement units."); + + +

+
mil
Sets the display units to mils (1/1000 inch). + +
mm
Sets the display units to millimeters. + +
+ +
+ +


+Next: , +Previous: gtk SetUnits Action, +Up: gtk actions + +
+ +

F.3.16 gtk SwapSides

+ + +

+
SwapSides(|v|h|r)
+
+ +

N_("Swaps the side of the board you're looking at."); + + +

This action changes the way you view the board. + +

+
v
Flips the board over vertically (up/down). + +
h
Flips the board over horizontally (left/right), like flipping pages in +a book. + +
r
Rotates the board 180 degrees without changing sides. + +
+ +

If no argument is given, the board isn't moved but the opposite side +is shown. + +

Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + +

As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the “working +side” of the board. + +

+ +


+Next: , +Previous: gtk SwapSides Action, +Up: gtk actions + +
+ +

F.3.17 gtk ToggleView

+ + +

+
ToggleView(1..MAXLAYER)
+ToggleView(layername)
+ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide)
+
+ +

Toggle the visibility of the specified layer or layer group. + + +

If you pass an integer, that layer is specified by index (the first +layer is 1, etc). If you pass a layer name, that layer is +specified by name. When a layer is specified, the visibility of the +layer group containing that layer is toggled. + +

If you pass a special layer name, the visibility of those components +(silk, rats, etc) is toggled. Note that if you have a layer named +the same as a special layer, the layer is chosen over the special layer. + +

+ +


+Previous: gtk ToggleView Action, +Up: gtk actions + +
+ +

F.3.18 gtk Zoom

+ + +

+
Zoom()
+Zoom(factor)
+
+ +

N_("Various zoom factor changes."); + +Changes the zoom (magnification) of the view of the board. If no +arguments are passed, the view is scaled such that the board just fits +inside the visible window (i.e. “view all”). Otherwise, +factor specifies a change in zoom factor. It may be prefixed by ++, -, or = to change how the zoom factor is +modified. The factor is a floating point number, such as +1.5 or 0.75. + +

+ +
+factor
Values greater than 1.0 cause the board to be drawn smaller; more of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn bigger; less of the board will be visible. + +
-factor
Values greater than 1.0 cause the board to be drawn bigger; less of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn smaller; more of the board will be visible. + +
=factor
+The factor is an absolute zoom factor; the unit for this value +is "PCB units per screen pixel". Since PCB units are 0.01 mil, a +factor of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, +about the actual resolution of most screens - resulting in an "actual +size" board. Similarly, a factor of 100 gives you a 10x actual +size. + +
+ +

Note that zoom factors of zero are silently ignored. + +

+ +


+Previous: gtk actions, +Up: Action Reference + +
+ +

F.4 lesstif actions

+ + + + +

F.4.1 lesstif About

+ + +

+
About()
+
+ +

Tell the user about this version of PCB. + + +

This just pops up a dialog telling the user which version of +pcb they're running. + +

+ +

F.4.2 lesstif AdjustSizes

+ + +

+
AdjustSizes()
+
+ +

Let the user change the board size, DRC parameters, etc + + +

Displays a dialog box that lets the user change the board +size, DRC parameters, and text scale. + +

The units are determined by the default display units. + +

+ +

F.4.3 lesstif AdjustStyle

+ + +

+
AdjustStyle()
+
+ +

Displays the route style adjustment window. + + +

+ +

F.4.4 lesstif Benchmark

+ + +

+
Benchmark()
+
+ +

Benchmark the GUI speed. + + +

This action is used to speed-test the Lesstif graphics subsystem. It +redraws the current screen as many times as possible in ten seconds. +It reports the amount of time needed to draw the screen once. + +

+ +

F.4.5 lesstif Command

+ + +

+
Command()
+
+ +

Displays the command line input window. + + +

The command window allows the user to manually enter actions to be +executed. Action syntax can be done one of two ways: + +

+
Follow the action name by an open parenthesis, arguments separated by +commas, end with a close parenthesis. Example: Abc(1,2,3) + +
Separate the action name and arguments by spaces. Example: Abc +1 2 3. + +
+ +

The first option allows you to have arguments with spaces in them, +but the second is more “natural” to type for most people. + +

Note that action names are not case sensitive, but arguments normally +are. However, most actions will check for “keywords” in a case +insensitive way. + +

There are three ways to finish with the command window. If you press +the Enter key, the command is invoked, the window goes away, +and the next time you bring up the command window it's empty. If you +press the Esc key, the window goes away without invoking +anything, and the next time you bring up the command window it's +empty. If you change focus away from the command window (i.e. click +on some other window), the command window goes away but the next time +you bring it up it resumes entering the command you were entering +before. + +

+ +


+Next: , +Previous: lesstif Command Action, +Up: lesstif actions + +
+ +

F.4.6 lesstif Cursor

+ + +

+
Cursor(Type,DeltaUp,DeltaRight,Units)
+
+ +

Move the cursor. + + +

This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive DeltaUp may move the +cursor towards the board origin if the board is inverted. + +

Type is one of ‘Pan’ or ‘Warp’. ‘Pan’ causes the +viewport to move such that the crosshair is under the mouse cursor. +‘Warp’ causes the mouse cursor to move to be above the crosshair. + +

Units can be one of the following: + +

+
mil
mm
The cursor is moved by that amount, in board units. + +
grid
The cursor is moved by that many grid points. + +
view
The values are percentages of the viewport's view. Thus, a pan of +‘100’ would scroll the viewport by exactly the width of the +current view. + +
board
The values are percentages of the board size. Thus, a move of +‘50,50’ moves you halfway across the board. + +
+ +
+ +


+Next: , +Previous: lesstif Cursor Action, +Up: lesstif actions + +
+ +

F.4.7 lesstif Debug

+ + +

+
Debug(...)
+
+ +

Debug action. + + +

This action exists to help debug scripts; it simply prints all its +arguments to stdout. + +

+ +

F.4.8 lesstif DebugXY

+ + +

+
DebugXY(...)
+
+ +

Debug action, with coordinates + + +

Like Debug, but requires a coordinate. If the user hasn't yet +indicated a location on the board, the user will be prompted to click +on one. + +

+ +

F.4.9 lesstif DoWindows

+ + +

+
DoWindows(1|2|3|4)
+DoWindows(Layout|Library|Log|Netlist)
+
+ +

Open various GUI windows. + + +

+
1
Layout
Open the layout window. Since the layout window is always shown +anyway, this has no effect. + +
2
Library
Open the library window. + +
3
Log
Open the log window. + +
4
Netlist
Open the netlist window. + +
+ + + +

F.4.10 lesstif DumpKeys

+ + +

+
DumpKeys()
+
+ +

Dump Lesstif key bindings. + + +

Causes the list of key bindings (from pcb-menu.res) to be +dumped to stdout. This is most useful when invoked from the command +line like this: + +

     pcb --action-string DumpKeys
+
+ + +

F.4.11 lesstif EditLayerGroups

+ + +

+
EditLayerGroups()
+
+ +

Let the user change the layer groupings + + +

Displays a dialog that lets the user view and change the layer +groupings. Each layer (row) can be a member of any one layer group +(column). Note the special layers solder and component +allow you to specify which groups represent the top and bottom of the +board. + +

See ChangeName Action. + +

+ +

F.4.12 lesstif Export

+ + +

+
Export()
+
+ +

Export the layout. + + +

Prompts the user for an exporter to use. Then, prompts the user for +that exporter's options, and exports the layout. + +

+ +

F.4.13 lesstif GetXY

+ + +

+
GetXY()
+
+ +

Get a coordinate. + + +

Prompts the user for a coordinate, if one is not already selected. + +

+ +

F.4.14 lesstif ImportGUI

+ + +

+
ImportGUI()
+
+ +

Lets the user choose the schematics to import from + + +

Displays a dialog that lets the user select the schematic(s) to import +from, then saves that information in the layout's attributes for +future imports. + +

+ +


+Next: , +Previous: lesstif ImportGUI Action, +Up: lesstif actions + +
+ +

F.4.15 lesstif LibraryShow

+ + +

+
LibraryShow()
+
+ +

Displays the library window. + + +

+ +

F.4.16 lesstif Load

+ + +

+
Load()
+Load(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert)
+
+ +

Load layout data from a user-selected file. + + +

This action is a GUI front-end to the core's LoadFrom action +(see LoadFrom Action). If you happen to pass a filename, like +LoadFrom, then LoadFrom is called directly. Else, the +user is prompted for a filename to load, and then LoadFrom is +called with that filename. + +

+ +

F.4.17 lesstif LoadVendor

+ + +

+
LoadVendor()
+
+ +

Loads a user-selected vendor resource file. + + +

The user is prompted for a file to load, and then +LoadVendorFrom is called (see LoadVendorFrom Action) to +load that vendor file. + +

+ +

F.4.18 lesstif NetlistShow

+ + +

+
NetlistShow(pinname|netname)
+
+ +

Selects the given pinname or netname in the netlist window. + + +

+ +

F.4.19 lesstif Print

+ + +

+
Print()
+
+ +

Print the layout. + + +

This will find the default printing HID, prompt the user for its +options, and print the layout. + +

+ +

F.4.20 lesstif PrintCalibrate

+ + +

+
PrintCalibrate()
+
+ +

Calibrate the printer. + + +

This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + +

+ +

F.4.21 lesstif PromptFor

+ + +

+
PromptFor([message[,default]])
+
+ +

Prompt for a response. + + +

This is mostly for testing the lesstif HID interface. The parameters +are passed to the prompt_for() HID function, causing the user +to be prompted for a response. The respose is simply printed to the +user's stdout. + +

+ +


+Next: , +Previous: lesstif PromptFor Action, +Up: lesstif actions + +
+ +

F.4.22 lesstif Return

+ + +

+
Return(0|1)
+
+ +

Simulate a passing or failing action. + + +

This is for testing. If passed a 0, does nothing and succeeds. If +passed a 1, does nothing but pretends to fail. + +

+ +

F.4.23 lesstif Save

+ + +

+
Save()
+Save(Layout|LayoutAs)
+Save(AllConnections|AllUnusedPins|ElementConnections)
+Save(PasteBuffer)
+
+ +

Save layout data to a user-selected file. + + +

This action is a GUI front-end to the core's SaveTo action +(see SaveTo Action). If you happen to pass a filename, like +SaveTo, then SaveTo is called directly. Else, the +user is prompted for a filename to save, and then SaveTo is +called with that filename. + +

+ +


+Next: , +Previous: lesstif Save Action, +Up: lesstif actions + +
+ +

F.4.24 lesstif SelectLayer

+ + +

+
SelectLayer(1..MAXLAYER|Silk|Rats)
+
+ +

Select which layer is the current layer. + + +

The specified layer becomes the currently active layer. It is made +visible if it is not already visible + +

+ +

F.4.25 lesstif SetUnits

+ + +

+
SetUnits(mm|mil)
+
+ +

Set the default measurement units. + + +

+
mil
Sets the display units to mils (1/1000 inch). + +
mm
Sets the display units to millimeters. + +
+ + + +

F.4.26 lesstif SwapSides

+ + +

+
SwapSides(|v|h|r)
+
+ +

Swaps the side of the board you're looking at. + + +

This action changes the way you view the board. + +

+
v
Flips the board over vertically (up/down). + +
h
Flips the board over horizontally (left/right), like flipping pages in +a book. + +
r
Rotates the board 180 degrees without changing sides. + +
+ +

If no argument is given, the board isn't moved but the opposite side +is shown. + +

Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + +

As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the “working +side” of the board. + +

+ +


+Next: , +Previous: lesstif SwapSides Action, +Up: lesstif actions + +
+ +

F.4.27 lesstif ToggleView

+ + +

+
ToggleView(1..MAXLAYER)
+ToggleView(layername)
+ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide)
+
+ +

Toggle the visibility of the specified layer or layer group. + + +

If you pass an integer, that layer is specified by index (the first +layer is 1, etc). If you pass a layer name, that layer is +specified by name. When a layer is specified, the visibility of the +layer group containing that layer is toggled. + +

If you pass a special layer name, the visibility of those components +(silk, rats, etc) is toggled. Note that if you have a layer named +the same as a special layer, the layer is chosen over the special layer. + +

+ +


+Previous: lesstif ToggleView Action, +Up: lesstif actions + +
+ +

F.4.28 lesstif Zoom

+ + +

+
Zoom()
+Zoom(factor)
+
+ +

Various zoom factor changes. + + +

Changes the zoom (magnification) of the view of the board. If no +arguments are passed, the view is scaled such that the board just fits +inside the visible window (i.e. “view all”). Otherwise, +factor specifies a change in zoom factor. It may be prefixed by ++, -, or = to change how the zoom factor is +modified. The factor is a floating point number, such as +1.5 or 0.75. + +

+
+factor
Values greater than 1.0 cause the board to be drawn smaller; more of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn bigger; less of the board will be visible. + +
-factor
Values greater than 1.0 cause the board to be drawn bigger; less of +the board will be visible. Values between 0.0 and 1.0 cause the board +to be drawn smaller; more of the board will be visible. + +
=factor
+The factor is an absolute zoom factor; the unit for this value +is "PCB units per screen pixel". Since PCB units are 0.01 mil, a +factor of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, +about the actual resolution of most screens - resulting in an "actual +size" board. Similarly, a factor of 100 gives you a 10x actual +size. + +
+ +

Note that zoom factors of zero are silently ignored. + + +

+ +


+Next: , +Previous: Action Reference, +Up: Top + +
+ +

Appendix G Glossary

+ +

+

+
Footprint
The pattern of metal, silkscreen, soldermask relief, and drills which +defines where you place a component on a circuit board. +Footprints are the placed by the user onto the PC board during the +placement phase of PCB layout. + +
Gerber File
The file format used in the industry to convey a board database to the +manufacturer is RS-274X (which replaces the now obsolete RS-274D +format). This file format was originally developed by Gerber for +their photo plotters and thus RS-274D and RS-274X format files +are often times refered to as “Gerber” files. + +
Thermal, Thermal Relief
A thermal relief is a way of connecting a pin to a ground +or power plane. Instead of directly connecting to the plane, small "spokes" +are used to increase the thermal resistance between the pin and the plane. +Often times these connections are refered to as simply a thermal. By increasing +the thermal resistance to the plane, it becomes easier to solder to the +pin. In the drawing below, the pin on the left is connected to the +polygon using a solid connection with no thermal relief, the middle +pin is connected using a thermal, while the pin on the right has no +connection to the polygon. In PCB, the “Thermal” Tool is used to +make both a solid connection and one with thermal relief (see Polygon Objects). + +
Example of a thermal relief
+ +
+ + +
+ +


+Previous: Glossary, +Up: Top + +
+ +

Index of Resources

+ +

Index of Actions, Commands and Options

+ + + +

Index of Concepts

+ + + + +
+

Table of Contents

+ +
+ + + Index: tags/1.0.5/doc/pcb.info =================================================================== --- tags/1.0.5/doc/pcb.info (nonexistent) +++ tags/1.0.5/doc/pcb.info (revision 953) @@ -0,0 +1,326 @@ +This is pcb.info, produced by makeinfo version 4.13 from pcb.texi. + +INFO-DIR-SECTION Miscellaneous +START-INFO-DIR-ENTRY +* pcb: (pcb). An interactive printed circuit board editor. +END-INFO-DIR-ENTRY + + This file documents how to use Pcb, the open source, interactive +printed circuit board layout system. + + Copyright (C) 1994,1995,1996, 2004 Thomas Nau + + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 harry eaton + + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Dan McMahill + + Copyright (C) 2004 DJ Delorie + + This program is free software; you may 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 +MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + + +Indirect: +pcb.info-1: 1021 +pcb.info-2: 300750 + +Tag Table: +(Indirect) +Node: Top1021 +Node: Copying2396 +Node: History3068 +Node: Overview7954 +Node: Intro8775 +Node: Symbol Objects10256 +Node: Via Objects10836 +Node: Element Objects11854 +Node: Layer Objects18737 +Node: Line Objects21889 +Node: Arc Objects24857 +Node: Polygon Objects26305 +Node: Text Objects28934 +Node: Net Objects29749 +Node: Getting Started30679 +Node: Application Window32927 +Node: Menu33576 +Node: Status-line and Input-field42616 +Node: Layer Controls45891 +Node: Tool Selectors49569 +Node: Layout Area56271 +Node: Log Window57139 +Node: Library Window57973 +Node: Netlist Window59217 +Node: Drawing and Removing60811 +Node: Common62955 +Node: Lines64804 +Node: Arcs66368 +Node: Polygons67551 +Node: Text69438 +Node: Vias70423 +Node: Elements71799 +Node: Pastebuffer77269 +Node: Moving and Copying79091 +Node: Loading and Saving80502 +Node: Printing82110 +Node: Exporting86518 +Node: bom86973 +Node: gcode87161 +Node: gerber90012 +Node: nelma90212 +Node: png90364 +Node: ps90508 +Node: eps90677 +Node: Connection Lists90914 +Node: Arrow Tool92720 +Node: Rats Nest94951 +Node: Design Rule Checking100036 +Node: Trace Optimizer102401 +Node: Searching for elements103945 +Node: Measuring distances104446 +Node: Vendor drill mapping105169 +Node: Autorouter108407 +Node: User Commands111745 +Node: Command-Line Options115952 +Node: General Options117224 +Node: General GUI Options119187 +Node: GTK+ GUI Options120305 +Node: lesstif GUI Options120881 +Node: Colors121452 +Node: Layer Names123460 +Node: Paths124209 +Node: Sizes125057 +Node: Commands126692 +Node: DRC Options128043 +Node: BOM Creation128812 +Node: Gerber Export129132 +Node: Postscript Export129494 +Node: Encapsulated Postscript Export131251 +Node: PNG Options131805 +Node: lpr Printing Options133335 +Node: nelma Options133771 +Node: X11 Interface134197 +Node: Resources134665 +Node: Actions150194 +Node: Translations177398 +Node: File Formats178937 +Node: Pad and Line Representation180586 +Node: Layout File181568 +Node: Element File183083 +Node: Font File184124 +Node: Netlist File184505 +Node: Library Contents File185786 +Node: Library File186841 +Node: File Syntax189295 +Node: Arc syntax190661 +Node: Attribute syntax191870 +Node: Connect syntax192381 +Node: Cursor syntax192734 +Node: DRC syntax193207 +Node: Element syntax193698 +Node: ElementArc syntax195640 +Node: ElementLine syntax196598 +Node: FileVersion syntax197051 +Node: Flags syntax197549 +Node: Grid syntax197844 +Node: Groups syntax198336 +Node: Layer syntax198925 +Node: Line syntax199448 +Node: Mark syntax200109 +Node: Net syntax200372 +Node: Netlist syntax200649 +Node: Pad syntax200810 +Node: PCB syntax201766 +Node: Pin syntax202100 +Node: PolyArea syntax202899 +Node: Polygon syntax203253 +Node: Rat syntax203744 +Node: Styles syntax204125 +Node: Symbol syntax205071 +Node: SymbolLine syntax205457 +Node: Text syntax205755 +Node: Thermal syntax206463 +Node: Via syntax206875 +Node: Object Flags207549 +Node: PCBFlags210352 +Node: Library Creation211816 +Node: Schematic Frontends230358 +Node: gEDA231140 +Node: xcircuit239834 +Node: Installation240128 +Node: compiling240659 +Node: quickstart240981 +Node: running configure241377 +Node: problems242549 +Node: HP243984 +Node: Sun244645 +Node: SGI245002 +Node: DEC Alpha245317 +Node: SCO245488 +Node: Linux245969 +Node: BSD246164 +Node: X11246547 +Node: TeX and Manuals247359 +Node: Custom Menus247863 +Node: Resource Syntax248429 +Node: Menu Definitions250770 +Node: Menu Files and Defaults253429 +Node: Regular Expressions254235 +Node: Standard Drill Sizes258031 +Node: Centroid File Format268079 +Node: Action Reference270931 +Node: core actions272542 +Node: AddRats Action278476 +Node: ApplyVendor Action278945 +Node: Atomic Action279277 +Node: Attributes Action280430 +Node: AutoPlaceSelected Action280843 +Node: AutoRoute Action281201 +Node: ChangeClearSize Action281951 +Node: ChangeDrillSize Action282518 +Node: ChangeFlag Action282839 +Node: ChangeHole Action283565 +Node: ChangeJoin Action283926 +Node: ChangeName Action284520 +Node: ChangeOctagon Action284965 +Node: ChangePaste Action285822 +Node: ChangePinName Action286296 +Node: ChangeSize Action286734 +Node: ChangeSquare Action287479 +Node: ClearOctagon Action288372 +Node: ClearSquare Action289225 +Node: ClrFlag Action290052 +Node: Connection Action290573 +Node: Delete Action291236 +Node: DeleteRats Action291445 +Node: DisableVendor Action291658 +Node: DisperseElements Action292071 +Node: Display Action292575 +Node: djopt Action297281 +Node: DRC Action299027 +Node: DumpLibrary Action299290 +Node: elementlist Action299501 +Node: elementsetattr Action300299 +Node: EnableVendor Action300750 +Node: execcommand Action301253 +Node: ExecuteFile Action301508 +Node: Flip Action301756 +Node: FontEdit Action302305 +Node: FontSave Action302503 +Node: FreeRotateBuffer Action302706 +Node: GlobalPuller Action303175 +Node: h Action303370 +Node: Import Action303773 +Node: l Action307425 +Node: le Action308057 +Node: LoadFootprint Action308640 +Node: LoadFrom Action309082 +Node: LoadVendorFrom Action310064 +Node: m Action310399 +Node: MarkCrosshair Action310983 +Node: Message Action311681 +Node: MinClearGap Action312120 +Node: MinMaskGap Action312533 +Node: Mode Action312939 +Node: MorphPolygon Action314180 +Node: MoveLayer Action314706 +Node: MoveObject Action315408 +Node: MoveToCurrentLayer Action315895 +Node: Netlist Action316318 +Node: New Action318068 +Node: OptAutoOnly Action318281 +Node: PasteBuffer Action318940 +Node: Polygon Action320762 +Node: Puller Action321345 +Node: q Action322053 +Node: q! Action322543 +Node: Quit Action323025 +Node: Redo Action323286 +Node: RemoveSelected Action324092 +Node: Renumber Action324297 +Node: Report Action324598 +Node: ReportDialog Action325457 +Node: RipUp Action325709 +Node: rn Action326243 +Node: RouteStyle Action326975 +Node: s Action327191 +Node: SaveSettings Action327844 +Node: SaveTo Action328187 +Node: Select Action328910 +Node: SetFlag Action330064 +Node: SetOctagon Action330579 +Node: SetSame Action331351 +Node: SetSquare Action331765 +Node: SetThermal Action332574 +Node: SetValue Action333855 +Node: ToggleHideName Action334413 +Node: ToggleVendor Action334787 +Node: Undo Action335296 +Node: UnloadVendor Action335975 +Node: Unselect Action336190 +Node: w Action337131 +Node: wq Action337623 +Node: common actions338118 +Node: LayersChanged Action338783 +Node: LibraryChanged Action339342 +Node: NetlistChanged Action339865 +Node: PCBChanged Action340382 +Node: RouteStylesChanged Action341049 +Node: gtk actions341560 +Node: gtk About Action343137 +Node: gtk AdjustStyle Action343408 +Node: gtk Center Action343708 +Node: gtk Cursor Action344031 +Node: gtk DoWindows Action345156 +Node: gtk EditLayerGroups Action345781 +Node: gtk GetXY Action346222 +Node: gtk ImportGUI Action346486 +Node: gtk Pan Action346761 +Node: gtk Popup Action347126 +Node: gtk Print Action347610 +Node: gtk PrintCalibrate Action347900 +Node: gtk Save Action348262 +Node: gtk SelectLayer Action348861 +Node: gtk SetUnits Action349214 +Node: gtk SwapSides Action349549 +Node: gtk ToggleView Action350615 +Node: gtk Zoom Action351395 +Node: lesstif actions352831 +Node: lesstif About Action354739 +Node: lesstif AdjustSizes Action355023 +Node: lesstif AdjustStyle Action355446 +Node: lesstif Benchmark Action355702 +Node: lesstif Command Action356134 +Node: lesstif Cursor Action357551 +Node: lesstif Debug Action358690 +Node: lesstif DebugXY Action358980 +Node: lesstif DoWindows Action359351 +Node: lesstif DumpKeys Action359866 +Node: lesstif EditLayerGroups Action360283 +Node: lesstif Export Action360854 +Node: lesstif GetXY Action361189 +Node: lesstif ImportGUI Action361463 +Node: lesstif LibraryShow Action361872 +Node: lesstif Load Action362108 +Node: lesstif LoadVendor Action362682 +Node: lesstif NetlistShow Action363070 +Node: lesstif Print Action363354 +Node: lesstif PrintCalibrate Action363667 +Node: lesstif PromptFor Action364051 +Node: lesstif Return Action364521 +Node: lesstif Save Action364868 +Node: lesstif SelectLayer Action365461 +Node: lesstif SetUnits Action365838 +Node: lesstif SwapSides Action366190 +Node: lesstif ToggleView Action367273 +Node: lesstif Zoom Action368077 +Node: Glossary369531 +Node: Index371140 + +End Tag Table Index: tags/1.0.5/doc/pcb.info-1 =================================================================== --- tags/1.0.5/doc/pcb.info-1 (nonexistent) +++ tags/1.0.5/doc/pcb.info-1 (revision 953) @@ -0,0 +1,7585 @@ +This is pcb.info, produced by makeinfo version 4.13 from pcb.texi. + +INFO-DIR-SECTION Miscellaneous +START-INFO-DIR-ENTRY +* pcb: (pcb). An interactive printed circuit board editor. +END-INFO-DIR-ENTRY + + This file documents how to use Pcb, the open source, interactive +printed circuit board layout system. + + Copyright (C) 1994,1995,1996, 2004 Thomas Nau + + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 harry eaton + + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Dan McMahill + + Copyright (C) 2004 DJ Delorie + + This program is free software; you may 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 +MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + + +File: pcb.info, Node: Top, Next: Copying, Up: (dir) + +Pcb +*** + +This document is a manual for `Pcb', the open source, interactive +printed circuit board layout system. + +* Menu: + +* Copying:: `Pcb' is freely redistributable! +* History:: How it all began. +* Overview:: An overview of `Pcb'. +* Intro:: A short description of the basic objects. +* Getting Started:: Introduction to `Pcb'. +* Autorouter:: Using the autorouter. +* User Commands:: User commands of `Pcb'. +* Command-Line Options:: Calling `Pcb' from a shell. +* X11 Interface:: Action routines, resources and default translation. +* File Formats:: Description of `ASCII' files used by `Pcb'. +* Library Creation:: Detailed description of symbol library creation. +* Schematic Frontends:: Schematic capture programs that work with PCB. +* Installation:: Compiling, installing and troubleshooting. +* Custom Menus:: Customizing the menu bar. +* Regular Expressions:: Searching for elements with regular expressions +* Standard Drill Sizes:: Tables of standard drill sizes +* Centroid File Format:: Details of the centroid (x-y) output file +* Action Reference:: Documentation for all available actions +* Glossary:: Glossary +* Index:: The Index. + + +File: pcb.info, Node: Copying, Next: History, Prev: Top, Up: Top + +Copying +******* + +Copyright (C) 1994,1995,1996,1997 Thomas Nau + + Copyright (C) 1998,1999,2000,2001,2002 harry eaton + + This program is free software; you may 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 +MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + + +File: pcb.info, Node: History, Next: Overview, Prev: Copying, Up: Top + +History +******* + +`Pcb' is a handy tool for laying out printed circuit boards. + + `Pcb' was first written by Thomas Nau for an Atari ST in 1990 and +ported to `UNIX' and `X11' 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. + + The second release 1.2 included menus for the first time. This made +`Pcb' easier to use and thus a more important tool. + + Release 1.3 introduced undo for highly-destructive commands, more +straightforward action handling and scalable fonts. Layer-groups were +introduced to group signal-layers together. + + Release 1.4 provided support for add-on device drivers. Two layers +(the solder and the component side) were added to support SMD elements. +The handling of libraries was also improved in 1.4.1. Support for +additional devices like GERBER plotters started in 1.4.4. The undo +feature was expanded and the redo-feature added in 1.4.5. + + harry eaton took over pcb development beginning with Release 1.5, +although he contributed some code beginning with Release 1.4.3 + + Release 1.5 provides support for rats-nest generation from simple net +lists. It also allows for automatic clearances around pins that pierce +a polygon. A variety of other enhancements including a Gerber RS-274X +driver and NC drill file generation have also been added. + + Release 1.6 provides automatic screen updates of changed regions. +This should eliminate most of the need for the redraw ((_R_ key). Also +some changes to what order items under the cursor are selected were +made for better consistency - it is no longer possible to accidentally +move a line or line point that is completely obscured by a polygon +laying over top of it. Larger objects on the upper most layers can be +selected ahead of smaller objects on lower layers. These changes make +operations more intuitive. A new mode of line creation was added that +creates two line on 45 degree angles with a single click. The actual +outline of the prospective line(s) are now shown during line creation. +An arc creation mode was added. Drawn arcs are quarter circles and can +be useful for high frequency controlled impedance lines. (You can have +eighth circle arc if the source is compiled with -DARC45, but be aware +that the ends of such arcs can never intersect a grid point). Two new +flags for pins and vias were created - one indicates that the pin or +via is purely a drill hole and has no copper annulus. You can only +toggle this flag for vias - for elements, it must be an integral part +of the element definition. The other flag controls whether the pad +will be round or octagonal. There is also now a feature for converting +the contents of a buffer into an element. + + Release 1.6.1 added the ability to make groups of action commands +bound to a single X11 event to be undone by a single undo. Also a +simple design rule checker was added - it checks for minimum spacing +and overlap rules. Plus many fixes for bugs introduced with the many +changes of 1.6 + + Release 1.7 added support for routing tracks through polygons +without touching them. It also added support for unplated drill files, +and drawing directly on the silk layer. A Netlist window for easily +working with netlist was also added. + + Release 2.0 adds an auto-router, a new simpler library mechanism, +much improved support for graphically creating (and editing) elements, +viewable solder-mask layers (and editing), snap to pins and pads, +netlist entry by drawing rats, element files (and libraries) that can +contain whole sub-layouts, metric grids, improved user interface, a GNU +autoconf/automake based build system, and a host of other improvements. + + Special thanks goes to: + Thomas Nau (who started the project and wrote the early versions). + C. Scott Ananian (who wrote the auto-router code). + Bernhard Daeubler (Bernhard.Daeubler@physik.uni-ulm.de) + Harald Daeubler (Harald.Daeubler@physik.uni-ulm.de) + DJ Delorie (djdelorie@users.sourceforge.net) + Larry Doolittle (ldoolitt@recycle.lbl.gov) + Dan McMahill (danmc@users.sourceforge.net) + Roland Merk (merk@faw.uni-ulm.de) + Erland Unruh (Erland.Unruh@malmo.trab.se) + Albert John FitzPatrick III (ajf_nylorac@acm.org) + Boerge Strand (borges@ifi.uio.no) + Andre M. Hedrick (hedrick@Astro.Dyer.Vanderbilt.Edu) + +who provided all sorts of help including porting `Pcb' to several +operating systems and platforms, bug fixes, library enhancement, user +interface suggestions and more. In addition to these people, many +others donated time for bug-fixing and other important work. Some of +them can be identified in the source code files. Thanks to all of +them. If you feel left out of this list, I apologize; please send me an +e-mail and I'll try to correct the omission. + + +File: pcb.info, Node: Overview, Next: Intro, Prev: History, Up: Top + +1 Overview +********** + +`Pcb' is an open source printed circuit board editor. `Pcb' includes +many professional features such as: + * Up to 16 copper layer designs by default. By changing a compile + time setting, this can be set as high as needed. + + * RS-274X (Gerber) output + + * NC Drill output + + * Centroid (X-Y) data output + + * Postscript and Encapsulated Postscript output + + * Autorouter + + * Trace optimizer + + * Rats nest + + * Design Rule Checker (DRC) + + * Connectivity verification + + * `Pcb' is Free Software + + * Can interoperate with free schematic capture tools such as gEDA and + xcircuit + + * Runs under Linux, NetBSD, Solaris, and other similar operating + systems. + + * Windows version is available + + +File: pcb.info, Node: Intro, Next: Getting Started, Prev: Overview, Up: Top + +2 Introduction +************** + +Each layout consists of several, mostly independent, objects. This +chapter gives an overview of the object types and their relationship to +each other. For a complete description of how to use `Pcb', refer to +*note Getting Started::. The layout is generated on-screen on a grid +that can have its origin at any desired location. The X coordinate +increases to the right, Y increases down to the bottom. All distances +and sizes in `Pcb' are measured in mils (0.001 inch). One unit on the +coordinate display is one mil in distance on the board. The grid may +be set on a metric pitch, but is only correct to within the nearest +/- +0.01 mil because `Pcb' stores all dimensions as integer multiples of +1/100 of a mil or 0.00001 inch. + + The sections in this chapter are sorted by the order of appearance +of the objects within a layout file. + +* Menu: + +* Symbol Objects:: Information about fonts and symbols. +* Via Objects:: Vias and pins connect layers. +* Element Objects:: Element, the basic type of circuits. +* Layer Objects:: A `container' for lines, text... +* Line Objects:: Tracks on the board +* Arc Objects:: Curved tracks +* Polygon Objects:: Planes and such +* Text Objects:: Objects to add symbols to your board. +* Net Objects:: Describes the desired connections on the board. + + +File: pcb.info, Node: Symbol Objects, Next: Via Objects, Up: Intro + +2.1 Symbols +=========== + +The top object is the layout itself. It uses a set of symbols that +resides at the first logical level. Each symbol is uniquely identified +by a seven bit `ASCII' code. All layout objects share the same set of +symbols. These symbols are used to form text objects on the silkscreen +and copper layers. Undefined symbols are drawn as filled rectangles. + + Every font file is preprocessed by a user-defined command when it is +loaded. For details see `fontCommand', *note Resources::. + + +File: pcb.info, Node: Via Objects, Next: Element Objects, Prev: Symbol Objects, Up: Intro + +2.2 Vias +======== + +Vias provide through-hole connectivity across all layers. While vias +look a lot like element pins, don't use vias for adding elements to the +layout, even if that seems easier than creating a new element. The +default solder-mask will cover over vias, so you won't be able to +solder to them. Of course, you can change this so that vias also have +solder-mask cut-outs, but it is not the default. Vias are also useful +for defining arbitrary drill points such as those used for mounting a +board. Vias used in this way have a special flag set so that they have +no annular copper ring, and also appear in the unplated drill file. +_Ctrl-H_ key over a via switches it between being a pure-mounting hole +and a regular via. You can assign a name to a via, which is useful +during the creation of new element definitions. Each via exists on all +copper layers. (_i.e._ blind and buried vias are not supported) + + +File: pcb.info, Node: Element Objects, Next: Layer Objects, Prev: Via Objects, Up: Intro + +2.3 Elements +============ + +Elements represent the components on a board. Elements are loaded from +`ASCII' coded files in a similar manner to the layout file itself, or +from the library selector window. An element is composed of lines and +arcs on the silk-screen layer (used to define the package outline), pins +(or pads for SMD) and three labels that define the description, the +element's layout-name (which also appears on the silk-screen layer) and +its value. You can choose which of the names are displayed on the screen +with the Screen menu; however, the silk screen in the printout will +always show the layout-name. Element pins are contained on the first +logical level and so reside on all layers, but the pads of surface-mount +elements reside on only the component or solder layers. An element can +have a mixture of pins, pads (on one or both sides), and mounting holes. + + A mark is used to position the element with respect to the cross +hair during pasting. The mark will lie on a grid point when the element +is positioned. The mark is drawn as a small diamond shape, but is only +visible when _both_ the `silk' and `pins/pads' layers are visible. All +parts of an element are treated as one unit, except for the name. It +is not possible to delete a single pin or move only part of an element +on the layout. You can resize separate pieces of an element, but doing +so is usually a bad idea. You can move/rotate the element name +independently of the element it belongs to. When you move an element +name, a line is draw from the cursor to the element mark so it is easy +to tell which element the name belongs to. + + Each pin and pad has two string identifiers, one is the "name" which +is a functional description of the pin (_e.g._ "clock in") and the +other is the "number" of the pin which is used to identify it in a +netlist. The "number" is usually an integer, but it can be any string. +You can edit the "name" of each pin of an element, but the "number" is +embedded in the element definition and is determined when the new +element is first created. Pads are similar to lines on a layer but +they must be oriented either vertically or horizontally. Pads can have +either rounded or square ends. Pins can be round, square, or octagonal. + + Elements are supported by several special layers: `silk', +`pins/pads' and `far-side'. The `silk' layer shows the package outline +and also holds legend text and element names. The `pins/pads' layer is +used to toggle whether the element's pins and pads are displayed. The +`far-side' layer controls visibility of objects (silkscreen and pads) +that are on the far (_i.e._ not currently viewed) side of the board. + + The "oldlib" style of footprint libraries distributed with `Pcb' +rely upon the M4 macro processor. M4 is typically installed under the +name `m4' on most unix-like operating systems. It is recommended that +you use the GNU version of M4 to avoid limitations found in some vendor +implementations. See the m4 man page on your system for more +information. Every element file is preprocessed by a user-defined +command when the file is read. For details see `elementCommand', *note +Resources::. `m4', the default value of `elementCommand', allows you to +create libraries for package definitions that are shared by all +elements. The old element libraries distributed with `Pcb' expect `m4' +or an equivalent to be the _elementCommand_. The new library scheme +simply has each element stored in a self-contained file, so there is no +need to learn `m4' to add to the libraries. + + `Pcb' can create a list of all connections from one (or all) +elements to the others or a list of unconnected pins. It can also +verify the layout connections against a netlist file. The element's +`layout-name' is the name used to identify the element in a netlist +file (see *note Netlist File::). + + The old libraries, or very old (pre-1.6) layout files may have +incorrect pin numbering since there was no concept of pin numbers when +they were created. `Pcb' uses the order of appearance of the pin +definitions in the layout or library file if it uses the old format, +but there is no guarantee that it will be correct for these old objects. + + Be aware that a few of the old library parts may still be incorrectly +implemented regarding pin-numbering. All of the DIL (Dual- +Inline-Pins) parts are correct and most of the others are too, but you +should verify the pin numbering of any non-DIL part before using an old +library part. (use the `generate object report' in the Info menu to +see what `Pcb' thinks a pin's number is) All of the old library names +begin with a ~, so you can easily identify them. The old libraries +also _may_ contain other sorts of errors, including incorrect pin +spacing, silkscreen overlapping solder areas, etc. Check carefully any +element in the old library before using it! As the new library grows, +the old library will be pared down to at least remove all of the +elements with errors, but this will take time. + + You can make your own element definitions graphically now. Simply +draw vias for the pins, lines on the solder and/or component layers for +surface-mount pads (they must be either horizontal or vertical), and +lines and arcs on the silkscreen layer for the silkscreen outline. You +should _name_ (_N_ key) each via and copper line with the pin _number_. +Once you are happy with the geometry, select everything that is to +become part of the element, then choose `convert selection to element' +from the Select menu. Afterwords you can make pin (or pad) one square +if you like, and give the element its various names. You can also give +the pins and pads their functional names. Note that the element mark +corresponds to the position you click after choosing the conversion +from the menu, so decide where the mark goes and make sure it falls on +a grid point before you request the conversion. If the vias/lines are +not named, then the pin numbering will correspond to the order in which +they were placed. + + When you create a new element, remember that silkscreen lines should +_never_ overlap the copper part of the pins or pads, as this can +interfere with soldering. The silkscreen should identify the maximum +extent of the element package so it is easy to see how close elements +can be placed together. + + If you want to make an element similar to an existing one, you can +break an element into constituent pieces from the Buffer menu. Paste +the pieces to the layout, make the necessary changes, then convert it +back into an element. If the pin numbers haven't changed, there is no +need to name each via/line as they are pre-named when the element was +broken apart. When you create a new element, you can save it to a file +in order to have easy access to it the next time you run `Pcb'. + + +File: pcb.info, Node: Layer Objects, Next: Line Objects, Prev: Element Objects, Up: Intro + +2.4 Layers +========== + +Every layout consists of several layers that can be used independently +or treated as a group. Layer groups can be used to logically separate +(and color-code) different traces (_e.g._ power and signal); however, +all layers within a group reside on the same physical copper layer of a +board, so using different layers within the same group won't provide +electrical separation where they touch or overlap. For details, see +`layerGroups', *note Resources::. Each layer is drawn in a color +defined in the resource file and identified by a name that you can +change (for details see `layerColor', *note Resources::.) Layers are +really just containers for line, arc, polygon, and text objects. The +component and solder layers contain SMD elements as well, but the file +structure doesn't reflect that fact directly. + + Each layer group represents a physical layer on the printed circuit +board. If you want to make a four layer board, you'll need to have at +least four layer groups. Connections between layer groups are +established only through element pins and vias. The relationship +between a specific layer and the board itself is configurable from the +`Edit layer groups' option in the Settings menu. The layer groups +corresponding to the physical layers: _component-side_ and +_solder-side_ are always defined and you must map at least one logical +layer to each, even if you plan to make a single-sided board. You are +not obligated to put tracks on either of them. Surface mount elements +always reside on either the component-side or the solder-side layer +group. When you paste an element from the buffer, it will go onto +whichever side of the board you are viewing. You can swap which side +of the board you are viewing by pressing the _Tab_ key, or by selecting +`view solder side' from the Screen menu. The layer groups just have a +name or number associated with them - where they are sandwiched in the +board is left for you to tell the manufacturer. + + The silkscreen layer is special because there are actually two +silkscreen layers, one for the top (component) and one for the bottom +(solder) side of the board. Which silk layer you draw on is determined +by the side of the board that you are viewing. If you are viewing the +component side, then drawing on the silk layer draws to the +component-side silk layer. + + The netlist layer is another special layer. It shows rat's-nest lines +(_i.e._ guides that show how the netlist expects the element to +interconnect). If you make this the active layer, you can use the Line +tool to add entries into the netlist, or to delete connections from the +netlist window. Except for these two purposes, you should not make the +netlist layer the active layer. Usually there is no need to do this +because a separate schematic package should be used to create the +netlist. `Pcb' can automatically draw all of the rats from the netlist. +In some cases you may want to make a small change without going to the +trouble of modifying the schematic, which is why this facility is +provided. + + +File: pcb.info, Node: Line Objects, Next: Arc Objects, Prev: Layer Objects, Up: Intro + +2.5 Lines +========= + +Lines are used to draw tracks on the pc board. When in the line mode, +each _Btn1_ press establishes one end of a line. Once the second point +is defined, the line is drawn and a new line started where the first +one ended. You can abandon the new starting point in favor of another +by pressing _Ctrl-Btn1_, or _Btn3_, but don't use _Btn2_. The undo +function (_U_ key or `undo last operation' from the Edit menu) will +take you back point by point if you use it while in the line mode. + + New lines can be restricted to 45 degree angles if desired. You can +toggle this restriction on and off while creating lines by pressing the +_period_ key. If the 45 degree restriction is turned on, then the _/_ +(forward slash) key can be used to cycle through three different modes +of 45 degree line creation. One mode just creates a single line forced +to the nearest 45 degree vector. The next mode creates two lines from +the start to end points such that the first line leaves the start point +at a 90 degree vector, and the second line enters the end point on a 45 +degree vector. The last mode creates two lines such that the first line +leaves the start point on a 45 degree vector and arrives at the end +point on a 90 degree vector. You can temporarily swap between the last +two modes by holding the _Shift_ key down. + + It is simple to edit a line object by breaking it into pieces +(insert point mode), moving an end point or the whole line (_Arrow +tool_), or changing the layer it resides on (_M_ key moves the line +under the pointer to the active layer). In the case when two line +segments meet at exactly the same point you can delete the intermediate +point, otherwise the delete tool removes an entire line. Feel free to +experiment since `Pcb' will allow you to undo and redo anything that +materially affects your work. If you switch active layers in the midst +of placing lines a via will automatically be placed, when necessary, in +order to continue the connection. + + If you draw a line inside a polygon, it will either plow through the +polygon creating a clearance, or touch the polygon. This behavior is +selectable in the Settings menu for new lines. To change the behavior +of an existing line, hit the _J_ key with the cross hair over the line. +You can increase the size of the clearance by 2 mils on each edge with +the with the _K_ key. _Shift-K_ will decrease the clearance by 2 mils. +The increment may be changed from 2 mils through the application +resource file. The clearance can be also increased, decreased and set +by the _ChangeClearSize_ action. + + Lines do not need to intersect the center of a pin, pad, via, or +other line for `Pcb' to understand that they make electrical connection. +If the connection is too tenuous, running the design rule checker will +report that the connection may break if the line width shrinks slightly. + + +File: pcb.info, Node: Arc Objects, Next: Polygon Objects, Prev: Line Objects, Up: Intro + +2.6 Arcs +======== + +`Pcb' can handle arcs of any angular extent, but when you create an arc +with the Arc tool, it will be a quarter circle (this means they always +bend a right angle). Arcs are very similar to lines otherwise. They +are created on the active layer and have the same thickness that new +lines will have. The various clicks for creating lines work pretty +much the same way for creating arcs. In order to make the arc curve in +the desired direction, drag the mouse along the tangent line from the +starting position towards the end position. If the grid is too coarse, +it may not be possible to distinguish whether you've moved over then up, +or up then over, so if you can't seem to make the arc go in the +direction you want, try pressing the _Shift_ key while drawing the arc. +Decreasing the grid spacing may also help. Alternatively you can draw +the wrong arc, then rotate and move it where you want. Like the Line +tool, after an arc is drawn a new starting point is established at the +end point. + + Whenever a starting point is established by either the Line or Arc +tools it will be retained if you switch directly between the tools +(e.g. _F2_ key for Lines, _F8_ key for Arcs. Arcs can either touch or +clear polygons just like lines do. Of course connection searches, undo +and all the other features you'd expect work with arcs too. + + +File: pcb.info, Node: Polygon Objects, Next: Text Objects, Prev: Arc Objects, Up: Intro + +2.7 Polygons +============ + +Sometimes it's useful to fill large areas with solid copper. The way +to do this is with polygons. Polygons can be created in either the +polygon mode or the rectangle mode. In the polygon mode, you'll have +to define each corner of the polygon with a mouse click (_Btn1_). When +the last point is clicked exactly on top of the starting point, the +polygon is finished. Since this can be hard to do, the _Shift-P_ key +will enter the final point for you, closing the polygon. If the 45 +degree angle restriction is turned on and you try to close the polygon +when it is not possible, you'll get a warning instead. If you haven't +finished entering a polygon, but want to undo one (or more) of the +points that you've already defined, use the undo command (_U_ key). + + With the rectangle tool, defining the two diagonally opposite +corners is sufficient, but of course the resulting polygon is a +rectangle. Like lines, a polygon can by edited by deleting, inserting +and moving the points that define it. Pins and vias _always_ clear +through polygons without touching them when first positioned. You must +add a thermal with the thermal tool in order to connect pins and vias +to polygons. Thermals can be added and removed by clicking _Btn1_ with +the thermal tool over the pin or via. The thermal tool always places a +thermal to polygons on the active layer, so if the tool doesn't seem to +work, it's probably because the polygon you want to touch is not on the +active layer. You can change the style of thermal used or make a solid +connection by holding down _Shift_ while clicking _Btn1_ with the +thermal tool over the pin or via. + + `Pcb' is capable of handling complex polygons, but using a number of +simpler ones improves performance of the connection tracing code. You +also must be careful not to create polygons that touch or overlap +themselves. The fabricated board may not look the way you expect if +you violate this principle. It is always ok to have two (or more) +polygons touch or overlap each other, but not for points within the +same polygon to do so. + + The great advantage to this new polygon behavior is that simple or +complex ground and/or power planes can be easily made with polygons and +seen on the screen. If you don't want this auto-clearance behavior, or +you load a layout created by an early version of `Pcb', the old behavior +(shorts to all piercing pins and vias) is available. A `ChangeSize' +operation (_S_ key) toggles a polygon between the new and old +polygon/pin behavior. + + +File: pcb.info, Node: Text Objects, Next: Net Objects, Prev: Polygon Objects, Up: Intro + +2.8 Text +======== + +Text objects should be used to label a layout or to put additional +information on the board. Elements have their `layout-name' labels on +the silk-screen layer. If you are making a board without a silkscreen, +you can use copper text to label the elements, but you have to do this +manually. + + Text is always horizontal when first created, but the rotate mode +can align it along 0, 90, 180 and 270 degree angles. Text on the far +side of the board will automatically appear mirror-imaged. + + _Warning:_ TEXT OBJECTS ON A COPPER LAYER CREATE COPPER LINES BUT +THEY ARE NOT SCANNED FOR CONNECTIONS OR TESTED FOR CREATING SHORTS VS. +THE NETLIST. NEITHER ARE TEXT OBJECTS TESTED AGAINST ANY DESIGN RULES. + + +File: pcb.info, Node: Net Objects, Prev: Text Objects, Up: Intro + +2.9 Nets +======== + +Layout files also contain the netlist that describes how the elements +are supposed to be interconnected. This list of connections can be +loaded from a netlist file (see *note Netlist File::), or entered by +drawing rat-lines as described previously. Each net has a name and +routing style associated with it. The net contains a list of all +element _layout-name_ names and pin _numbers_ that should be connected +to the net. Loading a netlist file will replace all existing nets with +the ones from the file. The _Netlist_ window provides an easy way to +browse through the net list. You can display the rat's-nest by selecting +`optimize rats-nest' from the Connects menu. If you move or rotate +elements, the rat's-nest will automatically follow the movements, but +they won't necessarily show the shortest paths until you optimize them +again. + + +File: pcb.info, Node: Getting Started, Next: Autorouter, Prev: Intro, Up: Top + +3 Getting Started +***************** + +The goal of this chapter is to give you enough information to learn how +`Pcb' works and how to develop your layouts to make the best use of +`Pcb''s features. All event translations (_i.e._ the buttons and keys +you press) refer to the default application resource file shipped with +`Pcb'. There is probably no need to change this unless your window +manager uses some of the button events itself; however, if you _want_ +to customize the behavior of `Pcb' then changing the resource file is +usually the best way to do it. + + Get yourself a printout of this chapter and _User Commands_, if you +haven't already done so, and follow the examples. + + Start `Pcb' (the actual command will use all lower-case letters) +without any additional options. If you get the error message: + + can't find default font-symbol-file 'default_font' + then the font searchpath or filename in the application resource +file is wrong. Be sure that your `m4' program supports search paths. +If not, get `GNU m4'. For other messages, see *note problems::. +Another quick-start is provided by `pcbtest.sh' in the `src' directory. +If some features don't seem to work, try running `pcbtest.sh', if that +works, then `Pcb' hasn't been installed properly. + +* Menu: + +* Application Window:: The elements of the main window. +* Log Window:: The optional logging window +* Library Window:: The circuit selection window +* Netlist Window:: The desired connections window +* Drawing and Removing:: +* Moving and Copying:: +* Loading and Saving:: +* Printing:: Creating Gerber files or postscript files +* Exporting:: Exporting a layout. +* Arrow Tool:: Selecting/Moving objects. +* Rats Nest:: Helps you place and route tracks against a netlist. +* Design Rule Checking:: Check for manufactureability +* Trace Optimizer:: Optimization of layouts +* Searching for elements:: Searching for elements +* Measuring distances:: Measuring distances +* Vendor drill mapping:: Mapping drills to a vendor specified list +* Connection Lists:: How to get a list of all or some connections. + + +File: pcb.info, Node: Application Window, Next: Log Window, Up: Getting Started + +3.1 The Application Window +========================== + +The main window consists of five areas: the menu at the top, the layer +control in the upper left, the tool buttons located below the layer +controls, the Layout area to the right of these, and the status line at +the bottom of the window. + +* Menu: + +* Menu:: +* Status-line and Input-field:: What is the program configuration. +* Layer Controls:: Switch layers on/off; change current one. +* Tool Selectors:: Select a layout tool. +* Layout Area:: Where the layout is drawn. + + +File: pcb.info, Node: Menu, Next: Status-line and Input-field, Up: Application Window + +3.1.1 Menus +----------- + +The menus are located at the top of the Layout area. Most, but not all, +of their functions are also available from the keyboard. Similarly, some +functions are only achievable through the keyboard or command entry. +Some menu entries such as `center layout' in the Screen menu require a +certain cross hair position. In this case a prompt message will popup +at the bottom of the screen with wording similar to the following: + move pointer to the appropriate screen position and press a button + Any mouse button will do the job, whereas any key except the arrow +(cursor) keys will cancel the operation. If it seems like the menu +hasn't done what you expected, check to see if it is waiting for the +position click. For details see *note Actions::. + + Pressing _Btn3_ in the Layout area also pops up a menu with many of +the most common operations (except when you're in the midst of drawing +a line or arc). When a choice in the _Btn3_ popup menu needs a cross +hair position, it uses the position where the cross hair was when +_Btn3_ was pressed. For example, to get detailed information on an +object, place the cross hair over the object, press _Btn3_, then choose +`object report'. If you pop up the _Btn3_ menu but don't want to take +any of the actions, click on one of the headers in the menu. + +File + This menu offers a choice of loading, saving and printing data, + saving connection information to a file or quitting the + application. Most of the entries in the File menu are self + explanatory. Selecting `print layout' pops up a printer control + dialog. A selection of several device drivers is available from + the printer control dialog. Presently _PostScript_, _encapsulated + PostScript_, and _GerberX_ are supported. The _GerberX_ driver + produces all of the files necessary to have the board + professionally manufactured. The connection saving features in + the File menu produce outputs in an arcane format that is not too + useful. They do _not_ produce netlist files. + +Edit + The Edit menu provides the usual cut, copy, paste which work on + selections. To learn how to create complex selections, see *note + Arrow Tool::. The Edit menu also provides access to Undo and Redo + of the last operation. These can also be accomplished with the _U_ + key and _Shift-R_ key. Finally, the Edit menu allows you to + change the names of: the layout, the active layer, or text objects + on the layout. + +Screen + The Screen menu supports most functions related to the whole + Layout area. There are various entries to change the grid to some + popular values, the zoom factor, and which kind of element name is + displayed. You can also re-align the grid origin and turn on and + off the display of the grid. Before changing the grid alignment, + I recommend that you zoom in as close as possible so that you're + sure the grid points appear exactly where you want them. + + The Screen menu also allows you to turn on and off the visibility + of the solder-mask layer. When the solder-mask layer is made + visible it obscures most of the layout, so only turn this on when + you really want to know what the solder-mask will look like. The + solder-mask that you see belongs to the side of the board you are + viewing, which can be changed with the `view solder side' option, + also found in the Screen menu. When the solder-mask is displayed, + the pin and pad clearance adjustments (*note Line Objects::) alter + the size of mask cut-outs. + +Sizes + The Sizes menu allows you to select a group of line thickness, via + diameter, via drill size, and clearance (keepaway) (collectively + called a "routing style") to be copied to the "active" sizes. You + can also change the names given to the routing styles and adjust + their values from this menu. The "active" sizes are also + adjustable from this menu. The "active" sizes are shown in the + status-line and control the initial size of new vias, drilling + holes, lines, clearances, text-objects and also the maximum + dimensions of the board layout. + +Settings + The Settings menu controls several operating configuration + parameters. The `edit layer groups' entry brings up a dialog that + allows you to change the way layers are grouped. Layer grouping is + described in *note Layer Objects::. The `all-direction lines' + entry controls the clipping of lines to 45-degree angles. You can + also control whether moving individual objects causes the attached + lines to "rubber band" with the move or not from the Settings + menu. Another entry controls whether the starting clip angle for + the two-line mode (*note Line Objects::) alternates every other + line. You can also control whether element names must be unique + from the Settings menu. When unique element names are enforced, + copying a new element will automatically create a unique + `layout-name' name for it provided that the name originally ended + with a digit (_e.g._ U7 or R6). The Settings menu allows you to + control whether the cross hair will snap to pins and pads even + when they are off-grid. Finally you can control whether new lines + and arcs touch or clear intersecting polygons from this menu. + +Select + This menu covers most of the operations that work with selected + objects. You may either (un)select all visible objects on a + layout or only the ones which have been found by the last + connection scan see . You can delete all selected objects from + this menu. Other entries in the Select menu change the sizes of + selected objects. Note that a select action only affects those + objects that are selected _and_ have their visibility turned on in + the Layer Control panel. The Select menu also provides a means for + selecting objects by name using unix *note Regular Expressions::. + +Buffer + From the Buffer menu you may select one out of five buffers to + use, rotate or clear its contents or save the buffer contents to a + file. You can also use the `break buffer element to pieces' entry + to de-compose an element into pieces for editing. Note: only + objects with visibility turned on are pasted to the layout. If you + have something in a buffer, then change which side of the board you + are viewing, the contents of the buffer will automatically be + mirrored for pasting on the side you are viewing. It is not + necessary to clear a buffer before cutting or copying something + into it - it will automatically be cleared first. + +Connects + The entries available through the Connects menu allow you to find + connections from objects and to manipulate these. You can also + optimize or erase rat's nests from this menu. Finally, the + `auto-route all rats' entry allows you to auto-route all + connections show by the rat's nest. The auto-router will use any + visible copper layer for routing, so turn off the visibility of any + layers you don't want it to use. The auto-router will automatically + understand and avoid any traces that are already on the board, but + it is not restricted to the grid. Finally, the auto-router routes + using the active sizes (except for nets that have a route-style + defined). `Pcb' always knows which tracks were routed by the + auto-router, and you can selectively remove them without fear of + changing tracks that you have manually routed with the `rip-up all + auto-routed tracks' entry in the Connects menu. The `design rule + checker' entry runs a check for copper areas that are too close + together, or connections that touch too tenuously for reliable + production. The DRC stops when the first problem is encountered so + after fixing a problem be sure to run it again until no problems + are found. + _Warning:_ COPPER TEXT IS IGNORED BY THE DRC CHECKER. + +Info + The `generate object report' entry from the Info menu provides a + way to get detailed information about an object, such as its + coordinates, dimensions, etc. You can also get a report + summarizing all of the drills used on the board with `generate + drill summary'. Lastly, you can get a list of all pins, pads and + vias that were found during a connection search. + +Window + The Window menu provides a way to bring each of `Pcb's' windows to + the front. The _Library_ window is used to bring elements from the + library into the paste-buffer. The _Message Log_ window holds the + various messages that `Pcb' sends to the user. The _Netlist_ + window shows the list of connections desired. + + + Now that you're familiar with the various menus, it's time to try +some things out. From the File menu choose `load layout', navigate to +the tutorial folder, then load the file `tut1.pcb'. + + +File: pcb.info, Node: Status-line and Input-field, Next: Layer Controls, Prev: Menu, Up: Application Window + +3.1.2 The Status-line and Input-field +------------------------------------- + +The status-line is located at the bottom edge of the main window. +During normal operation the status information is visible there. When +a selected menu operation requires an additional button click, the +status-line is replaced by a message telling you to position the cursor +and click. When a text input is required, the status-line is replaced +by the Input-field which has a prompt for typing the input. + + The status-line shows, from left to right, the side of the board +that you are viewing (_Tab_ key changes this), the current grid values, +if new lines are restricted to 45 degrees, which type of 45 degree line +mode is active, whether rubberband move and rotate mode is on (R), and +the zoom factor. This information is followed by the active +line-width, via-size and drilling hole, keepaway spacing, and text +scaling. Last is the active buffer number and the name of the layout. +An asterisk appearing at the far left indicates that the layout has +been modified since the last save. Note that the name of the layout is +not the same thing as the filename of the layout. Change the grid +factor to 1.0 mm from the Screen menu. Observe how the status line +shows the new grid setting. Except for the case of the metric grid, all +dimensions in the status line are in units of 0.001 inch (1 mil). + + The input-field pops up (temporarily replacing the status-line) +whenever user input is required. Two keys are bound to the input field: +the _Escape_ key aborts the input, _Return_ accepts it. Let's change +the name of a component on the board to see how the input-field works. +Position the cross hair over R5, and press the _N_ key. The input field +pops-up showing the name for you to edit. Go ahead and change the name, +then hit return. Notice the name of the element changed. Now undo the +change by pressing the _U_ key. You can position the cross hair over +the name, or the element before pressing the _N_ key. + + Now select `realign grid' from the Screen menu. Notice that the +status line has been replaced with an instruction to position the cursor +where you want a grid point to fall. In this case, since the cross hair +can only fall on a grid point, you must move the tip of the finger +cursor to the place where you want a grid point to appear. Do not worry +that the cross hair is not coincident with the cursor. Click _Btn1_ at +your chosen location. See how the grid has shifted, and the status line +has returned. + + The present cross hair position is displayed in the upper right +corner of the window. Normally this position is an absolute +coordinate, but you can anchor a marker at the cross hair location by +pressing _Ctrl-M_ (try it now) and then the display will read both the +absolute cross hair position as well as the difference between it and +the marker. The numbers enclosed in < > are the X and Y distances +between the cross hair and the mark, while the numbers enclosed in +parenthesis are the distance and angle from the mark to the cross hair. +The values displayed are always in units of 0.001 inch (1 mil). +Pressing _Ctrl-M_ again turns the marker off. + + +File: pcb.info, Node: Layer Controls, Next: Tool Selectors, Prev: Status-line and Input-field, Up: Application Window + +3.1.3 The Layer Controls +------------------------ + +The layer control panel, located in the upper left, is used to turn on +and off the display of layer groups and to select the active drawing +layer. If a layer hasn't been named, the label "_(unknown)_" is used +as the default. If this happens, it probably means the application +resources are not installed properly. + + The upper buttons are used to switch layers on and off. Click +__ on one or more of them. Each click toggles the setting. If +you turn off the currently active layer, another one that is visible +will become active. If there are no others visible, you will not be +able to turn off the active layer. When the layers are grouped, +clicking on these buttons will toggle the visibility of all layers in +the same group. This is a good idea because layers in the same group +reside on the same physical layer of the actual board. Notice that this +example has 2 groups each having 3 layers, plus two other layers named +`unused'. Use the `Edit layer groups' option in the `Settings' menu to +change the layer groupings in the lesstif GUI or the `Preferences' +dialog from the `File' menu in the GTK+ GUI. Note that changing the +groupings can radically alter the connectivity on the board. Grouping +layers is only useful for helping you to color-code signals in your +layout. Note that grouping layers actually reduces the number of +different physical layers available for your board, so to make an eight +layer board, you cannot group any layers. + + The _far side_ button turns on and off the visibility of elements +(including SMD pads) on the opposite (to the side you're viewing) board +side, as well as silk screening on that side. It does not hide the +x-ray view of the other copper layers, these must be turned off +separately if desired. Use the _tab_ key to view the entire board from +the other side. To see a view of what the back side of the board will +actually look like, make the solder layer the active layer then press +_tab_ until the status line says "solder" on the right, then turn off +the visibility of all layers except solder, pins/pads, vias, and silk. +Now turn them all back on. + + The lowest button, named _active_, is used to change the active +drawing layer. Pressing __ on it pops up a menu to select which +layer should be active. Each entry is labeled with the layer's name +and drawn in its color. The active layer is automatically made +visible. The active layer is always drawn on top of the other layers, +so the ordering of layers on the screen does not generally reflect the +ordering of the manufactured board. Only the solder, component, +silkscreen, and solder-mask layers are always drawn in their physical +order. Bringing the active layer to the top makes it easier to select +and change objects on the active layer. Try changing the active +layer's name to _ABC_ by selecting `edit name of active layer' from the +`Edit' menu. Changing the active layer can also be done by pressing +keys _1..MAX_LAYER_. + + Turn off the visibility of the component layer. Now make the +component layer the active layer. Notice that it automatically became +visible. Try setting a few other layers as the active layer. You should +also experiment with turning on and off each of the layers to see what +happens. + + The netlist layer is a special layer for adding connections to the +netlist by drawing rat lines. This is not the recommended way to add to +the netlist, but occasionally may be convenient. To learn how to use +the netlist layer see *note Net Objects::. + + +File: pcb.info, Node: Tool Selectors, Next: Layout Area, Prev: Layer Controls, Up: Application Window + +3.1.4 The Tool Selectors +------------------------ + +The tool selector buttons reside below the layer controls. They are +used to select which layout tool to use in the drawing area. Each tool +performs its function when _Btn1_ is pressed. Every tool gives the +cursor a unique shape that identifies it. The tool selector buttons +themselves are icons that illustrate their function. Each layout tool +can also be selected from the keyboard: + _F1_ key Via tool + _F2_ key Line tool + _F3_ key Arc tool + _F4_ key Text tool + _F5_ key Rectangle tool + _F6_ key Polygon tool + _F7_ key Buffer tool + _F8_ key Delete tool + _F9_ key Rotate tool + _Insert_ key Insert-point tool + _F10_ key Thermal tool + _F11_ key Arrow tool + _F12_ key Lock tool + + Some of the tools are very simple, such as the Via tool. Clicking +_Btn1_ with the Via tool creates a via at the cross hair position. The +via will have the diameter and drill sizes that are active, as shown in +the status line. The Buffer tool is similar. With it, __ copies +the contents of the active buffer to the layout, but only those parts +that reside on visible layers are copied. The Rotate tool allows you +to rotate elements, arcs, and text objects 90 degrees counter-clockwise +with each click. Holding the _Shift_ key down changes the Rotate tool +to clockwise operation. Anything including groups of objects can be +rotated inside a buffer using the rotate buffer menu option. + + The Line tool is explained in detail in *note Line Objects::. Go read +that section if you haven't already. Activate the Line tool. Set the +active layer to the solder layer. Try drawing some lines. Use the _U_ +key to undo some of the lines you just created. Zoom in a bit closer +with the _Z_ key. Draw some more lines. Be sure to draw some separate +lines by starting a new anchor point with _Ctrl-Btn1_. Change the +`crosshair snaps to pin/pads' behavior in the Settings menu. Now draw a +line. Notice that the new line points must now always be on a grid +point. It might not be able to reach some pins or pads with this +setting. Increase the active line thickness by pressing the _L_ key. +Note that the status line updates to reflect the new active line +thickness. Now draw another line. Before completing the next line, make +the component layer active by pressing the _4_ key. Now finish the +line. Notice that a via was automatically placed where you switched +layers. `Pcb' does not do any checks to make sure that the via could +safely be placed there. Neither does it interfere with your desire to +place lines haphazardly. It is up to you to place things properly when +doing manual routing with the Line tool. + + The Arc tool is explained in detail in *note Arc Objects::. Its use +is very similar to the Line tool. + + The Rectangle tool, Polygon tool and Thermal tool are explained in +detail in *note Polygon Objects::. Go read that section. Remember that +the Thermal tool will only create and destroy thermals to polygons on +the active layer. Use the Rectangle tool to make a small copper plane +on the component layer. Now place a via in the middle of the plane. +Notice that it does not touch the plane, and they are not electrically +connected. Use the Thermal tool to make the via connect to the plane. +Thermals allow the via or pin to be heated by a soldering iron without +having to heat the entire plane. If solid connections were made to the +plane, it could be nearly impossible to solder. Shift-click on the via +with the Thermal tool to change the style of thermal used or to make +the connection solid. Click on the via again with the Thermal tool to +remove the connection to the plane. + + The Insert-point tool is an editing tool that allows you to add +points into lines and polygons. The Insert-point tool enforces the 45 +degree line rule. You can force only the shorter line segment to 45 +degrees by holding the _Shift_ key down while inserting the point. Try +adding a point into one of the lines you created. Since line clipping +is turned on, you may need to move the cross hair quite far from the +point where you first clicked on the line. Turn off the line clipping +by selecting `all-direction lines' from the Settings menu (or hit the +_Period_ key). Now you can place an inserted point anywhere. Try +adding a point to the rectangle you made earlier. Start by clicking +somewhere along an edge of the rectangle, then move the pointer to a +new location and click again. + + The delete-mode deletes the object beneath the cursor with each +_Btn1_ click. If you click at an end-point that two lines have in +common, it will replace the two lines with a single line spanning the +two remaining points. This can be used to delete an "inserted" point +in a line, restoring the previous line. Now delete one of the original +corner points of the polygon you were just playing with. To do this, +place the cross hair over the corner and click on it with the Delete +tool. You could also use the _Backspace_ key if some other tool is +active. Try deleting some of the lines and intermediate points that you +created earlier. Use undo repeatedly to undo all the changes that +you've made. Use redo a few times to see what happens. Now add a new +line. Notice that you can no longer use redo since the layout has +changed since the last undo happened. The undo/redo tree is always +pruned in this way (_i.e._ it has a root, but no branches). + + The Arrow tool is so important, it has its own section: *note Arrow +Tool::. Go read it now. + + The Lock tool allows you to lock objects on the layout. When an +object is locked, it can't be selected, moved, rotated, or resized. +This is useful for very large objects like ground planes, or +board-outlines that are defined as an element. With such large objects, +nearly anywhere you click with the Arrow tool will be on the large +object, so it could be hard to draw box selections. If you lock an +object, the Arrow tool will behave as if it didn't exist. You cannot +unlock an object with undo. You must click on it again with the Lock +tool. If an object is locked, previous changes to it cannot be undone +either. When you lock an object, a report message about it is popped up +and will always tell you what object it is, and that it is locked if +you just locked it. Other than noticing your inability to manipulate +something, the only way to tell an object is locked is with a report +from the Info menu. Use the Lock tool sparingly. + + +File: pcb.info, Node: Layout Area, Prev: Tool Selectors, Up: Application Window + +3.1.5 Layout Area +----------------- + +The layout area is where you see the layout. The cursor shape depends +on the active tool when the pointer is moved into the layout area. A +cross hair follows the mouse pointer with respect to the grid setting. +Select a new grid from the _Screen_ menu. The new value is updated in +the status line. A different way to change the grid is _Shiftg_ +to decrease or _g_ to increase it, but this only works for English +(integer mil) grids. The grid setting is saved along with the data +when you save a pcb layout. For homemade layouts a value around 50 is +a good setting. The cursor can also be moved in the layout area with +the cursor (arrow) keys or, for larger distances, by pressing the +_Shift_ modifier together with a cursor key. + + +File: pcb.info, Node: Log Window, Next: Library Window, Prev: Application Window, Up: Getting Started + +3.2 Log Window +============== + +This optional window is used to display all kind of messages including +the ones written to _stderr_ by external commands. The main advantage +of using it is that its contents are saved in a scrolling list until the +program exits. Disabling this feature by setting the resource +_useLogWindow_ to _false_ will generate popup windows to display +messages. The _stderr_ of external commands will appear on `Pcb's +_stderr_ which normally is the parent shell. I suggest you iconify the +log window after startup for example by setting _*log.iconic_ to _true_ +in the resource file. If _raiseLogWindow_ is set _true_, the window +will deiconify and raise itself whenever new messages are to be +displayed. + + +File: pcb.info, Node: Library Window, Next: Netlist Window, Prev: Log Window, Up: Getting Started + +3.3 Library Window +================== + +The library window makes loading elements (or even partial layouts) +easy. Just click the appropriate library from the list on the left. A +list of its elements then appears on the right. Select an element from +the list by clicking on its description. Selecting an element from the +library will also automatically copy the element into the active +buffer, then invoke the _Buffer_ tool so you can paste it to the +layout. Elements in the old library should be taken with a grain of +salt (_i.e._ check them carefully before using). The old library names +all begin with ~ so you can easily distinguish between the old and new +libraries. All of the elements in the new library should be +thoroughly vetted, so you can use them with confidence. The new +libraries are stored simply as directories full of element files, so +making additions to the new library is easy since there is no need to +learn `m4'. For details on the old libraries, check-out *note Library +File:: and *note Library Contents File::. For details on the format of +an element file used for the new libraries, see *note Element File::. + + +File: pcb.info, Node: Netlist Window, Next: Drawing and Removing, Prev: Library Window, Up: Getting Started + +3.4 Netlist Window +================== + +The netlist window is very similar to the library window. On the left +is a list of all of the nets, on the right is the list of connections +belonging to the chosen net. The chosen net is highlighted in the list +and also shown on the second line of the window in red. If the net name +has a star to the left of it then it is "disabled". A disabled net is +treated as if it were not in the net list. This is useful, for example, +if you plan to use a ground plane and don't want the ground net showing +up in the rat's nest. You can enable/disable individual nets by +double-clicking the net name. If you want to enable or disable all nets +at once, there are two buttons at the top of the netlist window for +this purpose. + + The button labeled `Sel Net On Layout' can be used to select (on the +layout) everything that is connected (or is supposed to be connected) +to the net. If you click on a connection in the connection list, it +will select/deselect the corresponding pin or pad in the layout and +also center the layout window where it is located. If you "Find" +(`lookup connection to object' in the Connects menu [also _F_ key]), a +pin or pad it will also choose the net and connection in the netlist +window if it exists in the netlist. + + If no netlist exists for the layout, then the netlist window does not +appear. You can load a netlist from a file from the File menu. The +format for netlist files is described in *note Netlist File::. + + +File: pcb.info, Node: Drawing and Removing, Next: Moving and Copying, Prev: Netlist Window, Up: Getting Started + +3.5 Drawing and Removing Basic Objects +====================================== + +hace begging gutting here, and do a real-world tutorial example. + + There are several ways of creating new objects: you can draw them +yourself, you can copy an existing object (or selection), or you can +load an element from a file or from the Library window. Each type of +object has a particular tool for creating it. + + The active tool can be selected from the tool selectors in the bottom +left corner or by one of the function keys listed earlier in this +chapter. Each __ press with the tool tells the application to +create or change the appropriate object or at least take the first step +to do so. Each tools causes the cursor to take on a unique shape and +also causes the corresponding tool selector button to be highlighted. +You can use either cue to see which tool is active. + + Insert mode provides the capability of inserting new points into +existing polygons or lines. The 45 degree line clipping is now enforced +when selected. Press and hold the shift key while positioning the new +point to only clip the line segment to the nearer of the two existing +points to 45 degrees. You can also toggle the 45-degree clipping in +the middle of a point insertion by pressing the _._ If the shift +key is not depressed and the 45 degree line clipping mode is on, both +new line segments must be on 45 degree angles - greatly restricting +where the new point may be placed. In some cases this can cause +confusion as to whether an insertion has been started since the two new +lines may be forced to lie parallel on top of the original line until +the pointer is moved far from the end points. + + Removing objects, changing their size or moving them only applies to +objects that are visible when the command is executed. + +* Menu: + +* Common:: Keystrokes common to some objects. +* Lines:: +* Arcs:: +* Polygons:: Drawing polygons and rectangles. +* Text:: +* Vias:: +* Elements:: +* Pastebuffer:: A multi-purpose buffer. + + +File: pcb.info, Node: Common, Next: Lines, Up: Drawing and Removing + +3.5.1 Common Drawing and Removing Methods +----------------------------------------- + +There are several keystrokes and button events referring to an _object_ +without identifying its type. Here's a list of them: + + __ creates (or deletes) an object depending on the current +mode. + + _BackSpace_ or _Delete_ removes the visible object at the +cursor location. When more than one object exists at the location, the +order of removal is: via, line, text, polygon and element. The drawn +layer order also affects the search - whatever is top - most (except +elements) is affected before lower items. Basically all this means +that what is removed is probably just what you expect. If for some +reason it isn't, undo and try again. Only one object is removed for +each keystroke. If two or more of the same type match, the newest one +is removed. + + Use _s_ and _Shifts_ to change the size (width) of lines, +arcs, text objects, pins, pads and vias, or to toggle the style of +polygons (whether pins and vias automatically have clearances). + + _n_ changes the name of pins, pads, vias, the string of a text +object, or the currently displayed label of an element. + + _m_ moves the line, arc, or polygon under the cross hair to the +active layer if it wasn't on that layer already. + + _u_ (undo) recovers from an unlimited number of operations such +as creating, removing, moving, copying, selecting etc. It works like +you'd expect even if you're in the midst of creating something. + + _Shiftr_ restores the last undone operation provided no other +changes have been made since the undo was performed. + + _tab_ changes the board side you are viewing. + + For a complete list of keystrokes and button events see *note +Translations::. + + +File: pcb.info, Node: Lines, Next: Arcs, Prev: Common, Up: Drawing and Removing + +3.5.2 Lines +----------- + +To draw new lines you have to be in _line-mode_. Get there either by +selecting it from the _Tool palette_ or by pressing _F2_. Each +successive _notify_ event creates a new line. The adjustment to 45 +degree lines is done automatically if it is selected from the _Display_ +menu. You can toggle the 45 degree mode setting by pressing the +_._ (That is the period key). When 45 degree enforcement is turned +on there are three distinct modes of line creation: a single line on +the closest 45 degree vector towards the cross hair (but not necessarily +actually ending at the cross hair), two lines created such that the +first leaves the start point on a 90 degree vector and the second +arrives at the cross hair on a 45 degree vector, and finally two lines +created such that the first leaves the start point on a 45 degree +vector and the second arrives at the cross hair on a 90 degree vector. +These last two modes always connect all the way from the start and end +points, and all lines have angles in 45 degree multiples. The _/_ +cycles through the three modes. The status line shows a text icon to +indicate which of the modes is active and the lines following the cross +hair motion show the outline of the line(s) that will actually be +created. Press _Escape_ to leave line-mode. + + _l_, _Shiftl_ and the entries in the _Sizes_ menu change +the initial width of new lines. This width is also displayed in the +status line. + + +File: pcb.info, Node: Arcs, Next: Polygons, Prev: Lines, Up: Drawing and Removing + +3.5.3 Arcs +---------- + +An Arc is drawn with the _arc-tool_. Get there either by selecting it +from the _Tool palette_ or by pressing _F8_. Press _Btn1_ to +define the starting point for the arc. Drag the mouse towards the +desired end point along the path you want the arc to follow. The +outline of the arc that will be created is shown on the screen as you +move the mouse. Arcs are always forced to be 90 degrees and have +symmetrical length and width ( i.e. they are a quarter circle). The +next _Btn1_ click creates the arc. It will have the same width as new +lines (displayed in the status line) and appear on the active layer. +The arc leaves the starting point towards the cross hair along the axis +whose distance from the cross hair is largest. Normally this means that +if you drag along the path you want the arc to follow, you'll get what +you want. If the grid is set to the arc radius, then the two distances +will be equal and you won't be able to get all of the possible +directions. If this is thwarting your desires, reduce the grid spacing +(_!ShiftG_) and try again. + + +File: pcb.info, Node: Polygons, Next: Text, Prev: Arcs, Up: Drawing and Removing + +3.5.4 Polygons and Rectangles +----------------------------- + +A polygon is drawn by defining all of its segments as a series of +consecutive line segments. If the first point matches a new one and if +the number of points is greater than two, then the polygon is closed. +Since matching up with the first point may be difficult, you may use +_Shiftp_ to close the polygon. The _Shiftp_ won't work if +clipping to 45 degree lines is selected and the final segment cannot +match this condition. I suggest you create simple convex polygons in +order to avoid a strong negative impact on the performance of the +connection scanning routines. The _rectangle-mode_ is just an easy way +to generate rectangular polygons. _Polygon-mode_ also is selected by +_F6_ whereas _rectangle-mode_ uses _F4_. Pressing a __ +at two locations creates a rectangle by defining two of its corners. +_Insert_ brings you to _insert-point-mode_ which lets you add +additional points to an already existing polygon. Single points may be +removed by moving the cross hair to them and selecting one of the +delete actions _(remove-mode, BackSpace, or Delete_. This only works if +the remaining polygon will still have three or more corners. Pressing +_u_ or _p_ while entering a new polygon brings you back to +the previous corner. Removing a point does not force clipping to 45 +degree angles (because it's not generally possible). Newly created +polygons will not connect to pins or vias that pierce it unless you +create a thermal (using the thermal mode) to make the connection. If +the edge of a polygon gets too close to a pin or via that lies outside +of it, a warning will be issued and the pin will be given a special +color. Increasing the distance between them will remove the warning +color. + + +File: pcb.info, Node: Text, Next: Vias, Prev: Polygons, Up: Drawing and Removing + +3.5.5 Text +---------- + +Pressing _F5_ or clicking one of the text selector buttons changes +to _text-mode_. Each successive notify event (__) pops up the +input line at the bottom and queries for a string. Enter it and press +_Return_ to confirm or _Escape_ to abort. The text object is +created with its upper left corner at the current pointer location. +The initial scaling is changed by _t_ and _Shiftt_ or from +the _Sizes_ menu. + + Now switch to _rotate-mode_ and press __ at the text-objects +location. Text objects on the solder side of the layout are +automatically mirrored and flipped so that they are seen correctly when +viewing the solder-side. + + Use _n_ to edit the string. + + TEXT OBJECTS ON COPPER LAYERS CREATE COPPER LINES BUT THEY ARE NOT +SCANNED FOR CONNECTIONS. If they are moved to the silkscreen layer, they +no longer create copper. + + +File: pcb.info, Node: Vias, Next: Elements, Prev: Text, Up: Drawing and Removing + +3.5.6 Vias +---------- + +The initial size of new vias may be changed by _v_ and +_Shiftv_ or by selecting the appropriate entry from the _Sizes_ +menu. _Mod1v_ and _Mod1 Shiftv_ do the same for the drilling +hole of the via. The statusline is updated with the new values. +Creating a via is similar to the other objects. Switch to _via-mode_ by +using either the selector button or _F1_ then press _]_ or +__ to create one. _n_ changes the name of a via. If you +want to create a mounting hole for your board, then you can place a via +where you want the hole to be then convert the via into a hole. The +conversion is done by pressing _!Ctrlh_ with the cross hair over +the via. Conceptually it is still a via, but it has no copper annulus. +If you create such a hole in the middle of two polygons on different +layers, it will short the layers. Theoretically you could arrange for +such a hole not to be plated, but a metal screw inserted in the hole +would still risk shorting the layers. A good rule is to realize that +holes in the board really are vias between the layers and so place them +where they won't interfere with connectivity. You can convert a hole +back into a normal via with the same keystroke used to convert it in +the first place. + + +File: pcb.info, Node: Elements, Next: Pastebuffer, Prev: Vias, Up: Drawing and Removing + +3.5.7 Elements +-------------- + +Some of the functions related to elements only work if both the package +layer and the pin layer are switched on. + + Now that you're familiar with many of the basic commands, it is time +to put the first element on the layout. First of all, you have to load +data into the paste buffer. There are four ways to do this: + 1) load the data from a library + 2) load the data from a file + 3) copy data from an already existing element + 4) convert objects in the buffer into an element + We don't have any elements on the screen yet nor anything in the +buffer, so we use number one. + + Select _lsi_ from the menu in the library window press __ +twice at the appropriate text-line to get the MC68030 CPU. The data is +loaded and the mode is switched to _pastebuffer-mode_. Each notify +event now creates one of these beasts. Leave the mode by selecting a +different one or by _Escape_ which resets all modes.. The cross +hair is located at the _mark_ position as defined by the data file. +Rotating the buffer contents is done by selecting the _rotate_ entry of +the _Buffer_ menu or by pressing _ShiftF3_. The contents of the +buffer are valid until new data is loaded into it either by a +cut-to-buffer operation, copy-to-buffer operation or by loading a new +data file. There are 5 buffers available (possibly more or less if +changed at compile time with the `MAX_BUFFER' variable in +`globalconfig.h'). Switching between them is done by selecting a menu +entry or by _Shift1..MAX_BUFFER_. Each of the two board sides has +its own buffers. + + The release includes all data files for the circuits that are used +by the demo layout. The elements in the LED example are not found in +the library, but you can lift them from the example itself if you want. +If you have problems with the color of the cross hair, change the +resource _cross hairColor_ setting to a different one. + + Now load a second circuit, the MC68882 FPU for example. Create the +circuit as explained above. You now have two different unnamed +elements. Unnamed means that the layout-name of the element hasn't been +set yet. Selecting _description_ from the _Display_ menu displays the +description string of the two circuits which are CPU and FPU. The +values of the circuits are set to MC68030 and MC68882. Each of the +names of an element may be changed by _n_ at the elements location +and editing the old name in the bottom input line. Naming pins and vias +is similar to elements. You can hide the element name so that it won't +appear on the board silkscreen by pressing _h_ with the cursor +over the element. Doing so again un-hides the element name. + + Entering `:le' and selecting an element data file is the second way +to load circuits. + + The third way to create a new element is to copy an existing one. +Please refer to *note Moving and Copying::. + + The fourth way to create a new element is to convert a buffer's +contents into an element. Here's how it's done: Select the Via-tool +from the _Tool pallet_. Set the grid spacing to something appropriate +for the element pin spacing. Now create a series of vias where the pins +go. Create them in pin number order. It is often handy to place a +reference point (_!Ctrlm_) in the center of the first pin in order +to measure the location of the other pins. Next make a solder-side +layer the active layer from the _active-layer_ popup menu. Now draw +the outline of the element using lines and arcs. When you're done, +select everything that makes up the element with a box selection +(_ drag, _). Now select "cut selection to buffer" +from the _Buffer_ menu. Position the cursor over the center of pin 1 +and press the left button to load the data into the buffer. Finally +select "convert buffer to element" from the _Buffer_ menu. You'll only +want to create elements this way if they aren't already in the library. +It's also probably a good idea to do this before starting any of the +other aspects of a layout, but it isn't necessary. + + To display the pinout of a circuit move to it and press _Shiftd_ +or select _show pinout_ from the _Objects_ menu. A new window pops up +and displays the complete pinout of the element. This display can be +difficult to read if the component has been rotated 90 degrees :-( +therefore, the new window will show an un-rotated view so the pin names +are readable. _d_ displays the name of one or all pins/pads +inside the Layout area, this is only for display on-screen, it has no +effect on any printing of the layout. + + You also may want to change a pin's or pad's current size by pressing +_s_ to increase or _Shifts_ to decrease it. While this is +possible, it is not recommended since care was probably taken to define +the element structure in the first place. You can also change the +thickness of the element's silkscreen outline with the same keys. You +can change whether a pin or SMD pad is rounded or square with the +_q_. SMD pads should usually have squared ends. Finally, you can +change whether the non-square pins are round or octagonal with the +_!Ctrlo_. + + SMD elements and silkscreen objects are drawn in the "invisible +object" color if they are located on the opposite side of the board. + + For information on element connections refer to *note Connection +Lists::. + + +File: pcb.info, Node: Pastebuffer, Prev: Elements, Up: Drawing and Removing + +3.5.8 Pastebuffer +----------------- + +The line-stack and element-buffer of former releases have been replaced +by 5 (possibly more or less if changed at compile time with the +`MAX_BUFFER' variable in `globalconfig.h') multi-purpose buffers that +are selected by _Shift1..MAX_BUFFER_. The status line shows which +buffer is the active one. You may load data from a file or layout into +them. Cut-and-paste works too. If you followed the instructions +earlier in this chapter you should now have several objects on the +screen. Move the cross hair to one of them and press __ to +toggle its selection flag. (If you drag the mouse while the button is +down, a box selection will be attempted instead of toggling the +selection.) The object is redrawn in a different color. You also may +want to try moving the pointer while holding the third button down and +release it on a different location. This selects all objects inside the +rectangle and unselects everything else. If you want to add a box +selection to an existing selection, drag with _Mod1_ instead. +Dragging _Shift Mod1_ unselects objects in a box. Now change +to _pastebuffer-mode_ and select some operations from the _Buffer_ +menu. Copying objects to the buffer is available as _Mod1c_ while +cutting them uses _Mod1x_ as shortcut. Both clear the buffer +before new data is added. If you use the menu entries, you have to +supply a cross hair position by pressing a mouse button. The objects +are attached to the pastebuffer relative to that cross hair location. +Element data or PCB data may be merged into an existing layout by +loading the datafiles into the pastebuffer. Both operations are +available from the _File_ menu or as user commands. + + +File: pcb.info, Node: Moving and Copying, Next: Loading and Saving, Prev: Drawing and Removing, Up: Getting Started + +3.6 Moving and Copying +====================== + +All objects can be moved including element-names, by __, +dragging the pointer while holding the button down and releasing it at +the new location of the object. If you use _Mod1_ instead, +the object is copied. Copying does not work for element-names of +course. You can move all selected objects with _Shift _. This +uses the Pastebuffer, so it will remove whatever was previously in the +Pastebuffer. Please refer to *note Pastebuffer::. If you want to give +a small nudge to an object, but you don't think that the mouse will +give you the fine level of control that you want, you can position the +cursor over the object, press _[_, move it with the arrow keys, +then press _]_ when it's at the desired position. Remember that +all movements are forced onto grid coordinates, so you may want to +change the grid spacing first. + + To move a trace or group of traces to a different layer, first select +the tracks to be moved. It's easiest to do this if you shut off +everything but that layer first (i.e. silk, pins, other layers, etc). +Now set the current layer to be the new layer. Press Shift-M to move +all the selected tracks to the current layer. See the +_MoveToCurrentLayer_ action for more details. + + +File: pcb.info, Node: Loading and Saving, Next: Printing, Prev: Moving and Copying, Up: Getting Started + +3.7 Loading and Saving +====================== + +After your first experience with `Pcb' you will probably want to save +your work. `:s name' passes the data to an external program which is +responsible for saving it. For details see _saveCommand_ in *note +Resources::. Saving also is available from the _File_ menu, either +with or without supplying a filename. `Pcb' reuses the last filename if +you do not pass a new one to the save routine. + + To load an existing layout either select _load layout data_ from the +_File_ menu or use `:l filename'. A file select box pops up if you +don't specify a filename. Merging existing layouts into the new one is +supported either by the _File_ menu or by `:m filename'. + + `Pcb' saves a backup of the current layout at a user specified +interval. The backup filename is created by appending a dash, "-", to +the `.pcb' filename. For example, if you are editing the layout in +`projects/board.pcb' then the backup file name will be +`projects/board.pcb-'. If the layout is new and has not been saved +yet, then the backup file name is `PCB.####.backup' where the "####" +will be replaced by the process ID of the currenting running copy of +`Pcb'. This default backup file name may be changed at compilation +time via the `BACKUP_NAME' variable in `globalconfig.h'). During +critical sections of the program or when data would be lost it is saved +as `PCB.%i.save'. This file name may be changed at compile time with +the `SAVE_NAME' variable in `globalconfig.h'. + + +File: pcb.info, Node: Printing, Next: Exporting, Prev: Loading and Saving, Up: Getting Started + +3.8 Printing +============ + +`Pcb' now has support for device drivers, `PostScript', _encapsulated +PostScript_, and _Gerber RS-274X_ drivers are available so far. The +_Gerber RS-274X_ driver additionally generates a numerical control (NC) +drill file for automated drilling, a bill of materials file to assist +in materials procurement and inventory control, and a centroid (X-Y) +file which includes the centroid data needed by automatic assembly +(pick and place) machines. I recommend the use of `GhostScript' if you +don't have a `PostScript' printer for handling the PostScript output. +Printing always generates a complete set of files for a specified +driver. See the page about the _Print()_ action for additional +information about the filenames. The control panel offers a number of +options. Most of them are not available for Gerber output because it +wouldn't make sense, for example, to scale the gerber output (you'd +get an incorrectly made board!) The options are: + +`device' + The top menu button selects from the available device drivers. + +`rotate' + Rotate layout 90 degrees counter-clockwise before printing + (default). + +`mirror' + Mirror layout before printing. Use this option depending on your + production line. + +`color' + Created colored output. All colors will be converted to black if + this option is inactive. + +`outline' + Add a board outline to the output file. The size is determined by + the maximum board size changeable from the _sizes_ menu. The + outline appears on the top and bottom sides of the board, but not + on the internal layers. An outline can be useful for determining + where to shear the board from the panel, but be aware that it + creates a copper line. Thus it has the potential to cause short + circuits if you don't leave enough room from your wiring to the + board edge. Use a viewer to see what the output outline looks like + if you want to know what it looks like. + +`alignment' + Additional alignment targets are added to the output. The + distances between the board outline is set by the resource + _alignmentDistance_. Alignment targets should only be used if you + know for certain that YOU WILL BE USING THEM YOURSELF. It is + extremely unlikely that you will want to have alignment targets if + you send gerber files to a commercial pcb manufacture to be made. + +`scaling' + It's quite useful to enlarge your printout for checking the layout. + Use the scrollbar to adjust the scaling factor to your needs. + +`media' + Select the size of the output media from this menu. The user + defined size may be set by the resource _media_ either from one of + the well known paper sizes or by a `X11' geometry specification. + This entry is only available if you use `X11R5' or later. For + earlier releases the user defined size or, if not available, _A4_ + is used. Well known size are: + A3 + A4 + A5 + letter + tabloid + ledger + legal + executive + +`offset' + Adjust the offsets of the printout by using the panner at the + right side of the dialog box. This entry is only available if you + use `X11R5' or later. A zero offset is used for earlier releases. + +`8.3 filenames' + Select this button to generate DOS compatible filenames for the + output files. The _command_ input area will disappear if selected. + +`commandline' + Use this line to enter a command (starts with `|') or a filename. + A %f is replaced by the current filename. The default is set by + the resource _printCommand_. + + + The created file includes some labels which are guaranteed to stay +unchanged +`PCBMIN' + identifies the lowest x and y coordinates in mil. + +`PCBMAX' + identifies the highest x and y coordinates in mil. + +`PCBOFFSET' + is set to the x and y offset in mil. + +`PCBSCALE' + is a floating point value which identifies the scaling factor. + +`PCBSTARTDATA' +`PCBENDDATA' + all layout data is included between these two marks. You may use + them with an `awk' script to produce several printouts on one + piece of paper by duplicating the code and putting some + `translate' commands in front. Note, the normal `PostScript' + units are 1/72 inch. + + +File: pcb.info, Node: Exporting, Next: Arrow Tool, Prev: Printing, Up: Getting Started + +3.9 Exporting a layout +====================== + +To export a layout choose _Export layout_ from the _File_ menu, then +select the desired exporter. + +* Menu: + +* bom:: Bill of materials. +* gcode:: G-code. +* gerber:: Gerber. +* nelma:: Nelma. +* png:: Image. +* ps:: Postscript. +* eps:: Eps. + + +File: pcb.info, Node: bom, Next: gcode, Up: Exporting + +3.9.1 Bill of materials (bom) +----------------------------- + +Produces a bill of materials (BOM) file and a centroid (XY) file. + + +File: pcb.info, Node: gcode, Next: gerber, Prev: bom, Up: Exporting + +3.9.2 G-code (gcode) +-------------------- + +The gcode exporter can generate RS274/NGC G-CODE files to be used with +a CNC mill to produce pcb's by mechanically removing copper from the +perimeter of all elements. + + The elements are enlarged in order to compensate for the cutting +tool size so that the remaining copper corresponds to the original +size; however all polygons are left unchanged and will end up being a +little smaller; this is not a problem because the electrical connection +is done with traces, which are correctly enlarged. + + A .cnc file is generated for every copper layer, with the bottom +layer mirrored so that the milling is done right; of course it's not +possible to produce directly multi-layer (more than 2) pcb's with this +method, but the cnc files for intermediate layers are generated anyways. + + A drill file is also generated, and it contains all drills +regardless of the hole size; the drilling sequence is optimized in +order to require the least amount of movement. + + The export function generates an intermediate raster image before +extracting the contour of copper elements, and this image is saved as +well (in .png format) for inspection. + + When the spacing between two elements is less than the tool diameter +they will merge and no isolation will be cut between them; the control +image should be checked for this behaviour. + + Possible workarounds are: increasing spacing, decreasing the tool +size, increasing the intermediate image resolution. + + To maximize the chance of producing correct pcb's it would be better +to increase the DRC clearance to at least the tool diameter and use +traces as thick as possible; the rule is: use the largest element that +will not prevent the isolation cut. + + The exporter parameters are: + +basename + base name for generated files + +dpi + intermediate image resolution; affects precision when extracting + contours + +mill depth + should be the copper depth + +safe z + Z value when moving between polygons + +tool radius + copper elements are enlarged by this amount + +drill depth + depth of drills + +measurement unit + for all parameters above, can be mm,um,inch,mil; g-code is always + mm or inch + + All .cnc files specify Z values as parameters, so that it's easy to +change them without the need to run the exporter again. + + Operation was verified with the EMC2 g-code interpreter. + + Following is a sample layout that is converted with default settings: [image src="gcode.png" alt="Sample Layout"] + +The control image shows that the spacing is sufficient: [image src="gcode_control_img.png" alt="Control Image"] + +The final tool path follows the perimeter of all elements: [image src="gcode_tool_path.png" alt="Resulting Tool Path"] + + +File: pcb.info, Node: gerber, Next: nelma, Prev: gcode, Up: Exporting + +3.9.3 Gerber (gerber) +--------------------- + +Produces RS274-X (a.k.a. gerber) photo plot files and Excellon drill +files. + + +File: pcb.info, Node: nelma, Next: png, Prev: gerber, Up: Exporting + +3.9.4 Nelma (nelma) +------------------- + +Numerical analysis package export. + + +File: pcb.info, Node: png, Next: ps, Prev: nelma, Up: Exporting + +3.9.5 Image (png) +----------------- + +Produces GIF/JPEG/PNG image files. + + +File: pcb.info, Node: ps, Next: eps, Prev: png, Up: Exporting + +3.9.6 Postscript (ps) +--------------------- + +Export as postscript. Can be later converted to pdf. + + +File: pcb.info, Node: eps, Prev: ps, Up: Exporting + +3.9.7 Encapsulated Postscript (eps) +----------------------------------- + +Export as eps (encapsulated postscript) for inclusion in other +documents. Can be later converted to pdf. + + +File: pcb.info, Node: Connection Lists, Prev: Vendor drill mapping, Up: Getting Started + +3.10 Connection Lists +===================== + +After completing parts of your layout you may want to check if all drawn +connections match the ones you have in mind. This is probably best done +in conjunction with a net-list file: see *note Rats Nest::. The +following examples give more rudimentary ways to examine the +connections. + 1) create at least two elements and name them + 2) create some connections between their pins + 3) optionally add some vias and connections to them + + Now select _lookup connection_ from the _Connections_ menu, move the +cursor to a pin or via and press any mouse button. `Pcb' will look for +all other pins and/or vias connected to the one you have selected and +display the objects in a different color. Now try some of the reset +options available from the same menu. + + There also is a way to scan all connections of one element. Select +_a single element_ from the menu and press any button at the element's +location. All connections of this element will be saved to the +specified file. Either the layout name of the element or its canonical +name is used to identify pins depending on the one which is displayed +on the screen (may be changed by _Display_ menu). + + An automatic scan of all elements is initiated by choosing _all +elements_. It behaves in a similar fashion to scanning a single element +except the resource _resetAfterElement_ is used to determine if +connections should be reset before a new element is scanned. Doing so +will produce very long lists because the power lines are rescanned for +every element. By default the resource is set to _false_ for this +reason. + + To scan for unconnected pins select _unused pins_ from the same menu. + + +File: pcb.info, Node: Arrow Tool, Next: Rats Nest, Prev: Exporting, Up: Getting Started + +3.11 Arrow Tool +=============== + +Some commands mentioned earlier in this chapter also are able to +operate on all selected and visible objects. The Arrow tool is used to +select/deselect objects and also to move objects or selections. If you +click and release on an object with the Arrow tool, it will unselect +everything else and select the object. Selected objects change color to +reflect that they are selected. If you _Shift_ click, it will add the +object to (or remove) the object from the existing selection. If you +drag with the mouse button down with the Arrow tool, one of several +things could happen: if you first pressed the button on a selected +object, you will be moving the selection to where you release the +button. If you first pressed the button on an unselected object, you +will be moving that object. If you first pressed the button over empty +space, you will be drawing a box to select everything inside the box. +The _Shift_ key works the same way with box selections as it does with +single objects. + + Moving a single un-selected object is different from moving a +selection. First of all, you can move the end of line, or a point in a +polygon this way which is impossible by moving selections. Secondly, if +rubber banding is turned on, moving a single object will rubber-band +the attached lines. Finally, it is faster to move a single object this +way since there is no need to select it first. + + You can select any visible object unless it is locked. If you select +an object, then turn off its visibility with the Layer controls, it +won't be moved if you move the remaining visible selection. + + If you have not configured to use strokes in the `Pcb' user +interface, then the middle mouse button is automatically bound to the +arrow tool, regardless of the active tool (which is bound to the first +mouse button). So using the middle button any time is just like using +the first mouse button with the Arrow tool active. + + The entries of the _Selection_ menu are hopefully self-explanatory. +Many of the _Action Commands_ can take various key words that make them +function on all or some of the selected items. + + +File: pcb.info, Node: Rats Nest, Next: Design Rule Checking, Prev: Arrow Tool, Up: Getting Started + +3.12 Rats Nest +============== + +If you have a netlist that corresponds to the layout you are working +on, you can use the rats-nest feature to add rat-lines to the layout. +First you will need to load a netlist file (see _:rn_, *note User +Commands::). _w_ adds rat-lines on the active layer using the +current line thickness shown in the status line (usually you'll want +them to be thin lines). Only those rat-lines that fill in missing +connectivity (since you have probably routed some connections already) +are added. If the layout is already completely wired, nothing will be +added, and you will get a message that the wiring is complete. + + Rat-lines are lines having the special property that they only +connect to pins and pads at their end points. Rat-lines may be drawn +differently to other lines to make them easier to identify since they +have special behavior and cannot remain in a completed layout. +Rat-lines are added in the minimum length straight-line tree pattern +(always ending on pins or pads) that satisfies the missing connectivity +in the circuit. Used in connection with moves and rotates of the +elements, they are extremely useful for deciding where to place +elements on the board. The rat-lines will always automatically +rubberband to the elements whether or not the rubberband mode is on. +The only way for you to move them is by moving the parts they connect +to. This is because it is never desirable to have the rat-lines +disconnected from their element pins. Rat-lines will normally +criss-cross all over which gives rise to the name "rats nest" +describing a layout connected with them. If a SMD pad is unreachable +on the active layer, a warning will be issued about it and the rat-line +to that pad will not be generated. + + A common way to use rats nests is to place some elements on the +board, add the rat-lines, and then use a series of moves/rotates of the +elements until the rats nest appears to have minimum tangling. You may +want to iterate this step several times. Don't worry if the layout +looks messy - as long as you can get a sense for whether the +criss-crossing is better or worse as you move things, you're fine. +After moving some elements around, you may want to optimize the rats +nest _o_ so that the lines are drawn between the closest points +(this can change once you've moved components). Adding rat-lines only +to selected pads/pins (_Shiftw_) is often useful to layout a +circuit a little bit at a time. Sometimes you'll want to delete all +the rat-lines (_e_) or selected rat-lines (_Shifte_) in order +to reduce confusion. With a little practice you'll be able to achieve +a near optimal component placement with the use of a rats nest. + + Rat-lines are not only used for assisting your element placement, +they can also help you to route traces on the board. Use the _m_ +to convert a rat-line under the cursor into a normal line on the active +layer. Inserting a point into a rat-line will also cause the two new +lines to be normal lines on the board. Another way that you can use +rat-lines is to use the _f_ with the cursor over a pad or pin. +All of the pins and pads and rat-lines belonging to that net will be +highlighted. This is a helpful way to distinguish one net from the rest +of the rats nest. You can then route those tracks, turn off the +highlighting (_Shiftf_) and repeat the process. This will work even +if the layer that the rat-lines reside on is made invisible - so only +the pins and pads are highlighted. Be sure to erase the rat-lines +(_e_ erases them all) once you've duplicated their connectivity by +adding your own lines. When in doubt, the _o_ will delete only +those rat-lines that are no longer needed. + + If connections exist on the board that are not listed in the netlist +when _w_ is pressed, warning messages are issued and the affected +pins and pads are drawn in a special _warnColor_ until the next +_Notify()_ event. If the entire layout agrees completely with the +netlist, a message informs you that the layout is complete and no +rat-lines will be added (since none are needed). If the layout is +complete, but still has rat-lines then you will be warned that +rat-lines remain. If you get no message at all it's probably because +some elements listed in the net list can't be found and where reported +in an earlier message. There shouldn't be any rat-lines left in a +completed layout, only normal lines. + + The _Shiftw_ is used to add rat-lines to only those missing +connections among the selected pins and pads. This can be used to add +rat-lines in an incremental manner, or to force a rat-line to route +between two points that are not the closest points within the net. +Often it is best to add the rats nest in an incremental fashion, laying +out a sub-section of the board before going further. This is easy to +accomplish since new rat-lines are never added where routed +connectivity already makes the necessary connections. + + +File: pcb.info, Node: Design Rule Checking, Next: Trace Optimizer, Prev: Rats Nest, Up: Getting Started + +3.13 Design Rule Checking +========================= + +After you've finished laying out a board, you may want to check to be +certain that none of your interconnections are too closely spaced or +too tenuously touching to be reliably fabricated. The design rule +checking (DRC) function does this for you. Use the command ":DRC()" +(without the quotes of course) to invoke the checker. If there are no +problem areas, you'll get a message to that effect. If any problem is +encountered, you will get a message about it and the affected traces +will be highlighted. One part of the tracks of concern will be +selected, while the other parts of concern will have the +"FindConnection" highlighting. The screen will automatically be +centered in the middle of the object having the "FindConnection" +(Green) highlighting. The middle of the object is also the coordinates +reported to be "near" the problem. The actual trouble region will be +somewhere on the boundary of this object. If the two parts are from +different nets then there is some place where they approach each other +closer than the minimum rule. If the parts are from the same net, then +there is place where they are only barely connected. Find that place +and connect them better. + + After a DRC error is found and corrected you must run the DRC again +because the search for errors is halted as soon as the first problem is +found. Unless you've been extremely careless there should be no more +than a few design rule errors in your layout. The DRC checker does not +check for minimum spacing rules to copper text, so always be very +careful when adding copper text to a layout. The rules for the DRC are +specified in the application resource file. The minimum spacing value +(in mils) is given by the _Settings.Bloat_ value. The default is 7 +mils. The minimum touching overlap (in mils) is given by the +_Settings.Shrink_ value. This value defaults to 5 mils. Check with your +fabrication process people to determine the values that are right for +you. + + If you want to turn off the highlighting produced by the DRC, +perform an undo (assuming no other changes have been made). To restore +the highlighting, use redo. The redo will restore the highlighting +quickly without re-running the DRC checker. + + +File: pcb.info, Node: Trace Optimizer, Next: Searching for elements, Prev: Design Rule Checking, Up: Getting Started + +3.14 Trace Optimizer +==================== + +PCB includes a flexible trace optimizer. The trace optimizer can be run +after auto routing or hand routing to clean up the traces. + +Auto-Optimize + Performs debumpify, unjaggy, orthopull, vianudge, and viatrim, in + that order, repeating until no further optimizations are performed. + +Debumpify + Looks for U shaped traces that can be shortened or eliminated. + +Unjaggy + Looks for corners which could be flipped to eliminate one or more + corners (i.e. jaggy lines become simpler). + +Vianudge + Looks for vias where all traces leave in the same direction. Tries + to move via in that direction to eliminate one of the traces (and + thus a corner). + +Viatrim + Looks for traces that go from via to via, where moving that trace + to a different layer eliminates one or both vias. + +Orthopull + Looks for chains of traces all going in one direction, with more + traces orthogonal on one side than on the other. Moves the chain + in that direction, causing a net reduction in trace length, + possibly eliminating traces and/or corners. + +SimpleOpts + Removing unneeded vias, replacing two or more trace segments in a + row with a single segment. This is usually performed automatically + after other optimizations. + +Miter + Replaces 90 degree corners with a pair of 45 degree corners, to + reduce RF losses and trace length. + + + +File: pcb.info, Node: Searching for elements, Next: Measuring distances, Prev: Trace Optimizer, Up: Getting Started + +3.15 Searching for elements +=========================== + +To locate text or a specific element or grouping of similar elements +choose `Select by name' from the Select menu, then choose the +appropriate subsection. At the bottom of the screen the prompt +_pattern:_ appears. Enter the text or *note Regular Expressions:: of +the text to be found. Found text will be highlighted. + + +File: pcb.info, Node: Measuring distances, Next: Vendor drill mapping, Prev: Searching for elements, Up: Getting Started + +3.16 Measuring distances +======================== + +To measure distances, for example the pin-to-pin pitch of a part to +validate a footprint, place the cursor at the starting measurement +point, then press _!Ctrlm_. This marks the current location with +a _X_. The _X_ mark is now the zero point origin for the relative +cursor position display. The cursor display shows both absolute +position and position relative to the mark as the mouse is moved away +from the mark. If a mark is already present, the mark is removed and +the cursor display stops displaying relative cursor coordinates. + + +File: pcb.info, Node: Vendor drill mapping, Next: Connection Lists, Prev: Measuring distances, Up: Getting Started + +3.17 Vendor Drill Mapping +========================= + +`Pcb' includes support for mapping drill holes to a specified set of +sizes used by a particular vendor. Many PCB manufacturers have a +prefered set of drill sizes and charge extra when others are used. The +mapping can be performed on an existing design and can also be enabled +to automatically map drill holes as vias and elements are instantiated. + + The first step in using the vendor drill mapping feature is to create +a resource file describing the capabilities of your vendor. The file +format is the resource file format described in *note Resource Syntax::. +A complete example is given below. + + # Optional name of the vendor + vendor = "Vendor Name" + + # units for dimensions in this file. + # Allowed values: mil/inch/mm + units = mil + + # drill table + drillmap = { + # When mapping drill sizes, select the nearest size + # or always round up. Allowed values: up/nearest + round = up + + # The list of vendor drill sizes. Units are as specified + # above. + 20 + 28 + 35 + 38 + 42 + 52 + 59.5 + 86 + 125 + 152 + + # optional section for skipping mapping of certain elements + # based on reference designator, value, or description + # this is useful for critical parts where you may not + # want to change the drill size. Note that the strings + # are regular expressions. + skips = { + {refdes "^J3$"} # Skip J3. + {refdes "J3"} # Skip anything with J3 as part of the refdes. + {refdes "^U[1-3]$" "^X.*"} # Skip U1, U2, U3, and anything starting with X. + {value "^JOHNSTECH_.*"} # Skip all Johnstech footprints based on the value of a part. + {descr "^AMP_MICTOR_767054_1$"} # Skip based on the description. + } + } + + # If specified, this section will change the current DRC + # settings for the design. Units are as specified above. + drc = { + copper_space = 7 + copper_width = 7 + silk_width = 10 + copper_overlap = 4 + } + + The vendor resource is loaded using the _LoadVendor_ action. This +is invoked by entering: + :LoadVendor(vendorfile) + from within `Pcb'. Substitute the file name of your vendor resource +file for `vendorfile'. This action will load the vendor resource and +modify all the drill holes in the design as well as the default via +hole size for the various routing styles. + + Once a vendor drill map has been loaded, new vias and elements will +automatically have their drill hole sizes mapped to the vendor drill +table. Automatic drill mapping may be disabled under the "Settings" +menu. To re-apply an already loaded vendor drill table to a design, +choose "Apply vendor drill mapping" from the "Connects" menu. + + See *note Actions:: for a complete description of the actions +associated with vendor drill mapping. + + Note that the expressions used in the `skips' section are regular +expressions. See *note Regular Expressions:: for an introduction to +regular expressions. + + +File: pcb.info, Node: Autorouter, Next: User Commands, Prev: Getting Started, Up: Top + +4 Autorouter +************ + +`Pcb' includes an autorouter which can greatly speed up the layout of a +circuit board. The autorouter is a rectangle-expansion type of +autorouter based on "A Method for Gridless Routing of Printed Circuit +Boards" by A. C. Finch, K. J. Mackenzie, G. J. Balsdon, and G. Symonds +in the 1985 Proceedings of the 22nd ACM/IEEE Design Automation +Conference. This reference is available from the ACM Digital Library at +`http://www.acm.org/dl' for those with institutional or personal access +to it. It's also available from your local engineering library. The +reference paper is not needed for using the autorouter. + + Before using the autorouter, all elements need to be loaded into the +layout and placed and the connectivity netlist must be loaded. Once +the elements have been placed and the netlist loaded, the following +steps will autoroute your design. + + 1. Turn off visibility of any layers that you don't want the router + to use. + + 2. Turn of via visibility if you don't want the router to use any new + vias. + + 3. Use only plain rectangles for power/ground planes that you want + the router to use [use the rectangle tool!] + + 4. Make at least one connection from any plane you want the router to + use to the net you want it to connect to. + + 5. Draw continuous lines (on all routing layers) to outline keep-out + zones if desired. + + 6. Use routing styles in the netlist to have per-net routing styles. + Note that the routing style will be used for an entire net. This + means if you have a wide metal setting for a power net you will + need to manually route breakouts from any fine pitch parts on + their power pins because the router will not be able to change + to a narrow trace to connect to the part. + + 7. Set the current routing style to whatever you'd like the router to + use for any nets not having a defined route style in the netlist. + + 8. Disable any nets that you don't want the autorouter to route + (double-click them in the netlist window to add/remove the *) + + NOTE: If you will be manually routing these later not using + planes, it is usually better to let the autorouter route them then + rip them up yourself afterwards. If you plan to use a + ground/power plane manually, consider making it from one or + more pure rectangles and letting the autorouter have a go at it. + + 9. Create a fresh rat's nest. ('E' the 'W') + + 10. Select "show autorouter trials" in the settings menu if you want + to watch what's happening + + 11. Choose "autoroute all rats" in the connection menu. + + 12. If you really want to muck with the router because you have a + special design, e.g. all through-hole components you can mess with + layer directional costs by editing the autoroute.c source file + and changing the directional costs in lines 929-940. and try + again. Even more mucking about with costs is possible in lines + 4540-4569, but it's probably not such a good idea unless you + really just want to experiment. + + + After the design has been autorouted, you may want to run the trace +optimizer. See section *note Trace Optimizer:: for more information on +the trace optimizer. + + +File: pcb.info, Node: User Commands, Next: Command-Line Options, Prev: Autorouter, Up: Top + +5 User Commands +*************** + +The entering of user-commands is initiated by the action routine +_Command()_ (normally bound to the `(":")' character) which replaces +the bottom statusline with an input area or opens a separate command +window. It is finished by either _Return_ or _Escape_ to +confirm or to abort. These two key-bindings cannot be changed from the +resource file. The triggering event, normally a key press, is ignored. + + Commands can be entered in one of two styles, command entry syntax: +"_Command arg1 arg2_" or action script syntax "_Action1(arg1, arg2); +Action2(arg1, arg2);_". Quoting arguments works similar to bash +quoting: + + * A backslash (\) is the escape character. It preserves the literal + value of the next character that follows. To get a literal '\' use + "\\". + + * Enclosing characters in single quotes preserves the literal value + of each character within the quotes. A single quote may not occur + between single quotes, even when preceded by a blackslash. + + * Enclosing characters in double quotes preserves the literal value + of all characters within the quotes, with the exception of '\' + which maintains its special meaning as an escape character. + + There are simple _usage_ dialogs for each command and one for the +complete set of commands. + +`l [filename]' + Loads a new datafile (layout) and, if confirmed, overwrites any + existing unsaved data. The filename and the searchpath + (_filePath_) are passed to the command defined by _fileCommand_. + If no filename is specified a file select box will popup. + +`le [filename]' + Loads an element description into the paste buffer. The filename + and the searchpath (_elementPath_) are passed to the command + defined by _elementCommand_. If no filename is specified a file + select box will popup. + +`m [filename]' + Loads an layout file into the paste buffer. The filename and the + searchpath (_filePath_) are passed to the command defined by + _fileCommand_. If no filename is specified a file select box will + popup. + +`q[!]' + Quits the program without saving any data (after confirmation). + q! doesn't ask for confirmation, it just quits. + +`s [filename]' + Data and the filename are passed to the command defined by the + resource _saveCommand_. It must read the layout data from _stdin_. + If no filename is entered, either the last one is used again or, + if it is not available, a file select box will pop up. + +`rn [filename]' + Reads in a netlist file. If no filename is given a file select + box will pop up. The file is read via the command defined by the + _RatCommand_ resource. The command must send its output to + _stdout_. + + Netlists are used for generating rat's nests (see *note Rats + Nest::) and for verifying the board layout (which is also + accomplished by the _Ratsnest_ command). + +`w[q] [filename]' + These commands have been added for the convenience of `vi' users + and have the same functionality as _s_ combined with _q_. + +`actionCommand' + Causes the actionCommand to be executed. This allows you to + initiate actions for which no bindings exist in the resource file. + It can be used to initiate any action with whatever arguments you + enter. This makes it possible to do things that otherwise would + be extremely tedious. For example, to change the drilling hole + diameter of all vias in the layout to 32 mils, you could select + everything using the selection menu, then type + "_:ChangeDrillSize(SelectedVias, 32)_". (This will only work + provided the via's diameter is sufficiently large to accommodate a + 32 mil hole). Another example might be to set the grid to 1 mil + by typing "_:SetValue(Grid, 1)_". Note that some actions use the + current cursor location, so be sure to place the cursor where you + want before entering the command. This is one of my favorite new + features in 1.5 and can be a powerful tool. Study the *note + Actions:: section to see what actions are available. + + + +File: pcb.info, Node: Command-Line Options, Next: X11 Interface, Prev: User Commands, Up: Top + +6 Command-Line Options +********************** + +The synopsis of the pcb command is: + + `pcb [OPTION ...] [LAYOUT-FILE.pcb]' to start the application in GUI +mode, + +or + + `pcb [-h | -V | --copyright]' for a list of options, version, and +copyright, + +or + + `pcb -p [OPTION ...] [LAYOUT-FILE.pcb]' to print a layout, + +or + + `pcb -x HID [OPTION ...] [LAYOUT-FILE.pcb]' to export. + +Possible values for the parameter `HID' are: +`bom' + Export a bill of materials + +`gcode' + Export to G-Code + +`gerber' + Export RS-274X (Gerber) + +`nelma' + Numerical analysis package export + +`png' + export GIF/JPEG/PNG + +`ps' + export postscript + +`eps' + export encapsulated postscript + +There are several resources which may be set or reset in addition to the +standard toolkit command-line options. For a complete list refer to +*note Resources::. + +* Menu: + +* General Options:: +* General GUI Options:: +* GTK+ GUI Options:: +* lesstif GUI Options:: +* Colors:: +* Layer Names:: +* Paths:: +* Sizes:: +* Commands:: +* DRC Options:: +* BOM Creation:: +* Gerber Export:: +* Postscript Export:: +* Encapsulated Postscript Export:: +* PNG Options:: +* lpr Printing Options:: +* nelma Options:: + + +File: pcb.info, Node: General Options, Next: General GUI Options, Up: Command-Line Options + +6.1 General Options +=================== + +`--help' + Show help on command line options. + +`--version' + Show version. + +`--verbose' + Be verbose on stdout. + +`--copyright' + Show copyright. + +`--show-defaults' + Show option defaults. + +`--show-actions' + Show available actions and exit. + +`--dump-actions' + Dump actions (for documentation). + +`--grid-units-mm ' + Set default grid units. Can be mm or mil. Defaults to mil. + +`--backup-interval' + Time between automatic backups in seconds. Set to `0' to disable. + The default value is `60'. + +`--groups ' + Layer group string. Defaults to `"1,c:2:3:4:5:6,s:7:8"'. + +`--route-styles ' + A string that defines the route styles. Defaults to + `"Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000 + :Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600"' + +`--element-path ' + A colon separated list of directories or commands (starts with + '|'). The path is passed to the program specified in + `--element-command'. + +`--action-script ' + If set, this file is executed at startup. + +`--action-string ' + If set, this string of actions is executed at startup. + +`--fab-author ' + Name of author to be put in the Gerber files. + +`--layer-stack ' + Initial layer stackup, for setting up an export. A comma separated + list of layer names, layer numbers and layer groups. + +`--save-last-command' + If set, the last user command is saved. + +`--save-in-tmp' + If set, all data which would otherwise be lost are saved in a + temporary file `/tmp/PCB.%i.save' . Sequence `%i' is replaced by + the process ID. + +`--reset-after-element' + If set, all found connections are reset before a new component is + scanned. + +`--ring-bell-finished' + Execute the bell command when all rats are routed. + + +File: pcb.info, Node: General GUI Options, Next: GTK+ GUI Options, Prev: General Options, Up: Command-Line Options + +6.2 General GUI Options +======================= + +`--pinout-offset-x ' + Horizontal offset of the pin number display. Defaults to `100mil'. + +`--pinout-offset-y ' + Vertical offset of the pin number display. Defaults to `100mil'. + +`--pinout-text-offset-x ' + Horizontal offset of the pin name display. Defaults to `800mil'. + +`--pinout-text-offset-y ' + Vertical offset of the pin name display. Defaults to `-100mil'. + +`--draw-grid' + If set, draw the grid at start-up. + +`--clear-line' + If set, new lines clear polygons. + +`--full-poly' + If set, new polygons are full ones. + +`--unique-names' + If set, you will not be permitted to change the name of an + component to match that of another component. + +`--snap-pin' + If set, pin centers and pad end points are treated as additional + grid points that the cursor can snap to. + +`--all-direction-lines' + Allow all directions, when drawing new lines. + +`--show-number' + Pinout shows number. + + +File: pcb.info, Node: GTK+ GUI Options, Next: lesstif GUI Options, Prev: General GUI Options, Up: Command-Line Options + +6.3 GTK+ GUI Options +==================== + +`--listen' + Listen for actions on stdin. + +`--bg-image ' + File name of an image to put into the background of the GUI + canvas. The image must be a color PPM image, in binary (not ASCII) + format. It can be any size, and will be automatically scaled to + fit the canvas. + +`--pcb-menu ' + Location of the `gpcb-menu.res' file which defines the menu for + the GTK+ GUI. + + +File: pcb.info, Node: lesstif GUI Options, Next: Colors, Prev: GTK+ GUI Options, Up: Command-Line Options + +6.4 lesstif GUI Options +======================= + +`--listen' + Listen for actions on stdin. + +`--bg-image ' + File name of an image to put into the background of the GUI + canvas. The image must be a color PPM image, in binary (not ASCII) + format. It can be any size, and will be automatically scaled to + fit the canvas. + +`--pcb-menu ' + Location of the `pcb-menu.res' file which defines the menu for the + lesstif GUI. + + +File: pcb.info, Node: Colors, Next: Layer Names, Prev: lesstif GUI Options, Up: Command-Line Options + +6.5 Colors +========== + +`--black-color ' + Color value for black. Default: `#000000' + +`--black-color ' + Color value for white. Default: `#ffffff' + +`--background-color ' + Background color of the canvas. Default: `#e5e5e5' + +`--crosshair-color ' + Color of the crosshair. Default: `#ff0000' + +`--cross-color ' + Color of the cross. Default: `#cdcd00' + +`--via-color ' + Color of vias. Default: `#7f7f7f' + +`--via-selected-color ' + Color of selected vias. Default: `#00ffff' + +`--pin-color ' + Color of pins. Default: `#4d4d4d' + +`--pin-selected-color ' + Color of selected pins. Default: `#00ffff' + +`--pin-name-color ' + Color of pin names and pin numbers. Default: `#ff0000' + +`--element-color ' + Color of components. Default: `#000000' + +`--rat-color ' + Color of ratlines. Default: `#b8860b' + +`--invisible-objects-color ' + Color of invisible objects. Default: `#cccccc' + +`--invisible-mark-color ' + Color of invisible marks. Default: `#cccccc' + +`--element-selected-color ' + Color of selected components. Default: `#00ffff' + +`--rat-selected-color ' + Color of selected rats. Default: `#00ffff' + +`--connected-color ' + Color to indicate connections. Default: `#00ff00' + +`--off-limit-color ' + Color of off-canvas area. Default: `#cccccc' + +`--grid-color ' + Color of the grid. Default: `#ff0000' + +`--layer-color- ' + Color of layer `', where `' is an integer from 1 to 16. + +`--layer-selected-color- ' + Color of layer `', when selected. `' is an integer from 1 to + 16. + +`--warn-color ' + Color of offending objects during DRC. Default value is `"#ff8000"' + +`--mask-color ' + Color of the mask layer. Default value is `"#ff0000"' + + +File: pcb.info, Node: Layer Names, Next: Paths, Prev: Colors, Up: Command-Line Options + +6.6 Layer Names +=============== + +`--layer-name-1 ' + Name of the 1st Layer. Default is `"top"'. + +`--layer-name-2 ' + Name of the 2nd Layer. Default is `"ground"'. + +`--layer-name-3 ' + Name of the 3nd Layer. Default is `"signal2"'. + +`--layer-name-4 ' + Name of the 4rd Layer. Default is `"signal3"'. + +`--layer-name-5 ' + Name of the 5rd Layer. Default is `"power"'. + +`--layer-name-6 ' + Name of the 6rd Layer. Default is `"bottom"'. + +`--layer-name-7 ' + Name of the 7rd Layer. Default is `"outline"'. + +`--layer-name-8 ' + Name of the 8rd Layer. Default is `"spare"'. + + +File: pcb.info, Node: Paths, Next: Sizes, Prev: Layer Names, Up: Command-Line Options + +6.7 Paths +========= + +`--lib-newlib ' + Top level directory for the newlib style library. + +`--lib-name ' + The default filename for the library. + +`--default-font ' + The name of the default font. + +`--file-path ' + A colon separated list of directories or commands (starts with + '|'). The path is passed to the program specified in + `--file-command' together with the selected filename. + +`--font-path ' + A colon separated list of directories to search the default font. + Defaults to the default library path. + +`--lib-path ' + A colon separated list of directories that will be passed to the + commands specified by `--element-command' and + `--element-contents-command'. + + +File: pcb.info, Node: Sizes, Next: Commands, Prev: Paths, Up: Command-Line Options + +6.8 Sizes +========= + +All parameters should be given with an unit. If no unit is given, 1/100 +mil (cmil) will be used. Write units without space to the number like +`3mm', not `3 mm'. Valid Units are: +`km' + Kilometer + +`m' + Meter + +`cm' + Centimeter + +`mm' + Millimeter + +`um' + Micrometer + +`nm' + Nanometer + +`in' + Inch (1in = 0.0254m) + +`mil' + Mil (1000mil = 1in) + +`cmil' + Centimil (1/100 mil) + +`--via-thickness ' + Default diameter of vias. Default value is `60mil'. + +`--via-drilling-hole ' + Default diameter of holes. Default value is `28mil'. + +`--line-thickness ' + Default thickness of new lines. Default value is `10mil'. + +`--rat-thickness ' + Thickness of rats. Values from 1 to 19 are fixed width in screen + pixels. Anything larger means PCB units (i.e. 100 means "1 mil"). + Default value is `10mil'. + +`--keepaway ' + Default minimum distance between a track and adjacent copper. + Default value is `10mil'. + +`--default-PCB-width ' + Default width of the canvas. Default value is `6000mil'. + +`--default-PCB-height ' + Default height of the canvas. Default value is `5000mil'. + +`--text-scale ' + Default text scale. This value is in percent. Default value is + `100'. + +`--alignment-distance ' + Specifies the distance between the board outline and alignment + targets. Default value is `2mil'. + +`--grid ' + Initial grid size. Default value is `10mil'. + +`--minimum polygon area ' + Minimum polygon area. + + +File: pcb.info, Node: Commands, Next: DRC Options, Prev: Sizes, Up: Command-Line Options + +6.9 Commands +============ + +pcb uses external commands for input output operations. These commands +can be configured at start-up to meet local requirements. The command +string may include special sequences `%f', `%p' or `%a'. These are +replaced when the command is called. The sequence `%f' is replaced by +the file name, `%p' gets the path and `%a' indicates a package name. +`--font-command ' + Command to load a font. + +`--file-command ' + Command to read a file. + +`--element-command ' + Command to read a footprint. + Defaults to `"M4PATH='%p';export M4PATH;echo 'include(%f)' | m4"' + +`--print-file ' + Command to print to a file. + +`--lib-command-dir ' + Path to the command that queries the library. + +`--lib-command ' + Command to query the library. + Defaults to `"QueryLibrary.sh '%p' '%f' %a"' + +`--lib-contents-command ' + Command to query the contents of the library. + Defaults to `"ListLibraryContents.sh %p %f"' or, on Windows + builds, an empty string (to disable this feature). + +`--save-command ' + Command to save to a file. + +`--rat-command ' + Command for reading a netlist. Sequence `%f' is replaced by the + netlist filename. + + +File: pcb.info, Node: DRC Options, Next: BOM Creation, Prev: Commands, Up: Command-Line Options + +6.10 DRC Options +================ + +All parameters should be given with an unit. If no unit is given, 1/100 +mil (cmil) will be used for backward compability. Valid units are given +in section *note Sizes::. +`--bloat ' + Minimum spacing. Default value is `10mil'. + +`--shrink ' + Minimum touching overlap. Default value is `10mil'. + +`--min-width ' + Minimum width of copper. Default value is `10mil'. + +`--min-silk ' + Minimum width of lines in silk. Default value is `10mil'. + +`--min-drill ' + Minimum diameter of holes. Default value is `15mil'. + +`--min-ring ' + Minimum width of annular ring. Default value is `10mil'. + + +File: pcb.info, Node: BOM Creation, Next: Gerber Export, Prev: DRC Options, Up: Command-Line Options + +6.11 BOM Creation +================= + +`--bomfile ' + Name of the BOM output file. + +`--xyfile ' + Name of the XY output file. + +`--xy-unit ' + Unit of XY dimensions. Defaults to mil. + + +File: pcb.info, Node: Gerber Export, Next: Postscript Export, Prev: BOM Creation, Up: Command-Line Options + +6.12 Gerber Export +================== + +`--gerberfile ' + Gerber output file prefix. Can include a path. + +`--all-layers' + Output contains all layers, even empty ones. + +`--verbose' + Print file names and aperture counts on stdout. + + +File: pcb.info, Node: Postscript Export, Next: Encapsulated Postscript Export, Prev: Gerber Export, Up: Command-Line Options + +6.13 Postscript Export +====================== + +`--psfile ' + Name of the postscript output file. Can contain a path. + +`--drill-helper' + Print a centering target in large drill holes. + +`--align-marks' + Print alignment marks on each sheet. This is meant to ease + alignment during exposure. + +`--outline' + Print the contents of the outline layer on each sheet. + +`--mirror' + Print mirror image. + +`--fill-page' + Scale output to make the board fit the page. + +`--auto-mirror' + Print mirror image of appropriate layers. + +`--ps-color' + Postscript output in color. + +`--ps-bloat ' + Amount to add to trace/pad/pin edges. + +`--ps-invert' + Draw objects as white-on-black. + +`--media ' + Size of the media, the postscript is fitted to. The parameter + `' can be any of the standard names for paper size: + `A0' to `A10', `B0' to `B10', `Letter', `11x17', `Ledger', + `Legal', `Executive', `A-Size', `B-size', `C-Size', `D-size', + `E-size', `US-Business_Card', `Intl-Business_Card'. + +`--psfade ' + Fade amount for assembly drawings (0.0=missing, 1.0=solid). + +`--scale ' + Scale value to compensate for printer sizing errors (1.0 = full + scale). + +`--multi-file' + Produce multiple files, one per page, instead of a single multi + page file. + +`--xcalib ' + Paper width. Used for x-Axis calibration. + +`--ycalib ' + Paper height. Used for y-Axis calibration. + +`--drill-copper' + Draw drill holes in pins / vias, instead of leaving solid copper. + +`--show-legend' + Print file name and scale on printout. + + +File: pcb.info, Node: Encapsulated Postscript Export, Next: PNG Options, Prev: Postscript Export, Up: Command-Line Options + +6.14 Encapsulated Postscript Export +=================================== + +`--eps-file ' + Name of the encapsulated postscript output file. Can contain a + path. + +`--eps-scale ' + Scale EPS output by the parameter `num'. + +`--as-shown' + Export layers as shown on screen. + +`--monochrome' + Convert output to monochrome. + +`--only-visible' + Limit the bounds of the EPS file to the visible items. + + +File: pcb.info, Node: PNG Options, Next: lpr Printing Options, Prev: Encapsulated Postscript Export, Up: Command-Line Options + +6.15 PNG Options +================ + +`--outfile ' + Name of the file to be exported to. Can contain a path. + +`--dpi' + Scale factor in pixels/inch. Set to 0 to scale to size specified + in the layout. + +`--x-max' + Width of the png image in pixels. No constraint, when set to 0. + +`--y-max' + Height of the png output in pixels. No constraint, when set to 0. + +`--xy-max' + Maximum width and height of the PNG output in pixels. No + constraint, when set to 0. + +`--as-shown' + Export layers as shown on screen. + +`--monochrome' + Convert output to monochrome. + +`--only-vivible' + Limit the bounds of the exported PNG image to the visible items. + +`--use-alpha' + Make the background and any holes transparent. + +`--format ' + File format to be exported. Parameter `' can be `PNG', + `GIF', or `JPEG'. + +`--png-bloat ' + Amount of extra thickness to add to traces, pads, or pin edges. + The parameter `' is a number, appended by a dimension + `mm', `mil', or `pix'. If no dimension is given, the default + dimension is 1/100 mil. + +`--photo-mode' + Export a photo realistic image of the layout. + +`--photo-flip-x' + In photo-realistic mode, export the reverse side of the layout. + Left-right flip. + +`--photo-flip-y' + In photo-realistic mode, export the reverse side of the layout. + Up-down flip. + + +File: pcb.info, Node: lpr Printing Options, Next: nelma Options, Prev: PNG Options, Up: Command-Line Options + +6.16 lpr Printing Options +========================= + +`--lprcommand ' + Command to use for printing. Defaults to `lpr'. This can be used + to produce PDF output with a virtual PDF printer. Example: + `--lprcommand "lp -d CUPS-PDF-Printer"'. +In addition, all *note Postscript Export:: options are valid. + + +File: pcb.info, Node: nelma Options, Prev: lpr Printing Options, Up: Command-Line Options + +6.17 nelma Options +================== + +`-- basename ' + File name prefix. + +`--dpi ' + Horizontal scale factor (grid points/inch). + +`--copper-height ' + Copper layer height (um). + +`--substrate-height ' + Substrate layer height (um). + +`--substrate-epsilon ' + Substrate relative epsilon. + + +File: pcb.info, Node: X11 Interface, Next: File Formats, Prev: Command-Line Options, Up: Top + +7 X11 Interface +*************** + +This chapter gives an overview about the additional `X11' resources +which are defined by `Pcb' as well as the defined action routines. + +* Menu: + +* Resources:: Non-standard `X11' application resources. +* Actions:: A list of available action routines. +* Translations:: A list of the default key translations (as shipped). + + +File: pcb.info, Node: Resources, Next: Actions, Up: X11 Interface + +7.1 Non-Standard X11 Application Resources +========================================== + +In addition to the toolkit resources, `Pcb' defines the following +resources: + +`absoluteGrid (boolean)' + Selects if either the grid is relative to the position where it + has changed last or absolute, the default, to the origin (0,0). + +`alignmentDistance (dimension)' + Specifies the distance between the boards outline to the alignment + targets. + +`allDirectionLines (boolean)' + Enables (default) or disables clipping of new lines to 45 degree + angles. + +`backgroundImage (string)' + If specified, this image will be drawn as the background for the + board. The purpose of this option is to allow you to use a scan + of an existing layout as a prototype for your new layout. To do + this, there are some limitations as to what this image must be. + The image must be a PPM binary image (magic number `P6'). It must + have a maximum pixel value of 255 or less (i.e. no 16-bit images). + It must represent the entire board, as it will be scaled to fit + the board dimensions exactly. Note that it may be scaled unevenly + if the image doesn't have the same aspect ratio of your board. + You must ensure that the image does not use more colors than are + available on your system (mostly this is for pseudo-color + displays, like old 8-bit displays). For best results, I suggest + the following procedure using The Gimp: Load your image (any + type). Image->Scale if needed. Image->Colors->Curves and for + each of Red, Green, and Blue channel move the lower left point up + to about the 3/4 line (value 192). This will make your image pale + so it doesn't interfere with the traces you'll be adding. + Image->Mode->Indexed and select, say, 32 colors with Normal F-S + dithering. File->Save As, file type by extension, use `.ppm' as + the extension. Select Raw formatting. + +`backupInterval (int)' + `Pcb' has an automatic backup feature which saves the current data + every n seconds. The default is _300_ seconds. A value of zero + disables the feature. The backup file is named + `/tmp/PCB.%i.backup' by default (this may have been changed at + compilation time via the `BACKUP_NAME' variable in + `globalconfig.h'). _%i_ is replaced by the process ID. See also, + the command-line option _-backup-interval_. + +`Bloat (dimension)' + Specifies the minimum spacing design rule in mils. + +`connectedColor (color)' + All pins, vias, lines and rectangles which are selected during a + connection search are drawn with this color. The default value is + determined by _XtDefaultForeground_. + +`cross hairColor (color)' + This color is used to draw the cross hair cursor. The color is a + result of a _XOR_ operation with the contents of the Layout area. + The result also depends on the default colormap of the `X11' + server because only the colormap index is used in the boolean + operation and `Pcb' doesn't create its own colormap. The default + setting is _XtDefaultForeground_. + +`elementColor (color)' +`elementSelectedColor (color)' + The elements package part is drawn in these colors, for normal and + selected mode, respectively, which both default to + _XtDefaultForeground_. + +`elementCommand (string)' + `Pcb' uses a user defined command to read element files. This + resources is used to set the command which is executed by the + users default shell. Two escape sequences are defined to pass the + selected filename (%f) and the current search path (%p). The + command must write the element data to its standard output. The + default value is + M4PATH="%p";export M4PATH;echo 'include(%f)' | m4 + Using the GNU version of `m4' is highly recommended. See also, + the command-line option _-element-command_. + +`elementPath (string)' + A colon separated list of directories or commands (starts with + '|'). The path is passed to the program specified in + _elementCommand_ together with the selected element name. A + specified command will be executed in order to create entries for + the fileselect box. It must write its results to _stdout_ one + entry per line. See also, the user-command _le[!]_. + +`fileCommand (string)' + The command is executed by the user's default shell whenever + existing layout files are loaded. Data is read from the command's + standard output. Two escape sequences may be specified to pass + the selected filename (%f) and the current search path (%p). The + default value is: + cat %f + See also, the command-line option _-file-command_. + +`filePath (string)' + A colon separated list of directories or commands (starts with + '|'). The path is passed to the program specified in + _fileCommand_ together with the selected filename. A specified + command will be executed in order to create entries for the + fileselect box. It must write its results to _stdout_ one entry + per line. See also, the user-command _l[!]_. + +`fontCommand (string)' + Loading new symbol sets also is handled by an external command. + You again may pass the selected filename and the current search + path by passing %f and %p in the command string. Data is read from + the commands standard output. This command defaults to + cat %f + See also, the command-line option _-font-command_. + +`fontFile (string)' + The default font for new layouts is read from this file which is + searched in the directories as defined by the resource _fontPath_. + Searching is only performed if the filename does not contain a + directory component. The default filename is `default_font'. + +`fontPath (string)' + This resource, a colon separated list of directories, defines the + searchpath for font files. See also, the resource _fontFile_. + +`grid (int)' + This resources defines the initial value of one cursor step. It + defaults to _100 mil_ and any changes are saved together with the + layout data. + +`gridColor (color)' + This color is used to draw the grid. The color is a result of a + _INVERT_ operation with the contents of the Layout area. The result + also depends on the default colormap of the `X11' server because + only the colormap index is used in the boolean operation and `Pcb' + doesn't create its own colormap. The default setting is + _XtDefaultForeground_. + +`invisibleObjectsColor (color)' + Elements located on the opposite side of the board are drawn in + this color. The default is _XtDefaultForeground_. + +`layerColor1..MAX_LAYER (color)' +`layerSelectedColor1..MAX_LAYER (color)' + These resources define the drawing colors of the different layers + in normal and selected state. All values are preset to + _XtDefaultForeground_. + +`layerGroups (string)' + The argument to this resource is a colon separated list of comma + separated layer numbers (1..MAX_LAYER). All layers within one + group are switched on/off together. The default setting is + _1:2:3:...:MAX_LAYER_ which means all layers are handled + separately. Grouping layers one to three looks like + _1,2,3:4:...:MAX_LAYER_ + +`layerName1..MAX_LAYER (string)' + The default name of the layers in a new layout are determined by + these resources. The defaults are empty strings. + +`libraryCommand (string)' + `Pcb' uses a command to read element data from libraries. The + resources is used to set the command which is executed by the users + default shell. Three escape sequences are defined to pass the + selected filename (%f), the current search path (%p) as well (%a) + as the three parameters _template_, _value_ and _package_ to the + command. It must write the element data to its standard output. + The default value is + NONE/share/pcb/oldlib/QueryLibrary.sh %p %f %a + +`libraryContentsCommand (string)' + Similar to _libraryCommand_, `Pcb' uses the command specified by + this resource to list the contents of a library. + NONE/share/pcb/oldlib/ListLibraryContents.sh %p %f + is the default. + +`libraryFilename (string)' + The resource specifies the name of the library. The default value + is _pcblib_ unless changed at compile time with the + `LIBRARYFILENAME' variable in `globalconfig.h'. + +`libraryPath (string)' + A colon separated list of directories that will be passed to the + commands specified by _elementCommand_ and + _elementContentsCommand_. + +`lineThickness (dimension)' + The value, in the range [1..250] (the range may be changed at + compile time with the `MIN_LINESIZE' and `MAX_LINESIZE' variables + in `globalconfig.h'), defines the initial thickness of new lines. + The value is preset to _ten mil_. + +`media ( | x+-+-)' + The default (user defined) media of the `PostScript' device. + Predefined values are _a3_, _a4_, _a5_, _letter_, _tabloit_, + _ledger_, _legal_, and _executive_. The second way is to specify + the medias width, height and margins in mil. The resource + defaults to _a4_ size unless changed at compile time with the + `DEFAULT_MEDIASIZE' variable in `globalconfig.h'. + +`offLimitColor (color)' + The area outside the current maximum settings for width and height + is drawn with this color. The default value is determined by + _XtDefaultBackground_. + +`pinColor (color)' +`pinSelectedColor(color)' + This resource defines the drawing color of pins and pads in both + states. The values are preset to _XtDefaultForeground_. + +`pinoutFont (string)' + This fonts are used to display pin names. There is one font for + each zoom value. The values are preset to _XtdefaultFont_. + +`pinoutNameLength (int)' + This resource limits the number of characters which are displayed + for pin names in the pinout window. By default the string length + is limited to _eight_ characters per name. + +`pinoutOffsetX (int)' +`pinoutOffsetY (int)' + These resources determine the offset in _mil_ of the circuit from + the upper left corner of the window when displaying pinout + information. Both default to _100 mil_. + +`pinoutTextOffsetX (int)' +`pinoutTextOffsetY (int)' + The resources determine the distance in mil between the drilling + hole of a pin to the location where its name is displayed in the + pinout window. They default to _X:50_ and _Y:0_. + +`pinoutZoom (int)' + Sets the zoom factor for the pinout window according to the + formula: scale = 1:(2 power value). Its default value is _two_ + which results in a _1:4_ scale. + +`printCommand (string)' + Default file for printouts. If the name starts with a '|' the + output is piped through the command. A %f is replaced by the + current filename. There is no default file or command. + +`raiseLogWindow (boolean)' + The log window will be raised when new messages arrive if this + resource is set _true_, the default. + +`ratCommand (string)' + Default command for reading a netlist. A %f is replaced by the + netlist filename. Its default value is "_cat %f_". + +`ratPath (string)' + Default path to look for netlist files. It's default value is "." + +`resetAfterElement (boolean)' + If set to _true_, all found connections will be reset before a new + element is scanned. This will produce long lists when scanning the + whole layout for connections. The resource is set to _false_ by + default. The feature is only used while looking up connections of + all elements. + +`ringBellWhenFinished (boolean)' + Whether to ring the bell (the default) when a possibly lengthy + operation has finished or not. See also, the command-line option + _-ring-bell-finished_. + +`routeStyle (string)' + Default values for the menu of routing styles (seen in the sizes + menu). The string is a comma separated list of name, line + thickness, via diameter, and via drill size. e.g. + "Fat,50,100,40:Skinny,8,35,20:75Ohm,110,110,20" See also, the + command-line option _-route-styles_ and _Sizes Menu_ + +`rubberBandMode (boolean)' + Whether rubberband move and rotate (attached lines stretch like + rubberbands) is enabled (the default). + +`saveCommand (string)' + This command is used to save data to a layout file. The filename + may be indicated by placing `%f' in the string. It must read the + data from its standard input. The default command is: + cat - > %f + See also, the command-line option _-save-command_. + +`saveInTMP (boolean)' + Enabling this resource will save all data which would otherwise be + lost in a temporary file `/tmp/PCB.%i.save'. The file name may be + changed at compile time with the `EMERGENCY_NAME' variable in + `globalconfig.h'. . _%i_ is replaced by the process ID. As an + example, loading a new layout when the old one hasn't been saved + would use this resource. See also, the command-line option + _-save-in-tmp_. + +`saveLastCommand (boolean)' + Enables the saving of the last entered user command. The option is + _disabled_ by default. See also, the command-line option + _-save-last-command_. + +`Shrink (dimension)' + Specifies the minimum overlap (touching) design rule in mils. + +`size (x)' + Defines the width and height of a new layout. The default is + _7000x5000_ unless changed at compile time with the `DEFAULT_SIZE' + variable in `globalconfig.h'. + +`stipllePolygons (boolean)' + Determines whether to display polygons on the screen with a + stippled pattern. Stippling can create some amount of + transparency so that you can still (to some extent) see layers + beneath polygons. It defaults to False. + +`textScale (dimension)' + The font scaling in percent is defined by this resource. The + default is _100_ percent. + +`useLogWindow (boolean)' + Several subroutines send messages to the user if an error occurs. + This resource determines if they appear inside the log window or + as a separate dialog box. See also, the resource _raiseLogWindow_ + and the command line option _-loggeometry_. The default value is + _true_. + +`viaColor (color)' + +`viaSelectedColor (color)' + This resource defines the drawing color of vias in both states. + The values are preset to _XtDefaultForeground_. + +`viaThickness (dimension)' +`viaDrillingHole (dimension)' + The initial thickness and drilling hole of new vias. The values + must be in the range [30..400] (the range may be changed at compile + time with the `MIN_PINORVIASIZE' and `MAX_PINEORVIASIZE' variables + in `globalconfig.h'), with at least 20 mil of copper. The default + thickness is _40 mil_ and the default drilling hole is _20 mil_. + +`volume (int)' + The value is passed to `XBell()' which sets the volume of the `X' + speaker. The value lies in the range -100..100 and it defaults to + the maximum volume of _100_. + +`warnColor (color)' + This resources defines the color to be used for drawing pins and + pads when a warning has been issued about them. + +`zoom (int)' + The initial value for output scaling is set according to the + following formula: scale = 1:(2 power value). It defaults to + _three_ which results in an output scale of _1:8_. + + + Refer also to *note Command-Line Options::. + + +File: pcb.info, Node: Actions, Next: Translations, Prev: Resources, Up: X11 Interface + +7.2 Actions +=========== + +All user accessible commands may be bound to almost any `X' event. +Almost no default binding for commands is done in the binaries, so it +is vital for the application that at least a system-wide application +resource file exists. This file normally resides in the `share/pcb' +directory and is called `Pcb'. The bindings to which the manual refers +to are the ones as defined by the shipped resource file. Besides +binding an action to an X11 event, you can also execute any action +command using a ":" command (see *note User Commands::). + + Take special care about translations related to the functions keys +and the pointer buttons because most of the window managers use them +too. Change the file according to your hardware/software environment. +You may have to replace all occurances of _baseTranslations_ to +_translations_ if you use a `X11R4' server. + + Passing _Object_ as an argument to an action routine causes the +object at the cursor location to be changed, removed or whatever. If +more than one object is located at the cross hair position the smallest +type is used. If there are two of the same type the newer one is taken. +_SelectedObjects_ will handle all selected and visible objects. + +`AddRats(AllRats|SelectedRats)' + Adds rat-lines to the layout using the loaded netlist file (see + the _:rn_, *note User Commands::.). Rat lines are added on the + active layer using the current line thickness shown in the status + line. Only missing connectivity is added by the AddRats command + so if, for example, the layout is complete nothing will be added. + Rat lines may be drawn different to other lines on the screen to + make them easier to identify since they cannot appear in a + completed layout. The rat-lines are added in the minimum length + straight-line tree pattern (always ending on pins or pads) that + satisfies the missing connectivity in the circuit. If a SMD pad + is unreachable on the active layer, a warning will be issued about + it and the rat-line to that pad will not be generated. If + connections exist on the board which are not listed in the netlist + while AllRats are being added, warning messages will be issued and + the affected pins and pads will be drawn in a special _warnColor_ + until the next _Notify()_ event. If the entire layout agrees + completely with the net-list a message informs you that the layout + is complete and no rat-lines are added (since none are needed). + If _SelectedRats_ is passed as the argument, only those missing + connections that might connect among the selected pins and pads + are drawn. Default: + Nonew: AddRats(AllRats) + !Shiftw: AddRats(SelectedRats) + Noneo: DeleteRats(AllRats) AddRats(AllRats) + !Shifto: DeleteRats(SelectedRats) AddRats(SelectedRats) + +`ApplyVendor()' + Applies an already loaded vendor drill map to the design. + ApplyVendor() + +`Atomic(Save|Restore|Block|Close)' + Controls the undo grouping of sequences of actions. Before the + first action in a group, Atomic(Save) should be issued. After + each action that might be undoable, Atomic(Restore) should be + issued. Atomic(Block) concludes and save the undo grouping if + there was anything in the group to undo. Atomic(Close) concludes + and save the undo grouping even if nothing was actually done. + Thus it might produce an "empty" undo. This can be useful when + you want to use undo in a group of actions. + +`Bell([-100..100])' + Rings the bell of your display. If no value is passed the setting + of the resource _volume_ will be used. + +`ChangeClearSize(Object, value[, unit])' +`ChangeClearSize(SelectedPins|SelectedVias, value[, unit])' + The effect of this action depends on if the soldermask display is + presently turned on or off. If soldermask is displayed, then the + soldermask relief size will be changed. If soldermask display is + turned off, then the clearance to polygons will be changed. + _unit_ is "mil" or "mm". If not specified the units will default + to the internal unit of 0.01 mil. + !Mod1k: ChangeClearSize(Object, +2, mil) + !Mod1 Shiftk: ChangeClearSize(Object, -2, mil) + +`ChangeDrillSize(Object, value[, unit])' +`ChangeDrillSize(SelectedPins|SelectedVias, value[, unit])' + This action routine changes the drilling hole of pins and vias. + If _value_ starts with + or -, then it adds (or subtracts) _value_ + from the current hole diameter, otherwise it sets the diameter to + the value. _unit_ is "mil" or "mm". If not specified the units + will default to the internal unit of 0.01 mil. Default: + !Mod1s: Change2ndSize(Object, +5, mil) + !Mod1 Shifts: Change2ndSize(Object, -5, mil) + +`ChangeFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square,0|1)' + Sets/clears the indicated flag. This adds/removes thermals, + adds/removes the flag which indicates a pin/pad should be square, + or adds/removes the flag which indicates a pin/pad should be + octagonal. + :ChangeFlag(SelectedVias,thermal,1) + :ChangeFlag(SelectedPads,square,0) + +`ChangeHole(Object|SelectedVias)' + This action routine converts a via to and from a hole. A hole is + a via that has no copper annulus. The drill size for the via + determines the hole diameter. + !Ctrlh: ChangeHole(Object) + +`ChangeName(Object)' +`ChangeName(Layer|Layout)' + Changes the name of the visible object at the cursor location. A + text object doesn't have a name therefore the text string itself + is changed. The element name currently used for display is always + the one changed with this command. See + _Display(Description|NameOnPCB|Value)_ for details. Passing + _Layer_ changes the current layers name. Default: + Nonen: ChangeName(Object) + +`ChangeOctagon(Object|SelectElements|SelectedPins|SelectedVias|Selected)' + Toggles what shape the affected pin(s) or via(s) will be drawn + when they are not square. The shape will either be round or + octagonal. Default: + !Ctrlo: ChangeOctagon(Object) + +`ChangePinName(ElementName, PinNumber, PinName)' + Changes the name for a specified pin or pad number on a specified + element. This action is typically used to forward annotate + pin/pad names from a schematic to the layout. + ChangePinName(U1, 14, VDD) + +`ChangeSize(Object, value[, unit])' +`ChangeSize(SelectedLines|SelectedPins|SelectedVias, value[, unit])' +`ChangeSize(SelectedPads|SelectedTexts|SelectedNames, value[, unit])' +`ChangeSize(SelectedElements, value[, unit])' + To change the size of an object you have to bind these action to + some `X' event (or use :ChangeSize(...)). If _value_ begins with + a + or - then the value will be added (or subtracted) from the + current size, otherwise the size is set equal to _value_. Range + checking is done to insure that none of the maximum/minimums of + any size are violated. If _Object_ is passed then a single object + at the cursor location is changed. If any of the _Selected_ + arguments are passed then all selected and visible objects of that + type are changed. If the type being modified is an element, then + the thickness of the silkscreen lines defining the element is + changed. _unit_ is "mil" or "mm". If not specified the units + will default to the internal unit of 0.01 mil. Default: + Nones: ChangeSize(Object, +5) + !Shifts: ChangeSize(Object, -5) + +`ChangeSquare(Object|SelectedElements|SelectedPins)' + Toggles the setting of the square flag. The flag is used to + identify a certain pin, normally the first one, of circuits. It is + also used to make SMD pads have square ends. + Noneq: ChangeSquare(Object) + +`ClrFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square)' + Clears the indicated flag. This removes thermals, removes the flag + which indicates a pin/pad should be square, or removes the flag + which indicates a pin/pad should be octagonal. + :ClrFlag(SelectedVias,thermal) + +`Command()' + Calling _Command()_ pops up an input line at the bottom of the + window which allows you to enter commands. Including all action + commands! The dialog ends when _NoneReturn_ to confirm or + _NoneEscape_ to abort is entered. Default: + colon: Command() + +`Connection(Find)' +`Connection(ResetFoundLinesAndRectangles|ResetPinsViasAndPads|Reset)' + The _Connection()_ action is used to mark all connections from one + pin, line or via to others. The _ResetFoundLinesAndRectangles, + ResetFoundPinsAndVias_ and _Reset_ arguments may be used to reset + all marked lines and rectangles, vias and pins or all of them. The + search starts with the pin or via at the cursor position. All + found objects are drawn with the color defined by the resource + _connectedColor_. See also, + _Display(Description|NameOnPCB|Value)_. Default: + !Shiftc: Connection(Reset) + Nonef: Connection(Find) + !Shiftf: Connection(Reset) + +`DeleteRats(AllRats|SelectedRats)' + This routine deletes either all rat-lines in the layout, or only + the selected and visible ones. Non-rat-lines and other layout + objects are unaffected. Default: + Nonee: DeleteRats(AllRats) + !Shifte: DeleteRats(SelectedRats) + +`DisableVendor()' + Disables automatic drill size mapping to the loaded vendor drill + table. + DisableVendor() + +`DisperseElements(All|Selected)' + Disperses either all elements or only the selected elements in the + layout. This action should be used at the start of a design to + spread out all footprints before any placement or routing is done. + DisperseElements(All) + +`Display(Description|NameOnPCB|Value)' +`Display(Toggle45Degree|CycleClip)' +`Display(Grid|ToggleGrid)' +`Display(ToggleRubberBandMode)' +`Display(Center|ClearAndRedraw|Redraw)' +`Display(Pinout|PinOrPadName)' + This action routines handles some output related settings. It is + used to center the display around the cursor location and to + redraw the output area optionally after clearing the window. + Centering is done with respect to the _grid_ setting. Displaying + the grid itself may be switched on and off by _Grid_ but only if + the distance between two pixels exceeds 4 pixels. `Pcb' is able + to handle several labels of an element. One of them is a + description of the functionality (eg resistor), the second should + be a unique identifier (R1) whereas the last one is a value (100k). + The _Display()_ action selects which of the names is displayed. + It also controls which name will be affected by the _ChangeName_ + command. If _ToggleGrid_ is passed, `Pcb' changes between relative + ('rel' in the statusline) and absolute grid (an 'abs' in the + statusline). Relative grid means the pointer position when the + command is issued is used as the grid origin; while (0,0) is used + in the absolute grid case. Passing _Pinout_ displays the pinout + of the element at the current cursor location whereas + _PinOrPadName_ toggles displaying of the pins or pads name under + the cursor. If none of them matches but the cursor is inside of an + element, the flags is toggled for all of its pins and pads. For + details about rubberbands see also the details about _Mode_. + Default: + Nonec: Display(Center) + Noned: Display(PinOrPadName) + !Shiftd: Display(Pinout) + Noner: Display(ClearAndRedraw) + None.: Display(Toggle45Degree) + None/: Display(CycleClip) + +`DRC()' + Initiates design rule checking of the entire layout. Must be + repeated until no errors are found. + +`ExecuteFile(filename)' + Executes the PCB actions contained in the specified file. This + can be used to automate a complex sequence of operations. + :ExecuteFile(custom.cmd) + The command file contains a list of PCB actions. Blank lines are + ignored and lines starting with a # are treated as comment lines. + For example + # This is a comment line + Display(Grid) + SetValue(Zoom,2) + DRC() + +`EditLayerGroups()' + Pops up a dialog box to edit the layergroup setting. The function + is also available from the _Objects_ menu. There are no defaults. + +`EnableVendor()' + Enables automatic drill size mapping to the loaded vendor drill + table. + EnableVendor() + +`Load(ElementToBuffer|Layout|LayoutToBuffer|Nelist)' + This routine pops up a fileselect box to load layout, element data, + or netlist. The passed filename for layout data is saved and may + be reused. _ElementToBuffer_ and _LayoutToBuffer_ load the data + into the current buffer. There are no defaults. + +`LoadVendor(vendorfile)' + Loads the specified vendor resource file. + LoadVendor(myvendor.res) + +`MarkCrosshair()' + This routine marks the current cursor location with an X, and then + the cursor display shows both absolute position and position + relative to the mark. If a mark is already present, this routine + removes it and stops displaying relative cursor coordinates. + Defaults: + !Ctrlm: MarkCrosshair() + +`Mode(Copy|InsertPoint|Line|Move|None|PasteBuffer|Polygon|Thermal)' +`Mode(Remove|Rectangle|RubberbandMove|Text|Via)' +`Mode(Cycle)' +`Mode(Notify)' +`Mode(Save|Restore)' + Switches to a new mode of operation. The active mode is displayed + by a thick line around the matching mode selector button. Most of + the functionality of `Pcb' is implemented by selecting a mode and + calling _Mode(Notify)_. The arguments _Line_, _Polygon_, + _Rectangle_, _Text_ and _Via_ are used to create the appropriate + object whenever _Mode(Notify)_ is called. Some of them, such as + _Polygon_, need more than one call for one object to be created. + _InsertPoint_ adds points to existing polygons or lines. _Save_ + and _Restore_ are used to temporarily save the mode, switch to + another one, call _Mode(Notify)_ and restore the saved one. Have a + look at the application resource file for examples. _Copy_ and + _Move_ modes are used to change an object's location and, + optionally, to create a new one. The first call of _Mode(Notify)_ + attaches the object at the pointer location to the cross hair + whereas the second one drops it to the layout. The _rubberband_ + version of move performs the move while overriding the current + rubberband mode. Passing _PasteBuffer_ attaches the contents of + the currently selected buffer to the cross hair. Each call to + _Mode(Notify)_ pastes this contents to the layout. _Mode(Cycle)_ + cycles through the modes available in the mode-button pallet. + _Mode(None)_ switches all modes off. Default: + Escape: Mode(None) + space: Mode(Cycle) + NoneBackSpace: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) + NoneDelete: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) + NoneF1: Mode(Via) + NoneF2: Mode(Line) + NoneF3: Mode(PasteBuffer) + NoneF4: Mode(Rectangle) + NoneF5: Mode(Text) + NoneF6: Mode(Polygon) + NoneF7: Mode(Thermal) + NoneF8: Mode(Arc) + NoneInsert: Mode(InsertPoint) + None[: Mode(Save) Mode(Move) Mode(Notify) + None]: Mode(Notify) Mode(Restore) + None: Mode(Notify) + !Shift Ctrl: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) + None: Mode(Save) Mode(Move) Mode(Notify) + None: Mode(Notify) Mode(Restore) + !Mod1: Mode(Save) Mode(Copy) Mode(Notify) + !Mod1: Mode(Notify) Mode(Restore) + Shift BTNMOD: Mode(Save) Mode(RubberbandMove) Mode(Notify) + +`MovePointer(delta_x, delta_y)' + With this function it is possible to move the cross hair cursor by + using the cursor keys. The `X' server's pointer follows because + the necessary events are generated by `Pcb'. All movements are + performed with respect to the currently set grid value. Default: + NoneUp: MovePointer(0, -1) + !ShiftUp: MovePointer(0, -10) + NoneDown: MovePointer(0, 1) + !ShiftDown: MovePointer(0, 10) + NoneRight: MovePointer(1, 0) + !ShiftRight: MovePointer(10, 0) + NoneLeft: MovePointer(-1, 0) + !ShiftLeft: MovePointer(-10, 0) + +`MoveToCurrentLayer(Object|SelectedObjects)' + The function moves a single object at the cross hair location or + all selected objects to the current layer. Elements are not + movable by this function. They have to be deleted and replaced on + the other side. If a line segment is moved and the movement would + result in a loss of connectivity to another segment then via(s) + are automatically added to maintain the connectivity. + Nonem: MoveToCurrentLayer(Object) + !Shiftm: MoveToCurrentLayer(SelectedObjects) + +`New()' + Clear the current layout and starts a new one after entering its + name. Refer to the resource _backup_ for more information. No + defaults. + +`PasteBuffer(AddSelected|Clear|1..5)' +`PasteBuffer(Rotate, 1..3)' +`PasteBuffer(Convert)' + This action routine controls and selects the pastebuffer as well + as all cut-and-paste operations. Passing a buffer number selects + one in of the range 1..5. The statusline is updated with the new + number. _Rotate_ performs a number of 90 degree counter clockwise + rotations of the buffer contents. _AddSelected_ as first argument + copies all selected and visible objects into the buffer. Passing + _Clear_ removes all objects from the currently selected buffer. + _Convert_ causes the contents of the buffer (lines, arc, vias) to + be converted into an element definition. Refer to *note + Pastebuffer:: for examples. Default: + !Ctrlx: PasteBuffer(Clear) PasteBuffer(AddSelected) + Mode(PasteBuffer) + !Shift Ctrlx: PasteBuffer(Clear) PasteBuffer(AddSelected) + RemoveSelected() Mode(PasteBuffer) + !Mod1c: PasteBuffer(Clear) PasteBuffer(AddSelected) + !Mod1x: PasteBuffer(Clear) PasteBuffer(AddSelected) + RemoveSelected() + !Shift1: PasteBuffer(1) + !Shift2: PasteBuffer(2) + !Shift3: PasteBuffer(3) + !Shift4: PasteBuffer(4) + !Shift5: PasteBuffer(5) + NoneF3: Mode(PasteBuffer) + +`Polygon((Close|PreviousPoint)' + Polygons need a special action routine to make life easier. Calling + _Polygon(PreviousPoint)_ resets the newly entered corner to the + previous one. The Undo action will call Polygon(PreviousPoint) + when appropriate to do so. _Close_ creates the final segment of + the polygon. This may fail if clipping to 45 degree lines is + switched on, in which case a warning is issued. Default: + Nonep: Polygon(Close) + !Shiftp: Polygon(Close) + +`Print()' + Pops up a print control box that lets you select the output + device, scaling and many more options. Each run creates all files + that are supported by the selected device. These are mask files as + well as drilling files, silk screens and so on. The table shows + the filenames for all possible files: + POSIX (extension) 8.3 filename + --------------------------------------------- + *_componentmask.* cmsk.* + *_componentsilk.* cslk.* + *_soldermask.* smsk.* + *_soldersilk.* sslk.* + *_drill.* dril.* + *_groundplane.* gpl.* + *_group[1..8].* [..8].* + The output may be sent to a post-processor by starting the + filename with the _pipe_ `("|")' character. Any `"%f"' in a + command is replaced with the current filename. The function is + available from the _file_ menu. There are no defaults. + +`Quit()' + Quits the application after confirming the operation. Default: + WM_PROTOCOLS: Quit() + +`Redo()' + This routine allows you to recover from the last undo command. + You might want to do this if you thought that undo was going to + revert something other than what it actually did (in case you are + confused about which operations are un-doable), or if you have + been backing up through a long undo list and over-shoot your + stopping point. Any change that is made since the undo in + question will trim the redo list. For example if you add ten + lines, then undo three of them you could use redo to put them + back, but if you move a line on the board before performing the + redo, you will lose the ability to "redo" the three "undone" lines. + Default: + !Shiftr: Redo() + +`RemoveSelected()' + This routine removes all visible and selected objects. There are + no defaults. + +`Report(Object|DrillReport)' + This routine pops up a dialog box describing the various + characteristics of an object (or piece of an object such as a pad + or pin) in the layout at the cursor position, or a report about + all of the drill holes in the layout. There are no defaults. + +`RouteStyle(1|2|3|4)' + This routine copies the sizes corresponding to the numbered route + style into the active line thickens, via diameter, and via drill + size. Defaults: + !Ctrl1: RouteStyle(1) + ... + !CtrlNUM_STYLES: RouteStyle(NUM_STYLES) + The variable `NUM_STYLES' is set at compile time in + `globalconfig.h'. + +`Save(Layout|LayoutAs)' +`Save(AllConnections|AllUnusedPins|ElementConnections)' + Passing _Layout_ saves the layout using the file from which it was + loaded or, if it is a new layout, calls _Save(LayoutAs)_ which + queries the user for a filename. The values: _AllConnections_, + _AllUnusedPins_ and _ElementConnections_ start a connection scan + and save all connections, all unused pins or the connections of a + single element to a file. There are no defaults. + +`Select(All|Block|Connection|ToggleObject)' +`Select(ElementByName|ObjectByName|PadByName|PinByName)' +`Select(TextByName|ViaByName)' + Toggles either the selection flag of the object at the cross hair + position (_ToggleObject_) or selects all visible objects, all + inside a rectangle or all objects which have been found during the + last connection scan. The _ByName_ functions use a *note Regular + Expressions:: search, always case insensitive, to select the + objects. Default: + None: Select(ToggleObject) + None,None: See resource file - this is complex + +`SetFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square)' + Sets the indicated flag. This adds thermals, sets the flag which + indicates a pin/pad should be square, or sets the flag which + indicates a pin/pad should be octagonal. + :SetFlag(Selected,thermal) + +`SetValue(Grid|LineSize|TextScale|ViaDrillingHole|ViaSize|Zoom, value)' + Some internal values may be changed online by this function. The + first parameter specifies which data has to be changed. The other + one determines if the resource is set to the passed value, if + _value_ is specified without sign, or increments/decrements if it + is specified with a plus or minus sign. The function doesn't + change any existing object only the initial values of new objects. + Use the _ChangeSize()_ and _ChangeDrillSize()_ to change existing + objects. Default: + Noneg: SetValue(Grid, +5) + !Shiftg: SetValue(Grid, -5) + Nonel: SetValue(LineSize, +5) + !Shiftl: SetValue(LineSize, -5) + Nonet: SetValue(TextScale, +10) + !Shiftt: SetValue(TextScale, -10) + Nonev: SetValue(ViaSize, +5) + !Shiftv: SetValue(ViaSize, -5) + !Mod1v: SetValue(ViaDrillingHole, +5) + !Mod1 Shiftv: SetValue(ViaDrillingHole, -5) + Nonez: SetValue(Zoom, -1) + !Shiftz: SetValue(Zoom, +1) + +`SwapSides()' + This routine changes the board side you are viewing. Default: + NoneTab: SwapSides() + +`SwitchDrawingLayer(value)' + Makes layer number 1..MAX_LAYER the current one. Default: + None1: SwitchDrawingLayer(1) + ... + NoneMAX_LAYER: SwitchDrawingLayer(MAX_LAYER) + +`ToggleHideName(Object|SelectedElements)' + Toggles whether the element's name is displayed or hidden. If it + is hidden you won't see it on the screen and it will not appear on + the silk layer when you print the layout. + Noneh: ToggleHideName(Object) + !Shifth: ToggleHideName(SelectedElements) + +`ToggleVendor()' + Toggles automatic drill size mapping to the loaded vendor drill + table. + ToggleVendor() + +`ToggleVisibility(Layer)' + Toggles the visibility of the layer. + Mod11: ToggleVisibility(1) + Mod12: ToggleVisibility(2) + Mod13: ToggleVisibility(3) + Mod14: ToggleVisibility(4) + +`Undo()' +`Undo(ClearList)' + The unlimited undo feature of `Pcb' allows you to recover from + most operations that materially affect you work. Calling _Undo()_ + without any parameter recovers from the last (non-undo) operation. + _ClearList_ is used to release the allocated memory. _ClearList_ + is called whenever a new layout is started or loaded. See also + _Redo_. Default: + Noneu: Undo() + !Shift Ctrlu: Undo(ClearList) + +`UnloadVendor()' + Unloads the loaded vendor drill table. + UnloadVendor() + +`Unselect(All|Block|Connection)' + Unselects all visible objects, all inside a rectangle or all + objects which have been found during the last connection scan. + Default: + !Shift : Mode(Save) Mode(None) Unselect(Block) + !Shift : Unselect(Block) Mode(Restore) + + + +File: pcb.info, Node: Translations, Prev: Actions, Up: X11 Interface + +7.3 Default Translations +======================== + +This section covers some default translations of key and button events +as defined in the shipped default application resource file. Most of +them have already been listed in *note Actions::. `Pcb' makes use of a +nice `X11' feature; calling several action routines for one event. + +`NoneBackSpace:' + +`NoneDelete:' +`!ShiftBackSpace:' +`!Shift Ctrl:' + The object at the cursor location is removed by + _NoneBackSpace_ or _Shift Ctrl_ whereas + _ShiftBackSpace_ also removes all other objects that are + fully-connected to the one at the cursor location. + +`!Mod1 CtrlLeft:' +`!Mod1 CtrlRight:' +`!Mod1 CtrlUp:' +`!Mod1 CtrlDown:' + Scroll one page in one of the four directions. + +`NoneLeft:, !ShiftLeft:' +`NoneRight:, !ShiftRight:' +`NoneUp:, !ShiftUp:' +`NoneDown:, !ShiftDown:' + Move cross hair either one or ten points in grid. + +`NoneReturn:' + Finished user input, selects the 'default' button of dialogs. + +`NoneEscape:' + _Mode(Reset)_, aborts user input, selects the 'abort' button of + dialogs or resets all modes. + +`None, Btn2, None:' +`!Mod1, Btn2, !Mod1:' + The first sequence moves the object or element name at the cursor + location. The second one copies the objects. Copying isn't + available for element names. + + + +File: pcb.info, Node: File Formats, Next: Library Creation, Prev: X11 Interface, Up: Top + +8 File Formats +************** + +All files used by `Pcb' are read from the standard output of a command +or written to the standard input of one as plain seven bit `ASCII'. This +makes it possible to use any editor to change the contents of a layout +file. It is the only way for element or font description files to be +created. To do so you'll need to study the example files `example/*' +and `default_font' which are shipped with `Pcb'. For an overview refer +to *note Intro::. + + The following sections provide the necessary information about the +syntax of the files. Netlist files are not created by `Pcb', but it +does use them. For information on the format of a netlist file see the +_:rn_, *note User Commands::. The commands described allow you to add +almost any additional functionality you may need. Examples are +compressed read and write access as well as archives. The commands +themselves are defined by the resources _elementCommand_, +_fileCommand_, _fontCommand_, _libraryCommand_, +_libraryContentsCommand_ and _saveCommand_. Note that the commands are +not saved along with the data. It is considered an advantage to have +the layout file contain all necessary information, independent of any +other files. + + One thing common to all files is they may include comments, newlines, +and carriage returns at any place except within quoted strings. + +* Menu: + +* Pad and Line Representation:: +* Layout File:: +* Element File:: +* Font File:: +* Netlist File:: +* Library Contents File:: +* Library File:: +* File Syntax:: +* Object Flags:: +* PCBFlags:: + + +File: pcb.info, Node: Pad and Line Representation, Next: Layout File, Up: File Formats + +8.1 Pad and Line Representation +=============================== + +Pads and lines (copper traces, silk screen lines, etc) are represented +by the line end points and the aperture used to draw the line. It is +important to understand this when creating the pads for a new +footprint. The following figure illustrates a pad or line which is +drawn using a square aperture. The end points (X0,Y0), (X1,Y1) specify +the center of the aperture. The size parameter specifies the size of +the aperture. + + [image src="pad.png" alt="Pad Layout"] + +Pads and lines are represented in this way because this is how lines are +specified in RS-274X (Gerber) files which are used for creating the +masks used in board manufacturing. In fact, older mask making +equipment created lines in precisely this fashion. A physical aperture +was used to pass light through onto a photosensitive film. + + +File: pcb.info, Node: Layout File, Next: Element File, Prev: Pad and Line Representation, Up: File Formats + +8.2 Layout File Format +====================== + +The layout file describes a complete layout including symbols, vias, +elements and layers with lines, rectangles and text. This is the most +complex file of all. As `Pcb' has evolved, the file format has changed +several times to accommodate new features. `Pcb' has always been able +to read all older versions of the `.pcb' file. This allows the +migration of older designs to newer versions of the program. Obviously +older versions of `Pcb' will not be able to properly read layout files +stored in newer versions of the file format. + + In practice it is very common for footprint libraries to contain +elements which have been defined in various versions of the `Pcb' file +format. When faced with trying to understand an element file or layout +file which includes syntax not defined here, the best approach is to +examine the file `src/parse_y.y' which is the definitive definition of +the file format. + + The PCB layout file contains the following contents, in this order +(individual items are defined in *note File Syntax::: + +`PCB' + This names the board and sets its size + +`Grid' + Optional. + +`Cursor' + Optional. + +`Flags' + Optional. + +`Groups' + Optional. + +`Styles' + Optional. + +`Symbols' + Optional. + +`Vias, Rats, Layers, and Elements' + These may occur in any order, at this point in the file. + +`Netlists' + Optional. + + + +File: pcb.info, Node: Element File, Next: Font File, Prev: Layout File, Up: File Formats + +8.3 Element File Format +======================= + +Element files are used to describe one component which then may be used +several times within one or more layouts. You will normally split the +file into two parts, one for the pinout and one for the package +description. Using `m4' allows you to define pin names as macros in +one file and include a package description file which evaluates the +macros. See the resource _elementCommand_ for more information. The +pins (and pads) must appear in sequential order in the element file +(new in 1.5) so that pin 1 must be the first PIN(...) in the file. + + Doing things this way makes it possible to use one package file for +several different circuits. See the sample files `dil*'. + + The lowest x and y coordinates of all sub-objects of an element are +used as an attachment point for the cross hair cursor of the main +window, unless the element has a mark, in which case that's the +attachment point. + + +File: pcb.info, Node: Font File, Next: Netlist File, Prev: Element File, Up: File Formats + +8.4 Font File Format +==================== + +A number of user defined Symbols are called a font. There is only one +per layout. All symbols are made of lines. See the file `default_font' +as an example. + + The lowest x and y coordinates of all lines of a font are +transformed to (0,0). + + +File: pcb.info, Node: Netlist File, Next: Library Contents File, Prev: Font File, Up: File Formats + +8.5 Netlist File Format +======================= + +Netlists read by `Pcb' must have this simple text form: + + netname [style] NAME-PINNUM NAME2-PINNUM2 NAME3-PINNUM3 ... [\] + +for each net on the layout. where "netname" is the name of the net +which must be unique for each net, [style] is an optional route-style +name, NAME is the layout-name name given to an element, and PINNUM is +the (usually numeric) pin number of the element that connects to the net +(for details on pin numbering see *note Element Objects::). Spaces or +tabs separate the fields. If the line ends with a "\" the net +continues on the next line and the "\" is treated exactly as if it were +a space. If a NAME ends with a lower-case letter, all lower-case +letters are stripped from the end of the NAME to determine the matching +layout-name name. For example: + + Data U1-3 U2abc-4 FLOP1a-7 Uabc3-A9 + + specifies that the net called "Data" should have pin 3 of U1 +connected to pin 4 of U2, to pin 7 of FLOP1 and to pin A9 of Uabc3. +Note that element name and pin number strings are case-sensitive. It +is up to you to name the elements so that their layout-name names +agrees with the netlist. + + +File: pcb.info, Node: Library Contents File, Next: Library File, Prev: Netlist File, Up: File Formats + +8.6 Library Contents File Format +================================ + +There is nothing like a special library format. The ones that have been +introduced in 1.4.1 just use some nice (and time consuming) features of +GNU `m4'. The only predefined format is the one of the contents file +which is read during startup. It is made up of two basic line types: + + menu entry = "TYPE="name + contents line = template":"package":"value":"description + name = String + template = String + package = String + value = String + description = String + String = + + No leading white spaces or comments are allowed in this file. If you +need either one, define a command that removes them before loading. +Have a look to the _libraryContentsCommand_ resource. + + The menu entry will appear in the selection menu at the top and of +the library window. + + +File: pcb.info, Node: Library File, Next: File Syntax, Prev: Library Contents File, Up: File Formats + +8.7 Library File Format +======================= + +This section provides an overview about the existing `m4' definitions +of the elements. There are basically two different types of files. One +to define element specific data like the pinout, package and so on, the +other to define the values. For example the static RAM circuits 43256 +and 62256 are very similar. They therefore share a common definition in +the macro file but are defined with two different value labels. + + The macro file entry: + define(`Description_43256_dil', `SRAM 32Kx8') + define(`Param1_43256_dil', 28) + define(`Param2_43256_dil', 600) + define(`PinList_43256_dil', ``pin1', `pin2', ...') + + And the list file: + 43256_dil:N:43256:62256 + + The macro must define a description, the pin list and up to two +additional parameters that are passed to the package definitions. The +first one is the number of pins whereas the second one defines for +example the width of a package. + + It is very important to select a unique identifier for each macro. In +the example this would be _43256_dil_ which is also the templates name. +It is required by some low-level macros that _Description_, Param1_, +Param2__ and _PinList__ are perpended. + + The list file uses a syntax: + template:package:value[:more values] + + This means that the shown example will create two element entries +with the same package and pinout but with different names. + + A number of packages are defined in `common.m4'. Included are: + + DIL packages with suffix D, DW, J, JD, JG, N, NT, P + PLCC + TO3 + generic connectors + DIN 41.612 connectors + zick-zack (SD suffix) + 15 pin multiwatt + + If you are going to start your own library please take care about +`m4' functions. Be aware of quoting and so on and, most important check +your additional entry by calling the macro: + + CreateObject(`template', `value', `package suffix') + + If quoting is incorrect an endless loop may occur (broken by a +out-of-memory message). + + The scripts in the `lib' directory handle the creation of libraries +as well as of their contents files. Querying is also supported. + + I know quite well that this description of the library +implementation is not what some out there expect. But in my opinion +it's much more useful to look at the comments and follow the macros +step by step. + + +File: pcb.info, Node: File Syntax, Next: Object Flags, Prev: Library File, Up: File Formats + +8.8 File Syntax +=============== + +A special note about units: Older versions of `pcb' used mils (1/1000 +inch) as the base unit; a value of 500 in the file meant half an inch. +Newer versions uses a "high resolution" syntax, where the base unit is +1/100 of a mil (0.000010 inch); a value of 500 in the file means 5 +mils. As a general rule, the variants of each entry listed below which +use square brackets are the high resolution formats and use the 1/100 +mil units, and the ones with parentheses are the older variants and use +1 mil units. Note that when multiple variants are listed, the most +recent (and most preferred) format is the first listed. + + Symbolic and numeric flags (SFlags and NFlags) are described in +*note Object Flags::. + +* Menu: + +* Arc syntax:: +* Attribute syntax:: +* Connect syntax:: +* Cursor syntax:: +* DRC syntax:: +* Element syntax:: +* ElementArc syntax:: +* ElementLine syntax:: +* FileVersion syntax:: +* Flags syntax:: +* Grid syntax:: +* Groups syntax:: +* Layer syntax:: +* Line syntax:: +* Mark syntax:: +* Net syntax:: +* Netlist syntax:: +* Pad syntax:: +* PCB syntax:: +* Pin syntax:: +* PolyArea syntax:: +* Polygon syntax:: +* Rat syntax:: +* Styles syntax:: +* Symbol syntax:: +* SymbolLine syntax:: +* Text syntax:: +* Thermal syntax:: +* Via syntax:: + + +File: pcb.info, Node: Arc syntax, Next: Attribute syntax, Up: File Syntax + +8.8.1 Arc +--------- + +Arc [X Y Width Height Thickness Clearance StartAngle DeltaAngle SFlags] +Arc (X Y Width Height Thickness Clearance StartAngle DeltaAngle NFlags) +Arc (X Y Width Height Thickness StartAngle DeltaAngle NFlags) + +X Y + Coordinates of the center of the arc. + +WIDTH HEIGHT + The width and height, from the center to the edge. The bounds of + the circle of which this arc is a segment, is thus 2*Width by + 2*Height. + +THICKNESS + The width of the copper trace which forms the arc. + +CLEARANCE + The amount of space cleared around the arc when the line passes + through a polygon. The clearance is added to the thickness to get + the thickness of the clear; thus the space between the arc and the + polygon is Clearance/2 wide. + +STARTANGLE + The angle of one end of the arc, in degrees. In PCB, an angle of + zero points left (negative X direction), and 90 degrees points down + (positive Y direction). + +DELTAANGLE + The sweep of the arc. This may be negative. Positive angles sweep + counterclockwise. + +SFLAGS + Symbolic or numeric flags. + +NFLAGS + Numeric flags. + + +File: pcb.info, Node: Attribute syntax, Next: Connect syntax, Prev: Arc syntax, Up: File Syntax + +8.8.2 Attribute +--------------- + +Attribute ("Name" "Value") + +Attributes allow boards and elements to have arbitrary data attached to +them, which is not directly used by PCB itself but may be of use by +other programs or users. + +NAME + The name of the attribute + +VALUE + The value of the attribute. Values are always stored as strings, + even if the value is interpreted as, for example, a number. + + + +File: pcb.info, Node: Connect syntax, Next: Cursor syntax, Prev: Attribute syntax, Up: File Syntax + +8.8.3 Connect +------------- + +Connect ("PinPad") + +PINPAD + The name of a pin or pad which is included in this net. Pin and + Pad names are named by the refdes and pin name, like `"U14-7"' for + pin 7 of U14, or `"T4-E"' for pin E of T4. + + +File: pcb.info, Node: Cursor syntax, Next: DRC syntax, Prev: Connect syntax, Up: File Syntax + +8.8.4 Cursor +------------ + +Cursor [X Y Zoom] +Cursor (X Y Zoom) + +X Y + Location of the cursor when the board was saved. + +ZOOM + The current zoom factor. Note that a zoom factor of "0" means 1 + mil per screen pixel, N means 2^N mils per screen pixel, etc. The + first variant accepts floating point numbers. The special value + "1000" means "zoom to fit" + + +File: pcb.info, Node: DRC syntax, Next: Element syntax, Prev: Cursor syntax, Up: File Syntax + +8.8.5 DRC +--------- + +DRC [Bloat Shrink Line Silk Drill Ring] +DRC [Bloat Shrink Line Silk] +DRC [Bloat Shrink Line] + +BLOAT + Minimum spacing between copper. + +SHRINK + Minimum copper overlap to guarantee connectivity. + +LINE + Minimum line thickness. + +SILK + Minimum silk thickness. + +DRILL + Minimum drill size. + +RING + Minimum width of the annular ring around pins and vias. + + +File: pcb.info, Node: Element syntax, Next: ElementArc syntax, Prev: DRC syntax, Up: File Syntax + +8.8.6 Element +------------- + +Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags] ( +Element (NFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TNFlags) ( +Element (NFlags "Desc" "Name" "Value" TX TY TDir TScale TNFlags) ( +Element (NFlags "Desc" "Name" TX TY TDir TScale TNFlags) ( +Element ("Desc" "Name" TX TY TDir TScale TNFlags) ( + ... contents ... +) + +SFLAGS + Symbolic or numeric flags, for the element as a whole. + +NFLAGS + Numeric flags, for the element as a whole. + +DESC + The description of the element. This is one of the three strings + which can be displayed on the screen. + +NAME + The name of the element, usually the reference designator. + +VALUE + The value of the element. + +MX MY + The location of the element's mark. This is the reference point + for placing the element and its pins and pads. + +TX TY + The upper left corner of the text (one of the three strings). + +TDIR + The relative direction of the text. 0 means left to right for an + unrotated element, 1 means up, 2 left, 3 down. + +TSCALE + Size of the text, as a percentage of the "default" size of of the + font (the default font is about 40 mils high). Default is 100 (40 + mils). + +TSFLAGS + Symbolic or numeric flags, for the text. + +TNFLAGS + Numeric flags, for the text. + + Elements may contain pins, pads, element lines, element arcs, +attributes, and (for older elements) an optional mark. Note that +element definitions that have the mark coordinates in the element line, +only support pins and pads which use relative coordinates. The pin and +pad coordinates are relative to the mark. Element definitions which do +not include the mark coordinates in the element line, may have a Mark +definition in their contents, and only use pin and pad definitions +which use absolute coordinates. + + +File: pcb.info, Node: ElementArc syntax, Next: ElementLine syntax, Prev: Element syntax, Up: File Syntax + +8.8.7 ElementArc +---------------- + +ElementArc [X Y Width Height StartAngle DeltaAngle Thickness] +ElementArc (X Y Width Height StartAngle DeltaAngle Thickness) + +X Y + Coordinates of the center of the arc. These are relative to the + Element's mark point for new element formats, or absolute for older + formats. + +WIDTH HEIGHT + The width and height, from the center to the edge. The bounds of + the circle of which this arc is a segment, is thus 2*Width by + 2*Height. + +STARTANGLE + The angle of one end of the arc, in degrees. In PCB, an angle of + zero points left (negative X direction), and 90 degrees points down + (positive Y direction). + +DELTAANGLE + The sweep of the arc. This may be negative. Positive angles sweep + counterclockwise. + +THICKNESS + The width of the silk line which forms the arc. + + +File: pcb.info, Node: ElementLine syntax, Next: FileVersion syntax, Prev: ElementArc syntax, Up: File Syntax + +8.8.8 ElementLine +----------------- + +ElementLine [X1 Y1 X2 Y2 Thickness] +ElementLine (X1 Y1 X2 Y2 Thickness) + +X1 Y1 X2 Y2 + Coordinates of the endpoints of the line. These are relative to + the Element's mark point for new element formats, or absolute for + older formats. + +THICKNESS + The width of the silk for this line. + + +File: pcb.info, Node: FileVersion syntax, Next: Flags syntax, Prev: ElementLine syntax, Up: File Syntax + +8.8.9 FileVersion +----------------- + +FileVersion[Version] + +VERSION + File format version. This version number represents the date when + the pcb file format was last changed. + + Any version of pcb build from sources equal to or newer than this +number should be able to read the file. If this line is not present in +the input file then file format compatibility is not checked. + + +File: pcb.info, Node: Flags syntax, Next: Grid syntax, Prev: FileVersion syntax, Up: File Syntax + +8.8.10 Flags +------------ + +Flags(Number) + +NUMBER + A number, whose value is normally given in hex, individual bits of + which represent pcb-wide flags as defined in *note PCBFlags::. + + + +File: pcb.info, Node: Grid syntax, Next: Groups syntax, Prev: Flags syntax, Up: File Syntax + +8.8.11 Grid +----------- + +Grid [Step OffsetX OffsetY Visible] +Grid (Step OffsetX OffsetY Visible) +Grid (Step OffsetX OffsetY) + +STEP + Distance from one grid point to adjacent points. This value may + be a floating point number for the first two variants. + +OFFSETX OFFSETY + The "origin" of the grid. Normally zero. + +VISIBLE + If non-zero, the grid will be visible on the screen. + + +File: pcb.info, Node: Groups syntax, Next: Layer syntax, Prev: Grid syntax, Up: File Syntax + +8.8.12 Groups +------------- + +Groups("String") + +STRING + Encodes the layer grouping information. Each group is separated + by a colon, each member of each group is separated by a comma. + Group members are either numbers from `1'..N for each layer, and + the letters `c' or `s' representing the component side and solder + side of the board. Including `c' or `s' marks that group as being + the top or bottom side of the board. + + Groups("1,2,c:3:4:5,6,s:7,8") + + + +File: pcb.info, Node: Layer syntax, Next: Line syntax, Prev: Groups syntax, Up: File Syntax + +8.8.13 Layer +------------ + +Layer (LayerNum "Name") ( + ... contents ... +) + +LAYERNUM + The layer number. Layers are numbered sequentially, starting with + 1. The last two layers (9 and 10 by default) are solder-side silk + and component-side silk, in that order. + +NAME + The layer name. + +CONTENTS + The contents of the layer, which may include attributes, lines, + arcs, rectangles, text, and polygons. + + +File: pcb.info, Node: Line syntax, Next: Mark syntax, Prev: Layer syntax, Up: File Syntax + +8.8.14 Line +----------- + +Line [X1 Y1 X2 Y2 Thickness Clearance SFlags] +Line (X1 Y1 X2 Y2 Thickness Clearance NFlags) +Line (X1 Y1 X2 Y2 Thickness NFlags) + +X1 Y1 X2 Y2 + The end points of the line + +THICKNESS + The width of the line + +CLEARANCE + The amount of space cleared around the line when the line passes + through a polygon. The clearance is added to the thickness to get + the thickness of the clear; thus the space between the line and the + polygon is Clearance/2 wide. + +SFLAGS + Symbolic or numeric flags + +NFLAGS + Numeric flags. + + +File: pcb.info, Node: Mark syntax, Next: Net syntax, Prev: Line syntax, Up: File Syntax + +8.8.15 Mark +----------- + +Mark [X Y] +Mark (X Y) + +X Y + Coordinates of the Mark, for older element formats that don't have + the mark as part of the Element line. + + +File: pcb.info, Node: Net syntax, Next: Netlist syntax, Prev: Mark syntax, Up: File Syntax + +8.8.16 Net +---------- + +Net ("Name" "Style") ( + ... connects ... +) + +NAME + The name of this net. + +STYLE + The routing style that should be used when autorouting this net. + + +File: pcb.info, Node: Netlist syntax, Next: Pad syntax, Prev: Net syntax, Up: File Syntax + +8.8.17 Netlist +-------------- + +Netlist ( ) ( + ... nets ... +) + + +File: pcb.info, Node: Pad syntax, Next: PCB syntax, Prev: Netlist syntax, Up: File Syntax + +8.8.18 Pad +---------- + +Pad [rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" SFlags] +Pad (rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" NFlags) +Pad (aX1 aY1 aX2 aY2 Thickness "Name" "Number" NFlags) +Pad (aX1 aY1 aX2 aY2 Thickness "Name" NFlags) + +RX1 RY1 RX2 RY2 + Coordinates of the endpoints of the pad, relative to the element's + mark. Note that the copper extends beyond these coordinates by + half the thickness. To make a square or round pad, specify the + same coordinate twice. + +AX1 AY1 AX2 AY2 + Same, but absolute coordinates of the endpoints of the pad. + +THICKNESS + width of the pad. + +CLEARANCE + add to thickness to get clearance width. + +MASK + width of solder mask opening. + +NAME + name of pin + +NUMBER + number of pin + +SFLAGS + symbolic or numerical flags + +NFLAGS + numerical flags only + + +File: pcb.info, Node: PCB syntax, Next: Pin syntax, Prev: Pad syntax, Up: File Syntax + +8.8.19 PCB +---------- + +PCB ["Name" Width Height] +PCB ("Name" Width Height] +PCB ("Name") + +NAME + Name of the PCB project + +WIDTH HEIGHT + Size of the board + + If you don't specify the size of the board, a very large default is +chosen. + + +File: pcb.info, Node: Pin syntax, Next: PolyArea syntax, Prev: PCB syntax, Up: File Syntax + +8.8.20 Pin +---------- + +Pin [rX rY Thickness Clearance Mask Drill "Name" "Number" SFlags] +Pin (rX rY Thickness Clearance Mask Drill "Name" "Number" NFlags) +Pin (aX aY Thickness Drill "Name" "Number" NFlags) +Pin (aX aY Thickness Drill "Name" NFlags) +Pin (aX aY Thickness "Name" NFlags) + +RX RY + coordinates of center, relative to the element's mark + +AX AY + absolute coordinates of center. + +THICKNESS + outer diameter of copper annulus + +CLEARANCE + add to thickness to get clearance diameter + +MASK + diameter of solder mask opening + +DRILL + diameter of drill + +NAME + name of pin + +NUMBER + number of pin + +SFLAGS + symbolic or numerical flags + +NFLAGS + numerical flags only + + +File: pcb.info, Node: PolyArea syntax, Next: Polygon syntax, Prev: Pin syntax, Up: File Syntax + +8.8.21 PolyArea +--------------- + +PolyArea [Area] + +AREA + Minimum area of polygon island to retain. If a polygon has + clearances that cause an isolated island to be created, then will + only be retained if the area exceeds this minimum area. + + +File: pcb.info, Node: Polygon syntax, Next: Rat syntax, Prev: PolyArea syntax, Up: File Syntax + +8.8.22 Polygon +-------------- + +Polygon (SFlags) ( + ... (X Y) ... + ... [X Y] ... + Hole ( + ... (X Y) ... + ... [X Y] ... + ) + ... +) + +SFLAGS + Symbolic or numeric flags. + +X Y + Coordinates of each vertex. You must list at least three + coordinates. + +HOLE (...) + Defines a hole within the polygon's outer contour. There may be + zero or more such sections. + + +File: pcb.info, Node: Rat syntax, Next: Styles syntax, Prev: Polygon syntax, Up: File Syntax + +8.8.23 Rat +---------- + +Rat [X1 Y1 Group1 X2 Y2 Group2 SFlags] +Rat (X1 Y1 Group1 X2 Y2 Group2 NFlags) + +X1 Y1 X2 Y2 + The endpoints of the rat line. + +GROUP1 GROUP2 + The layer group each end is connected on. + +SFLAGS + Symbolic or numeric flags. + +NFLAGS + Numeric flags. + + +File: pcb.info, Node: Styles syntax, Next: Symbol syntax, Prev: Rat syntax, Up: File Syntax + +8.8.24 Styles +------------- + +Styles("String") + +STRING + Encodes the four routing styles `pcb' knows about. The four styles + are separated by colons. Each style consists of five parameters + as follows: + + NAME + The name of the style. + + THICKNESS + Width of lines and arcs. + + DIAMETER + Copper diameter of pins and vias. + + DRILL + Drill diameter of pins and vias. + + KEEPAWAY + Minimum spacing to other nets. If omitted, 10 mils is the + default. + + + + Styles("Signal,10,40,20:Power,25,60,35:Fat,40,60,35:Skinny,8,36,20") + Styles["Logic,1000,3600,2000,1000:Power,2500,6000,3500,1000: + Line,4000,6000,3500,1000:Breakout,600,2402,1181,600"] + +Note that strings in actual files cannot span lines; the above example +is split across lines only to make it readable. + + +File: pcb.info, Node: Symbol syntax, Next: SymbolLine syntax, Prev: Styles syntax, Up: File Syntax + +8.8.25 Symbol +------------- + +Symbol [Char Delta] ( +Symbol (Char Delta) ( + ... symbol lines ... +) + +CHAR + The character or numerical character value this symbol represents. + Characters must be in single quotes. + +DELTA + Additional space to allow after this character. + + +File: pcb.info, Node: SymbolLine syntax, Next: Text syntax, Prev: Symbol syntax, Up: File Syntax + +8.8.26 SymbolLine +----------------- + +SymbolLine [X1 Y1 X2 Y1 Thickness] +SymbolLine (X1 Y1 X2 Y1 Thickness) + +X1 Y1 X2 Y2 + The endpoints of this line. + +THICKNESS + The width of this line. + + +File: pcb.info, Node: Text syntax, Next: Thermal syntax, Prev: SymbolLine syntax, Up: File Syntax + +8.8.27 Text +----------- + +Text [X Y Direction Scale "String" SFlags] +Text (X Y Direction Scale "String" NFlags) +Text (X Y Direction "String" NFlags) + +X Y + The location of the upper left corner of the text. + +DIRECTION + 0 means text is drawn left to right, 1 means up, 2 means right to + left (i.e. upside down), and 3 means down. + +SCALE + Size of the text, as a percentage of the "default" size of of the + font (the default font is about 40 mils high). Default is 100 (40 + mils). + +STRING + The string to draw. + +SFLAGS + Symbolic or numeric flags. + +NFLAGS + Numeric flags. + + +File: pcb.info, Node: Thermal syntax, Next: Via syntax, Prev: Text syntax, Up: File Syntax + +8.8.28 Thermal +-------------- + +Thermal [Scale] + +SCALE + Relative size of thermal fingers. A value of 1.0 makes the finger + width twice the clearance gap width (measured across the gap, not + diameter). The normal value is 0.5, which results in a finger + width the same as the clearance gap width. + + +File: pcb.info, Node: Via syntax, Prev: Thermal syntax, Up: File Syntax + +8.8.29 Via +---------- + +Via [X Y Thickness Clearance Mask Drill "Name" SFlags] +Via (X Y Thickness Clearance Mask Drill "Name" NFlags) +Via (X Y Thickness Clearance Drill "Name" NFlags) +Via (X Y Thickness Drill "Name" NFlags) +Via (X Y Thickness "Name" NFlags) + +X Y + coordinates of center + +THICKNESS + outer diameter of copper annulus + +CLEARANCE + add to thickness to get clearance diameter + +MASK + diameter of solder mask opening + +DRILL + diameter of drill + +NAME + string, name of via (vias have names?) + +SFLAGS + symbolic or numerical flags + +NFLAGS + numerical flags only + + +File: pcb.info, Node: Object Flags, Next: PCBFlags, Prev: File Syntax, Up: File Formats + +8.9 Object Flags +================ + +Note that object flags can be given numerically (like `0x0147') or +symbolically (like `"found,showname,square"'. Some numeric values are +reused for different object types. The table below lists the numeric +value followed by the symbolic name. + +`0x0001 pin' + If set, this object is a pin. This flag is for internal use only. + +`0x0002 via' + Likewise, for vias. + +`0x0004 found' + If set, this object has been found by `FindConnection()'. + +`0x0008 hole' + For pins and vias, this flag means that the pin or via is a hole + without a copper annulus. + +`0x0010 rat' + If set for a line, indicates that this line is a rat line instead + of a copper trace. + +`0x0010 pininpoly' + For pins and pads, this flag is used internally to indicate that + the pin or pad overlaps a polygon on some layer. + +`0x0010 clearpoly' + 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. + +`0x0010 hidename' + For elements, when set the name of the element is hidden. + +`0x0020 showname' + For elements, when set the names of pins are shown. + +`0x0020 clearline' + For lines and arcs, the line/arc will clear polygons instead of + connecting to them. + +`0x0020 fullpoly' + For polygons, the full polygon is drawn (i.e. all parts instead of + only the biggest one). + +`0x0040 selected' + Set when the object is selected. + +`0x0080 onsolder' + For elements and pads, indicates that they are on the solder side. + +`0x0080 auto' + For lines and vias, indicates that these were created by the + autorouter. + +`0x0100 square' + For pins and pads, indicates a square (vs round) pin/pad. + +`0x0200 rubberend' + For lines, used internally for rubber band moves. + +`0x0200 warn' + For pins, vias, and pads, set to indicate a warning. + +`0x0400 usetherm' + Obsolete, indicates that pins/vias should be drawn with thermal + fingers. + +`0x0400' + Obsolete, old files used this to indicate lines drawn on silk. + +`0x0800 octagon' + Draw pins and vias as octagons. + +`0x1000 drc' + Set for objects that fail DRC. + +`0x2000 lock' + Set for locked objects. + +`0x4000 edge2' + 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. + +`0x8000 marker' + Marker used internally to avoid revisiting an object. + +`0x10000 nopaste' + For pads, set to prevent a solderpaste stencil opening for the + pad. Primarily used for pads used as fiducials. + + +File: pcb.info, Node: PCBFlags, Prev: Object Flags, Up: File Formats + +8.10 PCBFlags +============= + +`0x00001' + Pinout displays pin numbers instead of pin names. + +`0x00002' + Use local reference for moves, by setting the mark at the + beginning of each move. + +`0x00004' + When set, only polygons and their clearances are drawn, to see if + polygons have isolated regions. + +`0x00008' + Display DRC region on crosshair. + +`0x00010' + Do all move, mirror, rotate with rubberband connections. + +`0x00020' + Display descriptions of elements, instead of refdes. + +`0x00040' + Display names of elements, instead of refdes. + +`0x00080' + Auto-DRC flag. When set, PCB doesn't let you place copper that + violates DRC. + +`0x00100' + Enable 'all-direction' lines. + +`0x00200' + Switch starting angle after each click. + +`0x00400' + Force unique names on board. + +`0x00800' + New lines/arc clear polygons. + +`0x01000' + Crosshair snaps to pins and pads. + +`0x02000' + Show the solder mask layer. + +`0x04000' + Draw with thin lines. + +`0x08000' + Move items orthogonally. + +`0x10000' + Draw autoroute paths real-time. + +`0x20000' + New polygons are full ones. + +`0x40000' + Names are locked, the mouse cannot select them. + +`0x80000' + Everything but names are locked, the mouse cannot select anything + else. + +`0x100000' + New polygons are full polygons. + +`0x200000' + When set, element names are not drawn. + + +File: pcb.info, Node: Library Creation, Next: Schematic Frontends, Prev: File Formats, Up: Top + +9 Library Creation +****************** + +This chapter provides a detailed look at how footprint libraries are +created and used. The chapter is split into two section, the first +section covers the "old" style libraries which use the `m4' macro +processor and the second section covers the "new" style libraries. + + Despite the names "old" and "new", both styles of libraries are +useful and the "old" style should not be discounted because of its +name. The advantage of the old style libraries is that one can define +a family of footprints, say a DIP package, and then quickly produce all +the members of that family. Because the individual packages make use +of a base definition, corrections made to the base definition propagate +to all the members of a family. The primary drawback to using this +library approach is that the effort to create a single footprint is +more than a graphical interface and may take even longer if the user +has not used the `m4' macro language previously. + + The new style of footprint libraries stores each footprint in its own +file. The footprints are created graphically by placing pads and then +converting a group of pads to a component. This library method has the +advantage of being quick to learn and it is easily to build single +footprints quickly. If you are building a family of parts, however, the +additional effort in creating each one individually makes this approach +undesirable. In addition, creating a part with a large pin count can +be quite tedious when done by hand. + +9.1 Old Style (m4) Libraries +============================ + +The old style libraries for pcb use the `m4' macro processor to allow +the definition of a family of parts. There are several files +associated with the old style library. The file `common.m4' is the top +level file associated with the library. `common.m4' defines a few +utility macros which are used by other portions of the library, and +then includes a predefined set of library files (the lines like +`include(geda.inc)'). + +9.1.1 Overview of Oldlib Operation +---------------------------------- + +The big picture view of the old style library system is that the library +is simply a collection of macro definitions. The macros are written in +the `m4' macro language. An example of a macro and what it expands to +is the following. One of the predefined footprints in the library +which comes with PCB is the `PKG_SO8' macro. Note that all the +footprint macros begin with `PKG_'. For this particular example, +`PKG_SO8' is a macro for an 8-pin small outline surface mount package. +All of the footprint macros take 3 arguments. The first is the +canonical name of the footprint on the board. In this case "SO8" is an +appropriate name. The second argument is the reference designator on +the board such as "U1" or "U23". The third and final argument is the +value. For an integrated circuit this is usually the part number such +as "MAX4107" or "78L05" and for a component such as a resistor or +capacitor it is the resistance or capacitance. The complete call to the +macro in our example is `PKG_SO8(SO8, U1, MAX4107)'. When processed by +`m4' using the macros defined in the PCB library, this macro expands to + Element(0x00 "SO8" "U1" "MAX4107" 146 50 3 100 0x00) + ( + Pad(10 25 38 25 20 "1" 0x00) + Pad(10 75 38 75 20 "2" 0x100) + Pad(10 125 38 125 20 "3" 0x100) + Pad(10 175 38 175 20 "4" 0x100) + Pad(214 175 242 175 20 "5" 0x100) + Pad(214 125 242 125 20 "6" 0x100) + Pad(214 75 242 75 20 "7" 0x100) + Pad(214 25 242 25 20 "8" 0x100) + ElementLine(0 0 151 0 10) + ElementArc(126 0 25 25 0 180 10) + ElementLine(101 0 252 0 10) + ElementLine(252 0 252 200 10) + ElementLine(252 200 0 200 10) + ElementLine(0 200 0 0 10) + Mark(29 25) + ) + which is the actual definition of the footprint that the PCB program +works with. As a user of PCB the only time you will need or want to run +`m4' directly is when you are debugging a new library addition. In +normal operation, the calls to `m4' are made by helper scripts that +come with PCB. + + Tools such as `gsch2pcb' (used to interface the gEDA schematic +capture program to PCB layout) will call `m4' to produce an initial PCB +layout that includes all the components on a schematic. In addition, +when manually instantiating parts from within PCB, `m4' will be called +by PCB's helper scripts to produce the footprints. + +9.1.2 The Library Scripts +------------------------- + +There are several scripts that are used for processing the m4 +libraries. This section briefly describes these scripts and details how +they are used by PCB. + +9.1.2.1 Scripts Used During Compilation +....................................... + +The scripts described in this section are used during compilation of +PCB. They are run automatically by the build system, but are described +here to help document the complete library processing that occurs. +During the build of PCB, the following actions are taken. The +`CreateLibrary.sh' script is run to produce an M4 "frozen file". This +frozen file is simply a partially processed M4 input file which can be +loaded by M4 more quickly than the original input file. + + A typical call to `CreateLibrary.sh' used during the compilation of +PCB is: + ./CreateLibrary.sh -I . pcblib ./common.m4 TTL_74xx_DIL.m4 + connector.m4 crystal.m4 generic.m4 genericsmt.m4 gtag.m4 + jerry.m4 linear.m4 logic.m4 lsi.m4 memory.m4 optical.m4 pci.m4 + resistor_0.25W.m4 resistor_adjust.m4 resistor_array.m4 + texas_inst_amplifier.m4 texas_inst_voltage_reg.m4 + transistor.m4 geda.m4 + The `-I .' says to search in the current directory for the `.m4' +files. The output frozen file is `pcblib'. The main `common.m4' file +is listed as well as all of the `*.m4' files which define the +components in the library. + + In addition, a library contents file is created during the build with +the `CreateLibraryContents.sh' script. A typical call to +`CreateLibrary.sh' used during the compilation of PCB is: + ./CreateLibraryContents.sh -I . ./common.m4 TTL_74xx_DIL.list + connector.list crystal.list generic.list genericsmt.list gtag.list + jerry.list linear.list logic.list lsi.list memory.list optical.list + pci.list resistor_0.25W.list resistor_adjust.list resistor_array.list + texas_inst_amplifier.list texas_inst_voltage_reg.list transistor.list + geda.list > pcblib.contents + + The `pcblib.contents' file is used by the PCB program to define the +libraries and components which will be displayed when you bring up the +library window from within PCB. An example of part of the +`pcblib.contents' file is: + TYPE=~TTL 74xx DIL + 7400_dil:N:7400:4 dual-NAND + 7401_dil:N:7401:4 dual-NAND OC + 7402_dil:N:7402:4 dual-NOR + TYPE=~geda + geda_DIP6:DIP6:DIP6:Dual in-line package, narrow (300 mil) + geda_DIP8:DIP8:DIP8:Dual in-line package, narrow (300 mil) + geda_DIP14:DIP14:DIP14:Dual in-line package, narrow (300 mil) + geda_ACY300:ACY300:ACY300:Axial non-polar component, + The `TYPE=' lines define the library name that will show up in the +library window in PCB. The other lines define the actual components in +the library. + +9.1.2.2 Scripts Used by PCB at Runtime +...................................... + +When PCB is first executed, it makes a call to the +`ListLibraryContents.sh' script. This script provides the PCB program +with the contents of the library contents file created when PCB was +compiled. A typical call to `ListLibraryContents.sh' is + ../lib/ListLibraryContents.sh .:/tmp/pcb-20030903/src/../lib pcblib + This command says to search the path +`.:/tmp/pcb-20030903/src/../lib' for a file called `pcblib.contents' +(the `.contents' part is added automatically) and display the contents +of the file. PCB parses this output and generates the library window +entries. + + When you pick a library component from the library window, PCB calls +the `QueryLibrary.sh' script to actually pull the footprint into the +layout. For example, when the ACY300 component is selected from the +`~geda' library, the generated call may be: + + /tmp/pcb-20030903/src/../lib/QueryLibrary.sh + .:/tmp/pcb-20030903/src/../lib pcblib geda_ACY300 ACY300 + ACY300 + If you were to run this command by hand you would see the PCB code +for the element: + Element(0x00 "Axial non-polar component," "" "ACY300" 245 70 0 100 0x00) + ( + Pin(0 25 50 20 "1" 0x101) + Pin(300 25 50 20 "2" 0x01) + + ElementLine(0 25 75 25 10) + ElementLine(225 25 300 25 10) + + ElementLine(75 0 225 0 10) + ElementLine(225 0 225 50 10) + ElementLine(225 50 75 50 10) + ElementLine(75 50 75 0 10) + + # ElementArc(X1 Y 50 50 270 180 10) + # ElementArc(X2 Y 50 50 90 180 10) + + Mark(75 25) + ) + +9.1.3 Creating an Oldlib Footprint +---------------------------------- + +This section provides a complete example of defining a family of +footprints using the M4 style library. As a vehicle for this example, a +family of footprints for surface mount resistors and capacitors will be +developed. The file `example.inc' should have been installed on your +system as `$prefix/share/examples/oldlib/example.inc' where `$prefix' +is often times `/usr/local'. + + The `example.inc' file defines a macro called `COMMON_PKG_RCSMT' +which is a generic definition for a surface mount footprint with two +identical, rectangular pads. This macro will be called with different +parameters to fill out the family of parts. The arguments to the +`COMMON_PKG_RCSMT' are: + # ------------------------------------------------------------------- + # the definition for surface mount resistors and capacitors + # $1: canonical name + # $2: name on PCB + # $3: value + # $4: pad width (in direction perpendicular to part) + # $5: pad length (in direction parallel with part) + # $6: pad spacing (center to center) + # $7: distance from edge of pad to silk (in direction + # perpendicular to part) + # $8: distance from edge of pad to silk (in direction parallel + # with part) + # $9: Set to "no" to skip silk screen on the sides of the part + + define(`COMMON_PKG_RCSMT', + `define(`XMIN', `eval( -1*`$6'/2 - `$5'/2 - `$8')') + define(`XMAX', `eval( `$6'/2 + `$5'/2 + `$8')') + define(`YMIN', `eval(-1*`$4'/2 - `$7')') + define(`YMAX', `eval( `$4'/2 + `$7')') + Element(0x00 "$1" "$2" "$3" eval(XMIN+20) eval(YMAX+20) 0 100 0x00) + ( + ifelse(0, eval($4>$5), + # Pads which have the perpendicular pad dimension less + # than or equal to the parallel pad dimension + Pad(eval(-1*( $6 + $5 - $4)/2) 0 + eval((-1*$6 + $5 - $4)/2) 0 eval($4) "1" 0x100) + Pad(eval(-1*(-1*$6 + $5 - $4)/2) 0 + eval(( $6 + $5 - $4)/2) 0 eval($4) "2" 0x100) + , + # Pads which have the perpendicular pad dimension greater + # than or equal to the parallel pad dimension + Pad(eval(-1*$6/2) eval(-1*($4 - $5)/2) + eval(-1*$6/2) eval(($4 - $5)/2) eval($5) "1" 0x100) + Pad(eval( $6/2) eval(-1*($4 - $5)/2) + eval( $6/2) eval(($4 - $5)/2) eval($5) "2" 0x100) + ) + + # silk screen + # ends + ElementLine(XMIN YMIN XMIN YMAX 10) + ElementLine(XMAX YMAX XMAX YMIN 10) + # sides + ifelse($9,"no", + #skip side silk + , + ElementLine(XMIN YMIN XMAX YMIN 10) + ElementLine(XMAX YMAX XMIN YMAX 10) + ) + Mark(0 0) + )') + Note that the part has been defined with the mark located at `(0,0)' +and that the pads have been placed with the mark at the common centroid +of the footprint. While not a requirement, this is highly desirable +when developing a library that will need to interface with a pick and +place machine used for factory assembly of a board. + + The final part of `example.inc' defines particular versions of the +generic footprint we have created. These particular versions correspond +to various industry standard package sizes. + # 0402 package + # + # 30x30 mil pad, 15 mil metal-metal spacing=> + # 15 + 15 + 15 = 45 center-to-center + define(`PKG_RC0402', + `COMMON_PKG_RCSMT(`$1', `$2', `$3', 30, 30, 45, 0, 10, "no")') + + # 0603 package + # + # 40x40 mil pad, 30 mil metal-metal spacing=> + # 30 + 20 + 20 = 70 center-to-center + define(`PKG_RC0603', + `COMMON_PKG_RCSMT(`$1', `$2', `$3', 40, 40, 70, 10, 10)') + + # 1206 package + # + # 40x60 mil pad, 90 mil metal-metal spacing=> + # 90 + 20 + 20 = 130 center-to-center + define(`PKG_RC1206', + `COMMON_PKG_RCSMT(`$1', `$2', `$3', 60, 40, 130, 10, 10)') + + At this point, the `example.inc' file could be used by third party +tools such as `gsch2pcb'. However to fully integrate our footprints +into PCB we need to create the `example.m4' and `example.list' files. +The `example.m4' file defines descriptions for the new footprints. + define(`Description_my_RC0402', + ``Standard SMT resistor/capacitor (0402)'') + define(`Description_my_RC0603', + ``Standard SMT resistor/capacitor (0603)'') + define(`Description_my_RC1206', + ``Standard SMT resistor/capacitor (1206)'') + Finally we need to create the `example.list' file. + my_RC0402:RC0402:RES0402 + my_RC0402:RC0402:CAP0402 + my_RC0603:RC0603:RES0603 + my_RC0603:RC0603:CAP0603 + my_RC1206:RC1206:RES1206 + my_RC1206:RC1206:CAP1206 + The first field in the list file has the name corresponding to the +Description definitions in `example.m4'. The second field is the +template name which corresponds to the macros `PKG_*' we defined in +`example.inc' with the leading `PKG_' removed. It is the second field +which controls what footprint will actually appear on the board. The +final field is the name of the part type on the board. The first line +in our `example.list' file will produce a menu entry in the library +window that reads: + CAP0402, Standard SMT resistor/capacitor (0402) + The `CAP0402' portion comes directly from the third field in +`example.list' and the longer description comes from descriptions +macros in `example.m4'. Please note that any extra white space at the +end of a line in the `.list' files will cause them to not work properly. + +9.1.4 Troubleshooting Old Style Libraries +----------------------------------------- + +A powerful technique to help debug problems with libraries is to invoke +the `m4' processor directly. This approach will provide error output +which is not visible from within PCB. The following example shows how +one might try to debug an 8 pin small outline (SO8) package. The macro +name for the package is PKG_SO8. In this example, the canonical name +that is to be associated with the part is SO8, the reference designator +is U1, and the value is MAX4107 (the part number). + + echo "PKG_SO8(SO8, U1, MAX4107)" | \ + gm4 common.m4 - | \ + awk '/^[ \t]*$/ {next} {print}' | \ + more + The `awk' call simply removes blank lines which make the output hard +to read. + + For this particular example, the output is: + Element(0x00 "SO8" "U1" "MAX4107" 146 50 3 100 0x00) + ( + Pad(10 25 38 25 20 "1" 0x00) + Pad(10 75 38 75 20 "2" 0x100) + Pad(10 125 38 125 20 "3" 0x100) + Pad(10 175 38 175 20 "4" 0x100) + Pad(214 175 242 175 20 "5" 0x100) + Pad(214 125 242 125 20 "6" 0x100) + Pad(214 75 242 75 20 "7" 0x100) + Pad(214 25 242 25 20 "8" 0x100) + ElementLine(0 0 151 0 10) + ElementArc(126 0 25 25 0 180 10) + ElementLine(101 0 252 0 10) + ElementLine(252 0 252 200 10) + ElementLine(252 200 0 200 10) + ElementLine(0 200 0 0 10) + Mark(29 25) + ) + +9.2 New Style Libraries +======================= + +Footprints for the new style library are created graphically using the +PCB program. A single footprint is saved in each file. + +9.2.1 Creating Newlib Footprints +-------------------------------- + +To create + 1. Start PCB with an empty layout. + + 2. Make the component layer active. + + 3. For a leaded part, select the via tool and place vias where the + pads for the part should go. For surface mount pads, draw line + segments. Note that until the footprint is completed, the surface + mount pads will remain rounded. Currently a rectangle or polygon + may not be used as a pad. + + 4. For each via and line segment which will become a pad, select it + and press 'n' to be able to enter a name. Enter the pin number + and press enter. + + 5. Make the silk layer active. + + 6. Using the line and arc tools, draw a silk screen outline for the + part. + + 7. Using the selection tool, select all of the pins and silk screen + for the part. + + 8. Place the pointer above the reference point for the part. This is + typically the common centroid. Keeping the pointer there, + shift-right-click to bring up the popup menu and choose "convert + selection to element". + + 9. At this point, the vias, line segments, and silk screen will have + been converted to an element. To change any of the line segments + to have square ends rather than round ends, select the pads by + holding down the shift key and clicking each pad with the center + mouse button. Now under the Select menu, "Change square-flag of + selected objects" section, choose "Pins". + + 10. Select the element, shift-right-click to bring up the popup menu, + and choose "Copy Selection to Buffer". Now left-click on the + center of the new element. + + 11. Under the buffer menu, choose "save buffer elements to file" to + save the new footprint to a file. + + 12. Press ESC to exit from buffer mode. + +9.2.2 Modifying Newlib Footprints +--------------------------------- + + 1. In the `Pcb' program, instantiate the footprint you wish to modify. + + 2. Using the selection tool, select the footprint. + + 3. Now left-click on the selected element, this brings up a popup + menu, choose "Cut Selection to Buffer" from the popup menu. + + 4. Under the buffer menu, choose "break buffer element to pieces", + and then left-click to place the broken apart footprint to an open + area of the layout. Note that you must use the items under the + buffer menu, the items with the same names in the popup menu do + not work. + + 5. Make your desired modifications to the footprint and then convert + the pieces back to an element using the same procedure as when + starting from scratch on a new footprint. + + +File: pcb.info, Node: Schematic Frontends, Next: Installation, Prev: Library Creation, Up: Top + +10 Schematic Capture for PCB +**************************** + +When designing a circuit board of any complexity, a schematic capture +front-end for the design is highly desired. Any schematic capture +program which is able to generate a netlist in a user defined format as +well as a bill of materials can be made to work with PCB. Currently, we +are aware of two freely available schematic capture programs which can +interface with PCB. This chapter shows how a design can be taken from +start to finish using either of these two tools for schematic capture +and PCB for layout. + +* Menu: + +* gEDA:: Interfacing with GNU EDA (gEDA). +* xcircuit:: Interfacing with xcircuit. + + +File: pcb.info, Node: gEDA, Next: xcircuit, Up: Schematic Frontends + +10.1 gEDA +========= + +This section shows how to use gEDA as the schematic capture front-end +for a PCB design. This section is not intended to be complete +documentation on gEDA and it is assumed that the user has at least some +familiarity with the gEDA suite of programs. + + The basic steps in a gEDA + PCB design flow are: + 1. Set up project directories + + 2. Set up gEDA (gschem/gnetlist) config files + + 3. Set up gsch2pcb config files + + 4. Capture schematics using `gschem' (part of gEDA) + + 5. Create any unique PCB footprints needed for the design + + 6. Generate initial PCB design using `gsch2pcb' (part of gEDA) + + 7. Layout circuit board using `pcb' + + 8. Make any additional schematic changes with `gschem' and forward + annotate to PCB with `gsch2pcb' + + 9. Generate photoplot files (RS-274X, also known as "Gerber") for + board vendor + +10.1.1 Set Up Project Directories +--------------------------------- + +Although not required, a typical project directory will contain the +schematics and board layout at the top level. Schematic symbols and +circuit board footprints which are unique to this project are stored in +subdirectories. For this example, `sym' contains the project specific +schematic symbols and `pkg' contains the project specific footprints. +Set up the project subdirectory and subdirectories by executing: + mkdir ~/myproj + cd ~/myproj + mkdir sym + mkdir pkg + mkdir pkg/newlib + mkdir pkg/m4 + +10.1.2 Set Up gEDA Config Files +------------------------------- + +The gEDA tools, specifically `gschem' and `gnetlist', use configuration +files to set the search path for symbol libraries in addition to other +user preferences. Create a file in the top level project directory +called `gschemrc'. Add the following lines to that file: + + ;; list libraries here. Order matters as it sets the + ;; search order + (component-library "./sym") + This sets the local search path for the schematic capture program +`gschem'. Now the netlister, `gnetlist', must also be configured. +This can be done by copying the file `gschemrc' to `gnetlistrc' by +running `cp gschemrc gnetlistrc'. Alternatively, you can create a soft +link so only a single file needs to be updated if additional symbol +paths are added. The link is created by running `ln -s gschemrc +gnetlistrc'. + +10.1.3 Set Up `gsch2pcb' Config Files +------------------------------------- + +The program `gsch2pcb', not to be confused with the older `gschem2pcb' +script, is used to link the schematic to layout. `gsch2pcb' is +responsible for creating the netlist used to provide connectivity +information to PCB as well creating an initial layout with all +components instantiated in the design. Forward annotation of schematic +changes to the layout is also done using `gsch2pcb'. `gsch2pcb' uses a +project file to set up the schematic file names, PCB library locations, +and output file names. Create a project file called `project' using +the following as an example: + + # List all the schematics to be netlisted + # and laid out on the pc board. + schematics first.sch second.sch third.sch + + # For an output-name of foo, gsch2pcb generates files + # foo.net, foo.pcb, and foo.new.pcb. If there is no + # output-name specified, the file names are derived from + # the first listed schematic, i.e. first.net, etc. + output-name preamp + +10.1.4 Capture Schematics Using `gschem' +---------------------------------------- + +This section is fairly brief and assumes familiarity with using the +`gschem' schematic capture program. As you are creating your +schematics, be sure to observe the following rules: + * Make sure that each component in the schematic has a `footprint' + attribute that corresponds to a footprint in the PCB library or a + footprint you plan on creating. + + * Make sure all reference designators are unique. One way to ensure + this is to run the `refdes_renum' script (part of gEDA) after the + schematics are created. + +10.1.5 Create Any Unique PCB Footprints +--------------------------------------- + +Create the new footprints you design needs using either the m4 style or +newlib style of PCB libraries. Refer to *note Library Creation:: for +details on this process. For m4 style footprints, store them in the +`pkg/m4' subdirectory and for newlib footprints, store them in the +`pkg/newlib' subdirectory. + +10.1.6 Generate Initial PCB Design Using `gsch2pcb' +--------------------------------------------------- + +The `gsch2pcb' program connects the schematic and layout. It basic +operation is to call `gnetlist' to generate the connectivity netlist +that PCB used to verify connectivity and to instantiate all elements +found in the schematic to a new layout. The default, as of `gsch2pcb' +version 0.9, is to use any found m4 style parts first and then search +for newlib style if no old style part was found. By using the +`--use-files' or `-f' flag to `gsch2pcb' priority is given to newlib +style parts even if m4 style are found. You may wish to verify this in +the `gsch2pcb' documentation in case this changes in the future. To +start your layout, run `gsch2pcb project' where `project' is the +project file created previously. This will create a new netlist file, +`preamp.net', and a new layout file, `preamp.pcb'. + +10.1.7 Layout Circuit Board +--------------------------- + +Run PCB on the new layout by running `pcb preamp.pcb'. Load the +netlist file by selecting "load netlist file" from the "file" menu. In +the file selection dialog box, choose `preamp.net'. This loads +connectivity information into PCB. + + Using the selection tool, grab and move apart the various footprints +with the middle mouse button. Once the parts are moved apart from each +other, choose "optimize rats-nest" from the "Connects" menu. This menu +choice will display and optimize the rats nest. Use the rats nest to +help guide placement of the parts. You may wish to re-run the "optimize +rats-nest" command after moving parts around. + + After the placement is complete, use the line tool to add traces to +the board. As traces are added, the corresponding rats line will +disappear. + +10.1.8 Forward Annotation of Schematic Changes +---------------------------------------------- + +If schematic changes are made after the layout has started, `gsch2pcb' +can be used to forward annotate these changes to the layout. To +forward annotate schematic changes, run `gsch2pcb project'. This +command will create the files `preamp.new.pcb', `preamp.net', and +modify the file `preamp.pcb'. The modifications to `preamp.pcb' +include forward annotation of schematic component value changes, adds +any new components, and removes any deleted components. + +10.1.9 Generate Photoplot Files (RS-274X) +----------------------------------------- + +After the layout is complete, choose "edit layer-groupings" from the +"Settings" menu. The LayerGroups form lets you specify which layers +will appear in each output layer group. For example, in the default +form, layer group 1 has "front" and "front side" in it. The output +file `1.gbr' if DOS file names are used, or `somename_front.gbr' if +long file names are used will contain the "front" and "front side" +layers in it. Usually the defaults are sufficient, but this form is +still a useful reference. + + Choose "print layout..." from the "File" menu. In the print dialog +box, select "Gerber/RS-274X" for the device driver. Select the +"outline", "alignment", and "drillhelper" options. To get DOS +compatible file names, select the "DOS (8.3) names" option, otherwise +enter "preamp" for the filename. Press "OK". + + The following output files should have been created in the project +directory. The names in parentheses correspond to the DOS compatible +output file names. +`preamp_frontsilk.gbr (csilk.gbr)' + Top side silk screen. + +`preamp_frontmask.gbr (cmask.gbr)' + Top side soldermask relief. + +`preamp_front.gbr (1.gbr)' + Top copper. + +`preamp_backmask.gbr (smask.gbr)' + Bottom side soldermask relief. + +`preamp_back.gbr (2.gbr)' + Bottom Copper. + +`preamp_fab.gbr (fab.gbr)' + Fabrication drawing. Also known as the drill drawing. This + drawing is used for reference by the board vendor but is not + directly used in the fabrication process. + +`preamp_plated-drill.cnc (pdrill.cnc)' + NC Drill format file for the plated through holes. + +`preamp_unplated-drill.cnc (udrill.cnc)' + NC Drill format file for the unplated through holes. + +`preamp_bom.txt (bom.txt)' + A bill of materials for the layout. + +`preamp_xy.txt (xy.txt)' + Centroid (X-Y) data for driving automated assembly equipment. + + +File: pcb.info, Node: xcircuit, Prev: gEDA, Up: Schematic Frontends + +10.2 xcircuit +============= + +If anyone cares to contribute this section, it will get added. Please +submit changes to the bug tracking system for PCB which can be found +from the PCB homepage at `http://pcb.gpleda.org'. + + +File: pcb.info, Node: Installation, Next: Custom Menus, Prev: Schematic Frontends, Up: Top + +Appendix A Installation and Troubleshooting +******************************************* + +Compiling and installing the package should be straightforward. If any +problems occur, please contact the author , +or the current maintainer to find a +solution and include it into the next release. + +* Menu: + +* compiling:: Compiling and installing. +* problems:: Troubleshooting. + + +File: pcb.info, Node: compiling, Next: problems, Up: Installation + +A.1 Compiling and Installing +============================ + +This section covers the steps which are necessary to compile the +package. + +* Menu: + +* quickstart:: Quick start. +* running configure:: Customizing Pcb with Configure + + +File: pcb.info, Node: quickstart, Next: running configure, Up: compiling + +A.1.1 Quick Start +----------------- + +Starting with version 2.0, `Pcb' has switched to a GNU +autoconf/automake build system. Installation of `Pcb' consists of +three steps: configuration, building, and installing. In a typical +installation, these steps are as simple as + ./configure + make + make install + + +File: pcb.info, Node: running configure, Prev: quickstart, Up: compiling + +A.1.2 Running the configure Script +---------------------------------- + +The `configure' script accepts all of the standard GNU configure +options. For a complete list of configuration options, run +`./configure --help'. + +`INFOLIBDIR' + must be set to the directory where your GNU info files are located. + +`PCBLIBDIR' + is the path of a directory where the font files will be installed. + +`DEFAULTFONT' + the name of the default font file. + +`DEFAULTLIBRARY' + the name of the default library. + +`GNUM4' + the name of GNUs m4 version. + +`BTNMOD' + If your window manager has already bound _Mod1_ together with some + function keys you may want to change this setting. This is true + for HP-VUE. + + + If you find things which must be changed to compile on your system, +please add the appropriate autoconf tests (if you are familiar with +that) and mail a copy to the maintainer, harry eaton, at +. + + If you do not have the appropriate permissions you should run +`./pcbtest.sh' in the `src' directory to run `Pcb' from the +installation directory. + + +File: pcb.info, Node: problems, Prev: compiling, Up: Installation + +A.2 Troubleshooting +=================== + +There are some known problems. Most of them are related to missing +parts of a standard `X11' distribution. Some others are caused by third +party applications such as `X' servers. To make this list more complete +please mail your problems and, if available, solutions to the author. +The mail address may be found at the beginning of this chapter. In any +case, read *note X11::. + + By the way, you `MUST HAVE AN ANSI COMPILER' to make `Pcb' work. + + Another source of problems are older versions of `flex' and `bison'. +`Pcb' definitely works with `flex-2.4.7' and `bison-1.22' or later. The +problems will result in a _syntax error_ while parsing files. This +should only be a problem if you have modified the `flex' or `bison' +input files. + + The following list gives you just an idea because I'm not able to +test all `Pcb' releases on all platforms. + +* Menu: + +* HP:: Hewlett-Packard series 700 and 800 running HP-UX 10.* +* Sun:: Sun, Solaris 2.5 +* SGI:: SGI, IRIX 5.3 and 6.* +* DEC Alpha:: DEC Alpha, DEC UNIX 3.2c and 4.0 +* SCO:: SCO Unix ODT 3.0, PC hardware +* Linux:: Linux 0.99pl14 and later +* BSD:: FreeBSD, NetBSD ... +* X11:: Refers to `X11R4', `X11R5', and `OpenWindows' +* TeX and Manuals:: Problems creating the `pcb.dvi' + + +File: pcb.info, Node: HP, Next: Sun, Up: problems + +A.2.1 HP Series 700 and 800 +--------------------------- + +You have to install several `X11' include files or, better, install a +complete `X11R5' release. Hewlett-Packard doesn't support the Athena +Widgets. So the header files and libraries are missing from the +application media, but they are available as a patch. They also do not +ship the `ANSI' compiler with the normal operating system release so +you have to buy one or use `GCC'. Some of the tools are available as +patches. + + In addition, `Pcb' has been successfully tested on these platforms +with `HPUX 9.*, 10.*' running self-compiled `X11R5'. + + +File: pcb.info, Node: Sun, Next: SGI, Prev: HP, Up: problems + +A.2.2 Sun SPARC architecture +---------------------------- + +There are no known problems with Sun machines if they use `X11R5' +instead of `OpenWindows'. `Pcb' compiled successfully with all kinds of +SPARCstations `Solaris-2.[345]'. + + For problems with `OpenWindows' refer to *note X11::. + + +File: pcb.info, Node: SGI, Next: DEC Alpha, Prev: Sun, Up: problems + +A.2.3 Silicon Graphics +---------------------- + +`Pcb' has been tested on some boxes running either `IRIX-4.0.5' or +`IRIX-5.3'. The former one uses a `X11R4' server. There are no +problems. For known problems with `X11R4', see *note X11::. + + +File: pcb.info, Node: DEC Alpha, Next: SCO, Prev: SGI, Up: problems + +A.2.4 DEC Alpha +--------------- + +`Pcb' compiled and runs without problems on `DEC UNIX V3.2c'. + + +File: pcb.info, Node: SCO, Next: Linux, Prev: DEC Alpha, Up: problems + +A.2.5 SCO Unix +-------------- + +John DuBois wrote: + `SCO-ODT-3.0' requires the latest version of tls003, the Athena + widget library (available from sosco.sco.com). The main problems + I have encountered are it core dumps fairly often, especially + while loading/dropping elements... + I'll see what I am able to do as soon as I have access to an `SCO' +system. + + +File: pcb.info, Node: Linux, Next: BSD, Prev: SCO, Up: problems + +A.2.6 Linux +----------- + +Since the `X11' version of `Pcb' has been developed on a Linux system +here are no known problems. + + +File: pcb.info, Node: BSD, Next: X11, Prev: Linux, Up: problems + +A.2.7 FreeBSD and NetBSD +------------------------ + +`Pcb' has been tested on NetBSD and works without any problems. You +may also be able to find a NetBSD package at +`ftp://ftp.netbsd.org/pub/NetBSD/packages/cad/pcb/README.html' or a +FreeBSD port at +`http://www.freebsd.org/cgi/url.cgi?ports/cad/pcb/pkg-descr'. + + +File: pcb.info, Node: X11, Next: TeX and Manuals, Prev: BSD, Up: problems + +A.2.8 Problems related to X11 +----------------------------- + +There are a some problems related to `X11R4' or systems derived from +`X11' such as `OpenWindows'. *Note Sun::. You at least have to change +all occurances of _baseTranslations_ in the resource files to +_translations_ if you are using a `X11R4' server. Look at the `X11R5' +_Intrinsics_ manual for details. + + The panner widget (print dialog box) appears only in release `X11R5' +and later. It really simplifies adjusting the offsets. With earlier +releases the printout will always appear in the center of the page. + + You may have some problems in a mixed `X11-OpenWindows' environment. + + `Pcb' has been tested successfully with `X11R6' under Linux 1.1.59 +and later. + + +File: pcb.info, Node: TeX and Manuals, Prev: X11, Up: problems + +A.2.9 Problems related to TeX +----------------------------- + +If your `TeX' installation complains about a missing `texinfo.tex' file +copy the one included in this release (directory `doc' to your `TeX' +macro directory. Note, there are probably newer versions of this file +available from some FTP sites. `TeX-3.0' failed, `TeX-3.14' worked +just fine. Check our FTP server _ftp.uni-ulm.de_ for ready-to-print +versions of the manuals. + + +File: pcb.info, Node: Custom Menus, Next: Regular Expressions, Prev: Installation, Up: Top + +Appendix B Customizing the Menus +******************************** + +The menu system is driven off a data file that contains "resources". A +resource is a hierarchical description of a data tree which, in this +case, is mapped to the hierarchical menus used by Pcb. + +* Menu: + +* Resource Syntax:: What a resource file looks like. +* Menu Definitions:: Using a resource to define a menu. +* Menu Files and Defaults:: Where Pcb looks for its menu resource. + + +File: pcb.info, Node: Resource Syntax, Next: Menu Definitions, Up: Custom Menus + +B.1 Resource Syntax +=================== + +A resource file is a simple text file. It contains curly braces to +group things, spaces between things, and double quotes when strings +need to include spaces. There are four fundamental ways of adding data +to a resource. + + First, a string (either a single word or a quoted string with spaces, +we call both "strings" in this appendix) can be added all by itself, to +add a string resource to the current resource. This is used, for +example, to define the string printed on a menu button. In this +example, four strings are added to the FILE resource: + + File = { + Sample + "longer sample" + some text + } + + Second, a named string may be added by giving two strings separated +by an equals sign. This is used to specify X resources and a few other +optional parameters of menus, for example. Note that a string all by +itself is thus an "unnamed" string. + + {"Layer groups" foreground=red sensitive=false} + + Third, an unnamed subresource may be added. This is used to create +submenus and menu buttons. To add a subresource, simply group other +things in curly braces. This example describes a resource containing +one string and three subresources: + + {File + {New do_new()} + {Save do_save()} + {Quit do_quit()} + } + + Lastly, a named subresource may be added by prefixing an unnamed +subresource with a string and an equals sign, just as when naming +strings. This syntax is used to name the resources used for the main +menu and popup menus: + + MainMenu = { + ... + } + + Additionally, the menu parser allows for "hooks" whereby portions of +the menu system can be programmatically created at runtime by the +application. These hooks are invoked by a single word proceeded by an +at sign, such as this example where most of the Sizes menu is created +automatically: + + {Sizes + @sizes + {"Adjust active sizes ..." AdjustStyle(0)} + } + + In addition to all that, any unquoted pound sign (`#') begins a +comment. Commented text continues until the end of the containing +line. Comments may begin at the beginning of a line, or after other +text on the line: + + # This is a comment + MainMenu = { # This is also a comment + + +File: pcb.info, Node: Menu Definitions, Next: Menu Files and Defaults, Prev: Resource Syntax, Up: Custom Menus + +B.2 Menu Definitions +==================== + +To best understand this section, you should find the `pcb-menu.res' +file that your Pcb uses and refer to it for examples (*note Menu Files +and Defaults::). Note that the lesstif GUI uses `pcb-menu.res' and the +GTK+ GUI uses `gpcb-menu.res'. The file format is identical however +and if so desired, one can make one file be a soft link to the other. + + A resource defines a menu when it meets certain semantic +requirements. The menu hierarchy is reflected as a hierarchy of unnamed +subresources, with the first string of each subresource defining the +label used for the menu button. A subresource that itself contains +subresources becomes a submenu, a subresource that does not becomes a +button. + + A submenu should only contain subresources for the buttons or +submenus within that submenu. Two exceptions are allowed: an initial +string sets the label, and the string "-" (a single dash) will create a +separator. + + A button should not contain subresources, but will contain many +strings, named and unnamed. The first member shall be an unnamed +string which is the label for the button. Any other unnamed strings +within the button's resource will be used as actions (much like the +.Xdefaults action strings), which are functions that will be called +when the button is pressed (or popped up, or created, depending on the +action). As a convenience, if a left parenthesis is seen, the current +"word" will continue at least until the matching right parenthesis. +This allows you to pass strings with spaces as arguments to actions +without needing to quote the action. + + Named resources in button resources will be used as X resources. +Such resources can be used to set the font, color, and spacing of +buttons. As a convenience, "fg" can be used as an abbreviation for +"foreground". + + Within the menu's resource file, Pcb will look for a few key named +subresources. At the moment, the only one it looks for is one called +`MainMenu'. This will be used for the main menu bar. In the future, +other named subresources will be used for popup resources. + + Given all this, a small sample `pcb-menu.res' would be: + + MainMenu = { + {File + {"Load layout" Load(Layout)} + - + {"Quit Program" Quit() fg=red font=10x20} + } + } + + Within the Pcb sources are specially crafted comments that mark all +the actions, flags, menu hooks, and whatnot that Pcb offers. Read the +file `src/gather-actions' in the Pcb source tree for documentation for +these comments. + + +File: pcb.info, Node: Menu Files and Defaults, Prev: Menu Definitions, Up: Custom Menus + +B.3 Menu Files and Defaults +=========================== + +Pcb will look for a file which defines its menus, trying the following +names (the example is for the lesstif GUI, the GTK+ GUI has +"gpcb-menu.res" in place of "pcb-menu.res"): + + ./pcb-menu.res + $HOME/.pcb-menu.res + $PCBLIBDIR/pcb-menu.res + + + Note that PCBLIBDIR defaults to `/usr/local/share/pcb' (hence, +`/usr/local/share/pcb/pcb-menu.res'). The `' entry refers to +a menu definition within the Pcb application itself. The master file +for all this is the file `src/pcb-menu.res' in the Pcb source tree. +This master source is used to create the internal menu definition as +well as being installed in `$pcblibdir'. + + +File: pcb.info, Node: Regular Expressions, Next: Standard Drill Sizes, Prev: Custom Menus, Up: Top + +Appendix C Element Search/Regular Expressions +********************************************* + +C.1 Element Search/Regular Expressions +====================================== + +`Pcb''s search is based on POSIX 1003.2 Regular Expressions. Full POSIX +Regular Expressions are supported by `Pcb' if the regex library was +available when `Pcb' was built. One difference from the regular +expressions found in tools like awk or grep is that PCB implicitly adds +a "^" to the begining of a regular expression and "$" to the end of the +regular expression. For example, if you enter "C1", the actual regular +expression used internally is "^C1$". Another difference is that +search patterns in pcb are not case sensitive. That is, "CON" is +treated the same as "con". + + It is easier to show by example how to search than explain POSIX +1003.2. With regular expressions most characters are just themselves, +but some are special: + +`*' + Matches 0 or more instances of preceding character. + +`+' + Matches 1 or more instances of preceding character. + +`?' + Matches 0 or 1 instances of preceding character. + +`.' + Matches any single character other than the newline character. + +`|' + The vertical bar is the alternation operator. It combines two + regular expressions. The result matches if either of them matches. + +`\' + A backslash indicates the next character should not be interpreted + literally if it normally is, and should be interpreted literally + if it normally isn't. + +`{n}' + An integer n enclosed in curly brackets matches the preceding item + if it occurs exactly n times. + +`[ ]' + A pair of square brackets matches every character they contain. + Characters may be given explicitly, or as ranges. + +`-' + A hyphen in the context of square brackets denotes the range + between the preceding and the following character. E.g., the + range of digits is "0-9" . The range of letters from C to K is + "C-K" . + +`\^ inside square brackets' + Inside square brackets the caret is an anti operator. Its presence + makes the square prackets match anything except the contents of + the brackets. + +`( )' + Round parenthesis group parts of a regular expression. This is + very much like they do in math formulars. + + + If you need a special character literally, you can escape it with a +backslash. + + The following examples illustrate how regular expressions can be +used to specify element names (reference designators) to search for. +`C5' + Select the element whose name is exactly "C5". + +`C5 | R3' + Select C5 and R3. + +`C.*' + Select all elements whose name start with the letter "C", such as + C5, or C42, or CF1. + +`C.*1' + Select all elements that start with "C" and end with "1", such as + C1, or C51 or C5/9B71. + +`R10?' + Search for R1 or R10, but will not select R100 or R105. The + question mark is a quantifier for the character "0". + +`R128+' + Selects R128, R1288, R12888, etc. + +`TB.' + Select all terminal blocks having exactly one character designator + after "TB" such as TB1, TBA, or TBx but not TB. + +`TB..' + Select all terminal blocks having a two character designator such + as TB21 or TB1a. + +`TB.*' + Select all terminal blocks with any designator. + +`.*31' + Select all items, whose name ends with "31" such as Q31, or R31, + or R531. + +`Q[12]' + Select Q1 and Q2. + +`[A-D].*' + Select all items, whose name starts with "A", "B", "C", or "D". + +`.*N{2}.*' + Select all items, whose name contains two "N" in a row such as + CONN23, or connA, but not CON5 + +`[^D].*' + Select all items that do not start with the letter "D", such as + C2, or R34, but not D34 + + + +File: pcb.info, Node: Standard Drill Sizes, Next: Centroid File Format, Prev: Regular Expressions, Up: Top + +Appendix D Standard Drill Size Tables +************************************* + +D.1 American Standard Wire Size Drills +====================================== + +Drill Diameter Drill Diameter Drill Diameter +Size (inches) Size (inches) Size (inches) +97 .0059 96 .0063 95 .0067 +94 .0071 93 .0075 92 .0079 +91 .0083 90 .0087 89 .0091 +88 .0095 87 .0100 86 .0105 +85 .0110 84 .0115 83 .0120 +82 .0125 81 .0130 80 .0135 +79 .0145 78 .0160 77 .0180 +76 .0200 75 .0210 74 .0225 +73 .0240 72 .0250 71 .0260 +70 .0280 69 .0292 68 .0310 +67 .0320 66 .0330 65 .0350 +64 .0360 63 .0370 62 .0380 +61 .0390 60 .0400 59 .0410 +58 .0420 57 .0430 56 .0465 +55 .0520 54 .0550 53 .0595 +52 .0635 51 .0670 50 .0700 +49 .0730 48 .0760 47 .0785 +46 .0810 45 .0820 44 .0860 +43 .0890 42 .0935 41 .0960 +40 .0980 39 .0995 38 .1015 +37 .1040 36 .1065 35 .1100 +34 .1110 33 .1130 32 .1160 +31 .1200 30 .1285 29 .1360 +28 .1405 27 .1440 26 .1470 +25 .1495 24 .1520 23 .1540 +22 .1570 21 .1590 20 .1610 +19 .1660 18 .1695 17 .1730 +16 .1770 15 .1800 14 .1820 +13 .1850 12 .1890 11 .1910 +10 .1935 9 .1960 8 .1990 +7 .2010 6 .2040 5 .2055 +4 .2090 3 .2130 2 .2210 +1 .2280 + +D.2 American Standard Letter Size Drills +======================================== + +Drill Diameter Drill Diameter Drill Diameter +Size (inches) Size (inches) Size (inches) +A .2340 B .2380 C .2420 +D .2460 E .2500 F .2570 +G .2610 H .2660 I .2720 +J .2770 K .2810 L .2900 +M .2950 N .3020 O .3160 +P .3230 Q .3320 R .3390 +S .3480 T .3580 U .3680 +V .3770 W .3860 X .3970 +Y .4040 Z .4130 + +D.3 Fractional Inch Size Drills +=============================== + +Drill Diameter Drill Diameter Drill Diameter +Size (inches) Size (inches) Size (inches) +1/64 .0156 1/32 .0313 3/64 .0469 +1/16 .0625 5/64 .0781 3/32 .0938 +7/64 .1094 1/8 .1250 9/64 .1406 +5/32 .1562 11/64 .1719 3/16 .1875 +13/64 .2031 7/32 .2188 15/64 .2344 +1/4 .2500 17/64 .2656 9/32 .2812 +19/64 .2969 5/16 .3125 21/64 .3281 +11/32 .3438 23/64 .3594 3/8 .3750 +25/64 .3906 13/32 .4062 27/64 .4219 +7/16 .4375 29/64 .4531 15/32 .4688 +31/64 .4844 1/2 .5000 33/64 .5156 +17/32 .5313 35/64 .5469 9/16 .5625 +37/64 .5781 19/32 .5938 39/64 .6094 +5/8 .6250 41/64 .6406 21/32 .6562 +43/64 .6719 11/16 .6875 45/64 .7031 +23/32 .7188 47/64 .7344 3/4 .7500 +49/64 .7656 25/32 .7812 51/64 .7969 +13/16 .8125 53/64 .8281 27/32 .8438 +55/64 .8594 7/8 .8750 57/64 .8906 +29/32 .9062 59/64 .9219 15/16 .9375 +61/64 .9531 31/32 .9688 63/64 .9844 +1 1.0000 + +D.4 Metric Drills +================= + +Drill Diameter Drill Diameter Drill Diameter +Size (inches) Size (inches) Size (inches) +0.20 mm .00787 0.25 mm .00984 0.30 mm .0118 +0.35 mm .0138 0.40 mm .0158 0.45 mm .0177 +0.50 mm .0197 0.55 mm .0217 0.60 mm .0236 +0.65 mm .0256 0.70 mm .0276 0.75 mm .0295 +0.80 mm .0315 0.85 mm .0335 0.90 mm .0354 +0.95 mm .0374 1.00 mm .0394 1.05 mm .0413 +1.10 mm .0433 1.15 mm .0453 1.20 mm .0472 +1.25 mm .0492 1.30 mm .0512 1.35 mm .0531 +1.40 mm .0551 1.45 mm .0571 1.50 mm .0591 +1.55 mm .0610 1.60 mm .0630 1.65 mm .0650 +1.70 mm .0669 1.75 mm .0689 1.80 mm .0709 +1.85 mm .0728 1.90 mm .0748 1.95 mm .0768 +2.00 mm .0787 2.05 mm .0807 2.10 mm .0827 +2.15 mm .0846 2.20 mm .0866 2.25 mm .0886 +2.30 mm .0906 2.35 mm .0925 2.40 mm .0945 +2.45 mm .0965 2.50 mm .0984 2.55 mm .1004 +2.60 mm .1024 2.65 mm .1043 2.70 mm .1063 +2.75 mm .1083 2.80 mm .1102 2.85 mm .1122 +2.90 mm .1142 2.95 mm .1161 3.00 mm .1181 +3.10 mm .1220 3.15 mm .1240 3.20 mm .1260 +3.25 mm .1280 3.30 mm .1299 3.40 mm .1339 +3.50 mm .1378 3.60 mm .1417 3.70 mm .1457 +3.75 mm .1476 3.80 mm .1496 3.90 mm .1535 +4.00 mm .1575 4.10 mm .1614 4.20 mm .1654 +4.25 mm .1673 4.30 mm .1693 4.40 mm .1732 +4.50 mm .1772 4.60 mm .1811 4.70 mm .1850 +4.75 mm .1870 4.80 mm .1890 4.90 mm .1929 +5.00 mm .1969 5.10 mm .2008 5.20 mm .2047 +5.25 mm .2067 5.30 mm .2087 5.40 mm .2126 +5.50 mm .2165 5.60 mm .2205 5.70 mm .2244 +5.75 mm .2264 5.80 mm .2283 5.90 mm .2323 +6.00 mm .2362 6.10 mm .2402 6.20 mm .2441 +6.25 mm .2461 6.30 mm .2480 6.40 mm .2520 +6.50 mm .2559 6.60 mm .2598 6.70 mm .2638 +6.75 mm .2657 6.80 mm .2677 6.90 mm .2717 +7.00 mm .2756 7.10 mm .2795 7.20 mm .2835 +7.25 mm .2854 7.30 mm .2874 7.40 mm .2914 +7.50 mm .2953 7.60 mm .2992 7.70 mm .3031 +8.00 mm .3150 8.10 mm .3189 8.20 mm .3228 +8.25 mm .3248 8.30 mm .3268 8.40 mm .3307 +8.50 mm .3346 8.60 mm .3386 8.70 mm .3425 +8.75 mm .3445 8.80 mm .3465 8.90 mm .3504 +9.00 mm .3543 9.10 mm .3583 9.20 mm .3622 +9.25 mm .3642 9.30 mm .3661 9.40 mm .3701 +9.50 mm .3740 9.60 mm .3780 9.70 mm .3819 +9.75 mm .3839 9.80 mm .3858 9.90 mm .3898 +10.00 mm .3937 10.10 mm .3976 10.20 mm .4016 +10.25 mm .4035 10.30 mm .4055 10.40 mm .4094 +10.50 mm .4134 10.60 mm .4173 10.70 mm .4213 +10.80 mm .4252 10.90 mm .4291 11.00 mm .4331 +11.10 mm .4370 11.20 mm .4409 11.25 mm .4429 +11.30 mm .4449 11.40 mm .4488 11.50 mm .4528 +11.60 mm .4567 11.70 mm .4606 11.75 mm .4626 +11.80 mm .4646 11.90 mm .4685 12.00 mm .4724 +12.50 mm .4921 13.00 mm .5118 13.50 mm .5315 +14.00 mm .5512 14.50 mm .5709 15.00 mm .5906 +15.50 mm .6102 16.00 mm .6299 16.50 mm .6496 +17.00 mm .6693 17.50 mm .6890 18.00 mm .7087 +18.50 mm .7283 19.00 mm .7480 19.50 mm .7677 +20.00 mm .7874 20.50 mm .8071 21.00 mm .8268 +21.50 mm .8465 22.00 mm .8661 22.50 mm .8858 +23.00 mm .9055 23.50 mm .9252 24.00 mm .9449 +24.50 mm .9646 25.00 mm .9843 + + +File: pcb.info, Node: Centroid File Format, Next: Action Reference, Prev: Standard Drill Sizes, Up: Top + +Appendix E Centroid (X-Y) File Format +************************************* + +E.1 Overview +============ + +E.2 File Format +=============== + +The centroid output file is in a standard comma seperated values (CSV) +format. Comment lines begin with a "#". The output file contains a +header with an RCS Id tag (useful for those who will check the file +into a version control system), a version number for the file format, +some comments containing the author and title of the board, and a +comment describing the remainder of the file format. + + An example centroid file is shown below. + + + # $Id$ + # PcbXY Version 1.0 + # Date: Fri Jul 22 03:40:08 2005 UTC + # Author: PCB User + # Title: MyBoard - PCB X-Y + # RefDes, Description, Value, X, Y, rotation, top/bottom + # X,Y in mils. rotation in degrees. + # -------------------------------------------- + R61,"0603","10",2610.00,3560.00,90,top + J5,"AMPHENOL_ARFX1231","unknown",2390.00,4220.00,180,top + C13,"0402","0.01u",2340.00,3014.00,270,top + +E.3 Computation of Centroid and Rotation +======================================== + +The center of each element is found by averaging the (X,Y) coordinates +for the center of each pin and pad in the element. For example if an +element has 2 pins, 1 at (1,0) and another at (1,4) then the centroid +will be at (1,2). + + The calculation of rotation is a bit more complex. Currently a +rotation is not stored for each element but rather the rotated element +is stored. In other words if the element from the library has a pin at +(0,0) and (0,2) and it has been rotated by 90 degrees, then the `.pcb' +file will store (0,0) and (2,0) for the pin locations with no +indication that they have been rotated from the original. + + In the event that the element has only 1 pin, then the rotation is +set to zero. If the element has only one pad (as opposed to a +through-hole pin), then the rotation of the pad is used. + + When the element has multiple pins, the location of pin #1 is placed +in the coordinate system which has the centroid of the part at (0,0). +Then which quadrant pin #1 falls in determines the rotation. Zero +degrees of rotation is defined as pin #1 being in the upper left +quadrant. Increasing angles correspond to counterclockwise rotation so +a rotation of 90 degrees places pin #1 in the lower left quadrant. +Currently, the only allowed rotations are 0, 90, 180, and 270 degrees. + + If pin #1 happens to be at the centroid of the part, then pin #2 is +examined to see which quadrant it is located in. The same rules apply +for the definitions of rotation. In other words, when pin #1 is at the +centroid of the part and pin #2 is in the upper left quadrant, the +rotation is declared to be zero degrees. + + +File: pcb.info, Node: Action Reference, Next: Glossary, Prev: Centroid File Format, Up: Top + +Appendix F Action Reference +*************************** + +Many actions take a `delta' parameter as the last parameter, which is +an amount to change something. That `delta' may include units, as an +additional parameter, such as `Action(Object,5,mm)'. If no units are +specified, the default is PCB's native units (currently 1/100 mil). +Also, if the delta is prefixed by `+' or `-', the size is increased or +decreased by that amount. Otherwise, the size size is set to the given +amount. + + Action(Object,5,mil) + Action(Object,+0.5,mm) + Action(Object,-1) + + Actions which take a `delta' parameter which do not accept all these +options will specify what they do take. + + Many actions act on indicated objects on the board. They will have +parameters like `ToggleObject' or `SelectedVias' to indicate what group +of objects they act on. Unless otherwise specified, these parameters +are defined as follows: + +`Object' +`ToggleObject' + Affects the object under the mouse pointer. If this action is + invoked from a menu or script, the user will be prompted to click + on an object, which is then the object affected. + +`Selected' +`SelectedObjects' + Affects all objects which are currently selected. At least, all + selected objects for which the given action makes sense. + +`SelectedPins' +`SelectedVias' +`SelectedTYPE' +`etc' + Affects all objects which are both selected and of the TYPE + specified. + + +* Menu: + +* core actions:: +* common actions:: +* gtk actions:: +* lesstif actions:: + + +File: pcb.info, Node: core actions, Next: common actions, Up: Action Reference + +F.1 Core actions +================ + +* Menu: + +* AddRats Action:: Add one or more rat lines to the board. +* ApplyVendor Action:: Applies the currently loaded vendor drill table to the current design. +* Atomic Action:: Save or restore the undo serial number. +* Attributes Action:: Let the user edit the attributes of the layout, current or given +layer, or selected element. +* AutoPlaceSelected Action:: Auto-place selected components. +* AutoRoute Action:: Auto-route some or all rat lines. +* ChangeClearSize Action:: Changes the clearance size of objects. +* ChangeDrillSize Action:: Changes the drilling hole size of objects. +* ChangeFlag Action:: Sets or clears flags on objects. +* ChangeHole Action:: Changes the hole flag of objects. +* ChangeJoin Action:: Changes the join (clearance through polygons) of objects. +* ChangeName Action:: Sets the name of objects. +* ChangeOctagon Action:: Changes the octagon-flag of pins and vias. +* ChangePaste Action:: Changes the no paste flag of objects. +* ChangePinName Action:: Sets the name of a specific pin on a specific element. +* ChangeSize Action:: Changes the size of objects. +* ChangeSquare Action:: Changes the square flag of pins and pads. +* ClearOctagon Action:: Clears the octagon-flag of pins and vias. +* ClearSquare Action:: Clears the square-flag of pins and pads. +* ClrFlag Action:: Clears flags on objects. +* Connection Action:: Searches connections of the object at the cursor position. +* Delete Action:: Delete stuff. +* DeleteRats Action:: Delete rat lines. +* DisableVendor Action:: Disables automatic drill size mapping. +* DisperseElements Action:: Disperses elements. +* Display Action:: Several display-related actions. +* djopt Action:: Perform various optimizations on the current board. +* DRC Action:: Invoke the DRC check. +* DumpLibrary Action:: Display the entire contents of the libraries. +* elementlist Action:: Adds the given element if it doesn't already exist. +* elementsetattr Action:: Sets or clears an element-specific attribute. +* EnableVendor Action:: Enables automatic drill size mapping. +* execcommand Action:: Runs a command. +* ExecuteFile Action:: Run actions from the given file. +* Flip Action:: Flip an element to the opposite side of the board. +* FontEdit Action:: Convert the current font to a PCB for editing. +* FontSave Action:: Convert the current PCB back to a font. +* FreeRotateBuffer Action:: Rotates the current paste buffer contents by the specified angle. The +angle is given in degrees. If no angle is given, the user is prompted +for one. + +* GlobalPuller Action:: Pull all traces tight. +* h Action:: Print a help message for commands. +* Import Action:: Import schematics. +* l Action:: Loads layout data. +* le Action:: Loads an element into the current buffer. +* LoadFootprint Action:: Loads a single footprint by name. +* LoadFrom Action:: Load layout data from a file. +* LoadVendorFrom Action:: Loads the specified vendor resource file. +* m Action:: Loads a layout into the current buffer. +* MarkCrosshair Action:: Set/Reset the Crosshair mark. +* Message Action:: Writes a message to the log window. +* MinClearGap Action:: Ensures that polygons are a minimum distance from objects. +* MinMaskGap Action:: Ensures the mask is a minimum distance from pins and pads. +* Mode Action:: Change or use the tool mode. +* MorphPolygon Action:: Converts dead polygon islands into separate polygons. +* MoveLayer Action:: Moves/Creates/Deletes Layers. +* MoveObject Action:: Moves the object under the crosshair. +* MoveToCurrentLayer Action:: Moves objects to the current layer. +* Netlist Action:: Perform various actions on netlists. +* New Action:: Starts a new layout. +* OptAutoOnly Action:: Toggles the optimize-only-autorouted flag. +* PasteBuffer Action:: Various operations on the paste buffer. +* Polygon Action:: Some polygon related stuff. +* Puller Action:: Pull an arc-line junction tight. +* q Action:: Quits the application after confirming. +* q! Action:: Quits the application without confirming. +* Quit Action:: Quits the application after confirming. +* Redo Action:: Redo recent``undo''operations. +* RemoveSelected Action:: Removes any selected objects. +* Renumber Action:: Renumber all elements. The changes will be recorded to filename +for use in backannotating these changes to the schematic. +* Report Action:: Produce various report. +* ReportDialog Action:: Report on the object under the crosshair +* RipUp Action:: Ripup auto-routed tracks, or convert an element to parts. +* rn Action:: Reads netlist. +* RouteStyle Action:: Copies the indicated routing style into the current sizes. +* s Action:: Saves layout data. +* SaveSettings Action:: Saves settings. +* SaveTo Action:: Saves data to a file. +* Select Action:: Toggles or sets the selection. +* SetFlag Action:: Sets flags on objects. +* SetOctagon Action:: Sets the octagon-flag of objects. +* SetSame Action:: Sets current layer and sizes to match indicated item. +* SetSquare Action:: sets the square-flag of objects. +* SetThermal Action:: Set the thermal (on the current layer) of pins or vias to the given style. +Style = 0 means no thermal. +Style = 1 has diagonal fingers with sharp edges. +Style = 2 has horizontal and vertical fingers with sharp edges. +Style = 3 is a solid connection to the plane.Style = 4 has diagonal fingers with rounded edges. +Style = 5 has horizontal and vertical fingers with rounded edges. + +* SetValue Action:: Change various board-wide values and sizes. +* ToggleHideName Action:: Toggles the visibility of element names. +* ToggleVendor Action:: Toggles the state of automatic drill size mapping. +* Undo Action:: Undo recent changes. +* UnloadVendor Action:: Unloads the current vendor drill mapping table. +* Unselect Action:: Unselects the object at the pointer location or the specified objects. +* w Action:: Saves layout data. +* wq Action:: Saves the layout data and quits. + + +File: pcb.info, Node: AddRats Action, Next: ApplyVendor Action, Up: core actions + +F.1.1 AddRats +------------- + +AddRats(AllRats|SelectedRats|Close) + +Add one or more rat lines to the board. + +`AllRats' + Create rat lines for all loaded nets that aren't already connected + on with copper. + +`SelectedRats' + Similarly, but only add rat lines for nets connected to selected + pins and pads. + +`Close' + Selects the shortest unselected rat on the board. + + + +File: pcb.info, Node: ApplyVendor Action, Next: Atomic Action, Prev: AddRats Action, Up: core actions + +F.1.2 ApplyVendor +----------------- + +ApplyVendor() + +Applies the currently loaded vendor drill table to the current design. + + This will modify all of your drill holes to match the list of allowed +sizes for your vendor. + + +File: pcb.info, Node: Atomic Action, Next: Attributes Action, Prev: ApplyVendor Action, Up: core actions + +F.1.3 Atomic +------------ + +Atomic(Save|Restore|Close|Block) + +Save or restore the undo serial number. + + This action allows making multiple-action bindings into an atomic +operation that will be undone by a single Undo command. For example, +to optimize rat lines, you'd delete the rats and re-add them. To group +these into a single undo, you'd want the deletions and the additions to +have the same undo serial number. So, you `Save', delete the rats, +`Restore', add the rats - using the same serial number as the deletes, +then `Block', which checks to see if the deletions or additions +actually did anything. If not, the serial number is set to the saved +number, as there's nothing to undo. If something did happen, the +serial number is incremented so that these actions are counted as a +single undo step. + +`Save' + Saves the undo serial number. + +`Restore' + Returns it to the last saved number. + +`Close' + Sets it to 1 greater than the last save. + +`Block' + Does a Restore if there was nothing to undo, else does a Close. + + + +File: pcb.info, Node: Attributes Action, Next: AutoPlaceSelected Action, Prev: Atomic Action, Up: core actions + +F.1.4 Attributes +---------------- + +Attributes(Layout|Layer|Element) +Attributes(Layer,layername) + +Let the user edit the attributes of the layout, current or given layer, +or selected element. + + This just pops up a dialog letting the user edit the attributes of +the pcb, an element, or a layer. + + +File: pcb.info, Node: AutoPlaceSelected Action, Next: AutoRoute Action, Prev: Attributes Action, Up: core actions + +F.1.5 AutoPlaceSelected +----------------------- + +AutoPlaceSelected() + +Auto-place selected components. + + Attempts to re-arrange the selected components such that the nets +connecting them are minimized. Note that you cannot undo this. + + +File: pcb.info, Node: AutoRoute Action, Next: ChangeClearSize Action, Prev: AutoPlaceSelected Action, Up: core actions + +F.1.6 AutoRoute +--------------- + +AutoRoute(AllRats|SelectedRats) + +Auto-route some or all rat lines. + +`AllRats' + Attempt to autoroute all rats. + +`SelectedRats' + Attempt to autoroute the selected rats. + + + Before autorouting, it's important to set up a few things. First, +make sure any layers you aren't using are disabled, else the autorouter +may use them. Next, make sure the current line and via styles are set +accordingly. Last, make sure "new lines clear polygons" is set, in +case you eventually want to add a copper pour. + + Autorouting takes a while. During this time, the program may not be +responsive. + + +File: pcb.info, Node: ChangeClearSize Action, Next: ChangeDrillSize Action, Prev: AutoRoute Action, Up: core actions + +F.1.7 ChangeClearSize +--------------------- + +ChangeClearSize(Object, delta) +ChangeClearSize(SelectedPins|SelectedPads|SelectedVias, delta) +ChangeClearSize(SelectedLines|SelectedArcs, delta +ChangeClearSize(Selected|SelectedObjects, delta) + +Changes the clearance size of objects. + + If the solder mask is currently showing, this action changes the +solder mask clearance. If the mask is not showing, this action changes +the polygon clearance. + + +File: pcb.info, Node: ChangeDrillSize Action, Next: ChangeFlag Action, Prev: ChangeClearSize Action, Up: core actions + +F.1.8 ChangeDrillSize +--------------------- + +ChangeDrillSize(Object, delta) +ChangeDrillSize(SelectedPins|SelectedVias|Selected|SelectedObjects, delta) + +Changes the drilling hole size of objects. + + +File: pcb.info, Node: ChangeFlag Action, Next: ChangeHole Action, Prev: ChangeDrillSize Action, Up: core actions + +F.1.9 ChangeFlag +---------------- + +ChangeFlag(Object|Selected|SelectedObjects, flag, value) +ChangeFlag(SelectedLines|SelectedPins|SelectedVias, flag, value) +ChangeFlag(SelectedPads|SelectedTexts|SelectedNames, flag, value) +ChangeFlag(SelectedElements, flag, value) +flag = square | octagon | thermal | join +value = 0 | 1 + +Sets or clears flags on objects. + + Toggles the given flag on the indicated object(s). The flag may be +one of the flags listed above (square, octagon, thermal, join). The +value may be the number 0 or 1. If the value is 0, the flag is +cleared. If the value is 1, the flag is set. + + +File: pcb.info, Node: ChangeHole Action, Next: ChangeJoin Action, Prev: ChangeFlag Action, Up: core actions + +F.1.10 ChangeHole +----------------- + +ChangeHole(ToggleObject|Object|SelectedVias|Selected) + +Changes the hole flag of objects. + + The "hole flag" of a via determines whether the via is a +plated-through hole (not set), or an unplated hole (set). + + +File: pcb.info, Node: ChangeJoin Action, Next: ChangeName Action, Prev: ChangeHole Action, Up: core actions + +F.1.11 ChangeJoin +----------------- + +ChangeJoin(ToggleObject|SelectedLines|SelectedArcs|Selected) + +Changes the join (clearance through polygons) of objects. + + The join flag determines whether a line or arc, drawn to intersect a +polygon, electrically connects to the polygon or not. When joined, the +line/arc is simply drawn over the polygon, making an electrical +connection. When not joined, a gap is drawn between the line and the +polygon, insulating them from each other. + + +File: pcb.info, Node: ChangeName Action, Next: ChangeOctagon Action, Prev: ChangeJoin Action, Up: core actions + +F.1.12 ChangeName +----------------- + +ChangeName(Object) +ChangeName(Layout|Layer) + +Sets the name of objects. + +`Object' + Changes the name of the element under the cursor. + +`Layout' + Changes the name of the layout. This is printed on the fab + drawings. + +`Layer' + Changes the name of the currently active layer. + + + +File: pcb.info, Node: ChangeOctagon Action, Next: ChangePaste Action, Prev: ChangeName Action, Up: core actions + +F.1.13 ChangeOctagon +-------------------- + +ChangeOctagon(Object|ToggleObject|SelectedObjects|Selected) +ChangeOctagon(SelectedElements|SelectedPins|SelectedVias) + +Changes the octagon-flag of pins and vias. + + Pins, pads, and vias can have various shapes. All may be round. +Pins and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a shape +flag of an element, you actually change all of its pins and pads. + + Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + + +File: pcb.info, Node: ChangePaste Action, Next: ChangePinName Action, Prev: ChangeOctagon Action, Up: core actions + +F.1.14 ChangePaste +------------------ + +ChangePaste(ToggleObject|Object|SelectedPads|Selected) + +Changes the no paste flag of objects. + + The "no paste flag" of a pad determines whether the solderpaste +stencil will have an opening for the pad (no set) or if there wil be +no solderpaste on the pad (set). This is used for things such as +fiducial pads. + + +File: pcb.info, Node: ChangePinName Action, Next: ChangeSize Action, Prev: ChangePaste Action, Up: core actions + +F.1.15 ChangePinName +-------------------- + +ChangePinName(ElementName,PinNumber,PinName) + +Sets the name of a specific pin on a specific element. + + This can be especially useful for annotating pin names from a +schematic to the layout without requiring knowledge of the pcb file +format. + + ChangePinName(U3, 7, VCC) + + +File: pcb.info, Node: ChangeSize Action, Next: ChangeSquare Action, Prev: ChangePinName Action, Up: core actions + +F.1.16 ChangeSize +----------------- + +ChangeSize(Object, delta) +ChangeSize(SelectedObjects|Selected, delta) +ChangeSize(SelectedLines|SelectedPins|SelectedVias, delta) +ChangeSize(SelectedPads|SelectedTexts|SelectedNames, delta) +ChangeSize(SelectedElements, delta) + +Changes the size of objects. + + For lines and arcs, this changes the width. For pins and vias, this +changes the overall diameter of the copper annulus. For pads, this +changes the width and, indirectly, the length. For texts and names, +this changes the scaling factor. For elements, this changes the width +of the silk layer lines and arcs for this element. + + +File: pcb.info, Node: ChangeSquare Action, Next: ClearOctagon Action, Prev: ChangeSize Action, Up: core actions + +F.1.17 ChangeSquare +------------------- + +ChangeSquare(ToggleObject) +ChangeSquare(SelectedElements|SelectedPins) +ChangeSquare(Selected|SelectedObjects) + +Changes the square flag of pins and pads. + + Note that `Pins' means both pins and pads. + + Pins, pads, and vias can have various shapes. All may be round. +Pins and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a shape +flag of an element, you actually change all of its pins and pads. + + Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + + +File: pcb.info, Node: ClearOctagon Action, Next: ClearSquare Action, Prev: ChangeSquare Action, Up: core actions + +F.1.18 ClearOctagon +------------------- + +ClearOctagon(ToggleObject|Object|SelectedObjects|Selected) +ClearOctagon(SelectedElements|SelectedPins|SelectedVias) + +Clears the octagon-flag of pins and vias. + + Pins, pads, and vias can have various shapes. All may be round. +Pins and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a shape +flag of an element, you actually change all of its pins and pads. + + Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + + +File: pcb.info, Node: ClearSquare Action, Next: ClrFlag Action, Prev: ClearOctagon Action, Up: core actions + +F.1.19 ClearSquare +------------------ + +ClearSquare(ToggleObject|SelectedElements|SelectedPins) + +Clears the square-flag of pins and pads. + + Note that `Pins' means pins and pads. + + Pins, pads, and vias can have various shapes. All may be round. +Pins and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a shape +flag of an element, you actually change all of its pins and pads. + + Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + + +File: pcb.info, Node: ClrFlag Action, Next: Connection Action, Prev: ClearSquare Action, Up: core actions + +F.1.20 ClrFlag +-------------- + +ClrFlag(Object|Selected|SelectedObjects, flag) +ClrFlag(SelectedLines|SelectedPins|SelectedVias, flag) +ClrFlag(SelectedPads|SelectedTexts|SelectedNames, flag) +ClrFlag(SelectedElements, flag) +flag = square | octagon | thermal | join + +Clears flags on objects. + + Turns the given flag off, regardless of its previous setting. See +`ChangeFlag'. + + ClrFlag(SelectedLines,join) + + +File: pcb.info, Node: Connection Action, Next: Delete Action, Prev: ClrFlag Action, Up: core actions + +F.1.21 Connection +----------------- + +Connection(Find|ResetLinesAndPolygons|ResetPinsAndVias|Reset) + +Searches connections of the object at the cursor position. + + Connections found with this action will be highlighted in the +"connected-color" color and will have the "found" flag set. + +`Find' + The net under the cursor is "found". + +`ResetLinesAndPolygons' + Any "found" lines and polygons are marked "not found". + +`ResetPinsAndVias' + Any "found" pins and vias are marked "not found". + +`Reset' + All "found" objects are marked "not found". + + + +File: pcb.info, Node: Delete Action, Next: DeleteRats Action, Prev: Connection Action, Up: core actions + +F.1.22 Delete +------------- + +Delete(Object|Selected) +Delete(AllRats|SelectedRats) + +Delete stuff. + + +File: pcb.info, Node: DeleteRats Action, Next: DisableVendor Action, Prev: Delete Action, Up: core actions + +F.1.23 DeleteRats +----------------- + +DeleteRats(AllRats|Selected|SelectedRats) + +Delete rat lines. + + +File: pcb.info, Node: DisableVendor Action, Next: DisperseElements Action, Prev: DeleteRats Action, Up: core actions + +F.1.24 DisableVendor +-------------------- + +DisableVendor() + +Disables automatic drill size mapping. + + When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. + + +File: pcb.info, Node: DisperseElements Action, Next: Display Action, Prev: DisableVendor Action, Up: core actions + +F.1.25 DisperseElements +----------------------- + +DisperseElements(All|Selected) + +Disperses elements. + + Normally this is used when starting a board, by selecting all +elements and then dispersing them. This scatters the elements around +the board so that you can pick individual ones, rather than have all the +elements at the same 0,0 coordinate and thus impossible to choose from. + + +File: pcb.info, Node: Display Action, Next: djopt Action, Prev: DisperseElements Action, Up: core actions + +F.1.26 Display +-------------- + +Display(NameOnPCB|Description|Value) +Display(Grid|Redraw) +Display(CycleClip|CycleCrosshair|Toggle45Degree|ToggleStartDirection) +Display(ToggleGrid|ToggleRubberBandMode|ToggleUniqueNames) +Display(ToggleMask|ToggleName|ToggleClearLine|ToggleFullPoly|ToggleSnapPin) +Display(ToggleThindraw|ToggleThindrawPoly|ToggleOrthoMove|ToggleLocalRef) +Display(ToggleCheckPlanes|ToggleShowDRC|ToggleAutoDRC) +Display(ToggleLiveRoute|LockNames|OnlyNames) +Display(Pinout|PinOrPadName) + +Several display-related actions. + +`NameOnPCB' + +`Description' + +`Value' + Specify whether all elements show their name, description, or + value. + +`Redraw' + Redraw the whole board. + +`Toggle45Degree' + When clear, lines can be drawn at any angle. When set, lines are + restricted to multiples of 45 degrees and requested lines may be + broken up according to the clip setting. + +`CycleClip' + Changes the way lines are restricted to 45 degree increments. The + various settings are: straight only, orthogonal then angled, and + angled then orthogonal. If AllDirections is set, this action + disables it. + +`CycleCrosshair' + Changes crosshair drawing. Crosshair may accept form of 4-ray, + 8-ray and 12-ray cross. + +`ToggleRubberBandMode' + If set, moving an object moves all the lines attached to it too. + +`ToggleStartDirection' + If set, each time you set a point in a line, the Clip toggles + between orth-angle and angle-ortho. + +`ToggleUniqueNames' + If set, you will not be permitted to change the name of an element + to match that of another element. + +`ToggleSnapPin' + If set, pin centers and pad end points are treated as additional + grid points that the cursor can snap to. + +`ToggleLocalRef' + If set, the mark is automatically set to the beginning of any + move, so you can see the relative distance you've moved. + +`ToggleThindraw' + If set, objects on the screen are drawn as outlines (lines are + drawn as center-lines). This lets you see line endpoints hidden + under pins, for example. + +`ToggleThindrawPoly' + If set, polygons on the screen are drawn as outlines. + +`ToggleShowDRC' + If set, pending objects (i.e. lines you're in the process of + drawing) will be drawn with an outline showing how far away from + other copper you need to be. + +`ToggleLiveRoute' + If set, the progress of the autorouter will be visible on the + screen. + +`ToggleAutoDRC' + If set, you will not be permitted to make connections which violate + the current DRC and netlist settings. + +`ToggleCheckPlanes' + If set, lines and arcs aren't drawn, which usually leaves just the + polygons. If you also disable all but the layer you're interested + in, this allows you to check for isolated regions. + +`ToggleOrthoMove' + If set, the crosshair is only allowed to move orthogonally from its + previous position. I.e. you can move an element or line up, down, + left, or right, but not up+left or down+right. + +`ToggleName' + Selects whether the pinouts show the pin names or the pin numbers. + +`ToggleLockNames' + If set, text will ignore left mouse clicks and actions that work on + objects under the mouse. You can still select text with a lasso + (left mouse drag) and perform actions on the selection. + +`ToggleOnlyNames' + If set, only text will be sensitive for mouse clicks and actions + that work on objects under the mouse. You can still select other + objects with a lasso (left mouse drag) and perform actions on the + selection. + +`ToggleMask' + Turns the solder mask on or off. + +`ToggleClearLine' + When set, the clear-line flag causes new lines and arcs to have + their "clear polygons" flag set, so they won't be electrically + connected to any polygons they overlap. + +`ToggleFullPoly' + When set, the full-poly flag causes new polygons to have their + "full polygon" flag set, so all parts of them will be displayed + instead of only the biggest one. + +`ToggleGrid' + Resets the origin of the current grid to be wherever the mouse + pointer is (not where the crosshair currently is). If you provide + two numbers after this, the origin is set to that coordinate. + +`Grid' + Toggles whether the grid is displayed or not. + +`Pinout' + Causes the pinout of the element indicated by the cursor to be + displayed, usually in a separate window. + +`PinOrPadName' + Toggles whether the names of pins, pads, or (yes) vias will be + displayed. If the cursor is over an element, all of its pins and + pads are affected. + + + +File: pcb.info, Node: djopt Action, Next: DRC Action, Prev: Display Action, Up: core actions + +F.1.27 djopt +------------ + +djopt(debumpify|unjaggy|simple|vianudge|viatrim|orthopull) +djopt(auto) - all of the above +djopt(miter) + +Perform various optimizations on the current board. + + The different types of optimizations change your board in order to +reduce the total trace length and via count. + +`debumpify' + Looks for U-shaped traces that can be shortened or eliminated. + +`unjaggy' + Looks for corners which could be flipped to eliminate one or more + corners (i.e. jaggy lines become simpler). + +`simple' + Removing uneeded vias, replacing two or more trace segments in a + row with a single segment. This is usually performed + automatically after other optimizations. + +`vianudge' + Looks for vias where all traces leave in the same direction. + Tries to move via in that direction to eliminate one of the traces + (and thus a corner). + +`viatrim' + Looks for traces that go from via to via, where moving that trace + to a different layer eliminates one or both vias. + +`orthopull' + Looks for chains of traces all going in one direction, with more + traces orthogonal on one side than on the other. Moves the chain + in that direction, causing a net reduction in trace length, + possibly eliminating traces and/or corners. + +`splitlines' + Looks for lines that pass through vias, pins, or pads, and splits + them into separate lines so they can be managed separately. + +`auto' + Performs the above options, repeating until no further + optimizations can be made. + +`miter' + Replaces 90 degree corners with a pair of 45 degree corners, to + reduce RF losses and trace length. + + + +File: pcb.info, Node: DRC Action, Next: DumpLibrary Action, Prev: djopt Action, Up: core actions + +F.1.28 DRC +---------- + +DRC() + +Invoke the DRC check. + + Note that the design rule check uses the current board rule settings, +not the current style settings. + + +File: pcb.info, Node: DumpLibrary Action, Next: elementlist Action, Prev: DRC Action, Up: core actions + +F.1.29 DumpLibrary +------------------ + +DumpLibrary() + +Display the entire contents of the libraries. + + +File: pcb.info, Node: elementlist Action, Next: elementsetattr Action, Prev: DumpLibrary Action, Up: core actions + +F.1.30 elementlist +------------------ + +ElementList(Start|Done|Need,,,) + +Adds the given element if it doesn't already exist. + +`Start' + Indicates the start of an element list; call this before any Need + actions. + +`Need' + Searches the board for an element with a matching refdes. + + If found, the value and footprint are updated. + + If not found, a new element is created with the given footprint + and value. + +`Done' + Compares the list of elements needed since the most recent `start' + with the list of elements actually on the board. Any elements + that weren't listed are selected, so that the user may delete them. + + + +File: pcb.info, Node: elementsetattr Action, Next: EnableVendor Action, Prev: elementlist Action, Up: core actions + +F.1.31 elementsetattr +--------------------- + +ElementSetAttr(refdes,name[,value]) + +Sets or clears an element-specific attribute. + + If a value is specified, the named attribute is added (if not already +present) or changed (if it is) to the given value. If the value is not +specified, the given attribute is removed if present. + Index: tags/1.0.5/doc/pcb.info-2 =================================================================== --- tags/1.0.5/doc/pcb.info-2 (nonexistent) +++ tags/1.0.5/doc/pcb.info-2 (revision 953) @@ -0,0 +1,3304 @@ +This is pcb.info, produced by makeinfo version 4.13 from pcb.texi. + +INFO-DIR-SECTION Miscellaneous +START-INFO-DIR-ENTRY +* pcb: (pcb). An interactive printed circuit board editor. +END-INFO-DIR-ENTRY + + This file documents how to use Pcb, the open source, interactive +printed circuit board layout system. + + Copyright (C) 1994,1995,1996, 2004 Thomas Nau + + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 harry eaton + + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Dan McMahill + + Copyright (C) 2004 DJ Delorie + + This program is free software; you may 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 +MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + + +File: pcb.info, Node: EnableVendor Action, Next: execcommand Action, Prev: elementsetattr Action, Up: core actions + +F.1.32 EnableVendor +------------------- + +EnableVendor() + +Enables automatic drill size mapping. + + When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor resource file containing a drill table must be loaded +first. + + +File: pcb.info, Node: execcommand Action, Next: ExecuteFile Action, Prev: EnableVendor Action, Up: core actions + +F.1.33 execcommand +------------------ + +ExecCommand(command) + +Runs a command. + + Runs the given command, which is a system executable. + + +File: pcb.info, Node: ExecuteFile Action, Next: Flip Action, Prev: execcommand Action, Up: core actions + +F.1.34 ExecuteFile +------------------ + +ExecuteFile(filename) + +Run actions from the given file. + + Lines starting with `#' are ignored. + + +File: pcb.info, Node: Flip Action, Next: FontEdit Action, Prev: ExecuteFile Action, Up: core actions + +F.1.35 Flip +----------- + +Flip(Object|Selected|SelectedElements) + +Flip an element to the opposite side of the board. + + Note that the location of the element will be symmetric about the +cursor location; i.e. if the part you are pointing at will still be at +the same spot once the element is on the other side. When flipping +multiple elements, this retains their positions relative to each other, +not their absolute positions on the board. + + +File: pcb.info, Node: FontEdit Action, Next: FontSave Action, Prev: Flip Action, Up: core actions + +F.1.36 FontEdit +--------------- + +FontEdit() + +Convert the current font to a PCB for editing. + + +File: pcb.info, Node: FontSave Action, Next: FreeRotateBuffer Action, Prev: FontEdit Action, Up: core actions + +F.1.37 FontSave +--------------- + +FontSave() + +Convert the current PCB back to a font. + + +File: pcb.info, Node: FreeRotateBuffer Action, Next: GlobalPuller Action, Prev: FontSave Action, Up: core actions + +F.1.38 FreeRotateBuffer +----------------------- + +FreeRotateBuffer([Angle]) + +Rotates the current paste buffer contents by the specified angle. The +angle is given in degrees. If no angle is given, the user is prompted +for one. + + Rotates the contents of the pastebuffer by an arbitrary angle. If no +angle is given, the user is prompted for one. + + +File: pcb.info, Node: GlobalPuller Action, Next: h Action, Prev: FreeRotateBuffer Action, Up: core actions + +F.1.39 GlobalPuller +------------------- + +GlobalPuller() + +Pull all traces tight. + + +File: pcb.info, Node: h Action, Next: Import Action, Prev: GlobalPuller Action, Up: core actions + +F.1.40 h +-------- + +h + +Print a help message for commands. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: Import Action, Next: l Action, Prev: h Action, Up: core actions + +F.1.41 Import +------------- + +Import() +Import([gnetlist|make[,source,source,...]]) +Import(setnewpoint[,(mark|center|X,Y)]) +Import(setdisperse,D,units) + +Import schematics. + + Imports element and netlist data from the schematics (or some other +source). The first parameter, which is optional, is the mode. If not +specified, the `import::mode' attribute in the PCB is used. `gnetlist' +means gnetlist is used to obtain the information from the schematics. +`make' invokes `make', assuming the user has a `Makefile' in the +current directory. The `Makefile' will be invoked with the following +variables set: + +`PCB' + The name of the .pcb file + +`SRCLIST' + A space-separated list of source files + +`OUT' + The name of the file in which to put the command script, which may + contain any `Pcb' actions. By default, this is a temporary file + selected by `Pcb', but if you specify an `import::outfile' + attribute, that file name is used instead (and not automatically + deleted afterwards). + + + The target specified to be built is the first of these that apply: + + * The target specified by an `import::target' attribute. + + * The output file specified by an `import::outfile' attribute. + + * If nothing else is specified, the target is `pcb_import'. + + + If you specify an `import::makefile' attribute, then "-f " will be added to the command line. + + If you specify the mode, you may also specify the source files +(schematics). If you do not specify any, the list of schematics is +obtained by reading the `import::srcN' attributes (like `import::src0', +`import::src1', etc). + + For compatibility with future extensions to the import file format, +the generated file _must not_ start with the two characters `#%'. + + If a temporary file is needed the `TMPDIR' environment variable is +used to select its location. + + Note that the programs `gnetlist' and `make' may be overridden by +the user via the `make-program' and `gnetlist' `pcb' settings (i.e. in +`~/.pcb/settings' or on the command line). + + If `Pcb' cannot determine which schematic(s) to import from, the GUI +is called to let user choose (see `ImportGUI()'). + + Note that Import() doesn't delete anything - after an Import, +elements which shouldn't be on the board are selected and may be +removed once it's determined that the deletion is appropriate. + + If `Import()' is called with `setnewpoint', then the location of new +components can be specified. This is where parts show up when they're +added to the board. The default is the center of the board. + +`Import(setnewpoint)' + Prompts the user to click on the board somewhere, uses that point. + If called by a hotkey, uses the current location of the crosshair. + +`Import(setnewpoint,mark)' + Uses the location of the mark. If no mark is present, the point is + not changed. + +`Import(setnewpoint,center)' + Resets the point to the center of the board. + +`Import(setnewpoint,X,Y,units)' + Sets the point to the specific coordinates given. Example: + `Import(setnewpoint,50,25,mm)' + + + Note that the X and Y locations are stored in attributes named +`import::newX' and `import::newY' so you could change them manually if +you wished. + + Calling `Import(setdisperse,D,units)' sets how much the newly placed +elements are dispersed relative to the set point. For example, +`Import(setdisperse,10,mm)' will offset each part randomly up to 10mm +away from the point. The default dispersion is 1/10th of the smallest +board dimension. Dispersion is saved in the `import::disperse' +attribute. + + +File: pcb.info, Node: l Action, Next: le Action, Prev: Import Action, Up: core actions + +F.1.42 l +-------- + +l [name] + +Loads layout data. + + Loads a new datafile (layout) and, if confirmed, overwrites any +existing unsaved data. The filename and the searchpath (_filePath_) +are passed to the command defined by _fileCommand_. If no filename is +specified a file select box will popup. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: le Action, Next: LoadFootprint Action, Prev: l Action, Up: core actions + +F.1.43 le +--------- + +le [name] + +Loads an element into the current buffer. + + The filename and the searchpath (_elementPath_) are passed to the +command defined by _elementCommand_. If no filename is specified a +file select box will popup. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: LoadFootprint Action, Next: LoadFrom Action, Prev: le Action, Up: core actions + +F.1.44 LoadFootprint +-------------------- + +LoadFootprint(filename[,refdes,value]) + +Loads a single footprint by name. + + Loads a single footprint by name, rather than by reference or through +the library. If a refdes and value are specified, those are inserted +into the footprint as well. The footprint remains in the paste buffer. + + +File: pcb.info, Node: LoadFrom Action, Next: LoadVendorFrom Action, Prev: LoadFootprint Action, Up: core actions + +F.1.45 LoadFrom +--------------- + +LoadFrom(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert,filename) + +Load layout data from a file. + + This action assumes you know what the filename is. The various GUIs +should have a similar `Load' action where the filename is optional, and +will provide their own file selection mechanism to let you choose the +file name. + +`Layout' + Loads an entire PCB layout, replacing the current one. + +`LayoutToBuffer' + Loads an entire PCB layout to the paste buffer. + +`ElementToBuffer' + Loads the given element file into the paste buffer. Element files + contain only a single `Element' definition, such as the "newlib" + library uses. + +`Netlist' + Loads a new netlist, replacing any current netlist. + +`Revert' + Re-loads the current layout from its disk file, reverting any + changes you may have made. + + + +File: pcb.info, Node: LoadVendorFrom Action, Next: m Action, Prev: LoadFrom Action, Up: core actions + +F.1.46 LoadVendorFrom +--------------------- + +LoadVendorFrom(filename) + +Loads the specified vendor resource file. + +FILENAME + Name of the vendor resource file. If not specified, the user will + be prompted to enter one. + + +File: pcb.info, Node: m Action, Next: MarkCrosshair Action, Prev: LoadVendorFrom Action, Up: core actions + +F.1.47 m +-------- + +m [name] + +Loads a layout into the current buffer. + + The filename and the searchpath (_filePath_) are passed to the +command defined by _fileCommand_. If no filename is specified a file +select box will popup. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: MarkCrosshair Action, Next: Message Action, Prev: m Action, Up: core actions + +F.1.48 MarkCrosshair +-------------------- + +MarkCrosshair() +MarkCrosshair(Center) + +Set/Reset the Crosshair mark. + + The "mark" is a small X-shaped target on the display which is +treated like a second origin (the normal origin is the upper let corner +of the board). The GUI will display a second set of coordinates for +this mark, which tells you how far you are from it. + + If no argument is given, the mark is toggled - disabled if it was +enabled, or enabled at the current cursor position of disabled. If the +`Center' argument is given, the mark is moved to the current cursor +location. + + +File: pcb.info, Node: Message Action, Next: MinClearGap Action, Prev: MarkCrosshair Action, Up: core actions + +F.1.49 Message +-------------- + +Message(message) + +Writes a message to the log window. + + This action displays a message to the log window. This action is +primarily provided for use by other programs which may interface with +PCB. If multiple arguments are given, each one is sent to the log +window followed by a newline. + + +File: pcb.info, Node: MinClearGap Action, Next: MinMaskGap Action, Prev: Message Action, Up: core actions + +F.1.50 MinClearGap +------------------ + +MinClearGap(delta) +MinClearGap(Selected, delta) + +Ensures that polygons are a minimum distance from objects. + + Checks all specified objects, and increases the polygon clearance if +needed to ensure a minimum distance between their edges and the polygon +edges. + + +File: pcb.info, Node: MinMaskGap Action, Next: Mode Action, Prev: MinClearGap Action, Up: core actions + +F.1.51 MinMaskGap +----------------- + +MinMaskGap(delta) +MinMaskGap(Selected, delta) + +Ensures the mask is a minimum distance from pins and pads. + + Checks all specified pins and/or pads, and increases the mask if +needed to ensure a minimum distance between the pin or pad edge and the +mask edge. + + +File: pcb.info, Node: Mode Action, Next: MorphPolygon Action, Prev: MinMaskGap Action, Up: core actions + +F.1.52 Mode +----------- + +Mode(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer) +Mode(Polygon|Rectangle|Remove|Rotate|Text|Thermal|Via) +Mode(Notify|Release|Cancel|Stroke) +Mode(Save|Restore) + +Change or use the tool mode. + +`Arc' +`Arrow' +`Copy' +`InsertPoint' +`Line' +`Lock' +`Move' +`None' +`PasteBuffer' +`Polygon' +`Rectangle' +`Remove' +`Rotate' +`Text' +`Thermal' +`Via' + Select the indicated tool. + +`Notify' + Called when you press the mouse button, or move the mouse. + +`Release' + Called when you release the mouse button. + +`Cancel' + Cancels any pending tool activity, allowing you to restart + elsewhere. For example, this allows you to start a new line + rather than attach a line to the previous line. + +`Escape' + Similar to Cancel but calling this action a second time will return + to the Arrow tool. + +`Stroke' + If your `pcb' was built with libstroke, this invokes the stroke + input method. If not, this will restart a drawing mode if you were + drawing, else it will select objects. + +`Save' + Remembers the current tool. + +`Restore' + Restores the tool to the last saved tool. + + + +File: pcb.info, Node: MorphPolygon Action, Next: MoveLayer Action, Prev: Mode Action, Up: core actions + +F.1.53 MorphPolygon +------------------- + +MorphPolygon(Object|Selected) + +Converts dead polygon islands into separate polygons. + + If a polygon is divided into unconnected "islands", you can use this +command to convert the otherwise disappeared islands into separate +polygons. Be sure the cursor is over a portion of the polygon that +remains visible. Very small islands that may flake off are +automatically deleted. + + +File: pcb.info, Node: MoveLayer Action, Next: MoveObject Action, Prev: MorphPolygon Action, Up: core actions + +F.1.54 MoveLayer +---------------- + +MoveLayer(old,new) + +Moves/Creates/Deletes Layers. + + Moves a layer, creates a new layer, or deletes a layer. + +`old' + The is the layer number to act upon. Allowed values are: + `c' + Currently selected layer. + + `-1' + Create a new layer. + + `number' + An existing layer number. + + +`new' + Specifies where to move the layer to. Allowed values are: + `-1' + Deletes the layer. + + `up' + Moves the layer up. + + `down' + Moves the layer down. + + `c' + Creates a new layer. + + + + +File: pcb.info, Node: MoveObject Action, Next: MoveToCurrentLayer Action, Prev: MoveLayer Action, Up: core actions + +F.1.55 MoveObject +----------------- + +MoveObject(X,Y,dim) + +Moves the object under the crosshair. + + The `X' and `Y' are treated like `delta' is for many other objects. +For each, if it's prefixed by `+' or `-', then that amount is relative. +Otherwise, it's absolute. Units can be `mil' or `mm'; if unspecified, +units are PCB's internal units, currently 1/100 mil. + + +File: pcb.info, Node: MoveToCurrentLayer Action, Next: Netlist Action, Prev: MoveObject Action, Up: core actions + +F.1.56 MoveToCurrentLayer +------------------------- + +MoveToCurrentLayer(Object|SelectedObjects) + +Moves objects to the current layer. + + Note that moving an element from a component layer to a solder layer, +or from solder to component, won't automatically flip it. Use the +`Flip()' action to do that. + + +File: pcb.info, Node: Netlist Action, Next: New Action, Prev: MoveToCurrentLayer Action, Up: core actions + +F.1.57 Netlist +-------------- + +Net(find|select|rats|norats|clear[,net[,pin]]) +Net(freeze|thaw|forcethaw) +Net(add,net,pin) + +Perform various actions on netlists. + + Each of these actions apply to a specified set of nets. NET and PIN +are patterns which match one or more nets or pins; these patterns may +be full names or regular expressions. If an exact match is found, it +is the only match; if no exact match is found, _then_ the pattern is +tried as a regular expression. + + If neither NET nor PIN are specified, all nets apply. If NET is +specified but not PIN, all nets matching NET apply. If both are +specified, nets which match NET and contain a pin matching PIN apply. + +`find' + Nets which apply are marked _found_ and are drawn in the + `connected-color' color. + +`select' + Nets which apply are selected. + +`rats' + Nets which apply are marked as available for the rats nest. + +`norats' + Nets which apply are marked as not available for the rats nest. + +`clear' + Clears the netlist. + +`add' + Add the given pin to the given netlist, creating either if needed. + +`sort' + Called after a list of add's, this sorts the netlist. + +`freeze' +`thaw' +`forcethaw' + Temporarily prevents changes to the netlist from being reflected in + the GUI. For example, if you need to make multiple changes, you + freeze the netlist, make the changes, then thaw it. Note that + freeze/thaw requests may nest, with the netlist being fully thawed + only when all pending freezes are thawed. You can bypass the + nesting by using forcethaw, which resets the freeze count and + immediately updates the GUI. + + + +File: pcb.info, Node: New Action, Next: OptAutoOnly Action, Prev: Netlist Action, Up: core actions + +F.1.58 New +---------- + +New([name]) + +Starts a new layout. + + If a name is not given, one is prompted for. + + +File: pcb.info, Node: OptAutoOnly Action, Next: PasteBuffer Action, Prev: New Action, Up: core actions + +F.1.59 OptAutoOnly +------------------ + +OptAutoOnly() + +Toggles the optimize-only-autorouted flag. + + The original purpose of the trace optimizer was to clean up the +traces created by the various autorouters that have been used with PCB. +When a board has a mix of autorouted and carefully hand-routed traces, +you don't normally want the optimizer to move your hand-routed traces. +But, sometimes you do. By default, the optimizer only optimizes +autorouted traces. This action toggles that setting, so that you can +optimize hand-routed traces also. + + +File: pcb.info, Node: PasteBuffer Action, Next: Polygon Action, Prev: OptAutoOnly Action, Up: core actions + +F.1.60 PasteBuffer +------------------ + +PasteBuffer(AddSelected|Clear|1..MAX_BUFFER) +PasteBuffer(Rotate, 1..3) +PasteBuffer(Convert|Save|Restore|Mirror) +PasteBuffer(ToLayout, X, Y, units) + +Various operations on the paste buffer. + + There are a number of paste buffers; the actual limit is a +compile-time constant `MAX_BUFFER' in `globalconst.h'. It is currently +`5'. One of these is the "current" paste buffer, often referred to as +"the" paste buffer. + +`AddSelected' + Copies the selected objects to the current paste buffer. + +`Clear' + Remove all objects from the current paste buffer. + +`Convert' + Convert the current paste buffer to an element. Vias are + converted to pins, lines are converted to pads. + +`Restore' + Convert any elements in the paste buffer back to vias and lines. + +`Mirror' + Flip all objects in the paste buffer vertically (up/down flip). + To mirror horizontally, combine this with rotations. + +`Rotate' + Rotates the current buffer. The number to pass is 1..3, where 1 + means 90 degrees counter clockwise, 2 means 180 degrees, and 3 + means 90 degrees clockwise (270 CCW). + +`Save' + Saves any elements in the current buffer to the indicated file. + +`ToLayout' + Pastes any elements in the current buffer to the indicated X, Y + coordinates in the layout. The `X' and `Y' are treated like + `delta' is for many other objects. For each, if it's prefixed by + `+' or `-', then that amount is relative to the last location. + Otherwise, it's absolute. Units can be `mil' or `mm'; if + unspecified, units are PCB's internal units, currently 1/100 mil. + +`1..MAX_BUFFER' + Selects the given buffer to be the current paste buffer. + + + +File: pcb.info, Node: Polygon Action, Next: Puller Action, Prev: PasteBuffer Action, Up: core actions + +F.1.61 Polygon +-------------- + +Polygon(Close|PreviousPoint) + +Some polygon related stuff. + + Polygons need a special action routine to make life easier. + +`Close' + Creates the final segment of the polygon. This may fail if + clipping to 45 degree lines is switched on, in which case a + warning is issued. + +`PreviousPoint' + Resets the newly entered corner to the previous one. The Undo + action will call Polygon(PreviousPoint) when appropriate to do so. + + + +File: pcb.info, Node: Puller Action, Next: q Action, Prev: Polygon Action, Up: core actions + +F.1.62 Puller +------------- + +Puller() + +Pull an arc-line junction tight. + + The `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, +the left side is "before" with the black target marking where to put +the crosshair: + + [image src="puller.png" alt="Example of how puller works"] + +The right side is "after" with the black target marking where the +arc-line intersection was moved to. + + +File: pcb.info, Node: q Action, Next: q! Action, Prev: Puller Action, Up: core actions + +F.1.63 q +-------- + +q + +Quits the application after confirming. + + If you have unsaved changes, you will be prompted to confirm (or +save) before quitting. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: q! Action, Next: Quit Action, Prev: q Action, Up: core actions + +F.1.64 q! +--------- + +q! + +Quits the application without confirming. + + Note that this command neither saves your data nor prompts for +confirmation. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: Quit Action, Next: Redo Action, Prev: q! Action, Up: core actions + +F.1.65 Quit +----------- + +Quit() + +Quits the application after confirming. + + If you have unsaved changes, you will be prompted to confirm (or +save) before quitting. + + +File: pcb.info, Node: Redo Action, Next: RemoveSelected Action, Prev: Quit Action, Up: core actions + +F.1.66 Redo +----------- + +Redo() + +Redo recent"undo"operations. + + This routine allows you to recover from the last undo command. You +might want to do this if you thought that undo was going to revert +something other than what it actually did (in case you are confused +about which operations are un-doable), or if you have been backing up +through a long undo list and over-shoot your stopping point. Any +change that is made since the undo in question will trim the redo list. +For example if you add ten lines, then undo three of them you could use +redo to put them back, but if you move a line on the board before +performing the redo, you will lose the ability to "redo" the three +"undone" lines. + + +File: pcb.info, Node: RemoveSelected Action, Next: Renumber Action, Prev: Redo Action, Up: core actions + +F.1.67 RemoveSelected +--------------------- + +RemoveSelected() + +Removes any selected objects. + + +File: pcb.info, Node: Renumber Action, Next: Report Action, Prev: RemoveSelected Action, Up: core actions + +F.1.68 Renumber +--------------- + +Renumber() +Renumber(filename) + +Renumber all elements. The changes will be recorded to filename for +use in backannotating these changes to the schematic. + + +File: pcb.info, Node: Report Action, Next: ReportDialog Action, Prev: Renumber Action, Up: core actions + +F.1.69 Report +------------- + +Report(Object|DrillReport|FoundPins|NetLength|AllNetLengths|[,name]) + +Produce various report. + +`Object' + The object under the crosshair will be reported, describing various + aspects of the object. + +`DrillReport' + A report summarizing the number of drill sizes used, and how many + of each, will be produced. + +`FoundPins' + A report listing all pins and pads which are marked as "found" will + be produced. + +`NetLength' + The name and length of the net under the crosshair will be + reported to the message log. + +`AllNetLengths' + The name and length of the net under the crosshair will be + reported to the message log. An optional parameter specifies mm, + mil, pcb, or in units + + + +File: pcb.info, Node: ReportDialog Action, Next: RipUp Action, Prev: Report Action, Up: core actions + +F.1.70 ReportDialog +------------------- + +ReportDialog() + +Report on the object under the crosshair + + This is a shortcut for `Report(Object)'. + + +File: pcb.info, Node: RipUp Action, Next: rn Action, Prev: ReportDialog Action, Up: core actions + +F.1.71 RipUp +------------ + +RipUp(All|Selected|Element) + +Ripup auto-routed tracks, or convert an element to parts. + +`All' + Removes all lines and vias which were created by the autorouter. + +`Selected' + Removes all selected lines and vias which were created by the + autorouter. + +`Element' + Converts the element under the cursor to parts (vias and lines). + Note that this uses the highest numbered paste buffer. + + + +File: pcb.info, Node: rn Action, Next: RouteStyle Action, Prev: RipUp Action, Up: core actions + +F.1.72 rn +--------- + +rn [name] + +Reads netlist. + + If no filename is given a file select box will pop up. The file is +read via the command defined by the _RatCommand_ resource. The command +must send its output to _stdout_. + + Netlists are used for generating rat's nests (see *note Rats Nest::) +and for verifying the board layout (which is also accomplished by the +_Ratsnest_ command). + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: RouteStyle Action, Next: s Action, Prev: rn Action, Up: core actions + +F.1.73 RouteStyle +----------------- + +RouteStyle(1|2|3|4) + +Copies the indicated routing style into the current sizes. + + +File: pcb.info, Node: s Action, Next: SaveSettings Action, Prev: RouteStyle Action, Up: core actions + +F.1.74 s +-------- + +s [name] + +Saves layout data. + + Data and the filename are passed to the command defined by the +resource _saveCommand_. It must read the layout data from _stdin_. If +no filename is entered, either the last one is used again or, if it is +not available, a file select box will pop up. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: SaveSettings Action, Next: SaveTo Action, Prev: s Action, Up: core actions + +F.1.75 SaveSettings +------------------- + +SaveSettings() +SaveSettings(local) + +Saves settings. + + If you pass no arguments, the settings are stored in +`$HOME/.pcb/settings'. If you pass the word `local' they're saved in +`./pcb.settings'. + + +File: pcb.info, Node: SaveTo Action, Next: Select Action, Prev: SaveSettings Action, Up: core actions + +F.1.76 SaveTo +------------- + +SaveTo(Layout|LayoutAs,filename) +SaveTo(AllConnections|AllUnusedPins|ElementConnections,filename) +SaveTo(PasteBuffer,filename) + +Saves data to a file. + +`Layout' + Saves the current layout. + +`LayoutAs' + Saves the current layout, and remembers the filename used. + +`AllConnections' + Save all connections to a file. + +`AllUnusedPins' + List all unused pins to a file. + +`ElementConnections' + Save connections to the element at the cursor to a file. + +`PasteBuffer' + Save the content of the active Buffer to a file. This is the + graphical way to create a footprint. + + + +File: pcb.info, Node: Select Action, Next: SetFlag Action, Prev: SaveTo Action, Up: core actions + +F.1.77 Select +------------- + +Select(Object|ToggleObject) +Select(All|Block|Connection) +Select(ElementByName|ObjectByName|PadByName|PinByName) +Select(ElementByName|ObjectByName|PadByName|PinByName, Name) +Select(TextByName|ViaByName|NetByName) +Select(TextByName|ViaByName|NetByName, Name) +Select(Convert) + +Toggles or sets the selection. + +`ElementByName' + +`ObjectByName' + +`PadByName' + +`PinByName' + +`TextByName' + +`ViaByName' + +`NetByName' + These all rely on having a regular expression parser built into + `pcb'. If the name is not specified then the user is prompted for + a pattern, and all objects that match the pattern and are of the + type specified are selected. + +`Object' + +`ToggleObject' + Selects the object under the cursor. + +`Block' + Selects all objects in a rectangle indicated by the cursor. + +`All' + Selects all objects on the board. + +`Connection' + Selects all connections with the "found" flag set. + +`Convert' + Converts the selected objects to an element. This uses the highest + numbered paste buffer. + + + +File: pcb.info, Node: SetFlag Action, Next: SetOctagon Action, Prev: Select Action, Up: core actions + +F.1.78 SetFlag +-------------- + +SetFlag(Object|Selected|SelectedObjects, flag) +SetFlag(SelectedLines|SelectedPins|SelectedVias, flag) +SetFlag(SelectedPads|SelectedTexts|SelectedNames, flag) +SetFlag(SelectedElements, flag) +flag = square | octagon | thermal | join + +Sets flags on objects. + + Turns the given flag on, regardless of its previous setting. See +`ChangeFlag'. + + SetFlag(SelectedPins,thermal) + + +File: pcb.info, Node: SetOctagon Action, Next: SetSame Action, Prev: SetFlag Action, Up: core actions + +F.1.79 SetOctagon +----------------- + +SetOctagon(Object|ToggleObject|SelectedElements|Selected) + +Sets the octagon-flag of objects. + + Pins, pads, and vias can have various shapes. All may be round. +Pins and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a shape +flag of an element, you actually change all of its pins and pads. + + Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + + +File: pcb.info, Node: SetSame Action, Next: SetSquare Action, Prev: SetOctagon Action, Up: core actions + +F.1.80 SetSame +-------------- + +SetSame() + +Sets current layer and sizes to match indicated item. + + When invoked over any line, arc, polygon, or via, this changes the +current layer to be the layer that item is on, and changes the current +sizes (thickness, keepaway, drill, etc) according to that item. + + +File: pcb.info, Node: SetSquare Action, Next: SetThermal Action, Prev: SetSame Action, Up: core actions + +F.1.81 SetSquare +---------------- + +SetSquare(ToggleObject|SelectedElements|SelectedPins) + +sets the square-flag of objects. + + Note that `Pins' means pins and pads. + + Pins, pads, and vias can have various shapes. All may be round. +Pins and pads may be square (obviously "square" pads are usually +rectangular). Pins and vias may be octagonal. When you change a shape +flag of an element, you actually change all of its pins and pads. + + Note that the square flag takes precedence over the octagon flag, +thus, if both the square and octagon flags are set, the object is +square. When the square flag is cleared, the pins and pads will be +either round or, if the octagon flag is set, octagonal. + + +File: pcb.info, Node: SetThermal Action, Next: SetValue Action, Prev: SetSquare Action, Up: core actions + +F.1.82 SetThermal +----------------- + +SetThermal(Object|SelectedPins|SelectedVias|Selected, Style) + +Set the thermal (on the current layer) of pins or vias to the given +style. Style = 0 means no thermal. Style = 1 has diagonal fingers +with sharp edges. Style = 2 has horizontal and vertical fingers with +sharp edges. Style = 3 is a solid connection to the plane.Style = 4 +has diagonal fingers with rounded edges. Style = 5 has horizontal and +vertical fingers with rounded edges. + + This changes how/whether pins or vias connect to any rectangle or +polygon on the current layer. The first argument can specify one +object, or all selected pins, or all selected vias, or all selected +pins and vias. The second argument specifies the style of connection. +There are 5 possibilities: 0 - no connection, 1 - 45 degree fingers +with sharp edges, 2 - horizontal & vertical fingers with sharp edges, 3 +- solid connection, 4 - 45 degree fingers with rounded corners, 5 - +horizontal & vertical fingers with rounded corners. + + 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. + + +File: pcb.info, Node: SetValue Action, Next: ToggleHideName Action, Prev: SetThermal Action, Up: core actions + +F.1.83 SetValue +--------------- + +SetValue(Grid|Line|LineSize|Text|TextScale|ViaDrillingHole|Via|ViaSize, delta) + +Change various board-wide values and sizes. + +`ViaDrillingHole' + Changes the diameter of the drill for new vias. + +`Grid' + Sets the grid spacing. + +`Line' + +`LineSize' + Changes the thickness of new lines. + +`Via' + +`ViaSize' + Changes the diameter of new vias. + +`Text' + +`TextScale' + Changes the size of new text. + + + +File: pcb.info, Node: ToggleHideName Action, Next: ToggleVendor Action, Prev: SetValue Action, Up: core actions + +F.1.84 ToggleHideName +--------------------- + +ToggleHideName(Object|SelectedElements) + +Toggles the visibility of element names. + + If names are hidden you won't see them on the screen and they will +not appear on the silk layer when you print the layout. + + +File: pcb.info, Node: ToggleVendor Action, Next: Undo Action, Prev: ToggleHideName Action, Up: core actions + +F.1.85 ToggleVendor +------------------- + +ToggleVendor() + +Toggles the state of automatic drill size mapping. + + When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor resource file containing a drill table must be loaded +first. + + +File: pcb.info, Node: Undo Action, Next: UnloadVendor Action, Prev: ToggleVendor Action, Up: core actions + +F.1.86 Undo +----------- + +Undo() +Undo(ClearList) + +Undo recent changes. + + The unlimited undo feature of `Pcb' allows you to recover from most +operations that materially affect you work. Calling `Undo()' without +any parameter recovers from the last (non-undo) operation. `ClearList' +is used to release the allocated memory. `ClearList' is called whenever +a new layout is started or loaded. See also `Redo' and `Atomic'. + + Note that undo groups operations by serial number; changes with the +same serial number will be undone (or redone) as a group. See `Atomic'. + + +File: pcb.info, Node: UnloadVendor Action, Next: Unselect Action, Prev: Undo Action, Up: core actions + +F.1.87 UnloadVendor +------------------- + +UnloadVendor() + +Unloads the current vendor drill mapping table. + + +File: pcb.info, Node: Unselect Action, Next: w Action, Prev: UnloadVendor Action, Up: core actions + +F.1.88 Unselect +--------------- + +Unselect(All|Block|Connection) +Unselect(ElementByName|ObjectByName|PadByName|PinByName) +Unselect(ElementByName|ObjectByName|PadByName|PinByName, Name) +Unselect(TextByName|ViaByName) +Unselect(TextByName|ViaByName, Name) + +Unselects the object at the pointer location or the specified objects. + +`All' + Unselect all objects. + +`Block' + Unselect all objects in a rectangle given by the cursor. + +`Connection' + Unselect all connections with the "found" flag set. + +`ElementByName' + +`ObjectByName' + +`PadByName' + +`PinByName' + +`TextByName' + +`ViaByName' + These all rely on having a regular expression parser built into + `pcb'. If the name is not specified then the user is prompted for + a pattern, and all objects that match the pattern and are of the + type specified are unselected. + + + +File: pcb.info, Node: w Action, Next: wq Action, Prev: Unselect Action, Up: core actions + +F.1.89 w +-------- + +w [name] + +Saves layout data. + + This commands has been added for the convenience of `vi' users and +has the same functionality as `s'. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: wq Action, Prev: w Action, Up: core actions + +F.1.90 wq +--------- + +wq + +Saves the layout data and quits. + + This command has been added for the convenience of `vi' users and +has the same functionality as `s' combined with `q'. + + This is one of the command box helper actions. While it is a regular +action and can be used like any other action, its name and syntax are +optimized for use with the command box (`:') and thus the syntax is +documented for that purpose. + + +File: pcb.info, Node: common actions, Next: gtk actions, Prev: core actions, Up: Action Reference + +F.2 common actions +================== + +* Menu: + +* LayersChanged Action:: Tells the GUI that the layers have changed. +* LibraryChanged Action:: Tells the GUI that the libraries have changed. +* NetlistChanged Action:: Tells the GUI that the netlist has changed. +* PCBChanged Action:: 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 beingreloaded, and that it might keep some viewport settings +* RouteStylesChanged Action:: Tells the GUI that the routing styles have changed. + + +File: pcb.info, Node: LayersChanged Action, Next: LibraryChanged Action, Up: common actions + +F.2.1 LayersChanged +------------------- + +LayersChanged() + +Tells the GUI that the layers have changed. + + This includes layer names, colors, stacking order, visibility, etc. + + This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + + +File: pcb.info, Node: LibraryChanged Action, Next: NetlistChanged Action, Prev: LayersChanged Action, Up: common actions + +F.2.2 LibraryChanged +-------------------- + +LibraryChanged() + +Tells the GUI that the libraries have changed. + + This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + + +File: pcb.info, Node: NetlistChanged Action, Next: PCBChanged Action, Prev: LibraryChanged Action, Up: common actions + +F.2.3 NetlistChanged +-------------------- + +NetlistChanged() + +Tells the GUI that the netlist has changed. + + This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + + +File: pcb.info, Node: PCBChanged Action, Next: RouteStylesChanged Action, Prev: NetlistChanged Action, Up: common actions + +F.2.4 PCBChanged +---------------- + +PCBChanged([revert]) + +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 beingreloaded, and that it might keep some viewport +settings + + This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + + +File: pcb.info, Node: RouteStylesChanged Action, Prev: PCBChanged Action, Up: common actions + +F.2.5 RouteStylesChanged +------------------------ + +RouteStylesChanged() + +Tells the GUI that the routing styles have changed. + + This is one of a number of actions which are part of the HID +interface. The core functions use these actions to tell the current +GUI when to change the presented information in response to changes +that the GUI may not know about. The user normally does not invoke +these directly. + + +File: pcb.info, Node: gtk actions, Next: lesstif actions, Prev: common actions, Up: Action Reference + +F.3 gtk actions +=============== + +* Menu: + +* gtk About Action:: N_("Tell the user about this version of PCB."); +* gtk AdjustStyle Action:: Open the window which allows editing of the route styles. +* gtk Center Action:: N_("Moves the pointer to the center of the window."); +* gtk Cursor Action:: N_("Move the cursor."); +* gtk DoWindows Action:: N_("Open various GUI windows."); +* gtk EditLayerGroups Action:: Open the preferences window which allows editing of the layer groups. +* gtk GetXY Action:: N_("Get a coordinate."); +* gtk ImportGUI Action:: N_("Asks user which schematics to import into PCB. +"); +* gtk Pan Action:: N_("Start or stop panning (Mode = 1 to start, 0 to stop) +Optional thumb argument is ignored for now in gtk hid. +"); +* gtk Popup Action:: N_("Bring up the popup menu specified by `MenuName'. +If called by a mouse event then the mouse button number +must be specified as the optional second argument."); +* gtk Print Action:: N_("Print the layout."); +* gtk PrintCalibrate Action:: N_("Calibrate the printer."); +* gtk Save Action:: N_("Save layout and/or element data to a user-selected file."); +* gtk SelectLayer Action:: Select which layer is the current layer. +* gtk SetUnits Action:: N_("Set the default measurement units."); +* gtk SwapSides Action:: N_("Swaps the side of the board you're looking at."); +* gtk ToggleView Action:: Toggle the visibility of the specified layer or layer group. +* gtk Zoom Action:: N_("Various zoom factor changes."); + + +File: pcb.info, Node: gtk About Action, Next: gtk AdjustStyle Action, Up: gtk actions + +F.3.1 gtk About +--------------- + +About() + +N_("Tell the user about this version of PCB."); + + This just pops up a dialog telling the user which version of `pcb' +they're running. + + +File: pcb.info, Node: gtk AdjustStyle Action, Next: gtk Center Action, Prev: gtk About Action, Up: gtk actions + +F.3.2 gtk AdjustStyle +--------------------- + +AdjustStyle() + +Open the window which allows editing of the route styles. + + Opens the window which allows editing of the route styles. + + +File: pcb.info, Node: gtk Center Action, Next: gtk Cursor Action, Prev: gtk AdjustStyle Action, Up: gtk actions + +F.3.3 gtk Center +---------------- + +Center() + +N_("Moves the pointer to the center of the window."); + + Move the pointer to the center of the window, but only if it's +currently within the window already. + + +File: pcb.info, Node: gtk Cursor Action, Next: gtk DoWindows Action, Prev: gtk Center Action, Up: gtk actions + +F.3.4 gtk Cursor +---------------- + +Cursor(Type,DeltaUp,DeltaRight,Units) + +N_("Move the cursor."); + + This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive DELTAUP may move the cursor +towards the board origin if the board is inverted. + + Type is one of `Pan' or `Warp'. `Pan' causes the viewport to move +such that the crosshair is under the mouse cursor. `Warp' causes the +mouse cursor to move to be above the crosshair. + + UNITS can be one of the following: + +`mil' +`mm' + The cursor is moved by that amount, in board units. + +`grid' + The cursor is moved by that many grid points. + +`view' + The values are percentages of the viewport's view. Thus, a pan of + `100' would scroll the viewport by exactly the width of the + current view. + +`board' + The values are percentages of the board size. Thus, a move of + `50,50' moves you halfway across the board. + + + +File: pcb.info, Node: gtk DoWindows Action, Next: gtk EditLayerGroups Action, Prev: gtk Cursor Action, Up: gtk actions + +F.3.5 gtk DoWindows +------------------- + +DoWindows(1|2|3|4|5|6) +DoWindows(Layout|Library|Log|Netlist|Preferences|DRC) + +N_("Open various GUI windows."); + +`1' +`Layout' + Open the layout window. Since the layout window is always shown + anyway, this has no effect. + +`2' +`Library' + Open the library window. + +`3' +`Log' + Open the log window. + +`4' +`Netlist' + Open the netlist window. + +`5' +`Preferences' + Open the preferences window. + +`6' +`DRC' + Open the DRC violations window. + + + +File: pcb.info, Node: gtk EditLayerGroups Action, Next: gtk GetXY Action, Prev: gtk DoWindows Action, Up: gtk actions + +F.3.6 gtk EditLayerGroups +------------------------- + +EditLayerGroups() + +Open the preferences window which allows editing of the layer groups. + + Opens the preferences window which is where the layer groups are +edited. This action is primarily provides to provide menu resource +compatibility with the lesstif HID. + + +File: pcb.info, Node: gtk GetXY Action, Next: gtk ImportGUI Action, Prev: gtk EditLayerGroups Action, Up: gtk actions + +F.3.7 gtk GetXY +--------------- + +GetXY() + +N_("Get a coordinate."); + + Prompts the user for a coordinate, if one is not already selected. + + +File: pcb.info, Node: gtk ImportGUI Action, Next: gtk Pan Action, Prev: gtk GetXY Action, Up: gtk actions + +F.3.8 gtk ImportGUI +------------------- + +ImportGUI() + +N_("Asks user which schematics to import into PCB. "); + + Asks user which schematics to import into PCB. + + +File: pcb.info, Node: gtk Pan Action, Next: gtk Popup Action, Prev: gtk ImportGUI Action, Up: gtk actions + +F.3.9 gtk Pan +------------- + +Pan([thumb], Mode) + +N_("Start or stop panning (Mode = 1 to start, 0 to stop) Optional thumb +argument is ignored for now in gtk hid. "); + + Start or stop panning. To start call with Mode = 1, to stop call +with Mode = 0. + + +File: pcb.info, Node: gtk Popup Action, Next: gtk Print Action, Prev: gtk Pan Action, Up: gtk actions + +F.3.10 gtk Popup +---------------- + +Popup(MenuName, [Button]) + +N_("Bring up the popup menu specified by `MenuName'. If called by a +mouse event then the mouse button number must be specified as the +optional second argument."); + + This just pops up the specified menu. The menu must have been +defined as a named subresource of the Popups resource in the menu +resource file. + + +File: pcb.info, Node: gtk Print Action, Next: gtk PrintCalibrate Action, Prev: gtk Popup Action, Up: gtk actions + +F.3.11 gtk Print +---------------- + +Print() + +N_("Print the layout."); + + This will find the default printing HID, prompt the user for its +options, and print the layout. + + +File: pcb.info, Node: gtk PrintCalibrate Action, Next: gtk Save Action, Prev: gtk Print Action, Up: gtk actions + +F.3.12 gtk PrintCalibrate +------------------------- + +PrintCalibrate() + +N_("Calibrate the printer."); + + This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + + +File: pcb.info, Node: gtk Save Action, Next: gtk SelectLayer Action, Prev: gtk PrintCalibrate Action, Up: gtk actions + +F.3.13 gtk Save +--------------- + +Save() +Save(Layout|LayoutAs) +Save(AllConnections|AllUnusedPins|ElementConnections) +Save(PasteBuffer) + +N_("Save layout and/or element data to a user-selected file."); + + This action is a GUI front-end to the core's `SaveTo' action (*note +SaveTo Action::). If you happen to pass a filename, like `SaveTo', +then `SaveTo' is called directly. Else, the user is prompted for a +filename to save, and then `SaveTo' is called with that filename. + + +File: pcb.info, Node: gtk SelectLayer Action, Next: gtk SetUnits Action, Prev: gtk Save Action, Up: gtk actions + +F.3.14 gtk SelectLayer +---------------------- + +SelectLayer(1..MAXLAYER|Silk|Rats) + +Select which layer is the current layer. + + The specified layer becomes the currently active layer. It is made +visible if it is not already visible + + +File: pcb.info, Node: gtk SetUnits Action, Next: gtk SwapSides Action, Prev: gtk SelectLayer Action, Up: gtk actions + +F.3.15 gtk SetUnits +------------------- + +SetUnits(mm|mil) + +N_("Set the default measurement units."); + +`mil' + Sets the display units to mils (1/1000 inch). + +`mm' + Sets the display units to millimeters. + + + +File: pcb.info, Node: gtk SwapSides Action, Next: gtk ToggleView Action, Prev: gtk SetUnits Action, Up: gtk actions + +F.3.16 gtk SwapSides +-------------------- + +SwapSides(|v|h|r) + +N_("Swaps the side of the board you're looking at."); + + This action changes the way you view the board. + +`v' + Flips the board over vertically (up/down). + +`h' + Flips the board over horizontally (left/right), like flipping + pages in a book. + +`r' + Rotates the board 180 degrees without changing sides. + + + If no argument is given, the board isn't moved but the opposite side +is shown. + + Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + + As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the "working +side" of the board. + + +File: pcb.info, Node: gtk ToggleView Action, Next: gtk Zoom Action, Prev: gtk SwapSides Action, Up: gtk actions + +F.3.17 gtk ToggleView +--------------------- + +ToggleView(1..MAXLAYER) +ToggleView(layername) +ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide) + +Toggle the visibility of the specified layer or layer group. + + If you pass an integer, that layer is specified by index (the first +layer is `1', etc). If you pass a layer name, that layer is specified +by name. When a layer is specified, the visibility of the layer group +containing that layer is toggled. + + If you pass a special layer name, the visibility of those components +(silk, rats, etc) is toggled. Note that if you have a layer named the +same as a special layer, the layer is chosen over the special layer. + + +File: pcb.info, Node: gtk Zoom Action, Prev: gtk ToggleView Action, Up: gtk actions + +F.3.18 gtk Zoom +--------------- + +Zoom() +Zoom(factor) + +N_("Various zoom factor changes."); Changes the zoom (magnification) of +the view of the board. If no arguments are passed, the view is scaled +such that the board just fits inside the visible window (i.e. "view +all"). Otherwise, FACTOR specifies a change in zoom factor. It may be +prefixed by `+', `-', or `=' to change how the zoom factor is modified. +The FACTOR is a floating point number, such as `1.5' or `0.75'. + +`+FACTOR' + Values greater than 1.0 cause the board to be drawn smaller; more + of the board will be visible. Values between 0.0 and 1.0 cause + the board to be drawn bigger; less of the board will be visible. + +`-FACTOR' + Values greater than 1.0 cause the board to be drawn bigger; less of + the board will be visible. Values between 0.0 and 1.0 cause the + board to be drawn smaller; more of the board will be visible. + +`=FACTOR' + The FACTOR is an absolute zoom factor; the unit for this value is + "PCB units per screen pixel". Since PCB units are 0.01 mil, a + FACTOR of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, + about the actual resolution of most screens - resulting in an + "actual size" board. Similarly, a FACTOR of 100 gives you a 10x + actual size. + + + Note that zoom factors of zero are silently ignored. + + +File: pcb.info, Node: lesstif actions, Prev: gtk actions, Up: Action Reference + +F.4 lesstif actions +=================== + +* Menu: + +* lesstif About Action:: Tell the user about this version of PCB. +* lesstif AdjustSizes Action:: Let the user change the board size, DRC parameters, etc +* lesstif AdjustStyle Action:: Displays the route style adjustment window. +* lesstif Benchmark Action:: Benchmark the GUI speed. +* lesstif Command Action:: Displays the command line input window. +* lesstif Cursor Action:: Move the cursor. +* lesstif Debug Action:: Debug action. +* lesstif DebugXY Action:: Debug action, with coordinates +* lesstif DoWindows Action:: Open various GUI windows. +* lesstif DumpKeys Action:: Dump Lesstif key bindings. +* lesstif EditLayerGroups Action:: Let the user change the layer groupings +* lesstif Export Action:: Export the layout. +* lesstif GetXY Action:: Get a coordinate. +* lesstif ImportGUI Action:: Lets the user choose the schematics to import from +* lesstif LibraryShow Action:: Displays the library window. +* lesstif Load Action:: Load layout data from a user-selected file. +* lesstif LoadVendor Action:: Loads a user-selected vendor resource file. +* lesstif NetlistShow Action:: Selects the given pinname or netname in the netlist window. +* lesstif Print Action:: Print the layout. +* lesstif PrintCalibrate Action:: Calibrate the printer. +* lesstif PromptFor Action:: Prompt for a response. +* lesstif Return Action:: Simulate a passing or failing action. +* lesstif Save Action:: Save layout data to a user-selected file. +* lesstif SelectLayer Action:: Select which layer is the current layer. +* lesstif SetUnits Action:: Set the default measurement units. +* lesstif SwapSides Action:: Swaps the side of the board you're looking at. +* lesstif ToggleView Action:: Toggle the visibility of the specified layer or layer group. +* lesstif Zoom Action:: Various zoom factor changes. + + +File: pcb.info, Node: lesstif About Action, Next: lesstif AdjustSizes Action, Up: lesstif actions + +F.4.1 lesstif About +------------------- + +About() + +Tell the user about this version of PCB. + + This just pops up a dialog telling the user which version of `pcb' +they're running. + + +File: pcb.info, Node: lesstif AdjustSizes Action, Next: lesstif AdjustStyle Action, Prev: lesstif About Action, Up: lesstif actions + +F.4.2 lesstif AdjustSizes +------------------------- + +AdjustSizes() + +Let the user change the board size, DRC parameters, etc + + Displays a dialog box that lets the user change the board size, DRC +parameters, and text scale. + + The units are determined by the default display units. + + +File: pcb.info, Node: lesstif AdjustStyle Action, Next: lesstif Benchmark Action, Prev: lesstif AdjustSizes Action, Up: lesstif actions + +F.4.3 lesstif AdjustStyle +------------------------- + +AdjustStyle() + +Displays the route style adjustment window. + + +File: pcb.info, Node: lesstif Benchmark Action, Next: lesstif Command Action, Prev: lesstif AdjustStyle Action, Up: lesstif actions + +F.4.4 lesstif Benchmark +----------------------- + +Benchmark() + +Benchmark the GUI speed. + + This action is used to speed-test the Lesstif graphics subsystem. It +redraws the current screen as many times as possible in ten seconds. +It reports the amount of time needed to draw the screen once. + + +File: pcb.info, Node: lesstif Command Action, Next: lesstif Cursor Action, Prev: lesstif Benchmark Action, Up: lesstif actions + +F.4.5 lesstif Command +--------------------- + +Command() + +Displays the command line input window. + + The command window allows the user to manually enter actions to be +executed. Action syntax can be done one of two ways: + +`' + Follow the action name by an open parenthesis, arguments separated + by commas, end with a close parenthesis. Example: `Abc(1,2,3)' + +`' + Separate the action name and arguments by spaces. Example: `Abc 1 + 2 3'. + + + The first option allows you to have arguments with spaces in them, +but the second is more "natural" to type for most people. + + Note that action names are not case sensitive, but arguments normally +are. However, most actions will check for "keywords" in a case +insensitive way. + + There are three ways to finish with the command window. If you press +the `Enter' key, the command is invoked, the window goes away, and the +next time you bring up the command window it's empty. If you press the +`Esc' key, the window goes away without invoking anything, and the next +time you bring up the command window it's empty. If you change focus +away from the command window (i.e. click on some other window), the +command window goes away but the next time you bring it up it resumes +entering the command you were entering before. + + +File: pcb.info, Node: lesstif Cursor Action, Next: lesstif Debug Action, Prev: lesstif Command Action, Up: lesstif actions + +F.4.6 lesstif Cursor +-------------------- + +Cursor(Type,DeltaUp,DeltaRight,Units) + +Move the cursor. + + This action moves the mouse cursor. Unlike other actions which take +coordinates, this action's coordinates are always relative to the +user's view of the board. Thus, a positive DELTAUP may move the cursor +towards the board origin if the board is inverted. + + Type is one of `Pan' or `Warp'. `Pan' causes the viewport to move +such that the crosshair is under the mouse cursor. `Warp' causes the +mouse cursor to move to be above the crosshair. + + UNITS can be one of the following: + +`mil' +`mm' + The cursor is moved by that amount, in board units. + +`grid' + The cursor is moved by that many grid points. + +`view' + The values are percentages of the viewport's view. Thus, a pan of + `100' would scroll the viewport by exactly the width of the + current view. + +`board' + The values are percentages of the board size. Thus, a move of + `50,50' moves you halfway across the board. + + + +File: pcb.info, Node: lesstif Debug Action, Next: lesstif DebugXY Action, Prev: lesstif Cursor Action, Up: lesstif actions + +F.4.7 lesstif Debug +------------------- + +Debug(...) + +Debug action. + + This action exists to help debug scripts; it simply prints all its +arguments to stdout. + + +File: pcb.info, Node: lesstif DebugXY Action, Next: lesstif DoWindows Action, Prev: lesstif Debug Action, Up: lesstif actions + +F.4.8 lesstif DebugXY +--------------------- + +DebugXY(...) + +Debug action, with coordinates + + Like `Debug', but requires a coordinate. If the user hasn't yet +indicated a location on the board, the user will be prompted to click +on one. + + +File: pcb.info, Node: lesstif DoWindows Action, Next: lesstif DumpKeys Action, Prev: lesstif DebugXY Action, Up: lesstif actions + +F.4.9 lesstif DoWindows +----------------------- + +DoWindows(1|2|3|4) +DoWindows(Layout|Library|Log|Netlist) + +Open various GUI windows. + +`1' +`Layout' + Open the layout window. Since the layout window is always shown + anyway, this has no effect. + +`2' +`Library' + Open the library window. + +`3' +`Log' + Open the log window. + +`4' +`Netlist' + Open the netlist window. + + + +File: pcb.info, Node: lesstif DumpKeys Action, Next: lesstif EditLayerGroups Action, Prev: lesstif DoWindows Action, Up: lesstif actions + +F.4.10 lesstif DumpKeys +----------------------- + +DumpKeys() + +Dump Lesstif key bindings. + + Causes the list of key bindings (from `pcb-menu.res') to be dumped +to stdout. This is most useful when invoked from the command line like +this: + + pcb --action-string DumpKeys + + +File: pcb.info, Node: lesstif EditLayerGroups Action, Next: lesstif Export Action, Prev: lesstif DumpKeys Action, Up: lesstif actions + +F.4.11 lesstif EditLayerGroups +------------------------------ + +EditLayerGroups() + +Let the user change the layer groupings + + Displays a dialog that lets the user view and change the layer +groupings. Each layer (row) can be a member of any one layer group +(column). Note the special layers `solder' and `component' allow you +to specify which groups represent the top and bottom of the board. + + See *note ChangeName Action::. + + +File: pcb.info, Node: lesstif Export Action, Next: lesstif GetXY Action, Prev: lesstif EditLayerGroups Action, Up: lesstif actions + +F.4.12 lesstif Export +--------------------- + +Export() + +Export the layout. + + Prompts the user for an exporter to use. Then, prompts the user for +that exporter's options, and exports the layout. + + +File: pcb.info, Node: lesstif GetXY Action, Next: lesstif ImportGUI Action, Prev: lesstif Export Action, Up: lesstif actions + +F.4.13 lesstif GetXY +-------------------- + +GetXY() + +Get a coordinate. + + Prompts the user for a coordinate, if one is not already selected. + + +File: pcb.info, Node: lesstif ImportGUI Action, Next: lesstif LibraryShow Action, Prev: lesstif GetXY Action, Up: lesstif actions + +F.4.14 lesstif ImportGUI +------------------------ + +ImportGUI() + +Lets the user choose the schematics to import from + + Displays a dialog that lets the user select the schematic(s) to +import from, then saves that information in the layout's attributes for +future imports. + + +File: pcb.info, Node: lesstif LibraryShow Action, Next: lesstif Load Action, Prev: lesstif ImportGUI Action, Up: lesstif actions + +F.4.15 lesstif LibraryShow +-------------------------- + +LibraryShow() + +Displays the library window. + + +File: pcb.info, Node: lesstif Load Action, Next: lesstif LoadVendor Action, Prev: lesstif LibraryShow Action, Up: lesstif actions + +F.4.16 lesstif Load +------------------- + +Load() +Load(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert) + +Load layout data from a user-selected file. + + This action is a GUI front-end to the core's `LoadFrom' action +(*note LoadFrom Action::). If you happen to pass a filename, like +`LoadFrom', then `LoadFrom' is called directly. Else, the user is +prompted for a filename to load, and then `LoadFrom' is called with +that filename. + + +File: pcb.info, Node: lesstif LoadVendor Action, Next: lesstif NetlistShow Action, Prev: lesstif Load Action, Up: lesstif actions + +F.4.17 lesstif LoadVendor +------------------------- + +LoadVendor() + +Loads a user-selected vendor resource file. + + The user is prompted for a file to load, and then `LoadVendorFrom' +is called (*note LoadVendorFrom Action::) to load that vendor file. + + +File: pcb.info, Node: lesstif NetlistShow Action, Next: lesstif Print Action, Prev: lesstif LoadVendor Action, Up: lesstif actions + +F.4.18 lesstif NetlistShow +-------------------------- + +NetlistShow(pinname|netname) + +Selects the given pinname or netname in the netlist window. + + +File: pcb.info, Node: lesstif Print Action, Next: lesstif PrintCalibrate Action, Prev: lesstif NetlistShow Action, Up: lesstif actions + +F.4.19 lesstif Print +-------------------- + +Print() + +Print the layout. + + This will find the default printing HID, prompt the user for its +options, and print the layout. + + +File: pcb.info, Node: lesstif PrintCalibrate Action, Next: lesstif PromptFor Action, Prev: lesstif Print Action, Up: lesstif actions + +F.4.20 lesstif PrintCalibrate +----------------------------- + +PrintCalibrate() + +Calibrate the printer. + + This will print a calibration page, which you would measure and type +the measurements in, so that future printouts will be more precise. + + +File: pcb.info, Node: lesstif PromptFor Action, Next: lesstif Return Action, Prev: lesstif PrintCalibrate Action, Up: lesstif actions + +F.4.21 lesstif PromptFor +------------------------ + +PromptFor([message[,default]]) + +Prompt for a response. + + This is mostly for testing the lesstif HID interface. The parameters +are passed to the `prompt_for()' HID function, causing the user to be +prompted for a response. The respose is simply printed to the user's +stdout. + + +File: pcb.info, Node: lesstif Return Action, Next: lesstif Save Action, Prev: lesstif PromptFor Action, Up: lesstif actions + +F.4.22 lesstif Return +--------------------- + +Return(0|1) + +Simulate a passing or failing action. + + This is for testing. If passed a 0, does nothing and succeeds. If +passed a 1, does nothing but pretends to fail. + + +File: pcb.info, Node: lesstif Save Action, Next: lesstif SelectLayer Action, Prev: lesstif Return Action, Up: lesstif actions + +F.4.23 lesstif Save +------------------- + +Save() +Save(Layout|LayoutAs) +Save(AllConnections|AllUnusedPins|ElementConnections) +Save(PasteBuffer) + +Save layout data to a user-selected file. + + This action is a GUI front-end to the core's `SaveTo' action (*note +SaveTo Action::). If you happen to pass a filename, like `SaveTo', +then `SaveTo' is called directly. Else, the user is prompted for a +filename to save, and then `SaveTo' is called with that filename. + + +File: pcb.info, Node: lesstif SelectLayer Action, Next: lesstif SetUnits Action, Prev: lesstif Save Action, Up: lesstif actions + +F.4.24 lesstif SelectLayer +-------------------------- + +SelectLayer(1..MAXLAYER|Silk|Rats) + +Select which layer is the current layer. + + The specified layer becomes the currently active layer. It is made +visible if it is not already visible + + +File: pcb.info, Node: lesstif SetUnits Action, Next: lesstif SwapSides Action, Prev: lesstif SelectLayer Action, Up: lesstif actions + +F.4.25 lesstif SetUnits +----------------------- + +SetUnits(mm|mil) + +Set the default measurement units. + +`mil' + Sets the display units to mils (1/1000 inch). + +`mm' + Sets the display units to millimeters. + + + +File: pcb.info, Node: lesstif SwapSides Action, Next: lesstif ToggleView Action, Prev: lesstif SetUnits Action, Up: lesstif actions + +F.4.26 lesstif SwapSides +------------------------ + +SwapSides(|v|h|r) + +Swaps the side of the board you're looking at. + + This action changes the way you view the board. + +`v' + Flips the board over vertically (up/down). + +`h' + Flips the board over horizontally (left/right), like flipping + pages in a book. + +`r' + Rotates the board 180 degrees without changing sides. + + + If no argument is given, the board isn't moved but the opposite side +is shown. + + Normally, this action changes which pads and silk layer are drawn as +true silk, and which are drawn as the "invisible" layer. It also +determines which solder mask you see. + + As a special case, if the layer group for the side you're looking at +is visible and currently active, and the layer group for the opposite +is not visible (i.e. disabled), then this action will also swap which +layer group is visible and active, effectively swapping the "working +side" of the board. + + +File: pcb.info, Node: lesstif ToggleView Action, Next: lesstif Zoom Action, Prev: lesstif SwapSides Action, Up: lesstif actions + +F.4.27 lesstif ToggleView +------------------------- + +ToggleView(1..MAXLAYER) +ToggleView(layername) +ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide) + +Toggle the visibility of the specified layer or layer group. + + If you pass an integer, that layer is specified by index (the first +layer is `1', etc). If you pass a layer name, that layer is specified +by name. When a layer is specified, the visibility of the layer group +containing that layer is toggled. + + If you pass a special layer name, the visibility of those components +(silk, rats, etc) is toggled. Note that if you have a layer named the +same as a special layer, the layer is chosen over the special layer. + + +File: pcb.info, Node: lesstif Zoom Action, Prev: lesstif ToggleView Action, Up: lesstif actions + +F.4.28 lesstif Zoom +------------------- + +Zoom() +Zoom(factor) + +Various zoom factor changes. + + Changes the zoom (magnification) of the view of the board. If no +arguments are passed, the view is scaled such that the board just fits +inside the visible window (i.e. "view all"). Otherwise, FACTOR +specifies a change in zoom factor. It may be prefixed by `+', `-', or +`=' to change how the zoom factor is modified. The FACTOR is a +floating point number, such as `1.5' or `0.75'. + +`+FACTOR' + Values greater than 1.0 cause the board to be drawn smaller; more + of the board will be visible. Values between 0.0 and 1.0 cause + the board to be drawn bigger; less of the board will be visible. + +`-FACTOR' + Values greater than 1.0 cause the board to be drawn bigger; less of + the board will be visible. Values between 0.0 and 1.0 cause the + board to be drawn smaller; more of the board will be visible. + +`=FACTOR' + The FACTOR is an absolute zoom factor; the unit for this value is + "PCB units per screen pixel". Since PCB units are 0.01 mil, a + FACTOR of 1000 means 10 mils (0.01 in) per pixel, or 100 DPI, + about the actual resolution of most screens - resulting in an + "actual size" board. Similarly, a FACTOR of 100 gives you a 10x + actual size. + + + Note that zoom factors of zero are silently ignored. + + +File: pcb.info, Node: Glossary, Next: Index, Prev: Action Reference, Up: Top + +Appendix G Glossary +******************* + +Footprint + The pattern of metal, silkscreen, soldermask relief, and drills + which defines where you place a component on a circuit board. + Footprints are the placed by the user onto the PC board during the + placement phase of PCB layout. + +Gerber File + The file format used in the industry to convey a board database to + the manufacturer is RS-274X (which replaces the now obsolete + RS-274D format). This file format was originally developed by + Gerber for their photo plotters and thus RS-274D and RS-274X + format files are often times refered to as "Gerber" files. + +Thermal, Thermal Relief + A thermal relief is a way of connecting a pin to a ground or power + plane. Instead of directly connecting to the plane, small "spokes" + are used to increase the thermal resistance between the pin and + the plane. Often times these connections are refered to as simply + a thermal. By increasing the thermal resistance to the plane, it + becomes easier to solder to the pin. In the drawing below, the + pin on the left is connected to the polygon using a solid + connection with no thermal relief, the middle pin is connected + using a thermal, while the pin on the right has no connection to + the polygon. In PCB, the "Thermal" Tool is used to make both a + solid connection and one with thermal relief (see *note Polygon + Objects::). + + [image src="thermal.png" alt="Example of a thermal relief"] + + +File: pcb.info, Node: Index, Prev: Glossary, Up: Top + +Index of Resources +****************** + +[index] +* Menu: + +* absoluteGrid: Resources. (line 9) +* alignmentDistance: Resources. (line 13) +* allDirectionLines: Resources. (line 17) +* backgroundImage: Resources. (line 21) +* backupInterval: Resources. (line 43) +* bloat: Resources. (line 52) +* BTNMOD: running configure. (line 25) +* connectedColor: Resources. (line 55) +* cross hairColor: Resources. (line 60) +* DEFAULTFONT: running configure. (line 16) +* DEFAULTLIBRARY: running configure. (line 19) +* Element Search: Regular Expressions. (line 6) +* elementColor: Resources. (line 68) +* elementCommand <1>: File Formats. (line 14) +* elementCommand: Resources. (line 74) +* elementContentsCommand: Resources. (line 173) +* elementPath: Resources. (line 85) +* elementSelectedColor: Resources. (line 68) +* Exporting a layout: Exporting. (line 6) +* fileCommand <1>: File Formats. (line 14) +* fileCommand: Resources. (line 93) +* filePath: Resources. (line 102) +* fontCommand <1>: File Formats. (line 14) +* fontCommand: Resources. (line 110) +* fontFile: Resources. (line 118) +* fontPath: Resources. (line 124) +* GNUM4: running configure. (line 22) +* grid: Resources. (line 128) +* gridColor: Resources. (line 133) +* INFOLIBDIR: running configure. (line 10) +* invisibleObjectsColor: Resources. (line 141) +* layerColor: Resources. (line 145) +* layerGroups: Resources. (line 151) +* layerName: Resources. (line 159) +* layerSelectedColor: Resources. (line 145) +* libraryCommand <1>: File Formats. (line 14) +* libraryCommand: Resources. (line 163) +* libraryContentsCommand: File Formats. (line 14) +* libraryFilename: Resources. (line 179) +* libraryPath: Resources. (line 184) +* lineThickness: Resources. (line 189) +* Measuring distances: Measuring distances. (line 6) +* media: Resources. (line 195) +* offLimitColor: Resources. (line 203) +* PCBLIBDIR: running configure. (line 13) +* pinColor: Resources. (line 208) +* pinoutFont0..6: Resources. (line 213) +* pinoutNameLength: Resources. (line 217) +* pinoutOffsetX: Resources. (line 222) +* pinoutOffsetY: Resources. (line 222) +* pinoutTextOffsetX: Resources. (line 228) +* pinoutTextOffsetY: Resources. (line 228) +* pinoutZoom: Resources. (line 234) +* pinSelectedColor: Resources. (line 208) +* printCommand: Resources. (line 239) +* raiseLogWindow: Resources. (line 244) +* ratCommand: Resources. (line 248) +* ratPath: Resources. (line 252) +* Regular Expressions: Regular Expressions. (line 6) +* resetAfterElement: Resources. (line 255) +* ringBellWhenFinished: Resources. (line 262) +* routeStyle: Resources. (line 267) +* rubberBandMode: Resources. (line 274) +* saveCommand <1>: File Formats. (line 14) +* saveCommand: Resources. (line 278) +* saveInTMP: Resources. (line 285) +* saveLastCommand: Resources. (line 294) +* Searching for elements: Searching for elements. + (line 6) +* shrink: Resources. (line 299) +* size: Resources. (line 302) +* stipplePolygons: Resources. (line 307) +* textScale: Resources. (line 313) +* useLogWindow: Resources. (line 317) +* viaColor: Resources. (line 324) +* viaDrillingHole: Resources. (line 330) +* viaSelectedColor: Resources. (line 324) +* viaThickness: Resources. (line 330) +* volume: Resources. (line 338) +* warnColor: Resources. (line 343) +* zoom: Resources. (line 347) + +Index of Actions, Commands and Options +************************************** + +[index] +* Menu: + +* -- basename : nelma Options. (line 6) +* --action-script : General Options. (line 47) +* --action-string : General Options. (line 50) +* --align-marks: Postscript Export. (line 12) +* --alignment-distance : Sizes. (line 64) +* --all-direction-lines: General GUI Options. (line 35) +* --all-layers: Gerber Export. (line 9) +* --as-shown <1>: PNG Options. (line 23) +* --as-shown: Encapsulated Postscript Export. + (line 13) +* --auto-mirror: Postscript Export. (line 25) +* --background-color : Colors. (line 12) +* --backup-interval: General Options. (line 30) +* --bg-image <1>: lesstif GUI Options. (line 9) +* --bg-image : GTK+ GUI Options. (line 9) +* --black-color : Colors. (line 6) +* --bloat : DRC Options. (line 9) +* --bomfile : BOM Creation. (line 6) +* --clear-line: General GUI Options. (line 21) +* --connected-color : Colors. (line 54) +* --copper-height : nelma Options. (line 12) +* --copyright: General Options. (line 15) +* --cross-color : Colors. (line 18) +* --crosshair-color : Colors. (line 15) +* --default-font : Paths. (line 12) +* --default-PCB-height : Sizes. (line 57) +* --default-PCB-width : Sizes. (line 54) +* --dpi: PNG Options. (line 9) +* --dpi : nelma Options. (line 9) +* --draw-grid: General GUI Options. (line 18) +* --drill-copper: Postscript Export. (line 61) +* --drill-helper: Postscript Export. (line 9) +* --dump-actions: General Options. (line 24) +* --element-color : Colors. (line 36) +* --element-command : Commands. (line 17) +* --element-path : General Options. (line 42) +* --element-selected-color : Colors. (line 48) +* --eps-file : Encapsulated Postscript Export. + (line 6) +* --eps-scale : Encapsulated Postscript Export. + (line 10) +* --fab-author : General Options. (line 53) +* --file-command : Commands. (line 14) +* --file-path : Paths. (line 15) +* --fill-page: Postscript Export. (line 22) +* --font-command : Commands. (line 11) +* --font-path : Paths. (line 20) +* --format : PNG Options. (line 35) +* --full-poly: General GUI Options. (line 24) +* --gerberfile : Gerber Export. (line 6) +* --grid : Sizes. (line 68) +* --grid-color : Colors. (line 60) +* --grid-units-mm : General Options. (line 27) +* --groups : General Options. (line 34) +* --help: General Options. (line 6) +* --invisible-mark-color : Colors. (line 45) +* --invisible-objects-color : Colors. (line 42) +* --keepaway : Sizes. (line 50) +* --layer-color- : Colors. (line 63) +* --layer-name-1 : Layer Names. (line 6) +* --layer-name-2 : Layer Names. (line 9) +* --layer-name-3 : Layer Names. (line 12) +* --layer-name-4 : Layer Names. (line 15) +* --layer-name-5 : Layer Names. (line 18) +* --layer-name-6 : Layer Names. (line 21) +* --layer-name-7 : Layer Names. (line 24) +* --layer-name-8 : Layer Names. (line 27) +* --layer-selected-color- : Colors. (line 66) +* --layer-stack : General Options. (line 56) +* --lib-command : Commands. (line 27) +* --lib-command-dir : Commands. (line 24) +* --lib-contents-command : Commands. (line 31) +* --lib-name : Paths. (line 9) +* --lib-newlib : Paths. (line 6) +* --lib-path : Paths. (line 24) +* --line-thickness : Sizes. (line 42) +* --listen <1>: lesstif GUI Options. (line 6) +* --listen: GTK+ GUI Options. (line 6) +* --lprcommand : lpr Printing Options. + (line 6) +* --mask-color : Colors. (line 73) +* --media : Postscript Export. (line 37) +* --min-drill : DRC Options. (line 21) +* --min-ring : DRC Options. (line 24) +* --min-silk : DRC Options. (line 18) +* --min-width : DRC Options. (line 15) +* --minimum polygon area : Sizes. (line 71) +* --mirror: Postscript Export. (line 19) +* --monochrome <1>: PNG Options. (line 26) +* --monochrome: Encapsulated Postscript Export. + (line 16) +* --multi-file: Postscript Export. (line 51) +* --off-limit-color : Colors. (line 57) +* --only-visible: Encapsulated Postscript Export. + (line 19) +* --only-vivible: PNG Options. (line 29) +* --outfile : PNG Options. (line 6) +* --outline: Postscript Export. (line 16) +* --pcb-menu <1>: lesstif GUI Options. (line 15) +* --pcb-menu : GTK+ GUI Options. (line 15) +* --photo-flip-x: PNG Options. (line 48) +* --photo-flip-y: PNG Options. (line 52) +* --photo-mode: PNG Options. (line 45) +* --pin-color : Colors. (line 27) +* --pin-name-color : Colors. (line 33) +* --pin-selected-color : Colors. (line 30) +* --pinout-offset-x : General GUI Options. (line 6) +* --pinout-offset-y : General GUI Options. (line 9) +* --pinout-text-offset-x : General GUI Options. (line 12) +* --pinout-text-offset-y : General GUI Options. (line 15) +* --png-bloat : PNG Options. (line 39) +* --print-file : Commands. (line 21) +* --ps-bloat : Postscript Export. (line 31) +* --ps-color: Postscript Export. (line 28) +* --ps-invert: Postscript Export. (line 34) +* --psfade : Postscript Export. (line 44) +* --psfile : Postscript Export. (line 6) +* --rat-color : Colors. (line 39) +* --rat-command : Commands. (line 39) +* --rat-selected-color : Colors. (line 51) +* --rat-thickness : Sizes. (line 45) +* --reset-after-element: General Options. (line 68) +* --ring-bell-finished: General Options. (line 72) +* --route-styles : General Options. (line 37) +* --save-command : Commands. (line 36) +* --save-in-tmp: General Options. (line 63) +* --save-last-command: General Options. (line 60) +* --scale : Postscript Export. (line 47) +* --show-actions: General Options. (line 21) +* --show-defaults: General Options. (line 18) +* --show-legend: Postscript Export. (line 64) +* --show-number: General GUI Options. (line 38) +* --shrink : DRC Options. (line 12) +* --snap-pin: General GUI Options. (line 31) +* --substrate-epsilon : nelma Options. (line 18) +* --substrate-height : nelma Options. (line 15) +* --text-scale : Sizes. (line 60) +* --unique-names: General GUI Options. (line 27) +* --use-alpha: PNG Options. (line 32) +* --verbose <1>: Gerber Export. (line 12) +* --verbose: General Options. (line 12) +* --version: General Options. (line 9) +* --via-color : Colors. (line 21) +* --via-drilling-hole : Sizes. (line 39) +* --via-selected-color : Colors. (line 24) +* --via-thickness : Sizes. (line 36) +* --warn-color : Colors. (line 70) +* --x-max: PNG Options. (line 13) +* --xcalib : Postscript Export. (line 55) +* --xy-max: PNG Options. (line 19) +* --xy-unit : BOM Creation. (line 12) +* --xyfile : BOM Creation. (line 9) +* --y-max: PNG Options. (line 16) +* --ycalib : Postscript Export. (line 58) +* :actionCommand(): User Commands. (line 75) +* :l: User Commands. (line 33) +* :le: User Commands. (line 39) +* :m: User Commands. (line 45) +* :q: User Commands. (line 51) +* :rn: User Commands. (line 61) +* :s: User Commands. (line 55) +* :w[q]: User Commands. (line 71) +* AddRats(): Actions. (line 27) +* ApplyVendor() <1>: ApplyVendor Action. (line 8) +* ApplyVendor(): Actions. (line 54) +* Atomic(): Actions. (line 58) +* Bell(): Actions. (line 68) +* ChangeClearSize(): Actions. (line 72) +* ChangeDrillSize(): Actions. (line 83) +* ChangeFlag(): Actions. (line 93) +* ChangeHole(): Actions. (line 101) +* ChangeName(): Actions. (line 107) +* ChangeOctagon(): Actions. (line 117) +* ChangePinName(): Actions. (line 123) +* ChangeSize(): Actions. (line 129) +* ChangeSquare(): Actions. (line 148) +* ClrFlag(): Actions. (line 154) +* Command(): Actions. (line 160) +* Connection(): Actions. (line 167) +* DeleteRats(): Actions. (line 181) +* DisableVendor() <1>: DisableVendor Action. + (line 10) +* DisableVendor(): Actions. (line 188) +* DisperseElements(): Actions. (line 193) +* Display(): Actions. (line 199) +* DRC(): Actions. (line 234) +* EditLayerGroups(): Actions. (line 250) +* EnableVendor() <1>: EnableVendor Action. (line 10) +* EnableVendor(): Actions. (line 254) +* ExecuteFile(): Actions. (line 238) +* Load(): Actions. (line 259) +* LoadVendor(): Actions. (line 265) +* LoadVendorFrom(): LoadVendorFrom Action. + (line 10) +* MarkCrosshair(): Actions. (line 269) +* Mode(): Actions. (line 277) +* MovePointer(): Actions. (line 326) +* MoveToCurrentLayer(): Actions. (line 340) +* New(): Actions. (line 350) +* PasteBuffer(): Actions. (line 355) +* Polygon(): Actions. (line 382) +* Print(): Actions. (line 392) +* Quit(): Actions. (line 412) +* Redo(): Actions. (line 416) +* RemoveSelected(): Actions. (line 430) +* Report(): Actions. (line 434) +* RouteStyle(): Actions. (line 440) +* Save(): Actions. (line 450) +* Select(): Actions. (line 459) +* SetFlag(): Actions. (line 471) +* SetValue(): Actions. (line 477) +* SwapSides(): Actions. (line 499) +* SwitchDrawingLayer(): Actions. (line 503) +* ToggleHideName(): Actions. (line 509) +* ToggleVendor() <1>: ToggleVendor Action. (line 10) +* ToggleVendor(): Actions. (line 516) +* ToggleVisibility(): Actions. (line 521) +* Undo(): Actions. (line 528) +* UnloadVendor() <1>: UnloadVendor Action. (line 10) +* UnloadVendor(): Actions. (line 539) +* Unselect(): Actions. (line 543) + +Index of Concepts +***************** + +[index] +* Menu: + +* /tmp <1>: Resources. (line 285) +* /tmp: Loading and Saving. (line 18) +* action command: User Commands. (line 75) +* action reference: Action Reference. (line 6) +* actions: Actions. (line 6) +* actions file, executing: Actions. (line 238) +* Actions, initiating: User Commands. (line 75) +* align-marks: Postscript Export. (line 12) +* alignment: Resources. (line 13) +* alignment targets: Printing. (line 47) +* Alpha: DEC Alpha. (line 6) +* arc: Arc Objects. (line 6) +* arc, an example: Arcs. (line 6) +* architecture <1>: Linux. (line 6) +* architecture <2>: SCO. (line 6) +* architecture <3>: DEC Alpha. (line 6) +* architecture <4>: SGI. (line 6) +* architecture <5>: Sun. (line 6) +* architecture: HP. (line 6) +* arrow tool: Arrow Tool. (line 6) +* as-shown (EPS): Encapsulated Postscript Export. + (line 13) +* ASCII files, format of: File Formats. (line 6) +* Atari version: History. (line 6) +* atomic: Actions. (line 58) +* auto-router: Menu. (line 121) +* autorouter: Autorouter. (line 6) +* background: Resources. (line 21) +* backup <1>: Resources. (line 43) +* backup: Loading and Saving. (line 18) +* bell: Actions. (line 68) +* bill of materials: bom. (line 6) +* bloat: Resources. (line 52) +* bom: bom. (line 6) +* buffer, an example: Pastebuffer. (line 6) +* buffer, convert contents to element: Elements. (line 59) +* Buffer, popup menu: Menu. (line 109) +* buffer, selecting a: Actions. (line 355) +* button translations: Actions. (line 6) +* cat: Resources. (line 93) +* centering: Actions. (line 199) +* centroid file format: Centroid File Format. + (line 6) +* centroid file, algorithms: Centroid File Format. + (line 37) +* change active layer: Layer Controls. (line 6) +* change drawing layer: Actions. (line 503) +* change object name: Actions. (line 107) +* change settings: Actions. (line 477) +* change sizes: Actions. (line 72) +* change square flag: Actions. (line 148) +* change viewing side: Actions. (line 499) +* changing layers: Moving and Copying. (line 20) +* changing pin/pad names: Actions. (line 123) +* clearance: Line Objects. (line 38) +* clearance, changing of objects: Actions. (line 72) +* clearance, for new lines: Menu. (line 79) +* clipping lines to 45 degree <1>: Actions. (line 199) +* clipping lines to 45 degree: Resources. (line 17) +* closing a polygon: Actions. (line 382) +* cnc: gcode. (line 6) +* color printout: Printing. (line 32) +* color, warning: Resources. (line 343) +* colors: Resources. (line 55) +* command-line options: Command-Line Options. + (line 6) +* compile, how to: compiling. (line 6) +* configure: running configure. (line 6) +* connection, removing an: Translations. (line 11) +* connections, colors: Resources. (line 55) +* connections, creating list of: Connection Lists. (line 6) +* connections, reseting: Actions. (line 167) +* connections, reseting after element: Resources. (line 255) +* connections, searching for: Actions. (line 167) +* Connects, popup menu: Menu. (line 121) +* copy an object: Translations. (line 40) +* copying objects: Actions. (line 355) +* copying, an example: Moving and Copying. (line 6) +* creating objects: Common. (line 6) +* cursor color: Resources. (line 60) +* cursor movements: Actions. (line 326) +* cursor position: Actions. (line 269) +* cursor steps: Resources. (line 128) +* cutting objects: Actions. (line 355) +* DEC: DEC Alpha. (line 6) +* default font: Resources. (line 118) +* default layout size: Resources. (line 302) +* default library: Resources. (line 179) +* default text scaling: Resources. (line 313) +* default translations: Translations. (line 6) +* design rule checker, invoking: Menu. (line 121) +* design rule checking <1>: Actions. (line 234) +* design rule checking: Design Rule Checking. + (line 6) +* device, selecting an output: Printing. (line 21) +* directory /tmp <1>: Resources. (line 285) +* directory /tmp: Loading and Saving. (line 18) +* dispersing elements: Actions. (line 193) +* display: Resources. (line 307) +* displaying element names <1>: Actions. (line 199) +* displaying element names: Menu. (line 49) +* displaying pinout: Actions. (line 199) +* displaying status information: Status-line and Input-field. + (line 6) +* distributing elements: Actions. (line 193) +* DOS filenames: Printing. (line 80) +* drawing objects: Drawing and Removing. + (line 6) +* drc <1>: Actions. (line 234) +* drc <2>: Resources. (line 52) +* drc: Design Rule Checking. + (line 6) +* drill: Actions. (line 434) +* drill report: Menu. (line 143) +* drill sizes, list of standard: Standard Drill Sizes. + (line 6) +* Drill table: Vendor drill mapping. + (line 6) +* drill-helper: Postscript Export. (line 9) +* drilling hole, changing of objects: Actions. (line 83) +* drilling hole, setting of initial size: Actions. (line 477) +* Edit, popup menu: Menu. (line 40) +* element name, hiding: Actions. (line 509) +* element name, removing from silk-screen: Actions. (line 509) +* Element Search: Regular Expressions. (line 6) +* element, an example: Elements. (line 6) +* element, an overview: Element Objects. (line 6) +* element, color: Resources. (line 68) +* element, command: Resources. (line 74) +* element, creating a new package: Elements. (line 59) +* element, display names of <1>: Actions. (line 199) +* element, display names of: Menu. (line 49) +* element, editing: Menu. (line 109) +* element, file format: Element File. (line 6) +* element, files: Resources. (line 74) +* element, loading to buffer: User Commands. (line 39) +* element, move name of: Translations. (line 40) +* elements, dispersing: Actions. (line 193) +* elements, distributing: Actions. (line 193) +* encapsulated postscript: eps. (line 6) +* entering user commands: User Commands. (line 6) +* eps: eps. (line 6) +* erasing objects: Drawing and Removing. + (line 6) +* example files: Elements. (line 19) +* example of buffer handling: Pastebuffer. (line 6) +* example of connection lists: Connection Lists. (line 6) +* example of copying: Moving and Copying. (line 6) +* example of creating an element: Elements. (line 59) +* example of element handling: Elements. (line 6) +* example of line handling: Lines. (line 6) +* example of loading: Loading and Saving. (line 6) +* example of loading an element file: Elements. (line 41) +* example of moving: Moving and Copying. (line 6) +* example of pastebuffer handling: Pastebuffer. (line 6) +* example of pin handling: Elements. (line 41) +* example of polygon handling: Polygons. (line 6) +* example of printing: Printing. (line 6) +* example of rectangle handling: Polygons. (line 6) +* example of saving: Loading and Saving. (line 6) +* example of text handling: Text. (line 6) +* example of via handling: Vias. (line 6) +* exit <1>: Actions. (line 412) +* exit: User Commands. (line 51) +* Exporting a layout: Exporting. (line 6) +* file format, element data: Element File. (line 6) +* file format, font data: Font File. (line 6) +* file format, layout data: Layout File. (line 6) +* file format, libraries: Library File. (line 6) +* file format, library contents: Library Contents File. + (line 6) +* file formats: File Formats. (line 6) +* file formats, pads and lines: Pad and Line Representation. + (line 6) +* file load command: Resources. (line 93) +* file save command: Resources. (line 278) +* File sytax: File Syntax. (line 6) +* File, popup menu: Menu. (line 27) +* flags, changing: Actions. (line 93) +* flags, clearing: Actions. (line 154) +* flags, setting: Actions. (line 471) +* font command: Resources. (line 110) +* font file, format of: Font File. (line 6) +* font files: Resources. (line 110) +* font, an overview: Symbol Objects. (line 6) +* font, used for pin names: Resources. (line 213) +* format of element files: Element File. (line 6) +* format of font files: Font File. (line 6) +* format of layout files: Layout File. (line 6) +* format of libraries: Library File. (line 6) +* format of library contents: Library Contents File. + (line 6) +* FreeBSD: BSD. (line 6) +* g-code: gcode. (line 6) +* gcode: gcode. (line 6) +* gEDA, how to interface with: gEDA. (line 6) +* gerber: gerber. (line 7) +* glossary: Glossary. (line 6) +* GNU build system: quickstart. (line 6) +* GNU configure script: running configure. (line 6) +* grid <1>: Resources. (line 9) +* grid: Layout Area. (line 6) +* grid color: Resources. (line 133) +* grid, absolute and relative: Actions. (line 199) +* grid, alignment: Menu. (line 49) +* grid, display <1>: Actions. (line 199) +* grid, display: Menu. (line 49) +* grid, setting of: Actions. (line 477) +* groups: Resources. (line 151) +* groups, editing of: Actions. (line 250) +* gschem, how to interface with: gEDA. (line 6) +* Hewlett Packard: HP. (line 6) +* hide element name: Actions. (line 509) +* how to start: Getting Started. (line 6) +* HP: HP. (line 6) +* image export: png. (line 6) +* index of terms: Glossary. (line 6) +* Info, popup menu: Menu. (line 143) +* information about objects: Actions. (line 434) +* input-field, position of: Status-line and Input-field. + (line 6) +* inputfield, saving entered command-line: Resources. (line 294) +* inputfield, start user input: Actions. (line 160) +* install, how to: compiling. (line 6) +* key translations: Actions. (line 6) +* keyboard bell: Resources. (line 262) +* layer controls: Layer Controls. (line 6) +* layer groups: Layer Objects. (line 19) +* layer visibility, toggling: Actions. (line 521) +* layer, change active: Actions. (line 503) +* layer, name of: Resources. (line 159) +* layers, an overview: Layer Objects. (line 6) +* layers, changing which is active: Layer Controls. (line 6) +* layers, colors: Resources. (line 145) +* layers, editing of groups: Actions. (line 250) +* layers, groups: Resources. (line 151) +* layers, switching on/off: Layer Controls. (line 6) +* layout files: Resources. (line 93) +* layout files, format of: Layout File. (line 6) +* layout files, saving of: User Commands. (line 55) +* layout objects, an overview: Intro. (line 6) +* layout, default size of: Resources. (line 302) +* layout, loading a: User Commands. (line 33) +* layout, loading to buffer: User Commands. (line 45) +* layout, merging a: User Commands. (line 45) +* layout, printing a: Actions. (line 392) +* layout, start a new: Actions. (line 350) +* layout-name <1>: User Commands. (line 61) +* layout-name: Element Objects. (line 6) +* length of a pin name: Resources. (line 217) +* library accuracy: Element Objects. (line 74) +* library command: Resources. (line 163) +* library contents command: Resources. (line 173) +* library contents file, format of: Library Contents File. + (line 6) +* library creation: Library Creation. (line 6) +* library file, format of: Library File. (line 6) +* library name: Resources. (line 179) +* library searchpath: Resources. (line 184) +* library window: Library Window. (line 6) +* lines, an example: Lines. (line 6) +* lines, an overview: Line Objects. (line 6) +* lines, clipping to 45 degree <1>: Actions. (line 199) +* lines, clipping to 45 degree: Resources. (line 17) +* lines, setting of initial size: Actions. (line 477) +* lines, size: Resources. (line 189) +* Linux: Linux. (line 6) +* listing library contents: Resources. (line 173) +* loading a layout to buffer: User Commands. (line 45) +* loading elements: Resources. (line 74) +* loading elements to buffer: User Commands. (line 39) +* loading files: Actions. (line 259) +* loading fonts: Resources. (line 110) +* loading layouts <1>: Resources. (line 93) +* loading layouts: User Commands. (line 33) +* loading symbols: Resources. (line 110) +* loading, an example: Loading and Saving. (line 6) +* log window <1>: Resources. (line 244) +* log window: Log Window. (line 6) +* m4: Resources. (line 74) +* m4, preprocessing example files: Elements. (line 19) +* mark: Actions. (line 269) +* Measuring distances: Measuring distances. (line 6) +* media: Resources. (line 195) +* media margin: Resources. (line 195) +* media, size of: Printing. (line 59) +* menus: Menu. (line 6) +* merging layouts: User Commands. (line 45) +* messages <1>: Resources. (line 244) +* messages: Log Window. (line 6) +* mirroring printout: Printing. (line 28) +* mode selection: Tool Selectors. (line 6) +* mode, selecting of: Actions. (line 277) +* mounting holes: Actions. (line 101) +* move: Resources. (line 274) +* move an object: Translations. (line 40) +* moving objects: Arrow Tool. (line 6) +* moving objects to current layer: Actions. (line 340) +* moving, an example: Moving and Copying. (line 6) +* moving, traces to a different layer: Moving and Copying. (line 20) +* multi-file: Postscript Export. (line 51) +* name of an element: Actions. (line 199) +* name, change an objects: Actions. (line 107) +* namelength of pins: Resources. (line 217) +* nelma: nelma. (line 6) +* NetBSD: BSD. (line 6) +* netlist <1>: Actions. (line 27) +* netlist <2>: Resources. (line 248) +* netlist <3>: Rats Nest. (line 6) +* netlist: Net Objects. (line 6) +* Netlist Window: Netlist Window. (line 6) +* netlist, file format: Netlist File. (line 6) +* netlist, reading: Netlist File. (line 6) +* object report: Menu. (line 143) +* object, change name of: Actions. (line 107) +* object, changing the size of an: Common. (line 6) +* object, copy an: Translations. (line 40) +* object, creating an: Common. (line 6) +* object, drawing and removing: Drawing and Removing. + (line 6) +* object, move an: Translations. (line 40) +* object, removing an <1>: Translations. (line 11) +* object, removing an: Common. (line 6) +* objects, moving to current layer: Actions. (line 340) +* octagonal flag, changing: Actions. (line 93) +* octagonal flag, clearing: Actions. (line 154) +* octagonal flag, setting: Actions. (line 471) +* octagonal pins and vias: Actions. (line 117) +* off limit color: Resources. (line 203) +* offset of pinnames: Resources. (line 228) +* offset of pinout: Resources. (line 222) +* offset of printout: Printing. (line 75) +* old library: Element Objects. (line 74) +* only-visible: Encapsulated Postscript Export. + (line 19) +* OpenWindows: Sun. (line 6) +* operation modes, selecting of: Actions. (line 277) +* optimizer: Trace Optimizer. (line 6) +* outline printout: Printing. (line 36) +* output device: Printing. (line 21) +* overlap, minimum: Design Rule Checking. + (line 6) +* pad specification: Pad and Line Representation. + (line 6) +* pastebuffer, an example: Pastebuffer. (line 6) +* pastebuffer, convert contents to element: Elements. (line 59) +* pastebuffer, popup menu: Menu. (line 109) +* pastebuffer, selecting a: Actions. (line 355) +* path for element files: Resources. (line 85) +* path for font files: Resources. (line 124) +* path for layout files: Resources. (line 102) +* path for libraries: Resources. (line 184) +* PC UNIX <1>: BSD. (line 6) +* PC UNIX <2>: Linux. (line 6) +* PC UNIX: SCO. (line 6) +* PCB, an overview: Overview. (line 6) +* photo-mode: PNG Options. (line 45) +* pin color: Resources. (line 208) +* pin, name of: Resources. (line 217) +* pin/pad names, changing: Actions. (line 123) +* pinout, display of: Actions. (line 199) +* pinout, font to display pin names: Resources. (line 213) +* pinout, zoomfactor of display: Resources. (line 234) +* pins, an example: Elements. (line 41) +* pins, changing shape of: Actions. (line 117) +* png: png. (line 6) +* pointer, moving of: Actions. (line 326) +* polygon: Resources. (line 307) +* polygon point, go back to previous: Actions. (line 382) +* polygon, an example: Polygons. (line 6) +* polygon, an overview: Polygon Objects. (line 6) +* polygon, closing a: Actions. (line 382) +* popping up menus: Menu. (line 6) +* postprocessing layout data: Resources. (line 278) +* postscript: ps. (line 6) +* preprocessing element data: Resources. (line 74) +* preprocessing font data: Resources. (line 110) +* preprocessing layout data: Resources. (line 93) +* preventing loss of data <1>: Resources. (line 285) +* preventing loss of data: Loading and Saving. (line 18) +* print command: Printing. (line 84) +* print media <1>: Resources. (line 195) +* print media: Printing. (line 59) +* print offset: Printing. (line 75) +* printing: Resources. (line 239) +* printing a layout: Actions. (line 392) +* printing, an example: Printing. (line 6) +* problems: problems. (line 6) +* ps: ps. (line 6) +* ps-bloat: Postscript Export. (line 31) +* ps-invert: Postscript Export. (line 34) +* psfade: Postscript Export. (line 44) +* quit <1>: Actions. (line 412) +* quit: User Commands. (line 51) +* rat's nest: User Commands. (line 61) +* rat-line <1>: Actions. (line 27) +* rat-line: Rats Nest. (line 6) +* rats nest <1>: Actions. (line 27) +* rats nest <2>: Resources. (line 248) +* rats nest: Rats Nest. (line 6) +* rats-nest: Net Objects. (line 6) +* recover: Actions. (line 416) +* rectangle, an example: Polygons. (line 6) +* redo <1>: Actions. (line 416) +* redo: Menu. (line 40) +* redrawing layout: Actions. (line 199) +* refreshing layout: Actions. (line 199) +* Regular Expressions: Regular Expressions. (line 6) +* removing connections: Translations. (line 11) +* removing objects <1>: Translations. (line 11) +* removing objects <2>: Common. (line 6) +* removing objects: Drawing and Removing. + (line 6) +* removing selected objects: Actions. (line 430) +* report <1>: Actions. (line 434) +* report: Menu. (line 143) +* reseting found connections <1>: Actions. (line 167) +* reseting found connections: Resources. (line 255) +* resources: Resources. (line 6) +* rotate: Resources. (line 274) +* rotating a buffer: Actions. (line 355) +* rotating printout: Printing. (line 24) +* routing style <1>: Actions. (line 440) +* routing style: Resources. (line 267) +* rubber band: Menu. (line 79) +* rubberband <1>: Actions. (line 199) +* rubberband: Resources. (line 274) +* saving connections: Actions. (line 450) +* saving files: Actions. (line 450) +* saving found connections: Actions. (line 167) +* saving last entered user command: Resources. (line 294) +* saving layouts <1>: Resources. (line 278) +* saving layouts <2>: User Commands. (line 55) +* saving layouts: Loading and Saving. (line 18) +* saving, an example: Loading and Saving. (line 6) +* scaling a printout: Printing. (line 55) +* scanning connections: Actions. (line 167) +* schematic capture: Schematic Frontends. (line 6) +* schematic frontend: Schematic Frontends. (line 6) +* SCO: SCO. (line 6) +* Screen, popup menu: Menu. (line 49) +* script file, executing: Actions. (line 238) +* scrolling: Translations. (line 21) +* searching connections: Actions. (line 167) +* Searching for elements: Searching for elements. + (line 6) +* searchpath for element files: Resources. (line 85) +* searchpath for font files: Resources. (line 124) +* searchpath for layout files: Resources. (line 102) +* searchpath for libraries: Resources. (line 184) +* Select, popup menu: Menu. (line 98) +* selected object, removing an: Actions. (line 430) +* selected objects, changing sizes: Menu. (line 98) +* selected objects, removing: Menu. (line 98) +* selecting a buffer: Actions. (line 355) +* selecting a new tool: Tool Selectors. (line 6) +* selecting objects: Actions. (line 459) +* selecting, using the arrow tool: Arrow Tool. (line 6) +* selection: Actions. (line 459) +* Settings, popup menu: Menu. (line 79) +* SGI: SGI. (line 6) +* show-legend: Postscript Export. (line 64) +* shrink: Resources. (line 299) +* signal: Actions. (line 68) +* Silicon Graphics: SGI. (line 6) +* size of lines: Resources. (line 189) +* size of lines and vias: Actions. (line 440) +* size of vias: Resources. (line 330) +* sizes, changing of objects: Actions. (line 72) +* Sizes, popup menu: Menu. (line 68) +* snap to pins: Menu. (line 79) +* Solaris: Sun. (line 6) +* solder mask, viewing and editing: Menu. (line 58) +* spacing, minimum: Design Rule Checking. + (line 6) +* speaker volume: Resources. (line 338) +* square flag, changing: Actions. (line 93) +* square flag, changing of objects: Actions. (line 148) +* square flag, clearing: Actions. (line 154) +* square flag, setting: Actions. (line 471) +* standard drill sizes: Standard Drill Sizes. + (line 6) +* start user input: Actions. (line 160) +* starting a new layout: Actions. (line 350) +* starting Pcb: Command-Line Options. + (line 6) +* status information: Status-line and Input-field. + (line 6) +* strings, an example: Text. (line 6) +* strings, an overview: Text Objects. (line 6) +* Sun: Sun. (line 6) +* symbols: Resources. (line 118) +* symbols, an overview: Symbol Objects. (line 6) +* Syntax, file: File Syntax. (line 6) +* temporary files <1>: Resources. (line 285) +* temporary files: Loading and Saving. (line 18) +* terminology: Glossary. (line 6) +* TeX, problems: TeX and Manuals. (line 6) +* text, an example: Text. (line 6) +* text, an overview: Text Objects. (line 6) +* text, default scaling: Resources. (line 313) +* thermal flag, changing: Actions. (line 93) +* thermal flag, clearing: Actions. (line 154) +* thermal flag, setting: Actions. (line 471) +* thickness of lines: Resources. (line 189) +* thickness of objects: Common. (line 6) +* thickness of vias: Resources. (line 330) +* thickness, changing of objects: Actions. (line 129) +* toggle layer visibility: Actions. (line 521) +* tool selection: Tool Selectors. (line 6) +* tool, arrow: Arrow Tool. (line 6) +* trace optimizer: Trace Optimizer. (line 6) +* translations <1>: Translations. (line 6) +* translations: Actions. (line 6) +* troubleshooting: problems. (line 6) +* two line mode: Line Objects. (line 14) +* undo <1>: Actions. (line 528) +* undo: Menu. (line 40) +* undo, multi-action resources: Actions. (line 58) +* unique names: Menu. (line 79) +* unix command: Resources. (line 74) +* unselect objects: Actions. (line 543) +* user commands: User Commands. (line 6) +* user input: Translations. (line 33) +* vendor drill table <1>: UnloadVendor Action. (line 10) +* vendor drill table <2>: ToggleVendor Action. (line 10) +* vendor drill table <3>: LoadVendorFrom Action. + (line 10) +* vendor drill table <4>: EnableVendor Action. (line 10) +* vendor drill table <5>: DisableVendor Action. + (line 10) +* vendor drill table <6>: ApplyVendor Action. (line 8) +* vendor drill table: Actions. (line 54) +* Vendor drill table: Vendor drill mapping. + (line 6) +* vendor drill table, disabling: Actions. (line 188) +* vendor drill table, enabling: Actions. (line 254) +* vendor drill table, loading: Actions. (line 265) +* vendor drill table, toggling: Actions. (line 516) +* vendor drill table, unloading: Actions. (line 539) +* vendor map <1>: UnloadVendor Action. (line 10) +* vendor map <2>: ToggleVendor Action. (line 10) +* vendor map <3>: LoadVendorFrom Action. + (line 10) +* vendor map <4>: EnableVendor Action. (line 10) +* vendor map <5>: DisableVendor Action. + (line 10) +* vendor map <6>: ApplyVendor Action. (line 8) +* vendor map: Actions. (line 54) +* vendor map, disabling: Actions. (line 188) +* vendor map, enabling: Actions. (line 254) +* vendor map, loading: Actions. (line 265) +* vendor map, toggling: Actions. (line 516) +* vendor map, unloading: Actions. (line 539) +* Vendor mapping: Vendor drill mapping. + (line 6) +* Vendor rules: Vendor drill mapping. + (line 6) +* vias, an example: Vias. (line 6) +* vias, an overview: Via Objects. (line 6) +* vias, changing shape of: Actions. (line 117) +* vias, color: Resources. (line 324) +* vias, converting to mounting hole: Actions. (line 101) +* vias, setting of initial size: Actions. (line 477) +* vias, size: Resources. (line 330) +* viewing side, changing of: Actions. (line 499) +* volume of speaker: Resources. (line 338) +* Window, popup menu: Menu. (line 151) +* x-y file format: Centroid File Format. + (line 6) +* x-y file, algorithms: Centroid File Format. + (line 37) +* X11: X11 Interface. (line 6) +* X11 default translations: Translations. (line 6) +* X11 resources: Resources. (line 6) +* X11 translations: Actions. (line 6) +* X11, problems: X11. (line 6) +* xcircuit, how to interface with: xcircuit. (line 6) +* zoom of Layout area: Resources. (line 347) +* zoom of pinout window: Resources. (line 234) +* zoom, setting: Menu. (line 49) +* zoom, setting of: Actions. (line 477) + + Index: tags/1.0.5/doc/pcb.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/pcb.pdf =================================================================== --- tags/1.0.5/doc/pcb.pdf (nonexistent) +++ tags/1.0.5/doc/pcb.pdf (revision 953) Property changes on: tags/1.0.5/doc/pcb.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/pcb.texi =================================================================== --- tags/1.0.5/doc/pcb.texi (nonexistent) +++ tags/1.0.5/doc/pcb.texi (revision 953) @@ -0,0 +1,5829 @@ +\input texinfo @c -*-texinfo-*- +@comment RCS: $Id$ +@comment %**start of header +@setfilename pcb.info +@settitle Pcb +@setcontentsaftertitlepage +@macro pcb{} +@code{Pcb} +@end macro +@comment %**end of header + +@include version.texi + +@ifinfo +@format +INFO-DIR-SECTION Miscellaneous +START-INFO-DIR-ENTRY +* pcb: (pcb). An interactive printed circuit board editor. +END-INFO-DIR-ENTRY +@end format +@end ifinfo + +@iftex +@finalout +@end iftex + +@ifinfo +This file documents how to use Pcb, +the open source, interactive printed circuit board layout system. + +Copyright (C) 1994,1995,1996, 2004 Thomas Nau + +Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 harry eaton + +Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Dan McMahill + +Copyright (C) 2004 DJ Delorie + +This program is free software; you may 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 +MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +@b{GNU General Public License} for more details. + +@end ifinfo + +@setchapternewpage on +@headings single + +@titlepage +@title Pcb-@value{VERSION} +@subtitle an open source, interactive +@subtitle printed circuit board +@subtitle layout system +@author harry eaton +@end titlepage + +@ifnottex +@node Top +@top Pcb + +This document is a manual for @pcb{}, the open source, interactive printed circuit +board layout system. +@end ifnottex + +@menu +* Copying:: @pcb{} is freely redistributable! +* History:: How it all began. +* Overview:: An overview of @pcb{}. +* Intro:: A short description of the basic objects. +* Getting Started:: Introduction to @pcb{}. +* Autorouter:: Using the autorouter. +* User Commands:: User commands of @pcb{}. +* Command-Line Options:: Calling @pcb{} from a shell. +* X11 Interface:: Action routines, resources and default translation. +* File Formats:: Description of @code{ASCII} files used by @pcb{}. +* Library Creation:: Detailed description of symbol library creation. +* Schematic Frontends:: Schematic capture programs that work with PCB. +* Installation:: Compiling, installing and troubleshooting. +* Custom Menus:: Customizing the menu bar. +* Regular Expressions:: Searching for elements with regular expressions +* Standard Drill Sizes:: Tables of standard drill sizes +* Centroid File Format:: Details of the centroid (x-y) output file +* Action Reference:: Documentation for all available actions +* Glossary:: Glossary +* Index:: The Index. +@end menu + +@c --------------------------------------------------------------------- +@node Copying +@unnumbered Copying + +Copyright @copyright{} 1994,1995,1996,1997 Thomas Nau + +Copyright @copyright{} 1998,1999,2000,2001,2002 harry eaton + +This program is free software; you may 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 +MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +@b{GNU General Public License} for more details. + + +@c --------------------------- chapter 0 ------------------------------- +@node History +@unnumbered History + +@cindex Atari version +@pcb{} is a handy tool for laying out printed circuit +boards. + +@pcb{} was first written by Thomas Nau for an Atari ST in 1990 and +ported to @code{UNIX} and @code{X11} 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. + +The second release 1.2 included menus for the first time. This made +@pcb{} easier to use and thus a more important tool. + +Release 1.3 introduced undo for highly-destructive commands, +more straightforward action handling and scalable fonts. Layer-groups +were introduced to group signal-layers together. + +Release 1.4 provided support for add-on device drivers. +Two layers (the solder and the component side) +were added to support SMD elements. The handling of libraries +was also improved in 1.4.1. Support for additional devices like +GERBER plotters started in 1.4.4. The undo feature was expanded +and the redo-feature added in 1.4.5. + +harry eaton took over pcb development beginning with Release 1.5, +although he contributed some code beginning with Release 1.4.3 + +Release 1.5 provides support for rats-nest generation from simple net +lists. It also allows for automatic clearances around pins that pierce +a polygon. A variety of other enhancements including a Gerber RS-274X +driver and NC drill file generation have also been added. + +Release 1.6 provides automatic screen updates of changed regions. +This should eliminate most of the need for the redraw ((@emph{R} key). +Also some changes to what order items under the cursor are selected +were made for better consistency - it is no longer possible to +accidentally move a line or line point that is completely obscured +by a polygon laying over top of it. Larger objects on the upper +most layers can be selected ahead of smaller objects on lower layers. +These changes make operations more intuitive. A new mode of line +creation was added that creates two line on 45 degree angles +with a single click. The actual outline of the prospective line(s) are +now shown during line creation. An arc creation mode was added. +Drawn arcs are quarter circles and can be useful for high frequency +controlled impedance lines. (You can have eighth circle arc if the +source is compiled with -DARC45, but be aware that the ends of such +arcs can never intersect a grid point). Two new flags for pins and +vias were created - one indicates that the pin or via is purely a +drill hole and has no copper annulus. You can only toggle this flag +for vias - for elements, it must be an integral part of the element +definition. The other flag controls whether the pad will be round +or octagonal. There is also now a feature for converting the contents +of a buffer into an element. + +Release 1.6.1 added the ability to make groups of action commands bound to +a single X11 event to be undone by a single undo. Also a simple design rule +checker was added - it checks for minimum spacing and overlap rules. Plus +many fixes for bugs introduced with the many changes of 1.6 + +Release 1.7 added support for routing tracks through polygons without touching +them. It also added support for unplated drill files, and drawing directly +on the silk layer. A Netlist window for easily working with netlist was also added. + +Release 2.0 adds an auto-router, a new simpler library mechanism, much improved +support for graphically creating (and editing) elements, viewable solder-mask +layers (and editing), snap to pins and pads, netlist entry by drawing rats, element +files (and libraries) that can contain whole sub-layouts, metric grids, improved +user interface, a GNU autoconf/automake based build system, and a host +of other improvements. + +Special thanks goes to: +@display +Thomas Nau (who started the project and wrote the early versions). +C. Scott Ananian (who wrote the auto-router code). +Bernhard Daeubler (Bernhard.Daeubler@@physik.uni-ulm.de) +Harald Daeubler (Harald.Daeubler@@physik.uni-ulm.de) +DJ Delorie (djdelorie@@users.sourceforge.net) +Larry Doolittle (ldoolitt@@recycle.lbl.gov) +Dan McMahill (danmc@@users.sourceforge.net) +Roland Merk (merk@@faw.uni-ulm.de) +Erland Unruh (Erland.Unruh@@malmo.trab.se) +Albert John FitzPatrick III (ajf_nylorac@@acm.org) +Boerge Strand (borges@@ifi.uio.no) +Andre M. Hedrick (hedrick@@Astro.Dyer.Vanderbilt.Edu) +@end display + +@noindent +who provided all sorts of help including porting @pcb{} to +several operating systems and platforms, bug fixes, library enhancement, +user interface suggestions and more. In addition to these people, +many others donated time for bug-fixing and +other important work. Some of them can be identified in the source code +files. Thanks to all of them. If you feel left out of this list, I +apologize; please send me an e-mail and I'll try to correct the omission. + + +@c --------------------------- overview chapter ------------------------------- +@node Overview +@chapter Overview +@cindex PCB, an overview + +@pcb{} is an open source printed circuit board editor. +@pcb{} includes many professional features such as: +@itemize @bullet +@item Up to 16 copper layer designs by default. By changing a compile time setting, this +can be set as high as needed. +@item RS-274X (Gerber) output +@item NC Drill output +@item Centroid (X-Y) data output +@item Postscript and Encapsulated Postscript output +@item Autorouter +@item Trace optimizer +@item Rats nest +@item Design Rule Checker (DRC) +@item Connectivity verification +@item @pcb{} is Free Software +@item Can interoperate with free schematic capture tools such as gEDA and + xcircuit +@item Runs under Linux, NetBSD, Solaris, and other similar operating +systems. +@item Windows version is available +@end itemize + +@c --------------------------- chapter 1 ------------------------------- +@node Intro +@chapter Introduction +@cindex layout objects, an overview + +Each layout consists of several, mostly independent, objects. This chapter +gives an overview of the object types and their relationship to each other. +For a complete description of how to use @pcb{}, refer to +@ref{Getting Started}. +The layout is generated on-screen on a grid that can have its origin +at any desired location. +The X coordinate increases to the right, Y increases down to the bottom. +All distances and sizes in @pcb{} are measured in mils +(0.001 inch). One unit on the coordinate display is one mil in +distance on the board. +The grid may be set on a metric pitch, but is only correct to within +the nearest +/- 0.01 mil because @pcb{} stores all dimensions as +integer multiples of 1/100 of a mil or 0.00001 inch. + +The sections in this chapter are sorted by the +order of appearance of the objects within a layout file. + +@menu +* Symbol Objects:: Information about fonts and symbols. +* Via Objects:: Vias and pins connect layers. +* Element Objects:: Element, the basic type of circuits. +* Layer Objects:: A @samp{container} for lines, text... +* Line Objects:: Tracks on the board +* Arc Objects:: Curved tracks +* Polygon Objects:: Planes and such +* Text Objects:: Objects to add symbols to your board. +* Net Objects:: Describes the desired connections on the board. +@end menu + +@node Symbol Objects +@section Symbols +@cindex symbols, an overview +@cindex font, an overview + +The top object is the layout itself. It uses a set of symbols +that resides at the first logical level. Each symbol is uniquely identified +by a seven bit @code{ASCII} code. All layout objects share the same set of +symbols. These symbols are used to form text objects on the silkscreen +and copper layers. Undefined symbols are drawn as filled rectangles. + +Every font file is preprocessed by a user-defined command when it is loaded. +For details see @samp{fontCommand}, @ref{Resources}. + + +@node Via Objects +@section Vias +@cindex vias, an overview + +Vias provide through-hole connectivity across all layers. +While vias look a lot like element pins, don't use vias +for adding elements to the layout, even if that seems +easier than creating a new element. The default solder-mask +will cover over vias, so you won't be able to solder to them. +Of course, you can change this so that vias also have +solder-mask cut-outs, but it is not the default. +Vias are also useful for defining arbitrary drill points such as +those used for mounting a board. Vias used in this way have +a special flag set so that they have no annular copper ring, +and also appear in the unplated drill file. @emph{Ctrl-H} key over +a via switches it between being a pure-mounting hole and a regular via. +You can assign a name to a via, which is useful during the creation +of new element definitions. +Each via exists on all copper layers. (@emph{i.e.} +blind and buried vias are not supported) + + +@node Element Objects +@section Elements +@cindex element, an overview +@cindex layout-name + +Elements represent the components on a board. +Elements are loaded from @code{ASCII} coded files in a +similar manner to the layout file itself, or from the +library selector window. +An element is composed of lines and arcs on the silk-screen +layer (used to define the package outline), pins +(or pads for SMD) and three labels that define the +description, the element's layout-name (which also +appears on the silk-screen layer) and its value. You +can choose which of the names are displayed on the screen +with the @b{Screen} menu; however, the silk screen in +the printout will always show the layout-name. +Element pins are contained on the first logical level +and so reside on all layers, but the pads of surface-mount +elements reside on only the component or solder +layers. An element can have a mixture of pins, pads +(on one or both sides), and mounting holes. + +A mark is used to position the element with +respect to the cross hair during pasting. +The mark will lie on a grid point when the element +is positioned. The mark is drawn as a small diamond +shape, but is only visible when @emph{both} the @code{silk} +and @code{pins/pads} layers are visible. +All parts of an element are treated as one unit, except for +the name. +It is not possible to delete a single pin or move +only part of an element on the layout. +You can resize separate pieces of an element, +but doing so is usually a bad idea. You can move/rotate +the element name independently of the element it belongs +to. When you move an element name, a line is draw from +the cursor to the element mark so it is easy to tell +which element the name belongs to. + + +Each pin and pad has two string identifiers, one is the +"name" which is a functional description of the pin +(@emph{e.g.} "clock in") and the other is the "number" of the +pin which is used to identify it in a netlist. The "number" +is usually an integer, but it can be any string. You +can edit the "name" of each pin of an element, but the +"number" is embedded in the element definition and is +determined when the new element is first created. +Pads are similar to lines on a layer but they must be oriented +either vertically or horizontally. +Pads can have either rounded or square ends. Pins +can be round, square, or octagonal. + + +Elements are supported by several special layers: @code{silk}, @code{pins/pads} and +@code{far-side}. The @code{silk} layer shows the package outline and +also holds legend text and element names. The @code{pins/pads} layer is used to toggle +whether the element's pins and pads are displayed. The @code{far-side} layer controls visibility +of objects (silkscreen and pads) that are on the far (@emph{i.e.} not currently viewed) side +of the board. + +The ``oldlib'' style of footprint libraries distributed with +@pcb{} rely upon the M4 macro processor. M4 is typically +installed under the name @code{m4} on most unix-like operating +systems. It is recommended that you use the GNU version of M4 to +avoid limitations found in some vendor implementations. See the m4 +man page on your system for more information. +Every element file is preprocessed by a user-defined command when the file is read. +For details see @samp{elementCommand}, @ref{Resources}. @code{m4}, the default +value of @samp{elementCommand}, allows you to create libraries for +package definitions that are shared by all elements. +The old element libraries distributed with @pcb{} expect @code{m4} or an +equivalent to be the @emph{elementCommand}. The new library scheme simply has +each element stored in a self-contained file, so there is no need to learn +@code{m4} to add to the libraries. + +@pcb{} can create a list of +all connections from one (or all) elements to the others or a list of +unconnected pins. +It can also verify the layout connections against a netlist file. +The element's @samp{layout-name} is the name used to identify the element +in a netlist file (see @ref{Netlist File}). + +The old libraries, or very old (pre-1.6) layout files may have +incorrect pin numbering since there was no concept of pin numbers +when they were created. @pcb{} uses the order of appearance of +the pin definitions in the layout or library file if it uses the +old format, but there is no guarantee that it will be correct for +these old objects. + +@cindex old library +@cindex library accuracy +@b{Be aware that a few of the old library parts may still be incorrectly +implemented regarding pin-numbering.} All of the DIL (Dual- +Inline-Pins) parts are correct and most of the others are too, +but you should verify the pin numbering +of any non-DIL part before using an old library part. +(use the @samp{generate object report} in the @b{Info} menu +to see what @pcb{} thinks a pin's number is) +All of the old +library names begin with a ~, so you can easily identify them. +The old libraries also @emph{may} contain other sorts of errors, +including incorrect pin spacing, silkscreen overlapping solder areas, etc. +@b{Check carefully any element in the old library before using it!} +As the new library grows, the old library will be pared down to +at least remove all of the elements with errors, but this will +take time. + +You can make your own element definitions graphically now. +Simply draw vias for the pins, lines on the solder and/or +component layers for surface-mount pads (they must be either horizontal +or vertical), +and lines and arcs on the silkscreen layer for the silkscreen +outline. You should @emph{name} (@emph{N} key) each via and copper line with the pin @emph{number}. +Once you are happy with the geometry, select everything that is to become part of +the element, then choose @samp{convert selection to element} from the @b{Select} menu. +Afterwords you can make pin (or pad) one +square if you like, and give the element its various names. You can also give +the pins and pads their functional names. Note that the +element mark corresponds to the position you click after choosing the +conversion from the menu, so decide where the mark goes and make +sure it falls on a grid point before you request the conversion. +If the vias/lines are not named, then the pin numbering will correspond to the +order in which they were placed. + +When you create a new element, remember that silkscreen lines +should @emph{never} overlap the copper part of the +pins or pads, as this can interfere with soldering. The silkscreen +should identify the maximum extent of the element package so it +is easy to see how close elements can be placed together. + +If you want to make an element similar to an existing one, you can +break an element into constituent pieces from the @b{Buffer} menu. +Paste the pieces to the layout, make the necessary changes, then +convert it back into an element. If the pin numbers haven't changed, +there is no need to name each via/line as they are pre-named when +the element was broken apart. When you create a new element, you +can save it to a file in order to have easy access to it the next +time you run @pcb{}. + + +@node Layer Objects +@section Layers +@cindex layers, an overview + +Every layout consists of several layers that can be used independently +or treated as a group. +Layer groups can be used to logically separate (and color-code) +different traces (@emph{e.g.} power and signal); however, all +layers within a group reside on the same physical +copper layer of a board, so using different layers within the same +group won't provide electrical separation where they touch or overlap. +For details, see @samp{layerGroups}, @ref{Resources}. +Each layer is drawn in a color defined in the resource file +and identified by a name that you can change (for details +see @samp{layerColor}, @ref{Resources}.) +Layers are really just containers for line, arc, polygon, and text objects. The +component and solder layers contain SMD elements as well, but the +file structure doesn't reflect that fact directly. + +@cindex layer groups +Each layer group +represents a physical layer on the printed circuit board. If you want to make +a four layer board, you'll need to have at least four layer groups. +Connections between layer groups are established only through element pins and vias. +The relationship between a specific layer and the board itself is configurable from +the @samp{Edit layer groups} option in the @b{Settings} menu. +The layer groups corresponding to the physical layers: @emph{component-side} +and @emph{solder-side} are always defined and you must map at least one +logical layer to each, even if you plan to make a single-sided board. +You are not obligated to put tracks on either of them. +Surface mount elements always reside on either the component-side or the +solder-side layer group. When you paste an element from the buffer, +it will go onto whichever side of the board you are viewing. +You can swap which side of the board you are viewing by pressing +the @emph{Tab} key, or by selecting @samp{view solder side} from the +@b{Screen} menu. +The layer groups just have a name or number associated with them - where +they are sandwiched in the board is left for you to tell the +manufacturer. + +The silkscreen layer is special because there are actually two silkscreen +layers, one for the top (component) and one for the bottom (solder) side +of the board. Which silk layer you draw on is determined by the side of the +board that you are viewing. If you are viewing the component side, then +drawing on the silk layer draws to the component-side silk layer. + +The netlist layer is another special layer. It shows rat's-nest lines +(@emph{i.e.} guides that show how the netlist expects the element to interconnect). +If you make this the active layer, you can use the Line tool to add +entries into the netlist, or to delete connections from the netlist +window. Except for these two purposes, you should not +make the netlist layer the active layer. Usually there is no need to +do this because a separate schematic package should be used to create the +netlist. @pcb{} can automatically draw all of the rats from +the netlist. In some cases you may want to make a small change without +going to the trouble of modifying the schematic, which is why this +facility is provided. + + +@node Line Objects +@section Lines +@cindex lines, an overview + +Lines are used to draw tracks on the pc board. +When in the line mode, each @emph{Btn1} +press establishes one end of a line. +Once the second point is defined, the line is drawn +and a new line started where the first one ended. +You can abandon the new starting point in favor +of another by pressing @emph{Ctrl-Btn1}, or +@emph{Btn3}, but don't use @emph{Btn2}. +The undo function (@emph{U} key or @samp{undo last operation} +from the @b{Edit} menu) will take you back +point by point if you use it while in the line mode. + +@cindex two line mode +New lines can be restricted to 45 degree angles if desired. You can toggle this +restriction on and off while creating lines by pressing the @emph{period} key. +If the 45 degree restriction is turned on, then the @emph{/} (forward slash) key +can be used to cycle through three different modes of 45 degree line creation. +One mode just creates a single line forced to the nearest 45 degree vector. The next +mode creates two lines from the start to end points such that the first line leaves the +start point at a 90 degree vector, and the second line enters the end point on a 45 +degree vector. The last mode creates two lines such that the first line leaves the +start point on a 45 degree vector and arrives at the end point on a 90 degree vector. +You can temporarily swap between the last two modes by holding the @emph{Shift} key down. + +It is simple to edit a line object by breaking it into pieces (insert point mode), +moving an end point or the whole line (@emph{Arrow tool}), +or changing the layer it resides on (@emph{M} key moves the line under the pointer +to the active layer). +In the case when two line segments meet at exactly the same +point you can delete the intermediate point, otherwise the delete tool removes an entire line. +Feel free to experiment +since @pcb{} will allow you to undo and redo anything that materially affects your work. +If you switch active layers in the midst of placing lines a via will automatically be +placed, when necessary, in order to continue the connection. + +@cindex clearance +If you draw a line inside a polygon, it will either plow through the +polygon creating a clearance, or touch the polygon. This behavior is +selectable in the @b{Settings} menu for new lines. To change the +behavior of an existing line, hit the @emph{J} key with the cross hair +over the line. You can increase the size of the clearance by 2 mils on +each edge with the with the +@emph{K} key. @emph{Shift-K} will decrease the clearance by 2 mils. +The increment may be changed from 2 mils through the application +resource file. +The clearance can be also increased, decreased and set +by the @emph{ChangeClearSize} action. + +Lines do not need to intersect the center of a pin, pad, via, or other +line for @pcb{} to understand that they make electrical connection. +If the connection is too tenuous, running the design rule checker will report +that the connection may break if the line width shrinks slightly. + + +@node Arc Objects +@section Arcs +@cindex arc + +@pcb{} can handle arcs of any angular extent, but when you +create an arc with the Arc tool, it will +be a quarter circle (this means they always bend a right angle). Arcs are very similar +to lines otherwise. They are created on the active layer and have the same thickness +that new lines will have. The various clicks for creating lines work pretty much the +same way for creating arcs. +In order to make the arc curve in the desired direction, drag the mouse along +the tangent line from the starting position towards the end position. If the grid is +too coarse, it may not be possible to distinguish whether you've moved over then up, +or up then over, so if you can't seem to make the arc go in the direction you want, try pressing +the @emph{Shift} key while drawing the arc. Decreasing the grid spacing may also help. +Alternatively you can draw the wrong arc, then +rotate and move it where you want. Like the Line tool, after an arc is drawn a new +starting point is established at the end point. + +Whenever a starting point is established +by either the Line or Arc tools it will be retained if you switch directly between the +tools (e.g. @emph{F2} key for Lines, @emph{F8} key for Arcs. Arcs can either touch or +clear polygons just like lines do. Of course connection +searches, undo and all the other features you'd expect work with arcs too. + + +@node Polygon Objects +@section Polygons +@cindex polygon, an overview + +Sometimes it's useful to fill large areas with solid copper. +The way to do this is with polygons. +Polygons can be created in either the polygon mode or the rectangle mode. +In the polygon mode, you'll have to define each corner of the polygon +with a mouse click (@emph{Btn1}). When the last point is clicked +exactly on top of the starting point, the polygon is finished. +Since this can be hard to do, the @emph{Shift-P} key will enter the +final point for you, closing the polygon. +If the 45 degree angle restriction is turned on +and you try to close the polygon when it is not possible, you'll get a +warning instead. If you haven't finished entering a polygon, but want to +undo one (or more) of the points that you've already defined, use the +undo command (@emph{U} key). + +With the rectangle tool, defining +the two diagonally opposite corners is sufficient, but of course the resulting +polygon is a rectangle. +Like lines, a polygon can by edited by deleting, inserting and moving the points +that define it. Pins and vias @emph{always} clear through polygons without +touching them when first positioned. You must add a thermal with the thermal +tool in order to connect pins and vias to polygons. Thermals can be added and removed by +clicking @emph{Btn1} with the thermal tool over the pin or via. +The thermal tool always +places a thermal to polygons on the active layer, so if the tool doesn't +seem to work, it's probably because the polygon you want to touch is not +on the active layer. You can change the style of thermal used or make +a solid connection by holding down @emph{Shift} while clicking +@emph{Btn1} with the thermal tool over the pin or via. + +@pcb{} is capable of handling complex polygons, but +using a number of simpler ones improves performance of the connection tracing code. +You also must be careful not to create polygons that touch or overlap themselves. +The fabricated board may not look the way you expect if you violate this +principle. It is always ok to have two (or more) polygons touch or overlap +each other, but not for points within the same polygon to do so. + +The great advantage to this new polygon behavior is that simple or complex ground +and/or power planes can be easily made with polygons and seen on the screen. +If you don't want this auto-clearance behavior, or you load a layout created by +an early version of @pcb{}, the old behavior +(shorts to all piercing pins and vias) is available. A @samp{ChangeSize} +operation (@emph{S} key) toggles a polygon between the new and old polygon/pin +behavior. + + +@node Text Objects +@section Text +@cindex text, an overview +@cindex strings, an overview + +Text objects should be used to label a layout or to put additional +information on the board. Elements have their @samp{layout-name} labels on the +silk-screen layer. If you are making a board without a silkscreen, +you can use copper text to label the elements, but you have to do +this manually. + +Text is always horizontal when first created, but the +rotate mode can align it along 0, 90, 180 and 270 degree angles. +Text on the far side of the board will automatically appear mirror-imaged. + +@emph{Warning:} @b{TEXT OBJECTS ON A COPPER LAYER CREATE COPPER LINES BUT THEY ARE NOT SCANNED FOR +CONNECTIONS OR TESTED FOR CREATING SHORTS VS. THE NETLIST. NEITHER ARE TEXT OBJECTS TESTED AGAINST ANY DESIGN RULES}. + + +@node Net Objects +@section Nets +@cindex rats-nest +@cindex netlist + +Layout files also contain the netlist that describes how the elements +are supposed to be interconnected. This list of connections can be +loaded from a netlist file (see @ref{Netlist File}), or +entered by drawing rat-lines as described +previously. Each net has a name and routing style associated with it. +The net contains a list of all element @emph{layout-name} names and +pin @emph{numbers} that should +be connected to the net. Loading a netlist file will replace all +existing nets with the ones from the file. +The @emph{Netlist} window provides an easy way to +browse through the net list. You can display the rat's-nest by selecting +@samp{optimize rats-nest} from the @b{Connects} menu. If you move or rotate elements, +the rat's-nest will automatically follow the movements, but they won't +necessarily show the shortest paths until you optimize them again. + +@c --------------------------- chapter 2 ------------------------------- +@node Getting Started +@chapter Getting Started +@cindex how to start + +The goal of this chapter is to give you enough information to learn how +@pcb{} works and how to develop your layouts to make the best use of @pcb{}'s +features. All event translations (@emph{i.e.} the buttons and keys you +press) refer to the default application resource file shipped with @pcb{}. +There is probably no need to change this unless your window +manager uses some of the button events itself; however, if you @emph{want} +to customize the behavior of @pcb{} then changing the resource file +is usually the best way to do it. + +Get yourself a printout of this chapter and @emph{User Commands}, if you +haven't already done so, and follow the examples. + +Start @pcb{} (the actual command will use all lower-case letters) +without any additional options. +If you get the error message: + +@display + can't find default font-symbol-file 'default_font' +@end display +@noindent +then the font searchpath or filename in the application resource +file is wrong. Be sure that your @code{m4} program supports search paths. +If not, get @code{GNU m4}. +For other messages, see @ref{problems}. +Another quick-start is provided by @code{pcbtest.sh} in the @file{src} +directory. If some features don't seem to work, try running @code{pcbtest.sh}, +if that works, then @pcb{} hasn't been installed properly. + +@menu +* Application Window:: The elements of the main window. +* Log Window:: The optional logging window +* Library Window:: The circuit selection window +* Netlist Window:: The desired connections window +* Drawing and Removing:: +* Moving and Copying:: +* Loading and Saving:: +* Printing:: Creating Gerber files or postscript files +* Exporting:: Exporting a layout. +* Arrow Tool:: Selecting/Moving objects. +* Rats Nest:: Helps you place and route tracks against a netlist. +* Design Rule Checking:: Check for manufactureability +* Trace Optimizer:: Optimization of layouts +* Searching for elements:: Searching for elements +* Measuring distances:: Measuring distances +* Vendor drill mapping:: Mapping drills to a vendor specified list +* Connection Lists:: How to get a list of all or some connections. +@end menu + + +@node Application Window +@section The Application Window + +The main window consists of five areas: +the menu at the top, the layer control in the upper left, the tool buttons +located below the layer controls, the Layout area to the right of these, and the +status line at the bottom of the window. + +@menu +* Menu:: +* Status-line and Input-field:: What is the program configuration. +* Layer Controls:: Switch layers on/off; change current one. +* Tool Selectors:: Select a layout tool. +* Layout Area:: Where the layout is drawn. +@end menu + +@node Menu +@subsection Menus +@cindex menus +@cindex popping up menus + +The menus are located at the top of the Layout area. Most, but not all, +of their functions are also available from the keyboard. Similarly, some +functions are only achievable through the keyboard or command entry. +Some menu entries such as @samp{center layout} in the @b{Screen} menu require a certain cross hair position. +In this case a prompt message will popup at the bottom of the screen +with wording similar to the following: +@example +move pointer to the appropriate screen position and press a button +@end example +Any mouse button will do the job, whereas any key except the arrow (cursor) keys +will cancel the operation. If it seems like the menu hasn't done what you +expected, check to see if it is waiting for the position click. For details see @ref{Actions}. + +Pressing @emph{Btn3} in the Layout area also pops up a menu with many of the most common operations (except +when you're in the midst of drawing a line or arc). When +a choice in the @emph{Btn3} popup menu needs a cross hair position, it uses the position +where the cross hair was when @emph{Btn3} was pressed. For example, to get detailed +information on an object, place the cross hair over the object, press @emph{Btn3}, then +choose @samp{object report}. If you pop up the @emph{Btn3} menu but don't want to +take any of the actions, click on one of the headers in the menu. + +@table @b + +@cindex File, popup menu +@item File +This menu offers a choice of loading, saving and printing data, saving +connection information to a file or quitting the application. Most +of the entries in the @b{File} menu are self explanatory. +Selecting +@samp{print layout} pops up a printer control dialog. +A selection of several device drivers is available from the printer control +dialog. Presently @emph{PostScript}, @emph{encapsulated PostScript}, +and @emph{GerberX} are supported. The @emph{GerberX} driver produces +all of the files necessary to have the board professionally manufactured. +The connection saving features in the @b{File} menu produce outputs in an +arcane format that is not too useful. They do @emph{not} produce netlist +files. + +@cindex Edit, popup menu +@cindex undo +@cindex redo +@item Edit +The @b{Edit} menu provides the usual cut, copy, paste +which work on selections. To learn how to +create complex selections, see @ref{Arrow Tool}. +The @b{Edit} menu also +provides access to Undo and Redo of the last operation. These +can also be accomplished with the @emph{U} key and @emph{Shift-R} +key. Finally, the @b{Edit} menu allows you to change the names +of: the layout, the active layer, or text objects on the layout. + +@cindex Screen, popup menu +@cindex displaying element names +@cindex element, display names of +@cindex grid, display +@cindex grid, alignment +@cindex zoom, setting +@item Screen +The @b{Screen} menu supports most functions related to +the whole Layout area. There are various entries to change the grid to some popular +values, the zoom factor, and which kind of element name is displayed. +You can also re-align the grid origin and turn on and off the display +of the grid. +Before changing the grid alignment, I recommend that you zoom in as close as +possible so that you're sure the grid +points appear exactly where you want them. + +@cindex solder mask, viewing and editing +The @b{Screen} menu also allows you to turn on and off the +visibility of the solder-mask layer. When the solder-mask layer +is made visible it obscures most of the layout, so only turn +this on when you really want to know what the solder-mask will +look like. The solder-mask that you see belongs to the +side of the board you are viewing, which can be changed with +the @samp{view solder side} option, also found in the @b{Screen} menu. +When the solder-mask is displayed, the pin and pad clearance adjustments +(@pxref{Line Objects}) alter the size of mask cut-outs. + +@cindex Sizes, popup menu +@item Sizes +The @b{Sizes} menu allows you to select a group of line thickness, via diameter, via drill +size, and clearance (keepaway) (collectively called a "routing style") to be copied to the "active" sizes. +You can also change the names given to the routing styles and adjust their values from +this menu. The "active" sizes are also adjustable from this menu. +The "active" sizes are shown in the status-line and control the initial size of new vias, +drilling holes, lines, clearances, text-objects and also the maximum dimensions of the +board layout. + +@cindex Settings, popup menu +@cindex unique names +@cindex rubber band +@cindex snap to pins +@cindex clearance, for new lines +@item Settings +The @b{Settings} menu controls several operating configuration +parameters. The @samp{edit layer groups} entry brings up a dialog +that allows you to change the way layers are grouped. Layer grouping +is described in @ref{Layer Objects}. The @samp{all-direction lines} +entry controls +the clipping of lines to 45-degree angles. You can also control +whether moving individual objects causes the attached lines to +"rubber band" with the move or not from the @b{Settings} menu. Another +entry controls whether the starting clip angle for the two-line +mode (@pxref{Line Objects}) alternates every other line. You can +also control whether element names must be unique from the @b{Settings} +menu. When unique element names are enforced, copying a new element +will automatically create a unique @samp{layout-name} name for it +provided that the name originally ended with a digit (@emph{e.g.} +U7 or R6). The @b{Settings} menu allows you to control +whether the cross hair will snap to pins and pads even when they +are off-grid. Finally you can control whether new lines and +arcs touch or clear intersecting polygons from this menu. + +@cindex Select, popup menu +@cindex selected objects, removing +@cindex selected objects, changing sizes +@item Select +This menu covers most of the operations that work with selected objects. +You may either (un)select all visible objects on a layout or only the ones +which have been found by the last connection scan see +@c DRM: not sure where this was suppose to xfef to. +@c @ref{find connections} +. +You can delete all selected objects from this menu. +Other entries in the @b{Select} menu change the sizes of selected objects. +Note that a select action only affects those objects that are +selected @emph{and} have their visibility turned on in the Layer Control +panel. The @b{Select} menu also provides a means for selecting objects +by name using unix @ref{Regular Expressions}. + +@cindex Buffer, popup menu +@cindex pastebuffer, popup menu +@cindex element, editing +@item Buffer +From the @b{Buffer} menu you may select one out of five +buffers to use, rotate or clear its contents or save the buffer contents +to a file. You can also use the @samp{break buffer element to pieces} entry +to de-compose an element into pieces for editing. +Note: only objects with visibility turned on are pasted to the layout. If +you have something in a buffer, then change which side of the board you +are viewing, the contents of the buffer will automatically be mirrored +for pasting on the side you are viewing. It is not necessary to clear +a buffer before cutting or copying something into it - it will automatically +be cleared first. + +@cindex Connects, popup menu +@cindex auto-router +@cindex design rule checker, invoking +@item Connects +The entries available through the @b{Connects} menu allow you to find +connections from objects and to manipulate these. +You can also optimize or erase rat's nests from this menu. Finally, +the @samp{auto-route all rats} entry allows you to auto-route +all connections show by the rat's nest. The auto-router will use +any visible copper layer for routing, so turn off the visibility of any +layers you don't want it to use. The auto-router will automatically +understand and avoid any traces that are already on the board, but +it is not restricted to the grid. Finally, +the auto-router routes using the active sizes (except for nets that +have a route-style defined). @pcb{} always knows which tracks +were routed by the auto-router, and you can selectively remove them +without fear of changing tracks that you have manually routed +with the @samp{rip-up all auto-routed tracks} entry in the @b{Connects} +menu. The @samp{design rule checker} entry runs a check for copper +areas that are too close together, or connections that touch too +tenuously for reliable production. The DRC stops when the first +problem is encountered so after fixing a problem be sure to +run it again until no problems are found. +@display +@emph{Warning:} @b{COPPER TEXT IS IGNORED BY THE DRC CHECKER}. +@end display + +@cindex Info, popup menu +@cindex report +@cindex object report +@cindex drill report +@item Info +The @samp{generate object report} entry from the @b{Info} menu +provides a way to get detailed information +about an object, such as its coordinates, dimensions, etc. +You can also get a report summarizing all of the drills +used on the board with @samp{generate drill summary}. Lastly, +you can get a list of all pins, pads and vias that were +found during a connection search. + +@cindex Window, popup menu +@item Window +The @b{Window} menu provides a way to bring each of @code{Pcb's} +windows to the front. The @emph{Library} window is used to +bring elements from the library into the paste-buffer. The +@emph{Message Log} window holds the various messages that +@pcb{} sends to the user. The @emph{Netlist} window shows +the list of connections desired. + +@end table + +Now that you're familiar with the various menus, it's time +to try some things out. From the @b{File} menu choose +@samp{load layout}, navigate to the tutorial folder, then +load the file @samp{tut1.pcb}. + + +@node Status-line and Input-field +@subsection The Status-line and Input-field +@cindex status information +@cindex displaying status information +@cindex input-field, position of + +The status-line is located at the bottom edge of the main window. +During normal operation the status information is visible there. +When a selected menu operation requires an additional button click, the +status-line is replaced by a message telling you to position the cursor +and click. +When a text input is required, the status-line is replaced by the +Input-field which has a prompt for typing the input. + +The status-line shows, from left to right, the side of the board that you +are viewing (@emph{Tab} key changes this), the current grid values, +if new lines are restricted to 45 degrees, +which type of 45 degree line mode is active, whether rubberband move and +rotate mode is on (R), and the zoom factor. +This information is followed by the active line-width, via-size +and drilling hole, keepaway spacing, and text scaling. Last is the active buffer number and the +name of the layout. An asterisk appearing at the far left indicates that the +layout has been modified since the last save. +Note that the name of the layout is not the same +thing as the filename of the layout. +Change the grid factor to 1.0 mm from the @b{Screen} menu. Observe how the +status line shows the new grid setting. Except for the case of the metric +grid, all dimensions in the status line are in units of 0.001 inch (1 mil). + +The input-field pops up (temporarily replacing the status-line) whenever user input +is required. Two keys are bound to the input field: the @emph{Escape} key +aborts the input, @emph{Return} accepts it. Let's change the name of a component +on the board to see how the input-field works. Position the cross hair over +R5, and press the @emph{N} key. The input field pops-up showing the name +for you to edit. Go ahead and change the name, then hit return. Notice the name +of the element changed. Now undo the change by pressing the @emph{U} key. You can +position the cross hair over the name, or the element before pressing the +@emph{N} key. + +Now select @samp{realign grid} from the @b{Screen} menu. Notice that the +status line has been replaced with an instruction to position the cursor +where you want a grid point to fall. In this case, since the cross hair +can only fall on a grid point, you must move the tip of the finger cursor +to the place where you want a grid point to appear. Do not worry that +the cross hair is not coincident with the cursor. Click @emph{Btn1} at +your chosen location. See how the grid has shifted, and the status line +has returned. + +The present cross hair position is displayed in the upper right corner of the window. +Normally this position is an absolute coordinate, but you can anchor a marker at +the cross hair location by pressing @emph{Ctrl-M} (try it now) and then the +display will read both the absolute cross hair position as well as the difference +between it and the marker. The numbers enclosed in < > are the X and Y distances +between the cross hair and the mark, while the numbers enclosed in parenthesis +are the distance and angle from the mark to the cross hair. The values displayed +are always in units of 0.001 inch (1 mil). +Pressing @emph{Ctrl-M} again turns the marker off. + +@node Layer Controls +@subsection The Layer Controls +@cindex layer controls +@cindex layers, switching on/off +@cindex layers, changing which is active +@cindex change active layer + +The layer control panel, located in the upper left, is used to turn on +and off the display of layer groups and to select the active drawing layer. +If a layer hasn't been named, the label "@emph{(unknown)}" is used as the default. +If this happens, it probably means the application resources are not installed +properly. + +The upper buttons are used to switch layers on and off. Click +@emph{} on one or more of them. Each click toggles the setting. +If you turn off the currently active layer, another one that is visible +will become active. If there are no others visible, you will not be +able to turn off the active layer. +When the layers are grouped, clicking on these buttons will toggle +the visibility of all layers in the same group. This is a good idea because +layers in the same group reside on the same physical layer of +the actual board. Notice that this example has 2 groups each having +3 layers, plus two other layers named @samp{unused}. +Use the @samp{Edit layer groups} option in the @samp{Settings} menu to +change the layer groupings in the lesstif GUI or the @samp{Preferences} +dialog from the @samp{File} menu in the GTK+ GUI. Note that changing the +groupings can radically alter the connectivity on the board. +Grouping layers is only useful for helping you to color-code +signals in your layout. Note that grouping layers actually reduces the number +of different physical layers available for your board, so to make an eight +layer board, you cannot group any layers. + +The @emph{far side} button turns on and off the visibility of elements +(including SMD pads) on the opposite (to the side you're viewing) +board side, as well as silk screening on that side. It does not +hide the x-ray view of the other copper layers, these must be turned off +separately if desired. Use the @emph{tab} key to view the entire board from the other +side. To see a view of what the back side of the board will actually look like, +make the solder layer the active layer then press @emph{tab} until the status +line says "solder" on the right, then turn off the visibility of all layers +except solder, pins/pads, vias, and silk. Now turn them all back on. + +The lowest button, named @emph{active}, is used to change the active +drawing layer. Pressing @emph{} on it pops up a menu to select which +layer should be active. +Each entry is labeled with the layer's name and drawn in its color. +The active layer is automatically made visible. The active layer is +always drawn on top of the other layers, so the ordering of layers +on the screen does not generally reflect the ordering of the manufactured +board. Only the solder, component, silkscreen, and solder-mask layers +are always drawn in their physical order. Bringing the active layer +to the top makes it easier to select and change objects on the active layer. +Try changing the active layer's name to @emph{ABC} by selecting +@samp{edit name of active layer} from the @samp{Edit} menu. +Changing the active layer can also be done by pressing keys +@emph{1..MAX_LAYER}. + +Turn off the visibility of the component layer. +Now make the component layer the active layer. Notice that it +automatically became visible. Try setting a few +other layers as the active layer. You should also experiment +with turning on and off each of the layers to see what happens. + +The netlist layer is a special layer for adding connections to +the netlist by drawing rat lines. This is not the recommended +way to add to the netlist, but occasionally may be convenient. +To learn how to use the netlist layer see @ref{Net Objects}. + + +@node Tool Selectors +@subsection The Tool Selectors +@cindex mode selection +@cindex tool selection +@cindex selecting a new tool + +The tool selector buttons reside below the layer controls. +They are used to select which layout tool to use in the drawing +area. Each tool performs its function when @emph{Btn1} is pressed. +Every tool gives the cursor a unique shape that identifies it. +The tool selector buttons themselves are icons that illustrate their function. +Each layout tool can also be selected from the keyboard: +@example + @emph{F1} key Via tool + @emph{F2} key Line tool + @emph{F3} key Arc tool + @emph{F4} key Text tool + @emph{F5} key Rectangle tool + @emph{F6} key Polygon tool + @emph{F7} key Buffer tool + @emph{F8} key Delete tool + @emph{F9} key Rotate tool + @emph{Insert} key Insert-point tool + @emph{F10} key Thermal tool + @emph{F11} key Arrow tool + @emph{F12} key Lock tool +@end example + +Some of the tools are very simple, such as the Via tool. Clicking +@emph{Btn1} with the Via tool creates a via at the cross hair position. +The via will have the diameter and drill sizes that are active, +as shown in the status line. +The Buffer tool is similar. With it, @emph{} copies +the contents of the active buffer to the layout, but only +those parts that reside on visible layers are copied. +The Rotate tool allows you to rotate elements, arcs, and text objects +90 degrees counter-clockwise with each click. Holding the @emph{Shift} +key down changes the Rotate tool to clockwise operation. +Anything including groups of objects +can be rotated inside a buffer using the rotate buffer menu option. + +The Line tool is explained in detail in @ref{Line Objects}. Go read +that section if you haven't already. +Activate the Line tool. Set the active layer to the solder layer. +Try drawing some lines. Use the @emph{U} key to undo some of the +lines you just created. Zoom in a bit closer with the @emph{Z} key. +Draw some more lines. Be sure to draw some separate lines by starting +a new anchor point with @emph{Ctrl-Btn1}. Change the @samp{crosshair snaps to pin/pads} +behavior in the @b{Settings} menu. Now draw a line. Notice that +the new line points must now always be on a grid point. It might not +be able to reach some pins or pads with this setting. Increase the active line thickness +by pressing the @emph{L} key. Note that the status line updates +to reflect the new active line thickness. Now draw another line. Before completing the +next line, make the component layer active by pressing the @emph{4} key. +Now finish the line. Notice that a via was automatically placed where +you switched layers. @pcb{} does not do any checks to make sure that +the via could safely be placed there. Neither does it interfere with +your desire to place lines haphazardly. It is up to you to place +things properly when doing manual routing with the Line tool. + +The Arc tool is explained in detail in @ref{Arc Objects}. Its +use is very similar to the Line tool. + +The Rectangle tool, Polygon tool and Thermal tool are explained in detail in +@ref{Polygon Objects}. Go read that section. +Remember that the Thermal tool will only create and destroy thermals +to polygons on the active layer. Use the Rectangle tool to make a +small copper plane on the component layer. Now place a via in the +middle of the plane. Notice that it does not touch the plane, and +they are not electrically connected. Use the Thermal tool to make +the via connect to the plane. Thermals allow the via or pin to +be heated by a soldering iron without having to heat the entire +plane. If solid connections were made to the plane, it could be +nearly impossible to solder. Shift-click on the via with the Thermal +tool to change the style of thermal used or to make the connection +solid. Click on the via again with the Thermal tool to remove the +connection to the plane. + +The Insert-point tool is an editing tool that allows you to add +points into lines and polygons. The +Insert-point tool enforces the 45 degree line +rule. You can force only the shorter line segment to 45 +degrees by holding the @emph{Shift} key down while inserting the point. +Try adding a point into one of the lines you created. Since line +clipping is turned on, you may need to move the cross hair quite far +from the point where you first clicked on the line. Turn off the +line clipping by selecting @samp{all-direction lines} from the +@b{Settings} menu (or hit +the @emph{Period} key). Now you can place an inserted point anywhere. +Try adding a point to the rectangle you made earlier. Start by clicking +somewhere along an edge of the rectangle, then move the pointer to +a new location and click again. + +The delete-mode deletes the object beneath the cursor with each +@emph{Btn1} click. +If you click at an end-point that two lines have in common, it will replace the two lines with a single line +spanning the two remaining points. This can be used to delete an "inserted" +point in a line, restoring the previous line. Now delete one of the original corner +points of the polygon you were just playing with. To do this, place the cross hair over the +corner and click on it with the Delete tool. You could also use the @emph{Backspace} key +if some other tool is active. Try deleting some of +the lines and intermediate points that you created earlier. Use undo +repeatedly to undo all the changes that you've made. Use redo +a few times to see what happens. Now add a new line. Notice that +you can no longer use redo since the layout has changed since +the last undo happened. The undo/redo tree is always pruned in this +way (@emph{i.e.} it has a root, but no branches). + +The Arrow tool is so important, it has its own section: @ref{Arrow Tool}. +Go read it now. + +The Lock tool allows you to lock objects on the layout. When an object +is locked, it can't be selected, moved, rotated, or resized. This is +useful for very large objects like ground planes, or board-outlines that +are defined as an element. With such large objects, nearly anywhere you +click with the Arrow tool will be on the large object, so it could be +hard to draw box selections. If you lock an object, the Arrow tool will +behave as if it didn't exist. You cannot unlock an object with undo. +You must click on it again with the Lock tool. If an object is locked, +previous changes to it cannot be undone either. When you lock +an object, a report message about it is popped up and will always tell +you what object it is, and that it is locked if you just locked it. +Other than noticing your inability to manipulate something, the only +way to tell an object is locked is with a report from the @b{Info} +menu. Use the Lock tool sparingly. + + +@node Layout Area +@subsection Layout Area +@cindex grid + +The layout area is where you see the layout. The cursor shape depends +on the active tool when the pointer is moved into the layout area. +A cross hair follows the mouse pointer with respect to the grid setting. +Select a new grid from the @emph{Screen} menu. +The new value is updated in the status line. +A different way to change the grid is +@emph{Shiftg} to decrease or @emph{g} to increase +it, but this only works for English (integer mil) grids. +The grid setting is saved along with the data when you save a pcb layout. +For homemade layouts a value around 50 is a good setting. +The cursor can also be moved in the layout area with the cursor (arrow) keys or, for larger +distances, by pressing the @emph{Shift} modifier together with a cursor key. + + +@node Log Window +@section Log Window +@cindex log window +@cindex messages + +This optional window is used to display all kind of messages including +the ones written to @emph{stderr} by external commands. The main advantage +of using it is +that its contents are saved in a scrolling list until the +program exits. Disabling this feature by setting the resource +@emph{useLogWindow} to @emph{false} will generate popup windows to display +messages. The @emph{stderr} of external commands will appear on @pcb{}s +@emph{stderr} which normally is the parent shell. I suggest you iconify +the log window after startup for example by setting @emph{*log.iconic} to +@emph{true} in the resource file. If @emph{raiseLogWindow} is set @emph{true}, +the window will deiconify and raise itself whenever new messages are to be +displayed. + + +@node Library Window +@section Library Window +@cindex library window + +The library window makes loading elements (or even partial layouts) easy. +Just click the appropriate library from the list on the left. A list +of its elements then appears on the right. Select an element +from the list by clicking on its description. Selecting an element from the +library will also automatically copy the element into +the active buffer, then invoke the @emph{Buffer} tool so +you can paste it to the layout. Elements in the old library should be +taken with a grain of salt (@emph{i.e.} check them carefully before +using). The old library names all begin with ~ so you can easily distinguish between +the old and new libraries. All of the elements in the new library +should be thoroughly vetted, so you +can use them with confidence. The new libraries are stored simply +as directories full of element files, so making additions to the +new library is easy since there is no need to learn @code{m4}. +For details on the old libraries, +check-out @ref{Library File} and @ref{Library Contents File}. For +details on the format of an element file used for the new libraries, +see @ref{Element File}. + + +@node Netlist Window +@section Netlist Window +@cindex Netlist Window + +The netlist window is very similar to the library window. On the left +is a list of all of the nets, on the right is the list of connections +belonging to the chosen net. The chosen net is highlighted in the +list and also shown on the second line of the window in red. If the +net name has a star to the left of it then it is "disabled". A disabled +net is treated as if it were not in the net list. This is useful, for +example, if you plan to use a ground plane and don't want the ground +net showing up in the rat's nest. You can enable/disable individual +nets by double-clicking the net name. If you want to enable or disable +all nets at once, there are two buttons at the top of the netlist +window for this purpose. + +The button labeled @samp{Sel Net On Layout} +can be used to select (on the layout) everything that is connected +(or is supposed to be connected) to the net. If you click on a +connection in the connection list, it will select/deselect +the corresponding pin or pad in the layout and also center the layout +window where it is located. If you "Find" (@samp{lookup connection +to object} in the @b{Connects} menu [also @emph{F} key]), a pin +or pad it will also choose the net and connection in the netlist window +if it exists in the netlist. + +If no netlist exists for the layout, then the netlist window does not +appear. You can load a netlist from a file from the @b{File} menu. The +format for netlist files is described in @ref{Netlist File}. + + +@node Drawing and Removing +@section Drawing and Removing Basic Objects +@cindex drawing objects +@cindex removing objects +@cindex erasing objects +@cindex object, drawing and removing + +hace begging gutting here, and do a real-world tutorial example. + +There are several ways of creating new objects: you can draw them yourself, +you can copy an existing object (or selection), or you can load an element from a file or +from the Library window. Each type of object has a particular tool for creating it. + +The active tool can be selected from the tool selectors in the bottom +left corner or by one of the function keys listed earlier in this chapter. +Each @emph{} press with the tool tells the application to create +or change the appropriate object or at least take +the first step to do so. Each tools causes the cursor to take +on a unique shape and also causes the corresponding +tool selector button to be highlighted. You can use either cue +to see which tool is active. + +Insert mode provides the capability of inserting new points into existing +polygons or lines. The 45 degree line clipping is now enforced when selected. +Press and hold the shift key while positioning the new point to only clip +the line segment to the nearer of the two existing points to 45 degrees. +You can also toggle the 45-degree clipping in the middle of a point +insertion by pressing the @emph{.} +If the shift key is not depressed and the 45 degree line clipping mode +is on, both new line segments must be on 45 degree angles - greatly +restricting where the new point may be placed. In some cases this can cause +confusion as to whether an insertion has been started since the two new +lines may be forced to lie parallel on top of the original line until the +pointer is moved far from the end points. + +Removing objects, changing their size or moving them only applies to objects +that are visible when the command is executed. + +@menu +* Common:: Keystrokes common to some objects. +* Lines:: +* Arcs:: +* Polygons:: Drawing polygons and rectangles. +* Text:: +* Vias:: +* Elements:: +* Pastebuffer:: A multi-purpose buffer. +@end menu + +@node Common +@subsection Common Drawing and Removing Methods +@cindex creating objects +@cindex object, creating an +@cindex removing objects +@cindex object, removing an +@cindex thickness of objects +@cindex object, changing the size of an + +There are several keystrokes and button events referring to an @emph{object} +without identifying its type. Here's a list of them: + +@emph{} creates (or deletes) an object depending on the +current mode. + +@emph{BackSpace} or @emph{Delete} removes the visible +object at the cursor location. When more than one object exists at the +location, the order of removal is: via, line, text, polygon and +element. The drawn layer order also affects the search - whatever is +top - most (except elements) is affected before lower items. Basically +all this means that what is removed is probably just what you expect. +If for some reason it isn't, undo and try again. +Only one object is removed for each keystroke. If two or more +of the same type match, the newest one is removed. + +Use @emph{s} and @emph{Shifts} to change the size (width) +of lines, arcs, text objects, pins, pads and vias, or to toggle the style +of polygons (whether pins and vias automatically have clearances). + +@emph{n} changes the name of pins, pads, vias, the +string of a text object, or the currently displayed label of an element. + +@emph{m} moves the line, arc, or polygon under the cross hair to the +active layer if it wasn't on that layer already. + +@emph{u} (undo) recovers from an unlimited number of operations +such as creating, removing, moving, copying, selecting etc. It works like +you'd expect even if you're in the midst of creating something. + +@emph{Shiftr} restores the last undone operation provided no other +changes have been made since the undo was performed. + +@emph{tab} changes the board side you are viewing. + +For a complete list of keystrokes and button events see @ref{Translations}. + + +@node Lines +@subsection Lines +@cindex lines, an example +@cindex example of line handling + +To draw new lines you have to be in @emph{line-mode}. Get there either by +selecting it from the @emph{Tool palette} or by pressing @emph{F2}. +Each successive @emph{notify} event creates a new line. The +adjustment to 45 degree lines is done automatically if it is selected from the +@emph{Display} menu. You can toggle the 45 degree mode setting by +pressing the @emph{.} (That is the period key). When 45 degree enforcement +is turned on there are three distinct modes of line creation: a single +line on the closest 45 degree vector towards the cross hair (but not necessarily +actually ending at the cross hair), two lines created such that the first leaves +the start point on a 90 degree vector and the second arrives at the cross hair +on a 45 degree vector, and finally two lines created such that the first leaves +the start point on a 45 degree vector and the second arrives at the cross hair +on a 90 degree vector. These last two modes always connect all the way from +the start and end points, and all lines have angles in 45 degree multiples. +The @emph{/} cycles through the three modes. The status line shows a +text icon to indicate which of the modes is active and the lines following +the cross hair motion show the outline of the line(s) that will actually be created. +Press @emph{Escape} to leave line-mode. + +@emph{l}, @emph{Shiftl} and the entries in the +@emph{Sizes} menu change the initial width of new lines. This width is also +displayed in the status line. + + +@node Arcs +@subsection Arcs +@cindex arc, an example + +An Arc is drawn with the @emph{arc-tool}. Get there either by selecting it +from the @emph{Tool palette} or by pressing @emph{F8}. Press @emph{Btn1} to +define the starting point for the arc. Drag the mouse towards the desired +end point along the path you want the arc to follow. The outline of the arc that +will be created is shown on the screen as you move the mouse. Arcs are always +forced to be 90 degrees and have symmetrical length and width ( i.e. they are +a quarter circle). The next @emph{Btn1} click creates the arc. It will have +the same width as new lines (displayed in the status line) and appear on the +active layer. The arc leaves the starting point towards the cross hair along +the axis whose distance from the cross hair is largest. Normally this means that +if you drag along the path you want the arc to follow, you'll get what you +want. If the grid is set to the arc radius, then the two distances will be +equal and you won't be able to get all of the possible directions. If this +is thwarting your desires, reduce the grid spacing (@emph{!ShiftG}) and +try again. + + +@node Polygons +@subsection Polygons and Rectangles +@cindex polygon, an example +@cindex example of polygon handling +@cindex rectangle, an example +@cindex example of rectangle handling + +A polygon is drawn by defining all of its segments as a series of +consecutive line segments. If the first point matches a new one and if +the number of points is greater than two, then the polygon is closed. +Since matching up with the first point may be difficult, you may use +@emph{Shiftp} to close the polygon. The @emph{Shiftp} won't +work if clipping to 45 degree lines is selected +and the final segment cannot match this condition. +I suggest you create simple convex polygons in order to avoid a strong +negative impact on the performance of the connection scanning routines. +The @emph{rectangle-mode} is just an easy way to generate rectangular polygons. +@emph{Polygon-mode} also is selected by @emph{F6} whereas +@emph{rectangle-mode} uses @emph{F4}. +Pressing a @emph{} at two locations creates a rectangle by +defining two of its corners. +@emph{Insert} brings you to @emph{insert-point-mode} which lets you +add additional points to an already existing polygon. +Single points may be removed by moving the cross hair to them and selecting +one of the delete actions @emph{(remove-mode, BackSpace, or Delete}. This only works +if the remaining polygon will still have three or more corners. +Pressing @emph{u} or @emph{p} while entering a new polygon +brings you back to the previous corner. Removing a point does not +force clipping to 45 degree angles (because it's not generally possible). +Newly created polygons will not connect to pins or vias +that pierce it unless you create a thermal (using the thermal mode) to make +the connection. If the edge of a polygon gets too close to a pin or via that +lies outside of it, a warning will be issued and the pin will be given a +special color. Increasing the distance between them will remove the warning +color. + + +@node Text +@subsection Text +@cindex text, an example +@cindex strings, an example +@cindex example of text handling + +Pressing @emph{F5} or clicking one of the text selector buttons +changes to @emph{text-mode}. +Each successive notify event (@emph{}) +pops up the input line at the bottom and queries for a string. +Enter it and press @emph{Return} to confirm or +@emph{Escape} to abort. +The text object is created with its upper left corner at the current pointer +location. +The initial scaling is changed by @emph{t} and +@emph{Shiftt} or from the @emph{Sizes} menu. + +Now switch to @emph{rotate-mode} and press +@emph{} at the text-objects location. Text objects +on the solder side of the layout are automatically mirrored and +flipped so that they are seen correctly when viewing the solder-side. + +Use @emph{n} to edit the string. + +@b{TEXT OBJECTS ON COPPER LAYERS CREATE COPPER LINES BUT THEY ARE NOT SCANNED FOR +CONNECTIONS}. If they are moved to the silkscreen layer, they +no longer create copper. + + +@node Vias +@subsection Vias +@cindex vias, an example +@cindex example of via handling + +The initial size of new vias may be changed by @emph{v} and +@emph{Shiftv} or by selecting the appropriate entry from the +@emph{Sizes} menu. @emph{Mod1v} and @emph{Mod1 Shiftv} do +the same for the drilling hole of the via. +The statusline is updated with the new values. +Creating a via is similar to the other objects. Switch to @emph{via-mode} +by using either the selector button or @emph{F1} then press +@emph{]} or @emph{} to create one. +@emph{n} changes the name of a via. If you want to create a mounting +hole for your board, then you can place a via where you want the hole to +be then convert the via into a hole. The conversion is done by pressing +@emph{!Ctrlh} with the cross hair over the via. Conceptually it is +still a via, but it has no copper annulus. If you create such a hole in +the middle of two polygons on different layers, it will short the layers. +Theoretically you could arrange for such a hole not to be plated, but a +metal screw inserted in the hole would still risk shorting the layers. +A good rule is to realize that holes in the board really are vias between +the layers and so place them where they won't interfere with connectivity. +You can convert a hole back into a normal via with the same keystroke used +to convert it in the first place. + +@node Elements +@subsection Elements +@cindex element, an example +@cindex example of element handling + +Some of the functions related to elements only work if both the package +layer and the pin layer are switched on. + +Now that you're familiar with many of the basic commands, it is +time to put the first element on the layout. +First of all, you have to load data into the paste buffer. +There are four ways to do this: +@example + 1) load the data from a library + 2) load the data from a file + 3) copy data from an already existing element + 4) convert objects in the buffer into an element +@end example +We don't have any elements on the screen yet nor anything in the +buffer, so we use number one. + +@cindex example files +@cindex m4, preprocessing example files +Select @emph{lsi} from the menu in the library window press +@emph{} twice at the appropriate text-line to get +the MC68030 CPU. +The data is loaded and the mode is switched to @emph{pastebuffer-mode}. +Each notify event now creates one of these beasts. Leave the mode +by selecting a different one or by @emph{Escape} which resets +all modes.. +The cross hair is located at the @emph{mark} position as defined by +the data file. Rotating the buffer contents is done by selecting +the @emph{rotate} entry of the @emph{Buffer} menu or by pressing +@emph{ShiftF3}. The contents of the buffer +are valid until new data is loaded into it either by a cut-to-buffer +operation, copy-to-buffer operation or by loading a new data file. +There are 5 buffers +available (possibly more or less if changed at compile time +with the @code{MAX_BUFFER} variable in @file{globalconfig.h}). +Switching between them is done by selecting a menu entry or +by @emph{Shift1..MAX_BUFFER}. +Each of the two board sides has its own buffers. + +The release includes all data files for the circuits that are used +by the demo layout. The elements in the LED example are not found in the library, +but you can lift them from the example itself if you want. +If you have problems with the color of the cross hair, change the resource +@emph{cross hairColor} setting to a different one. + +@cindex example of loading an element file +@cindex pins, an example +@cindex example of pin handling +Now load a second circuit, the MC68882 FPU for example. +Create the circuit as explained above. You now have two different unnamed +elements. Unnamed means that the layout-name of the element +hasn't been set yet. Selecting @emph{description} from the @emph{Display} +menu displays the description string of the two circuits which +are CPU and FPU. The values of the circuits are set to MC68030 and MC68882. +Each of the names of an element may be changed +by @emph{n} at the elements location and editing the old name in +the bottom input line. Naming pins and vias is similar to elements. +You can hide the element name so that it won't appear on the board +silkscreen by pressing @emph{h} with the cursor over the element. +Doing so again un-hides the element name. + +Entering @kbd{:le} and selecting an element data file is +the second way to load circuits. + +The third way to create a new element is to copy an existing one. +Please refer to @ref{Moving and Copying}. + +@cindex example of creating an element +@cindex element, creating a new package +@cindex pastebuffer, convert contents to element +@cindex buffer, convert contents to element +The fourth way to create a new element is to convert a buffer's contents +into an element. Here's how it's done: Select the Via-tool from the +@emph{Tool pallet}. Set the grid spacing to something appropriate for +the element pin spacing. Now create a series of vias where the pins +go. Create them in pin number order. It is often handy to place a reference +point (@emph{!Ctrlm}) in the center of the first pin in order to measure +the location of the other pins. Next make a solder-side layer the active +layer from the @emph{active-layer} popup menu. Now draw the outline of +the element using lines and arcs. When you're done, select everything that +makes up the element with a box selection (@emph{ drag, +}). Now select "cut selection to buffer" from the @emph{Buffer} +menu. Position the cursor over the center of pin 1 and press the left +button to load the data into the buffer. +Finally select "convert buffer to element" from the @emph{Buffer} menu. +You'll only want to create elements this way if they aren't already in the +library. It's also probably a good idea to do this before starting any of +the other aspects of a layout, but it isn't necessary. + +To display the pinout of a circuit move to it and press @emph{Shiftd} +or select @emph{show pinout} from the @emph{Objects} menu. A new window +pops up and displays the complete pinout of the element. This display can +be difficult to read if the component has been rotated 90 degrees :-( +therefore, the new window will show an un-rotated view so the pin names +are readable. +@emph{d} displays the name of one or all pins/pads inside the +Layout area, this is only for display on-screen, it has no effect on any +printing of the layout. + +You also may want to change a pin's or pad's current size by pressing +@emph{s} to increase or @emph{Shifts} to decrease it. While +this is possible, it is not recommended since care was probably taken +to define the element structure in the first place. You can also change the thickness +of the element's silkscreen outline with the same keys. You can +change whether a pin or SMD pad is rounded or square with the @emph{q}. +SMD pads should usually have squared ends. Finally, you can change whether +the non-square pins are round or octagonal with the @emph{!Ctrlo}. + +SMD elements and silkscreen objects are drawn in the "invisible object" +color if they are located on the opposite side of the board. + +For information on element connections refer to @ref{Connection Lists}. + + +@node Pastebuffer +@subsection Pastebuffer +@cindex pastebuffer, an example +@cindex example of pastebuffer handling +@cindex buffer, an example +@cindex example of buffer handling + +The line-stack and element-buffer of former releases have been replaced +by 5 (possibly more or less if changed at compile time +with the @code{MAX_BUFFER} variable in @file{globalconfig.h}) +multi-purpose buffers that are selected by +@emph{Shift1..MAX_BUFFER}. The status line shows which buffer is +the active one. +You may load data from a file or layout into them. +Cut-and-paste works too. +If you followed the instructions earlier in this chapter you should +now have several objects on the screen. Move the cross hair to one of them +and press @emph{} to toggle its selection flag. (If you drag the +mouse while the button is down, a box selection will be attempted instead +of toggling the selection.) The object +is redrawn in a different color. You also may want to try +moving the pointer while holding the third button down and +release it on a different location. This selects all objects inside the +rectangle and unselects everything else. If you want to add a box selection +to an existing selection, drag with @emph{Mod1} instead. +Dragging @emph{Shift Mod1} unselects objects in a box. +Now change to @emph{pastebuffer-mode} and select some operations from the +@emph{Buffer} menu. Copying objects to the buffer is available as +@emph{Mod1c} while cutting them uses @emph{Mod1x} as +shortcut. Both clear the buffer before new data is added. +If you use the menu entries, you have to supply a cross hair position by +pressing a mouse button. The objects are attached to the pastebuffer +relative to that cross hair location. +Element data or PCB data may be merged into an existing layout by loading +the datafiles into the pastebuffer. Both operations are available from +the @emph{File} menu or as user commands. + +@node Moving and Copying +@section Moving and Copying +@cindex moving, an example +@cindex copying, an example +@cindex example of moving +@cindex example of copying + +All objects can be moved including element-names, by +@emph{}, dragging the pointer while holding the button down +and releasing it at the new location of the object. If you use +@emph{Mod1} instead, the object is copied. Copying does not work for +element-names of course. You can move all selected objects with +@emph{Shift }. This uses the Pastebuffer, so +it will remove whatever was previously in the Pastebuffer. +Please refer to @ref{Pastebuffer}. +If you want to give a small nudge to an object, but you don't think +that the mouse will give you the fine level of control that you want, +you can position the cursor over the object, press @emph{[}, +move it with the arrow keys, then press @emph{]} when it's at the +desired position. Remember that all movements are forced onto grid coordinates, so +you may want to change the grid spacing first. + +@cindex moving, traces to a different layer +@cindex changing layers +To move a trace or group of traces to a different layer, first select +the tracks to be moved. It's easiest to do this if you shut off everything +but that layer first (i.e. silk, pins, other layers, etc). +Now set the current layer to be the new layer. +Press Shift-M to move all the selected tracks to the current layer. +See the @emph{MoveToCurrentLayer} action for more details. + +@node Loading and Saving +@section Loading and Saving +@cindex loading, an example +@cindex saving, an example +@cindex example of saving +@cindex example of loading + +After your first experience with @pcb{} you will probably want to save +your work. @kbd{:s name} passes the data to an external program which +is responsible for saving it. For details see @emph{saveCommand} in +@ref{Resources}. +Saving also is available from the @emph{File} menu, either with or +without supplying a filename. @pcb{} reuses the last +filename if you do not pass a new one to the save routine. + +To load an existing layout either select @emph{load layout data} from the +@emph{File} menu or use @kbd{:l filename}. A file select box pops up if you +don't specify a filename. Merging existing layouts into the new one is +supported either by the @emph{File} menu or by @kbd{:m filename}. + +@cindex backup +@cindex saving layouts +@cindex preventing loss of data +@cindex /tmp +@cindex directory /tmp +@cindex temporary files +@pcb{} saves a backup of the current layout at a user specified interval. +The backup filename is created by appending a dash, "-", to the @file{.pcb} filename. +For example, if you are editing the layout in @file{projects/board.pcb} then the +backup file name will be @file{projects/board.pcb-}. If the layout is new and +has not been saved yet, then the backup file name is @file{PCB.####.backup} where the "####" +will be replaced by the process ID of the currenting running copy of @pcb{}. +This default backup file name may be changed at compilation time via the +@code{BACKUP_NAME} +variable in @file{globalconfig.h}). During critical +sections of the program or when data would be lost it is saved as +@file{PCB.%i.save}. This file name may be changed at compile time +with the @code{SAVE_NAME} variable in @file{globalconfig.h}. + + +@node Printing +@section Printing +@cindex printing, an example +@cindex example of printing + +@pcb{} now has support for device drivers, +@code{PostScript}, @emph{encapsulated PostScript}, +and @emph{Gerber RS-274X} drivers are +available so far. The @emph{Gerber RS-274X} +driver additionally generates a numerical control (NC) drill file for +automated drilling, +a bill of materials file to assist in materials procurement and +inventory control, and a centroid (X-Y) file which includes the +centroid data needed +by automatic assembly (pick and place) machines. + I recommend the use of @code{GhostScript} if you +don't have a @code{PostScript} printer for handling the PostScript +output. Printing always generates +a complete set of files for a specified driver. +See the page about +the @emph{Print()} action for additional information about the filenames. +The control panel offers a number of options. Most of them are not available +for Gerber output because it wouldn't make sense, for example, to scale the gerber output +(you'd get an incorrectly made board!) The options are: + +@table @samp +@cindex device, selecting an output +@cindex output device +@item device +The top menu button selects from the available device drivers. + +@cindex rotating printout +@item rotate +Rotate layout 90 degrees counter-clockwise before printing (default). + +@cindex mirroring printout +@item mirror +Mirror layout before printing. Use this option depending +on your production line. + +@cindex color printout +@item color +Created colored output. All colors will be converted to black if this option +is inactive. + +@cindex outline printout +@item outline +Add a board outline to the output file. The size is determined by the +maximum board size changeable from the @emph{sizes} menu. The outline appears +on the top and bottom sides of the board, but not on the internal layers. +An outline can be useful for determining where to shear the board from the +panel, but be aware that it creates a copper line. Thus it has the potential +to cause short circuits if you don't leave enough room from your wiring +to the board edge. Use a viewer to see what the output outline looks like +if you want to know what it looks like. + +@cindex alignment targets +@item alignment +Additional alignment targets are added to the output. The distances between +the board outline is set by the resource @emph{alignmentDistance}. Alignment +targets should only be used if you know for certain that YOU WILL BE USING +THEM YOURSELF. It is extremely unlikely that you will want to have alignment +targets if you send gerber files to a commercial pcb manufacture to be made. + +@cindex scaling a printout +@item scaling +It's quite useful to enlarge your printout for checking the layout. +Use the scrollbar to adjust the scaling factor to your needs. + +@cindex print media +@cindex media, size of +@item media +Select the size of the output media from this menu. The user defined size +may be set by the resource @emph{media} either from one of the well known +paper sizes or by a @code{X11} geometry specification. +This entry is only available if you use @code{X11R5} or later. +For earlier releases the user defined size or, if not available, @emph{A4} +is used. +Well known size are: +@display + A3 + A4 + A5 + letter + tabloid + ledger + legal + executive +@end display + +@cindex offset of printout +@cindex print offset +@item offset +Adjust the offsets of the printout by using the panner at the right side +of the dialog box. +This entry is only available if you use @code{X11R5} or later. A zero +offset is used for earlier releases. + +@cindex DOS filenames +@item 8.3 filenames +Select this button to generate DOS compatible filenames for the output files. +The @emph{command} input area will disappear if selected. + +@cindex print command +@item commandline +Use this line to enter a command (starts with @kbd{|}) or a filename. +A %f is replaced by the current filename. +The default is set by the resource @emph{printCommand}. + +@end table + +The created file includes some labels which are guaranteed to stay unchanged +@table @samp +@item PCBMIN +identifies the lowest x and y coordinates in mil. + +@item PCBMAX +identifies the highest x and y coordinates in mil. + +@item PCBOFFSET +is set to the x and y offset in mil. + +@item PCBSCALE +is a floating point value which identifies the scaling factor. + +@item PCBSTARTDATA +@itemx PCBENDDATA +all layout data is included between these two marks. You may use them with an +@code{awk} script to produce several printouts on one piece of paper by +duplicating the code and putting some @code{translate} commands in front. +Note, the normal @code{PostScript} units are 1/72 inch. +@end table + +@node Exporting +@section Exporting a layout +@cindex Exporting a layout +@vindex Exporting a layout + +To export a layout choose @emph{Export layout} from the @emph{File} menu, then +select the desired exporter. + +@menu +* bom:: Bill of materials. +* gcode:: G-code. +* gerber:: Gerber. +* nelma:: Nelma. +* png:: Image. +* ps:: Postscript. +* eps:: Eps. +@end menu + +@node bom +@subsection Bill of materials (bom) +@cindex bom +@cindex bill of materials + +Produces a bill of materials (BOM) file and a centroid (XY) file. + +@node gcode +@subsection G-code (gcode) +@cindex gcode +@cindex g-code +@cindex cnc + +The gcode exporter can generate RS274/NGC G-CODE files to be used with a CNC mill to +produce pcb's by mechanically removing copper from the perimeter of all elements. + +The elements are enlarged in order to compensate for the cutting tool size so +that the remaining copper corresponds to the original size; however all +polygons are left unchanged and will end up being a little smaller; this is not a +problem because the electrical connection is done with traces, which are correctly +enlarged. + +A .cnc file is generated for every copper layer, with the bottom layer mirrored so +that the milling is done right; of course it's not possible to produce directly +multi-layer (more than 2) pcb's with this method, but the cnc files for +intermediate layers are generated anyways. + +A drill file is also generated, and it contains all drills regardless of the hole +size; the drilling sequence is optimized in order to require the least amount of +movement. + +The export function generates an intermediate raster image before extracting the contour +of copper elements, and this image is saved as well (in .png format) for inspection. + +When the spacing between two elements is less than the tool diameter they will merge +and no isolation will be cut between them; the control image should be checked for +this behaviour. + +Possible workarounds are: increasing spacing, decreasing the tool size, increasing +the intermediate image resolution. + +To maximize the chance of producing correct pcb's it would be better to increase +the DRC clearance to at least the tool diameter and use traces as thick as possible; +the rule is: use the largest element that will not prevent the isolation cut. + +The exporter parameters are: + +@table @b +@item basename +base name for generated files + +@item dpi +intermediate image resolution; affects precision when extracting contours + +@item mill depth +should be the copper depth + +@item safe z +Z value when moving between polygons + +@item tool radius +copper elements are enlarged by this amount + +@item drill depth +depth of drills + +@item measurement unit +for all parameters above, can be mm,um,inch,mil; g-code is always mm or inch +@end table + +All .cnc files specify Z values as parameters, so that it's easy to +change them without the need to run the exporter again. + +Operation was verified with the EMC2 g-code interpreter. + +Following is a sample layout that is converted with default settings: +@center @image{gcode,,,Sample Layout,png} + +The control image shows that the spacing is sufficient: +@center @image{gcode_control_img,,,Control Image,png} + +The final tool path follows the perimeter of all elements: +@center @image{gcode_tool_path,,,Resulting Tool Path,png} + +@node gerber +@subsection Gerber (gerber) +@cindex gerber + +Produces RS274-X (a.k.a. gerber) photo plot files and Excellon drill files. + +@node nelma +@subsection Nelma (nelma) +@cindex nelma + +Numerical analysis package export. + +@node png +@subsection Image (png) +@cindex png +@cindex image export + +Produces GIF/JPEG/PNG image files. + +@node ps +@subsection Postscript (ps) +@cindex ps +@cindex postscript + +Export as postscript. +Can be later converted to pdf. + +@node eps +@subsection Encapsulated Postscript (eps) +@cindex eps +@cindex encapsulated postscript + +Export as eps (encapsulated postscript) for inclusion in other documents. +Can be later converted to pdf. + + +@node Connection Lists +@section Connection Lists +@cindex example of connection lists +@cindex connections, creating list of + +After completing parts of your layout you may want to check if all drawn +connections match the ones you have in mind. This is probably best done +in conjunction with a net-list file: see @ref{Rats Nest}. +The following examples give more rudimentary ways to examine +the connections. +@example + 1) create at least two elements and name them + 2) create some connections between their pins + 3) optionally add some vias and connections to them +@end example + +Now select @emph{lookup connection} from the @emph{Connections} menu, +move the cursor to a pin or via and press any mouse button. @pcb{} +will look for all other pins and/or vias connected to the one you have +selected and display the objects in a different color. +Now try some of the reset options available from the same menu. + +There also is a way to scan all connections of one element. Select +@emph{a single element} from the menu and press any button at the +element's location. All connections of this element will be saved +to the specified file. +Either the layout name of the element or its canonical name is used to +identify pins depending on the one which is displayed on the screen +(may be changed by @emph{Display} menu). + +An automatic scan of all elements is initiated by choosing +@emph{all elements}. It behaves in a similar fashion to scanning a single +element except the resource @emph{resetAfterElement} +is used to determine if connections should be reset before a new element is +scanned. Doing so will produce very long lists because the power lines are +rescanned for every element. By default the resource is set to @emph{false} +for this reason. + +To scan for unconnected pins select @emph{unused pins} from the same +menu. + + +@node Arrow Tool +@section Arrow Tool +@cindex selecting, using the arrow tool +@cindex moving objects +@cindex arrow tool +@cindex tool, arrow + +Some commands mentioned earlier in this chapter also are able to operate on all +selected and visible objects. The Arrow tool is used to select/deselect +objects and also to move objects or selections. If you click and release +on an object with the Arrow tool, it will unselect everything else and +select the object. Selected objects change color to reflect that +they are selected. If you @emph{Shift} click, it will add the object to +(or remove) the object from the existing selection. If you drag with +the mouse button down with the Arrow tool, one of several things could +happen: if you first pressed the button on a selected object, you +will be moving the selection to where you release the button. If you +first pressed the button on an unselected object, you will be moving +that object. If you first pressed the button over empty space, you +will be drawing a box to select everything inside the box. The @emph{Shift} +key works the same way with box selections as it does with single objects. + +Moving a single un-selected object is different from moving a selection. +First of all, you can move the end of line, or a point in a polygon this +way which is impossible by moving selections. Secondly, if rubber banding +is turned on, moving a single object will rubber-band the attached lines. +Finally, it is faster to move a single object this way since there is no need +to select it first. + +You can select any visible object unless it is locked. If you select an +object, then turn off its visibility with the Layer controls, it won't +be moved if you move the remaining visible selection. + +If you have not configured to use strokes in the @pcb{} user interface, then +the middle mouse button is automatically bound to the arrow tool, regardless +of the active tool (which is bound to the first mouse button). So using +the middle button any time is just like using the first mouse button +with the Arrow tool active. + +The entries of the @emph{Selection} menu are hopefully self-explanatory. +Many of the @emph{Action Commands} can take various key words that make +them function on all or some of the selected items. + +@node Rats Nest +@section Rats Nest +@cindex rats nest +@cindex netlist +@cindex rat-line + +If you have a netlist that corresponds to the layout you are working on, you +can use the rats-nest feature to add rat-lines to the layout. +First you will need to load a netlist file (see @emph{:rn}, +@ref{User Commands}). +@emph{w} adds rat-lines on the active layer using the current +line thickness shown in the status line (usually you'll want them to be thin lines). +Only those rat-lines that fill in missing connectivity (since you have +probably routed some connections already) are added. +If the layout is already completely wired, nothing will be added, and you will +get a message that the wiring is complete. + +Rat-lines are lines having the special property that they only connect to pins and +pads at their end points. Rat-lines may be drawn differently to other lines +to make them easier to identify since they have special behavior and cannot +remain in a completed layout. +Rat-lines are added in the minimum length straight-line tree pattern +(always ending on pins or pads) that satisfies the missing connectivity in the circuit. +Used in connection with moves and rotates of the elements, they are extremely useful for +deciding where to place elements on the board. The rat-lines will always automatically +rubberband to the elements whether or not the rubberband mode is on. The only way for +you to move them is by moving the parts they connect to. +This is because it is never desirable to have the rat-lines disconnected from +their element pins. Rat-lines will normally criss-cross +all over which gives rise to the name "rats nest" describing a layout connected with +them. If a SMD pad is unreachable on the active layer, a warning will be issued +about it and the rat-line to that pad will not be generated. + +A common way to use rats nests is to place some +elements on the board, add the rat-lines, and then use a series of moves/rotates of the +elements until the rats nest appears to have minimum tangling. You may want to iterate this step +several times. Don't worry if the layout looks messy - as long as you can get a sense for whether +the criss-crossing is better or worse as you move things, you're fine. +After moving some elements around, you may want to optimize the rats nest @emph{o} +so that the lines are drawn between the closest points (this can change once you've moved components). +Adding rat-lines only to selected pads/pins (@emph{Shiftw}) +is often useful to layout a circuit a little bit at a time. +Sometimes you'll want to delete all the rat-lines (@emph{e}) or +selected rat-lines (@emph{Shifte}) in order to reduce confusion. +With a little practice you'll be able to achieve a near optimal component placement with +the use of a rats nest. + +Rat-lines are not only used for assisting your element placement, they can also help +you to route traces on the board. +Use the @emph{m} to convert a rat-line under the cursor into +a normal line on the active layer. +Inserting a point into a rat-line will also cause the two new lines to be normal lines +on the board. +Another way that you can use rat-lines is to +use the @emph{f} with the cursor over a pad or pin. All of the pins and +pads and rat-lines belonging to that net will be highlighted. This is a helpful way to +distinguish one net from the rest of the rats nest. You can then route those tracks, +turn off the highlighting (@emph{Shiftf}) and repeat the process. This will work even +if the layer that the rat-lines reside on is made invisible - so only the pins and pads +are highlighted. +Be sure to erase the rat-lines (@emph{e} erases them all) once you've +duplicated their connectivity by adding your own lines. +When in doubt, the @emph{o} will delete only those +rat-lines that are no longer needed. + +If connections exist on the board that are not listed in the netlist when +@emph{w} is pressed, warning messages are issued and the affected pins and +pads are drawn in a special @emph{warnColor} until the next @emph{Notify()} event. +If the entire layout agrees completely with the netlist, a message informs you that +the layout is complete and no rat-lines will be added (since none are needed). +If the layout is complete, but still has rat-lines then you will be warned +that rat-lines remain. If you get no message at all it's probably because some +elements listed in the net list can't be found and where reported in an earlier +message. +There shouldn't be any rat-lines left in a completed layout, only normal lines. + +The @emph{Shiftw} is used to add rat-lines to only those missing connections among +the selected pins and pads. This can be used to add rat-lines in an incremental +manner, or to force a rat-line to route between two points that are not the +closest points within the net. Often it is best to add the rats nest in an incremental fashion, laying +out a sub-section of the board before going further. This is easy to accomplish since +new rat-lines are never added where routed connectivity already makes the necessary +connections. + +@node Design Rule Checking +@section Design Rule Checking +@cindex design rule checking +@cindex drc +@cindex spacing, minimum +@cindex overlap, minimum + +After you've finished laying out a board, you may want to check +to be certain that none of your interconnections are too closely +spaced or too tenuously touching to be reliably fabricated. The design +rule checking (DRC) function does this for you. Use the command ":DRC()" (without +the quotes of course) to invoke the checker. If there are no problem areas, +you'll get a message to that effect. If any problem is encountered, you will get +a message about it and the affected traces will be highlighted. One part of the +tracks of concern will be selected, while the other parts of concern will have the +"FindConnection" highlighting. The screen will automatically be centered in the +middle of the object having the "FindConnection" (Green) highlighting. The middle of +the object is also the coordinates reported to be "near" the problem. The actual trouble +region will be somewhere on the boundary of this object. If the two parts are +from different nets then there is some place where they approach each +other closer than the minimum rule. If the parts are from the same net, then +there is place where they are only barely connected. Find that place and connect +them better. + +After a DRC error is found and corrected you must run the DRC again because +the search for errors is halted as soon as the first problem is found. Unless you've +been extremely careless there should be no more than a few design rule errors +in your layout. The DRC checker does not check for minimum spacing rules to +copper text, so always be very careful when adding copper text to a layout. +The rules for the DRC are specified in the application resource file. The minimum +spacing value (in mils) is given by the @emph{Settings.Bloat} value. The default +is 7 mils. The minimum touching overlap (in mils) is given by the +@emph{Settings.Shrink} value. This value defaults to 5 mils. Check with your +fabrication process people to determine the values that are right for you. + +If you want to turn off the highlighting produced by the DRC, perform an +undo (assuming no other changes have been made). To restore the highlighting, +use redo. The redo will restore the highlighting quickly without re-running +the DRC checker. + +@node Trace Optimizer +@section Trace Optimizer +@cindex trace optimizer +@cindex optimizer + +PCB includes a flexible trace optimizer. The trace optimizer can be run +after auto routing or hand routing to clean up the traces. + +@table @b +@item Auto-Optimize +Performs debumpify, unjaggy, orthopull, vianudge, and viatrim, in that +order, repeating until no further optimizations are performed. + +@item Debumpify +Looks for U shaped traces that can be shortened or eliminated. + +@item Unjaggy +Looks for corners which could be flipped to eliminate one or more +corners (i.e. jaggy lines become simpler). + +@item Vianudge +Looks for vias where all traces leave in the same direction. Tries to +move via in that direction to eliminate one of the traces (and thus a +corner). + +@item Viatrim +Looks for traces that go from via to via, where moving that trace to a +different layer eliminates one or both vias. + +@item Orthopull +Looks for chains of traces all going in one direction, with more traces +orthogonal on one side than on the other. Moves the chain in that +direction, causing a net reduction in trace length, possibly eliminating +traces and/or corners. + +@item SimpleOpts +Removing unneeded vias, replacing two or more trace segments in a row +with a single segment. This is usually performed automatically after +other optimizations. + +@item Miter +Replaces 90 degree corners with a pair of 45 degree corners, to reduce +RF losses and trace length. + +@end table + +@node Searching for elements +@section Searching for elements +@cindex Searching for elements +@vindex Searching for elements + +To locate text or a specific element or grouping of similar elements +choose @samp{Select by name} from the @b{Select} menu, then choose the +appropriate subsection. At the bottom of the screen the prompt +@emph{pattern:} appears. Enter the text or @ref{Regular Expressions} +of the text to be found. Found text will be highlighted. + +@node Measuring distances +@section Measuring distances +@cindex Measuring distances +@vindex Measuring distances + +To measure distances, for example the pin-to-pin pitch of a part to +validate a footprint, place the cursor at the starting +measurement point, then press @emph{!Ctrlm}. This marks the +current location with a @emph{X}. The @emph{X} mark is now the zero point +origin for the relative cursor position display. The cursor display +shows both absolute position and position relative to the mark as +the mouse is moved away from the mark. If a mark is already present, +the mark is removed and the cursor display stops displaying relative +cursor coordinates. + +@node Vendor drill mapping +@section Vendor Drill Mapping +@cindex Vendor rules +@cindex Vendor mapping +@cindex Drill table +@cindex Vendor drill table + +@pcb{} includes support for mapping drill holes to a specified set +of sizes used by a particular vendor. Many PCB manufacturers have a +prefered set of drill sizes and charge extra when others are used. +The mapping can be performed on an existing design and can also be +enabled to automatically map drill holes as vias and elements are +instantiated. + +The first step in using the vendor drill mapping feature is to create +a resource file describing the capabilities of your vendor. The file +format is the resource file format described in @ref{Resource Syntax}. +A complete example is given below. + +@example +# Optional name of the vendor +vendor = "Vendor Name" + +# units for dimensions in this file. +# Allowed values: mil/inch/mm +units = mil + +# drill table +drillmap = @{ + # When mapping drill sizes, select the nearest size + # or always round up. Allowed values: up/nearest + round = up + + # The list of vendor drill sizes. Units are as specified + # above. + 20 + 28 + 35 + 38 + 42 + 52 + 59.5 + 86 + 125 + 152 + + # optional section for skipping mapping of certain elements + # based on reference designator, value, or description + # this is useful for critical parts where you may not + # want to change the drill size. Note that the strings + # are regular expressions. + skips = @{ + @{refdes "^J3$"@} # Skip J3. + @{refdes "J3"@} # Skip anything with J3 as part of the refdes. + @{refdes "^U[1-3]$" "^X.*"@} # Skip U1, U2, U3, and anything starting with X. + @{value "^JOHNSTECH_.*"@} # Skip all Johnstech footprints based on the value of a part. + @{descr "^AMP_MICTOR_767054_1$"@} # Skip based on the description. + @} +@} + +# If specified, this section will change the current DRC +# settings for the design. Units are as specified above. +drc = @{ + copper_space = 7 + copper_width = 7 + silk_width = 10 + copper_overlap = 4 +@} +@end example + +The vendor resource is loaded using the @emph{LoadVendor} action. +This is invoked by entering: +@example +:LoadVendor(vendorfile) +@end example +from within @pcb{}. Substitute the file name of your vendor +resource file for @samp{vendorfile}. This action will load the vendor +resource and modify all the drill holes in the design as well as the +default via hole size for the various routing styles. + +Once a vendor drill map has been loaded, new vias and elements will +automatically have their drill hole sizes mapped to the vendor drill +table. Automatic drill mapping may be disabled under the ``Settings'' +menu. To re-apply an already loaded vendor drill table to a design, +choose ``Apply vendor drill mapping'' from the ``Connects'' menu. + +See @ref{Actions} for a complete description of the actions associated +with vendor drill mapping. + +Note that the expressions used in the @code{skips} section are regular +expressions. See @ref{Regular Expressions} for an introduction to +regular expressions. + +@c --------------------------- Autorouter Chapter ------------------------------- +@node Autorouter +@chapter Autorouter +@cindex autorouter + +@pcb{} includes an autorouter which can greatly speed up the +layout of a circuit board. The autorouter is a rectangle-expansion +type of autorouter based on +``A Method for Gridless Routing of Printed Circuit Boards'' by +A. C. Finch, K. J. Mackenzie, G. J. Balsdon, and G. Symonds in the +1985 Proceedings of the 22nd ACM/IEEE Design Automation Conference. +This reference is available from the ACM Digital Library at +@url{http://www.acm.org/dl} for those with institutional or personal +access to it. It's also available from your local engineering +library. The reference paper is not needed for using the autorouter. + +Before using the autorouter, all elements need to be loaded into the +layout and placed and the connectivity netlist must be loaded. Once +the elements have been placed and the netlist loaded, the following +steps will autoroute your design. + +@enumerate +@item Turn off visibility of any layers that you don't want the router +to use. + +@item Turn of via visibility if you don't want the router to use any +new vias. + +@item Use only plain rectangles for power/ground planes that you want + the router to use [use the rectangle tool!] + +@item Make at least one connection from any plane you want the router to + use to the net you want it to connect to. + +@item Draw continuous lines (on all routing layers) to outline keep-out + zones if desired. + +@item Use routing styles in the netlist to have per-net routing styles. + Note that the routing style will be used for an entire net. This means + if you have a wide metal setting for a power net you will need to manually + route breakouts from any fine pitch parts on their power pins because + the router will not be able to change to a narrow trace to connect + to the part. + +@item Set the current routing style to whatever you'd like the router to + use for any nets not having a defined route style in the netlist. + +@item Disable any nets that you don't want the autorouter to route + (double-click them in the netlist window to add/remove the *) + + NOTE: If you will be manually routing these later not using + planes, it is usually better to let the autorouter route them then rip + them up yourself afterwards. If you plan to use a ground/power plane + manually, consider making it from one or more pure rectangles and + letting the autorouter have a go at it. + +@item Create a fresh rat's nest. ('E' the 'W') + +@item Select ``show autorouter trials'' in the settings menu if you want + to watch what's happening + +@item Choose ``autoroute all rats'' in the connection menu. + +@item If you really want to muck with the router because you have a + special design, e.g. all through-hole components you can mess with + layer directional costs by editing the autoroute.c source file and + changing the directional costs in lines 929-940. and try again. Even + more mucking about with costs is possible in lines 4540-4569, but it's + probably not such a good idea unless you really just want to + experiment. + +@end enumerate + +After the design has been autorouted, you may want to run the trace +optimizer. See section @ref{Trace Optimizer} for more information on +the trace optimizer. + + +@c --------------------------- User Commands chapter ------------------------------- +@node User Commands +@chapter User Commands + +@cindex user commands +@cindex entering user commands +The entering of user-commands is initiated by the action routine +@emph{Command()} (normally bound to the @code{(":")} character) which +replaces the bottom statusline with an input area or opens a separate +command window. It is finished by either @emph{Return} or +@emph{Escape} to confirm or to abort. These two key-bindings +cannot be changed from the resource file. The triggering event, +normally a key press, is ignored. + +Commands can be entered in one of two styles, command entry syntax: +``@emph{Command arg1 arg2}'' or action script syntax ``@emph{Action1(arg1, +arg2); Action2(arg1, arg2);}''. Quoting arguments works similar to +bash quoting: + +@itemize +@item A backslash (\) is the escape character. It preserves the literal +value of the next character that follows. To get a literal '\' use +"\\". + +@item Enclosing characters in single quotes preserves the literal value of +each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a blackslash. + +@item Enclosing characters in double quotes preserves the literal value of +all characters within the quotes, with the exception of '\' which +maintains its special meaning as an escape character. +@end itemize + +There are simple @emph{usage} dialogs for each command and one for the +complete set of commands. + +@table @samp + +@findex :l +@cindex loading layouts +@cindex layout, loading a +@item l [filename] +Loads a new datafile (layout) and, if confirmed, overwrites any existing unsaved data. +The filename and the searchpath (@emph{filePath}) are passed to the +command defined by @emph{fileCommand}. +If no filename is specified a file select box will popup. + +@findex :le +@cindex loading elements to buffer +@cindex element, loading to buffer +@item le [filename] +Loads an element description into the paste buffer. +The filename and the searchpath (@emph{elementPath}) are passed to the +command defined by @emph{elementCommand}. +If no filename is specified a file select box will popup. + +@findex :m +@cindex loading a layout to buffer +@cindex merging layouts +@cindex layout, loading to buffer +@cindex layout, merging a +@item m [filename] +Loads an layout file into the paste buffer. +The filename and the searchpath (@emph{filePath}) are passed to the +command defined by @emph{fileCommand}. +If no filename is specified a file select box will popup. + +@findex :q +@cindex exit +@cindex quit +@item q[!] +Quits the program without saving any data (after confirmation). +q! doesn't ask for confirmation, it just quits. + +@findex :s +@cindex saving layouts +@cindex layout files, saving of +@item s [filename] +Data and the filename are passed to the command defined by the resource +@emph{saveCommand}. It must read the layout data from @emph{stdin}. +If no filename is entered, either the last one is used +again or, if it is not available, a file select box will pop up. + +@findex :rn +@cindex rat's nest +@cindex layout-name +@item rn [filename] +Reads in a netlist file. If no filename is given +a file select box will pop up. +The file is read via the command defined by the +@emph{RatCommand} resource. The command must send its output to @emph{stdout}. + +Netlists are used for generating rat's nests (see @ref{Rats Nest}) and for +verifying the board layout (which is also accomplished by the @emph{Ratsnest} +command). + +@findex :w[q] +@cindex saving layouts +@cindex layout files, saving of +@item w[q] [filename] +These commands have been added for the convenience of @code{vi} users and +have the same functionality as @emph{s} combined with @emph{q}. + +@findex :actionCommand() +@cindex action command +@cindex Actions, initiating +@item actionCommand +Causes the actionCommand to be executed. This allows you to initiate actions +for which no bindings exist in the resource file. It can be used to initiate any +action with whatever arguments you enter. This makes it possible to do things +that otherwise would be extremely tedious. For example, to change the drilling +hole diameter of all vias in the layout to 32 mils, you could select everything using the +selection menu, then type "@emph{:ChangeDrillSize(SelectedVias, 32)}". (This will +only work provided the via's diameter is sufficiently large to accommodate a 32 mil hole). +Another example might be to set the grid to 1 mil by typing "@emph{:SetValue(Grid, 1)}". +Note that some actions use the current cursor location, so be sure to place the cursor +where you want before entering the command. This is one of my favorite new +features in 1.5 and can be a powerful tool. Study the @ref{Actions} section to +see what actions are available. + +@end table + + +@c --------------------------- chapter 4 ------------------------------- +@node Command-Line Options +@chapter Command-Line Options +@cindex starting @pcb{} +@cindex command-line options + +The synopsis of the pcb command is: + +@code{pcb [OPTION ...] [LAYOUT-FILE.pcb]} to start the application in GUI mode, + +@noindent or + +@code{pcb [-h | -V | --copyright]} for a list of options, version, and copyright, + +@noindent or + +@code{pcb -p [OPTION ...] [LAYOUT-FILE.pcb]} to print a layout, + +@noindent or + +@code{pcb -x HID [OPTION ...] [LAYOUT-FILE.pcb]} to export. + +@noindent Possible values for the parameter @samp{HID} are: + @table @samp + @item bom + Export a bill of materials + @item gcode + Export to G-Code + @item gerber + Export RS-274X (Gerber) + @item nelma + Numerical analysis package export + @item png + export GIF/JPEG/PNG + @item ps + export postscript + @item eps + export encapsulated postscript +@end table + +@noindent There are several resources which may be set or reset in addition to the +standard toolkit command-line options. For a complete list refer to +@ref{Resources}. + + +@include options.texi + + + +@c --------------------------- chapter 5 ------------------------------- +@node X11 Interface +@chapter X11 Interface +@cindex X11 + +This chapter gives an overview about the additional @code{X11} resources which +are defined by @pcb{} as well as the defined action routines. + +@menu +* Resources:: Non-standard @code{X11} application resources. +* Actions:: A list of available action routines. +* Translations:: A list of the default key translations (as shipped). +@end menu + + +@node Resources +@section Non-Standard X11 Application Resources +@cindex resources +@cindex X11 resources + +In addition to the toolkit resources, @pcb{} defines the +following resources: + +@table @samp + +@vindex absoluteGrid +@cindex grid +@item absoluteGrid (boolean) +Selects if either the grid is relative to the position where it has changed +last or absolute, the default, to the origin (0,0). + +@vindex alignmentDistance +@cindex alignment +@item alignmentDistance (dimension) +Specifies the distance between the boards outline to the alignment targets. + +@vindex allDirectionLines +@cindex lines, clipping to 45 degree +@cindex clipping lines to 45 degree +@item allDirectionLines (boolean) +Enables (default) or disables clipping of new lines to 45 degree angles. + +@vindex backgroundImage +@cindex background +@item backgroundImage (string) +If specified, this image will be drawn as the background for the +board. The purpose of this option is to allow you to use a scan of an +existing layout as a prototype for your new layout. To do this, there +are some limitations as to what this image must be. The image must be +a PPM binary image (magic number @samp{P6}). It must have a maximum +pixel value of 255 or less (i.e. no 16-bit images). It must represent +the entire board, as it will be scaled to fit the board dimensions +exactly. Note that it may be scaled unevenly if the image doesn't +have the same aspect ratio of your board. You must ensure that the +image does not use more colors than are available on your system +(mostly this is for pseudo-color displays, like old 8-bit displays). +For best results, I suggest the following procedure using The Gimp: +Load your image (any type). Image->Scale if needed. +Image->Colors->Curves and for each of Red, Green, and Blue channel +move the lower left point up to about the 3/4 line (value 192). This +will make your image pale so it doesn't interfere with the traces +you'll be adding. Image->Mode->Indexed and select, say, 32 colors +with Normal F-S dithering. File->Save As, file type by extension, +use @file{.ppm} as the extension. Select Raw formatting. + +@vindex backupInterval +@cindex backup +@item backupInterval (int) +@pcb{} has an automatic backup feature which saves the current data +every n seconds. The default is @emph{300} seconds. A value of zero disables +the feature. The backup file is named @file{/tmp/PCB.%i.backup} by +default (this may have been changed at compilation time via the +@code{BACKUP_NAME} +variable in @file{globalconfig.h}). +@emph{%i} is replaced by the process ID. +See also, the command-line option @emph{--backup-interval}. + +@vindex bloat +@cindex bloat +@cindex drc +@item Bloat (dimension) +Specifies the minimum spacing design rule in mils. + +@vindex connectedColor +@cindex colors +@cindex connections, colors +@item connectedColor (color) +All pins, vias, lines and rectangles which are selected during a connection +search are drawn with this color. The default value is determined by +@emph{XtDefaultForeground}. + +@vindex cross hairColor +@cindex colors +@cindex cursor color +@item cross hairColor (color) +This color is used to draw the cross hair cursor. The color is a result of +a @emph{XOR} operation with the contents of the Layout area. The result +also depends on the default colormap of the @code{X11} server because only +the colormap index is used in the boolean operation and @pcb{} doesn't +create its own colormap. The default setting is @emph{XtDefaultForeground}. + +@vindex elementColor +@vindex elementSelectedColor +@cindex colors +@cindex element, color +@item elementColor (color) +@itemx elementSelectedColor (color) +The elements package part is drawn in these colors, for normal and selected +mode, respectively, which both default to @emph{XtDefaultForeground}. + +@vindex elementCommand +@cindex element, command +@cindex element, files +@cindex loading elements +@cindex preprocessing element data +@cindex unix command +@cindex m4 +@item elementCommand (string) +@pcb{} uses a user defined command to read element files. This resources +is used to set the command which is executed by the users default shell. +Two escape sequences are defined to pass the selected filename (%f) and the +current search path (%p). The command must write the element data +to its standard output. The default value is +@example + M4PATH="%p";export M4PATH;echo 'include(%f)' | m4 +@end example +Using the GNU version of @code{m4} is highly recommended. +See also, the command-line option @emph{--element-command}. + +@vindex elementPath +@cindex searchpath for element files +@cindex path for element files +@cindex element, files +@cindex loading elements +@item elementPath (string) +A colon separated list of directories or commands (starts with '|'). +The path is passed to the program specified in @emph{elementCommand} together +with the selected element name. A specified command will be executed in order +to create entries for the fileselect box. It must write its results to +@emph{stdout} one entry per line. +See also, the user-command @emph{le[!]}. + +@vindex fileCommand +@cindex file load command +@cindex layout files +@cindex loading layouts +@cindex preprocessing layout data +@cindex unix command +@cindex cat +@item fileCommand (string) +The command is executed by the user's default shell whenever existing layout +files are loaded. Data is read from the command's standard output. +Two escape sequences may be specified to pass the selected filename (%f) +and the current search path (%p). The default value is: +@example + cat %f +@end example +See also, the command-line option @emph{--file-command}. + +@vindex filePath +@cindex searchpath for layout files +@cindex path for layout files +@cindex layout files +@cindex loading layouts +@item filePath (string) +A colon separated list of directories or commands (starts with '|'). +The path is passed to the program specified in @emph{fileCommand} together +with the selected filename. A specified command will be executed in order +to create entries for the fileselect box. It must write its results to +@emph{stdout} one entry per line. +See also, the user-command @emph{l[!]}. + +@vindex fontCommand +@cindex font command +@cindex font files +@cindex loading fonts +@cindex loading symbols +@cindex preprocessing font data +@cindex unix command +@cindex cat +@item fontCommand (string) +Loading new symbol sets also is handled by an external command. You again +may pass the selected filename and the current search path by passing +%f and %p in the command string. Data is read from the commands standard +output. This command defaults to +@example + cat %f +@end example +See also, the command-line option @emph{--font-command}. + +@vindex fontFile +@cindex default font +@cindex symbols +@item fontFile (string) +The default font for new layouts is read from this file which is searched +in the directories as defined by the resource @emph{fontPath}. +Searching is only performed if the filename does not contain a directory +component. +The default filename is @file{default_font}. + +@vindex fontPath +@cindex searchpath for font files +@cindex path for font files +@cindex font files +@cindex loading fonts +@cindex loading symbols +@item fontPath (string) +This resource, a colon separated list of directories, defines the searchpath +for font files. See also, the resource @emph{fontFile}. + +@vindex grid +@cindex grid +@cindex cursor steps +@item grid (int) +This resources defines the initial value of one cursor step. It defaults +to @emph{100 mil} and any changes are saved together with the layout data. + +@vindex gridColor +@cindex colors +@cindex grid color +@item gridColor (color) +This color is used to draw the grid. The color is a result of +a @emph{INVERT} operation with the contents of the Layout area. The result +also depends on the default colormap of the @code{X11} server because only +the colormap index is used in the boolean operation and @pcb{} doesn't +create its own colormap. The default setting is @emph{XtDefaultForeground}. + +@vindex invisibleObjectsColor +@cindex colors +@cindex element, color +@item invisibleObjectsColor (color) +Elements located on the opposite side of the board are drawn in this color. +The default is @emph{XtDefaultForeground}. + +@vindex layerColor +@vindex layerSelectedColor +@cindex colors +@cindex layers, colors +@item layerColor1..MAX_LAYER (color) +@itemx layerSelectedColor1..MAX_LAYER (color) +These resources define the drawing colors of the different layers in +normal and selected state. All values are preset to @emph{XtDefaultForeground}. + +@vindex layerGroups +@cindex layers, groups +@cindex groups +@item layerGroups (string) +The argument to this resource is a colon separated list of comma separated +layer numbers (1..MAX_LAYER). All layers within one group are switched on/off +together. The default setting is @emph{1:2:3:...:MAX_LAYER} which means +all layers are handled separately. Grouping layers one to three looks like +@emph{1,2,3:4:...:MAX_LAYER} + +@vindex layerName +@cindex layer, name of +@item layerName1..MAX_LAYER (string) +The default name of the layers in a new layout are determined by these +resources. The defaults are empty strings. + +@vindex libraryCommand +@cindex library command +@cindex loading elements +@cindex unix command +@item libraryCommand (string) +@pcb{} uses a command to read element data from libraries. +The resources is used to set the command which is executed by the users +default shell. Three escape sequences are defined to pass the selected +filename (%f), the current search path (%p) as well (%a) as the three +parameters @emph{template}, @emph{value} and @emph{package} to the command. +It must write the element data to its standard output. The default value is +@example + NONE/share/pcb/oldlib/QueryLibrary.sh %p %f %a +@end example + +@vindex elementContentsCommand +@cindex library contents command +@cindex listing library contents +@cindex unix command +@item libraryContentsCommand (string) +Similar to @emph{libraryCommand}, @pcb{} uses the command specified +by this resource to list the contents of a library. +@example + NONE/share/pcb/oldlib/ListLibraryContents.sh %p %f +@end example +is the default. + +@vindex libraryFilename +@cindex default library +@cindex library name +@item libraryFilename (string) +The resource specifies the name of the library. The default value is +@emph{pcblib} unless changed at compile time +with the @code{LIBRARYFILENAME} variable in @file{globalconfig.h}. + +@vindex libraryPath +@cindex searchpath for libraries +@cindex path for libraries +@cindex library searchpath +@item libraryPath (string) +A colon separated list of directories that will be passed to the commands +specified by @emph{elementCommand} and @emph{elementContentsCommand}. + +@vindex lineThickness +@cindex lines, size +@cindex size of lines +@cindex thickness of lines +@item lineThickness (dimension) +The value, in the range [1..250] (the range may be changed at compile +time with the @code{MIN_LINESIZE} and @code{MAX_LINESIZE} variables in +@file{globalconfig.h}), defines the +initial thickness of new lines. The value is preset to @emph{ten mil}. + +@vindex media +@cindex media +@cindex media margin +@cindex print media +@item media ( | x+-+-) +The default (user defined) media of the @code{PostScript} device. Predefined +values are @emph{a3}, @emph{a4}, @emph{a5}, @emph{letter}, @emph{tabloit}, +@emph{ledger}, @emph{legal}, and @emph{executive}. +The second way is to specify the medias width, height and margins in mil. +The resource defaults to @emph{a4} size unless changed at compile time +with the @code{DEFAULT_MEDIASIZE} variable in @file{globalconfig.h}. + +@vindex offLimitColor +@cindex colors +@cindex off limit color +@item offLimitColor (color) +The area outside the current maximum settings for width and height is drawn +with this color. The default value is determined by @emph{XtDefaultBackground}. + +@vindex pinColor +@vindex pinSelectedColor +@cindex colors +@cindex pin color +@item pinColor (color) +@itemx pinSelectedColor(color) +This resource defines the drawing color of pins and pads in both states. +The values are preset to @emph{XtDefaultForeground}. + +@vindex pinoutFont0..6 +@cindex font, used for pin names +@cindex pinout, font to display pin names +@item pinoutFont (string) +This fonts are used to display pin names. There is one font for each zoom +value. The values are preset to @emph{XtdefaultFont}. + +@vindex pinoutNameLength +@cindex namelength of pins +@cindex pin, name of +@cindex length of a pin name +@item pinoutNameLength (int) +This resource limits the number of characters which are displayed for +pin names in the pinout window. By default the string length is limited +to @emph{eight} characters per name. + +@vindex pinoutOffsetX +@vindex pinoutOffsetY +@cindex offset of pinout +@item pinoutOffsetX (int) +@itemx pinoutOffsetY (int) +These resources determine the offset in @emph{mil} of the circuit from the +upper left corner of the window when displaying pinout information. +Both default to @emph{100 mil}. + +@vindex pinoutTextOffsetX +@vindex pinoutTextOffsetY +@cindex offset of pinnames +@item pinoutTextOffsetX (int) +@itemx pinoutTextOffsetY (int) +The resources determine the distance in mil between the drilling hole of a pin +to the location where its name is displayed in the pinout window. +They default to @emph{X:50} and @emph{Y:0}. + +@vindex pinoutZoom +@cindex pinout, zoomfactor of display +@cindex zoom of pinout window +@item pinoutZoom (int) +Sets the zoom factor for the pinout window according to the formula: +scale = 1:(2 power value). Its default value is @emph{two} which results in +a @emph{1:4} scale. + +@vindex printCommand +@cindex printing +@item printCommand (string) +Default file for printouts. If the name starts with a '|' the output +is piped through the command. A %f is replaced by the current filename. +There is no default file or command. + +@vindex raiseLogWindow +@cindex log window +@cindex messages +@item raiseLogWindow (boolean) +The log window will be raised when new messages arrive if this resource +is set @emph{true}, the default. + +@vindex ratCommand +@cindex rats nest +@cindex netlist +@item ratCommand (string) +Default command for reading a netlist. A %f is replaced by the netlist +filename. Its default value is "@emph{cat %f}". + +@vindex ratPath +@cindex rats nest +@cindex netlist +@item ratPath (string) +Default path to look for netlist files. It's default value is "." + +@vindex resetAfterElement +@cindex connections, reseting after element +@cindex reseting found connections +@item resetAfterElement (boolean) +If set to @emph{true}, all found connections will be reset before a new +element is scanned. This will produce long lists when scanning the whole +layout for connections. The resource is set to @emph{false} by default. +The feature is only used while looking up connections of all elements. + +@vindex ringBellWhenFinished +@cindex keyboard bell +@item ringBellWhenFinished (boolean) +Whether to ring the bell (the default) when a possibly lengthy operation +has finished or not. +See also, the command-line option @emph{--ring-bell-finished}. + +@vindex routeStyle +@cindex routing style +@item routeStyle (string) +Default values for the menu of routing styles (seen in the sizes menu). +The string is a comma separated list of name, line thickness, +via diameter, and via drill size. +e.g. "Fat,50,100,40:Skinny,8,35,20:75Ohm,110,110,20" +See also, the command-line option @emph{--route-styles} and @emph{Sizes Menu} + +@vindex rubberBandMode +@cindex move +@cindex rubberband +@cindex rotate +@item rubberBandMode (boolean) +Whether rubberband move and rotate (attached lines stretch like +rubberbands) is enabled (the default). + +@vindex saveCommand +@cindex file save command +@cindex layout files +@cindex saving layouts +@cindex postprocessing layout data +@cindex unix command +@cindex cat +@item saveCommand (string) +This command is used to save data to a layout file. The filename may be +indicated by placing @code{%f} in the string. It must read the data from +its standard input. The default command is: +@example + cat - > %f +@end example +See also, the command-line option @emph{--save-command}. + +@vindex saveInTMP +@cindex backup +@cindex saving layouts +@cindex preventing loss of data +@cindex temporary files +@cindex /tmp +@cindex directory /tmp +@item saveInTMP (boolean) +Enabling this resource will save all data which would otherwise be lost +in a temporary file @file{/tmp/PCB.%i.save}. The file name may +be changed at compile time +with the @code{EMERGENCY_NAME} variable in @file{globalconfig.h}. +. +@emph{%i} is replaced by the process ID. +As an example, loading a new layout when the old one hasn't been saved would +use this resource. +See also, the command-line option @emph{--save-in-tmp}. + +@vindex saveLastCommand +@cindex saving last entered user command +@cindex inputfield, saving entered command-line +@item saveLastCommand (boolean) +Enables the saving of the last entered user command. The option is +@emph{disabled} by default. +See also, the command-line option @emph{--save-last-command}. + +@vindex shrink +@cindex shrink +@cindex drc +@item Shrink (dimension) +Specifies the minimum overlap (touching) design rule in mils. + +@vindex size +@cindex default layout size +@cindex layout, default size of +@item size (x) +Defines the width and height of a new layout. The default is +@emph{7000x5000} unless changed at compile time +with the @code{DEFAULT_SIZE} variable in @file{globalconfig.h}. + + +@vindex stipplePolygons +@cindex polygon +@cindex display +@item stipllePolygons (boolean) +Determines whether to display polygons on the screen with a stippled +pattern. Stippling can create some amount of transparency so that +you can still (to some extent) see layers beneath polygons. +It defaults to False. + +@vindex textScale +@cindex text, default scaling +@cindex default text scaling +@item textScale (dimension) +The font scaling in percent is defined by this resource. The default is +@emph{100} percent. + +@vindex useLogWindow +@cindex log window +@cindex messages +@item useLogWindow (boolean) +Several subroutines send messages to the user if an error occurs. +This resource determines if they appear inside the log window or as a separate +dialog box. See also, the resource @emph{raiseLogWindow} and the command line +option @emph{-loggeometry}. +The default value is @emph{true}. + +@vindex viaColor +@vindex viaSelectedColor +@cindex colors +@cindex vias, color +@item viaColor (color) +@item viaSelectedColor (color) +This resource defines the drawing color of vias in both states. +The values are preset to @emph{XtDefaultForeground}. + +@vindex viaThickness +@vindex viaDrillingHole +@cindex vias, size +@cindex size of vias +@cindex thickness of vias +@item viaThickness (dimension) +@itemx viaDrillingHole (dimension) +The initial thickness and drilling hole of new vias. The values must be in the +range [30..400] (the range may be changed at compile +time with the @code{MIN_PINORVIASIZE} and @code{MAX_PINEORVIASIZE} variables in +@file{globalconfig.h}), with at least 20 +mil of copper. +The default thickness is @emph{40 mil} and the default drilling hole is +@emph{20 mil}. + +@vindex volume +@cindex speaker volume +@cindex volume of speaker +@item volume (int) +The value is passed to @code{XBell()} which sets the volume of the @code{X} +speaker. +The value lies in the range -100..100 and it defaults to the maximum volume of +@emph{100}. + +@vindex warnColor +@cindex colors +@cindex color, warning +@item warnColor (color) +This resources defines the color to be used for drawing pins and pads when +a warning has been issued about them. + +@vindex zoom +@cindex zoom of Layout area +@item zoom (int) +The initial value for output scaling is set according to the following +formula: scale = 1:(2 power value). It defaults to @emph{three} which results +in an output scale of @emph{1:8}. + +@end table + +Refer also to @ref{Command-Line Options}. + +@node Actions +@section Actions +@cindex actions +@cindex translations +@cindex key translations +@cindex button translations +@cindex X11 translations + +All user accessible commands may be bound to almost any @code{X} event. Almost +no default binding for commands is done in the binaries, so it is vital for the +application that at least a system-wide application resource file exists. +This file normally resides in the @file{share/pcb} directory and +is called @file{Pcb}. The bindings to which the manual refers to are the +ones as defined by the shipped resource file. Besides binding an action to +an X11 event, you can also execute any action command using a ":" command +(see @ref{User Commands}). + +Take special care about translations related to the functions keys and the +pointer buttons because most of the window managers use them too. +Change the file according to your hardware/software environment. +You may have to replace all occurances of @emph{baseTranslations} to +@emph{translations} if you use a @code{X11R4} server. + +Passing @emph{Object} as an argument to an action routine causes the object +at the cursor location to be changed, removed or whatever. If more than +one object is located at the cross hair position the smallest type is used. +If there are two of the same type the newer one is taken. +@emph{SelectedObjects} will handle all selected and visible objects. + + +@table @samp +@findex AddRats() +@cindex rats nest +@cindex netlist +@cindex rat-line +@item AddRats(AllRats|SelectedRats) +Adds rat-lines to the layout using the loaded netlist file (see the @emph{:rn}, +@ref{User Commands}.). Rat lines are added on the active layer using the current +line thickness shown in the status line. +Only missing connectivity is added by the +AddRats command so if, for example, the layout is complete nothing will be added. +Rat lines may be drawn different to other lines on the screen +to make them easier to identify since they cannot appear in a completed layout. +The rat-lines are added in the minimum length straight-line tree pattern +(always ending on pins or pads) that satisfies the missing connectivity in the circuit. +If a SMD pad is unreachable on the active layer, a warning will be issued +about it and the rat-line to that pad will not be generated. +If connections exist on the board which are not listed in the netlist while +AllRats are being added, warning messages will be issued and the affected pins and +pads will be drawn in a special @emph{warnColor} until the next @emph{Notify()} event. +If the entire layout agrees completely with the net-list a message informs you that +the layout is complete and no rat-lines are added (since none are needed). +If @emph{SelectedRats} +is passed as the argument, only those missing connections that might connect among +the selected pins and pads are drawn. +Default: +@example +Nonew: AddRats(AllRats) +!Shiftw: AddRats(SelectedRats) +Noneo: DeleteRats(AllRats) AddRats(AllRats) +!Shifto: DeleteRats(SelectedRats) AddRats(SelectedRats) +@end example + +@findex ApplyVendor() +@cindex vendor map +@cindex vendor drill table +@item ApplyVendor() +Applies an already loaded vendor drill map to the design. +@example +ApplyVendor() +@end example + +@findex Atomic() +@cindex undo, multi-action resources +@cindex atomic +@item Atomic(Save|Restore|Block|Close) +Controls the undo grouping of sequences of actions. Before the first action +in a group, Atomic(Save) should be issued. After each action that might +be undoable, Atomic(Restore) should be issued. Atomic(Block) concludes +and save the undo grouping if there was anything in the group to undo. +Atomic(Close) concludes and save the undo grouping even if nothing was +actually done. Thus it might produce an "empty" undo. This can be useful +when you want to use undo in a group of actions. + +@findex Bell() +@cindex signal +@cindex bell +@item Bell([-100..100]) +Rings the bell of your display. If no value is passed the setting +of the resource @emph{volume} will be used. + +@findex ChangeClearSize() +@cindex change sizes +@cindex sizes, changing of objects +@cindex clearance, changing of objects +@item ChangeClearSize(Object, value[, unit]) +@itemx ChangeClearSize(SelectedPins|SelectedVias, value[, unit]) +The effect of this action depends on if the soldermask display is presently +turned on or off. If soldermask is displayed, then the soldermask +relief size will be changed. If soldermask display is turned off, +then the clearance to polygons will be changed. +@emph{unit} is "mil" or "mm". If not specified the units will default +to the internal unit of 0.01 mil. +@example +!Mod1k: ChangeClearSize(Object, +2, mil) +!Mod1 Shiftk: ChangeClearSize(Object, -2, mil) +@end example + +@findex ChangeDrillSize() +@cindex change sizes +@cindex sizes, changing of objects +@cindex drilling hole, changing of objects +@item ChangeDrillSize(Object, value[, unit]) +@itemx ChangeDrillSize(SelectedPins|SelectedVias, value[, unit]) +This action routine changes the drilling hole of pins and vias. +If @emph{value} starts with + or -, then it adds (or subtracts) +@emph{value} from the current hole diameter, otherwise it sets the +diameter to the value. +@emph{unit} is "mil" or "mm". If not specified the units will default +to the internal unit of 0.01 mil. +Default: +@example +!Mod1s: Change2ndSize(Object, +5, mil) +!Mod1 Shifts: Change2ndSize(Object, -5, mil) +@end example + +@findex ChangeFlag() +@cindex flags, changing +@cindex octagonal flag, changing +@cindex square flag, changing +@cindex thermal flag, changing +@item ChangeFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square,0|1) +Sets/clears the indicated flag. This adds/removes thermals, adds/removes the flag +which indicates a pin/pad should be square, or adds/removes the flag which +indicates a pin/pad should be octagonal. +@example +:ChangeFlag(SelectedVias,thermal,1) +:ChangeFlag(SelectedPads,square,0) +@end example + +@findex ChangeHole() +@cindex vias, converting to mounting hole +@cindex mounting holes +@item ChangeHole(Object|SelectedVias) +This action routine converts a via to and from a hole. A hole is +a via that has no copper annulus. The drill size for the via +determines the hole diameter. +@example +!Ctrlh: ChangeHole(Object) +@end example + +@findex ChangeName() +@cindex name, change an objects +@cindex change object name +@cindex object, change name of +@item ChangeName(Object) +@itemx ChangeName(Layer|Layout) +Changes the name of the visible object at the cursor location. A text object +doesn't have a name therefore the text string itself is changed. +The element name currently used for display is always the one changed with this +command. +See @emph{Display(Description|NameOnPCB|Value)} for details. +Passing @emph{Layer} changes the current layers name. +Default: +@example +Nonen: ChangeName(Object) +@end example + +@findex ChangeOctagon() +@cindex pins, changing shape of +@cindex vias, changing shape of +@cindex octagonal pins and vias +@item ChangeOctagon(Object|SelectElements|SelectedPins|SelectedVias|Selected) +Toggles what shape the affected pin(s) or via(s) will be drawn when they +are not square. The shape will either be round or octagonal. +Default: +@example +!Ctrlo: ChangeOctagon(Object) +@end example + +@findex ChangePinName() +@cindex changing pin/pad names +@cindex pin/pad names, changing +@item ChangePinName(ElementName, PinNumber, PinName) +Changes the name for a specified pin or pad number on a specified element. +This action is typically used to forward annotate pin/pad names from a schematic +to the layout. +@example +ChangePinName(U1, 14, VDD) +@end example + + +@findex ChangeSize() +@cindex change sizes +@cindex sizes, changing of objects +@cindex thickness, changing of objects +@item ChangeSize(Object, value[, unit]) +@itemx ChangeSize(SelectedLines|SelectedPins|SelectedVias, value[, unit]) +@itemx ChangeSize(SelectedPads|SelectedTexts|SelectedNames, value[, unit]) +@itemx ChangeSize(SelectedElements, value[, unit]) +To change the size of an object you have to bind these action to some +@code{X} event (or use :ChangeSize(...)). If @emph{value} begins with +a + or - then the value will be added (or subtracted) from the current +size, otherwise the size is set equal to @emph{value}. Range checking is +done to insure that none of the maximum/minimums of any size are violated. +If @emph{Object} is passed then a single object at the cursor location is +changed. If any of the @emph{Selected} arguments are passed then all selected +and visible objects of that type are changed. If the type being modified is +an element, then the thickness of the silkscreen lines defining the element +is changed. +@emph{unit} is "mil" or "mm". If not specified the units will default +to the internal unit of 0.01 mil. +Default: +@example +Nones: ChangeSize(Object, +5) +!Shifts: ChangeSize(Object, -5) +@end example + +@findex ChangeSquare() +@cindex change square flag +@cindex square flag, changing of objects +@cindex thickness, changing of objects +@item ChangeSquare(Object|SelectedElements|SelectedPins) +Toggles the setting of the square flag. The flag is used to identify a +certain pin, normally the first one, of circuits. It is also used to +make SMD pads have square ends. +@example +Noneq: ChangeSquare(Object) +@end example + +@findex ClrFlag() +@cindex flags, clearing +@cindex flags, clearing +@cindex octagonal flag, clearing +@cindex square flag, clearing +@cindex thermal flag, clearing +@item ClrFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square) +Clears the indicated flag. This removes thermals, removes the flag +which indicates a pin/pad should be square, or removes the flag which +indicates a pin/pad should be octagonal. +@example +:ClrFlag(SelectedVias,thermal) +@end example + +@findex Command() +@cindex start user input +@cindex inputfield, start user input +@item Command() +Calling @emph{Command()} pops up an input line at the bottom of the window +which allows you to enter commands. Including all action commands! +The dialog ends when @emph{NoneReturn} +to confirm or @emph{NoneEscape} to abort is entered. +Default: +@example +colon: Command() +@end example + +@findex Connection() +@cindex scanning connections +@cindex searching connections +@cindex connections, reseting +@cindex reseting found connections +@cindex connections, searching for +@cindex saving found connections +@item Connection(Find) +@itemx Connection(ResetFoundLinesAndRectangles|ResetPinsViasAndPads|Reset) +The @emph{Connection()} action is used to mark all connections from one pin, +line or via to others. +The @emph{ResetFoundLinesAndRectangles, ResetFoundPinsAndVias} and +@emph{Reset} arguments may be used to reset all marked lines and rectangles, +vias and pins or all of them. The search starts with the pin or via +at the cursor position. All found objects are drawn with the color +defined by the resource @emph{connectedColor}. +See also, @emph{Display(Description|NameOnPCB|Value)}. +Default: +@example +!Shiftc: Connection(Reset) +Nonef: Connection(Find) +!Shiftf: Connection(Reset) +@end example + +@findex DeleteRats() +@cindex rats nest +@cindex rat-line +@cindex netlist +@item DeleteRats(AllRats|SelectedRats) +This routine deletes either all rat-lines in the layout, or only +the selected and visible ones. Non-rat-lines and other layout +objects are unaffected. +Default: +@example +Nonee: DeleteRats(AllRats) +!Shifte: DeleteRats(SelectedRats) +@end example + +@findex DisableVendor() +@cindex vendor map, disabling +@cindex vendor drill table, disabling +@item DisableVendor() +Disables automatic drill size mapping to the loaded vendor drill table. +@example +DisableVendor() +@end example + +@findex DisperseElements() +@cindex dispersing elements +@cindex distributing elements +@cindex elements, dispersing +@cindex elements, distributing +@item DisperseElements(All|Selected) +Disperses either all elements or only the selected elements in the +layout. This action should be used at the +start of a design to spread out all footprints before any placement or +routing is done. +@example +DisperseElements(All) +@end example + + +@findex Display() +@cindex centering +@cindex redrawing layout +@cindex refreshing layout +@cindex name of an element +@cindex displaying element names +@cindex element, display names of +@cindex grid, absolute and relative +@cindex grid, display +@cindex rubberband +@cindex pinout, display of +@cindex displaying pinout +@cindex lines, clipping to 45 degree +@cindex clipping lines to 45 degree +@item Display(Description|NameOnPCB|Value) +@itemx Display(Toggle45Degree|CycleClip) +@itemx Display(Grid|ToggleGrid) +@itemx Display(ToggleRubberBandMode) +@itemx Display(Center|ClearAndRedraw|Redraw) +@itemx Display(Pinout|PinOrPadName) +This action routines handles some output related settings. It is +used to center the display around the cursor location and to redraw the +output area optionally after clearing the window. +Centering is done with respect to the @emph{grid} setting. Displaying the +grid itself may be switched on and off by @emph{Grid} but only if +the distance between two pixels exceeds 4 pixels. +@pcb{} is able to handle several labels of an element. One of them +is a description of the functionality (eg resistor), the second should be +a unique identifier (R1) whereas the last one is a value (100k). +The @emph{Display()} action selects which of the names is displayed. +It also controls which name will be affected by the @emph{ChangeName} command. +If @emph{ToggleGrid} is passed, @pcb{} changes between relative +('rel' in the statusline) and absolute grid (an 'abs' in the statusline). +Relative grid means the pointer position when the command is issued is +used as the grid origin; while (0,0) is used in the absolute grid case. +Passing @emph{Pinout} displays the pinout of the element at the current +cursor location whereas @emph{PinOrPadName} toggles displaying of the +pins or pads name under the cursor. If none of them matches but the cursor +is inside of an element, the flags is toggled for all of its pins and pads. +For details about rubberbands see also the details about @emph{Mode}. +Default: +@example +Nonec: Display(Center) +Noned: Display(PinOrPadName) +!Shiftd: Display(Pinout) +Noner: Display(ClearAndRedraw) +None.: Display(Toggle45Degree) +None/: Display(CycleClip) +@end example + +@findex DRC() +@cindex design rule checking +@cindex drc +@item DRC() +Initiates design rule checking of the entire layout. Must be repeated +until no errors are found. + +@findex ExecuteFile() +@cindex actions file, executing +@cindex script file, executing +@item ExecuteFile(filename) +Executes the PCB actions contained in the specified file. +This can be used to automate a complex sequence of operations. +@example +:ExecuteFile(custom.cmd) +@end example +The command file contains a list of PCB actions. Blank lines +are ignored and lines starting with a # are treated as comment +lines. For example +@example +# This is a comment line +Display(Grid) +SetValue(Zoom,2) +DRC() +@end example + +@findex EditLayerGroups() +@cindex layers, editing of groups +@cindex groups, editing of +@item EditLayerGroups() +Pops up a dialog box to edit the layergroup setting. The function is also +available from the @emph{Objects} menu. +There are no defaults. + +@findex EnableVendor() +@cindex vendor map, enabling +@cindex vendor drill table, enabling +@item EnableVendor() +Enables automatic drill size mapping to the loaded vendor drill table. +@example +EnableVendor() +@end example + + +@findex Load() +@cindex loading files +@item Load(ElementToBuffer|Layout|LayoutToBuffer|Nelist) +This routine pops up a fileselect box to load layout, element data, +or netlist. +The passed filename for layout data is saved and may be reused. +@emph{ElementToBuffer} and @emph{LayoutToBuffer} load the data into the +current buffer. +There are no defaults. + +@findex LoadVendor() +@cindex vendor map, loading +@cindex vendor drill table, loading +@item LoadVendor(vendorfile) +Loads the specified vendor resource file. +@example +LoadVendor(myvendor.res) +@end example + +@findex MarkCrosshair() +@cindex mark +@cindex cursor position +@item MarkCrosshair() +This routine marks the current cursor location with an X, and then +the cursor display shows both absolute position and position relative to +the mark. If a mark is already present, this routine removes it and +stops displaying relative cursor coordinates. +Defaults: +@example +!Ctrlm: MarkCrosshair() +@end example + +@findex Mode() +@cindex mode, selecting of +@cindex operation modes, selecting of +@item Mode(Copy|InsertPoint|Line|Move|None|PasteBuffer|Polygon|Thermal) +@itemx Mode(Remove|Rectangle|RubberbandMove|Text|Via) +@itemx Mode(Cycle) +@itemx Mode(Notify) +@itemx Mode(Save|Restore) +Switches to a new mode of operation. The active mode is displayed by a thick +line around the matching mode selector button. +Most of the functionality of @pcb{} is implemented by selecting a mode +and calling @emph{Mode(Notify)}. The arguments @emph{Line}, @emph{Polygon}, +@emph{Rectangle}, @emph{Text} and @emph{Via} are used to create the +appropriate object whenever @emph{Mode(Notify)} is called. Some of them, +such as @emph{Polygon}, need more than one call for one object to be created. +@emph{InsertPoint} adds points to existing polygons or lines. +@emph{Save} and @emph{Restore} are used to temporarily save the mode, switch +to another one, call @emph{Mode(Notify)} and restore the saved one. Have +a look at the application resource file for examples. +@emph{Copy} and @emph{Move} modes are used to change an object's location and, +optionally, to create a new one. The first call of @emph{Mode(Notify)} attaches +the object at the pointer location to the cross hair whereas the second +one drops it to the layout. The @emph{rubberband} version of move performs the +move while overriding the current rubberband mode. +Passing @emph{PasteBuffer} attaches the contents of the currently selected +buffer to the cross hair. Each call to @emph{Mode(Notify)} pastes this contents +to the layout. @emph{Mode(Cycle)} cycles through the modes available in the +mode-button pallet. +@emph{Mode(None)} switches all modes off. +Default: +@example +Escape: Mode(None) +space: Mode(Cycle) +NoneBackSpace: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) +NoneDelete: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) +NoneF1: Mode(Via) +NoneF2: Mode(Line) +NoneF3: Mode(PasteBuffer) +NoneF4: Mode(Rectangle) +NoneF5: Mode(Text) +NoneF6: Mode(Polygon) +NoneF7: Mode(Thermal) +NoneF8: Mode(Arc) +NoneInsert: Mode(InsertPoint) +None[: Mode(Save) Mode(Move) Mode(Notify) +None]: Mode(Notify) Mode(Restore) +None: Mode(Notify) +!Shift Ctrl: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) +None: Mode(Save) Mode(Move) Mode(Notify) +None: Mode(Notify) Mode(Restore) +!Mod1: Mode(Save) Mode(Copy) Mode(Notify) +!Mod1: Mode(Notify) Mode(Restore) +Shift BTNMOD: Mode(Save) Mode(RubberbandMove) Mode(Notify) +@end example + +@findex MovePointer() +@cindex pointer, moving of +@cindex cursor movements +@item MovePointer(delta_x, delta_y) +With this function it is possible to move the cross hair cursor by using the +cursor keys. The @code{X} server's pointer follows because the necessary +events are generated by @pcb{}. All movements are performed with respect +to the currently set grid value. +Default: +@example +NoneUp: MovePointer(0, -1) +!ShiftUp: MovePointer(0, -10) +NoneDown: MovePointer(0, 1) +!ShiftDown: MovePointer(0, 10) +NoneRight: MovePointer(1, 0) +!ShiftRight: MovePointer(10, 0) +NoneLeft: MovePointer(-1, 0) +!ShiftLeft: MovePointer(-10, 0) +@end example + +@findex MoveToCurrentLayer() +@cindex objects, moving to current layer +@cindex moving objects to current layer +@item MoveToCurrentLayer(Object|SelectedObjects) +The function moves a single object at the cross hair location or all selected +objects to the current layer. Elements are not movable by this function. +They have to be deleted and replaced on the other side. +If a line segment is moved and the movement would result in a loss of +connectivity to another segment then via(s) are automatically added to +maintain the connectivity. +@example +Nonem: MoveToCurrentLayer(Object) +!Shiftm: MoveToCurrentLayer(SelectedObjects) +@end example + +@findex New() +@cindex layout, start a new +@cindex starting a new layout +@item New() +Clear the current layout and starts a new one after entering its name. +Refer to the resource @emph{backup} for more information. +No defaults. + +@findex PasteBuffer() +@cindex buffer, selecting a +@cindex pastebuffer, selecting a +@cindex selecting a buffer +@cindex rotating a buffer +@cindex cutting objects +@cindex copying objects +@item PasteBuffer(AddSelected|Clear|1..5) +@itemx PasteBuffer(Rotate, 1..3) +@itemx PasteBuffer(Convert) +This action routine controls and selects the pastebuffer as well as all +cut-and-paste operations. Passing a buffer number selects one in of the +range 1..5. The statusline is updated with the new number. +@emph{Rotate} performs a number of 90 degree counter clockwise rotations +of the buffer contents. @emph{AddSelected} as first argument copies all +selected and visible objects into the buffer. Passing @emph{Clear} removes +all objects from the currently selected buffer. @emph{Convert} causes +the contents of the buffer (lines, arc, vias) to be converted into an +element definition. Refer to @ref{Pastebuffer} +for examples. +Default: +@example +!Ctrlx: PasteBuffer(Clear) PasteBuffer(AddSelected) + Mode(PasteBuffer) +!Shift Ctrlx: PasteBuffer(Clear) PasteBuffer(AddSelected) + RemoveSelected() Mode(PasteBuffer) +!Mod1c: PasteBuffer(Clear) PasteBuffer(AddSelected) +!Mod1x: PasteBuffer(Clear) PasteBuffer(AddSelected) + RemoveSelected() +!Shift1: PasteBuffer(1) +!Shift2: PasteBuffer(2) +!Shift3: PasteBuffer(3) +!Shift4: PasteBuffer(4) +!Shift5: PasteBuffer(5) +NoneF3: Mode(PasteBuffer) +@end example + +@findex Polygon() +@cindex polygon, closing a +@cindex polygon point, go back to previous +@cindex closing a polygon +@item Polygon((Close|PreviousPoint) +Polygons need a special action routine to make life easier. Calling +@emph{Polygon(PreviousPoint)} resets the newly entered corner to the +previous one. The Undo action will call Polygon(PreviousPoint) +when appropriate to do so. @emph{Close} creates the final +segment of the polygon. This may fail if clipping to 45 degree +lines is switched on, in which case a warning is issued. +Default: +@example +Nonep: Polygon(Close) +!Shiftp: Polygon(Close) +@end example + +@findex Print() +@cindex layout, printing a +@cindex printing a layout +@item Print() +Pops up a print control box that lets you select the output +device, scaling and many more options. Each run creates all +files that are supported by the selected device. These are +mask files as well as drilling files, silk screens and so on. The table +shows the filenames for all possible files: +@example + POSIX (extension) 8.3 filename + --------------------------------------------- + *_componentmask.* cmsk.* + *_componentsilk.* cslk.* + *_soldermask.* smsk.* + *_soldersilk.* sslk.* + *_drill.* dril.* + *_groundplane.* gpl.* + *_group[1..8].* [..8].* +@end example +The output may be sent to a post-processor by starting the filename with the +@emph{pipe} @code{("|")} character. Any @code{"%f"} in a command is replaced +with the current filename. The function is available from the @emph{file} menu. +There are no defaults. + +@findex Quit() +@cindex quit +@cindex exit +@item Quit() +Quits the application after confirming the operation. +Default: +@example +WM_PROTOCOLS: Quit() +@end example + +@findex Redo() +@cindex redo +@cindex recover +@item Redo() +This routine allows you to recover from the last undo command. +You might want to do this if you thought that undo was going to +revert something other than what it actually did (in case you +are confused about which operations are un-doable), or if you +have been backing up through a long undo list and over-shoot +your stopping point. Any change that is made since the undo +in question will trim the redo list. For example if you add +ten lines, then undo three of them you could use redo to put +them back, but if you move a line on the board before performing +the redo, you will lose the ability to "redo" the three "undone" lines. +Default: +@example +!Shiftr: Redo() +@end example + +@findex RemoveSelected() +@cindex removing selected objects +@cindex selected object, removing an +@item RemoveSelected() +This routine removes all visible and selected objects. +There are no defaults. + +@findex Report() +@cindex report +@cindex information about objects +@cindex drill +@item Report(Object|DrillReport) +This routine pops up a dialog box describing the various +characteristics of an object (or piece of an object such as a pad or pin) +in the layout at the cursor position, or a report about all of the +drill holes in the layout. +There are no defaults. + +@findex RouteStyle() +@cindex routing style +@cindex size of lines and vias +@item RouteStyle(1|2|3|4) +This routine copies the sizes corresponding to the numbered route style +into the active line thickens, via diameter, and via drill size. +Defaults: +@example +!Ctrl1: RouteStyle(1) +... +!CtrlNUM_STYLES: RouteStyle(NUM_STYLES) +@end example +The variable @code{NUM_STYLES} is set at compile time in +@file{globalconfig.h}. + +@findex Save() +@cindex saving files +@cindex saving connections +@item Save(Layout|LayoutAs) +@itemx Save(AllConnections|AllUnusedPins|ElementConnections) +Passing @emph{Layout} saves the layout using the file from which it was +loaded or, if it is a new layout, calls @emph{Save(LayoutAs)} which queries +the user for a filename. +The values: @emph{AllConnections}, @emph{AllUnusedPins} and +@emph{ElementConnections} start a connection scan and save all connections, +all unused pins or the connections of a single element to a file. +There are no defaults. + +@findex Select() +@cindex selection +@cindex selecting objects +@item Select(All|Block|Connection|ToggleObject) +@itemx Select(ElementByName|ObjectByName|PadByName|PinByName) +@itemx Select(TextByName|ViaByName) +Toggles either the selection flag of the object at the cross hair position +(@emph{ToggleObject}) or selects all visible objects, all inside a +rectangle or all objects which have been found during the last connection +scan. The @emph{ByName} functions use a @ref{Regular Expressions} search, +always case insensitive, to select the objects. +Default: +@example +None: Select(ToggleObject) +None,None: See resource file - this is complex +@end example + +@findex SetFlag() +@cindex flags, setting +@cindex octagonal flag, setting +@cindex square flag, setting +@cindex thermal flag, setting +@item SetFlag(Object|SelectElements|SelectedPins|SelectedVias|Selected,thermal|octagon|square) +Sets the indicated flag. This adds thermals, sets the flag +which indicates a pin/pad should be square, or sets the flag which +indicates a pin/pad should be octagonal. +@example +:SetFlag(Selected,thermal) +@end example + +@findex SetValue() +@cindex change settings +@cindex zoom, setting of +@cindex grid, setting of +@cindex drilling hole, setting of initial size +@cindex vias, setting of initial size +@cindex lines, setting of initial size +@item SetValue(Grid|LineSize|TextScale|ViaDrillingHole|ViaSize|Zoom, value) +Some internal values may be changed online by this function. +The first parameter specifies which data has to be changed. The other one +determines if the resource is set to the passed value, if @emph{value} is +specified without sign, or increments/decrements if it is specified with +a plus or minus sign. +The function doesn't change any existing object only the initial values of +new objects. Use the @emph{ChangeSize()} and @emph{ChangeDrillSize()} +to change existing objects. +Default: +@example +Noneg: SetValue(Grid, +5) +!Shiftg: SetValue(Grid, -5) +Nonel: SetValue(LineSize, +5) +!Shiftl: SetValue(LineSize, -5) +Nonet: SetValue(TextScale, +10) +!Shiftt: SetValue(TextScale, -10) +Nonev: SetValue(ViaSize, +5) +!Shiftv: SetValue(ViaSize, -5) +!Mod1v: SetValue(ViaDrillingHole, +5) +!Mod1 Shiftv: SetValue(ViaDrillingHole, -5) +Nonez: SetValue(Zoom, -1) +!Shiftz: SetValue(Zoom, +1) +@end example + +@findex SwapSides() +@cindex change viewing side +@cindex viewing side, changing of +@item SwapSides() +This routine changes the board side you are viewing. +Default: +@example +NoneTab: SwapSides() +@end example + +@findex SwitchDrawingLayer() +@cindex change drawing layer +@cindex layer, change active +@item SwitchDrawingLayer(value) +Makes layer number 1..MAX_LAYER the current one. +Default: +@example +None1: SwitchDrawingLayer(1) +... +NoneMAX_LAYER: SwitchDrawingLayer(MAX_LAYER) +@end example + +@findex ToggleHideName() +@cindex hide element name +@cindex element name, hiding +@cindex element name, removing from silk-screen +@item ToggleHideName(Object|SelectedElements) +Toggles whether the element's name is displayed or hidden. If it +is hidden you won't see it on the screen and it will not appear +on the silk layer when you print the layout. +@example +Noneh: ToggleHideName(Object) +!Shifth: ToggleHideName(SelectedElements) +@end example + +@findex ToggleVendor() +@cindex vendor map, toggling +@cindex vendor drill table, toggling +@item ToggleVendor() +Toggles automatic drill size mapping to the loaded vendor drill table. +@example +ToggleVendor() +@end example + +@findex ToggleVisibility() +@cindex toggle layer visibility +@cindex layer visibility, toggling +@item ToggleVisibility(Layer) +Toggles the visibility of the layer. +@example +Mod11: ToggleVisibility(1) +Mod12: ToggleVisibility(2) +Mod13: ToggleVisibility(3) +Mod14: ToggleVisibility(4) +@end example + +@findex Undo() +@cindex undo +@cindex recover +@item Undo() +@itemx Undo(ClearList) +The unlimited undo feature of @pcb{} allows you to recover +from most operations that materially affect you work. +Calling @emph{Undo()} without any parameter recovers +from the last (non-undo) operation. @emph{ClearList} is used to release the +allocated memory. @emph{ClearList} is called whenever a new layout is started +or loaded. See also @emph{Redo}. +Default: +@example +Noneu: Undo() +!Shift Ctrlu: Undo(ClearList) +@end example + +@findex UnloadVendor() +@cindex vendor map, unloading +@cindex vendor drill table, unloading +@item UnloadVendor() +Unloads the loaded vendor drill table. +@example +UnloadVendor() +@end example + +@findex Unselect() +@cindex selection +@cindex unselect objects +@item Unselect(All|Block|Connection) +Unselects all visible objects, all inside a rectangle or all objects which +have been found during the last connection scan. +Default: +@example +!Shift : Mode(Save) Mode(None) Unselect(Block) +!Shift : Unselect(Block) Mode(Restore) +@end example + +@end table + + +@node Translations +@section Default Translations +@cindex translations +@cindex default translations +@cindex X11 default translations + +This section covers some default translations of key and button events as +defined in the shipped default application resource file. Most of them have +already been listed in @ref{Actions}. @pcb{} makes use of a nice @code{X11} +feature; calling several action routines for one event. + +@table @samp + +@cindex removing objects +@cindex removing connections +@cindex object, removing an +@cindex connection, removing an +@item NoneBackSpace: +@item NoneDelete: +@itemx !ShiftBackSpace: +@itemx !Shift Ctrl: +The object at the cursor location is removed by @emph{NoneBackSpace} or +@emph{Shift Ctrl} whereas @emph{ShiftBackSpace} also removes +all other objects that are fully-connected to the one at the cursor location. + +@cindex scrolling +@item !Mod1 CtrlLeft: +@itemx !Mod1 CtrlRight: +@itemx !Mod1 CtrlUp: +@itemx !Mod1 CtrlDown: +Scroll one page in one of the four directions. + +@cindex scrolling +@item NoneLeft:, !ShiftLeft: +@itemx NoneRight:, !ShiftRight: +@itemx NoneUp:, !ShiftUp: +@itemx NoneDown:, !ShiftDown: +Move cross hair either one or ten points in grid. + +@cindex user input +@item NoneReturn: +Finished user input, selects the 'default' button of dialogs. + +@cindex user input +@item NoneEscape: +@emph{Mode(Reset)}, aborts user input, selects the 'abort' button of +dialogs or resets all modes. + +@cindex element, move name of +@cindex object, move an +@cindex object, copy an +@cindex move an object +@cindex copy an object +@item None, Btn2, None: +@itemx !Mod1, Btn2, !Mod1: +The first sequence moves the object or element name at the cursor location. +The second one copies the objects. Copying isn't available for +element names. + +@end table + + +@c --------------------------- chapter 6 ------------------------------- +@node File Formats +@chapter File Formats +@cindex file formats +@cindex ASCII files, format of + +All files used by @pcb{} are read from the standard output of a command +or written to the standard input of one as plain seven bit @code{ASCII}. This +makes it possible to use any editor to change the contents of a layout file. +It is the only way for element or font description files to be created. +To do so you'll need to study the example files @file{example/*} and +@file{default_font} which are shipped with @pcb{}. +For an overview refer to @ref{Intro}. + +@vindex elementCommand +@vindex fileCommand +@vindex fontCommand +@vindex libraryCommand +@vindex libraryContentsCommand +@vindex saveCommand +The following sections provide the necessary information about the syntax of +the files. +Netlist files are not created by @pcb{}, but it does use them. For information +on the format of a netlist file see the @emph{:rn}, +@ref{User Commands}. +The commands described allow you to add almost any additional +functionality you may need. Examples are compressed read and write access as +well as archives. The commands themselves are defined by the resources +@emph{elementCommand}, @emph{fileCommand}, @emph{fontCommand}, +@emph{libraryCommand}, @emph{libraryContentsCommand} and @emph{saveCommand}. +Note that the commands are not saved along with the data. +It is considered an advantage to have the layout file contain all necessary +information, independent of any other files. + +One thing common to all files is they may include comments, newlines, +and carriage returns at any place except within quoted strings. + +@menu +* Pad and Line Representation:: +* Layout File:: +* Element File:: +* Font File:: +* Netlist File:: +* Library Contents File:: +* Library File:: +* File Syntax:: +* Object Flags:: +* PCBFlags:: +@end menu + + + +@node Pad and Line Representation +@section Pad and Line Representation +@cindex pad specification +@cindex file formats, pads and lines + +Pads and lines (copper traces, silk screen lines, etc) are represented by the +line end points and the aperture used to draw the line. It is important to +understand this when creating the pads for a new footprint. The following figure +illustrates a pad or line which is drawn using a square aperture. The end +points (X0,Y0), (X1,Y1) specify the center of the aperture. The size parameter +specifies the size of the aperture. + +@center @image{pad,,,Pad Layout,png} + +Pads and lines are represented in this way because this is how lines are +specified in RS-274X (Gerber) files which are used for creating +the masks used in board manufacturing. In fact, older mask making +equipment created lines in precisely this fashion. A physical aperture was +used to pass light through onto a photosensitive film. + +@node Layout File +@section Layout File Format +@cindex layout files, format of +@cindex format of layout files +@cindex file format, layout data + +The layout file describes a complete layout including symbols, vias, +elements and layers with lines, rectangles and text. This is the most +complex file of all. As @pcb{} has evolved, the file format has +changed several times to accommodate new features. @pcb{} has +always been able to read all older versions of the @code{.pcb} file. +This allows the migration of older designs to newer versions of the +program. Obviously older versions of @pcb{} will not be able +to properly read layout files stored in newer versions of the file +format. + +In practice it is very common for footprint libraries to contain +elements which have been defined in various versions of the @pcb{} +file format. When faced with trying to understand an element file or +layout file which includes syntax not defined here, the best approach +is to examine the file @file{src/parse_y.y} which is the definitive +definition of the file format. + +The PCB layout file contains the following contents, in this order (individual items +are defined in @ref{File Syntax}: + +@table @code + +@item PCB +This names the board and sets its size + +@item Grid +Optional. + +@item Cursor +Optional. + +@item Flags +Optional. + +@item Groups +Optional. + +@item Styles +Optional. + +@item Symbols +Optional. + +@item Vias, Rats, Layers, and Elements +These may occur in any order, at this point in the file. + +@item Netlists +Optional. + +@end table + +@node Element File +@section Element File Format +@cindex element, file format +@cindex format of element files +@cindex file format, element data + +Element files are used to describe one component which then may be used +several times within one or more layouts. You will normally split the +file into two parts, one for the pinout and one for the package description. +Using @code{m4} allows you to define pin names as macros in one file and +include a package description file which evaluates the macros. See +the resource @emph{elementCommand} for more information. The pins (and pads) +must appear in sequential order in the element file (new in 1.5) so that +pin 1 must be the first PIN(...) in the file. + +Doing things this way makes it possible to use one package file for several +different circuits. See the sample files @file{dil*}. + +The lowest x and y coordinates of all sub-objects of an element are +used as an attachment point for the cross hair cursor of the main +window, unless the element has a mark, in which case that's the +attachment point. + + + +@node Font File +@section Font File Format +@cindex font file, format of +@cindex format of font files +@cindex file format, font data + +A number of user defined Symbols are called a font. There is only one per +layout. All symbols are made of lines. See the file @file{default_font} +as an example. + +The lowest x and y coordinates of all lines of a font are transformed to (0,0). + +@node Netlist File +@section Netlist File Format +@cindex netlist, file format +@cindex netlist, reading + +Netlists read by @pcb{} must have this simple text form: + +@example +netname [style] NAME-PINNUM NAME2-PINNUM2 NAME3-PINNUM3 ... [\] +@end example + +@noindent +for each net on the layout. +where "netname" is the name of the net which must be unique for each +net, [style] is an optional route-style name, +NAME is the layout-name name given to an element, +and PINNUM is the (usually numeric) +pin number of the element that connects to the net +(for details on pin numbering see @ref{Element Objects}). +Spaces or tabs separate the fields. +If the line ends with a "\" the +net continues on the next line and the "\" is treated exactly as if it +were a space. If a NAME ends with a lower-case letter, +all lower-case letters are stripped from the end of the NAME to determine the +matching layout-name name. For example: + +@example + Data U1-3 U2abc-4 FLOP1a-7 Uabc3-A9 +@end example + +specifies that the net called "Data" should have +pin 3 of U1 connected to pin 4 of U2, to pin 7 of +FLOP1 and to pin A9 of Uabc3. Note that element name and +pin number strings are case-sensitive. +It is up to you to name the elements so that their layout-name names +agrees with the netlist. + +@node Library Contents File +@section Library Contents File Format +@cindex library contents file, format of +@cindex format of library contents +@cindex file format, library contents + +There is nothing like a special library format. The ones that have been +introduced in 1.4.1 just use some nice (and time consuming) features of GNU +@code{m4}. The only predefined format is the one of the contents file +which is read during startup. It is made up of two basic line types: + +@example +menu entry = "TYPE="name +contents line = template":"package":"value":"description +name = String +template = String +package = String +value = String +description = String +String = +@end example + +No leading white spaces or comments are allowed in this file. If you need +either one, define a command that removes them before loading. Have a look +to the @emph{libraryContentsCommand} resource. + +The menu entry will appear in the selection menu at the top and of the +library window. + +@node Library File +@section Library File Format +@cindex library file, format of +@cindex format of libraries +@cindex file format, libraries + +This section provides an overview about the existing @code{m4} definitions +of the elements. There are basically two different types of files. One +to define element specific data like the pinout, package and so on, the +other to define the values. For example the static RAM circuits 43256 and +62256 are very similar. They therefore share a common definition in the +macro file but are defined with two different value labels. + +The macro file entry: +@example +define(`Description_43256_dil', `SRAM 32Kx8') +define(`Param1_43256_dil', 28) +define(`Param2_43256_dil', 600) +define(`PinList_43256_dil', ``pin1', `pin2', ...') +@end example + +And the list file: +@example +43256_dil:N:43256:62256 +@end example + +The macro must define a description, the pin list and up to two additional +parameters that are passed to the package definitions. The first one is +the number of pins whereas the second one defines for example the width +of a package. + +It is very important to select a unique identifier for each macro. In +the example this would be @emph{43256_dil} which is also the templates name. +It is required by some low-level macros that +@emph{Description_, Param1_, Param2_} and @emph{PinList_} are perpended. + +The list file uses a syntax: +@example +template:package:value[:more values] +@end example + +This means that the shown example will create two element entries with the +same package and pinout but with different names. + +A number of packages are defined in @file{common.m4}. Included are: + +@example +DIL packages with suffix D, DW, J, JD, JG, N, NT, P +PLCC +TO3 +generic connectors +DIN 41.612 connectors +zick-zack (SD suffix) +15 pin multiwatt +@end example + +If you are going to start your own library please take care about @code{m4} +functions. Be aware of quoting and so on and, most important check your +additional entry by calling the macro: + +@example +CreateObject(`template', `value', `package suffix') +@end example + +If quoting is incorrect an endless loop may occur (broken by a out-of-memory +message). + +The scripts in the @file{lib} directory handle the creation of libraries +as well as of their contents files. Querying is also supported. + +I know quite well that this description of the library implementation is +not what some out there expect. But in my opinion it's much more useful to +look at the comments and follow the macros step by step. + +@node File Syntax +@section File Syntax +@cindex File sytax +@cindex Syntax, file + +@include pcbfile.texi + +@c --------------------------- chapter 7 ------------------------------- +@node Library Creation +@chapter Library Creation +@cindex library creation + +This chapter provides a detailed look at how footprint libraries are +created and used. The chapter is split into two section, the first +section covers the "old" style libraries which use the @code{m4} macro +processor and the second section covers the "new" style libraries. + +Despite the names "old" and "new", both styles of libraries are useful +and the "old" style should not be discounted because of its name. The +advantage of the old style libraries is that one can define a family of +footprints, say a DIP package, and then quickly produce all the members +of that family. Because the individual packages make use of a base +definition, corrections made to the base definition propagate to all the +members of a family. The primary drawback to using this library +approach is that the effort to create a single footprint is more than a +graphical interface and may take even longer if the user has not used +the @code{m4} macro language previously. + +The new style of footprint libraries stores each footprint in its own +file. The footprints are created graphically by placing pads and then +converting a group of pads to a component. This library method has the +advantage of being quick to learn and it is easily to build single +footprints quickly. If you are building a family of parts, however, the +additional effort in creating each one individually makes this approach +undesirable. In addition, creating a part with a large pin count +can be quite tedious when done by hand. + + +@section Old Style (m4) Libraries +The old style libraries for pcb use the @code{m4} macro processor to +allow the definition of a family of parts. There are several files +associated with the old style library. The file @file{common.m4} is the +top level file associated with the library. @file{common.m4} defines a +few utility macros which are used by other portions of the library, +and then includes a predefined set of library files (the lines like +@code{include(geda.inc)}). + +@subsection Overview of Oldlib Operation +The big picture view of the old style library system is that the library +is simply a collection of macro definitions. The macros are written in +the @code{m4} macro language. An example of a macro and what it expands +to is the following. One of the predefined footprints in the library +which comes with PCB is the @code{PKG_SO8} macro. Note that all the +footprint macros begin with @code{PKG_}. For this particular example, +@code{PKG_SO8} is a macro for an 8-pin small outline surface mount +package. All of the footprint macros take 3 arguments. The first is the +canonical name of the footprint on the board. In this case "SO8" is an +appropriate name. The second argument is the reference designator on +the board such as "U1" or "U23". The third and final argument is the +value. For an integrated circuit this is usually the part number such +as "MAX4107" or "78L05" and for a component such as a resistor or +capacitor it is the resistance or capacitance. The complete call to the +macro in our example is @samp{PKG_SO8(SO8, U1, MAX4107)}. When +processed by @code{m4} using the macros defined in the PCB library, this +macro expands to +@example +Element(0x00 "SO8" "U1" "MAX4107" 146 50 3 100 0x00) +( + Pad(10 25 38 25 20 "1" 0x00) + Pad(10 75 38 75 20 "2" 0x100) + Pad(10 125 38 125 20 "3" 0x100) + Pad(10 175 38 175 20 "4" 0x100) + Pad(214 175 242 175 20 "5" 0x100) + Pad(214 125 242 125 20 "6" 0x100) + Pad(214 75 242 75 20 "7" 0x100) + Pad(214 25 242 25 20 "8" 0x100) + ElementLine(0 0 151 0 10) + ElementArc(126 0 25 25 0 180 10) + ElementLine(101 0 252 0 10) + ElementLine(252 0 252 200 10) + ElementLine(252 200 0 200 10) + ElementLine(0 200 0 0 10) + Mark(29 25) +) +@end example +which is the actual definition of the footprint that the PCB program +works with. As a user of PCB the only time you will need or want to run +@code{m4} directly is when you are debugging a new library addition. In +normal operation, the calls to @code{m4} are made by helper scripts that +come with PCB. + +Tools such as @code{gsch2pcb} (used to interface the gEDA schematic +capture program to PCB layout) will call @code{m4} to produce an initial +PCB layout that includes all the components on a schematic. In +addition, when manually instantiating parts from within PCB, @code{m4} +will be called by PCB's helper scripts to produce the footprints. + +@subsection The Library Scripts +There are several scripts that are used for processing the m4 +libraries. This section briefly describes these scripts and details how +they are used by PCB. + +@subsubsection Scripts Used During Compilation +The scripts described in this section are used during compilation of +PCB. They are run automatically by the build system, but are described +here to help document the complete library processing that occurs. +During the build of PCB, the following actions are taken. The +@code{CreateLibrary.sh} script is run to produce an M4 "frozen file". +This frozen file is simply a partially processed M4 input file which can +be loaded by M4 more quickly than the original input file. + +A typical call to @code{CreateLibrary.sh} used during the compilation of +PCB is: +@example +./CreateLibrary.sh -I . pcblib ./common.m4 TTL_74xx_DIL.m4 +connector.m4 crystal.m4 generic.m4 genericsmt.m4 gtag.m4 +jerry.m4 linear.m4 logic.m4 lsi.m4 memory.m4 optical.m4 pci.m4 +resistor_0.25W.m4 resistor_adjust.m4 resistor_array.m4 +texas_inst_amplifier.m4 texas_inst_voltage_reg.m4 +transistor.m4 geda.m4 +@end example +The @samp{-I .} says to search in the current directory for the +@file{.m4} files. The output frozen file is @file{pcblib}. The main +@file{common.m4} file is listed as well as all of the @file{*.m4} files +which define the components in the library. + +In addition, a library contents file is created during the build with +the @code{CreateLibraryContents.sh} script. +A typical call to @code{CreateLibrary.sh} used during the compilation of +PCB is: +@example +./CreateLibraryContents.sh -I . ./common.m4 TTL_74xx_DIL.list +connector.list crystal.list generic.list genericsmt.list gtag.list +jerry.list linear.list logic.list lsi.list memory.list optical.list +pci.list resistor_0.25W.list resistor_adjust.list resistor_array.list +texas_inst_amplifier.list texas_inst_voltage_reg.list transistor.list +geda.list > pcblib.contents +@end example + +The @file{pcblib.contents} file is used by the PCB program to define the +libraries and components which will be displayed when you bring up +the library window from within PCB. An example of part of the +@file{pcblib.contents} file is: +@example +TYPE=~TTL 74xx DIL +7400_dil:N:7400:4 dual-NAND +7401_dil:N:7401:4 dual-NAND OC +7402_dil:N:7402:4 dual-NOR +TYPE=~geda +geda_DIP6:DIP6:DIP6:Dual in-line package, narrow (300 mil) +geda_DIP8:DIP8:DIP8:Dual in-line package, narrow (300 mil) +geda_DIP14:DIP14:DIP14:Dual in-line package, narrow (300 mil) +geda_ACY300:ACY300:ACY300:Axial non-polar component, +@end example +The @code{TYPE=} lines define the library name that will show up in the +library window in PCB. The other lines define the actual components in +the library. + +@subsubsection Scripts Used by PCB at Runtime +When PCB is first executed, it makes a call to the +@code{ListLibraryContents.sh} script. This script provides the PCB +program with the contents of the library contents file created when PCB +was compiled. A typical call to @code{ListLibraryContents.sh} is +@example +../lib/ListLibraryContents.sh .:/tmp/pcb-20030903/src/../lib pcblib +@end example +This command says to search the path +@samp{.:/tmp/pcb-20030903/src/../lib} for a file called +@file{pcblib.contents} (the @file{.contents} part is added +automatically) and display the contents of the file. +PCB parses this output and generates the library window entries. + +When you pick a library component from the library window, PCB calls the +@code{QueryLibrary.sh} script to actually pull the footprint into the +layout. For example, when the ACY300 component is selected from the +@code{~geda} library, the generated call may be: + +@example +/tmp/pcb-20030903/src/../lib/QueryLibrary.sh +.:/tmp/pcb-20030903/src/../lib pcblib geda_ACY300 ACY300 +ACY300 +@end example +If you were to run this command by hand you would see the PCB code for +the element: +@example +Element(0x00 "Axial non-polar component," "" "ACY300" 245 70 0 100 0x00) +( + Pin(0 25 50 20 "1" 0x101) + Pin(300 25 50 20 "2" 0x01) + + ElementLine(0 25 75 25 10) + ElementLine(225 25 300 25 10) + + ElementLine(75 0 225 0 10) + ElementLine(225 0 225 50 10) + ElementLine(225 50 75 50 10) + ElementLine(75 50 75 0 10) + +# ElementArc(X1 Y 50 50 270 180 10) +# ElementArc(X2 Y 50 50 90 180 10) + + Mark(75 25) +) +@end example + +@subsection Creating an Oldlib Footprint +This section provides a complete example of defining a family of +footprints using the M4 style library. As a vehicle for this example, a +family of footprints for surface mount resistors and capacitors will be +developed. The file @file{example.inc} should have been installed on +your system as @file{$prefix/share/examples/oldlib/example.inc} where +@file{$prefix} is often times @file{/usr/local}. + +The @file{example.inc} file defines a macro called +@code{COMMON_PKG_RCSMT} which is a generic definition for a surface +mount footprint with two identical, rectangular pads. This macro will +be called with different parameters to fill out the family of parts. +The arguments to the @code{COMMON_PKG_RCSMT} are: +@example +# ------------------------------------------------------------------- +# the definition for surface mount resistors and capacitors +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pad width (in direction perpendicular to part) +# $5: pad length (in direction parallel with part) +# $6: pad spacing (center to center) +# $7: distance from edge of pad to silk (in direction +# perpendicular to part) +# $8: distance from edge of pad to silk (in direction parallel +# with part) +# $9: Set to "no" to skip silk screen on the sides of the part +@end example + +@example +define(`COMMON_PKG_RCSMT', + `define(`XMIN', `eval( -1*`$6'/2 - `$5'/2 - `$8')') + define(`XMAX', `eval( `$6'/2 + `$5'/2 + `$8')') + define(`YMIN', `eval(-1*`$4'/2 - `$7')') + define(`YMAX', `eval( `$4'/2 + `$7')') +Element(0x00 "$1" "$2" "$3" eval(XMIN+20) eval(YMAX+20) 0 100 0x00) +( + ifelse(0, eval($4>$5), + # Pads which have the perpendicular pad dimension less + # than or equal to the parallel pad dimension + Pad(eval(-1*( $6 + $5 - $4)/2) 0 + eval((-1*$6 + $5 - $4)/2) 0 eval($4) "1" 0x100) + Pad(eval(-1*(-1*$6 + $5 - $4)/2) 0 + eval(( $6 + $5 - $4)/2) 0 eval($4) "2" 0x100) + , + # Pads which have the perpendicular pad dimension greater + # than or equal to the parallel pad dimension + Pad(eval(-1*$6/2) eval(-1*($4 - $5)/2) + eval(-1*$6/2) eval(($4 - $5)/2) eval($5) "1" 0x100) + Pad(eval( $6/2) eval(-1*($4 - $5)/2) + eval( $6/2) eval(($4 - $5)/2) eval($5) "2" 0x100) + ) + + # silk screen + # ends + ElementLine(XMIN YMIN XMIN YMAX 10) + ElementLine(XMAX YMAX XMAX YMIN 10) + # sides +ifelse($9,"no", + #skip side silk + , + ElementLine(XMIN YMIN XMAX YMIN 10) + ElementLine(XMAX YMAX XMIN YMAX 10) +) + Mark(0 0) +)') +@end example +Note that the part has been defined with the mark located at +@code{(0,0)} and that the pads have been placed with the mark at the +common centroid of the footprint. While not a requirement, this is +highly desirable when developing a library that will need to interface +with a pick and place machine used for factory assembly of a board. + +The final part of @file{example.inc} defines particular versions of the +generic footprint we have created. These particular versions correspond +to various industry standard package sizes. +@example +# 0402 package +# +# 30x30 mil pad, 15 mil metal-metal spacing=> +# 15 + 15 + 15 = 45 center-to-center +define(`PKG_RC0402', + `COMMON_PKG_RCSMT(`$1', `$2', `$3', 30, 30, 45, 0, 10, "no")') + +# 0603 package +# +# 40x40 mil pad, 30 mil metal-metal spacing=> +# 30 + 20 + 20 = 70 center-to-center +define(`PKG_RC0603', + `COMMON_PKG_RCSMT(`$1', `$2', `$3', 40, 40, 70, 10, 10)') + +# 1206 package +# +# 40x60 mil pad, 90 mil metal-metal spacing=> +# 90 + 20 + 20 = 130 center-to-center +define(`PKG_RC1206', + `COMMON_PKG_RCSMT(`$1', `$2', `$3', 60, 40, 130, 10, 10)') +@end example + +At this point, the @file{example.inc} file could be used by third party +tools such as @code{gsch2pcb}. However to fully integrate our +footprints into PCB we need to create the @file{example.m4} and +@file{example.list} files. The @file{example.m4} file defines +descriptions for the new footprints. +@example +define(`Description_my_RC0402', + ``Standard SMT resistor/capacitor (0402)'') +define(`Description_my_RC0603', + ``Standard SMT resistor/capacitor (0603)'') +define(`Description_my_RC1206', + ``Standard SMT resistor/capacitor (1206)'') +@end example +Finally we need to create the @file{example.list} file. +@example +my_RC0402:RC0402:RES0402 +my_RC0402:RC0402:CAP0402 +my_RC0603:RC0603:RES0603 +my_RC0603:RC0603:CAP0603 +my_RC1206:RC1206:RES1206 +my_RC1206:RC1206:CAP1206 +@end example +The first field in the list file has the name corresponding to the +Description definitions in @file{example.m4}. The second field is the +template name which corresponds to the macros @code{PKG_*} we defined in +@file{example.inc} with the leading @code{PKG_} removed. It is the +second field which controls what footprint will actually appear on the +board. The final +field is the name of the part type on the board. The first line in our +@file{example.list} file will produce a menu entry in the library window +that reads: +@example +CAP0402, Standard SMT resistor/capacitor (0402) +@end example +The @code{CAP0402} portion comes directly from the third field in +@code{example.list} and the longer description comes from descriptions +macros in @code{example.m4}. Please note that any extra white space +at the end of a line in the @file{.list} files will cause them to +not work properly. + +@subsection Troubleshooting Old Style Libraries + +A powerful technique to help debug problems with libraries is to invoke +the @code{m4} processor directly. This approach will provide error +output which is not visible from within PCB. The following example +shows how one might try to debug an 8 pin small outline (SO8) package. The +macro name for the package is PKG_SO8. In this example, the +canonical name that is to be associated with the part is SO8, the +reference designator is U1, and the value is MAX4107 (the part number). + +@example +echo "PKG_SO8(SO8, U1, MAX4107)" | \ + gm4 common.m4 - | \ + awk '/^[ \t]*$/ @{next@} @{print@}' | \ + more +@end example +The @code{awk} call simply removes blank lines which make the output +hard to read. + +For this particular example, the output is: +@example +Element(0x00 "SO8" "U1" "MAX4107" 146 50 3 100 0x00) +( + Pad(10 25 38 25 20 "1" 0x00) + Pad(10 75 38 75 20 "2" 0x100) + Pad(10 125 38 125 20 "3" 0x100) + Pad(10 175 38 175 20 "4" 0x100) + Pad(214 175 242 175 20 "5" 0x100) + Pad(214 125 242 125 20 "6" 0x100) + Pad(214 75 242 75 20 "7" 0x100) + Pad(214 25 242 25 20 "8" 0x100) + ElementLine(0 0 151 0 10) + ElementArc(126 0 25 25 0 180 10) + ElementLine(101 0 252 0 10) + ElementLine(252 0 252 200 10) + ElementLine(252 200 0 200 10) + ElementLine(0 200 0 0 10) + Mark(29 25) +) +@end example + +@section New Style Libraries +Footprints for the new style library are created graphically using the +PCB program. A single footprint is saved in each file. + +@subsection Creating Newlib Footprints +To create +@enumerate +@item Start PCB with an empty layout. +@item Make the component layer active. +@item For a leaded part, select the via tool and place vias where the +pads for the part should go. For surface mount pads, draw line +segments. Note that until the footprint is completed, the surface +mount pads will remain rounded. Currently a rectangle or polygon +may not be used as a pad. +@item For each via and line segment which will become a pad, select it +and press 'n' to be able to enter a name. Enter +the pin number and press enter. +@item Make the silk layer active. +@item Using the line and arc tools, draw a silk screen outline for the +part. +@item Using the selection tool, select all of the pins and silk screen +for the part. +@item Place the pointer above the reference point for the part. This is +typically the common centroid. Keeping the pointer there, shift-right-click +to bring up the popup menu and choose "convert +selection to element". +@item At this point, the vias, line segments, and silk screen will have +been converted to an element. To change any of the line segments to +have square ends rather than round ends, select the pads by holding +down the shift key and clicking each pad with the center mouse button. +Now under the Select menu, "Change square-flag of selected objects" +section, choose "Pins". +@item Select the element, shift-right-click to bring up the popup menu, and +choose "Copy Selection to Buffer". Now left-click on the center of +the new element. +@item Under the buffer menu, choose "save buffer elements to file" to +save the new footprint to a file. +@item Press ESC to exit from buffer mode. +@end enumerate + +@subsection Modifying Newlib Footprints +@enumerate +@item In the @pcb{} program, instantiate the footprint you wish to modify. +@item Using the selection tool, select the footprint. +@item Now left-click on the selected element, this brings up a popup menu, choose +"Cut Selection to Buffer" from the popup menu. +@item Under the buffer menu, choose "break buffer element to pieces", +and then left-click to place the broken apart footprint to an open area of +the layout. Note that you must use the items under the buffer menu, the +items with the same names in the popup menu do not work. +@item Make your desired modifications to the footprint and then convert +the pieces back to an element using the same procedure as when starting +from scratch on a new footprint. +@end enumerate + + +@c --------------------------- chapter 8 ------------------------------- +@node Schematic Frontends +@chapter Schematic Capture for PCB +@cindex schematic capture +@cindex schematic frontend + +When designing a circuit board of any complexity, a schematic capture +front-end for the design is highly desired. Any schematic capture +program which is able to generate a netlist in a user defined format as +well as a bill of materials can be made to work with PCB. Currently, we +are aware of two freely available schematic capture programs which can +interface with PCB. This chapter shows how a design can be taken from +start to finish using either of these two tools for schematic capture +and PCB for layout. + +@menu +* gEDA:: Interfacing with GNU EDA (gEDA). +* xcircuit:: Interfacing with xcircuit. +@end menu + +@node gEDA +@section gEDA +@cindex gschem, how to interface with +@cindex gEDA, how to interface with + +This section shows how to use gEDA as the schematic capture front-end for +a PCB design. This section is not intended to be complete documentation +on gEDA and it is assumed that the user has at least some familiarity +with the gEDA suite of programs. + +The basic steps in a gEDA + PCB design flow are: +@enumerate +@item Set up project directories +@item Set up gEDA (gschem/gnetlist) config files +@item Set up gsch2pcb config files +@item Capture schematics using @code{gschem} (part of gEDA) +@item Create any unique PCB footprints needed for the design +@item Generate initial PCB design using @code{gsch2pcb} (part of gEDA) +@item Layout circuit board using @code{pcb} +@item Make any additional schematic changes with @code{gschem} and +forward annotate to PCB with @code{gsch2pcb} +@item Generate photoplot files (RS-274X, also known as "Gerber") for +board vendor +@end enumerate + +@subsection Set Up Project Directories +Although not required, a typical project directory will contain the +schematics and board layout at the top level. +Schematic symbols and circuit board footprints which are unique to this +project are stored in subdirectories. For this example, @file{sym} +contains the project specific schematic symbols and @file{pkg} contains +the project specific footprints. Set up the project subdirectory and +subdirectories by executing: +@example +mkdir ~/myproj +cd ~/myproj +mkdir sym +mkdir pkg +mkdir pkg/newlib +mkdir pkg/m4 +@end example + +@subsection Set Up gEDA Config Files +The gEDA tools, specifically @code{gschem} and @code{gnetlist}, use +configuration files to set the search path for symbol libraries in +addition to other user preferences. Create a file in the top level +project directory called @file{gschemrc}. Add the following lines to +that file: +@example + +;; list libraries here. Order matters as it sets the +;; search order +(component-library "./sym") + +@end example +This sets the local search path for the schematic capture program +@code{gschem}. Now the netlister, @code{gnetlist}, must also be +configured. This can be done by copying the file @file{gschemrc} to +@file{gnetlistrc} by running @samp{cp gschemrc gnetlistrc}. +Alternatively, you can create a soft link so only a single file needs to +be updated if additional symbol paths are added. The link is created by +running @samp{ln -s gschemrc gnetlistrc}. + +@subsection Set Up @code{gsch2pcb} Config Files +The program @code{gsch2pcb}, not to be confused with the older +@code{gschem2pcb} script, is used to link the schematic to layout. +@code{gsch2pcb} is responsible for creating the netlist used to provide +connectivity information to PCB as well creating an initial layout with +all components instantiated in the design. Forward annotation of +schematic changes to the layout is also done using @code{gsch2pcb}. +@code{gsch2pcb} uses a project file to set up the schematic file names, +PCB library locations, and output file names. Create a project file +called @file{project} using the following as an example: +@example + +# List all the schematics to be netlisted +# and laid out on the pc board. +schematics first.sch second.sch third.sch + +# For an output-name of foo, gsch2pcb generates files +# foo.net, foo.pcb, and foo.new.pcb. If there is no +# output-name specified, the file names are derived from +# the first listed schematic, i.e. first.net, etc. +output-name preamp + +@end example + + +@subsection Capture Schematics Using @code{gschem} +This section is fairly brief and assumes familiarity with using the +@code{gschem} schematic capture program. As you are creating your +schematics, be sure to observe the following rules: +@itemize +@item Make sure that each component in the schematic has a +@code{footprint} attribute that corresponds to a footprint in the PCB +library or a footprint you plan on creating. +@item Make sure all reference designators are unique. One way to ensure +this is to run the @code{refdes_renum} script (part of gEDA) after the +schematics are created. +@end itemize + +@subsection Create Any Unique PCB Footprints +Create the new footprints you design needs using either the m4 style or +newlib style of PCB libraries. Refer to @ref{Library Creation} for details on this +process. For m4 style footprints, store them in the @file{pkg/m4} +subdirectory and for newlib footprints, store them in the +@file{pkg/newlib} subdirectory. + +@subsection Generate Initial PCB Design Using @code{gsch2pcb} +The @code{gsch2pcb} program connects the schematic and layout. It basic +operation is to call @code{gnetlist} to generate the connectivity +netlist that PCB used to verify connectivity and to instantiate all +elements found in the schematic to a new layout. +The default, as of @code{gsch2pcb} version 0.9, is to use any found m4 +style parts first and then search for newlib style if no old style part +was found. By using the @code{--use-files} or @code{-f} flag to @code{gsch2pcb} +priority is given to newlib style parts even if m4 style are found. You +may wish to verify this in the @code{gsch2pcb} documentation in case +this changes in the future. +To start your layout, +run @samp{gsch2pcb project} where @file{project} is the project file +created previously. This will create a new netlist file, +@file{preamp.net}, and a new layout file, @file{preamp.pcb}. + + +@subsection Layout Circuit Board +Run PCB on the new layout by running @samp{pcb preamp.pcb}. +Load the netlist file by selecting "load netlist file" from the "file" +menu. In the file selection dialog box, choose @file{preamp.net}. This +loads connectivity information into PCB. + +Using the selection tool, grab and move apart the various footprints +with the middle mouse button. Once the parts are moved apart from each +other, choose "optimize rats-nest" from the "Connects" menu. This menu +choice will display and optimize the rats nest. Use the rats nest to +help guide placement of the parts. You may wish to re-run the "optimize +rats-nest" command after moving parts around. + +After the placement is complete, use the line tool to add traces to the +board. As traces are added, the corresponding rats line will disappear. + +@subsection Forward Annotation of Schematic Changes +If schematic changes are made after the layout has started, +@code{gsch2pcb} can be used to forward annotate these changes to the +layout. To forward annotate schematic changes, run @samp{gsch2pcb +project}. This command will create the files @file{preamp.new.pcb}, +@file{preamp.net}, and modify the file @file{preamp.pcb}. The +modifications to @file{preamp.pcb} include forward annotation of +schematic component value changes, adds any new components, and removes +any deleted components. + +@subsection Generate Photoplot Files (RS-274X) +After the layout is complete, choose "edit layer-groupings" from the +"Settings" menu. The LayerGroups form lets you specify which layers +will appear in each output layer group. For example, in the default +form, layer group 1 has "front" and "front side" in it. The +output file @file{1.gbr} if DOS file names are used, or +@file{somename_front.gbr} if long file names are used will contain the +"front" and "front side" layers in it. Usually the defaults are +sufficient, but this form is still a useful reference. + +Choose "print layout..." from the "File" menu. In the print dialog box, +select "Gerber/RS-274X" for the device +driver. Select the "outline", "alignment", and "drillhelper" options. +To get DOS compatible file names, select the "DOS (8.3) names" option, +otherwise enter "preamp" for the filename. Press "OK". + +The following output files should have been created in the project directory. +The names in parentheses correspond to the DOS compatible output file names. +@table @file +@item preamp_frontsilk.gbr (csilk.gbr) +Top side silk screen. +@item preamp_frontmask.gbr (cmask.gbr) +Top side soldermask relief. +@item preamp_front.gbr (1.gbr) +Top copper. +@item preamp_backmask.gbr (smask.gbr) +Bottom side soldermask relief. +@item preamp_back.gbr (2.gbr) +Bottom Copper. +@item preamp_fab.gbr (fab.gbr) +Fabrication drawing. Also known as the drill drawing. This drawing is +used for reference by the board vendor but is not directly used in the +fabrication process. +@item preamp_plated-drill.cnc (pdrill.cnc) +NC Drill format file for the plated through holes. +@item preamp_unplated-drill.cnc (udrill.cnc) +NC Drill format file for the unplated through holes. +@item preamp_bom.txt (bom.txt) +A bill of materials for the layout. +@item preamp_xy.txt (xy.txt) +Centroid (X-Y) data for driving automated assembly equipment. +@end table + +@comment to include an image: +@comment @image{geda1, 6in, 4in, geda schematic, png} + +@node xcircuit +@section xcircuit +@cindex xcircuit, how to interface with +@cindex xcircuit, how to interface with + +If anyone cares to contribute this section, it will get added. Please +submit changes to the bug tracking system for PCB which can be found from +the PCB homepage at @url{http://pcb.gpleda.org}. + +@c --------------------------- Appendix A ------------------------------- + +@node Installation +@appendix Installation and Troubleshooting + +Compiling and installing the package should be straightforward. If any problems +occur, please contact the author @email{Thomas.Nau@@rz.uni-ulm.de}, or the +current maintainer @email{haceaton@@aplcomm.jhuapl.edu} to find +a solution and include it into the next release. + +@menu +* compiling:: Compiling and installing. +* problems:: Troubleshooting. +@end menu + + +@node compiling +@section Compiling and Installing +@cindex install, how to +@cindex compile, how to + +This section covers the steps which are necessary to compile the package. + +@menu +* quickstart:: Quick start. +* running configure:: Customizing Pcb with Configure +@end menu + +@node quickstart +@subsection Quick Start +@cindex GNU build system + +Starting with version 2.0, @pcb{} has switched to a GNU +autoconf/automake build system. Installation of @pcb{} consists of +three steps: configuration, building, and installing. +In a typical installation, these steps are as simple as +@example +./configure +make +make install +@end example + +@node running configure +@subsection Running the configure Script +@cindex GNU configure script +@cindex configure + +The @code{configure} script accepts all of the standard GNU configure +options. For a complete list of configuration options, run +@code{./configure --help}. + + +@table @samp +@vindex INFOLIBDIR +@item INFOLIBDIR +must be set to the directory where your GNU info files are located. + +@vindex PCBLIBDIR +@item PCBLIBDIR +is the path of a directory where the font files will be installed. + +@vindex DEFAULTFONT +@item DEFAULTFONT +the name of the default font file. + +@vindex DEFAULTLIBRARY +@item DEFAULTLIBRARY +the name of the default library. + +@vindex GNUM4 +@item GNUM4 +the name of GNUs m4 version. + +@vindex BTNMOD +@item BTNMOD +If your window manager has already bound @emph{Mod1} together with some +function keys you may want to change this setting. This is true for HP-VUE. + + +@end table + +If you find things which must be changed to compile on your system, +please add the appropriate autoconf tests (if you are familiar with +that) and mail a copy to the maintainer, harry eaton, at +@email{haceaton@@aplcomm.jhuapl.edu}. + + +If you do not have the appropriate permissions you should run +@file{./pcbtest.sh} in the @file{src} directory to run @pcb{} from +the installation directory. + + +@node problems +@section Troubleshooting +@cindex problems +@cindex troubleshooting + +There are some known problems. Most of them are related to +missing parts of a standard @code{X11} distribution. Some others are caused by +third party applications such as @code{X} servers. To make this list more +complete please mail your problems and, if available, solutions to the author. +The mail address may be found at the beginning of this chapter. +In any case, read @ref{X11}. + +By the way, you @code{MUST HAVE AN ANSI COMPILER} to make @pcb{} work. + + +Another source of problems are older versions of @code{flex} and @code{bison}. +@pcb{} definitely works with @code{flex-2.4.7} and @code{bison-1.22} or +later. The problems will result in a @emph{syntax error} while parsing files. +This should only be a problem if you have modified the @code{flex} or +@code{bison} input files. + +The following list gives you just an idea because I'm not able to test +all @pcb{} releases on all platforms. + +@menu +* HP:: Hewlett-Packard series 700 and 800 running HP-UX 10.* +* Sun:: Sun, Solaris 2.5 +* SGI:: SGI, IRIX 5.3 and 6.* +* DEC Alpha:: DEC Alpha, DEC UNIX 3.2c and 4.0 +* SCO:: SCO Unix ODT 3.0, PC hardware +* Linux:: Linux 0.99pl14 and later +* BSD:: FreeBSD, NetBSD ... +* X11:: Refers to @code{X11R4}, @code{X11R5}, and @code{OpenWindows} +* TeX and Manuals:: Problems creating the @file{pcb.dvi} +@end menu + +@node HP +@subsection HP Series 700 and 800 +@cindex architecture +@cindex HP +@cindex Hewlett Packard + +You have to install several @code{X11} include files +or, better, install a complete @code{X11R5} release. Hewlett-Packard doesn't +support the Athena Widgets. So the header files and libraries are missing +from the application media, but they are available as a patch. +They also do not ship the @code{ANSI} compiler with the normal operating +system release so you have to buy one or use @code{GCC}. +Some of the tools are available as patches. + +In addition, @pcb{} has been successfully tested on these platforms with +@code{HPUX 9.*, 10.*} running self-compiled @code{X11R5}. + + +@node Sun +@subsection Sun SPARC architecture +@cindex architecture +@cindex Sun +@cindex Solaris +@cindex OpenWindows + +There are no known problems with Sun machines if they use @code{X11R5} instead +of @code{OpenWindows}. @pcb{} compiled successfully with all kinds of +SPARCstations @code{Solaris-2.[345]}. + +For problems with @code{OpenWindows} refer to @ref{X11}. + +@node SGI +@subsection Silicon Graphics +@cindex architecture +@cindex Silicon Graphics +@cindex SGI + +@pcb{} has been tested on some boxes running either @code{IRIX-4.0.5} or +@code{IRIX-5.3}. The former one uses a @code{X11R4} server. +There are no problems. +For known problems +with @code{X11R4}, see @ref{X11}. + + +@node DEC Alpha +@subsection DEC Alpha +@cindex architecture +@cindex DEC +@cindex Alpha + +@pcb{} compiled and runs without problems on @code{DEC UNIX V3.2c}. + + +@node SCO +@subsection SCO Unix +@cindex architecture +@cindex SCO +@cindex PC UNIX + +John DuBois wrote: +@example +@code{SCO-ODT-3.0} requires the latest version of tls003, the Athena +widget library (available from sosco.sco.com). The main problems +I have encountered are it core dumps fairly often, especially +while loading/dropping elements... +@end example +I'll see what I am able to do as soon as I have access to an @code{SCO} system. + + +@node Linux +@subsection Linux +@cindex architecture +@cindex Linux +@cindex PC UNIX + +Since the @code{X11} version of @pcb{} has been developed on a Linux +system here are no known problems. + + +@node BSD +@subsection FreeBSD and NetBSD +@cindex FreeBSD +@cindex NetBSD +@cindex PC UNIX + +@pcb{} has been tested on NetBSD and works without any problems. +You may also be able to find a NetBSD package at +@url{ftp://ftp.netbsd.org/pub/NetBSD/packages/cad/pcb/README.html} or a +FreeBSD port at +@url{http://www.freebsd.org/cgi/url.cgi?ports/cad/pcb/pkg-descr}. + +@node X11 +@subsection Problems related to X11 +@cindex X11, problems + +There are a some problems related to @code{X11R4} or systems derived from +@code{X11} such as @code{OpenWindows}. @xref{Sun}. You at least have to change +all occurances of @emph{baseTranslations} in the resource files to +@emph{translations} if you are using a @code{X11R4} server. Look at the +@code{X11R5} @emph{Intrinsics} manual for details. + +The panner widget (print dialog box) appears only in release @code{X11R5} and +later. It really simplifies adjusting the offsets. +With earlier releases the printout will always appear in the center of the +page. + +You may have some problems in a mixed @code{X11-OpenWindows} +environment. + +@pcb{} has been tested successfully with @code{X11R6} under Linux 1.1.59 +and later. + + +@node TeX and Manuals +@subsection Problems related to TeX +@cindex TeX, problems + +If your @code{TeX} installation complains about a missing @file{texinfo.tex} +file copy the one included in this release (directory @file{doc} +to your @code{TeX} macro directory. +Note, there are probably newer versions of this file available from some +FTP sites. +@code{TeX-3.0} failed, @code{TeX-3.14} worked just fine. Check our FTP server +@emph{ftp.uni-ulm.de} for ready-to-print versions of the manuals. + + +@c --------------------------- Appendix B ------------------------------- + +@node Custom Menus +@appendix Customizing the Menus + +The menu system is driven off a data file that contains +@dfn{resources}. A resource is a hierarchical description of a data +tree which, in this case, is mapped to the hierarchical menus used by +Pcb. + +@menu +* Resource Syntax:: What a resource file looks like. +* Menu Definitions:: Using a resource to define a menu. +* Menu Files and Defaults:: Where Pcb looks for its menu resource. +@end menu + +@node Resource Syntax +@section Resource Syntax + +A resource file is a simple text file. It contains curly braces to +group things, spaces between things, and double quotes when strings +need to include spaces. There are four fundamental ways of adding +data to a resource. + +First, a string (either a single word or a quoted string with spaces, +we call both ``strings'' in this appendix) can be added all by itself, +to add a string resource to the current resource. This is used, for +example, to define the string printed on a menu button. In this +example, four strings are added to the @var{File} resource: + +@example +File = @{ + Sample + "longer sample" + some text +@} +@end example + +Second, a named string may be added by giving two strings separated by +an equals sign. This is used to specify X resources and a few other +optional parameters of menus, for example. Note that a string all by +itself is thus an ``unnamed'' string. + +@example +@{"Layer groups" foreground=red sensitive=false@} +@end example + +Third, an unnamed subresource may be added. This is used to create +submenus and menu buttons. To add a subresource, simply group other +things in curly braces. This example describes a resource containing +one string and three subresources: + +@example +@{File + @{New do_new()@} + @{Save do_save()@} + @{Quit do_quit()@} +@} +@end example + +Lastly, a named subresource may be added by prefixing an unnamed +subresource with a string and an equals sign, just as when naming +strings. This syntax is used to name the resources used for the main +menu and popup menus: + +@example +MainMenu = @{ + @dots{} + @} +@end example + +Additionally, the menu parser allows for ``hooks'' whereby portions of +the menu system can be programmatically created at runtime by the +application. These hooks are invoked by a single word proceeded by an +at sign, such as this example where most of the Sizes menu is created +automatically: + +@example +@{Sizes + @@sizes + @{"Adjust active sizes ..." AdjustStyle(0)@} + @} +@end example + +In addition to all that, any unquoted pound sign (@code{#}) begins a +comment. Commented text continues until the end of the containing +line. Comments may begin at the beginning of a line, or after other +text on the line: + +@example +# This is a comment +MainMenu = @{ # This is also a comment +@end example + +@node Menu Definitions +@section Menu Definitions + +To best understand this section, you should find the +@file{pcb-menu.res} file that your Pcb uses and refer to it for +examples (@pxref{Menu Files and Defaults}). Note that the lesstif +GUI uses @file{pcb-menu.res} and the GTK+ GUI uses @file{gpcb-menu.res}. +The file format is identical however and if so desired, one can make +one file be a soft link to the other. + +A resource defines a menu when it meets certain semantic requirements. +The menu hierarchy is reflected as a hierarchy of unnamed +subresources, with the first string of each subresource defining the +label used for the menu button. A subresource that itself contains +subresources becomes a submenu, a subresource that does not becomes a +button. + +A submenu should only contain subresources for the buttons or submenus +within that submenu. Two exceptions are allowed: an initial string +sets the label, and the string ``-'' (a single dash) will create a +separator. + +A button should not contain subresources, but will contain many +strings, named and unnamed. The first member shall be an unnamed +string which is the label for the button. Any other unnamed strings +within the button's resource will be used as actions (much like the +.Xdefaults action strings), which are functions that will be called +when the button is pressed (or popped up, or created, depending on the +action). As a convenience, if a left parenthesis is seen, the current +``word'' will continue at least until the matching right parenthesis. +This allows you to pass strings with spaces as arguments to actions +without needing to quote the action. + +Named resources in button resources will be used as X resources. Such +resources can be used to set the font, color, and spacing of buttons. +As a convenience, ``fg'' can be used as an abbreviation for ``foreground''. + +Within the menu's resource file, Pcb will look for a few key named +subresources. At the moment, the only one it looks for is one called +@code{MainMenu}. This will be used for the main menu bar. In the +future, other named subresources will be used for popup resources. + +Given all this, a small sample @file{pcb-menu.res} would be: + +@example +MainMenu = @{ + @{File + @{"Load layout" Load(Layout)@} + - + @{"Quit Program" Quit() fg=red font=10x20@} + @} +@} +@end example + +Within the Pcb sources are specially crafted comments that mark all +the actions, flags, menu hooks, and whatnot that Pcb offers. Read the +file @file{src/gather-actions} in the Pcb source tree for +documentation for these comments. + +@node Menu Files and Defaults +@section Menu Files and Defaults + +Pcb will look for a file which defines its menus, trying the following +names (the example is for the lesstif GUI, the GTK+ GUI has ``gpcb-menu.res'' +in place of ``pcb-menu.res''): + +@example +./pcb-menu.res +$HOME/.pcb-menu.res +$PCBLIBDIR/pcb-menu.res + +@end example + +Note that @var{pcblibdir} defaults to @file{/usr/local/share/pcb} +(hence, @file{/usr/local/share/pcb/pcb-menu.res}). The +@file{} entry refers to a menu definition within the Pcb +application itself. The master file for all this is the file +@file{src/pcb-menu.res} in the Pcb source tree. This master source is +used to create the internal menu definition as well as being installed +in @file{$pcblibdir}. + +@c --------------------------- Appendix C ------------------------------- +@node Regular Expressions +@appendix Element Search/Regular Expressions +@cindex Element Search +@cindex Regular Expressions +@vindex Element Search +@vindex Regular Expressions + +@section Element Search/Regular Expressions +@pcb{}'s search is based on POSIX 1003.2 Regular Expressions. Full POSIX +Regular Expressions are supported by @pcb{} if the regex library was +available when @pcb{} was built. One difference from the regular +expressions found in tools like awk or grep is that PCB implicitly +adds a ``^'' to the begining of a regular expression and ``$'' to the +end of the regular expression. For example, if you enter ``C1'', the +actual regular expression used internally is ``^C1$''. Another difference +is that search patterns in pcb are not case sensitive. That is, ``CON'' is +treated the same as ``con''. + +It is easier to show by example how to search than explain +POSIX 1003.2. With regular expressions most characters are just +themselves, but some are special: + +@table @samp +@item * +Matches 0 or more instances of preceding character. + +@item + +Matches 1 or more instances of preceding character. + +@item ? +Matches 0 or 1 instances of preceding character. + +@item . +Matches any single character other than the newline character. + +@item | +The vertical bar is the alternation operator. It combines two +regular expressions. The result matches if either of them matches. + +@item \ +A backslash indicates the next character should not be interpreted literally +if it normally is, and should be interpreted literally if it normally isn't. + +@item @{n@} +An integer n enclosed in curly brackets matches the preceding item if +it occurs exactly n times. + +@item [ ] +A pair of square brackets matches every character they contain. Characters +may be given explicitly, or as ranges. + +@item - +A hyphen in the context of square brackets denotes the range between the +preceding and the following character. E.g., the range of digits is +``0-9'' . The range of letters from C to K is ``C-K'' . + +@item \^ inside square brackets +Inside square brackets the caret is an anti operator. Its presence makes +the square prackets match anything except the contents of the brackets. + +@item ( ) +Round parenthesis group parts of a regular expression. This is very much +like they do in math formulars. + +@end table + +If you need a special character literally, you can escape it with a +backslash. + +The following examples illustrate how regular expressions can be used to +specify element names (reference designators) to search for. +@table @samp + +@item C5 +Select the element whose name is exactly ``C5''. + +@item C5 | R3 +Select C5 and R3. + +@item C.* +Select all elements whose name start with the letter ``C'', such as C5, or +C42, or CF1. + +@item C.*1 +Select all elements that start with ``C'' and end with ``1'', such as C1, +or C51 or C5/9B71. + +@item R10? +Search for R1 or R10, but will not select R100 or R105. The question mark +is a quantifier for the character ``0''. + +@item R128+ +Selects R128, R1288, R12888, etc. + +@item TB. +Select all terminal blocks having exactly one character designator after +``TB'' such as TB1, TBA, or TBx but not TB. + +@item TB.. +Select all terminal blocks having a two character designator such as TB21 or +TB1a. + +@item TB.* +Select all terminal blocks with any designator. + +@item .*31 +Select all items, whose name ends with ``31'' such as Q31, or R31, or R531. + +@item Q[12] +Select Q1 and Q2. + +@item [A-D].* +Select all items, whose name starts with ``A'', ``B'', ``C'', or ``D''. + +@item .*N@{2@}.* +Select all items, whose name contains two ``N'' in a row such as +CONN23, or connA, but not CON5 + +@item [^D].* +Select all items that do not start with the letter ``D'', such as C2, or +R34, but not D34 + +@end table + + +@c --------------------------- Appendix -- drill sizes ------------------------------- +@node Standard Drill Sizes +@appendix Standard Drill Size Tables +@cindex drill sizes, list of standard +@cindex standard drill sizes + +@section American Standard Wire Size Drills +@include wire_size.texi + +@section American Standard Letter Size Drills +@include letter_size.texi + +@section Fractional Inch Size Drills +@include fractional_size.texi + +@section Metric Drills +@include metric_size.texi + +@c --------------------------- Appendix -- Centroid File Format ---------------------- +@node Centroid File Format +@appendix Centroid (X-Y) File Format +@cindex centroid file format +@cindex x-y file format + +@section Overview + +@section File Format +The centroid output file is in a standard comma seperated values (CSV) +format. Comment lines begin with a ``#''. The output file contains a +header with an RCS Id tag (useful for those who will check the file +into a version control system), a version number for the file format, +some comments containing the author and title of the board, and a +comment describing the remainder of the file format. + +An example centroid file is shown below. + +@example + +# @verb{ $ }Id@verb{ $ } +# PcbXY Version 1.0 +# Date: Fri Jul 22 03:40:08 2005 UTC +# Author: PCB User +# Title: MyBoard - PCB X-Y +# RefDes, Description, Value, X, Y, rotation, top/bottom +# X,Y in mils. rotation in degrees. +# -------------------------------------------- +R61,"0603","10",2610.00,3560.00,90,top +J5,"AMPHENOL_ARFX1231","unknown",2390.00,4220.00,180,top +C13,"0402","0.01u",2340.00,3014.00,270,top + +@end example + +@section Computation of Centroid and Rotation +@cindex centroid file, algorithms +@cindex x-y file, algorithms +The center of each element is found by averaging the (X,Y) coordinates +for the center of each pin and pad in the element. For example if an +element has 2 pins, 1 at (1,0) and another at (1,4) then the centroid +will be at (1,2). + +The calculation of rotation is a bit more complex. Currently a +rotation is not stored for each element but rather the rotated element +is stored. In other words if the element from the library has a pin +at (0,0) and (0,2) and it has been rotated by 90 degrees, then the +@file{.pcb} file will store (0,0) and (2,0) for the pin locations with +no indication that they have been rotated from the original. + +In the event that the element has only 1 pin, then the rotation is set +to zero. If the element has only one pad (as opposed to a +through-hole pin), then the rotation of the pad is used. + +When the element has multiple pins, the location of pin #1 is placed +in the coordinate system which has the centroid of the part at (0,0). +Then which quadrant pin #1 falls in determines the rotation. Zero +degrees of rotation is defined as pin #1 being in the upper left +quadrant. Increasing angles correspond to counterclockwise rotation so a +rotation of 90 degrees places pin #1 in the lower left quadrant. +Currently, the only allowed rotations are 0, 90, 180, and 270 degrees. + +If pin #1 happens to be at the centroid of the part, then pin #2 is +examined to see which quadrant it is located in. The same rules apply +for the definitions of rotation. In other words, when pin #1 is at +the centroid of the part and pin #2 is in the upper left quadrant, the +rotation is declared to be zero degrees. + +@c --------------------------- Appendix -- Actions ---------------------- +@node Action Reference +@appendix Action Reference +@cindex action reference + +@include actions.texi + +@c --------------------------- Appendix -- Glossary ---------------------- +@node Glossary +@appendix Glossary +@cindex glossary +@cindex terminology +@cindex index of terms + +@table @asis + +@item Footprint +The pattern of metal, silkscreen, soldermask relief, and drills which +defines where you place a component on a circuit board. +Footprints are the placed by the user onto the PC board during the +placement phase of PCB layout. + +@item Gerber File +The file format used in the industry to convey a board database to the +manufacturer is RS-274X (which replaces the now obsolete RS-274D +format). This file format was originally developed by Gerber for +their photo plotters and thus RS-274D and RS-274X format files +are often times refered to as ``Gerber'' files. + +@item Thermal, Thermal Relief +A thermal relief is a way of connecting a pin to a ground +or power plane. Instead of directly connecting to the plane, small "spokes" +are used to increase the thermal resistance between the pin and the plane. +Often times these connections are refered to as simply a thermal. By increasing +the thermal resistance to the plane, it becomes easier to solder to the +pin. In the drawing below, the pin on the left is connected to the +polygon using a solid connection with no thermal relief, the middle +pin is connected using a thermal, while the pin on the right has no +connection to the polygon. In PCB, the ``Thermal'' Tool is used to +make both a solid connection and one with thermal relief (see @ref{Polygon Objects}). + +@center @image{thermal,,,Example of a thermal relief,png} + +@end table + +@c --------------------------------------------------------------------- +@node Index +@unnumbered Index of Resources +@printindex vr + +@unnumbered Index of Actions, Commands and Options +@printindex fn + +@unnumbered Index of Concepts +@printindex cp + +@contents +@bye Index: tags/1.0.5/doc/pcbfile.texi =================================================================== --- tags/1.0.5/doc/pcbfile.texi (nonexistent) +++ tags/1.0.5/doc/pcbfile.texi (revision 953) @@ -0,0 +1,946 @@ +@c key pcbfile +@c ./../src/parse_y.y 143 + +A special note about units: Older versions of @code{pcb} used mils +(1/1000 inch) as the base unit; a value of 500 in the file meant +half an inch. Newer versions uses a "high resolution" syntax, +where the base unit is 1/100 of a mil (0.000010 inch); a value of 500 in +the file means 5 mils. As a general rule, the variants of each entry +listed below which use square brackets are the high resolution formats +and use the 1/100 mil units, and the ones with parentheses are the older +variants and use 1 mil units. Note that when multiple variants +are listed, the most recent (and most preferred) format is the first +listed. + +Symbolic and numeric flags (SFlags and NFlags) are described in +@ref{Object Flags}. + +@menu +* Arc syntax:: +* Attribute syntax:: +* Connect syntax:: +* Cursor syntax:: +* DRC syntax:: +* Element syntax:: +* ElementArc syntax:: +* ElementLine syntax:: +* FileVersion syntax:: +* Flags syntax:: +* Grid syntax:: +* Groups syntax:: +* Layer syntax:: +* Line syntax:: +* Mark syntax:: +* Net syntax:: +* Netlist syntax:: +* Pad syntax:: +* PCB syntax:: +* Pin syntax:: +* PolyArea syntax:: +* Polygon syntax:: +* Rat syntax:: +* Styles syntax:: +* Symbol syntax:: +* SymbolLine syntax:: +* Text syntax:: +* Thermal syntax:: +* Via syntax:: +@end menu +@c pcbfile Arc +@node Arc syntax +@subsection Arc +@c ./../src/parse_y.y 660 + +@cartouche +@format +Arc [X Y Width Height Thickness Clearance StartAngle DeltaAngle SFlags] +Arc (X Y Width Height Thickness Clearance StartAngle DeltaAngle NFlags) +Arc (X Y Width Height Thickness StartAngle DeltaAngle NFlags) +@end format +@end cartouche + +@table @var +@item X Y +Coordinates of the center of the arc. +@item Width Height +The width and height, from the center to the edge. The bounds of the +circle of which this arc is a segment, is thus @math{2*Width} by +@math{2*Height}. +@item Thickness +The width of the copper trace which forms the arc. +@item Clearance +The amount of space cleared around the arc when the line passes +through a polygon. The clearance is added to the thickness to get the +thickness of the clear; thus the space between the arc and the polygon +is @math{Clearance/2} wide. +@item StartAngle +The angle of one end of the arc, in degrees. In PCB, an angle of zero +points left (negative X direction), and 90 degrees points down +(positive Y direction). +@item DeltaAngle +The sweep of the arc. This may be negative. Positive angles sweep +counterclockwise. +@item SFlags +Symbolic or numeric flags. +@item NFlags +Numeric flags. +@end table + +@c pcbfile Attribute +@node Attribute syntax +@subsection Attribute +@c ./../src/parse_y.y 1268 + +@cartouche +@format +Attribute ("Name" "Value") +@end format +@end cartouche + +Attributes allow boards and elements to have arbitrary data attached +to them, which is not directly used by PCB itself but may be of use by +other programs or users. + +@table @var +@item Name +The name of the attribute + +@item Value +The value of the attribute. Values are always stored as strings, even +if the value is interpreted as, for example, a number. + +@end table + +@c pcbfile Connect +@node Connect syntax +@subsection Connect +@c ./../src/parse_y.y 1258 + +@cartouche +@format +Connect ("PinPad") +@end format +@end cartouche + +@table @var +@item PinPad +The name of a pin or pad which is included in this net. Pin and Pad +names are named by the refdes and pin name, like @code{"U14-7"} for +pin 7 of U14, or @code{"T4-E"} for pin E of T4. +@end table + +@c pcbfile Cursor +@node Cursor syntax +@subsection Cursor +@c ./../src/parse_y.y 335 + +@cartouche +@format +Cursor [X Y Zoom] +Cursor (X Y Zoom) +@end format +@end cartouche + +@table @var +@item X Y +Location of the cursor when the board was saved. +@item Zoom +The current zoom factor. Note that a zoom factor of "0" means 1 mil +per screen pixel, N means @math{2^N} mils per screen pixel, etc. The +first variant accepts floating point numbers. The special value +"1000" means "zoom to fit" +@end table + +@c pcbfile DRC +@node DRC syntax +@subsection DRC +@c ./../src/parse_y.y 376 + +@cartouche +@format +DRC [Bloat Shrink Line Silk Drill Ring] +DRC [Bloat Shrink Line Silk] +DRC [Bloat Shrink Line] +@end format +@end cartouche + +@table @var +@item Bloat +Minimum spacing between copper. +@item Shrink +Minimum copper overlap to guarantee connectivity. +@item Line +Minimum line thickness. +@item Silk +Minimum silk thickness. +@item Drill +Minimum drill size. +@item Ring +Minimum width of the annular ring around pins and vias. +@end table + +@c pcbfile Element +@node Element syntax +@subsection Element +@c ./../src/parse_y.y 816 + +@cartouche +@format +Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags] ( +Element (NFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TNFlags) ( +Element (NFlags "Desc" "Name" "Value" TX TY TDir TScale TNFlags) ( +Element (NFlags "Desc" "Name" TX TY TDir TScale TNFlags) ( +Element ("Desc" "Name" TX TY TDir TScale TNFlags) ( +@ @ @ @dots{} contents @dots{} +) +@end format +@end cartouche + +@table @var +@item SFlags +Symbolic or numeric flags, for the element as a whole. +@item NFlags +Numeric flags, for the element as a whole. +@item Desc +The description of the element. This is one of the three strings +which can be displayed on the screen. +@item Name +The name of the element, usually the reference designator. +@item Value +The value of the element. +@item MX MY +The location of the element's mark. This is the reference point +for placing the element and its pins and pads. +@item TX TY +The upper left corner of the text (one of the three strings). +@item TDir +The relative direction of the text. 0 means left to right for +an unrotated element, 1 means up, 2 left, 3 down. +@item TScale +Size of the text, as a percentage of the ``default'' size of of the +font (the default font is about 40 mils high). Default is 100 (40 +mils). +@item TSFlags +Symbolic or numeric flags, for the text. +@item TNFlags +Numeric flags, for the text. +@end table + +Elements may contain pins, pads, element lines, element arcs, +attributes, and (for older elements) an optional mark. Note that +element definitions that have the mark coordinates in the element +line, only support pins and pads which use relative coordinates. The +pin and pad coordinates are relative to the mark. Element definitions +which do not include the mark coordinates in the element line, may +have a Mark definition in their contents, and only use pin and pad +definitions which use absolute coordinates. + +@c pcbfile ElementArc +@node ElementArc syntax +@subsection ElementArc +@c ./../src/parse_y.y 927 + +@cartouche +@format +ElementArc [X Y Width Height StartAngle DeltaAngle Thickness] +ElementArc (X Y Width Height StartAngle DeltaAngle Thickness) +@end format +@end cartouche + +@table @var +@item X Y +Coordinates of the center of the arc. These are relative to the +Element's mark point for new element formats, or absolute for older +formats. +@item Width Height +The width and height, from the center to the edge. The bounds of the +circle of which this arc is a segment, is thus @math{2*Width} by +@math{2*Height}. +@item StartAngle +The angle of one end of the arc, in degrees. In PCB, an angle of zero +points left (negative X direction), and 90 degrees points down +(positive Y direction). +@item DeltaAngle +The sweep of the arc. This may be negative. Positive angles sweep +counterclockwise. +@item Thickness +The width of the silk line which forms the arc. +@end table + +@c pcbfile ElementLine +@node ElementLine syntax +@subsection ElementLine +@c ./../src/parse_y.y 925 + +@cartouche +@format +ElementLine [X1 Y1 X2 Y2 Thickness] +ElementLine (X1 Y1 X2 Y2 Thickness) +@end format +@end cartouche + +@table @var +@item X1 Y1 X2 Y2 +Coordinates of the endpoints of the line. These are relative to the +Element's mark point for new element formats, or absolute for older +formats. +@item Thickness +The width of the silk for this line. +@end table + +@c pcbfile FileVersion +@node FileVersion syntax +@subsection FileVersion +@c ./../src/parse_y.y 258 + +@cartouche +@format +FileVersion[Version] +@end format +@end cartouche + +@table @var +@item Version +File format version. This version number represents the date when the pcb file +format was last changed. +@end table + +Any version of pcb build from sources equal to or newer +than this number should be able to read the file. If this line is not present +in the input file then file format compatibility is not checked. + + +@c pcbfile Flags +@node Flags syntax +@subsection Flags +@c ./../src/parse_y.y 418 + +@cartouche +@format +Flags(Number) +@end format +@end cartouche + +@table @var +@item Number +A number, whose value is normally given in hex, individual bits of which +represent pcb-wide flags as defined in @ref{PCBFlags}. + +@end table + +@c pcbfile Grid +@node Grid syntax +@subsection Grid +@c ./../src/parse_y.y 294 + +@cartouche +@format +Grid [Step OffsetX OffsetY Visible] +Grid (Step OffsetX OffsetY Visible) +Grid (Step OffsetX OffsetY) +@end format +@end cartouche + +@table @var +@item Step +Distance from one grid point to adjacent points. This value may be a +floating point number for the first two variants. +@item OffsetX OffsetY +The "origin" of the grid. Normally zero. +@item Visible +If non-zero, the grid will be visible on the screen. +@end table + +@c pcbfile Groups +@node Groups syntax +@subsection Groups +@c ./../src/parse_y.y 432 + +@cartouche +@format +Groups("String") +@end format +@end cartouche + +@table @var +@item String + +Encodes the layer grouping information. Each group is separated by a +colon, each member of each group is separated by a comma. Group +members are either numbers from @code{1}..@var{N} for each layer, and +the letters @code{c} or @code{s} representing the component side and +solder side of the board. Including @code{c} or @code{s} marks that +group as being the top or bottom side of the board. + +@example +Groups("1,2,c:3:4:5,6,s:7,8") +@end example + +@end table + +@c pcbfile Layer +@node Layer syntax +@subsection Layer +@c ./../src/parse_y.y 573 + +@cartouche +@format +Layer (LayerNum "Name") ( +@ @ @ @dots{} contents @dots{} +) +@end format +@end cartouche + +@table @var +@item LayerNum +The layer number. Layers are numbered sequentially, starting with 1. +The last two layers (9 and 10 by default) are solder-side silk and +component-side silk, in that order. +@item Name +The layer name. +@item contents +The contents of the layer, which may include attributes, lines, arcs, rectangles, +text, and polygons. +@end table + +@c pcbfile Line +@node Line syntax +@subsection Line +@c ./../src/parse_y.y 629 + +@cartouche +@format +Line [X1 Y1 X2 Y2 Thickness Clearance SFlags] +Line (X1 Y1 X2 Y2 Thickness Clearance NFlags) +Line (X1 Y1 X2 Y2 Thickness NFlags) +@end format +@end cartouche + +@table @var +@item X1 Y1 X2 Y2 +The end points of the line +@item Thickness +The width of the line +@item Clearance +The amount of space cleared around the line when the line passes +through a polygon. The clearance is added to the thickness to get the +thickness of the clear; thus the space between the line and the +polygon is @math{Clearance/2} wide. +@item SFlags +Symbolic or numeric flags +@item NFlags +Numeric flags. +@end table + +@c pcbfile Mark +@node Mark syntax +@subsection Mark +@c ./../src/parse_y.y 929 + +@cartouche +@format +Mark [X Y] +Mark (X Y) +@end format +@end cartouche + +@table @var +@item X Y +Coordinates of the Mark, for older element formats that don't have +the mark as part of the Element line. +@end table + +@c pcbfile Net +@node Net syntax +@subsection Net +@c ./../src/parse_y.y 1235 + +@cartouche +@format +Net ("Name" "Style") ( +@ @ @ @dots{} connects @dots{} +) +@end format +@end cartouche + +@table @var +@item Name +The name of this net. +@item Style +The routing style that should be used when autorouting this net. +@end table + +@c pcbfile Netlist +@node Netlist syntax +@subsection Netlist +@c ./../src/parse_y.y 1214 + +@cartouche +@format +Netlist ( ) ( +@ @ @ @dots{} nets @dots{} +) +@end format +@end cartouche + +@c pcbfile Pad +@node Pad syntax +@subsection Pad +@c ./../src/parse_y.y 1086 + +@cartouche +@format +Pad [rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" SFlags] +Pad (rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" NFlags) +Pad (aX1 aY1 aX2 aY2 Thickness "Name" "Number" NFlags) +Pad (aX1 aY1 aX2 aY2 Thickness "Name" NFlags) +@end format +@end cartouche + +@table @var +@item rX1 rY1 rX2 rY2 +Coordinates of the endpoints of the pad, relative to the element's +mark. Note that the copper extends beyond these coordinates by half +the thickness. To make a square or round pad, specify the same +coordinate twice. +@item aX1 aY1 aX2 aY2 +Same, but absolute coordinates of the endpoints of the pad. +@item Thickness +width of the pad. +@item Clearance +add to thickness to get clearance width. +@item Mask +width of solder mask opening. +@item Name +name of pin +@item Number +number of pin +@item SFlags +symbolic or numerical flags +@item NFlags +numerical flags only +@end table + +@c pcbfile PCB +@node PCB syntax +@subsection PCB +@c ./../src/parse_y.y 271 + +@cartouche +@format +PCB ["Name" Width Height] +PCB ("Name" Width Height] +PCB ("Name") +@end format +@end cartouche + +@table @var +@item Name +Name of the PCB project +@item Width Height +Size of the board +@end table + +If you don't specify the size of the board, a very large default is +chosen. + +@c pcbfile Pin +@node Pin syntax +@subsection Pin +@c ./../src/parse_y.y 1013 + +@cartouche +@format +Pin [rX rY Thickness Clearance Mask Drill "Name" "Number" SFlags] +Pin (rX rY Thickness Clearance Mask Drill "Name" "Number" NFlags) +Pin (aX aY Thickness Drill "Name" "Number" NFlags) +Pin (aX aY Thickness Drill "Name" NFlags) +Pin (aX aY Thickness "Name" NFlags) +@end format +@end cartouche + +@table @var +@item rX rY +coordinates of center, relative to the element's mark +@item aX aY +absolute coordinates of center. +@item Thickness +outer diameter of copper annulus +@item Clearance +add to thickness to get clearance diameter +@item Mask +diameter of solder mask opening +@item Drill +diameter of drill +@item Name +name of pin +@item Number +number of pin +@item SFlags +symbolic or numerical flags +@item NFlags +numerical flags only +@end table + +@c pcbfile PolyArea +@node PolyArea syntax +@subsection PolyArea +@c ./../src/parse_y.y 353 + +@cartouche +@format +PolyArea [Area] +@end format +@end cartouche + +@table @var +@item Area +Minimum area of polygon island to retain. If a polygon has clearances that cause an isolated island to be created, then will only be retained if the area exceeds this minimum area. +@end table + +@c pcbfile Polygon +@node Polygon syntax +@subsection Polygon +@c ./../src/parse_y.y 743 + +@cartouche +@format +Polygon (SFlags) ( +@ @ @ @dots{} (X Y) @dots{} +@ @ @ @dots{} [X Y] @dots{} +@ @ @ Hole ( +@ @ @ @ @ @ @dots{} (X Y) @dots{} +@ @ @ @ @ @ @dots{} [X Y] @dots{} +@ @ @ ) +@ @ @ @dots{} +) +@end format +@end cartouche + +@table @var +@item SFlags +Symbolic or numeric flags. +@item X Y +Coordinates of each vertex. You must list at least three coordinates. +@item Hole (...) +Defines a hole within the polygon's outer contour. There may be zero or more such sections. +@end table + +@c pcbfile Rat +@node Rat syntax +@subsection Rat +@c ./../src/parse_y.y 558 + +@cartouche +@format +Rat [X1 Y1 Group1 X2 Y2 Group2 SFlags] +Rat (X1 Y1 Group1 X2 Y2 Group2 NFlags) +@end format +@end cartouche + +@table @var +@item X1 Y1 X2 Y2 +The endpoints of the rat line. +@item Group1 Group2 +The layer group each end is connected on. +@item SFlags +Symbolic or numeric flags. +@item NFlags +Numeric flags. +@end table + +@c pcbfile Styles +@node Styles syntax +@subsection Styles +@c ./../src/parse_y.y 442 + +@cartouche +@format +Styles("String") +@end format +@end cartouche + +@table @var +@item String + +Encodes the four routing styles @code{pcb} knows about. The four styles +are separated by colons. Each style consists of five parameters as follows: + +@table @var +@item Name +The name of the style. +@item Thickness +Width of lines and arcs. +@item Diameter +Copper diameter of pins and vias. +@item Drill +Drill diameter of pins and vias. +@item Keepaway +Minimum spacing to other nets. If omitted, 10 mils is the default. + +@end table + +@end table + +@example +Styles("Signal,10,40,20:Power,25,60,35:Fat,40,60,35:Skinny,8,36,20") +Styles["Logic,1000,3600,2000,1000:Power,2500,6000,3500,1000: +@ @ @ Line,4000,6000,3500,1000:Breakout,600,2402,1181,600"] +@end example + +@noindent +Note that strings in actual files cannot span lines; the above example +is split across lines only to make it readable. + +@c pcbfile Symbol +@node Symbol syntax +@subsection Symbol +@c ./../src/parse_y.y 1148 + +@cartouche +@format +Symbol [Char Delta] ( +Symbol (Char Delta) ( +@ @ @ @dots{} symbol lines @dots{} +) +@end format +@end cartouche + +@table @var +@item Char +The character or numerical character value this symbol represents. +Characters must be in single quotes. +@item Delta +Additional space to allow after this character. +@end table + +@c pcbfile SymbolLine +@node SymbolLine syntax +@subsection SymbolLine +@c ./../src/parse_y.y 1197 + +@cartouche +@format +SymbolLine [X1 Y1 X2 Y1 Thickness] +SymbolLine (X1 Y1 X2 Y1 Thickness) +@end format +@end cartouche + +@table @var +@item X1 Y1 X2 Y2 +The endpoints of this line. +@item Thickness +The width of this line. +@end table + +@c pcbfile Text +@node Text syntax +@subsection Text +@c ./../src/parse_y.y 689 + +@cartouche +@format +Text [X Y Direction Scale "String" SFlags] +Text (X Y Direction Scale "String" NFlags) +Text (X Y Direction "String" NFlags) +@end format +@end cartouche + +@table @var +@item X Y +The location of the upper left corner of the text. +@item Direction +0 means text is drawn left to right, 1 means up, 2 means right to left +(i.e. upside down), and 3 means down. +@item Scale +Size of the text, as a percentage of the ``default'' size of of the +font (the default font is about 40 mils high). Default is 100 (40 +mils). +@item String +The string to draw. +@item SFlags +Symbolic or numeric flags. +@item NFlags +Numeric flags. +@end table + +@c pcbfile Thermal +@node Thermal syntax +@subsection Thermal +@c ./../src/parse_y.y 365 + +@cartouche +@format +Thermal [Scale] +@end format +@end cartouche + +@table @var +@item Scale +Relative size of thermal fingers. A value of 1.0 makes the finger +width twice the clearance gap width (measured across the gap, not +diameter). The normal value is 0.5, which results in a finger width +the same as the clearance gap width. +@end table + +@c pcbfile Via +@node Via syntax +@subsection Via +@c ./../src/parse_y.y 498 + +@cartouche +@format +Via [X Y Thickness Clearance Mask Drill "Name" SFlags] +Via (X Y Thickness Clearance Mask Drill "Name" NFlags) +Via (X Y Thickness Clearance Drill "Name" NFlags) +Via (X Y Thickness Drill "Name" NFlags) +Via (X Y Thickness "Name" NFlags) +@end format +@end cartouche + +@table @var +@item X Y +coordinates of center +@item Thickness +outer diameter of copper annulus +@item Clearance +add to thickness to get clearance diameter +@item Mask +diameter of solder mask opening +@item Drill +diameter of drill +@item Name +string, name of via (vias have names?) +@item SFlags +symbolic or numerical flags +@item NFlags +numerical flags only +@end table + +@c pcbfile ~objectflags +@c ./../src/const.h 110 +@node Object Flags +@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. + +@table @code +@item 0x0001 pin +If set, this object is a pin. This flag is for internal use only. +@item 0x0002 via +Likewise, for vias. +@item 0x0004 found +If set, this object has been found by @code{FindConnection()}. +@item 0x0008 hole +For pins and vias, this flag means that the pin or via is a hole +without a copper annulus. +@item 0x0010 rat +If set for a line, indicates that this line is a rat line instead of a +copper trace. +@item 0x0010 pininpoly +For pins and pads, this flag is used internally to indicate that the +pin or pad overlaps a polygon on some layer. +@item 0x0010 clearpoly +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. +@item 0x0010 hidename +For elements, when set the name of the element is hidden. +@item 0x0020 showname +For elements, when set the names of pins are shown. +@item 0x0020 clearline +For lines and arcs, the line/arc will clear polygons instead of +connecting to them. +@item 0x0020 fullpoly +For polygons, the full polygon is drawn (i.e. all parts instead of only the biggest one). +@item 0x0040 selected +Set when the object is selected. +@item 0x0080 onsolder +For elements and pads, indicates that they are on the solder side. +@item 0x0080 auto +For lines and vias, indicates that these were created by the +autorouter. +@item 0x0100 square +For pins and pads, indicates a square (vs round) pin/pad. +@item 0x0200 rubberend +For lines, used internally for rubber band moves. +@item 0x0200 warn +For pins, vias, and pads, set to indicate a warning. +@item 0x0400 usetherm +Obsolete, indicates that pins/vias should be drawn with thermal +fingers. +@item 0x0400 +Obsolete, old files used this to indicate lines drawn on silk. +@item 0x0800 octagon +Draw pins and vias as octagons. +@item 0x1000 drc +Set for objects that fail DRC. +@item 0x2000 lock +Set for locked objects. +@item 0x4000 edge2 +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. +@item 0x8000 marker +Marker used internally to avoid revisiting an object. +@item 0x10000 nopaste +For pads, set to prevent a solderpaste stencil opening for the +pad. Primarily used for pads used as fiducials. +@end table +@c pcbfile ~pcbflags +@c ./../src/const.h 149 +@node PCBFlags +@section PCBFlags +@table @code +@item 0x00001 +Pinout displays pin numbers instead of pin names. +@item 0x00002 +Use local reference for moves, by setting the mark at the beginning of +each move. +@item 0x00004 +When set, only polygons and their clearances are drawn, to see if +polygons have isolated regions. +@item 0x00008 +Display DRC region on crosshair. +@item 0x00010 +Do all move, mirror, rotate with rubberband connections. +@item 0x00020 +Display descriptions of elements, instead of refdes. +@item 0x00040 +Display names of elements, instead of refdes. +@item 0x00080 +Auto-DRC flag. When set, PCB doesn't let you place copper that +violates DRC. +@item 0x00100 +Enable 'all-direction' lines. +@item 0x00200 +Switch starting angle after each click. +@item 0x00400 +Force unique names on board. +@item 0x00800 +New lines/arc clear polygons. +@item 0x01000 +Crosshair snaps to pins and pads. +@item 0x02000 +Show the solder mask layer. +@item 0x04000 +Draw with thin lines. +@item 0x08000 +Move items orthogonally. +@item 0x10000 +Draw autoroute paths real-time. +@item 0x20000 +New polygons are full ones. +@item 0x40000 +Names are locked, the mouse cannot select them. +@item 0x80000 +Everything but names are locked, the mouse cannot select anything else. +@item 0x100000 +New polygons are full polygons. +@item 0x200000 +When set, element names are not drawn. +@end table Index: tags/1.0.5/doc/puller.pcb =================================================================== --- tags/1.0.5/doc/puller.pcb (nonexistent) +++ tags/1.0.5/doc/puller.pcb (revision 953) @@ -0,0 +1,848 @@ +# release: pcb 1.99s + +PCB["" 110000 30000] + +Grid[10000.00000000 0 0 1] +Cursor[0 0 0.000000] +Thermal[0.500000] +DRC[1000 1000 1000 1000 1500 1000] +Flags(0x0000000000001c40) +Groups("1,c:2,s:3:4:5:6:7:8") +Styles["Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000:Fat,5000,10000,5000,1000:Skinny,600,2402,1181,600"] + +Symbol[' ' 1800] +( +) +Symbol['!' 1200] +( + SymbolLine[0 4500 0 5000 800] + SymbolLine[0 1000 0 3500 800] +) +Symbol['"' 1200] +( + SymbolLine[0 1000 0 2000 800] + SymbolLine[1000 1000 1000 2000 800] +) +Symbol['#' 1200] +( + SymbolLine[0 3500 2000 3500 800] + SymbolLine[0 2500 2000 2500 800] + SymbolLine[1500 2000 1500 4000 800] + SymbolLine[500 2000 500 4000 800] +) +Symbol['$' 1200] +( + SymbolLine[1500 1500 2000 2000 800] + SymbolLine[500 1500 1500 1500 800] + SymbolLine[0 2000 500 1500 800] + SymbolLine[0 2000 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4000 800] + SymbolLine[1500 4500 2000 4000 800] + SymbolLine[500 4500 1500 4500 800] + SymbolLine[0 4000 500 4500 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['%' 1200] +( + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[1000 2500 1500 2000 800] + SymbolLine[500 2500 1000 2500 800] + SymbolLine[0 2000 500 2500 800] + SymbolLine[0 5000 4000 1000 800] + SymbolLine[3500 5000 4000 4500 800] + SymbolLine[4000 4000 4000 4500 800] + SymbolLine[3500 3500 4000 4000 800] + SymbolLine[3000 3500 3500 3500 800] + SymbolLine[2500 4000 3000 3500 800] + SymbolLine[2500 4000 2500 4500 800] + SymbolLine[2500 4500 3000 5000 800] + SymbolLine[3000 5000 3500 5000 800] +) +Symbol['&' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 3500 1500 2000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[0 2500 2500 5000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[0 3500 0 4500 800] +) +Symbol[''' 1200] +( + SymbolLine[0 2000 1000 1000 800] +) +Symbol['(' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] +) +Symbol[')' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['*' 1200] +( + SymbolLine[0 2000 2000 4000 800] + SymbolLine[0 4000 2000 2000 800] + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol['+' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol[',' 1200] +( + SymbolLine[0 6000 1000 5000 800] +) +Symbol['-' 1200] +( + SymbolLine[0 3000 2000 3000 800] +) +Symbol['.' 1200] +( + SymbolLine[0 5000 500 5000 800] +) +Symbol['/' 1200] +( + SymbolLine[0 4500 3000 1500 800] +) +Symbol['0' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4000 2000 2000 800] +) +Symbol['1' 1200] +( + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1000 1000 1000 5000 800] + SymbolLine[0 2000 1000 1000 800] +) +Symbol['2' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[0 5000 2500 2500 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['3' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol['4' 1200] +( + SymbolLine[0 3000 2000 1000 800] + SymbolLine[0 3000 2500 3000 800] + SymbolLine[2000 1000 2000 5000 800] +) +Symbol['5' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 1000 0 3000 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[500 2500 1500 2500 800] + SymbolLine[1500 2500 2000 3000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['6' 1200] +( + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[0 3000 1500 3000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3500 2000 4500 800] +) +Symbol['7' 1200] +( + SymbolLine[0 5000 2500 2500 800] + SymbolLine[2500 1000 2500 2500 800] + SymbolLine[0 1000 2500 1000 800] +) +Symbol['8' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2500 800] + SymbolLine[1500 3000 2000 2500 800] +) +Symbol['9' 1200] +( + SymbolLine[0 5000 2000 3000 800] + SymbolLine[2000 1500 2000 3000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol[':' 1200] +( + SymbolLine[0 2500 500 2500 800] + SymbolLine[0 3500 500 3500 800] +) +Symbol[';' 1200] +( + SymbolLine[0 5000 1000 4000 800] + SymbolLine[1000 2500 1000 3000 800] +) +Symbol['<' 1200] +( + SymbolLine[0 3000 1000 2000 800] + SymbolLine[0 3000 1000 4000 800] +) +Symbol['=' 1200] +( + SymbolLine[0 2500 2000 2500 800] + SymbolLine[0 3500 2000 3500 800] +) +Symbol['>' 1200] +( + SymbolLine[0 2000 1000 3000 800] + SymbolLine[0 4000 1000 3000 800] +) +Symbol['?' 1200] +( + SymbolLine[1000 3000 1000 3500 800] + SymbolLine[1000 4500 1000 5000 800] + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2000 800] + SymbolLine[1000 3000 2000 2000 800] +) +Symbol['@' 1200] +( + SymbolLine[0 1000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 4000 5000 800] + SymbolLine[5000 3500 5000 1000 800] + SymbolLine[5000 1000 4000 0 800] + SymbolLine[4000 0 1000 0 800] + SymbolLine[1000 0 0 1000 800] + SymbolLine[1500 2000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 3000 3500 800] + SymbolLine[3000 3500 3500 3000 800] + SymbolLine[3500 3000 4000 3500 800] + SymbolLine[3500 3000 3500 1500 800] + SymbolLine[3500 2000 3000 1500 800] + SymbolLine[2000 1500 3000 1500 800] + SymbolLine[2000 1500 1500 2000 800] + SymbolLine[4000 3500 5000 3500 800] +) +Symbol['A' 1200] +( + SymbolLine[0 1500 0 5000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['B' 1200] +( + SymbolLine[0 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] +) +Symbol['C' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] +) +Symbol['D' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[0 5000 2000 5000 800] + SymbolLine[0 1000 2000 1000 800] +) +Symbol['E' 1200] +( + SymbolLine[0 3000 1500 3000 800] + SymbolLine[0 5000 2000 5000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] +) +Symbol['F' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 3000 1500 3000 800] +) +Symbol['G' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[1000 3000 2000 3000 800] +) +Symbol['H' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[2500 1000 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['I' 1200] +( + SymbolLine[0 1000 1000 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 1000 5000 800] +) +Symbol['J' 1200] +( + SymbolLine[0 1000 1500 1000 800] + SymbolLine[1500 1000 1500 4500 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['K' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3000 2000 1000 800] + SymbolLine[0 3000 2000 5000 800] +) +Symbol['L' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['M' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 1500 2500 800] + SymbolLine[1500 2500 3000 1000 800] + SymbolLine[3000 1000 3000 5000 800] +) +Symbol['N' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 2500 4000 800] + SymbolLine[2500 1000 2500 5000 800] +) +Symbol['O' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['P' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol['Q' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1000 4000 2000 5000 800] +) +Symbol['R' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[500 3000 2500 5000 800] +) +Symbol['S' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['T' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['U' 1200] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 1000 2000 4500 800] +) +Symbol['V' 1200] +( + SymbolLine[0 1000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[2000 1000 2000 4000 800] +) +Symbol['W' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 1500 3500 800] + SymbolLine[1500 3500 3000 5000 800] + SymbolLine[3000 1000 3000 5000 800] +) +Symbol['X' 1200] +( + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 2500 4000 800] + SymbolLine[2500 4000 2500 5000 800] + SymbolLine[0 4000 0 5000 800] + SymbolLine[0 4000 2500 1500 800] + SymbolLine[2500 1000 2500 1500 800] +) +Symbol['Y' 1200] +( + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 1000 2500 800] + SymbolLine[1000 2500 2000 1500 800] + SymbolLine[2000 1000 2000 1500 800] + SymbolLine[1000 2500 1000 5000 800] +) +Symbol['Z' 1200] +( + SymbolLine[0 1000 2500 1000 800] + SymbolLine[2500 1000 2500 1500 800] + SymbolLine[0 4000 2500 1500 800] + SymbolLine[0 4000 0 5000 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['[' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['\' 1200] +( + SymbolLine[0 1500 3000 4500 800] +) +Symbol[']' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['^' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1500 800] +) +Symbol['_' 1200] +( + SymbolLine[0 5000 2000 5000 800] +) +Symbol['a' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[2000 4500 2500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['b' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] +) +Symbol['c' 1200] +( + SymbolLine[500 3000 2000 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] +) +Symbol['d' 1200] +( + SymbolLine[2000 1000 2000 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] +) +Symbol['e' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[0 4000 2000 4000 800] + SymbolLine[2000 4000 2000 3500 800] +) +Symbol['f' 1000] +( + SymbolLine[500 1500 500 5000 800] + SymbolLine[500 1500 1000 1000 800] + SymbolLine[1000 1000 1500 1000 800] + SymbolLine[0 3000 1000 3000 800] +) +Symbol['g' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[2000 3000 2000 6000 800] +) +Symbol['h' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] +) +Symbol['i' 1000] +( + SymbolLine[0 2000 0 2500 800] + SymbolLine[0 3500 0 5000 800] +) +Symbol['j' 1000] +( + SymbolLine[500 2000 500 2500 800] + SymbolLine[500 3500 500 6000 800] + SymbolLine[0 6500 500 6000 800] +) +Symbol['k' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 1500 5000 800] + SymbolLine[0 3500 1000 2500 800] +) +Symbol['l' 1000] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['m' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[2000 3500 2500 3000 800] + SymbolLine[2500 3000 3000 3000 800] + SymbolLine[3000 3000 3500 3500 800] + SymbolLine[3500 3500 3500 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['n' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['o' 1200] +( + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['p' 1200] +( + SymbolLine[500 3500 500 6500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[1000 5000 2000 5000 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['q' 1200] +( + SymbolLine[2000 3500 2000 6500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['r' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['s' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2000 4000 2500 4500 800] + SymbolLine[500 4000 2000 4000 800] + SymbolLine[0 3500 500 4000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['t' 1000] +( + SymbolLine[500 1000 500 4500 800] + SymbolLine[500 4500 1000 5000 800] + SymbolLine[0 2500 1000 2500 800] +) +Symbol['u' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3000 2000 4500 800] +) +Symbol['v' 1200] +( + SymbolLine[0 3000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[2000 3000 2000 4000 800] +) +Symbol['w' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[1500 3000 1500 4500 800] + SymbolLine[1500 4500 2000 5000 800] + SymbolLine[2000 5000 2500 5000 800] + SymbolLine[2500 5000 3000 4500 800] + SymbolLine[3000 3000 3000 4500 800] +) +Symbol['x' 1200] +( + SymbolLine[0 3000 2000 5000 800] + SymbolLine[0 5000 2000 3000 800] +) +Symbol['y' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 6000 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['z' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[0 5000 2000 3000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['{' 1200] +( + SymbolLine[500 1500 1000 1000 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['|' 1200] +( + SymbolLine[0 1000 0 5000 800] +) +Symbol['}' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[500 2500 1000 3000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['~' 1200] +( + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1000 3000 800] + SymbolLine[1000 3000 1500 3500 800] + SymbolLine[1500 3500 2000 3500 800] + SymbolLine[2000 3500 2500 3000 800] +) +Via[30000 20000 10000 2000 0 5000 "" ""] +Via[80000 20000 10000 2000 0 5000 "" ""] +Layer(1 "component") +( + Line[10000 20000 20000 20000 2000 2000 "clearline"] + Line[40000 20000 50000 20000 2000 2000 "clearline"] + Line[60000 20000 70000 20000 2000 2000 "clearline"] + Line[100000 20000 84848 11254 2000 2000 "clearline"] + Arc[30000 20000 10000 10000 2000 2000 270 -90 "clearline"] + Arc[30000 20000 10000 10000 2000 2000 270 90 "clearline"] + Arc[80000 20000 10000 10000 2000 2000 270 -29 "clearline"] + Arc[80000 20000 10000 10000 2000 2000 270 90 "clearline"] +) +Layer(2 "solder") +( +) +Layer(3 "GND") +( +) +Layer(4 "power") +( +) +Layer(5 "signal1") +( +) +Layer(6 "signal2") +( +) +Layer(7 "signal3") +( +) +Layer(8 "signal4") +( +) +Layer(9 "silk") +( +) +Layer(10 "silk") +( + Line[33000 20000 38000 20000 500 2000 "clearline"] + Line[40000 13000 40000 18000 500 2000 "clearline"] + Line[42000 20000 47000 20000 500 2000 "clearline"] + Line[40000 22000 40000 27000 500 2000 "clearline"] + Line[77848 11254 82848 11254 500 2000 "clearline"] + Line[84848 4254 84848 9254 500 2000 "clearline"] + Line[86848 11254 91848 11254 500 2000 "clearline"] + Line[84848 13254 84848 18254 500 2000 "clearline"] + Arc[40000 20000 2000 2000 500 2000 0 -90 "clearline"] + Arc[39999 20001 2001 2001 500 2000 270 -90 "clearline"] + Arc[40002 20002 1998 1998 500 2000 180 -90 "clearline"] + Arc[40002 19998 2002 2002 500 2000 90 -90 "clearline"] + Arc[84848 11254 2000 2000 500 2000 0 -90 "clearline"] + Arc[84847 11255 2001 2001 500 2000 270 -90 "clearline"] + Arc[84850 11256 1998 1998 500 2000 180 -90 "clearline"] + Arc[84850 11252 2002 2002 500 2000 90 -90 "clearline"] +) Index: tags/1.0.5/doc/puller.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/puller.pdf =================================================================== --- tags/1.0.5/doc/puller.pdf (nonexistent) +++ tags/1.0.5/doc/puller.pdf (revision 953) Property changes on: tags/1.0.5/doc/puller.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/puller.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/puller.png =================================================================== --- tags/1.0.5/doc/puller.png (nonexistent) +++ tags/1.0.5/doc/puller.png (revision 953) Property changes on: tags/1.0.5/doc/puller.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/refcard.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/refcard.pdf =================================================================== --- tags/1.0.5/doc/refcard.pdf (nonexistent) +++ tags/1.0.5/doc/refcard.pdf (revision 953) Property changes on: tags/1.0.5/doc/refcard.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/refcard.tex =================================================================== --- tags/1.0.5/doc/refcard.tex (nonexistent) +++ tags/1.0.5/doc/refcard.tex (revision 953) @@ -0,0 +1,258 @@ +% $Id$ +% +% COPYRIGHT +% +% PCB, interactive printed circuit board design +% Copyright (C) 1994, 1995 Thomas Nau +% Copyright (C) 1998, 1999, 2000, 2001 harry eaton +% Copyright (C) 2009 Chitlesh Goorah +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +% +% Contact addresses for paper mail and Email: +% Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +% Thomas.Nau@rz.uni-ulm.de + + +\documentclass[11pt,landscape]{article} +\usepackage{multicol} +\usepackage{calc} +\usepackage{ifthen} +\usepackage[landscape,left=2.5cm,top=2cm,right=2cm,bottom=2cm,nohead]{geometry} + +% Turn off header and footer +\pagestyle{empty} + +% Redefine section commands to use less space +\makeatletter +\renewcommand{\section}{\@startsection{section}{1}{0mm}% + {-1ex plus -.5ex minus -.2ex}% + {0.5ex plus .2ex}%x + {\normalfont\large\bfseries}} +\renewcommand{\subsection}{\@startsection{subsection}{2}{0mm}% + {-1explus -.5ex minus -.2ex}% + {0.5ex plus .2ex}% + {\normalfont\normalsize\bfseries}} +\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{0mm}% + {-1ex plus -.5ex minus -.2ex}% + {1ex plus .2ex}% + {\normalfont\small\bfseries}} +\makeatother + +% Define BibTeX command +\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} + +% Don't print section numbers +\setcounter{secnumdepth}{0} + + +\setlength{\parindent}{0pt} +\setlength{\parskip}{0pt plus 0.5ex} + +%------------------------------------------------------------------ +% some new commands to define the modifier keys +% +\newcommand{\Shift}{{\it [S]}} +\newcommand{\Ctrl}{{\it [C]}} +\newcommand{\Mod}{{\it [M]}} +\newcommand{\Btn}{{\it Btn}} +\newcommand{\Fun}{{\it F}} + +\begin{document} +\raggedright +\footnotesize +\begin{multicols}{3} + + +% multicol parameters +% These lengths are set only within the two main columns +%\setlength{\columnseprule}{0.25pt} +\setlength{\premulticols}{1pt} +\setlength{\postmulticols}{1pt} +\setlength{\multicolsep}{1pt} +\setlength{\columnsep}{2pt} + +\begin{center} + \Large{\textbf{PCB Command reference}} + \footnote{http://pcb.gpleda.org/index.html} + \footnote{Obviously \Shift, \Ctrl, \Mod, \Fun \space and \Btn \space mean the shift, + control, modifier1 (BTNMOD for buttons), function key and mouse button.} \\ +\end{center} + +\section{Misc operations} +\begin{tabular}{@{}ll@{}} +backspace & remove object \\ +\Shift\Ctrl\Btn1 & remove object \\ +scroll wheel & vertical pan \\ +\Shift scroll wheel & horizontal pan \\ +\Btn1 & current mode action\\ +u & undo operation \\ +\Shift r & redo operation \\ +\Shift\Ctrl u & clear undo-list \\ +tab & switch viewing side \\ +cursor key & move crosshair 1 grid\\ +\Shift cursor key! & move crosshair 10 grid\\ +\end{tabular} + + +\section{Connections} +\begin{tabular}{@{}ll@{}} +\Shift f & reset found connections \\ +f & find connections \\ +\Shift backspace & remove connections \\ +\end{tabular} + + +\section{User (:) commands} +\begin{tabular}{@{}ll@{}} +:DRC() & check layout for rule violations \\ +:l [file] & load data file \\ +:le [file] & load element to buffer \\ +:m [file] & load layout to buffer \\ +:q & quit application \\ +:rn [file] & load netlist \\ +:s [file] & save data as file \\ +\end{tabular} + +\section{Display} +\begin{tabular}{@{}ll@{}} +c & center display \\ +g & increase grid spacing \\ +\Shift g & decrease grid spacing \\ +\Ctrl m & mark location \\ +r & clear and redraw output \\ +z & zoom in \\ +\Shift z & zoom out \\ +v & zoom extents \\ +\Shift\Btn3 & temporary zoom extents \\ +\end{tabular} + + +\section{Selections} +\begin{tabular}{@{}ll@{}} +\Btn2 & select/deselect object \\ +\Shift\Btn2 & toggle object to selection \\ +drag \Btn2 & select only objects in box \\ +drag \Shift\Btn2 & add box to selection \\ +\Shift m & move selected to current layer \\ +\end{tabular} + + +\section{Copy and move} +\begin{tabular}{@{}ll@{}} +drag \Btn2 & move object or selection\\ +drag \Mod\Btn2 & copy object \\ +drag \Shift\Mod\Btn2 & override rubberband \& move \\ +m & move to current layer \\ +\end{tabular} + + +\section{Pastebuffer} +\begin{tabular}{@{}ll@{}} +\Ctrl x & copy selected objects to buffer \\ + & and enter pastebuffer mode \\ +\Shift \Ctrl x & cut selected objects to buffer \\ + & and enter pastebuffer mode \\ +\Btn1 & in pastebuffer mode copy to layout \\ +\Shift \Fun7 & rotate 90 degree cc \\ +\Ctrl 1$\cdots$5 & select buffer \# 1$\cdots$5 \\ +\end{tabular} + + +\section{Sizing} +\begin{tabular}{@{}ll@{}} +s & increase size of TLAPV\footnotemark\\ +\Shift s & decrease size of TLAPV\\ +\Mod s & increase drill size of PV \\ +\Shift\Mod s & decrease drill size of PV \\ +k & increase clearance of LAPV\\ +\Shift\ k & decrease clearance of LAPV\\ +\end{tabular} +\footnotetext{TLAPV: text, line, arc, pin or via} + + +\section{Element} +\begin{tabular}{@{}ll@{}} +d & display pinout \\ +\Shift d & open pinout window \\ +h & hide/show element name \\ +n & change element name \\ +\end{tabular} + + +\section{Pin/pad} +\begin{tabular}{@{}ll@{}} +n & change name \\ +q & toggle square flag \\ +\end{tabular} + + +\section{Via} +\begin{tabular}{@{}ll@{}} +\Fun1 & enter via-mode \\ +\Ctrl v & increase initial size \\ +\Shift \Ctrl v & decrease initial size \\ +\Mod v & inc. initial drilling hole \\ +\Shift\Mod v & dec. initial drilling hole \\ +\Ctrl h & convert via to mounting hole \\ +\end{tabular} + + +\section{Lines and arcs} +\begin{tabular}{@{}ll@{}} +\Fun2 & enter line mode \\ +\Fun3 & enter arc mode \\ +l & increase initial line size \\ +\Shift l & decrease initial line size \\ +period & toggle 45 degree enforcement \\ +/ & cycle multiline mode \\ +\Shift & override multiline mode \\ +\end{tabular} + + +\section{Polygon} +\begin{tabular}{@{}ll@{}} +\Fun5 & enter rectangle-mode \\ +\Fun6 & enter polygon-mode \\ +\Shift p & close path \\ +insert & enter insert point mode \\ +\end{tabular} + + +\section{Text} +\begin{tabular}{@{}ll@{}} +\Fun4 & enter text-mode \\ +n & edit string \\ +t & increase initial text size \\ +\Shift t & decrease initial text size \\ +\end{tabular} + + +\section{Rats nest} +\begin{tabular}{@{}ll@{}} +w & add all rats \\ +\Shift w & add rats to selected pins/pads \\ +e & delete all rats \\ +\Shift e & delete selected rats \\ +o & optimize all rats \\ +\Shift o & optimize selected rats \\ +\end{tabular} + + +\end{multicols} + + +\end{document} Index: tags/1.0.5/doc/stamp-vti =================================================================== --- tags/1.0.5/doc/stamp-vti (nonexistent) +++ tags/1.0.5/doc/stamp-vti (revision 953) @@ -0,0 +1,4 @@ +@set UPDATED 17 September 2011 +@set UPDATED-MONTH September 2011 +@set EDITION 20110918 +@set VERSION 20110918 Index: tags/1.0.5/doc/texinfo.tex =================================================================== --- tags/1.0.5/doc/texinfo.tex (nonexistent) +++ tags/1.0.5/doc/texinfo.tex (revision 953) @@ -0,0 +1,7086 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2005-01-30.17} +% +% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software +% Foundation, Inc. +% +% This texinfo.tex file 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, or (at +% your option) any later version. +% +% This texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write +% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +% Boston, MA 02111-1307, USA. +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or +% ftp://tug.org/tex/texinfo.tex +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + +\message{Basics,} +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexstar=\* +\let\ptext=\t + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% In some macros, we cannot use the `\? notation---the left quote is +% in some cases the escape char. +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\questChar = `\? +\chardef\semiChar = `\; +\chardef\underChar = `\_ + +\chardef\spaceChar = `\ % +\chardef\spacecat = 10 +\def\spaceisspace{\catcode\spaceChar=\spacecat} + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\undefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% For @cropmarks command. +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \escapechar = `\\ % use backslash in output files. + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingxxx.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 2\baselineskip + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \normalturnoffactive + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1 \unvbox#1 +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\next{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % We cannot use \next here, as it holds the macro to run; + % thus we reuse \temp. + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \next. +% (Similarily, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as enviroments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At runtime, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Evironment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +%% Simple single-character @ commands + +% @@ prints an @ +% Kludge this until the fonts are right (grr). +\def\@{{\tt\char64}} + +% This is turned off because it was never documented +% and you can use @w{...} around a quote to suppress ligatures. +%% Define @` and @' to be the same as ` and ' +%% but suppressing ligatures. +%\def\`{{`}} +%\def\'{{'}} + +% Used to generate quoted braces. +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} +\let\{=\mylbrace +\let\}=\myrbrace +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux file. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \c +\let\dotaccent = \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \t +\let\ubaraccent = \b +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=3000 } + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=3000 } + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=3000 } + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +% Old definition--didn't work. +%\parseargdef\need{\par % +%% This method tries to make TeX break the page naturally +%% if the depth of the box does not fit. +%{\baselineskip=0pt% +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak +%\prevdepth=-1000pt +%}} + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @include file insert text of that file as input. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable + \def\temp{\input #1 }% + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} + +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} + +% @sp n outputs n lines of vertical space + +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment + +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} + +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode\underChar = \active + \gdef\mathunderscore{% + \catcode\underChar=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a \ character. +% FYI, plain.tex uses \\ as a temporary control sequence (why?), but +% this is not advertised and we don't care. Texinfo does not +% otherwise define @\. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + } +} + +% @bullet and @minus need the same treatment as @math, just above. +\def\bullet{$\ptexbullet$} +\def\minus{$-$} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil + .\hfil.\hfil.% + \hskip 0pt plus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=3000 +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma = , + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. +\ifx\pdfoutput\undefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi +% +\ifpdf + \input pdfcolor + \pdfcatalog{/PageMode /UseOutlines}% + \def\dopdfimage#1#2#3{% + \def\imagewidth{#2}% + \def\imageheight{#3}% + % without \immediate, pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifx\empty\imagewidth\else width \imagewidth \fi + \ifx\empty\imageheight\else height \imageheight \fi + \ifnum\pdftexversion<13 + #1.pdf% + \else + {#1.pdf}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code in a section title + % aren't expanded. + \atdummies + \normalturnoffactive + \pdfdest name{#1} xyz% + }} + \def\pdfmkpgn#1{#1} + \let\linkcolor = \Blue % was Cyan, but that seems light? + \def\endlink{\Black\pdfendlink} + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node + % text, which might be empty if this toc entry had no + % corresponding node. #4 is the page number. + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worthwhile, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Thanh's hack / proper braces in bookmarks + \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace + \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace + % + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \input \jobname.toc + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. + \indexnofonts + \turnoffactive + \input \jobname.toc + \endgroup + } + % + \def\makelinks #1,{% + \def\params{#1}\def\E{END}% + \ifx\params\E + \let\nextmakelinks=\relax + \else + \let\nextmakelinks=\makelinks + \ifnum\lnkcount>0,\fi + \picknum{#1}% + \startlink attr{/Border [0 0 0]} + goto name{\pdfmkpgn{\the\pgn}}% + \linkcolor #1% + \advance\lnkcount by 1% + \endlink + \fi + \nextmakelinks + } + \def\picknum#1{\expandafter\pn#1} + \def\pn#1{% + \def\p{#1}% + \ifx\p\lbrace + \let\nextpn=\ppn + \else + \let\nextpn=\ppnn + \def\first{#1} + \fi + \nextpn + } + \def\ppn#1{\pgn=#1\gobble} + \def\ppnn{\pgn=\first} + \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \ifx\p\space\else\addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \fi + \nextsp} + \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + \def\pdfurl#1{% + \begingroup + \normalturnoffactive\def\@{@}% + \makevalueexpandable + \leavevmode\Red + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \linkcolor #1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\linkcolor = \relax + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + +% Default leading. +\newdimen\textleading \textleading = 13.2pt + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +\def\setleading#1{% + \normalbaselineskip = #1\relax + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% Set the font macro #1 to the font named #2, adding on the +% specified font prefix (normally `cm'). +% #3 is the font's design size, #4 is a scale factor +\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\undefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} %where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep} +\setfont\texttt\ttshape{10}{\mainmagstep} +\setfont\textbf\bfshape{10}{\mainmagstep} +\setfont\textit\itshape{10}{\mainmagstep} +\setfont\textsl\slshape{10}{\mainmagstep} +\setfont\textsf\sfshape{10}{\mainmagstep} +\setfont\textsc\scshape{10}{\mainmagstep} +\setfont\textttsl\ttslshape{10}{\mainmagstep} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1} +\setfont\deftt\ttshape{10}{\magstep1} +\setfont\defttsl\ttslshape{10}{\magstep1} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000} +\setfont\smalltt\ttshape{9}{1000} +\setfont\smallbf\bfshape{10}{900} +\setfont\smallit\itshape{9}{1000} +\setfont\smallsl\slshape{9}{1000} +\setfont\smallsf\sfshape{9}{1000} +\setfont\smallsc\scshape{10}{900} +\setfont\smallttsl\ttslshape{10}{900} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000} +\setfont\smallertt\ttshape{8}{1000} +\setfont\smallerbf\bfshape{10}{800} +\setfont\smallerit\itshape{8}{1000} +\setfont\smallersl\slshape{8}{1000} +\setfont\smallersf\sfshape{8}{1000} +\setfont\smallersc\scshape{10}{800} +\setfont\smallerttsl\ttslshape{10}{800} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3} +\setfont\titleit\itbshape{10}{\magstep4} +\setfont\titlesl\slbshape{10}{\magstep4} +\setfont\titlett\ttbshape{12}{\magstep3} +\setfont\titlettsl\ttslshape{10}{\magstep4} +\setfont\titlesf\sfbshape{17}{\magstep1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2} +\setfont\chapit\itbshape{10}{\magstep3} +\setfont\chapsl\slbshape{10}{\magstep3} +\setfont\chaptt\ttbshape{12}{\magstep2} +\setfont\chapttsl\ttslshape{10}{\magstep3} +\setfont\chapsf\sfbshape{17}{1000} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1} +\setfont\secit\itbshape{10}{\magstep2} +\setfont\secsl\slbshape{10}{\magstep2} +\setfont\sectt\ttbshape{12}{\magstep1} +\setfont\secttsl\ttslshape{10}{\magstep2} +\setfont\secsf\sfbshape{12}{\magstep1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf} +\setfont\ssecit\itbshape{10}{1315} +\setfont\ssecsl\slbshape{10}{1315} +\setfont\ssectt\ttbshape{12}{\magstephalf} +\setfont\ssecttsl\ttslshape{10}{1315} +\setfont\ssecsf\sfbshape{12}{\magstephalf} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000} +\setfont\reducedtt\ttshape{10}{1000} +\setfont\reducedbf\bfshape{10}{1000} +\setfont\reducedit\itshape{10}{1000} +\setfont\reducedsl\slshape{10}{1000} +\setfont\reducedsf\sfshape{10}{1000} +\setfont\reducedsc\scshape{10}{1000} +\setfont\reducedttsl\ttslshape{10}{1000} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{25pt}} +\def\titlefont#1{{\titlefonts\rm #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% +% I wish the USA used A4 paper. +% --karl, 24jan03. + + +% Set up the default fonts, so we can use them for creating boxes. +% +\textfonts \rm + +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000} +\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000} +\setfont\shortconttt\ttshape{12}{1000} + +%% Add scribe-like font environments, plus @l for inline lisp (usually sans +%% serif) and @ii for TeX italic + +% \smartitalic{ARG} outputs arg in italics, followed by an italic correction +% unless the following character is such as not to need one. +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} +\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\var=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% @b, explicit bold. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\frenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + } +\catcode`@=\other + +\def\t#1{% + {\tt \rawbackslash \frenchspacing #1}% + \null +} +\def\samp#1{`\tclose{#1}'\null} +\setfont\keyrm\rmshape{8}{1000} +\font\keysy=cmsy9 +\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% + \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% + \vbox{\hrule\kern-0.4pt + \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% + \kern-0.4pt\hrule}% + \kern-.06em\raise0.4pt\hbox{\angleright}}}} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @file, @option are the same as @samp. +\let\file=\samp +\let\option=\samp + +% @code is a modification of @t, +% which makes spaces the same size as normal in the surrounding text. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \frenchspacing + #1% + }% + \null +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. + +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. +% -- rms. +{ + \catcode`\-=\active + \catcode`\_=\active + % + \global\def\code{\begingroup + \catcode`\-=\active \let-\codedash + \catcode`\_=\active \let_\codeunder + \codex + } +} + +\def\realdash{-} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} +\def\codex #1{\tclose{#1}\endgroup} + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\arg{#1}% + \ifx\arg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\arg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\arg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle option `\arg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct.' +\kbdinputstyle distinct + +\def\xkey{\key} +\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +\ifx\one\xkey\ifx\threex\three \key{#2}% +\else{\tclose{\kbdfont\look}}\fi +\else{\tclose{\kbdfont\look}}\fi} + +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=\code +\let\env=\code +\let\command=\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. Perhaps eventually put in +% a hypertex \special here. +% +\def\uref#1{\douref #1,,,\finish} +\def\douref#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\frenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines + \let\tt=\authortt} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rm #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\authorfont \leftline{#1}}% + \fi +} + + +%%% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -\baselineskip + \global\advance\vsize by -\baselineskip +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\HEADINGSoff{% +\global\evenheadline={\hfil} \global\evenfootline={\hfil} +\global\oddheadline={\hfil} \global\oddfootline={\hfil}} +\HEADINGSoff +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\undefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + \def\itemcontents{#1}% + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. Note that \everycr resets \everytab. +\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +%% Test to see if parskip is larger than space between lines of +%% table. If not, do nothing. +%% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1', which must be on a line + % by itself. + \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}% + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \obeylines % + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +\def\enddoignore{\endgroup\ignorespaces} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\- = \active \catcode`\_ = \active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \undefined + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname\donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % Need these in case \tex is in effect and \{ is a \delimiter again. + % But can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. + \let\{ = \mylbrace + \let\} = \myrbrace + % + % \definedummyword defines \#1 as \realbackslash #1\space, thus + % effectively preventing its expansion. This is used only for control + % words, not control letters, because the \space would be incorrect + % for control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword##1{% + \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}% + }% + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% + }% + \let\definedummyaccent\definedummyletter + % + % Do the redefinitions. + \commondummies +} + +% For the aux file, @ is the escape character. So we want to redefine +% everything using @ instead of \realbackslash. When everything uses +% @, this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % (See comments in \indexdummies.) + \def\definedummyword##1{% + \expandafter\def\csname ##1\endcsname{@##1\space}% + }% + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{@##1}% + }% + \let\definedummyaccent\definedummyletter + % + % Do the redefinitions. + \commondummies +} + +% Called from \indexdummies and \atdummies. \definedummyword and +% \definedummyletter must be defined first. +% +\def\commondummies{% + % + \normalturnoffactive + % + \commondummiesnofonts + % + \definedummyletter{_}% + % + % Non-English letters. + \definedummyword{AA}% + \definedummyword{AE}% + \definedummyword{L}% + \definedummyword{OE}% + \definedummyword{O}% + \definedummyword{aa}% + \definedummyword{ae}% + \definedummyword{l}% + \definedummyword{oe}% + \definedummyword{o}% + \definedummyword{ss}% + \definedummyword{exclamdown}% + \definedummyword{questiondown}% + \definedummyword{ordf}% + \definedummyword{ordm}% + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword{bf}% + \definedummyword{gtr}% + \definedummyword{hat}% + \definedummyword{less}% + \definedummyword{sf}% + \definedummyword{sl}% + \definedummyword{tclose}% + \definedummyword{tt}% + % + \definedummyword{LaTeX}% + \definedummyword{TeX}% + % + % Assorted special characters. + \definedummyword{bullet}% + \definedummyword{comma}% + \definedummyword{copyright}% + \definedummyword{registeredsymbol}% + \definedummyword{dots}% + \definedummyword{enddots}% + \definedummyword{equiv}% + \definedummyword{error}% + \definedummyword{euro}% + \definedummyword{expansion}% + \definedummyword{minus}% + \definedummyword{pounds}% + \definedummyword{point}% + \definedummyword{print}% + \definedummyword{result}% + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable + % + % Normal spaces, not active ones. + \unsepspaces + % + % No macro expansion. + \turnoffmacros +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +% Better have this without active chars. +{ + \catcode`\~=\other + \gdef\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter{!}% + \definedummyaccent{"}% + \definedummyaccent{'}% + \definedummyletter{*}% + \definedummyaccent{,}% + \definedummyletter{.}% + \definedummyletter{/}% + \definedummyletter{:}% + \definedummyaccent{=}% + \definedummyletter{?}% + \definedummyaccent{^}% + \definedummyaccent{`}% + \definedummyaccent{~}% + \definedummyword{u}% + \definedummyword{v}% + \definedummyword{H}% + \definedummyword{dotaccent}% + \definedummyword{ringaccent}% + \definedummyword{tieaccent}% + \definedummyword{ubaraccent}% + \definedummyword{udotaccent}% + \definedummyword{dotless}% + % + % Texinfo font commands. + \definedummyword{b}% + \definedummyword{i}% + \definedummyword{r}% + \definedummyword{sc}% + \definedummyword{t}% + % + % Commands that take arguments. + \definedummyword{acronym}% + \definedummyword{cite}% + \definedummyword{code}% + \definedummyword{command}% + \definedummyword{dfn}% + \definedummyword{emph}% + \definedummyword{env}% + \definedummyword{file}% + \definedummyword{kbd}% + \definedummyword{key}% + \definedummyword{math}% + \definedummyword{option}% + \definedummyword{samp}% + \definedummyword{strong}% + \definedummyword{tie}% + \definedummyword{uref}% + \definedummyword{url}% + \definedummyword{var}% + \definedummyword{verb}% + \definedummyword{w}% + } +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{% + \expandafter\let\csname ##1\endcsname\asis + }% + % We can just ignore other control letters. + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{}% + }% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + % how to handle braces? + \def\_{\normalunderscore}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\aa{aa}% + \def\ae{ae}% + \def\l{l}% + \def\oe{oe}% + \def\o{o}% + \def\ss{ss}% + \def\exclamdown{!}% + \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\result{=>}% + % + % Don't write macro names. + \emptyusermacros +} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \ifvmode + \dosubindsanitize + \else + \dosubindwrite + \fi + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write will make \lastskip zero. The result is that sequences +% like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +% ..., ready, GO: +% +\def\dosubindsanitize{% + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \skip0 = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \count255 = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\skip0 glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\skip0 + \fi + % + \dosubindwrite + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\count255>9999 \penalty\count255 \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\skip0 + \fi +} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this frozes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#1}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like \dotfill except takes at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines this as the name of the chapter. +% page headings and footings can use it. @section does likewise. +% However, they are not reliable, because we don't use marks. +\def\thischapter{} +\def\thissection{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +% NOTE on use of \vbox for chapter headings, section headings, and such: +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. +% 3) Likewise, headings look best if no \parindent is used, and +% if justification is not attempted. Hence \raggedright. + + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +%%% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +%%% Define plain chapter starts, and page on/off switching for it +% Parameter controlling skip before chapter headings (if needed) + +\newskip\chapheadingskip + +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + \pchapsepmacro + {% + \chapfonts \rm + % + % Have to define \thissection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\thissection{#1}% + \gdef\thischaptername{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \gdef\thischapter{#1}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \gdef\thischapter{}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + % We don't substitute the actual chapter name into \thischapter + % because we don't want its macros evaluated now. And we don't + % use \thissection because that changes with each section. + % + \xdef\thischapter{\putwordAppendix{} \appendixletter: + \noexpand\thischaptername}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \xdef\thischapter{\putwordChapter{} \the\chapno: + \noexpand\thischaptername}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\sectionheading#1#2#3#4{% + {% + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rm + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Only insert the space after the number if we have a section number. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\thissection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \thissection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\thissection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\thissection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chfplain. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chfplain. + \donoderef{#3}% + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This is purely so the last item on the list is a known \penalty > + % 10000. This is so \startdefun can avoid allowing breakpoints after + % section headings. Otherwise, it would insert a valid breakpoint between: + % + % @section sec-whatever + % @deffn def-whatever + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + \toks0 = {#2}% + \toks2 = \expandafter{\lastnode}% + \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}% + {\the\toks2}{\noexpand\folio}}}% + \temp + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \def\thischapter{}% + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + % We can't do this, because then an actual ^ in a section + % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. + %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + + +% Normal (long) toc. +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, it should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @tex ... @end tex escapes into raw Tex temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain tex @ character. + +\envdef\tex{% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \escapechar=`\\ + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\*=\ptexstar + \let\t=\ptext + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\def\nonfillstart{% + \aboveenvbreak + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + \parindent = 0pt + \emergencystretch = 0pt % don't try to avoid overfull boxes + % @cartouche defines \nonarrowing to inhibit narrowing + % at next level down. + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \fi + \let\exdent=\nofillexdent +} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} + +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvs {lisp}{example}{% + \nonfillstart + \tt + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} + +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenv {display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenv{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\envdef\quotation{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount = \lispnarrowing + \let\nonarrowing = \relax + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% [Knuth] pp. 380,381,391 +% Disable Spanish ligatures ?` and !` of \tt font +\begingroup + \catcode`\`=\active\gdef`{\relax\lq} +\endgroup +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \catcode`\`=\active + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +\def\starttabbox{\setbox0=\hbox\bgroup} +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen0=\wd0 % the width so far, or since the previous tab + \divide\dimen0 by\tabw + \multiply\dimen0 by\tabw % compute previous multiple of \tabw + \advance\dimen0 by\tabw % advance to next multiple of \tabw + \wd0=\dimen0 \box0 \starttabbox + }% + } +\endgroup +\def\setupverbatim{% + \nonfillstart + \advance\leftskip by -\defbodyindent + % Easiest (and conventionally used) font for verbatim + \tt + \def\par{\leavevmode\egroup\box0\endgraf}% + \catcode`\`=\active + \tabexpand + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \defargscommonending, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + \ifnum\lastpenalty=10002 \penalty2000 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty 10002 % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remainnig is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +%%% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +%%% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \let\var=\ttslanted + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +\def\badparencount{% + \errmessage{Unbalanced parentheses in @def}% + \global\parencount=0 +} +\def\badbrackcount{% + \errmessage{Unbalanced square braces in @def}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newline. + % + % I've verified that it is necessary both for e-TeX and for ordinary TeX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? +\def\macrolist{} % List of all defined macros in the form + % \do\macro1\do\macro2... + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \. + +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. + +\def\scanctxt{% + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other +} + +\def\scanargctxt{% + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +\def\macroargctxt{% + \scanctxt + \catcode`\\=\other +} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. + +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0% + \else + \expandafter\parsemargdef \argl;% + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + % Add the macroname to \macrolist + \toks0 = \expandafter{\macrolist\do}% + \xdef\macrolist{\the\toks0 + \expandafter\noexpand\csname\the\macname\endcsname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\do\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx#1\relax + % remove this + \else + \noexpand\do \noexpand #1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname #1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.blah for each blah +% in the params list, to be ##N where N is the position in that list. +% That gets used by \mbodybackslash (above). + +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. + +\def\parsemargdef#1;{\paramno=0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1% + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \fi + \fi} + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg) +\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \next} + +% We want to disable all macros during \shipout so that they are not +% expanded by \write. +\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% + \edef\next{\macrolist}\expandafter\endgroup\next} + +% For \indexnofonts, we need to get rid of all macros, leaving only the +% arguments (if present). Of course this is not nearly correct, but it +% is the best we can do for now. makeinfo does not expand macros in the +% argument to @deffn, which ends up writing an index entry, and texindex +% isn't prepared for an index sort entry that starts with \. +% +% Since macro invocations are followed by braces, we can just redefine them +% to take a single TeX argument. The case of a macro invocation that +% goes to end-of-line is not handled. +% +\def\emptyusermacros{\begingroup + \def\do##1{\let\noexpand##1=\noexpand\asis}% + \edef\next{\macrolist}\expandafter\endgroup\next} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Just make them active and then expand them all to nothing. +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile + +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \thissection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \turnoffactive + \otherbackslash + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\thissection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \writexrdef{pg}{\folio}% will be written later, during \shipout + }% + \fi +} + +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + \def\printedmanual{\ignorespaces #5}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual\unskip}% + \setbox0=\hbox{\printedrefname\unskip}% + \ifdim \wd0 = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax + % Use the node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1 > 0pt + % It is in another manual, so we don't have it. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + \leavevmode + \getfilename{#4}% + {\turnoffactive \otherbackslash + \ifnum\filenamelength>0 + \startlink attr{/Border [0 0 0]}% + goto file{\the\filename.pdf} name{#1}% + \else + \startlink attr{/Border [0 0 0]}% + goto name{\pdfmkpgn{#1}}% + \fi + }% + \linkcolor + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \otherbackslash + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 = 0pt + \refx{#1-snt}% + \else + \printedrefname + \fi + % + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive \otherbackslash + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% + \fi + \fi + \endlink +\endgroup} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value. + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR#1\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readauxfile + \global\havexrefstrue + \fi + \closein 1 +} + +\def\readauxfile{\begingroup + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count 1=128 + \def\loop{% + \catcode\count 1=\other + \advance\count 1 by 1 + \ifnum \count 1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 + % + \input \jobname.aux +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarily, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\undefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing this stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \nobreak\bigskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \line\bgroup\hss + \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode \hss \egroup \bigbreak \fi % space after the image +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \thissection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\thissection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies \turnoffactive \otherbackslash + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \thissection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + +\message{localization,} +% and i18n. + +% @documentlanguage is usually given very early, just after +% @setfilename. If done too late, it may not override everything +% properly. Single argument is the language abbreviation. +% It would be nice if we could set up a hyphenation file here. +% +\parseargdef\documentlanguage{% + \tex % read txi-??.tex file in plain TeX. + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 + \endgroup +} +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? In the current directory +should work if nowhere else does.} + + +% @documentencoding should change something in TeX eventually, most +% likely, but for now just recognize it. +\let\documentencoding = \comment + + +% Page size parameters. +% +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be so finicky about underfull hboxes, either. +\hbadness = 2000 + +% Following George Bush, just get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; 3) voffset; +% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8) +% physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{46\baselineskip}{6in}% + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.5 (or so) format. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {\voffset}{.25in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{51\baselineskip}{160mm} + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1 + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other +\catcode`\~=\other +\catcode`\^=\other +\catcode`\_=\other +\catcode`\|=\other +\catcode`\<=\other +\catcode`\>=\other +\catcode`\+=\other +\catcode`\$=\other +\def\normaldoublequote{"} +\def\normaltilde{~} +\def\normalcaret{^} +\def\normalunderscore{_} +\def\normalverticalbar{|} +\def\normalless{<} +\def\normalgreater{>} +\def\normalplus{+} +\def\normaldollar{$}%$ font-lock fix + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active +\def~{{\tt\char126}} +\chardef\hat=`\^ +\catcode`\^=\active +\def^{{\tt \hat}} + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } + +\catcode`\|=\active +\def|{{\tt\char124}} +\chardef \less=`\< +\catcode`\<=\active +\def<{{\tt \less}} +\chardef \gtr=`\> +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +\catcode`\$=\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. +{\catcode`\\=\active + @gdef@rawbackslash{@let\=@backslashcurfont} + @gdef@otherbackslash{@let\=@realbackslash} +} + +% \realbackslash is an actual character `\' with catcode other. +{\catcode`\\=\other @gdef@realbackslash{\}} + +% \normalbackslash outputs one backslash in fixed width font. +\def\normalbackslash{{\tt\backslashcurfont}} + +\catcode`\\=\active + +% Used sometimes to turn off (effectively) the active characters +% even after parsing them. +@def@turnoffactive{% + @let"=@normaldoublequote + @let\=@realbackslash + @let~=@normaltilde + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let<=@normalless + @let>=@normalgreater + @let+=@normalplus + @let$=@normaldollar %$ font-lock fix + @unsepspaces +} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. (Thus, \ is not expandable when this is in +% effect.) +% +@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\{ in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also back turn on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These look ok in all fonts, so just make them not special. +@catcode`@& = @other +@catcode`@# = @other +@catcode`@% = @other + + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore Index: tags/1.0.5/doc/thermal.pcb =================================================================== --- tags/1.0.5/doc/thermal.pcb (nonexistent) +++ tags/1.0.5/doc/thermal.pcb (revision 953) @@ -0,0 +1,844 @@ +# release: pcb-bin 1.99q + +PCB["thermal" 300000 300000] + +Grid[5000.00000000 0 0 1] +Cursor[88600 72400 2.000000] +Thermal[0.500000] +DRC[699 400 800 800 1000 750] +Flags(0x0000000000000840) +Groups("1,s:2,c:3:4:5:6:7:8") +Styles["Signal,2500,30000,10000,0:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,200,2402,1181,600"] + +Symbol[' ' 1800] +( +) +Symbol['!' 1200] +( + SymbolLine[0 4500 0 5000 800] + SymbolLine[0 1000 0 3500 800] +) +Symbol['"' 1200] +( + SymbolLine[0 1000 0 2000 800] + SymbolLine[1000 1000 1000 2000 800] +) +Symbol['#' 1200] +( + SymbolLine[0 3500 2000 3500 800] + SymbolLine[0 2500 2000 2500 800] + SymbolLine[1500 2000 1500 4000 800] + SymbolLine[500 2000 500 4000 800] +) +Symbol['$' 1200] +( + SymbolLine[1500 1500 2000 2000 800] + SymbolLine[500 1500 1500 1500 800] + SymbolLine[0 2000 500 1500 800] + SymbolLine[0 2000 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4000 800] + SymbolLine[1500 4500 2000 4000 800] + SymbolLine[500 4500 1500 4500 800] + SymbolLine[0 4000 500 4500 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['%' 1200] +( + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[1000 2500 1500 2000 800] + SymbolLine[500 2500 1000 2500 800] + SymbolLine[0 2000 500 2500 800] + SymbolLine[0 5000 4000 1000 800] + SymbolLine[3500 5000 4000 4500 800] + SymbolLine[4000 4000 4000 4500 800] + SymbolLine[3500 3500 4000 4000 800] + SymbolLine[3000 3500 3500 3500 800] + SymbolLine[2500 4000 3000 3500 800] + SymbolLine[2500 4000 2500 4500 800] + SymbolLine[2500 4500 3000 5000 800] + SymbolLine[3000 5000 3500 5000 800] +) +Symbol['&' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 3500 1500 2000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[0 2500 2500 5000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[0 3500 0 4500 800] +) +Symbol[''' 1200] +( + SymbolLine[0 2000 1000 1000 800] +) +Symbol['(' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] +) +Symbol[')' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['*' 1200] +( + SymbolLine[0 2000 2000 4000 800] + SymbolLine[0 4000 2000 2000 800] + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol['+' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol[',' 1200] +( + SymbolLine[0 6000 1000 5000 800] +) +Symbol['-' 1200] +( + SymbolLine[0 3000 2000 3000 800] +) +Symbol['.' 1200] +( + SymbolLine[0 5000 500 5000 800] +) +Symbol['/' 1200] +( + SymbolLine[0 4500 3000 1500 800] +) +Symbol['0' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4000 2000 2000 800] +) +Symbol['1' 1200] +( + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1000 1000 1000 5000 800] + SymbolLine[0 2000 1000 1000 800] +) +Symbol['2' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[0 5000 2500 2500 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['3' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol['4' 1200] +( + SymbolLine[0 3000 2000 1000 800] + SymbolLine[0 3000 2500 3000 800] + SymbolLine[2000 1000 2000 5000 800] +) +Symbol['5' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 1000 0 3000 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[500 2500 1500 2500 800] + SymbolLine[1500 2500 2000 3000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['6' 1200] +( + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[0 3000 1500 3000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3500 2000 4500 800] +) +Symbol['7' 1200] +( + SymbolLine[0 5000 2500 2500 800] + SymbolLine[2500 1000 2500 2500 800] + SymbolLine[0 1000 2500 1000 800] +) +Symbol['8' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2500 800] + SymbolLine[1500 3000 2000 2500 800] +) +Symbol['9' 1200] +( + SymbolLine[0 5000 2000 3000 800] + SymbolLine[2000 1500 2000 3000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol[':' 1200] +( + SymbolLine[0 2500 500 2500 800] + SymbolLine[0 3500 500 3500 800] +) +Symbol[';' 1200] +( + SymbolLine[0 5000 1000 4000 800] + SymbolLine[1000 2500 1000 3000 800] +) +Symbol['<' 1200] +( + SymbolLine[0 3000 1000 2000 800] + SymbolLine[0 3000 1000 4000 800] +) +Symbol['=' 1200] +( + SymbolLine[0 2500 2000 2500 800] + SymbolLine[0 3500 2000 3500 800] +) +Symbol['>' 1200] +( + SymbolLine[0 2000 1000 3000 800] + SymbolLine[0 4000 1000 3000 800] +) +Symbol['?' 1200] +( + SymbolLine[1000 3000 1000 3500 800] + SymbolLine[1000 4500 1000 5000 800] + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2000 800] + SymbolLine[1000 3000 2000 2000 800] +) +Symbol['@' 1200] +( + SymbolLine[0 1000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 4000 5000 800] + SymbolLine[5000 3500 5000 1000 800] + SymbolLine[5000 1000 4000 0 800] + SymbolLine[4000 0 1000 0 800] + SymbolLine[1000 0 0 1000 800] + SymbolLine[1500 2000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 3000 3500 800] + SymbolLine[3000 3500 3500 3000 800] + SymbolLine[3500 3000 4000 3500 800] + SymbolLine[3500 3000 3500 1500 800] + SymbolLine[3500 2000 3000 1500 800] + SymbolLine[2000 1500 3000 1500 800] + SymbolLine[2000 1500 1500 2000 800] + SymbolLine[4000 3500 5000 3500 800] +) +Symbol['A' 1200] +( + SymbolLine[0 1500 0 5000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['B' 1200] +( + SymbolLine[0 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] +) +Symbol['C' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] +) +Symbol['D' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[0 5000 2000 5000 800] + SymbolLine[0 1000 2000 1000 800] +) +Symbol['E' 1200] +( + SymbolLine[0 3000 1500 3000 800] + SymbolLine[0 5000 2000 5000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] +) +Symbol['F' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 3000 1500 3000 800] +) +Symbol['G' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[1000 3000 2000 3000 800] +) +Symbol['H' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[2500 1000 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['I' 1200] +( + SymbolLine[0 1000 1000 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 1000 5000 800] +) +Symbol['J' 1200] +( + SymbolLine[0 1000 1500 1000 800] + SymbolLine[1500 1000 1500 4500 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['K' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3000 2000 1000 800] + SymbolLine[0 3000 2000 5000 800] +) +Symbol['L' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['M' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 1500 2500 800] + SymbolLine[1500 2500 3000 1000 800] + SymbolLine[3000 1000 3000 5000 800] +) +Symbol['N' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 2500 4000 800] + SymbolLine[2500 1000 2500 5000 800] +) +Symbol['O' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['P' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol['Q' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1000 4000 2000 5000 800] +) +Symbol['R' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[500 3000 2500 5000 800] +) +Symbol['S' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['T' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['U' 1200] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 1000 2000 4500 800] +) +Symbol['V' 1200] +( + SymbolLine[0 1000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[2000 1000 2000 4000 800] +) +Symbol['W' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 1500 3500 800] + SymbolLine[1500 3500 3000 5000 800] + SymbolLine[3000 1000 3000 5000 800] +) +Symbol['X' 1200] +( + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 2500 4000 800] + SymbolLine[2500 4000 2500 5000 800] + SymbolLine[0 4000 0 5000 800] + SymbolLine[0 4000 2500 1500 800] + SymbolLine[2500 1000 2500 1500 800] +) +Symbol['Y' 1200] +( + SymbolLine[0 1000 0 1500 800] + SymbolLine[0 1500 1000 2500 800] + SymbolLine[1000 2500 2000 1500 800] + SymbolLine[2000 1000 2000 1500 800] + SymbolLine[1000 2500 1000 5000 800] +) +Symbol['Z' 1200] +( + SymbolLine[0 1000 2500 1000 800] + SymbolLine[2500 1000 2500 1500 800] + SymbolLine[0 4000 2500 1500 800] + SymbolLine[0 4000 0 5000 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['[' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['\' 1200] +( + SymbolLine[0 1500 3000 4500 800] +) +Symbol[']' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['^' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1500 800] +) +Symbol['_' 1200] +( + SymbolLine[0 5000 2000 5000 800] +) +Symbol['a' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[2000 4500 2500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['b' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] +) +Symbol['c' 1200] +( + SymbolLine[500 3000 2000 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] +) +Symbol['d' 1200] +( + SymbolLine[2000 1000 2000 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] +) +Symbol['e' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[0 4000 2000 4000 800] + SymbolLine[2000 4000 2000 3500 800] +) +Symbol['f' 1000] +( + SymbolLine[500 1500 500 5000 800] + SymbolLine[500 1500 1000 1000 800] + SymbolLine[1000 1000 1500 1000 800] + SymbolLine[0 3000 1000 3000 800] +) +Symbol['g' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[2000 3000 2000 6000 800] +) +Symbol['h' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] +) +Symbol['i' 1000] +( + SymbolLine[0 2000 0 2500 800] + SymbolLine[0 3500 0 5000 800] +) +Symbol['j' 1000] +( + SymbolLine[500 2000 500 2500 800] + SymbolLine[500 3500 500 6000 800] + SymbolLine[0 6500 500 6000 800] +) +Symbol['k' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 1500 5000 800] + SymbolLine[0 3500 1000 2500 800] +) +Symbol['l' 1000] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['m' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[2000 3500 2500 3000 800] + SymbolLine[2500 3000 3000 3000 800] + SymbolLine[3000 3000 3500 3500 800] + SymbolLine[3500 3500 3500 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['n' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['o' 1200] +( + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['p' 1200] +( + SymbolLine[500 3500 500 6500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[1000 5000 2000 5000 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['q' 1200] +( + SymbolLine[2000 3500 2000 6500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['r' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['s' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2000 4000 2500 4500 800] + SymbolLine[500 4000 2000 4000 800] + SymbolLine[0 3500 500 4000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['t' 1000] +( + SymbolLine[500 1000 500 4500 800] + SymbolLine[500 4500 1000 5000 800] + SymbolLine[0 2500 1000 2500 800] +) +Symbol['u' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3000 2000 4500 800] +) +Symbol['v' 1200] +( + SymbolLine[0 3000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[2000 3000 2000 4000 800] +) +Symbol['w' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[1500 3000 1500 4500 800] + SymbolLine[1500 4500 2000 5000 800] + SymbolLine[2000 5000 2500 5000 800] + SymbolLine[2500 5000 3000 4500 800] + SymbolLine[3000 3000 3000 4500 800] +) +Symbol['x' 1200] +( + SymbolLine[0 3000 2000 5000 800] + SymbolLine[0 5000 2000 3000 800] +) +Symbol['y' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 6000 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['z' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[0 5000 2000 3000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['{' 1200] +( + SymbolLine[500 1500 1000 1000 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['|' 1200] +( + SymbolLine[0 1000 0 5000 800] +) +Symbol['}' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[500 2500 1000 3000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['~' 1200] +( + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1000 3000 800] + SymbolLine[1000 3000 1500 3500 800] + SymbolLine[1500 3500 2000 3500 800] + SymbolLine[2000 3500 2500 3000 800] +) +Via[45000 135000 30000 10000 0 10000 "" "thermal(0S)"] +Via[255000 135000 30000 10000 0 10000 "" ""] +Via[150000 135000 30000 10000 0 10000 "" "thermal(0)"] +Layer(1 "component") +( + Polygon("clearpoly") + ( + [5000 95000] [290000 95000] [290000 175000] [5000 175000] + ) +) +Layer(2 "solder") +( +) +Layer(3 "GND") +( +) +Layer(4 "power") +( +) +Layer(5 "signal1") +( +) +Layer(6 "signal2") +( +) +Layer(7 "unused") +( +) +Layer(8 "unused") +( +) +Layer(9 "silk") +( +) +Layer(10 "silk") +( + Line[255000 180000 255000 160000 2500 10000 "clearline"] + Line[255000 160000 260000 165000 2500 10000 "clearline"] + Line[45000 160000 50000 165000 2500 10000 "clearline"] + Line[45000 160000 40000 165000 2500 10000 "clearline"] + Line[45000 180000 45000 160000 2500 10000 "clearline"] + Line[255000 160000 250000 165000 2500 10000 "clearline"] + Line[150000 160000 155000 165000 2500 10000 "clearline"] + Line[150000 160000 145000 165000 2500 10000 "clearline"] + Line[150000 180000 150000 160000 2500 10000 "clearline"] + Text[220000 190000 0 200 "no connection" ""] + Text[15000 180000 0 200 "Via/Pin with " ""] + Text[5000 190000 0 200 "solid connection " ""] + Text[225000 180000 0 200 "Via/Pin with" ""] + Text[120000 180000 0 200 "Via/Pin with " ""] + Text[130000 190000 0 200 "thermal" ""] +) Index: tags/1.0.5/doc/thermal.pdf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/thermal.pdf =================================================================== --- tags/1.0.5/doc/thermal.pdf (nonexistent) +++ tags/1.0.5/doc/thermal.pdf (revision 953) Property changes on: tags/1.0.5/doc/thermal.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/thermal.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc/thermal.png =================================================================== --- tags/1.0.5/doc/thermal.png (nonexistent) +++ tags/1.0.5/doc/thermal.png (revision 953) Property changes on: tags/1.0.5/doc/thermal.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc/version.texi =================================================================== --- tags/1.0.5/doc/version.texi (nonexistent) +++ tags/1.0.5/doc/version.texi (revision 953) @@ -0,0 +1,4 @@ +@set UPDATED 17 September 2011 +@set UPDATED-MONTH September 2011 +@set EDITION 20110918 +@set VERSION 20110918 Index: tags/1.0.5/doc/wire_size.tab =================================================================== --- tags/1.0.5/doc/wire_size.tab (nonexistent) +++ tags/1.0.5/doc/wire_size.tab (revision 953) @@ -0,0 +1,102 @@ +# $Id$ +# + +97 .0059 +96 .0063 +95 .0067 +94 .0071 +93 .0075 +92 .0079 +91 .0083 +90 .0087 +89 .0091 +88 .0095 +87 .0100 +86 .0105 +85 .0110 +84 .0115 +83 .0120 +82 .0125 +81 .0130 +80 .0135 +79 .0145 +78 .0160 +77 .0180 +76 .0200 +75 .0210 +74 .0225 +73 .0240 +72 .0250 +71 .0260 +70 .0280 +69 .0292 +68 .0310 +67 .0320 +66 .0330 +65 .0350 +64 .0360 +63 .0370 +62 .0380 +61 .0390 +60 .0400 +59 .0410 +58 .0420 +57 .0430 +56 .0465 +55 .0520 +54 .0550 +53 .0595 +52 .0635 +51 .0670 +50 .0700 +49 .0730 +48 .0760 +47 .0785 +46 .0810 +45 .0820 +44 .0860 +43 .0890 +42 .0935 +41 .0960 +40 .0980 +39 .0995 +38 .1015 +37 .1040 +36 .1065 +35 .1100 +34 .1110 +33 .1130 +32 .1160 +31 .1200 +30 .1285 +29 .1360 +28 .1405 +27 .1440 +26 .1470 +25 .1495 +24 .1520 +23 .1540 +22 .1570 +21 .1590 +20 .1610 +19 .1660 +18 .1695 +17 .1730 +16 .1770 +15 .1800 +14 .1820 +13 .1850 +12 .1890 +11 .1910 +10 .1935 +9 .1960 +8 .1990 +7 .2010 +6 .2040 +5 .2055 +4 .2090 +3 .2130 +2 .2210 +1 .2280 + + Index: tags/1.0.5/doc/wire_size.texi =================================================================== --- tags/1.0.5/doc/wire_size.texi (nonexistent) +++ tags/1.0.5/doc/wire_size.texi (revision 953) @@ -0,0 +1,40 @@ +@c Generated file. Do not edit directly +@c $Id$ +@multitable @columnfractions 0.167 0.167 0.167 0.167 0.167 0.167 +@item Drill @tab Diameter @tab Drill @tab Diameter @tab Drill @tab Diameter +@item Size @tab (inches) @tab Size @tab (inches) @tab Size @tab (inches) + +@item 97 @tab .0059 @tab 96 @tab .0063 @tab 95 @tab .0067 +@item 94 @tab .0071 @tab 93 @tab .0075 @tab 92 @tab .0079 +@item 91 @tab .0083 @tab 90 @tab .0087 @tab 89 @tab .0091 +@item 88 @tab .0095 @tab 87 @tab .0100 @tab 86 @tab .0105 +@item 85 @tab .0110 @tab 84 @tab .0115 @tab 83 @tab .0120 +@item 82 @tab .0125 @tab 81 @tab .0130 @tab 80 @tab .0135 +@item 79 @tab .0145 @tab 78 @tab .0160 @tab 77 @tab .0180 +@item 76 @tab .0200 @tab 75 @tab .0210 @tab 74 @tab .0225 +@item 73 @tab .0240 @tab 72 @tab .0250 @tab 71 @tab .0260 +@item 70 @tab .0280 @tab 69 @tab .0292 @tab 68 @tab .0310 +@item 67 @tab .0320 @tab 66 @tab .0330 @tab 65 @tab .0350 +@item 64 @tab .0360 @tab 63 @tab .0370 @tab 62 @tab .0380 +@item 61 @tab .0390 @tab 60 @tab .0400 @tab 59 @tab .0410 +@item 58 @tab .0420 @tab 57 @tab .0430 @tab 56 @tab .0465 +@item 55 @tab .0520 @tab 54 @tab .0550 @tab 53 @tab .0595 +@item 52 @tab .0635 @tab 51 @tab .0670 @tab 50 @tab .0700 +@item 49 @tab .0730 @tab 48 @tab .0760 @tab 47 @tab .0785 +@item 46 @tab .0810 @tab 45 @tab .0820 @tab 44 @tab .0860 +@item 43 @tab .0890 @tab 42 @tab .0935 @tab 41 @tab .0960 +@item 40 @tab .0980 @tab 39 @tab .0995 @tab 38 @tab .1015 +@item 37 @tab .1040 @tab 36 @tab .1065 @tab 35 @tab .1100 +@item 34 @tab .1110 @tab 33 @tab .1130 @tab 32 @tab .1160 +@item 31 @tab .1200 @tab 30 @tab .1285 @tab 29 @tab .1360 +@item 28 @tab .1405 @tab 27 @tab .1440 @tab 26 @tab .1470 +@item 25 @tab .1495 @tab 24 @tab .1520 @tab 23 @tab .1540 +@item 22 @tab .1570 @tab 21 @tab .1590 @tab 20 @tab .1610 +@item 19 @tab .1660 @tab 18 @tab .1695 @tab 17 @tab .1730 +@item 16 @tab .1770 @tab 15 @tab .1800 @tab 14 @tab .1820 +@item 13 @tab .1850 @tab 12 @tab .1890 @tab 11 @tab .1910 +@item 10 @tab .1935 @tab 9 @tab .1960 @tab 8 @tab .1990 +@item 7 @tab .2010 @tab 6 @tab .2040 @tab 5 @tab .2055 +@item 4 @tab .2090 @tab 3 @tab .2130 @tab 2 @tab .2210 +@item 1 @tab .2280 @tab @tab @tab @tab @end multitable + Index: tags/1.0.5/doc-rnd/Makefile =================================================================== --- tags/1.0.5/doc-rnd/Makefile (nonexistent) +++ tags/1.0.5/doc-rnd/Makefile (revision 953) @@ -0,0 +1,7 @@ +MENU_RES=../src/gpcb-menu.res ../src/pcb-menu.res +KEYLIST=../util/keylist.sh + +all: keys.html + +keys.html: $(MENU_RES) $(KEYLIST) + $(KEYLIST) $(MENU_RES) > keys.html \ No newline at end of file Index: tags/1.0.5/doc-rnd/TODO =================================================================== --- tags/1.0.5/doc-rnd/TODO (nonexistent) +++ tags/1.0.5/doc-rnd/TODO (revision 953) @@ -0,0 +1,51 @@ +BACK ANNOTATION + - renumbering action disabled; grep for BA_TODO + +BUGS +- distorted square pin bugs: + - rtree assert failure when NDEBUG is turned off and 'q' is pressed on a pin twice +- gpmi (and other buildings/plugins) not showing up in the about box + +CLEANUP + - remove libstroke? + +FEATURES +- UI: trace length calculation {small} +- UI: be able to manually change text line width {small} +- CORE: clear poly should be a per layer flag (on each objects) {?} +- CORE: inverse text {medium} +- BUILD: menuconfig and a config file for scconfig + + +Low prio: +- display net names on pins, vias (and maybe tracks?) when zoomed in enough +- DRC should wanr for thin poly hair +- prev grid size, next grid size +- 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? +- cleanup resources: + - better tree structs with less hidden properties (minor change in the res format: always require key=val pairs) + - gtk, lesstif: reorganize the code so that: + - menus are always created using a path (ghid_main_menu_real_add_resource) + - res->menu should be a common code +- check whether local copy of gts is needed +- gpmi: + - dialog: attribute dialog: mini parser from text + - fix debug draw in the gtk hid + - ACTE_action(): coords should not be int but Coord + - hid: hid_destroy (pair of hid_create) + - cleanup on unload: + - remove menus + - get timers to work +- win32 port {large} + - clean up central Makefile.in rules: + - remove cat, sed, grep where possible, use scconfig instead Index: tags/1.0.5/doc-rnd/ba.html =================================================================== --- tags/1.0.5/doc-rnd/ba.html (nonexistent) +++ tags/1.0.5/doc-rnd/ba.html (revision 953) @@ -0,0 +1,50 @@ + + +

pcb-rnd - the [ba] patches

+Back annotation was a long standing missing functionality. There has been +different suggestions, including: +
    +
  • back annotation is not needed at all, the user can do it manually +
  • pcb should generate a new netlist, the user should run diff on the netlists and manually edit the schematics +
  • gschem should be able to load netlists emitted by PCB; or gnetlist could reverse-process such a netlist +
+

+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 +demo video about how this happens in practice. +

+The modified gschem can be checked out from svn://repo.hu/geda-gaf-ba/trunk +

+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. + +

Design decisions

+This devlog entry functions +as a design decision document. + Another entry is a summary +on how the feature ended up in a private feature-fork of gschem. + +

save/load and compatibility

+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: +
    +
  • 1. No back annotation is made in pcb-rnd: the file stays compatible +
  • 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 again compatible with mainline pcb; this is called resolution of netlist patches +
  • 3. There are unresolved netlist patches saved in pcb-rnd and the user attempts to load the pcb file in mainline pcb: syntax error (but no data loss); solution: resolve the netlist patch as described in point 2. +
  • 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". +
  • 5. Any file saved by mainline PCB can be opened by pcb-rnd, back annotation does not affect that. + +
+ + +

plans

+Back annotation for further changes, e.g. value change, naming/renaming nets, +etc. + + Index: tags/1.0.5/doc-rnd/debian.html =================================================================== --- tags/1.0.5/doc-rnd/debian.html (nonexistent) +++ tags/1.0.5/doc-rnd/debian.html (revision 953) @@ -0,0 +1,18 @@ + + +

pcb-rnd - the [debian] patch

+ +The name of the package has been changed to pcb-rnd; a conflict with the +vanilla pcb is set. +

+The lesstif variant and pcb documentation are not compiled or packaged +- I don't need them. The possibility is still there to compile them, tho. +

+The gtk variant (pcb-rnd-gtk) has both dbus and gl disabled. +

+Versioning scheme changed to match svn revisions and tags of pcb-rnd. + +

plans

+No plans - this feature is fully implemented. + + Index: tags/1.0.5/doc-rnd/devlog/20150731a_menu.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150731a_menu.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150731a_menu.html (revision 953) @@ -0,0 +1,59 @@ + + +

pcb-rnd devlog

+

Dynamic menus

+

Background

+Before integrating gpmi scripting, pcb-rnd needs to be prepared to +interface with the scripts. The engine is pretty much ready since ages: +the action interface is ideal for scripts to register their actions or +execute existing actions. This also means the command line and batch +UI are instantly connected with scripts. +

+The only largely visible remaining portion is the GUI. pcb-gpmi supports +building dialog boxes using the current HID (so called attribute dialogs, +originally invented for exporter settings) and calling some simpler predefined +dialogs like a progress bar or alert. +

+What's really missing is a way to create new menus on the fly. The user +loads a script and the script makes up a menu with submenus, all bound to +the proper actions. +

+This introduces a nice dilemma, tho: there is a real cool menu configuration +file that makes the user able to reconfigure the menu system, hot keys, tool +tips and whatnot (I wish more applications had this feature!). What if a script +comes in and trolls the whole thing creating random menus at surprising +places in the menu system? How the user can control what the script could do +with his preciously crafted menu setup tailored to his own preferences? +

+I believe in sharp tools and careful users. I indeed plan to allow scripts to +do whatever they want with the menu system but I invent some conventions too. +As long as scripts stick to these conventions, the user retain control over +the menu layout. + +

How it works

+ +PCB reads *menu.res and builds the gui on startup; the menu system is +static after that point. pcb-rnd does the same on startup but also +stores all menus (referenced by their paths, like "/File/Save as") in a +hash table. Later on a call to a new hid function (create_menu()) can +create new menus or submenus, extending the menu tree at any point. +

+When a new menu "/File/foo" is created, using the hash create_menu() +finds out that /File already exists and doesn't create it but use the +existing widget from the hash. This means if the user creates menus from +the res file that are also created by the script, the res file sort of +overrides the script's later actions as all those menus will already exist +by the time the script tries to create them. +

+And here comes the conventions part: +

    +
  • there will be a new menu, called "/Plugins" +
  • each plugin should have its own submenu there (gpmi for scripting: "/Plugins/GPMI scripting") +
  • each script is just a child of the gpmi plugin so it should have its submenus under "Plugins/GPMI scripting/scriptname" +
+ +As long as plugins and scripts stick to this convention, the user can +create all the menus for all the plugins and scripts in advance. Stock +menu res files will have the /Plugin menu at least, so its place is fixed. + + Index: tags/1.0.5/doc-rnd/devlog/20150731b_gtk.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150731b_gtk.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150731b_gtk.html (revision 953) @@ -0,0 +1,36 @@ + + +

pcb-rnd devlog

+

dynamic gtk menus

+As described in the previous post, +pcb-rnd will feature dynamic menus. I first implemented this in the +gtk hid. +

+It turned out gtk was way too OOP for my taste1. It took about 6 +hours total, to implement and debug the feature. (As a comparison, it +took about 90 minutes to make the research related to +the resource structs in PCB and implement the HID modifications for +the new hid command). The trickiest part was +to figure the need of calling a show() on the menubar after adding +the new items. +

+When I didn't have that, only plain action menu/submenus showed up +(in already existing menu/ widgets), but +new (main) menus and menu/submenu/submenus didn't. After many hours of gdb +sessions I finally made sure (by printing all the widgets to stderr +recursively) that: +

    +
  • I am really adding the new widgets... +
  • ... under the right parent +
  • ... with the right properties +
+Then I also printed allocated dimensions and coordinates - but the values +were misleading. Finally I figured there was different flags like realization +and visibility, so printed them too. This revealed that all my new menus were +there in an invisible state. +
+

Footnotes

+1: not because of the show() call, but because of the way objects +are stored in memory: too many generic pointers casted forth and back, makes it +really hard to print all properties of a menu item (including its label) +with gdb. Index: tags/1.0.5/doc-rnd/devlog/20150801a_events.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150801a_events.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150801a_events.html (revision 953) @@ -0,0 +1,22 @@ + + +

pcb-rnd devlog

+

events

+PCB has a nice action infrastructure: most user actions are +implemented in smallish functions taking (int argc, char *argv[]). Menu +items, hotkeys, the command line and batch processing just call these +actions. This is the user->pcb_core direction of commands. +

+Before adding scripting to pcb-rnd, the other direction (pcb_core->user) has +to be implemented: an event infrastructure. Random parts of the core +or the HID code will yield events using a simple vararg event() function. +Other parts of PCB, especially plugins, can bind (sign up to) events with +function pointers. When an event is triggered, all functions signed up to +the event are called (in random order). +

+Passing arguments to events is similar to the arguments of actions, except +argv[] is not a char *[], but an event_arg_t *[]. event_arg_t has an enum +field for argument type and an union for the argument value. This means the +API is binary: integers are passed as integers, not as strings. + + Index: tags/1.0.5/doc-rnd/devlog/20150803a_scriptig.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150803a_scriptig.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150803a_scriptig.html (revision 953) @@ -0,0 +1,36 @@ + + +

pcb-rnd devlog

+

scripting

+Most of the infrastructure for a scriptable pcb had been there in pcb-gpmi. +I had also finished some gpmi cleanup and pcb +(menu and + events ) subprojects last week. +These made it easier to get to reach the current status after a weekend +coding marathon: +
    +
  • dialog boxes for managing (loading/unloading) scripts -- check out the videos: + list scripts and get details or + load a new script + + +
  • import, test, extend the glue layer; scripts can: +
      +
    • register new actions +
    • create new menus and submenus +
    • execute existing actions +
    • pop up simple dialog boxes (message, report, progress bar, file selection) -- check out the video +
    • build and pop up custom dialog boxes (so called attribute dialogs) +
    • search for objects (lines, arc, polys, vias, etc.) on the layout +
    • create new objects on the layout +
    • change "page" properties (dimensions of the board) +
    • debug draw on the gui (slightly broken on gtk due to some gtk hid bugs) +
    +
+

+My example scripts are written in awk, lua and tcl +at this point, but gpmi supports 7 other languages +(scheme, stutter (lisp), pascal, perl +php, python, ruby) which are also available in +pcb-rnd. + Index: tags/1.0.5/doc-rnd/devlog/20150816a_scriptig.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150816a_scriptig.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150816a_scriptig.html (revision 953) @@ -0,0 +1,28 @@ + + +

pcb-rnd devlog

+

scripting, 2

+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. +

+I have a Rosetta stone +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. +

+Another document, the +scripting intro 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. +

+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. +

+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. + Index: tags/1.0.5/doc-rnd/devlog/20150820a_dimensions.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150820a_dimensions.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150820a_dimensions.html (revision 953) @@ -0,0 +1,24 @@ + + +

pcb-rnd devlog

+

fp2anim dimensions

+After attacking the qfn()/qfp() parametric footprint problem today, +I realized fp2anim lacked a very important feature: dimension lines. +The footprint being generated is to match the datasheet. Checking the match +requires visible dimensions. +

+The new feature of fp2anim is to optionally display custom dimensions on +the preview. Generator scripts print #dimension comments in the footprint +file (not breaking the file format). The generator passes on a dimension +name along with the value. As a first attempt my conventions are: +

    +
  • add dimension lines for dimension type input parameters +
  • add dimension lines for calculated dimensions if they are likely to be informative and be included in the datasheet +
+ +

fp2anim vector font

+While working on the dimensions, I realized I had to switch to vector fonts: +the built-in pixel font of animator can not be rotated. The size of a vector +font text can be calculated, which also enables fp2anim to optionally place +semi-transparent bars behind the text to make it more visible on dark background +(like pads). Index: tags/1.0.5/doc-rnd/devlog/20150820b_qf.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150820b_qf.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150820b_qf.html (revision 953) @@ -0,0 +1,27 @@ + + +

pcb-rnd devlog

+

qf()

+The next group of footprints I decided to generate are qfn(), tqfp(), lqfp(). +The generic set of rules for these footprints is: +
    +
  • there is a virtual rectangle that forms rows of pads +
  • pads are evenly spaced among the edges of that rectangle +
  • pin numbering is counter-clockwise +
  • the body of the part may be inside of the rectangle or may extend over the pads +
+ +

low level flexibility vs. high level comfort

+qf() currently has 14 arguments. It is flexible enough to generate qfn, tqfp, +lqfp, and anything similar I've seen in the package datasheet of a major +vendor. However, it is not straight forward to convert datasheet tables +into qf() parameters. +

+On the other hand, in practice we need qfn() and tqfp(), which are special +cases of qf(). To nail the common use cases, qfn() and tqfp() narrows down +the number of parameters to 3..4. Even better, these parameters are exactly +those that are in the name of a typical QFN or TQFP footprint or in the first +few lines of the dimensions table. I call these scripts frontends to qf(). +

+This makes the common footprints very easy to produce using frontends while +leaves a (bit more complicated) plan B, qf(), for special cases. Index: tags/1.0.5/doc-rnd/devlog/20150821a_parametric_requirements.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150821a_parametric_requirements.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150821a_parametric_requirements.html (revision 953) @@ -0,0 +1,32 @@ + + +

pcb-rnd devlog

+

requirements for parametric footprint generation

+ +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: + +
    + +
  • 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) + +
  • 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 + +
  • 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). + +
  • 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. + +
Index: tags/1.0.5/doc-rnd/devlog/20150830a_fork_faq.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150830a_fork_faq.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150830a_fork_faq.html (revision 953) @@ -0,0 +1,234 @@ + + +

pcb-rnd devlog

+ +

Fork FAQ

+ +This document contains my short answers to questions commonly popping up +in endless flamewars on the geda mailing list. The purpose of this +document is not to convince anyone about any of the questions, 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. + +

1. Why did you fork?

+ +

1.1. Fragmentation is bad, your fork is harmful!

+I agree that fragmentation is bad. I believe the some 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 +

+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. + +

1.2. ... but how will you get all these merged with mainline?

+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. + +

1.3. ... but you are in the best position for a merge!

+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. + +

1.4. Ok then, but you won't have too many users.

+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. + +

1.5. I'd like to merge something from pcb-rnd to mainline

+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. + +

1.6. I'd like to merge something from mainline to pcb-rnd

+If the feature is in line with the goals of pcb-rnd, fine, I'll give +you svn commit access from day 0. + +

1.7. Would you abandon the development of pcb-rnd and join the mainline, if...

+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: +
    +
  • simple, centralized VCS (not just the UI, the whole thing) +
  • VCS based, zero-administration release and publish interface +
  • a sane build system instead of autotools +
  • the code won't switch to C++ +
+ + +

1.8. Would you join the development of gschem?

+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." +

+I don't expect any of this to happen. + + + +

2. git: did you know...

+
+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. + +

2.1. ... that there was an svn frontend to git?

+Yes. 2/3 of my problems with git and DVCS in general are not of technical +nature. I know the concepts of DVCS and I find them suboptimal in +case of small teams. A different UI or a good document won't help in that. + +

2.2. ... that there was this great document about git?

+See 2.1. + +

2.3. ... that DVCS is the future, anything centralized is bad, svn is obsolete?

+These are not facts, but slogans I don't believe in. + +

2.4. What if someone has to develop offline for long?

+In the 21th century, when we have cheap mobile internet even in eastern +Europe? + +

2.5. But feature X is harder with svn!

+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. + +

2.6. But there are no local repositories and you have to commit unfinished stuff and worry if anything breaks! And branching is hard

+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. +

+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. + +

2.7. But that's extra effort and makes life harder!

+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. + +

2.8. I don't agree with any of this, git is better!

+Cool, so go on using git. I didn't try to convince you not to, I just +explained why I won't. + +

3. opengl

+
+

3.1. But I need opengl!

+Use the mainline then. Or contribute the code for sane opengl support +in pcb-rnd. I can live with a solution where opengl is a separate HID and +is not the default one. + +

3.2. ... good, then please make that opengl hid!

+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. + +

3.3. Did you know that opengl can be turned off in mainline?

+Yes. If I have a fork, I want its defaults to reflect my preferences. + +

3.4. But transparent renders are so good on a board with many layers!

+Not for me: transparency made even a 2 layer board cryptic when I tried. See +3.1. + + +

4. programming languages, file formats

+
+

4.1. switch to C++, it is so much better

+Nope. I prefer C. + +

4.2. but pcb-rnd doesn't compile with a C++ compiled

+Correct: pcb-rnd is written in C. It also doesn't compile with a Pascal +compiler. + +

4.3. but mainline already invested in preparing a C++ transition

+Good for them. If I didn't have a fork, I'd fork the day when the first +C++ class is committed. + +

4.4. we need SQL for the file format

+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. + +

4.3. we need to switch to xml/json (or python or perl arrays)

+No, we don't need to. + +

4.4. ... but they are easier to parse because of existing libs

+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. + +

4.5. ... but the current file format doesn't support feature X

+True. And that's because the internal model (the in-core representation +and all the code handling that) 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. + +

4.6. ... but I can't build a database of the current lib

+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. + + +

5. scconfig, autotools, build systems

+
+

5.1. scconfig doesn't support feature X that autotools does

+Are you sure? Maybe it does, just uses a different syntax. If not, did +you try to send me a feature request? + +

5.2. scconfig's syntax is different

+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. + +

5.3. But ./configure has to have the same UI as autotools

+False. + +

5.4. Most people know autotools, there are merits in supporting the same features or UI

+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. + +

5.5. But autotools is so much better!

+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. + +

5.6. So why don't you rather fix autotools?

+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. + +

5.7. But scconfig doesn't do cross compilation!

+False. It does. It's been supported since May 2008. It's been added +about 1.5 months after the very first file. + +

5.8. I just don't like scconfig.

+If you have something particular that makes you dislike scconfig, +a missing feature for example, please let me know. +

+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. + + + Index: tags/1.0.5/doc-rnd/devlog/20150830b_back_ann.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150830b_back_ann.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150830b_back_ann.html (revision 953) @@ -0,0 +1,304 @@ + + +

pcb-rnd devlog

+ +

back annotation

+ +

netlists, annotations

+ +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. +

+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. +

+annotation paths +

+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 foo on the drawing, that does the reverse: receives +whatever format the sender has and generates something that gschem will +understand. + +

Support in pcb-rnd: core

+Pcb-rnd gets a complete netlist. If the user could change the netlist directly, +there should be some sort of diff tool in foo 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. +

+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" and "net_info". The table is called the netlist patch. +

+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: + +
op pinID net +
del_conn B1 n1 +
del_conn B2 n2 +
add_conn B2 n1 +
add_conn B1 n2 +
+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. +

+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. +

+The table would be normalized after operations. For example: + +
op pinID net +
del_conn B1 n1 +
add_conn B1 n2 +
add_conn B1 n3 +
del_conn B1 n2 +
+would be reduced to + +
op pinID net +
del_conn B1 n1 +
add_conn B1 n3 +
+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. +

+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. +

+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. +

+net_info is used to describe the original members of a net, in +the state they were before any change on the netlist occured. + +

Support in pcb-rnd: GUI

+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. +

+There should be a separate dialog box or a separate region of the netlist box +showing the netlist patch with edit capabilities. +

+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: + +
action screenshot patch list after the actions +
  • look at initial rats
(empty) +
  • first connect A1 to B1
(empty) + +
    +
  • then realize it's very hard to connect A2 to B2 while the previous connection is there +
  • he would then revert the first connection +
  • and connect A1 to B2 +
  • which would cause shorts +
+ (empty) + +
    +
  • then he would use the "approve netlist change" hotkey/action on the network; + this would add netlist patch 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!) +
+ +
+net_info n1 A1 B1
+net_info n2 A2 B2
+del_conn B1 n1
+add_conn B1 n2
+
+ +
    +
  • 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 +
  • the same thing would need to happen to the A2-B2 rat +
+ +
+net_info n1 A1 B1
+net_info n2 A2 B2
+del_conn B1 n1
+add_conn B1 n2
+del_conn B2 n2
+
+ + +
  • the user then would connect A2 to B1, which again is a short
+
    +
  • the user would approve it as a new connection +
  • we have exactly 2 del_conn and 2 add_conn patches. +
+ +
+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
+
+ +
+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. +

+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. +

+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. + +

Support in gschem

+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. +

+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 foo converted the patch into). +

+However, gschem should support four things natively: +

    +
  • it should have a concept of an unwanted pin-network connection; a connection + becomes unwanted only when the back annotation says so +
  • it should be able to mark unwanted connections on the active schematic page +
  • it should be able to tell the user if there are unwanted connections on + any of the pages open +
  • it should be able to refresh its idea of unwanted connections while + schematic pages are open +
+

+Displaying unwanted connections happen at: +

    +
  • a pin of a component is connected to a net using a "blue line" net: mark the pin-net connection point +
  • a pin is directly connected to another pin, no net line in between: mark the connection point +
  • a pin is connected to a net using a pin attribute: mark the pin +
  • TODO: are there more? +
+

+TODO: there are a lot to think over about special cases related to +multipage schematics, hierarchies, slots, split symbols. + +

What foo does exactly

+... is not clear yet. It depends on what sort of support gschem would provide. + +

Amendment 1: other parameters (1st sep)

+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. +

+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 in-place 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: +

    +
  • 1. remember or note down which parts to change footprints for +
  • 2. go back to gschem and change them +
  • 3. get the changes in pcb (I use gsch2pcb and Makefiles, one step; the import menu is one step too, just another one) +
  • 4. disperse the new elements +
  • 5. find where they used to be +
  • 6. and then do the fiddling to fit them in +
+

+The new process would be: +

    +
  • 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 +
  • 2. do the fiddling to fit the new part in +
  • 3. do a back annotation +
  • (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) +
+

+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 foo handles would be in the +simplest plain text form. + + +

Amendment 2: examples from gschem's point of view (3rd Sep)

+

netlist change

+
    +
  • The user creates the schematics and imports it in pcb; the original + netlist contains a line "netname1 U1-1 CONN1-2" +
  • 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. +
  • The netlist patch generated for this single change by pcb-rnd would be: +
    +del_conn netname1 U1-1
    +add_conn netname2 U1-1
    +	
    +
  • the user may need to load the netlist patch in ghscem +
  • 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. +
  • The user would find this indication and would resolve the situation + by whatever changes he finds appropriate +
  • 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. +
+ +

attribute change: footprint change

+
    +
  • The user creates the schematics and imports it in pcb; originally + U1 has an attribute footprint=DIP(8). +
  • during the layout the user figures using the footpritn SO(8) is + more appropriate. He does the change in pcb-rnd. +
  • pcb-rnd emits the following netlist patch for this: +
    +change_attrib U1 footprint=DIP(8) footprint=SO(8)
    +	
    +

    + (or it could be a del_attrib and add_attrib pair, like with connections) +

  • the user may need to load the netlist patch in ghscem +
  • In gschem there would be an indication that highlights any U1 instances + that has footprint=DIP(8) +
  • The user would find this indication and would resolve the situation + by whatever changes he finds appropriate (e.g. change the attribute) +
  • gschem would rerun the patch commands and would figure the change is + no longer requred and would remove the indication +
+ Index: tags/1.0.5/doc-rnd/devlog/20150901a_back_ann.html =================================================================== --- tags/1.0.5/doc-rnd/devlog/20150901a_back_ann.html (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/20150901a_back_ann.html (revision 953) @@ -0,0 +1,87 @@ + + +

pcb-rnd devlog

+ +

back annotation

+ + +

Conclusions of the first thread

+DJ has another
model +where back annotation is only a subset of a bigger mechanism. +

+Many other users commented the thread, but no one else presented a +plan that formed a complete system. +

+While there were some useful feedback about some details, no one explicitly +said he'd be contributing the gschem part (... for any of the ideas floating +around). +

+The thread is swamped in a chaotic set of random ideas and opinions - the +same way as previous related threads usually did. + + +

Second thread

+In the second thread I will focus on actual contribution. For this, +I'm narrowing down what exactly needs to be contributed: + + +
    +
  • 1. minor UI changes, most probably in the C part of the gschem code. +somehow ending up in the official repo; I'd prefer to avoid maintaining a +fork of gschem (no, having the fork in git doesn't help). + +
  • 2. a scheme script that can be plugged into gschem and do real simple +things like toggling flags for point 1, counting how many flags are +toggled, warn the user about the counter is being non-zero; this script +doesn't need to get into the official repo + +
  • 3. depending on whether we (me and my actual contributor who contributes +code) go for push or pull, we need: a new action or menu or whatever that +can trigger a pull or some means that can collect a change list pushed and +then indicate that something's happened. It's not really a third piece of +code, just a third piece of concept that is spread across 1 and 2. +
+

+First, I seek a contributor for exactly these 3 things. Alternatively if +there's someone who is really willing to contribute actual code and spend +time on this, I'm open to change parts of my plan if he has better ideas +as long as the new approach still solves the actual problems I have. + + +

Preparing for the third phase (3rd sep)

+Options are being eliminated slowly. I couldn't find out who are currently the +maintainers of gschem, so I couldn't ask their opinion about my back annotation +plan directly. Last stable release is about 2 years old, last unstable is more +than a year old. +

+The main options currently are: +

    +
  • 1. Evan offered contribution on the gschem side; Markus offered him write + access to the official git repo. We could have a branch there. We'd + aim for a merge, so minimal changes and a lot of scheme hacking (... + that still none of us want to do, afaik). + Without positive feedback from maintainers, I believe this branch + has a very low chance to get merged in mainline. If it doesn't get + merged, all the extra effort on scheme, git, and trying to + do things in the gschem-way are just energy wasted. + +
  • 2. I start an svn repo and implement the stuff the better way (no + scheme, bigger change, no worries about whether it gets merged). Keep + changes on-topic and small, so later on if someone wants to merge, + there's a chance to get it into a branch in the git repo first then + do the merge. Has even lower chance to get merged, but certainly + speeds up development and is much easier to work on, distribute and + use than a bitrotting git branch. If it doesn't get merged, + only a small amount of efforts wasted on trying to keep changes + merge-friendly. + +
  • 3. I start an svn repo and implement the stuff the best I can - without + considering any merging aspects. This is the option that'd grant + the most development speed and efficiency. It doesn't get merged, + but no energy is wasted at all and the resulting code is better. +
+There are some other options, but those are just variants of the above three. +Currently I think option 1 is unlikely to work, for I don't touch git, +and noone wants to touch scheme. Both 2 or 3 could work, but the total lack +of gschem maintainer feedback doesn't make option 2 look too good. + Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.dot =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.dot (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.dot (revision 953) @@ -0,0 +1,19 @@ +digraph annot { + + + gnetlist [shape=box] + + {rank=same pcb gschem spacer1} + + spacer1 [style=invisible] + + foo [shape=box] + + gschem -> gnetlist [label="forward1"] + pcb -> foo [label="back1"] + + gschem->spacer1->pcb [style=invisible arrowhead=none] + + gnetlist -> pcb [label="forward2"] + foo -> gschem [label="back2"] +} Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_annot.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s0.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s0.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_s0.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_s0.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_s0.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s1.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s1.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_s1.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_s1.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_s1.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s2.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s2.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_s2.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_s2.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_s2.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s3.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s3.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_s3.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_s3.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_s3.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s4.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s4.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_s4.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_s4.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_s4.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s5.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s5.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_s5.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_s5.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_s5.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s6.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/devlog/res/20150830b_s6.png =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/20150830b_s6.png (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/20150830b_s6.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/devlog/res/20150830b_s6.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/devlog/res/Makefile =================================================================== --- tags/1.0.5/doc-rnd/devlog/res/Makefile (nonexistent) +++ tags/1.0.5/doc-rnd/devlog/res/Makefile (revision 953) @@ -0,0 +1,4 @@ +all: 20150830b_annot.png + +%.png: %.dot + dot -Tpng < $^ > $@ Index: tags/1.0.5/doc-rnd/flagcomp.html =================================================================== --- tags/1.0.5/doc-rnd/flagcomp.html (nonexistent) +++ tags/1.0.5/doc-rnd/flagcomp.html (revision 953) @@ -0,0 +1,23 @@ + + +

pcb-rnd - the [flagcomp] patch

+ +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. +

+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. + +

save/load and compatibility

+This patch ensures compatibility in save/load cycles with flags introduced +by later versions of vanilla PCB or different branches/forks of PCB by +not removing flags they introduced. + +

plans

+No plans - this feature is fully implemented. + + Index: tags/1.0.5/doc-rnd/gpmi/Credits =================================================================== --- tags/1.0.5/doc-rnd/gpmi/Credits (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/Credits (revision 953) @@ -0,0 +1,11 @@ +2006...2009 +~~~~~~~~~~~ +Big thanks to DJ Delorie who added external HID support in PCB and commited +many small patches needed to get this project working in the period +when the whole project was a plugin to vanilla pcb. + +The following people helped the project with their valuable feedbacks +in the early stage: + John Griessen + Carlos Nieves Onega + Index: tags/1.0.5/doc-rnd/gpmi/History =================================================================== --- tags/1.0.5/doc-rnd/gpmi/History (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/History (revision 953) @@ -0,0 +1,32 @@ +History +~~~~~~~ +As of October 2006, PCB has native support for external (or dynamic +loadable) HIDs. This project is plugin that provides scripting features. + +For a long time I believe that good applications should be scriptable, +and real good ones should not restrict scripting to one or two languages. +For this reason I have been working on GPMI with various other developers +for years. GPMI provides a general way to split up big applications in +smaller, usually dynamic loadable parts, and encourages that some of these +parts should be written in a script language. For me, the ideal model +of an application is a small core that knows how to manipulate the +internal representation of the task and a lot of dynamic functionality +plugins and support plugins that do all the high-level job for the user. + +PCB is an old and big software, with a stable user base. Restructuring the +whole source to "GPMIize" it is no option. Instead, a nice compromise is +implementing this functionality in a plugin that pcb can load for the users +who are interested in such extras. + +From 2006 to 2009 spring the project was on hold, because I was nagging +PCB developers to add support for customizable dialog boxes. In late March +2009, PCB developers pointed out that the interface I was waiting for had been +there for who-knows-how-long. With the help of DJ Delorie I extended the +action handling of PCB to remember action contexts, which was another showstopper. +After all obstacles removed, I allocated a 24 hour coding session where I +finished the exporter functionality, added action binding, dialog box handling +and layout manipulation functions. + +During the summer of 2015 I merged pcb-gpmi into pcb-rnd and made it +the default scirpting engine for pcb-rnd. + Index: tags/1.0.5/doc-rnd/gpmi/Makefile =================================================================== --- tags/1.0.5/doc-rnd/gpmi/Makefile (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/Makefile (revision 953) @@ -0,0 +1,20 @@ +DPI_BIG=-Gsize=8,8 -Gdpi=166 +DPI=-Gsize=8,8 -Gdpi=100 + +all: gpmi_flow.png gpmi_flow_load.png gpmi_flow_reg.png gpmi_flow_menu.png gpmi_flow_exp.png + cd rosetta && make + +gpmi_flow.png: gpmi_flow.dot Makefile + dot $(DPI_BIG) -Tpng gpmi_flow.dot >$@ + +gpmi_flow_load.png: gpmi_flow_load.dot Makefile + dot $(DPI) -Tpng gpmi_flow_load.dot >$@ + +gpmi_flow_reg.png: gpmi_flow_reg.dot Makefile + dot $(DPI) -Tpng gpmi_flow_reg.dot >$@ + +gpmi_flow_menu.png: gpmi_flow_menu.dot Makefile + dot $(DPI) -Tpng gpmi_flow_menu.dot >$@ + +gpmi_flow_exp.png: gpmi_flow_exp.dot Makefile + dot $(DPI) -Tpng gpmi_flow_exp.dot >$@ Index: tags/1.0.5/doc-rnd/gpmi/Porting =================================================================== --- tags/1.0.5/doc-rnd/gpmi/Porting (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/Porting (revision 953) @@ -0,0 +1,5 @@ +Currently the project works on Linux only. GPMI is portable, so we need +only Makefile tweakings on pcb-gpmi to be able to compile it anywhere +where GPMI compiles. However, first I want to see some test results +from Linux users. + Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow.dot =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow.dot (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow.dot (revision 953) @@ -0,0 +1,63 @@ +digraph g { + rankdir=LR + splines="polyline" +# nodesep=1 +# ranksep=1.5 + + subgraph cluster_0 { + label="pcb-rnd" +# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] + core [label="core" shape=box] + hids [label="HID system" shape=box height=2] + plugins [label="plugin system" shape=box height=2] + } + + subgraph cluster_1 { + label="GPMI" + gpmi_hid [label="gpmi HID"] + gpmi_pkg [label="gpmi package\n(host glue layer)"] + gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] + gpmi_scr1 [label="lua script"] + gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] + gpmi_scr2 [label="awk script"] + } + + + + gui [label="the active\nGUI HID\n(e.g. gtk)"] + exp1 [label="PS exporer"] + exp2 [label="PNG exporer"] + + + exp1 -> hids [label="register"] + exp2 -> hids [label="register"] + + hids -> exp1 [label="drawing"] + hids -> exp2 [label="drawing"] + hids -> gui [label="drawing"] + + plugins -> gpmi_hid [label="load plugin"] + gpmi_hid -> hids [label="register"] + hids -> gpmi_hid [label="drawing"] + core -> gpmi_hid [label="event"] + + gpmi_pkg -> core [label="calls & variables"] + gpmi_pkg -> hids [label="calls & variables"] + gpmi_pkg -> gpmi_hid [label="calls & variables"] + gpmi_pkg -> plugins [label="calls & variables"] + + + gpmi_hid -> gpmi_mod1 [label="load script"] + gpmi_hid -> gpmi_mod1 [label="event"] + gpmi_hid -> gpmi_mod2 [label="load script"] + gpmi_hid -> gpmi_mod2 [label="event"] + + gpmi_mod1 -> gpmi_scr1 [label="load and exec"] + gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed] + gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed] + + gpmi_mod2 -> gpmi_scr2 [label="load and exec"] + gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] + gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] + +} \ No newline at end of file Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow.png =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow.png (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/gpmi/gpmi_flow.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.dot =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.dot (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.dot (revision 953) @@ -0,0 +1,65 @@ +digraph g { + rankdir=LR + splines="polyline" +# nodesep=1 +# ranksep=1.5 + + subgraph cluster_0 { + label="pcb-rnd" +# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] + core [label="core" shape=box] + hids [label="HID system" shape=box height=2] + plugins [label="plugin system" shape=box height=2] + } + + subgraph cluster_1 { + label="GPMI" + gpmi_hid [label="gpmi HID"] + gpmi_pkg [label="gpmi package\n(host glue layer)"] + gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] + gpmi_scr1 [label="lua script"] + gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] + gpmi_scr2 [label="awk script"] + outfile [label="export\noutput file" color=green] + } + + + + gui [label="the active\nGUI HID\n(e.g. gtk)"] + exp1 [label="PS exporer"] + exp2 [label="PNG exporer"] + + + exp1 -> hids [label="register"] + exp2 -> hids [label="register"] + + hids -> exp1 [label="drawing"] + hids -> exp2 [label="drawing"] + hids -> gui [label="drawing"] + + plugins -> gpmi_hid [label="load plugin"] + gpmi_hid -> hids [label="register"] + hids -> gpmi_hid [label="drawing" color=green] + core -> gpmi_hid [label="event"] + + gpmi_pkg -> core [label="calls & variables"] + gpmi_pkg -> hids [label="calls & variables" color=red] + gpmi_pkg -> gpmi_hid [label="calls & variables"] + gpmi_pkg -> plugins [label="calls & variables"] + + + gpmi_hid -> gpmi_mod1 [label="load script"] + gpmi_hid -> gpmi_mod1 [label="event" color=green] + gpmi_hid -> gpmi_mod2 [label="load script"] + gpmi_hid -> gpmi_mod2 [label="event"] + + gpmi_mod1 -> gpmi_scr1 [label="load and exec"] + gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed color=green] + gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=red] + gpmi_scr1 -> outfile [label="write" color=green] + + gpmi_mod2 -> gpmi_scr2 [label="load and exec"] + gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] + gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] + +} \ No newline at end of file Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.png =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.png (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_exp.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.dot =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.dot (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.dot (revision 953) @@ -0,0 +1,63 @@ +digraph g { + rankdir=LR + splines="polyline" +# nodesep=1 +# ranksep=1.5 + + subgraph cluster_0 { + label="pcb-rnd" +# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] + core [label="core" shape=box] + hids [label="HID system" shape=box height=2] + plugins [label="plugin system" shape=box height=2] + } + + subgraph cluster_1 { + label="GPMI" + gpmi_hid [label="gpmi HID"] + gpmi_pkg [label="gpmi package\n(host glue layer)"] + gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] + gpmi_scr1 [label="lua script"] + gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] + gpmi_scr2 [label="awk script"] + } + + + + gui [label="the active\nGUI HID\n(e.g. gtk)"] + exp1 [label="PS exporer"] + exp2 [label="PNG exporer"] + + + exp1 -> hids [label="register"] + exp2 -> hids [label="register"] + + hids -> exp1 [label="drawing"] + hids -> exp2 [label="drawing"] + hids -> gui [label="drawing"] + + plugins -> gpmi_hid [label="load plugin" color=red] + gpmi_hid -> hids [label="register"] + hids -> gpmi_hid [label="drawing"] + core -> gpmi_hid [label="event"] + + gpmi_pkg -> core [label="calls & variables"] + gpmi_pkg -> hids [label="calls & variables"] + gpmi_pkg -> gpmi_hid [label="calls & variables" color=green] + gpmi_pkg -> plugins [label="calls & variables"] + + + gpmi_hid -> gpmi_mod1 [label="load script" color=red] + gpmi_hid -> gpmi_mod1 [label="event"] + gpmi_hid -> gpmi_mod2 [label="load script"] + gpmi_hid -> gpmi_mod2 [label="event"] + + gpmi_mod1 -> gpmi_scr1 [label="load and exec" color=red] + gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed] + gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green] + + gpmi_mod2 -> gpmi_scr2 [label="load and exec"] + gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] + gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] + +} \ No newline at end of file Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.png =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.png (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_load.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.dot =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.dot (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.dot (revision 953) @@ -0,0 +1,63 @@ +digraph g { + rankdir=LR + splines="polyline" +# nodesep=1 +# ranksep=1.5 + + subgraph cluster_0 { + label="pcb-rnd" +# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] + core [label="core" shape=box] + hids [label="HID system" shape=box height=2] + plugins [label="plugin system" shape=box height=2] + } + + subgraph cluster_1 { + label="GPMI" + gpmi_hid [label="gpmi HID"] + gpmi_pkg [label="gpmi package\n(host glue layer)"] + gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] + gpmi_scr1 [label="lua script"] + gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] + gpmi_scr2 [label="awk script"] + } + + + + gui [label="the active\nGUI HID\n(e.g. gtk)"] + exp1 [label="PS exporer"] + exp2 [label="PNG exporer"] + + + exp1 -> hids [label="register"] + exp2 -> hids [label="register"] + + hids -> exp1 [label="drawing"] + hids -> exp2 [label="drawing"] + hids -> gui [label="drawing" color=green] + + plugins -> gpmi_hid [label="load plugin"] + gpmi_hid -> hids [label="register"] + hids -> gpmi_hid [label="drawing"] + core -> gpmi_hid [label="event" color=red] + + gpmi_pkg -> core [label="calls & variables"] + gpmi_pkg -> hids [label="calls & variables" color=green] + gpmi_pkg -> gpmi_hid [label="calls & variables"] + gpmi_pkg -> plugins [label="calls & variables"] + + + gpmi_hid -> gpmi_mod1 [label="load script"] + gpmi_hid -> gpmi_mod1 [label="event" color=red] + gpmi_hid -> gpmi_mod2 [label="load script"] + gpmi_hid -> gpmi_mod2 [label="event"] + + gpmi_mod1 -> gpmi_scr1 [label="load and exec"] + gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed color=red] + gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green] + + gpmi_mod2 -> gpmi_scr2 [label="load and exec"] + gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] + gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] + +} \ No newline at end of file Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.png =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.png (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_menu.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.dot =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.dot (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.dot (revision 953) @@ -0,0 +1,64 @@ +digraph g { + rankdir=LR + splines="polyline" +# nodesep=1 +# ranksep=1.5 + + subgraph cluster_0 { + label="pcb-rnd" +# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] + core [label="core" shape=box] + hids [label="HID system" shape=box height=2] + plugins [label="plugin system" shape=box height=2] + } + + subgraph cluster_1 { + label="GPMI" + gpmi_hid [label="gpmi HID"] + gpmi_pkg [label="gpmi package\n(host glue layer)"] + gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] + gpmi_scr1 [label="lua script"] + gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] + gpmi_scr2 [label="awk script"] + } + + + + gui [label="the active\nGUI HID\n(e.g. gtk)"] + exp1 [label="PS exporer"] + exp2 [label="PNG exporer"] + + + exp1 -> hids [label="register"] + exp2 -> hids [label="register"] + + hids -> exp1 [label="drawing"] + hids -> exp2 [label="drawing"] + hids -> gui [label="drawing"] + + plugins -> gpmi_hid [label="load plugin"] + gpmi_hid -> hids [label="register"] + hids -> gpmi_hid [label="drawing"] + core -> gpmi_hid [label="event"] + + gpmi_pkg -> core [label="calls & variables" color=green] + gpmi_pkg -> hids [label="calls & variables"] + gpmi_pkg -> gpmi_hid [label="calls & variables" color=red] + gpmi_pkg -> plugins [label="calls & variables"] + + + gpmi_hid -> gpmi_mod1 [label="load script"] + gpmi_hid -> gpmi_mod1 [label="event"] + gpmi_hid -> gpmi_mod2 [label="load script"] + gpmi_hid -> gpmi_mod2 [label="event"] + + gpmi_mod1 -> gpmi_scr1 [label="load and exec"] + gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed] + gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=red] + gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green] + + gpmi_mod2 -> gpmi_scr2 [label="load and exec"] + gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] + gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] + +} \ No newline at end of file Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.png =================================================================== --- tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.png (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/gpmi/gpmi_flow_reg.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/gpmi/index.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/index.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/index.html (revision 953) @@ -0,0 +1,32 @@ + + +

pcb-rnd GPMI scripting - TOC

+ +

Installation, configuration

+
+ + +

High level docs

+ + +

Glue layer documentation

+ + +

Authors, credits, misc

+ + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/Makefile =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/Makefile (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/Makefile (revision 953) @@ -0,0 +1,14 @@ +ROOT=../../.. +ALL= actions dialogs hid layout + +all: XREF $(ALL:%=%_ref.html) + +include $(ROOT)/src/pcb-gpmi/Makefile.config + +%_ref.html REF.% : $(ROOT)/src/pcb-gpmi/gpmi_plugin/gpmi_pkg/%.h + $(ROOT)/util/genref.sh "$^" "$(ROOT)" "../packages/$@" $(PCB_CFLAGS) >$*_ref.html + +XREF: $(ALL:%=REF.%) + cat $^ > $@ + + Index: tags/1.0.5/doc-rnd/gpmi/packages/XREF =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/XREF (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/XREF (revision 953) @@ -0,0 +1,84 @@ +event ACTE_action ../packages/actions_ref.html#ACTE_action +event ACTE_gui_init ../packages/actions_ref.html#ACTE_gui_init +event ACTE_unload ../packages/actions_ref.html#ACTE_unload +function action_register ../packages/actions_ref.html#action_register +function action_arg ../packages/actions_ref.html#action_arg +function action ../packages/actions_ref.html#action +function create_menu ../packages/actions_ref.html#create_menu +enum dialog_fileselect_e ../packages/dialogs_ref.html#dialog_fileselect_e +function dialog_log ../packages/dialogs_ref.html#dialog_log +function dialog_confirm ../packages/dialogs_ref.html#dialog_confirm +function dialog_report ../packages/dialogs_ref.html#dialog_report +function dialog_prompt ../packages/dialogs_ref.html#dialog_prompt +function dialog_fileselect ../packages/dialogs_ref.html#dialog_fileselect +function dialog_beep ../packages/dialogs_ref.html#dialog_beep +function dialog_progress ../packages/dialogs_ref.html#dialog_progress +function dialog_attribute ../packages/dialogs_ref.html#dialog_attribute +enum hid_attr_type_e ../packages/hid_ref.html#hid_attr_type_e +enum EndCapStyle_e ../packages/hid_ref.html#EndCapStyle_e +event HIDE_get_export_options ../packages/hid_ref.html#HIDE_get_export_options +event HIDE_do_export_start ../packages/hid_ref.html#HIDE_do_export_start +event HIDE_do_export_finish ../packages/hid_ref.html#HIDE_do_export_finish +event HIDE_set_layer ../packages/hid_ref.html#HIDE_set_layer +event HIDE_set_color ../packages/hid_ref.html#HIDE_set_color +event HIDE_set_line_cap ../packages/hid_ref.html#HIDE_set_line_cap +event HIDE_set_line_width ../packages/hid_ref.html#HIDE_set_line_width +event HIDE_set_draw_xor ../packages/hid_ref.html#HIDE_set_draw_xor +event HIDE_set_draw_faded ../packages/hid_ref.html#HIDE_set_draw_faded +event HIDE_draw_line ../packages/hid_ref.html#HIDE_draw_line +event HIDE_draw_arc ../packages/hid_ref.html#HIDE_draw_arc +event HIDE_draw_rect ../packages/hid_ref.html#HIDE_draw_rect +event HIDE_fill_circle ../packages/hid_ref.html#HIDE_fill_circle +event HIDE_fill_polygon ../packages/hid_ref.html#HIDE_fill_polygon +event HIDE_fill_rect ../packages/hid_ref.html#HIDE_fill_rect +event HIDE_use_mask ../packages/hid_ref.html#HIDE_use_mask +event HIDE_make_gc ../packages/hid_ref.html#HIDE_make_gc +event HIDE_destroy_gc ../packages/hid_ref.html#HIDE_destroy_gc +event HIDE_fill_pcb_pv ../packages/hid_ref.html#HIDE_fill_pcb_pv +function hid_create ../packages/hid_ref.html#hid_create +function hid_add_attribute ../packages/hid_ref.html#hid_add_attribute +function hid_get_attribute ../packages/hid_ref.html#hid_get_attribute +function hid_register ../packages/hid_ref.html#hid_register +function hid_gpmi_data_set ../packages/hid_ref.html#hid_gpmi_data_set +function hid_gpmi_data_get ../packages/hid_ref.html#hid_gpmi_data_get +function hid_string2val ../packages/hid_ref.html#hid_string2val +enum layout_object_mask_e ../packages/layout_ref.html#layout_object_mask_e +enum layout_object_coord_e ../packages/layout_ref.html#layout_object_coord_e +enum layout_flag_e ../packages/layout_ref.html#layout_flag_e +enum layer_field_e ../packages/layout_ref.html#layer_field_e +function layout_search_box ../packages/layout_ref.html#layout_search_box +function layout_search_selected ../packages/layout_ref.html#layout_search_selected +function layout_search_found ../packages/layout_ref.html#layout_search_found +function layout_search_get ../packages/layout_ref.html#layout_search_get +function layout_search_free ../packages/layout_ref.html#layout_search_free +function layout_obj_coord ../packages/layout_ref.html#layout_obj_coord +function layout_obj_type ../packages/layout_ref.html#layout_obj_type +function layout_obj_move ../packages/layout_ref.html#layout_obj_move +function layout_arc_angles ../packages/layout_ref.html#layout_arc_angles +function layout_create_line ../packages/layout_ref.html#layout_create_line +function layout_create_via ../packages/layout_ref.html#layout_create_via +function layout_create_arc ../packages/layout_ref.html#layout_create_arc +function layout_switch_to_layer ../packages/layout_ref.html#layout_switch_to_layer +function layout_get_current_layer ../packages/layout_ref.html#layout_get_current_layer +function layout_resolve_layer ../packages/layout_ref.html#layout_resolve_layer +function layout_get_max_possible_layer ../packages/layout_ref.html#layout_get_max_possible_layer +function layout_get_max_copper_layer ../packages/layout_ref.html#layout_get_max_copper_layer +function layout_get_max_layer ../packages/layout_ref.html#layout_get_max_layer +function layout_layer_name ../packages/layout_ref.html#layout_layer_name +function layout_layer_color ../packages/layout_ref.html#layout_layer_color +function layout_layer_field ../packages/layout_ref.html#layout_layer_field +function layout_get_page_width ../packages/layout_ref.html#layout_get_page_width +function layout_get_page_height ../packages/layout_ref.html#layout_get_page_height +function layout_set_page_size ../packages/layout_ref.html#layout_set_page_size +function mil2pcb_multiplier ../packages/layout_ref.html#mil2pcb_multiplier +function mm2pcb_multiplier ../packages/layout_ref.html#mm2pcb_multiplier +function current_grid_unit ../packages/layout_ref.html#current_grid_unit +function debug_draw_request ../packages/layout_ref.html#debug_draw_request +function debug_draw_flush ../packages/layout_ref.html#debug_draw_flush +function debug_draw_finish ../packages/layout_ref.html#debug_draw_finish +function debug_draw_dctx ../packages/layout_ref.html#debug_draw_dctx +function draw_set_color ../packages/layout_ref.html#draw_set_color +function draw_set_line_width ../packages/layout_ref.html#draw_set_line_width +function draw_set_draw_xor ../packages/layout_ref.html#draw_set_draw_xor +function draw_set_draw_faded ../packages/layout_ref.html#draw_set_draw_faded +function draw_line ../packages/layout_ref.html#draw_line Index: tags/1.0.5/doc-rnd/gpmi/packages/actions.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/actions.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/actions.html (revision 953) @@ -0,0 +1,106 @@ + + +

The actions package

+ +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. + +

Registration of new actions

+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 name of the event handler +can be used to identify the triggering action. (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.) +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. +

+The process of binding an action: +

    +
  1. create an event handler for event ACTE_action +
  2. register one or more actions using function action_register +
  3. optional: when the event handler is triggered, check argument name (for scripts with multiple actions registered) +
  4. optional: use argument argc and function action_arg to fetch action arguments +
  5. optional: use arguments x, y to learn the cursor position on the layout. +
+ +Example (written in lua): +
+-- 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");
+
+

+When the script is unloaded all actions the script registered +are removed from pcb-rnd automatically. + +

Executing actions

+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): +
+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!");
+
+

+The above script registers a new action called untwo(). When untwo() is executed, +it exectues action undo() twice. + + +

Creating menus

+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. +

+The first argument of create_menu() is the menu path. The path is a list +of visible menu names separated by slashes (e.g. "File/Save as..." means +"File" menu, "Save as..." submenu). By convention, scripts should +create new menu items under the "Plugins/" menu. +

+The following example lua script registers a new menu item +

+PkgLoad("pcb-rnd-gpmi/actions", 0);
+
+function ev_gui_init(argc, argv)
+	create_menu("Plugins/foo", "undo()", "o", "Ctrl<Key>o", "tooltip for foo");
+end
+
+-- register and bind action
+Bind("ACTE_gui_init", "ev_gui_init");
+
+

+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. + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/actions_ref.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/actions_ref.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/actions_ref.html (revision 953) @@ -0,0 +1,82 @@ + + +

PCB GPMI

+

Reference manual for package actions

+Automatically generated from actions.h + +

Events

+
+

Events do not have return value. The first argument is always the even id. Event handlers defined in scripts get all event arguments converted to string (types below are informational). + +

ACTE_action(int event_id, const char* name, int argc, int x, int y)

+
+ 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 
+
+
+

ACTE_gui_init(int event_id, int argc, char** argv)

+
+ 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. 
+
+
+

ACTE_unload(int event_id, const char* conffile)

+
+ 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. 
+
+
+

Functions

+
+

The following functions are registered in script context. + +

int action_register(const char* name, const char* need_xy, const char* description, const char* syntax)

+
+ 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.
+ 
+
+
+

const char* action_arg(int argn)

+
+ extract the (argn)th event argument for the current action (makes sense only in an ACTE_action event handler 
+
+
+

int action(const char* cmdline)

+
+ 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). 
+
+
+

void create_menu(const char* path, const char* action, const char* mnemonic, const char* hotkey, const char* tooltip)

+
+ 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 
+
+
+ + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/dialogs.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/dialogs.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/dialogs.html (revision 953) @@ -0,0 +1,47 @@ + + +

dialogs package

+ 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. + +

Common conventions

+ 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. +

+ The only exception is dialog_progress(), which opens or + updates or closes the already open progress dialog box, and + returns immediately (even when the box is left open). + +

Simple dialogs vs. custom dialogs

+ 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 dialog_confirm(), dialog_prompt(), + dialog_fileselect() are static. +

+ When the script needs a custom, dynamic dialog box, it needs to + create an attribute dialog. The script sets up a HID + structure using the hid package, builds up all the input fields + then calls dialog_attribute() with the hid. + +

Progress dialogs

+ + 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 total. As long as + argument so_far is less than total, the dialog is + open. +

+ After the process has finished, a call with so_far=total+1 should be + made to make sure the window is closed. If the call returns non-zero, + the process should be cancelled. + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/dialogs_ref.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/dialogs_ref.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/dialogs_ref.html (revision 953) @@ -0,0 +1,105 @@ + + +

PCB GPMI

+

Reference manual for package dialogs

+Automatically generated from dialogs.h + +

Enums

+
+

Enum values should be passed on as strings. + +

dialog_fileselect_e

+
+ Filter on what files a file select dialog should list 
+
+ +
value meaning +
FS_NONE none of the below +
FS_READ when the selected file will be read, not written (HID_FILESELECT_READ) +
FS_NOT_EXIST 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) +
FS_TEMPLATE 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) +
+
+

Functions

+
+

The following functions are registered in script context. + +

void dialog_log(const char* msg)

+
+ Append a msg to the log (log window and/or stderr). 
+
+
+

int dialog_confirm(const char* msg, const char* ok, const char* cancel)

+
+ 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. 
+
+
+

void dialog_report(const char* title, const char* msg)

+
+ Pop up a report dialog.
+   Arguments:
+     title: title of the window
+     msg: message 
+
+
+

char* dialog_prompt(const char* msg, const char* default_)

+
+ 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. 
+
+
+

char* dialog_fileselect(const char* title, const char* descr, char* default_file_, char* default_ext, const char* history_tag, dialog_fileselect_t flags)

+
+ 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). 
+
+
+

void dialog_beep(void)

+
+ Audible beep 
+
+
+

int dialog_progress(int so_far, int total, const char* message)

+
+ 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.
+
+
+
+

int dialog_attribute(hid_t* hid, const char* title, const char* descr)

+
+ 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 
+
+
+ + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/event_id.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/event_id.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/event_id.html (revision 953) @@ -0,0 +1,20 @@ + + +

event_id

+ +The first argument passed to an event handler is always the event ID. +It is useful if there are several GPMI events with the same arguments and +the script wants to bind them all to the same event handler. In that case +using event_id the event handler can determine which event triggered the +call. This design is similar to the signal handler documented in +signal(2). + +

+ +The case described above (dispatcher in the event handler) is rare. +Most users will bind one event to one function and can safely ignore this +argument. Nevertheless it must present as the first argument +on the event handler's argument list. + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/hid.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/hid.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/hid.html (revision 953) @@ -0,0 +1,76 @@ + + +

hid package

+ +The hid package has two purposes: +
    +
  • it is glue layer for exporter dialog boxes and attribute dialog boxes; +
  • it can register exporter HIDs in PCB +
+ +

Building a custom dialog box

+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(). +

+The process of building a dialog box is closed by a call to +

    +
  • hid_register(), which registers a new exporter hid using the + attributes of the dialog box; or +
  • dialog_attribute() (of the dialog package) which pops up a custom + dialog box immediately. +
+ +

Registering an exporter

+ 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: +
    +
  1. envelope events to set up exporting +
  2. many draw events to actually export the objects +
  3. an envelope event to finish exporting +
+ +

Envelope: events generated before or after exporting

+
    +
  • HIDE_get_export_options(void *hid): Generated before get_exporter_options returns the option list to the GUI hid +
  • HIDE_do_export_start(void *hid): Generated before export redraw starts +
  • HIDE_do_export_finish(void *hid): Generated after export redraw finihsed +
+ +

Drawing: events generated during exporting

+ Note: there may be multiple gcs (graphic contexts), each having its own color, line + properties, xor drawing and faded state. Graphic contexts are created + and destroyed by the following events: +
    +
  • HIDE_make_gc(void *hid, void *gc); +
  • HIDE_destroy_gc(void *hid, void *gc); +
+ + Gc properties are changed by the following events: +
    +
  • HIDE_set_layer(void *hid, const char *name, int group); +
  • HIDE_set_color(void *hid, void *gc, const char *name); +
  • HIDE_set_line_cap(void *hid, void *gc, EndCapStyle style); +
  • HIDE_set_line_width(void *hid, void *gc, int width); +
  • HIDE_set_draw_xor(void *hid, void *gc, int xor); +
  • HIDE_set_draw_faded(void *hid, void *gc, int faded); +
+ + Finally, the actual drawing operations: +
    +
  • HIDE_draw_line(void *hid, void *gc, int x1, int y1, int x2, int y2); +
  • HIDE_draw_arc(void *hid, void *gc, int cx, int cy, int xradius, int yradius, int start_angle, int delta_angle); +
  • HIDE_draw_rect(void *hid, void *gc, int x1, int y1, int x2, int y2); +
  • HIDE_fill_circle(void *hid, void *gc, int cx, int cy, int radius); +
  • HIDE_fill_polygon(void *hid, void *gc, int n_coords, int *x, int *y); +
  • HIDE_fill_rect(void *hid, void *gc, int x1, int y1, int x2, int y2); +
  • HIDE_use_mask(void *hid, int use_it); [TODO] +
+ + + Index: tags/1.0.5/doc-rnd/gpmi/packages/hid_ref.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/hid_ref.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/hid_ref.html (revision 953) @@ -0,0 +1,200 @@ + + +

PCB GPMI

+

Reference manual for package hid

+Automatically generated from hid.h + +

Enums

+
+

Enum values should be passed on as strings. + +

hid_attr_type_e

+
+ Type of an HID attribute (usually a widget on an attribute dialog box) 
+
+ +
value meaning +
HIDA_Label non-editable label displayed on the GUI +
HIDA_Integer a sugned integer value +
HIDA_Real a floating point value +
HIDA_String one line textual input +
HIDA_Boolean true/false boolean value +
HIDA_Enum select an item of a predefined list +
HIDA_Mixed TODO +
HIDA_Path path to a file or directory +
HIDA_Unit select a dimension unit +
HIDA_Coord enter a coordinate +
+
+

EndCapStyle_e

+
+ Line or arc ending style 
+
+ +
value meaning +
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 +
+
+

Events

+
+

Events do not have return value. The first argument is always the even id. Event handlers defined in scripts get all event arguments converted to string (types below are informational). + +

HIDE_get_export_options(int event_id, void* hid)

+
+ Called before get_exporter_options returns the option list to the GUI hid 
+
+
+

HIDE_do_export_start(int event_id, void* hid)

+
+ Called before export redraw starts 
+
+
+

HIDE_do_export_finish(int event_id, void* hid)

+
+ Called after export redraw finihsed 
+
+
+

HIDE_set_layer(int event_id, void* hid, const char* name, int group, int empty)

+
+ PCB callback events for drawing: change layer 
+
+
+

HIDE_set_color(int event_id, void* hid, void* gc, const char* name)

+
+ PCB callback events for drawing: change drawing color 
+
+
+

HIDE_set_line_cap(int event_id, void* hid, void* gc, EndCapStyle style)

+
+ PCB callback events for drawing: change drawing line cap style
+
+
+

HIDE_set_line_width(int event_id, void* hid, void* gc, int width)

+
+ PCB callback events for drawing: change drawing line width 
+
+
+

HIDE_set_draw_xor(int event_id, void* hid, void* gc, int xor)

+
+ PCB callback events for drawing: toggle xor drawing method 
+
+
+

HIDE_set_draw_faded(int event_id, void* hid, void* gc, int faded)

+
+ PCB callback events for drawing: toggle faded drawing method 
+
+
+

HIDE_draw_line(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2)

+
+ PCB callback events for drawing: draw a line 
+
+
+

HIDE_draw_arc(int event_id, void* hid, void* gc, int cx, int cy, int xradius, int yradius, double start_angle, double delta_angle)

+
+ PCB callback events for drawing: draw an arc from center cx;cy 
+
+
+

HIDE_draw_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2)

+
+ PCB callback events for drawing: draw a rectangle 
+
+
+

HIDE_fill_circle(int event_id, void* hid, void* gc, int cx, int cy, int radius)

+
+ PCB callback events for drawing: draw a filled circle 
+
+
+

HIDE_fill_polygon(int event_id, void* hid, void* gc, int n_coords, int* x, int* y)

+
+ PCB callback events for drawing: draw a filled ploygon 
+
+
+

HIDE_fill_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2)

+
+ PCB callback events for drawing: draw a filled rectangle 
+
+
+

HIDE_use_mask(int event_id, void* hid, int use_it)

+
+ PCB callback events for drawing: TODO 
+
+
+

HIDE_make_gc(int event_id, void* hid, void* gc)

+
+ PCB callback events for drawing: create a new graphical context 
+
+
+

HIDE_destroy_gc(int event_id, void* hid, void* gc)

+
+ PCB callback events for drawing: destroy a graphical context 
+
+
+

HIDE_fill_pcb_pv(int event_id, void* hid, void* fg_gc, void* bg_gc, void* pad, int drawHole, int mask)

+
+ PCB callback events for drawing: TODO 
+
+
+

Functions

+
+

The following functions are registered in script context. + +

hid_t* hid_create(char* hid_name, char* description)

+
+ Creates a new hid context. Name and description matters only if the hid is
+registered as an exporter later. 
+
+
+

int hid_add_attribute(hid_t* hid, char* attr_name, char* help, hid_attr_type_t type, int min, int max, char* default_val)

+
+ 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. 
+
+
+

char* hid_get_attribute(hid_t* hid, int attr_id)

+
+ 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. 
+
+
+

int hid_register(hid_t* hid)

+
+ Register the hid; call it after a hid is created and its attributes
+   are all set up 
+
+
+

void hid_gpmi_data_set(hid_t* h, void* data)

+
+ For internal use 
+
+
+

hid_t* hid_gpmi_data_get(HID* h)

+
+ For internal use 
+
+
+

HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char* str)

+
+ For internal use 
+
+
+ + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/layout.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/layout.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/layout.html (revision 953) @@ -0,0 +1,58 @@ + + +

layout package

+ +Layout package searches and manipulates the current layout. Dimension units +are in nanometer unless otherwise mentioned. + +

Page: board dimensions

+ Functions used to query or set width and height of the drawing: +
    +
  • int layout_get_page_width(); +
  • int layout_get_page_height(); +
  • void layout_set_page_size(int width, int height); +
+ +

Layer manipulation

+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. +
    +
  • int layout_resolve_layer(const char *name): resolve layer number by name (case sensitive); returns negative number if not found +
  • int layout_get_current_layer(): returns the number of the current layer +
  • void layout_switch_to_layer(int layer): switch to layer (further actions will take place there) +
+

+ +

Object searches

+ 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. +

+ TODO: validity of a list in time +

+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. + +

Create new objects

+ The layour_create_*() calls are used to create new objects on the current + layer (set by layout_switch_to_layer()). + + +

API reference - page, untis and coordinates

+(angles are in radian) +TODO + +

API reference - debug draw

+TODO + + + Index: tags/1.0.5/doc-rnd/gpmi/packages/layout_ref.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/packages/layout_ref.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/packages/layout_ref.html (revision 953) @@ -0,0 +1,305 @@ + + +

PCB GPMI

+

Reference manual for package layout

+Automatically generated from layout.h + +

Enums

+
+

Enum values should be passed on as strings. + +

layout_object_mask_e

+
+ Object type search mask bits 
+
+ +
value meaning +
OM_LINE lines (traces, silk lines, not font) +
OM_TEXT text written using the font +
OM_POLYGON polygons, including rectangles +
OM_ARC arcs, circles +
OM_VIA vias and holes which are not part of a footprint +
OM_PIN pins/pads of a footprint +
OM_ANY shorthand for "find anything" +
+
+

layout_object_coord_e

+
+ Which coordinate of the object is referenced 
+
+ +
value meaning +
OC_BX1 bounding box X1 +
OC_BX2 bounding box X2 +
OC_BY1 bounding box Y1 +
OC_BY2 bounding box Y2 +
OC_P1X point 1 X +
OC_P2X point 2 X +
OC_P1Y point 1 Y +
OC_P2Y point 2 Y +
OC_OBJ the whole object +
OC_P1 point 1 is P1X +
OC_P2 point 2 is P2X +
+
+

layout_flag_e

+
+ of layout_object_coord_t 
+
+ +
value meaning +
FL_NONE <comment missing in the header> +
FL_SHOWNUMBER <comment missing in the header> +
FL_LOCALREF <comment missing in the header> +
FL_CHECKPLANS <comment missing in the header> +
FL_SHOWDRC <comment missing in the header> +
FL_RUBBERBAND <comment missing in the header> +
FL_DESCRIPTION <comment missing in the header> +
FL_NAMEONPCB <comment missing in the header> +
FL_AUTODRC <comment missing in the header> +
FL_ALLDIRECTION <comment missing in the header> +
FL_SWAPSTARTDIR <comment missing in the header> +
FL_UNIQUENAME <comment missing in the header> +
FL_CLEARNEW <comment missing in the header> +
FL_SNAPPIN <comment missing in the header> +
FL_SHOWMASK <comment missing in the header> +
FL_THINDRAW <comment missing in the header> +
FL_ORTHOMOVE <comment missing in the header> +
FL_LIVEROUTE <comment missing in the header> +
FL_THINDRAWPOLY <comment missing in the header> +
FL_LOCKNAMES <comment missing in the header> +
FL_ONLYNAMES <comment missing in the header> +
FL_NEWFULLPOLY <comment missing in the header> +
FL_HIDENAMES <comment missing in the header> +
FL_THERMALSTYLE1 <comment missing in the header> +
FL_THERMALSTYLE2 <comment missing in the header> +
FL_THERMALSTYLE3 <comment missing in the header> +
FL_THERMALSTYLE4 <comment missing in the header> +
FL_THERMALSTYLE5 <comment missing in the header> +
+
+

layer_field_e

+
+ Field name of the layer structure 
+
+ +
value meaning +
LFLD_NUM_LINES number of lines on the layer +
LFLD_NUM_TEXTS number of texts on the layer +
LFLD_NUM_POLYS number of polygons on the layer +
LFLD_NUM_ARCS number of arcs on the layer +
LFLD_VISIBLE non-zero if the layer is visible +
LFLD_NODRC non-zero if the layer doesn't use DRC +
+
+

Functions

+
+

The following functions are registered in script context. + +

int layout_search_box(const char* search_ID, layout_object_mask_t obj_types, int x1, int y1, int x2, int y2)

+
+ 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. 
+
+
+

int layout_search_selected(const char* search_ID, layout_object_mask_t obj_types)

+
+ 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. 
+
+
+

int layout_search_found(const char* search_ID, layout_object_mask_t obj_types)

+
+ 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. 
+
+
+

layout_object_t* layout_search_get(const char* search_ID, int n)

+
+ Returns the nth object from a search list (or NULL pointer if n is beyond the list) 
+
+
+

int layout_search_free(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) 
+
+
+

int layout_obj_coord(layout_object_t* obj, layout_object_coord_t coord)

+
+ 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. 
+
+
+

layout_object_mask_t layout_obj_type(layout_object_t* obj)

+
+ Return the type of an object (always a single bit) 
+
+
+

int layout_obj_move(layout_object_t* obj, layout_object_coord_t coord, int dx, int dy)

+
+ 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 
+
+
+

int layout_arc_angles(layout_object_t* obj, int relative, int start, int delta)

+
+ change angles of an arc; start and delate are relative if relative is non-zero; returns 0 on success 
+
+
+

int layout_create_line(int x1, int y1, int x2, int y2, int thickness, int clearance, layout_flag_t flags)

+
+ create a line 
+
+
+

int layout_create_via(int x, int y, int thickness, int clearance, int mask, int hole, const char* name, layout_flag_t flags)

+
+ create a named via 
+
+
+

int layout_create_arc(int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, layout_flag_t flags)

+
+ create a new arc; sa is start angle, dir is delta angle 
+
+
+

void layout_switch_to_layer(int layer)

+
+ switch to layer (further layer-specific actions will take place there) 
+
+
+

int layout_get_current_layer()

+
+ returns the number of the current layer 
+
+
+

int layout_resolve_layer(const char* name)

+
+ resolve layer number by name (case sensitive); returns negative number if not found 
+
+
+

int layout_get_max_possible_layer()

+
+ return the theoretical number of layers supported by PCB 
+
+
+

int layout_get_max_copper_layer()

+
+ return the actual number of copper layers on the current design 
+
+
+

int layout_get_max_layer()

+
+ return the actual number of layers on the current design 
+
+
+

const char* layout_layer_name(int layer)

+
+ return the name of a layer 
+
+
+

const char* layout_layer_color(int layer)

+
+ return the color of a layer 
+
+
+

int layout_layer_field(int layer, layer_field_t fld)

+
+ return an integer field of a layer 
+
+
+

int layout_get_page_width()

+
+ query or set width and height of the drawing 
+
+
+

int layout_get_page_height()

+
+<comment missing in the header>
+
+
+

void layout_set_page_size(int width, int height)

+
+<comment missing in the header>
+
+
+

double mil2pcb_multiplier()

+
+ -- coordinate system -- (coord.c) 
+
+
+

double mm2pcb_multiplier()

+
+<comment missing in the header>
+
+
+

const char* current_grid_unit()

+
+<comment missing in the header>
+
+
+

int debug_draw_request(void)

+
+ Initialize debug drawing; returns 1 if worked, 0 if denied 
+
+
+

void debug_draw_flush(void)

+
+ Flush the drawing 
+
+
+

void debug_draw_finish(dctx_t* ctx)

+
+ Finish (close) drawing 
+
+
+

dctx_t* debug_draw_dctx(void)

+
+ Get the draw context of debug draw 
+
+
+

void draw_set_color(dctx_t* ctx, const char* name)

+
+ Debug draw style: set drawing color 
+
+
+

void draw_set_line_width(dctx_t* ctx, int width)

+
+ Debug draw style: set line width 
+
+
+

void draw_set_draw_xor(dctx_t* ctx, int xor)

+
+ Debug draw style: set whether drawing should happen in xor 
+
+
+

void draw_set_draw_faded(dctx_t* ctx, int faded)

+
+ Debug draw style: set whether drawing should happen in faded mode  
+
+
+

void draw_line(dctx_t* ctx, int x1_, int y1_, int x2_, int y2_)

+
+ Debug draw: draw a line using the current style settings 
+
+
+ + + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ID.desc =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ID.desc (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ID.desc (revision 953) @@ -0,0 +1,2 @@ +Create a new action hello() that prints "Hello world!" in the message log. + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ID.name =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ID.name (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ID.name (revision 953) @@ -0,0 +1 @@ +hello world (text, log) Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.awk =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.awk (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.awk (revision 953) @@ -0,0 +1,14 @@ +BEGIN { + PkgLoad("pcb-rnd-gpmi/actions", 0); + PkgLoad("pcb-rnd-gpmi/dialogs", 0); +} + +function ev_action(id, name, argc, x, y) +{ + dialog_log("Hello world!\n"); +} + +BEGIN { + Bind("ACTE_action", "ev_action"); + action_register("hello", "", "log hello world", "hello()"); +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.bash =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.bash (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.bash (revision 953) @@ -0,0 +1,18 @@ +#!/bin/bash + +function load_packages() +{ + GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 + GPMI PkgLoad "pcb-rnd-gpmi/dialogs" 0 +} + +function ev_action() { + GPMI dialog_log "Hello world!\n" +} + +function main() +{ + load_packages + GPMI Bind "ACTE_action" "ev_action" + GPMI action_register "hello" "" "log hello world" "hello()" +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.html (revision 953) @@ -0,0 +1,25 @@ +Load packages the script depends on: +
    +
  • actions for registering the new action; +
  • dialogs for printing in the message log. +
+

+Create a function ev_action 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. +

+When the action event is called, use dialog_log to append +a log message. +

+In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. +

+Finally use action_register to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps) +
Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.lua =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.lua (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.lua (revision 953) @@ -0,0 +1,9 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +function ev_action(id, name, argc, x, y) + dialog_log("Hello world!\n"); +end + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.pl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.pl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.pl (revision 953) @@ -0,0 +1,10 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +sub ev_action { + my($id, $name, $argc, $x, $y) = @_; + dialog_log("Hello world!\n"); +} + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.py =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.py (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.py (revision 953) @@ -0,0 +1,8 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +def ev_action(id, name, argc, x, y): + dialog_log("Hello world!\n"); + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.rb =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.rb (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.rb (revision 953) @@ -0,0 +1,9 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +def ev_action(id, name, argc, x, y) + dialog_log("Hello world!\n"); +end + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.scm =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.scm (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.scm (revision 953) @@ -0,0 +1,9 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/dialogs" 0) + +(define ev_action (lambda (id name argc x y) + (dialog_log "Hello world!\n"))) + +(Bind "ACTE_action" "ev_action") +(action_register "hello" "" "log hello world" "hello()") + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.stt =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.stt (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.stt (revision 953) @@ -0,0 +1,10 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/dialogs" 0) + +(defun ev_action (id name argc x y) + (dialog_log "Hello world!\n")) + +(Bind "ACTE_action" "ev_action") +(action_register "hello" "" "log hello world" "hello()") + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.tcl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.tcl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/ex.tcl (revision 953) @@ -0,0 +1,10 @@ +PkgLoad pcb-rnd-gpmi/actions 0 +PkgLoad pcb-rnd-gpmi/dialogs 0 + +proc ev_action {id, name, argc, x, y} { + dialog_log "Hello world!\n" +} + +Bind ACTE_action ev_action +action_register "hello" "" "log hello world" "hello()" + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/index.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/index.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello/index.html (revision 953) @@ -0,0 +1,55 @@ + + +<-- back to the
index of Rosetta examples +

hello world (text, log)

+Create a new action hello() that prints "Hello world!" in the message log. +

Example implementations

+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +

Explanation, step by step

+Load packages the script depends on: +
    +
  • +actions + for registering the new action; +
  • +dialogs + for printing in the message log.
+ +

Create a function +ev_action + 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. +

When the action event is called, use +dialog_log + to append a log message. +

In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. +

Finally use +action_register + to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps)
+ Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ID.desc =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ID.desc (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ID.desc (revision 953) @@ -0,0 +1,3 @@ +Create a new action hello() that prints "Hello world!" in a popup window. + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ID.name =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ID.name (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ID.name (revision 953) @@ -0,0 +1 @@ +hello world (popup window) Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.awk =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.awk (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.awk (revision 953) @@ -0,0 +1,14 @@ +BEGIN { + PkgLoad("pcb-rnd-gpmi/actions", 0); + PkgLoad("pcb-rnd-gpmi/dialogs", 0); +} + +function ev_action(id, name, argc, x, y) +{ + dialog_report("Greeting window", "Hello world!"); +} + +BEGIN { + Bind("ACTE_action", "ev_action"); + action_register("hello", "", "log hello world", "hello()"); +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.bash =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.bash (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.bash (revision 953) @@ -0,0 +1,18 @@ +#!/bin/bash + +function load_packages() +{ + GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 + GPMI PkgLoad "pcb-rnd-gpmi/dialogs" 0 +} + +function ev_action() { + GPMI dialog_report "Greeting window" "Hello world!" +} + +function main() +{ + load_packages + GPMI Bind "ACTE_action" "ev_action" + GPMI action_register "hello" "" "log hello world" "hello()" +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.html (revision 953) @@ -0,0 +1,26 @@ +Load packages the script depends on: +
    +
  • actions for registering the new action; +
  • dialogs for creating a dialog box. +
+

+Create a function ev_action 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. +

+When the action event is called, use dialog_report to pop +up a report dialog. First argument donates the name (title) of the window, +the second is the text printed in the window. +

+In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. +

+Finally use action_register to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps) +
Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.lua =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.lua (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.lua (revision 953) @@ -0,0 +1,9 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +function ev_action(id, name, argc, x, y) + dialog_report("Greeting window", "Hello world!"); +end + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.pl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.pl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.pl (revision 953) @@ -0,0 +1,10 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +sub ev_action { + my($id, $name, $argc, $x, $y) = @_; + dialog_report("Greeting window", "Hello world!"); +} + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.py =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.py (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.py (revision 953) @@ -0,0 +1,8 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +def ev_action(id, name, argc, x, y): + dialog_report("Greeting window", "Hello world!"); + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.rb =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.rb (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.rb (revision 953) @@ -0,0 +1,9 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +def ev_action(id, name, argc, x, y) + dialog_report("Greeting window", "Hello world!"); +end + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.scm =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.scm (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.scm (revision 953) @@ -0,0 +1,9 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/dialogs" 0) + +(define ev_action (lambda (id name argc x y) + (dialog_report "Greeting window" "Hello world!"))) + +(Bind "ACTE_action" "ev_action") +(action_register "hello" "" "log hello world" "hello()") + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.stt =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.stt (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.stt (revision 953) @@ -0,0 +1,10 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/dialogs" 0) + +(defun ev_action (id name argc x y) + (dialog_report "Greeting window" "Hello world!")) + +(Bind "ACTE_action" "ev_action") +(action_register "hello" "" "log hello world" "hello()") + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.tcl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.tcl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/ex.tcl (revision 953) @@ -0,0 +1,10 @@ +PkgLoad pcb-rnd-gpmi/actions 0 +PkgLoad pcb-rnd-gpmi/dialogs 0 + +proc ev_action {id, name, argc, x, y} { + dialog_report "Greeting window" "Hello world!" +} + +Bind ACTE_action ev_action +action_register "hello" "" "log hello world" "hello()" + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/index.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/index.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/10_hello_gui/index.html (revision 953) @@ -0,0 +1,55 @@ + + +<-- back to the index of Rosetta examples +

hello world (popup window)

+Create a new action hello() that prints "Hello world!" in a popup window. +

Example implementations

+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +

Explanation, step by step

+Load packages the script depends on: +
    +
  • +actions + for registering the new action; +
  • +dialogs + for creating a dialog box.
+ +

Create a function +ev_action + 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. +

When the action event is called, use +dialog_report + to pop up a report dialog. First argument donates the name (title) of the window, the second is the text printed in the window. +

In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. +

Finally use +action_register + to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps)
+ Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ID.desc =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ID.desc (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ID.desc (revision 953) @@ -0,0 +1,3 @@ +Create a new action hello() that prints "Hello world!" in a popup window, create a menu (under "Plugins/GPMI scripting/") that executes the action. + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ID.name =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ID.name (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ID.name (revision 953) @@ -0,0 +1 @@ +hello world (popup window + submenu) Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.awk =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.awk (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.awk (revision 953) @@ -0,0 +1,20 @@ +BEGIN { + PkgLoad("pcb-rnd-gpmi/actions", 0); + PkgLoad("pcb-rnd-gpmi/dialogs", 0); +} + +function ev_action(id, name, argc, x, y) +{ + dialog_report("Greeting window", "Hello world!"); +} + +function ev_gui_init(id, argc, argv) +{ + create_menu("Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); +} + +BEGIN { + Bind("ACTE_action", "ev_action"); + Bind("ACTE_gui_init", "ev_gui_init"); + action_register("hello", "", "log hello world", "hello()"); +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.bash =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.bash (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.bash (revision 953) @@ -0,0 +1,24 @@ +#!/bin/bash + +function load_packages() +{ + GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 + GPMI PkgLoad "pcb-rnd-gpmi/dialogs" 0 +} + +function ev_action() { + GPMI dialog_report "Greeting window" "Hello world!" +} + +function ev_gui_init() +{ + GPMI create_menu "Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello" +} + +function main() +{ + load_packages + GPMI Bind "ACTE_action" "ev_action" + GPMI Bind "ACTE_gui_init" "ev_gui_init" + GPMI action_register "hello" "" "log hello world" "hello()" +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.html (revision 953) @@ -0,0 +1,33 @@ +Load packages the script depends on: +
    +
  • actions for registering the new action; +
  • dialogs for creating a dialog box. +
+

+Create a function ev_action 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. +

+When the action event is called, use dialog_report to pop +up a report dialog. First argument donates the name (title) of the window, +the second is the text printed in the window. +

+Create a function ev_gui_init that will be called when the +gui has been initialized - this is the right moment to register +new menus in the GUI. Put the new menu item in the +"Plugins/GPMI scripting/" menu by convention, and set hot key to ctrl+w. +The menu should execute action hello(). +

+In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. +Also bind ev_gui_init so that the new menu can be safely created. +

+Finally use action_register to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps) +
Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.lua =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.lua (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.lua (revision 953) @@ -0,0 +1,14 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +function ev_action(id, name, argc, x, y) + dialog_report("Greeting window", "Hello world!"); +end + +function ev_gui_init(id, argc, argv) + create_menu("Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); +end + +Bind("ACTE_action", "ev_action"); +Bind("ACTE_gui_init", "ev_gui_init"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.pl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.pl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.pl (revision 953) @@ -0,0 +1,17 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +sub ev_action { + my($id, $name, $argc, $x, $y) = @_; + dialog_report("Greeting window", "Hello world!"); +} + +sub ev_gui_init +{ + my($id, $name, $argc, $argv) = @_; + create_menu("Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); +} + +Bind("ACTE_action", "ev_action"); +Bind("ACTE_gui_init", "ev_gui_init"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.py =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.py (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.py (revision 953) @@ -0,0 +1,12 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +def ev_action(id, name, argc, x, y): + dialog_report("Greeting window", "Hello world!"); + +def ev_gui_init(id, argc, argv): + create_menu("Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); + +Bind("ACTE_action", "ev_action"); +Bind("ACTE_gui_init", "ev_gui_init"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.rb =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.rb (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.rb (revision 953) @@ -0,0 +1,14 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/dialogs", 0); + +def ev_action(id, name, argc, x, y) + dialog_report("Greeting window", "Hello world!"); +end + +def ev_gui_init(id, argc, argv) + create_menu("Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); +end + +Bind("ACTE_action", "ev_action"); +Bind("ACTE_gui_init", "ev_gui_init"); +action_register("hello", "", "log hello world", "hello()"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.scm =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.scm (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.scm (revision 953) @@ -0,0 +1,12 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/dialogs" 0) + +(define ev_action (lambda (id name argc x y) + (dialog_report "Greeting window" "Hello world!"))) + +(define ev_gui_init (lambda (id argc argv) + (create_menu "Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello"))) + +(Bind "ACTE_action" "ev_action") +(Bind "ACTE_gui_init" "ev_gui_init") +(action_register "hello" "" "log hello world" "hello()") Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.stt =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.stt (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.stt (revision 953) @@ -0,0 +1,12 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/dialogs" 0) + +(defun ev_action (id name argc x y) + (dialog_report "Greeting window" "Hello world!")) + +(defun ev_gui_init (id argc argv) + (create_menu "Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello")) + +(Bind "ACTE_action" "ev_action") +(Bind "ACTE_gui_init" "ev_gui_init") +(action_register "hello" "" "log hello world" "hello()") Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.tcl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.tcl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/ex.tcl (revision 953) @@ -0,0 +1,15 @@ +PkgLoad pcb-rnd-gpmi/actions 0 +PkgLoad pcb-rnd-gpmi/dialogs 0 + +proc ev_action {id, name, argc, x, y} { + dialog_report "Greeting window" "Hello world!" +} + +proc ev_gui_init {id, argc, argv} { + create_menu "Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello" +} + +Bind ACTE_action ev_action +Bind ACTE_gui_init ev_gui_init +action_register "hello" "" "log hello world" "hello()" + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/index.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/index.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/12_hello_menu/index.html (revision 953) @@ -0,0 +1,58 @@ + + +<-- back to the index of Rosetta examples +

hello world (popup window + submenu)

+Create a new action hello() that prints "Hello world!" in a popup window, create a menu (under "Plugins/GPMI scripting/") that executes the action. +

Example implementations

+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +

Explanation, step by step

+Load packages the script depends on: +
    +
  • +actions + for registering the new action; +
  • +dialogs + for creating a dialog box.
+ +

Create a function +ev_action + 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. +

When the action event is called, use +dialog_report + to pop up a report dialog. First argument donates the name (title) of the window, the second is the text printed in the window. +

Create a function +ev_gui_init + that will be called when the gui has been initialized - this is the right moment to register new menus in the GUI. Put the new menu item in the "Plugins/GPMI scripting/" menu by convention, and set hot key to ctrl+w. The menu should execute action hello(). +

In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. Also bind ev_gui_init so that the new menu can be safely created. +

Finally use +action_register + to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps)
+ Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ID.desc =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ID.desc (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ID.desc (revision 953) @@ -0,0 +1,3 @@ +Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm. + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ID.name =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ID.name (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ID.name (revision 953) @@ -0,0 +1 @@ +action: move selected objects Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.awk =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.awk (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.awk (revision 953) @@ -0,0 +1,22 @@ +BEGIN { + PkgLoad("pcb-rnd-gpmi/actions", 0); + PkgLoad("pcb-rnd-gpmi/layout", 0); +} + +function ev_action(id, name, argc, x, y ,dx,dy,n,num_objs,obj_ptr) +{ + dx = action_arg(0) * mm2pcb_multiplier() + dy = action_arg(1) * mm2pcb_multiplier() + + num_objs = layout_search_selected("mv_search", "OM_ANY") + for(n = 0; n < num_objs; n++) { + obj_ptr = layout_search_get("mv_search", n) + layout_obj_move(obj_ptr, "OC_OBJ", dx, dy) + } + layout_search_free("mv_search") +} + +BEGIN { + Bind("ACTE_action", "ev_action"); + action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.bash =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.bash (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.bash (revision 953) @@ -0,0 +1,41 @@ +#!/bin/bash + +function load_packages() +{ + GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 + GPMI PkgLoad "pcb-rnd-gpmi/layout" 0 +} + +function ev_action() { + local dx dy n num_objs + + GPMI action_arg 0 + a0=`bash_int "$result"` + + GPMI action_arg 1 + a1=`bash_int "$result"` + + GPMI mm2pcb_multiplier + conv=`bash_int "$result"` + + dx=$(($a0 * $conv)) + dy=$(($a1 * $conv)) + + GPMI layout_search_selected "mv_search" "OM_ANY" + num_objs=`bash_int "$result"` + + for n in `seq 0 $(($num_objs-1))` + do + GPMI layout_search_get "mv_search" $n + obj_ptr="$result" + GPMI layout_obj_move $obj_ptr "OC_OBJ" $dx $dy + done + GPMI layout_search_free "mv_search" +} + +function main() +{ + load_packages + GPMI Bind "ACTE_action" "ev_action" + GPMI action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)" +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.html (revision 953) @@ -0,0 +1,36 @@ +Load packages the script depends on: +
    +
  • actions for registering the new action; +
  • layout for searching selected objects and moving objects. +
+

+Create a function ev_action 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. +

+When the action event is called, first set up: +

    +
  • fetch event argument 0 and 1 using action_arg; +
  • resolve the conversion rate from mm to PCB's units using mm2pcb_multiplier; +
  • perform a search for all selected object using layout_search_selected (return value is the number of objects found), name the resulting list "mv_search" +
+A loop then iterates over the objects on the list: +
    +
  • resolve the Nth element of the list using layout_search_get, referecing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer; +
  • move the object using layout_obj_move; 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) +
+Finally the search list shall be destroyed to reclaim memory, using layout_search_free. +

+ +In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. +

+Finally use action_register to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps) +
Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.lua =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.lua (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.lua (revision 953) @@ -0,0 +1,18 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/layout", 0); + +function ev_action(id, name, argc, x, y) + local dx = action_arg(0) * mm2pcb_multiplier() + local dy = action_arg(1) * mm2pcb_multiplier() + + local num_objs = layout_search_selected("mv_search", "OM_ANY") + for n=0,num_objs+1 + do + obj_ptr = layout_search_get("mv_search", n) + layout_obj_move(obj_ptr, "OC_OBJ", dx, dy) + end + layout_search_free("mv_search") +end + +Bind("ACTE_action", "ev_action"); +action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); \ No newline at end of file Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.pl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.pl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.pl (revision 953) @@ -0,0 +1,20 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/layout", 0); + +sub ev_action { + my($id, $name, $argc, $x, $y) = @_; + + my $dx = action_arg(0) * mm2pcb_multiplier(); + my $dy = action_arg(1) * mm2pcb_multiplier(); + + my $num_objs = layout_search_selected("mv_search", "OM_ANY"); + for(my $n = 0; $n < $num_objs; $n++) { + $obj_ptr = layout_search_get("mv_search", $n); + layout_obj_move($obj_ptr, "OC_OBJ", $dx, $dy); + } + layout_search_free("mv_search"); + +} + +Bind("ACTE_action", "ev_action"); +action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.py =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.py (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.py (revision 953) @@ -0,0 +1,15 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/layout", 0); + +def ev_action(id, name, argc, x, y): + dx = int(action_arg(0)) * float(mm2pcb_multiplier()) + dy = int(action_arg(1)) * float(mm2pcb_multiplier()) + num_objs = int(layout_search_selected("mv_search", "OM_ANY")) + for n in xrange(0, num_objs): + obj_ptr = layout_search_get("mv_search", n) + layout_obj_move(obj_ptr, "OC_OBJ", dx, dy) + layout_search_free("mv_search") + +Bind("ACTE_action", "ev_action"); +action_register("hello", "", "log hello world", "hello()"); +action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.rb =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.rb (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.rb (revision 953) @@ -0,0 +1,25 @@ +PkgLoad("pcb-rnd-gpmi/actions", 0); +PkgLoad("pcb-rnd-gpmi/layout", 0); + +def ev_action(id, name, argc, x, y) +# TODO: how to convert 1e+06 in ruby? +# conv = mm2pcb_multiplier().to_i + conv = 1000000 + + + dx = action_arg(0).to_i * conv.to_i; + dy = action_arg(1).to_i * conv.to_i; + + num_objs = layout_search_selected("mv_search", "OM_ANY").to_i; + + for n in 0..(num_objs-1) + obj_ptr = layout_search_get("mv_search", n); + layout_obj_move(obj_ptr, "OC_OBJ", dx, dy); + n += 1; + end + layout_search_free("mv_search"); + +end + +Bind("ACTE_action", "ev_action"); +action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.scm =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.scm (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.scm (revision 953) @@ -0,0 +1,20 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/layout" 0) + +(define ev_action (lambda (id name argc x y) +(let + ( + (dx (* (string->number (action_arg 0)) (string->number (mm2pcb_multiplier)))) + (dy (* (string->number (action_arg 1)) (string->number (mm2pcb_multiplier)))) + (num_objs (string->number (layout_search_selected "mv_search" "OM_ANY"))) + (obj_ptr 0) + ) + (do ((n 0 (1+ n))) + ((> n num_objs)) + (set! obj_ptr (layout_search_get "mv_search" n)) + (layout_obj_move obj_ptr "OC_OBJ" (inexact->exact dx) (inexact->exact dy)) + ) +))) + +(Bind "ACTE_action" "ev_action") +(action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)") Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.stt =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.stt (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.stt (revision 953) @@ -0,0 +1,24 @@ +(PkgLoad "pcb-rnd-gpmi/actions" 0) +(PkgLoad "pcb-rnd-gpmi/layout" 0) + +(defun ev_action (id name argc x y) +(let + ( + (dx (* (->num (action_arg 0)) (->num (mm2pcb_multiplier)))) + (dy (* (->num (action_arg 1)) (->num (mm2pcb_multiplier)))) + (num_objs (->num (layout_search_selected "mv_search" "OM_ANY"))) + (obj_ptr 0) + ) + (do ((n 0 (1+ n))) + ((> n num_objs)) + (set! obj_ptr (layout_search_get "mv_search" n)) + (layout_obj_move obj_ptr "OC_OBJ" (->int dx) (->int dy)) + ) +) +) + +(Bind "ACTE_action" "ev_action") +(action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)") + + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.tcl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.tcl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/ex.tcl (revision 953) @@ -0,0 +1,17 @@ +PkgLoad pcb-rnd-gpmi/actions 0 +PkgLoad pcb-rnd-gpmi/layout 0 + +proc ev_action {id, name, argc, x, y} { + set dx [expr round([action_arg 0] * [mm2pcb_multiplier])] + set dy [expr round([action_arg 1] * [mm2pcb_multiplier])] + + set num_objs [layout_search_selected mv_search OM_ANY] + for {set n 0} {$n < $num_objs} {incr n} { + set obj_ptr [layout_search_get mv_search $n] + layout_obj_move $obj_ptr OC_OBJ $dx $dy + } + layout_search_free mv_search +} + +Bind ACTE_action ev_action +action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)" Index: tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/index.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/index.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/30_move/index.html (revision 953) @@ -0,0 +1,74 @@ + + +<-- back to the index of Rosetta examples +

action: move selected objects

+Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm. +

Example implementations

+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +

Explanation, step by step

+Load packages the script depends on: +
    +
  • +actions + for registering the new action; +
  • +layout + for searching selected objects and moving objects.
+ +

Create a function +ev_action + 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. +

When the action event is called, first set up: +

    +
  • fetch event argument 0 and 1 using +action_arg +; +
  • resolve the conversion rate from mm to PCB's units using +mm2pcb_multiplier +; +
  • perform a search for all selected object using +layout_search_selected + (return value is the number of objects found), name the resulting list "mv_search"
+ A loop then iterates over the objects on the list: +
    +
  • resolve the Nth element of the list using +layout_search_get +, referecing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer; +
  • move the object using +layout_obj_move +; 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)
+ Finally the search list shall be destroyed to reclaim memory, using +layout_search_free +. +

In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. +

Finally use +action_register + to register the action: +

    +
  • first argument is the name of the action +
  • second is the xy query string; it is empty since this action won't need coordinates to operate on +
  • third is the description that shows up in dumps and helps +
  • fourth is the syntax description (also for helps)
+ Index: tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ID.desc =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ID.desc (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ID.desc (revision 953) @@ -0,0 +1 @@ +Create a new exporter that prints a list of drills in x,y,dia table in CSV, TSV or text format Index: tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ID.name =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ID.name (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ID.name (revision 953) @@ -0,0 +1 @@ +drill list exporter Index: tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk (revision 953) @@ -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, 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") +} Index: tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.html (revision 953) @@ -0,0 +1,60 @@ + +An exporter is a hid registered. During the export +process, pcb-rnd calls the exporter to draw objects on layers. The GPMI +layer converts these calls to bindable events. An exporter script catches +the drawing events relevant to the output format and draws everything from +event handlers. +

+An exporter is sort of a drawing backend: pcb-rnd sets up graphic contexts +(gc for short) and draws on them. The first gc set up should open the +output file, the last gc closed should flush/close the file. +

+


+ +

Theory of operation

+Assume only filled circles on the +top assembly layer are holes. Emit a line for each of these +and ignore everything else. + +

Implementation

+Load packages the script depends on: +
    +
  • hid for registering the new exporter; +
  • layout for unit conversion; +
  • dialogs for error reporting. +
+

+Set up an exporter hid, storing the handle of each object created in +a global variable: +

    +
  • create a hid using hid_create +
  • add two attributes (fields) to the dialog using hid_add_attribute +
  • register the new hid using hid_register - this makes it an exporter +
+

+Set up global state variables: +

    +
  • fmt will be a cache for the format selected by the user +
  • conv is the conversion scale between mm and PCB internal coordinate unit +
  • channel specifies a file handle or indicates that the output file is open +
  • green_light indicates that the exporter is drawing the relevant layer +
+

+Define a make_gc callback. It is called when a new graphic +context is created (e.g. for layers). An exporter is sort of a drawing +backend: pcb-rnd sets up gc's and draws on them. The first gc set up +should open the output file, the last gc closed should flush/close the file. +Define a destroy_gc callback for the latter. GCs are +destroyed at the end of the export process. Use global variable channel +to make sure the file is open/close only once (see TODO script context). +

+Define a set_layer callback that sets green_light to true if +layer name is "topasssembly", false otherwise. +

+Callback fill_circle is the workhorse: check if we have the green +light to emit lines, then convert coordinates and diameter to mm and +decide what format to use for printing a line for each filled circle. +

+Finally, bind all four callbacks to exporter events. + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua (revision 953) @@ -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(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") Index: tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl (revision 953) @@ -0,0 +1,63 @@ +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 Index: tags/1.0.5/doc-rnd/gpmi/rosetta/index.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/index.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/index.html (revision 953) @@ -0,0 +1,58 @@ + + + +

pcb-rnd scripting - Rosetta

+The Rosetta Stone +of pcb-rnd scripting is a collection of example scripts implemented in +various scripting languages. Rosetta has multiple purposes: +
    +
  • to provide examples of using the pcb-rnd API; +
  • to not scare away newcomers by showing the first examples in an unfamiliar language; +
  • to help the user to decide which language to use for a specific task; +
  • to provide examples on how to convert idioms of pcb-rnd scripts from one language to another. +
+

+Each example comes with an explanation, written in plain English about what the +scripts do, step by step. Instead of trying to exploit powerful features +of the language, example implementations try to be simple. +

+The list below is ordered from the least complex to the most complex examples. +Column lvl is the complexity score. The less the score is, the simpler +the example is. + + +

Index of examples

+ + + + + + + + +
lvlexample languages description +
10 + hello world (text, log) + awk bash lua perl python ruby scheme stutter tcl + Create a new action hello() that prints "Hello world!" in the message log. +
10 + hello world (popup window) + awk bash lua perl python ruby scheme stutter tcl + Create a new action hello() that prints "Hello world!" in a popup window. +
12 + hello world (popup window + submenu) + awk bash lua perl python ruby scheme stutter tcl + Create a new action hello() that prints "Hello world!" in a popup window, create a menu (under "Plugins/GPMI scripting/") that executes the action. +
30 + action: move selected objects + awk bash lua perl python ruby scheme stutter tcl + Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm. +
35 + drill list exporter + awk lua tcl + Create a new exporter that prints a list of drills in x,y,dia table in CSV, TSV or text format +
+ + + + Index: tags/1.0.5/doc-rnd/gpmi/rosetta/index.templ.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/rosetta/index.templ.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/rosetta/index.templ.html (revision 953) @@ -0,0 +1,29 @@ + + + +

pcb-rnd scripting - Rosetta

+The Rosetta Stone +of pcb-rnd scripting is a collection of example scripts implemented in +various scripting languages. Rosetta has multiple purposes: +
    +
  • to provide examples of using the pcb-rnd API; +
  • to not scare away newcomers by showing the first examples in an unfamiliar language; +
  • to help the user to decide which language to use for a specific task; +
  • to provide examples on how to convert idioms of pcb-rnd scripts from one language to another. +
+

+Each example comes with an explanation, written in plain English about what the +scripts do, step by step. Instead of trying to exploit powerful features +of the language, example implementations try to be simple. +

+The list below is ordered from the least complex to the most complex examples. +Column lvl is the complexity score. The less the score is, the simpler +the example is. + + +

Index of examples

+ + + + + Index: tags/1.0.5/doc-rnd/gpmi/scripting_intro.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi/scripting_intro.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/scripting_intro.html (revision 953) @@ -0,0 +1,226 @@ + + +

Scripting intro

+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. +

+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. + +

1. pcb-rnd internals

+ +Since scripts are glued to pcb-rnd internals, scripters need to know +the basic concepts of how pcb-rnd is structured. + +

1.1 pcb-rnd, HIDs, plugins and GPMI

+pcb-rnd consists of: +
    +
  • a core that handles the file format, data structures, UI and exporter logics +
  • a hid system that is a layer between core and the HIDs +
  • a set of GUI HIDs which are responsible for interactive graphical display of the current design +
  • a set of exporter HIDs which are responsible for exporting offline representation of the current design +
  • a plugin system that can load HIDs from on the fly, from dynamic loadable libraries (.so or .dll) +
  • a buildin system 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" +
+

+Note 1: at the moment GUI hids can not be plugins or buildins. +
+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. +

+When pcb-rnd executable is compiled, the core, the default GUI and exporter HIDs +and buildins are compiled into the executable. Later on +

+The GPMI hid is an optional plugin that, by compile-time choice +of the user, can be: +

    +
  • left out all-together - pcb-rnd does not have scripting +
  • compiled as a plugin - when the .so (or .dll) is put in the right directory, pcb-rnd loads it during startup and has scripting +
  • compiled as buildin - becomes part of the pcb-rnd executable so that scripting is always available +
+ +

1.2. Actions, menus, exporters

+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. +

+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. +

+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: +

    +
  1. An exporter HID may register one or more exporters. +
  2. When the user tries to export the design, pcb-rnd lists all + registered exporters. +
  3. The user chooses one, and the preconfigured dialog box + with the selected exporter's options are popped up. +
  4. pcb-rnd core runs the dialog and saves the results if the user + clicked on the ok button. +
  5. pcb-rnd starts the exporting process: it calls the callbacks + to draw the design layer by layer, object by object. +
+ +

1.3. How a script can interact with the user

+
    +
  • The script may register actions - these actions are instantly accessible from the GUI command line, on stdin with --listen and in batch mode +
  • The script may create menus and bind them to actions - when the menu is selected, the action is executed +
  • The script may bind to events that will be generated asynchronously by pcb-rnd - when such an event is received, the script executes some code +
  • The script may register new exporter(s) - the user will be able to export the design using the script +
  • The script may run arbitrary code "on load" (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 +
+ + +

2. GPMI intro

+ +

2.1. GPMI's place in the pcb-rnd world

+
+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: +
    +
  • gpmi module: dynamic lib written in C, knows how to load and interpret a script and how to deliver events to the script +
  • gpmi package: dynamic lib, provides C functions the script can directly call; package functions then know how to deal with PCB internals +
+Arrows drawn with dashed line represents a slow, string based communication. +
+ +

2.2. Module, script, script context, packages

+
+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. +

+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. +

+Step 0: the GPMI HID 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. +

+Step 1: the GPMI HID 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. +

+Step 2: the script 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. +

+Packages are loaded only once and are globally accessible for multiple modules. +

+ +

2.3. Binding events, registering actions, creating menus

+
+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. +

+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: +

    +
  • a script that registers actions needs to bind the ACTE_action event to serve the action requests +
  • 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) +
+
+ +
+Menus are created using the create_menu() call. Menus can be +created only when the GUI is already set up - this may happen only +after some of the scripts are already loaded. 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. +

+

+ +

2.4. Exporting

+
+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: +

+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. +

+ +

2.5. Making modifications on the design

+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. + + +

3. How it works in practice

+ +

3.1. Loading the GPMI plugin

+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. +

+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: + +
path purpose +
+
$prefix/lib/pcb-rnd/plugins/$arch/ system plugins, multihost +
$prefix/lib/pcb-rnd/plugins/ system plugins +
~/.pcb/plugins/$arch/ user plugins, multihost +
~/.pcb/plugins/ user plugins +
./plugins/$arch/ project plugins, multihost +
./plugins/ project plugins +
+In the above table: +

    +
  • $prefix is the installation prefix (normally /usr) +
  • $arch is the host arch triplet, e.g. i386-unknown-linux; this is useful if multiple architectures share the same NFS mounted plugin dir +
  • ~ is the user home directory, if exists, e.g. /home/jdoe +
  • ./ is the current working directory pcb has been started from; may be useful for project-local scripts +
+ +

3.2. Loading scripts

+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. +

+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. +

+Example config: +

+# 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
+
Index: tags/1.0.5/doc-rnd/gpmi/util/Makefile =================================================================== --- tags/1.0.5/doc-rnd/gpmi/util/Makefile (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/util/Makefile (revision 953) @@ -0,0 +1 @@ +all: Index: tags/1.0.5/doc-rnd/gpmi/util/rosetta_genpages.sh =================================================================== --- tags/1.0.5/doc-rnd/gpmi/util/rosetta_genpages.sh (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/util/rosetta_genpages.sh (revision 953) @@ -0,0 +1,171 @@ +#!/bin/sh + +clean_id() +{ + tr "\r\n" "~" | sed ' +s/~*$//; +s/|/\&pipe;/g; +s/&/\&/g; +s//\>/g; +s/"/\"/g; +s/'\''/\'/g; +s/~\+/
/g; +' + echo "" +} + +genpage() +{ + local dir scripts name desc + + dir="$1" + scripts="$2" + + name=`cat $dir/ID.name` + desc=`cat $dir/ID.desc` + ./tags < "$dir/ex.html" | awk -v "fn_ref=../packages/XREF" -v "scripts=$scripts" -v "name=$name" -v "desc=$desc" ' + BEGIN { + while((getline < fn_ref) > 0) { + REF[$2] = $3 + } + print "" + print "" + print "<-- back to the index of Rosetta examples" + print "

" name "

" + print desc + + print "

Example implementations

" + v = split(scripts, S, "[\r\n]+") + for(n = 1; n <= v; n++) { + lang=S[n] + sub("^ex[.]", "", lang) + if (n != 1) + print " | " + print "" lang "" + } + + print "

Explanation, step by step

" + } + /^/ { + gsub("", "", $0) + name=$0 + gsub("[ \t]*", "", name) + if (name in REF) { + link_begin="" + link_end = "" + } + else { + link_begin="" + link_end="" + } + print "" link_begin $0 link_end "" + next + } + + { print $0 } + + ' > "$dir/index.html" +} + +gen_index() +{ + + awk -v "template=$1" ' + BEGIN { + FS="[|]" + q = "\"" + LANGS["rb"] = "ruby" + LANGS["pl"] = "perl" + LANGS["py"] = "python" + LANGS["stt"] = "stutter" + LANGS["scm"] = "scheme" + } + + ($1 == "scripts") { + s = $3 + gsub("ex[.]", "", s) + v = split(s, S, " ") + s = "" + for(n = 1; n <= v; n++) { + if (S[n] in LANGS) + s = s " " LANGS[S[n]] + else + s = s " " S[n] + } + DATA[$2, $1] = s + next + } + + ($1 == "name") { + if (names == "") + names = $2 + else + names = names "|" $2 + } + + + { + # DATA[script, name] = "hello world" + DATA[$2, $1] = $3 + } + + function generate(cmd ,N,n,v,name,level) { + if (cmd == "index") { + print "" + print "" + print "
lvlexample languages description" + v = split(names, N, "[|]") + for(n = 1; n <= v; n++) { + name = N[n] + level = name + sub("_.*", "", level) + if (level ~ "[^0-9]") + level = "n/a" + print "
" level + print " " DATA[name, "name"] "" + print " " DATA[name, "scripts"] + print " " DATA[name, "desc"] + } + print "
" + } + else + print "Do not know how to generate " cmd > "/dev/stderr" + } + + END { + FS="" + while((getline < template) > 0) { + if (match($0, "]*>")) { + print substr($0, 1, RSTART-1) + cmd=substr($0, RSTART+8, RLENGTH-9) + sub("^[ \t]*", "", cmd) + generate(cmd) + print substr($0, RSTART+RLENGTH) + } + else + print $0 + } + } + ' + +} + + +for n in ../rosetta/* +do + if test -d "$n" + then + bn=`basename $n` + scripts=`cd $n && ls ex.* | grep -v ".pyc$\|.html$" ` + genpage "$n" "$scripts" + echo -n "desc|$bn|" + clean_id < $n/ID.desc + echo -n "name|$bn|" + clean_id < $n/ID.name + echo -n "scripts|$bn|" + echo $scripts + fi +done | gen_index ../rosetta/index.templ.html > ../rosetta/index.html + + Property changes on: tags/1.0.5/doc-rnd/gpmi/util/rosetta_genpages.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/doc-rnd/gpmi/util/tags =================================================================== --- tags/1.0.5/doc-rnd/gpmi/util/tags (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi/util/tags (revision 953) @@ -0,0 +1,4 @@ +#!/bin/sh + +tr "\n" " " | sed "s@\(<[^/]\)@\n\1@g;s@\(]*>\)@\1\n@g" + Property changes on: tags/1.0.5/doc-rnd/gpmi/util/tags ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/doc-rnd/gpmi.html =================================================================== --- tags/1.0.5/doc-rnd/gpmi.html (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi.html (revision 953) @@ -0,0 +1,41 @@ + + +

pcb-rnd - the [gpmi] patch

+ +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: +
    +
  • register new actions +
  • create new menus and submenus +
  • execute existing actions +
  • pop up simple dialog boxes (message, report, progress bar, file selection) -- check out the video +
  • build and pop up custom dialog boxes (so called attribute dialogs) +
  • search for objects (lines, arc, polys, vias, etc.) on the layout +
  • change and move existing objects on the layout +
  • create new objects on the layout +
  • change "page" properties (dimensions of the board) +
  • debug draw on the gui (slightly broken on gtk due to some gtk hid bugs) +
+ +

+This feature has three options: +

    +
  • disabled: not compiled at all - when gpmi is not installed (no gpmi scripting in PCB) +
  • buildin: compiled and linked in the executable - pcb-rnd always can load and run scripts +
  • plugin: compiled as a loadable plugin - pcb-rnd can load and run scripts if the plugin is installed +
+ +

Example

+Check out the Rosetta stone of +pcb-rnd. + +

save/load and compatibility

+Save/load files are not affected. + +

plans

+Expose more internals, write more example scripts and documentation. + + + Index: tags/1.0.5/doc-rnd/gpmi_temp_inst.txt =================================================================== --- tags/1.0.5/doc-rnd/gpmi_temp_inst.txt (nonexistent) +++ tags/1.0.5/doc-rnd/gpmi_temp_inst.txt (revision 953) @@ -0,0 +1,65 @@ +GPMI system-wide installation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The installation process is somewhat manual at this early stage. Please +follow the steps below. + +First, you'll need libgpmi - it's a general purpose script glue interface. + +A/1. svn checkout svn://repo.hu/gpmi/trunk gpmi/trunk +A/2. look at doc/languages.txt there; if you have preferred languages, +please install the -dev packages of those. My favorite is mawk, but I +think most of the example pcb scripts would be in lua. Versions should +match; it may be that gpmi works with a newer minor version out of the +box, tho. +A/3. run ./configure +A/4. check if it found the language(s) you wanted; if not, or anything +else breaks, please send me your scconfig/config.log +A/5. make +A/6. make install (as root, but see below) + +There are options to step 6: + +- if you want to check what it'd do, you could run this: + + install_root=/tmp/foo make install + + it's like DESTDIR for autotools: it will do everything but will use + /tmp/foo instead of / so you see what it'd do without using root or + messing with /usr + +- you can use make linstall instead of make install; this creates symlinks +(pointing to the binaries in your user checkout) instead of copying the +files. If gpmi changes and you need to update and recompile, you won't +need to reinstall (until the number of files change). + +- there's a make uninstall, but it's more or less untested (failed once +and worked once for me) + +Second, you'll need pcb-rnd: + +B/1. svn checkout svn://repo.hu/pcb-rnd/trunk pcb-rnd/trunk +B/2. ./configure +B/3. check the output; if anything went wrong, please send me +scconfig/config.log +B/4. make +B/5. you don't need to install it for testing: cd src; ./pcb-rnd + + +There are options in step 2: by default, if gpmi is found, it's compiled +in "buildin" mode, which means script support is compiled into the pcb-rnd +executable. An alternative is to have it as a plugin (dynamic linkable +object). This can be done using the --plugin-gpmi argument for ./configure. + + +GPMI local installation +~~~~~~~~~~~~~~~~~~~~~~~ +GPMI can be installed without root, into a local user directory (typically +under home). To achieve this, follow the above steps with the following +modifications (assuming you want to install gpmi in ~/usr): + +A/3. ./configure --prefix=~/usr +B/2. ./configure --gpmi-prefix=~/usr + +NOTE: you don't need to use install_root; gpmi will install under ~/usr as +if it was /usr. Index: tags/1.0.5/doc-rnd/index.html =================================================================== --- tags/1.0.5/doc-rnd/index.html (nonexistent) +++ tags/1.0.5/doc-rnd/index.html (revision 953) @@ -0,0 +1,52 @@ + + +

pcb-rnd

+PCB-rnd is a fork of PCB, part of +the geda project. This fork features embedded scripting and a set of random +smaller features and bugfixes. +I don't plan to submit these patches to the upstream or merge changes from +the official repo (motivation). +

+When I work on pcb-rnd, I also write a developer log. +

+Feel free to give it a try: +

+ +

+List of major changes: + +
commit message tag and docdescription +
[gpmi] scripting PCB (including GUI dialogs, actions, menus, changing the layout) +
[intconn] component internal connections +
[nonetlist] components that are not part of the netlist and should not cause shorts +
[tostyle] 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 +
[mincut] minimal cut based warnings on shorts +
[square] change square pad to a generic shaped-pin based on the octagon pin code - this is an alternative to teardrops +
[flagcomp] unknown flag compatibility +
[scconfig] use scconfig instead of autotools +
[pcb-fp] generic parametric footprints; on-the-fly footprint generation by external tools written in any language (remove m4 hardwirings) +
[pcblib], + [pcblib-param] clean up the footprint library shipped +
[debian] Debian packaging the binaries configured to my own taste +
[ba] back annotation +
[onpoint] on-point by Robert Drehmel + +
+I have plans on my TODO list - these have lower priority +compared to the features above. + +

+Extra documentation: +

+ + + + Index: tags/1.0.5/doc-rnd/intconn.html =================================================================== --- tags/1.0.5/doc-rnd/intconn.html (nonexistent) +++ tags/1.0.5/doc-rnd/intconn.html (revision 953) @@ -0,0 +1,64 @@ + + +

pcb-rnd - the [intconn] patch

+ +There are parts with internal connections (e.g. pin 2 and 4 of a SO8 +package are internally connected). Vanilla PCB can not handle this, +leaving the following options: +
    +
  • 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 +
  • back-annotate which pin is connected - there's no easy back annotation +
  • 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 +
+

+The patch introduces a new pin flag intconn(g) which marks the pin +to have internal connections in group g. If there +are multiple pins using the same g value within a single element, they +are internally connected. In other words, g 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 g shall be between 1 and 255, 0 means no internal +connection (equivalent to the case when intconn(0) is omitted). +

+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". +

+Combined with the [nonetlist] 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. +

Example

+Crossing traces resolved using a 0 Ohm 1206 resistor called J1. The footprint +has an intconn between the two pads which resolves the final rat line. +

+ +

+ +

+ +

+ + + +

save/load and compatibility

+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: +
+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)"]
+
+Vanilla PCB will load the design ignoring internal connections - +this may introduce new rats. +

+Vanilla PCB doesn't save intconn() and elements are embedded in the file - +once the design is loaded and saved with vanilla PCB, internal connection +info is lost. + +

plans

+No plans - this feature is fully implemented. There is no plan for implementing +a GUI, internal connections should be hand-edited into the element. + + Index: tags/1.0.5/doc-rnd/intconn1.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/intconn1.png =================================================================== --- tags/1.0.5/doc-rnd/intconn1.png (nonexistent) +++ tags/1.0.5/doc-rnd/intconn1.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/intconn1.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/intconn2.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/intconn2.png =================================================================== --- tags/1.0.5/doc-rnd/intconn2.png (nonexistent) +++ tags/1.0.5/doc-rnd/intconn2.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/intconn2.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/intconn3.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/intconn3.png =================================================================== --- tags/1.0.5/doc-rnd/intconn3.png (nonexistent) +++ tags/1.0.5/doc-rnd/intconn3.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/intconn3.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/jumper_1206.fp =================================================================== --- tags/1.0.5/doc-rnd/jumper_1206.fp (nonexistent) +++ tags/1.0.5/doc-rnd/jumper_1206.fp (revision 953) @@ -0,0 +1,7 @@ +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] +) Index: tags/1.0.5/doc-rnd/keys.html =================================================================== --- tags/1.0.5/doc-rnd/keys.html (nonexistent) +++ tags/1.0.5/doc-rnd/keys.html (revision 953) @@ -0,0 +1,556 @@ + +

Key to action bindings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
key modifiers pcb-menu.res
lesstif
gpcb-menu.res
gtk +
. +   + Display(Toggle45Degree) + Display(Toggle45Degree) +
/ +   + Display(CycleClip) + Display(CycleClip) +
1 + shift + PasteBuffer(1) + PasteBuffer(1) +
2 + shift + PasteBuffer(2) + PasteBuffer(2) +
3 + shift + PasteBuffer(3) + PasteBuffer(3) +
4 + shift + PasteBuffer(4) + PasteBuffer(4) +
5 + shift + PasteBuffer(5) + PasteBuffer(5) +
: +   + Command() + Command() +
= +   + djopt(simple) + djopt(simple) +
shift + djopt(auto) + djopt(auto) +
[ +   + Mode(Save) + Mode(Save) +
] +   + Mode(Release) + Mode(Release) +
` +   + Zoom(Toggle) +   +
a +   + SetSame() + SetSame() +
alt + Select(All) + Select(All) +
alt-shift + Unselect(All) + Unselect(All) +
b +   + Flip(Object) + Flip(Object) +
shift + Flip(SelectedElements) + Flip(SelectedElements) +
backspace +   + Delete(Selected) + RemoveSelected() +
shift + Atomic(Save) + Atomic(Save) +
c +   + Center() + Center() +
ctrl + Mode(PasteBuffer) + Mode(PasteBuffer) +
d +   + Display(PinOrPadName) + Display(PinOrPadName) +
shift + Display(Pinout) + Display(Pinout) +
delete +   + Delete(Selected) + Mode(Save) +
shift + Atomic(Save) + RemoveSelected() +
down +   + Cursor(Warp,0,-1,grid) + Cursor(Warp,0,-1,grid) +
shift + Cursor(Pan,0,-50,view) + Cursor(Pan,0,-50,view) +
e +   + DeleteRats(AllRats) + DeleteRats(AllRats) +
shift + DeleteRats(SelectedRats) + DeleteRats(SelectedRats) +
enter +   + Mode(Notify) + Mode(Notify) +
escape +   + Mode(Cancel) + Mode(Escape) +
f +   + Connection(Reset) + Connection(Reset) +
ctrl + Connection(Find) + Connection(Find) +
shift + Display(Redraw) + Display(Redraw) +
f1 +   + Mode(Via) + Mode(Via) +
f10 +   + Mode(Thermal) + Mode(Thermal) +
f11 +   + Mode(Arrow) + Mode(Arrow) +
f12 +   + Mode(Lock) + Mode(Lock) +
f2 +   + Mode(Line) + Mode(Line) +
f3 +   + Mode(Arc) + Mode(Arc) +
f4 +   + Mode(Text) + Mode(Text) +
f5 +   + Mode(Rectangle) + Mode(Rectangle) +
f6 +   + Mode(Polygon) + Mode(Polygon) +
f7 +   + Mode(PasteBuffer) + Mode(PasteBuffer) +
shift + PasteBuffer(Rotate,1) + PasteBuffer(Rotate,1) +
f8 +   + Mode(Remove) + Mode(Remove) +
f9 +   + Mode(Rotate) + Mode(Rotate) +
g +   + SetValue(Grid,+5,mil) + SetValue(Grid,+5,mil) +
ctrl + SetValue(Grid,+0.05,mm) + SetValue(Grid,+0.05,mm) +
ctrl-shift + SetValue(Grid,-0.05,mm) + SetValue(Grid,-0.05,mm) +
shift + SetValue(Grid,-5,mil) + SetValue(Grid,-5,mil) +
h +   + ToggleHideName(Object) + ToggleHideName(Object) +
ctrl + ChangeHole(Object) + ChangeHole(Object) +
shift + ToggleHideName(SelectedElements) + ToggleHideName(SelectedElements) +
i +   +   + DoWindows(Library) +
insert +   + Mode(InsertPoint) + Mode(InsertPoint) +
j +   + ChangeJoin(Object) + ChangeJoin(Object) +
shift + ChangeJoin(SelectedObjects) + ChangeJoin(SelectedObjects) +
k +   + ChangeClearSize(Object,+2,mil) + ChangeClearSize(Object,+2,mil) +
ctrl + ChangeClearSize(SelectedObjects,+2,mil) + ChangeClearSize(SelectedObjects,+2,mil) +
ctrl-shift + ChangeClearSize(SelectedObjects,-2,mil) + ChangeClearSize(SelectedObjects,-2,mil) +
shift + ChangeClearSize(Object,-2,mil) + ChangeClearSize(Object,-2,mil) +
l +   + SetValue(LineSize,+5,mil) + SetValue(LineSize,+5,mil) +
shift + SetValue(LineSize,-5,mil) + SetValue(LineSize,-5,mil) +
left +   + Cursor(Warp,-1,0,grid) + Cursor(Warp,-1,0,grid) +
shift + Cursor(Pan,-50,0,view) + Cursor(Pan,-50,0,view) +
m +   + MoveToCurrentLayer(Object) + MoveToCurrentLayer(Object) +
ctrl + MarkCrosshair() + MarkCrosshair() +
shift + MoveToCurrentLayer(Selected) + MoveToCurrentLayer(Selected) +
n +   + ChangeName(Object) + ChangeName(Object) +
alt +   + ChangeNonetlist(Element) +
ctrl + New() + New() +
shift + AddRats(Close) + AddRats(Close) +
o +   + Atomic(Block) + Atomic(Block) +
ctrl + ChangeOctagon(Object) + ChangeOctagon(Object) +
shift + Atomic(Save) + Atomic(Save) +
p +   + Polygon(PreviousPoint) + Polygon(PreviousPoint) +
alt + ManagePlugins() + ManagePlugins() +
ctrl + AutoPlaceSelected() + AutoPlaceSelected() +
ctrl-shift + Display(ToggleThindrawPoly) + Display(ToggleThindrawPoly) +
shift + Polygon(Close) + Polygon(Close) +
q +   + ChangeSquare(Object) + ChangeSquare(ToggleObject) +
ctrl + Quit() + Quit() +
r +   + Report(NetLength) +   +
alt + AutoRoute(SelectedRats) + AutoRoute(SelectedRats) +
ctrl + ReportObject() + ReportObject() +
shift + Redo() + Redo() +
right +   + Cursor(Warp,1,0,grid) + Cursor(Warp,1,0,grid) +
shift + Cursor(Pan,50,0,view) + Cursor(Pan,50,0,view) +
s +   + ChangeSize(Object,+5,mil) + ChangeSize(Object,+5,mil) +
alt + ChangeDrillSize(Object,+5,mil) + ChangeDrillSize(Object,+5,mil) +
alt-shift + ChangeDrillSize(Object,-5,mil) + ChangeDrillSize(Object,-5,mil) +
ctrl + Save(Layout) + Save(Layout) +
ctrl-shift + Save(LayoutAs) + Save(LayoutAs) +
shift + ChangeSize(Object,-5,mil) + ChangeSize(Object,-5,mil) +
space +   + Mode(Arrow) + Mode(Arrow) +
t +   + SetValue(TextScale,+10,mil) + SetValue(TextScale,+10,mil) +
shift + SetValue(TextScale,-10,mil) + SetValue(TextScale,-10,mil) +
tab +   + SwapSides(V) + SwapSides(V) +
ctrl + SwapSides(R) + SwapSides(R) +
ctrl-shift + SwapSides() + SwapSides() +
shift + SwapSides(H) + SwapSides(H) +
u +   + Undo() + Undo() +
ctrl-shift + Undo(ClearList) + Undo(ClearList) +
up +   + Cursor(Warp,0,1,grid) + Cursor(Warp,0,1,grid) +
shift + Cursor(Pan,0,50,view) + Cursor(Pan,0,50,view) +
v +   + Zoom() + Zoom() +
alt + SetValue(ViaDrillingHole,+5,mil) + SetValue(ViaDrillingHole,+5,mil) +
alt-shift + SetValue(ViaDrillingHole,-5,mil) + SetValue(ViaDrillingHole,-5,mil) +
ctrl + Mode(PasteBuffer) + Mode(PasteBuffer) +
ctrl-shift + SetValue(ViaSize,-5,mil) + SetValue(ViaSize,-5,mil) +
shift + SetValue(ViaSize,+5,mil) + SetValue(ViaSize,+5,mil) +
w +   + AddRats(AllRats) + AddRats(AllRats) +
shift + AddRats(SelectedRats) + AddRats(SelectedRats) +
x + ctrl + Mode(PasteBuffer) + Mode(PasteBuffer) +
y +   + Puller() + Puller() +
shift + ChangeSizes(Object,style,mil); + ChangeSizes(Object,style,mil); +
z +   + Zoom(-1.2) + Zoom(-1.2) +
alt + Undo() +   +
shift + Zoom(+1.2) + Zoom(+1.2) +
| +   + Display(ToggleThindraw) + Display(ToggleThindraw) +
+ Index: tags/1.0.5/doc-rnd/mincut.html =================================================================== --- tags/1.0.5/doc-rnd/mincut.html (nonexistent) +++ tags/1.0.5/doc-rnd/mincut.html (revision 953) @@ -0,0 +1,47 @@ + + +

pcb-rnd - the [mincut] patch

+ +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: +
    +
  • manual tagging of objects (lines, polys, arcs, vias) with net and warn + where two differently tagged net connects +
  • automatic tagging based on "where it was connected first", then the same + warning mechanism as above +
  • trace history (using the undo buffer?) and go back until when it was + not broken, check what exactly broke it +
  • history combined with tagging +
  • calculate minimal cut +
+

+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). +

+The minimal cut is the least amount of object whose removal would resolve +the short. It is best demonstrated on an example: +

+ +

+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. +

+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). + +

save/load and compatibility

+New PCB flag enablemincut. Vanilla pcb ignores this flag but does not +preserve it. + +

plans

+Finished, no plans. + + Index: tags/1.0.5/doc-rnd/mincut.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/mincut.png =================================================================== --- tags/1.0.5/doc-rnd/mincut.png (nonexistent) +++ tags/1.0.5/doc-rnd/mincut.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/mincut.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/misc/install_cgi.html =================================================================== --- tags/1.0.5/doc-rnd/misc/install_cgi.html (nonexistent) +++ tags/1.0.5/doc-rnd/misc/install_cgi.html (revision 953) @@ -0,0 +1,45 @@ + + +

Installation of the footprint CGIs

+

system requirements, 3rd party software

+ The following software needs to be installed on the system + that will host the scripts: +
    +
  • /bin/bash (did not test with POSIX shell) +
  • awk (tested with gawk, may work with other modern implementation) +
  • common binutils, e.g. ls, find +
  • animator, the svn HEAD version; NOTE: it is possible to manually compile animator into a static executable (useful on dedicated web servers) +
  • a web server that can execute plain old CGI scripts +
  • a full checkout of pcb-rnd/trunk from svn://repo.hu/pcb-rnd/trunk +
+ +

Installation

+Since the CGIs are just demo scripts for repo.hu and are not really installed +anywhere else normally, there is no install script but a manual installation +process. For both the parametric and the static footprint CGI: +
    +
  1. check out pcb-rnd/trunk in a directory readable (but not writable) by www-data (or whatever user the CGI will run with) +
  2. copy the config file pcblib.cgi.conf from pcb-rnd/trunk/util to /etc +
  3. edit the config file; ignore setting sdir for now +
  4. hardlink, copy, or wrap the cgi files from under pcb-rnd/trunk/util into the web server's CGI directory +
+

+For the static footprint CGI (set up the map cache): +

    +
  1. cd to trunk/util/pcblib-map in the checkout and run make - NOTE: some awk scripts have hardwired CGI paths yet (TODO) +
  2. copy this directory to a web-accessible directory +
  3. set sdir to the absolute path of the web-accessible copy in /etc/pcblib.cgi.conf +
+ +

Tips and tricks

+

cgi wrapping

+Making the checkout directly into the cgi-bin dir is not a good idea. Using +a hard link on each CGI between the checkout and the cgi-bin dir is better, +but an svn up will silently break the link leaving the old version live. +The most stable solution is placing a wrapper script in the cgi-bin dir: +
+#!/bin/bash
+. /full/path/to/the/checkout/util/pcblib-param.cgi
+
+ + Index: tags/1.0.5/doc-rnd/motivation.html =================================================================== --- tags/1.0.5/doc-rnd/motivation.html (nonexistent) +++ tags/1.0.5/doc-rnd/motivation.html (revision 953) @@ -0,0 +1,58 @@ + + +

pcb-rnd motivation

+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: +
    +
  • PCB already knew 95% of everything I'd ever need years ago +
  • the remaining 5% was not on the TODO list of developers and generally no one shown much interest in getting patches for those +
  • meanwhile a lot of new features have been added, from which most I find totally useless: +
      +
    • dbus +
    • gl - transparency makes even simple 2 sided boards unusable; slower than the classic version sw render on all my computers +
    • preparation for a C++ transition +
    +
  • the official Debian package enables (requires, depends on) both dbus and gl +
  • 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 +
  • DVCS always 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 +
  • it's nearly impossible to get small patches applied^1: +
      +
    • often no one has the time to revise and commit them +
    • communication requires web2.0 +
    • there are too many cycles of "please fix this and change that first" +
    • with the chaos VCS, it's too likely that new feature patches would require ongoing maintenance to avoid that a large scale merge (or rebase, whatever) of another feature branch breaks it +
    • 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. +
    +
  • I don't even dream about getting larger patches in the official release^1 +
  • no stable release for years; maintaining a set of patches (like pcb-gpmi) and porting them to new releases is too much hassle +
+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: +
    +
  • I stick with my fork and will use it on all my computers for all my designs +
  • Because of that, there's no emphasis on keeping the file formats compatible +
  • 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). +
  • 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 +
  • plans for new features: +
      +
    • pin shapes (a preliminary version is already implemented) +
    • 1206 jumpers without having to add them on the schematics/netlist (done: [intconn] and [nonetlist] are the PCB-side features for this) +
    • merge pcb-gpmi; GPMI would be an optional addon, it'd probably stay a plugin, but there should not be a separate repo (done) +
    +
+

+Footnotes: +

    +
  • ^1: this may have changed lately and pcb developers are more open to newcomers +
+ + Index: tags/1.0.5/doc-rnd/nonetlist.html =================================================================== --- tags/1.0.5/doc-rnd/nonetlist.html (nonexistent) +++ tags/1.0.5/doc-rnd/nonetlist.html (revision 953) @@ -0,0 +1,53 @@ + + +

pcb-rnd - the [nonetlist] patch

+ +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). +

+Uses of the nonetlist feature: +

    +
  • smd jumper: Combined with the [intconn] 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. +
  • mechanical parts that should not show up on the schematics: +
      +
    • mounting hole elements: single pin holes with silk marking the head of the screw +
    • chassis (often with mounting holes or keep-out areas) +
    • logos in footprints (no poly support in footprint - yet?) +
    • mechanical parts which do not have solderable pins (plastic spacers, extra connector shields) +
    • "spare parts", e.g. unused/disconnected DIP sockets or pin grids or connectors in a corner of the PCB for prototyping (dev-board style) +
    +
+

+Preservation: gsch2pcb-rnd leaves nonetlist elements in the PCB. +

save/load and compatibility

+This patch introduces a new element flag. The following example demonstrates +a 1206 jumper footprint: +
+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]
+)
+
+Vanilla 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. +

+Vanilla PCB doesn't save nonetlist and elements are embedded in the file - +once the design is loaded and saved with vanilla PCB, the flag is lost. +After reloading the file in pcb-rnd, the element causes the same shorts +as in vanilla PCB. + +

plans

+No plans, the feature is complete. + + Index: tags/1.0.5/doc-rnd/onpoint.html =================================================================== --- tags/1.0.5/doc-rnd/onpoint.html (nonexistent) +++ tags/1.0.5/doc-rnd/onpoint.html (revision 953) @@ -0,0 +1,50 @@ + + +

pcb-rnd - the [onpoint] patches

+ +Robert Drehmel writes: +
+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.
+
+ +

save/load and compatibility

+Not affected. + +

plans

+The feature is complete. + + + Index: tags/1.0.5/doc-rnd/pcb-fp.html =================================================================== --- tags/1.0.5/doc-rnd/pcb-fp.html (nonexistent) +++ tags/1.0.5/doc-rnd/pcb-fp.html (revision 953) @@ -0,0 +1,36 @@ + + +

pcb-rnd - the [pcb-fp] patch

+ +Pcb-fp is an effort to clean up the footprint situation: +
    +
  • replace lib and newlib with pcblib, a library that tries to provide common footprints only +
  • clear the syntax: if a footprint name contains parenthesis, it's generated (parametric footprint), else it's the name of a static footprint file +
  • parametric footprints: replace m4 with a generic, language-independent footprint generator framework +
      +
    • implement libpcb_fp, which centralizes searching and loading footprints +
    • fork gsch2pcb to gsch2pcb-rnd that uses libpcb_fp (and does not have any m4 references hardwired) +
    • fork gnet_gsch2pcb.scm (the gnetlist backend) to remove m4 heuristics +
    +
+ +

Example

+Intaractive parametric footprint selection in pcb-rnd: +

+ +

+An online footprint generator web1.0 version is also available. + +

save/load and compatibility

+Save/load files are not affected. If a schematics is written for the new +library and depends on parametric footprints: +
    +
  • vanilla gsch2pcb won't find those footprints +
  • vanilla pcb won't show those footprints in the footprint selection dialog +
+ +

plans

+No plans - this feature is fully implemented. + + + Index: tags/1.0.5/doc-rnd/pcb-fp.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/pcb-fp.png =================================================================== --- tags/1.0.5/doc-rnd/pcb-fp.png (nonexistent) +++ tags/1.0.5/doc-rnd/pcb-fp.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/pcb-fp.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/pcblib.html =================================================================== --- tags/1.0.5/doc-rnd/pcblib.html (nonexistent) +++ tags/1.0.5/doc-rnd/pcblib.html (revision 953) @@ -0,0 +1,49 @@ + + +

pcb-rnd - the [pcblib] and [pcblib-param] patches

+ +
+The footprint library shipped with vanilla 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 ... +
    +
  • ... for the very beginning of the learning curve; +
  • ... and to be the core of the user's own library later. +
+

+[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. +

+There is an online map of +the library and +an online interface to the parametric footprint generators. + +

Design decisions

+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. +

+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. + +

Example

+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! + +

save/load and compatibility

+Not affected: elements are embedded in the PCB. + +

plans

+None, the feature is complete. +
            + + +
+ + Index: tags/1.0.5/doc-rnd/pcblib.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/pcblib.png =================================================================== --- tags/1.0.5/doc-rnd/pcblib.png (nonexistent) +++ tags/1.0.5/doc-rnd/pcblib.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/pcblib.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/polygrid.html =================================================================== --- tags/1.0.5/doc-rnd/polygrid.html (nonexistent) +++ tags/1.0.5/doc-rnd/polygrid.html (revision 953) @@ -0,0 +1,17 @@ + + +

pcb-rnd - the [polygrid] patch

+ +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. + +

save/load and compatibility

+Not affected. + +

plans

+Fix bugs. +

+No (feature) plans - this feature is fully implemented. + + Index: tags/1.0.5/doc-rnd/scconfig.html =================================================================== --- tags/1.0.5/doc-rnd/scconfig.html (nonexistent) +++ tags/1.0.5/doc-rnd/scconfig.html (revision 953) @@ -0,0 +1,15 @@ + + +

pcb-rnd - the [scconfig] patch

+ +Pcb-rnd uses scconfig +for ./configure instead of autotools. Scconfig is smaller and easier +to maintain. + +

save/load and compatibility

+Not affected. + +

plans

+No plans - this feature is almost fully implemented. + + Index: tags/1.0.5/doc-rnd/square.html =================================================================== --- tags/1.0.5/doc-rnd/square.html (nonexistent) +++ tags/1.0.5/doc-rnd/square.html (revision 953) @@ -0,0 +1,71 @@ + + +

pcb-rnd - the [square] patch

+Most of my PCBs end up in toner transfer. 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: +
    +
  • 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 +
  • DJ's teardrop plugin: this increases the area only toward the trace, whereas very often there's more room on the opposite side +
  • manually add an extra poly around the pin; with multiple pins it's hard to get the polys separate +
  • 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 +
+ +

+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. +

+The code is also patched to handle clearances, shorts and connections (find.c). +

+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. + +

save/load and compatibility

+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: +
+Pin[40000 60000 6000 3000 6600 2800 "8" "8" "square,shape(3)"]
+
+Vanilla 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. +

+Vanilla PCB doesn't save shape() - once the design is loaded and saved with +vanilla PCB pin shape info is lost. + +

plans

+In the original code there are separate code paths for round, octagonal and +square pins. The separation repeats for at least: +
    +
  • drawing the pin shape +
  • calculating the clearance +
  • checking whether things overlap or connect (pin vs pin, pin vs line, etc.) +
  • autorouter +
+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). +

+The [square] feature is a good base for cleaning up the code a bit and for +moving toward a generic pin shape patch: +

    +
  • hardwired octagon calculations should be replaced to use the same x;y const offset table +
  • the table should be replaced by a struct that describes length (number of points) - alternatively use POLYAREA +
  • square pin should be renamed to polygon pin +
  • octagon flag shall be removed - it should be a configuration of the x;y const table +
  • square flag shall be removed - it should be a configuration +
  • the only flag remaining should be shape(); if a pin is not shaped, it's round +
  • 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 vanilla PCB format. +
  • there should be a set of pin shapes in a default configuration table, including square and octagonal; these should be static +
  • the PCB file format should be extended with an option to expand the pin shape table with custom shapes +
  • UI: shapes could be imported (converted) from polys around vias +
  • 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 +
+ + Index: tags/1.0.5/doc-rnd/square.pcb =================================================================== --- tags/1.0.5/doc-rnd/square.pcb (nonexistent) +++ tags/1.0.5/doc-rnd/square.pcb (revision 953) @@ -0,0 +1,893 @@ +# release: pcb 20110918 + +# To read pcb files, the pcb version (or the git source date) must be >= the file version +FileVersion[20070407] + +PCB["" 130000 105000] + +Grid[2500.0 0 0 1] +Cursor[0 0 0.000000] +PolyArea[3100.006200] +Thermal[0.500000] +DRC[1000 1000 1000 1000 1500 1000] +Flags("nameonpcb,uniquename,clearnew") +Groups("1,c:2,s:3:4:5:6:7:8") +Styles["Signal,1500,6000,3150,2500:Power,3000,6000,3937,2500:Fat,8000,6000,3500,2500:Skinny,1200,2402,1181,2500"] + +Symbol[' ' 1800] +( +) +Symbol['!' 1200] +( + SymbolLine[0 4500 0 5000 800] + SymbolLine[0 1000 0 3500 800] +) +Symbol['"' 1200] +( + SymbolLine[0 1000 0 2000 800] + SymbolLine[1000 1000 1000 2000 800] +) +Symbol['#' 1200] +( + SymbolLine[0 3500 2000 3500 800] + SymbolLine[0 2500 2000 2500 800] + SymbolLine[1500 2000 1500 4000 800] + SymbolLine[500 2000 500 4000 800] +) +Symbol['$' 1200] +( + SymbolLine[1500 1500 2000 2000 800] + SymbolLine[500 1500 1500 1500 800] + SymbolLine[0 2000 500 1500 800] + SymbolLine[0 2000 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4000 800] + SymbolLine[1500 4500 2000 4000 800] + SymbolLine[500 4500 1500 4500 800] + SymbolLine[0 4000 500 4500 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['%' 1200] +( + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[1000 2500 1500 2000 800] + SymbolLine[500 2500 1000 2500 800] + SymbolLine[0 2000 500 2500 800] + SymbolLine[0 5000 4000 1000 800] + SymbolLine[3500 5000 4000 4500 800] + SymbolLine[4000 4000 4000 4500 800] + SymbolLine[3500 3500 4000 4000 800] + SymbolLine[3000 3500 3500 3500 800] + SymbolLine[2500 4000 3000 3500 800] + SymbolLine[2500 4000 2500 4500 800] + SymbolLine[2500 4500 3000 5000 800] + SymbolLine[3000 5000 3500 5000 800] +) +Symbol['&' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 3500 1500 2000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[0 2500 2500 5000 800] + SymbolLine[500 1000 1000 1000 800] + SymbolLine[1000 1000 1500 1500 800] + SymbolLine[1500 1500 1500 2000 800] + SymbolLine[0 3500 0 4500 800] +) +Symbol[''' 1200] +( + SymbolLine[0 2000 1000 1000 800] +) +Symbol['(' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] +) +Symbol[')' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['*' 1200] +( + SymbolLine[0 2000 2000 4000 800] + SymbolLine[0 4000 2000 2000 800] + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol['+' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[1000 2000 1000 4000 800] +) +Symbol[',' 1200] +( + SymbolLine[0 6000 1000 5000 800] +) +Symbol['-' 1200] +( + SymbolLine[0 3000 2000 3000 800] +) +Symbol['.' 1200] +( + SymbolLine[0 5000 500 5000 800] +) +Symbol['/' 1200] +( + SymbolLine[0 4500 3000 1500 800] +) +Symbol['0' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4000 2000 2000 800] +) +Symbol['1' 1200] +( + SymbolLine[0 1800 800 1000 800] + SymbolLine[800 1000 800 5000 800] + SymbolLine[0 5000 1500 5000 800] +) +Symbol['2' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[0 5000 2500 2500 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['3' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 2800 1500 2800 800] + SymbolLine[2000 1500 2000 2300 800] + SymbolLine[2000 3300 2000 4500 800] + SymbolLine[2000 3300 1500 2800 800] + SymbolLine[2000 2300 1500 2800 800] +) +Symbol['4' 1200] +( + SymbolLine[0 3500 2000 1000 800] + SymbolLine[0 3500 2500 3500 800] + SymbolLine[2000 1000 2000 5000 800] +) +Symbol['5' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 1000 0 3000 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[500 2500 1500 2500 800] + SymbolLine[1500 2500 2000 3000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['6' 1200] +( + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1500 2800 2000 3300 800] + SymbolLine[0 2800 1500 2800 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3300 2000 4500 800] +) +Symbol['7' 1200] +( + SymbolLine[500 5000 2500 1000 800] + SymbolLine[0 1000 2500 1000 800] +) +Symbol['8' 1200] +( + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3700 0 4500 800] + SymbolLine[0 3700 700 3000 800] + SymbolLine[700 3000 1300 3000 800] + SymbolLine[1300 3000 2000 3700 800] + SymbolLine[2000 3700 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 2300 700 3000 800] + SymbolLine[0 1500 0 2300 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2300 800] + SymbolLine[1300 3000 2000 2300 800] +) +Symbol['9' 1200] +( + SymbolLine[500 5000 2000 3000 800] + SymbolLine[2000 1500 2000 3000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol[':' 1200] +( + SymbolLine[0 2500 500 2500 800] + SymbolLine[0 3500 500 3500 800] +) +Symbol[';' 1200] +( + SymbolLine[0 5000 1000 4000 800] + SymbolLine[1000 2500 1000 3000 800] +) +Symbol['<' 1200] +( + SymbolLine[0 3000 1000 2000 800] + SymbolLine[0 3000 1000 4000 800] +) +Symbol['=' 1200] +( + SymbolLine[0 2500 2000 2500 800] + SymbolLine[0 3500 2000 3500 800] +) +Symbol['>' 1200] +( + SymbolLine[0 2000 1000 3000 800] + SymbolLine[0 4000 1000 3000 800] +) +Symbol['?' 1200] +( + SymbolLine[1000 3000 1000 3500 800] + SymbolLine[1000 4500 1000 5000 800] + SymbolLine[0 1500 0 2000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 2000 800] + SymbolLine[1000 3000 2000 2000 800] +) +Symbol['@' 1200] +( + SymbolLine[0 1000 0 4000 800] + SymbolLine[0 4000 1000 5000 800] + SymbolLine[1000 5000 4000 5000 800] + SymbolLine[5000 3500 5000 1000 800] + SymbolLine[5000 1000 4000 0 800] + SymbolLine[4000 0 1000 0 800] + SymbolLine[1000 0 0 1000 800] + SymbolLine[1500 2000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 3000 3500 800] + SymbolLine[3000 3500 3500 3000 800] + SymbolLine[3500 3000 4000 3500 800] + SymbolLine[3500 3000 3500 1500 800] + SymbolLine[3500 2000 3000 1500 800] + SymbolLine[2000 1500 3000 1500 800] + SymbolLine[2000 1500 1500 2000 800] + SymbolLine[4000 3500 5000 3500 800] +) +Symbol['A' 1200] +( + SymbolLine[0 2000 0 5000 800] + SymbolLine[0 2000 700 1000 800] + SymbolLine[700 1000 1800 1000 800] + SymbolLine[1800 1000 2500 2000 800] + SymbolLine[2500 2000 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['B' 1200] +( + SymbolLine[0 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3300 2500 4500 800] + SymbolLine[2000 2800 2500 3300 800] + SymbolLine[500 2800 2000 2800 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2300 800] + SymbolLine[2000 2800 2500 2300 800] +) +Symbol['C' 1200] +( + SymbolLine[700 5000 2000 5000 800] + SymbolLine[0 4300 700 5000 800] + SymbolLine[0 1700 0 4300 800] + SymbolLine[0 1700 700 1000 800] + SymbolLine[700 1000 2000 1000 800] +) +Symbol['D' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[1800 1000 2500 1700 800] + SymbolLine[2500 1700 2500 4300 800] + SymbolLine[1800 5000 2500 4300 800] + SymbolLine[0 5000 1800 5000 800] + SymbolLine[0 1000 1800 1000 800] +) +Symbol['E' 1200] +( + SymbolLine[0 2800 1500 2800 800] + SymbolLine[0 5000 2000 5000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] +) +Symbol['F' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[0 2800 1500 2800 800] +) +Symbol['G' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[1000 3000 2000 3000 800] +) +Symbol['H' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[2500 1000 2500 5000 800] + SymbolLine[0 3000 2500 3000 800] +) +Symbol['I' 1200] +( + SymbolLine[0 1000 1000 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 1000 5000 800] +) +Symbol['J' 1200] +( + SymbolLine[700 1000 1500 1000 800] + SymbolLine[1500 1000 1500 4500 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 4500 0 4000 800] +) +Symbol['K' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3000 2000 1000 800] + SymbolLine[0 3000 2000 5000 800] +) +Symbol['L' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['M' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 1500 3000 800] + SymbolLine[1500 3000 3000 1000 800] + SymbolLine[3000 1000 3000 5000 800] +) +Symbol['N' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 1000 2500 5000 800] + SymbolLine[2500 1000 2500 5000 800] +) +Symbol['O' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['P' 1200] +( + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] +) +Symbol['Q' 1200] +( + SymbolLine[0 1500 0 4500 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1500 1000 800] + SymbolLine[1500 1000 2000 1500 800] + SymbolLine[2000 1500 2000 4000 800] + SymbolLine[1000 5000 2000 4000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[1000 3500 2000 5000 800] +) +Symbol['R' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[2500 1500 2500 2500 800] + SymbolLine[2000 3000 2500 2500 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[1300 3000 2500 5000 800] +) +Symbol['S' 1200] +( + SymbolLine[2000 1000 2500 1500 800] + SymbolLine[500 1000 2000 1000 800] + SymbolLine[0 1500 500 1000 800] + SymbolLine[0 1500 0 2500 800] + SymbolLine[0 2500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['T' 1200] +( + SymbolLine[0 1000 2000 1000 800] + SymbolLine[1000 1000 1000 5000 800] +) +Symbol['U' 1200] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 1000 2000 4500 800] +) +Symbol['V' 1200] +( + SymbolLine[0 1000 1000 5000 800] + SymbolLine[1000 5000 2000 1000 800] +) +Symbol['W' 1200] +( + SymbolLine[0 1000 0 3000 800] + SymbolLine[0 3000 500 5000 800] + SymbolLine[500 5000 1500 3000 800] + SymbolLine[1500 3000 2500 5000 800] + SymbolLine[2500 5000 3000 3000 800] + SymbolLine[3000 3000 3000 1000 800] +) +Symbol['X' 1200] +( + SymbolLine[0 5000 2500 1000 800] + SymbolLine[0 1000 2500 5000 800] +) +Symbol['Y' 1200] +( + SymbolLine[0 1000 1000 3000 800] + SymbolLine[1000 3000 2000 1000 800] + SymbolLine[1000 3000 1000 5000 800] +) +Symbol['Z' 1200] +( + SymbolLine[0 1000 2500 1000 800] + SymbolLine[0 5000 2500 1000 800] + SymbolLine[0 5000 2500 5000 800] +) +Symbol['[' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['\' 1200] +( + SymbolLine[0 1500 3000 4500 800] +) +Symbol[']' 1200] +( + SymbolLine[0 1000 500 1000 800] + SymbolLine[500 1000 500 5000 800] + SymbolLine[0 5000 500 5000 800] +) +Symbol['^' 1200] +( + SymbolLine[0 1500 500 1000 800] + SymbolLine[500 1000 1000 1500 800] +) +Symbol['_' 1200] +( + SymbolLine[0 5000 2000 5000 800] +) +Symbol['a' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 4500 800] + SymbolLine[2000 4500 2500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['b' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] +) +Symbol['c' 1200] +( + SymbolLine[500 3000 2000 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 2000 5000 800] +) +Symbol['d' 1200] +( + SymbolLine[2000 1000 2000 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] +) +Symbol['e' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[0 4000 2000 4000 800] + SymbolLine[2000 4000 2000 3500 800] +) +Symbol['f' 1000] +( + SymbolLine[500 1500 500 5000 800] + SymbolLine[500 1500 1000 1000 800] + SymbolLine[1000 1000 1500 1000 800] + SymbolLine[0 3000 1000 3000 800] +) +Symbol['g' 1200] +( + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[2000 3000 2000 6000 800] +) +Symbol['h' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] +) +Symbol['i' 1000] +( + SymbolLine[0 2000 0 2100 1000] + SymbolLine[0 3500 0 5000 800] +) +Symbol['j' 1000] +( + SymbolLine[500 2000 500 2100 1000] + SymbolLine[500 3500 500 6000 800] + SymbolLine[0 6500 500 6000 800] +) +Symbol['k' 1200] +( + SymbolLine[0 1000 0 5000 800] + SymbolLine[0 3500 1500 5000 800] + SymbolLine[0 3500 1000 2500 800] +) +Symbol['l' 1000] +( + SymbolLine[0 1000 0 4500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['m' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[2000 3500 2500 3000 800] + SymbolLine[2500 3000 3000 3000 800] + SymbolLine[3000 3000 3500 3500 800] + SymbolLine[3500 3500 3500 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['n' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 5000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['o' 1200] +( + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[2000 3500 2000 4500 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['p' 1200] +( + SymbolLine[500 3500 500 6500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[2500 3500 2500 4500 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[1000 5000 2000 5000 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['q' 1200] +( + SymbolLine[2000 3500 2000 6500 800] + SymbolLine[1500 3000 2000 3500 800] + SymbolLine[500 3000 1500 3000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[0 3500 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['r' 1200] +( + SymbolLine[500 3500 500 5000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[1000 3000 2000 3000 800] + SymbolLine[0 3000 500 3500 800] +) +Symbol['s' 1200] +( + SymbolLine[500 5000 2000 5000 800] + SymbolLine[2000 5000 2500 4500 800] + SymbolLine[2000 4000 2500 4500 800] + SymbolLine[500 4000 2000 4000 800] + SymbolLine[0 3500 500 4000 800] + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 2000 3000 800] + SymbolLine[2000 3000 2500 3500 800] + SymbolLine[0 4500 500 5000 800] +) +Symbol['t' 1000] +( + SymbolLine[500 1000 500 4500 800] + SymbolLine[500 4500 1000 5000 800] + SymbolLine[0 2500 1000 2500 800] +) +Symbol['u' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] + SymbolLine[2000 3000 2000 4500 800] +) +Symbol['v' 1200] +( + SymbolLine[0 3000 1000 5000 800] + SymbolLine[2000 3000 1000 5000 800] +) +Symbol['w' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[500 5000 1000 5000 800] + SymbolLine[1000 5000 1500 4500 800] + SymbolLine[1500 3000 1500 4500 800] + SymbolLine[1500 4500 2000 5000 800] + SymbolLine[2000 5000 2500 5000 800] + SymbolLine[2500 5000 3000 4500 800] + SymbolLine[3000 3000 3000 4500 800] +) +Symbol['x' 1200] +( + SymbolLine[0 3000 2000 5000 800] + SymbolLine[0 5000 2000 3000 800] +) +Symbol['y' 1200] +( + SymbolLine[0 3000 0 4500 800] + SymbolLine[0 4500 500 5000 800] + SymbolLine[2000 3000 2000 6000 800] + SymbolLine[1500 6500 2000 6000 800] + SymbolLine[500 6500 1500 6500 800] + SymbolLine[0 6000 500 6500 800] + SymbolLine[500 5000 1500 5000 800] + SymbolLine[1500 5000 2000 4500 800] +) +Symbol['z' 1200] +( + SymbolLine[0 3000 2000 3000 800] + SymbolLine[0 5000 2000 3000 800] + SymbolLine[0 5000 2000 5000 800] +) +Symbol['{' 1200] +( + SymbolLine[500 1500 1000 1000 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[0 3000 500 2500 800] + SymbolLine[0 3000 500 3500 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[500 4500 1000 5000 800] +) +Symbol['|' 1200] +( + SymbolLine[0 1000 0 5000 800] +) +Symbol['}' 1200] +( + SymbolLine[0 1000 500 1500 800] + SymbolLine[500 1500 500 2500 800] + SymbolLine[500 2500 1000 3000 800] + SymbolLine[500 3500 1000 3000 800] + SymbolLine[500 3500 500 4500 800] + SymbolLine[0 5000 500 4500 800] +) +Symbol['~' 1200] +( + SymbolLine[0 3500 500 3000 800] + SymbolLine[500 3000 1000 3000 800] + SymbolLine[1000 3000 1500 3500 800] + SymbolLine[1500 3500 2000 3500 800] + SymbolLine[2000 3500 2500 3000 800] +) +Attribute("PCB::grid::unit" "mil") + +Element["" "Dual in-line package, medium wide (400 mil)" "" "DIP14M" 62500 22500 22000 5000 3 100 ""] +( + Pin[0 0 6000 3000 6600 2800 "1" "1" "square"] + Pin[0 10000 6000 3000 6600 2800 "2" "2" ""] + Pin[0 20000 6000 3000 6600 2800 "3" "3" "thermal(1S)"] + Pin[0 30000 6000 3000 6600 2800 "4" "4" "square,shape(3)"] + Pin[0 40000 6000 3000 6600 2800 "5" "5" "square,shape(2)"] + Pin[0 50000 6000 3000 6600 2800 "6" "6" "square,shape(4)"] + Pin[0 60000 6000 3000 6600 2800 "7" "7" "square,shape(8)"] + Pin[40000 60000 6000 3000 6600 2800 "8" "8" "square,shape(8)"] + Pin[40000 50000 6000 3000 6600 2800 "9" "9" "square,shape(4)"] + Pin[40000 40000 6000 3000 6600 2800 "10" "10" "square,shape(2)"] + Pin[40000 30000 6000 3000 6600 2800 "11" "11" "square,shape(3)"] + Pin[40000 20000 6000 3000 6600 2800 "12" "12" ""] + Pin[40000 10000 6000 3000 6600 2800 "13" "13" ""] + Pin[40000 0 6000 3000 6600 2800 "14" "14" "square,shape(1)"] + ElementLine [-5000 -5000 -5000 65000 1000] + ElementLine [-5000 65000 45000 65000 1000] + ElementLine [45000 65000 45000 -5000 1000] + ElementLine [-5000 -5000 15000 -5000 1000] + ElementLine [25000 -5000 45000 -5000 1000] + ElementArc [20000 -5000 5000 5000 0 180 1000] + + ) +Layer(1 "component") +( +) +Layer(2 "solder") +( + Line[10000 17500 67500 17500 1500 5000 "clearline"] + Line[67500 17500 77500 27500 1500 5000 "clearline"] + Line[77500 27500 85000 27500 1500 5000 "clearline"] + Line[62500 22500 37500 22500 1500 5000 "clearline"] + Line[10000 27500 67500 27500 1500 5000 "clearline"] + Line[67500 27500 77500 37500 1500 5000 "clearline"] + Line[77500 37500 85000 37500 1500 5000 "clearline"] + Line[62500 32500 45000 32500 1500 5000 "clearline"] + Line[10000 37500 67500 37500 1500 5000 "clearline"] + Line[67500 37500 77500 47500 1500 5000 "clearline"] + Line[77500 47500 85000 47500 1500 5000 "clearline"] + Line[62500 42500 27500 42500 1500 5000 ""] + Line[10000 47500 67500 47500 1500 5000 "clearline"] + Line[67500 47500 77500 57500 1500 5000 "clearline"] + Line[77500 57500 85000 57500 1500 5000 "clearline"] + Line[62500 52500 37500 52500 1500 5000 "clearline"] + Line[37500 57500 67500 57500 1500 5000 "clearline"] + Line[67500 57500 77500 67500 1500 5000 "clearline"] + Line[77500 67500 85000 67500 1500 5000 "clearline"] + Line[62500 62500 37500 62500 1500 5000 "clearline"] + Line[37500 67500 67500 67500 1500 5000 "clearline"] + Line[67500 67500 77500 77500 1500 5000 "clearline"] + Line[77500 77500 85000 77500 1500 5000 "clearline"] + Line[62500 72500 37500 72500 1500 5000 "clearline"] + Line[37500 77500 67500 77500 1500 5000 "clearline"] + Line[67500 77500 77500 87500 1500 5000 "clearline"] + Line[77500 87500 85000 87500 1500 5000 "clearline"] + Line[62500 82500 37500 82500 1500 5000 "clearline"] + Line[65000 32500 60000 32500 6000 5000 "clearline"] + Line[105000 32500 100000 32500 6000 5000 "clearline"] + Line[102500 32500 125000 32500 1500 5000 "clearline"] + Line[102500 52500 125000 52500 1500 5000 "clearline"] + Line[102500 62500 125000 62500 1500 5000 "clearline"] + Line[102500 72500 125000 72500 1500 5000 "clearline"] + Line[102500 82500 125000 82500 1500 5000 "clearline"] + Line[102500 22500 125000 22500 1500 5000 "clearline"] + Polygon("clearpoly") + ( + [55000 37500] [70000 37500] [70000 47500] [55000 47500] + ) + Polygon("clearpoly") + ( + [85000 7500] [117500 7500] [117500 92500] [85000 92500] + ) +) +Layer(3 "GND") +( +) +Layer(4 "power") +( +) +Layer(5 "signal1") +( +) +Layer(6 "signal2") +( +) +Layer(7 "signal3") +( +) +Layer(8 "signal4") +( +) +Layer(9 "silk") +( +) +Layer(10 "silk") +( + Text[10000 17500 0 130 "square" "clearline"] + Text[10000 27500 0 130 "fat trace" "clearline"] + Text[10000 37500 0 130 "poly" "clearline"] + Text[25000 95000 1 130 "with [square]" "clearline"] + Text[15000 92500 1 130 "shaped pins" "clearline"] +) Index: tags/1.0.5/doc-rnd/square.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/1.0.5/doc-rnd/square.png =================================================================== --- tags/1.0.5/doc-rnd/square.png (nonexistent) +++ tags/1.0.5/doc-rnd/square.png (revision 953) Property changes on: tags/1.0.5/doc-rnd/square.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/1.0.5/doc-rnd/tostyle.html =================================================================== --- tags/1.0.5/doc-rnd/tostyle.html (nonexistent) +++ tags/1.0.5/doc-rnd/tostyle.html (revision 953) @@ -0,0 +1,50 @@ + + +

pcb-rnd - the [tostyle] patch

+ +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. +

+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. +

+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 number but +to the current routing style. The [tostyle] patch does exactly this. +It implements the following new features: +

    +
  • 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 +
  • size change actions normally take a value and a unit; if the value is not a number but text style, the value is copied from the currently active routing style +
  • 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 +
  • 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 +
+

+The new route style set works on: +

    +
  • lines and arcs: sets their line width and clearance +
  • vias and individual pins: sets their ring dia, drill dia and clearance +
  • individual pads: sets their clearance +
  • elements: set all their pins and pads +
+ +

Example

+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. +

+CLI: select objects, execute action ChangeSizes(selected, style) +

+CLI: to adjust drill sizes only: select objects, execute action ChangeDrillSize(selected, style) + + +

save/load and compatibility

+Not affected, since the patch introduces actions and UI changes, no change +related to the data model. + +

plans

+No plans, the feature is complete. + + + Index: tags/1.0.5/globalconst.h =================================================================== --- tags/1.0.5/globalconst.h (nonexistent) +++ tags/1.0.5/globalconst.h (revision 953) @@ -0,0 +1,138 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996 Thomas Nau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + * RCS: $Id$ + */ + +/* global constants + * most of these values are also required by files outside the source tree + * (manuals...) + */ + +#ifndef __GLOBALCONST_INCLUDED__ +#define __GLOBALCONST_INCLUDED__ + +#include "config.h" + +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +/* --------------------------------------------------------------------------- + * some file-, directory- and environment names + */ +#define EMERGENCY_NAME "PCB.%.8i.save" /* %i --> pid */ +#define BACKUP_NAME "PCB.%.8i.backup" /* %i --> pid */ + +/* --------------------------------------------------------------------------- + * some default values + */ +#define DEFAULT_SIZE "7000x5000" /* default layout size */ +#define DEFAULT_MEDIASIZE "a4" /* default output media */ +#define DEFAULT_CELLSIZE 50 /* default cell size for symbols */ +#define CLICK_TIME 200 /* default time for click expiration */ +#define SCROLL_TIME 25 /* time between scrolls when drawing beyond border */ +#define COLUMNS 8 /* number of columns for found pin report */ + +/* --------------------------------------------------------------------------- + * frame between the groundplane and the copper + */ +#define GROUNDPLANEFRAME MIL_TO_COORD(15) +#define MASKFRAME 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 DEF_LAYER 8 /* default number of layers for new boards */ +#define NUM_STYLES 4 +#define MIN_LINESIZE MIL_TO_COORD(0.01) /* thickness of lines */ +#define MAX_LINESIZE LARGE_VALUE +#define MIN_TEXTSCALE 10 /* scaling of text objects in percent */ +#define MAX_TEXTSCALE 10000 +#define MIN_PINORVIASIZE MIL_TO_COORD(20) /* size of a pin or via */ +#define MIN_PINORVIAHOLE MIL_TO_COORD(4) /* size of a pins or vias drilling hole */ +#define MAX_PINORVIASIZE LARGE_VALUE +#define MIN_PINORVIACOPPER MIL_TO_COORD(4) /* min difference outer-inner diameter */ +#define MIN_PADSIZE MIL_TO_COORD(1) /* min size of a pad */ +#define MAX_PADSIZE LARGE_VALUE /* max size of a pad */ +#define MIN_DRC_VALUE MIL_TO_COORD(0.1) +#define MAX_DRC_VALUE MIL_TO_COORD(500) +#define MIN_DRC_SILK MIL_TO_COORD(1) +#define MAX_DRC_SILK MIL_TO_COORD(30) +#define MIN_DRC_DRILL MIL_TO_COORD(1) +#define MAX_DRC_DRILL MIL_TO_COORD(50) +#define MIN_DRC_RING 0 +#define MAX_DRC_RING MIL_TO_COORD(100) +#define MIN_GRID 1 +#define MAX_GRID MIL_TO_COORD(1000) +#define MAX_FONTPOSITION 255 /* upper limit of characters in my font */ + +#define MAX_COORD LARGE_VALUE /* coordinate limits */ +#define MIN_SIZE 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 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 +#else +#define MAX_SIZE MAX_PINORVIASIZE +#endif + +#ifndef MAXPATHLEN /* maximum path length */ +#ifdef PATH_MAX +#define MAXPATHLEN PATH_MAX +#else +#define MAXPATHLEN 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_LIBRARY_LINE_LENGTH 255 /* maximum line length in the */ + /* library-description file */ +#define MAX_NETLIST_LINE_LENGTH 255 /* maximum line length for netlist files */ +#define MAX_MODESTACK_DEPTH 16 /* maximum depth of mode stack */ +#define MAX_CROSSHAIRSTACK_DEPTH 16 /* maximum depth of state stack */ +#define MIN_GRID_DISTANCE 4 /* minimum distance between point */ + /* to enable grid drawing */ + /* size of diamond element mark */ +#define EMARK_SIZE MIL_TO_COORD (10) + +/* (Approximate) capheight size of the default PCB font */ +#define FONT_CAPHEIGHT MIL_TO_COORD (45) +#endif Property changes on: tags/1.0.5/globalconst.h ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/gts/Makefile.dep =================================================================== --- tags/1.0.5/gts/Makefile.dep (nonexistent) +++ tags/1.0.5/gts/Makefile.dep (revision 953) @@ -0,0 +1,38 @@ +### Generated file, do not edit, run make dep ### + +object.o: object.c gts.h gts-private.h +point.o: point.c gts.h gts-private.h predicates.h +vertex.o: vertex.c gts.h +segment.o: segment.c gts.h +edge.o: edge.c gts.h +triangle.o: triangle.c gts.h +face.o: face.c gts.h +kdtree.o: kdtree.c gts.h +bbtree.o: bbtree.c gts.h +misc.o: misc.c gts.h gts-private.h ../config.h ../config.manual.h \ + ../config.auto.h +predicates.o: predicates.c predicates.h rounding.h ../config.h \ + ../config.manual.h ../config.auto.h +heap.o: heap.c gts.h +eheap.o: eheap.c gts.h +fifo.o: fifo.c gts.h +matrix.o: matrix.c gts.h +surface.o: surface.c gts.h gts-private.h +stripe.o: stripe.c gts.h +vopt.o: vopt.c gts.h +refine.o: refine.c gts.h +iso.o: iso.c gts.h +isotetra.o: isotetra.c +split.o: split.c gts.h +psurface.o: psurface.c gts.h +hsurface.o: hsurface.c gts.h +cdt.o: cdt.c gts.h +boolean.o: boolean.c gts.h +named.o: named.c gts.h +oocs.o: oocs.c gts.h +container.o: container.c gts.h +graph.o: graph.c gts.h +pgraph.o: pgraph.c gts.h +partition.o: partition.c gts.h +curvature.o: curvature.c gts.h +tribox3.o: tribox3.c Index: tags/1.0.5/gts/Makefile.in =================================================================== --- tags/1.0.5/gts/Makefile.in (nonexistent) +++ tags/1.0.5/gts/Makefile.in (revision 953) @@ -0,0 +1,62 @@ +put /local/gts/CFLAGS [@-I. -I.. -DG_LOG_DOMAIN=\"Gts\" @libs/sul/glib/cflags@@] +put /local/gts/OBJS [@ + object.o + point.o + vertex.o + segment.o + edge.o + triangle.o + face.o + kdtree.o + bbtree.o + misc.o + predicates.o + heap.o + eheap.o + fifo.o + matrix.o + surface.o + stripe.o + vopt.o + refine.o + iso.o + isotetra.o + split.o + psurface.o + hsurface.o + cdt.o + boolean.o + named.o + oocs.o + container.o + graph.o + pgraph.o + partition.o + curvature.o + tribox3.o +@] + +put /tmpasm/OFS { } +uniq /local/gts/OBJS +put /local/gts/SRCS /local/gts/OBJS +gsub /local/gts/SRCS {.o } {.c } + +print [@ +CFLAGS = @/local/gts/CFLAGS@ +OBJS = @/local/gts/OBJS@ + +libgts.a: $(OBJS) + @fstools/ar@ rvu libgts.a $(OBJS) + +clean: + -@fstools/rm@ $(OBJS) libgts.a +@] + +# generate explicit rules for .c -> .o +put /local/comp/OBJS /local/gts/OBJS +include {../scconfig/Makefile.comp.inc} + +# generate deps +put /local/dep/CFLAGS /local/gts/CFLAGS +put /local/dep/SRCS /local/gts/SRCS +include {../scconfig/Makefile.dep.inc} Index: tags/1.0.5/gts/bbtree.c =================================================================== --- tags/1.0.5/gts/bbtree.c (nonexistent) +++ tags/1.0.5/gts/bbtree.c (revision 953) @@ -0,0 +1,1289 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +static void bbox_init (GtsBBox * bbox) +{ + bbox->bounded = NULL; +} + +/** + * gts_bbox_class: + * + * Returns: the #GtsBBoxClass. + */ +GtsBBoxClass * gts_bbox_class (void) +{ + static GtsBBoxClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo bbox_info = { + "GtsBBox", + sizeof (GtsBBox), + sizeof (GtsBBoxClass), + (GtsObjectClassInitFunc) NULL, + (GtsObjectInitFunc) bbox_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &bbox_info); + } + + return klass; +} + +/** + * gts_bbox_set: + * @bbox: a #GtsBBox. + * @bounded: the object to be bounded. + * @x1: x-coordinate of the lower left corner. + * @y1: y-coordinate of the lower left corner. + * @z1: z-coordinate of the lower left corner. + * @x2: x-coordinate of the upper right corner. + * @y2: y-coordinate of the upper right corner. + * @z2: z-coordinate of the upper right corner. + * + * Sets fields of @bbox. + */ +void gts_bbox_set (GtsBBox * bbox, + gpointer bounded, + gdouble x1, gdouble y1, gdouble z1, + gdouble x2, gdouble y2, gdouble z2) +{ + g_return_if_fail (bbox != NULL); + g_return_if_fail (x2 >= x1 && y2 >= y1 && z2 >= z1); + + bbox->x1 = x1; bbox->y1 = y1; bbox->z1 = z1; + bbox->x2 = x2; bbox->y2 = y2; bbox->z2 = z2; + bbox->bounded = bounded; +} + +/** + * gts_bbox_new: + * @klass: a #GtsBBoxClass. + * @bounded: the object to be bounded. + * @x1: x-coordinate of the lower left corner. + * @y1: y-coordinate of the lower left corner. + * @z1: z-coordinate of the lower left corner. + * @x2: x-coordinate of the upper right corner. + * @y2: y-coordinate of the upper right corner. + * @z2: z-coordinate of the upper right corner. + * + * Returns: a new #GtsBBox. + */ +GtsBBox * gts_bbox_new (GtsBBoxClass * klass, + gpointer bounded, + gdouble x1, gdouble y1, gdouble z1, + gdouble x2, gdouble y2, gdouble z2) +{ + GtsBBox * bbox; + + g_return_val_if_fail (klass != NULL, NULL); + + bbox = GTS_BBOX (gts_object_new (GTS_OBJECT_CLASS (klass))); + gts_bbox_set (bbox, bounded, x1, y1, z1, x2, y2, z2); + return bbox; +} + +/** + * gts_bbox_triangle: + * @klass: a #GtsBBoxClass. + * @t: a #GtsTriangle. + * + * Returns: a new #GtsBBox bounding box of @t. + */ +GtsBBox * gts_bbox_triangle (GtsBBoxClass * klass, + GtsTriangle * t) +{ + GtsBBox * bbox; + GtsPoint * p; + + g_return_val_if_fail (t != NULL, NULL); + g_return_val_if_fail (klass != NULL, NULL); + + p = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + bbox = gts_bbox_new (klass, t, p->x, p->y, p->z, p->x, p->y, p->z); + + p = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + if (p->x > bbox->x2) bbox->x2 = p->x; + if (p->x < bbox->x1) bbox->x1 = p->x; + if (p->y > bbox->y2) bbox->y2 = p->y; + if (p->y < bbox->y1) bbox->y1 = p->y; + if (p->z > bbox->z2) bbox->z2 = p->z; + if (p->z < bbox->z1) bbox->z1 = p->z; + p = GTS_POINT (gts_triangle_vertex (t)); + if (p->x > bbox->x2) bbox->x2 = p->x; + if (p->x < bbox->x1) bbox->x1 = p->x; + if (p->y > bbox->y2) bbox->y2 = p->y; + if (p->y < bbox->y1) bbox->y1 = p->y; + if (p->z > bbox->z2) bbox->z2 = p->z; + if (p->z < bbox->z1) bbox->z1 = p->z; + + return bbox; +} + +/** + * gts_bbox_segment: + * @klass: a #GtsBBoxClass. + * @s: a #GtsSegment. + * + * Returns: a new #GtsBBox bounding box of @s. + */ +GtsBBox * gts_bbox_segment (GtsBBoxClass * klass, GtsSegment * s) +{ + GtsBBox * bbox; + GtsPoint * p1, * p2; + + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (klass != NULL, NULL); + + bbox = gts_bbox_new (klass, s, 0., 0., 0., 0., 0., 0.); + + p1 = GTS_POINT (s->v1); + p2 = GTS_POINT (s->v2); + if (p1->x > p2->x) { + bbox->x2 = p1->x; bbox->x1 = p2->x; + } + else { + bbox->x1 = p1->x; bbox->x2 = p2->x; + } + if (p1->y > p2->y) { + bbox->y2 = p1->y; bbox->y1 = p2->y; + } + else { + bbox->y1 = p1->y; bbox->y2 = p2->y; + } + if (p1->z > p2->z) { + bbox->z2 = p1->z; bbox->z1 = p2->z; + } + else { + bbox->z1 = p1->z; bbox->z2 = p2->z; + } + + return bbox; +} + +static void bbox_foreach_vertex (GtsPoint * p, GtsBBox * bb) +{ + if (p->x < bb->x1) bb->x1 = p->x; + if (p->y < bb->y1) bb->y1 = p->y; + if (p->z < bb->z1) bb->z1 = p->z; + if (p->x > bb->x2) bb->x2 = p->x; + if (p->y > bb->y2) bb->y2 = p->y; + if (p->z > bb->z2) bb->z2 = p->z; +} + +/** + * gts_bbox_surface: + * @klass: a #GtsBBoxClass. + * @surface: a #GtsSurface. + * + * Returns: a new #GtsBBox bounding box of @surface. + */ +GtsBBox * gts_bbox_surface (GtsBBoxClass * klass, GtsSurface * surface) +{ + GtsBBox * bbox; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (surface != NULL, NULL); + + bbox = gts_bbox_new (klass, surface, 0., 0., 0., 0., 0., 0.); + bbox->x1 = bbox->y1 = bbox->z1 = G_MAXDOUBLE; + bbox->x2 = bbox->y2 = bbox->z2 = -G_MAXDOUBLE; + + gts_surface_foreach_vertex (surface, (GtsFunc) bbox_foreach_vertex, bbox); + + return bbox; +} + +/** + * gts_bbox_bboxes: + * @klass: a #GtsBBoxClass. + * @bboxes: a list of #GtsBBox. + * + * Returns: a new #GtsBBox bounding box of all the bounding boxes in + * @bboxes. + */ +GtsBBox * gts_bbox_bboxes (GtsBBoxClass * klass, GSList * bboxes) +{ + GtsBBox * bbox; + GtsBBox * bb; + + g_return_val_if_fail (bboxes != NULL, NULL); + g_return_val_if_fail (klass != NULL, NULL); + + bb = bboxes->data; + bbox = gts_bbox_new (klass, bboxes, + bb->x1, bb->y1, bb->z1, bb->x2, bb->y2, bb->z2); + bboxes = bboxes->next; + while (bboxes) { + bb = bboxes->data; + if (bb->x1 < bbox->x1) bbox->x1 = bb->x1; + if (bb->y1 < bbox->y1) bbox->y1 = bb->y1; + if (bb->z1 < bbox->z1) bbox->z1 = bb->z1; + if (bb->x2 > bbox->x2) bbox->x2 = bb->x2; + if (bb->y2 > bbox->y2) bbox->y2 = bb->y2; + if (bb->z2 > bbox->z2) bbox->z2 = bb->z2; + bboxes = bboxes->next; + } + + return bbox; +} + +/** + * gts_bbox_points: + * @klass: a #GtsBBoxClass. + * @points: a list of #GtsPoint. + * + * Returns: a new #GtsBBox bounding box of @points. + */ +GtsBBox * gts_bbox_points (GtsBBoxClass * klass, GSList * points) +{ + GtsPoint * p; + GtsBBox * bbox; + GSList * i; + + if (points == NULL) + return NULL; + + p = points->data; + bbox = gts_bbox_new (klass, points, p->x, p->y, p->z, p->x, p->y, p->z); + + i = points->next; + while (i) { + p = i->data; + if (p->x > bbox->x2) + bbox->x2 = p->x; + else if (p->x < bbox->x1) + bbox->x1 = p->x; + if (p->y > bbox->y2) + bbox->y2 = p->y; + else if (p->y < bbox->y1) + bbox->y1 = p->y; + if (p->z > bbox->z2) + bbox->z2 = p->z; + else if (p->z < bbox->z1) + bbox->z1 = p->z; + i = i->next; + } + + return bbox; +} + +/** + * gts_bboxes_are_overlapping: + * @bb1: a #GtsBBox. + * @bb2: a #GtsBBox. + * + * Returns: %TRUE if the bounding boxes @bb1 and @bb2 are overlapping + * (including just touching), %FALSE otherwise. + */ +gboolean gts_bboxes_are_overlapping (GtsBBox * bb1, GtsBBox * bb2) +{ + if (bb1 == bb2) + return TRUE; + if (bb1->x1 > bb2->x2) + return FALSE; + if (bb2->x1 > bb1->x2) + return FALSE; + if (bb1->y1 > bb2->y2) + return FALSE; + if (bb2->y1 > bb1->y2) + return FALSE; + if (bb1->z1 > bb2->z2) + return FALSE; + if (bb2->z1 > bb1->z2) + return FALSE; + return TRUE; +} + +#define bbox_volume(bb) (((bb)->x2 -\ + (bb)->x1)*\ + ((bb)->y2 -\ + (bb)->y1)*\ + ((bb)->z2 -\ + (bb)->z1)) + +/** + * gts_bbox_diagonal2: + * @bb: a #GtsBBox. + * + * Returns: the squared length of the diagonal of @bb. + */ +gdouble gts_bbox_diagonal2 (GtsBBox * bb) +{ + gdouble x, y, z; + + g_return_val_if_fail (bb != NULL, 0.); + + x = bb->x2 - bb->x1; + y = bb->y2 - bb->y1; + z = bb->z2 - bb->z1; + + return x*x + y*y + z*z; +} + +/** + * gts_bbox_draw: + * @bb: a #GtsBBox. + * @fptr: a file pointer. + * + * Writes in file @fptr an OOGL (Geomview) description of @bb. + */ +void gts_bbox_draw (GtsBBox * bb, FILE * fptr) +{ + g_return_if_fail (bb != NULL); + + fprintf (fptr, "OFF 8 6 12\n"); + fprintf (fptr, "%g %g %g\n", + bb->x1, bb->y1, bb->z1); + fprintf (fptr, "%g %g %g\n", + bb->x2, bb->y1, bb->z1); + fprintf (fptr, "%g %g %g\n", + bb->x2, bb->y2, bb->z1); + fprintf (fptr, "%g %g %g\n", + bb->x1, bb->y2, bb->z1); + fprintf (fptr, "%g %g %g\n", + bb->x1, bb->y1, bb->z2); + fprintf (fptr, "%g %g %g\n", + bb->x2, bb->y1, bb->z2); + fprintf (fptr, "%g %g %g\n", + bb->x2, bb->y2, bb->z2); + fprintf (fptr, "%g %g %g\n", + bb->x1, bb->y2, bb->z2); + fputs ("4 3 2 1 0\n" + "4 4 5 6 7\n" + "4 2 3 7 6\n" + "4 0 1 5 4\n" + "4 0 4 7 3\n" + "4 1 2 6 5\n", + fptr); +} + +#define MINMAX(x1, x2, xmin, xmax) { if (x1 < x2) { xmin = x1; xmax = x2; }\ + else { xmin = x2; xmax = x1; } } + +/** + * gts_bbox_point_distance2: + * @bb: a #GtsBBox. + * @p: a #GtsPoint. + * @min: a pointer on a gdouble. + * @max: a pointer on a gdouble. + * + * Sets @min and @max to lower and upper bounds for the square of the + * Euclidean distance between the object contained in @bb and @p. For these + * bounds to make any sense the bounding box must be "tight" i.e. each of the + * 6 faces of the box must at least be touched by one point of the bounded + * object. + */ +void gts_bbox_point_distance2 (GtsBBox * bb, GtsPoint * p, + gdouble * min, gdouble * max) +{ + gdouble x1, y1, z1, x2, y2, z2, x, y, z; + gdouble dmin, dmax, xd1, xd2, yd1, yd2, zd1, zd2; + gdouble mx, Mx, my, My, mz, Mz; + + g_return_if_fail (bb != NULL); + g_return_if_fail (p != NULL); + g_return_if_fail (min != NULL); + g_return_if_fail (max != NULL); + + x1 = bb->x1; y1 = bb->y1; z1 = bb->z1; + x2 = bb->x2; y2 = bb->y2; z2 = bb->z2; + x = p->x; y = p->y; z = p->z; + + xd1 = (x1 - x)*(x1 - x); + xd2 = (x - x2)*(x - x2); + yd1 = (y1 - y)*(y1 - y); + yd2 = (y - y2)*(y - y2); + zd1 = (z1 - z)*(z1 - z); + zd2 = (z - z2)*(z - z2); + + dmin = x < x1 ? xd1 : x > x2 ? xd2 : 0.0; + dmin += y < y1 ? yd1 : y > y2 ? yd2 : 0.0; + dmin += z < z1 ? zd1 : z > z2 ? zd2 : 0.0; + + MINMAX (xd1, xd2, mx, Mx); + MINMAX (yd1, yd2, my, My); + MINMAX (zd1, zd2, mz, Mz); + + dmax = mx + My + Mz; + dmax = MIN (dmax, Mx + my + Mz); + dmax = MIN (dmax, Mx + My + mz); + + *min = dmin; + *max = dmax; +} + +/** + * gts_bbox_is_stabbed: + * @bb: a #GtsBBox. + * @p: a #GtsPoint. + * + * Returns: %TRUE if the ray starting at @p and ending at (+infty, + * @p->y, @p->z) intersects with @bb, %FALSE otherwise. + */ +gboolean gts_bbox_is_stabbed (GtsBBox * bb, GtsPoint * p) +{ + g_return_val_if_fail (bb != NULL, FALSE); + g_return_val_if_fail (p != NULL, FALSE); + + if (p->x > bb->x2 || + p->y < bb->y1 || p->y > bb->y2 || + p->z < bb->z1 || p->z > bb->z2) + return FALSE; + return TRUE; +} + +extern int triBoxOverlap (double boxcenter[3], + double boxhalfsize[3], + double triverts[3][3]); + +/** + * gts_bbox_overlaps_triangle: + * @bb: a #GtsBBox. + * @t: a #GtsTriangle. + * + * This is a wrapper around the fast overlap test of Tomas + * Akenine-Moller (http://www.cs.lth.se/home/Tomas_Akenine_Moller/). + * + * Returns: %TRUE if @bb overlaps with @t, %FALSE otherwise. + */ +gboolean gts_bbox_overlaps_triangle (GtsBBox * bb, GtsTriangle * t) +{ + double bc[3], bh[3], tv[3][3]; + GtsPoint * p1, * p2, * p3; + + g_return_val_if_fail (bb != NULL, FALSE); + g_return_val_if_fail (t != NULL, FALSE); + + bc[0] = (bb->x2 + bb->x1)/2.; + bh[0] = (bb->x2 - bb->x1)/2.; + bc[1] = (bb->y2 + bb->y1)/2.; + bh[1] = (bb->y2 - bb->y1)/2.; + bc[2] = (bb->z2 + bb->z1)/2.; + bh[2] = (bb->z2 - bb->z1)/2.; + p1 = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + p2 = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + p3 = GTS_POINT (gts_triangle_vertex (t)); + tv[0][0] = p1->x; tv[0][1] = p1->y; tv[0][2] = p1->z; + tv[1][0] = p2->x; tv[1][1] = p2->y; tv[1][2] = p2->z; + tv[2][0] = p3->x; tv[2][1] = p3->y; tv[2][2] = p3->z; + + return triBoxOverlap (bc, bh, tv); +} + +/** + * gts_bbox_overlaps_segment: + * @bb: a #GtsBBox. + * @s: a #GtsSegment. + * + * This functions uses gts_bbox_overlaps_triangle() with a degenerate + * triangle. + * + * Returns: %TRUE if @bb overlaps with @s, %FALSE otherwise. + */ +gboolean gts_bbox_overlaps_segment (GtsBBox * bb, GtsSegment * s) +{ + double bc[3], bh[3], tv[3][3]; + GtsPoint * p1, * p2, * p3; + + g_return_val_if_fail (bb != NULL, FALSE); + g_return_val_if_fail (s != NULL, FALSE); + + bc[0] = (bb->x2 + bb->x1)/2.; + bh[0] = (bb->x2 - bb->x1)/2.; + bc[1] = (bb->y2 + bb->y1)/2.; + bh[1] = (bb->y2 - bb->y1)/2.; + bc[2] = (bb->z2 + bb->z1)/2.; + bh[2] = (bb->z2 - bb->z1)/2.; + p1 = GTS_POINT (s->v1); + p2 = GTS_POINT (s->v2); + p3 = p1; + tv[0][0] = p1->x; tv[0][1] = p1->y; tv[0][2] = p1->z; + tv[1][0] = p2->x; tv[1][1] = p2->y; tv[1][2] = p2->z; + tv[2][0] = p3->x; tv[2][1] = p3->y; tv[2][2] = p3->z; + + return triBoxOverlap (bc, bh, tv); +} + +/** + * gts_bb_tree_new: + * @bboxes: a list of #GtsBBox. + * + * Builds a new hierarchy of bounding boxes for @bboxes. At each + * level, the GNode->data field contains a #GtsBBox bounding box of + * all the children. The tree is binary and is built by repeatedly + * cutting in two approximately equal halves the bounding boxes at + * each level until a leaf node (i.e. a bounding box given in @bboxes) + * is reached. In order to minimize the depth of the tree, the cutting + * direction is always chosen as perpendicular to the longest + * dimension of the bounding box. + * + * Returns: a new hierarchy of bounding boxes. + */ +GNode * gts_bb_tree_new (GSList * bboxes) +{ + GSList * i, * positive = NULL, * negative = NULL; + GNode * node; + GtsBBox * bbox; + guint dir, np = 0, nn = 0; + gdouble * p1, * p2; + gdouble cut; + + g_return_val_if_fail (bboxes != NULL, NULL); + + if (bboxes->next == NULL) /* leaf node */ + return g_node_new (bboxes->data); + + bbox = gts_bbox_bboxes (gts_bbox_class (), bboxes); + node = g_node_new (bbox); + + if (bbox->x2 - bbox->x1 > bbox->y2 - bbox->y1) { + if (bbox->z2 - bbox->z1 > bbox->x2 - bbox->x1) + dir = 2; + else + dir = 0; + } + else if (bbox->z2 - bbox->z1 > bbox->y2 - bbox->y1) + dir = 2; + else + dir = 1; + + p1 = (gdouble *) &bbox->x1; + p2 = (gdouble *) &bbox->x2; + cut = (p1[dir] + p2[dir])/2.; + i = bboxes; + while (i) { + bbox = i->data; + p1 = (gdouble *) &bbox->x1; + p2 = (gdouble *) &bbox->x2; + if ((p1[dir] + p2[dir])/2. > cut) { + positive = g_slist_prepend (positive, bbox); + np++; + } + else { + negative = g_slist_prepend (negative, bbox); + nn++; + } + i = i->next; + } + if (!positive) { + GSList * last = g_slist_nth (negative, (nn - 1)/2); + positive = last->next; + last->next = NULL; + } + else if (!negative) { + GSList * last = g_slist_nth (positive, (np - 1)/2); + negative = last->next; + last->next = NULL; + } + g_node_prepend (node, gts_bb_tree_new (positive)); + g_slist_free (positive); + g_node_prepend (node, gts_bb_tree_new (negative)); + g_slist_free (negative); + + return node; +} + +static void prepend_triangle_bbox (GtsTriangle * t, GSList ** bboxes) +{ + *bboxes = g_slist_prepend (*bboxes, + gts_bbox_triangle (gts_bbox_class (), t)); +} + +/** + * gts_bb_tree_surface: + * @s: a #GtsSurface. + * + * Returns: a new hierarchy of bounding boxes bounding the faces of @s. + */ +GNode * gts_bb_tree_surface (GtsSurface * s) +{ + GSList * bboxes = NULL; + GNode * tree; + + g_return_val_if_fail (s != NULL, NULL); + + gts_surface_foreach_face (s, (GtsFunc) prepend_triangle_bbox, &bboxes); + tree = gts_bb_tree_new (bboxes); + g_slist_free (bboxes); + + return tree; +} + +/** + * gts_bb_tree_stabbed: + * @tree: a bounding box tree. + * @p: a #GtsPoint. + * + * Returns: a list of bounding boxes, leaves of @tree which are + * stabbed by the ray defined by @p (see gts_bbox_is_stabbed()). + */ +GSList * gts_bb_tree_stabbed (GNode * tree, GtsPoint * p) +{ + GSList * list = NULL; + GtsBBox * bb; + GNode * i; + + g_return_val_if_fail (tree != NULL, NULL); + g_return_val_if_fail (p != NULL, NULL); + + bb = tree->data; + if (!gts_bbox_is_stabbed (bb, p)) + return NULL; + if (tree->children == NULL) /* leaf node */ + return g_slist_prepend (NULL, bb); + i = tree->children; + while (i) { + list = g_slist_concat (list, gts_bb_tree_stabbed (i, p)); + i = i->next; + } + return list; +} + +/** + * gts_bb_tree_overlap: + * @tree: a bounding box tree. + * @bbox: a #GtsBBox. + * + * Returns: a list of bounding boxes, leaves of @tree which overlap @bbox. + */ +GSList * gts_bb_tree_overlap (GNode * tree, GtsBBox * bbox) +{ + GSList * list = NULL; + GtsBBox * bb; + GNode * i; + + g_return_val_if_fail (tree != NULL, NULL); + g_return_val_if_fail (bbox != NULL, NULL); + + bb = tree->data; + if (!gts_bboxes_are_overlapping (bbox, bb)) + return NULL; + if (tree->children == NULL) /* leaf node */ + return g_slist_prepend (NULL, bb); + i = tree->children; + while (i) { + list = g_slist_concat (list, gts_bb_tree_overlap (i, bbox)); + i = i->next; + } + return list; +} + +/** + * gts_bb_tree_is_overlapping: + * @tree: a bounding box tree. + * @bbox: a #GtsBBox. + * + * Returns: %TRUE if any leaf of @tree overlaps @bbox, %FALSE otherwise. + */ +gboolean gts_bb_tree_is_overlapping (GNode * tree, GtsBBox * bbox) +{ + GtsBBox * bb; + GNode * i; + + g_return_val_if_fail (tree != NULL, FALSE); + g_return_val_if_fail (bbox != NULL, FALSE); + + bb = tree->data; + if (!gts_bboxes_are_overlapping (bbox, bb)) + return FALSE; + if (tree->children == NULL) /* leaf node */ + return TRUE; + i = tree->children; + while (i) { + if (gts_bb_tree_is_overlapping (i, bbox)) + return TRUE; + i = i->next; + } + return FALSE; +} + +/** + * gts_bb_tree_traverse_overlapping: + * @tree1: a bounding box tree. + * @tree2: a bounding box tree. + * @func: a #GtsBBTreeTraverseFunc. + * @data: user data to be passed to @func. + * + * Calls @func for each overlapping pair of leaves of @tree1 and @tree2. + */ +void gts_bb_tree_traverse_overlapping (GNode * tree1, GNode * tree2, + GtsBBTreeTraverseFunc func, + gpointer data) +{ + GtsBBox * bb1, * bb2; + + g_return_if_fail (tree1 != NULL && tree2 != NULL); + + bb1 = tree1->data; bb2 = tree2->data; + if (!gts_bboxes_are_overlapping (bb1, bb2)) + return; + + if (tree1->children == NULL && tree2->children == NULL) + (*func) (tree1->data, tree2->data, data); + else if (tree2->children == NULL || + (tree1->children != NULL && + bbox_volume (bb1) > bbox_volume (bb2))) { + GNode * i = tree1->children; + while (i) { + gts_bb_tree_traverse_overlapping (i, tree2, func, data); + i = i->next; + } + } + else { + GNode * i = tree2->children; + while (i) { + gts_bb_tree_traverse_overlapping (tree1, i, func, data); + i = i->next; + } + } +} + +/** + * gts_bb_tree_draw: + * @tree: a bounding box tree. + * @depth: a specified depth. + * @fptr: a file pointer. + * + * Write in @fptr an OOGL (Geomview) description of @tree for the + * depth specified by @depth. + */ +void gts_bb_tree_draw (GNode * tree, guint depth, FILE * fptr) +{ + guint d; + + g_return_if_fail (tree != NULL); + g_return_if_fail (fptr != NULL); + + d = g_node_depth (tree); + + if (d == 1) + fprintf (fptr, "{ LIST"); + + if (d == depth) + gts_bbox_draw (tree->data, fptr); + else if (d < depth) { + GNode * i = tree->children; + while (i) { + gts_bb_tree_draw (i, depth, fptr); + i = i->next; + } + } + + if (d == 1) + fprintf (fptr, "}\n"); +} + +static void bb_tree_free (GNode * tree, gboolean free_leaves) +{ + GNode * i; + + g_return_if_fail (tree != NULL); + + if (!free_leaves && tree->children == NULL) /* leaf node */ + return; + + gts_object_destroy (tree->data); + + i = tree->children; + while (i) { + bb_tree_free (i, free_leaves); + i = i->next; + } +} + +/** + * gts_bb_tree_destroy: + * @tree: a bounding box tree. + * @free_leaves: if %TRUE the bounding boxes given by the user are freed. + * + * Destroys all the bounding boxes created by @tree and destroys the + * tree itself. If @free_leaves is set to %TRUE, destroys boxes given + * by the user when creating the tree (i.e. leaves of the tree). + */ +void gts_bb_tree_destroy (GNode * tree, gboolean free_leaves) +{ + g_return_if_fail (tree != NULL); + + bb_tree_free (tree, free_leaves); + g_node_destroy (tree); +} + +static gdouble bb_tree_min_max (GNode * tree, + GtsPoint * p, + gdouble min_max, + GSList ** list) +{ + GNode * tree1, * tree2; + gdouble min1, max1, min2, max2; + + if (tree->children == NULL) { + *list = g_slist_prepend (*list, tree->data); + return min_max; + } + tree1 = tree->children; + gts_bbox_point_distance2 (tree1->data, p, &min1, &max1); + if (max1 < min_max) + min_max = max1; + + tree2 = tree1->next; + gts_bbox_point_distance2 (tree2->data, p, &min2, &max2); + if (max2 < min_max) + min_max = max2; + + if (min1 < min2) { + if (min1 <= min_max) { + min_max = bb_tree_min_max (tree1, p, min_max, list); + if (min2 <= min_max) + min_max = bb_tree_min_max (tree2, p, min_max, list); + } + } + else { + if (min2 <= min_max) { + min_max = bb_tree_min_max (tree2, p, min_max, list); + if (min1 <= min_max) + min_max = bb_tree_min_max (tree1, p, min_max, list); + } + } + + return min_max; +} + +/** + * gts_bb_tree_point_closest_bboxes: + * @tree: a bounding box tree. + * @p: a #GtsPoint. + * + * Returns: a list of #GtsBBox. One of the bounding boxes is assured to contain + * the object of @tree closest to @p. + */ +GSList * gts_bb_tree_point_closest_bboxes (GNode * tree, + GtsPoint * p) +{ + gdouble min, min_max; + GSList * list = NULL, * i, * prev = NULL; + + g_return_val_if_fail (tree != NULL, NULL); + g_return_val_if_fail (p != NULL, NULL); + + gts_bbox_point_distance2 (tree->data, p, &min, &min_max); + min_max = bb_tree_min_max (tree, p, min_max, &list); + + i = list; + while (i) { + GSList * next = i->next; + gdouble min, max; + + gts_bbox_point_distance2 (i->data, p, &min, &max); + + if (min > min_max) { + if (prev == NULL) + list = next; + else + prev->next = next; + g_slist_free_1 (i); + } + else + prev = i; + i = next; + } + + return list; +} + +/** + * gts_bb_tree_point_distance: + * @tree: a bounding box tree. + * @p: a #GtsPoint. + * @distance: a #GtsBBoxDistFunc. + * @bbox: if not %NULL is set to the bounding box containing the closest + * object. + * + * Returns: the distance as evaluated by @distance between @p and the closest + * object in @tree. + */ +gdouble gts_bb_tree_point_distance (GNode * tree, + GtsPoint * p, + GtsBBoxDistFunc distance, + GtsBBox ** bbox) +{ + GSList * list, * i; + gdouble dmin = G_MAXDOUBLE; + + g_return_val_if_fail (tree != NULL, dmin); + g_return_val_if_fail (p != NULL, dmin); + g_return_val_if_fail (distance != NULL, dmin); + + i = list = gts_bb_tree_point_closest_bboxes (tree, p); + while (i) { + gdouble d = (*distance) (p, GTS_BBOX (i->data)->bounded); + + if (fabs (d) < fabs (dmin)) { + dmin = d; + if (bbox) + *bbox = i->data; + } + i = i->next; + } + g_slist_free (list); + + return dmin; +} + +/** + * gts_bb_tree_point_closest: + * @tree: a bounding box tree. + * @p: a #GtsPoint. + * @closest: a #GtsBBoxClosestFunc. + * @distance: if not %NULL is set to the distance between @p and the + * new #GtsPoint. + * + * Returns: a new #GtsPoint, closest point to @p and belonging to an object of + * @tree. + */ +GtsPoint * gts_bb_tree_point_closest (GNode * tree, + GtsPoint * p, + GtsBBoxClosestFunc closest, + gdouble * distance) +{ + GSList * list, * i; + gdouble dmin = G_MAXDOUBLE; + GtsPoint * np = NULL; + + g_return_val_if_fail (tree != NULL, NULL); + g_return_val_if_fail (p != NULL, NULL); + g_return_val_if_fail (closest != NULL, NULL); + + i = list = gts_bb_tree_point_closest_bboxes (tree, p); + while (i) { + GtsPoint * tp = (*closest) (p, GTS_BBOX (i->data)->bounded); + gdouble d = gts_point_distance2 (tp, p); + + if (d < dmin) { + if (np) + gts_object_destroy (GTS_OBJECT (np)); + np = tp; + dmin = d; + } + else + gts_object_destroy (GTS_OBJECT (tp)); + i = i->next; + } + g_slist_free (list); + + if (distance) + *distance = dmin; + + return np; +} + +/** + * gts_bb_tree_triangle_distance: + * @tree: a bounding box tree. + * @t: a #GtsTriangle. + * @distance: a #GtsBBoxDistFunc. + * @delta: spatial scale of the sampling to be used. + * @range: a #GtsRange to be filled with the results. + * + * Given a triangle @t, points are sampled regularly on its surface + * using @delta as increment. The distance from each of these points + * to the closest object of @tree is computed using @distance and the + * gts_bb_tree_point_distance() function. The fields of @range are + * filled with the number of points sampled, the minimum, average and + * maximum value and the standard deviation. + */ +void gts_bb_tree_triangle_distance (GNode * tree, + GtsTriangle * t, + GtsBBoxDistFunc distance, + gdouble delta, + GtsRange * range) +{ + GtsPoint * p1, * p2, * p3, * p; + GtsVector p1p2, p1p3; + gdouble l1, t1, dt1; + guint i, n1; + + g_return_if_fail (tree != NULL); + g_return_if_fail (t != NULL); + g_return_if_fail (distance != NULL); + g_return_if_fail (delta > 0.); + g_return_if_fail (range != NULL); + + gts_triangle_vertices (t, + (GtsVertex **) &p1, + (GtsVertex **) &p2, + (GtsVertex **) &p3); + + gts_vector_init (p1p2, p1, p2); + gts_vector_init (p1p3, p1, p3); + gts_range_init (range); + p = GTS_POINT (gts_object_new (GTS_OBJECT_CLASS (gts_point_class ()))); + + l1 = sqrt (gts_vector_scalar (p1p2, p1p2)); + n1 = l1/delta + 1; + dt1 = 1.0/(gdouble) n1; + t1 = 0.0; + for (i = 0; i <= n1; i++, t1 += dt1) { + gdouble t2 = 1. - t1; + gdouble x = t2*p1p3[0]; + gdouble y = t2*p1p3[1]; + gdouble z = t2*p1p3[2]; + gdouble l2 = sqrt (x*x + y*y + z*z); + guint j, n2 = (guint) (l2/delta + 1); + gdouble dt2 = t2/(gdouble) n2; + + x = t2*p1->x + t1*p2->x; + y = t2*p1->y + t1*p2->y; + z = t2*p1->z + t1*p2->z; + + t2 = 0.0; + for (j = 0; j <= n2; j++, t2 += dt2) { + p->x = x + t2*p1p3[0]; + p->y = y + t2*p1p3[1]; + p->z = z + t2*p1p3[2]; + + gts_range_add_value (range, + gts_bb_tree_point_distance (tree, p, distance, NULL)); + } + } + + gts_object_destroy (GTS_OBJECT (p)); + gts_range_update (range); +} + +/** + * gts_bb_tree_segment_distance: + * @tree: a bounding box tree. + * @s: a #GtsSegment. + * @distance: a #GtsBBoxDistFunc. + * @delta: spatial scale of the sampling to be used. + * @range: a #GtsRange to be filled with the results. + * + * Given a segment @s, points are sampled regularly on its length + * using @delta as increment. The distance from each of these points + * to the closest object of @tree is computed using @distance and the + * gts_bb_tree_point_distance() function. The fields of @range are + * filled with the number of points sampled, the minimum, average and + * maximum value and the standard deviation. + */ +void gts_bb_tree_segment_distance (GNode * tree, + GtsSegment * s, + gdouble (*distance) (GtsPoint *, + gpointer), + gdouble delta, + GtsRange * range) +{ + GtsPoint * p1, * p2, * p; + GtsVector p1p2; + gdouble l, t, dt; + guint i, n; + + g_return_if_fail (tree != NULL); + g_return_if_fail (s != NULL); + g_return_if_fail (distance != NULL); + g_return_if_fail (delta > 0.); + g_return_if_fail (range != NULL); + + p1 = GTS_POINT (s->v1); + p2 = GTS_POINT (s->v2); + + gts_vector_init (p1p2, p1, p2); + gts_range_init (range); + p = GTS_POINT (gts_object_new (GTS_OBJECT_CLASS (gts_point_class()))); + + l = sqrt (gts_vector_scalar (p1p2, p1p2)); + n = (guint) (l/delta + 1); + dt = 1.0/(gdouble) n; + t = 0.0; + for (i = 0; i <= n; i++, t += dt) { + p->x = p1->x + t*p1p2[0]; + p->y = p1->y + t*p1p2[1]; + p->z = p1->z + t*p1p2[2]; + + gts_range_add_value (range, + gts_bb_tree_point_distance (tree, p, distance, NULL)); + } + + gts_object_destroy (GTS_OBJECT (p)); + gts_range_update (range); +} + +static void surface_distance_foreach_triangle (GtsTriangle * t, + gpointer * data) +{ + gdouble * delta = data[1]; + GtsRange * range = data[2]; + gdouble * total_area = data[3], area; + GtsRange range_triangle; + + gts_bb_tree_triangle_distance (data[0], t, data[4], *delta, &range_triangle); + + if (range_triangle.min < range->min) + range->min = range_triangle.min; + if (range_triangle.max > range->max) + range->max = range_triangle.max; + range->n += range_triangle.n; + + area = gts_triangle_area (t); + *total_area += area; + range->sum += area*range_triangle.mean; + range->sum2 += area*range_triangle.mean*range_triangle.mean; +} + +/** + * gts_bb_tree_surface_distance: + * @tree: a bounding box tree. + * @s: a #GtsSurface. + * @distance: a #GtsBBoxDistFunc. + * @delta: a sampling increment defined as the percentage of the diagonal + * of the root bounding box of @tree. + * @range: a #GtsRange to be filled with the results. + * + * Calls gts_bb_tree_triangle_distance() for each face of @s. The + * fields of @range are filled with the minimum, maximum and average + * distance. The average distance is defined as the sum of the average + * distances for each triangle weighthed by their area and divided by + * the total area of the surface. The standard deviation is defined + * accordingly. The @n field of @range is filled with the number of + * sampled points used. + */ +void gts_bb_tree_surface_distance (GNode * tree, + GtsSurface * s, + GtsBBoxDistFunc distance, + gdouble delta, + GtsRange * range) +{ + gpointer data[5]; + gdouble total_area = 0.; + + g_return_if_fail (tree != NULL); + g_return_if_fail (s != NULL); + g_return_if_fail (delta > 0. && delta < 1.); + g_return_if_fail (range != NULL); + + gts_range_init (range); + delta *= sqrt (gts_bbox_diagonal2 (tree->data)); + data[0] = tree; + data[1] = δ + data[2] = range; + data[3] = &total_area; + data[4] = distance; + + gts_surface_foreach_face (s, + (GtsFunc) surface_distance_foreach_triangle, + data); + + if (total_area > 0.) { + if (range->sum2 - range->sum*range->sum/total_area >= 0.) + range->stddev = sqrt ((range->sum2 - range->sum*range->sum/total_area) + /total_area); + else + range->stddev = 0.; + range->mean = range->sum/total_area; + } + else + range->min = range->max = range->mean = range->stddev = 0.; +} + +static void surface_distance_foreach_boundary (GtsEdge * e, + gpointer * data) +{ + gdouble * delta = data[1]; + GtsRange * range = data[2]; + gdouble * total_length = data[3], length; + GtsRange range_edge; + + if (gts_edge_is_boundary (e, NULL)) { + GtsSegment * s = GTS_SEGMENT (e); + + gts_bb_tree_segment_distance (data[0], s, data[4], *delta, &range_edge); + + if (range_edge.min < range->min) + range->min = range_edge.min; + if (range_edge.max > range->max) + range->max = range_edge.max; + range->n += range_edge.n; + + length = gts_point_distance (GTS_POINT (s->v1), GTS_POINT (s->v2)); + *total_length += length; + range->sum += length*range_edge.mean; + range->sum2 += length*range_edge.mean*range_edge.mean; + } +} + +/** + * gts_bb_tree_surface_boundary_distance: + * @tree: a bounding box tree. + * @s: a #GtsSurface. + * @distance: a #GtsBBoxDistFunc. + * @delta: a sampling increment defined as the percentage of the diagonal + * of the root bounding box of @tree. + * @range: a #GtsRange to be filled with the results. + * + * Calls gts_bb_tree_segment_distance() for each edge boundary of @s. + * The fields of @range are filled with the minimum, maximum and + * average distance. The average distance is defined as the sum of the + * average distances for each boundary edge weighthed by their length + * and divided by the total length of the boundaries. The standard + * deviation is defined accordingly. The @n field of @range is filled + * with the number of sampled points used. + */ +void gts_bb_tree_surface_boundary_distance (GNode * tree, + GtsSurface * s, + gdouble (*distance) (GtsPoint *, + gpointer), + gdouble delta, + GtsRange * range) +{ + gpointer data[5]; + gdouble total_length = 0.; + + g_return_if_fail (tree != NULL); + g_return_if_fail (s != NULL); + g_return_if_fail (delta > 0. && delta < 1.); + g_return_if_fail (range != NULL); + + gts_range_init (range); + delta *= sqrt (gts_bbox_diagonal2 (tree->data)); + data[0] = tree; + data[1] = δ + data[2] = range; + data[3] = &total_length; + data[4] = distance; + + gts_surface_foreach_edge (s, + (GtsFunc) surface_distance_foreach_boundary, + data); + + if (total_length > 0.) { + if (range->sum2 - range->sum*range->sum/total_length >= 0.) + range->stddev = sqrt ((range->sum2 - + range->sum*range->sum/total_length) + /total_length); + else + range->stddev = 0.; + range->mean = range->sum/total_length; + } + else + range->min = range->max = range->mean = range->stddev = 0.; +} Index: tags/1.0.5/gts/boolean.c =================================================================== --- tags/1.0.5/gts/boolean.c (nonexistent) +++ tags/1.0.5/gts/boolean.c (revision 953) @@ -0,0 +1,2048 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999--2002 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +/*#define DEBUG*/ +/*#define DEBUG_BOOLEAN*/ +/*#define CHECK_ORIENTED*/ + +#ifdef DEBUG +# include "gts-private.h" +#endif /* DEBUG */ + +static void surface_inter_destroy (GtsObject * object) +{ + GtsSurfaceInter * si = GTS_SURFACE_INTER (object); + + gts_object_destroy (GTS_OBJECT (si->s1)); + gts_object_destroy (GTS_OBJECT (si->s2)); + g_slist_free (si->edges); + + (* GTS_OBJECT_CLASS (gts_surface_inter_class ())->parent_class->destroy) + (object); +} + +static void surface_inter_class_init (GtsObjectClass * klass) +{ + klass->destroy = surface_inter_destroy; +} + +static void surface_inter_init (GtsSurfaceInter * si) +{ + si->s1 = si->s2 = NULL; + si->edges = NULL; +} + +/** + * gts_surface_inter_class: + * + * Returns: the #GtsSurfaceInterClass. + */ +GtsSurfaceInterClass * gts_surface_inter_class (void) +{ + static GtsSurfaceInterClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo surface_inter_info = { + "GtsSurfaceInter", + sizeof (GtsSurfaceInter), + sizeof (GtsSurfaceInterClass), + (GtsObjectClassInitFunc) surface_inter_class_init, + (GtsObjectInitFunc) surface_inter_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &surface_inter_info); + } + + return klass; +} + +/* EdgeInter: Header */ + +typedef struct _EdgeInter EdgeInter; + +struct _EdgeInter { + GtsEdge parent; + + GtsTriangle * t1, * t2; +}; + +#define EDGE_INTER(obj) GTS_OBJECT_CAST (obj,\ + EdgeInter,\ + edge_inter_class ()) +#define IS_EDGE_INTER(obj) (gts_object_is_from_class (obj,\ + edge_inter_class ())) + +static GtsEdgeClass * edge_inter_class (void); +static EdgeInter * edge_inter_new (GtsVertex * v1, GtsVertex * v2, + GtsTriangle * t1, GtsTriangle * t2); + +/* EdgeInter: Object */ + +static GtsEdgeClass * edge_inter_class (void) +{ + static GtsEdgeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo edge_inter_info = { + "EdgeInter", + sizeof (EdgeInter), + sizeof (GtsEdgeClass), + (GtsObjectClassInitFunc) NULL, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_constraint_class ()), + &edge_inter_info); + } + + return klass; +} + +static EdgeInter * edge_inter_new (GtsVertex * v1, GtsVertex * v2, + GtsTriangle * t1, GtsTriangle * t2) +{ + EdgeInter * object; + + object = EDGE_INTER (gts_edge_new (GTS_EDGE_CLASS (edge_inter_class ()), + v1, v2)); + object->t1 = t1; + object->t2 = t2; + + return object; +} + +#ifdef DEBUG +static void write_surface_graph (GtsSurface * s, FILE * fp) +{ + GSList * l = NULL; + GtsGraph * g; + static void add_to_list (gpointer data, GSList ** l) { + *l = g_slist_prepend (*l, data); + } + + gts_surface_foreach_vertex (s, (GtsFunc) gts_object_reset_reserved, NULL); + gts_surface_foreach_edge (s, (GtsFunc) gts_object_reset_reserved, NULL); + gts_surface_foreach_edge (s, (GtsFunc) add_to_list, &l); + g = gts_segments_graph_new (gts_graph_class (), l); + gts_graph_write_dot (g, fp); + gts_object_destroy (GTS_OBJECT (g)); + g_slist_free (l); +} +#endif /* DEBUG */ + +static GtsPoint * segment_triangle_intersection (GtsSegment * s, + GtsTriangle * t, + GtsPointClass * klass) +{ + GtsPoint * A, * B, * C, * D, * E; + gint ABCE, ABCD, ADCE, ABDE, BCDE; + GtsEdge * AB, * BC, * CA; + gdouble a, b, c; + + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (t != NULL, NULL); + g_return_val_if_fail (klass != NULL, NULL); + + gts_triangle_vertices_edges (t, NULL, + (GtsVertex **) &A, + (GtsVertex **) &B, + (GtsVertex **) &C, + &AB, &BC, &CA); + D = GTS_POINT (s->v1); + E = GTS_POINT (s->v2); + + ABCE = gts_point_orientation_3d_sos (A, B, C, E); + ABCD = gts_point_orientation_3d_sos (A, B, C, D); + if (ABCE < 0 || ABCD > 0) { + GtsPoint * tmpp; + gint tmp; + + tmpp = E; E = D; D = tmpp; + tmp = ABCE; ABCE = ABCD; ABCD = tmp; + } + if (ABCE < 0 || ABCD > 0) + return NULL; + ADCE = gts_point_orientation_3d_sos (A, D, C, E); + if (ADCE < 0) + return NULL; + ABDE = gts_point_orientation_3d_sos (A, B, D, E); + if (ABDE < 0) + return NULL; + BCDE = gts_point_orientation_3d_sos (B, C, D, E); + if (BCDE < 0) + return NULL; + a = gts_point_orientation_3d (A, B, C, E); + b = gts_point_orientation_3d (A, B, C, D); + if (a != b) { + c = a/(a - b); + return gts_point_new (klass, + E->x + c*(D->x - E->x), + E->y + c*(D->y - E->y), + E->z + c*(D->z - E->z)); + } + /* D and E are contained within ABC */ +#ifdef DEBUG + fprintf (stderr, + "segment: %p:%s triangle: %p:%s intersection\n" + "D and E contained in ABC\n", + s, GTS_NEDGE (s)->name, t, GTS_NFACE (t)->name); +#endif /* DEBUG */ + g_assert (a == 0.); + return gts_point_new (klass, + (E->x + D->x)/2., + (E->y + D->y)/2., + (E->z + D->z)/2.); +} + +static gint triangle_triangle_orientation (GtsPoint * p1, + GtsPoint * p2, GtsPoint * p3, + GtsPoint * p4, GtsPoint * p5, + GtsPoint * p6) +{ + gint o4 = 0, o5 = 0, o6 = 0; + + if (p4 != p1 && p4 != p2 && p4 != p3) + o4 = gts_point_orientation_3d_sos (p1, p2, p3, p4); + if (p5 != p1 && p5 != p2 && p5 != p3) + o5 = gts_point_orientation_3d_sos (p1, p2, p3, p5); + if (o4*o5 < 0) + return 0; + if (p6 != p1 && p6 != p2 && p6 != p3) + o6 = gts_point_orientation_3d_sos (p1, p2, p3, p6); + if (o4*o6 < 0 || o5*o6 < 0) + return 0; + if (o4) return o4; + if (o5) return o5; + g_assert (o6); + return o6; +} + +static gint triangle_point_orientation (GtsTriangle * t1, + GtsTriangle * t2, + gint o1, + GtsPoint * p) +{ + GtsPoint * p1 = GTS_POINT (GTS_SEGMENT (t1->e1)->v1); + GtsPoint * p2 = GTS_POINT (GTS_SEGMENT (t1->e1)->v2); + GtsPoint * p3 = GTS_POINT (gts_triangle_vertex (t1)); + GtsPoint * p4 = GTS_POINT (GTS_SEGMENT (t2->e1)->v1); + GtsPoint * p5 = GTS_POINT (GTS_SEGMENT (t2->e1)->v2); + GtsPoint * p6 = GTS_POINT (gts_triangle_vertex (t2)); + gint o = triangle_triangle_orientation (p1, p2, p3, p4, p5, p6); + + if (o != 0) + return o; + o = triangle_triangle_orientation (p4, p5, p6, p1, p2, p3); + if (o != 0) { + gint o2 = gts_point_orientation_3d_sos (p4, p5, p6, p); + + return - o*o1*o2; + } + return 0; +} + +static void add_edge_inter (GtsEdge * e, + GtsTriangle * t, + GtsVertex * v) +{ + GtsVertex * ev1 = GTS_SEGMENT (e)->v1, * ev2 = GTS_SEGMENT (e)->v2; + GList * i = GTS_OBJECT (e)->reserved; + + GTS_OBJECT (v)->reserved = t; + if (i == NULL) { + GTS_OBJECT (e)->reserved = g_list_prepend (NULL, v); +#ifdef DEBUG + fprintf (stderr, "add_edge_inter: inserting %p (%p,%p)\n", v, e, t); +#endif /* DEBUG */ + } + else { + GtsPoint * p1 = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + GtsPoint * p2 = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + GtsPoint * p3 = GTS_POINT (gts_triangle_vertex (t)); + gint o1, oref = gts_point_orientation_3d_sos (p1, p2, p3, GTS_POINT (ev1)); + + o1 = oref; + while (i) { + gint o2 = triangle_point_orientation (t, GTS_OBJECT (i->data)->reserved, + oref, GTS_POINT (ev1)); + + if (o2 == 0) { +#ifdef DEBUG + g_warning ("add_edge_inter: safe sign evaluation failed\n"); +#endif /* DEBUG */ + o2 = gts_point_orientation_3d_sos (p1, p2, p3, i->data); + } + + if (o1*o2 < 0) + break; + ev1 = i->data; + o1 = o2; + i = i->next; + } + if (i != NULL) { + GList * n = g_list_prepend (NULL, v); + + ev2 = i->data; + n->next = i; + n->prev = i->prev; + i->prev = n; + if (n->prev == NULL) + GTS_OBJECT (e)->reserved = n; + else + n->prev->next = n; + } + else { + g_assert (o1*gts_point_orientation_3d_sos (p1, p2, p3, GTS_POINT (ev2)) + < 0); + GTS_OBJECT (e)->reserved = g_list_append (GTS_OBJECT (e)->reserved, v); + } +#ifdef DEBUG + fprintf (stderr, + "add_edge_inter: inserting %p (%p,%p) between %p and %p\n", + v, e, t, ev1, ev2); + i = GTS_OBJECT (e)->reserved; + while (i) { + fprintf (stderr, " %p", i->data); + i = i->next; + } + fprintf (stderr, "\n"); +#endif /* DEBUG */ + } +} + +static GtsVertex * intersects (GtsEdge * e, + GtsTriangle * t, + GtsSurface * s) +{ + GList * i = GTS_OBJECT (e)->reserved; + GtsVertex * v; + + while (i) { + if (GTS_OBJECT (i->data)->reserved == t) + return i->data; + i = i->next; + } + + v = GTS_VERTEX (segment_triangle_intersection (GTS_SEGMENT (e), t, + GTS_POINT_CLASS (s->vertex_class))); + if (v != NULL) { +#ifdef DEBUG + if (GTS_IS_NVERTEX (v) && GTS_IS_NEDGE (e) && GTS_IS_NFACE (t) && + GTS_NVERTEX (v)->name[0] == '\0') + g_snprintf (GTS_NVERTEX (v)->name, GTS_NAME_LENGTH, "%s|%s", + GTS_NEDGE (e)->name, GTS_NFACE (t)->name); +#endif /* DEBUG */ + if (s->vertex_class->intersection_attributes) + (*s->vertex_class->intersection_attributes) + (v, GTS_OBJECT (e), GTS_OBJECT (t)); + add_edge_inter (e, t, v); + } + return v; +} + +/* see figure misc/orientation.fig */ +static gint intersection_orientation (GtsTriangle * t1, + GtsEdge * e, + GtsTriangle * t2) +{ + GtsVertex * v1, * v2, * v3; + GtsEdge * e2, * e3; + GtsVertex * v4, * v5, * v6; + + gts_triangle_vertices_edges (t1, e, &v1, &v2, &v3, &e, &e2, &e3); + gts_triangle_vertices (t2, &v4, &v5, &v6); + + return gts_point_orientation_3d_sos (GTS_POINT (v4), + GTS_POINT (v5), + GTS_POINT (v6), + GTS_POINT (v2)); +} + +#define UPDATE_ORIENTATION if (o > 0) { vi2 = v; /* e2 = e; */ } else { vi2 = vi1;\ + /* e2 = e1; */\ + vi1 = v;\ + /* e1 = e; */ } + +static void intersect_edges (GtsBBox * bb1, GtsBBox * bb2, + GtsSurfaceInter * si) +{ + GtsSurface * s1 = GTS_OBJECT (si->s1)->reserved; + GtsTriangle * t1 = GTS_TRIANGLE (bb1->bounded); + GtsTriangle * t2 = GTS_TRIANGLE (bb2->bounded); + GtsVertex * v, * vi1 = NULL, * vi2 = NULL; + //GtsEdge * e1 = NULL, * e2 = NULL, * e; + + vi1 = intersects (t2->e1, t1, s1); + //e1 = t2->e1; + v = intersects (t2->e2, t1, s1); + //e = t2->e2; + if (!vi1) { + vi1 = v; + //e1 = e; + } + else if (v) { + gint o = intersection_orientation (t2, t2->e2, t1); + UPDATE_ORIENTATION; + } + if (!vi2) { + v = intersects (t2->e3, t1, s1); + //e = t2->e3; + if (!vi1) { + vi1 = v; + //e1 = e; + } + else if (v) { + gint o = intersection_orientation (t2, t2->e3, t1); + UPDATE_ORIENTATION; + } + } + if (!vi2) { + v = intersects (t1->e1, t2, s1); + //e = t1->e1; + if (!vi1) { + vi1 = v; + //e1 = e; + } + else if (v) { + gint o = - intersection_orientation (t1, t1->e1, t2); + UPDATE_ORIENTATION; + } + } + if (!vi2) { + v = intersects (t1->e2, t2, s1); + //e = t1->e2; + if (!vi1) { + vi1 = v; + //e1 = e; + } + else if (v) { + gint o = - intersection_orientation (t1, t1->e2, t2); + UPDATE_ORIENTATION; + } + } + if (!vi2) { + v = intersects (t1->e3, t2, s1); + //e = t1->e3; + if (!vi1) { + vi1 = v; + //e1 = e; + } + else if (v) { + gint o = - intersection_orientation (t1, t1->e3, t2); + UPDATE_ORIENTATION; + } + } + + g_assert ((!vi1 && !vi2) || (vi1 && vi2)); + if (vi1) { + GtsEdge * e = GTS_EDGE (edge_inter_new (vi1, vi2, t1, t2)); + +#ifdef DEBUG + fprintf (stderr, "creating constraint %p: %p->%p: %p/%p\n", + e, vi1, vi2, t1, t2); +#endif /* DEBUG */ + gts_surface_add_face (si->s1, GTS_FACE (t1)); + gts_surface_add_face (si->s2, GTS_FACE (t2)); + si->edges = g_slist_prepend (si->edges, e); + GTS_OBJECT (t1)->reserved = g_slist_prepend (GTS_OBJECT (t1)->reserved, e); + GTS_OBJECT (t2)->reserved = g_slist_prepend (GTS_OBJECT (t2)->reserved, e); + } +} + +static GtsSurfaceInter * surface_inter_new (GtsSurfaceInterClass * klass, + GtsSurface * s1, + GtsSurface * s2, + GNode * faces_tree1, + GNode * faces_tree2) +{ + GtsSurfaceInter * si; + + si = GTS_SURFACE_INTER (gts_object_new (GTS_OBJECT_CLASS (klass))); + si->s1 = gts_surface_new (gts_surface_class (), + s1->face_class, + s1->edge_class, + s1->vertex_class); + GTS_OBJECT (si->s1)->reserved = s1; + si->s2 = gts_surface_new (gts_surface_class (), + s2->face_class, + s2->edge_class, + s2->vertex_class); + GTS_OBJECT (si->s2)->reserved = s2; + gts_bb_tree_traverse_overlapping (faces_tree1, faces_tree2, + (GtsBBTreeTraverseFunc) intersect_edges, + si); + + return si; +} + +static void free_slist (GtsObject * o) +{ + g_slist_free (o->reserved); + o->reserved = NULL; +} + +static void free_glist (GtsObject * o) +{ + g_list_foreach (o->reserved, (GFunc) gts_object_reset_reserved, NULL); + g_list_free (o->reserved); + o->reserved = NULL; +} + +/** + * gts_surface_intersection: + * @s1: a #GtsSurface. + * @s2: a #GtsSurface. + * @faces_tree1: a bounding box tree (see gts_bb_tree_new()) for + * the faces of @s1. + * @faces_tree2: a bounding box tree for the faces of @s2. + * + * Returns: a list of #GtsEdge defining the curve intersection of the + * two surfaces. + */ +GSList * gts_surface_intersection (GtsSurface * s1, + GtsSurface * s2, + GNode * faces_tree1, + GNode * faces_tree2) +{ + GtsSurfaceInter * si; + GSList * inter; + + g_return_val_if_fail (s1 != NULL, NULL); + g_return_val_if_fail (s2 != NULL, NULL); + g_return_val_if_fail (faces_tree1 != NULL, NULL); + g_return_val_if_fail (faces_tree2 != NULL, NULL); + + si = surface_inter_new (gts_surface_inter_class (), + s1, s2, faces_tree1, faces_tree2); + + gts_surface_foreach_face (si->s1, (GtsFunc) free_slist, NULL); + gts_surface_foreach_face (si->s2, (GtsFunc) free_slist, NULL); + gts_surface_foreach_edge (si->s1, (GtsFunc) free_glist, NULL); + gts_surface_foreach_edge (si->s2, (GtsFunc) free_glist, NULL); + inter = si->edges; + si->edges = NULL; + gts_object_destroy (GTS_OBJECT (si)); + + return inter; +} + +typedef enum { + INTERIOR = 1 << (GTS_USER_FLAG), + RELEVANT = 1 << (GTS_USER_FLAG + 1) +} CurveFlag; + +#define IS_SET(s, f) ((GTS_OBJECT_FLAGS (s) & (f)) != 0) +#define SET(s, f) (GTS_OBJECT_FLAGS (s) |= (f)) +#define UNSET(s, f) (GTS_OBJECT_FLAGS (s) &= ~(f)) +#define NEXT(s) (GTS_OBJECT (s)->reserved) + +#ifdef DEBUG +static void print_segment (GtsSegment * s) +{ + fprintf (stderr, "%p: %s->%s ", s, + GTS_NVERTEX (s->v1)->name, + GTS_NVERTEX (s->v2)->name); + if (NEXT (s)) { + GtsSegment * next = NEXT (s); + + fprintf (stderr, "next %p: %s->%s\n", next, + GTS_NVERTEX (next->v1)->name, + GTS_NVERTEX (next->v2)->name); + } + else + fprintf (stderr, "next NULL\n"); +} + +static void write_nodes (GSList * i, GHashTable * hash, guint * nn, + FILE * fp) +{ + while (i) { + GtsSegment * s = i->data; + + if (!g_hash_table_lookup (hash, s->v1)) { + fprintf (fp, " %u [ label = \"%p\" ];\n", *nn, s->v1); + g_hash_table_insert (hash, s->v1, GUINT_TO_POINTER ((*nn)++)); + } + if (!g_hash_table_lookup (hash, s->v2)) { + fprintf (fp, " %u [ label = \"%p\" ];\n", *nn, s->v2); + g_hash_table_insert (hash, s->v2, GUINT_TO_POINTER ((*nn)++)); + } + i = i->next; + } +} + +static void write_edges (GSList * i, GHashTable * hash, + GtsSurface * surface, + FILE * fp) +{ + while (i) { + GtsSegment * s = i->data; + + fprintf (fp, " %u -> %u [ label = \"%p:%d\" ];\n", + GPOINTER_TO_UINT (g_hash_table_lookup (hash, s->v1)), + GPOINTER_TO_UINT (g_hash_table_lookup (hash, s->v2)), + s, + gts_edge_face_number (GTS_EDGE (s), surface)); + i = i->next; + } +} + +static void write_graph (GSList * boundary, GSList * interior, + GtsSurface * surface, + FILE * fp) +{ + GHashTable * hash = g_hash_table_new (NULL, NULL); + guint nn = 1; + + fprintf (fp, "digraph oriented_curve {\n"); + write_nodes (boundary, hash, &nn, fp); + write_nodes (interior, hash, &nn, fp); + write_edges (boundary, hash, surface, fp); + fprintf (fp, " edge [ color = red ];\n"); + write_edges (interior, hash, surface, fp); + fprintf (fp, "}\n"); + g_hash_table_destroy (hash); +} + +static void write_graph1 (GtsSegment * start, GSList * i, + GtsSurface * surface, + FILE * fp) +{ + GSList * boundary = NULL, * interior = NULL; + GtsSegment * s = start; + + do { + boundary = g_slist_prepend (boundary, s); + s = NEXT (s); + } while (s != start); + while (i) { + if (IS_SET (i->data, INTERIOR)) + interior = g_slist_prepend (interior, i->data); + i = i->next; + } + write_graph (boundary, interior, surface, fp); + g_slist_free (boundary); + g_slist_free (interior); +} + +static void print_loop (GtsSegment * start, FILE * fp) +{ + GtsSegment * s = start; + + do { + fprintf (fp, " %p: %p:%s -> %p:%s\n", + s, + s->v1, GTS_NVERTEX (s->v1)->name, + s->v2, GTS_NVERTEX (s->v2)->name); + s = NEXT (s); + } while (s != start && s != NULL); +} + +static void draw_vector (GtsPoint * p1, GtsPoint * p2, FILE * fp) +{ + gdouble x = p2->x - p1->x; + gdouble y = p2->y - p1->y; + gdouble z = p2->z - p1->z; + + fprintf (fp, "VECT 1 3 0 3 0 %g %g %g %g %g %g %g %g %g\n", + p1->x + x - (x - y/2.)/5., + p1->y + y - (x/2. + y)/5., + p1->z + z - (x/2. + z)/5., + p1->x + x, + p1->y + y, + p1->z + z, + p1->x + x - (x + y/2.)/5., + p1->y + y + (x/2. - y)/5., + p1->z + z + (x/2. - z)/5.); + fprintf (fp, "VECT 1 2 0 2 0 %g %g %g %g %g %g\n", + p1->x, p1->y, p1->z, + p1->x + x, + p1->y + y, + p1->z + z); +} + +static void draw_vector1 (GtsPoint * p1, GtsPoint * p2, GtsPoint * o, + FILE * fp) +{ + gdouble x1 = o->x + 0.9*(p1->x - o->x); + gdouble y1 = o->y + 0.9*(p1->y - o->y); + gdouble z1 = o->z + 0.9*(p1->z - o->z); + gdouble x2 = o->x + 0.9*(p2->x - o->x); + gdouble y2 = o->y + 0.9*(p2->y - o->y); + gdouble z2 = o->z + 0.9*(p2->z - o->z); + gdouble x = x2 - x1; + gdouble y = y2 - y1; + gdouble z = z2 - z1; + + fprintf (fp, "VECT 1 3 0 3 0 %g %g %g %g %g %g %g %g %g\n", + x1 + x - (x - y/2.)/5., + y1 + y - (x/2. + y)/5., + z1 + z - (x/2. + z)/5., + x1 + x, + y1 + y, + z1 + z, + x1 + x - (x + y/2.)/5., + y1 + y + (x/2. - y)/5., + z1 + z + (x/2. - z)/5.); + fprintf (fp, "VECT 1 2 0 2 0 %g %g %g %g %g %g\n", + x1, y1, z1, + x1 + x, + y1 + y, + z1 + z); +} + +static void write_segments (GSList * boundary, GSList * interior, + FILE * fp) +{ + GSList * i = boundary; + + fprintf (fp, "LIST {\n"); + while (i) { + GSList * inext = i->next; + GtsSegment * s = i->data; + GtsSegment * next = inext ? inext->data : boundary->data; + GtsVertex * v1, * v2; + + if (s->v1 != next->v1 && s->v1 != next->v2) { + v1 = s->v1; + v2 = s->v2; + } + else { + v1 = s->v2; + v2 = s->v1; + } + draw_vector (GTS_POINT (v1), GTS_POINT (v2), fp); + i = inext; + } + i = interior; + while (i) { + GtsSegment * s = i->data; + + draw_vector (GTS_POINT (s->v1), GTS_POINT (s->v2), fp); + i = i->next; + } + fprintf (fp, "}\n"); +} + +static void write_loops (GSList * i, FILE * fp) +{ + guint nl = 0; + + while (i) { + GtsSegment * start = i->data, * s; + GtsPoint os; + guint n = 0; + + fprintf (fp, "(geometry \"loop%d\" = LIST {\n", nl++); + + os.x = os.y = os.z = 0.; + s = start; + do { + GtsSegment * next = NEXT (s); + GtsPoint * p; + + if (s->v1 != next->v1 && s->v1 != next->v2) + p = GTS_POINT (s->v1); + else + p = GTS_POINT (s->v2); + os.x += p->x; os.y += p->y; os.z += p->z; n++; + s = next; + } while (s != start); + os.x /= n; os.y /= n; os.z /= n; + + s = start; + do { + GtsSegment * next = NEXT (s); + + if (s->v1 != next->v1 && s->v1 != next->v2) + draw_vector1 (GTS_POINT (s->v1), GTS_POINT (s->v2), &os, fp); + else + draw_vector1 (GTS_POINT (s->v2), GTS_POINT (s->v1), &os, fp); + s = next; + } while (s != start); + + fprintf (fp, "})\n"); + + i = i->next; + } +} + +#define NAME(v) (GTS_IS_NVERTEX (v) ? GTS_NVERTEX (v)->name : "") +#endif /* DEBUG */ + +static GtsSegment * prev_flag (GtsSegment * s, CurveFlag flag) +{ + GSList * i = s->v1->segments; + + while (i) { + if (i->data != s && IS_SET (i->data, flag)) + return i->data; + i = i->next; + } + return NULL; +} + +static GtsSegment * next_flag (GtsSegment * s, CurveFlag flag) +{ + GSList * i = s->v2->segments; + + while (i) { + if (i->data != s && IS_SET (i->data, flag)) + return i->data; + i = i->next; + } + return NULL; +} + +static GtsSegment * next_interior (GtsVertex * v) +{ + GSList * i = v->segments; + + while (i) { + GtsSegment * s = i->data; + + if (s->v1 == v && IS_SET (s, INTERIOR)) + return s; + i = i->next; + } + return NULL; +} + +static GtsSegment * prev_interior (GtsVertex * v) +{ + GSList * i = v->segments; + + while (i) { + GtsSegment * s = i->data; + + if (s->v2 == v && IS_SET (s, INTERIOR)) + return s; + i = i->next; + } + return NULL; +} + +static GtsSegment * reverse (GtsSegment * start, + gboolean interior, + gboolean * isloop) +{ + GtsSegment * s = start, * prev = NULL, * rprev = NULL; + GtsSegment * rstart = NULL, * rstart1 = NULL; + + do { + GtsSegment * rs; + + g_assert (IS_EDGE_INTER (s)); + rs = GTS_SEGMENT (edge_inter_new (s->v2, s->v1, + EDGE_INTER (s)->t1, EDGE_INTER (s)->t2)); + + if (rstart == NULL) + rstart = rs; + else if (rstart1 == NULL) + rstart1 = rs; + if (interior) + SET (rs, INTERIOR); + NEXT (rs) = rprev; + rprev = rs; + prev = s; + s = NEXT (s); + } while (s != NULL && s != start); + if (s == start) { + NEXT (rstart) = rprev; + *isloop = TRUE; + } + else { + NEXT (rstart) = start; + NEXT (prev) = rprev; + *isloop = FALSE; + } + return rstart1; +} + +static GSList * interior_loops (GSList * interior) +{ + GSList * i = interior; + GSList * loops = NULL; + + i = interior; + while (i) { + GtsSegment * s = i->data; + + if (IS_SET (s, RELEVANT)) { + GtsSegment * start = s, * end; + + do { + GtsSegment * next = next_flag (s, INTERIOR); + + UNSET (s, RELEVANT); + end = s; + s = NEXT (s) = next; + } while (s != NULL && s != start); + + if (s == start) + loops = g_slist_prepend (loops, start); + else { + GtsSegment * next, * prev; + gboolean isloop; + + s = prev_flag (start, INTERIOR); + while (s) { + UNSET (s, RELEVANT); + NEXT (s) = start; + start = s; + s = prev_flag (s, INTERIOR); + } + next = next_flag (end, RELEVANT); + prev = prev_flag (start, RELEVANT); + if (prev != NULL) + SET (start->v1, INTERIOR); + if (next != NULL) + SET (end->v2, INTERIOR); + if (next == NULL && prev == NULL) + loops = g_slist_prepend (loops, start); + else + reverse (start, TRUE, &isloop); + } + } + i = i->next; + } + return loops; +} + +#define ORIENTATION(p1,p2,p3,o) (gts_point_orientation_3d (p1, p2, o, p3)) +#define ORIENTATION_SOS(p1,p2,p3,o) (gts_point_orientation_3d_sos (p1, p2, o, p3)) + +#define ORIENTED_VERTICES(s,next,w1,w2) {\ + if ((s)->v1 == (next)->v1 || (s)->v1 == (next)->v2) {\ + w1 = (s)->v2;\ + w2 = (s)->v1;\ + }\ + else {\ + w1 = (s)->v1;\ + w2 = (s)->v2;\ + }\ +} + +#if 0 +static GtsSegment * segment_intersects (GtsPoint * p1, GtsPoint * p2, + GSList * i, + GtsPoint * o) +{ + while (i) { + GtsSegment * s = i->data; + GtsPoint * p3 = GTS_POINT (s->v1); + GtsPoint * p4 = GTS_POINT (s->v2); + + if (p3 != p1 && p3 != p2 && p4 != p1 && p4 != p2) { + gdouble o1 = ORIENTATION (p3, p4, p1, o); + gdouble o2 = ORIENTATION (p3, p4, p2, o); + + if ((o1 < 0. && o2 > 0.) || (o1 > 0. && o2 < 0.)) { + o1 = ORIENTATION (p1, p2, p3, o); + o2 = ORIENTATION (p1, p2, p4, o); + + if ((o1 <= 0. && o2 >= 0.) || (o1 >= 0. && o2 <= 0.)) + return s; + } + } + i = i->next; + } + return NULL; +} +#else +static GtsSegment * segment_intersects (GtsPoint * p1, GtsPoint * p2, + GSList * i, + GtsPoint * o) +{ + while (i) { + GtsSegment * s = i->data; + GtsPoint * p3 = GTS_POINT (s->v1); + GtsPoint * p4 = GTS_POINT (s->v2); + + if (p3 != p1 && p3 != p2 && p4 != p1 && p4 != p2) { + gint o1 = ORIENTATION_SOS (p3, p4, p1, o); + gint o2 = ORIENTATION_SOS (p3, p4, p2, o); + + if (o1*o2 < 0) { + o1 = ORIENTATION_SOS (p1, p2, p3, o); + o2 = ORIENTATION_SOS (p1, p2, p4, o); + + if (o1*o2 < 0) + return s; + } + } + i = i->next; + } + return NULL; +} +#endif + +static gboolean is_inside_wedge (GtsSegment * s1, GtsSegment * s2, + GtsPoint * p, GtsPoint * o) +{ + GtsVertex * v1, * v2, * v3; + + ORIENTED_VERTICES (s1, s2, v1, v2); + v3 = s2->v1 != v2 ? s2->v1 : s2->v2; + + if (ORIENTATION (GTS_POINT (v1), GTS_POINT (v2), + GTS_POINT (v3), o) >= 0.) { + if (ORIENTATION (GTS_POINT (v1), GTS_POINT (v2), p, o) <= 0. || + ORIENTATION (GTS_POINT (v2), GTS_POINT (v3), p, o) <= 0.) + return FALSE; + } + else if (ORIENTATION (GTS_POINT (v1), GTS_POINT (v2), p, o) <= 0. && + ORIENTATION (GTS_POINT (v2), GTS_POINT (v3), p, o) <= 0.) + return FALSE; + return TRUE; +} + +static GtsSegment * connection (GtsPoint * p, + GSList * interior, + GSList * bloops, + GtsPoint * o) +{ + while (bloops) { + GtsSegment * start = bloops->data, * s = start; + + do { + GtsSegment * next = NEXT (s); + GtsVertex * v2 = s->v1 == next->v1 || s->v1 == next->v2 ? s->v1 : s->v2; + + if (is_inside_wedge (s, next, p, o) && + !segment_intersects (p, GTS_POINT (v2), interior, o)) + return s; + s = next; + } while (s != start); + bloops = bloops->next; + } + return NULL; +} + +static gdouble loop_orientation (GtsSegment * start, + GtsPoint * p, GtsPoint * o) +{ + GtsSegment * s = start; + gdouble or = 0.; + + do { + GtsSegment * next = NEXT (s); + GtsVertex * v1, * v2; + + ORIENTED_VERTICES (s, next, v1, v2); + or += ORIENTATION (p, GTS_POINT (v1), GTS_POINT (v2), o); + s = next; + } while (s != start); + +#ifdef DEBUG + fprintf (stderr, "loop orientation: %g\n", or); +#endif /* DEBUG */ + + return or; +} + +static void connect_interior_loop (GtsSegment * start, + GSList ** interior, + GSList ** bloops, + GtsSurface * surface, + GtsPoint * o) +{ + GtsSegment * s = start, * c = NULL, * next, * s1, * rs1, * rs; + GtsVertex * v, * cv; + gboolean isloop; + + do { + if (!(c = connection (GTS_POINT (s->v2), *interior, *bloops, o))) + s = NEXT (s); + } while (s != start && !c); + g_assert (c); + next = NEXT (c); + v = c->v1 == next->v1 || c->v1 == next->v2 ? c->v1 : c->v2; + cv = s->v2; +#ifdef DEBUG + fprintf (stderr, "connecting %p:%s with %p:%s\n", + cv, NAME (cv), v, NAME (v)); + fprintf (stderr, " c: %p: %p:%s %p:%s\n", c, + c->v1, NAME (c->v1), + c->v2, NAME (c->v2)); + fprintf (stderr, " next: %p: %p:%s %p:%s\n", next, + next->v1, NAME (next->v1), + next->v2, NAME (next->v2)); +#endif /* DEBUG */ + rs = reverse (s, FALSE, &isloop); + if (isloop) { + if (loop_orientation (rs, GTS_POINT (v), o) < 0.) { + GtsSegment * tmp = s; + s = rs; + rs = tmp; + } + *bloops = g_slist_prepend (*bloops, rs); + } + s1 = GTS_SEGMENT (gts_edge_new (surface->edge_class, v, cv)); + rs1 = GTS_SEGMENT (gts_edge_new (surface->edge_class, cv, v)); + NEXT (c) = s1; + NEXT (rs1) = next; + *interior = g_slist_prepend (*interior, s1); + NEXT (s1) = NEXT (s); + NEXT (s) = rs1; +} + +static GSList * boundary_loops (GSList * boundary) +{ + GSList * i = boundary; + GtsSegment * start = i->data; + GSList * loops = NULL; + + while (i) { + GtsSegment * s = i->data; + GSList * inext = i->next; + GtsSegment * next = inext ? inext->data : start; + GtsVertex * v = s->v1 == next->v1 || s->v1 == next->v2 ? s->v1 : s->v2; + + if (IS_SET (v, INTERIOR)) { + GtsSegment * intprev = prev_interior (v); + + NEXT (intprev) = next; + NEXT (s) = next_interior (v); + UNSET (v, INTERIOR); + } + else + NEXT (s) = next; + i = inext; + } + + i = boundary; + while (i) { + start = i->data; + + if (IS_SET (start, RELEVANT)) { + GtsSegment * s = start; + + do { + UNSET (s, RELEVANT); + UNSET (s, INTERIOR); + s = NEXT (s); + } while (s != start); + loops = g_slist_prepend (loops, start); + } + i = i->next; + } + + return loops; +} + +typedef struct _Ear Ear; + +struct _Ear { + GtsVertex * v1, * v2, * v3; + GtsSegment * s1, * s2, * s3; +}; + +static gboolean point_in_wedge (GtsPoint * p1, GtsPoint * p2, GtsPoint * p3, + GtsPoint * p, gboolean closed, GtsPoint * o) +{ + gdouble o1; + + if (p == p2 || p == p3) + return FALSE; + o1 = ORIENTATION (p1, p2, p, o); + if ((closed && o1 < 0.) || (!closed && o1 <= 0.)) return FALSE; + o1 = ORIENTATION (p3, p1, p, o); + if ((closed && o1 < 0.) || (!closed && o1 <= 0.)) return FALSE; + return TRUE; +} + +#if 0 +static gboolean segment_intersects1 (GtsPoint * p1, GtsPoint * p2, + GtsPoint * p3, GtsPoint * p4, + gboolean closed, GtsPoint * o) +{ + gdouble o1 = ORIENTATION (p3, p4, p1, o); + gdouble o2 = ORIENTATION (p3, p4, p2, o); + gdouble o3, o4; + + if ((closed && ((o1 > 0. && o2 > 0.) || (o1 < 0. && o2 < 0.))) || + (!closed && ((o1 >= 0. && o2 >= 0.) || (o1 <= 0. && o2 <= 0.)))) + return FALSE; + o3 = ORIENTATION (p1, p2, p3, o); + o4 = ORIENTATION (p1, p2, p4, o); + if ((o3 > 0. && o4 > 0.) || (o3 < 0. && o4 < 0.)) + return FALSE; + if (closed) return TRUE; + if ((o3 == 0. && o4 > 0.) || (o4 == 0. && o3 > 0.)) + return TRUE; + return FALSE; +} +#else +static gboolean segment_intersects1 (GtsPoint * p1, GtsPoint * p2, + GtsPoint * p3, GtsPoint * p4, + gboolean closed, GtsPoint * o) +{ + gint o1, o2; + + o1 = ORIENTATION_SOS (p3, p4, p1, o); + o2 = ORIENTATION_SOS (p3, p4, p2, o); + if (o1*o2 > 0) + return FALSE; + o1 = ORIENTATION_SOS (p1, p2, p3, o); + o2 = ORIENTATION_SOS (p1, p2, p4, o); + if (o1*o2 > 0) + return FALSE; + return TRUE; +} +#endif + +static GtsSegment * triangle_intersects_segments (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + gboolean closed, + GtsSegment * start, + GtsPoint * o) +{ + GtsSegment * s = start; + + do { + GtsPoint * p4 = GTS_POINT (s->v1); + GtsPoint * p5 = GTS_POINT (s->v2); + + if (p4 == p1) { + if (point_in_wedge (p1, p2, p3, p5, closed, o)) + return s; + } + else if (p4 == p2) { + if (point_in_wedge (p2, p3, p1, p5, closed, o)) + return s; + } + else if (p4 == p3) { + if (point_in_wedge (p3, p1, p2, p5, closed, o)) + return s; + } + else if (p5 == p1) { + if (point_in_wedge (p1, p2, p3, p4, closed, o)) + return s; + } + else if (p5 == p2) { + if (point_in_wedge (p2, p3, p1, p4, closed, o)) + return s; + } + else if (p5 == p3) { + if (point_in_wedge (p3, p1, p2, p4, closed, o)) + return s; + } + else if (segment_intersects1 (p1, p2, p4, p5, closed, o) || + segment_intersects1 (p2, p3, p4, p5, closed, o) || + segment_intersects1 (p3, p1, p4, p5, closed, o)) + return s; + s = NEXT (s); + } while (s != start); + return NULL; +} + +static gboolean new_ear (GtsSegment * s, + Ear * e, + GtsSegment * start, + guint sloppy, + GtsPoint * o) +{ + gdouble or; + + e->s1 = s; + e->s2 = NEXT (s); + + g_return_val_if_fail (e->s2, FALSE); + g_return_val_if_fail (e->s2 != e->s1, FALSE); + + ORIENTED_VERTICES (e->s1, e->s2, e->v1, e->v2); + e->v3 = e->s2->v1 != e->v2 ? e->s2->v1 : e->s2->v2; + if (e->v3 == e->v1) + return FALSE; + e->s3 = NEXT (e->s2); + if (gts_segment_connect (e->s3, e->v1, e->v3)) { + if (NEXT (e->s3) != e->s1) + return FALSE; + } + else if (gts_vertices_are_connected (e->v1, e->v3)) + return FALSE; + else + e->s3 = NULL; + or = ORIENTATION (GTS_POINT (e->v1), GTS_POINT (e->v2), GTS_POINT (e->v3),o); + switch (sloppy) { + case 0: + if (or <= 0. || + triangle_intersects_segments (GTS_POINT (e->v1), GTS_POINT (e->v2), + GTS_POINT (e->v3), TRUE, start, o)) + return FALSE; + break; + case 1: + if (or < 0. || + (or > 0. && + triangle_intersects_segments (GTS_POINT (e->v1), GTS_POINT (e->v2), + GTS_POINT (e->v3), FALSE, start, o))) + return FALSE; + break; + case 2: + if ((or > 0. && + triangle_intersects_segments (GTS_POINT (e->v1), GTS_POINT (e->v2), + GTS_POINT (e->v3), FALSE, start, o)) || + (or < 0. && + triangle_intersects_segments (GTS_POINT (e->v2), GTS_POINT (e->v1), + GTS_POINT (e->v3), FALSE, start, o))) + return FALSE; + break; + case 3: + if (or < 0.) + return FALSE; + break; + } +#ifdef DEBUG + if (or <= 0.) + fprintf (stderr, "or: %g\n", or); +#endif /* DEBUG */ + g_assert (or > -1e-6); + return TRUE; +} + +static void triangulate_loop (GtsSegment * start, + GtsSurface * surface, + GtsPoint * o) +{ + GtsSegment * prev = start, * s; + guint sloppy = 0; +#ifdef DEBUG + guint nt = 0; +#endif /* DEBUG */ + + s = NEXT (start); + while (NEXT (s) != s) { + GtsSegment * next = NEXT (s); + Ear e; + +#ifdef DEBUG + fprintf (stderr, "prev: %p s: %p next: %p\n", prev, s, next); +#endif /* DEBUG */ + + if (!new_ear (s, &e, start, sloppy, o)) { + if (s == start) { + sloppy++; +#ifdef DEBUG + fprintf (stderr, "sloppy: %u\n", sloppy); +#endif /* DEBUG */ + } + prev = s; + s = next; + } + else { + GtsFace * f; + + if (!GTS_IS_EDGE (e.s3)) + e.s3 = GTS_SEGMENT (gts_edge_new (surface->edge_class, e.v1, e.v3)); + f = gts_face_new (surface->face_class, + GTS_EDGE (e.s1), GTS_EDGE (e.s2), GTS_EDGE (e.s3)); + gts_surface_add_face (surface, f); + UNSET (e.s1, RELEVANT); + UNSET (e.s1, INTERIOR); + UNSET (e.s2, RELEVANT); + UNSET (e.s2, INTERIOR); + NEXT (prev) = e.s3; + NEXT (e.s3) = NEXT (e.s2); + NEXT (e.s1) = NEXT (e.s2) = NULL; + start = prev; + s = NEXT (prev); + sloppy = 0; +#ifdef DEBUG + { + gchar name[80]; + FILE * fp; + + fprintf (stderr, " t.%u: (%p:%s,%p:%s,%p:%s)\n", + nt, + e.v1, NAME (e.v1), + e.v2, NAME (e.v2), + e.v3, NAME (e.v3)); + sprintf (name, "/tmp/t.%u", nt++); + fp = fopen (name, "wt"); + // gts_surface_write (surface, fp); + gts_write_triangle (GTS_TRIANGLE (f), NULL, fp); + // write_graph1 (start, interior, surface, fp); + fclose (fp); + print_loop (start, stderr); + } +#endif /* DEBUG */ + } + } + UNSET (s, RELEVANT); + UNSET (s, INTERIOR); + NEXT (s) = NULL; +} + +#ifdef CHECK_ORIENTED +static void check_object (GtsObject * o) +{ + g_assert (o->reserved == NULL); + g_assert (o->flags == 0); +} + +static void check_boundary (GtsEdge * e, GtsSurface * s) +{ + check_object (GTS_OBJECT (e)); + check_object (GTS_OBJECT (GTS_SEGMENT (e)->v1)); + check_object (GTS_OBJECT (GTS_SEGMENT (e)->v2)); + g_assert (gts_edge_face_number (e, s) == 1); +} + +static void check_interior (GtsEdge * e, GtsSurface * s) +{ + guint n; + check_object (GTS_OBJECT (e)); + check_object (GTS_OBJECT (GTS_SEGMENT (e)->v1)); + check_object (GTS_OBJECT (GTS_SEGMENT (e)->v2)); + + n = gts_edge_face_number (e, s); +#ifdef DEBUG + if (n != 2) + gts_surface_print_stats (s, stderr); +#endif /* DEBUG */ + g_assert (n == 2); +} + +static void check_boundary_interior_triangulation (GSList * boundary, + GSList * interior, + GtsSurface * surface) +{ + g_slist_foreach (boundary, (GFunc) check_boundary, surface); + g_slist_foreach (interior, (GFunc) check_interior, surface); +} +#endif /*ifdef CHECK_ORIENTED */ + +static void merge_duplicate (GtsEdge * e) +{ + GtsEdge * dup = gts_edge_is_duplicate (e); + + g_assert (dup); + gts_edge_replace (dup, e); + gts_object_destroy (GTS_OBJECT (dup)); +} + +static void triangulate_boundary_interior (GSList * boundary, + GSList * interior, + GtsSurface * s, + GtsPoint * o) +{ + GSList * iloops, * bloops, * i; + + i = boundary; + while (i) { + SET (i->data, RELEVANT); + i = i->next; + } + i = interior; + while (i) { + SET (i->data, RELEVANT); + SET (i->data, INTERIOR); + i = i->next; + } + + iloops = interior_loops (interior); + bloops = boundary_loops (boundary); + + i = iloops; + while (i) { +#ifdef DEBUG + fprintf (stderr, "--- interior loop ---\n"); + print_loop (i->data, stderr); +#endif /* DEBUG */ + connect_interior_loop (i->data, &interior, &bloops, s, o); + i = i->next; + } + +#ifdef DEBUG + { + FILE * fp = fopen ("/tmp/bloops", "w"); + write_loops (bloops, fp); + fclose (fp); + } +#endif /* DEBUG */ + + i = bloops; + while (i) { +#ifdef DEBUG + fprintf (stderr, "--- boundary loop ---\n"); + print_loop (i->data, stderr); +#endif /* DEBUG */ + triangulate_loop (i->data, s, o); + i = i->next; + } + + g_slist_foreach (interior, (GFunc) merge_duplicate, NULL); + g_slist_free (iloops); + g_slist_free (bloops); + +#ifdef CHECK_ORIENTED + check_boundary_interior_triangulation (boundary, interior, s); +#endif /* CHECK_ORIENTED */ +} + +static void create_edges (GtsSegment * s, GtsSurface * surface) +{ + if (GTS_OBJECT (s)->reserved) { + GList * i = GTS_OBJECT (s)->reserved; + GtsVertex * v1 = i->data; + + GTS_OBJECT (s)->reserved = g_list_prepend (i, + gts_edge_new (surface->edge_class, s->v1, v1)); + while (i) { + GList * next = i->next; + GtsVertex * v2 = next ? next->data : s->v2; + + GTS_OBJECT (i->data)->reserved = NULL; + i->data = gts_edge_new (surface->edge_class, v1, v2); + v1 = v2; + i = next; + } + } +} + +static void add_boundary (GtsSegment * s, GtsSegment * next, + GSList ** boundary) +{ + if (GTS_OBJECT (s)->reserved == NULL) + *boundary = g_slist_prepend (*boundary, s); + else { + if (s->v2 == next->v2 || s->v2 == next->v1) { + GList * i = g_list_last (GTS_OBJECT (s)->reserved); + + while (i) { + *boundary = g_slist_prepend (*boundary, i->data); + i = i->prev; + } + } + else { + GList * i = GTS_OBJECT (s)->reserved; + + while (i) { + *boundary = g_slist_prepend (*boundary, i->data); + i = i->next; + } + } + } +} + +static void triangulate_face (GtsTriangle * t, GtsSurface * surface) +{ + GSList * interior = GTS_OBJECT (t)->reserved; + GSList * boundary = NULL; + GtsSurface * s = gts_surface_new (gts_surface_class (), + surface->face_class, + surface->edge_class, + surface->vertex_class); + gdouble x, y, z; + GtsPoint * p = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + GtsPoint * o; + + GTS_OBJECT (t)->reserved = NULL; + gts_triangle_normal (t, &x, &y, &z); + g_assert (x != 0. || y != 0. || z != 0.); + o = gts_point_new (gts_point_class (), p->x + x, p->y + y, p->z + z); + add_boundary (GTS_SEGMENT (t->e3), GTS_SEGMENT (t->e1), &boundary); + add_boundary (GTS_SEGMENT (t->e2), GTS_SEGMENT (t->e3), &boundary); + add_boundary (GTS_SEGMENT (t->e1), GTS_SEGMENT (t->e2), &boundary); +#ifdef DEBUG + { + static guint nt = 0; + char name[80]; + FILE * fp; + + fprintf (stderr, "%u: triangulating %p\n", nt, t); +if (nt == 28) + fprintf (stderr, "tintin!!!!\n"); + sprintf (name, "/tmp/oc.%u", nt++); + fp = fopen (name, "wt"); + // write_graph (boundary, interior, s, fp); + write_segments (boundary, interior, fp); + fclose (fp); + } +#endif /* DEBUG */ + triangulate_boundary_interior (boundary, interior, s, o); + g_slist_free (interior); + g_slist_free (boundary); + if (GTS_OBJECT (t)->klass->attributes) + gts_surface_foreach_face (s, (GtsFunc) gts_object_attributes, t); + gts_surface_merge (surface, s); + gts_object_destroy (GTS_OBJECT (s)); + gts_object_destroy (GTS_OBJECT (o)); +} + +static void free_edge_list (GtsObject * o) +{ + g_list_free (o->reserved); + o->reserved = NULL; +} + +/** + * gts_surface_inter_new: + * @klass: a #GtsSurfaceInterClass. + * @s1: a #GtsSurface. + * @s2: a #GtsSurface. + * @faces_tree1: a bounding box tree (see gts_bb_tree_new()) for + * the faces of @s1. + * @faces_tree2: a bounding box tree for the faces of @s2. + * @is_open1: whether @s1 is an "open" surface. + * @is_open2: whether @s2 is an "open" surface. + * + * When triangulating the cut faces, the new faces inherit the + * attributes of these original faces through their attributes() + * method. + * + * Returns: a new #GtsSurfaceInter describing the intersection of @s1 + * and @s2. + */ +GtsSurfaceInter * gts_surface_inter_new (GtsSurfaceInterClass * klass, + GtsSurface * s1, + GtsSurface * s2, + GNode * faces_tree1, + GNode * faces_tree2, + gboolean is_open1, + gboolean is_open2) +{ + GtsSurfaceInter * si; + GtsSurface * s; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (s1 != NULL, NULL); + g_return_val_if_fail (s2 != NULL, NULL); + g_return_val_if_fail (faces_tree1 != NULL, NULL); + g_return_val_if_fail (faces_tree2 != NULL, NULL); + + si = surface_inter_new (klass, s1, s2, faces_tree1, faces_tree2); + + gts_surface_foreach_edge (si->s1, (GtsFunc) create_edges, si->s1); + gts_surface_foreach_edge (si->s2, (GtsFunc) create_edges, si->s2); + +#ifdef DEBUG + fprintf (stderr, "====== triangulating s1 ======\n"); +#endif /* DEBUG */ + s = gts_surface_new (gts_surface_class (), + s1->face_class, + s1->edge_class, + s1->vertex_class); + gts_surface_foreach_face (si->s1, (GtsFunc) triangulate_face, s); + gts_surface_foreach_edge (si->s1, (GtsFunc) free_edge_list, NULL); + gts_object_destroy (GTS_OBJECT (si->s1)); + si->s1 = s; + GTS_OBJECT (si->s1)->reserved = s1; + +#ifdef DEBUG + fprintf (stderr, "====== triangulating s2 ======\n"); +#endif /* DEBUG */ + s = gts_surface_new (gts_surface_class (), + s2->face_class, + s2->edge_class, + s2->vertex_class); + gts_surface_foreach_face (si->s2, (GtsFunc) triangulate_face, s); + gts_surface_foreach_edge (si->s2, (GtsFunc) free_edge_list, NULL); + gts_object_destroy (GTS_OBJECT (si->s2)); + si->s2 = s; + GTS_OBJECT (si->s2)->reserved = s2; + + return si; +} + +static void check_surface_edge (GtsEdge * e, gpointer * data) +{ + gboolean * ok = data[0]; + GtsSurface * s = data[1]; + GtsSurface * bs = GTS_OBJECT (s)->reserved; + guint nf = gts_edge_face_number (e, s); + + if (nf < 1 || nf > 2) { + *ok = FALSE; + g_return_if_fail (nf >= 1 && nf <= 2); + } + if (nf == 1 && gts_edge_face_number (e, bs) == 0) { + *ok = FALSE; + g_return_if_fail (gts_edge_face_number (e, bs) > 0); + } +} + +static void mark_edge (GtsObject * o, gpointer data) +{ + o->reserved = data; +} + +static gint triangle_orientation (GtsTriangle * t, GtsEdge * e) +{ + GtsSegment * s = GTS_SEGMENT (t->e1 == e ? t->e2 + : + t->e2 == e ? t->e3 + : + t->e1); + GtsVertex * v2 = GTS_SEGMENT (e)->v2; + + if (s->v1 == v2 || s->v2 == v2) + return 1; + return -1; +} + +static gboolean check_orientation (GtsEdge * e, GtsSurface * s) +{ + GtsTriangle * t1 = NULL, * t2 = NULL; + GSList * i = e->triangles; + gint o1 = 0, o2 = 0; + + while (i) { + if (GTS_IS_FACE (i->data) && + gts_face_has_parent_surface (i->data, s)) { + if (t1 == NULL) { + t1 = i->data; + o1 = triangle_orientation (t1, e); + } + else if (t2 == NULL) { + t2 = i->data; + o2 = triangle_orientation (t2, e); + g_return_val_if_fail (o1*o2 < 0, FALSE); + } + else + g_assert_not_reached (); + } + i = i->next; + } + g_return_val_if_fail (t1 && t2, FALSE); + return TRUE; +} + +static void check_edge (GtsSegment * s, gpointer * data) +{ + gboolean * ok = data[0]; + GtsSurfaceInter * si = data[1]; + gboolean * closed = data[2]; + GSList * j; + guint nn = 0; + + j = s->v1->segments; + while (j && *ok) { + GtsSegment * s1 = j->data; + + if (s1 != s && GTS_OBJECT (s1)->reserved == si) { + if (s1->v2 != s->v1) + *ok = FALSE; + nn++; + } + j = j->next; + } + j = s->v2->segments; + while (j && *ok) { + GtsSegment * s1 = j->data; + + if (s1 != s && GTS_OBJECT (s1)->reserved == si) { + if (s1->v1 != s->v2) + *ok = FALSE; + nn++; + } + j = j->next; + } + if (nn != 2) + *closed = FALSE; + + if (!check_orientation (GTS_EDGE (s), si->s1)) + *ok = FALSE; + if (!check_orientation (GTS_EDGE (s), si->s2)) + *ok = FALSE; +} + +/** + * gts_surface_inter_check: + * @si: a #GtsSurfaceInter. + * @closed: is set to %TRUE if @si->edges is a closed curve, %FALSE + * otherwise. + * + * Returns: %TRUE if the curve described by @si is an orientable + * manifold, %FALSE otherwise. + */ +gboolean gts_surface_inter_check (GtsSurfaceInter * si, + gboolean * closed) +{ + gboolean ok = TRUE; + gpointer data[3]; + + g_return_val_if_fail (si != NULL, FALSE); + g_return_val_if_fail (closed != NULL, FALSE); + + *closed = si->edges ? TRUE : FALSE; + + /* mark edges as used by si */ + g_slist_foreach (si->edges, (GFunc) mark_edge, si); + + data[0] = &ok; + data[1] = si; + data[2] = closed; + g_slist_foreach (si->edges, (GFunc) check_edge, data); + g_slist_foreach (si->edges, (GFunc) gts_object_reset_reserved, NULL); + + /* check connectivity of the faces of @si */ + if (*closed) { + gpointer data[2]; + + data[0] = &ok; + data[1] = si->s1; + gts_surface_foreach_edge (si->s1, (GtsFunc) check_surface_edge, data); + data[1] = si->s2; + gts_surface_foreach_edge (si->s2, (GtsFunc) check_surface_edge, data); + } + + return ok; +} + +/* Given @e and @f returns a #GtsFace compatible with @f and belonging to + @s1 or @s2 */ +static GtsFace * next_compatible_face (GtsEdge * e, + GtsFace * f, + GtsSurface * s1, + GtsSurface * s2) +{ + GSList * i = e->triangles; + GtsFace * f2 = NULL, * f3 = NULL; + + while (i) { + GtsFace * f1 = i->data; + + if (f1 != f && GTS_IS_FACE (f1)) { + if (gts_face_has_parent_surface (f1, s1)) + return f1; + if (gts_face_has_parent_surface (f1, s2)) { + if (f2 == NULL) f2 = f1; + else if (f3 == NULL) f3 = f1; + else g_assert_not_reached (); /* s2 is a non-manifold surface */ + } + } + i = i->next; + } + if (f3 == NULL) { + if (gts_edge_is_boundary (e, s2)) + return NULL; + return f2; + } + g_assert (gts_face_has_parent_surface (f, s1)); + if (gts_triangles_are_compatible (GTS_TRIANGLE (f), GTS_TRIANGLE (f2), e)) + return f2; + return f3; +} + +static void walk_faces (GtsEdge * e, GtsFace * f, + GtsSurface * s1, + GtsSurface * s2, + GtsSurface * s) +{ + GtsFifo * faces = gts_fifo_new (); + GtsFifo * edges = gts_fifo_new (); + + gts_fifo_push (faces, f); + gts_fifo_push (edges, e); + while ((f = gts_fifo_pop (faces)) && (e = gts_fifo_pop (edges))) { + if (!GTS_OBJECT (f)->reserved) { + GtsTriangle * t = GTS_TRIANGLE (f); + GtsFace * f1; + + gts_surface_add_face (s, f); + GTS_OBJECT (f)->reserved = s; + if (t->e1 != e && !GTS_OBJECT (t->e1)->reserved && + (f1 = next_compatible_face (t->e1, f, s1, s2))) { + gts_fifo_push (faces, f1); + gts_fifo_push (edges, t->e1); + } + if (t->e2 != e && !GTS_OBJECT (t->e2)->reserved && + (f1 = next_compatible_face (t->e2, f, s1, s2))) { + gts_fifo_push (faces, f1); + gts_fifo_push (edges, t->e2); + } + if (t->e3 != e && !GTS_OBJECT (t->e3)->reserved && + (f1 = next_compatible_face (t->e3, f, s1, s2))) { + gts_fifo_push (faces, f1); + gts_fifo_push (edges, t->e3); + } + } + } + gts_fifo_destroy (faces); + gts_fifo_destroy (edges); +} + +/** + * gts_surface_inter_boolean: + * @si: a #GtsSurfaceInter. + * @surface: a #GtsSurface. + * @op: a #GtsBooleanOperation. + * + * Adds to @surface the part of the surface described by @si and @op. + */ +void gts_surface_inter_boolean (GtsSurfaceInter * si, + GtsSurface * surface, + GtsBooleanOperation op) +{ + GtsSurface * s = NULL; + gint orient = 1; + GSList * i; + + g_return_if_fail (si != NULL); + g_return_if_fail (surface != NULL); + + switch (op) { + case GTS_1_OUT_2: s = si->s1; orient = 1; break; + case GTS_1_IN_2: s = si->s1; orient = -1; break; + case GTS_2_OUT_1: s = si->s2; orient = -1; break; + case GTS_2_IN_1: s = si->s2; orient = 1; break; + default: g_assert_not_reached (); + } + + /* mark edges as belonging to intersection */ + g_slist_foreach (si->edges, (GFunc) mark_edge, si); + + i = si->edges; + while (i) { + GtsEdge * e = i->data; + GSList * j = e->triangles; + + while (j) { + if (gts_face_has_parent_surface (j->data, s) && + orient*triangle_orientation (j->data, e) > 0) { +#ifdef DEBUG_BOOLEAN + GtsFace * boundary = gts_edge_is_boundary (e, surface); + + g_assert (!boundary || boundary == j->data); +#endif /* DEBUG_BOOLEAN */ + walk_faces (e, j->data, s, GTS_OBJECT (s)->reserved, surface); + break; + } + j = j->next; + } + i = i->next; + } + g_slist_foreach (si->edges, (GFunc) gts_object_reset_reserved, NULL); + gts_surface_foreach_face (surface, + (GtsFunc) gts_object_reset_reserved, NULL); +} + +static void self_intersecting (GtsBBox * bb1, GtsBBox * bb2, + gpointer * d) +{ + GtsTriangle * t1 = bb1->bounded; + GtsTriangle * t2 = bb2->bounded; + + if (t1 != t2) { + GtsSegment * s1 = GTS_SEGMENT (t1->e1); + GtsSegment * s2 = GTS_SEGMENT (t1->e2); + GtsSegment * s3 = GTS_SEGMENT (t1->e3); + GtsSegment * s4 = GTS_SEGMENT (t2->e1); + GtsSegment * s5 = GTS_SEGMENT (t2->e2); + GtsSegment * s6 = GTS_SEGMENT (t2->e3); + GtsPoint * pi; + + if ((!gts_segments_touch (s4, s1) && + !gts_segments_touch (s4, s2) && + !gts_segments_touch (s4, s3) && + (pi = segment_triangle_intersection (s4, t1, gts_point_class ())) + != NULL) || + (!gts_segments_touch (s5, s1) && + !gts_segments_touch (s5, s2) && + !gts_segments_touch (s5, s3) && + (pi = segment_triangle_intersection (s5, t1, gts_point_class ())) + != NULL) || + (!gts_segments_touch (s6, s1) && + !gts_segments_touch (s6, s2) && + !gts_segments_touch (s6, s3) && + (pi = segment_triangle_intersection (s6, t1, gts_point_class ())) + != NULL)) { + GtsBBTreeTraverseFunc func = d[0]; + gpointer data = d[1]; + gboolean * self_inter = d[2]; + + gts_object_destroy (GTS_OBJECT (pi)); + *self_inter = TRUE; + (* func) (bb1, bb2, data); + } + } +} + +/** + * gts_surface_foreach_intersecting_face: + * @s: a #GtsSurface. + * @func: a #GtsBBTreeTraverseFunc. + * @data: user data to pass to @func. + * + * Calls @func for each intersecting pair of faces of @s. + * + * Returns: %TRUE if @func was called at least once, %FALSE otherwise. + */ +gboolean gts_surface_foreach_intersecting_face (GtsSurface * s, + GtsBBTreeTraverseFunc func, + gpointer data) +{ + GNode * tree; + gpointer d[3]; + gboolean self_inter = FALSE; + + g_return_val_if_fail (s != NULL, FALSE); + g_return_val_if_fail (func != NULL, FALSE); + + tree = gts_bb_tree_surface (s); + d[0] = func; + d[1] = data; + d[2] = &self_inter; + gts_bb_tree_traverse_overlapping (tree, tree, + (GtsBBTreeTraverseFunc) self_intersecting, + d); + gts_bb_tree_destroy (tree, TRUE); + + return self_inter; +} + +static void add_intersecting (GtsBBox * bb1, GtsBBox * bb2, + GtsSurface * intersected) +{ + gts_surface_add_face (intersected, bb1->bounded); + gts_surface_add_face (intersected, bb2->bounded); +} + +/** + * gts_surface_is_self_intersecting: + * @s: a #GtsSurface. + * + * Returns: a new #GtsSurface containing the faces of @s which are + * self-intersecting or %NULL if no faces of @s are self-intersecting. + */ +GtsSurface * gts_surface_is_self_intersecting (GtsSurface * s) +{ + GtsSurface * intersected; + + g_return_val_if_fail (s != NULL, NULL); + + intersected = gts_surface_new (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass), + s->face_class, + s->edge_class, + s->vertex_class); + if (!gts_surface_foreach_intersecting_face (s, + (GtsBBTreeTraverseFunc) add_intersecting, intersected)) { + gts_object_destroy (GTS_OBJECT (intersected)); + intersected = NULL; + } + return intersected; +} Index: tags/1.0.5/gts/cdt.c =================================================================== --- tags/1.0.5/gts/cdt.c (nonexistent) +++ tags/1.0.5/gts/cdt.c (revision 953) @@ -0,0 +1,1173 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include + + +#include +#include "gts.h" + +#ifdef USE_SURFACE_BTREE + +static gint find_closest (GtsTriangle * t, gpointer value, gpointer * data) +{ + guint * ns = data[2]; + guint * n = data[3]; + + if (*n >= *ns) + return TRUE; + else { + gdouble * dmin = data[0]; + gpointer * closest = data[1]; + GtsPoint * p = data[4]; + + if (gts_triangle_orientation (t) > 0.) { + GtsPoint * p1 = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + gdouble d = (p->x - p1->x)*(p->x - p1->x) + (p->y - p1->y)*(p->y - p1->y); + + if (d < *dmin) { + *dmin = d; + *closest = t; + } + (*n)++; + } + } + return FALSE; +} + +/* select the face closest to @p among n^1/3 randomly picked faces + * of @surface */ +static GtsFace * closest_face (GtsSurface * s, GtsPoint * p) +{ + guint n = 0, nt, ns; + gdouble dmin = G_MAXDOUBLE; + GtsFace * closest = NULL; + gpointer data[5]; + + nt = gts_surface_face_number (s); + if (!nt) + return NULL; + ns = exp (log ((gdouble) nt)/3.); + + data[0] = &dmin; + data[1] = &closest; + data[2] = &ns; + data[3] = &n; + data[4] = p; + g_tree_traverse (s->faces, (GTraverseFunc) find_closest, G_IN_ORDER, data); + + return closest; +} + +#else /* not USE_SURFACE_BTREE */ + +typedef struct _SFindClosest SFindClosest; + +struct _SFindClosest { + gdouble dmin; + GtsFace *closest; + GtsPoint * p; + gint stop; +}; + +# if GLIB_CHECK_VERSION(2,4,0) +/* finally, with g_hash_table_find we are able to stop iteration over the hash + table in the middle */ + +static gboolean find_closest (gpointer key, gpointer value, gpointer user_data) +{ + SFindClosest * data = (SFindClosest *) user_data; + GtsFace * f = GTS_FACE (value); + + if (gts_triangle_orientation (GTS_TRIANGLE (f)) > 0.) { + GtsPoint * p1 = GTS_POINT (GTS_SEGMENT (GTS_TRIANGLE (f)->e1)->v1); + gdouble d = ((data->p->x - p1->x)*(data->p->x - p1->x) + + (data->p->y - p1->y)*(data->p->y - p1->y)); + + if (d < data->dmin) { + data->dmin = d; + data->closest = f; + } + } + data->stop--; + return !(data->stop > 0); +} + +static GtsFace * closest_face (GtsSurface * s, GtsPoint * p) +{ + SFindClosest fc; + + fc.dmin = G_MAXDOUBLE; + fc.closest = NULL; + fc.p = p; + fc.stop = (gint) exp (log ((gdouble) g_hash_table_size (s->faces))/3.); + g_hash_table_find (s->faces, find_closest, &fc); + + return fc.closest; +} + +# else /* VERSION < 2.4.0 */ + +static void +find_closest (gpointer key, gpointer value, gpointer user_data) +{ + SFindClosest * data = (SFindClosest *) user_data; + GtsFace * f = GTS_FACE (value); + + if (gts_triangle_orientation (GTS_TRIANGLE (f)) > 0.) { + GtsPoint * p1 = GTS_POINT (GTS_SEGMENT (GTS_TRIANGLE (f)->e1)->v1); + gdouble d = ((data->p->x - p1->x)*(data->p->x - p1->x) + + (data->p->y - p1->y)*(data->p->y - p1->y)); + + if (d < data->dmin) { + data->dmin = d; + data->closest = f; + } + } + data->stop--; +} + +/* select the face closest to @p among n^1/3 randomly picked faces + * of @surface */ +static GtsFace * closest_face (GtsSurface * s, GtsPoint * p) +{ + SFindClosest fc; + + if (!g_hash_table_size (s->faces)) + return NULL; + + fc.dmin = G_MAXDOUBLE; + fc.closest = NULL; + fc.p = p; + fc.stop = (gint) exp (log ((gdouble) g_hash_table_size (s->faces))/3.); + g_hash_table_foreach (s->faces, find_closest, &fc); + return fc.closest; +} +# endif /* VERSION < 2.4.0 */ +#endif /* not USE_SURFACE_BTREE */ + +/* returns the face belonging to @surface and neighbor of @f via @e */ +static GtsFace * neighbor (GtsFace * f, + GtsEdge * e, + GtsSurface * surface) +{ + GSList * i = e->triangles; + GtsTriangle * t = GTS_TRIANGLE (f); + + while (i) { + GtsTriangle * t1 = i->data; + if (t1 != t && + GTS_IS_FACE (t1) && + gts_face_has_parent_surface (GTS_FACE (t1), surface)) + return GTS_FACE (t1); + i = i->next; + } + return NULL; +} + +/* given a triangle @t and a segment s (@o -> @p). + @o must be in @t. Returns the + edge of @t which is intersected by s or %NULL if @p is also + contained in @t (on_summit is set to %FALSE) or if s intersects @t + exactly on one of its summit (on_summit is set to %TRUE). */ +static GtsEdge * triangle_next_edge (GtsTriangle * t, + GtsPoint * o, GtsPoint * p, + gboolean * on_summit) +{ + GtsVertex * v1, * v2, * v3; + GtsEdge * e1, * e2, * e3; + gdouble orient = 0.0; + + gts_triangle_vertices_edges (t, NULL, + &v1, &v2, &v3, + &e1, &e2, &e3); + + *on_summit = FALSE; + orient = gts_point_orientation (o, GTS_POINT (v1), p); + if (orient > 0.0) { + orient = gts_point_orientation (o, GTS_POINT (v2), p); + if (orient > 0.0) { + if (gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), p) >= 0.0) + return NULL; + return e2; + } + if (orient < 0.0) { + if (gts_point_orientation (GTS_POINT (v1), GTS_POINT (v2), p) >= 0.0) + return NULL; + return e1; + } + if (gts_point_orientation (GTS_POINT (v1), GTS_POINT (v2), p) < 0.0) + *on_summit = TRUE; + return NULL; + } + + if (orient < 0.0) { + orient = gts_point_orientation (o, GTS_POINT (v3), p); + if (orient > 0.0) { + if (gts_point_orientation (GTS_POINT (v3), GTS_POINT (v1), p) >= 0.0) + return NULL; + return e3; + } + if (orient < 0.0) { + if (gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), p) >= 0.0) + return NULL; + return e2; + } + if (gts_point_orientation (GTS_POINT (v3), GTS_POINT (v1), p) < 0.0) + *on_summit = TRUE; + return NULL; + } + + if (gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), p) < 0.0) + return e2; + if (gts_point_orientation (GTS_POINT (v1), GTS_POINT (v2), p) < 0.0) + *on_summit = TRUE; + return NULL; +} + +static void triangle_barycenter (GtsTriangle * t, GtsPoint * b) +{ + GtsPoint * p = GTS_POINT (gts_triangle_vertex (t)); + b->x = (p->x + + GTS_POINT (GTS_SEGMENT(t->e1)->v1)->x + + GTS_POINT (GTS_SEGMENT(t->e1)->v2)->x)/3.; + b->y = (p->y + + GTS_POINT (GTS_SEGMENT(t->e1)->v1)->y + + GTS_POINT (GTS_SEGMENT(t->e1)->v2)->y)/3.; +} + +static GtsFace * point_locate (GtsPoint * o, + GtsPoint * p, + GtsFace * f, + GtsSurface * surface) +{ + GtsEdge * prev; + gboolean on_summit; + GtsVertex * v1, * v2, * v3; + GtsEdge * e2, * e3; + + prev = triangle_next_edge (GTS_TRIANGLE (f), o, p, &on_summit); + + if (!prev) { + GtsFace * f1; + + if (!on_summit) + return f; /* p is inside f */ + + /* s intersects f exactly on a summit: restarts from a neighbor of f */ + if ((f1 = neighbor (f, GTS_TRIANGLE (f)->e1, surface)) || + (f1 = neighbor (f, GTS_TRIANGLE (f)->e2, surface)) || + (f1 = neighbor (f, GTS_TRIANGLE (f)->e3, surface))) { + triangle_barycenter (GTS_TRIANGLE (f1), o); + return point_locate (o, p, f1, surface); + } + return NULL; + } + + f = neighbor (f, prev, surface); + if (f) + gts_triangle_vertices_edges (GTS_TRIANGLE (f), prev, + &v1, &v2, &v3, &prev, &e2, &e3); + while (f) { + gdouble orient = gts_point_orientation (o, GTS_POINT (v3), p); + + if (orient < 0.0) { + if (gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), p) >= 0.0) + return f; /* p is inside f */ + f = neighbor (f, e2, surface); + prev = e2; + v1 = v3; + } + else if (orient > 0.0) { + if (gts_point_orientation (GTS_POINT (v3), GTS_POINT (v1), p) >= 0.0) + return f; /* p is inside f */ + f = neighbor (f, e3, surface); + prev = e3; + v2 = v3; + } + else { + GtsFace * f1; + + if (gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), p) >= 0.0) + return f; /* p is inside f */ + + /* s intersects f exactly on v3: restarts from a neighbor of f */ + if ((f1 = neighbor (f, e2, surface)) || + (f1 = neighbor (f, e3, surface))) { + triangle_barycenter (GTS_TRIANGLE (f1), o); + return point_locate (o, p, f1, surface); + } + return NULL; + } + /* update e2, e3, v3 for the new triangle */ + if (f) { + if (prev == GTS_TRIANGLE (f)->e1) { + e2 = GTS_TRIANGLE (f)->e2; e3 = GTS_TRIANGLE (f)->e3; + } + else if (prev == GTS_TRIANGLE (f)->e2) { + e2 = GTS_TRIANGLE (f)->e3; e3 = GTS_TRIANGLE (f)->e1; + } + else { + e2 = GTS_TRIANGLE (f)->e1; e3 = GTS_TRIANGLE (f)->e2; + } + if (GTS_SEGMENT (e2)->v1 == v1 || GTS_SEGMENT (e2)->v1 == v2) + v3 = GTS_SEGMENT (e2)->v2; + else + v3 = GTS_SEGMENT (e2)->v1; + } + } + return NULL; +} + +/** + * gts_point_locate: + * @p: a #GtsPoint. + * @surface: a #GtsSurface. + * @guess: %NULL or a face of @surface close to @p. + * + * Locates the face of the planar projection of @surface containing + * @p. The planar projection of @surface must define a connected set + * of triangles without holes and bounded by a convex boundary. The + * algorithm is randomized and performs in O(n^1/3) expected time + * where n is the number of triangles of @surface. + * + * If a good @guess is given the point location can be significantly faster. + * + * Returns: a #GtsFace of @surface containing @p or %NULL if @p is not + * contained within the boundary of @surface. + */ +GtsFace * gts_point_locate (GtsPoint * p, + GtsSurface * surface, + GtsFace * guess) +{ + GtsFace * fr; + GtsPoint * o; + + g_return_val_if_fail (p != NULL, NULL); + g_return_val_if_fail (surface != NULL, NULL); + g_return_val_if_fail (guess == NULL || + gts_face_has_parent_surface (guess, surface), NULL); + + if (guess == NULL) + guess = closest_face (surface, p); + else + g_return_val_if_fail (gts_triangle_orientation (GTS_TRIANGLE (guess)) > 0., NULL); + + if (guess == NULL) + return NULL; + + o = GTS_POINT (gts_object_new (GTS_OBJECT_CLASS (gts_point_class ()))); + triangle_barycenter (GTS_TRIANGLE (guess), o); + fr = point_locate (o, p, guess, surface); + gts_object_destroy (GTS_OBJECT (o)); + + return fr; +} + + +/** + * gts_constraint_class: + * + * Returns: the #GtsConstraintClass. + */ +GtsConstraintClass * gts_constraint_class (void) +{ + static GtsConstraintClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo constraint_info = { + "GtsConstraint", + sizeof (GtsConstraint), + sizeof (GtsConstraintClass), + (GtsObjectClassInitFunc) NULL, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_edge_class ()), + &constraint_info); + } + + return klass; +} + +static void split_list (GtsListFace * f, GtsListFace * f1, GtsListFace * f2, + GtsPoint * p1, GtsPoint * p2, + GSList ** last1, GSList ** last2) +{ + GSList * i = f->points, * l1 = *last1, * l2 = *last2; + + while (i) { + GtsPoint * p = i->data; + + if (gts_point_orientation (p1, p2, p) >= 0.) { + if (l1) l1->next = i; else f1->points = i; + l1 = i; + } + else { + if (l2) l2->next = i; else f2->points = i; + l2 = i; + } + i = i->next; + } + f->points = NULL; + *last1 = l1; + *last2 = l2; +} + +/* cf. figure misc/swap.fig */ +static void swap_if_in_circle (GtsFace * f1, + GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3, + GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3, + GtsSurface * surface) +{ + GtsFace * f2; + GtsEdge * e4, *e5; + GtsVertex * v4; + + if (GTS_IS_CONSTRAINT (e1)) /* @e1 is a constraint can not swap */ + return; + + f2 = neighbor (f1, e1, surface); + if (f2 == NULL) /* @e1 is a boundary of @surface */ + return; + + if (GTS_TRIANGLE (f2)->e1 == e1) { + e4 = GTS_TRIANGLE (f2)->e2; e5 = GTS_TRIANGLE (f2)->e3; + } + else if (GTS_TRIANGLE (f2)->e2 == e1) { + e4 = GTS_TRIANGLE (f2)->e3; e5 = GTS_TRIANGLE (f2)->e1; + } + else { + e4 = GTS_TRIANGLE (f2)->e1; e5 = GTS_TRIANGLE (f2)->e2; + } + if (GTS_SEGMENT (e4)->v1 == GTS_SEGMENT (e1)->v1 || + GTS_SEGMENT (e4)->v1 == GTS_SEGMENT (e1)->v2) + v4 = GTS_SEGMENT (e4)->v2; + else + v4 = GTS_SEGMENT (e4)->v1; + + if (gts_point_in_circle (GTS_POINT (v4), GTS_POINT (v1), + GTS_POINT (v2), GTS_POINT (v3)) > 0.0) { + GtsEdge * en; + GtsSegment * sn = gts_vertices_are_connected (v3, v4); + GtsFace * f3, * f4; + + if (!GTS_IS_EDGE (sn)) + en = gts_edge_new (surface->edge_class, v3, v4); + else + en = GTS_EDGE (sn); + + f3 = gts_face_new (surface->face_class, en, e5, e2); + gts_object_attributes (GTS_OBJECT (f3), GTS_OBJECT (f1)); + f4 = gts_face_new (surface->face_class, en, e3, e4); + gts_object_attributes (GTS_OBJECT (f4), GTS_OBJECT (f2)); + + if (GTS_IS_LIST_FACE (f3)) { + GSList * last3 = NULL, * last4 = NULL; + + if (GTS_IS_LIST_FACE (f1)) + split_list (GTS_LIST_FACE (f1), GTS_LIST_FACE (f3), GTS_LIST_FACE (f4), + GTS_POINT (v3), GTS_POINT (v4), &last3, &last4); + if (GTS_IS_LIST_FACE (f2)) + split_list (GTS_LIST_FACE (f2), GTS_LIST_FACE (f3), GTS_LIST_FACE (f4), + GTS_POINT (v3), GTS_POINT (v4), &last3, &last4); + if (last3) last3->next = NULL; + if (last4) last4->next = NULL; + } + + gts_surface_remove_face (surface, f1); + gts_surface_remove_face (surface, f2); + gts_surface_add_face (surface, f3); + gts_surface_add_face (surface, f4); + + swap_if_in_circle (f3, v4, v2, v3, e5, e2, en, surface); + swap_if_in_circle (f4, v1, v4, v3, e4, en, e3, surface); + } +} + +/** + * gts_delaunay_add_vertex_to_face: + * @surface: a #GtsSurface. + * @v: a #GtsVertex. + * @f: a #GtsFace belonging to @surface. + * + * Adds vertex @v to the face @f of the Delaunay triangulation defined + * by @surface. + * + * Returns: %NULL is @v has been successfully added to @surface or was + * already contained in @surface or a #GtsVertex having the same x and + * y coordinates as @v. + */ +GtsVertex * gts_delaunay_add_vertex_to_face (GtsSurface * surface, + GtsVertex * v, + GtsFace * f) +{ + GtsEdge * e1, * e2, * e3; + GtsSegment * s4, * s5, * s6; + GtsEdge * e4, * e5, * e6; + GtsVertex * v1, * v2, * v3; + GtsFace * nf[3]; + + g_return_val_if_fail (surface != NULL, v); + g_return_val_if_fail (v != NULL, v); + g_return_val_if_fail (f != NULL, v); + + gts_triangle_vertices_edges (GTS_TRIANGLE (f), NULL, + &v1, &v2, &v3, &e1, &e2, &e3); + if (v == v1 || v == v2 || v == v3) /* v already in @surface */ + return NULL; + if (GTS_POINT (v)->x == GTS_POINT (v1)->x && + GTS_POINT (v)->y == GTS_POINT (v1)->y) + return v1; + if (GTS_POINT (v)->x == GTS_POINT (v2)->x && + GTS_POINT (v)->y == GTS_POINT (v2)->y) + return v2; + if (GTS_POINT (v)->x == GTS_POINT (v3)->x && + GTS_POINT (v)->y == GTS_POINT (v3)->y) + return v3; + + s4 = gts_vertices_are_connected (v, v1); + if (!GTS_IS_EDGE (s4)) + e4 = gts_edge_new (surface->edge_class, v, v1); + else + e4 = GTS_EDGE (s4); + s5 = gts_vertices_are_connected (v, v2); + if (!GTS_IS_EDGE (s5)) + e5 = gts_edge_new (surface->edge_class, v, v2); + else + e5 = GTS_EDGE (s5); + s6 = gts_vertices_are_connected (v, v3); + if (!GTS_IS_EDGE (s6)) + e6 = gts_edge_new (surface->edge_class, v, v3); + else + e6 = GTS_EDGE (s6); + + /* cf. figure misc/swap.fig */ + nf[0] = gts_face_new (surface->face_class, e4, e1, e5); + gts_object_attributes (GTS_OBJECT (nf[0]), GTS_OBJECT (f)); + nf[1] = gts_face_new (surface->face_class, e5, e2, e6); + gts_object_attributes (GTS_OBJECT (nf[1]), GTS_OBJECT (f)); + nf[2] = gts_face_new (surface->face_class, e6, e3, e4); + gts_object_attributes (GTS_OBJECT (nf[2]), GTS_OBJECT (f)); + + if (GTS_IS_LIST_FACE (f) && GTS_IS_LIST_FACE (nf[0])) { + GSList * i = GTS_LIST_FACE (f)->points, * last[3] = { NULL, NULL, NULL }; + + while (i) { + GtsPoint * p = i->data; + GSList * next = i->next; + guint j; + + if (p != GTS_POINT (v)) { + if (gts_point_orientation (GTS_POINT (v), GTS_POINT (v1), p) >= 0.) { + gdouble o = gts_point_orientation (GTS_POINT (v), GTS_POINT (v2), p); + + if (o != 0.) + j = o > 0. ? 1 : 0; + else + j = gts_point_orientation (GTS_POINT (v), GTS_POINT (v3), p) + > 0. ? 0 : 1; + } + else if (gts_point_orientation (GTS_POINT (v), GTS_POINT (v3), p) > 0.) + j = 2; + else + j = 1; + if (last[j]) + last[j]->next = i; + else + GTS_LIST_FACE (nf[j])->points = i; + last[j] = i; + } + else + g_slist_free_1 (i); + i = next; + } + GTS_LIST_FACE (f)->points = NULL; + if (last[0]) last[0]->next = NULL; + if (last[1]) last[1]->next = NULL; + if (last[2]) last[2]->next = NULL; + } + + gts_surface_remove_face (surface, f); + gts_surface_add_face (surface, nf[0]); + gts_surface_add_face (surface, nf[1]); + gts_surface_add_face (surface, nf[2]); + + swap_if_in_circle (nf[0], v1, v2, v, e1, e5, e4, surface); + swap_if_in_circle (nf[1], v2, v3, v, e2, e6, e5, surface); + swap_if_in_circle (nf[2], v3, v1, v, e3, e4, e6, surface); + + return NULL; +} + +/** + * gts_delaunay_add_vertex: + * @surface: a #GtsSurface. + * @v: a #GtsVertex. + * @guess: %NULL or a #GtsFace belonging to @surface to be used as an initial + * guess for point location. + * + * Adds vertex @v to the Delaunay triangulation defined by + * @surface. If @v is not contained in the convex hull bounding + * @surface, @v is not added to the triangulation. + * + * Returns: %NULL is @v has been successfully added to @surface or was + * already contained in @surface, @v if @v is not contained in the + * convex hull bounding surface or a #GtsVertex having the same x and + * y coordinates as @v. + */ +GtsVertex * gts_delaunay_add_vertex (GtsSurface * surface, + GtsVertex * v, + GtsFace * guess) +{ + GtsFace * f; + + g_return_val_if_fail (surface != NULL, v); + g_return_val_if_fail (v != NULL, v); + + if (!(f = gts_point_locate (GTS_POINT (v), surface, guess))) + return v; + return gts_delaunay_add_vertex_to_face (surface, v, f); +} + +static gboolean polygon_in_circle (GSList * poly, + GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3) +{ + GtsVertex * v1 = NULL, * v2 = NULL; + + while (poly) { + GtsSegment * s = poly->data; + GtsVertex * v; + v = s->v1; + if (v != v1 && v != v2 && + v != GTS_VERTEX (p1) && + v != GTS_VERTEX (p2) && + v != GTS_VERTEX (p3) && + gts_point_in_circle (GTS_POINT (v), p1, p2, p3) > 0.) + return TRUE; + v = s->v2; + if (v != v1 && v != v2 && + v != GTS_VERTEX (p1) && + v != GTS_VERTEX (p2) && + v != GTS_VERTEX (p3) && + gts_point_in_circle (GTS_POINT (v), p1, p2, p3) > 0.) + return TRUE; + v1 = s->v1; + v2 = s->v2; + poly = poly->next; + } + return FALSE; +} + +static void triangulate_polygon (GSList * poly, + GtsSurface * surface, + GtsFace * ref) +{ + GSList * i, * poly1, * poly2; + GtsVertex * v1, * v2, * v3 = NULL; + gboolean found = FALSE; + GtsSegment * s, * s1, * s2; + GtsEdge * e1, * e2; + GtsFace * f; + + if (poly == NULL || poly->next == NULL) { + g_slist_free (poly); + return; + } + + s = poly->data; + s1 = poly->next->data; + if (s->v1 == s1->v1 || s->v1 == s1->v2) { + v1 = s->v2; + v2 = s->v1; + } + else { + g_assert (s->v2 == s1->v1 || s->v2 == s1->v2); + v1 = s->v1; + v2 = s->v2; + } + + i = poly->next; + v3 = v2; + while (i && !found) { + s1 = i->data; + if (s1->v1 == v3) + v3 = s1->v2; + else { + g_assert (s1->v2 == v3); + v3 = s1->v1; + } + if (v3 != v1 && + gts_point_orientation (GTS_POINT (v1), + GTS_POINT (v2), + GTS_POINT (v3)) >= 0. && + !polygon_in_circle (poly, + GTS_POINT (v1), + GTS_POINT (v2), + GTS_POINT (v3))) + found = TRUE; + else + i = i->next; + } + + if (!found) { + g_slist_free (poly); + return; + } + + s1 = gts_vertices_are_connected (v2, v3); + if (!GTS_IS_EDGE (s1)) + e1 = gts_edge_new (surface->edge_class, v2, v3); + else + e1 = GTS_EDGE (s1); + s2 = gts_vertices_are_connected (v3, v1); + if (!GTS_IS_EDGE (s2)) + e2 = gts_edge_new (surface->edge_class, v3, v1); + else + e2 = GTS_EDGE (s2); + f = gts_face_new (surface->face_class, GTS_EDGE (s), e1, e2); + gts_object_attributes (GTS_OBJECT (f), GTS_OBJECT (ref)); + gts_surface_add_face (surface, f); + + poly1 = poly->next; + g_slist_free_1 (poly); + if (i->next && e2 != i->next->data) + poly2 = g_slist_prepend (i->next, e2); + else + poly2 = i->next; + if (e1 != i->data) + i->next = g_slist_prepend (NULL, e1); + else + i->next = NULL; + + triangulate_polygon (poly1, surface, ref); + triangulate_polygon (poly2, surface, ref); +} + +/** + * gts_delaunay_remove_vertex: + * @surface: a #GtsSurface. + * @v: a #GtsVertex. + * + * Removes @v from the Delaunay triangulation defined by @surface and + * restores the Delaunay property. Vertex @v must not be used by any + * constrained edge otherwise the triangulation is not guaranteed to + * be Delaunay. + */ +void gts_delaunay_remove_vertex (GtsSurface * surface, GtsVertex * v) +{ + GSList * triangles, * i; + GtsFace * ref = NULL; + + g_return_if_fail (surface != NULL); + g_return_if_fail (v != NULL); + + i = triangles = gts_vertex_triangles (v, NULL); + while (i && !ref) { + if (GTS_IS_FACE (i->data) && + gts_face_has_parent_surface (i->data, surface)) + ref = i->data; + i = i->next; + } + if (!ref) { + g_slist_free (triangles); + g_return_if_fail (ref); + } + triangulate_polygon (gts_vertex_fan_oriented (v, surface), surface, ref); + i = triangles; + while (i) { + if (GTS_IS_FACE (i->data) && + gts_face_has_parent_surface (i->data, surface)) + gts_surface_remove_face (surface, i->data); + i = i->next; + } + g_slist_free (triangles); +} + +#define NEXT_CUT(edge, edge1, list) { next = neighbor (f, edge, surface);\ + remove_triangles (e, surface);\ + if (!constraint && !e->triangles)\ + gts_object_destroy (GTS_OBJECT (e));\ + g_assert (next);\ + *list = g_slist_prepend (*list, edge1);\ + return g_slist_concat (constraint,\ + remove_intersected_edge (s, edge,\ + next, surface, left, right));\ + } + +static void remove_triangles (GtsEdge * e, GtsSurface * s) +{ + GSList * i = e->triangles; + + while (i) { + GSList * next = i->next; + + if (GTS_IS_FACE (i->data) && gts_face_has_parent_surface (i->data, s)) + gts_surface_remove_face (s, i->data); + i = next; + } +} + +static GSList * +remove_intersected_edge (GtsSegment * s, + GtsEdge * e, + GtsFace * f, + GtsSurface * surface, + GSList ** left, GSList ** right) +{ + GtsVertex * v1, * v2, * v3; + GtsEdge * e1, * e2; + gdouble o1, o2; + GtsFace * next; + GSList * constraint = NULL; + + if (GTS_IS_CONSTRAINT (e)) + constraint = g_slist_prepend (NULL, e); + + gts_triangle_vertices_edges (GTS_TRIANGLE (f), e, + &v1, &v2, &v3, &e, &e1, &e2); + + o1 = gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), + GTS_POINT (s->v2)); + o2 = gts_point_orientation (GTS_POINT (v3), GTS_POINT (v1), + GTS_POINT (s->v2)); + + if (o1 == 0. && o2 == 0.) { +/* if(o2 != 0.) { + fprintf(stderr, "o1 = %f o2 = %f\n", o1, o2); + fprintf(stderr, "v1 = %f, %f\n", GTS_POINT(v1)->x, GTS_POINT(v1)->y); + fprintf(stderr, "v2 = %f, %f\n", GTS_POINT(v2)->x, GTS_POINT(v2)->y); + fprintf(stderr, "v3 = %f, %f\n", GTS_POINT(v3)->x, GTS_POINT(v3)->y); + fprintf(stderr, "s->v2 = %f, %f\n", GTS_POINT(s->v2)->x, GTS_POINT(s->v2)->y); + + g_assert (o2 == 0.); + }*/ + // if(o2 == 0.) { + remove_triangles (e, surface); + if (!constraint && !e->triangles) + gts_object_destroy (GTS_OBJECT (e)); + *left = g_slist_prepend (*left, e2); + *right = g_slist_prepend (*right, e1); +// } + } + else if (o1 > 0.) { + g_assert (o2 <= 0.); + NEXT_CUT (e2, e1, right) + } + else if (o2 >= 0.) + NEXT_CUT (e1, e2, left) + else { + gdouble o3 = gts_point_orientation (GTS_POINT (s->v1), GTS_POINT (s->v2), + GTS_POINT (v3)); + if (o3 > 0.) + NEXT_CUT (e1, e2, left) + else + NEXT_CUT (e2, e1, right) + } + return constraint; +} + +static GSList * +remove_intersected_vertex (GtsSegment * s, + GtsVertex * v, + GtsSurface * surface, + GSList ** left, + GSList ** right, + GtsFace ** ref) +{ + GSList * triangles = gts_vertex_triangles (v, NULL); + GSList * i; + + i = triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_IS_FACE (t) && + gts_face_has_parent_surface (GTS_FACE (t), surface)) { + GtsVertex * v1, * v2, * v3; + gdouble o1, o2; + + gts_triangle_vertices (t, &v1, &v2, &v3); + if (v == v2) { + v2 = v3; + v3 = v1; + } + else if (v == v3) { + v3 = v2; + v2 = v1; + } + else + g_assert (v == v1); + + if ((o1 = gts_point_orientation (GTS_POINT (v), GTS_POINT (v2), + GTS_POINT (s->v2))) >= 0. && + (o2 = gts_point_orientation (GTS_POINT (v3), GTS_POINT (v), + GTS_POINT (s->v2))) >= 0.) { + gdouble o3 = gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), + GTS_POINT (s->v2)); + GtsEdge * e = gts_triangle_edge_opposite (t, v); + GtsEdge * e1, * e2; + GtsFace * next = neighbor (GTS_FACE (t), e, surface); + + *ref = GTS_FACE (t); + gts_triangle_vertices_edges (t, e, &v2, &v3, &v, &e, &e2, &e1); + + g_slist_free (triangles); + + if (o3 >= 0.) /* @s->v2 is inside (or on the edge) of t */ + return NULL; + + gts_allow_floating_faces = TRUE; + gts_surface_remove_face (surface, GTS_FACE (t)); + gts_allow_floating_faces = FALSE; + + *left = g_slist_prepend (*left, e2); + *right = g_slist_prepend (*right, e1); + + g_assert (next); + return remove_intersected_edge (s, e, next, surface, left, right); + } + } + i = i->next; + } + + g_assert_not_reached (); + return NULL; +} + +/** + * gts_delaunay_add_constraint: + * @surface: a #GtsSurface. + * @c: a #GtsConstraint. + * + * Add constraint @c to the constrained Delaunay triangulation defined by + * @surface. + * + * Returns: a list of #GtsConstraint conflicting (i.e. intersecting) with @c + * which were removed from @surface (%NULL if there was none). + */ +GSList * gts_delaunay_add_constraint (GtsSurface * surface, + GtsConstraint * c) +{ + GSList * constraints; + GtsVertex * v1; //, * v2; + GSList * left = NULL, * right = NULL; + GtsFace * ref = NULL; + + g_return_val_if_fail (surface != NULL, NULL); + g_return_val_if_fail (c != NULL, NULL); + g_return_val_if_fail (GTS_IS_CONSTRAINT (c), NULL); + + v1 = GTS_SEGMENT (c)->v1; + //v2 = GTS_SEGMENT (c)->v2; + + gts_allow_floating_edges = TRUE; + constraints = remove_intersected_vertex (GTS_SEGMENT (c), v1, surface, + &left, &right, &ref); + gts_allow_floating_edges = FALSE; +#if 1 + triangulate_polygon (g_slist_prepend (g_slist_reverse (right), c), + surface, ref); + triangulate_polygon (g_slist_prepend (left, c), + surface, ref); +#else + right = g_slist_prepend (g_slist_reverse (right), c); + left = g_slist_prepend (left, c); + { + FILE * fp0 = fopen ("hole", "wt"); + FILE * fp1 = fopen ("right", "wt"); + FILE * fp2 = fopen ("left", "wt"); + GSList * i = left; + + gts_surface_write (surface, fp0); + fclose (fp0); + + fprintf (fp2, "LIST {\n"); + while (i) { + GtsSegment * s = i->data; + fprintf (fp2, + "# %p: %p->%p\n" + "VECT 1 2 0 2 0 %g %g 0 %g %g 0\n", + s, s->v1, s->v2, + GTS_POINT (s->v1)->x, GTS_POINT (s->v1)->y, + GTS_POINT (s->v2)->x, GTS_POINT (s->v2)->y); + i = i->next; + } + fprintf (fp2, "}\n"); + fprintf (fp1, "LIST {\n"); + i = right; + while (i) { + GtsSegment * s = i->data; + fprintf (fp1, + "# %p: %p->%p\n" + "VECT 1 2 0 2 0 %g %g 0 %g %g 0\n", + s, s->v1, s->v2, + GTS_POINT (s->v1)->x, GTS_POINT (s->v1)->y, + GTS_POINT (s->v2)->x, GTS_POINT (s->v2)->y); + i = i->next; + } + fprintf (fp1, "}\n"); + fclose (fp1); + fclose (fp2); + } + triangulate_polygon (right, surface); + triangulate_polygon (left, surface); +#endif + if (ref && !ref->surfaces) { + gts_allow_floating_edges = TRUE; + gts_object_destroy (GTS_OBJECT (ref)); + gts_allow_floating_edges = FALSE; + } + return constraints; +} + +static void delaunay_check (GtsTriangle * t, gpointer * data) +{ + GtsSurface * surface = data[0]; + GtsFace ** face = data[1]; + + if (*face == NULL) { + GSList * i, * list; + GtsVertex * v1, * v2, * v3; + + gts_triangle_vertices (t, &v1, &v2, &v3); + list = gts_vertex_neighbors (v1, NULL, surface); + list = gts_vertex_neighbors (v2, list, surface); + list = gts_vertex_neighbors (v3, list, surface); + i = list; + while (i && *face == NULL) { + GtsVertex * v = i->data; + if (v != v1 && v != v2 && v != v3 && + gts_point_in_circle (GTS_POINT (v), + GTS_POINT (v1), + GTS_POINT (v2), + GTS_POINT (v3)) > 0.) + *face = GTS_FACE (t); + i = i->next; + } + g_slist_free (list); + } +} + +/** + * gts_delaunay_check: + * @surface: a #GtsSurface. + * + * Returns: %NULL if the planar projection of @surface is a Delaunay + * triangulation (unconstrained), a #GtsFace violating the Delaunay + * property otherwise. + */ +GtsFace * gts_delaunay_check (GtsSurface * surface) +{ + GtsFace * face = NULL; + gpointer data[2]; + + g_return_val_if_fail (surface != NULL, FALSE); + + data[0] = surface; + data[1] = &face; + gts_surface_foreach_face (surface, (GtsFunc) delaunay_check, data); + + return face; +} + +/** + * gts_delaunay_remove_hull: + * @surface: a #GtsSurface. + * + * Removes all the edges of the boundary of @surface which are not + * constraints. + */ +void gts_delaunay_remove_hull (GtsSurface * surface) +{ + GSList * boundary; + + g_return_if_fail (surface != NULL); + + boundary = gts_surface_boundary (surface); + gts_allow_floating_edges = TRUE; + while (boundary) { + GSList * i = boundary; + GtsEdge * e = i->data; + + boundary = i->next; + g_slist_free_1 (i); + if (!GTS_IS_CONSTRAINT (e)) { + GtsTriangle * t = GTS_TRIANGLE (gts_edge_is_boundary (e, surface)); + + if (t != NULL) { + if (t->e1 != e && !GTS_IS_CONSTRAINT (t->e1) && + !gts_edge_is_boundary (t->e1, surface)) + boundary = g_slist_prepend (boundary, t->e1); + if (t->e2 != e && !GTS_IS_CONSTRAINT (t->e2) && + !gts_edge_is_boundary (t->e2, surface)) + boundary = g_slist_prepend (boundary, t->e2); + if (t->e3 != e && !GTS_IS_CONSTRAINT (t->e3) && + !gts_edge_is_boundary (t->e3, surface)) + boundary = g_slist_prepend (boundary, t->e3); + gts_surface_remove_face (surface, GTS_FACE (t)); + } + if (!e->triangles) + gts_object_destroy (GTS_OBJECT (e)); + } + } + gts_allow_floating_edges = FALSE; +} + +/* GtsListFace: Object */ + +static void gts_list_face_destroy (GtsObject * object) +{ + g_slist_free (GTS_LIST_FACE (object)->points); + + (* GTS_OBJECT_CLASS (gts_list_face_class ())->parent_class->destroy) + (object); +} + +static void gts_list_face_class_init (GtsFaceClass * klass) +{ + GTS_OBJECT_CLASS (klass)->destroy = gts_list_face_destroy; +} + +GtsFaceClass * gts_list_face_class (void) +{ + static GtsFaceClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo gts_list_face_info = { + "GtsListFace", + sizeof (GtsListFace), + sizeof (GtsFaceClass), + (GtsObjectClassInitFunc) gts_list_face_class_init, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_face_class ()), + >s_list_face_info); + } + + return klass; +} Index: tags/1.0.5/gts/container.c =================================================================== --- tags/1.0.5/gts/container.c (nonexistent) +++ tags/1.0.5/gts/container.c (revision 953) @@ -0,0 +1,493 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +/* GtsContainee */ + +static void containee_class_init (GtsContaineeClass * klass) +{ + klass->remove_container = NULL; + klass->add_container = NULL; + klass->foreach = NULL; + klass->is_contained = NULL; + klass->replace = NULL; +} + +GtsContaineeClass * gts_containee_class (void) +{ + static GtsContaineeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo containee_info = { + "GtsContainee", + sizeof (GtsContainee), + sizeof (GtsContaineeClass), + (GtsObjectClassInitFunc) containee_class_init, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), + &containee_info); + } + + return klass; +} + +GtsContainee * gts_containee_new (GtsContaineeClass * klass) +{ + GtsContainee * object; + + object = GTS_CONTAINEE (gts_object_new (GTS_OBJECT_CLASS (klass))); + + return object; +} + +gboolean gts_containee_is_contained (GtsContainee * item, + GtsContainer * c) +{ + g_return_val_if_fail (item != NULL, FALSE); + g_return_val_if_fail (c != NULL, FALSE); + + if (GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->is_contained) + return + (* GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->is_contained) + (item, c); + return FALSE; +} + +void gts_containee_replace (GtsContainee * item, + GtsContainee * with) +{ + if (GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->replace) + (* GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->replace) (item, with); + if (GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->foreach) { + (* GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->foreach) + (item, (GtsFunc) gts_container_add, with); + (* GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->foreach) + (item, (GtsFunc) gts_container_remove, item); + } +} + +/* GtsSListContainee */ + +static void slist_containee_destroy (GtsObject * object) +{ + GtsSListContainee * item = GTS_SLIST_CONTAINEE (object); + GSList * i; + + i = item->containers; + while (i) { + GSList * next = i->next; + + gts_container_remove (i->data, GTS_CONTAINEE (item)); + i = next; + } + g_assert (item->containers == NULL); + + (* GTS_OBJECT_CLASS (gts_slist_containee_class ())->parent_class->destroy) + (object); +} + +static void slist_containee_remove_container (GtsContainee * i, + GtsContainer * c) +{ + GtsSListContainee * item = GTS_SLIST_CONTAINEE (i); + item->containers = g_slist_remove (item->containers, c); +} + +static void slist_containee_add_container (GtsContainee * i, + GtsContainer * c) +{ + GtsSListContainee * item = GTS_SLIST_CONTAINEE (i); + if (!g_slist_find (item->containers, c)) + item->containers = g_slist_prepend (item->containers, c); +} + +static void slist_containee_foreach (GtsContainee * c, + GtsFunc func, + gpointer data) +{ + GSList * i = GTS_SLIST_CONTAINEE (c)->containers; + + while (i) { + GSList * next = i->next; + + (* func) (i->data, data); + i = next; + } +} + +static gboolean slist_containee_is_contained (GtsContainee * i, + GtsContainer * c) +{ + return g_slist_find (GTS_SLIST_CONTAINEE (i)->containers, c) ? TRUE : FALSE; +} + +static void slist_containee_class_init (GtsSListContaineeClass * klass) +{ + GTS_CONTAINEE_CLASS (klass)->remove_container = + slist_containee_remove_container; + GTS_CONTAINEE_CLASS (klass)->add_container = + slist_containee_add_container; + GTS_CONTAINEE_CLASS (klass)->foreach = + slist_containee_foreach; + GTS_CONTAINEE_CLASS (klass)->is_contained = + slist_containee_is_contained; + + GTS_OBJECT_CLASS (klass)->destroy = slist_containee_destroy; +} + +static void slist_containee_init (GtsSListContainee * object) +{ + object->containers = NULL; +} + +GtsSListContaineeClass * gts_slist_containee_class (void) +{ + static GtsSListContaineeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo slist_containee_info = { + "GtsSListContainee", + sizeof (GtsSListContainee), + sizeof (GtsSListContaineeClass), + (GtsObjectClassInitFunc) slist_containee_class_init, + (GtsObjectInitFunc) slist_containee_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_containee_class ()), + &slist_containee_info); + } + + return klass; +} + +/* GtsContainer */ + +static void remove_container (GtsContainee * item, GtsContainer * c) +{ + if (GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->remove_container) + (* GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->remove_container) + (item, c); +} + +static void container_destroy (GtsObject * object) +{ + GtsContainer * c = GTS_CONTAINER (object); + + gts_container_foreach (c, (GtsFunc) remove_container, c); + + (* GTS_OBJECT_CLASS (gts_container_class ())->parent_class->destroy) + (object); +} + +static void container_add (GtsContainer * c, GtsContainee * item) +{ + if (GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->add_container) + (* GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->add_container) + (item, c); +} + +static void container_remove (GtsContainer * c, GtsContainee * item) +{ + if (GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->remove_container) + (* GTS_CONTAINEE_CLASS (GTS_OBJECT (item)->klass)->remove_container) + (item, c); +} + +static void container_clone_add (GtsContainee * item, GtsContainer * clone) +{ + gts_container_add (clone, item); +} + +static void container_clone (GtsObject * clone, GtsObject * object) +{ + gts_object_init (clone, object->klass); + gts_container_foreach (GTS_CONTAINER (object), + (GtsFunc) container_clone_add, clone); +} + +static void container_class_init (GtsContainerClass * klass) +{ + klass->add = container_add; + klass->remove = container_remove; + klass->foreach = NULL; + klass->size = NULL; + + GTS_OBJECT_CLASS (klass)->destroy = container_destroy; + GTS_OBJECT_CLASS (klass)->clone = container_clone; +} + +GtsContainerClass * gts_container_class (void) +{ + static GtsContainerClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo container_info = { + "GtsContainer", + sizeof (GtsContainer), + sizeof (GtsContainerClass), + (GtsObjectClassInitFunc) container_class_init, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = + gts_object_class_new (GTS_OBJECT_CLASS (gts_slist_containee_class ()), + &container_info); + } + + return klass; +} + +GtsContainer * gts_container_new (GtsContainerClass * klass) +{ + GtsContainer * object; + + object = GTS_CONTAINER (gts_object_new (GTS_OBJECT_CLASS (klass))); + + return object; +} + +void gts_container_add (GtsContainer * c, + GtsContainee * item) +{ + g_return_if_fail (c != NULL); + g_return_if_fail (item != NULL); + + g_assert (GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->add); + (* GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->add) (c, item); +} + +void gts_container_remove (GtsContainer * c, + GtsContainee * item) +{ + g_return_if_fail (c != NULL); + g_return_if_fail (item != NULL); + + g_assert (GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->remove); + (* GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->remove) (c, item); +} + +void gts_container_foreach (GtsContainer * c, + GtsFunc func, + gpointer data) +{ + g_return_if_fail (c != NULL); + g_return_if_fail (func != NULL); + + if (GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->foreach) + (* GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->foreach) (c, func, data); +} + +guint gts_container_size (GtsContainer * c) +{ + g_return_val_if_fail (c != NULL, 0); + + if (GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->size) + return (* GTS_CONTAINER_CLASS (GTS_OBJECT (c)->klass)->size) (c); + return 0; +} + +/* GtsHashContainer */ + +static void hash_container_destroy (GtsObject * object) +{ + GHashTable * items = GTS_HASH_CONTAINER (object)->items; + + (* GTS_OBJECT_CLASS (gts_hash_container_class ())->parent_class->destroy) + (object); + + g_hash_table_destroy (items); +} + +static void hash_container_add (GtsContainer * c, GtsContainee * item) +{ + g_return_if_fail (GTS_HASH_CONTAINER (c)->frozen == FALSE); + + g_hash_table_insert (GTS_HASH_CONTAINER (c)->items, item, NULL); + + (* GTS_CONTAINER_CLASS (GTS_OBJECT_CLASS (gts_hash_container_class ())->parent_class)->add) (c, item); +} + +static void hash_container_remove (GtsContainer * c, GtsContainee * item) +{ + g_return_if_fail (GTS_HASH_CONTAINER (c)->frozen == FALSE); + + g_hash_table_remove (GTS_HASH_CONTAINER (c)->items, item); + + (* GTS_CONTAINER_CLASS (GTS_OBJECT_CLASS (gts_hash_container_class ())->parent_class)->remove) (c, item); +} + +static void hash_foreach (GtsContainee * item, + gpointer item_data, + gpointer * info) +{ + (* ((GtsFunc) info[0])) (item, info[1]); +} + +static void hash_container_foreach (GtsContainer * c, + GtsFunc func, + gpointer data) +{ + gpointer info[2]; + + info[0] = func; + info[1] = data; + /* prevent removing or adding items */ + GTS_HASH_CONTAINER (c)->frozen = TRUE; + g_hash_table_foreach (GTS_HASH_CONTAINER (c)->items, + (GHFunc) hash_foreach, info); + GTS_HASH_CONTAINER (c)->frozen = FALSE; +} + +static guint hash_container_size (GtsContainer * c) +{ + return g_hash_table_size (GTS_HASH_CONTAINER (c)->items); +} + +static void hash_container_class_init (GtsHashContainerClass * klass) +{ + GTS_CONTAINER_CLASS (klass)->add = hash_container_add; + GTS_CONTAINER_CLASS (klass)->remove = hash_container_remove; + GTS_CONTAINER_CLASS (klass)->foreach = hash_container_foreach; + GTS_CONTAINER_CLASS (klass)->size = hash_container_size; + + GTS_OBJECT_CLASS (klass)->destroy = hash_container_destroy; +} + +static void hash_container_init (GtsHashContainer * object) +{ + object->items = g_hash_table_new (NULL, NULL); + object->frozen = FALSE; +} + +GtsHashContainerClass * gts_hash_container_class (void) +{ + static GtsHashContainerClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo hash_container_info = { + "GtsHashContainer", + sizeof (GtsHashContainer), + sizeof (GtsHashContainerClass), + (GtsObjectClassInitFunc) hash_container_class_init, + (GtsObjectInitFunc) hash_container_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_container_class ()), + &hash_container_info); + } + + return klass; +} + +/* GtsSListContainer */ + +static void slist_container_destroy (GtsObject * object) +{ + GSList * items = GTS_SLIST_CONTAINER (object)->items; + + (* GTS_OBJECT_CLASS (gts_slist_container_class ())->parent_class->destroy) + (object); + + g_slist_free (items); +} + +static void slist_container_add (GtsContainer * c, GtsContainee * item) +{ + g_return_if_fail (GTS_SLIST_CONTAINER (c)->frozen == FALSE); + + if (!g_slist_find (GTS_SLIST_CONTAINER (c)->items, item)) + GTS_SLIST_CONTAINER (c)->items = + g_slist_prepend (GTS_SLIST_CONTAINER (c)->items, item); + + (* GTS_CONTAINER_CLASS (GTS_OBJECT_CLASS (gts_slist_container_class ())->parent_class)->add) (c, item); +} + +static void slist_container_remove (GtsContainer * c, GtsContainee * item) +{ + g_return_if_fail (GTS_SLIST_CONTAINER (c)->frozen == FALSE); + + GTS_SLIST_CONTAINER (c)->items = + g_slist_remove (GTS_SLIST_CONTAINER (c)->items, item); + + (* GTS_CONTAINER_CLASS (GTS_OBJECT_CLASS (gts_slist_container_class ())->parent_class)->remove) (c, item); +} + +static void slist_container_foreach (GtsContainer * c, + GtsFunc func, + gpointer data) +{ + GSList * i; + + i = GTS_SLIST_CONTAINER (c)->items; + while (i) { + GSList * next = i->next; + + (* func) (i->data, data); + i = next; + } +} + +static guint slist_container_size (GtsContainer * c) +{ + return g_slist_length (GTS_SLIST_CONTAINER (c)->items); +} + +static void slist_container_class_init (GtsSListContainerClass * klass) +{ + GTS_CONTAINER_CLASS (klass)->add = slist_container_add; + GTS_CONTAINER_CLASS (klass)->remove = slist_container_remove; + GTS_CONTAINER_CLASS (klass)->foreach = slist_container_foreach; + GTS_CONTAINER_CLASS (klass)->size = slist_container_size; + + GTS_OBJECT_CLASS (klass)->destroy = slist_container_destroy; +} + +static void slist_container_init (GtsSListContainer * object) +{ + object->items = NULL; + object->frozen = FALSE; +} + +GtsSListContainerClass * gts_slist_container_class (void) +{ + static GtsSListContainerClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo slist_container_info = { + "GtsSListContainer", + sizeof (GtsSListContainer), + sizeof (GtsSListContainerClass), + (GtsObjectClassInitFunc) slist_container_class_init, + (GtsObjectInitFunc) slist_container_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_container_class ()), + &slist_container_info); + } + + return klass; +} Index: tags/1.0.5/gts/curvature.c =================================================================== --- tags/1.0.5/gts/curvature.c (nonexistent) +++ tags/1.0.5/gts/curvature.c (revision 953) @@ -0,0 +1,621 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999-2002 Ray Jones, Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +static gboolean angle_obtuse (GtsVertex * v, GtsFace * f) +{ + GtsEdge * e = gts_triangle_edge_opposite (GTS_TRIANGLE (f), v); + GtsVector vec1, vec2; + + gts_vector_init (vec1, GTS_POINT (v), GTS_POINT (GTS_SEGMENT (e)->v1)); + gts_vector_init (vec2, GTS_POINT (v), GTS_POINT (GTS_SEGMENT (e)->v2)); + + return (gts_vector_scalar (vec1, vec2) < 0.0); +} + +static gboolean triangle_obtuse (GtsVertex * v, GtsFace * f) +{ + GtsEdge * e = gts_triangle_edge_opposite (GTS_TRIANGLE (f), v); + + return (angle_obtuse (v, f) || + angle_obtuse (GTS_SEGMENT (e)->v1, f) || + angle_obtuse (GTS_SEGMENT (e)->v2, f)); +} + +static gdouble cotan (GtsVertex * vo, GtsVertex * v1, GtsVertex * v2) +{ + /* cf. Appendix B of [Meyer et al 2002] */ + GtsVector u, v; + gdouble udotv, denom; + + gts_vector_init (u, GTS_POINT (vo), GTS_POINT (v1)); + gts_vector_init (v, GTS_POINT (vo), GTS_POINT (v2)); + + udotv = gts_vector_scalar (u, v); + denom = sqrt (gts_vector_scalar (u,u)*gts_vector_scalar (v,v) - + udotv*udotv); + + + /* denom can be zero if u==v. Returning 0 is acceptable, based on + * the callers of this function below. */ + if (denom == 0.0) return (0.0); + + return (udotv/denom); +} + +static gdouble angle_from_cotan (GtsVertex * vo, + GtsVertex * v1, GtsVertex * v2) +{ + /* cf. Appendix B and the caption of Table 1 from [Meyer et al 2002] */ + GtsVector u, v; + gdouble udotv, denom; + + gts_vector_init (u, GTS_POINT (vo), GTS_POINT (v1)); + gts_vector_init (v, GTS_POINT (vo), GTS_POINT (v2)); + + udotv = gts_vector_scalar (u, v); + denom = sqrt (gts_vector_scalar (u,u)*gts_vector_scalar (v,v) + - udotv*udotv); + + /* Note: I assume this is what they mean by using atan2 (). -Ray Jones */ + + /* tan = denom/udotv = y/x (see man page for atan2) */ + return (fabs (atan2 (denom, udotv))); +} + +static gdouble region_area (GtsVertex * v, GtsFace * f) +{ + /* cf. Section 3.3 of [Meyer et al 2002] */ + + if (gts_triangle_area (GTS_TRIANGLE (f)) == 0.0) return (0.0); + + if (triangle_obtuse (v, f)) { + if (angle_obtuse (v, f)) + return (gts_triangle_area (GTS_TRIANGLE (f))/2.0); + else + return (gts_triangle_area (GTS_TRIANGLE (f))/4.0); + } else { + GtsEdge * e = gts_triangle_edge_opposite (GTS_TRIANGLE (f), v); + + return ((cotan (GTS_SEGMENT (e)->v1, v, GTS_SEGMENT (e)->v2)* + gts_point_distance2 (GTS_POINT (v), + GTS_POINT (GTS_SEGMENT (e)->v2)) + + cotan (GTS_SEGMENT (e)->v2, v, GTS_SEGMENT (e)->v1)* + gts_point_distance2 (GTS_POINT (v), + GTS_POINT (GTS_SEGMENT (e)->v1))) + /8.0); + } +} + +/** + * gts_vertex_mean_curvature_normal: + * @v: a #GtsVertex. + * @s: a #GtsSurface. + * @Kh: the Mean Curvature Normal at @v. + * + * Computes the Discrete Mean Curvature Normal approximation at @v. + * The mean curvature at @v is half the magnitude of the vector @Kh. + * + * Note: the normal computed is not unit length, and may point either + * into or out of the surface, depending on the curvature at @v. It + * is the responsibility of the caller of the function to use the mean + * curvature normal appropriately. + * + * This approximation is from the paper: + * Discrete Differential-Geometry Operators for Triangulated 2-Manifolds + * Mark Meyer, Mathieu Desbrun, Peter Schroder, Alan H. Barr + * VisMath '02, Berlin (Germany) + * http://www-grail.usc.edu/pubs.html + * + * Returns: %TRUE if the operator could be evaluated, %FALSE if the + * evaluation failed for some reason (@v is boundary or is the + * endpoint of a non-manifold edge.) + */ +gboolean gts_vertex_mean_curvature_normal (GtsVertex * v, GtsSurface * s, + GtsVector Kh) +{ + GSList * faces, * edges, * i; + gdouble area = 0.0; + + g_return_val_if_fail (v != NULL, FALSE); + g_return_val_if_fail (s != NULL, FALSE); + + /* this operator is not defined for boundary edges */ + if (gts_vertex_is_boundary (v, s)) return (FALSE); + + faces = gts_vertex_faces (v, s, NULL); + g_return_val_if_fail (faces != NULL, FALSE); + + edges = gts_vertex_fan_oriented (v, s); + if (edges == NULL) { + g_slist_free (faces); + return (FALSE); + } + + i = faces; + while (i) { + GtsFace * f = i->data; + + area += region_area (v, f); + i = i->next; + } + g_slist_free (faces); + + Kh[0] = Kh[1] = Kh[2] = 0.0; + + i = edges; + while (i) { + GtsEdge * e = i->data; + GtsVertex * v1 = GTS_SEGMENT (e)->v1; + GtsVertex * v2 = GTS_SEGMENT (e)->v2; + gdouble temp; + + temp = cotan (v1, v, v2); + Kh[0] += temp*(GTS_POINT (v2)->x - GTS_POINT (v)->x); + Kh[1] += temp*(GTS_POINT (v2)->y - GTS_POINT (v)->y); + Kh[2] += temp*(GTS_POINT (v2)->z - GTS_POINT (v)->z); + + temp = cotan (v2, v, v1); + Kh[0] += temp*(GTS_POINT (v1)->x - GTS_POINT (v)->x); + Kh[1] += temp*(GTS_POINT (v1)->y - GTS_POINT (v)->y); + Kh[2] += temp*(GTS_POINT (v1)->z - GTS_POINT (v)->z); + + i = i->next; + } + g_slist_free (edges); + + if (area > 0.0) { + Kh[0] /= 2*area; + Kh[1] /= 2*area; + Kh[2] /= 2*area; + } else { + return (FALSE); + } + + return TRUE; +} + +/** + * gts_vertex_gaussian_curvature: + * @v: a #GtsVertex. + * @s: a #GtsSurface. + * @Kg: the Discrete Gaussian Curvature approximation at @v. + * + * Computes the Discrete Gaussian Curvature approximation at @v. + * + * This approximation is from the paper: + * Discrete Differential-Geometry Operators for Triangulated 2-Manifolds + * Mark Meyer, Mathieu Desbrun, Peter Schroder, Alan H. Barr + * VisMath '02, Berlin (Germany) + * http://www-grail.usc.edu/pubs.html + * + * Returns: %TRUE if the operator could be evaluated, %FALSE if the + * evaluation failed for some reason (@v is boundary or is the + * endpoint of a non-manifold edge.) + */ +gboolean gts_vertex_gaussian_curvature (GtsVertex * v, GtsSurface * s, + gdouble * Kg) +{ + GSList * faces, * edges, * i; + gdouble area = 0.0; + gdouble angle_sum = 0.0; + + g_return_val_if_fail (v != NULL, FALSE); + g_return_val_if_fail (s != NULL, FALSE); + g_return_val_if_fail (Kg != NULL, FALSE); + + /* this operator is not defined for boundary edges */ + if (gts_vertex_is_boundary (v, s)) return (FALSE); + + faces = gts_vertex_faces (v, s, NULL); + g_return_val_if_fail (faces != NULL, FALSE); + + edges = gts_vertex_fan_oriented (v, s); + if (edges == NULL) { + g_slist_free (faces); + return (FALSE); + } + + i = faces; + while (i) { + GtsFace * f = i->data; + + area += region_area (v, f); + i = i->next; + } + g_slist_free (faces); + + i = edges; + while (i) { + GtsEdge * e = i->data; + GtsVertex * v1 = GTS_SEGMENT (e)->v1; + GtsVertex * v2 = GTS_SEGMENT (e)->v2; + + angle_sum += angle_from_cotan (v, v1, v2); + i = i->next; + } + g_slist_free (edges); + + *Kg = (2.0*M_PI - angle_sum)/area; + + return TRUE; +} + +/** + * gts_vertex_principal_curvatures: + * @Kh: mean curvature. + * @Kg: Gaussian curvature. + * @K1: first principal curvature. + * @K2: second principal curvature. + * + * Computes the principal curvatures at a point given the mean and + * Gaussian curvatures at that point. + * + * The mean curvature can be computed as one-half the magnitude of the + * vector computed by gts_vertex_mean_curvature_normal(). + * + * The Gaussian curvature can be computed with + * gts_vertex_gaussian_curvature(). + */ +void gts_vertex_principal_curvatures (gdouble Kh, gdouble Kg, + gdouble * K1, gdouble * K2) +{ + gdouble temp = Kh*Kh - Kg; + + g_return_if_fail (K1 != NULL); + g_return_if_fail (K2 != NULL); + + if (temp < 0.0) temp = 0.0; + temp = sqrt (temp); + *K1 = Kh + temp; + *K2 = Kh - temp; +} + +/* from Maple */ +static void linsolve (gdouble m11, gdouble m12, gdouble b1, + gdouble m21, gdouble m22, gdouble b2, + gdouble * x1, gdouble * x2) +{ + gdouble temp; + + temp = 1.0 / (m21*m12 - m11*m22); + *x1 = (m12*b2 - m22*b1)*temp; + *x2 = (m11*b2 - m21*b1)*temp; +} + +/* from Maple - largest eigenvector of [a b; b c] */ +static void eigenvector (gdouble a, gdouble b, gdouble c, + GtsVector e) +{ + if (b == 0.0) { + e[0] = 0.0; + } else { + e[0] = -(c - a - sqrt (c*c - 2*a*c + a*a + 4*b*b))/(2*b); + } + e[1] = 1.0; + e[2] = 0.0; +} + +/** + * gts_vertex_principal_directions: + * @v: a #GtsVertex. + * @s: a #GtsSurface. + * @Kh: mean curvature normal (a #GtsVector). + * @Kg: Gaussian curvature (a gdouble). + * @e1: first principal curvature direction (direction of largest curvature). + * @e2: second principal curvature direction. + * + * Computes the principal curvature directions at a point given @Kh + * and @Kg, the mean curvature normal and Gaussian curvatures at that + * point, computed with gts_vertex_mean_curvature_normal() and + * gts_vertex_gaussian_curvature(), respectively. + * + * Note that this computation is very approximate and tends to be + * unstable. Smoothing of the surface or the principal directions may + * be necessary to achieve reasonable results. + */ +void gts_vertex_principal_directions (GtsVertex * v, GtsSurface * s, + GtsVector Kh, gdouble Kg, + GtsVector e1, GtsVector e2) +{ + GtsVector N; + gdouble normKh; + GSList * i, * j; + GtsVector basis1, basis2, d, eig; + gdouble ve2, vdotN; + gdouble aterm_da, bterm_da, cterm_da, const_da; + gdouble aterm_db, bterm_db, cterm_db, const_db; + gdouble a, b, c; + gdouble K1, K2; + gdouble *weights, *kappas, *d1s, *d2s; + gint edge_count; + gdouble err_e1, err_e2; + int e; + + /* compute unit normal */ + normKh = sqrt (gts_vector_scalar (Kh, Kh)); + + if (normKh > 0.0) { + N[0] = Kh[0] / normKh; + N[1] = Kh[1] / normKh; + N[2] = Kh[2] / normKh; + } else { + /* This vertex is a point of zero mean curvature (flat or saddle + * point). Compute a normal by averaging the adjacent triangles + */ + N[0] = N[1] = N[2] = 0.0; + i = gts_vertex_faces (v, s, NULL); + while (i) { + gdouble x, y, z; + gts_triangle_normal (GTS_TRIANGLE ((GtsFace *) i->data), + &x, &y, &z); + N[0] += x; + N[1] += y; + N[2] += z; + + i = i->next; + } + g_return_if_fail (gts_vector_norm (N) > 0.0); + gts_vector_normalize (N); + } + + + /* construct a basis from N: */ + /* set basis1 to any component not the largest of N */ + basis1[0] = basis1[1] = basis1[2] = 0.0; + if (fabs (N[0]) > fabs (N[1])) + basis1[1] = 1.0; + else + basis1[0] = 1.0; + + /* make basis2 orthogonal to N */ + gts_vector_cross (basis2, N, basis1); + gts_vector_normalize (basis2); + + /* make basis1 orthogonal to N and basis2 */ + gts_vector_cross (basis1, N, basis2); + gts_vector_normalize (basis1); + + aterm_da = bterm_da = cterm_da = const_da = 0.0; + aterm_db = bterm_db = cterm_db = const_db = 0.0; + + weights = g_malloc (sizeof (gdouble)*g_slist_length (v->segments)); + kappas = g_malloc (sizeof (gdouble)*g_slist_length (v->segments)); + d1s = g_malloc (sizeof (gdouble)*g_slist_length (v->segments)); + d2s = g_malloc (sizeof (gdouble)*g_slist_length (v->segments)); + edge_count = 0; + + i = v->segments; + while (i) { + GtsEdge * e; + GtsFace * f1, * f2; + gdouble weight, kappa, d1, d2; + GtsVector vec_edge; + + if (! GTS_IS_EDGE (i->data)) { + i = i->next; + continue; + } + + e = i->data; + + /* since this vertex passed the tests in + * gts_vertex_mean_curvature_normal(), this should be true. */ + g_assert (gts_edge_face_number (e, s) == 2); + + /* identify the two triangles bordering e in s */ + f1 = f2 = NULL; + j = e->triangles; + while (j) { + if ((! GTS_IS_FACE (j->data)) || + (! gts_face_has_parent_surface (GTS_FACE (j->data), s))) { + j = j->next; + continue; + } + if (f1 == NULL) + f1 = GTS_FACE (j->data); + else { + f2 = GTS_FACE (j->data); + break; + } + j = j->next; + } + g_assert (f2 != NULL); + + /* We are solving for the values of the curvature tensor + * B = [ a b ; b c ]. + * The computations here are from section 5 of [Meyer et al 2002]. + * + * The first step is to calculate the linear equations governing + * the values of (a,b,c). These can be computed by setting the + * derivatives of the error E to zero (section 5.3). + * + * Since a + c = norm(Kh), we only compute the linear equations + * for dE/da and dE/db. (NB: [Meyer et al 2002] has the + * equation a + b = norm(Kh), but I'm almost positive this is + * incorrect.) + * + * Note that the w_ij (defined in section 5.2) are all scaled by + * (1/8*A_mixed). We drop this uniform scale factor because the + * solution of the linear equations doesn't rely on it. + * + * The terms of the linear equations are xterm_dy with x in + * {a,b,c} and y in {a,b}. There are also const_dy terms that are + * the constant factors in the equations. + */ + + /* find the vector from v along edge e */ + gts_vector_init (vec_edge, GTS_POINT (v), + GTS_POINT ((GTS_SEGMENT (e)->v1 == v) ? + GTS_SEGMENT (e)->v2 : GTS_SEGMENT (e)->v1)); + ve2 = gts_vector_scalar (vec_edge, vec_edge); + vdotN = gts_vector_scalar (vec_edge, N); + + /* section 5.2 - There is a typo in the computation of kappa. The + * edges should be x_j-x_i. + */ + kappa = 2.0 * vdotN / ve2; + + /* section 5.2 */ + + /* I don't like performing a minimization where some of the + * weights can be negative (as can be the case if f1 or f2 are + * obtuse). To ensure all-positive weights, we check for + * obtuseness and use values similar to those in region_area(). */ + weight = 0.0; + if (! triangle_obtuse(v, f1)) { + weight += ve2 * + cotan (gts_triangle_vertex_opposite (GTS_TRIANGLE (f1), e), + GTS_SEGMENT (e)->v1, GTS_SEGMENT (e)->v2) / 8.0; + } else { + if (angle_obtuse (v, f1)) { + weight += ve2 * gts_triangle_area (GTS_TRIANGLE (f1)) / 4.0; + } else { + weight += ve2 * gts_triangle_area (GTS_TRIANGLE (f1)) / 8.0; + } + } + + if (! triangle_obtuse(v, f2)) { + weight += ve2 * + cotan (gts_triangle_vertex_opposite (GTS_TRIANGLE (f2), e), + GTS_SEGMENT (e)->v1, GTS_SEGMENT (e)->v2) / 8.0; + } else { + if (angle_obtuse (v, f2)) { + weight += ve2 * gts_triangle_area (GTS_TRIANGLE (f2)) / 4.0; + } else { + weight += ve2 * gts_triangle_area (GTS_TRIANGLE (f2)) / 8.0; + } + } + + /* projection of edge perpendicular to N (section 5.3) */ + d[0] = vec_edge[0] - vdotN * N[0]; + d[1] = vec_edge[1] - vdotN * N[1]; + d[2] = vec_edge[2] - vdotN * N[2]; + gts_vector_normalize (d); + + /* not explicit in the paper, but necessary. Move d to 2D basis. */ + d1 = gts_vector_scalar (d, basis1); + d2 = gts_vector_scalar (d, basis2); + + /* store off the curvature, direction of edge, and weights for later use */ + weights[edge_count] = weight; + kappas[edge_count] = kappa; + d1s[edge_count] = d1; + d2s[edge_count] = d2; + edge_count++; + + /* Finally, update the linear equations */ + aterm_da += weight * d1 * d1 * d1 * d1; + bterm_da += weight * d1 * d1 * 2 * d1 * d2; + cterm_da += weight * d1 * d1 * d2 * d2; + const_da += weight * d1 * d1 * (- kappa); + + aterm_db += weight * d1 * d2 * d1 * d1; + bterm_db += weight * d1 * d2 * 2 * d1 * d2; + cterm_db += weight * d1 * d2 * d2 * d2; + const_db += weight * d1 * d2 * (- kappa); + + i = i->next; + } + + /* now use the identity (Section 5.3) a + c = |Kh| = 2 * kappa_h */ + aterm_da -= cterm_da; + const_da += cterm_da * normKh; + + aterm_db -= cterm_db; + const_db += cterm_db * normKh; + + /* check for solvability of the linear system */ + if (((aterm_da * bterm_db - aterm_db * bterm_da) != 0.0) && + ((const_da != 0.0) || (const_db != 0.0))) { + linsolve (aterm_da, bterm_da, -const_da, + aterm_db, bterm_db, -const_db, + &a, &b); + + c = normKh - a; + + eigenvector (a, b, c, eig); + } else { + /* region of v is planar */ + eig[0] = 1.0; + eig[1] = 0.0; + } + + /* Although the eigenvectors of B are good estimates of the + * principal directions, it seems that which one is attached to + * which curvature direction is a bit arbitrary. This may be a bug + * in my implementation, or just a side-effect of the inaccuracy of + * B due to the discrete nature of the sampling. + * + * To overcome this behavior, we'll evaluate which assignment best + * matches the given eigenvectors by comparing the curvature + * estimates computed above and the curvatures calculated from the + * discrete differential operators. */ + + gts_vertex_principal_curvatures (0.5 * normKh, Kg, &K1, &K2); + + err_e1 = err_e2 = 0.0; + /* loop through the values previously saved */ + for (e = 0; e < edge_count; e++) { + gdouble weight, kappa, d1, d2; + gdouble temp1, temp2; + gdouble delta; + + weight = weights[e]; + kappa = kappas[e]; + d1 = d1s[e]; + d2 = d2s[e]; + + temp1 = fabs (eig[0] * d1 + eig[1] * d2); + temp1 = temp1 * temp1; + temp2 = fabs (eig[1] * d1 - eig[0] * d2); + temp2 = temp2 * temp2; + + /* err_e1 is for K1 associated with e1 */ + delta = K1 * temp1 + K2 * temp2 - kappa; + err_e1 += weight * delta * delta; + + /* err_e2 is for K1 associated with e2 */ + delta = K2 * temp1 + K1 * temp2 - kappa; + err_e2 += weight * delta * delta; + } + g_free (weights); + g_free (kappas); + g_free (d1s); + g_free (d2s); + + /* rotate eig by a right angle if that would decrease the error */ + if (err_e2 < err_e1) { + gdouble temp = eig[0]; + + eig[0] = eig[1]; + eig[1] = -temp; + } + + e1[0] = eig[0] * basis1[0] + eig[1] * basis2[0]; + e1[1] = eig[0] * basis1[1] + eig[1] * basis2[1]; + e1[2] = eig[0] * basis1[2] + eig[1] * basis2[2]; + gts_vector_normalize (e1); + + /* make N,e1,e2 a right handed coordinate sytem */ + gts_vector_cross (e2, N, e1); + gts_vector_normalize (e2); +} Index: tags/1.0.5/gts/edge.c =================================================================== --- tags/1.0.5/gts/edge.c (nonexistent) +++ tags/1.0.5/gts/edge.c (revision 953) @@ -0,0 +1,582 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +gboolean gts_allow_floating_edges = FALSE; + +static void edge_destroy (GtsObject * object) +{ + GtsEdge * edge = GTS_EDGE (object); + GSList * i; + + i = edge->triangles; + while (i) { + GSList * next = i->next; + gts_object_destroy (i->data); + i = next; + } + g_assert (edge->triangles == NULL); + + (* GTS_OBJECT_CLASS (gts_edge_class ())->parent_class->destroy) (object); +} + +static void edge_clone (GtsObject * clone, GtsObject * object) +{ + (* GTS_OBJECT_CLASS (gts_edge_class ())->parent_class->clone) (clone, + object); + GTS_SEGMENT (clone)->v1 = GTS_SEGMENT (clone)->v2 = NULL; + GTS_EDGE (clone)->triangles = NULL; +} + +static void edge_class_init (GtsObjectClass * klass) +{ + klass->clone = edge_clone; + klass->destroy = edge_destroy; +} + +static void edge_init (GtsEdge * edge) +{ + edge->triangles = NULL; +} + +/** + * gts_edge_class: + * + * Returns: the #GtsEdgeClass. + */ +GtsEdgeClass * gts_edge_class (void) +{ + static GtsEdgeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo edge_info = { + "GtsEdge", + sizeof (GtsEdge), + sizeof (GtsEdgeClass), + (GtsObjectClassInitFunc) edge_class_init, + (GtsObjectInitFunc) edge_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_segment_class ()), + &edge_info); + } + + return klass; +} + +/** + * gts_edge_new: + * @klass: a #GtsEdgeClass. + * @v1: a #GtsVertex. + * @v2: a #GtsVertex. + * + * Returns: a new #GtsEdge linking @v1 and @v2. + */ +GtsEdge * gts_edge_new (GtsEdgeClass * klass, + GtsVertex * v1, GtsVertex * v2) +{ + return GTS_EDGE (gts_segment_new (GTS_SEGMENT_CLASS (klass), v1, v2)); +} + +void gts_edge_remove(GtsEdge *edge) +{ + edge->segment.v1->segments = g_slist_remove(edge->segment.v1->segments, &edge->segment); + edge->segment.v2->segments = g_slist_remove(edge->segment.v2->segments, &edge->segment); + edge_destroy(GTS_OBJECT (edge)); +} + +/** + * gts_edge_replace: + * @e: a #GtsEdge. + * @with: a #GtsEdge. + * + * Replaces @e with @with. For each triangle which uses @e as an + * edge, @e is replaced with @with. The @with->triangles list is + * updated appropriately and the @e->triangles list is freed and set + * to %NULL. + */ +void gts_edge_replace (GtsEdge * e, GtsEdge * with) +{ + GSList * i; + + g_return_if_fail (e != NULL && with != NULL && e != with); + + i = e->triangles; + while (i) { + GtsTriangle * t = i->data; + if (t->e1 == e) t->e1 = with; + if (t->e2 == e) t->e2 = with; + if (t->e3 == e) t->e3 = with; + if (!g_slist_find (with->triangles, t)) + with->triangles = g_slist_prepend (with->triangles, t); + i = i->next; + } + g_slist_free (e->triangles); + e->triangles = NULL; +} + +/** + * gts_edge_has_parent_surface: + * @e: a #GtsEdge. + * @surface: a #GtsSurface. + * + * Returns: a #GtsFace of @surface having @e as an edge, %NULL otherwise. + */ +GtsFace * gts_edge_has_parent_surface (GtsEdge * e, GtsSurface * surface) +{ + GSList * i; + + g_return_val_if_fail (e != NULL, NULL); + + i = e->triangles; + while (i) { + if (GTS_IS_FACE (i->data) && + gts_face_has_parent_surface (i->data, surface)) + return i->data; + i = i->next; + } + return NULL; +} + +/** + * gts_edge_has_any_parent_surface: + * @e: a #GtsEdge. + * + * Returns: %NULL if @e is not an edge of any triangle or if all the + * faces having @e has an edge do not belong to any surface, + * a #GtsFace belonging to a surface and having @e as an edge. + */ +GtsFace * gts_edge_has_any_parent_surface (GtsEdge * e) +{ + GSList * i; + + g_return_val_if_fail (e != NULL, NULL); + + i = e->triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_IS_FACE (t) && GTS_FACE (t)->surfaces != NULL) + return GTS_FACE (t); + i = i->next; + } + return NULL; +} + +/** + * gts_edge_is_boundary: + * @e: a #GtsEdge. + * @surface: a #GtsSurface or %NULL. + * + * Returns: the unique #GtsFace (which belongs to @surface) and which + * has @e as an edge (i.e. @e is a boundary edge (of @surface)) or %NULL + * if there is more than one or no faces (belonging to @surface) and + * with @e as an edge. + */ +GtsFace * gts_edge_is_boundary (GtsEdge * e, GtsSurface * surface) +{ + GSList * i; + GtsFace * f = NULL; + + g_return_val_if_fail (e != NULL, NULL); + + i = e->triangles; + while (i) { + if (GTS_IS_FACE (i->data)) { + if (!surface || gts_face_has_parent_surface (i->data, surface)) { + if (f != NULL) + return NULL; + f = i->data; + } + } + i = i->next; + } + return f; +} + +/** + * gts_edges_from_vertices: + * @vertices: a list of #GtsVertex. + * @parent: a #GtsSurface. + * + * Returns: a list of unique #GtsEdge which have one of their vertices in + * @vertices and are used by a face of @parent. + */ +GSList * gts_edges_from_vertices (GSList * vertices, GtsSurface * parent) +{ + GHashTable * hash; + GSList * edges = NULL, * i; + + g_return_val_if_fail (parent != NULL, NULL); + + hash = g_hash_table_new (NULL, NULL); + i = vertices; + while (i) { + GSList * j = GTS_VERTEX (i->data)->segments; + while (j) { + GtsSegment * s = j->data; + if (GTS_IS_EDGE (s) && + gts_edge_has_parent_surface (GTS_EDGE (s), parent) && + g_hash_table_lookup (hash, s) == NULL) { + edges = g_slist_prepend (edges, s); + g_hash_table_insert (hash, s, i); + } + j = j->next; + } + i = i->next; + } + g_hash_table_destroy (hash); + return edges; +} + +/** + * gts_edge_face_number: + * @e: a #GtsEdge. + * @s: a #GtsSurface. + * + * Returns: the number of faces using @e and belonging to @s. + */ +guint gts_edge_face_number (GtsEdge * e, GtsSurface * s) +{ + GSList * i; + guint nt = 0; + + g_return_val_if_fail (e != NULL, 0); + g_return_val_if_fail (s != NULL, 0); + + i = e->triangles; + while (i) { + if (GTS_IS_FACE (i->data) && + gts_face_has_parent_surface (GTS_FACE (i->data), s)) + nt++; + i = i->next; + } + return nt; +} + +/** + * gts_edge_is_duplicate: + * @e: a #GtsEdge. + * + * Returns: the first #GtsEdge different from @e which shares the + * same endpoints or %NULL if there is none. + */ +GtsEdge * gts_edge_is_duplicate (GtsEdge * e) +{ + GSList * i; + GtsVertex * v2; + + g_return_val_if_fail (e != NULL, NULL); + + v2 = GTS_SEGMENT (e)->v2; + i = GTS_SEGMENT (e)->v1->segments; + if (GTS_SEGMENT (e)->v1 == v2) /* e is degenerate: special treatment */ + while (i) { + GtsSegment * s = i->data; + if (s != GTS_SEGMENT (e) && + GTS_IS_EDGE (s) && + s->v1 == v2 && s->v2 == v2) + return GTS_EDGE (s); + i = i->next; + } + else /* e is not degenerate */ + while (i) { + GtsSegment * s = i->data; + if (s != GTS_SEGMENT (e) && + GTS_IS_EDGE (s) && + (s->v1 == v2 || s->v2 == v2)) + return GTS_EDGE (s); + i = i->next; + } + return NULL; +} + +/** + * gts_edges_merge: + * @edges: a list of #GtsEdge. + * + * For each edge in @edges check if it is duplicated (as + * returned by gts_edge_is_duplicate()). If it is replace it by its + * duplicate, destroy it and remove it from the list. + * + * Returns: the updated @edges list. + */ +GList * gts_edges_merge (GList * edges) +{ + GList * i = edges; + + /* we want to control edge destruction */ + gts_allow_floating_edges = TRUE; + while (i) { + GtsEdge * e = i->data; + GtsEdge * de = gts_edge_is_duplicate (e); + if (de) { + GList * next = i->next; + edges = g_list_remove_link (edges, i); + g_list_free_1 (i); + i = next; + gts_edge_replace (e, de); + gts_object_destroy (GTS_OBJECT (e)); + } + else + i = i->next; + } + gts_allow_floating_edges = FALSE;; + + return edges; +} + +static void triangle_vertices_edges (GtsTriangle * t, + GtsEdge * e, + GtsVertex ** v, + GtsEdge ** ee1, + GtsEdge ** ee2) +{ + GtsEdge * e1 = t->e1, * e2 = t->e2, * e3 = t->e3; + GtsVertex * v1 = GTS_SEGMENT (e)->v1; + + if (e1 == e) e1 = e3; + else if (e2 == e) e2 = e3; + else g_assert (e3 == e); + + if (GTS_SEGMENT (e2)->v1 == v1 || GTS_SEGMENT (e2)->v2 == v1) { + e3 = e1; e1 = e2; e2 = e3; + } + if (GTS_SEGMENT (e1)->v1 == v1) + *v = GTS_SEGMENT (e1)->v2; + else + *v = GTS_SEGMENT (e1)->v1; + *ee1 = e1; + *ee2 = e2; +} + +/** + * gts_edge_belongs_to_tetrahedron: + * @e: a #GtsEdge. + * + * Returns: %TRUE if @e is used by faces forming a tetrahedron, %FALSE + * otherwise. + */ +gboolean gts_edge_belongs_to_tetrahedron (GtsEdge * e) +{ + GSList * i; + + g_return_val_if_fail (e != NULL, FALSE); + + i = e->triangles; + while (i) { + GtsEdge * e1, * e2; + GtsVertex * vt1; + GSList * j = i->next; + triangle_vertices_edges (i->data, e, &vt1, &e1, &e2); + while (j) { + GtsSegment * s5; + GtsEdge * e3, * e4; + GtsVertex * vt2; + + triangle_vertices_edges (j->data, e, &vt2, &e3, &e4); + s5 = gts_vertices_are_connected (vt1, vt2); + if (GTS_IS_EDGE (s5) && + gts_triangle_use_edges (e1, e3, GTS_EDGE (s5)) && + gts_triangle_use_edges (e2, e4, GTS_EDGE (s5))) + return TRUE; + j = j->next; + } + i = i->next; + } + + return FALSE; +} + +#define edge_use_vertex(e, v) (GTS_SEGMENT(e)->v1 == v ||\ + GTS_SEGMENT(e)->v2 == v) + +static GtsEdge * next_edge (GtsTriangle * t, + GtsEdge * e1, + GtsEdge * e) +{ + GtsVertex * v1 = GTS_SEGMENT (e)->v1; + GtsVertex * v2 = GTS_SEGMENT (e)->v2; + + if (t->e1 != e1 && t->e1 != e && + (edge_use_vertex (t->e1, v1) || edge_use_vertex (t->e1, v2))) + return t->e1; + else if (t->e2 != e1 && t->e2 != e && + (edge_use_vertex (t->e2, v1) || edge_use_vertex (t->e2, v2))) + return t->e2; + else if (t->e3 != e1 && t->e3 != e && + (edge_use_vertex (t->e3, v1) || edge_use_vertex (t->e3, v2))) + return t->e3; + g_assert_not_reached (); + return NULL; +} + +static void triangle_next (GtsEdge * e1, GtsEdge * e) +{ + GSList * i; + + i = e1->triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_OBJECT (t)->reserved) { + GTS_OBJECT (t)->reserved = NULL; + triangle_next (next_edge (t, e1, e), e); + } + i = i->next; + } +} + +/** + * gts_edge_is_contact: + * @e: a #GtsEdge. + * + * Returns: the number of sets of connected triangles sharing @e as a + * contact edge. + */ +guint gts_edge_is_contact (GtsEdge * e) +{ + GSList * i, * triangles; + guint ncomponent = 0; + + g_return_val_if_fail (e != NULL, 0); + + triangles = gts_vertex_triangles (GTS_SEGMENT (e)->v1, NULL); + i = triangles = gts_vertex_triangles (GTS_SEGMENT (e)->v2, triangles); + while (i) { + GTS_OBJECT (i->data)->reserved = i; + i = i->next; + } + + i = e->triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_OBJECT (t)->reserved) { + GtsEdge * e1; + GTS_OBJECT (t)->reserved = NULL; + e1 = next_edge (t, NULL, e); + triangle_next (e1, e); + triangle_next (next_edge (t, e1, e), e); + ncomponent++; + } + i = i->next; + } + + g_slist_foreach (triangles, (GFunc) gts_object_reset_reserved, NULL); + g_slist_free (triangles); + + return ncomponent; +} + +/** + * gts_edge_swap: + * @e: a #GtsEdge. + * @s: a #GtsSurface. + * + * Performs an "edge swap" on the two triangles sharing @e and + * belonging to @s. + */ +void gts_edge_swap (GtsEdge * e, GtsSurface * s) +{ + GtsTriangle * t1 = NULL, * t2 = NULL, * t; + GtsFace * f; + GSList * i; + GtsVertex * v1, * v2, * v3, * v4, * v5, * v6; + GtsEdge * e1, * e2, * e3, * e4; + GtsSegment * v3v6; + + g_return_if_fail (e != NULL); + g_return_if_fail (s != NULL); + + i = e->triangles; + while (i) { + if (GTS_IS_FACE (i->data) && gts_face_has_parent_surface (i->data, s)) { + if (!t1) + t1 = i->data; + else if (!t2) + t2 = i->data; + else + g_return_if_fail (gts_edge_face_number (e, s) == 2); + } + i = i->next; + } + g_assert (t1 && t2); + + gts_triangle_vertices_edges (t1, e, &v1, &v2, &v3, &e, &e1, &e2); + gts_triangle_vertices_edges (t2, e, &v4, &v5, &v6, &e, &e3, &e4); + g_assert (v2 == v4 && v1 == v5); + + v3v6 = gts_vertices_are_connected (v3, v6); + if (!GTS_IS_EDGE (v3v6)) + v3v6 = GTS_SEGMENT (gts_edge_new (s->edge_class, v3, v6)); + f = gts_face_new (s->face_class, e1, GTS_EDGE (v3v6), e4); + if ((t = gts_triangle_is_duplicate (GTS_TRIANGLE (f))) && + GTS_IS_FACE (t)) { + gts_object_destroy (GTS_OBJECT (f)); + f = GTS_FACE (t); + } + gts_surface_add_face (s, f); + + f = gts_face_new (s->face_class, GTS_EDGE (v3v6), e2, e3); + if ((t = gts_triangle_is_duplicate (GTS_TRIANGLE (f))) && + GTS_IS_FACE (t)) { + gts_object_destroy (GTS_OBJECT (f)); + f = GTS_FACE (t); + } + gts_surface_add_face (s, f); + + gts_surface_remove_face (s, GTS_FACE (t1)); + gts_surface_remove_face (s, GTS_FACE (t2)); +} + +/** + * gts_edge_manifold_faces: + * @e: a #GtsEdge. + * @s: a #GtsSurface. + * @f1: pointer for first face. + * @f2: pointer for second face. + * + * If @e is a manifold edge of surface @s, fills @f1 and @f2 with the + * faces belonging to @s and sharing @e. + * + * Returns: %TRUE if @e is a manifold edge, %FALSE otherwise. + */ +gboolean gts_edge_manifold_faces (GtsEdge * e, GtsSurface * s, + GtsFace ** f1, GtsFace ** f2) +{ + GSList * i; + + g_return_val_if_fail (e != NULL, FALSE); + g_return_val_if_fail (s != NULL, FALSE); + g_return_val_if_fail (f1 != NULL, FALSE); + g_return_val_if_fail (f2 != NULL, FALSE); + + *f1 = *f2 = NULL; + i = e->triangles; + while (i) { + if (GTS_IS_FACE (i->data) && gts_face_has_parent_surface (i->data, s)) { + if (!(*f1)) *f1 = i->data; + else if (!(*f2)) *f2 = i->data; + else return FALSE; + } + i = i->next; + } + + return (*f1 && *f2); +} Index: tags/1.0.5/gts/eheap.c =================================================================== --- tags/1.0.5/gts/eheap.c (nonexistent) +++ tags/1.0.5/gts/eheap.c (revision 953) @@ -0,0 +1,461 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +#define PARENT(i) ((i) >= 2 ? (i)/2 : 0) +#define LEFT_CHILD(i) (2*(i)) +#define RIGHT_CHILD(i) (2*(i) + 1) + + +/** + * gts_eheap_new: + * @key_func: a #GtsKeyFunc or %NULL. + * @data: user data to be passed to @key_func. + * + * Returns: a new #GtsEHeap using @key_func as key. + */ +GtsEHeap * gts_eheap_new (GtsKeyFunc key_func, + gpointer data) +{ + GtsEHeap * heap; + + heap = g_malloc (sizeof(GtsEHeap)); + heap->elts = g_ptr_array_new (); + heap->func = key_func; + heap->data = data; + heap->frozen = FALSE; + heap->randomized = FALSE; + return heap; +} + +static void sift_up (GtsEHeap * heap, guint i) +{ + GtsEHeapPair * parent, * child; + guint p; + gpointer * pdata = heap->elts->pdata; + gdouble key; + + child = pdata[i - 1]; + key = child->key; + while ((p = PARENT (i))) { + parent = pdata[p - 1]; + if (parent->key > key || + (heap->randomized && parent->key == key && rand () < RAND_MAX/2)) { + pdata[p - 1] = child; + pdata[i - 1] = parent; + child->pos = p; + parent->pos = i; + i = p; + } + else + i = 0; + } +} + +/** + * gts_eheap_insert: + * @heap: a #GtsEHeap. + * @p: a pointer to add to the heap. + * + * Inserts a new element @p in the heap. + * + * Returns: a #GtsEHeapPair describing the position of the element in the heap. + * This pointer is necessary for gts_eheap_remove() and + * gts_eheap_decrease_key(). + */ +GtsEHeapPair * gts_eheap_insert (GtsEHeap * heap, gpointer p) +{ + GtsEHeapPair * pair; + GPtrArray * elts; + + g_return_val_if_fail (heap != NULL, NULL); + g_return_val_if_fail (heap->func != NULL, NULL); + + elts = heap->elts; + pair = g_malloc (sizeof (GtsEHeapPair)); + g_ptr_array_add (elts, pair); + pair->data = p; + pair->pos = elts->len; + pair->key = (*heap->func) (p, heap->data); + if (!heap->frozen) + sift_up (heap, elts->len); + return pair; +} + +/** + * gts_eheap_insert_with_key: + * @heap: a #GtsEHeap. + * @p: a pointer to add to the heap. + * @key: the value of the key associated to @p. + * + * Inserts a new element @p in the heap. + * + * Returns: a #GtsEHeapPair describing the position of the element in the heap. + * This pointer is necessary for gts_eheap_remove() and + * gts_eheap_decrease_key(). + */ +GtsEHeapPair * gts_eheap_insert_with_key (GtsEHeap * heap, + gpointer p, + gdouble key) +{ + GtsEHeapPair * pair; + GPtrArray * elts; + + g_return_val_if_fail (heap != NULL, NULL); + + elts = heap->elts; + pair = g_malloc (sizeof (GtsEHeapPair)); + g_ptr_array_add (elts, pair); + pair->data = p; + pair->pos = elts->len; + pair->key = key; + if (!heap->frozen) + sift_up (heap, elts->len); + return pair; +} + +static void sift_down (GtsEHeap * heap, guint i) +{ + GtsEHeapPair * left_child, * right_child, * child, * parent; + guint lc, rc, c; + gpointer * pdata = heap->elts->pdata; + guint len = heap->elts->len; + gdouble key; + + lc = LEFT_CHILD (i); + rc = RIGHT_CHILD (i); + left_child = lc <= len ? pdata[lc - 1] : NULL; + right_child = rc <= len ? pdata[rc - 1] : NULL; + + parent = pdata[i - 1]; + key = parent->key; + while (left_child != NULL) { + if (right_child == NULL || left_child->key < right_child->key) { + child = left_child; + c = lc; + } + else { + child = right_child; + c = rc; + } + if (key > child->key) { + pdata[i - 1] = child; + child->pos = i; + pdata[c - 1] = parent; + parent->pos = c; + i = c; + lc = LEFT_CHILD (i); + rc = RIGHT_CHILD (i); + left_child = lc <= len ? pdata[lc - 1] : NULL; + right_child = rc <= len ? pdata[rc - 1] : NULL; + } + else + left_child = NULL; + } +} + +/** + * gts_eheap_remove_top: + * @heap: a #GtsEHeap. + * @key: a pointer on a gdouble or %NULL. + * + * Removes the element at the top of the heap and optionally (if @key is not + * %NULL) returns the value of its key. + * + * Returns: the element at the top of the heap. + */ +gpointer gts_eheap_remove_top (GtsEHeap * heap, gdouble * key) +{ + gpointer root; + GPtrArray * elts; + guint len; + GtsEHeapPair * pair; + + g_return_val_if_fail (heap != NULL, NULL); + + elts = heap->elts; + len = elts->len; + + if (len == 0) + return NULL; + if (len == 1) { + pair = g_ptr_array_remove_index (elts, 0); + root = pair->data; + if (key) + *key = pair->key; + g_free (pair); + return root; + } + + pair = elts->pdata[0]; + root = pair->data; + if (key) + *key = pair->key; + g_free (pair); + pair = g_ptr_array_remove_index (elts, len - 1); + elts->pdata[0] = pair; + pair->pos = 1; + sift_down (heap, 1); + return root; +} + +/** + * gts_eheap_top: + * @heap: a #GtsEHeap. + * @key: a pointer on a gdouble or %NULL. + * + * Returns: the element at the top of the heap and optionally (if @key is not + * %NULL) its key. + */ +gpointer gts_eheap_top (GtsEHeap * heap, gdouble * key) +{ + GtsEHeapPair * pair; + GPtrArray * elts; + + g_return_val_if_fail (heap != NULL, NULL); + + elts = heap->elts; + + if (elts->len == 0) + return NULL; + + pair = elts->pdata[0]; + if (key) + *key = pair->key; + return pair->data; +} + +/** + * gts_eheap_destroy: + * @heap: a #GtsEHeap. + * + * Free all the memory allocated for @heap. + */ +void gts_eheap_destroy (GtsEHeap * heap) +{ + guint i; + + g_return_if_fail (heap != NULL); + + for (i = 0; i < heap->elts->len; i++) + g_free (heap->elts->pdata[i]); + g_ptr_array_free (heap->elts, TRUE); + g_free (heap); +} + +/** + * gts_eheap_thaw: + * @heap: a #GtsEHeap. + * + * If @heap has been frozen previously using gts_eheap_freeze(), reorder it + * in O(n) time and unfreeze it. + */ +void gts_eheap_thaw (GtsEHeap * heap) +{ + guint i; + + g_return_if_fail (heap != NULL); + + if (!heap->frozen) + return; + + for (i = heap->elts->len/2; i > 0; i--) + sift_down (heap, i); + + heap->frozen = FALSE; +} + +/** + * gts_eheap_foreach: + * @heap: a #GtsEHeap. + * @func: the function to call for each element in the heap. + * @data: to pass to @func. + */ +void gts_eheap_foreach (GtsEHeap * heap, + GFunc func, + gpointer data) +{ + guint i; + GPtrArray * elts; + + g_return_if_fail (heap != NULL); + g_return_if_fail (func != NULL); + + elts = heap->elts; + for (i = 0; i < elts->len; i++) + (*func) (((GtsEHeapPair *) elts->pdata[i])->data, data); +} + +/** + * gts_eheap_remove: + * @heap: a #GtsEHeap. + * @p: a #GtsEHeapPair. + * + * Removes element corresponding to @p from @heap in O(log n). + * + * Returns: the element just removed from @heap. + */ +gpointer gts_eheap_remove (GtsEHeap * heap, GtsEHeapPair * p) +{ + GtsEHeapPair ** pdata; + GtsEHeapPair * parent; + guint i, par; + gpointer data; + + g_return_val_if_fail (heap != NULL, NULL); + g_return_val_if_fail (p != NULL, NULL); + + pdata = (GtsEHeapPair **)heap->elts->pdata; + i = p->pos; + data = p->data; + + g_return_val_if_fail (i > 0 && i <= heap->elts->len, NULL); + g_return_val_if_fail (p == pdata[i - 1], NULL); + + /* move element to the top */ + while ((par = PARENT (i))) { + parent = pdata[par - 1]; + pdata[par - 1] = p; + pdata[i - 1] = parent; + p->pos = par; + parent->pos = i; + i = par; + } + + gts_eheap_remove_top (heap, NULL); + + return data; +} + +/** + * gts_eheap_decrease_key: + * @heap: a #GtsEHeap. + * @p: a #GtsEHeapPair. + * @new_key: the new value of the key for this element. Must be smaller than + * the current key. + * + * Decreases the value of the key of the element at position @p. + */ +void gts_eheap_decrease_key (GtsEHeap * heap, + GtsEHeapPair * p, + gdouble new_key) +{ + guint i; + + g_return_if_fail (heap != NULL); + g_return_if_fail (p != NULL); + + i = p->pos; + g_return_if_fail (i > 0 && i <= heap->elts->len); + g_return_if_fail (p == heap->elts->pdata[i - 1]); + + g_return_if_fail (new_key <= p->key); + + p->key = new_key; + if (!heap->frozen) + sift_up (heap, i); +} + +/** + * gts_eheap_freeze: + * @heap: a #GtsEHeap. + * + * Freezes the heap. Any subsequent operation will not preserve the heap + * property. Used in conjunction with gts_eheap_insert() and gts_eheap_thaw() + * to create a heap in O(n) time. + */ +void gts_eheap_freeze (GtsEHeap * heap) +{ + g_return_if_fail (heap != NULL); + + heap->frozen = TRUE; +} + +/** + * gts_eheap_size: + * @heap: a #GtsEHeap. + * + * Returns: the number of items in @heap. + */ +guint gts_eheap_size (GtsEHeap * heap) +{ + g_return_val_if_fail (heap != NULL, 0); + + return heap->elts->len; +} + +/** + * gts_eheap_update: + * @heap: a #GtsEHeap. + * + * Updates the key of each element of @heap and reorders it. + */ +void gts_eheap_update (GtsEHeap * heap) +{ + guint i, len; + GtsEHeapPair ** pairs; + gpointer data; + GtsKeyFunc func; + + g_return_if_fail (heap != NULL); + g_return_if_fail (heap->func != NULL); + + heap->frozen = TRUE; + + len = heap->elts->len; + pairs = (GtsEHeapPair **) heap->elts->pdata; + data = heap->data; + func = heap->func; + + for (i = 0; i < len; i++) { + GtsEHeapPair * pair = pairs[i]; + pair->key = (*func) (pair->data, data); + } + + gts_eheap_thaw (heap); +} + +/** + * gts_eheap_key: + * @heap: a #GtsEHeap. + * @p: a pointer to be tested; + * + * Returns: the value of the key for pointer @p. + */ +gdouble gts_eheap_key (GtsEHeap * heap, gpointer p) +{ + g_return_val_if_fail (heap != NULL, 0.); + g_return_val_if_fail (heap->func != NULL, 0.); + + return (* heap->func) (p, heap->data); +} + +/** + * gts_eheap_randomized: + * @heap: a #GtsEHeap. + * @randomized: whether @heap should be randomized. + */ +void gts_eheap_randomized (GtsEHeap * heap, gboolean randomized) +{ + g_return_if_fail (heap != NULL); + + heap->randomized = randomized; +} Index: tags/1.0.5/gts/face.c =================================================================== --- tags/1.0.5/gts/face.c (nonexistent) +++ tags/1.0.5/gts/face.c (revision 953) @@ -0,0 +1,297 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +gboolean gts_allow_floating_faces = FALSE; + +static void face_destroy (GtsObject * object) +{ + GtsFace * face = GTS_FACE (object); + GSList * i; + + i = face->surfaces; + while (i) { + GSList * next = i->next; + gts_surface_remove_face (i->data, face); + i = next; + } + g_assert (face->surfaces == NULL); + + (* GTS_OBJECT_CLASS (gts_face_class ())->parent_class->destroy) (object); +} + +static void face_clone (GtsObject * clone, GtsObject * object) +{ + (* GTS_OBJECT_CLASS (gts_face_class ())->parent_class->clone) (clone, + object); + GTS_FACE (clone)->surfaces = NULL; +} + +static void face_class_init (GtsFaceClass * klass) +{ + GTS_OBJECT_CLASS (klass)->clone = face_clone; + GTS_OBJECT_CLASS (klass)->destroy = face_destroy; +} + +static void face_init (GtsFace * face) +{ + face->surfaces = NULL; +} + +/** + * gts_face_class: + * + * Returns: the #GtsFaceClass. + */ +GtsFaceClass * gts_face_class (void) +{ + static GtsFaceClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo face_info = { + "GtsFace", + sizeof (GtsFace), + sizeof (GtsFaceClass), + (GtsObjectClassInitFunc) face_class_init, + (GtsObjectInitFunc) face_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_triangle_class ()), + &face_info); + } + + return klass; +} + +/** + * gts_face_new: + * @klass: a #GtsFaceClass. + * @e1: a #GtsEdge. + * @e2: a #GtsEdge. + * @e3: a #GtsEdge. + * + * Returns: a new #GtsFace using @e1, @e2 and @e3 as edges. + */ +GtsFace * gts_face_new (GtsFaceClass * klass, + GtsEdge * e1, GtsEdge * e2, GtsEdge * e3) +{ + GtsFace * f; + + f = GTS_FACE (gts_object_new (GTS_OBJECT_CLASS (klass))); + gts_triangle_set (GTS_TRIANGLE (f), e1, e2, e3); + + return f; +} + +/** + * gts_face_has_parent_surface: + * @f: a #GtsFace. + * @s: a #GtsSurface. + * + * Returns: %TRUE if @f belongs to @s, %FALSE otherwise. + */ +gboolean gts_face_has_parent_surface (GtsFace * f, GtsSurface * s) +{ + GSList * i; + + g_return_val_if_fail (f != NULL, FALSE); + + i = f->surfaces; + while (i) { + if (i->data == s) + return TRUE; + i = i->next; + } + return FALSE; +} + +/** + * gts_faces_from_edges: + * @edges: a list of #GtsEdge. + * @s: a #GtsSurface or %NULL. + * + * Builds a list of unique faces which belong to @s and have + * one of their edges in @edges. + * + * Returns: the list of faces. + */ +GSList * gts_faces_from_edges (GSList * edges, GtsSurface * s) +{ + GHashTable * hash; + GSList * faces = NULL, * i; + + hash = g_hash_table_new (NULL, NULL); + i = edges; + while (i) { + GSList * j = GTS_EDGE (i->data)->triangles; + while (j) { + GtsTriangle * t = j->data; + if (GTS_IS_FACE (t) && + (!s || gts_face_has_parent_surface (GTS_FACE (t), s)) && + g_hash_table_lookup (hash, t) == NULL) { + faces = g_slist_prepend (faces, t); + g_hash_table_insert (hash, t, i); + } + j = j->next; + } + i = i->next; + } + g_hash_table_destroy (hash); + + return faces; +} + +/** + * gts_face_neighbor_number: + * @f: a #GtsFace. + * @s: a #GtsSurface or %NULL. + * + * Returns: the number of faces neighbors of @f and belonging to @s. + */ +guint gts_face_neighbor_number (GtsFace * f, GtsSurface * s) +{ + GSList * i; + guint nn = 0; + GtsEdge * e[4], ** e1 = e; + + g_return_val_if_fail (f != NULL, 0); + + e[0] = GTS_TRIANGLE (f)->e1; + e[1] = GTS_TRIANGLE (f)->e2; + e[2] = GTS_TRIANGLE (f)->e3; + e[3] = NULL; + while (*e1) { + i = (*e1++)->triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_FACE (t) != f && + GTS_IS_FACE (t) && + (!s || gts_face_has_parent_surface (GTS_FACE (t), s))) + nn++; + i = i->next; + } + } + + return nn; +} + +/** + * gts_face_neighbors: + * @f: a #GtsFace. + * @s: a #GtsSurface or %NULL. + * + * Returns: a list of unique #GtsFace neighbors of @f and belonging to @s. + */ +GSList * gts_face_neighbors (GtsFace * f, GtsSurface * s) +{ + GSList * i, * list = NULL; + GtsEdge * e[4], ** e1 = e; + + g_return_val_if_fail (f != NULL, NULL); + + e[0] = GTS_TRIANGLE (f)->e1; + e[1] = GTS_TRIANGLE (f)->e2; + e[2] = GTS_TRIANGLE (f)->e3; + e[3] = NULL; + while (*e1) { + i = (*e1++)->triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_FACE (t) != f && + GTS_IS_FACE (t) && + (!s || gts_face_has_parent_surface (GTS_FACE (t), s))) + list = g_slist_prepend (list, t); + i = i->next; + } + } + + return list; +} + +/** + * gts_face_foreach_neighbor: + * @f: a #GtsFace. + * @s: a #GtsSurface or %NULL. + * @func: a #GtsFunc. + * @data: user data to pass to @func. + * + * Calls @func for each neighbor of @f belonging to @s (if not %NULL). + */ +void gts_face_foreach_neighbor (GtsFace * f, + GtsSurface * s, + GtsFunc func, + gpointer data) +{ + GSList * i; + GtsEdge * e[4], ** e1 = e; + + g_return_if_fail (f != NULL); + g_return_if_fail (func != NULL); + + e[0] = GTS_TRIANGLE (f)->e1; + e[1] = GTS_TRIANGLE (f)->e2; + e[2] = GTS_TRIANGLE (f)->e3; + e[3] = NULL; + while (*e1) { + i = (*e1++)->triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_FACE (t) != f && + GTS_IS_FACE (t) && + (!s || gts_face_has_parent_surface (GTS_FACE (t), s))) + (* func) (t, data); + i = i->next; + } + } +} + +static gboolean triangle_is_incompatible (GtsTriangle * t, GtsEdge * e, GtsSurface * s) +{ + GSList * i = e->triangles; + + while (i) { + if (i->data != t && + GTS_IS_FACE (i->data) && + gts_face_has_parent_surface (i->data, s) && + !gts_triangles_are_compatible (t, i->data, e)) + return TRUE; + i = i->next; + } + return FALSE; +} + +/** + * gts_face_is_compatible: + * @f: a #GtsFace. + * @s: a #GtsSurface. + * + * Returns: %TRUE if @f is compatible with all its neighbors belonging + * to @s, %FALSE otherwise. + */ +gboolean gts_face_is_compatible (GtsFace * f, GtsSurface * s) +{ + g_return_val_if_fail (f != NULL, FALSE); + g_return_val_if_fail (s != NULL, FALSE); + + return !(triangle_is_incompatible (GTS_TRIANGLE (f), GTS_TRIANGLE (f)->e1, s) || + triangle_is_incompatible (GTS_TRIANGLE (f), GTS_TRIANGLE (f)->e2, s) || + triangle_is_incompatible (GTS_TRIANGLE (f), GTS_TRIANGLE (f)->e3, s)); +} Index: tags/1.0.5/gts/fifo.c =================================================================== --- tags/1.0.5/gts/fifo.c (nonexistent) +++ tags/1.0.5/gts/fifo.c (revision 953) @@ -0,0 +1,192 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +struct _GtsFifo { + GList * head; + GList * tail; +}; + +/** + * gts_fifo_new: + * + * Returns: a new #GtsFifo. + */ +GtsFifo * gts_fifo_new () +{ + GtsFifo * fifo = g_malloc (sizeof (GtsFifo)); + + fifo->head = fifo->tail = NULL; + return fifo; +} + +/** + * gts_fifo_write: + * @fifo: a #GtsFifo. + * @fp: a file pointer. + * + * Writes the content of @fifo in @fp. + */ +void gts_fifo_write (GtsFifo * fifo, FILE * fp) +{ + GList * i; + + g_return_if_fail (fifo != NULL); + g_return_if_fail (fp != NULL); + + fprintf (fp, "["); + i = fifo->head; + while (i) { + fprintf (fp, "%p ", i->data); + i = i->next; + } + fprintf (fp, "]"); +} + +/** + * gts_fifo_push: + * @fifo: a #GtsFifo. + * @data: data to add to @fifo. + * + * Push @data into @fifo. + */ +void gts_fifo_push (GtsFifo * fifo, gpointer data) +{ + g_return_if_fail (fifo != NULL); + + fifo->head = g_list_prepend (fifo->head, data); + if (fifo->tail == NULL) + fifo->tail = fifo->head; +} + +/** + * gts_fifo_pop: + * @fifo: a #GtsFifo. + * + * Removes the first element from @fifo. + * + * Returns: the first element in @fifo or %NULL if @fifo is empty. + */ +gpointer gts_fifo_pop (GtsFifo * fifo) +{ + gpointer data; + GList * tail; + + g_return_val_if_fail (fifo != NULL, NULL); + + if (fifo->tail == NULL) + return NULL; + tail = fifo->tail->prev; + data = fifo->tail->data; + fifo->head = g_list_remove_link (fifo->head, fifo->tail); + g_list_free_1 (fifo->tail); + fifo->tail = tail; + return data; +} + +/** + * gts_fifo_top: + * @fifo: a #GtsFifo. + * + * Returns: the first element in @fifo or %NULL if @fifo is empty. + */ +gpointer gts_fifo_top (GtsFifo * fifo) +{ + g_return_val_if_fail (fifo != NULL, NULL); + + if (fifo->tail == NULL) + return NULL; + return fifo->tail->data; +} + +/** + * gts_fifo_size: + * @fifo: a #GtsFifo. + * + * Returns: the number of elements in @fifo. + */ +guint gts_fifo_size (GtsFifo * fifo) +{ + g_return_val_if_fail (fifo != NULL, 0); + + return g_list_length (fifo->head); +} + +/** + * gts_fifo_destroy: + * @fifo: a #GtsFifo. + * + * Frees all the memory allocated for @fifo. + */ +void gts_fifo_destroy (GtsFifo * fifo) +{ + g_return_if_fail (fifo != NULL); + g_list_free (fifo->head); + g_free (fifo); +} + +/** + * gts_fifo_is_empty: + * @fifo: a #GtsFifo. + * + * Returns: %TRUE if @fifo is empty, %FALSE otherwise. + */ +gboolean gts_fifo_is_empty (GtsFifo * fifo) +{ + g_return_val_if_fail (fifo != NULL, TRUE); + + return (fifo->head == NULL); +} + +/** + * gts_fifo_foreach: + * @fifo: a #GtsFifo. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func in order for each item in @fifo, passing @data. + */ +void gts_fifo_foreach (GtsFifo * fifo, GtsFunc func, gpointer data) +{ + GList * i; + + g_return_if_fail (fifo != NULL); + g_return_if_fail (func != NULL); + + i = fifo->tail; + while (i) { + (* func) (i->data, data); + i = i->prev; + } +} + +/** + * gts_fifo_reverse: + * @fifo: a #GtsFifo. + * + * Reverses the order of elements in @fifo. + */ +void gts_fifo_reverse (GtsFifo * fifo) +{ + g_return_if_fail (fifo != NULL); + + fifo->tail = fifo->head; + fifo->head = g_list_reverse (fifo->head); +} Index: tags/1.0.5/gts/graph.c =================================================================== --- tags/1.0.5/gts/graph.c (nonexistent) +++ tags/1.0.5/gts/graph.c (revision 953) @@ -0,0 +1,1776 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "gts.h" + +/* GtsGNode */ + +gboolean gts_allow_floating_gnodes = FALSE; + +static void gnode_remove_container (GtsContainee * i, GtsContainer * c) +{ + (* GTS_CONTAINEE_CLASS (GTS_OBJECT_CLASS (gts_gnode_class ())->parent_class)->remove_container) (i, c); + if (GTS_SLIST_CONTAINEE (i)->containers == NULL && + !gts_allow_floating_gnodes && + !GTS_OBJECT_DESTROYED(GTS_OBJECT (i))) + gts_object_destroy (GTS_OBJECT (i)); +} + +static void gnode_class_init (GtsGNodeClass * klass) +{ + klass->weight = NULL; + + GTS_CONTAINEE_CLASS (klass)->remove_container = gnode_remove_container; +} + +static void gnode_init (GtsGNode * n) +{ + n->level = 0; +} + +/** + * gts_gnode_class: + * + * Returns: the #GtsGNodeClass. + */ +GtsGNodeClass * gts_gnode_class (void) +{ + static GtsGNodeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo gnode_info = { + "GtsGNode", + sizeof (GtsGNode), + sizeof (GtsGNodeClass), + (GtsObjectClassInitFunc) gnode_class_init, + (GtsObjectInitFunc) gnode_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = + gts_object_class_new (GTS_OBJECT_CLASS (gts_slist_container_class ()), + &gnode_info); + } + + return klass; +} + +/** + * gts_gnode_new: + * @klass: a #GtsGNodeClass. + * + * Returns: a new #GtsGNode. + */ +GtsGNode * gts_gnode_new (GtsGNodeClass * klass) +{ + GtsGNode * object; + + object = GTS_GNODE (gts_object_new (GTS_OBJECT_CLASS (klass))); + + return object; +} + +/** + * gts_gnode_foreach_neighbor: + * @n: a #GtsGNode. + * @g: a #GtsGraph or %NULL. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func for each neighbor #GtsGNode of @n (belonging to @g if + * @g is not %NULL. + */ +void gts_gnode_foreach_neighbor (GtsGNode * n, + GtsGraph * g, + GtsFunc func, + gpointer data) +{ + GSList * i; + + g_return_if_fail (n != NULL); + g_return_if_fail (func != NULL); + + i = GTS_SLIST_CONTAINER (n)->items; + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (g == NULL || gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (g))) + (* func) (n1, data); + i = i->next; + } +} + +/** + * gts_gnode_foreach_edge: + * @n: a #GtsGNode. + * @g: a #GtsGraph or %NULL. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func for each #GtsGEdge connecting @n to another #GtsGNode + * (belonging to @g if @g is not %NULL. + */ +void gts_gnode_foreach_edge (GtsGNode * n, + GtsGraph * g, + GtsFunc func, + gpointer data) +{ + GSList * i; + + g_return_if_fail (n != NULL); + g_return_if_fail (func != NULL); + + i = GTS_SLIST_CONTAINER (n)->items; + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (g == NULL || gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (g))) + (* func) (i->data, data); + i = i->next; + } +} + +/** + * gts_gnode_degree: + * @n: a #GtsGNode. + * @g: a #GtsGraph or %NULL. + * + * Returns: the number of neighbors of @n (belonging to @g if @g is not %NULL). + */ +guint gts_gnode_degree (GtsGNode * n, + GtsGraph * g) +{ + GSList * i; + guint nn = 0; + + g_return_val_if_fail (n != NULL, 0); + + i = GTS_SLIST_CONTAINER (n)->items; + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (g == NULL || gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (g))) + nn++; + i = i->next; + } + + return nn; +} + +/** + * gts_gnode_move_cost: + * @n: a #GtsGNode. + * @src: a #GtsGraph containing @n. + * @dst: another #GtsGraph. + * + * Returns: the cost (increase in the sum of the weights of the edges cut) of + * moving @n from @src to @dst. + */ +gfloat gts_gnode_move_cost (GtsGNode * n, + GtsGraph * src, + GtsGraph * dst) +{ + GSList * i; + gfloat cost = 0.; + + g_return_val_if_fail (n != NULL, G_MAXFLOAT); + g_return_val_if_fail (src != NULL, G_MAXFLOAT); + g_return_val_if_fail (dst != NULL, G_MAXFLOAT); + g_return_val_if_fail (gts_containee_is_contained (GTS_CONTAINEE (n), + GTS_CONTAINER (src)), + G_MAXFLOAT); + + i = GTS_SLIST_CONTAINER (n)->items; + while (i) { + GtsGEdge * ge = i->data; + GtsGNode * neighbor = GTS_GNODE_NEIGHBOR (n, ge); + + if (gts_containee_is_contained (GTS_CONTAINEE (neighbor), + GTS_CONTAINER (src))) + cost += gts_gedge_weight (ge); + else if (gts_containee_is_contained (GTS_CONTAINEE (neighbor), + GTS_CONTAINER (dst))) + cost -= gts_gedge_weight (ge); + i = i->next; + } + + return cost; +} + +/** + * gts_gnode_weight: + * @n: a #GtsGNode. + * + * Returns: the weight of @n as defined by the weight() method of the + * #GtsGNodeClass. + */ +gfloat gts_gnode_weight (GtsGNode * n) +{ + g_return_val_if_fail (n != NULL, 0.); + + if (GTS_GNODE_CLASS (GTS_OBJECT (n)->klass)->weight) + return (* GTS_GNODE_CLASS (GTS_OBJECT (n)->klass)->weight) (n); + return 1.; +} + +/* GtsNGNode */ + +static void ngnode_init (GtsNGNode * n) +{ + n->id = 0; +} + +/** + * gts_ngnode_class: + * + * Returns: the #GtsNGNodeClass. + */ +GtsNGNodeClass * gts_ngnode_class (void) +{ + static GtsNGNodeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo ngnode_info = { + "GtsNGNode", + sizeof (GtsNGNode), + sizeof (GtsNGNodeClass), + (GtsObjectClassInitFunc) NULL, + (GtsObjectInitFunc) ngnode_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_gnode_class ()), + &ngnode_info); + } + + return klass; +} + +/** + * gts_ngnode_new: + * @klass: a #GtsNGNodeClass. + * + * Returns: a new #GtsNGNode with identity @id. + */ +GtsNGNode * gts_ngnode_new (GtsNGNodeClass * klass, + guint id) +{ + GtsNGNode * n; + + n = GTS_NGNODE (gts_gnode_new (GTS_GNODE_CLASS (klass))); + n->id = id; + + return n; +} + +/* GtsWGNode */ + +static gfloat wgnode_weight (GtsGNode * n) +{ + return GTS_WGNODE (n)->weight; +} + +static void wgnode_class_init (GtsWGNodeClass * klass) +{ + GTS_GNODE_CLASS (klass)->weight = wgnode_weight; +} + +static void wgnode_init (GtsWGNode * n) +{ + n->weight = 1.; +} + +/** + * gts_wgnode_class: + * + * Returns: the #GtsWGNodeClass. + */ +GtsWGNodeClass * gts_wgnode_class (void) +{ + static GtsWGNodeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo wgnode_info = { + "GtsWGNode", + sizeof (GtsWGNode), + sizeof (GtsWGNodeClass), + (GtsObjectClassInitFunc) wgnode_class_init, + (GtsObjectInitFunc) wgnode_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_gnode_class ()), + &wgnode_info); + } + + return klass; +} + +/** + * gts_wgnode_new: + * @klass: a #GtsWGNodeClass. + * @weight: the weight of the #GtsWGNode to create. + * + * Returns: a new #GtsWGNode of weight @weight. + */ +GtsWGNode * gts_wgnode_new (GtsWGNodeClass * klass, + gfloat weight) +{ + GtsWGNode * n; + + n = GTS_WGNODE (gts_gnode_new (GTS_GNODE_CLASS (klass))); + n->weight = weight; + + return n; +} + +/* GtsPNode */ + +static void pnode_write (GtsGNode * n, FILE * fp) +{ + if (GTS_IS_NVERTEX (GTS_PNODE (n)->data)) + fprintf (fp, "label=\"%p:%s\",", + GTS_PNODE (n)->data, + GTS_NVERTEX (GTS_PNODE (n)->data)->name); + else + fprintf (fp, "label=\"%p\",", GTS_PNODE (n)->data); +} + +static void pnode_class_init (GtsPNodeClass * klass) +{ + GTS_GNODE_CLASS (klass)->write = pnode_write; +} + +static void pnode_init (GtsPNode * pn) +{ + pn->data = NULL; +} + +/** + * gts_pnode_class: + * + * Returns: the #GtsPNodeClass. + */ +GtsPNodeClass * gts_pnode_class (void) +{ + static GtsPNodeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo pnode_info = { + "GtsPNode", + sizeof (GtsPNode), + sizeof (GtsPNodeClass), + (GtsObjectClassInitFunc) pnode_class_init, + (GtsObjectInitFunc) pnode_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_gnode_class ()), + &pnode_info); + } + + return klass; +} + +/** + * gts_pnode_new: + * @klass: a #GtsPNodeClass. + * @data: user data. + * + * Returns: a new #GtsPNode associated with @data. + */ +GtsPNode * gts_pnode_new (GtsPNodeClass * klass, gpointer data) +{ + GtsPNode * pn; + + pn = GTS_PNODE (gts_object_new (GTS_OBJECT_CLASS (klass))); + pn->data = data; + + return pn; +} + +/* GtsFNode */ + +static void fnode_write (GtsGNode * n, FILE * fp) +{ + fprintf (fp, "label=\"%p\",", GTS_FNODE (n)->f); +} + +static void fnode_class_init (GtsGNodeClass * klass) +{ + klass->write = fnode_write; +} + +static void fnode_init (GtsFNode * fn) +{ + fn->f = NULL; +} + +/** + * gts_fnode_class: + * + * Returns: the #GtsFNodeClass. + */ +GtsFNodeClass * gts_fnode_class (void) +{ + static GtsFNodeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo fnode_info = { + "GtsFNode", + sizeof (GtsFNode), + sizeof (GtsFNodeClass), + (GtsObjectClassInitFunc) fnode_class_init, + (GtsObjectInitFunc) fnode_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_gnode_class ()), + &fnode_info); + } + + return klass; +} + +/** + * gts_fnode_new: + * @klass: a #GtsFNodeClass. + * @f: a #GtsFace. + * + * Returns: a new #GtsFNode associated with face @f. + */ +GtsFNode * gts_fnode_new (GtsFNodeClass * klass, GtsFace * f) +{ + GtsFNode * fn; + + g_return_val_if_fail (f != NULL, NULL); + + fn = GTS_FNODE (gts_object_new (GTS_OBJECT_CLASS (klass))); + fn->f = f; + + return fn; +} + +/* GtsGEdge */ + +static void gedge_destroy (GtsObject * object) +{ + GtsGEdge * ge = GTS_GEDGE (object); + + if (ge->n1) + gts_container_remove (GTS_CONTAINER (ge->n1), GTS_CONTAINEE (ge)); + if (ge->n2) + gts_container_remove (GTS_CONTAINER (ge->n2), GTS_CONTAINEE (ge)); + + (* GTS_OBJECT_CLASS (gts_gedge_class ())->parent_class->destroy) (object); +} + +static void gedge_remove_container (GtsContainee * i, GtsContainer * c) +{ + GtsGEdge * ge = GTS_GEDGE (i); + GtsGNode * n1 = ge->n1; + GtsGNode * n2 = ge->n2; + + ge->n1 = ge->n2 = NULL; + if (n1 != NULL && n2 != NULL) { + if (GTS_CONTAINER (n1) == c) { + if (n2 && n2 != n1) gts_container_remove (GTS_CONTAINER (n2), i); + } + else if (GTS_CONTAINER (n2) == c) { + if (n1 && n1 != n2) gts_container_remove (GTS_CONTAINER (n1), i); + } + else + g_assert_not_reached (); + (* GTS_OBJECT_CLASS (gts_gedge_class ())->parent_class->destroy) + (GTS_OBJECT (i)); + } +} + +static gboolean gedge_is_contained (GtsContainee * i, GtsContainer * c) +{ + GtsGEdge * ge = GTS_GEDGE (i); + + if (GTS_CONTAINER (ge->n1) == c || GTS_CONTAINER (ge->n2) == c) + return TRUE; + return FALSE; +} + +static void gedge_class_init (GtsGEdgeClass * klass) +{ + klass->link = NULL; + klass->weight = NULL; + + GTS_CONTAINEE_CLASS (klass)->remove_container = gedge_remove_container; + GTS_CONTAINEE_CLASS (klass)->is_contained = gedge_is_contained; + + GTS_OBJECT_CLASS (klass)->destroy = gedge_destroy; +} + +static void gedge_init (GtsGEdge * object) +{ + object->n1 = object->n2 = NULL; +} + +/** + * gts_gedge_class: + * + * Returns: the #GtsGEdgeClass. + */ +GtsGEdgeClass * gts_gedge_class (void) +{ + static GtsGEdgeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo gedge_info = { + "GtsGEdge", + sizeof (GtsGEdge), + sizeof (GtsGEdgeClass), + (GtsObjectClassInitFunc) gedge_class_init, + (GtsObjectInitFunc) gedge_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_containee_class ()), + &gedge_info); + } + + return klass; +} + +/** + * gts_gedge_new: + * @klass: a #GtsGEdgeClass. + * @n1: a #GtsGNode. + * @n2: another #GtsGNode. + * + * Returns: a new #GtsGEdge linking @n1 and @n2. + */ +GtsGEdge * gts_gedge_new (GtsGEdgeClass * klass, GtsGNode * n1, GtsGNode * n2) +{ + GtsGEdge * object; + + g_return_val_if_fail (n1 != NULL, NULL); + g_return_val_if_fail (n2 != NULL, NULL); + + object = GTS_GEDGE (gts_object_new (GTS_OBJECT_CLASS (klass))); + object->n1 = n1; + gts_container_add (GTS_CONTAINER (n1), GTS_CONTAINEE (object)); + object->n2 = n2; + if (n1 != n2) + gts_container_add (GTS_CONTAINER (n2), GTS_CONTAINEE (object)); + + if (klass->link) + object = (* klass->link) (object, n1, n2); + + return object; +} + +/** + * gts_gedge_weight: + * @e: a #GtsGEdge. + * + * Returns: the weight of edge @e as defined by the weight() method of + * #GtsGEdgeClass. + */ +gfloat gts_gedge_weight (GtsGEdge * e) +{ + g_return_val_if_fail (e != NULL, 0.); + + if (GTS_GEDGE_CLASS (GTS_OBJECT (e)->klass)->weight) + return (* GTS_GEDGE_CLASS (GTS_OBJECT (e)->klass)->weight) (e); + return 1.; +} + +/* GtsPGEdge */ + +static void pgedge_write (GtsGEdge * ge, FILE * fp) +{ + if (GTS_IS_EDGE (GTS_PGEDGE (ge)->data)) { + GtsEdge * e = GTS_PGEDGE (ge)->data; + guint n = g_slist_length (e->triangles); + + fprintf (fp, "label=\"%p:%s:%d\",color=%s", e, + GTS_IS_NEDGE (e) ? GTS_NEDGE (e)->name : "", + n, + n == 0 ? "black" : + n == 1 ? "blue" : + n == 2 ? "green" : + n == 3 ? "violet" : + n == 4 ? "red" : + "pink"); + } + else + fprintf (fp, "label=\"%p\",", GTS_PGEDGE (ge)->data); +} + +static void pgedge_class_init (GtsPGEdgeClass * klass) +{ + GTS_GEDGE_CLASS (klass)->write = pgedge_write; +} + +static void pgedge_init (GtsPGEdge * e) +{ + e->data = NULL; +} + +/** + * gts_pgedge_class: + * + * Returns: the #GtsPGEdgeClass. + */ +GtsPGEdgeClass * gts_pgedge_class (void) +{ + static GtsPGEdgeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo pgedge_info = { + "GtsPGEdge", + sizeof (GtsPGEdge), + sizeof (GtsPGEdgeClass), + (GtsObjectClassInitFunc) pgedge_class_init, + (GtsObjectInitFunc) pgedge_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_gedge_class ()), + &pgedge_info); + } + + return klass; +} + +/** + * gts_pgedge_new: + * @klass: a #GtsPGEdgeClass. + * @n1: a #GtsGNode. + * @n2: another #GtsGNode. + * @data: user data. + * + * Returns: a new #GtsPGEdge associated with @data linking @n1 and @n2. + */ +GtsPGEdge * gts_pgedge_new (GtsPGEdgeClass * klass, + GtsGNode * g1, + GtsGNode * g2, + gpointer data) +{ + GtsPGEdge * we; + + we = GTS_PGEDGE (gts_gedge_new (GTS_GEDGE_CLASS (klass), g1, g2)); + we->data = data; + + return we; +} + +/* GtsWGEdge */ + +static gfloat wgedge_weight (GtsGEdge * e) +{ + return GTS_WGEDGE (e)->weight; +} + +static void wgedge_class_init (GtsWGEdgeClass * klass) +{ + GTS_GEDGE_CLASS (klass)->weight = wgedge_weight; +} + +static void wgedge_init (GtsWGEdge * e) +{ + e->weight = 1.; +} + +/** + * gts_wgedge_class: + * + * Returns: the #GtsWGEdgeClass. + */ +GtsWGEdgeClass * gts_wgedge_class (void) +{ + static GtsWGEdgeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo wgedge_info = { + "GtsWGEdge", + sizeof (GtsWGEdge), + sizeof (GtsWGEdgeClass), + (GtsObjectClassInitFunc) wgedge_class_init, + (GtsObjectInitFunc) wgedge_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_gedge_class ()), + &wgedge_info); + } + + return klass; +} + +/** + * gts_wgedge_new: + * @klass: a #GtsWGEdgeClass. + * @n1: a #GtsGNode. + * @n2: another #GtsGNode. + * @weight: the weight of the new edge. + * + * Returns: a new #GtsWGEdge of weight @weight linking @n1 and @n2. + */ +GtsWGEdge * gts_wgedge_new (GtsWGEdgeClass * klass, + GtsGNode * g1, + GtsGNode * g2, + gfloat weight) +{ + GtsWGEdge * we; + + we = GTS_WGEDGE (gts_gedge_new (GTS_GEDGE_CLASS (klass), g1, g2)); + we->weight = weight; + + return we; +} + +/* GtsGraph */ + +static void graph_init (GtsGraph * g) +{ + g->graph_class = gts_graph_class (); + g->node_class = gts_gnode_class (); + g->edge_class = gts_gedge_class (); +} + +static void graph_write (GtsObject * object, FILE * fp) +{ + GtsGraph * graph = GTS_GRAPH (object); + + fprintf (fp, " %s %s %s", + object->klass->info.name, + GTS_OBJECT_CLASS (graph->node_class)->info.name, + GTS_OBJECT_CLASS (graph->edge_class)->info.name); +} + +static void graph_read (GtsObject ** object, GtsFile * f) +{ + GtsObjectClass * klass; + + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsGNodeClass)"); + return; + } + klass = gts_object_class_from_name (f->token->str); + if (klass == NULL) { + gts_file_error (f, "unknown class `%s'", f->token->str); + return; + } + if (!gts_object_class_is_from_class (klass, gts_gnode_class ())) { + gts_file_error (f, "class `%s' is not a GtsGNodeClass", f->token->str); + return; + } + GTS_GRAPH (*object)->node_class = GTS_GNODE_CLASS (klass); + gts_file_next_token (f); + + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsGEdgeClass)"); + return; + } + klass = gts_object_class_from_name (f->token->str); + if (klass == NULL) { + gts_file_error (f, "unknown class `%s'", f->token->str); + return; + } + if (!gts_object_class_is_from_class (klass, gts_gedge_class ())) { + gts_file_error (f, "class `%s' is not a GtsGEdgeClass", f->token->str); + return; + } + GTS_GRAPH (*object)->edge_class = GTS_GEDGE_CLASS (klass); + gts_file_next_token (f); +} + +static void graph_class_init (GtsGraphClass * klass) +{ + klass->weight = NULL; + + GTS_OBJECT_CLASS (klass)->write = graph_write; + GTS_OBJECT_CLASS (klass)->read = graph_read; +} + +/** + * gts_graph_class: + * + * Returns: the #GtsGraphClass. + */ +GtsGraphClass * gts_graph_class (void) +{ + static GtsGraphClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo graph_info = { + "GtsGraph", + sizeof (GtsGraph), + sizeof (GtsGraphClass), + (GtsObjectClassInitFunc) graph_class_init, + (GtsObjectInitFunc) graph_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_hash_container_class ()), + &graph_info); + } + + return klass; +} + +/** + * gts_graph_new: + * @klass: a #GtsGraphClass. + * @node_class: a #GtsGNodeClass. + * @edge_class: a #GtsGEdgeClass. + * + * Returns: a new #GtsGraph using @node_class and @edge_class as node types. + */ +GtsGraph * gts_graph_new (GtsGraphClass * klass, + GtsGNodeClass * node_class, + GtsGEdgeClass * edge_class) +{ + GtsGraph * g; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (node_class != NULL, NULL); + g_return_val_if_fail (edge_class != NULL, NULL); + + g = GTS_GRAPH (gts_object_new (GTS_OBJECT_CLASS (klass))); + g->node_class = node_class; + g->edge_class = edge_class; + + return g; +} + +static void compute_degree (GtsGNode * n, gpointer * data) +{ + GtsGraph * g = data[0]; + GtsRange * degree = data[1]; + + gts_range_add_value (degree, gts_gnode_degree (n, g)); +} + +/** + * gts_graph_print_stats: + * @g: a #GtsGraph. + * @fp: a file pointer. + * + * Writes to @fp a summary of the properties of @g. + */ +void gts_graph_print_stats (GtsGraph * g, FILE * fp) +{ + GtsRange degree; + gpointer data[2]; + + g_return_if_fail (g != NULL); + g_return_if_fail (fp != NULL); + + fprintf (fp, "# nodes: %d weight: %g\n", + gts_container_size (GTS_CONTAINER (g)), + gts_graph_weight (g)); + fprintf (fp, "# degree: "); + gts_range_init (°ree); + data[0] = g; + data[1] = °ree; + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) compute_degree, data); + gts_range_update (°ree); + gts_range_print (°ree, fp); + fprintf (fp, "\n"); + fprintf (fp, "# edges cut: %d edges cut weight: %g\n", + gts_graph_edges_cut (g), + gts_graph_edges_cut_weight (g)); +} + +struct _GtsGraphTraverse { + GtsFifo * q; + GtsGraph * g; +}; + +static void reset_level (GtsGNode * n) +{ + n->level = 0; +} + +/** + * gts_graph_traverse_new: + * @g: a #GtsGraph. + * @n: a #GtsGNode belonging to @g. + * @type: the type of traversal. + * @reinit: if %TRUE, the traversal is reinitialized. + * + * Returns: a new #GtsGraphTraverse initialized for the traversal of + * @g of type @type, starting from @n. + */ +GtsGraphTraverse * gts_graph_traverse_new (GtsGraph * g, + GtsGNode * n, + GtsTraverseType type, + gboolean reinit) +{ + GtsGraphTraverse * t; + + g_return_val_if_fail (g != NULL, NULL); + g_return_val_if_fail (n != NULL, NULL); + g_return_val_if_fail (gts_containee_is_contained (GTS_CONTAINEE (n), + GTS_CONTAINER (g)), + NULL); + + if (reinit) + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) reset_level, NULL); + + t = g_malloc (sizeof (GtsGraphTraverse)); + t->q = gts_fifo_new (); + t->g = g; + n->level = 1; + gts_fifo_push (t->q, n); + + return t; +} + +static void push_neighbor (GtsGNode * n, gpointer * data) +{ + GtsFifo * q = data[0]; + GtsGNode * u = data[1]; + + if (n->level == 0) { + n->level = u->level + 1; + gts_fifo_push (q, n); + } +} + +/** + * gts_graph_traverse_next: + * @t: a #GtsGraphTraverse. + * + * Returns: the next #GtsGNode of the traversal defined by @t or %NULL + * if the traversal is complete. + */ +GtsGNode * gts_graph_traverse_next (GtsGraphTraverse * t) +{ + GtsGNode * u; + + g_return_val_if_fail (t != NULL, NULL); + + u = gts_fifo_pop (t->q); + if (u) { + gpointer data[2]; + + data[0] = t->q; + data[1] = u; + gts_gnode_foreach_neighbor (u, t->g, (GtsFunc) push_neighbor, data); + } + + return u; +} + +/** + * gts_graph_traverse_what_next: + * @t: a #GtsGraphTraverse. + * + * Returns: the next #GtsGNode of the traversal defined by @t or %NULL + * if the traversal is complete but without advancing the traversal. + */ +GtsGNode * gts_graph_traverse_what_next (GtsGraphTraverse * t) +{ + g_return_val_if_fail (t != NULL, NULL); + + return gts_fifo_top (t->q); +} + +/** + * gts_graph_traverse_destroy: + * @t: a #GtsGraphTraverse. + * + * Frees all the memory allocated for @t. + */ +void gts_graph_traverse_destroy (GtsGraphTraverse * t) +{ + g_return_if_fail (t != NULL); + + gts_fifo_destroy (t->q); + g_free (t); +} + +static void edge_foreach_node (GtsGNode * n, gpointer * info) +{ + GtsFunc func = (GtsFunc) info[0]; + gpointer data = info[1]; + GHashTable * hash = info[2]; + GSList * i = GTS_SLIST_CONTAINER (n)->items; + + while (i) { + GtsGEdge * e = i->data; + if (!g_hash_table_lookup (hash, e)) { + (* func) (e, data); + g_hash_table_insert (hash, e, e); + } + i = i->next; + } +} + +/** + * gts_graph_foreach_edge: + * @g: a #GtsGraph. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func for each #GtsEdge of @g. + */ +void gts_graph_foreach_edge (GtsGraph * g, GtsFunc func, gpointer data) +{ + gpointer info[3]; + GHashTable * hash; + + g_return_if_fail (g != NULL); + g_return_if_fail (func != NULL); + + info[0] = func; + info[1] = data; + info[2] = hash = g_hash_table_new (NULL, NULL); + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) edge_foreach_node, info); + g_hash_table_destroy (hash); +} + +/** + * gts_graph_weight: + * @g: a #GtsGraph. + * + * Returns: the weight of graph @g as defined by the weight() method + * of #GtsGraphClass. + */ +gfloat gts_graph_weight (GtsGraph * g) +{ + g_return_val_if_fail (g != NULL, 0.); + + if (GTS_GRAPH_CLASS (GTS_OBJECT (g)->klass)->weight) + return (* GTS_GRAPH_CLASS (GTS_OBJECT (g)->klass)->weight) (g); + return (gfloat) gts_container_size (GTS_CONTAINER (g)); +} + +/** + * gts_graph_distance_sum: + * @g: a #GtsGraph. + * @center: a #GtsGNode of @g. + * + * Returns: the sum of the distances between all the other #GtsGNode + * of @g and @center. + */ +guint gts_graph_distance_sum (GtsGraph * g, GtsGNode * center) +{ + GtsGraphTraverse * t; + GtsGNode * n; + guint sum = 0; + + g_return_val_if_fail (g != NULL, 0); + g_return_val_if_fail (center != NULL, 0); + + t = gts_graph_traverse_new (g, center, GTS_BREADTH_FIRST, TRUE); + while ((n = gts_graph_traverse_next (t))) + sum += n->level - 1; + gts_graph_traverse_destroy (t); + + return sum; +} + +/** + * gts_graph_farthest: + * @g: a #GtsGraph. + * @gnodes: a list of #GtsGNode belonging to @g. + * + * Returns: the #GtsGNode belonging to @g and farthest from all the nodes in + * @gnodes (hmmm, definition of "farthest"?). + */ +GtsGNode * gts_graph_farthest (GtsGraph * g, GSList * gnodes) +{ + GtsGNode * farthest = NULL; + GSList * i; + gboolean reinit = TRUE, changed = TRUE; + guint level = 1; + + g_return_val_if_fail (g != NULL, NULL); + + /* initialize traversals */ + i = gnodes; + while (i) { + GTS_OBJECT (i->data)->reserved = + gts_graph_traverse_new (g, i->data, GTS_BREADTH_FIRST, reinit); + reinit = FALSE; + i = i->next; + } + + while (changed) { + changed = FALSE; + i = gnodes; + while (i) { + GtsGraphTraverse * t = GTS_OBJECT (i->data)->reserved; + GtsGNode * n; + while ((n = gts_graph_traverse_what_next (t)) && n->level == level) { + changed = TRUE; + farthest = n; + gts_graph_traverse_next (t); + } + i = i->next; + } + level++; + } + + /* destroy traversals */ + i = gnodes; + while (i) { + gts_graph_traverse_destroy (GTS_OBJECT (i->data)->reserved); + GTS_OBJECT (i->data)->reserved = NULL; + i = i->next; + } + return farthest; +} + +static void neighbor_count (GtsGNode * n, gpointer * data) +{ + guint * cuts = data[0]; + GtsGraph * g = data[1]; + + if (!gts_containee_is_contained (GTS_CONTAINEE (n), GTS_CONTAINER (g))) + (*cuts)++; +} + +static void count_edge_cuts (GtsGNode * n, gpointer * data) +{ + gts_gnode_foreach_neighbor (n, NULL, (GtsFunc) neighbor_count, data); +} + +/** + * gts_graph_edges_cut: + * @g: a #GtsGraph. + * + * Returns: the number of edges of @g connecting nodes belonging to @g + * to nodes not belonging to @g. + */ +guint gts_graph_edges_cut (GtsGraph * g) +{ + guint cuts = 0; + gpointer data[2]; + + g_return_val_if_fail (g != NULL, 0); + + data[0] = &cuts; + data[1] = g; + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) count_edge_cuts, data); + + return cuts; +} + +static void sum_edge_cuts_weight (GtsGNode * n, gpointer * data) +{ + gfloat * weight = data[0]; + GtsGraph * g = data[1]; + GSList * i = GTS_SLIST_CONTAINER (n)->items; + + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (!gts_containee_is_contained (GTS_CONTAINEE (n1), GTS_CONTAINER (g))) + *weight += gts_gedge_weight (i->data); + i = i->next; + } +} + +/** + * gts_graph_edges_cut_weight: + * @g: a #GtsGraph. + * + * Returns: the sum of the weights of the edges of @g connecting nodes + * belonging to @g to nodes not belonging to @g. + */ +gfloat gts_graph_edges_cut_weight (GtsGraph * g) +{ + gfloat weight = 0.; + gpointer data[2]; + + g_return_val_if_fail (g != NULL, 0); + + data[0] = &weight; + data[1] = g; + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) sum_edge_cuts_weight, + data); + + return weight; +} + +/** + * gts_graph_read_jostle: + * @g: a #GtsGraph. + * @fp: a #GtsFile. + * + * Adds to @g the nodes and edges defined in the file pointed to by + * @fp. This file must use the Jostle "graph" ASCII format. + * The nodes created are of type #GtsNGNode and their identities are the + * line number at which they appear in @fp. + * + * Returns: 0 if the lecture was successful, the line number at which + * an error occured otherwise (in which case the @error field of @fp + * is set). + */ +guint gts_graph_read_jostle (GtsGraph * g, GtsFile * fp) +{ + guint nn, ne, n; + GtsGNode ** nodes; + + g_return_val_if_fail (g != NULL, 1); + g_return_val_if_fail (fp != NULL, 1); + + if (fp->type != GTS_INT) { + gts_file_error (fp, "expecting an integer (number of nodes)"); + return fp->line; + } + nn = atoi (fp->token->str); + gts_file_next_token (fp); + + if (fp->type != GTS_INT) { + gts_file_error (fp, "expecting an integer (number of edges)"); + return fp->line; + } + ne = atoi (fp->token->str); + + gts_file_first_token_after (fp, '\n'); + nodes = g_malloc (sizeof (GtsGNode *)*(nn + 1)); + + n = 0; + while (n < nn && fp->type != GTS_ERROR) { + GtsNGNode * node = gts_ngnode_new (gts_ngnode_class (), fp->line); + + nodes[n++] = GTS_GNODE (node); + gts_container_add (GTS_CONTAINER (g), GTS_CONTAINEE (node)); + do { + if (fp->type != GTS_INT) + gts_file_error (fp, "expecting an integer (node index)"); + else { + guint in = atoi (fp->token->str); + + if (in == 0 || in > nn) + gts_file_error (fp, "node index `%d' is out of range `[1,%d]'", + in, nn); + else if (in == n) + gts_file_error (fp, "node index `%d' references itself", in); + else if (in < n) { + gts_gedge_new (g->edge_class, GTS_GNODE (node), nodes[in - 1]); + ne--; + gts_file_next_token (fp); + } + } + } while (fp->type != GTS_ERROR && fp->type != '\n'); + } + g_free (nodes); + + if (fp->type != GTS_ERROR) { + if (n != nn) + gts_file_error (fp, "only `%d' nodes read out of `%d'", + n, nn); + else if (ne > 0) + gts_file_error (fp, "`%d' unallocated edges remaining", + ne); + } + + if (fp->type == GTS_ERROR) + return fp->line; + return 0; +} + +static void count_edges (GtsGEdge * e, guint * nedge) +{ + (*nedge)++; +} + +static void write_node (GtsObject * node, gpointer * data) +{ + FILE * fp = data[0]; + guint * nnode = data[1]; + + node->reserved = GUINT_TO_POINTER ((*nnode)++); + if (node->klass->write) + (* node->klass->write) (node, fp); + fputc ('\n', fp); +} + +static void write_edge (GtsGEdge * edge, FILE * fp) +{ + fprintf (fp, "%u %u", + GPOINTER_TO_UINT (GTS_OBJECT (edge->n1)->reserved), + GPOINTER_TO_UINT (GTS_OBJECT (edge->n2)->reserved)); + if (GTS_OBJECT (edge)->klass->write) + (* GTS_OBJECT (edge)->klass->write) (GTS_OBJECT (edge), fp); + fputc ('\n', fp); +} + +/** + * gts_graph_write: + * @g: a #GtsGraph. + * @fp: a file pointer. + * + * Writes in the file @fp an ASCII representation of @g. The file + * format is as follows. + * + * All the lines beginning with #GTS_COMMENTS are ignored. The first line + * contains two unsigned integers separated by spaces. The first + * integer is the number of nodes, nn, the second is the number of + * edges, ne. + * + * Follows nn lines containing node description. + * Follows ne lines containing the two indices (starting + * from one) of the nodes of each edge. + * + * The format described above is the least common denominator to all + * GTS files. Consistent with an object-oriented approach, the GTS + * file format is extensible. Each of the lines of the file can be + * extended with user-specific attributes accessible through the + * read() and write() virtual methods of each of the objects written + * (graph, nodes or edges). When read with different object classes, + * these extra attributes are just ignored. + */ +void gts_graph_write (GtsGraph * g, FILE * fp) +{ + guint nnode = 1, nedge = 0; + gpointer data[2]; + + g_return_if_fail (g != NULL); + g_return_if_fail (fp != NULL); + + gts_graph_foreach_edge (g, (GtsFunc) count_edges, &nedge); + fprintf (fp, "%u %u", gts_container_size (GTS_CONTAINER (g)), nedge); + if (GTS_OBJECT (g)->klass->write) + (* GTS_OBJECT (g)->klass->write) (GTS_OBJECT (g), fp); + fputc ('\n', fp); + data[0] = fp; + data[1] = &nnode; + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) write_node, data); + gts_graph_foreach_edge (g, (GtsFunc) write_edge, fp); + gts_container_foreach (GTS_CONTAINER (g), + (GtsFunc) gts_object_reset_reserved, NULL); +} + +/** + * gts_graph_read: + * @fp: a #GtsFile. + * + * Reads a graph from a file. + * + * Returns: the new #GtsGraph or %NULL if an error occured (in which + * case the @error field of @fp is set). + */ +GtsGraph * gts_graph_read (GtsFile * fp) +{ + GtsGraph * g; + GtsGNode ** nodes; + guint nn, ne, n; + + g_return_val_if_fail (fp != NULL, NULL); + + if (fp->type != GTS_INT) { + gts_file_error (fp, "expecting an integer (number of nodes)"); + return NULL; + } + nn = atoi (fp->token->str); + gts_file_next_token (fp); + + if (fp->type != GTS_INT) { + gts_file_error (fp, "expecting an integer (number of edges)"); + return NULL; + } + ne = atoi (fp->token->str); + + gts_file_next_token (fp); + if (fp->type != '\n') { + GtsObjectClass * klass; + + gts_graph_class (); + gts_gnode_class (); + gts_gedge_class (); + + if (fp->type != GTS_STRING) { + gts_file_error (fp, "expecting a string (GtsGraphClass)"); + return NULL; + } + klass = gts_object_class_from_name (fp->token->str); + if (klass == NULL) { + gts_file_error (fp, "unknown class `%s'", fp->token->str); + return NULL; + } + if (!gts_object_class_is_from_class (klass, gts_graph_class ())) { + gts_file_error (fp, "class `%s' is not a GtsGraphClass", fp->token->str); + return NULL; + } + g = GTS_GRAPH (gts_object_new (klass)); + g->graph_class = GTS_GRAPH_CLASS (klass); + gts_file_next_token (fp); + (* klass->read) ((GtsObject **) &g, fp); + if (fp->type == GTS_ERROR) { + gts_object_destroy (GTS_OBJECT (g)); + return NULL; + } + } + else + g = GTS_GRAPH (gts_object_new (GTS_OBJECT_CLASS (gts_graph_class ()))); + gts_file_first_token_after (fp, '\n'); + if (nn <= 0) + return g; + + nodes = g_malloc ((nn + 1)*sizeof (GtsGNode *)); + + n = 0; + while (n < nn && fp->type != GTS_ERROR) { + GtsObject * new_node = + gts_object_new (GTS_OBJECT_CLASS (g->node_class)); + + gts_container_add (GTS_CONTAINER (g), GTS_CONTAINEE (new_node)); + if (GTS_OBJECT_CLASS (g->node_class)->read) + (*GTS_OBJECT_CLASS (g->node_class)->read) (&new_node, fp); + gts_file_first_token_after (fp, '\n'); + nodes[n++] = GTS_GNODE (new_node); + } + if (fp->type == GTS_ERROR) + nn = n; + + n = 0; + while (n < ne && fp->type != GTS_ERROR) { + guint n1, n2; + + if (fp->type != GTS_INT) + gts_file_error (fp, "expecting an integer (first node index)"); + else { + n1 = atoi (fp->token->str); + if (n1 == 0 || n1 > nn) + gts_file_error (fp, "node index `%d' is out of range `[1,%d]'", + n1, nn); + else { + gts_file_next_token (fp); + if (fp->type != GTS_INT) + gts_file_error (fp, "expecting an integer (second node index)"); + else { + n2 = atoi (fp->token->str); + if (n2 == 0 || n2 > nn) + gts_file_error (fp, "node index `%d' is out of range `[1,%d]'", + n2, nn); + else { + GtsGEdge * new_edge = + gts_gedge_new (g->edge_class, nodes[n1 - 1], nodes [n2 - 1]); + + gts_file_next_token (fp); + if (fp->type != '\n') + if (GTS_OBJECT_CLASS (g->edge_class)->read) + (*GTS_OBJECT_CLASS (g->edge_class)->read) + ((GtsObject **) &new_edge, fp); + gts_file_first_token_after (fp, '\n'); + n++; + } + } + } + } + } + + if (fp->type == GTS_ERROR) { + gts_allow_floating_gnodes = TRUE; + while (nn) + gts_object_destroy (GTS_OBJECT (nodes[nn-- - 1])); + gts_allow_floating_gnodes = FALSE; + } + g_free (nodes); + + if (fp->type == GTS_ERROR) { + gts_object_destroy (GTS_OBJECT (g)); + return NULL; + } + return g; +} + +static void write_dot_node (GtsGNode * node, gpointer * data) +{ + FILE * fp = data[0]; + guint * nnode = data[1]; + + fprintf (fp, " n%u", *nnode); + if (GTS_GNODE_CLASS (GTS_OBJECT (node)->klass)->write) { + fputs (" [", fp); + (* GTS_GNODE_CLASS (GTS_OBJECT (node)->klass)->write) (node, fp); + fputc (']', fp); + } + fputs (";\n", fp); + GTS_OBJECT (node)->reserved = GUINT_TO_POINTER ((*nnode)++); +} + +static void write_dot_edge (GtsGEdge * edge, FILE * fp) +{ + fprintf (fp, " n%u -> n%u", + GPOINTER_TO_UINT (GTS_OBJECT (edge->n1)->reserved), + GPOINTER_TO_UINT (GTS_OBJECT (edge->n2)->reserved)); + if (GTS_GEDGE_CLASS (GTS_OBJECT (edge)->klass)->write) { + fputs (" [", fp); + (* GTS_GEDGE_CLASS (GTS_OBJECT (edge)->klass)->write) (edge, fp); + fputc (']', fp); + } + fputs (";\n", fp); +} + +/** + * gts_graph_write_dot: + * @g: a #GtsGraph. + * @fp: a file pointer. + * + * Writes in the file @fp an ASCII representation of @g in the dot format of + * AT&T Bell Labs. + */ +void gts_graph_write_dot (GtsGraph * g, FILE * fp) +{ + guint nnode = 1; + gpointer data[2]; + + g_return_if_fail (g != NULL); + g_return_if_fail (fp != NULL); + + fprintf (fp, "digraph \"%p\" {\n", g); + data[0] = fp; + data[1] = &nnode; + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) write_dot_node, data); + gts_graph_foreach_edge (g, (GtsFunc) write_dot_edge, fp); + fputs ("}\n", fp); + + gts_container_foreach (GTS_CONTAINER (g), + (GtsFunc) gts_object_reset_reserved, NULL); +} + +/* GtsWGraph */ + +static gfloat wgraph_weight (GtsGraph * g) +{ + return GTS_WGRAPH (g)->weight; +} + +static void wgraph_add (GtsContainer * g, GtsContainee * n) +{ + GtsWGraph * wg = GTS_WGRAPH (g); + gfloat w = gts_gnode_weight (GTS_GNODE (n)); + + wg->weight += w; + + (* GTS_CONTAINER_CLASS (GTS_OBJECT_CLASS (gts_wgraph_class ())->parent_class)->add) (g, n); +} + +static void wgraph_remove (GtsContainer * g, GtsContainee * n) +{ + GTS_WGRAPH (g)->weight -= gts_gnode_weight (GTS_GNODE (n)); + + (* GTS_CONTAINER_CLASS (GTS_OBJECT_CLASS (gts_wgraph_class ())->parent_class)->remove) (g, n); +} + +static void wgraph_class_init (GtsWGraphClass * klass) +{ + GTS_GRAPH_CLASS (klass)->weight = wgraph_weight; + + GTS_CONTAINER_CLASS (klass)->add = wgraph_add; + GTS_CONTAINER_CLASS (klass)->remove = wgraph_remove; +} + +static void wgraph_init (GtsWGraph * g) +{ + g->weight = 0.; +} + +/** + * gts_wgraph_class: + * + * Returns: the #GtsWGraphClass. + */ +GtsWGraphClass * gts_wgraph_class (void) +{ + static GtsWGraphClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo wgraph_info = { + "GtsWGraph", + sizeof (GtsWGraph), + sizeof (GtsWGraphClass), + (GtsObjectClassInitFunc) wgraph_class_init, + (GtsObjectInitFunc) wgraph_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_graph_class ()), + &wgraph_info); + } + + return klass; +} + +static void weight_max (GtsGNode * n, gfloat * wmax) +{ + gfloat w = gts_gnode_weight (n); + + if (w > *wmax) + *wmax = w; +} + +/** + * gts_wgraph_weight_max: + * @wg: a #GtsWGraph. + * + * Returns: the maximum weight of any vertices belonging to @g. + */ +gfloat gts_wgraph_weight_max (GtsWGraph * wg) +{ + gfloat wmax = - G_MAXFLOAT; + + g_return_val_if_fail (wg != NULL, 0.); + + gts_container_foreach (GTS_CONTAINER (wg), (GtsFunc) weight_max, &wmax); + + return wmax; +} + +/* Surface graph */ + +static void create_node (GtsFace * f, GtsGraph * graph) +{ + GtsFNode * fn = gts_fnode_new (gts_fnode_class (), f); + + gts_container_add (GTS_CONTAINER (graph), GTS_CONTAINEE (fn)); + GTS_OBJECT (f)->reserved = fn; +} + +static void create_edge (GtsEdge * e, GtsSurface * s) +{ + GSList * i = e->triangles; + + while (i) { + GtsFace * f = i->data; + if (GTS_IS_FACE (f) && gts_face_has_parent_surface (f, s)) { + GSList * j = i->next; + while (j) { + GtsFace * f1 = j->data; + if (GTS_IS_FACE (f1) && gts_face_has_parent_surface (f1, s)) + gts_pgedge_new (gts_pgedge_class (), + GTS_OBJECT (f)->reserved, + GTS_OBJECT (f1)->reserved, + e); + j = j->next; + } + } + i = i->next; + } +} + +/** + * gts_surface_graph_new: + * @klass: a #GtsGraphClass. + * @s: a #GtsSurface. + * + * Returns: a new #GtsGraph representing the connectivity of the faces + * of @s. This graph uses #GtsFGNode as nodes which allows to store + * the dependencies between nodes and faces of @s. + */ +GtsGraph * gts_surface_graph_new (GtsGraphClass * klass, + GtsSurface * s) +{ + GtsGraph * graph; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (s != NULL, NULL); + + graph = GTS_GRAPH (gts_object_new (GTS_OBJECT_CLASS (klass))); + gts_surface_foreach_face (s, (GtsFunc) create_node, graph); + gts_surface_foreach_edge (s, (GtsFunc) create_edge, s); + gts_surface_foreach_face (s, (GtsFunc) gts_object_reset_reserved, NULL); + + return graph; +} + +static void create_segment_edge (GtsSegment * s, GtsGraph * graph) +{ + GtsGNode * n1 = GTS_OBJECT (s->v1)->reserved, * n2; + + if (n1 == NULL) { + n1 = GTS_GNODE (gts_pnode_new (gts_pnode_class (), s->v1)); + gts_container_add (GTS_CONTAINER (graph), GTS_CONTAINEE (n1)); + GTS_OBJECT (s->v1)->reserved = n1; + } + + n2 = GTS_OBJECT (s->v2)->reserved; + if (n2 == NULL) { + n2 = GTS_GNODE (gts_pnode_new (gts_pnode_class (), s->v2)); + gts_container_add (GTS_CONTAINER (graph), GTS_CONTAINEE (n2)); + GTS_OBJECT (s->v2)->reserved = n2; + } + + gts_pgedge_new (gts_pgedge_class (), n1, n2, s); +} + +static void reset_reserved (GtsSegment * s) +{ + GTS_OBJECT (s->v1)->reserved = GTS_OBJECT (s->v2)->reserved = NULL; +} + +/** + * gts_segments_graph_new: + * @klass: a #GtsGraphClass. + * @segments: a list of #GtsSegment. + * + * Returns: a new #GtsGraph representing the connectivity of the segments + * in @segments. + */ +GtsGraph * gts_segments_graph_new (GtsGraphClass * klass, + GSList * segments) +{ + GtsGraph * graph; + + g_return_val_if_fail (klass != NULL, NULL); + + graph = GTS_GRAPH (gts_object_new (GTS_OBJECT_CLASS (klass))); + g_slist_foreach (segments, (GFunc) create_segment_edge, graph); + g_slist_foreach (segments, (GFunc) reset_reserved, NULL); + + return graph; +} + +static void add_to_surface (GtsGNode * n, GtsSurface * s) +{ + if (GTS_IS_FNODE (n)) + gts_surface_add_face (s, GTS_FNODE (n)->f); +} + +/** + * gts_surface_graph_surface: + * @surface_graph: a #GtsGraph using #GtsFGNode as nodes. + * @s: a #GtsSurface. + * + * Returns: a new #GtsSurface using the same classes as @s and + * composed of the faces defined by @surface_graph. + */ +GtsSurface * gts_surface_graph_surface (GtsGraph * surface_graph, + GtsSurface * s) +{ + GtsSurface * s1; + + g_return_val_if_fail (surface_graph != NULL, NULL); + g_return_val_if_fail (s != NULL, NULL); + + s1 = gts_surface_new (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass), + s->face_class, + s->edge_class, + s->vertex_class); + gts_container_foreach (GTS_CONTAINER (surface_graph), + (GtsFunc) add_to_surface, s1); + return s1; +} + Index: tags/1.0.5/gts/gts-private.h =================================================================== --- tags/1.0.5/gts/gts-private.h (nonexistent) +++ tags/1.0.5/gts/gts-private.h (revision 953) @@ -0,0 +1,37 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GTS_PRIVATE_H__ +#define __GTS_PRIVATE_H__ + +/* Debugging flags */ + +/* #define DEBUG_FUNCTIONS */ + +#ifdef DEBUG_FUNCTIONS +/* #define DEBUG_LEAKS */ +#define DEBUG_IDENTITY +guint id (gpointer p); +void id_insert (gpointer p); +void id_remove (gpointer p); +void gts_write_triangle (GtsTriangle * t, GtsPoint * o, FILE * fptr); +void gts_write_segment (GtsSegment * s, GtsPoint * o, FILE * fptr); +#endif /* DEBUG_FUNCTIONS */ + +#endif /* __GTS_PRIVATE_H__ */ Index: tags/1.0.5/gts/gts.h =================================================================== --- tags/1.0.5/gts/gts.h (nonexistent) +++ tags/1.0.5/gts/gts.h (revision 953) @@ -0,0 +1,2577 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GTS_H__ +#define __GTS_H__ + +#include +#include + +#define GTS_MAJOR_VERSION 0 +#define GTS_MINOR_VERSION 7 +#define GTS_MICRO_VERSION 6 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Added based on glib.h by M J Loehr 01/01/01 */ +/* GTS version. + * we prefix variable declarations so they can + * properly get exported in windows dlls. + */ +#ifdef NATIVE_WIN32 +# ifdef GTS_COMPILATION +# define GTS_C_VAR __declspec(dllexport) +# else /* not GTS_COMPILATION */ +# define GTS_C_VAR extern __declspec(dllimport) +# endif /* not GTS_COMPILATION */ +#else /* not NATIVE_WIN32 */ +# define GTS_C_VAR extern +#endif /* not NATIVE_WIN32 */ + +GTS_C_VAR const guint gts_major_version; +GTS_C_VAR const guint gts_minor_version; +GTS_C_VAR const guint gts_micro_version; +GTS_C_VAR const guint gts_interface_age; +GTS_C_VAR const guint gts_binary_age; + +#define GTS_CHECK_VERSION(major,minor,micro) \ + (gts_major_version > (major) || \ + (gts_major_version == (major) && gts_minor_version > (minor)) || \ + (gts_major_version == (major) && gts_minor_version == (minor) && \ + gts_micro_version >= (micro))) + +#define GTS_COMMENTS "#!" +#define GTS_MAINTAINER "popinet@users.sourceforge.net" + + + + +void gts_predicates_init(); + + +/* Class declarations for base types */ + +typedef struct _GtsObjectClassInfo GtsObjectClassInfo; +typedef struct _GtsObject GtsObject; +typedef struct _GtsObjectClass GtsObjectClass; +typedef struct _GtsPoint GtsPoint; +typedef struct _GtsPointClass GtsPointClass; +typedef struct _GtsVertex GtsVertex; +typedef struct _GtsVertexClass GtsVertexClass; +typedef struct _GtsSegment GtsSegment; +typedef struct _GtsSegmentClass GtsSegmentClass; +typedef struct _GtsEdge GtsEdge; +typedef struct _GtsEdgeClass GtsEdgeClass; +typedef struct _GtsTriangle GtsTriangle; +typedef struct _GtsTriangleClass GtsTriangleClass; +typedef struct _GtsFace GtsFace; +typedef struct _GtsFaceClass GtsFaceClass; +typedef struct _GtsBBox GtsBBox; +typedef struct _GtsBBoxClass GtsBBoxClass; +typedef struct _GtsSurface GtsSurface; +typedef struct _GtsSurfaceClass GtsSurfaceClass; + +typedef void (*GtsObjectClassInitFunc) (GtsObjectClass * objclass); +typedef void (*GtsObjectInitFunc) (GtsObject * obj); +typedef void (*GtsArgSetFunc) (GtsObject * obj); +typedef void (*GtsArgGetFunc) (GtsObject * obj); + +typedef gdouble GtsVector[3]; +typedef gdouble GtsVector4[4]; +typedef GtsVector4 GtsMatrix; +/** + * GtsKeyFunc: + * @item: A pointer to an item to be stored in the heap. + * @data: User data passed to gts_eheap_new(). + * + * Returns: the value of the key for the given item. + */ +typedef gdouble (*GtsKeyFunc) (gpointer item, + gpointer data); +typedef enum +{ + GTS_OUT = -1, + GTS_ON = 0, + GTS_IN = 1 +} GtsIntersect; + +typedef struct _GtsColor GtsColor; + +struct _GtsColor { + gfloat r, g, b; +}; + +typedef gint (*GtsFunc) (gpointer item, + gpointer data); + +/* misc.c */ + +typedef struct _GtsFile GtsFile; + +typedef enum { + GTS_NONE = 1 << 8, + GTS_INT = 1 << 9, + GTS_UINT = 1 << 10, + GTS_FLOAT = 1 << 11, + GTS_DOUBLE = 1 << 12, + GTS_STRING = 1 << 13, + GTS_FILE = 1 << 14, + GTS_ERROR = 1 << 15 +} GtsTokenType; + +struct _GtsFile { + FILE * fp; + gchar * s, * s1; + guint line, pos; + GString * token; + GtsTokenType type; + gchar * error; + + guint curline, curpos; + guint scope, scope_max; + gint next_token; + gchar * delimiters; + gchar * comments; + gchar * tokens; +}; + +typedef struct _GtsFileVariable GtsFileVariable; + +struct _GtsFileVariable { + GtsTokenType type; + gchar name[30]; + gboolean unique; + gpointer data; + gboolean set; + guint line, pos; +}; + + +GtsFile * gts_file_new (FILE * fp); +GtsFile * gts_file_new_from_string (const gchar * s); +void gts_file_verror (GtsFile * f, + const gchar * format, + va_list args); +void gts_file_error (GtsFile * f, + const gchar * format, + ...); +gint gts_file_getc (GtsFile * f); +guint gts_file_read (GtsFile * f, + gpointer ptr, + guint size, + guint nmemb); +gint gts_file_getc_scope (GtsFile * f); +void gts_file_next_token (GtsFile * f); +void gts_file_first_token_after (GtsFile * f, + GtsTokenType type); +void gts_file_assign_start (GtsFile * f, + GtsFileVariable * vars); +GtsFileVariable * gts_file_assign_next (GtsFile * f, + GtsFileVariable * vars); +void gts_file_assign_variables (GtsFile * f, + GtsFileVariable * vars); +void gts_file_variable_error (GtsFile * f, + GtsFileVariable * vars, + const gchar * name, + const gchar * format, + ...); +void gts_file_destroy (GtsFile * f); + +/* Objects: object.c */ + +#ifdef GTS_CHECK_CASTS +# define GTS_OBJECT_CAST(obj, type, klass) ((type *) gts_object_check_cast (obj, klass)) +# define GTS_OBJECT_CLASS_CAST(objklass, type, klass) ((type *) gts_object_class_check_cast (objklass, klass)) +#else /* not GTS_CHECK_CASTS */ +# define GTS_OBJECT_CAST(obj, type, klass) ((type *) (obj)) +# define GTS_OBJECT_CLASS_CAST(objklass, type, klass) ((type *) (objklass)) +#endif /* not GTS_CHECK_CASTS */ + +#define GTS_CLASS_NAME_LENGTH 40 +#define GTS_OBJECT(obj) GTS_OBJECT_CAST (obj,\ + GtsObject,\ + gts_object_class ()) +#define GTS_OBJECT_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsObjectClass,\ + gts_object_class()) +#define GTS_IS_OBJECT(obj) (gts_object_is_from_class (obj,\ + gts_object_class ())) + +typedef enum +{ + GTS_DESTROYED = 1 << 0, + GTS_USER_FLAG = 1 /* user flags start from here */ +} GtsObjectFlags; + +#define GTS_OBJECT_FLAGS(obj) (GTS_OBJECT (obj)->flags) +#define GTS_OBJECT_DESTROYED(obj) ((GTS_OBJECT_FLAGS (obj) & GTS_DESTROYED) != 0) +#define GTS_OBJECT_SET_FLAGS(obj,flag) G_STMT_START{ (GTS_OBJECT_FLAGS (obj) |= (flag)); }G_STMT_END +#define GTS_OBJECT_UNSET_FLAGS(obj,flag) G_STMT_START{ (GTS_OBJECT_FLAGS (obj) &= ~(flag)); }G_STMT_END + +struct _GtsObjectClassInfo { + gchar name[GTS_CLASS_NAME_LENGTH]; + guint object_size; + guint class_size; + GtsObjectClassInitFunc class_init_func; + GtsObjectInitFunc object_init_func; + GtsArgSetFunc arg_set_func; + GtsArgGetFunc arg_get_func; +}; + +struct _GtsObject { + GtsObjectClass * klass; + + gpointer reserved; + guint32 flags; +}; + +struct _GtsObjectClass { + GtsObjectClassInfo info; + GtsObjectClass * parent_class; + + void (* clone) (GtsObject *, GtsObject *); + void (* destroy) (GtsObject *); + void (* read) (GtsObject **, GtsFile *); + void (* write) (GtsObject *, FILE *); + GtsColor (* color) (GtsObject *); + void (* attributes) (GtsObject *, GtsObject *); +}; + +gpointer gts_object_class_new (GtsObjectClass * parent_class, + GtsObjectClassInfo * info); +GtsObjectClass * gts_object_class (void); +gpointer gts_object_check_cast (gpointer object, + gpointer klass); +gpointer gts_object_class_check_cast (gpointer klass, + gpointer from); + +static inline +gpointer gts_object_is_from_class (gpointer object, + gpointer klass) +{ + GtsObjectClass * c; + + g_return_val_if_fail (klass != NULL, NULL); + + if (object == NULL) + return NULL; + + c = ((GtsObject *) object)->klass; + + g_return_val_if_fail (c != NULL, NULL); + + while (c) { + if (c == klass) + return object; + c = c->parent_class; + } + + return NULL; +} + +static inline +gpointer gts_object_class_is_from_class (gpointer klass, + gpointer from) +{ + GtsObjectClass * c; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (from != NULL, NULL); + + c = (GtsObjectClass *) klass; + while (c) { + if (c == from) + return klass; + c = c->parent_class; + } + + return NULL; +} + +GtsObjectClass * gts_object_class_from_name (const gchar * name); + +GtsObject * gts_object_new (GtsObjectClass * klass); +GtsObject * gts_object_clone (GtsObject * object); +void gts_object_attributes (GtsObject * object, + GtsObject * from); +void gts_object_init (GtsObject * object, + GtsObjectClass * klass); +void gts_object_reset_reserved (GtsObject * object); +void gts_object_destroy (GtsObject * object); +void gts_finalize (void); + +/* Ranges: surface.c */ +typedef struct _GtsRange GtsRange; + +struct _GtsRange { + gdouble min, max, sum, sum2, mean, stddev; + guint n; +}; + +void gts_range_init (GtsRange * r); +void gts_range_reset (GtsRange * r); +void gts_range_add_value (GtsRange * r, + gdouble val); +void gts_range_update (GtsRange * r); +void gts_range_print (GtsRange * r, + FILE * fptr); + +/* Points: point.c */ + +#define GTS_IS_POINT(obj) (gts_object_is_from_class (obj,\ + gts_point_class ())) +#define GTS_POINT(obj) GTS_OBJECT_CAST (obj,\ + GtsPoint,\ + gts_point_class ()) +#define GTS_POINT_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsPointClass,\ + gts_point_class ()) + +struct _GtsPoint { + GtsObject object; + + gdouble x, y, z; /* must be contiguous (cast to robust functions) */ +}; + +struct _GtsPointClass { + GtsObjectClass parent_class; + gboolean binary; +}; + +GtsPointClass * gts_point_class (void); +GtsPoint * gts_point_new (GtsPointClass * klass, + gdouble x, + gdouble y, + gdouble z); +void gts_point_set (GtsPoint * p, + gdouble x, + gdouble y, + gdouble z); +#define gts_point_is_in_rectangle(p, p1, p2) ((p)->x >= (p1)->x &&\ + (p)->x <= (p2)->x &&\ + (p)->y >= (p1)->y &&\ + (p)->y <= (p2)->y &&\ + (p)->z >= (p1)->z &&\ + (p)->z <= (p2)->z) +GtsPoint * gts_segment_triangle_intersection (GtsSegment * s, + GtsTriangle * t, + gboolean boundary, + GtsPointClass * klass); +void gts_point_transform (GtsPoint * p, + GtsMatrix * m); +gdouble gts_point_distance (GtsPoint * p1, + GtsPoint * p2); +gdouble gts_point_distance2 (GtsPoint * p1, + GtsPoint * p2); +gdouble gts_point_orientation_3d (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + GtsPoint * p4); +gint gts_point_orientation_3d_sos (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + GtsPoint * p4); +GtsIntersect gts_point_is_in_triangle (GtsPoint * p, + GtsTriangle * t); +gdouble gts_point_in_circle (GtsPoint * p, + GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3); +gdouble gts_point_in_sphere (GtsPoint * p, + GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + GtsPoint * p4); +gdouble gts_point_in_triangle_circle (GtsPoint * p, + GtsTriangle * t); +gdouble gts_point_orientation (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3); +gint gts_point_orientation_sos (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3); +gdouble gts_point_segment_distance2 (GtsPoint * p, + GtsSegment * s); +gdouble gts_point_segment_distance (GtsPoint * p, + GtsSegment * s); +void gts_point_segment_closest (GtsPoint * p, + GtsSegment * s, + GtsPoint * closest); +gdouble gts_point_triangle_distance2 (GtsPoint * p, + GtsTriangle * t); +gdouble gts_point_triangle_distance (GtsPoint * p, + GtsTriangle * t); +void gts_point_triangle_closest (GtsPoint * p, + GtsTriangle * t, + GtsPoint * closest); +gboolean gts_point_is_inside_surface (GtsPoint * p, + GNode * tree, + gboolean is_open); + +/* Vertices: vertex.c */ + +#define GTS_IS_VERTEX(obj) (gts_object_is_from_class (obj,\ + gts_vertex_class ())) +#define GTS_VERTEX(obj) GTS_OBJECT_CAST (obj,\ + GtsVertex,\ + gts_vertex_class ()) +#define GTS_VERTEX_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsVertexClass,\ + gts_vertex_class ()) +struct _GtsVertex { + GtsPoint p; + + GSList * segments; +}; + +struct _GtsVertexClass { + GtsPointClass parent_class; + + void (* intersection_attributes) (GtsVertex *, + GtsObject *, + GtsObject *); +}; + +GTS_C_VAR +gboolean gts_allow_floating_vertices; + +GtsVertexClass * gts_vertex_class (void); +GtsVertex * gts_vertex_new (GtsVertexClass * klass, + gdouble x, + gdouble y, + gdouble z); +void gts_vertex_replace (GtsVertex * v, + GtsVertex * with); +gboolean gts_vertex_is_unattached (GtsVertex * v); +GtsSegment * gts_vertices_are_connected (GtsVertex * v1, + GtsVertex * v2); +GSList * gts_vertex_triangles (GtsVertex * v, + GSList * list); +GSList * gts_vertex_faces (GtsVertex * v, + GtsSurface * surface, + GSList * list); +GSList * gts_vertex_neighbors (GtsVertex * v, + GSList * list, + GtsSurface * surface); +GSList * gts_vertices_from_segments (GSList * segments); +gboolean gts_vertex_is_boundary (GtsVertex * v, + GtsSurface * surface); +GList * gts_vertices_merge (GList * vertices, + gdouble epsilon, + gboolean (* check) (GtsVertex *, GtsVertex *)); +GSList * gts_vertex_fan_oriented (GtsVertex * v, + GtsSurface * surface); +guint gts_vertex_is_contact (GtsVertex * v, gboolean sever); + +/* GtsVertexNormal: Header */ + +typedef struct _GtsVertexNormal GtsVertexNormal; + +struct _GtsVertexNormal { + /*< private >*/ + GtsVertex parent; + + /*< public >*/ + GtsVector n; +}; + +#define GTS_VERTEX_NORMAL(obj) GTS_OBJECT_CAST (obj,\ + GtsVertexNormal,\ + gts_vertex_normal_class ()) +#define GTS_IS_VERTEX_NORMAL(obj) (gts_object_is_from_class (obj,\ + gts_vertex_normal_class ())) + +GtsVertexClass * gts_vertex_normal_class (void); + +/* GtsColorVertex: Header */ + +typedef struct _GtsColorVertex GtsColorVertex; + +struct _GtsColorVertex { + /*< private >*/ + GtsVertex parent; + + /*< public >*/ + GtsColor c; +}; + +#define GTS_COLOR_VERTEX(obj) GTS_OBJECT_CAST (obj,\ + GtsColorVertex,\ + gts_color_vertex_class ()) +#define GTS_IS_COLOR_VERTEX(obj) (gts_object_is_from_class (obj,\ + gts_color_vertex_class ())) + +GtsVertexClass * gts_color_vertex_class (void); + +/* Segments: segment.c */ + +#define GTS_IS_SEGMENT(obj) (gts_object_is_from_class (obj,\ + gts_segment_class ())) +#define GTS_SEGMENT(obj) GTS_OBJECT_CAST (obj,\ + GtsSegment,\ + gts_segment_class ()) +#define GTS_SEGMENT_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsSegmentClass,\ + gts_segment_class ()) + +struct _GtsSegment { + GtsObject object; + + GtsVertex * v1; + GtsVertex * v2; +}; + +struct _GtsSegmentClass { + GtsObjectClass parent_class; +}; + +GtsSegmentClass * gts_segment_class (void); +GtsSegment * gts_segment_new (GtsSegmentClass * klass, + GtsVertex * v1, + GtsVertex * v2); +#define gts_segment_connect(s, e1, e2) (((s)->v1 == e1 &&\ + (s)->v2 == e2) || \ + ((s)->v1 == e2 &&\ + (s)->v2 == e1)) +#define gts_segments_are_identical(s1, s2) (((s1)->v1 == (s2)->v1 &&\ + (s1)->v2 == (s2)->v2)\ + ||\ + ((s1)->v1 == (s2)->v2 &&\ + (s1)->v2 == (s2)->v1)) +#define gts_segments_touch(s1, s2) ((s1)->v1 == (s2)->v1 ||\ + (s1)->v1 == (s2)->v2 ||\ + (s1)->v2 == (s2)->v1 ||\ + (s1)->v2 == (s2)->v2) +GtsIntersect gts_segments_are_intersecting (GtsSegment * s1, + GtsSegment * s2); +GtsSegment * gts_segment_is_duplicate (GtsSegment * s); +GtsVertex * gts_segment_midvertex (GtsSegment * s, + GtsVertexClass * klass); +GSList * gts_segments_from_vertices (GSList * vertices); +gboolean gts_segment_is_ok (GtsSegment * s); + +/* Edges: edge.c */ + +#define GTS_IS_EDGE(obj) (gts_object_is_from_class (obj,\ + gts_edge_class ())) +#define GTS_EDGE(obj) GTS_OBJECT_CAST (obj,\ + GtsEdge,\ + gts_edge_class ()) +#define GTS_EDGE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsEdgeClass,\ + gts_edge_class ()) + +struct _GtsEdge { + GtsSegment segment; + + GSList * triangles; +}; + +struct _GtsEdgeClass { + GtsSegmentClass parent_class; +}; + +GTS_C_VAR +gboolean gts_allow_floating_edges; + +GtsEdgeClass * gts_edge_class (void); +GtsEdge * gts_edge_new (GtsEdgeClass * klass, + GtsVertex * v1, + GtsVertex * v2); +/** + * gts_edge_is_unattached: + * @s: a #GtsEdge. + * + * Evaluates to %TRUE if no triangles uses @s as an edge, %FALSE otherwise. + */ +#define gts_edge_is_unattached(s) ((s)->triangles == NULL ? TRUE : FALSE) +GtsFace * gts_edge_has_parent_surface (GtsEdge * e, + GtsSurface * surface); +GtsFace * gts_edge_has_any_parent_surface (GtsEdge * e); +GtsFace * gts_edge_is_boundary (GtsEdge * e, + GtsSurface * surface); +void gts_edge_replace (GtsEdge * e, + GtsEdge * with); +GSList * gts_edges_from_vertices (GSList * vertices, + GtsSurface * parent); +guint gts_edge_face_number (GtsEdge * e, + GtsSurface * s); +gboolean gts_edge_collapse_is_valid (GtsEdge * e); +gboolean gts_edge_collapse_creates_fold (GtsEdge * e, + GtsVertex * v, + gdouble max); +GtsEdge * gts_edge_is_duplicate (GtsEdge * e); +GList * gts_edges_merge (GList * edges); +gboolean gts_edge_belongs_to_tetrahedron (GtsEdge * e); +guint gts_edge_is_contact (GtsEdge * e); +void gts_edge_swap (GtsEdge * e, + GtsSurface * s); +gboolean gts_edge_manifold_faces (GtsEdge * e, + GtsSurface * s, + GtsFace ** f1, + GtsFace ** f2); + +/* Triangles: triangle.c */ + +#define GTS_IS_TRIANGLE(obj) (gts_object_is_from_class (obj,\ + gts_triangle_class ())) +#define GTS_TRIANGLE(obj) GTS_OBJECT_CAST (obj,\ + GtsTriangle,\ + gts_triangle_class ()) +#define GTS_TRIANGLE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsTriangleClass,\ + gts_triangle_class ()) + +struct _GtsTriangle { + GtsObject object; + + GtsEdge * e1; + GtsEdge * e2; + GtsEdge * e3; +}; + +struct _GtsTriangleClass { + GtsObjectClass parent_class; +}; + +GtsTriangleClass * gts_triangle_class (void); +void gts_triangle_set (GtsTriangle * triangle, + GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3); +GtsTriangle * gts_triangle_new (GtsTriangleClass * klass, + GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3); +#define gts_triangle_vertex(t) (GTS_SEGMENT (GTS_TRIANGLE (t)->e1)->v1 ==\ + GTS_SEGMENT (GTS_TRIANGLE (t)->e2)->v1 || \ + GTS_SEGMENT (GTS_TRIANGLE (t)->e1)->v2 ==\ + GTS_SEGMENT (GTS_TRIANGLE (t)->e2)->v1 ? \ + GTS_SEGMENT (GTS_TRIANGLE (t)->e2)->v2 :\ + GTS_SEGMENT (GTS_TRIANGLE (t)->e2)->v1) +GtsVertex * gts_triangle_vertex_opposite (GtsTriangle * t, + GtsEdge * e); +GtsEdge * gts_triangle_edge_opposite (GtsTriangle * t, + GtsVertex * v); +gdouble gts_triangles_angle (GtsTriangle * t1, + GtsTriangle * t2); +gboolean gts_triangles_are_compatible (GtsTriangle * t1, + GtsTriangle * t2, + GtsEdge * e); +gdouble gts_triangle_area (GtsTriangle * t); +gdouble gts_triangle_perimeter (GtsTriangle * t); +gdouble gts_triangle_quality (GtsTriangle * t); +void gts_triangle_normal (GtsTriangle * t, + gdouble * x, + gdouble * y, + gdouble * z); +gdouble gts_triangle_orientation (GtsTriangle * t); +void gts_triangle_revert (GtsTriangle * t); +GSList * gts_triangles_from_edges (GSList * edges); +void gts_triangle_vertices_edges (GtsTriangle * t, + GtsEdge * e, + GtsVertex ** v1, + GtsVertex ** v2, + GtsVertex ** v3, + GtsEdge ** e1, + GtsEdge ** e2, + GtsEdge ** e3); +GtsTriangle * gts_triangle_enclosing (GtsTriangleClass * klass, + GSList * points, + gdouble scale); +guint gts_triangle_neighbor_number (GtsTriangle * t); +GSList * gts_triangle_neighbors (GtsTriangle * t); +GtsEdge * gts_triangles_common_edge (GtsTriangle * t1, + GtsTriangle * t2); +GtsTriangle * gts_triangle_is_duplicate (GtsTriangle * t); +GtsTriangle * gts_triangle_use_edges (GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3); +gboolean gts_triangle_is_ok (GtsTriangle * t); +void gts_triangle_vertices (GtsTriangle * t, + GtsVertex ** v1, + GtsVertex ** v2, + GtsVertex ** v3); +GtsPoint * gts_triangle_circumcircle_center (GtsTriangle * t, + GtsPointClass * point_class); +gboolean gts_triangles_are_folded (GSList * triangles, + GtsVertex * A, GtsVertex * B, + gdouble max); +GtsObject * gts_triangle_is_stabbed (GtsTriangle * t, + GtsPoint * p, + gdouble * orientation); +void gts_triangle_interpolate_height (GtsTriangle * t, + GtsPoint * p); + +/* Faces: face.c */ + +#define GTS_IS_FACE(obj) (gts_object_is_from_class (obj,\ + gts_face_class ())) +#define GTS_FACE(obj) GTS_OBJECT_CAST (obj,\ + GtsFace,\ + gts_face_class ()) +#define GTS_FACE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsFaceClass,\ + gts_face_class ()) + +struct _GtsFace { + GtsTriangle triangle; + + GSList * surfaces; +}; + +struct _GtsFaceClass { + GtsTriangleClass parent_class; +}; + +GTS_C_VAR +gboolean gts_allow_floating_faces; + +GtsFaceClass * gts_face_class (void); +GtsFace * gts_face_new (GtsFaceClass * klass, + GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3); +gboolean gts_face_has_parent_surface (GtsFace * f, + GtsSurface * s); +GSList * gts_faces_from_edges (GSList * edges, + GtsSurface * s); +guint gts_face_neighbor_number (GtsFace * f, + GtsSurface * s); +GSList * gts_face_neighbors (GtsFace * f, + GtsSurface * s); +void gts_face_foreach_neighbor (GtsFace * f, + GtsSurface * s, + GtsFunc func, + gpointer data); +gboolean gts_face_is_compatible (GtsFace * f, + GtsSurface * s); + +/* Matrices: matrix.c */ + +#define gts_vector_cross(C,A,B) ((C)[0] = (A)[1]*(B)[2] - (A)[2]*(B)[1],\ + (C)[1] = (A)[2]*(B)[0] - (A)[0]*(B)[2],\ + (C)[2] = (A)[0]*(B)[1] - (A)[1]*(B)[0]) + +#define gts_vector_init(v, p1, p2) ((v)[0] = (p2)->x - (p1)->x,\ + (v)[1] = (p2)->y - (p1)->y,\ + (v)[2] = (p2)->z - (p1)->z) +#define gts_vector_scalar(v1, v2) ((v1)[0]*(v2)[0] +\ + (v1)[1]*(v2)[1] +\ + (v1)[2]*(v2)[2]) +#define gts_vector_norm(v) (sqrt ((v)[0]*(v)[0] +\ + (v)[1]*(v)[1] +\ + (v)[2]*(v)[2])) +#define gts_vector_normalize(v) {\ + gdouble __gts_n = gts_vector_norm (v);\ + if (__gts_n > 0.) {\ + (v)[0] /= __gts_n;\ + (v)[1] /= __gts_n;\ + (v)[2] /= __gts_n;\ + }\ +} +GtsMatrix * gts_matrix_new (gdouble a00, gdouble a01, gdouble a02, gdouble a03, + gdouble a10, gdouble a11, gdouble a12, gdouble a13, + gdouble a20, gdouble a21, gdouble a22, gdouble a23, + gdouble a30, gdouble a31, gdouble a32, gdouble a33); +void gts_matrix_assign (GtsMatrix * m, + gdouble a00, gdouble a01, gdouble a02, gdouble a03, + gdouble a10, gdouble a11, gdouble a12, gdouble a13, + gdouble a20, gdouble a21, gdouble a22, gdouble a23, + gdouble a30, gdouble a31, gdouble a32, gdouble a33); +GtsMatrix * gts_matrix_projection (GtsTriangle * t); +GtsMatrix * gts_matrix_transpose (GtsMatrix * m); +gdouble gts_matrix_determinant (GtsMatrix * m); +GtsMatrix * gts_matrix_inverse (GtsMatrix * m); +GtsMatrix * gts_matrix3_inverse (GtsMatrix * m); +void gts_matrix_print (GtsMatrix * m, + FILE * fptr); +guint gts_matrix_compatible_row (GtsMatrix * A, + GtsVector b, + guint n, + GtsVector A1, + gdouble b1); +guint gts_matrix_quadratic_optimization (GtsMatrix * A, + GtsVector b, + guint n, + GtsMatrix * H, + GtsVector c); +GtsMatrix * gts_matrix_product (GtsMatrix * m1, + GtsMatrix * m2); +GtsMatrix * gts_matrix_zero (GtsMatrix * m); +GtsMatrix * gts_matrix_identity (GtsMatrix * m); +GtsMatrix * gts_matrix_scale (GtsMatrix * m, + GtsVector s); +GtsMatrix * gts_matrix_translate (GtsMatrix * m, + GtsVector t); +GtsMatrix * gts_matrix_rotate (GtsMatrix * m, + GtsVector r, + gdouble angle); +void gts_matrix_destroy (GtsMatrix * m); +void gts_vector_print (GtsVector v, + FILE * fptr); +void gts_vector4_print (GtsVector4 v, + FILE * fptr); + +/* Kdtrees: kdtree.c */ + +#define gts_kdtree_destroy(tree) g_node_destroy(tree) + +GNode * gts_kdtree_new (GPtrArray * points, + int (*compare) + (const void *, + const void *)); +GSList * gts_kdtree_range (GNode * tree, + GtsBBox * bbox, + int (*compare) + (const void *, + const void *)); + +/* Bboxtrees: bbtree.c */ + +/** + * GtsBBTreeTraverseFunc: + * @bb1: a #GtsBBox. + * @bb2: another #GtsBBox. + * @data: user data passed to the function. + * + * User function called for each pair of overlapping bounding + * boxes. See gts_bb_tree_traverse_overlapping(). + */ +typedef void (*GtsBBTreeTraverseFunc) (GtsBBox * bb1, + GtsBBox * bb2, + gpointer data); +/** + * GtsBBoxDistFunc: + * @p: a #GtsPoint. + * @bounded: an object bounded by a #GtsBBox. + * + * User function returning the (minimum) distance between the object + * defined by @bounded and point @p. + * + * Returns: the distance between @p and @bounded. + */ +typedef gdouble (*GtsBBoxDistFunc) (GtsPoint * p, + gpointer bounded); +/** + * GtsBBoxClosestFunc: + * @p: a #GtsPoint. + * @bounded: an object bounded by a #GtsBBox. + * + * User function returning a #GtsPoint belonging to the object defined + * by @bounded and closest to @p. + * + * Returns: a #GtsPoint. + */ +typedef GtsPoint * (*GtsBBoxClosestFunc) (GtsPoint * p, + gpointer bounded); + +/** + * GTS_IS_BBOX: + * @obj: a #GtsObject. + * + * Evaluates to %TRUE if @obj is a #GtsBBox, %FALSE otherwise. + */ +#define GTS_IS_BBOX(obj) (gts_object_is_from_class (obj,\ + gts_bbox_class ())) +/** + * GTS_BBOX: + * @obj: a #GtsObject. + * + * Casts @obj to #GtsBBox. + */ +#define GTS_BBOX(obj) GTS_OBJECT_CAST (obj,\ + GtsBBox,\ + gts_bbox_class ()) +/** + * GTS_BBOX_CLASS: + * @klass: a descendant of #GtsBBoxClass. + * + * Casts @klass to #GtsBBoxClass. + */ +#define GTS_BBOX_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsBBoxClass,\ + gts_bbox_class ()) + +struct _GtsBBox { + GtsObject object; + gpointer bounded; + gdouble x1, y1, z1; + gdouble x2, y2, z2; +}; + +struct _GtsBBoxClass { + GtsObjectClass parent_class; +}; + +GtsBBoxClass * gts_bbox_class (void); +GtsBBox * gts_bbox_new (GtsBBoxClass * klass, + gpointer bounded, + gdouble x1, + gdouble y1, + gdouble z1, + gdouble x2, + gdouble y2, + gdouble z2); +void gts_bbox_set (GtsBBox * bbox, + gpointer bounded, + gdouble x1, + gdouble y1, + gdouble z1, + gdouble x2, + gdouble y2, + gdouble z2); +GtsBBox * gts_bbox_segment (GtsBBoxClass * klass, + GtsSegment * s); +GtsBBox * gts_bbox_triangle (GtsBBoxClass * klass, + GtsTriangle * t); +GtsBBox * gts_bbox_surface (GtsBBoxClass * klass, + GtsSurface * surface); +GtsBBox * gts_bbox_bboxes (GtsBBoxClass * klass, + GSList * bboxes); +GtsBBox * gts_bbox_points (GtsBBoxClass * klass, + GSList * points); +/** + * gts_bbox_point_is_inside: + * @bbox: a #GtsBBox. + * @p: a #GtsPoint. + * + * Evaluates to %TRUE if @p is inside (or on the boundary) of @bbox, %FALSE otherwise. + */ +#define gts_bbox_point_is_inside(bbox, p) ((p)->x >= (bbox)->x1 &&\ + (p)->y >= (bbox)->y1 &&\ + (p)->z >= (bbox)->z1 &&\ + (p)->x <= (bbox)->x2 &&\ + (p)->y <= (bbox)->y2 &&\ + (p)->z <= (bbox)->z2) +gboolean gts_bboxes_are_overlapping (GtsBBox * bb1, + GtsBBox * bb2); +void gts_bbox_draw (GtsBBox * bb, + FILE * fptr); +gdouble gts_bbox_diagonal2 (GtsBBox * bb); +void gts_bbox_point_distance2 (GtsBBox * bb, + GtsPoint * p, + gdouble * min, + gdouble * max); +gboolean gts_bbox_is_stabbed (GtsBBox * bb, + GtsPoint * p); +gboolean gts_bbox_overlaps_triangle (GtsBBox * bb, + GtsTriangle * t); +gboolean gts_bbox_overlaps_segment (GtsBBox * bb, + GtsSegment * s); + +GNode * gts_bb_tree_new (GSList * bboxes); +GNode * gts_bb_tree_surface (GtsSurface * s); +GSList * gts_bb_tree_stabbed (GNode * tree, + GtsPoint * p); +GSList * gts_bb_tree_overlap (GNode * tree, + GtsBBox * bbox); +gboolean gts_bb_tree_is_overlapping (GNode * tree, + GtsBBox * bbox); +void gts_bb_tree_traverse_overlapping (GNode * tree1, + GNode * tree2, + GtsBBTreeTraverseFunc func, + gpointer data); +void gts_bb_tree_draw (GNode * tree, + guint depth, + FILE * fptr); +GSList * gts_bb_tree_point_closest_bboxes (GNode * tree, + GtsPoint * p); +gdouble gts_bb_tree_point_distance (GNode * tree, + GtsPoint * p, + GtsBBoxDistFunc distance, + GtsBBox ** bbox); +GtsPoint * gts_bb_tree_point_closest (GNode * tree, + GtsPoint * p, + GtsBBoxClosestFunc closest, + gdouble * distance); +void gts_bb_tree_segment_distance (GNode * tree, + GtsSegment * s, + GtsBBoxDistFunc distance, + gdouble delta, + GtsRange * range); +void gts_bb_tree_triangle_distance (GNode * tree, + GtsTriangle * t, + GtsBBoxDistFunc distance, + gdouble delta, + GtsRange * range); +void gts_bb_tree_surface_distance (GNode * tree, + GtsSurface * s, + GtsBBoxDistFunc distance, + gdouble delta, + GtsRange * range); +void gts_bb_tree_surface_boundary_distance + (GNode * tree, + GtsSurface * s, + GtsBBoxDistFunc distance, + gdouble delta, + GtsRange * range); +void gts_bb_tree_destroy (GNode * tree, + gboolean free_leaves); + +/* Surfaces: surface.c */ + +typedef struct _GtsSurfaceStats GtsSurfaceStats; +typedef struct _GtsSurfaceQualityStats GtsSurfaceQualityStats; +typedef GtsVertex * (*GtsRefineFunc) (GtsEdge * e, + GtsVertexClass * klass, + gpointer data); +typedef GtsVertex * (*GtsCoarsenFunc) (GtsEdge * e, + GtsVertexClass * klass, + gpointer data); +typedef gboolean (*GtsStopFunc) (gdouble cost, + guint nedge, + gpointer data); + +struct _GtsSurfaceStats { + guint n_faces; + guint n_incompatible_faces; + guint n_duplicate_faces; + guint n_duplicate_edges; + guint n_boundary_edges; + guint n_non_manifold_edges; + GtsRange edges_per_vertex, faces_per_edge; + GtsSurface * parent; +}; + +struct _GtsSurfaceQualityStats { + GtsRange face_quality; + GtsRange face_area; + GtsRange edge_length; + GtsRange edge_angle; + GtsSurface * parent; +}; + +struct _GtsSurface { + GtsObject object; + +#ifdef USE_SURFACE_BTREE + GTree * faces; +#else /* not USE_SURFACE_BTREE */ + GHashTable * faces; +#endif /* not USE_SURFACE_BTREE */ + GtsFaceClass * face_class; + GtsEdgeClass * edge_class; + GtsVertexClass * vertex_class; + gboolean keep_faces; +}; + +struct _GtsSurfaceClass { + GtsObjectClass parent_class; + + void (* add_face) (GtsSurface *, GtsFace *); + void (* remove_face) (GtsSurface *, GtsFace *); +}; + +#define GTS_IS_SURFACE(obj) (gts_object_is_from_class (obj,\ + gts_surface_class ())) +#define GTS_SURFACE(obj) GTS_OBJECT_CAST (obj,\ + GtsSurface,\ + gts_surface_class ()) +#define GTS_SURFACE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsSurfaceClass,\ + gts_surface_class ()) + +GtsSurfaceClass * gts_surface_class (void); +GtsSurface * gts_surface_new (GtsSurfaceClass * klass, + GtsFaceClass * face_class, + GtsEdgeClass * edge_class, + GtsVertexClass * vertex_class); +void gts_surface_add_face (GtsSurface * s, + GtsFace * f); +void gts_surface_remove_face (GtsSurface * s, + GtsFace * f); +guint gts_surface_read (GtsSurface * surface, + GtsFile * f); +gdouble gts_surface_area (GtsSurface * s); +void gts_surface_stats (GtsSurface * s, + GtsSurfaceStats * stats); +void gts_surface_quality_stats (GtsSurface * s, + GtsSurfaceQualityStats * stats); +void gts_surface_print_stats (GtsSurface * s, + FILE * fptr); +void gts_surface_write (GtsSurface * s, + FILE * fptr); +void gts_surface_write_oogl (GtsSurface * s, + FILE * fptr); +void gts_surface_write_vtk (GtsSurface * s, + FILE * fptr); +void gts_surface_write_oogl_boundary (GtsSurface * s, + FILE * fptr); +void gts_surface_foreach_vertex (GtsSurface * s, + GtsFunc func, + gpointer data); +void gts_surface_foreach_edge (GtsSurface * s, + GtsFunc func, + gpointer data); +void gts_surface_foreach_face (GtsSurface * s, + GtsFunc func, + gpointer data); +guint gts_surface_foreach_face_remove (GtsSurface * s, + GtsFunc func, + gpointer data); +typedef struct _GtsSurfaceTraverse GtsSurfaceTraverse; +GtsSurfaceTraverse * gts_surface_traverse_new (GtsSurface * s, + GtsFace * f); +GtsFace * gts_surface_traverse_next (GtsSurfaceTraverse * t, + guint * level); +void gts_surface_traverse_destroy (GtsSurfaceTraverse * t); +void gts_surface_refine (GtsSurface * surface, + GtsKeyFunc cost_func, + gpointer cost_data, + GtsRefineFunc refine_func, + gpointer refine_data, + GtsStopFunc stop_func, + gpointer stop_data); +gboolean gts_edge_collapse_is_valid (GtsEdge * e); +void gts_surface_coarsen (GtsSurface * surface, + GtsKeyFunc cost_func, + gpointer cost_data, + GtsCoarsenFunc coarsen_func, + gpointer coarsen_data, + GtsStopFunc stop_func, + gpointer stop_data, + gdouble minangle); +gboolean gts_coarsen_stop_number (gdouble cost, + guint nedge, + guint * min_number); +gboolean gts_coarsen_stop_cost (gdouble cost, + guint nedge, + gdouble * max_cost); +void gts_surface_tessellate (GtsSurface * s, + GtsRefineFunc refine_func, + gpointer refine_data); +GtsSurface * gts_surface_generate_sphere (GtsSurface * s, + guint geodesation_order); +GtsSurface * gts_surface_copy (GtsSurface * s1, + GtsSurface * s2); +void gts_surface_merge (GtsSurface * s, + GtsSurface * with); +gboolean gts_surface_is_manifold (GtsSurface * s); +gboolean gts_surface_is_closed (GtsSurface * s); +gboolean gts_surface_is_orientable (GtsSurface * s); +gdouble gts_surface_volume (GtsSurface * s); +gdouble gts_surface_center_of_mass (GtsSurface * s, + GtsVector cm); +gdouble gts_surface_center_of_area (GtsSurface * s, + GtsVector cm); +guint gts_surface_vertex_number (GtsSurface * s); +guint gts_surface_edge_number (GtsSurface * s); +guint gts_surface_face_number (GtsSurface * s); +void gts_surface_distance (GtsSurface * s1, + GtsSurface * s2, + gdouble delta, + GtsRange * face_range, + GtsRange * boundary_range); +GSList * gts_surface_boundary (GtsSurface * surface); +GSList * gts_surface_split (GtsSurface * s); + +/* Discrete differential operators: curvature.c */ + +gboolean gts_vertex_mean_curvature_normal (GtsVertex * v, + GtsSurface * s, + GtsVector Kh); +gboolean gts_vertex_gaussian_curvature (GtsVertex * v, + GtsSurface * s, + gdouble * Kg); +void gts_vertex_principal_curvatures (gdouble Kh, + gdouble Kg, + gdouble * K1, + gdouble * K2); +void gts_vertex_principal_directions (GtsVertex * v, + GtsSurface * s, + GtsVector Kh, + gdouble Kg, + GtsVector e1, + GtsVector e2); + +/* Volume optimization: vopt.c */ +typedef struct _GtsVolumeOptimizedParams GtsVolumeOptimizedParams; + +struct _GtsVolumeOptimizedParams { + gdouble volume_weight; + gdouble boundary_weight; + gdouble shape_weight; +}; + +GtsVertex * gts_volume_optimized_vertex (GtsEdge * edge, + GtsVertexClass * klass, + GtsVolumeOptimizedParams * params); +gdouble gts_volume_optimized_cost (GtsEdge * e, + GtsVolumeOptimizedParams * params); + +/* bool operations: boolean.c */ + +GSList * gts_surface_intersection (GtsSurface * s1, + GtsSurface * s2, + GNode * faces_tree1, + GNode * faces_tree2); + +typedef struct _GtsSurfaceInter GtsSurfaceInter; +typedef struct _GtsSurfaceInterClass GtsSurfaceInterClass; +/** + * GtsBooleanOperation: + * @GTS_1_OUT_2: identifies the part of the first surface which lies + * outside the second surface. + * @GTS_1_IN_2: identifies the part of the first surface which lies + * inside the second surface. + * @GTS_2_OUT_1: identifies the part of the second surface which lies + * outside the first surface. + * @GTS_2_IN_1: identifies the part of the second surface which lies + * inside the first surface. + */ +typedef enum { GTS_1_OUT_2, + GTS_1_IN_2, + GTS_2_OUT_1, + GTS_2_IN_1 } GtsBooleanOperation; + +/** + * GTS_IS_SURFACE_INTER: + * @obj: a #GtsObject. + * + * Evaluates to %TRUE if @obj is a #GtsSurfaceInter, %FALSE otherwise. + */ +#define GTS_IS_SURFACE_INTER(obj) (gts_object_is_from_class (obj,\ + gts_surface_inter_class ())) +/** + * GTS_SURFACE_INTER: + * @obj: a descendant of #GtsSurfaceInter. + * + * Casts @obj to #GtsSurfaceInter. + */ +#define GTS_SURFACE_INTER(obj) GTS_OBJECT_CAST (obj,\ + GtsSurfaceInter,\ + gts_surface_inter_class ()) +/** + * GTS_SURFACE_INTER_CLASS: + * @klass: a descendant of #GtsSurfaceInterClass. + * + * Casts @klass to #GtsSurfaceInterClass. + */ +#define GTS_SURFACE_INTER_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsSurfaceInterClass,\ + gts_surface_inter_class ()) + +struct _GtsSurfaceInter { + GtsObject object; + + GtsSurface * s1; + GtsSurface * s2; + GSList * edges; +}; + +struct _GtsSurfaceInterClass { + GtsObjectClass parent_class; +}; + +GtsSurfaceInterClass * +gts_surface_inter_class (void); +GtsSurfaceInter * +gts_surface_inter_new (GtsSurfaceInterClass * klass, + GtsSurface * s1, + GtsSurface * s2, + GNode * faces_tree1, + GNode * faces_tree2, + gboolean is_open1, + gboolean is_open2); +gboolean +gts_surface_inter_check (GtsSurfaceInter * si, + gboolean * closed); +void +gts_surface_inter_boolean (GtsSurfaceInter * si, + GtsSurface * surface, + GtsBooleanOperation op); +gboolean gts_surface_foreach_intersecting_face (GtsSurface * s, + GtsBBTreeTraverseFunc func, + gpointer data); +GtsSurface * +gts_surface_is_self_intersecting (GtsSurface * s); + +/* Binary Heap: heap.c */ + +typedef struct _GtsHeap GtsHeap; + +GtsHeap * gts_heap_new (GCompareFunc compare_func); +void gts_heap_insert (GtsHeap * heap, gpointer p); +gpointer gts_heap_remove_top (GtsHeap * heap); +gpointer gts_heap_top (GtsHeap * heap); +void gts_heap_thaw (GtsHeap * heap); +void gts_heap_foreach (GtsHeap * heap, + GFunc func, + gpointer user_data); +void gts_heap_freeze (GtsHeap * heap); +guint gts_heap_size (GtsHeap * heap); +void gts_heap_destroy (GtsHeap * heap); + +/* Extended Binary Heap: eheap.c */ + +typedef struct _GtsEHeap GtsEHeap; +typedef struct _GtsEHeapPair GtsEHeapPair; + +struct _GtsEHeap { + GPtrArray * elts; + GtsKeyFunc func; + gpointer data; + gboolean frozen, randomized; +}; + +/** + * _GtsEHeapPair: + * @data: Points to the item stored in the heap. + * @key: Value of the key for this item. + * @pos: Private field. + */ +struct _GtsEHeapPair { + gpointer data; + gdouble key; + guint pos; +}; + +GtsEHeap * gts_eheap_new (GtsKeyFunc key_func, + gpointer data); +GtsEHeapPair * gts_eheap_insert (GtsEHeap * heap, + gpointer p); +GtsEHeapPair * gts_eheap_insert_with_key (GtsEHeap * heap, + gpointer p, + gdouble key); +gpointer gts_eheap_remove_top (GtsEHeap * heap, + gdouble * key); +gpointer gts_eheap_top (GtsEHeap * heap, + gdouble * key); +void gts_eheap_thaw (GtsEHeap * heap); +void gts_eheap_foreach (GtsEHeap * heap, + GFunc func, + gpointer data); +gpointer gts_eheap_remove (GtsEHeap * heap, + GtsEHeapPair * p); +void gts_eheap_decrease_key (GtsEHeap * heap, + GtsEHeapPair * p, + gdouble new_key); +void gts_eheap_freeze (GtsEHeap * heap); +guint gts_eheap_size (GtsEHeap * heap); +void gts_eheap_update (GtsEHeap * heap); +gdouble gts_eheap_key (GtsEHeap * heap, + gpointer p); +void gts_eheap_randomized (GtsEHeap * heap, + gboolean randomized); +void gts_eheap_destroy (GtsEHeap * heap); + +/* FIFO queues: fifo.c */ + +typedef struct _GtsFifo GtsFifo; + +GtsFifo * gts_fifo_new (void); +void gts_fifo_write (GtsFifo * fifo, + FILE * fp); +void gts_fifo_push (GtsFifo * fifo, + gpointer data); +gpointer gts_fifo_pop (GtsFifo * fifo); +gpointer gts_fifo_top (GtsFifo * fifo); +guint gts_fifo_size (GtsFifo * fifo); +gboolean gts_fifo_is_empty (GtsFifo * fifo); +void gts_fifo_foreach (GtsFifo * fifo, + GtsFunc func, + gpointer data); +void gts_fifo_reverse (GtsFifo * fifo); +void gts_fifo_destroy (GtsFifo * fifo); + +/* Progressive surfaces */ + +/* split.c */ + +typedef struct _GtsSplit GtsSplit; +typedef struct _GtsSplitClass GtsSplitClass; +typedef struct _GtsSplitCFace GtsSplitCFace; + +struct _GtsSplit { + GtsObject object; + + GtsVertex * v; + GtsObject * v1; + GtsObject * v2; + GtsSplitCFace * cfaces; + guint ncf; +}; + +struct _GtsSplitClass { + GtsObjectClass parent_class; +}; + +#define GTS_IS_SPLIT(obj) (gts_object_is_from_class (obj,\ + gts_split_class ())) +#define GTS_SPLIT(obj) GTS_OBJECT_CAST (obj,\ + GtsSplit,\ + gts_split_class ()) +#define GTS_SPLIT_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsSplitClass,\ + gts_split_class ()) +#define GTS_SPLIT_V1(vs) (GTS_IS_SPLIT ((vs)->v1) ?\ + GTS_SPLIT ((vs)->v1)->v :\ + GTS_VERTEX ((vs)->v1)) +#define GTS_SPLIT_V2(vs) (GTS_IS_SPLIT ((vs)->v2) ?\ + GTS_SPLIT ((vs)->v2)->v :\ + GTS_VERTEX ((vs)->v2)) + +GtsSplitClass * gts_split_class (void); +GtsSplit * gts_split_new (GtsSplitClass * klass, + GtsVertex * v, + GtsObject * o1, + GtsObject * o2); +void gts_split_collapse (GtsSplit * vs, + GtsEdgeClass * klass, + GtsEHeap * heap); +void gts_split_expand (GtsSplit * vs, + GtsSurface * s, + GtsEdgeClass * klass); +typedef gboolean (*GtsSplitTraverseFunc) (GtsSplit * vs, + gpointer data); +void gts_split_traverse (GtsSplit * root, + GTraverseType order, + gint depth, + GtsSplitTraverseFunc func, + gpointer data); +guint gts_split_height (GtsSplit * root); + +/* psurface.c */ + +typedef struct _GtsPSurface GtsPSurface; +typedef struct _GtsPSurfaceClass GtsPSurfaceClass; + +struct _GtsPSurface { + GtsObject object; + + GtsSurface * s; + GPtrArray * split; + GtsSplitClass * split_class; + guint pos, min; + + GPtrArray * vertices; + GPtrArray * faces; +}; + +struct _GtsPSurfaceClass { + GtsObjectClass parent_class; +}; + +#define GTS_IS_PSURFACE(obj) (gts_object_is_from_class (obj,\ + gts_psurface_class ())) +#define GTS_PSURFACE(obj) GTS_OBJECT_CAST (obj,\ + GtsPSurface,\ + gts_psurface_class ()) +#define GTS_PSURFACE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsPSurfaceClass,\ + gts_psurface_class ()) +#define GTS_PSURFACE_IS_CLOSED(ps) (!(ps)->vertices) + +GtsPSurfaceClass * gts_psurface_class (void); +GtsPSurface * gts_psurface_new (GtsPSurfaceClass * klass, + GtsSurface * surface, + GtsSplitClass * split_class, + GtsKeyFunc cost_func, + gpointer cost_data, + GtsCoarsenFunc coarsen_func, + gpointer coarsen_data, + GtsStopFunc stop_func, + gpointer stop_data, + gdouble minangle); +GtsSplit * gts_psurface_add_vertex (GtsPSurface * ps); +GtsSplit * gts_psurface_remove_vertex (GtsPSurface * ps); +guint gts_psurface_max_vertex_number (GtsPSurface * ps); +guint gts_psurface_min_vertex_number (GtsPSurface * ps); +void gts_psurface_set_vertex_number (GtsPSurface * ps, + guint n); +guint gts_psurface_get_vertex_number (GtsPSurface * ps); +void gts_psurface_write (GtsPSurface * ps, + FILE * fptr); +GtsPSurface * gts_psurface_open (GtsPSurfaceClass * klass, + GtsSurface * s, + GtsSplitClass * split_class, + GtsFile * f); +GtsSplit * gts_psurface_read_vertex (GtsPSurface * ps, + GtsFile * fp); +void gts_psurface_close (GtsPSurface * ps); +void gts_psurface_foreach_vertex (GtsPSurface * ps, + GtsFunc func, + gpointer data); + +/* hsurface.c */ + +typedef struct _GtsHSplit GtsHSplit; +typedef struct _GtsHSplitClass GtsHSplitClass; +typedef struct _GtsHSurface GtsHSurface; +typedef struct _GtsHSurfaceClass GtsHSurfaceClass; + +struct _GtsHSplit { + GtsSplit split; + + GtsEHeapPair * index; + GtsHSplit * parent; + guint nchild; +}; + +struct _GtsHSplitClass { + GtsSplitClass parent_class; +}; + +#define GTS_IS_HSPLIT(obj) (gts_object_is_from_class (obj,\ + gts_hsplit_class ())) +#define GTS_HSPLIT(obj) GTS_OBJECT_CAST (obj,\ + GtsHSplit,\ + gts_hsplit_class ()) +#define GTS_HSPLIT_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsHSplitClass,\ + gts_hsplit_class ()) + +GtsHSplitClass * gts_hsplit_class (void); +GtsHSplit * gts_hsplit_new (GtsHSplitClass * klass, + GtsSplit * vs); +void gts_hsplit_collapse (GtsHSplit * hs, + GtsHSurface * hsurface); +void gts_hsplit_expand (GtsHSplit * hs, + GtsHSurface * hsurface); +void gts_hsplit_force_expand (GtsHSplit * hs, + GtsHSurface * hsurface); + +struct _GtsHSurface { + GtsObject object; + + GtsSurface * s; + GSList * roots; + GtsEHeap * expandable; + GtsEHeap * collapsable; + GPtrArray * split; + guint nvertex; +}; + +struct _GtsHSurfaceClass { + GtsObjectClass parent_class; +}; + +#define GTS_IS_HSURFACE(obj) (gts_object_is_from_class (obj,\ + gts_hsurface_class ())) +#define GTS_HSURFACE(obj) GTS_OBJECT_CAST (obj,\ + GtsHSurface,\ + gts_hsurface_class ()) +#define GTS_HSURFACE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsHSurfaceClass,\ + gts_hsurface_class ()) + +GtsHSurfaceClass * gts_hsurface_class (void); +GtsHSurface * gts_hsurface_new (GtsHSurfaceClass * klass, + GtsHSplitClass * hsplit_class, + GtsPSurface * psurface, + GtsKeyFunc expand_key, + gpointer expand_data, + GtsKeyFunc collapse_key, + gpointer collapse_data); +void gts_hsurface_traverse (GtsHSurface * hsurface, + GTraverseType order, + gint depth, + GtsSplitTraverseFunc func, + gpointer data); +void gts_hsurface_foreach (GtsHSurface * hsurface, + GTraverseType order, + GtsFunc func, + gpointer data); +guint gts_hsurface_height (GtsHSurface * hsurface); + +/* Constrained Delaunay triangulation: cdt.c */ + +/** + * GTS_IS_CONSTRAINT: + * @obj: a #GtsObject. + * + * Evaluates to %TRUE if @obj is a #GtsConstraint, %FALSE otherwise. + */ +#define GTS_IS_CONSTRAINT(obj) (gts_object_is_from_class (obj,\ + gts_constraint_class ())) +/** + * GTS_CONSTRAINT: + * @obj: a descendant of #GtsConstraint. + * + * Casts @obj to #GtsConstraint. + */ +#define GTS_CONSTRAINT(obj) GTS_OBJECT_CAST (obj,\ + GtsConstraint,\ + gts_constraint_class ()) +/** + * GTS_CONSTRAINT_CLASS: + * @klass: a desscendant of #GtsConstraintClass. + * + * Casts @klass to #GtsConstraintClass. + */ +#define GTS_CONSTRAINT_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsConstraintClass,\ + gts_constraint_class ()) + +struct _GtsConstraint { + GtsEdge edge; +}; + +struct _GtsConstraintClass { + GtsEdgeClass parent_class; +}; + +typedef struct _GtsConstraint GtsConstraint; +typedef struct _GtsConstraintClass GtsConstraintClass; + +GtsConstraintClass * gts_constraint_class (void); + +GtsFace * gts_point_locate (GtsPoint * p, + GtsSurface * surface, + GtsFace * guess); +GtsVertex * gts_delaunay_add_vertex_to_face (GtsSurface * surface, + GtsVertex * v, + GtsFace * f); +GtsVertex * gts_delaunay_add_vertex (GtsSurface * surface, + GtsVertex * v, + GtsFace * guess); +void gts_delaunay_remove_vertex (GtsSurface * surface, + GtsVertex * v); +GtsFace * gts_delaunay_check (GtsSurface * surface); +GSList * gts_delaunay_add_constraint (GtsSurface * surface, + GtsConstraint * c); +void gts_delaunay_remove_hull (GtsSurface * surface); + +/* GtsListFace: Header */ + +typedef struct _GtsListFace GtsListFace; + +struct _GtsListFace { + /*< private >*/ + GtsFace parent; + + /*< public >*/ + GSList * points; +}; + +#define GTS_LIST_FACE(obj) GTS_OBJECT_CAST (obj,\ + GtsListFace,\ + gts_list_face_class ()) +#define GTS_IS_LIST_FACE(obj) (gts_object_is_from_class (obj,\ + gts_list_face_class ())) + +GtsFaceClass * gts_list_face_class (void); + +/* Constrained Delaunay refinement: refine.c */ + +typedef gboolean (* GtsEncroachFunc) (GtsVertex * v, + GtsEdge * e, + GtsSurface * s, + gpointer data); + +gboolean gts_vertex_encroaches_edge (GtsVertex * v, + GtsEdge * e); +GtsVertex * gts_edge_is_encroached (GtsEdge * e, + GtsSurface * s, + GtsEncroachFunc encroaches, + gpointer data); +guint gts_delaunay_conform (GtsSurface * surface, + gint steiner_max, + GtsEncroachFunc encroaches, + gpointer data); +guint gts_delaunay_refine (GtsSurface * surface, + gint steiner_max, + GtsEncroachFunc encroaches, + gpointer encroach_data, + GtsKeyFunc cost, + gpointer cost_data); + +/* Isosurfaces (marching cubes): iso.c */ + +typedef struct _GtsGridPlane GtsGridPlane; +typedef struct _GtsIsoSlice GtsIsoSlice; +typedef struct _GtsCartesianGrid GtsCartesianGrid; + +struct _GtsGridPlane { + GtsPoint ** p; + guint nx, ny; +}; + +struct _GtsCartesianGrid { + guint nx, ny, nz; + gdouble x, dx, y, dy, z, dz; +}; + +typedef void (*GtsIsoCartesianFunc) (gdouble ** a, + GtsCartesianGrid g, + guint i, + gpointer data); + +GtsGridPlane * gts_grid_plane_new (guint nx, + guint ny); +void gts_grid_plane_destroy (GtsGridPlane * g); +GtsIsoSlice * gts_iso_slice_new (guint nx, guint ny); +void gts_iso_slice_fill (GtsIsoSlice * slice, + GtsGridPlane * plane1, + GtsGridPlane * plane2, + gdouble ** f1, + gdouble ** f2, + gdouble iso, + GtsVertexClass * klass); +void gts_iso_slice_fill_cartesian (GtsIsoSlice * slice, + GtsCartesianGrid g, + gdouble ** f1, + gdouble ** f2, + gdouble iso, + GtsVertexClass * klass); +void gts_iso_slice_destroy (GtsIsoSlice * slice); +void gts_isosurface_slice (GtsIsoSlice * slice1, + GtsIsoSlice * slice2, + GtsSurface * surface); +void gts_isosurface_cartesian (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso); + +/* Isosurfaces (marching tetrahedra): isotetra.c */ + +void gts_isosurface_tetra (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso); +void gts_isosurface_tetra_bcl (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso); +void gts_isosurface_tetra_bounded (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso); + +/* Named vertices, edges and triangles: named.c */ + +#define GTS_NAME_LENGTH 40 + +#define GTS_NVERTEX(obj) GTS_OBJECT_CAST (obj,\ + GtsNVertex,\ + gts_nvertex_class ()) +#define GTS_NVERTEX_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsNVertexClass,\ + gts_nvertex_class()) +#define GTS_IS_NVERTEX(obj) (gts_object_is_from_class (obj,\ + gts_nvertex_class ())) + +typedef struct _GtsNVertex GtsNVertex; +typedef struct _GtsNVertexClass GtsNVertexClass; + +struct _GtsNVertex { + GtsVertex parent; + char name[GTS_NAME_LENGTH]; +}; + +struct _GtsNVertexClass { + GtsVertexClass parent_class; +}; + +GtsNVertexClass * gts_nvertex_class (void); + +#define GTS_NEDGE(obj) GTS_OBJECT_CAST (obj,\ + GtsNEdge,\ + gts_nedge_class ()) +#define GTS_NEDGE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsNEdgeClass,\ + gts_nedge_class()) +#define GTS_IS_NEDGE(obj) (gts_object_is_from_class (obj,\ + gts_nedge_class ())) + +typedef struct _GtsNEdge GtsNEdge; +typedef struct _GtsNEdgeClass GtsNEdgeClass; + +struct _GtsNEdge { + GtsEdge parent; + char name[GTS_NAME_LENGTH]; +}; + +struct _GtsNEdgeClass { + GtsEdgeClass parent_class; +}; + +GtsNEdgeClass * gts_nedge_class (void); + +#define GTS_NFACE(obj) GTS_OBJECT_CAST (obj,\ + GtsNFace,\ + gts_nface_class ()) +#define GTS_NFACE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsNFaceClass,\ + gts_nface_class()) +#define GTS_IS_NFACE(obj) (gts_object_is_from_class (obj,\ + gts_nface_class ())) + +typedef struct _GtsNFace GtsNFace; +typedef struct _GtsNFaceClass GtsNFaceClass; + +struct _GtsNFace { + GtsFace parent; + char name[GTS_NAME_LENGTH]; +}; + +struct _GtsNFaceClass { + GtsFaceClass parent_class; +}; + +GtsNFaceClass * gts_nface_class (void); + +/* Cluster object for out-of-core simplification: oocs.c */ + +#define GTS_CLUSTER(obj) GTS_OBJECT_CAST (obj,\ + GtsCluster,\ + gts_cluster_class ()) +#define GTS_CLUSTER_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsClusterClass,\ + gts_cluster_class()) +#define GTS_IS_CLUSTER(obj) (gts_object_is_from_class (obj,\ + gts_cluster_class ())) + +typedef struct _GtsCluster GtsCluster; +typedef struct _GtsClusterClass GtsClusterClass; +typedef struct _GtsClusterId GtsClusterId; + +struct _GtsClusterId { + guint x, y, z; +}; + +struct _GtsCluster { + GtsObject parent; + + GtsClusterId id; + GtsVertex * v; + guint n; +}; + +struct _GtsClusterClass { + GtsObjectClass parent_class; + + void (* add) (GtsCluster * c, GtsPoint * p, gpointer data); + void (* update) (GtsCluster * c); +}; + +GtsClusterClass * gts_cluster_class (void); +GtsCluster * gts_cluster_new (GtsClusterClass * klass, + GtsClusterId id, + GtsVertexClass * vklass); +void gts_cluster_add (GtsCluster * c, + GtsPoint * p, + gpointer data); +void gts_cluster_update (GtsCluster * c); + +/* Cluster group object for out-of-core simplification: oocs.c */ + +#define GTS_CLUSTER_GRID(obj) GTS_OBJECT_CAST (obj,\ + GtsClusterGrid,\ + gts_cluster_grid_class ()) +#define GTS_CLUSTER_GRID_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsClusterGridClass,\ + gts_cluster_grid_class()) +#define GTS_IS_CLUSTER_GRID(obj) (gts_object_is_from_class (obj,\ + gts_cluster_grid_class ())) + +typedef struct _GtsClusterGrid GtsClusterGrid; +typedef struct _GtsClusterGridClass GtsClusterGridClass; + +struct _GtsClusterGrid { + GtsObject parent; + + GtsSurface * surface; + GtsBBox * bbox; + GtsVector size; + + GtsClusterClass * cluster_class; + GHashTable * clusters; +}; + +struct _GtsClusterGridClass { + GtsObjectClass parent_class; +}; + +GtsClusterGridClass * gts_cluster_grid_class (void); +GtsClusterGrid * gts_cluster_grid_new (GtsClusterGridClass * klass, + GtsClusterClass * cluster_class, + GtsSurface * s, + GtsBBox * bbox, + gdouble delta); +void gts_cluster_grid_add_triangle (GtsClusterGrid * cluster_grid, + GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + gpointer data); +GtsRange gts_cluster_grid_update (GtsClusterGrid * cluster_grid); + +/* Triangle strip generation: stripe.c */ +GSList * gts_surface_strip (GtsSurface * s); + +/* GtsContainee: container.c */ + +typedef struct _GtsContainee GtsContainee; +typedef struct _GtsContaineeClass GtsContaineeClass; +typedef struct _GtsContainer GtsContainer; +typedef struct _GtsContainerClass GtsContainerClass; + +struct _GtsContainee { + GtsObject object; +}; + +struct _GtsContaineeClass { + GtsObjectClass parent_class; + + void (* add_container) (GtsContainee *, GtsContainer *); + void (* remove_container) (GtsContainee *, GtsContainer *); + void (* foreach) (GtsContainee *, GtsFunc, gpointer); + gboolean (* is_contained) (GtsContainee *, GtsContainer *); + void (* replace) (GtsContainee *, GtsContainee *); +}; + +#define GTS_CONTAINEE(obj) GTS_OBJECT_CAST (obj,\ + GtsContainee,\ + gts_containee_class ()) +#define GTS_CONTAINEE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsContaineeClass,\ + gts_containee_class()) +#define GTS_IS_CONTAINEE(obj) (gts_object_is_from_class (obj,\ + gts_containee_class ())) + +GtsContaineeClass * gts_containee_class (void); +GtsContainee * gts_containee_new (GtsContaineeClass * klass); +gboolean gts_containee_is_contained (GtsContainee * item, + GtsContainer * c); +void gts_containee_replace (GtsContainee * item, + GtsContainee * with); + +/* GtsSListContainee: container.c */ + +typedef struct _GtsSListContainee GtsSListContainee; +typedef struct _GtsSListContaineeClass GtsSListContaineeClass; + +struct _GtsSListContainee { + GtsContainee containee; + + GSList * containers; +}; + +struct _GtsSListContaineeClass { + GtsContaineeClass parent_class; +}; + +#define GTS_SLIST_CONTAINEE(obj) GTS_OBJECT_CAST (obj,\ + GtsSListContainee,\ + gts_slist_containee_class ()) +#define GTS_SLIST_CONTAINEE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsSListContaineeClass,\ + gts_slist_containee_class()) +#define GTS_IS_SLIST_CONTAINEE(obj) (gts_object_is_from_class (obj,\ + gts_slist_containee_class ())) + +GtsSListContaineeClass * gts_slist_containee_class (void); + +/* GtsContainer: container.c */ + +struct _GtsContainer { + GtsSListContainee object; +}; + +struct _GtsContainerClass { + GtsSListContaineeClass parent_class; + + void (* add) (GtsContainer *, GtsContainee *); + void (* remove) (GtsContainer *, GtsContainee *); + void (* foreach) (GtsContainer *, GtsFunc, gpointer); + guint (* size) (GtsContainer *); +}; + +#define GTS_CONTAINER(obj) GTS_OBJECT_CAST (obj,\ + GtsContainer,\ + gts_container_class ()) +#define GTS_CONTAINER_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsContainerClass,\ + gts_container_class()) +#define GTS_IS_CONTAINER(obj) (gts_object_is_from_class (obj,\ + gts_container_class ())) + +GtsContainerClass * gts_container_class (void); +GtsContainer * gts_container_new (GtsContainerClass * klass); +void gts_container_add (GtsContainer * c, + GtsContainee * item); +void gts_container_remove (GtsContainer * c, + GtsContainee * item); +void gts_container_foreach (GtsContainer * c, + GtsFunc func, + gpointer data); +guint gts_container_size (GtsContainer * c); + +/* GtsHashContainer: container.c */ + +typedef struct _GtsHashContainer GtsHashContainer; +typedef struct _GtsHashContainerClass GtsHashContainerClass; + +struct _GtsHashContainer { + GtsContainer c; + + GHashTable * items; + gboolean frozen; +}; + +struct _GtsHashContainerClass { + GtsContainerClass parent_class; +}; + +#define GTS_HASH_CONTAINER(obj) GTS_OBJECT_CAST (obj,\ + GtsHashContainer,\ + gts_hash_container_class ()) +#define GTS_HASH_CONTAINER_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsHashContainerClass,\ + gts_hash_container_class()) +#define GTS_IS_HASH_CONTAINER(obj) (gts_object_is_from_class (obj,\ + gts_hash_container_class ())) + +GtsHashContainerClass * gts_hash_container_class (void); + +/* GtsSListContainer: container.c */ + +typedef struct _GtsSListContainer GtsSListContainer; +typedef struct _GtsSListContainerClass GtsSListContainerClass; + +struct _GtsSListContainer { + GtsContainer c; + + GSList * items; + gboolean frozen; +}; + +struct _GtsSListContainerClass { + GtsContainerClass parent_class; +}; + +#define GTS_SLIST_CONTAINER(obj) GTS_OBJECT_CAST (obj,\ + GtsSListContainer,\ + gts_slist_container_class ()) +#define GTS_SLIST_CONTAINER_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsSListContainerClass,\ + gts_slist_container_class()) +#define GTS_IS_SLIST_CONTAINER(obj) (gts_object_is_from_class (obj,\ + gts_slist_container_class ())) + +GtsSListContainerClass * gts_slist_container_class (void); + +/* GtsGNode: graph.c */ + +typedef struct _GtsGNode GtsGNode; +typedef struct _GtsGNodeClass GtsGNodeClass; +typedef struct _GtsGraph GtsGraph; +typedef struct _GtsGraphClass GtsGraphClass; + +struct _GtsGNode { + GtsSListContainer container; + + guint level; +}; + +struct _GtsGNodeClass { + GtsSListContainerClass parent_class; + + gfloat (* weight) (GtsGNode *); + void (* write) (GtsGNode *, FILE *); +}; + +#define GTS_GNODE(obj) GTS_OBJECT_CAST (obj,\ + GtsGNode,\ + gts_gnode_class ()) +#define GTS_GNODE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsGNodeClass,\ + gts_gnode_class()) +#define GTS_IS_GNODE(obj) (gts_object_is_from_class (obj,\ + gts_gnode_class ())) +#define GTS_GNODE_NEIGHBOR(n,e) (GTS_GEDGE (e)->n1 == n ? GTS_GEDGE (e)->n2 : GTS_GEDGE (e)->n2 == n ? GTS_GEDGE (e)->n1 : NULL) + +GtsGNodeClass * gts_gnode_class (void); +GtsGNode * gts_gnode_new (GtsGNodeClass * klass); +void gts_gnode_foreach_neighbor (GtsGNode * n, + GtsGraph * g, + GtsFunc func, + gpointer data); +void gts_gnode_foreach_edge (GtsGNode * n, + GtsGraph * g, + GtsFunc func, + gpointer data); +guint gts_gnode_degree (GtsGNode * n, + GtsGraph * g); +gfloat gts_gnode_move_cost (GtsGNode * n, + GtsGraph * src, + GtsGraph * dst); +gfloat gts_gnode_weight (GtsGNode * n); + +GTS_C_VAR +gboolean gts_allow_floating_gnodes; + +/* GtsNGNode: graph.c */ + +typedef struct _GtsNGNode GtsNGNode; +typedef struct _GtsNGNodeClass GtsNGNodeClass; + +struct _GtsNGNode { + GtsGNode node; + + guint id; +}; + +struct _GtsNGNodeClass { + GtsGNodeClass parent_class; +}; + +#define GTS_NGNODE(obj) GTS_OBJECT_CAST (obj,\ + GtsNGNode,\ + gts_ngnode_class ()) +#define GTS_NGNODE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsNGNodeClass,\ + gts_ngnode_class()) +#define GTS_IS_NGNODE(obj) (gts_object_is_from_class (obj,\ + gts_ngnode_class ())) + +GtsNGNodeClass * gts_ngnode_class (void); +GtsNGNode * gts_ngnode_new (GtsNGNodeClass * klass, + guint id); + +/* GtsWGNode: graph.c */ + +typedef struct _GtsWGNode GtsWGNode; +typedef struct _GtsWGNodeClass GtsWGNodeClass; + +struct _GtsWGNode { + GtsGNode node; + + gfloat weight; +}; + +struct _GtsWGNodeClass { + GtsGNodeClass parent_class; +}; + +#define GTS_WGNODE(obj) GTS_OBJECT_CAST (obj,\ + GtsWGNode,\ + gts_wgnode_class ()) +#define GTS_WGNODE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsWGNodeClass,\ + gts_wgnode_class()) +#define GTS_IS_WGNODE(obj) (gts_object_is_from_class (obj,\ + gts_wgnode_class ())) + +GtsWGNodeClass * gts_wgnode_class (void); +GtsWGNode * gts_wgnode_new (GtsWGNodeClass * klass, + gfloat weight); + +/* GtsPNode */ + +typedef struct _GtsPNode GtsPNode; +typedef struct _GtsPNodeClass GtsPNodeClass; + +struct _GtsPNode { + GtsGNode node; + + gpointer data; +}; + +struct _GtsPNodeClass { + GtsGNodeClass parent_class; +}; + +#define GTS_PNODE(obj) GTS_OBJECT_CAST (obj,\ + GtsPNode,\ + gts_pnode_class ()) +#define GTS_PNODE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsPNodeClass,\ + gts_pnode_class()) +#define GTS_IS_PNODE(obj) (gts_object_is_from_class (obj,\ + gts_pnode_class ())) + +GtsPNodeClass * gts_pnode_class (void); +GtsPNode * gts_pnode_new (GtsPNodeClass * klass, + gpointer data); + +/* GtsFNode */ + +typedef struct _GtsFNode GtsFNode; +typedef struct _GtsFNodeClass GtsFNodeClass; + +struct _GtsFNode { + GtsGNode node; + + GtsFace * f; +}; + +struct _GtsFNodeClass { + GtsGNodeClass parent_class; +}; + +#define GTS_FNODE(obj) GTS_OBJECT_CAST (obj,\ + GtsFNode,\ + gts_fnode_class ()) +#define GTS_FNODE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsFNodeClass,\ + gts_fnode_class()) +#define GTS_IS_FNODE(obj) (gts_object_is_from_class (obj,\ + gts_fnode_class ())) + +GtsFNodeClass * gts_fnode_class (void); +GtsFNode * gts_fnode_new (GtsFNodeClass * klass, + GtsFace * f); + +/* GtsGEdge: graph.c */ + +typedef struct _GtsGEdge GtsGEdge; +typedef struct _GtsGEdgeClass GtsGEdgeClass; + +struct _GtsGEdge { + GtsContainee containee; + + GtsGNode * n1; + GtsGNode * n2; +}; + +struct _GtsGEdgeClass { + GtsContaineeClass parent_class; + + GtsGEdge * (* link) (GtsGEdge * e, GtsGNode * n1, GtsGNode * n2); + gfloat (* weight) (GtsGEdge * e); + void (* write) (GtsGEdge * e, FILE * fp); +}; + +#define GTS_GEDGE(obj) GTS_OBJECT_CAST (obj,\ + GtsGEdge,\ + gts_gedge_class ()) +#define GTS_GEDGE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsGEdgeClass,\ + gts_gedge_class()) +#define GTS_IS_GEDGE(obj) (gts_object_is_from_class (obj,\ + gts_gedge_class ())) + +GtsGEdgeClass * gts_gedge_class (void); +GtsGEdge * gts_gedge_new (GtsGEdgeClass * klass, + GtsGNode * n1, + GtsGNode * n2); +gfloat gts_gedge_weight (GtsGEdge * e); +#define gts_gedge_connects(e, a1, a2)\ + (((e)->n1 == a1 && (e)->n2 == a2) || ((e)->n1 == a2 && (e)->n2 == a1)) + +/* GtsPGEdge: graph.c */ + +typedef struct _GtsPGEdge GtsPGEdge; +typedef struct _GtsPGEdgeClass GtsPGEdgeClass; + +struct _GtsPGEdge { + GtsGEdge gedge; + + gpointer data; +}; + +struct _GtsPGEdgeClass { + GtsGEdgeClass parent_class; +}; + +#define GTS_PGEDGE(obj) GTS_OBJECT_CAST (obj,\ + GtsPGEdge,\ + gts_pgedge_class ()) +#define GTS_PGEDGE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsPGEdgeClass,\ + gts_pgedge_class()) +#define GTS_IS_PGEDGE(obj) (gts_object_is_from_class (obj,\ + gts_pgedge_class ())) + +GtsPGEdgeClass * gts_pgedge_class (void); +GtsPGEdge * gts_pgedge_new (GtsPGEdgeClass * klass, + GtsGNode * n1, + GtsGNode * n2, + gpointer data); + +/* GtsWGEdge: graph.c */ + +typedef struct _GtsWGEdge GtsWGEdge; +typedef struct _GtsWGEdgeClass GtsWGEdgeClass; + +struct _GtsWGEdge { + GtsGEdge gedge; + + gfloat weight; +}; + +struct _GtsWGEdgeClass { + GtsGEdgeClass parent_class; +}; + +#define GTS_WGEDGE(obj) GTS_OBJECT_CAST (obj,\ + GtsWGEdge,\ + gts_wgedge_class ()) +#define GTS_WGEDGE_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsWGEdgeClass,\ + gts_wgedge_class()) +#define GTS_IS_WGEDGE(obj) (gts_object_is_from_class (obj,\ + gts_wgedge_class ())) + +GtsWGEdgeClass * gts_wgedge_class (void); +GtsWGEdge * gts_wgedge_new (GtsWGEdgeClass * klass, + GtsGNode * n1, + GtsGNode * n2, + gfloat weight); + +/* GtsGraph: graph.c */ + +struct _GtsGraph { + GtsHashContainer object; + + GtsGraphClass * graph_class; + GtsGNodeClass * node_class; + GtsGEdgeClass * edge_class; +}; + +struct _GtsGraphClass { + GtsHashContainerClass parent_class; + + gfloat (* weight) (GtsGraph *); +}; + +#define GTS_GRAPH(obj) GTS_OBJECT_CAST (obj,\ + GtsGraph,\ + gts_graph_class ()) +#define GTS_GRAPH_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsGraphClass,\ + gts_graph_class()) +#define GTS_IS_GRAPH(obj) (gts_object_is_from_class (obj,\ + gts_graph_class ())) + +GtsGraphClass * gts_graph_class (void); +GtsGraph * gts_graph_new (GtsGraphClass * klass, + GtsGNodeClass * node_class, + GtsGEdgeClass * edge_class); +void gts_graph_print_stats (GtsGraph * g, + FILE * fp); +typedef struct _GtsGraphTraverse GtsGraphTraverse; +typedef enum { GTS_BREADTH_FIRST + } GtsTraverseType; +GtsGraphTraverse * gts_graph_traverse_new (GtsGraph * g, + GtsGNode * n, + GtsTraverseType type, + gboolean reinit); +GtsGNode * gts_graph_traverse_next (GtsGraphTraverse * t); +GtsGNode * gts_graph_traverse_what_next (GtsGraphTraverse * t); +void gts_graph_traverse_destroy (GtsGraphTraverse * t); +void gts_graph_foreach_edge (GtsGraph * g, + GtsFunc func, + gpointer data); +gfloat gts_graph_weight (GtsGraph * g); +guint gts_graph_distance_sum (GtsGraph * g, + GtsGNode * center); +GtsGNode * gts_graph_farthest (GtsGraph * g, + GSList * gnodes); +guint gts_graph_edges_cut (GtsGraph * g); +gfloat gts_graph_edges_cut_weight (GtsGraph * g); +void gts_graph_write (GtsGraph * g, + FILE * fp); +void gts_graph_write_dot (GtsGraph * g, + FILE * fp); +GtsGraph * gts_graph_read (GtsFile * fp); +guint gts_graph_read_jostle (GtsGraph * g, + GtsFile * fp); + +/* GtsWGraph: graph.c */ + +typedef struct _GtsWGraph GtsWGraph; +typedef struct _GtsWGraphClass GtsWGraphClass; + +struct _GtsWGraph { + GtsGraph graph; + + gfloat weight; +}; + +struct _GtsWGraphClass { + GtsGraphClass parent_class; +}; + +#define GTS_WGRAPH(obj) GTS_OBJECT_CAST (obj,\ + GtsWGraph,\ + gts_wgraph_class ()) +#define GTS_WGRAPH_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsWGraphClass,\ + gts_wgraph_class()) +#define GTS_IS_WGRAPH(obj) (gts_object_is_from_class (obj,\ + gts_wgraph_class ())) + +GtsWGraphClass * gts_wgraph_class (void); +gfloat gts_wgraph_weight_max (GtsWGraph * wg); + +/* Surface graph: graph.c */ + +GtsGraph * gts_surface_graph_new (GtsGraphClass * klass, + GtsSurface * s); +GtsSurface * gts_surface_graph_surface (GtsGraph * surface_graph, + GtsSurface * s); + +/* Segments graph: graph.c */ + +GtsGraph * gts_segments_graph_new (GtsGraphClass * klass, + GSList * segments); + +/* GtsGNodeSplit: pgraph.c */ + +typedef struct _GtsGNodeSplit GtsGNodeSplit; +typedef struct _GtsGNodeSplitClass GtsGNodeSplitClass; + +struct _GtsGNodeSplit { + GtsObject object; + + GtsGNode * n; + GtsObject * n1; + GtsObject * n2; +}; + +struct _GtsGNodeSplitClass { + GtsObjectClass parent_class; +}; + +#define GTS_GNODE_SPLIT(obj) GTS_OBJECT_CAST (obj,\ + GtsGNodeSplit,\ + gts_gnode_split_class ()) +#define GTS_GNODE_SPLIT_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsGNodeSplitClass,\ + gts_gnode_split_class()) +#define GTS_IS_GNODE_SPLIT(obj) (gts_object_is_from_class (obj,\ + gts_gnode_split_class ())) +#define GTS_GNODE_SPLIT_N1(ns) (GTS_IS_GNODE_SPLIT ((ns)->n1) ? GTS_GNODE_SPLIT ((ns)->n1)->n : GTS_GNODE ((ns)->n1)) +#define GTS_GNODE_SPLIT_N2(ns) (GTS_IS_GNODE_SPLIT ((ns)->n2) ? GTS_GNODE_SPLIT ((ns)->n2)->n : GTS_GNODE ((ns)->n2)) + +GtsGNodeSplitClass * gts_gnode_split_class (void); +GtsGNodeSplit * gts_gnode_split_new (GtsGNodeSplitClass * klass, + GtsGNode * n, + GtsObject * n1, + GtsObject * n2); +void gts_gnode_split_collapse (GtsGNodeSplit * ns, + GtsGraph * g, + GtsWGEdgeClass * klass); +void gts_gnode_split_expand (GtsGNodeSplit * ns, + GtsGraph * g); + +/* GtsPGraph: pgraph.c */ + +typedef struct _GtsPGraph GtsPGraph; +typedef struct _GtsPGraphClass GtsPGraphClass; + +struct _GtsPGraph { + GtsObject object; + + GtsGraph * g; + GPtrArray * split; + GArray * levels; + GtsGNodeSplitClass * split_class; + GtsWGEdgeClass * edge_class; + guint pos, min, level; +}; + +struct _GtsPGraphClass { + GtsObjectClass parent_class; +}; + +#define GTS_PGRAPH(obj) GTS_OBJECT_CAST (obj,\ + GtsPGraph,\ + gts_pgraph_class ()) +#define GTS_PGRAPH_CLASS(klass) GTS_OBJECT_CLASS_CAST (klass,\ + GtsPGraphClass,\ + gts_pgraph_class()) +#define GTS_IS_PGRAPH(obj) (gts_object_is_from_class (obj,\ + gts_pgraph_class ())) + +GtsPGraphClass * gts_pgraph_class (void); +GtsPGraph * gts_pgraph_new (GtsPGraphClass * klass, + GtsGraph * g, + GtsGNodeSplitClass * split_class, + GtsWGNodeClass * node_class, + GtsWGEdgeClass * edge_class, + guint min); +GtsGNodeSplit * gts_pgraph_add_node (GtsPGraph * pg); +GtsGNodeSplit * gts_pgraph_remove_node (GtsPGraph * pg); +void gts_pgraph_set_node_number (GtsPGraph *pg, + guint n); +guint gts_pgraph_get_node_number (GtsPGraph *pg); +guint gts_pgraph_min_node_number (GtsPGraph *pg); +guint gts_pgraph_max_node_number (GtsPGraph *pg); +void gts_pgraph_foreach_node (GtsPGraph *pg, + GtsFunc func, + gpointer data); +gboolean gts_pgraph_down (GtsPGraph * pg, + GtsFunc func, + gpointer data); +/* Graph partition: partition.c */ + +GSList * gts_graph_bubble_partition (GtsGraph * g, + guint np, + guint niter, + GtsFunc step_info, + gpointer data); +guint gts_graph_partition_edges_cut (GSList * partition); +gfloat gts_graph_partition_edges_cut_weight (GSList * partition); +void gts_graph_partition_print_stats (GSList * partition, + FILE * fp); +gfloat gts_graph_partition_balance (GSList * partition); +GSList * gts_graph_partition_clone (GSList * partition); +GSList * gts_graph_recursive_bisection (GtsWGraph * wg, + guint n, + guint ntry, + guint mmax, + guint nmin, + gfloat imbalance); +void gts_graph_partition_destroy (GSList * partition); + +/* Graph bisection: partition.c */ + +typedef struct _GtsGraphBisection GtsGraphBisection; + +struct _GtsGraphBisection { + GtsGraph * g; + GtsGraph * g1; + GtsGraph * g2; + GHashTable * bg1; + GHashTable * bg2; +}; + +gboolean gts_graph_bisection_check (GtsGraphBisection * bg); +GtsGraphBisection * gts_graph_ggg_bisection (GtsGraph * g, + guint ntry); +GtsGraphBisection * gts_graph_bfgg_bisection (GtsGraph * g, + guint ntry); +gdouble gts_graph_bisection_kl_refine (GtsGraphBisection * bg, + guint mmax); +gdouble gts_graph_bisection_bkl_refine (GtsGraphBisection * bg, + guint mmax, + gfloat imbalance); +GtsGraphBisection * gts_graph_bisection_new (GtsWGraph * wg, + guint ntry, + guint mmax, + guint nmin, + gfloat imbalance); +void gts_graph_bisection_destroy (GtsGraphBisection * bg, + gboolean destroy_graphs); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GTS_H__ */ Index: tags/1.0.5/gts/heap.c =================================================================== --- tags/1.0.5/gts/heap.c (nonexistent) +++ tags/1.0.5/gts/heap.c (revision 953) @@ -0,0 +1,258 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +#define PARENT(i) ((i) >= 2 ? (i)/2 : 0) +#define LEFT_CHILD(i) (2*(i)) +#define RIGHT_CHILD(i) (2*(i) + 1) + +struct _GtsHeap { + GPtrArray * elts; + GCompareFunc func; + gboolean frozen; +}; + +/** + * gts_heap_new: + * @compare_func: a GCompareFunc. + * + * Returns: a new #GtsHeap using @compare_func as a sorting function. + */ +GtsHeap * gts_heap_new (GCompareFunc compare_func) +{ + GtsHeap * heap; + + g_return_val_if_fail (compare_func != NULL, NULL); + + heap = g_malloc (sizeof(GtsHeap)); + heap->elts = g_ptr_array_new (); + heap->func = compare_func; + heap->frozen = FALSE; + return heap; +} + +static void sift_up (GtsHeap * heap, guint i) +{ + gpointer parent, child; + guint p; + gpointer * pdata = heap->elts->pdata; + GCompareFunc func = heap->func; + + child = pdata[i - 1]; + while ((p = PARENT (i))) { + parent = pdata[p - 1]; + if ((*func) (parent, child) > 0) { + pdata[p - 1] = child; + pdata[i - 1] = parent; + i = p; + } + else + i = 0; + } +} + +/** + * gts_heap_insert: + * @heap: a #GtsHeap. + * @p: a pointer to add to the heap. + * + * Inserts a new element @p in the heap. + */ +void gts_heap_insert (GtsHeap * heap, gpointer p) +{ + g_return_if_fail (heap != NULL); + + g_ptr_array_add (heap->elts, p); + if (!heap->frozen) + sift_up (heap, heap->elts->len); +} + +static void sift_down (GtsHeap * heap, guint i) +{ + gpointer left_child, right_child, child, parent; + guint lc, rc, c; + gpointer * pdata = heap->elts->pdata; + guint len = heap->elts->len; + GCompareFunc func = heap->func; + + lc = LEFT_CHILD (i); + rc = RIGHT_CHILD (i); + left_child = lc <= len ? pdata[lc - 1] : NULL; + right_child = rc <= len ? pdata[rc - 1] : NULL; + + parent = pdata[i - 1]; + while (left_child != NULL) { + if (right_child == NULL || + (*func) (left_child, right_child) < 0) { + child = left_child; + c = lc; + } + else { + child = right_child; + c = rc; + } + if ((*func) (parent, child) > 0) { + pdata[i - 1] = child; + pdata[c - 1] = parent; + i = c; + lc = LEFT_CHILD (i); + rc = RIGHT_CHILD (i); + left_child = lc <= len ? pdata[lc - 1] : NULL; + right_child = rc <= len ? pdata[rc - 1] : NULL; + } + else + left_child = NULL; + } +} + +/** + * gts_heap_remove_top: + * @heap: a #GtsHeap. + * + * Removes the element at the top of the heap. + * + * Returns: the element at the top of the heap. + */ +gpointer gts_heap_remove_top (GtsHeap * heap) +{ + gpointer root; + GPtrArray * elts; + guint len; + + g_return_val_if_fail (heap != NULL, NULL); + + elts = heap->elts; len = elts->len; + + if (len == 0) + return NULL; + if (len == 1) + return g_ptr_array_remove_index (elts, 0); + + root = elts->pdata[0]; + elts->pdata[0] = g_ptr_array_remove_index (elts, len - 1); + sift_down (heap, 1); + return root; +} + +/** + * gts_heap_top: + * @heap: a #GtsHeap. + * + * Returns: the element at the top of the heap. + */ +gpointer gts_heap_top (GtsHeap * heap) +{ + GPtrArray * elts; + guint len; + + g_return_val_if_fail (heap != NULL, NULL); + + elts = heap->elts; + len = elts->len; + if (len == 0) + return NULL; + return elts->pdata[0]; +} + +/** + * gts_heap_destroy: + * @heap: a #GtsHeap. + * + * Free all the memory allocated for @heap. + */ +void gts_heap_destroy (GtsHeap * heap) +{ + g_return_if_fail (heap != NULL); + + g_ptr_array_free (heap->elts, TRUE); + g_free (heap); +} + +/** + * gts_heap_thaw: + * @heap: a #GtsHeap. + * + * If @heap has been frozen previously using gts_heap_freeze(), reorder it + * in O(n) time and unfreeze it. + */ +void gts_heap_thaw (GtsHeap * heap) +{ + guint i; + + g_return_if_fail (heap != NULL); + + if (!heap->frozen) + return; + + for (i = heap->elts->len/2; i > 0; i--) + sift_down (heap, i); + + heap->frozen = FALSE; +} + +/** + * gts_heap_foreach: + * @heap: a #GtsHeap. + * @func: the function to call for each element in the heap. + * @user_data: to pass to @func. + */ +void gts_heap_foreach (GtsHeap * heap, + GFunc func, + gpointer user_data) +{ + guint i; + GPtrArray * elts; + + g_return_if_fail (heap != NULL); + g_return_if_fail (func != NULL); + + elts = heap->elts; + for (i = 0; i < elts->len; i++) + (*func) (elts->pdata[i], user_data); +} + +/** + * gts_heap_freeze: + * @heap: a #GtsHeap. + * + * Freezes the heap. Any subsequent operation will not preserve the heap + * property. Used in conjunction with gts_heap_insert() and gts_heap_thaw() + * to create a heap in O(n) time. + */ +void gts_heap_freeze (GtsHeap * heap) +{ + g_return_if_fail (heap != NULL); + + heap->frozen = TRUE; +} + +/** + * gts_heap_size: + * @heap: a #GtsHeap. + * + * Returns: the number of items in @heap. + */ +guint gts_heap_size (GtsHeap * heap) +{ + g_return_val_if_fail (heap != NULL, 0); + + return heap->elts->len; +} Index: tags/1.0.5/gts/hsurface.c =================================================================== --- tags/1.0.5/gts/hsurface.c (nonexistent) +++ tags/1.0.5/gts/hsurface.c (revision 953) @@ -0,0 +1,405 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "gts.h" + +#define HEAP_INSERT_HSPLIT(h, e) ((e)->index = gts_eheap_insert (h, e)) +#define HEAP_REMOVE_HSPLIT(h, e) (gts_eheap_remove (h, (e)->index),\ + (e)->index = NULL) + +static void hsplit_init (GtsHSplit * hsplit) +{ + hsplit->index = NULL; + hsplit->parent = NULL; + hsplit->nchild = 0; +} + +/** + * gts_hsplit_class: + * + * Returns: the #GtsHSplitClass. + */ +GtsHSplitClass * gts_hsplit_class (void) +{ + static GtsHSplitClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo hsplit_info = { + "GtsHSplit", + sizeof (GtsHSplit), + sizeof (GtsHSplitClass), + (GtsObjectClassInitFunc) NULL, + (GtsObjectInitFunc) hsplit_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_split_class ()), + &hsplit_info); + } + + return klass; +} + +/** + * gts_hsplit_new: + * @klass: a #GtsHSplitClass. + * @vs: a #GtsSplit. + * + * Returns: a new #GtsHSplit, hierarchical extension of @vs. + */ +GtsHSplit * gts_hsplit_new (GtsHSplitClass * klass, GtsSplit * vs) +{ + GtsHSplit * hs; + + g_return_val_if_fail (vs != NULL, NULL); + + hs = GTS_HSPLIT (gts_object_new (GTS_OBJECT_CLASS (klass))); + memcpy (hs, vs, sizeof (GtsSplit)); + GTS_OBJECT (hs)->reserved = NULL; + + return hs; +} + +/** + * gts_hsplit_collapse: + * @hs: a #GtsHSplit. + * @hsurface: a #GtsHSurface. + * + * Collapses the #GtsSplit defined by @hs, updates the expandable and + * collapsable priority heaps of @hsurface. + */ +void gts_hsplit_collapse (GtsHSplit * hs, + GtsHSurface * hsurface) +{ + GtsHSplit * parent; + GtsSplit * vs; + + g_return_if_fail (hs != NULL); + g_return_if_fail (hs->nchild == 2); + g_return_if_fail (hsurface != NULL); + + gts_split_collapse (GTS_SPLIT (hs), hsurface->s->edge_class, NULL); + + hsurface->nvertex--; + hs->nchild = 0; + HEAP_REMOVE_HSPLIT (hsurface->collapsable, hs); + HEAP_INSERT_HSPLIT (hsurface->expandable, hs); + + vs = GTS_SPLIT (hs); + if (GTS_IS_HSPLIT (vs->v1)) + HEAP_REMOVE_HSPLIT (hsurface->expandable, GTS_HSPLIT (vs->v1)); + if (GTS_IS_HSPLIT (vs->v2)) + HEAP_REMOVE_HSPLIT (hsurface->expandable, GTS_HSPLIT (vs->v2)); + + parent = hs->parent; + if (parent && ++parent->nchild == 2) + HEAP_INSERT_HSPLIT (hsurface->collapsable, parent); +} + +/** + * gts_hsplit_expand: + * @hs: a #GtsHSplit. + * @hsurface: a #GtsHSurface. + * + * Expands the #GtsSplit defined by @hs (which must be expandable) + * and updates the priority heaps of @hsurface. + */ +void gts_hsplit_expand (GtsHSplit * hs, + GtsHSurface * hsurface) +{ + GtsHSplit * parent; + GtsSplit * vs; + + g_return_if_fail (hs != NULL); + g_return_if_fail (hsurface != NULL); + g_return_if_fail (hs->nchild == 0); + + gts_split_expand (GTS_SPLIT (hs), hsurface->s, hsurface->s->edge_class); + hsurface->nvertex++; + hs->nchild = 2; + HEAP_REMOVE_HSPLIT (hsurface->expandable, hs); + HEAP_INSERT_HSPLIT (hsurface->collapsable, hs); + + vs = GTS_SPLIT (hs); + if (GTS_IS_HSPLIT (vs->v1)) + HEAP_INSERT_HSPLIT (hsurface->expandable, GTS_HSPLIT (vs->v1)); + if (GTS_IS_HSPLIT (vs->v2)) + HEAP_INSERT_HSPLIT (hsurface->expandable, GTS_HSPLIT (vs->v2)); + + parent = hs->parent; + if (parent && parent->nchild-- == 2) + HEAP_REMOVE_HSPLIT (hsurface->collapsable, parent); +} + +static void hsurface_destroy (GtsObject * object) +{ + GtsHSurface * hs = GTS_HSURFACE (object); + + gts_hsurface_traverse (hs, G_POST_ORDER, -1, + (GtsSplitTraverseFunc) gts_object_destroy, + NULL); + g_slist_free (hs->roots); + if (hs->expandable) + gts_eheap_destroy (hs->expandable); + if (hs->collapsable) + gts_eheap_destroy (hs->collapsable); + g_ptr_array_free (hs->split, TRUE); + + (* GTS_OBJECT_CLASS (gts_hsurface_class ())->parent_class->destroy) (object); +} + +static void hsurface_class_init (GtsObjectClass * klass) +{ + klass->destroy = hsurface_destroy; +} + +static void hsurface_init (GtsHSurface * hsurface) +{ + hsurface->s = NULL; + hsurface->roots = NULL; + hsurface->expandable = hsurface->collapsable = NULL; + hsurface->split = g_ptr_array_new (); + hsurface->nvertex = 0; +} + +/** + * gts_hsurface_class: + * + * Returns: the #GtsHSurfaceClass. + */ +GtsHSurfaceClass * gts_hsurface_class (void) +{ + static GtsHSurfaceClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo hsurface_info = { + "GtsHSurface", + sizeof (GtsHSurface), + sizeof (GtsHSurfaceClass), + (GtsObjectClassInitFunc) hsurface_class_init, + (GtsObjectInitFunc) hsurface_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), + &hsurface_info); + } + + return klass; +} + +/** + * gts_hsurface_new: + * @klass: a #GtsHSurfaceClass. + * @hsplit_class: a #GtsHSplitClass. + * @psurface: a #GtsPSurface. + * @expand_key: a #GtsKeyFunc used to order the priority heap of expandable + * #GtsHSplit. + * @expand_data: data to be passed to @expand_key. + * @collapse_key: a #GtsKeyFunc used to order the priority heap of collapsable + * #GtsHSplit. + * @collapse_data: data to be passed to @collapsed_key. + * + * Returns: a new #GtsHSurface, hierarchical extension of @psurface + * and using #GtsHSplit of class @hsplit_class. Note that @psurface is + * destroyed in the process. + */ +GtsHSurface * gts_hsurface_new (GtsHSurfaceClass * klass, + GtsHSplitClass * hsplit_class, + GtsPSurface * psurface, + GtsKeyFunc expand_key, + gpointer expand_data, + GtsKeyFunc collapse_key, + gpointer collapse_data) +{ + GtsHSurface * hsurface; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (hsplit_class != NULL, NULL); + g_return_val_if_fail (psurface != NULL, NULL); + g_return_val_if_fail (expand_key != NULL, NULL); + g_return_val_if_fail (collapse_key != NULL, NULL); + + hsurface = GTS_HSURFACE (gts_object_new (GTS_OBJECT_CLASS (klass))); + hsurface->s = psurface->s; + hsurface->expandable = gts_eheap_new (expand_key, expand_data); + hsurface->collapsable = gts_eheap_new (collapse_key, collapse_data); + g_ptr_array_set_size (hsurface->split, psurface->split->len); + + while (gts_psurface_remove_vertex (psurface)) + ; + while (psurface->pos) { + GtsSplit * vs = g_ptr_array_index (psurface->split, psurface->pos - 1); + GtsHSplit * hs = gts_hsplit_new (hsplit_class, vs); + + g_ptr_array_index (hsurface->split, psurface->pos - 1) = hs; + psurface->pos--; + + hs->parent = GTS_OBJECT (vs)->reserved; + if (hs->parent) { + GtsSplit * vsp = GTS_SPLIT (hs->parent); + + if (vsp->v1 == GTS_OBJECT (vs)) { + g_assert (vsp->v2 != GTS_OBJECT (vs)); + vsp->v1 = GTS_OBJECT (hs); + } + else { + g_assert (vsp->v2 == GTS_OBJECT (vs)); + vsp->v2 = GTS_OBJECT (hs); + } + } + else + hsurface->roots = g_slist_prepend (hsurface->roots, hs); + + hs->nchild = 0; + if (GTS_IS_SPLIT (vs->v1)) + GTS_OBJECT (vs->v1)->reserved = hs; + else + hs->nchild++; + if (GTS_IS_SPLIT (vs->v2)) + GTS_OBJECT (vs->v2)->reserved = hs; + else + hs->nchild++; + + gts_split_expand (vs, psurface->s, psurface->s->edge_class); + + if (hs->nchild == 2) + HEAP_INSERT_HSPLIT (hsurface->collapsable, hs); + } + + hsurface->nvertex = gts_surface_vertex_number (hsurface->s); + gts_object_destroy (GTS_OBJECT (psurface)); + + return hsurface; +} + +/** + * gts_hsurface_traverse: + * @hsurface: a #GtsHSurface. + * @order: the order in which nodes are visited - G_PRE_ORDER or G_POST_ORDER. + * @depth: the maximum depth of the traversal. Nodes below this depth + * will not be visited. If max_depth is -1 all nodes in the tree are + * visited. If depth is 1, only the root is visited. If depth is 2, + * the root and its children are visited. And so on. + * @func: the function to call for each visited #GtsHSplit. + * @data: user data to pass to the function. + * + * Traverses a hierarchical surface starting from its roots. It calls + * the given function for each #GtsHSplit visited. + * See also gts_split_traverse(). + */ +void gts_hsurface_traverse (GtsHSurface * hsurface, + GTraverseType order, + gint depth, + GtsSplitTraverseFunc func, + gpointer data) +{ + GSList * i; + + g_return_if_fail (hsurface != NULL); + g_return_if_fail (func != NULL); + g_return_if_fail (order < G_LEVEL_ORDER); + g_return_if_fail (depth == -1 || depth > 0); + + i = hsurface->roots; + while (i) { + gts_split_traverse (i->data, order, depth, func, data); + i = i->next; + } +} + +/** + * gts_hsurface_foreach: + * @hsurface: a #GtsHSurface. + * @order: the order in which #GtsHSplit are visited - G_PRE_ORDER or + * G_POST_ORDER. + * @func: the function to call for each visited #GtsHSplit. + * @data: user data to pass to the function. + * + * Starts by expanding all the #GtsHSplit of @hsurface. If @order is + * G_PRE_ORDER, calls @func for each #GtsHSplit and collapses it. If + * order is G_POST_ORDER, collapses each #GtsHSplit first and then + * calls @func. The traversal can be halted at any point by returning + * TRUE from func. + */ +void gts_hsurface_foreach (GtsHSurface * hsurface, + GTraverseType order, + GtsFunc func, + gpointer data) +{ + GtsHSplit * hs; + guint i = 0, len; + gboolean stop = FALSE; + + g_return_if_fail (hsurface != NULL); + g_return_if_fail (func != NULL); + g_return_if_fail (order == G_PRE_ORDER || order == G_POST_ORDER); + + while ((hs = gts_eheap_top (hsurface->expandable, NULL))) + gts_hsplit_expand (hs, hsurface); + + len = hsurface->split->len; + switch (order) { + case G_PRE_ORDER: + while (i < len && !stop) { + GtsHSplit * hs = g_ptr_array_index (hsurface->split, i); + stop = (*func) (hs, data); + if (!stop) + gts_hsplit_collapse (hs, hsurface); + i++; + } + break; + case G_POST_ORDER: + while (i < len && !stop) { + GtsHSplit * hs = g_ptr_array_index (hsurface->split, i); + gts_hsplit_collapse (hs, hsurface); + stop = (*func) (hs, data); + i++; + } + break; + default: + g_assert_not_reached (); + } +} + +/** + * gts_hsurface_height: + * @hsurface: a #GtsHSurface. + * + * Returns: the maximum height of the tree described by @hsurface. + */ +guint gts_hsurface_height (GtsHSurface * hsurface) +{ + GSList * i; + guint height = 0; + + g_return_val_if_fail (hsurface != NULL, 0); + + i = hsurface->roots; + while (i) { + guint tmp_height = gts_split_height (i->data); + if (tmp_height > height) + height = tmp_height; + i = i->next; + } + + return height; +} Index: tags/1.0.5/gts/iso.c =================================================================== --- tags/1.0.5/gts/iso.c (nonexistent) +++ tags/1.0.5/gts/iso.c (revision 953) @@ -0,0 +1,455 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +typedef enum { LEFT = 0, RIGHT = 1 } Orientation; + +typedef struct { + GtsVertex * v; + Orientation orientation; +} OrientedVertex; + +struct _GtsIsoSlice { + OrientedVertex *** vertices; + guint nx, ny; +}; + +/* coordinates of the edges of the cube (see doc/isocube.fig) */ +static guint c[12][4] = { + {0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 1}, {0, 0, 1, 0}, + {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 1, 0, 1}, {1, 1, 0, 0}, + {2, 0, 0, 0}, {2, 1, 0, 0}, {2, 1, 1, 0}, {2, 0, 1, 0}}; + +/* first index is the edge number, second index is the edge orientation + (RIGHT or LEFT), third index are the edges which this edge may connect to + in order */ +static guint edge[12][2][3] = { + {{9, 1, 8}, {4, 3, 7}}, /* 0 */ + {{6, 2, 5}, {8, 0, 9}}, /* 1 */ + {{10, 3, 11}, {5, 1, 6}}, /* 2 */ + {{7, 0, 4}, {11, 2, 10}}, /* 3 */ + {{3, 7, 0}, {8, 5, 11}}, /* 4 */ + {{11, 4, 8}, {1, 6, 2}}, /* 5 */ + {{2, 5, 1}, {9, 7, 10}}, /* 6 */ + {{10, 6, 9}, {0, 4, 3}}, /* 7 */ + {{5, 11, 4}, {0, 9, 1}}, /* 8 */ + {{1, 8, 0}, {7, 10, 6}}, /* 9 */ + {{6, 9, 7}, {3, 11, 2}}, /* 10 */ + {{2, 10, 3}, {4, 8, 5}} /* 11 */ +}; + +static void ** malloc2D (guint nx, guint ny, gulong size) +{ + void ** m = g_malloc (nx*sizeof (void *)); + guint i; + + for (i = 0; i < nx; i++) + m[i] = g_malloc0 (ny*size); + + return m; +} + +static void free2D (void ** m, guint nx) +{ + guint i; + + g_return_if_fail (m != NULL); + + for (i = 0; i < nx; i++) + g_free (m[i]); + g_free (m); +} + +/** + * gts_grid_plane_new: + * @nx: + * @ny: + * + * Returns: + */ +GtsGridPlane * gts_grid_plane_new (guint nx, guint ny) +{ + GtsGridPlane * g = g_malloc (sizeof (GtsGridPlane)); + + g->p = (GtsPoint **) malloc2D (nx, ny, sizeof (GtsPoint)); + g->nx = nx; + g->ny = ny; + + return g; +} + +/** + * gts_grid_plane_destroy: + * @g: + * + */ +void gts_grid_plane_destroy (GtsGridPlane * g) +{ + g_return_if_fail (g != NULL); + + free2D ((void **) g->p, g->nx); + g_free (g); +} + +/** + * gts_iso_slice_new: + * @nx: number of vertices in the x direction. + * @ny: number of vertices in the y direction. + * + * Returns: a new #GtsIsoSlice. + */ +GtsIsoSlice * gts_iso_slice_new (guint nx, guint ny) +{ + GtsIsoSlice * slice; + + g_return_val_if_fail (nx > 1, NULL); + g_return_val_if_fail (ny > 1, NULL); + + slice = g_malloc (sizeof (GtsIsoSlice)); + + slice->vertices = g_malloc (3*sizeof (OrientedVertex **)); + slice->vertices[0] = + (OrientedVertex **) malloc2D (nx, ny, sizeof (OrientedVertex)); + slice->vertices[1] = + (OrientedVertex **) malloc2D (nx - 1, ny, sizeof (OrientedVertex)); + slice->vertices[2] = + (OrientedVertex **) malloc2D (nx, ny - 1, sizeof (OrientedVertex)); + slice->nx = nx; + slice->ny = ny; + + return slice; +} + +/** + * gts_iso_slice_fill: + * @slice: a #GtsIsoSlice. + * @plane1: a #GtsGridPlane. + * @plane2: another #GtsGridPlane. + * @f1: values of the function corresponding to @plane1. + * @f2: values of the function corresponding to @plane2. + * @iso: isosurface value. + * @klass: a #GtsVertexClass or one of its descendant to be used for the + * new vertices. + * + * Fill @slice with the coordinates of the vertices defined by + * f1 (x,y,z) = @iso and f2 (x, y, z) = @iso. + */ +void gts_iso_slice_fill (GtsIsoSlice * slice, + GtsGridPlane * plane1, + GtsGridPlane * plane2, + gdouble ** f1, + gdouble ** f2, + gdouble iso, + GtsVertexClass * klass) +{ + OrientedVertex *** vertices; + GtsPoint ** p1, ** p2 = NULL; + guint i, j, nx, ny; + + g_return_if_fail (slice != NULL); + g_return_if_fail (plane1 != NULL); + g_return_if_fail (f1 != NULL); + g_return_if_fail (f2 == NULL || plane2 != NULL); + + p1 = plane1->p; + if (plane2) + p2 = plane2->p; + vertices = slice->vertices; + nx = slice->nx; + ny = slice->ny; + + if (f2) + for (i = 0; i < nx; i++) + for (j = 0; j < ny; j++) { + gdouble v1 = f1[i][j] - iso; + gdouble v2 = f2[i][j] - iso; + if ((v1 >= 0. && v2 < 0.) || (v1 < 0. && v2 >= 0.)) { + gdouble c2 = v1/(v1 - v2), c1 = 1. - c2; + vertices[0][i][j].v = + gts_vertex_new (klass, + c1*p1[i][j].x + c2*p2[i][j].x, + c1*p1[i][j].y + c2*p2[i][j].y, + c1*p1[i][j].z + c2*p2[i][j].z); + vertices[0][i][j].orientation = v2 >= 0. ? RIGHT : LEFT; + } + else + vertices[0][i][j].v = NULL; + } + for (i = 0; i < nx - 1; i++) + for (j = 0; j < ny; j++) { + gdouble v1 = f1[i][j] - iso; + gdouble v2 = f1[i+1][j] - iso; + if ((v1 >= 0. && v2 < 0.) || (v1 < 0. && v2 >= 0.)) { + gdouble c2 = v1/(v1 - v2), c1 = 1. - c2; + vertices[1][i][j].v = + gts_vertex_new (klass, + c1*p1[i][j].x + c2*p1[i+1][j].x, + c1*p1[i][j].y + c2*p1[i+1][j].y, + c1*p1[i][j].z + c2*p1[i+1][j].z); + vertices[1][i][j].orientation = v2 >= 0. ? RIGHT : LEFT; + } + else + vertices[1][i][j].v = NULL; + } + for (i = 0; i < nx; i++) + for (j = 0; j < ny - 1; j++) { + gdouble v1 = f1[i][j] - iso; + gdouble v2 = f1[i][j+1] - iso; + if ((v1 >= 0. && v2 < 0.) || (v1 < 0. && v2 >= 0.)) { + gdouble c2 = v1/(v1 - v2), c1 = 1. - c2; + vertices[2][i][j].v = + gts_vertex_new (klass, + c1*p1[i][j].x + c2*p1[i][j+1].x, + c1*p1[i][j].y + c2*p1[i][j+1].y, + c1*p1[i][j].z + c2*p1[i][j+1].z); + vertices[2][i][j].orientation = v2 >= 0. ? RIGHT : LEFT; + } + else + vertices[2][i][j].v = NULL; + } +} + +/** + * gts_iso_slice_fill_cartesian: + * @slice: a #GtsIsoSlice. + * @g: a #GtsCartesianGrid. + * @f1: values of the function for plane z = @g.z. + * @f2: values of the function for plane z = @g.z + @g.dz. + * @iso: isosurface value. + * @klass: a #GtsVertexClass. + * + * Fill @slice with the coordinates of the vertices defined by + * f1 (x,y,z) = @iso and f2 (x, y, z) = @iso. + */ +void gts_iso_slice_fill_cartesian (GtsIsoSlice * slice, + GtsCartesianGrid g, + gdouble ** f1, + gdouble ** f2, + gdouble iso, + GtsVertexClass * klass) +{ + OrientedVertex *** vertices; + guint i, j; + gdouble x, y; + + g_return_if_fail (slice != NULL); + g_return_if_fail (f1 != NULL); + + vertices = slice->vertices; + + if (f2) + for (i = 0, x = g.x; i < g.nx; i++, x += g.dx) + for (j = 0, y = g.y; j < g.ny; j++, y += g.dy) { + gdouble v1 = f1[i][j] - iso; + gdouble v2 = f2[i][j] - iso; + if ((v1 >= 0. && v2 < 0.) || (v1 < 0. && v2 >= 0.)) { + vertices[0][i][j].v = + gts_vertex_new (klass, + x, y, g.z + g.dz*v1/(v1 - v2)); + vertices[0][i][j].orientation = v2 >= 0. ? RIGHT : LEFT; + } + else + vertices[0][i][j].v = NULL; + } + for (i = 0, x = g.x; i < g.nx - 1; i++, x += g.dx) + for (j = 0, y = g.y; j < g.ny; j++, y += g.dy) { + gdouble v1 = f1[i][j] - iso; + gdouble v2 = f1[i+1][j] - iso; + if ((v1 >= 0. && v2 < 0.) || (v1 < 0. && v2 >= 0.)) { + vertices[1][i][j].v = + gts_vertex_new (klass, x + g.dx*v1/(v1 - v2), y, g.z); + vertices[1][i][j].orientation = v2 >= 0. ? RIGHT : LEFT; + } + else + vertices[1][i][j].v = NULL; + } + for (i = 0, x = g.x; i < g.nx; i++, x += g.dx) + for (j = 0, y = g.y; j < g.ny - 1; j++, y += g.dy) { + gdouble v1 = f1[i][j] - iso; + gdouble v2 = f1[i][j+1] - iso; + if ((v1 >= 0. && v2 < 0.) || (v1 < 0. && v2 >= 0.)) { + vertices[2][i][j].v = + gts_vertex_new (klass, x, y + g.dy*v1/(v1 - v2), g.z); + vertices[2][i][j].orientation = v2 >= 0. ? RIGHT : LEFT; + } + else + vertices[2][i][j].v = NULL; + } +} + +/** + * gts_iso_slice_destroy: + * @slice: a #GtsIsoSlice. + * + * Free all memory allocated for @slice. + */ +void gts_iso_slice_destroy (GtsIsoSlice * slice) +{ + g_return_if_fail (slice != NULL); + + free2D ((void **) slice->vertices[0], slice->nx); + free2D ((void **) slice->vertices[1], slice->nx - 1); + free2D ((void **) slice->vertices[2], slice->nx); + g_free (slice->vertices); + g_free (slice); +} + +/** + * gts_isosurface_slice: + * @slice1: a #GtsIsoSlice. + * @slice2: another #GtsIsoSlice. + * @surface: a #GtsSurface. + * + * Given two successive slices @slice1 and @slice2 link their vertices with + * segments and triangles which are added to @surface. + */ +void gts_isosurface_slice (GtsIsoSlice * slice1, + GtsIsoSlice * slice2, + GtsSurface * surface) +{ + guint j, k, l, nx, ny; + OrientedVertex *** vertices[2]; + GtsVertex * va[12]; + + g_return_if_fail (slice1 != NULL); + g_return_if_fail (slice2 != NULL); + g_return_if_fail (surface != NULL); + g_return_if_fail (slice1->nx == slice2->nx && slice1->ny == slice2->ny); + + vertices[0] = slice1->vertices; + vertices[1] = slice2->vertices; + nx = slice1->nx; + ny = slice1->ny; + + /* link vertices with segments and triangles */ + for (j = 0; j < nx - 1; j++) + for (k = 0; k < ny - 1; k++) { + gboolean cube_is_cut = FALSE; + for (l = 0; l < 12; l++) { + guint nv = 0, e = l; + OrientedVertex ov = + vertices[c[e][1]][c[e][0]][j + c[e][2]][k + c[e][3]]; + while (ov.v && !GTS_OBJECT (ov.v)->reserved) { + guint m = 0, * ne = edge[e][ov.orientation]; + va[nv++] = ov.v; + GTS_OBJECT (ov.v)->reserved = surface; + ov.v = NULL; + while (m < 3 && !ov.v) { + e = ne[m++]; + ov = vertices[c[e][1]][c[e][0]][j + c[e][2]][k + c[e][3]]; + } + } + /* create edges and faces */ + if (nv > 2) { + GtsEdge * e1, * e2, * e3; + guint m; + if (!(e1 = GTS_EDGE (gts_vertices_are_connected (va[0], va[1])))) + e1 = gts_edge_new (surface->edge_class, va[0], va[1]); + for (m = 1; m < nv - 1; m++) { + if (!(e2 = GTS_EDGE (gts_vertices_are_connected (va[m], va[m+1])))) + e2 = gts_edge_new (surface->edge_class, va[m], va[m+1]); + if (!(e3 = GTS_EDGE (gts_vertices_are_connected (va[m+1], va[0])))) + e3 = gts_edge_new (surface->edge_class, va[m+1], va[0]); + gts_surface_add_face (surface, + gts_face_new (surface->face_class, + e1, e2, e3)); + e1 = e3; + } + } + if (nv > 0) + cube_is_cut = TRUE; + } + if (cube_is_cut) + for (l = 0; l < 12; l++) { + GtsVertex * v = + vertices[c[l][1]][c[l][0]][j + c[l][2]][k + c[l][3]].v; + if (v) + GTS_OBJECT (v)->reserved = NULL; + } + } +} + +#define SWAP(s1, s2, tmp) (tmp = s1, s1 = s2, s2 = tmp) + +/** + * gts_isosurface_cartesian: + * @surface: a #GtsSurface. + * @g: a #GtsCartesianGrid. + * @f: a #GtsIsoCartesianFunc. + * @data: user data to be passed to @f. + * @iso: isosurface value. + * + * Adds to @surface new faces defining the isosurface f(x,y,z) = @iso. By + * convention, the normals to the surface are pointing toward the positive + * values of f(x,y,z) - @iso. + * + * The user function @f is called successively for each value of the z + * coordinate defined by @g. It must fill the corresponding (x,y) plane with + * the values of the function for which the isosurface is to be computed. + */ +void gts_isosurface_cartesian (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso) +{ + void * tmp; + gdouble ** f1, ** f2; + GtsIsoSlice * slice1, * slice2; + guint i; + + g_return_if_fail (surface != NULL); + g_return_if_fail (f != NULL); + g_return_if_fail (g.nx > 1); + g_return_if_fail (g.ny > 1); + g_return_if_fail (g.nz > 1); + + slice1 = gts_iso_slice_new (g.nx, g.ny); + slice2 = gts_iso_slice_new (g.nx, g.ny); + f1 = (gdouble **) malloc2D (g.nx, g.ny, sizeof (gdouble)); + f2 = (gdouble **) malloc2D (g.nx, g.ny, sizeof (gdouble)); + + (*f) (f1, g, 0, data); + g.z += g.dz; + (*f) (f2, g, 1, data); + g.z -= g.dz; + gts_iso_slice_fill_cartesian (slice1, g, f1, f2, iso, + surface->vertex_class); + g.z += g.dz; + for (i = 2; i < g.nz; i++) { + g.z += g.dz; + (*f) (f1, g, i, data); + SWAP (f1, f2, tmp); + g.z -= g.dz; + gts_iso_slice_fill_cartesian (slice2, g, f1, f2, iso, + surface->vertex_class); + g.z += g.dz; + gts_isosurface_slice (slice1, slice2, surface); + SWAP (slice1, slice2, tmp); + } + gts_iso_slice_fill_cartesian (slice2, g, f2, NULL, iso, + surface->vertex_class); + gts_isosurface_slice (slice1, slice2, surface); + + gts_iso_slice_destroy (slice1); + gts_iso_slice_destroy (slice2); + free2D ((void **) f1, g.nx); + free2D ((void **) f2, g.nx); +} Index: tags/1.0.5/gts/isotetra.c =================================================================== --- tags/1.0.5/gts/isotetra.c (nonexistent) +++ tags/1.0.5/gts/isotetra.c (revision 953) @@ -0,0 +1,840 @@ +/* GTS-Library conform marching tetrahedra algorithm + * Copyright (C) 2002 Gert Wollny + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#ifdef NATIVE_WIN32 +# include +# define M_SQRT2 1.41421356237309504880 +#endif /* NATIVE_WIN32 */ + +typedef struct { + gint nx, ny; + gdouble ** data; +} slice_t; + +typedef struct { + gint x, y, z; + gboolean mid; + gdouble d; +} tetra_vertex_t; + +/* this helper is a lookup table for vertices */ +typedef struct { + gint nx, ny; + GtsVertex ** vtop, ** vmid, **vbot; +} helper_t ; + +typedef struct { + GHashTable * vbot, * vtop; +} helper_bcl ; + + +static helper_t * init_helper (int nx, int ny) +{ + gint nxy = 4*nx*ny; + helper_t *retval = g_malloc0 (sizeof (helper_t)); + + retval->nx = nx; + retval->ny = ny; + retval->vtop = g_malloc0 (sizeof (GtsVertex *)*nxy); + retval->vmid = g_malloc0 (sizeof (GtsVertex *)*nxy); + retval->vbot = g_malloc0 (sizeof (GtsVertex *)*nxy); + return retval; +} + +static helper_bcl * init_helper_bcl (void) +{ + helper_bcl *retval = g_malloc0 (sizeof (helper_bcl)); + + retval->vtop = g_hash_table_new (g_str_hash, g_str_equal); + retval->vbot = g_hash_table_new (g_str_hash, g_str_equal); + return retval; +} + +static void free_helper (helper_t * h) +{ + g_free (h->vtop); + g_free (h->vmid); + g_free (h->vbot); + g_free (h); +} + +static void free_helper_bcl (helper_bcl * h) +{ + g_hash_table_destroy (h->vtop); + g_hash_table_destroy (h->vbot); + g_free (h); +} + +/* move the vertices in the bottom slice to the top, and clear the + other slices in the lookup tables */ +static void helper_advance (helper_t * h) +{ + GtsVertex ** help = h->vbot; + h->vbot = h->vtop; + h->vtop = help; + + memset (h->vmid, 0, 4*sizeof(GtsVertex *) * h->nx * h->ny); + memset (h->vbot, 0, 4*sizeof(GtsVertex *) * h->nx * h->ny); +} + +static void helper_advance_bcl (helper_bcl * h) +{ + GHashTable * help = g_hash_table_new (g_str_hash, g_str_equal); + + g_hash_table_destroy (h->vbot); + h->vbot = h->vtop; + h->vtop = help; +} + +/* find the zero-crossing of line through v1 and v2 and return the + corresponding GtsVertex */ +static GtsVertex * get_vertex (gint mz, + const tetra_vertex_t * v1, + const tetra_vertex_t * v2, + helper_t * help, + GtsCartesianGrid * g, + GtsVertexClass * klass) +{ + GtsVertex ** vertex; + gint x, y, index, idx2, z; + gdouble dx, dy, dz, d; + + g_assert (v1->d - v2->d != 0.); + + dx = dy = dz = 0.0; + d = v1->d/(v1->d - v2->d); + + index = 0; + + if (v1->x != v2->x) { + index |= 1; + dx = d; + } + + if (v1->y != v2->y) { + index |= 2; + dy = d; + } + + if (v1->z != v2->z) { + dz = d; + } + + x = v1->x; + if (v1->x > v2->x) { x = v2->x; dx = 1.0 - dx; } + + y = v1->y; + if (v1->y > v2->y) { y = v2->y; dy = 1.0 - dy;} + + z = v1->z; + if (v1->z > v2->z) { z = v2->z; dz = 1.0 - dz;} + + idx2 = 4 * ( x + y * help->nx ) + index; + + if (v1->z == v2->z) + vertex = (mz == z) ? &help->vtop[idx2] : &help->vbot[idx2]; + else + vertex = &help->vmid[idx2]; + + if (mz != z && dz != 0.0) { + fprintf(stderr, "%f \n", dz); + } + + /* if vertex is not yet created, do it now */ + if (!*vertex) + *vertex = gts_vertex_new (klass, + g->dx * ( x + dx) + g->x, + g->dy * ( y + dy) + g->y, + g->dz * ( z + dz) + g->z); + + return *vertex; +} + +static GtsVertex * get_vertex_bcl (gint mz, + const tetra_vertex_t * v1, + const tetra_vertex_t * v2, + helper_bcl * help, + GtsCartesianGrid * g, + GtsVertexClass * klass) +{ + GtsVertex * v; + GHashTable * table; + gchar * s1, * s2, * hash; + gdouble x1, x2, y1, y2, z1, z2, d; + + g_assert (v1->d - v2->d != 0.); + + /* first find correct hash table */ + if ((v1->z > mz) && (v2->z > mz)) + table = help->vtop; + else + table = help->vbot; + + d = v1->d / (v1->d - v2->d); + + /* sort vertices */ + s1 = g_strdup_printf ("%d %d %d %d", v1->x, v1->y, v1->z, v1->mid); + s2 = g_strdup_printf ("%d %d %d %d", v2->x, v2->y, v2->z, v2->mid); + + hash = (d == 0.0) ? g_strdup (s1) : + (d == 1.0) ? g_strdup (s2) : + (strcmp (s1, s2) < 0) ? g_strjoin (" ", s1, s2, NULL) : + g_strjoin (" ", s2, s1, NULL); + + /* return existing vertex or make a new one */ + v = g_hash_table_lookup (table, hash); + if (!v){ + + x1 = g->dx * (v1->x + (v1->mid / 2.0)) + g->x; + x2 = g->dx * (v2->x + (v2->mid / 2.0)) + g->x; + y1 = g->dy * (v1->y + (v1->mid / 2.0)) + g->y; + y2 = g->dy * (v2->y + (v2->mid / 2.0)) + g->y; + z1 = g->dz * (v1->z + (v1->mid / 2.0)) + g->z; + z2 = g->dz * (v2->z + (v2->mid / 2.0)) + g->z; + + v = gts_vertex_new (klass, x1 * (1.0 - d) + d * x2, + y1 * (1.0 - d) + d * y2, + z1 * (1.0 - d) + d * z2); + + g_hash_table_insert (table, g_strdup(hash), v); + } + g_free (s1); + g_free (s2); + g_free (hash); + + return v; +} + +/* create an edge connecting the zero crossings of lines through a + pair of vertices, or return an existing one */ +static GtsEdge * get_edge (GtsVertex * v1, GtsVertex * v2, + GtsEdgeClass * klass) +{ + GtsSegment *s; + GtsEdge *edge; + + g_assert (v1); + g_assert (v2); + + s = gts_vertices_are_connected (v1, v2); + + if (GTS_IS_EDGE (s)) + edge = GTS_EDGE(s); + else + edge = gts_edge_new (klass, v1, v2); + return edge; +} + +static void add_face (GtsSurface * surface, + const tetra_vertex_t * a1, const tetra_vertex_t * a2, + const tetra_vertex_t * b1, const tetra_vertex_t * b2, + const tetra_vertex_t * c1, const tetra_vertex_t * c2, + gint rev, helper_t * help, + gint z, GtsCartesianGrid * g) +{ + GtsFace * t; + GtsEdge * e1, * e2, * e3; + GtsVertex * v1 = get_vertex (z, a1, a2, help, g, surface->vertex_class); + GtsVertex * v2 = get_vertex (z, b1, b2, help, g, surface->vertex_class); + GtsVertex * v3 = get_vertex (z, c1, c2, help, g, surface->vertex_class); + + g_assert (v1 != v2); + g_assert (v2 != v3); + g_assert (v1 != v3); + + if (!rev) { + e1 = get_edge (v1, v2, surface->edge_class); + e2 = get_edge (v2, v3, surface->edge_class); + e3 = get_edge (v1, v3, surface->edge_class); + } else { + e1 = get_edge (v1, v3, surface->edge_class); + e2 = get_edge (v2, v3, surface->edge_class); + e3 = get_edge (v1, v2, surface->edge_class); + } + + t = gts_face_new (surface->face_class, e1, e2, e3); + gts_surface_add_face (surface, t); +} + +static void add_face_bcl (GtsSurface * surface, + const tetra_vertex_t * a1, + const tetra_vertex_t * a2, + const tetra_vertex_t * b1, + const tetra_vertex_t * b2, + const tetra_vertex_t * c1, + const tetra_vertex_t * c2, + gint rev, helper_bcl * help, + gint z, GtsCartesianGrid * g) +{ + GtsFace * t; + GtsEdge * e1, * e2, * e3; + GtsVertex * v1 = get_vertex_bcl (z, a1, a2, help, g, surface->vertex_class); + GtsVertex * v2 = get_vertex_bcl (z, b1, b2, help, g, surface->vertex_class); + GtsVertex * v3 = get_vertex_bcl (z, c1, c2, help, g, surface->vertex_class); + + if (v1 == v2 || v2 == v3 || v1 == v3) + return; + + if (!rev) { + e1 = get_edge (v1, v2, surface->edge_class); + e2 = get_edge (v2, v3, surface->edge_class); + e3 = get_edge (v1, v3, surface->edge_class); + } else { + e1 = get_edge (v1, v3, surface->edge_class); + e2 = get_edge (v2, v3, surface->edge_class); + e3 = get_edge (v1, v2, surface->edge_class); + } + + t = gts_face_new (surface->face_class, e1, e2, e3); + gts_surface_add_face (surface, t); +} + +/* create a new slice of site nx \times ny */ +static slice_t * new_slice (gint nx, gint ny) +{ + gint x; + slice_t * retval = g_malloc (sizeof (slice_t)); + + retval->data = g_malloc (nx*sizeof(gdouble *)); + retval->nx = nx; + retval->ny = ny; + for (x = 0; x < nx; x++) + retval->data[x] = g_malloc (ny*sizeof (gdouble)); + return retval; +} + +/* initialize a slice with inival */ +static void slice_init (slice_t * slice, gdouble inival) +{ + gint x, y; + + g_assert (slice); + + for (x = 0; x < slice->nx; x++) + for (y = 0; y < slice->ny; y++) + slice->data[x][y] = inival; +} + +/* free the memory of a slice */ +static void free_slice (slice_t * slice) +{ + gint x; + + g_return_if_fail (slice != NULL); + + for (x = 0; x < slice->nx; x++) + g_free (slice->data[x]); + g_free (slice->data); + g_free (slice); +} + +static void analyze_tetrahedra (const tetra_vertex_t * a, + const tetra_vertex_t * b, + const tetra_vertex_t * c, + const tetra_vertex_t * d, + gint parity, GtsSurface * surface, + helper_t * help, + gint z, GtsCartesianGrid * g) +{ + gint rev = parity; + gint code = 0; + + if (a->d >= 0.) code |= 1; + if (b->d >= 0.) code |= 2; + if (c->d >= 0.) code |= 4; + if (d->d >= 0.) code |= 8; + + switch (code) { + case 15: + case 0: return; /* all inside or outside */ + + case 14:rev = !parity; + case 1:add_face (surface, a, b, a, d, a, c, rev, help, z, g); + break; + case 13:rev = ! parity; + case 2:add_face (surface, a, b, b, c, b, d, rev, help, z, g); + break; + case 12:rev = !parity; + case 3:add_face (surface, a, d, a, c, b, c, rev, help, z, g); + add_face (surface, a, d, b, c, b, d, rev, help, z, g); + break; + case 11:rev = !parity; + case 4:add_face (surface, a, c, c, d, b, c, rev, help, z, g); + break; + case 10:rev = !parity; + case 5: add_face (surface, a, b, a, d, c, d, rev, help, z, g); + add_face (surface, a, b, c, d, b, c, rev, help, z, g); + break; + case 9:rev = !parity; + case 6:add_face (surface, a, b, a, c, c, d, rev, help, z, g); + add_face (surface, a, b, c, d, b, d, rev, help, z, g); + break; + case 7:rev = !parity; + case 8:add_face (surface, a, d, b, d, c, d, rev, help, z, g); + break; + } +} + +static void analyze_tetrahedra_bcl (const tetra_vertex_t * a, + const tetra_vertex_t * b, + const tetra_vertex_t * c, + const tetra_vertex_t * d, + GtsSurface * surface, + helper_bcl * help, + gint z, GtsCartesianGrid * g) +{ + gint rev = 0; + gint code = 0; + + if (a->d >= 0.) code |= 1; + if (b->d >= 0.) code |= 2; + if (c->d >= 0.) code |= 4; + if (d->d >= 0.) code |= 8; + + switch (code) { + case 15: + case 0: return; /* all inside or outside */ + + case 14:rev = !rev; + case 1:add_face_bcl (surface, a, b, a, d, a, c, rev, help, z, g); + break; + case 13:rev = !rev; + case 2:add_face_bcl (surface, a, b, b, c, b, d, rev, help, z, g); + break; + case 12:rev = !rev; + case 3:add_face_bcl (surface, a, d, a, c, b, c, rev, help, z, g); + add_face_bcl (surface, a, d, b, c, b, d, rev, help, z, g); + break; + case 11:rev = !rev; + case 4:add_face_bcl (surface, a, c, c, d, b, c, rev, help, z, g); + break; + case 10:rev = !rev; + case 5: add_face_bcl (surface, a, b, a, d, c, d, rev, help, z, g); + add_face_bcl (surface, a, b, c, d, b, c, rev, help, z, g); + break; + case 9:rev = !rev; + case 6:add_face_bcl (surface, a, b, a, c, c, d, rev, help, z, g); + add_face_bcl (surface, a, b, c, d, b, d, rev, help, z, g); + break; + case 7:rev = !rev; + case 8:add_face_bcl (surface, a, d, b, d, c, d, rev, help, z, g); + break; + } +} + +static void iso_slice_evaluate (slice_t * s1, slice_t * s2, + GtsCartesianGrid g, + gint z, GtsSurface * surface, helper_t * help) +{ + gint x,y; + tetra_vertex_t v0, v1, v2, v3, v4, v5, v6, v7; + gdouble ** s1p = s1->data; + gdouble ** s2p = s2->data; + + for (y = 0; y < g.ny-1; y++) + for (x = 0; x < g.nx-1; x++) { + gint parity = (((x ^ y) ^ z) & 1); + + v0.x = x ; v0.y = y ; v0.z = z ; v0.mid = FALSE; v0.d = s1p[x ][y ]; + v1.x = x ; v1.y = y+1; v1.z = z ; v1.mid = FALSE; v1.d = s1p[x ][y+1]; + v2.x = x+1; v2.y = y ; v2.z = z ; v2.mid = FALSE; v2.d = s1p[x+1][y ]; + v3.x = x+1; v3.y = y+1; v3.z = z ; v3.mid = FALSE; v3.d = s1p[x+1][y+1]; + v4.x = x ; v4.y = y ; v4.z = z+1; v4.mid = FALSE; v4.d = s2p[x ][y ]; + v5.x = x ; v5.y = y+1; v5.z = z+1; v5.mid = FALSE; v5.d = s2p[x ][y+1]; + v6.x = x+1; v6.y = y ; v6.z = z+1; v6.mid = FALSE; v6.d = s2p[x+1][y ]; + v7.x = x+1; v7.y = y+1; v7.z = z+1; v7.mid = FALSE; v7.d = s2p[x+1][y+1]; + + if (parity == 0) { + analyze_tetrahedra (&v0, &v1, &v2, &v4, parity, surface, help, z, &g); + analyze_tetrahedra (&v7, &v1, &v4, &v2, parity, surface, help, z, &g); + analyze_tetrahedra (&v1, &v7, &v3, &v2, parity, surface, help, z, &g); + analyze_tetrahedra (&v1, &v7, &v4, &v5, parity, surface, help, z, &g); + analyze_tetrahedra (&v2, &v6, &v4, &v7, parity, surface, help, z, &g); + }else{ + analyze_tetrahedra (&v4, &v5, &v6, &v0, parity, surface, help, z, &g); + analyze_tetrahedra (&v3, &v5, &v0, &v6, parity, surface, help, z, &g); + analyze_tetrahedra (&v5, &v3, &v7, &v6, parity, surface, help, z, &g); + analyze_tetrahedra (&v5, &v3, &v0, &v1, parity, surface, help, z, &g); + analyze_tetrahedra (&v6, &v2, &v0, &v3, parity, surface, help, z, &g); + } + } +} + +static void iso_slice_evaluate_bcl (slice_t * s1, slice_t * s2, slice_t * s3, + GtsCartesianGrid g, + gint z, GtsSurface * surface, + helper_bcl * help) +{ + gint x,y; + tetra_vertex_t v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, w0; + gdouble ** s1p = s1->data; + gdouble ** s2p = s2->data; + gdouble ** s3p = s3->data; + + for (y = 0; y < g.ny-2; y++) + for (x = 0; x < g.nx-2; x++) { + v0.x = x ; v0.y = y ; v0.z = z ; v0.mid = TRUE; + v0.d = (s1p[x ][y ] + s2p[x ][y ] + + s1p[x ][y+1] + s2p[x ][y+1] + + s1p[x+1][y ] + s2p[x+1][y ] + + s1p[x+1][y+1] + s2p[x+1][y+1])/8.0; + + v1.x = x+1; v1.y = y ; v1.z = z ; v1.mid = TRUE; + v1.d = (s1p[x+1][y ] + s2p[x+1][y ] + + s1p[x+1][y+1] + s2p[x+1][y+1] + + s1p[x+2][y ] + s2p[x+2][y ] + + s1p[x+2][y+1] + s2p[x+2][y+1])/8.0; + + v2.x = x ; v2.y = y+1; v2.z = z ; v2.mid = TRUE; + v2.d = (s1p[x ][y+1] + s2p[x ][y+1] + + s1p[x ][y+2] + s2p[x ][y+2] + + s1p[x+1][y+1] + s2p[x+1][y+1] + + s1p[x+1][y+2] + s2p[x+1][y+2])/8.0; + + v3.x = x ; v3.y = y ; v3.z = z+1; v3.mid = TRUE; + v3.d = (s2p[x ][y ] + s3p[x ][y ] + + s2p[x ][y+1] + s3p[x ][y+1] + + s2p[x+1][y ] + s3p[x+1][y ] + + s2p[x+1][y+1] + s3p[x+1][y+1])/8.0; + + v4.x = x+1; v4.y = y ; v4.z = z ; v4.mid = FALSE; v4.d = s1p[x+1][y ]; + v5.x = x ; v5.y = y+1; v5.z = z ; v5.mid = FALSE; v5.d = s1p[x ][y+1]; + v6.x = x+1; v6.y = y+1; v6.z = z ; v6.mid = FALSE; v6.d = s1p[x+1][y+1]; + v7.x = x+1; v7.y = y ; v7.z = z+1; v7.mid = FALSE; v7.d = s2p[x+1][y ]; + v8.x = x ; v8.y = y+1; v8.z = z+1; v8.mid = FALSE; v8.d = s2p[x ][y+1]; + v9.x = x+1; v9.y = y+1; v9.z = z+1; v9.mid = FALSE; v9.d = s2p[x+1][y+1]; + w0.x = x ; w0.y = y ; w0.z = z+1; w0.mid = FALSE; w0.d = s2p[x ][y ]; + + analyze_tetrahedra_bcl (&v0, &v9, &v6, &v1, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v6, &v4, &v1, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v4, &v7, &v1, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v7, &v9, &v1, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v5, &v6, &v2, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v6, &v9, &v2, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v9, &v8, &v2, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v8, &v5, &v2, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v8, &v9, &v3, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v9, &v7, &v3, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &v7, &w0, &v3, surface, help, z, &g); + analyze_tetrahedra_bcl (&v0, &w0, &v8, &v3, surface, help, z, &g); + } +} + +/* copy src into dest by stripping off the iso value and leave out + the boundary (which should be G_MINDOUBLE) */ +static void copy_to_bounded (slice_t * dest, slice_t * src, + gdouble iso, gdouble fill) +{ + gint x,y; + gdouble * src_ptr; + gdouble * dest_ptr = dest->data[0]; + + g_assert(dest->ny == src->ny + 2); + g_assert(dest->nx == src->nx + 2); + + for (y = 0; y < dest->ny; ++y, ++dest_ptr) + *dest_ptr = fill; + + for (x = 1; x < src->nx - 1; ++x) { + dest_ptr = dest->data[x]; + src_ptr = src->data[x-1]; + *dest_ptr++ = fill; + for (y = 0; y < src->ny; ++y, ++dest_ptr, ++src_ptr) + *dest_ptr = *src_ptr - iso; + *dest_ptr++ = fill; + } + + dest_ptr = dest->data[y]; + + for (y = 0; y < dest->ny; ++y, ++dest_ptr) + *dest_ptr = fill; +} + +static void iso_sub (slice_t * s, gdouble iso) +{ + gint x,y; + + for (x = 0; x < s->nx; ++x) { + gdouble *ptr = s->data[x]; + + for (y = 0; y < s->ny; ++y, ++ptr) + *ptr -= iso; + } +} + + +/** + * gts_isosurface_tetra_bounded: + * @surface: a #GtsSurface. + * @g: a #GtsCartesianGrid. + * @f: a #GtsIsoCartesianFunc. + * @data: user data to be passed to @f. + * @iso: isosurface value. + * + * Adds to @surface new faces defining the isosurface f(x,y,z) = + * @iso. By convention, the normals to the surface are pointing toward + * the positive values of f(x,y,z) - @iso. To ensure a closed object, + * a boundary of G_MINDOUBLE is added around the domain + * + * The user function @f is called successively for each value of the z + * coordinate defined by @g. It must fill the corresponding (x,y) + * plane with the values of the function for which the isosurface is + * to be computed. + */ +void gts_isosurface_tetra_bounded (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso) +{ + slice_t *slice1, *slice2, *transfer_slice; + GtsCartesianGrid g_intern = g; + helper_t *helper; + gint z; + + g_return_if_fail (surface != NULL); + g_return_if_fail (f != NULL); + g_return_if_fail (g.nx > 1); + g_return_if_fail (g.ny > 1); + g_return_if_fail (g.nz > 1); + + /* create the helper slices */ + slice1 = new_slice (g.nx + 2, g.ny + 2); + slice2 = new_slice (g.nx + 2, g.ny + 2); + + /* initialize the first slice as OUTSIDE */ + slice_init (slice1, -1.0); + + /* create a slice of the original image size */ + transfer_slice = new_slice (g.nx, g.ny); + + /* adapt the parameters to our enlarged image */ + g_intern.x -= g.dx; + g_intern.y -= g.dy; + g_intern.z -= g.dz; + g_intern.nx = g.nx + 2; + g_intern.ny = g.ny + 2; + g_intern.nz = g.nz; + + /* create the helper for vertex-lookup */ + helper = init_helper (g_intern.nx, g_intern.ny); + + /* go slicewise through the data */ + z = 0; + while (z < g.nz) { + slice_t * hs; + + /* request slice */ + f (transfer_slice->data, g, z, data); + g.z += g.dz; + + /* copy slice in enlarged image and mark the border as OUTSIDE */ + copy_to_bounded (slice2, transfer_slice, iso, -1.); + + /* triangulate */ + iso_slice_evaluate (slice1, slice2, g_intern, z, surface, helper); + + /* switch the input slices */ + hs = slice1; slice1 = slice2; slice2 = hs; + + /* switch the vertex lookup tables */ + helper_advance(helper); + ++z; + } + + /* initialize the last slice as OUTSIDE */ + slice_init (slice2, - 1.0); + + /* close the object */ + iso_slice_evaluate(slice1, slice2, g_intern, z, surface, helper); + + free_helper (helper); + free_slice (slice1); + free_slice (slice2); + free_slice (transfer_slice); +} + +/** + * gts_isosurface_tetra: + * @surface: a #GtsSurface. + * @g: a #GtsCartesianGrid. + * @f: a #GtsIsoCartesianFunc. + * @data: user data to be passed to @f. + * @iso: isosurface value. + * + * Adds to @surface new faces defining the isosurface f(x,y,z) = + * @iso. By convention, the normals to the surface are pointing toward + * the positive values of f(x,y,z) - @iso. + * + * The user function @f is called successively for each value of the z + * coordinate defined by @g. It must fill the corresponding (x,y) + * plane with the values of the function for which the isosurface is + * to be computed. + */ +void gts_isosurface_tetra (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso) +{ + slice_t *slice1, *slice2; + helper_t *helper; + gint z; + GtsCartesianGrid g_internal; + + g_return_if_fail (surface != NULL); + g_return_if_fail (f != NULL); + g_return_if_fail (g.nx > 1); + g_return_if_fail (g.ny > 1); + g_return_if_fail (g.nz > 1); + + memcpy (&g_internal, &g, sizeof (GtsCartesianGrid)); + + /* create the helper slices */ + slice1 = new_slice (g.nx, g.ny); + slice2 = new_slice (g.nx, g.ny); + + /* create the helper for vertex-lookup */ + helper = init_helper (g.nx, g.ny); + + z = 0; + f (slice1->data, g, z, data); + iso_sub (slice1, iso); + + z++; + g.z += g.dz; + + /* go slicewise through the data */ + while (z < g.nz) { + slice_t * hs; + + /* request slice */ + f (slice2->data, g, z, data); + iso_sub (slice2, iso); + + g.z += g.dz; + + /* triangulate */ + iso_slice_evaluate (slice1, slice2, g_internal, z-1, surface, helper); + + /* switch the input slices */ + hs = slice1; slice1 = slice2; slice2 = hs; + + /* switch the vertex lookup tables */ + helper_advance (helper); + + ++z; + } + + free_helper(helper); + free_slice(slice1); + free_slice(slice2); +} + +/** + * gts_isosurface_tetra_bcl: + * @surface: a #GtsSurface. + * @g: a #GtsCartesianGrid. + * @f: a #GtsIsoCartesianFunc. + * @data: user data to be passed to @f. + * @iso: isosurface value. + * + * Adds to @surface new faces defining the isosurface f(x,y,z) = + * @iso. By convention, the normals to the surface are pointing toward + * the positive values of f(x,y,z) - @iso. + * + * The user function @f is called successively for each value of the z + * coordinate defined by @g. It must fill the corresponding (x,y) + * plane with the values of the function for which the isosurface is + * to be computed. + * + * This version produces the dual "body-centered" faces relative to + * the faces produced by gts_isosurface_tetra(). + */ +void gts_isosurface_tetra_bcl (GtsSurface * surface, + GtsCartesianGrid g, + GtsIsoCartesianFunc f, + gpointer data, + gdouble iso) +{ + slice_t *slice1, *slice2, *slice3; + helper_bcl *helper; + gint z; + GtsCartesianGrid g_internal; + + g_return_if_fail (surface != NULL); + g_return_if_fail (f != NULL); + g_return_if_fail (g.nx > 1); + g_return_if_fail (g.ny > 1); + g_return_if_fail (g.nz > 1); + + memcpy (&g_internal, &g, sizeof (GtsCartesianGrid)); + + /* create the helper slices */ + slice1 = new_slice (g.nx, g.ny); + slice2 = new_slice (g.nx, g.ny); + slice3 = new_slice (g.nx, g.ny); + + /* create the helper for vertex-lookup */ + helper = init_helper_bcl (); + + z = 0; + f (slice1->data, g, z, data); + iso_sub (slice1, iso); + + z++; + g.z += g.dz; + + f (slice2->data, g, z, data); + iso_sub (slice1, iso); + + z++; + g.z += g.dz; + + /* go slicewise through the data */ + while (z < g.nz) { + slice_t * hs; + + /* request slice */ + f (slice3->data, g, z, data); + iso_sub (slice3, iso); + + g.z += g.dz; + + /* triangulate */ + iso_slice_evaluate_bcl (slice1, slice2, slice3, g_internal, z-2, + surface, helper); + + /* switch the input slices */ + hs = slice1; slice1 = slice2; slice2 = slice3; slice3 = hs; + + /* switch the vertex lookup tables */ + helper_advance_bcl (helper); + + ++z; + } + + free_helper_bcl(helper); + free_slice(slice1); + free_slice(slice2); + free_slice(slice3); +} Index: tags/1.0.5/gts/kdtree.c =================================================================== --- tags/1.0.5/gts/kdtree.c (nonexistent) +++ tags/1.0.5/gts/kdtree.c (revision 953) @@ -0,0 +1,152 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + + +static int compare_x (const void * p1, const void * p2) { + GtsPoint + * pp1 = *((gpointer *) p1), + * pp2 = *((gpointer *) p2); + if (pp1->x > pp2->x) + return 1; + return -1; +} + +static int compare_y (const void * p1, const void * p2) { + GtsPoint + * pp1 = *((gpointer *) p1), + * pp2 = *((gpointer *) p2); + if (pp1->y > pp2->y) + return 1; + return -1; +} + +static int compare_z (const void * p1, const void * p2) { + GtsPoint + * pp1 = *((gpointer *) p1), + * pp2 = *((gpointer *) p2); + if (pp1->z > pp2->z) + return 1; + return -1; +} + +/** + * gts_kdtree_new: + * @points: an array of #GtsPoint. + * @compare: always %NULL. + * + * Note that the order of the points in array @points is modified by this + * function. + * + * Returns: a new 3D tree for @points. + */ +GNode * gts_kdtree_new (GPtrArray * points, + int (*compare) (const void *, const void *)) +{ + guint middle; + GPtrArray array; + GNode * node; + GtsPoint * point; + + g_return_val_if_fail (points != NULL, NULL); + g_return_val_if_fail (points->len > 0, NULL); + + /* sort the points */ + if (compare == compare_x) compare = compare_y; + else if (compare == compare_y) compare = compare_z; + else compare = compare_x; + qsort (points->pdata, points->len, sizeof (gpointer), compare); + + middle = (points->len - 1)/2; + point = points->pdata[middle]; + node = g_node_new (point); + + if (points->len > 1) { + array.len = middle; + if (array.len > 0) { + array.pdata = points->pdata; + g_node_prepend (node, gts_kdtree_new (&array, compare)); + } + else + g_node_prepend (node, g_node_new (NULL)); + + array.len = points->len - middle - 1; + if (array.len > 0) { + array.pdata = &(points->pdata[middle + 1]); + g_node_prepend (node, gts_kdtree_new (&array, compare)); + } + else + g_node_prepend (node, g_node_new (NULL)); + } + + return node; +} + +/** + * gts_kdtree_range: + * @tree: a 3D tree. + * @bbox: a #GtsBBox. + * @compare: always %NULL. + * + * Returns: a list of #GtsPoint belonging to @tree which are inside @bbox. + */ +GSList * gts_kdtree_range (GNode * tree_3d, + GtsBBox * bbox, + int (*compare) (const void *, const void *)) +{ + GSList * list = NULL; + GtsPoint * p; + gdouble left, right, v; + GNode * node; + + g_return_val_if_fail (tree_3d != NULL, NULL); + g_return_val_if_fail (bbox != NULL, NULL); + + p = tree_3d->data; + if (p == NULL) + return NULL; + + if (gts_bbox_point_is_inside (bbox, p)) + list = g_slist_prepend (list, p); + + if (compare == compare_x) { + left = bbox->y1; right = bbox->y2; v = p->y; + compare = compare_y; + } + else if (compare == compare_y) { + left = bbox->z1; right = bbox->z2; v = p->z; + compare = compare_z; + } + else { + left = bbox->x1; right = bbox->x2; v = p->x; + compare = compare_x; + } + + if ((node = tree_3d->children)) { + if (right >= v) + list = g_slist_concat (list, gts_kdtree_range (node, bbox, compare)); + node = node->next; + if (left <= v) + list = g_slist_concat (list, gts_kdtree_range (node, bbox, compare)); + } + return list; +} + Index: tags/1.0.5/gts/matrix.c =================================================================== --- tags/1.0.5/gts/matrix.c (nonexistent) +++ tags/1.0.5/gts/matrix.c (revision 953) @@ -0,0 +1,725 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +/** + * gts_matrix_new: + * @a00: element [0][0]. + * @a01: element [0][1]. + * @a02: element [0][2]. + * @a03: element [0][3]. + * @a10: element [1][0]. + * @a11: element [1][1]. + * @a12: element [1][2]. + * @a13: element [1][3]. + * @a20: element [2][0]. + * @a21: element [2][1]. + * @a22: element [2][2]. + * @a23: element [2][3]. + * @a30: element [3][0]. + * @a31: element [3][1]. + * @a32: element [3][2]. + * @a33: element [3][3]. + * + * Allocates memory and initializes a new #GtsMatrix. + * + * Returns: a pointer to the newly created #GtsMatrix. + */ +GtsMatrix * gts_matrix_new (gdouble a00, gdouble a01, gdouble a02, gdouble a03, + gdouble a10, gdouble a11, gdouble a12, gdouble a13, + gdouble a20, gdouble a21, gdouble a22, gdouble a23, + gdouble a30, gdouble a31, gdouble a32, gdouble a33) +{ + GtsMatrix * m; + + m = g_malloc (4*sizeof (GtsVector4)); + + m[0][0] = a00; m[1][0] = a10; m[2][0] = a20; m[3][0] = a30; + m[0][1] = a01; m[1][1] = a11; m[2][1] = a21; m[3][1] = a31; + m[0][2] = a02; m[1][2] = a12; m[2][2] = a22; m[3][2] = a32; + m[0][3] = a03; m[1][3] = a13; m[2][3] = a23; m[3][3] = a33; + + return m; +} + +/** + * gts_matrix_assign: + * @m: a #GtsMatrix. + * @a00: element [0][0]. + * @a01: element [0][1]. + * @a02: element [0][2]. + * @a03: element [0][3]. + * @a10: element [1][0]. + * @a11: element [1][1]. + * @a12: element [1][2]. + * @a13: element [1][3]. + * @a20: element [2][0]. + * @a21: element [2][1]. + * @a22: element [2][2]. + * @a23: element [2][3]. + * @a30: element [3][0]. + * @a31: element [3][1]. + * @a32: element [3][2]. + * @a33: element [3][3]. + * + * Set values of matrix elements. + */ +void gts_matrix_assign (GtsMatrix * m, + gdouble a00, gdouble a01, gdouble a02, gdouble a03, + gdouble a10, gdouble a11, gdouble a12, gdouble a13, + gdouble a20, gdouble a21, gdouble a22, gdouble a23, + gdouble a30, gdouble a31, gdouble a32, gdouble a33) +{ + g_return_if_fail (m != NULL); + + m[0][0] = a00; m[1][0] = a10; m[2][0] = a20; m[3][0] = a30; + m[0][1] = a01; m[1][1] = a11; m[2][1] = a21; m[3][1] = a31; + m[0][2] = a02; m[1][2] = a12; m[2][2] = a22; m[3][2] = a32; + m[0][3] = a03; m[1][3] = a13; m[2][3] = a23; m[3][3] = a33; +} + +/** + * gts_matrix_projection: + * @t: a #GtsTriangle. + * + * Creates a new #GtsMatrix representing the projection onto a plane of normal + * given by @t. + * + * Returns: a pointer to the newly created #GtsMatrix. + */ +GtsMatrix * gts_matrix_projection (GtsTriangle * t) +{ + GtsVertex * v1, * v2, * v3; + GtsEdge * e1, * e2, * e3; + GtsMatrix * m; + gdouble x1, y1, z1, x2, y2, z2, x3, y3, z3, l; + + g_return_val_if_fail (t != NULL, NULL); + + m = g_malloc (4*sizeof (GtsVector4)); + gts_triangle_vertices_edges (t, NULL, &v1, &v2, &v3, &e1, &e2, &e3); + + x1 = GTS_POINT (v2)->x - GTS_POINT (v1)->x; + y1 = GTS_POINT (v2)->y - GTS_POINT (v1)->y; + z1 = GTS_POINT (v2)->z - GTS_POINT (v1)->z; + x2 = GTS_POINT (v3)->x - GTS_POINT (v1)->x; + y2 = GTS_POINT (v3)->y - GTS_POINT (v1)->y; + z2 = GTS_POINT (v3)->z - GTS_POINT (v1)->z; + x3 = y1*z2 - z1*y2; y3 = z1*x2 - x1*z2; z3 = x1*y2 - y1*x2; + x2 = y3*z1 - z3*y1; y2 = z3*x1 - x3*z1; z2 = x3*y1 - y3*x1; + + g_assert ((l = sqrt (x1*x1 + y1*y1 + z1*z1)) > 0.0); + m[0][0] = x1/l; m[1][0] = y1/l; m[2][0] = z1/l; m[3][0] = 0.; + g_assert ((l = sqrt (x2*x2 + y2*y2 + z2*z2)) > 0.0); + m[0][1] = x2/l; m[1][1] = y2/l; m[2][1] = z2/l; m[3][1] = 0.; + g_assert ((l = sqrt (x3*x3 + y3*y3 + z3*z3)) > 0.0); + m[0][2] = x3/l; m[1][2] = y3/l; m[2][2] = z3/l; m[3][2] = 0.; + m[0][3] = 0; m[1][3] = 0.; m[2][3] = 0.; m[3][3] = 1.; + + return m; +} + +/** + * gts_matrix_transpose: + * @m: a #GtsMatrix. + * + * Returns: a pointer to a newly created #GtsMatrix transposed of @m. + */ +GtsMatrix * gts_matrix_transpose (GtsMatrix * m) +{ + GtsMatrix * mi; + + g_return_val_if_fail (m != NULL, NULL); + + mi = g_malloc (4*sizeof (GtsVector4)); + + mi[0][0] = m[0][0]; mi[1][0] = m[0][1]; + mi[2][0] = m[0][2]; mi[3][0] = m[0][3]; + mi[0][1] = m[1][0]; mi[1][1] = m[1][1]; + mi[2][1] = m[1][2]; mi[3][1] = m[1][3]; + mi[0][2] = m[2][0]; mi[1][2] = m[2][1]; + mi[2][2] = m[2][2]; mi[3][2] = m[2][3]; + mi[0][3] = m[3][0]; mi[1][3] = m[3][1]; + mi[2][3] = m[3][2]; mi[3][3] = m[3][3]; + + return mi; +} + +/* + * calculate the determinant of a 2x2 matrix. + * + * Adapted from: + * Matrix Inversion + * by Richard Carling + * from "Graphics Gems", Academic Press, 1990 + */ +static gdouble det2x2 (gdouble a, gdouble b, gdouble c, gdouble d) +{ + gdouble ans2; + + ans2 = a*d - b*c; + return ans2; +} + +/* + * calculate the determinant of a 3x3 matrix + * in the form + * + * | a1, b1, c1 | + * | a2, b2, c2 | + * | a3, b3, c3 | + * + * Adapted from: + * Matrix Inversion + * by Richard Carling + * from "Graphics Gems", Academic Press, 1990 + */ +static gdouble det3x3 (gdouble a1, gdouble a2, gdouble a3, + gdouble b1, gdouble b2, gdouble b3, + gdouble c1, gdouble c2, gdouble c3) +{ + gdouble ans3; + + ans3 = a1 * det2x2( b2, b3, c2, c3 ) + - b1 * det2x2( a2, a3, c2, c3 ) + + c1 * det2x2( a2, a3, b2, b3 ); + return ans3; +} + +/** + * gts_matrix_determinant: + * @m: a #GtsMatrix. + * + * Returns: the value of det(@m). + */ +gdouble gts_matrix_determinant (GtsMatrix * m) +{ + gdouble ans4; + gdouble a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4; + + g_return_val_if_fail (m != NULL, 0.0); + + a1 = m[0][0]; b1 = m[0][1]; + c1 = m[0][2]; d1 = m[0][3]; + + a2 = m[1][0]; b2 = m[1][1]; + c2 = m[1][2]; d2 = m[1][3]; + + a3 = m[2][0]; b3 = m[2][1]; + c3 = m[2][2]; d3 = m[2][3]; + + a4 = m[3][0]; b4 = m[3][1]; + c4 = m[3][2]; d4 = m[3][3]; + + ans4 = a1 * det3x3 (b2, b3, b4, c2, c3, c4, d2, d3, d4) + - b1 * det3x3 (a2, a3, a4, c2, c3, c4, d2, d3, d4) + + c1 * det3x3 (a2, a3, a4, b2, b3, b4, d2, d3, d4) + - d1 * det3x3 (a2, a3, a4, b2, b3, b4, c2, c3, c4); + + return ans4; +} + +/* + * adjoint( original_matrix, inverse_matrix ) + * + * calculate the adjoint of a 4x4 matrix + * + * Let a denote the minor determinant of matrix A obtained by + * ij + * + * deleting the ith row and jth column from A. + * + * i+j + * Let b = (-1) a + * ij ji + * + * The matrix B = (b ) is the adjoint of A + * ij + */ +static GtsMatrix * adjoint (GtsMatrix * m) +{ + gdouble a1, a2, a3, a4, b1, b2, b3, b4; + gdouble c1, c2, c3, c4, d1, d2, d3, d4; + GtsMatrix * ma; + + a1 = m[0][0]; b1 = m[0][1]; + c1 = m[0][2]; d1 = m[0][3]; + + a2 = m[1][0]; b2 = m[1][1]; + c2 = m[1][2]; d2 = m[1][3]; + + a3 = m[2][0]; b3 = m[2][1]; + c3 = m[2][2]; d3 = m[2][3]; + + a4 = m[3][0]; b4 = m[3][1]; + c4 = m[3][2]; d4 = m[3][3]; + + ma = g_malloc (4*sizeof (GtsVector4)); + + /* row column labeling reversed since we transpose rows & columns */ + + ma[0][0] = det3x3 (b2, b3, b4, c2, c3, c4, d2, d3, d4); + ma[1][0] = - det3x3 (a2, a3, a4, c2, c3, c4, d2, d3, d4); + ma[2][0] = det3x3 (a2, a3, a4, b2, b3, b4, d2, d3, d4); + ma[3][0] = - det3x3 (a2, a3, a4, b2, b3, b4, c2, c3, c4); + + ma[0][1] = - det3x3 (b1, b3, b4, c1, c3, c4, d1, d3, d4); + ma[1][1] = det3x3 (a1, a3, a4, c1, c3, c4, d1, d3, d4); + ma[2][1] = - det3x3 (a1, a3, a4, b1, b3, b4, d1, d3, d4); + ma[3][1] = det3x3 (a1, a3, a4, b1, b3, b4, c1, c3, c4); + + ma[0][2] = det3x3 (b1, b2, b4, c1, c2, c4, d1, d2, d4); + ma[1][2] = - det3x3 (a1, a2, a4, c1, c2, c4, d1, d2, d4); + ma[2][2] = det3x3 (a1, a2, a4, b1, b2, b4, d1, d2, d4); + ma[3][2] = - det3x3 (a1, a2, a4, b1, b2, b4, c1, c2, c4); + + ma[0][3] = - det3x3 (b1, b2, b3, c1, c2, c3, d1, d2, d3); + ma[1][3] = det3x3 (a1, a2, a3, c1, c2, c3, d1, d2, d3); + ma[2][3] = - det3x3 (a1, a2, a3, b1, b2, b3, d1, d2, d3); + ma[3][3] = det3x3 (a1, a2, a3, b1, b2, b3, c1, c2, c3); + + return ma; +} + + +/** + * gts_matrix_inverse: + * @m: a #GtsMatrix. + * + * Returns: a pointer to a newly created #GtsMatrix inverse of @m or %NULL + * if @m is not invertible. + */ +GtsMatrix * gts_matrix_inverse (GtsMatrix * m) +{ + GtsMatrix * madj; + gdouble det; + gint i, j; + + g_return_val_if_fail (m != NULL, NULL); + + det = gts_matrix_determinant (m); + if (det == 0.) + return NULL; + + madj = adjoint (m); + for (i = 0; i < 4; i++) + for(j = 0; j < 4; j++) + madj[i][j] /= det; + + return madj; +} + +/** + * gts_matrix3_inverse: + * @m: a 3x3 #GtsMatrix. + * + * Returns: a pointer to a newly created 3x3 #GtsMatrix inverse of @m or %NULL + * if @m is not invertible. + */ +GtsMatrix * gts_matrix3_inverse (GtsMatrix * m) +{ + GtsMatrix * mi; + gdouble det; + + g_return_val_if_fail (m != NULL, NULL); + + det = (m[0][0]*(m[1][1]*m[2][2] - m[2][1]*m[1][2]) - + m[0][1]*(m[1][0]*m[2][2] - m[2][0]*m[1][2]) + + m[0][2]*(m[1][0]*m[2][1] - m[2][0]*m[1][1])); + if (det == 0.0) + return NULL; + + mi = g_malloc0 (4*sizeof (GtsVector)); + + mi[0][0] = (m[1][1]*m[2][2] - m[1][2]*m[2][1])/det; + mi[0][1] = (m[2][1]*m[0][2] - m[0][1]*m[2][2])/det; + mi[0][2] = (m[0][1]*m[1][2] - m[1][1]*m[0][2])/det; + mi[1][0] = (m[1][2]*m[2][0] - m[1][0]*m[2][2])/det; + mi[1][1] = (m[0][0]*m[2][2] - m[2][0]*m[0][2])/det; + mi[1][2] = (m[1][0]*m[0][2] - m[0][0]*m[1][2])/det; + mi[2][0] = (m[1][0]*m[2][1] - m[2][0]*m[1][1])/det; + mi[2][1] = (m[2][0]*m[0][1] - m[0][0]*m[2][1])/det; + mi[2][2] = (m[0][0]*m[1][1] - m[0][1]*m[1][0])/det; + + return mi; +} + +/** + * gts_matrix_print: + * @m: a #GtsMatrix. + * @fptr: a file descriptor. + * + * Print @m to file @fptr. + */ +void gts_matrix_print (GtsMatrix * m, FILE * fptr) +{ + g_return_if_fail (m != NULL); + g_return_if_fail (fptr != NULL); + + fprintf (fptr, + "[[%15.7g %15.7g %15.7g %15.7g]\n" + " [%15.7g %15.7g %15.7g %15.7g]\n" + " [%15.7g %15.7g %15.7g %15.7g]\n" + " [%15.7g %15.7g %15.7g %15.7g]]\n", + m[0][0], m[0][1], m[0][2], m[0][3], + m[1][0], m[1][1], m[1][2], m[1][3], + m[2][0], m[2][1], m[2][2], m[2][3], + m[3][0], m[3][1], m[3][2], m[3][3]); +} + +/** + * gts_vector_print: + * @v: a #GtsVector. + * @fptr: a file descriptor. + * + * Print @s to file @fptr. + */ +void gts_vector_print (GtsVector v, FILE * fptr) +{ + g_return_if_fail (fptr != NULL); + + fprintf (fptr, + "[%15.7g %15.7g %15.7g ]\n", + v[0], v[1], v[2]); +} + +/** + * gts_vector4_print: + * @v: a #GtsVector4. + * @fptr: a file descriptor. + * + * Print @v to file @fptr. + */ +void gts_vector4_print (GtsVector4 v, FILE * fptr) +{ + g_return_if_fail (fptr != NULL); + + fprintf (fptr, + "[%15.7g %15.7g %15.7g %15.7g]\n", + v[0], v[1], v[2], v[3]); +} + +/* [cos(alpha)]^2 */ +#define COSALPHA2 0.999695413509 /* alpha = 1 degree */ +/* [sin(alpha)]^2 */ +#define SINALPHA2 3.04586490453e-4 /* alpha = 1 degree */ + +/** + * gts_matrix_compatible_row: + * @A: a #GtsMatrix. + * @b: a #GtsVector. + * @n: the number of previous constraints of @A.x=@b. + * @A1: a #GtsMatrix. + * @b1: a #GtsVector. + * + * Given a system of @n constraints @A.x=@b adds to it the compatible + * constraints defined by @A1.x=@b1. The compatibility is determined + * by insuring that the resulting system is well-conditioned (see + * Lindstrom and Turk (1998, 1999)). + * + * Returns: the number of constraints of the resulting system. + */ +guint gts_matrix_compatible_row (GtsMatrix * A, + GtsVector b, + guint n, + GtsVector A1, + gdouble b1) +{ + gdouble na1; + + g_return_val_if_fail (A != NULL, 0); + + na1 = gts_vector_scalar (A1, A1); + if (na1 == 0.0) + return n; + + /* normalize row */ + na1 = sqrt (na1); + A1[0] /= na1; A1[1] /= na1; A1[2] /= na1; b1 /= na1; + + if (n == 1) { + gdouble a0a1 = gts_vector_scalar (A[0], A1); + if (a0a1*a0a1 >= COSALPHA2) + return 1; + } + else if (n == 2) { + GtsVector V; + gdouble s; + + gts_vector_cross (V, A[0], A[1]); + s = gts_vector_scalar (V, A1); + if (s*s <= gts_vector_scalar (V, V)*SINALPHA2) + return 2; + } + + A[n][0] = A1[0]; A[n][1] = A1[1]; A[n][2] = A1[2]; b[n] = b1; + return n + 1; +} + +/** + * gts_matrix_quadratic_optimization: + * @A: a #GtsMatrix. + * @b: a #GtsVector. + * @n: the number of constraints (must be smaller than 3). + * @H: a symmetric positive definite Hessian. + * @c: a #GtsVector. + * + * Solve a quadratic optimization problem: Given a quadratic objective function + * f which can be written as: f(x) = x^t.@H.x + @c^t.x + k, where @H is the + * symmetric positive definite Hessian of f and k is a constant, find the + * minimum of f subject to the set of @n prior linear constraints, defined by + * the first @n rows of @A and @b (@A.x = @b). The new constraints given by + * the minimization are added to @A and @b only if they are linearly + * independent as determined by gts_matrix_compatible_row(). + * + * Returns: the new number of constraints defined by @A and @b. + */ +guint gts_matrix_quadratic_optimization (GtsMatrix * A, + GtsVector b, + guint n, + GtsMatrix * H, + GtsVector c) +{ + g_return_val_if_fail (A != NULL, 0); + g_return_val_if_fail (b != NULL, 0); + g_return_val_if_fail (n < 3, 0); + g_return_val_if_fail (H != NULL, 0); + + switch (n) { + case 0: { + n = gts_matrix_compatible_row (A, b, n, H[0], - c[0]); + n = gts_matrix_compatible_row (A, b, n, H[1], - c[1]); + n = gts_matrix_compatible_row (A, b, n, H[2], - c[2]); + return n; + } + case 1: { + GtsVector Q0 = {0., 0., 0.}; + GtsVector Q1 = {0., 0., 0.}; + GtsVector A1; + gdouble max = A[0][0]*A[0][0]; + guint d = 0; + + /* build a vector orthogonal to the constraint */ + if (A[0][1]*A[0][1] > max) { max = A[0][1]*A[0][1]; d = 1; } + if (A[0][2]*A[0][2] > max) { max = A[0][2]*A[0][2]; d = 2; } + switch (d) { + case 0: Q0[0] = - A[0][2]/A[0][0]; Q0[2] = 1.0; break; + case 1: Q0[1] = - A[0][2]/A[0][1]; Q0[2] = 1.0; break; + case 2: Q0[2] = - A[0][0]/A[0][2]; Q0[0] = 1.0; break; + } + + /* build a second vector orthogonal to the first and to the constraint */ + gts_vector_cross (Q1, A[0], Q0); + + A1[0] = gts_vector_scalar (Q0, H[0]); + A1[1] = gts_vector_scalar (Q0, H[1]); + A1[2] = gts_vector_scalar (Q0, H[2]); + + n = gts_matrix_compatible_row (A, b, n, A1, - gts_vector_scalar (Q0, c)); + + A1[0] = gts_vector_scalar (Q1, H[0]); + A1[1] = gts_vector_scalar (Q1, H[1]); + A1[2] = gts_vector_scalar (Q1, H[2]); + + n = gts_matrix_compatible_row (A, b, n, A1, - gts_vector_scalar (Q1, c)); + + return n; + } + case 2: { + /* build a vector orthogonal to the two constraints */ + GtsVector A1, Q; + + gts_vector_cross (Q, A[0], A[1]); + A1[0] = gts_vector_scalar (Q, H[0]); + A1[1] = gts_vector_scalar (Q, H[1]); + A1[2] = gts_vector_scalar (Q, H[2]); + + n = gts_matrix_compatible_row (A, b, n, A1, - gts_vector_scalar (Q, c)); + + return n; + } + default: + g_assert_not_reached (); + } + return 0; +} + +/** + * gts_matrix_destroy: + * @m: a #GtsMatrix. + * + * Free all the memory allocated for @m. + */ +void gts_matrix_destroy (GtsMatrix * m) +{ + g_free (m); +} + +/** + * gts_matrix_product: + * @m1: a #GtsMatrix. + * @m2: another #GtsMatrix. + * + * Returns: a new #GtsMatrix, product of @m1 and @m2. + */ +GtsMatrix * gts_matrix_product (GtsMatrix * m1, GtsMatrix * m2) +{ + guint i, j; + GtsMatrix * m; + + g_return_val_if_fail (m1 != NULL, NULL); + g_return_val_if_fail (m2 != NULL, NULL); + g_return_val_if_fail (m1 != m2, NULL); + + m = g_malloc (4*sizeof (GtsVector4)); + + for (i = 0; i < 4; i++) + for (j = 0; j < 4; j++) + m[i][j] = m1[i][0]*m2[0][j] + m1[i][1]*m2[1][j] + + m1[i][2]*m2[2][j] + m1[i][3]*m2[3][j]; + return m; +} + +/** + * gts_matrix_zero: + * @m: a #GtsMatrix or $NULL. + * + * Initializes @m to zeros. Allocates a matrix if @m is %NULL. + * + * Returns: the zero'ed matrix. + */ +GtsMatrix * gts_matrix_zero (GtsMatrix * m) +{ + if (m == NULL) + m = g_malloc0 (4*sizeof (GtsVector4)); + else { + m[0][0] = m[1][0] = m[2][0] = m[3][0] = 0.; + m[0][1] = m[1][1] = m[2][1] = m[3][1] = 0.; + m[0][2] = m[1][2] = m[2][2] = m[3][2] = 0.; + m[0][3] = m[1][3] = m[2][3] = m[3][3] = 0.; + } + return m; +} + +/** + * gts_matrix_identity: + * @m: a #GtsMatrix or %NULL. + * + * Initializes @m to an identity matrix. Allocates a matrix if @m is %NULL. + * + * Returns: the identity matrix. + */ +GtsMatrix * gts_matrix_identity (GtsMatrix * m) +{ + m = gts_matrix_zero (m); + m[0][0] = m[1][1] = m[2][2] = m[3][3] = 1.; + return m; +} + +/** + * gts_matrix_scale: + * @m: a #GtsMatrix or %NULL. + * @s: the scaling vector. + * + * Initializes @m to a scaling matrix for @s. Allocates a matrix if @m + * is %NULL. + * + * Returns: the scaling matrix. + */ +GtsMatrix * gts_matrix_scale (GtsMatrix * m, GtsVector s) +{ + m = gts_matrix_zero (m); + m[0][0] = s[0]; + m[1][1] = s[1]; + m[2][2] = s[2]; + m[3][3] = 1.; + return m; +} + +/** + * gts_matrix_translate: + * @m: a #GtsMatrix or %NULL. + * @t: the translation vector. + * + * Initializes @m to a translation matrix for @t. Allocates a new + * matrix if @m is %NULL. + * + * Returns: the translation matix. + */ +GtsMatrix * gts_matrix_translate (GtsMatrix * m, GtsVector t) +{ + m = gts_matrix_zero (m); + m[0][3] = t[0]; + m[1][3] = t[1]; + m[2][3] = t[2]; + m[3][3] = 1.; + m[0][0] = m[1][1] = m[2][2] = 1.; + return m; +} + +/** + * gts_matrix_rotate: + * @m: a #GtsMatrix or %NULL. + * @r: the rotation axis. + * @angle: the angle (in radians) to rotate by. + * + * Initializes @m to a rotation matrix around @r by @angle. + * Allocates a new matrix if @m is %NULL. + * + * Returns: the rotation matrix. + */ +GtsMatrix * gts_matrix_rotate (GtsMatrix * m, + GtsVector r, + gdouble angle) +{ + gdouble c, c1, s; + + gts_vector_normalize (r); + + c = cos (angle); + c1 = 1. - c; + s = sin (angle); + + if (m == NULL) + m = g_malloc (4*sizeof (GtsVector4)); + + m[0][0] = r[0]*r[0]*c1 + c; + m[0][1] = r[0]*r[1]*c1 - r[2]*s; + m[0][2] = r[0]*r[2]*c1 + r[1]*s; + m[0][3] = 0.; + + m[1][0] = r[1]*r[0]*c1 + r[2]*s; + m[1][1] = r[1]*r[1]*c1 + c; + m[1][2] = r[1]*r[2]*c1 - r[0]*s; + m[1][3] = 0.; + + m[2][0] = r[2]*r[0]*c1 - r[1]*s; + m[2][1] = r[2]*r[1]*c1 + r[0]*s; + m[2][2] = r[2]*r[2]*c1 + c; + m[2][3] = 0.; + + m[3][0] = 0.; + m[3][1] = 0.; + m[3][2] = 0.; + m[3][3] = 1.; + + return m; +} Index: tags/1.0.5/gts/misc.c =================================================================== --- tags/1.0.5/gts/misc.c (nonexistent) +++ tags/1.0.5/gts/misc.c (revision 953) @@ -0,0 +1,692 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +#include "gts.h" +#include "gts-private.h" +#include "config.h" + +const guint gts_major_version = GTS_MAJOR_VERSION; +const guint gts_minor_version = GTS_MINOR_VERSION; +const guint gts_micro_version = GTS_MICRO_VERSION; +const guint gts_interface_age = 1; +const guint gts_binary_age = 1; + +static gboolean char_in_string (char c, const char * s) +{ + while (*s != '\0') + if (*(s++) == c) + return TRUE; + return FALSE; +} + +static GtsFile * file_new (void) +{ + GtsFile * f; + + f = g_malloc (sizeof (GtsFile)); + f->fp = NULL; + f->s = f->s1 = NULL; + f->curline = 1; + f->curpos = 1; + f->token = g_string_new (""); + f->type = '\0'; + f->error = NULL; + f->next_token = '\0'; + + f->scope = f->scope_max = 0; + f->delimiters = g_strdup (" \t"); + f->comments = g_strdup (GTS_COMMENTS); + f->tokens = g_strdup ("\n{}()="); + + return f; +} + +/** + * gts_file_new: + * @fp: a file pointer. + * + * Returns: a new #GtsFile. + */ +GtsFile * gts_file_new (FILE * fp) +{ + GtsFile * f; + + g_return_val_if_fail (fp != NULL, NULL); + + f = file_new (); + f->fp = fp; + gts_file_next_token (f); + + return f; +} + +/** + * gts_file_new_from_string: + * @s: a string. + * + * Returns: a new #GtsFile. + */ +GtsFile * gts_file_new_from_string (const gchar * s) +{ + GtsFile * f; + + g_return_val_if_fail (s != NULL, NULL); + + f = file_new (); + f->s1 = f->s = g_strdup (s); + gts_file_next_token (f); + + return f; +} + +/** + * gts_file_destroy: + * @f: a #GtsFile. + * + * Frees all the memory allocated for @f. + */ +void gts_file_destroy (GtsFile * f) +{ + g_return_if_fail (f != NULL); + + g_free (f->delimiters); + g_free (f->comments); + g_free (f->tokens); + if (f->error) + g_free (f->error); + if (f->s1) + g_free (f->s1); + g_string_free (f->token, TRUE); + g_free (f); +} + +/** + * gts_file_verror: + * @f: a @GtsFile. + * @format: the standard sprintf() format string. + * @args: the list of parameters to insert into the format string. + * + * Sets the @error field of @f using g_strdup_vprintf(). + * + * This function can be called only once and disables any other + * operation on @f (gts_file_close() excepted). + */ +void gts_file_verror (GtsFile * f, + const gchar * format, + va_list args) +{ + g_return_if_fail (f != NULL); + g_return_if_fail (format != NULL); + + g_assert (f->type != GTS_ERROR); + f->error = g_strdup_vprintf (format, args); + f->type = GTS_ERROR; +} + +/** + * gts_file_error: + * @f: a @GtsFile. + * @format: the standard sprintf() format string. + * @...: the parameters to insert into the format string. + * + * Sets the @error field of @f using gts_file_verror(). + * + * This function can be called only once and disables any other + * operation on @f (gts_file_close() excepted). + */ +void gts_file_error (GtsFile * f, + const gchar * format, + ...) +{ + va_list args; + + g_return_if_fail (f != NULL); + g_return_if_fail (format != NULL); + + va_start (args, format); + gts_file_verror (f, format, args); + va_end (args); +} + +static gint next_char (GtsFile * f) +{ + if (f->fp) + return fgetc (f->fp); + else if (*f->s == '\0') + return EOF; + return *(f->s++); +} + +/** + * gts_file_getc : + * @f: a #GtsFile. + * + * Returns: the next character in @f or EOF if the end of the file is + * reached or if an error occured. + */ +gint gts_file_getc (GtsFile * f) +{ + gint c; + + g_return_val_if_fail (f != NULL, EOF); + + if (f->type == GTS_ERROR) + return EOF; + + c = next_char (f); + f->curpos++; + while (char_in_string (c, f->comments)) { + while (c != EOF && c != '\n') + c = next_char (f); + if (c == '\n') { + f->curline++; + f->curpos = 1; + c = next_char (f); + } + } + switch (c) { + case '\n': + f->curline++; + f->curpos = 1; + break; + case '{': + f->scope++; + break; + case '}': + if (f->scope == 0) { + f->line = f->curline; + f->pos = f->curpos - 1; + gts_file_error (f, "no matching opening brace"); + c = EOF; + } + else + f->scope--; + } + return c; +} + +/** + * gts_file_read: + * @f: a #GtsFile. + * @ptr: a pointer. + * @size: size of an element. + * @nmemb: number of elements. + * + * Reads @nmemb elements of data, each @size bytes long, from @f, + * storing them at the location given by @ptr. + * + * Returns: the number of elements read. + */ +guint gts_file_read (GtsFile * f, gpointer ptr, guint size, guint nmemb) +{ + guint i, n; + gchar * p; + + g_return_val_if_fail (f != NULL, 0); + g_return_val_if_fail (ptr != NULL, 0); + g_return_val_if_fail (f->fp != NULL, 0); + + if (f->type == GTS_ERROR) + return 0; + + n = fread (ptr, size, nmemb, f->fp); + for (i = 0, p = ptr; i < n*size; i++, p++) { + f->curpos++; + if (*p == '\n') { + f->curline++; + f->curpos = 1; + } + } + return n; +} + +/** + * gts_file_getc_scope : + * @f: a #GtsFile. + * + * Returns: the next character in @f in the scope defined by + * @f->scope_max or EOF if the end of the file is reached or if an + * error occured. + */ +gint gts_file_getc_scope (GtsFile * f) +{ + gint c; + + g_return_val_if_fail (f != NULL, EOF); + + if (f->type == GTS_ERROR) + return EOF; + + if (f->scope <= f->scope_max) + c = gts_file_getc (f); + else { + c = gts_file_getc (f); + while (c != EOF && f->scope > f->scope_max) + c = gts_file_getc (f); + } + return c; +} + +/** + * gts_file_next_token: + * @f: a #GtsFile. + * + * Reads next token from @f and updates its @token and @delim fields. + */ +void gts_file_next_token (GtsFile * f) +{ + gint c; + gboolean in_string = FALSE; + + g_return_if_fail (f != NULL); + + if (f->type == GTS_ERROR) + return; + f->token->str[0] = '\0'; + f->token->len = 0; + if (f->next_token != '\0') { + if (char_in_string (f->next_token, f->tokens)) { + f->line = f->curline; + f->pos = f->curpos - 1; + g_string_append_c (f->token, f->next_token); + f->type = f->next_token; + f->next_token = '\0'; + return; + } + else { + c = f->next_token; + f->next_token = '\0'; + } + } + else + c = gts_file_getc_scope (f); + f->type = GTS_NONE; + while (c != EOF && (!in_string || !char_in_string (c, f->delimiters))) { + if (in_string) { + if (char_in_string (c, f->tokens)) { + f->next_token = c; + break; + } + g_string_append_c (f->token, c); + } + else if (!char_in_string (c, f->delimiters)) { + in_string = TRUE; + f->line = f->curline; + f->pos = f->curpos - 1; + g_string_append_c (f->token, c); + if (char_in_string (c, f->tokens)) { + f->type = c; + break; + } + } + c = gts_file_getc_scope (f); + } + if (f->type == GTS_NONE && f->token->len > 0) { + gchar * a; + + a = f->token->str; + while (*a != '\0' && char_in_string (*a, "+-")) a++; + if (*a == '\0') { + f->type = GTS_STRING; + return; + } + a = f->token->str; + while (*a != '\0' && char_in_string (*a, "+-0123456789")) a++; + if (*a == '\0') { + f->type = GTS_INT; + return; + } + a = f->token->str; + while (*a != '\0' && char_in_string (*a, "+-eE.")) a++; + if (*a == '\0') { + f->type = GTS_STRING; + return; + } + a = f->token->str; + while (*a != '\0' && char_in_string (*a, "+-0123456789eE.")) a++; + if (*a == '\0') { + f->type = GTS_FLOAT; + return; + } + a = f->token->str; + if (!strncmp (a, "0x", 2) || + !strncmp (a, "-0x", 3) || + !strncmp (a, "+0x", 3)) { + while (*a != '\0' && char_in_string (*a, "+-0123456789abcdefx")) a++; + if (*a == '\0') { + f->type = GTS_INT; + return; + } + a = f->token->str; + while (*a != '\0' && char_in_string (*a, "+-0123456789abcdefx.p")) a++; + if (*a == '\0') { + f->type = GTS_FLOAT; + return; + } + } + f->type = GTS_STRING; + } +} + +/** + * gts_file_first_token_after: + * @f: a #GtsFile. + * @type: a #GtsTokenType. + * + * Finds and sets the first token of a type different from @type + * occuring after a token of type @type. + */ +void gts_file_first_token_after (GtsFile * f, GtsTokenType type) +{ + g_return_if_fail (f != NULL); + + while (f->type != GTS_ERROR && + f->type != GTS_NONE && + f->type != type) + gts_file_next_token (f); + while (f->type == type) + gts_file_next_token (f); +} + +/** + * gts_file_assign_start: + * @f: a #GtsFile. + * @vars: a %GTS_NONE terminated array of #GtsFileVariable. + * + * Opens a block delimited by braces to read a list of optional + * arguments specified by @vars. + * + * If an error is encountered the @error field of @f is set. + */ +void gts_file_assign_start (GtsFile * f, GtsFileVariable * vars) +{ + GtsFileVariable * var; + + g_return_if_fail (f != NULL); + g_return_if_fail (vars != NULL); + + var = vars; + while (var->type != GTS_NONE) + (var++)->set = FALSE; + + if (f->type != '{') { + gts_file_error (f, "expecting an opening brace"); + return; + } + + f->scope_max++; + gts_file_next_token (f); +} + +/** + * gts_file_assign_next: + * @f: a #GtsFile. + * @vars: a %GTS_NONE terminated array of #GtsFileVariable. + * + * Assigns the next optional argument of @vars read from @f. + * + * Returns: the variable of @vars which has been assigned or %NULL if + * no variable has been assigned (if an error has been encountered the + * @error field of @f is set). + */ +GtsFileVariable * gts_file_assign_next (GtsFile * f, GtsFileVariable * vars) +{ + GtsFileVariable * var; + gboolean found = FALSE; + + g_return_val_if_fail (f != NULL, NULL); + g_return_val_if_fail (vars != NULL, NULL); + + while (f->type == '\n') + gts_file_next_token (f); + if (f->type == '}') { + f->scope_max--; + gts_file_next_token (f); + return NULL; + } + if (f->type == GTS_ERROR) + return NULL; + + var = vars; + while (f->type != GTS_ERROR && var->type != GTS_NONE && !found) { + if (!strcmp (var->name, f->token->str)) { + found = TRUE; + if (var->unique && var->set) + gts_file_error (f, "variable `%s' was already set at line %d:%d", + var->name, var->line, var->pos); + else { + var->line = f->line; + var->pos = f->pos; + gts_file_next_token (f); + if (f->type != '=') + gts_file_error (f, "expecting `='"); + else { + var->set = TRUE; + switch (var->type) { + case GTS_FILE: + break; + case GTS_INT: + gts_file_next_token (f); + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer"); + var->set = FALSE; + } + else if (var->data) + *((gint *) var->data) = atoi (f->token->str); + break; + case GTS_UINT: + gts_file_next_token (f); + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer"); + var->set = FALSE; + } + else if (var->data) + *((guint *) var->data) = atoi (f->token->str); + break; + case GTS_FLOAT: + gts_file_next_token (f); + if (f->type != GTS_INT && f->type != GTS_FLOAT) { + gts_file_error (f, "expecting a number"); + var->set = FALSE; + } + else if (var->data) + *((gfloat *) var->data) = atof (f->token->str); + break; + case GTS_DOUBLE: + gts_file_next_token (f); + if (f->type != GTS_INT && f->type != GTS_FLOAT) { + gts_file_error (f, "expecting a number"); + var->set = FALSE; + } + else if (var->data) + *((gdouble *) var->data) = atof (f->token->str); + break; + case GTS_STRING: + gts_file_next_token (f); + if (f->type != GTS_INT && + f->type != GTS_FLOAT && + f->type != GTS_STRING) { + gts_file_error (f, "expecting a string"); + var->set = FALSE; + } + else if (var->data) + *((gchar **) var->data) = g_strdup (f->token->str); + break; + default: + g_assert_not_reached (); + } + } + } + } + else + var++; + } + if (!found) + gts_file_error (f, "unknown identifier `%s'", f->token->str); + else if (f->type != GTS_ERROR) { + g_assert (var->set); + gts_file_next_token (f); + return var; + } + return NULL; +} + +/** + * gts_file_assign_variables: + * @f: a #GtsFile. + * @vars: an array of #GtsFileVariable. + * + * Assigns all the variables belonging to @vars found in @f. + * + * If an error is encountered the @error field of @f is set. + */ +void gts_file_assign_variables (GtsFile * f, GtsFileVariable * vars) +{ + g_return_if_fail (f != NULL); + g_return_if_fail (vars != NULL); + + gts_file_assign_start (f, vars); + while (gts_file_assign_next (f, vars)) + ; +} + +/** + * gts_file_variable_error: + * @f: a #GtsFile. + * @vars: an array of #GtsFileVariable. + * @name: the name of a variable in @vars. + * @format: the standard sprintf() format string. + * @...: the parameters to insert into the format string. + * + * Sets the @error field of @f using gts_file_verror(). + * + * String @name must match one of the variable names in @vars. + * + * If variable @name has been assigned (using gts_file_assign_variables()) + * sets the @line and @pos fields of @f to the line and position where + * it has been assigned. + */ +void gts_file_variable_error (GtsFile * f, + GtsFileVariable * vars, + const gchar * name, + const gchar * format, + ...) +{ + va_list args; + GtsFileVariable * var; + + g_return_if_fail (f != NULL); + g_return_if_fail (vars != NULL); + g_return_if_fail (name != NULL); + g_return_if_fail (format != NULL); + + var = vars; + while (var->type != GTS_NONE && strcmp (var->name, name)) + var++; + + g_return_if_fail (var->type != GTS_NONE); /* @name not found in @vars */ + + if (var->set) { + f->line = var->line; + f->pos = var->pos; + } + + va_start (args, format); + gts_file_verror (f, format, args); + va_end (args); +} + +#ifdef DEBUG_FUNCTIONS +static GHashTable * ids = NULL; +static guint next_id = 1; + +guint id (gpointer p) +{ + g_return_val_if_fail (p != NULL, 0); + g_return_val_if_fail (ids != NULL, 0); + g_assert (g_hash_table_lookup (ids, p)); + return GPOINTER_TO_UINT (g_hash_table_lookup (ids, p)); +} + +void id_insert (gpointer p) +{ + g_return_if_fail (p != NULL); + if (ids == NULL) ids = g_hash_table_new (NULL, NULL); + g_assert (g_hash_table_lookup (ids, p) == NULL); + g_hash_table_insert (ids, p, GUINT_TO_POINTER (next_id++)); +} + +void id_remove (gpointer p) +{ + g_assert (g_hash_table_lookup (ids, p)); + g_hash_table_remove (ids, p); +} + +void gts_write_triangle (GtsTriangle * t, + GtsPoint * o, + FILE * fptr) +{ + gdouble xo = o ? o->x : 0.0; + gdouble yo = o ? o->y : 0.0; + gdouble zo = o ? o->z : 0.0; + + g_return_if_fail (t != NULL && fptr != NULL); + + fprintf (fptr, "(hdefine geometry \"t%d\" { =\n", id (t)); + fprintf (fptr, "OFF 3 1 0\n" + "%g %g %g\n%g %g %g\n%g %g %g\n3 0 1 2\n})\n" + "(geometry \"t%d\" { : \"t%d\"})\n" + "(normalization \"t%d\" none)\n", + GTS_POINT (GTS_SEGMENT (t->e1)->v1)->x - xo, + GTS_POINT (GTS_SEGMENT (t->e1)->v1)->y - yo, + GTS_POINT (GTS_SEGMENT (t->e1)->v1)->z - zo, + GTS_POINT (GTS_SEGMENT (t->e1)->v2)->x - xo, + GTS_POINT (GTS_SEGMENT (t->e1)->v2)->y - yo, + GTS_POINT (GTS_SEGMENT (t->e1)->v2)->z - zo, + GTS_POINT (gts_triangle_vertex (t))->x - xo, + GTS_POINT (gts_triangle_vertex (t))->y - yo, + GTS_POINT (gts_triangle_vertex (t))->z - zo, + id (t), id (t), id (t)); +} + +void gts_write_segment (GtsSegment * s, + GtsPoint * o, + FILE * fptr) +{ + gdouble xo = o ? o->x : 0.0; + gdouble yo = o ? o->y : 0.0; + gdouble zo = o ? o->z : 0.0; + + g_return_if_fail (s != NULL && fptr != NULL); + + fprintf (fptr, "(geometry \"s%d\" { =\n", id (s)); + fprintf (fptr, "VECT 1 2 0 2 0 %g %g %g %g %g %g })\n" + "(normalization \"s%d\" none)\n", + GTS_POINT (s->v1)->x - xo, + GTS_POINT (s->v1)->y - yo, + GTS_POINT (s->v1)->z - zo, + GTS_POINT (s->v2)->x - xo, + GTS_POINT (s->v2)->y - yo, + GTS_POINT (s->v2)->z - zo, + id (s)); +} +#endif /* DEBUG_FUNCTIONS */ Index: tags/1.0.5/gts/named.c =================================================================== --- tags/1.0.5/gts/named.c (nonexistent) +++ tags/1.0.5/gts/named.c (revision 953) @@ -0,0 +1,188 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +static void nvertex_read (GtsObject ** po, GtsFile * fp) +{ + if ((*po)->klass->parent_class->read) + (* (*po)->klass->parent_class->read) (po, fp); + + if (fp->type != '\n' && fp->type != GTS_ERROR) { + strncpy (GTS_NVERTEX (*po)->name, fp->token->str, GTS_NAME_LENGTH); + gts_file_next_token (fp); + } +} + +static void nvertex_write (GtsObject * o, FILE * fptr) +{ + GtsNVertex * nv = GTS_NVERTEX (o); + + (* o->klass->parent_class->write) (o, fptr); + if (nv->name[0] != '\0') + fprintf (fptr, " %s", nv->name); +} + +static void nvertex_class_init (GtsNVertexClass * klass) +{ + GTS_OBJECT_CLASS (klass)->read = nvertex_read; + GTS_OBJECT_CLASS (klass)->write = nvertex_write; +} + +static void nvertex_init (GtsNVertex * nvertex) +{ + nvertex->name[0] = '\0'; +} + +/** + * gts_nvertex_class: + * + * Returns: the #GtsNVertexClass. + */ +GtsNVertexClass * gts_nvertex_class (void) +{ + static GtsNVertexClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo nvertex_info = { + "GtsNVertex", + sizeof (GtsNVertex), + sizeof (GtsNVertexClass), + (GtsObjectClassInitFunc) nvertex_class_init, + (GtsObjectInitFunc) nvertex_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_vertex_class ()), + &nvertex_info); + } + + return klass; +} + +static void nedge_read (GtsObject ** po, GtsFile * fp) +{ + if (fp->type != GTS_STRING) { + gts_file_error (fp, "expecting a string (name)"); + return; + } + strncpy (GTS_NEDGE (*po)->name, fp->token->str, GTS_NAME_LENGTH); + gts_file_next_token (fp); +} + +static void nedge_write (GtsObject * o, FILE * fptr) +{ + GtsNEdge * ne = GTS_NEDGE (o); + + if (ne->name[0] != '\0') + fprintf (fptr, " %s", ne->name); +} + +static void nedge_class_init (GtsNEdgeClass * klass) +{ + GTS_OBJECT_CLASS (klass)->read = nedge_read; + GTS_OBJECT_CLASS (klass)->write = nedge_write; +} + +static void nedge_init (GtsNEdge * nedge) +{ + nedge->name[0] = '\0'; +} + +/** + * gts_nedge_class: + * + * Returns: the #GtsNEdgeClass. + */ +GtsNEdgeClass * gts_nedge_class (void) +{ + static GtsNEdgeClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo nedge_info = { + "GtsNEdge", + sizeof (GtsNEdge), + sizeof (GtsNEdgeClass), + (GtsObjectClassInitFunc) nedge_class_init, + (GtsObjectInitFunc) nedge_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_edge_class ()), + &nedge_info); + } + + return klass; +} + +static void nface_read (GtsObject ** po, GtsFile * fp) +{ + if (fp->type != GTS_STRING) { + gts_file_error (fp, "expecting a string (name)"); + return; + } + strncpy (GTS_NFACE (*po)->name, fp->token->str, GTS_NAME_LENGTH); + gts_file_next_token (fp); +} + +static void nface_write (GtsObject * o, FILE * fptr) +{ + GtsNFace * nf = GTS_NFACE (o); + + if (nf->name[0] != '\0') + fprintf (fptr, " %s", GTS_NFACE (o)->name); +} + +static void nface_class_init (GtsNFaceClass * klass) +{ + GTS_OBJECT_CLASS (klass)->read = nface_read; + GTS_OBJECT_CLASS (klass)->write = nface_write; +} + +static void nface_init (GtsNFace * nface) +{ + nface->name[0] = '\0'; +} + +/** + * gts_nface_class: + * + * Returns: the #GtsNFaceClass. + */ +GtsNFaceClass * gts_nface_class (void) +{ + static GtsNFaceClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo nface_info = { + "GtsNFace", + sizeof (GtsNFace), + sizeof (GtsNFaceClass), + (GtsObjectClassInitFunc) nface_class_init, + (GtsObjectInitFunc) nface_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_face_class ()), + &nface_info); + } + + return klass; +} Index: tags/1.0.5/gts/object.c =================================================================== --- tags/1.0.5/gts/object.c (nonexistent) +++ tags/1.0.5/gts/object.c (revision 953) @@ -0,0 +1,345 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" +#include "gts-private.h" + +static GHashTable * class_table = NULL; + +static void gts_object_class_init (GtsObjectClass * klass, + GtsObjectClass * parent_class) +{ + if (parent_class) { + gts_object_class_init (klass, parent_class->parent_class); + if (parent_class->info.class_init_func) + (*parent_class->info.class_init_func) (klass); + } +} + +/** + * gts_object_class_new: + * @parent_class: a #GtsObjectClass. + * @info: a #GtsObjectClassInfo, description of the new class to create. + * + * Returns: a new #GtsObjectClass derived from @parent_class and described by + * @info. + */ +gpointer gts_object_class_new (GtsObjectClass * parent_class, + GtsObjectClassInfo * info) +{ + GtsObjectClass * klass; + + g_return_val_if_fail (info != NULL, NULL); + g_return_val_if_fail (parent_class == NULL || + info->object_size >= parent_class->info.object_size, + NULL); + g_return_val_if_fail (parent_class == NULL || + info->class_size >= parent_class->info.class_size, + NULL); + + klass = g_malloc0 (info->class_size); + klass->info = *info; + klass->parent_class = parent_class; + gts_object_class_init (klass, klass); + + if (!class_table) + class_table = g_hash_table_new (g_str_hash, g_str_equal); + g_hash_table_insert (class_table, klass->info.name, klass); + + return klass; +} + +/** + * gts_object_class_from_name: + * @name: the name of a #GtsObjectClass. + * + * Returns: the #GtsObjectClass with name @name or %NULL if it hasn't been + * instantiated yet. + */ +GtsObjectClass * gts_object_class_from_name (const gchar * name) +{ + g_return_val_if_fail (name != NULL, NULL); + + if (!class_table) + return NULL; + return g_hash_table_lookup (class_table, name); +} + +static void object_destroy (GtsObject * object) +{ +#ifdef DEBUG_IDENTITY +#ifdef DEBUG_LEAKS + fprintf (stderr, "destroy %s %p->%d\n", + object->klass->info.name, + object, + id (object)); +#endif + id_remove (object); +#endif + object->klass = NULL; + g_free (object); +} + +static void object_clone (GtsObject * clone, GtsObject * object) +{ + memcpy (clone, object, object->klass->info.object_size); + clone->reserved = NULL; +} + +static void object_class_init (GtsObjectClass * klass) +{ + klass->clone = object_clone; + klass->destroy = object_destroy; + klass->read = NULL; + klass->write = NULL; + klass->color = NULL; + klass->attributes = NULL; +} + +static void object_init (GtsObject * object) +{ + object->reserved = NULL; + object->flags = 0; +} + +/** + * gts_object_class: + * + * Returns: the #GtsObjectClass. + */ +GtsObjectClass * gts_object_class (void) +{ + static GtsObjectClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo object_info = { + "GtsObject", + sizeof (GtsObject), + sizeof (GtsObjectClass), + (GtsObjectClassInitFunc) object_class_init, + (GtsObjectInitFunc) object_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (NULL, &object_info); + } + + return klass; +} + +/** + * gts_object_check_cast: + * @object: a #GtsObject. + * @klass: a #GtsObjectClass. + * + * Returns: @object while emitting warnings if @object is not of class @klass. + */ +gpointer gts_object_check_cast (gpointer object, + gpointer klass) +{ + if (!object) { + g_warning ("invalid cast from (NULL) pointer to `%s'", + GTS_OBJECT_CLASS (klass)->info.name); + return object; + } + if (!((GtsObject *) object)->klass) { + g_warning ("invalid unclassed pointer in cast to `%s'", + GTS_OBJECT_CLASS (klass)->info.name); + return object; + } + if (!gts_object_is_from_class (object, klass)) { + g_warning ("invalid cast from `%s' to `%s'", + ((GtsObject *) object)->klass->info.name, + GTS_OBJECT_CLASS (klass)->info.name); + return object; + } + return object; +} + +/** + * gts_object_class_check_cast: + * @klass: a #GtsObjectClass. + * @from: a #GtsObjectClass. + * + * Returns: @klass while emitting warnings if @klass is not derived from + * @from. + */ +gpointer gts_object_class_check_cast (gpointer klass, + gpointer from) +{ + if (!klass) { + g_warning ("invalid cast from (NULL) pointer to `%s'", + GTS_OBJECT_CLASS (from)->info.name); + return klass; + } + if (!gts_object_class_is_from_class (klass, from)) { + g_warning ("invalid cast from `%s' to `%s'", + GTS_OBJECT_CLASS (klass)->info.name, + GTS_OBJECT_CLASS (from)->info.name); + return klass; + } + return klass; +} + +/** + * gts_object_init: + * @object: a #GtsObject. + * @klass: a #GtsObjectClass. + * + * Calls the init method of @klass with @object as argument. This is done + * recursively in the correct order (from the base class to the top). You + * should rarely need this function as it is called automatically by the + * constructor for each class. + */ +void gts_object_init (GtsObject * object, GtsObjectClass * klass) +{ + GtsObjectClass * parent_class; + + g_return_if_fail (object != NULL); + g_return_if_fail (klass != NULL); + + parent_class = klass->parent_class; + if (parent_class) + gts_object_init (object, parent_class); + if (klass->info.object_init_func) + (*klass->info.object_init_func) (object); +} + +/** + * gts_object_new: + * @klass: a #GtsObjectClass. + * + * Returns: a new initialized object of class @klass. + */ +GtsObject * gts_object_new (GtsObjectClass * klass) +{ + GtsObject * object; + + g_return_val_if_fail (klass != NULL, NULL); + + object = g_malloc0 (klass->info.object_size); + object->klass = klass; + gts_object_init (object, klass); + +#ifdef DEBUG_IDENTITY + id_insert (object); +#ifdef DEBUG_LEAKS + fprintf (stderr, "new %s %p->%d\n", klass->info.name, + object, + id (object)); +#endif +#endif + + return object; +} + +/** + * gts_object_clone: + * @object: a #GtsObject. + * + * Calls the clone method of @object. The call to this function will fail + * if no clone method exists for the given object. + * + * Returns: a new object clone of @object. + */ +GtsObject * gts_object_clone (GtsObject * object) +{ + GtsObject * clone; + + g_return_val_if_fail (object != NULL, NULL); + g_return_val_if_fail (object->klass->clone, NULL); + + clone = g_malloc0 (object->klass->info.object_size); + clone->klass = object->klass; + object_init (clone); + (* object->klass->clone) (clone, object); + +#ifdef DEBUG_IDENTITY + id_insert (clone); +#ifdef DEBUG_LEAKS + fprintf (stderr, "clone %s %p->%d\n", clone->klass->info.name, + clone, + id (clone)); +#endif +#endif + + return clone; +} + +/** + * gts_object_destroy: + * @object: a #GtsObject. + * + * Calls the destroy method of @object, freeing all memory allocated for it. + */ +void gts_object_destroy (GtsObject * object) +{ + g_assert (object->klass->destroy); + GTS_OBJECT_SET_FLAGS (object, GTS_DESTROYED); + (* object->klass->destroy) (object); +} + +/** + * gts_object_reset_reserved: + * @object: a #GtsObject. + * + * Reset the reserved field of @object. + */ +void gts_object_reset_reserved (GtsObject * object) +{ + g_return_if_fail (object != NULL); + + object->reserved = NULL; +} + +/** + * gts_object_attributes: + * @object: a #GtsObject. + * @from: a #GtsObject. + * + * Calls the attributes() method of @object using @from as source. + */ +void gts_object_attributes (GtsObject * object, GtsObject * from) +{ + g_return_if_fail (object != NULL); + + if (object->klass->attributes) + (* object->klass->attributes) (object, from); +} + +static void free_class (gchar * name, GtsObjectClass * klass) +{ + g_free (klass); +} + +/** + * gts_finalize: + * + * Free all the memory allocated by the object system of GTS. No other + * GTS function can be called after this function has been called. + */ +void gts_finalize (void) +{ + if (class_table) { + g_hash_table_foreach (class_table, (GHFunc) free_class, NULL); + g_hash_table_destroy (class_table); + class_table = NULL; + } +} Index: tags/1.0.5/gts/oocs.c =================================================================== --- tags/1.0.5/gts/oocs.c (nonexistent) +++ tags/1.0.5/gts/oocs.c (revision 953) @@ -0,0 +1,387 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +static void cluster_destroy (GtsObject * object) +{ + GtsCluster * c = GTS_CLUSTER (object); + + if (c->v && gts_vertex_is_unattached (c->v)) + gts_object_destroy (GTS_OBJECT (c->v)); + + /* do not forget to call destroy method of the parent */ + (* GTS_OBJECT_CLASS (gts_cluster_class ())->parent_class->destroy) (object); +} + +static void cluster_add (GtsCluster * c, GtsPoint * p, gpointer data) +{ + GtsPoint * cp; + + g_return_if_fail (c != NULL); + g_return_if_fail (c->v != NULL); + g_return_if_fail (p != NULL); + + cp = GTS_POINT (c->v); + + cp->x += p->x; + cp->y += p->y; + cp->z += p->z; + c->n++; +} + +static void cluster_update (GtsCluster * c) +{ + GtsPoint * p; + + g_return_if_fail (c != NULL); + g_return_if_fail (c->v != NULL); + + if (c->n > 1) { + p = GTS_POINT (c->v); + p->x /= c->n; + p->y /= c->n; + p->z /= c->n; + } +} + +static void cluster_class_init (GtsClusterClass * klass) +{ + klass->add = cluster_add; + klass->update = cluster_update; + + GTS_OBJECT_CLASS (klass)->destroy = cluster_destroy; +} + +static void cluster_init (GtsCluster * c) +{ + c->v = NULL; + c->n = 0; +} + +/** + * gts_cluster_class: + * + * Returns: the #GtsClusterClass. + */ +GtsClusterClass * gts_cluster_class (void) +{ + static GtsClusterClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo cluster_info = { + "GtsCluster", + sizeof (GtsCluster), + sizeof (GtsClusterClass), + (GtsObjectClassInitFunc) cluster_class_init, + (GtsObjectInitFunc) cluster_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &cluster_info); + } + + return klass; +} + +/** + * gts_cluster_new: + * @klass: a #GtsClusterClass. + * @id: the id of the new cluster. + * @vklass: a #GtsVertexClass for the representative vertex of the cluster. + * + * Returns: a new #GtsCluster. + */ +GtsCluster * gts_cluster_new (GtsClusterClass * klass, + GtsClusterId id, + GtsVertexClass * vklass) +{ + GtsCluster * c; + + c = GTS_CLUSTER (gts_object_new (GTS_OBJECT_CLASS (klass))); + c->id = id; + c->v = gts_vertex_new (vklass, 0., 0., 0.); + + return c; +} + +/** + * gts_cluster_add: + * @c: a #GtsCluster. + * @p: a #GtsPoint. + * @data: data to pass to the add() virtual method of #GtsClusterClass. + * + * Adds point @p to cluster @c. + */ +void gts_cluster_add (GtsCluster * c, GtsPoint * p, gpointer data) +{ + g_return_if_fail (c != NULL); + g_return_if_fail (p != NULL); + + (* GTS_CLUSTER_CLASS (GTS_OBJECT (c)->klass)->add) (c, p, data); +} + +/** + * gts_cluster_update: + * @c: a #GtsCluster. + * + * Updates the position of the vertex representative of all the + * vertices added to @c. + */ +void gts_cluster_update (GtsCluster * c) +{ + g_return_if_fail (c != NULL); + + (* GTS_CLUSTER_CLASS (GTS_OBJECT (c)->klass)->update) (c); +} + +static void destroy_cluster (GtsClusterId * id, GtsObject * cluster) +{ + gts_object_destroy (cluster); +} + +static void cluster_grid_destroy (GtsObject * object) +{ + GtsClusterGrid * cluster_grid = GTS_CLUSTER_GRID (object); + + g_hash_table_foreach (cluster_grid->clusters, + (GHFunc) destroy_cluster, NULL); + g_hash_table_destroy (cluster_grid->clusters); + + (* GTS_OBJECT_CLASS (gts_cluster_grid_class ())->parent_class->destroy) + (object); +} + +static void cluster_grid_class_init (GtsClusterGridClass * klass) +{ + GTS_OBJECT_CLASS (klass)->destroy = cluster_grid_destroy; +} + +static gint cluster_id_equal (gconstpointer v1, + gconstpointer v2) +{ + const GtsClusterId * id1 = (const GtsClusterId *) v1; + const GtsClusterId * id2 = (const GtsClusterId *) v2; + return ((id1->x == id2->x) && (id1->y == id2->y) && (id1->z == id2->z)); +} + +static guint cluster_id_hash (gconstpointer key) +{ + const GtsClusterId * id = (const GtsClusterId *) key; + return id->x + id->y + id->z; +} + +static void cluster_grid_init (GtsClusterGrid * cluster_grid) +{ + cluster_grid->surface = NULL; + cluster_grid->bbox = NULL; + cluster_grid->cluster_class = gts_cluster_class (); + cluster_grid->clusters = g_hash_table_new (cluster_id_hash, + cluster_id_equal); +} + +/** + * gts_cluster_grid_class: + * + * Returns: the #GtsClusterGridClass. + */ +GtsClusterGridClass * gts_cluster_grid_class (void) +{ + static GtsClusterGridClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo cluster_grid_info = { + "GtsClusterGrid", + sizeof (GtsClusterGrid), + sizeof (GtsClusterGridClass), + (GtsObjectClassInitFunc) cluster_grid_class_init, + (GtsObjectInitFunc) cluster_grid_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &cluster_grid_info); + } + + return klass; +} + +/** + * gts_cluster_grid_new: + * @klass: a #GtsClusterGridClass. + * @cluster_class: the klass to be used for the vertex clusters. + * @s: the simplified surface. + * @bbox: bounding box of the surface to be simplified. + * @delta: the size of one grid cell of the simplification grid. + * + * Returns: a new #GtsClusterGrid. + */ +GtsClusterGrid * gts_cluster_grid_new (GtsClusterGridClass * klass, + GtsClusterClass * cluster_class, + GtsSurface * s, + GtsBBox * bbox, + gdouble delta) +{ + GtsClusterGrid * cluster_grid; + GtsVector size; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (cluster_class != NULL, NULL); + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (bbox != NULL, NULL); + g_return_val_if_fail (delta > 0., NULL); + + size[0] = ceil ((bbox->x2 - bbox->x1)/delta); + size[1] = ceil ((bbox->y2 - bbox->y1)/delta); + size[2] = ceil ((bbox->z2 - bbox->z1)/delta); + g_return_val_if_fail (size[0] <= 2.*G_MAXINT + 2. && + size[1] <= 2.*G_MAXINT + 2. && + size[2] <= 2.*G_MAXINT + 2., NULL); + cluster_grid = + GTS_CLUSTER_GRID (gts_object_new (GTS_OBJECT_CLASS (klass))); + cluster_grid->cluster_class = cluster_class; + cluster_grid->surface = s; + cluster_grid->bbox = bbox; + cluster_grid->size[0] = size[0]; + cluster_grid->size[1] = size[1]; + cluster_grid->size[2] = size[2]; + + return cluster_grid; +} + +static GtsClusterId cluster_index (GtsPoint * p, + GtsBBox * bb, + GtsVector n) +{ + GtsClusterId id = {0, 0, 0}; + + g_return_val_if_fail (p->x >= bb->x1 && p->x <= bb->x2, id); + g_return_val_if_fail (p->y >= bb->y1 && p->y <= bb->y2, id); + g_return_val_if_fail (p->z >= bb->z1 && p->z <= bb->z2, id); + + id.x = (guint) (p->x == bb->x2 ? n[0] - 1. : n[0]*(p->x - bb->x1)/(bb->x2 - bb->x1)); + id.y = (guint) (p->y == bb->y2 ? n[1] - 1. : n[1]*(p->y - bb->y1)/(bb->y2 - bb->y1)); + id.z = (guint) (p->z == bb->z2 ? n[2] - 1. : n[2]*(p->z - bb->z1)/(bb->z2 - bb->z1)); + + return id; +} + +static GtsCluster * cluster_grid_add_point (GtsClusterGrid * cluster_grid, + GtsPoint * p, + gpointer data) +{ + GtsClusterId id = cluster_index (p, + cluster_grid->bbox, + cluster_grid->size); + GtsCluster * c = g_hash_table_lookup (cluster_grid->clusters, &id); + + if (c == NULL) { + c = gts_cluster_new (cluster_grid->cluster_class, id, + cluster_grid->surface->vertex_class); + g_hash_table_insert (cluster_grid->clusters, &c->id, c); + } + + gts_cluster_add (c, p, data); + + return c; +} + +/** + * gts_cluster_grid_add_triangle: + * @cluster_grid: a #GtsClusterGrid. + * @p1: a #GtsPoint. + * @p2: a #GtsPoint. + * @p3: a #GtsPoint. + * @data: user data to pass to the cluster add() method. + * + * Adds the triangle defined by @p1, @p2 and @p3 to the respective clusters + * of @cluster_grid. + */ +void gts_cluster_grid_add_triangle (GtsClusterGrid * cluster_grid, + GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + gpointer data) +{ + GtsCluster * c1, * c2, * c3; + + g_return_if_fail (cluster_grid != NULL); + g_return_if_fail (p1 != NULL); + g_return_if_fail (p2 != NULL); + g_return_if_fail (p3 != NULL); + g_return_if_fail (cluster_grid->surface != NULL); + + c1 = cluster_grid_add_point (cluster_grid, p1, data); + c2 = cluster_grid_add_point (cluster_grid, p2, data); + c3 = cluster_grid_add_point (cluster_grid, p3, data); + + if (c1 != c2 && c2 != c3 && c3 != c1) { + GtsVertex * v1, * v2, * v3; + GtsEdge * e1, * e2, * e3; + gboolean new_edge = FALSE; + + v1 = c1->v; v2 = c2->v; v3 = c3->v; + + if ((e1 = GTS_EDGE (gts_vertices_are_connected (v1, v2))) == NULL) { + e1 = gts_edge_new (cluster_grid->surface->edge_class, v1, v2); + new_edge = TRUE; + } + if ((e2 = GTS_EDGE (gts_vertices_are_connected (v2, v3))) == NULL) { + e2 = gts_edge_new (cluster_grid->surface->edge_class, v2, v3); + new_edge = TRUE; + } + if ((e3 = GTS_EDGE (gts_vertices_are_connected (v3, v1))) == NULL) { + e3 = gts_edge_new (cluster_grid->surface->edge_class, v3, v1); + new_edge = TRUE; + } + if (new_edge || !gts_triangle_use_edges (e1, e2, e3)) + gts_surface_add_face (cluster_grid->surface, + gts_face_new (cluster_grid->surface->face_class, + e1, e2, e3)); + } +} + +static void update_cluster (gint * id, GtsCluster * cluster, GtsRange * stats) +{ + gts_cluster_update (cluster); + gts_range_add_value (stats, cluster->n); +} + +/** + * gts_cluster_grid_update: + * @cluster_grid: a #GtsClusterGrid. + * + * Updates the representative vertices of all the clusters of @cluster_grid. + * + * Returns: a #GtsRange describing the statistics for the number of vertices + * added to each cluster of @cluster_grid. + */ +GtsRange gts_cluster_grid_update (GtsClusterGrid * cluster_grid) +{ + GtsRange stats; + + gts_range_init (&stats); + g_return_val_if_fail (cluster_grid != NULL, stats); + + g_hash_table_foreach (cluster_grid->clusters, + (GHFunc) update_cluster, &stats); + gts_range_update (&stats); + + return stats; +} Index: tags/1.0.5/gts/partition.c =================================================================== --- tags/1.0.5/gts/partition.c (nonexistent) +++ tags/1.0.5/gts/partition.c (revision 953) @@ -0,0 +1,1219 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include + +#include "gts.h" + +/* #define DEBUG */ + +/* Graph partition */ + +/** + * gts_graph_partition_edges_cut: + * @partition: a list of @GtsGraph representing a partition. + * + * Returns: the number of edges cut by the partition. + */ +guint gts_graph_partition_edges_cut (GSList * partition) +{ + guint cuts = 0; + + while (partition) { + cuts += gts_graph_edges_cut (partition->data); + partition = partition->next; + } + + return cuts/2; +} + +/** + * gts_graph_partition_edges_cut_weight: + * @partition: a list of @GtsGraph representing a partition. + * + * Returns: the total weight of the edges cut by the partition. + */ +gfloat gts_graph_partition_edges_cut_weight (GSList * partition) +{ + gfloat weight = 0.; + + while (partition) { + weight += gts_graph_edges_cut_weight (partition->data); + partition = partition->next; + } + + return weight/2.; +} + +/** + * gts_graph_partition_print_stats: + * @partition: a list of @GtsGraph representing a partition. + * @fp: a file pointer. + * + * Writes to @fp a summary of the properties of @partition. + */ +void gts_graph_partition_print_stats (GSList * partition, + FILE * fp) +{ + GtsRange weight; + GSList * i; + + g_return_if_fail (partition != NULL); + g_return_if_fail (fp != NULL); + + gts_range_init (&weight); + i = partition; + while (i) { + gts_range_add_value (&weight, gts_graph_weight (i->data)); + i = i->next; + } + gts_range_update (&weight); + + fprintf (fp, + "# parts: %d\n" + "# edge cuts: %5d edge cuts weight: %5g\n" + "# weight: ", + g_slist_length (partition), + gts_graph_partition_edges_cut (partition), + gts_graph_partition_edges_cut_weight (partition)); + gts_range_print (&weight, fp); + fputc ('\n', fp); +} + +/** + * gts_graph_partition_balance: + * @partition: a list of @GtsGraph representing a partition. + * + * Returns: the difference between the maximum and the minimum weight + * of the graphs in @partition. + */ +gfloat gts_graph_partition_balance (GSList * partition) +{ + gfloat wmin = G_MAXFLOAT; + gfloat wmax = - G_MAXFLOAT; + + g_return_val_if_fail (partition != NULL, 0.); + + while (partition) { + gfloat weight = gts_graph_weight (partition->data); + if (weight < wmin) + wmin = weight; + if (weight > wmax) + wmax = weight; + partition = partition->next; + } + return wmax - wmin; +} + +/** + * gts_graph_partition_clone: + * @partition: a list of @GtsGraph representing a partition. + * + * Returns: a new partition clone of @partition (i.e. a list of new + * graphs clones of the graphs in @partition). + */ +GSList * gts_graph_partition_clone (GSList * partition) +{ + GSList * cparts = NULL; + + while (partition) { + cparts = + g_slist_prepend (cparts, + gts_object_clone (GTS_OBJECT (partition->data))); + partition = partition->next; + } + return cparts; +} + +/** + * gts_graph_partition_destroy: + * @partition: a list of @GtsGraph representing a partition. + * + * Destroys all the graphs in @partition and frees @partition. + */ +void gts_graph_partition_destroy (GSList * partition) +{ + GSList * i = partition; + + while (i) { + gts_object_destroy (GTS_OBJECT (i->data)); + i = i->next; + } + g_slist_free (partition); +} + +static void find_smallest_degree (GtsGNode * n, gpointer * data) +{ + GtsGNode ** nmin = data[0]; + GtsGraph * g = data[1]; + guint * min = data[2]; + guint degree = gts_gnode_degree (n, g); + + if (degree < *min) { + *min = degree; + *nmin = n; + } +} + +static gint graph_comp_weight (GtsGraph * g1, GtsGraph * g2) +{ + if (gts_graph_weight (g1) > gts_graph_weight (g2)) + return 1; + return -1; +} + +static void partition_update (GSList * list, GtsGraph * g) +{ + GSList * i; + GtsGraph * g1; + GtsHeap * size_heap; + gboolean reinit = TRUE; + + /* initialize traversals */ + i = list; + while (i) { + GtsGNode * seed = GTS_OBJECT (i->data)->reserved; + GTS_OBJECT (seed)->reserved = + gts_graph_traverse_new (g, seed, GTS_BREADTH_FIRST, reinit); + reinit = FALSE; + i = i->next; + } + + size_heap = gts_heap_new ((GCompareFunc) graph_comp_weight); + i = list; + while (i) { + gts_heap_insert (size_heap, i->data); + i = i->next; + } + while ((g1 = gts_heap_remove_top (size_heap))) { + GtsGraphTraverse * t = GTS_OBJECT (GTS_OBJECT (g1)->reserved)->reserved; + GtsGNode * n = gts_graph_traverse_next (t); + if (n) { + gts_container_add (GTS_CONTAINER (g1), GTS_CONTAINEE (n)); + gts_heap_insert (size_heap, g1); + } + } + gts_heap_destroy (size_heap); + + /* destroy traversals */ + i = list; + while (i) { + GtsGNode * seed = GTS_OBJECT (i->data)->reserved; + gts_graph_traverse_destroy (GTS_OBJECT (seed)->reserved); + GTS_OBJECT (seed)->reserved = NULL; + i = i->next; + } +} + +static void better_seed (GtsGNode * n, gpointer * data) +{ + guint * sum = data[0]; + GtsGNode ** seed = data[1]; + GtsGraph * g = data[2]; + guint sum1 = gts_graph_distance_sum (g, n); + + if (sum1 < *sum) { + *sum = sum1; + *seed = n; + } +} + +static GtsGNode * graph_new_seed (GtsGraph * g, GtsGNode * seed) +{ + guint sum = gts_graph_distance_sum (g, seed); + gpointer data[3]; + GtsGNode * new_seed = seed; + + data[0] = ∑ + data[1] = &new_seed; + data[2] = g; + gts_gnode_foreach_neighbor (seed, g, (GtsFunc) better_seed, data); + + return new_seed; +} + +/** + * gts_graph_bubble_partition: + * @g: a #GtsGraph. + * @np: number of partitions. + * @niter: the maximum number of iterations. + * @step_info: a #GtsFunc or %NULL. + * @data: user data to pass to @step_info. + * + * An implementation of the "bubble partitioning algorithm" of + * Diekmann, Preis, Schlimbach and Walshaw (2000). The maximum number + * of iteration on the positions of the graph growing seeds is + * controlled by @niter. + * + * If not %NULL @step_info is called after each iteration on the seeds + * positions passing the partition (a GSList) as argument. + * + * Returns: a list of @np new #GtsGraph representing the partition. + */ +GSList * gts_graph_bubble_partition (GtsGraph * g, + guint np, + guint niter, + GtsFunc step_info, + gpointer data) +{ + GSList * list = NULL, * seeds = NULL; + GtsGNode * seed = NULL; + guint min = G_MAXINT/2 - 1; + gpointer info[3]; + GtsGraph * g1; + gboolean changed = TRUE; + + g_return_val_if_fail (g != NULL, NULL); + g_return_val_if_fail (np > 0, NULL); + + info[0] = &seed; + info[1] = g; + info[2] = &min; + gts_container_foreach (GTS_CONTAINER (g), + (GtsFunc) find_smallest_degree, + info); + if (seed == NULL) + return NULL; + + g1 = GTS_GRAPH (gts_object_new (GTS_OBJECT (g)->klass)); + gts_container_add (GTS_CONTAINER (g1), GTS_CONTAINEE (seed)); + list = g_slist_prepend (list, g1); + GTS_OBJECT (g1)->reserved = seed; + seeds = g_slist_prepend (seeds, seed); + + while (--np && seed) + if ((seed = gts_graph_farthest (g, seeds))) { + g1 = GTS_GRAPH (gts_object_new (GTS_OBJECT (g)->klass)); + gts_container_add (GTS_CONTAINER (g1), GTS_CONTAINEE (seed)); + list = g_slist_prepend (list, g1); + GTS_OBJECT (g1)->reserved = seed; + seeds = g_slist_prepend (seeds, seed); + } + g_slist_free (seeds); + + partition_update (list, g); + + while (changed && niter--) { + GSList * i; + + changed = FALSE; + i = list; + while (i) { + GtsGraph * g1 = i->data; + GtsGNode * seed = GTS_OBJECT (g1)->reserved; + GtsGNode * new_seed = graph_new_seed (g1, seed); + if (new_seed != seed) { + changed = TRUE; + GTS_OBJECT (g1)->reserved = new_seed; + } + i = i->next; + } + + if (changed) { + i = list; + while (i) { + GtsGraph * g1 = i->data; + GtsGNode * seed = GTS_OBJECT (g1)->reserved; + + gts_object_destroy (GTS_OBJECT (g1)); + i->data = g1 = GTS_GRAPH (gts_object_new (GTS_OBJECT (g)->klass)); + gts_container_add (GTS_CONTAINER (g1), GTS_CONTAINEE (seed)); + GTS_OBJECT (g1)->reserved = seed; + i = i->next; + } + partition_update (list, g); + if (step_info) + (* step_info) (list, data); + } + } + g_slist_foreach (list, (GFunc) gts_object_reset_reserved, NULL); + return list; +} + +/* Graph bisection */ + +static gdouble node_cost (GtsGNode * n, gpointer * data) +{ + GtsGraph * g = data[0]; + GtsGraph * g1 = data[1]; + GSList * i = GTS_SLIST_CONTAINER (n)->items; + gdouble cost = 0.; + + while (i) { + GtsGEdge * e = i->data; + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, e); + + if (gts_containee_is_contained (GTS_CONTAINEE (n1), GTS_CONTAINER (g))) { + if (gts_containee_is_contained (GTS_CONTAINEE (n1), GTS_CONTAINER (g1))) + cost -= gts_gedge_weight (e); + else + cost += gts_gedge_weight (e); + } + i = i->next; + } + + return cost; +} + +static void add_neighbor (GtsGNode * n, GtsEHeap * heap) +{ + if (GTS_OBJECT (n)->reserved == n) + return; + if (GTS_OBJECT (n)->reserved) + gts_eheap_remove (heap, GTS_OBJECT (n)->reserved); + GTS_OBJECT (n)->reserved = gts_eheap_insert (heap, n); +} + +static void add_unused (GtsGNode * n, GtsGraph * g2) +{ + if (GTS_OBJECT (n)->reserved) + GTS_OBJECT (n)->reserved = NULL; + else + gts_container_add (GTS_CONTAINER (g2), GTS_CONTAINEE (n)); +} + +static gdouble degree_cost (GtsGNode * n, GtsGraph * g) +{ + return gts_gnode_degree (n, g); +} + +static void add_seed (GtsGNode * n, GtsEHeap * heap) +{ + gts_eheap_insert (heap, n); +} + +static void boundary_node1 (GtsGNode * n, GtsGraphBisection * bg) +{ + GSList * i = GTS_SLIST_CONTAINER (n)->items; + + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (bg->g2))) { + g_hash_table_insert (bg->bg1, n, n1); + return; + } + i = i->next; + } +} + +static void boundary_node2 (GtsGNode * n, GtsGraphBisection * bg) +{ + GSList * i = GTS_SLIST_CONTAINER (n)->items; + + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (bg->g1))) { + g_hash_table_insert (bg->bg2, n, n1); + return; + } + i = i->next; + } +} + +static void check_bg (GtsGNode * n, gpointer * data) +{ + GHashTable * bg = data[0]; + GtsGraph * g = data[1]; + gboolean * ok = data[2]; + guint * nb = data[3]; + guint nn = gts_gnode_degree (n, g); + + if (nn > 0) + (*nb)++; + if ((nn > 0 && !g_hash_table_lookup (bg, n)) || + (nn == 0 && g_hash_table_lookup (bg, n))) { + g_warning ("nn: %d lookup: %p\n", + nn, g_hash_table_lookup (bg, n)); + *ok = FALSE; + } +} + +/** + * gts_graph_bisection_check: + * @bg: a #GtsGraphBisection. + * + * Checks that the boundary of @bg is correctly defined (used for + * debugging purposes). + * + * Returns: %TRUE if @bg is ok, %FALSE otherwise. + */ +gboolean gts_graph_bisection_check (GtsGraphBisection * bg) +{ + gboolean ok = TRUE; + guint nb; + gpointer data[4]; + + g_return_val_if_fail (bg != NULL, FALSE); + + nb = 0; + data[0] = bg->bg1; + data[1] = bg->g2; + data[2] = &ok; + data[3] = &nb; + gts_container_foreach (GTS_CONTAINER (bg->g1), (GtsFunc) check_bg, data); + g_return_val_if_fail (g_hash_table_size (bg->bg1) == nb, FALSE); + + nb = 0; + data[0] = bg->bg2; + data[1] = bg->g1; + gts_container_foreach (GTS_CONTAINER (bg->g2), (GtsFunc) check_bg, data); + g_return_val_if_fail (g_hash_table_size (bg->bg2) == nb, FALSE); + + return ok; +} + +/** + * gts_graph_ggg_bisection: + * @g: a #GtsGraph. + * @ntry: the number of randomly selected initial seeds. + * + * An implementation of the "Greedy Graph Growing" algorithm of + * Karypis and Kumar (1997). + * + * @ntry randomly chosen seeds are used and the best partition is retained. + * + * Returns: a new #GtsGraphBisection of @g. + */ +GtsGraphBisection * gts_graph_ggg_bisection (GtsGraph * g, guint ntry) +{ + gfloat size, bestcost = G_MAXFLOAT, smin; + GtsGraph * bestg1 = NULL, * bestg2 = NULL; + gboolean balanced = FALSE; + GtsEHeap * degree_heap; + GtsGNode * seed; + GtsGraphBisection * bg; + + g_return_val_if_fail (g != NULL, NULL); + + bg = g_malloc (sizeof (GtsGraphBisection)); + bg->g = g; + + size = gts_graph_weight (g)/2.; + smin = 0.9*size; + + degree_heap = gts_eheap_new ((GtsKeyFunc) degree_cost, g); + gts_eheap_freeze (degree_heap); + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) add_seed, degree_heap); + gts_eheap_thaw (degree_heap); + + while (ntry && ((seed = gts_eheap_remove_top (degree_heap, NULL)))) { + GtsGraph * g1, * g2; + GtsGNode * n; + gdouble cost; + gpointer data[2]; + GtsEHeap * heap; + + g1 = gts_graph_new (GTS_GRAPH_CLASS (GTS_OBJECT (g)->klass), + g->node_class, g->edge_class); + g2 = gts_graph_new (GTS_GRAPH_CLASS (GTS_OBJECT (g)->klass), + g->node_class, g->edge_class); + + data[0] = g; + data[1] = g1; + heap = gts_eheap_new ((GtsKeyFunc) node_cost, data); + + gts_container_add (GTS_CONTAINER (g1), GTS_CONTAINEE (seed)); + GTS_OBJECT (seed)->reserved = seed; + gts_gnode_foreach_neighbor (seed, g, (GtsFunc) add_neighbor, heap); + + while ((n = gts_eheap_remove_top (heap, &cost))) + if (gts_graph_weight (g1) + gts_gnode_weight (n) <= size) { + gts_container_add (GTS_CONTAINER (g1), GTS_CONTAINEE (n)); + GTS_OBJECT (n)->reserved = n; + gts_gnode_foreach_neighbor (n, g, (GtsFunc) add_neighbor, heap); + } + else + GTS_OBJECT (n)->reserved = NULL; + gts_eheap_destroy (heap); + + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) add_unused, g2); + + cost = gts_graph_edges_cut_weight (g1); + if (!bestg1 || + (!balanced && gts_graph_weight (g1) >= smin) || + (cost < bestcost && gts_graph_weight (g1) >= smin)) { + if (bestg1) + bestcost = cost; + if (bestg1) + gts_object_destroy (GTS_OBJECT (bestg1)); + if (bestg2) + gts_object_destroy (GTS_OBJECT (bestg2)); + bestg1 = g1; + bestg2 = g2; + if (gts_graph_weight (g1) >= smin) + balanced = TRUE; + } + else { + gts_object_destroy (GTS_OBJECT (g1)); + gts_object_destroy (GTS_OBJECT (g2)); + } + + ntry--; + } + gts_eheap_destroy (degree_heap); + +#ifdef DEBUG + fprintf (stderr, "bestcost: %5g g1: %5g|%5d g2: %5g|%5d\n", + bestcost, + gts_graph_weight (bestg1), + gts_container_size (GTS_CONTAINER (bestg1)), + gts_graph_weight (bestg2), + gts_container_size (GTS_CONTAINER (bestg2))); +#endif + + g_assert (bestg1 != NULL); + bg->g1 = bestg1; + g_assert (bestg2 != NULL); + bg->g2 = bestg2; + + /* boundary nodes */ + bg->bg1 = g_hash_table_new (NULL, NULL); + gts_container_foreach (GTS_CONTAINER (bg->g1), (GtsFunc) boundary_node1, bg); + bg->bg2 = g_hash_table_new (NULL, NULL); + gts_container_foreach (GTS_CONTAINER (bg->g2), (GtsFunc) boundary_node2, bg); + + return bg; +} + +/** + * gts_graph_bfgg_bisection: + * @g: a #GtsGraph. + * @ntry: the number of randomly selected initial seeds. + * + * An implementation of a "Breadth-First Graph Growing" algorithm. + * + * @ntry randomly chosen seeds are used and the best partition is retained. + * + * Returns: a new #GtsGraphBisection of @g. + */ +GtsGraphBisection * gts_graph_bfgg_bisection (GtsGraph * g, guint ntry) +{ + gfloat size, bestcost = G_MAXFLOAT, smin; + GtsGraph * bestg1 = NULL, * bestg2 = NULL; + GtsEHeap * degree_heap; + GtsGNode * seed; + GtsGraphBisection * bg; + + g_return_val_if_fail (g != NULL, NULL); + + bg = g_malloc (sizeof (GtsGraphBisection)); + bg->g = g; + + size = gts_graph_weight (g)/2.; + smin = 0.9*size; + + degree_heap = gts_eheap_new ((GtsKeyFunc) degree_cost, g); + gts_eheap_freeze (degree_heap); + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) add_seed, degree_heap); + gts_eheap_thaw (degree_heap); + + while (ntry && ((seed = gts_eheap_remove_top (degree_heap, NULL)))) { + GtsGraph * g1, * g2; + GtsGNode * n; + gdouble cost; + GtsGraphTraverse * t = gts_graph_traverse_new (g, seed, + GTS_BREADTH_FIRST, TRUE); + + g1 = gts_graph_new (GTS_GRAPH_CLASS (GTS_OBJECT (g)->klass), + g->node_class, g->edge_class); + g2 = gts_graph_new (GTS_GRAPH_CLASS (GTS_OBJECT (g)->klass), + g->node_class, g->edge_class); + + while ((n = gts_graph_traverse_next (t))) + if (gts_graph_weight (g1) + gts_gnode_weight (n) <= size) { + gts_container_add (GTS_CONTAINER (g1), GTS_CONTAINEE (n)); + GTS_OBJECT (n)->reserved = n; + } + gts_graph_traverse_destroy (t); + + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) add_unused, g2); + + cost = gts_graph_edges_cut_weight (g1); + if (!bestg1 || (cost < bestcost && gts_graph_weight (g1) >= smin)) { + if (bestg1) + bestcost = cost; + if (bestg1) + gts_object_destroy (GTS_OBJECT (bestg1)); + if (bestg2) + gts_object_destroy (GTS_OBJECT (bestg2)); + bestg1 = g1; + bestg2 = g2; + } + else { + gts_object_destroy (GTS_OBJECT (g1)); + gts_object_destroy (GTS_OBJECT (g2)); + } + + ntry--; + } + gts_eheap_destroy (degree_heap); + +#ifdef DEBUG + fprintf (stderr, "bestcost: %5g g1: %5g|%5d g2: %5g|%5d\n", + bestcost, + gts_graph_weight (bestg1), + gts_container_size (GTS_CONTAINER (bestg1)), + gts_graph_weight (bestg2), + gts_container_size (GTS_CONTAINER (bestg2))); +#endif + + bg->g1 = bestg1; + bg->g2 = bestg2; + + /* boundary nodes */ + bg->bg1 = g_hash_table_new (NULL, NULL); + gts_container_foreach (GTS_CONTAINER (bg->g1), (GtsFunc) boundary_node1, bg); + bg->bg2 = g_hash_table_new (NULL, NULL); + gts_container_foreach (GTS_CONTAINER (bg->g2), (GtsFunc) boundary_node2, bg); + + return bg; +} + +static gdouble node_move_cost1 (GtsGNode * n, GtsGraphBisection * bg) +{ + return gts_gnode_move_cost (n, bg->g1, bg->g2); +} + +static gdouble node_move_cost2 (GtsGNode * n, GtsGraphBisection * bg) +{ + return gts_gnode_move_cost (n, bg->g2, bg->g1); +} + +static void build_heap (GtsGNode * n, GtsEHeap * heap) +{ + GTS_OBJECT (n)->reserved = gts_eheap_insert (heap, n); +} + +/** + * gts_graph_bisection_kl_refine: + * @bg: a #GtsGraphBisection. + * @mmax: the maximum number of unsuccessful successive moves. + * + * An implementation of the simplified Kernighan-Lin algorithm for + * graph bisection refinement as described in Karypis and Kumar + * (1997). + * + * The algorithm stops if @mmax consecutive modes do not lead to a + * decrease in the number of edges cut. This last @mmax moves are + * undone. + * + * Returns: the decrease in the weight of the edges cut by the bisection. + */ +gdouble gts_graph_bisection_kl_refine (GtsGraphBisection * bg, + guint mmax) +{ + GtsEHeap * h1, * h2; + GtsGNode * n; + guint nm = 0, i; + GtsGNode ** moves; + gdouble bestcost = 0., totalcost = 0., best_balance; + + g_return_val_if_fail (bg != NULL, 0.); + g_return_val_if_fail (mmax > 0, 0.); + + h1 = gts_eheap_new ((GtsKeyFunc) node_move_cost1, bg); + gts_eheap_freeze (h1); + gts_container_foreach (GTS_CONTAINER (bg->g1), (GtsFunc) build_heap, h1); + gts_eheap_thaw (h1); + + h2 = gts_eheap_new ((GtsKeyFunc) node_move_cost2, bg); + gts_eheap_freeze (h2); + gts_container_foreach (GTS_CONTAINER (bg->g2), (GtsFunc) build_heap, h2); + gts_eheap_thaw (h2); + + moves = g_malloc (sizeof (GtsGNode *)*mmax); + best_balance = fabs (gts_graph_weight (bg->g1) - gts_graph_weight (bg->g2)); + + do { + GtsGraph * g1, * g2; + gdouble cost; + + if (gts_graph_weight (bg->g1) > gts_graph_weight (bg->g2)) { + n = gts_eheap_remove_top (h1, &cost); + g1 = bg->g1; + g2 = bg->g2; + } + else { + n = gts_eheap_remove_top (h2, &cost); + g1 = bg->g2; + g2 = bg->g1; + } + if (n) { + GSList * i; + + GTS_OBJECT (n)->reserved = NULL; + gts_container_add (GTS_CONTAINER (g2), GTS_CONTAINEE (n)); + gts_container_remove (GTS_CONTAINER (g1), GTS_CONTAINEE (n)); + + totalcost += cost; + if (totalcost < bestcost) { + bestcost = totalcost; + nm = 0; + } + else if (totalcost == bestcost) { + gdouble balance = fabs (gts_graph_weight (g1) - gts_graph_weight (g2)); + + if (balance < best_balance) { + best_balance = balance; + nm = 0; + } + } + else + moves[nm++] = n; + + i = GTS_SLIST_CONTAINER (n)->items; + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (GTS_OBJECT (n1)->reserved && + gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (bg->g))) { + GtsEHeap * h = + gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (bg->g1)) ? h1 : h2; + gts_eheap_remove (h, GTS_OBJECT (n1)->reserved); + GTS_OBJECT (n1)->reserved = gts_eheap_insert (h, n1); + } + i = i->next; + } + } + } while (n && nm < mmax); + + gts_eheap_foreach (h1, (GFunc) gts_object_reset_reserved, NULL); + gts_eheap_foreach (h2, (GFunc) gts_object_reset_reserved, NULL); + gts_eheap_destroy (h1); + gts_eheap_destroy (h2); + + /* undo last nm moves */ + for (i = 0; i < nm; i++) { + GtsGNode * n = moves[i]; + GtsGraph * g1 = + gts_containee_is_contained (GTS_CONTAINEE (n), + GTS_CONTAINER (bg->g1)) ? bg->g1 : bg->g2; + GtsGraph * g2 = g1 == bg->g1 ? bg->g2 : bg->g1; + + gts_container_add (GTS_CONTAINER (g2), GTS_CONTAINEE (n)); + gts_container_remove (GTS_CONTAINER (g1), GTS_CONTAINEE (n)); + } + g_free (moves); + + return bestcost; +} + +static void build_bheap (GtsGNode * n, GtsGNode * n1, GtsEHeap * heap) +{ + GTS_OBJECT (n)->reserved = gts_eheap_insert (heap, n); +} + +static void update_neighbors (GtsGNode * n, GtsGraphBisection * bg, + GtsEHeap * h1, GtsEHeap * h2) +{ + GSList * i; + + i = GTS_SLIST_CONTAINER (n)->items; + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (bg->g))) { + GtsEHeap * h; + GtsGraph /* * g1,*/ * g2; + GHashTable * bg1; + + if (gts_containee_is_contained (GTS_CONTAINEE (n1), + GTS_CONTAINER (bg->g1))) { + h = h1; + //g1 = bg->g1; + g2 = bg->g2; + bg1 = bg->bg1; + } + else { + h = h2; + //g1 = bg->g2; + g2 = bg->g1; + bg1 = bg->bg2; + } + g_hash_table_remove (bg1, n1); + if (h && GTS_OBJECT (n1)->reserved && GTS_OBJECT (n1)->reserved != n1) { + gts_eheap_remove (h, GTS_OBJECT (n1)->reserved); + GTS_OBJECT (n1)->reserved = NULL; + } + if (gts_gnode_degree (n1, g2)) { + g_hash_table_insert (bg1, n1, n1); + if (h && GTS_OBJECT (n1)->reserved != n1) + GTS_OBJECT (n1)->reserved = gts_eheap_insert (h, n1); + } + } + i = i->next; + } +} + +/** + * gts_graph_bisection_bkl_refine: + * @bg: a #GtsGraphBisection. + * @mmax: the maximum number of unsuccessful successive moves. + * @imbalance: the maximum relative imbalance allowed between the + * weights of both halves of the partition. + * + * An implementation of the simplified boundary Kernighan-Lin + * algorithm for graph bisection refinement as described in Karypis + * and Kumar (1997). + * + * The algorithm stops if @mmax consecutive modes do not lead to a + * decrease in the number of edges cut. This last @mmax moves are + * undone. + * + * Returns: the decrease in the weight of the edges cut by the bisection. + */ +gdouble gts_graph_bisection_bkl_refine (GtsGraphBisection * bg, + guint mmax, + gfloat imbalance) +{ + GtsEHeap * h1, * h2; + GtsGNode * n; + guint nm = 0, i; + GtsGNode ** moves; + gdouble bestcost = 0., totalcost = 0., best_balance; + gboolean balanced = FALSE; + + g_return_val_if_fail (bg != NULL, 0.); + g_return_val_if_fail (mmax > 0, 0.); + g_return_val_if_fail (imbalance >= 0. && imbalance <= 1., 0.); + + h1 = gts_eheap_new ((GtsKeyFunc) node_move_cost1, bg); + gts_eheap_freeze (h1); + g_hash_table_foreach (bg->bg1, (GHFunc) build_bheap, h1); + gts_eheap_thaw (h1); + + h2 = gts_eheap_new ((GtsKeyFunc) node_move_cost2, bg); + gts_eheap_freeze (h2); + g_hash_table_foreach (bg->bg2, (GHFunc) build_bheap, h2); + gts_eheap_thaw (h2); + + moves = g_malloc (sizeof (GtsGNode *)*mmax); + imbalance *= gts_graph_weight (bg->g); + best_balance = fabs (gts_graph_weight (bg->g1) - gts_graph_weight (bg->g2)); + if (best_balance <= imbalance) + balanced = TRUE; + + do { + GtsGraph * g1, * g2; + GHashTable * bg1, * bg2; + gdouble cost; + + if (gts_graph_weight (bg->g1) > gts_graph_weight (bg->g2)) { + n = gts_eheap_remove_top (h1, &cost); + g1 = bg->g1; + g2 = bg->g2; + bg1 = bg->bg1; + bg2 = bg->bg2; + } + else { + n = gts_eheap_remove_top (h2, &cost); + g1 = bg->g2; + g2 = bg->g1; + bg1 = bg->bg2; + bg2 = bg->bg1; + } + if (n) { + gdouble balance; + + GTS_OBJECT (n)->reserved = n; + gts_container_add (GTS_CONTAINER (g2), GTS_CONTAINEE (n)); + gts_container_remove (GTS_CONTAINER (g1), GTS_CONTAINEE (n)); + g_hash_table_remove (bg1, n); + if (gts_gnode_degree (n, g1)) + g_hash_table_insert (bg2, n, n); + + update_neighbors (n, bg, h1, h2); + + totalcost += cost; + balance = fabs (gts_graph_weight (g1) - gts_graph_weight (g2)); + + if (!balanced && balance <= imbalance) { + bestcost = totalcost; + best_balance = balance; + balanced = TRUE; + nm = 0; + } + else if (totalcost < bestcost && + (balance < best_balance || balance <= imbalance)) { + bestcost = totalcost; + best_balance = balance; + nm = 0; + } + else if (totalcost == bestcost && balance < best_balance) { + best_balance = balance; + nm = 0; + } + else + moves[nm++] = n; + } + } while (n && nm < mmax); + + gts_container_foreach (GTS_CONTAINER (bg->g), + (GtsFunc) gts_object_reset_reserved, NULL); + gts_eheap_destroy (h1); + gts_eheap_destroy (h2); + + /* undo last nm moves */ + for (i = 0; i < nm; i++) { + GtsGNode * n = moves[i]; + GtsGraph * g1, * g2; + GHashTable * bg1, * bg2; + + if (gts_containee_is_contained (GTS_CONTAINEE (n), + GTS_CONTAINER (bg->g1))) { + g1 = bg->g1; + g2 = bg->g2; + bg1 = bg->bg1; + bg2 = bg->bg2; + } + else { + g1 = bg->g2; + g2 = bg->g1; + bg1 = bg->bg2; + bg2 = bg->bg1; + } + + gts_container_add (GTS_CONTAINER (g2), GTS_CONTAINEE (n)); + gts_container_remove (GTS_CONTAINER (g1), GTS_CONTAINEE (n)); + g_hash_table_remove (bg1, n); + if (gts_gnode_degree (n, g1)) + g_hash_table_insert (bg2, n, n); + + update_neighbors (n, bg, NULL, NULL); + } + g_free (moves); + + return bestcost; +} + +/* Multilevel partitioning */ + +static void bisection_children (GtsGNodeSplit * ns, GtsGraphBisection * bg) +{ + GtsGraph * g, * g1; + GHashTable * bbg; + GtsGNode * n1 = GTS_GNODE_SPLIT_N1 (ns); + GtsGNode * n2 = GTS_GNODE_SPLIT_N2 (ns); + + if (gts_containee_is_contained (GTS_CONTAINEE (ns->n), + GTS_CONTAINER (bg->g1))) { + g = bg->g1; + g1 = bg->g2; + bbg = bg->bg1; + } + else { + g = bg->g2; + g1 = bg->g1; + bbg = bg->bg2; + } + + gts_allow_floating_gnodes = TRUE; + gts_container_remove (GTS_CONTAINER (g), GTS_CONTAINEE (ns->n)); + gts_allow_floating_gnodes = FALSE; + gts_container_add (GTS_CONTAINER (g), GTS_CONTAINEE (n1)); + gts_container_add (GTS_CONTAINER (g), GTS_CONTAINEE (n2)); + + if (g_hash_table_lookup (bbg, ns->n)) { + g_hash_table_remove (bbg, ns->n); + if (gts_gnode_degree (n1, g1) > 0) + g_hash_table_insert (bbg, n1, n1); + if (gts_gnode_degree (n2, g1) > 0) + g_hash_table_insert (bbg, n2, n2); + } +} + +/** + * gts_graph_bisection_new: + * @wg: a #GtsWGraph. + * @ntry: the number of tries for the graph growing algorithm. + * @mmax: the number of unsucessful moves for the refinement algorithm. + * @nmin: the minimum number of nodes of the coarsest graph. + * @imbalance: the maximum relative imbalance allowed between the + * weights of both halves of the partition. + * + * An implementation of a multilevel bisection algorithm as presented + * in Karypis and Kumar (1997). A multilevel hierarchy of graphs is + * created using the #GtsPGraph object. The bisection of the coarsest + * graph is created using the gts_graph_ggg_bisection() function. The + * graph is then uncoarsened using gts_pgraph_down() and at each level + * the bisection is refined using gts_graph_bisection_bkl_refine(). + * + * Returns: a new #GtsGraphBisection of @wg. + */ +GtsGraphBisection * gts_graph_bisection_new (GtsWGraph * wg, + guint ntry, + guint mmax, + guint nmin, + gfloat imbalance) +{ + GtsGraph * g; + GtsPGraph * pg; + GtsGraphBisection * bg; + gdouble cost; + + g_return_val_if_fail (wg != NULL, NULL); + + g = GTS_GRAPH (wg); + pg = gts_pgraph_new (gts_pgraph_class (), g, + gts_gnode_split_class (), + gts_wgnode_class (), + gts_wgedge_class (), + nmin); + + bg = gts_graph_ggg_bisection (g, ntry); +#ifdef DEBUG + fprintf (stderr, "before size: %5d weight: %5g cuts: %5d cweight: %5g\n", + gts_container_size (GTS_CONTAINER (bg->g1)), + gts_graph_weight (bg->g1), + gts_graph_edges_cut (bg->g1), + gts_graph_edges_cut_weight (bg->g1)); + g_assert (gts_graph_bisection_check (bg)); +#endif + while ((cost = gts_graph_bisection_bkl_refine (bg, mmax, imbalance))) { +#ifdef DEBUG + fprintf (stderr, " cost: %g\n", cost); + g_assert (gts_graph_bisection_check (bg)); +#endif + } +#ifdef DEBUG + fprintf (stderr, "after size: %5d weight: %5g cuts: %5d cweight: %5g\n", + gts_container_size (GTS_CONTAINER (bg->g1)), + gts_graph_weight (bg->g1), + gts_graph_edges_cut (bg->g1), + gts_graph_edges_cut_weight (bg->g1)); +#endif + while (gts_pgraph_down (pg, (GtsFunc) bisection_children, bg)) { +#ifdef DEBUG + fprintf (stderr, "before size: %5d weight: %5g cuts: %5d cweight: %5g\n", + gts_container_size (GTS_CONTAINER (bg->g1)), + gts_graph_weight (bg->g1), + gts_graph_edges_cut (bg->g1), + gts_graph_edges_cut_weight (bg->g1)); +#endif + while ((cost = gts_graph_bisection_bkl_refine (bg, mmax, imbalance))) { +#ifdef DEBUG + fprintf (stderr, " cost: %g\n", cost); + g_assert (gts_graph_bisection_check (bg)); +#endif + } +#ifdef DEBUG + fprintf (stderr, "after size: %5d weight: %5g cuts: %5d cweight: %5g\n", + gts_container_size (GTS_CONTAINER (bg->g1)), + gts_graph_weight (bg->g1), + gts_graph_edges_cut (bg->g1), + gts_graph_edges_cut_weight (bg->g1)); +#endif + } + gts_object_destroy (GTS_OBJECT (pg)); + + return bg; +} + +/** + * gts_graph_bisection_destroy: + * @bg: a #GtsGraphBisection. + * @destroy_graphs: controls graph destruction. + * + * Frees all the memory allocated for @bg. If @destroy_graphs is %TRUE + * the graphs created by @bg are destroyed. + */ +void gts_graph_bisection_destroy (GtsGraphBisection * bg, + gboolean destroy_graphs) +{ + g_return_if_fail (bg != NULL); + + g_hash_table_destroy (bg->bg1); + g_hash_table_destroy (bg->bg2); + + if (destroy_graphs) { + gts_object_destroy (GTS_OBJECT (bg->g1)); + gts_object_destroy (GTS_OBJECT (bg->g2)); + } + + g_free (bg); +} + +static void recursive_bisection (GtsWGraph * wg, + guint np, + guint ntry, + guint mmax, + guint nmin, + gfloat imbalance, + GSList ** list) +{ + if (np == 0) + *list = g_slist_prepend (*list, wg); + else { + GtsGraphBisection * bg = + gts_graph_bisection_new (wg, ntry, mmax, nmin, imbalance); + GtsGraph * g1 = bg->g1; + GtsGraph * g2 = bg->g2; + + gts_object_destroy (GTS_OBJECT (wg)); + gts_graph_bisection_destroy (bg, FALSE); + recursive_bisection (GTS_WGRAPH (g1), np - 1, ntry, mmax, nmin, imbalance, + list); + recursive_bisection (GTS_WGRAPH (g2), np - 1, ntry, mmax, nmin, imbalance, + list); + } +} + +/** + * gts_graph_recursive_bisection: + * @wg: a #GtsWGraph. + * @n: the number of bisection levels. + * @ntry: the number of tries for the graph growing algorithm. + * @mmax: the number of unsucessful moves for the refinement algorithm. + * @nmin: the minimum number of nodes of the coarsest graph. + * @imbalance: the maximum relative imbalance allowed between the + * weights of both halves of the partition. + * + * Calls gts_graph_bisection_new() recursively in order to obtain a + * 2^@n partition of @wg. + * + * Returns: a list of 2^@n new #GtsGraph representing the partition. + */ +GSList * gts_graph_recursive_bisection (GtsWGraph * wg, + guint n, + guint ntry, + guint mmax, + guint nmin, + gfloat imbalance) +{ + GtsGraphBisection * bg; + GtsGraph * g1, * g2; + GSList * list = NULL; + + g_return_val_if_fail (wg != NULL, NULL); + g_return_val_if_fail (n > 0, NULL); + + bg = gts_graph_bisection_new (wg, ntry, mmax, nmin, imbalance); + g1 = bg->g1; + g2 = bg->g2; + gts_graph_bisection_destroy (bg, FALSE); + recursive_bisection (GTS_WGRAPH (g1), n - 1, ntry, mmax, nmin, imbalance, + &list); + recursive_bisection (GTS_WGRAPH (g2), n - 1, ntry, mmax, nmin, imbalance, + &list); + + return list; +} Index: tags/1.0.5/gts/pgraph.c =================================================================== --- tags/1.0.5/gts/pgraph.c (nonexistent) +++ tags/1.0.5/gts/pgraph.c (revision 953) @@ -0,0 +1,584 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +/* GtsGNodeSplit */ + +static void gnode_split_destroy (GtsObject * object) +{ + GtsGNodeSplit * ns = GTS_GNODE_SPLIT (object); + + if (gts_container_size (GTS_CONTAINER (ns->n)) == 0) { + g_assert (GTS_SLIST_CONTAINEE (ns->n)->containers == NULL); + gts_object_destroy (GTS_OBJECT (ns->n)); + } + else { + /* GtsGNode * n1 = GTS_GNODE_SPLIT_N1 (ns); */ + /* GtsGNode * n2 = GTS_GNODE_SPLIT_N2 (ns); */ + + g_warning ("Memory deallocation for GtsGNodeSplit not fully implemented yet: memory leak!"); + } + + (* GTS_OBJECT_CLASS (gts_gnode_split_class ())->parent_class->destroy) + (object); +} + +static void gnode_split_class_init (GtsGNodeSplitClass * klass) +{ + GTS_OBJECT_CLASS (klass)->destroy = gnode_split_destroy; +} + +static void gnode_split_init (GtsGNodeSplit * ns) +{ + ns->n = NULL; + ns->n1 = ns->n2 = NULL; +} + +/** + * gts_gnode_split_class: + * + * Returns: the #GtsGNodeSplitClass. + */ +GtsGNodeSplitClass * gts_gnode_split_class (void) +{ + static GtsGNodeSplitClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo gnode_split_info = { + "GtsGNodeSplit", + sizeof (GtsGNodeSplit), + sizeof (GtsGNodeSplitClass), + (GtsObjectClassInitFunc) gnode_split_class_init, + (GtsObjectInitFunc) gnode_split_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &gnode_split_info); + } + + return klass; +} + +/** + * gts_gnode_split_new: + * @klass: a #GtsGNodeSplitClass. + * @n: a #GtsGNode. + * @n1: a #GtsGNodeSplit or #GtsGNode. + * @n2: a #GtsGNodeSplit or #GtsGNode. + * + * Creates a new #GtsGNodeSplit which would collapse @n1 and @n2 into + * @n. The collapse itself is not performed. + * + * Returns: the new #GtsGNodeSplit. + */ +GtsGNodeSplit * gts_gnode_split_new (GtsGNodeSplitClass * klass, + GtsGNode * n, + GtsObject * n1, + GtsObject * n2) +{ + GtsGNodeSplit * ns; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (n != NULL, NULL); + g_return_val_if_fail (GTS_IS_GNODE_SPLIT (n1) || GTS_IS_GNODE (n1), NULL); + g_return_val_if_fail (GTS_IS_GNODE_SPLIT (n2) || GTS_IS_GNODE (n2), NULL); + + ns = GTS_GNODE_SPLIT (gts_object_new (GTS_OBJECT_CLASS (klass))); + ns->n = n; + ns->n1 = n1; + ns->n2 = n2; + + return ns; +} + +static void connect_edge (GtsGEdge * e, gpointer * data) +{ + GtsGNode * n = data[0]; + GtsGNode * n1 = data[1]; + GtsGNode * n2 = data[2]; + + if (GTS_OBJECT (e)->reserved || /* edge is disconnected */ + gts_gedge_connects (e, n1, n2)) + return; + if (e->n1 == n1 || e->n1 == n2) + e->n1 = n; + else if (e->n2 == n1 || e->n2 == n2) + e->n2 = n; + else + g_assert_not_reached (); + gts_container_add (GTS_CONTAINER (n), GTS_CONTAINEE (e)); +} + +/** + * gts_gnode_split_collapse: + * @ns: a #GtsGNodeSplit. + * @g: a #GtsGraph. + * @klass: a #GtsWGEdgeClass. + * + * Collapses the node split @ns. Any new edge created during the + * process will be of class @klass. + */ +void gts_gnode_split_collapse (GtsGNodeSplit * ns, + GtsGraph * g, + GtsWGEdgeClass * klass) +{ + GtsGNode * n1, * n2; + GSList * i; + gpointer data[3]; + + g_return_if_fail (ns != NULL); + g_return_if_fail (g != NULL); + g_return_if_fail (gts_container_size (GTS_CONTAINER (ns->n)) == 0); + + n1 = GTS_GNODE_SPLIT_N1 (ns); + n2 = GTS_GNODE_SPLIT_N2 (ns); + + /* look for triangles */ + i = GTS_SLIST_CONTAINER (n1)->items; + while (i) { + GtsGEdge * e13 = i->data; + GtsGNode * n3 = GTS_GNODE_NEIGHBOR (n1, e13); + if (n3 != n2) { + GSList * j = GTS_SLIST_CONTAINER (n3)->items; + while (j) { + GtsGEdge * e32 = j->data; + GSList * next = j->next; + GtsGNode * n4 = GTS_GNODE_NEIGHBOR (n3, e32); + if (n4 == n2) { /* found triangle n1 (e13) n3 (e32) n2 */ + gts_wgedge_new (klass, ns->n, n3, + gts_gedge_weight (e13) + gts_gedge_weight (e32)); + GTS_OBJECT (e13)->reserved = n3; + GTS_OBJECT (e32)->reserved = n3; + GTS_SLIST_CONTAINER (n3)->items = + g_slist_remove (GTS_SLIST_CONTAINER (n3)->items, e32); + } + j = next; + } + if (GTS_OBJECT (e13)->reserved == n3) + GTS_SLIST_CONTAINER (n3)->items = + g_slist_remove (GTS_SLIST_CONTAINER (n3)->items, e13); + } + i = i->next; + } + + /* connect edges to new node */ + data[0] = ns->n; + data[1] = n1; + data[2] = n2; + gts_container_foreach (GTS_CONTAINER (n1), (GtsFunc) connect_edge, data); + gts_container_foreach (GTS_CONTAINER (n2), (GtsFunc) connect_edge, data); + + gts_allow_floating_gnodes = TRUE; + gts_container_remove (GTS_CONTAINER (g), GTS_CONTAINEE (n1)); + gts_container_remove (GTS_CONTAINER (g), GTS_CONTAINEE (n2)); + gts_allow_floating_gnodes = FALSE; + gts_container_add (GTS_CONTAINER (g), GTS_CONTAINEE (ns->n)); +} + +static void restore_edge (GtsGEdge * e, gpointer * data) +{ + GtsGNode * n = data[0]; + GtsGNode * n1 = data[1]; + GtsGNode * n2 = data[2]; + GtsGNode * n3 = GTS_OBJECT (e)->reserved; + + if (n3) { /* e is a disconnected edge */ + GTS_OBJECT (e)->reserved = NULL; + gts_container_add (GTS_CONTAINER (n3), GTS_CONTAINEE (e)); + return; + } + + if (gts_gedge_connects (e, n1, n2)) + return; + + if (e->n1 == n) + e->n1 = n1; + else if (e->n2 == n) + e->n2 = n1; + else + g_assert_not_reached (); + GTS_SLIST_CONTAINER (n)->items = + g_slist_remove (GTS_SLIST_CONTAINER (n)->items, e); +} + +/** + * gts_gnode_split_expand: + * @ns: a #GtsGNodeSplit. + * @g: a #GtsGraph. + * + * Expands the node split ns adding the new nodes to @g. + */ +void gts_gnode_split_expand (GtsGNodeSplit * ns, + GtsGraph * g) +{ + GtsGNode * n1, * n2; + gpointer data[3]; + GSList * i; + + g_return_if_fail (ns != NULL); + g_return_if_fail (g != NULL); + g_return_if_fail (gts_containee_is_contained (GTS_CONTAINEE (ns->n), + GTS_CONTAINER (g))); + + n1 = GTS_GNODE_SPLIT_N1 (ns); + n2 = GTS_GNODE_SPLIT_N2 (ns); + + data[0] = ns->n; + data[1] = n1; + data[2] = n2; + gts_container_foreach (GTS_CONTAINER (n1), (GtsFunc) restore_edge, data); + data[1] = n2; + data[2] = n1; + gts_container_foreach (GTS_CONTAINER (n2), (GtsFunc) restore_edge, data); + + i = GTS_SLIST_CONTAINER (ns->n)->items; + while (i) { + GSList * next = i->next; + gts_container_remove (GTS_CONTAINER (ns->n), GTS_CONTAINEE (i->data)); + i = next; + } + g_assert (gts_container_size (GTS_CONTAINER (ns->n)) == 0); + + gts_allow_floating_gnodes = TRUE; + gts_container_remove (GTS_CONTAINER (g), GTS_CONTAINEE (ns->n)); + gts_allow_floating_gnodes = FALSE; + + gts_container_add (GTS_CONTAINER (g), GTS_CONTAINEE (n1)); + gts_container_add (GTS_CONTAINER (g), GTS_CONTAINEE (n2)); +} + +/* GtsPGraph */ + +static void pgraph_destroy (GtsObject * object) +{ + GtsPGraph * pg = GTS_PGRAPH (object); + guint i; + + for (i = 0; i < pg->split->len; i++) + gts_object_destroy (GTS_OBJECT (g_ptr_array_index (pg->split, i))); + g_ptr_array_free (pg->split, TRUE); + g_array_free (pg->levels, TRUE); + + (* GTS_OBJECT_CLASS (gts_pgraph_class ())->parent_class->destroy) (object); +} + +static void pgraph_class_init (GtsPGraphClass * klass) +{ + GTS_OBJECT_CLASS (klass)->destroy = pgraph_destroy; +} + +static void pgraph_init (GtsPGraph * pg) +{ + pg->g = NULL; + pg->split = g_ptr_array_new (); + pg->levels = g_array_new (FALSE, FALSE, sizeof (guint)); + pg->level = 0; + pg->split_class = gts_gnode_split_class (); + pg->edge_class = gts_wgedge_class (); + pg->pos = pg->min = 0; +} + +/** + * gts_pgraph_class: + * + * Returns: the #GtsPGraphClass. + */ +GtsPGraphClass * gts_pgraph_class (void) +{ + static GtsPGraphClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo pgraph_info = { + "GtsPGraph", + sizeof (GtsPGraph), + sizeof (GtsPGraphClass), + (GtsObjectClassInitFunc) pgraph_class_init, + (GtsObjectInitFunc) pgraph_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &pgraph_info); + } + + return klass; +} + +static void match_neighbor (GtsGNode * n, gpointer * data) +{ + if (!GTS_OBJECT (n)->reserved) { + GtsGraph * g = data[0]; + GSList ** list = data[1]; + GSList * i = GTS_SLIST_CONTAINER (n)->items; + gfloat wmax = - G_MAXFLOAT; + GtsGEdge * emax = NULL; + + while (i) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, i->data); + if (!GTS_OBJECT (n1)->reserved && + gts_gedge_weight (i->data) > wmax && + gts_containee_is_contained (GTS_CONTAINEE (n1), GTS_CONTAINER (g))) { + emax = i->data; + wmax = gts_gedge_weight (emax); + } + i = i->next; + } + if (emax) { + GtsGNode * n1 = GTS_GNODE_NEIGHBOR (n, emax); + + GTS_OBJECT (n1)->reserved = n; + GTS_OBJECT (n)->reserved = n1; + *list = g_slist_prepend (*list, emax); + } + } +} + +static GSList * maximal_matching (GtsGraph * g) +{ + GSList * list = NULL; + gpointer data[2]; + + data[0] = g; + data[1] = &list; + gts_container_foreach (GTS_CONTAINER (g), (GtsFunc) match_neighbor, data); + gts_container_foreach (GTS_CONTAINER (g), + (GtsFunc) gts_object_reset_reserved, + NULL); + + return list; +} + +/** + * gts_pgraph_new: + * @klass: a #GtsPGraphClass. + * @g: a #GtsGraph. + * @split_class: a #GtsGNodeSplitClass. + * @node_class: a #GtsWGNodeClass. + * @edge_class: a #GtsWGEdgeClass. + * @min: the minimum number of nodes. + * + * Creates a new multilevel approximation of graph @g. At each level a + * maximal matching is created using the Heavy Edge Matching (HEM) + * technique of Karypis and Kumar (1997). The newly created nodes are + * of type @node_class and their weight is set to the sum of the + * weights of their children. The newly created edges are of type + * @edge_class and their weight is set to the sum of the weight of the + * collapsed edges. The last level is reached when the maximal + * matching obtained would lead to a graph with less than @min nodes. + * + * Returns: the new #GtsPGraph containing the multilevel + * representation of @g. + */ +GtsPGraph * gts_pgraph_new (GtsPGraphClass * klass, + GtsGraph * g, + GtsGNodeSplitClass * split_class, + GtsWGNodeClass * node_class, + GtsWGEdgeClass * edge_class, + guint min) +{ + GtsPGraph * pg; + GSList * matching; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (g != NULL, NULL); + g_return_val_if_fail (split_class != NULL, NULL); + g_return_val_if_fail (node_class != NULL, NULL); + g_return_val_if_fail (edge_class != NULL, NULL); + + pg = GTS_PGRAPH (gts_object_new (GTS_OBJECT_CLASS (klass))); + pg->g = g; + pg->split_class = split_class; + pg->edge_class = edge_class; + + while (gts_container_size (GTS_CONTAINER (g)) > min && + (matching = maximal_matching (g))) { + GSList * i = matching; + guint size = gts_container_size (GTS_CONTAINER (g)); + + g_array_append_val (pg->levels, size); + + while (i && gts_container_size (GTS_CONTAINER (g)) > min) { + GtsGEdge * e = i->data; + GtsGNode * n = GTS_GNODE (gts_wgnode_new (node_class, + gts_gnode_weight (e->n1) + + gts_gnode_weight (e->n2))); + GtsGNodeSplit * ns = gts_gnode_split_new (split_class, n, + GTS_OBJECT (e->n1), + GTS_OBJECT (e->n2)); + gts_gnode_split_collapse (ns, g, edge_class); + g_ptr_array_add (pg->split, ns); + i = i->next; + } + g_slist_free (matching); + } + + pg->pos = pg->split->len; + pg->min = gts_container_size (GTS_CONTAINER (g)); + pg->level = pg->levels->len; + + return pg; +} + +/** + * gts_pgraph_add_node: + * @pg: a #GtsPGraph. + * + * Adds one node to the multilevel graph @pg by expanding the next + * available #GtsGNodeSplit. + * + * Returns: the expanded #GtsGNodeSplit or #NULL if all the + * #GtsGNodeSplit have already been expanded. + */ +GtsGNodeSplit * gts_pgraph_add_node (GtsPGraph * pg) +{ + GtsGNodeSplit * ns; + + g_return_val_if_fail (pg != NULL, NULL); + + if (pg->pos == 0) + return NULL; + + ns = g_ptr_array_index (pg->split, --pg->pos); + gts_gnode_split_expand (ns, pg->g); + + return ns; +} + +/** + * gts_pgraph_remove_node: + * @pg: a #GtsPGraph. + * + * Removes one node from the multilevel graph @pg by collapsing the + * first available #GtsGNodeSplit. + * + * Returns: the collapsed #GtsGNodeSplit or %NULL if all the + * #GtsGNodeSplit have already been collapsed. + */ +GtsGNodeSplit * gts_pgraph_remove_node (GtsPGraph * pg) +{ + GtsGNodeSplit * ns; + + g_return_val_if_fail (pg != NULL, NULL); + + if (pg->pos == pg->split->len) + return NULL; + + ns = g_ptr_array_index (pg->split, pg->pos++); + gts_gnode_split_collapse (ns, pg->g, pg->edge_class); + + return ns; +} + +/** + * gts_pgraph_max_node_number: + * @pg: a #GtsPGraph. + * + * Returns: the maximum number of nodes of @pg i.e. the number of + * nodes if all the #GtsGNodeSplit were expanded. + */ +guint gts_pgraph_max_node_number (GtsPGraph * pg) +{ + g_return_val_if_fail (pg != NULL, 0); + + return pg->min + pg->split->len; +} + +/** + * gts_pgraph_min_node_number: + * @pg: a #GtsPGraph. + * + * Returns: the minimum number of nodes of @pg i.e. the number of + * nodes if all the #GtsGNodeSplit were collapsed. + */ +guint gts_pgraph_min_node_number (GtsPGraph * pg) +{ + g_return_val_if_fail (pg != NULL, 0); + + return pg->min; +} + +/** + * gts_pgraph_set_node_number: + * @pg: a #GtsPGraph. + * @n: a number of nodes. + * + * Performs the required number of collapses or expansions to set the + * number of nodes of @pg to @n. + */ +void gts_pgraph_set_node_number (GtsPGraph * pg, guint n) +{ + g_return_if_fail (pg != NULL); + + n = pg->min + pg->split->len - n; + while (pg->pos > n && gts_pgraph_add_node (pg)) + ; + while (pg->pos < n && gts_pgraph_remove_node (pg)) + ; +} + +/** + * gts_pgraph_get_node_number: + * @pg: a #GtsPGraph. + * + * Returns: the current number of nodes of @pg. + */ +guint gts_pgraph_get_node_number (GtsPGraph * pg) +{ + g_return_val_if_fail (pg != NULL, 0); + + return pg->min + pg->split->len - pg->pos; +} + +/** + * gts_pgraph_down: + * @pg: a #GtsPGraph. + * @func: a #GtsFunc or %NULL. + * @data: user data to pass to @func. + * + * Performs the required number of expansions to go from the current + * level to the level immediately below. + * + * If @func is not %NULL, it is called after each #GtsGNodeSplit has + * been expanded. + * + * Returns: %FALSE if it is not possible to go down one level, %TRUE + * otherwise. + */ +gboolean gts_pgraph_down (GtsPGraph * pg, + GtsFunc func, + gpointer data) +{ + guint size; + + g_return_val_if_fail (pg != NULL, FALSE); + + if (pg->level == 0) + return FALSE; + + size = g_array_index (pg->levels, guint, --(pg->level)); + while (gts_container_size (GTS_CONTAINER (pg->g)) < size) { + GtsGNodeSplit * ns = gts_pgraph_add_node (pg); + + g_assert (ns); + if (func) + (* func) (ns, data); + } + return TRUE; +} + Index: tags/1.0.5/gts/point.c =================================================================== --- tags/1.0.5/gts/point.c (nonexistent) +++ tags/1.0.5/gts/point.c (revision 953) @@ -0,0 +1,986 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "gts.h" +#include "gts-private.h" +#include "predicates.h" + +static void point_read (GtsObject ** o, GtsFile * f) +{ + GtsPoint * p = GTS_POINT (*o); + + if (GTS_POINT_CLASS ((*o)->klass)->binary) { + if (gts_file_read (f, &(p->x), sizeof (gdouble), 1) != 1) { + gts_file_error (f, "expecting a binary number (x coordinate)"); + return; + } + if (gts_file_read (f, &(p->y), sizeof (gdouble), 1) != 1) { + gts_file_error (f, "expecting a binary number (y coordinate)"); + return; + } + if (gts_file_read (f, &(p->z), sizeof (gdouble), 1) != 1) { + gts_file_error (f, "expecting a binary number (z coordinate)"); + return; + } + } + else { + if (f->type != GTS_INT && f->type != GTS_FLOAT) { + gts_file_error (f, "expecting a number (x coordinate)"); + return; + } + p->x = atof (f->token->str); + + gts_file_next_token (f); + if (f->type != GTS_INT && f->type != GTS_FLOAT) { + gts_file_error (f, "expecting a number (y coordinate)"); + return; + } + p->y = atof (f->token->str); + + gts_file_next_token (f); + if (f->type != GTS_INT && f->type != GTS_FLOAT) { + gts_file_error (f, "expecting a number (z coordinate)"); + return; + } + p->z = atof (f->token->str); + + gts_file_next_token (f); + } +} + +static void point_write (GtsObject * o, FILE * fptr) +{ + GtsPoint * p = GTS_POINT (o); + + if (GTS_POINT_CLASS ((o)->klass)->binary) { + fwrite (&(p->x), sizeof (gdouble), 1, fptr); + fwrite (&(p->y), sizeof (gdouble), 1, fptr); + fwrite (&(p->z), sizeof (gdouble), 1, fptr); + } + else + fprintf (fptr, "%.10g %.10g %.10g", p->x, p->y, p->z); +} + +static void point_class_init (GtsObjectClass * klass) +{ + klass->read = point_read; + klass->write = point_write; +} + +/** + * gts_point_class: + * + * Returns: the #GtsPointClass. + */ +GtsPointClass * gts_point_class (void) +{ + static GtsPointClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo point_info = { + "GtsPoint", + sizeof (GtsPoint), + sizeof (GtsPointClass), + (GtsObjectClassInitFunc) point_class_init, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), + &point_info); + } + + return klass; +} + +/** + * gts_point_new: + * @klass: a #GtsPointClass. + * @x: the x-coordinate. + * @y: the y-coordinate. + * @z: the z-coordinate. + * + * Returns: a new #GtsPoint. + */ +GtsPoint * gts_point_new (GtsPointClass * klass, + gdouble x, gdouble y, gdouble z) +{ + GtsPoint * p; + + p = GTS_POINT (gts_object_new (GTS_OBJECT_CLASS (klass))); + p->x = x; + p->y = y; + p->z = z; + + return p; +} + +/** + * gts_point_set: + * @p: a #GtsPoint. + * @x: the x-coordinate. + * @y: the y-coordinate. + * @z: the z-coordinate. + * + * Sets the coordinates of @p. + */ +void gts_point_set (GtsPoint * p, gdouble x, gdouble y, gdouble z) +{ + g_return_if_fail (p != NULL); + + p->x = x; + p->y = y; + p->z = z; +} + +/** + * gts_point_distance: + * @p1: a #GtsPoint. + * @p2: another #GtsPoint. + * + * Returns: the Euclidean distance between @p1 and @p2. + */ +gdouble gts_point_distance (GtsPoint * p1, GtsPoint * p2) +{ + g_return_val_if_fail (p1 != NULL && p2 != NULL, 0.0); + + return sqrt ((p1->x - p2->x)*(p1->x - p2->x) + + (p1->y - p2->y)*(p1->y - p2->y) + + (p1->z - p2->z)*(p1->z - p2->z)); +} + +/** + * gts_point_distance2: + * @p1: a #GtsPoint. + * @p2: another #GtsPoint. + * + * Returns: the square of the Euclidean distance between @p1 and @p2. + */ +gdouble gts_point_distance2 (GtsPoint * p1, GtsPoint * p2) +{ + g_return_val_if_fail (p1 != NULL && p2 != NULL, 0.0); + + return + (p1->x - p2->x)*(p1->x - p2->x) + + (p1->y - p2->y)*(p1->y - p2->y) + + (p1->z - p2->z)*(p1->z - p2->z); +} + +/** + * gts_point_orientation_3d: + * @p1: a #GtsPoint. + * @p2: a #GtsPoint. + * @p3: a #GtsPoint. + * @p4: a #GtsPoint. + * + * Checks if @p4 lies above, below or on the plane passing through the + * points @p1, @p2 and @p3. Below is defined so that @p1, @p2 and @p3 + * appear in counterclockwise order when viewed from above the + * plane. The returned value is an approximation of six times the + * signed volume of the tetrahedron defined by the four points. This + * function uses adaptive floating point arithmetic and is + * consequently geometrically robust. + * + * Returns: a positive value if @p4 lies below, a negative value if + * @p4 lies above the plane, zero if the four points are coplanar. + */ +gdouble gts_point_orientation_3d (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + GtsPoint * p4) +{ + g_return_val_if_fail (p1 != NULL && p2 != NULL && + p3 != NULL && p4 != NULL, 0.0); + return orient3d ((gdouble *) &p1->x, + (gdouble *) &p2->x, + (gdouble *) &p3->x, + (gdouble *) &p4->x); +} + +/** + * gts_point_is_in_triangle: + * @p: a #GtsPoint. + * @t: a #GtsTriangle. + * + * Tests if the planar projection (x, y) of @p is inside, outside or + * on the boundary of the planar projection of @t. This function is + * geometrically robust. + * + * Returns: %GTS_IN if @p is inside @t, %GTS_ON if @p is on the boundary of + * @t, %GTS_OUT otherwise. + */ +GtsIntersect gts_point_is_in_triangle (GtsPoint * p, GtsTriangle * t) +{ + GtsVertex * v1, * v2, * v3; + gdouble d1, d2, d3; + + g_return_val_if_fail (p != NULL && t != NULL, FALSE); + + gts_triangle_vertices (t, &v1, &v2, &v3); + + d1 = gts_point_orientation (GTS_POINT (v1), GTS_POINT (v2), p); + if (d1 < 0.0) + return GTS_OUT; + d2 = gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), p); + if (d2 < 0.0) + return GTS_OUT; + d3 = gts_point_orientation (GTS_POINT (v3), GTS_POINT (v1), p); + if (d3 < 0.0) + return GTS_OUT; + if (d1 == 0.0 || d2 == 0.0 || d3 == 0.0) + return GTS_ON; + return GTS_IN; +} + +/** + * gts_point_in_triangle_circle: + * @p: a #GtsPoint. + * @t: a #GtsTriangle. + * + * Tests if the planar projection (x, y) of @p is inside or outside + * the circumcircle of the planar projection of @t. This function is + * geometrically robust. + * + * Returns: a positive number if @p lies inside, + * a negative number if @p lies outside and zero if @p lies on + * the circumcircle of @t. + */ +gdouble gts_point_in_triangle_circle (GtsPoint * p, GtsTriangle * t) +{ + GtsPoint * p1, * p2, * p3; + + g_return_val_if_fail (p != NULL && t != NULL, 0.0); + + gts_triangle_vertices (t, + (GtsVertex **) &p1, + (GtsVertex **) &p2, + (GtsVertex **) &p3); + + return incircle ((gdouble *) &p1->x, + (gdouble *) &p2->x, + (gdouble *) &p3->x, + (gdouble *) &p->x); +} + +/** + * gts_point_in_circle: + * @p: a #GtsPoint. + * @p1: a #GtsPoint. + * @p2: a #GtsPoint. + * @p3: a #GtsPoint. + * + * Tests if the planar projection (x, y) of @p is inside or outside the + * circle defined by the planar projection of @p1, @p2 and @p3. + * + * Returns: a positive number if @p lies inside, + * a negative number if @p lies outside and zero if @p lies on + * the circle. + */ +gdouble gts_point_in_circle (GtsPoint * p, + GtsPoint * p1, GtsPoint * p2, GtsPoint * p3) +{ + g_return_val_if_fail (p != NULL && p1 != NULL && p2 != NULL && p3 != NULL, + 0.0); + + return incircle ((gdouble *) &p1->x, + (gdouble *) &p2->x, + (gdouble *) &p3->x, + (gdouble *) &p->x); +} + +/** + * gts_point_in_sphere: + * @p: a #GtsPoint. + * @p1: a #GtsPoint. + * @p2: a #GtsPoint. + * @p3: a #GtsPoint. + * @p4: a #GtsPoint. + * + * Tests if @p is inside or outside the sphere defined by @p1, @p2, + * @p3 and @p4. + * + * Returns: a positive number if @p lies inside, + * a negative number if @p lies outside and zero if @p lies on + * the sphere. + */ +gdouble gts_point_in_sphere (GtsPoint * p, + GtsPoint * p1, GtsPoint * p2, GtsPoint * p3, GtsPoint * p4) +{ + g_return_val_if_fail (p != NULL && p1 != NULL && p2 != NULL && p3 != NULL && p4 != NULL, + 0.0); + + return insphere ((gdouble *) &p1->x, + (gdouble *) &p2->x, + (gdouble *) &p3->x, + (gdouble *) &p4->x, + (gdouble *) &p->x); +} + +/** + * gts_point_segment_distance2: + * @p: a #GtsPoint. + * @s: a #GtsSegment. + * + * Returns: the square of the minimun Euclidean distance between @p and @s. + */ +gdouble gts_point_segment_distance2 (GtsPoint * p, GtsSegment * s) +{ + gdouble t, ns2, x, y, z; + GtsPoint * p1, * p2; + + g_return_val_if_fail (p != NULL, 0.0); + g_return_val_if_fail (s != NULL, 0.0); + + p1 = GTS_POINT (s->v1); + p2 = GTS_POINT (s->v2); + ns2 = gts_point_distance2 (p1, p2); + if (ns2 == 0.0) + return gts_point_distance2 (p, p1); + t = ((p2->x - p1->x)*(p->x - p1->x) + + (p2->y - p1->y)*(p->y - p1->y) + + (p2->z - p1->z)*(p->z - p1->z))/ns2; + if (t > 1.0) + return gts_point_distance2 (p, p2); + if (t < 0.0) + return gts_point_distance2 (p, p1); + x = (1. - t)*p1->x + t*p2->x - p->x; + y = (1. - t)*p1->y + t*p2->y - p->y; + z = (1. - t)*p1->z + t*p2->z - p->z; + return x*x + y*y + z*z; +} + +/** + * gts_point_segment_distance: + * @p: a #GtsPoint. + * @s: a #GtsSegment. + * + * Returns: the minimun Euclidean distance between @p and @s. + */ +gdouble gts_point_segment_distance (GtsPoint * p, GtsSegment * s) +{ + g_return_val_if_fail (p != NULL, 0.0); + g_return_val_if_fail (s != NULL, 0.0); + + return sqrt (gts_point_segment_distance2 (p, s)); +} + +/** + * gts_point_segment_closest: + * @p: a #GtsPoint. + * @s: a #GtsSegment. + * @closest: a #GtsPoint. + * + * Set the coordinates of @closest to the coordinates of the point belonging + * to @s closest to @p. + */ +void gts_point_segment_closest (GtsPoint * p, + GtsSegment * s, + GtsPoint * closest) +{ + gdouble t, ns2; + GtsPoint * p1, * p2; + + g_return_if_fail (p != NULL); + g_return_if_fail (s != NULL); + g_return_if_fail (closest != NULL); + + p1 = GTS_POINT (s->v1); + p2 = GTS_POINT (s->v2); + ns2 = gts_point_distance2 (p1, p2); + + if (ns2 == 0.0) { + gts_point_set (closest, p1->x, p1->y, p1->z); + return; + } + + t = ((p2->x - p1->x)*(p->x - p1->x) + + (p2->y - p1->y)*(p->y - p1->y) + + (p2->z - p1->z)*(p->z - p1->z))/ns2; + + if (t > 1.0) + gts_point_set (closest, p2->x, p2->y, p2->z); + else if (t < 0.0) + gts_point_set (closest, p1->x, p1->y, p1->z); + else + gts_point_set (closest, + (1. - t)*p1->x + t*p2->x, + (1. - t)*p1->y + t*p2->y, + (1. - t)*p1->z + t*p2->z); +} + +/** + * gts_point_triangle_distance2: + * @p: a #GtsPoint. + * @t: a #GtsTriangle. + * + * Returns: the square of the minimun Euclidean distance between @p and @t. + */ +gdouble gts_point_triangle_distance2 (GtsPoint * p, GtsTriangle * t) +{ + GtsPoint * p1, * p2, * p3; + GtsEdge * e1, * e2, * e3; + GtsVector p1p2, p1p3, pp1; + gdouble A, B, C, D, E, det; + gdouble t1, t2; + gdouble x, y, z; + + g_return_val_if_fail (p != NULL, 0.0); + g_return_val_if_fail (t != NULL, 0.0); + + gts_triangle_vertices_edges (t, NULL, + (GtsVertex **) &p1, + (GtsVertex **) &p2, + (GtsVertex **) &p3, + &e1, &e2, &e3); + + gts_vector_init (p1p2, p1, p2); + gts_vector_init (p1p3, p1, p3); + gts_vector_init (pp1, p, p1); + + B = gts_vector_scalar (p1p3, p1p2); + E = gts_vector_scalar (p1p2, p1p2); + C = gts_vector_scalar (p1p3, p1p3); + + det = B*B - E*C; + if (det == 0.) { /* p1p2 and p1p3 are colinear */ + gdouble d1 = gts_point_segment_distance2 (p, GTS_SEGMENT (e1)); + gdouble d2 = gts_point_segment_distance2 (p, GTS_SEGMENT (e3)); + if (d1 < d2) + return d1; + return d2; + } + + A = gts_vector_scalar (p1p3, pp1); + D = gts_vector_scalar (p1p2, pp1); + + t1 = (D*C - A*B)/det; + t2 = (A*E - D*B)/det; + + if (t1 < 0.) + return gts_point_segment_distance2 (p, GTS_SEGMENT (e3)); + if (t2 < 0.) + return gts_point_segment_distance2 (p, GTS_SEGMENT (e1)); + if (t1 + t2 > 1.) + return gts_point_segment_distance2 (p, GTS_SEGMENT (e2)); + + x = pp1[0] + t1*p1p2[0] + t2*p1p3[0]; + y = pp1[1] + t1*p1p2[1] + t2*p1p3[1]; + z = pp1[2] + t1*p1p2[2] + t2*p1p3[2]; + + return x*x + y*y + z*z; +} + +/** + * gts_point_triangle_distance: + * @p: a #GtsPoint. + * @t: a #GtsTriangle. + * + * Returns: the minimun Euclidean distance between @p and @t. + */ +gdouble gts_point_triangle_distance (GtsPoint * p, GtsTriangle * t) +{ + g_return_val_if_fail (p != NULL, 0.0); + g_return_val_if_fail (t != NULL, 0.0); + + return sqrt (gts_point_triangle_distance2 (p, t)); +} + +/** + * gts_point_triangle_closest: + * @p: a #GtsPoint. + * @t: a #GtsTriangle. + * @closest: a #GtsPoint. + * + * Set the coordinates of @closest to those of the point belonging to @t and + * closest to @p. + */ +void gts_point_triangle_closest (GtsPoint * p, + GtsTriangle * t, + GtsPoint * closest) +{ + GtsPoint * p1, * p2, * p3; + GtsEdge * e1, * e2, * e3; + GtsVector p1p2, p1p3, pp1; + gdouble A, B, C, D, E, det; + gdouble t1, t2; + + g_return_if_fail (p != NULL); + g_return_if_fail (t != NULL); + g_return_if_fail (closest != NULL); + + gts_triangle_vertices_edges (t, NULL, + (GtsVertex **) &p1, + (GtsVertex **) &p2, + (GtsVertex **) &p3, + &e1, &e2, &e3); + + gts_vector_init (p1p2, p1, p2); + gts_vector_init (p1p3, p1, p3); + gts_vector_init (pp1, p, p1); + + B = gts_vector_scalar (p1p3, p1p2); + E = gts_vector_scalar (p1p2, p1p2); + C = gts_vector_scalar (p1p3, p1p3); + + det = B*B - E*C; + if (det == 0.) { /* p1p2 and p1p3 are colinear */ + GtsPoint * cp = + GTS_POINT (gts_object_new (GTS_OBJECT_CLASS (gts_point_class ()))); + gts_point_segment_closest (p, GTS_SEGMENT (e1), cp); + gts_point_segment_closest (p, GTS_SEGMENT (e3), closest); + + if (gts_point_distance2 (cp, p) < gts_point_distance2 (closest, p)) + gts_point_set (closest, cp->x, cp->y, cp->z); + gts_object_destroy (GTS_OBJECT (cp)); + return; + } + + A = gts_vector_scalar (p1p3, pp1); + D = gts_vector_scalar (p1p2, pp1); + + t1 = (D*C - A*B)/det; + t2 = (A*E - D*B)/det; + + if (t1 < 0.) + gts_point_segment_closest (p, GTS_SEGMENT (e3), closest); + else if (t2 < 0.) + gts_point_segment_closest (p, GTS_SEGMENT (e1), closest); + else if (t1 + t2 > 1.) + gts_point_segment_closest (p, GTS_SEGMENT (e2), closest); + else + gts_point_set (closest, + p1->x + t1*p1p2[0] + t2*p1p3[0], + p1->y + t1*p1p2[1] + t2*p1p3[1], + p1->z + t1*p1p2[2] + t2*p1p3[2]); +} + +/** + * gts_segment_triangle_intersection: + * @s: a #GtsSegment. + * @t: a #GtsTriangle. + * @boundary: if %TRUE, the boundary of @t is taken into account. + * @klass: a #GtsPointClass to be used for the new point. + * + * Checks if @s intersects @t. If this is the case, creates a new + * point pi intersection of @s with @t. + * + * This function is geometrically robust in the sense that it will not + * return a point if @s and @t do not intersect and will return a + * point if @s and @t do intersect. However, the point coordinates are + * subject to round-off errors. + * + * Note that this function will not return any point if @s is contained in + * the plane defined by @t. + * + * Returns: a summit of @t (if @boundary is set to %TRUE), one of the endpoints + * of @s or a new #GtsPoint, intersection of @s with @t or %NULL if @s + * and @t don't intersect. + */ +GtsPoint * gts_segment_triangle_intersection (GtsSegment * s, + GtsTriangle * t, + gboolean boundary, + GtsPointClass * klass) +{ + GtsPoint * A, * B, * C, * D, * E, * I; + gdouble ABCE, ABCD, ADCE, ABDE, BCDE; + gdouble c; + + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (t != NULL, NULL); + g_return_val_if_fail (klass != NULL, NULL); + + A = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + B = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + C = GTS_POINT (gts_triangle_vertex (t)); + D = GTS_POINT (s->v1); + E = GTS_POINT (s->v2); + + ABCE = gts_point_orientation_3d (A, B, C, E); + ABCD = gts_point_orientation_3d (A, B, C, D); + if (ABCE < 0.0 || ABCD > 0.0) { + GtsPoint * tmpp; + gdouble tmp; + tmpp = E; E = D; D = tmpp; + tmp = ABCE; ABCE = ABCD; ABCD = tmp; + } + if (ABCE < 0.0 || ABCD > 0.0) + return NULL; + ADCE = gts_point_orientation_3d (A, D, C, E); + if ((boundary && ADCE < 0.) || (!boundary && ADCE <= 0.)) + return NULL; + ABDE = gts_point_orientation_3d (A, B, D, E); + if ((boundary && ABDE < 0.) || (!boundary && ABDE <= 0.)) + return NULL; + BCDE = gts_point_orientation_3d (B, C, D, E); + if ((boundary && BCDE < 0.) || (!boundary && BCDE <= 0.)) + return NULL; + if (ABCE == 0.0) { + if (ABCD == 0.0) + /* s is contained in the plane defined by t*/ + return NULL; + return E; + } + if (ABCD == 0.0) + return D; + if (boundary) { /* corners of @t */ + if (ABDE == 0.) { + if (ADCE == 0.) + return A; + if (BCDE == 0.) + return B; + } + else if (BCDE == 0. && ADCE == 0.) + return C; + } + c = ABCE/(ABCE - ABCD); + I = GTS_POINT (gts_object_new (GTS_OBJECT_CLASS (klass))); + gts_point_set (I, + E->x + c*(D->x - E->x), + E->y + c*(D->y - E->y), + E->z + c*(D->z - E->z)); + return I; +} + +/** + * gts_point_transform: + * @p: a #GtsPoint. + * @m: the #GtsMatrix representing the transformation to + * apply to the coordinates of @p. + * + * Transform the coordinates of @p according to @m. (p[] becomes m[][].p[]). + */ +void gts_point_transform (GtsPoint * p, GtsMatrix * m) +{ + gdouble x, y, z; + g_return_if_fail (p != NULL && m != NULL); + x = m[0][0]*p->x + m[0][1]*p->y + m[0][2]*p->z + m[0][3]; + y = m[1][0]*p->x + m[1][1]*p->y + m[1][2]*p->z + m[1][3]; + z = m[2][0]*p->x + m[2][1]*p->y + m[2][2]*p->z + m[2][3]; + p->x = x; p->y = y; p->z = z; +} + +/** + * gts_point_orientation: + * @p1: a #GtsPoint. + * @p2: a #GtsPoint. + * @p3: a #GtsPoint. + * + * Checks for orientation of the projection of three points on the + * (x,y) plane. The result is also an approximation of twice the + * signed area of the triangle defined by the three points. This + * function uses adaptive floating point arithmetic and is + * consequently geometrically robust. + * + * Returns: a positive value if @p1, @p2 and @p3 appear in + * counterclockwise order, a negative value if they appear in + * clockwise order and zero if they are colinear. + */ +gdouble gts_point_orientation (GtsPoint * p1, GtsPoint * p2, GtsPoint * p3) +{ + g_return_val_if_fail (p1 != NULL && p2 != NULL && p3 != NULL, 0.0); + + return orient2d ((gdouble *) &p1->x, + (gdouble *) &p2->x, + (gdouble *) &p3->x); +} + +static gboolean ray_intersects_triangle (GtsPoint * D, GtsPoint * E, + GtsTriangle * t) +{ + GtsPoint * A, * B, * C; + gint ABCE, ABCD, ADCE, ABDE, BCDE; + + gts_triangle_vertices (t, (GtsVertex **) &A, + (GtsVertex **) &B, + (GtsVertex **) &C); + + ABCE = gts_point_orientation_3d_sos (A, B, C, E); + ABCD = gts_point_orientation_3d_sos (A, B, C, D); + if (ABCE < 0 || ABCD > 0) { + GtsPoint * tmpp; + gint tmp; + + tmpp = E; E = D; D = tmpp; + tmp = ABCE; ABCE = ABCD; ABCD = tmp; + } + if (ABCE < 0 || ABCD > 0) + return FALSE; + ADCE = gts_point_orientation_3d_sos (A, D, C, E); + if (ADCE < 0) + return FALSE; + ABDE = gts_point_orientation_3d_sos (A, B, D, E); + if (ABDE < 0) + return FALSE; + BCDE = gts_point_orientation_3d_sos (B, C, D, E); + if (BCDE < 0) + return FALSE; + return TRUE; +} + +/** + * gts_point_is_inside_surface: + * @p: a #GtsPoint. + * @tree: a bounding box tree of the faces of a closed, orientable + * surface (see gts_bb_tree_surface()). + * @is_open: %TRUE if the surface defined by @tree is "open" i.e. its volume + * is negative, %FALSE otherwise. + * + * Returns: %TRUE if @p is inside the surface defined by @tree, %FALSE + * otherwise. + */ +gboolean gts_point_is_inside_surface (GtsPoint * p, + GNode * tree, + gboolean is_open) +{ + GSList * list, * i; + guint nc = 0; + GtsPoint * p1; + GtsBBox * bb; + + g_return_val_if_fail (p != NULL, FALSE); + g_return_val_if_fail (tree != NULL, FALSE); + + bb = tree->data; + p1 = gts_point_new (gts_point_class (), bb->x2 + fabs (bb->x2)/10., p->y, p->z); + i = list = gts_bb_tree_stabbed (tree, p); + while (i) { + GtsTriangle * t = GTS_TRIANGLE (GTS_BBOX (i->data)->bounded); + + if (ray_intersects_triangle (p, p1, t)) + nc++; + i = i->next; + } + g_slist_free (list); + gts_object_destroy (GTS_OBJECT (p1)); + + return is_open ? (nc % 2 == 0) : (nc % 2 != 0); +} + +#define SIGN(x) ((x) > 0. ? 1 : -1) +#define ORIENT1D(a,b) ((a) > (b) ? 1 : (a) < (b) ? -1 : 0) + +static gint sortp (gpointer * p, guint n) +{ + gint sign = 1; + guint i, j; + + for (i = 0; i < n - 1; i++) + for (j = 0; j < n - 1 - i; j++) + if (GPOINTER_TO_UINT (p[j+1]) < GPOINTER_TO_UINT (p[j])) { + gpointer tmp = p[j]; + + p[j] = p[j+1]; + p[j+1] = tmp; + sign = - sign; + } + return sign; +} + +/** + * gts_point_orientation_3d_sos: + * @p1: a #GtsPoint. + * @p2: a #GtsPoint. + * @p3: a #GtsPoint. + * @p4: a #GtsPoint. + * + * Checks if @p4 lies above or below the plane passing through the + * points @p1, @p2 and @p3. Below is defined so that @p1, @p2 and @p3 + * appear in counterclockwise order when viewed from above the + * plane. This function uses adaptive floating point arithmetic and is + * consequently geometrically robust. + * + * Simulation of Simplicity (SoS) is used to break ties when the + * orientation is degenerate (i.e. @p4 lies on the plane defined by + * @p1, @p2 and @p3). + * + * Returns: +1 if @p4 lies below, -1 if @p4 lies above the plane. + */ +gint gts_point_orientation_3d_sos (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3, + GtsPoint * p4) +{ + gdouble o; + + g_return_val_if_fail (p1 != NULL && p2 != NULL && + p3 != NULL && p4 != NULL, 0); + + o = orient3d ((gdouble *) &p1->x, + (gdouble *) &p2->x, + (gdouble *) &p3->x, + (gdouble *) &p4->x); + if (o != 0.) + return SIGN (o); + else { + GtsPoint * p[4]; + gdouble a[2], b[2], c[2]; + gint sign; + + p[0] = p1; p[1] = p2; p[2] = p3; p[3] = p4; + sign = sortp ((gpointer *) p, 4); + + /* epsilon^1/8 */ + a[0] = p[1]->x; a[1] = p[1]->y; + b[0] = p[2]->x; b[1] = p[2]->y; + c[0] = p[3]->x; c[1] = p[3]->y; + o = orient2d (a, b, c); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^1/4 */ + a[0] = p[1]->x; a[1] = p[1]->z; + b[0] = p[2]->x; b[1] = p[2]->z; + c[0] = p[3]->x; c[1] = p[3]->z; + o = orient2d (a, b, c); + if (o != 0.) + return - SIGN (o)*sign; + + /* epsilon^1/2 */ + a[0] = p[1]->y; a[1] = p[1]->z; + b[0] = p[2]->y; b[1] = p[2]->z; + c[0] = p[3]->y; c[1] = p[3]->z; + o = orient2d (a, b, c); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon */ + a[0] = p[0]->x; a[1] = p[0]->y; + b[0] = p[2]->x; b[1] = p[2]->y; + c[0] = p[3]->x; c[1] = p[3]->y; + o = orient2d (a, b, c); + if (o != 0.) + return - SIGN (o)*sign; + + /* epsilon^5/4 */ + o = ORIENT1D (p[2]->x, p[3]->x); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^3/2 */ + o = ORIENT1D (p[2]->y, p[3]->y); + if (o != 0.) + return - SIGN (o)*sign; + + /* epsilon^2 */ + a[0] = p[0]->x; a[1] = p[0]->z; + b[0] = p[2]->x; b[1] = p[2]->z; + c[0] = p[3]->x; c[1] = p[3]->z; + o = orient2d (a, b, c); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^5/2 */ + o = ORIENT1D (p[2]->z, p[3]->z); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^4 */ + a[0] = p[0]->y; a[1] = p[0]->z; + b[0] = p[2]->y; b[1] = p[2]->z; + c[0] = p[3]->y; c[1] = p[3]->z; + o = orient2d (a, b, c); + if (o != 0.) + return - SIGN (o)*sign; + + /* epsilon^8 */ + a[0] = p[0]->x; a[1] = p[0]->y; + b[0] = p[1]->x; b[1] = p[1]->y; + c[0] = p[3]->x; c[1] = p[3]->y; + o = orient2d (a, b, c); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^33/4 */ + o = ORIENT1D (p[1]->x, p[3]->x); + if (o != 0.) + return - SIGN (o)*sign; + + /* epsilon^17/2 */ + o = ORIENT1D (p[1]->y, p[3]->y); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^10 */ + o = ORIENT1D (p[0]->x, p[3]->x); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^21/2 */ + return sign; + } +} + +/** + * gts_point_orientation_sos: + * @p1: a #GtsPoint. + * @p2: a #GtsPoint. + * @p3: a #GtsPoint. + * + * Checks for orientation of the projection of three points on the + * (x,y) plane. + * + * Simulation of Simplicity (SoS) is used to break ties when the + * orientation is degenerate (i.e. @p3 lies on the line defined by + * @p1 and @p2). + * + * Returns: a positive value if @p1, @p2 and @p3 appear in + * counterclockwise order or a negative value if they appear in + * clockwise order. + */ +gint gts_point_orientation_sos (GtsPoint * p1, + GtsPoint * p2, + GtsPoint * p3) +{ + gdouble o; + + g_return_val_if_fail (p1 != NULL && p2 != NULL && p3 != NULL, 0); + + o = orient2d ((gdouble *) &p1->x, + (gdouble *) &p2->x, + (gdouble *) &p3->x); + if (o != 0.) + return SIGN (o); + else { + GtsPoint * p[3]; + gint sign; + + p[0] = p1; p[1] = p2; p[2] = p3; + sign = sortp ((gpointer *) p, 3); + + /* epsilon^1/4 */ + o = ORIENT1D (p[1]->x, p[2]->x); + if (o != 0.) + return - SIGN (o)*sign; + + /* epsilon^1/2 */ + o = ORIENT1D (p[1]->y, p[2]->y); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon */ + o = ORIENT1D (p[0]->x, p[2]->x); + if (o != 0.) + return SIGN (o)*sign; + + /* epsilon^3/2 */ + return sign; + } +} Index: tags/1.0.5/gts/predicates.c =================================================================== --- tags/1.0.5/gts/predicates.c (nonexistent) +++ tags/1.0.5/gts/predicates.c (revision 953) @@ -0,0 +1,2742 @@ +/*****************************************************************************/ +/* */ +/* Routines for Arbitrary Precision Floating-point Arithmetic */ +/* and Fast Robust Geometric Predicates */ +/* (predicates.c) */ +/* */ +/* May 18, 1996 */ +/* */ +/* Placed in the public domain by */ +/* Jonathan Richard Shewchuk */ +/* School of Computer Science */ +/* Carnegie Mellon University */ +/* 5000 Forbes Avenue */ +/* Pittsburgh, Pennsylvania 15213-3891 */ +/* jrs@cs.cmu.edu */ +/* */ +/* This file contains C implementation of algorithms for exact addition */ +/* and multiplication of floating-point numbers, and predicates for */ +/* robustly performing the orientation and incircle tests used in */ +/* computational geometry. The algorithms and underlying theory are */ +/* described in Jonathan Richard Shewchuk. "Adaptive Precision Floating- */ +/* Point Arithmetic and Fast Robust Geometric Predicates." Technical */ +/* Report CMU-CS-96-140, School of Computer Science, Carnegie Mellon */ +/* University, Pittsburgh, Pennsylvania, May 1996. (Submitted to */ +/* Discrete & Computational Geometry.) */ +/* */ +/* This file, the paper listed above, and other information are available */ +/* from the Web page http://www.cs.cmu.edu/~quake/robust.html . */ +/* */ +/*****************************************************************************/ + +/*****************************************************************************/ +/* */ +/* Using this code: */ +/* */ +/* First, read the short or long version of the paper (from the Web page */ +/* above). */ +/* */ +/* Be sure to call exactinit() once, before calling any of the arithmetic */ +/* functions or geometric predicates. Also be sure to turn on the */ +/* optimizer when compiling this file. */ +/* */ +/* */ +/* Several geometric predicates are defined. Their parameters are all */ +/* points. Each point is an array of two or three floating-point */ +/* numbers. The geometric predicates, described in the papers, are */ +/* */ +/* orient2d(pa, pb, pc) */ +/* orient2dfast(pa, pb, pc) */ +/* orient3d(pa, pb, pc, pd) */ +/* orient3dfast(pa, pb, pc, pd) */ +/* incircle(pa, pb, pc, pd) */ +/* incirclefast(pa, pb, pc, pd) */ +/* insphere(pa, pb, pc, pd, pe) */ +/* inspherefast(pa, pb, pc, pd, pe) */ +/* */ +/* Those with suffix "fast" are approximate, non-robust versions. Those */ +/* without the suffix are adaptive precision, robust versions. There */ +/* are also versions with the suffices "exact" and "slow", which are */ +/* non-adaptive, exact arithmetic versions, which I use only for timings */ +/* in my arithmetic papers. */ +/* */ +/* */ +/* An expansion is represented by an array of floating-point numbers, */ +/* sorted from smallest to largest magnitude (possibly with interspersed */ +/* zeros). The length of each expansion is stored as a separate integer, */ +/* and each arithmetic function returns an integer which is the length */ +/* of the expansion it created. */ +/* */ +/* Several arithmetic functions are defined. Their parameters are */ +/* */ +/* e, f Input expansions */ +/* elen, flen Lengths of input expansions (must be >= 1) */ +/* h Output expansion */ +/* b Input scalar */ +/* */ +/* The arithmetic functions are */ +/* */ +/* grow_expansion(elen, e, b, h) */ +/* grow_expansion_zeroelim(elen, e, b, h) */ +/* expansion_sum(elen, e, flen, f, h) */ +/* expansion_sum_zeroelim1(elen, e, flen, f, h) */ +/* expansion_sum_zeroelim2(elen, e, flen, f, h) */ +/* fast_expansion_sum(elen, e, flen, f, h) */ +/* fast_expansion_sum_zeroelim(elen, e, flen, f, h) */ +/* linear_expansion_sum(elen, e, flen, f, h) */ +/* linear_expansion_sum_zeroelim(elen, e, flen, f, h) */ +/* scale_expansion(elen, e, b, h) */ +/* scale_expansion_zeroelim(elen, e, b, h) */ +/* compress(elen, e, h) */ +/* */ +/* All of these are described in the long version of the paper; some are */ +/* described in the short version. All return an integer that is the */ +/* length of h. Those with suffix _zeroelim perform zero elimination, */ +/* and are recommended over their counterparts. The procedure */ +/* fast_expansion_sum_zeroelim() (or linear_expansion_sum_zeroelim() on */ +/* processors that do not use the round-to-even tiebreaking rule) is */ +/* recommended over expansion_sum_zeroelim(). Each procedure has a */ +/* little note next to it (in the code below) that tells you whether or */ +/* not the output expansion may be the same array as one of the input */ +/* expansions. */ +/* */ +/* */ +/* If you look around below, you'll also find macros for a bunch of */ +/* simple unrolled arithmetic operations, and procedures for printing */ +/* expansions (commented out because they don't work with all C */ +/* compilers) and for generating random floating-point numbers whose */ +/* significand bits are all random. Most of the macros have undocumented */ +/* requirements that certain of their parameters should not be the same */ +/* variable; for safety, better to make sure all the parameters are */ +/* distinct variables. Feel free to send email to jrs@cs.cmu.edu if you */ +/* have questions. */ +/* */ +/*****************************************************************************/ + +#include +#include +#include +#include "predicates.h" + +/* Use header file generated automatically by predicates_init. */ +//#define USE_PREDICATES_INIT + +#ifdef USE_PREDICATES_INIT +#include "predicates_init.h" +#endif /* USE_PREDICATES_INIT */ + +/* FPU control. We MUST have only double precision (not extended precision) */ +#include "rounding.h" + +/* On some machines, the exact arithmetic routines might be defeated by the */ +/* use of internal extended precision floating-point registers. Sometimes */ +/* this problem can be fixed by defining certain values to be volatile, */ +/* thus forcing them to be stored to memory and rounded off. This isn't */ +/* a great solution, though, as it slows the arithmetic down. */ +/* */ +/* To try this out, write "#define INEXACT volatile" below. Normally, */ +/* however, INEXACT should be defined to be nothing. ("#define INEXACT".) */ + +#define INEXACT /* Nothing */ +/* #define INEXACT volatile */ + +#define REAL double /* float or double */ +#define REALPRINT doubleprint +#define REALRAND doublerand +#define NARROWRAND narrowdoublerand +#define UNIFORMRAND uniformdoublerand + +/* Which of the following two methods of finding the absolute values is */ +/* fastest is compiler-dependent. A few compilers can inline and optimize */ +/* the fabs() call; but most will incur the overhead of a function call, */ +/* which is disastrously slow. A faster way on IEEE machines might be to */ +/* mask the appropriate bit, but that's difficult to do in C. */ + +#define Absolute(a) ((a) >= 0.0 ? (a) : -(a)) +/* #define Absolute(a) fabs(a) */ + +/* Many of the operations are broken up into two pieces, a main part that */ +/* performs an approximate operation, and a "tail" that computes the */ +/* roundoff error of that operation. */ +/* */ +/* The operations Fast_Two_Sum(), Fast_Two_Diff(), Two_Sum(), Two_Diff(), */ +/* Split(), and Two_Product() are all implemented as described in the */ +/* reference. Each of these macros requires certain variables to be */ +/* defined in the calling routine. The variables `bvirt', `c', `abig', */ +/* `_i', `_j', `_k', `_l', `_m', and `_n' are declared `INEXACT' because */ +/* they store the result of an operation that may incur roundoff error. */ +/* The input parameter `x' (or the highest numbered `x_' parameter) must */ +/* also be declared `INEXACT'. */ + +#define Fast_Two_Sum_Tail(a, b, x, y) \ + bvirt = x - a; \ + y = b - bvirt + +#define Fast_Two_Sum(a, b, x, y) \ + x = (REAL) (a + b); \ + Fast_Two_Sum_Tail(a, b, x, y) + +#define Fast_Two_Diff_Tail(a, b, x, y) \ + bvirt = a - x; \ + y = bvirt - b + +#define Fast_Two_Diff(a, b, x, y) \ + x = (REAL) (a - b); \ + Fast_Two_Diff_Tail(a, b, x, y) + +#define Two_Sum_Tail(a, b, x, y) \ + bvirt = (REAL) (x - a); \ + avirt = x - bvirt; \ + bround = b - bvirt; \ + around = a - avirt; \ + y = around + bround + +#define Two_Sum(a, b, x, y) \ + x = (REAL) (a + b); \ + Two_Sum_Tail(a, b, x, y) + +#define Two_Diff_Tail(a, b, x, y) \ + bvirt = (REAL) (a - x); \ + avirt = x + bvirt; \ + bround = bvirt - b; \ + around = a - avirt; \ + y = around + bround + +#define Two_Diff(a, b, x, y) \ + x = (REAL) (a - b); \ + Two_Diff_Tail(a, b, x, y) + +#define Split(a, ahi, alo) \ + c = (REAL) (splitter * a); \ + abig = (REAL) (c - a); \ + ahi = c - abig; \ + alo = a - ahi + +#define Two_Product_Tail(a, b, x, y) \ + Split(a, ahi, alo); \ + Split(b, bhi, blo); \ + err1 = x - (ahi * bhi); \ + err2 = err1 - (alo * bhi); \ + err3 = err2 - (ahi * blo); \ + y = (alo * blo) - err3 + +#define Two_Product(a, b, x, y) \ + x = (REAL) (a * b); \ + Two_Product_Tail(a, b, x, y) + +/* Two_Product_Presplit() is Two_Product() where one of the inputs has */ +/* already been split. Avoids redundant splitting. */ + +#define Two_Product_Presplit(a, b, bhi, blo, x, y) \ + x = (REAL) (a * b); \ + Split(a, ahi, alo); \ + err1 = x - (ahi * bhi); \ + err2 = err1 - (alo * bhi); \ + err3 = err2 - (ahi * blo); \ + y = (alo * blo) - err3 + +/* Two_Product_2Presplit() is Two_Product() where both of the inputs have */ +/* already been split. Avoids redundant splitting. */ + +#define Two_Product_2Presplit(a, ahi, alo, b, bhi, blo, x, y) \ + x = (REAL) (a * b); \ + err1 = x - (ahi * bhi); \ + err2 = err1 - (alo * bhi); \ + err3 = err2 - (ahi * blo); \ + y = (alo * blo) - err3 + +/* Square() can be done more quickly than Two_Product(). */ + +#define Square_Tail(a, x, y) \ + Split(a, ahi, alo); \ + err1 = x - (ahi * ahi); \ + err3 = err1 - ((ahi + ahi) * alo); \ + y = (alo * alo) - err3 + +#define Square(a, x, y) \ + x = (REAL) (a * a); \ + Square_Tail(a, x, y) + +/* Macros for summing expansions of various fixed lengths. These are all */ +/* unrolled versions of Expansion_Sum(). */ + +#define Two_One_Sum(a1, a0, b, x2, x1, x0) \ + Two_Sum(a0, b , _i, x0); \ + Two_Sum(a1, _i, x2, x1) + +#define Two_One_Diff(a1, a0, b, x2, x1, x0) \ + Two_Diff(a0, b , _i, x0); \ + Two_Sum( a1, _i, x2, x1) + +#define Two_Two_Sum(a1, a0, b1, b0, x3, x2, x1, x0) \ + Two_One_Sum(a1, a0, b0, _j, _0, x0); \ + Two_One_Sum(_j, _0, b1, x3, x2, x1) + +#define Two_Two_Diff(a1, a0, b1, b0, x3, x2, x1, x0) \ + Two_One_Diff(a1, a0, b0, _j, _0, x0); \ + Two_One_Diff(_j, _0, b1, x3, x2, x1) + +#define Four_One_Sum(a3, a2, a1, a0, b, x4, x3, x2, x1, x0) \ + Two_One_Sum(a1, a0, b , _j, x1, x0); \ + Two_One_Sum(a3, a2, _j, x4, x3, x2) + +#define Four_Two_Sum(a3, a2, a1, a0, b1, b0, x5, x4, x3, x2, x1, x0) \ + Four_One_Sum(a3, a2, a1, a0, b0, _k, _2, _1, _0, x0); \ + Four_One_Sum(_k, _2, _1, _0, b1, x5, x4, x3, x2, x1) + +#define Four_Four_Sum(a3, a2, a1, a0, b4, b3, b1, b0, x7, x6, x5, x4, x3, x2, \ + x1, x0) \ + Four_Two_Sum(a3, a2, a1, a0, b1, b0, _l, _2, _1, _0, x1, x0); \ + Four_Two_Sum(_l, _2, _1, _0, b4, b3, x7, x6, x5, x4, x3, x2) + +#define Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b, x8, x7, x6, x5, x4, \ + x3, x2, x1, x0) \ + Four_One_Sum(a3, a2, a1, a0, b , _j, x3, x2, x1, x0); \ + Four_One_Sum(a7, a6, a5, a4, _j, x8, x7, x6, x5, x4) + +#define Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, x9, x8, x7, \ + x6, x5, x4, x3, x2, x1, x0) \ + Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b0, _k, _6, _5, _4, _3, _2, \ + _1, _0, x0); \ + Eight_One_Sum(_k, _6, _5, _4, _3, _2, _1, _0, b1, x9, x8, x7, x6, x5, x4, \ + x3, x2, x1) + +#define Eight_Four_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b4, b3, b1, b0, x11, \ + x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0) \ + Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, _l, _6, _5, _4, _3, \ + _2, _1, _0, x1, x0); \ + Eight_Two_Sum(_l, _6, _5, _4, _3, _2, _1, _0, b4, b3, x11, x10, x9, x8, \ + x7, x6, x5, x4, x3, x2) + +/* Macros for multiplying expansions of various fixed lengths. */ + +#define Two_One_Product(a1, a0, b, x3, x2, x1, x0) \ + Split(b, bhi, blo); \ + Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \ + Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x1); \ + Fast_Two_Sum(_j, _k, x3, x2) + +#define Four_One_Product(a3, a2, a1, a0, b, x7, x6, x5, x4, x3, x2, x1, x0) \ + Split(b, bhi, blo); \ + Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \ + Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x1); \ + Fast_Two_Sum(_j, _k, _i, x2); \ + Two_Product_Presplit(a2, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x3); \ + Fast_Two_Sum(_j, _k, _i, x4); \ + Two_Product_Presplit(a3, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x5); \ + Fast_Two_Sum(_j, _k, x7, x6) + +#define Two_Two_Product(a1, a0, b1, b0, x7, x6, x5, x4, x3, x2, x1, x0) \ + Split(a0, a0hi, a0lo); \ + Split(b0, bhi, blo); \ + Two_Product_2Presplit(a0, a0hi, a0lo, b0, bhi, blo, _i, x0); \ + Split(a1, a1hi, a1lo); \ + Two_Product_2Presplit(a1, a1hi, a1lo, b0, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, _1); \ + Fast_Two_Sum(_j, _k, _l, _2); \ + Split(b1, bhi, blo); \ + Two_Product_2Presplit(a0, a0hi, a0lo, b1, bhi, blo, _i, _0); \ + Two_Sum(_1, _0, _k, x1); \ + Two_Sum(_2, _k, _j, _1); \ + Two_Sum(_l, _j, _m, _2); \ + Two_Product_2Presplit(a1, a1hi, a1lo, b1, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _n, _0); \ + Two_Sum(_1, _0, _i, x2); \ + Two_Sum(_2, _i, _k, _1); \ + Two_Sum(_m, _k, _l, _2); \ + Two_Sum(_j, _n, _k, _0); \ + Two_Sum(_1, _0, _j, x3); \ + Two_Sum(_2, _j, _i, _1); \ + Two_Sum(_l, _i, _m, _2); \ + Two_Sum(_1, _k, _i, x4); \ + Two_Sum(_2, _i, _k, x5); \ + Two_Sum(_m, _k, x7, x6) + +/* An expansion of length two can be squared more quickly than finding the */ +/* product of two different expansions of length two, and the result is */ +/* guaranteed to have no more than six (rather than eight) components. */ + +#define Two_Square(a1, a0, x5, x4, x3, x2, x1, x0) \ + Square(a0, _j, x0); \ + _0 = a0 + a0; \ + Two_Product(a1, _0, _k, _1); \ + Two_One_Sum(_k, _1, _j, _l, _2, x1); \ + Square(a1, _j, _1); \ + Two_Two_Sum(_j, _1, _l, _2, x5, x4, x3, x2) + +#ifndef USE_PREDICATES_INIT + +static REAL splitter; /* = 2^ceiling(p / 2) + 1. Used to split floats in half. */ +/* A set of coefficients used to calculate maximum roundoff errors. */ +static REAL resulterrbound; +static REAL ccwerrboundA, ccwerrboundB, ccwerrboundC; +static REAL o3derrboundA, o3derrboundB, o3derrboundC; +static REAL iccerrboundA, iccerrboundB, iccerrboundC; +static REAL isperrboundA, isperrboundB, isperrboundC; + +void +gts_predicates_init() +{ + double half = 0.5; + double check = 1.0, lastcheck; + int every_other = 1; + /* epsilon = 2^(-p). Used to estimate roundoff errors. */ + double epsilon = 1.0; + + FPU_ROUND_DOUBLE; + + splitter = 1.; + + /* Repeatedly divide `epsilon' by two until it is too small to add to */ + /* one without causing roundoff. (Also check if the sum is equal to */ + /* the previous sum, for machines that round up instead of using exact */ + /* rounding. Not that this library will work on such machines anyway). */ + do { + lastcheck = check; + epsilon *= half; + if (every_other) { + splitter *= 2.0; + } + every_other = !every_other; + check = 1.0 + epsilon; + } while ((check != 1.0) && (check != lastcheck)); + splitter += 1.0; + /* Error bounds for orientation and incircle tests. */ + resulterrbound = (3.0 + 8.0 * epsilon) * epsilon; + ccwerrboundA = (3.0 + 16.0 * epsilon) * epsilon; + ccwerrboundB = (2.0 + 12.0 * epsilon) * epsilon; + ccwerrboundC = (9.0 + 64.0 * epsilon) * epsilon * epsilon; + o3derrboundA = (7.0 + 56.0 * epsilon) * epsilon; + o3derrboundB = (3.0 + 28.0 * epsilon) * epsilon; + o3derrboundC = (26.0 + 288.0 * epsilon) * epsilon * epsilon; + iccerrboundA = (10.0 + 96.0 * epsilon) * epsilon; + iccerrboundB = (4.0 + 48.0 * epsilon) * epsilon; + iccerrboundC = (44.0 + 576.0 * epsilon) * epsilon * epsilon; + isperrboundA = (16.0 + 224.0 * epsilon) * epsilon; + isperrboundB = (5.0 + 72.0 * epsilon) * epsilon; + isperrboundC = (71.0 + 1408.0 * epsilon) * epsilon * epsilon; + + + FPU_RESTORE; +} + +#endif /* USE_PREDICATES_INIT */ + +/*****************************************************************************/ +/* */ +/* doubleprint() Print the bit representation of a double. */ +/* */ +/* Useful for debugging exact arithmetic routines. */ +/* */ +/*****************************************************************************/ + +/* +void doubleprint(number) +double number; +{ + unsigned long long no; + unsigned long long sign, expo; + int exponent; + int i, bottomi; + + no = *(unsigned long long *) &number; + sign = no & 0x8000000000000000ll; + expo = (no >> 52) & 0x7ffll; + exponent = (int) expo; + exponent = exponent - 1023; + if (sign) { + printf("-"); + } else { + printf(" "); + } + if (exponent == -1023) { + printf( + "0.0000000000000000000000000000000000000000000000000000_ ( )"); + } else { + printf("1."); + bottomi = -1; + for (i = 0; i < 52; i++) { + if (no & 0x0008000000000000ll) { + printf("1"); + bottomi = i; + } else { + printf("0"); + } + no <<= 1; + } + printf("_%d (%d)", exponent, exponent - 1 - bottomi); + } +} +*/ + +/*****************************************************************************/ +/* */ +/* floatprint() Print the bit representation of a float. */ +/* */ +/* Useful for debugging exact arithmetic routines. */ +/* */ +/*****************************************************************************/ + +/* +void floatprint(number) +float number; +{ + unsigned no; + unsigned sign, expo; + int exponent; + int i, bottomi; + + no = *(unsigned *) &number; + sign = no & 0x80000000; + expo = (no >> 23) & 0xff; + exponent = (int) expo; + exponent = exponent - 127; + if (sign) { + printf("-"); + } else { + printf(" "); + } + if (exponent == -127) { + printf("0.00000000000000000000000_ ( )"); + } else { + printf("1."); + bottomi = -1; + for (i = 0; i < 23; i++) { + if (no & 0x00400000) { + printf("1"); + bottomi = i; + } else { + printf("0"); + } + no <<= 1; + } + printf("_%3d (%3d)", exponent, exponent - 1 - bottomi); + } +} +*/ + +/*****************************************************************************/ +/* */ +/* expansion_print() Print the bit representation of an expansion. */ +/* */ +/* Useful for debugging exact arithmetic routines. */ +/* */ +/*****************************************************************************/ + +/* +void expansion_print(elen, e) +int elen; +REAL *e; +{ + int i; + + for (i = elen - 1; i >= 0; i--) { + REALPRINT(e[i]); + if (i > 0) { + printf(" +\n"); + } else { + printf("\n"); + } + } +} +*/ + +/*****************************************************************************/ +/* */ +/* doublerand() Generate a double with random 53-bit significand and a */ +/* random exponent in [0, 511]. */ +/* */ +/*****************************************************************************/ + +/* +static double doublerand() +{ + double result; + double expo; + long a, b, c; + long i; + + a = random(); + b = random(); + c = random(); + result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8); + for (i = 512, expo = 2; i <= 131072; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* narrowdoublerand() Generate a double with random 53-bit significand */ +/* and a random exponent in [0, 7]. */ +/* */ +/*****************************************************************************/ + +/* +static double narrowdoublerand() +{ + double result; + double expo; + long a, b, c; + long i; + + a = random(); + b = random(); + c = random(); + result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8); + for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* uniformdoublerand() Generate a double with random 53-bit significand. */ +/* */ +/*****************************************************************************/ + +/* +static double uniformdoublerand() +{ + double result; + long a, b; + + a = random(); + b = random(); + result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8); + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* floatrand() Generate a float with random 24-bit significand and a */ +/* random exponent in [0, 63]. */ +/* */ +/*****************************************************************************/ + +/* +static float floatrand() +{ + float result; + float expo; + long a, c; + long i; + + a = random(); + c = random(); + result = (float) ((a - 1073741824) >> 6); + for (i = 512, expo = 2; i <= 16384; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* narrowfloatrand() Generate a float with random 24-bit significand and */ +/* a random exponent in [0, 7]. */ +/* */ +/*****************************************************************************/ + +/* +static float narrowfloatrand() +{ + float result; + float expo; + long a, c; + long i; + + a = random(); + c = random(); + result = (float) ((a - 1073741824) >> 6); + for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* uniformfloatrand() Generate a float with random 24-bit significand. */ +/* */ +/*****************************************************************************/ + +/* +static float uniformfloatrand() +{ + float result; + long a; + + a = random(); + result = (float) ((a - 1073741824) >> 6); + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* fast_expansion_sum_zeroelim() Sum two expansions, eliminating zero */ +/* components from the output expansion. */ +/* */ +/* Sets h = e + f. See the long version of my paper for details. */ +/* */ +/* If round-to-even is used (as with IEEE 754), maintains the strongly */ +/* nonoverlapping property. (That is, if e is strongly nonoverlapping, h */ +/* will be also.) Does NOT maintain the nonoverlapping or nonadjacent */ +/* properties. */ +/* */ +/*****************************************************************************/ + +static int fast_expansion_sum_zeroelim(int elen, REAL *e, + int flen, REAL *f, REAL *h) + /* h cannot be e or f. */ +{ + REAL Q; + INEXACT REAL Qnew; + INEXACT REAL hh; + INEXACT REAL bvirt; + REAL avirt, bround, around; + int eindex, findex, hindex; + REAL enow, fnow; + + enow = e[0]; + fnow = f[0]; + eindex = findex = 0; + if ((fnow > enow) == (fnow > -enow)) { + Q = enow; + enow = e[++eindex]; + } else { + Q = fnow; + fnow = f[++findex]; + } + hindex = 0; + if ((eindex < elen) && (findex < flen)) { + if ((fnow > enow) == (fnow > -enow)) { + Fast_Two_Sum(enow, Q, Qnew, hh); + enow = e[++eindex]; + } else { + Fast_Two_Sum(fnow, Q, Qnew, hh); + fnow = f[++findex]; + } + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + while ((eindex < elen) && (findex < flen)) { + if ((fnow > enow) == (fnow > -enow)) { + Two_Sum(Q, enow, Qnew, hh); + enow = e[++eindex]; + } else { + Two_Sum(Q, fnow, Qnew, hh); + fnow = f[++findex]; + } + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + } + while (eindex < elen) { + Two_Sum(Q, enow, Qnew, hh); + enow = e[++eindex]; + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + while (findex < flen) { + Two_Sum(Q, fnow, Qnew, hh); + fnow = f[++findex]; + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + if ((Q != 0.0) || (hindex == 0)) { + h[hindex++] = Q; + } + return hindex; +} + +/*****************************************************************************/ +/* */ +/* scale_expansion_zeroelim() Multiply an expansion by a scalar, */ +/* eliminating zero components from the */ +/* output expansion. */ +/* */ +/* Sets h = be. See either version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the strongly nonoverlapping and nonadjacent */ +/* properties as well. (That is, if e has one of these properties, so */ +/* will h.) */ +/* */ +/*****************************************************************************/ + +static int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h) + /* e and h cannot be the same. */ +{ + INEXACT REAL Q, sum; + REAL hh; + INEXACT REAL product1; + REAL product0; + int eindex, hindex; + REAL enow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + + Split(b, bhi, blo); + Two_Product_Presplit(e[0], b, bhi, blo, Q, hh); + hindex = 0; + if (hh != 0) { + h[hindex++] = hh; + } + for (eindex = 1; eindex < elen; eindex++) { + enow = e[eindex]; + Two_Product_Presplit(enow, b, bhi, blo, product1, product0); + Two_Sum(Q, product0, sum, hh); + if (hh != 0) { + h[hindex++] = hh; + } + Fast_Two_Sum(product1, sum, Q, hh); + if (hh != 0) { + h[hindex++] = hh; + } + } + if ((Q != 0.0) || (hindex == 0)) { + h[hindex++] = Q; + } + return hindex; +} + +/*****************************************************************************/ +/* */ +/* estimate() Produce a one-word estimate of an expansion's value. */ +/* */ +/* See either version of my paper for details. */ +/* */ +/*****************************************************************************/ + +static REAL estimate(int elen, REAL *e) +{ + REAL Q; + int eindex; + + Q = e[0]; + for (eindex = 1; eindex < elen; eindex++) { + Q += e[eindex]; + } + return Q; +} + +/*****************************************************************************/ +/* */ +/* orient2dfast() Approximate 2D orientation test. Nonrobust. */ +/* orient2dexact() Exact 2D orientation test. Robust. */ +/* orient2dslow() Another exact 2D orientation test. Robust. */ +/* orient2d() Adaptive exact 2D orientation test. Robust. */ +/* */ +/* Return a positive value if the points pa, pb, and pc occur */ +/* in counterclockwise order; a negative value if they occur */ +/* in clockwise order; and zero if they are collinear. The */ +/* result is also a rough approximation of twice the signed */ +/* area of the triangle defined by the three points. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In orient2d() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, orient2d() is usually quite */ +/* fast, but will run more slowly when the input points are collinear or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +static REAL orient2dadapt(REAL *pa, REAL *pb, REAL *pc, REAL detsum) +{ + INEXACT REAL acx, acy, bcx, bcy; + REAL acxtail, acytail, bcxtail, bcytail; + INEXACT REAL detleft, detright; + REAL detlefttail, detrighttail; + REAL det, errbound; + REAL B[4], C1[8], C2[12], D[16]; + INEXACT REAL B3; + int C1length, C2length, Dlength; + REAL u[4]; + INEXACT REAL u3; + INEXACT REAL s1, t1; + REAL s0, t0; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + acx = (REAL) (pa[0] - pc[0]); + bcx = (REAL) (pb[0] - pc[0]); + acy = (REAL) (pa[1] - pc[1]); + bcy = (REAL) (pb[1] - pc[1]); + + Two_Product(acx, bcy, detleft, detlefttail); + Two_Product(acy, bcx, detright, detrighttail); + + Two_Two_Diff(detleft, detlefttail, detright, detrighttail, + B3, B[2], B[1], B[0]); + B[3] = B3; + + det = estimate(4, B); + errbound = ccwerrboundB * detsum; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pc[0], acx, acxtail); + Two_Diff_Tail(pb[0], pc[0], bcx, bcxtail); + Two_Diff_Tail(pa[1], pc[1], acy, acytail); + Two_Diff_Tail(pb[1], pc[1], bcy, bcytail); + + if ((acxtail == 0.0) && (acytail == 0.0) + && (bcxtail == 0.0) && (bcytail == 0.0)) { + return det; + } + + errbound = ccwerrboundC * detsum + resulterrbound * Absolute(det); + det += (acx * bcytail + bcy * acxtail) + - (acy * bcxtail + bcx * acytail); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Product(acxtail, bcy, s1, s0); + Two_Product(acytail, bcx, t1, t0); + Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]); + u[3] = u3; + C1length = fast_expansion_sum_zeroelim(4, B, 4, u, C1); + + Two_Product(acx, bcytail, s1, s0); + Two_Product(acy, bcxtail, t1, t0); + Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]); + u[3] = u3; + C2length = fast_expansion_sum_zeroelim(C1length, C1, 4, u, C2); + + Two_Product(acxtail, bcytail, s1, s0); + Two_Product(acytail, bcxtail, t1, t0); + Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]); + u[3] = u3; + Dlength = fast_expansion_sum_zeroelim(C2length, C2, 4, u, D); + + return(D[Dlength - 1]); +} + +REAL orient2d(pa, pb, pc) +REAL *pa; +REAL *pb; +REAL *pc; +{ + REAL detleft, detright, det; + REAL detsum, errbound; + REAL orient; + + FPU_ROUND_DOUBLE; + + detleft = (pa[0] - pc[0]) * (pb[1] - pc[1]); + detright = (pa[1] - pc[1]) * (pb[0] - pc[0]); + det = detleft - detright; + + if (detleft > 0.0) { + if (detright <= 0.0) { + FPU_RESTORE; + return det; + } else { + detsum = detleft + detright; + } + } else if (detleft < 0.0) { + if (detright >= 0.0) { + FPU_RESTORE; + return det; + } else { + detsum = -detleft - detright; + } + } else { + FPU_RESTORE; + return det; + } + + errbound = ccwerrboundA * detsum; + if ((det >= errbound) || (-det >= errbound)) { + FPU_RESTORE; + return det; + } + + orient = orient2dadapt(pa, pb, pc, detsum); + FPU_RESTORE; + return orient; +} + +/*****************************************************************************/ +/* */ +/* orient3dfast() Approximate 3D orientation test. Nonrobust. */ +/* orient3dexact() Exact 3D orientation test. Robust. */ +/* orient3dslow() Another exact 3D orientation test. Robust. */ +/* orient3d() Adaptive exact 3D orientation test. Robust. */ +/* */ +/* Return a positive value if the point pd lies below the */ +/* plane passing through pa, pb, and pc; "below" is defined so */ +/* that pa, pb, and pc appear in counterclockwise order when */ +/* viewed from above the plane. Returns a negative value if */ +/* pd lies above the plane. Returns zero if the points are */ +/* coplanar. The result is also a rough approximation of six */ +/* times the signed volume of the tetrahedron defined by the */ +/* four points. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In orient3d() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, orient3d() is usually quite */ +/* fast, but will run more slowly when the input points are coplanar or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +static REAL orient3dadapt(REAL *pa, REAL *pb, REAL *pc, REAL *pd, + REAL permanent) +{ + INEXACT REAL adx, bdx, cdx, ady, bdy, cdy, adz, bdz, cdz; + REAL det, errbound; + + INEXACT REAL bdxcdy1, cdxbdy1, cdxady1, adxcdy1, adxbdy1, bdxady1; + REAL bdxcdy0, cdxbdy0, cdxady0, adxcdy0, adxbdy0, bdxady0; + REAL bc[4], ca[4], ab[4]; + INEXACT REAL bc3, ca3, ab3; + REAL adet[8], bdet[8], cdet[8]; + int alen, blen, clen; + REAL abdet[16]; + int ablen; + REAL *finnow, *finother, *finswap; + REAL fin1[192], fin2[192]; + int finlength; + + REAL adxtail, bdxtail, cdxtail; + REAL adytail, bdytail, cdytail; + REAL adztail, bdztail, cdztail; + INEXACT REAL at_blarge, at_clarge; + INEXACT REAL bt_clarge, bt_alarge; + INEXACT REAL ct_alarge, ct_blarge; + REAL at_b[4], at_c[4], bt_c[4], bt_a[4], ct_a[4], ct_b[4]; + int at_blen, at_clen, bt_clen, bt_alen, ct_alen, ct_blen; + INEXACT REAL bdxt_cdy1, cdxt_bdy1, cdxt_ady1; + INEXACT REAL adxt_cdy1, adxt_bdy1, bdxt_ady1; + REAL bdxt_cdy0, cdxt_bdy0, cdxt_ady0; + REAL adxt_cdy0, adxt_bdy0, bdxt_ady0; + INEXACT REAL bdyt_cdx1, cdyt_bdx1, cdyt_adx1; + INEXACT REAL adyt_cdx1, adyt_bdx1, bdyt_adx1; + REAL bdyt_cdx0, cdyt_bdx0, cdyt_adx0; + REAL adyt_cdx0, adyt_bdx0, bdyt_adx0; + REAL bct[8], cat[8], abt[8]; + int bctlen, catlen, abtlen; + INEXACT REAL bdxt_cdyt1, cdxt_bdyt1, cdxt_adyt1; + INEXACT REAL adxt_cdyt1, adxt_bdyt1, bdxt_adyt1; + REAL bdxt_cdyt0, cdxt_bdyt0, cdxt_adyt0; + REAL adxt_cdyt0, adxt_bdyt0, bdxt_adyt0; + REAL u[4], v[12], w[16]; + INEXACT REAL u3; + int vlength, wlength; + REAL negate; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j, _k; + REAL _0; + + adx = (REAL) (pa[0] - pd[0]); + bdx = (REAL) (pb[0] - pd[0]); + cdx = (REAL) (pc[0] - pd[0]); + ady = (REAL) (pa[1] - pd[1]); + bdy = (REAL) (pb[1] - pd[1]); + cdy = (REAL) (pc[1] - pd[1]); + adz = (REAL) (pa[2] - pd[2]); + bdz = (REAL) (pb[2] - pd[2]); + cdz = (REAL) (pc[2] - pd[2]); + + Two_Product(bdx, cdy, bdxcdy1, bdxcdy0); + Two_Product(cdx, bdy, cdxbdy1, cdxbdy0); + Two_Two_Diff(bdxcdy1, bdxcdy0, cdxbdy1, cdxbdy0, bc3, bc[2], bc[1], bc[0]); + bc[3] = bc3; + alen = scale_expansion_zeroelim(4, bc, adz, adet); + + Two_Product(cdx, ady, cdxady1, cdxady0); + Two_Product(adx, cdy, adxcdy1, adxcdy0); + Two_Two_Diff(cdxady1, cdxady0, adxcdy1, adxcdy0, ca3, ca[2], ca[1], ca[0]); + ca[3] = ca3; + blen = scale_expansion_zeroelim(4, ca, bdz, bdet); + + Two_Product(adx, bdy, adxbdy1, adxbdy0); + Two_Product(bdx, ady, bdxady1, bdxady0); + Two_Two_Diff(adxbdy1, adxbdy0, bdxady1, bdxady0, ab3, ab[2], ab[1], ab[0]); + ab[3] = ab3; + clen = scale_expansion_zeroelim(4, ab, cdz, cdet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + finlength = fast_expansion_sum_zeroelim(ablen, abdet, clen, cdet, fin1); + + det = estimate(finlength, fin1); + errbound = o3derrboundB * permanent; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pd[0], adx, adxtail); + Two_Diff_Tail(pb[0], pd[0], bdx, bdxtail); + Two_Diff_Tail(pc[0], pd[0], cdx, cdxtail); + Two_Diff_Tail(pa[1], pd[1], ady, adytail); + Two_Diff_Tail(pb[1], pd[1], bdy, bdytail); + Two_Diff_Tail(pc[1], pd[1], cdy, cdytail); + Two_Diff_Tail(pa[2], pd[2], adz, adztail); + Two_Diff_Tail(pb[2], pd[2], bdz, bdztail); + Two_Diff_Tail(pc[2], pd[2], cdz, cdztail); + + if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0) + && (adytail == 0.0) && (bdytail == 0.0) && (cdytail == 0.0) + && (adztail == 0.0) && (bdztail == 0.0) && (cdztail == 0.0)) { + return det; + } + + errbound = o3derrboundC * permanent + resulterrbound * Absolute(det); + det += (adz * ((bdx * cdytail + cdy * bdxtail) + - (bdy * cdxtail + cdx * bdytail)) + + adztail * (bdx * cdy - bdy * cdx)) + + (bdz * ((cdx * adytail + ady * cdxtail) + - (cdy * adxtail + adx * cdytail)) + + bdztail * (cdx * ady - cdy * adx)) + + (cdz * ((adx * bdytail + bdy * adxtail) + - (ady * bdxtail + bdx * adytail)) + + cdztail * (adx * bdy - ady * bdx)); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + finnow = fin1; + finother = fin2; + + if (adxtail == 0.0) { + if (adytail == 0.0) { + at_b[0] = 0.0; + at_blen = 1; + at_c[0] = 0.0; + at_clen = 1; + } else { + negate = -adytail; + Two_Product(negate, bdx, at_blarge, at_b[0]); + at_b[1] = at_blarge; + at_blen = 2; + Two_Product(adytail, cdx, at_clarge, at_c[0]); + at_c[1] = at_clarge; + at_clen = 2; + } + } else { + if (adytail == 0.0) { + Two_Product(adxtail, bdy, at_blarge, at_b[0]); + at_b[1] = at_blarge; + at_blen = 2; + negate = -adxtail; + Two_Product(negate, cdy, at_clarge, at_c[0]); + at_c[1] = at_clarge; + at_clen = 2; + } else { + Two_Product(adxtail, bdy, adxt_bdy1, adxt_bdy0); + Two_Product(adytail, bdx, adyt_bdx1, adyt_bdx0); + Two_Two_Diff(adxt_bdy1, adxt_bdy0, adyt_bdx1, adyt_bdx0, + at_blarge, at_b[2], at_b[1], at_b[0]); + at_b[3] = at_blarge; + at_blen = 4; + Two_Product(adytail, cdx, adyt_cdx1, adyt_cdx0); + Two_Product(adxtail, cdy, adxt_cdy1, adxt_cdy0); + Two_Two_Diff(adyt_cdx1, adyt_cdx0, adxt_cdy1, adxt_cdy0, + at_clarge, at_c[2], at_c[1], at_c[0]); + at_c[3] = at_clarge; + at_clen = 4; + } + } + if (bdxtail == 0.0) { + if (bdytail == 0.0) { + bt_c[0] = 0.0; + bt_clen = 1; + bt_a[0] = 0.0; + bt_alen = 1; + } else { + negate = -bdytail; + Two_Product(negate, cdx, bt_clarge, bt_c[0]); + bt_c[1] = bt_clarge; + bt_clen = 2; + Two_Product(bdytail, adx, bt_alarge, bt_a[0]); + bt_a[1] = bt_alarge; + bt_alen = 2; + } + } else { + if (bdytail == 0.0) { + Two_Product(bdxtail, cdy, bt_clarge, bt_c[0]); + bt_c[1] = bt_clarge; + bt_clen = 2; + negate = -bdxtail; + Two_Product(negate, ady, bt_alarge, bt_a[0]); + bt_a[1] = bt_alarge; + bt_alen = 2; + } else { + Two_Product(bdxtail, cdy, bdxt_cdy1, bdxt_cdy0); + Two_Product(bdytail, cdx, bdyt_cdx1, bdyt_cdx0); + Two_Two_Diff(bdxt_cdy1, bdxt_cdy0, bdyt_cdx1, bdyt_cdx0, + bt_clarge, bt_c[2], bt_c[1], bt_c[0]); + bt_c[3] = bt_clarge; + bt_clen = 4; + Two_Product(bdytail, adx, bdyt_adx1, bdyt_adx0); + Two_Product(bdxtail, ady, bdxt_ady1, bdxt_ady0); + Two_Two_Diff(bdyt_adx1, bdyt_adx0, bdxt_ady1, bdxt_ady0, + bt_alarge, bt_a[2], bt_a[1], bt_a[0]); + bt_a[3] = bt_alarge; + bt_alen = 4; + } + } + if (cdxtail == 0.0) { + if (cdytail == 0.0) { + ct_a[0] = 0.0; + ct_alen = 1; + ct_b[0] = 0.0; + ct_blen = 1; + } else { + negate = -cdytail; + Two_Product(negate, adx, ct_alarge, ct_a[0]); + ct_a[1] = ct_alarge; + ct_alen = 2; + Two_Product(cdytail, bdx, ct_blarge, ct_b[0]); + ct_b[1] = ct_blarge; + ct_blen = 2; + } + } else { + if (cdytail == 0.0) { + Two_Product(cdxtail, ady, ct_alarge, ct_a[0]); + ct_a[1] = ct_alarge; + ct_alen = 2; + negate = -cdxtail; + Two_Product(negate, bdy, ct_blarge, ct_b[0]); + ct_b[1] = ct_blarge; + ct_blen = 2; + } else { + Two_Product(cdxtail, ady, cdxt_ady1, cdxt_ady0); + Two_Product(cdytail, adx, cdyt_adx1, cdyt_adx0); + Two_Two_Diff(cdxt_ady1, cdxt_ady0, cdyt_adx1, cdyt_adx0, + ct_alarge, ct_a[2], ct_a[1], ct_a[0]); + ct_a[3] = ct_alarge; + ct_alen = 4; + Two_Product(cdytail, bdx, cdyt_bdx1, cdyt_bdx0); + Two_Product(cdxtail, bdy, cdxt_bdy1, cdxt_bdy0); + Two_Two_Diff(cdyt_bdx1, cdyt_bdx0, cdxt_bdy1, cdxt_bdy0, + ct_blarge, ct_b[2], ct_b[1], ct_b[0]); + ct_b[3] = ct_blarge; + ct_blen = 4; + } + } + + bctlen = fast_expansion_sum_zeroelim(bt_clen, bt_c, ct_blen, ct_b, bct); + wlength = scale_expansion_zeroelim(bctlen, bct, adz, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + + catlen = fast_expansion_sum_zeroelim(ct_alen, ct_a, at_clen, at_c, cat); + wlength = scale_expansion_zeroelim(catlen, cat, bdz, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + + abtlen = fast_expansion_sum_zeroelim(at_blen, at_b, bt_alen, bt_a, abt); + wlength = scale_expansion_zeroelim(abtlen, abt, cdz, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + + if (adztail != 0.0) { + vlength = scale_expansion_zeroelim(4, bc, adztail, v); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, vlength, v, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdztail != 0.0) { + vlength = scale_expansion_zeroelim(4, ca, bdztail, v); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, vlength, v, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdztail != 0.0) { + vlength = scale_expansion_zeroelim(4, ab, cdztail, v); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, vlength, v, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + if (adxtail != 0.0) { + if (bdytail != 0.0) { + Two_Product(adxtail, bdytail, adxt_bdyt1, adxt_bdyt0); + Two_One_Product(adxt_bdyt1, adxt_bdyt0, cdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (cdztail != 0.0) { + Two_One_Product(adxt_bdyt1, adxt_bdyt0, cdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if (cdytail != 0.0) { + negate = -adxtail; + Two_Product(negate, cdytail, adxt_cdyt1, adxt_cdyt0); + Two_One_Product(adxt_cdyt1, adxt_cdyt0, bdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (bdztail != 0.0) { + Two_One_Product(adxt_cdyt1, adxt_cdyt0, bdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + } + if (bdxtail != 0.0) { + if (cdytail != 0.0) { + Two_Product(bdxtail, cdytail, bdxt_cdyt1, bdxt_cdyt0); + Two_One_Product(bdxt_cdyt1, bdxt_cdyt0, adz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (adztail != 0.0) { + Two_One_Product(bdxt_cdyt1, bdxt_cdyt0, adztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if (adytail != 0.0) { + negate = -bdxtail; + Two_Product(negate, adytail, bdxt_adyt1, bdxt_adyt0); + Two_One_Product(bdxt_adyt1, bdxt_adyt0, cdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (cdztail != 0.0) { + Two_One_Product(bdxt_adyt1, bdxt_adyt0, cdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + } + if (cdxtail != 0.0) { + if (adytail != 0.0) { + Two_Product(cdxtail, adytail, cdxt_adyt1, cdxt_adyt0); + Two_One_Product(cdxt_adyt1, cdxt_adyt0, bdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (bdztail != 0.0) { + Two_One_Product(cdxt_adyt1, cdxt_adyt0, bdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if (bdytail != 0.0) { + negate = -cdxtail; + Two_Product(negate, bdytail, cdxt_bdyt1, cdxt_bdyt0); + Two_One_Product(cdxt_bdyt1, cdxt_bdyt0, adz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (adztail != 0.0) { + Two_One_Product(cdxt_bdyt1, cdxt_bdyt0, adztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + } + + if (adztail != 0.0) { + wlength = scale_expansion_zeroelim(bctlen, bct, adztail, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdztail != 0.0) { + wlength = scale_expansion_zeroelim(catlen, cat, bdztail, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdztail != 0.0) { + wlength = scale_expansion_zeroelim(abtlen, abt, cdztail, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + return finnow[finlength - 1]; +} + +REAL orient3d(pa, pb, pc, pd) +REAL *pa; +REAL *pb; +REAL *pc; +REAL *pd; +{ + REAL adx, bdx, cdx, ady, bdy, cdy, adz, bdz, cdz; + REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady; + REAL det; + REAL permanent, errbound; + REAL orient; + + FPU_ROUND_DOUBLE; + + adx = pa[0] - pd[0]; + bdx = pb[0] - pd[0]; + cdx = pc[0] - pd[0]; + ady = pa[1] - pd[1]; + bdy = pb[1] - pd[1]; + cdy = pc[1] - pd[1]; + adz = pa[2] - pd[2]; + bdz = pb[2] - pd[2]; + cdz = pc[2] - pd[2]; + + bdxcdy = bdx * cdy; + cdxbdy = cdx * bdy; + + cdxady = cdx * ady; + adxcdy = adx * cdy; + + adxbdy = adx * bdy; + bdxady = bdx * ady; + + det = adz * (bdxcdy - cdxbdy) + + bdz * (cdxady - adxcdy) + + cdz * (adxbdy - bdxady); + + permanent = (Absolute(bdxcdy) + Absolute(cdxbdy)) * Absolute(adz) + + (Absolute(cdxady) + Absolute(adxcdy)) * Absolute(bdz) + + (Absolute(adxbdy) + Absolute(bdxady)) * Absolute(cdz); + errbound = o3derrboundA * permanent; + if ((det > errbound) || (-det > errbound)) { + FPU_RESTORE; + return det; + } + + orient = orient3dadapt(pa, pb, pc, pd, permanent); + FPU_RESTORE; + return orient; +} + +/*****************************************************************************/ +/* */ +/* incirclefast() Approximate 2D incircle test. Nonrobust. */ +/* incircleexact() Exact 2D incircle test. Robust. */ +/* incircleslow() Another exact 2D incircle test. Robust. */ +/* incircle() Adaptive exact 2D incircle test. Robust. */ +/* */ +/* Return a positive value if the point pd lies inside the */ +/* circle passing through pa, pb, and pc; a negative value if */ +/* it lies outside; and zero if the four points are cocircular.*/ +/* The points pa, pb, and pc must be in counterclockwise */ +/* order, or the sign of the result will be reversed. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In incircle() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, incircle() is usually quite */ +/* fast, but will run more slowly when the input points are cocircular or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +static REAL incircleadapt(REAL *pa, REAL *pb, REAL *pc, REAL *pd, + REAL permanent) +{ + INEXACT REAL adx, bdx, cdx, ady, bdy, cdy; + REAL det, errbound; + + INEXACT REAL bdxcdy1, cdxbdy1, cdxady1, adxcdy1, adxbdy1, bdxady1; + REAL bdxcdy0, cdxbdy0, cdxady0, adxcdy0, adxbdy0, bdxady0; + REAL bc[4], ca[4], ab[4]; + INEXACT REAL bc3, ca3, ab3; + REAL axbc[8], axxbc[16], aybc[8], ayybc[16], adet[32]; + int axbclen, axxbclen, aybclen, ayybclen, alen; + REAL bxca[8], bxxca[16], byca[8], byyca[16], bdet[32]; + int bxcalen, bxxcalen, bycalen, byycalen, blen; + REAL cxab[8], cxxab[16], cyab[8], cyyab[16], cdet[32]; + int cxablen, cxxablen, cyablen, cyyablen, clen; + REAL abdet[64]; + int ablen; + REAL fin1[1152], fin2[1152]; + REAL *finnow, *finother, *finswap; + int finlength; + + REAL adxtail, bdxtail, cdxtail, adytail, bdytail, cdytail; + INEXACT REAL adxadx1, adyady1, bdxbdx1, bdybdy1, cdxcdx1, cdycdy1; + REAL adxadx0, adyady0, bdxbdx0, bdybdy0, cdxcdx0, cdycdy0; + REAL aa[4], bb[4], cc[4]; + INEXACT REAL aa3, bb3, cc3; + INEXACT REAL ti1, tj1; + REAL ti0, tj0; + REAL u[4], v[4]; + INEXACT REAL u3, v3; + REAL temp8[8], temp16a[16], temp16b[16], temp16c[16]; + REAL temp32a[32], temp32b[32], temp48[48], temp64[64]; + int temp8len, temp16alen, temp16blen, temp16clen; + int temp32alen, temp32blen, temp48len, temp64len; + REAL axtbb[8], axtcc[8], aytbb[8], aytcc[8]; + int axtbblen, axtcclen, aytbblen, aytcclen; + REAL bxtaa[8], bxtcc[8], bytaa[8], bytcc[8]; + int bxtaalen, bxtcclen, bytaalen, bytcclen; + REAL cxtaa[8], cxtbb[8], cytaa[8], cytbb[8]; + int cxtaalen, cxtbblen, cytaalen, cytbblen; + REAL axtbc[8], aytbc[8], bxtca[8], bytca[8], cxtab[8], cytab[8]; + int axtbclen = 0, aytbclen = 0; + int bxtcalen = 0, bytcalen = 0; + int cxtablen = 0, cytablen = 0; + REAL axtbct[16], aytbct[16], bxtcat[16], bytcat[16], cxtabt[16], cytabt[16]; + int axtbctlen, aytbctlen, bxtcatlen, bytcatlen, cxtabtlen, cytabtlen; + REAL axtbctt[8], aytbctt[8], bxtcatt[8]; + REAL bytcatt[8], cxtabtt[8], cytabtt[8]; + int axtbcttlen, aytbcttlen, bxtcattlen, bytcattlen, cxtabttlen, cytabttlen; + REAL abt[8], bct[8], cat[8]; + int abtlen, bctlen, catlen; + REAL abtt[4], bctt[4], catt[4]; + int abttlen, bcttlen, cattlen; + INEXACT REAL abtt3, bctt3, catt3; + REAL negate; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + adx = (REAL) (pa[0] - pd[0]); + bdx = (REAL) (pb[0] - pd[0]); + cdx = (REAL) (pc[0] - pd[0]); + ady = (REAL) (pa[1] - pd[1]); + bdy = (REAL) (pb[1] - pd[1]); + cdy = (REAL) (pc[1] - pd[1]); + + Two_Product(bdx, cdy, bdxcdy1, bdxcdy0); + Two_Product(cdx, bdy, cdxbdy1, cdxbdy0); + Two_Two_Diff(bdxcdy1, bdxcdy0, cdxbdy1, cdxbdy0, bc3, bc[2], bc[1], bc[0]); + bc[3] = bc3; + axbclen = scale_expansion_zeroelim(4, bc, adx, axbc); + axxbclen = scale_expansion_zeroelim(axbclen, axbc, adx, axxbc); + aybclen = scale_expansion_zeroelim(4, bc, ady, aybc); + ayybclen = scale_expansion_zeroelim(aybclen, aybc, ady, ayybc); + alen = fast_expansion_sum_zeroelim(axxbclen, axxbc, ayybclen, ayybc, adet); + + Two_Product(cdx, ady, cdxady1, cdxady0); + Two_Product(adx, cdy, adxcdy1, adxcdy0); + Two_Two_Diff(cdxady1, cdxady0, adxcdy1, adxcdy0, ca3, ca[2], ca[1], ca[0]); + ca[3] = ca3; + bxcalen = scale_expansion_zeroelim(4, ca, bdx, bxca); + bxxcalen = scale_expansion_zeroelim(bxcalen, bxca, bdx, bxxca); + bycalen = scale_expansion_zeroelim(4, ca, bdy, byca); + byycalen = scale_expansion_zeroelim(bycalen, byca, bdy, byyca); + blen = fast_expansion_sum_zeroelim(bxxcalen, bxxca, byycalen, byyca, bdet); + + Two_Product(adx, bdy, adxbdy1, adxbdy0); + Two_Product(bdx, ady, bdxady1, bdxady0); + Two_Two_Diff(adxbdy1, adxbdy0, bdxady1, bdxady0, ab3, ab[2], ab[1], ab[0]); + ab[3] = ab3; + cxablen = scale_expansion_zeroelim(4, ab, cdx, cxab); + cxxablen = scale_expansion_zeroelim(cxablen, cxab, cdx, cxxab); + cyablen = scale_expansion_zeroelim(4, ab, cdy, cyab); + cyyablen = scale_expansion_zeroelim(cyablen, cyab, cdy, cyyab); + clen = fast_expansion_sum_zeroelim(cxxablen, cxxab, cyyablen, cyyab, cdet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + finlength = fast_expansion_sum_zeroelim(ablen, abdet, clen, cdet, fin1); + + det = estimate(finlength, fin1); + errbound = iccerrboundB * permanent; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pd[0], adx, adxtail); + Two_Diff_Tail(pa[1], pd[1], ady, adytail); + Two_Diff_Tail(pb[0], pd[0], bdx, bdxtail); + Two_Diff_Tail(pb[1], pd[1], bdy, bdytail); + Two_Diff_Tail(pc[0], pd[0], cdx, cdxtail); + Two_Diff_Tail(pc[1], pd[1], cdy, cdytail); + if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0) + && (adytail == 0.0) && (bdytail == 0.0) && (cdytail == 0.0)) { + return det; + } + + errbound = iccerrboundC * permanent + resulterrbound * Absolute(det); + det += ((adx * adx + ady * ady) * ((bdx * cdytail + cdy * bdxtail) + - (bdy * cdxtail + cdx * bdytail)) + + 2.0 * (adx * adxtail + ady * adytail) * (bdx * cdy - bdy * cdx)) + + ((bdx * bdx + bdy * bdy) * ((cdx * adytail + ady * cdxtail) + - (cdy * adxtail + adx * cdytail)) + + 2.0 * (bdx * bdxtail + bdy * bdytail) * (cdx * ady - cdy * adx)) + + ((cdx * cdx + cdy * cdy) * ((adx * bdytail + bdy * adxtail) + - (ady * bdxtail + bdx * adytail)) + + 2.0 * (cdx * cdxtail + cdy * cdytail) * (adx * bdy - ady * bdx)); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + finnow = fin1; + finother = fin2; + + if ((bdxtail != 0.0) || (bdytail != 0.0) + || (cdxtail != 0.0) || (cdytail != 0.0)) { + Square(adx, adxadx1, adxadx0); + Square(ady, adyady1, adyady0); + Two_Two_Sum(adxadx1, adxadx0, adyady1, adyady0, aa3, aa[2], aa[1], aa[0]); + aa[3] = aa3; + } + if ((cdxtail != 0.0) || (cdytail != 0.0) + || (adxtail != 0.0) || (adytail != 0.0)) { + Square(bdx, bdxbdx1, bdxbdx0); + Square(bdy, bdybdy1, bdybdy0); + Two_Two_Sum(bdxbdx1, bdxbdx0, bdybdy1, bdybdy0, bb3, bb[2], bb[1], bb[0]); + bb[3] = bb3; + } + if ((adxtail != 0.0) || (adytail != 0.0) + || (bdxtail != 0.0) || (bdytail != 0.0)) { + Square(cdx, cdxcdx1, cdxcdx0); + Square(cdy, cdycdy1, cdycdy0); + Two_Two_Sum(cdxcdx1, cdxcdx0, cdycdy1, cdycdy0, cc3, cc[2], cc[1], cc[0]); + cc[3] = cc3; + } + + if (adxtail != 0.0) { + axtbclen = scale_expansion_zeroelim(4, bc, adxtail, axtbc); + temp16alen = scale_expansion_zeroelim(axtbclen, axtbc, 2.0 * adx, + temp16a); + + axtcclen = scale_expansion_zeroelim(4, cc, adxtail, axtcc); + temp16blen = scale_expansion_zeroelim(axtcclen, axtcc, bdy, temp16b); + + axtbblen = scale_expansion_zeroelim(4, bb, adxtail, axtbb); + temp16clen = scale_expansion_zeroelim(axtbblen, axtbb, -cdy, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (adytail != 0.0) { + aytbclen = scale_expansion_zeroelim(4, bc, adytail, aytbc); + temp16alen = scale_expansion_zeroelim(aytbclen, aytbc, 2.0 * ady, + temp16a); + + aytbblen = scale_expansion_zeroelim(4, bb, adytail, aytbb); + temp16blen = scale_expansion_zeroelim(aytbblen, aytbb, cdx, temp16b); + + aytcclen = scale_expansion_zeroelim(4, cc, adytail, aytcc); + temp16clen = scale_expansion_zeroelim(aytcclen, aytcc, -bdx, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdxtail != 0.0) { + bxtcalen = scale_expansion_zeroelim(4, ca, bdxtail, bxtca); + temp16alen = scale_expansion_zeroelim(bxtcalen, bxtca, 2.0 * bdx, + temp16a); + + bxtaalen = scale_expansion_zeroelim(4, aa, bdxtail, bxtaa); + temp16blen = scale_expansion_zeroelim(bxtaalen, bxtaa, cdy, temp16b); + + bxtcclen = scale_expansion_zeroelim(4, cc, bdxtail, bxtcc); + temp16clen = scale_expansion_zeroelim(bxtcclen, bxtcc, -ady, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdytail != 0.0) { + bytcalen = scale_expansion_zeroelim(4, ca, bdytail, bytca); + temp16alen = scale_expansion_zeroelim(bytcalen, bytca, 2.0 * bdy, + temp16a); + + bytcclen = scale_expansion_zeroelim(4, cc, bdytail, bytcc); + temp16blen = scale_expansion_zeroelim(bytcclen, bytcc, adx, temp16b); + + bytaalen = scale_expansion_zeroelim(4, aa, bdytail, bytaa); + temp16clen = scale_expansion_zeroelim(bytaalen, bytaa, -cdx, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdxtail != 0.0) { + cxtablen = scale_expansion_zeroelim(4, ab, cdxtail, cxtab); + temp16alen = scale_expansion_zeroelim(cxtablen, cxtab, 2.0 * cdx, + temp16a); + + cxtbblen = scale_expansion_zeroelim(4, bb, cdxtail, cxtbb); + temp16blen = scale_expansion_zeroelim(cxtbblen, cxtbb, ady, temp16b); + + cxtaalen = scale_expansion_zeroelim(4, aa, cdxtail, cxtaa); + temp16clen = scale_expansion_zeroelim(cxtaalen, cxtaa, -bdy, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdytail != 0.0) { + cytablen = scale_expansion_zeroelim(4, ab, cdytail, cytab); + temp16alen = scale_expansion_zeroelim(cytablen, cytab, 2.0 * cdy, + temp16a); + + cytaalen = scale_expansion_zeroelim(4, aa, cdytail, cytaa); + temp16blen = scale_expansion_zeroelim(cytaalen, cytaa, bdx, temp16b); + + cytbblen = scale_expansion_zeroelim(4, bb, cdytail, cytbb); + temp16clen = scale_expansion_zeroelim(cytbblen, cytbb, -adx, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + if ((adxtail != 0.0) || (adytail != 0.0)) { + if ((bdxtail != 0.0) || (bdytail != 0.0) + || (cdxtail != 0.0) || (cdytail != 0.0)) { + Two_Product(bdxtail, cdy, ti1, ti0); + Two_Product(bdx, cdytail, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]); + u[3] = u3; + negate = -bdy; + Two_Product(cdxtail, negate, ti1, ti0); + negate = -bdytail; + Two_Product(cdx, negate, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]); + v[3] = v3; + bctlen = fast_expansion_sum_zeroelim(4, u, 4, v, bct); + + Two_Product(bdxtail, cdytail, ti1, ti0); + Two_Product(cdxtail, bdytail, tj1, tj0); + Two_Two_Diff(ti1, ti0, tj1, tj0, bctt3, bctt[2], bctt[1], bctt[0]); + bctt[3] = bctt3; + bcttlen = 4; + } else { + bct[0] = 0.0; + bctlen = 1; + bctt[0] = 0.0; + bcttlen = 1; + } + + if (adxtail != 0.0) { + temp16alen = scale_expansion_zeroelim(axtbclen, axtbc, adxtail, temp16a); + axtbctlen = scale_expansion_zeroelim(bctlen, bct, adxtail, axtbct); + temp32alen = scale_expansion_zeroelim(axtbctlen, axtbct, 2.0 * adx, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + if (bdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, cc, adxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, bdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, bb, -adxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, cdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + temp32alen = scale_expansion_zeroelim(axtbctlen, axtbct, adxtail, + temp32a); + axtbcttlen = scale_expansion_zeroelim(bcttlen, bctt, adxtail, axtbctt); + temp16alen = scale_expansion_zeroelim(axtbcttlen, axtbctt, 2.0 * adx, + temp16a); + temp16blen = scale_expansion_zeroelim(axtbcttlen, axtbctt, adxtail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (adytail != 0.0) { + temp16alen = scale_expansion_zeroelim(aytbclen, aytbc, adytail, temp16a); + aytbctlen = scale_expansion_zeroelim(bctlen, bct, adytail, aytbct); + temp32alen = scale_expansion_zeroelim(aytbctlen, aytbct, 2.0 * ady, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + + + temp32alen = scale_expansion_zeroelim(aytbctlen, aytbct, adytail, + temp32a); + aytbcttlen = scale_expansion_zeroelim(bcttlen, bctt, adytail, aytbctt); + temp16alen = scale_expansion_zeroelim(aytbcttlen, aytbctt, 2.0 * ady, + temp16a); + temp16blen = scale_expansion_zeroelim(aytbcttlen, aytbctt, adytail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if ((bdxtail != 0.0) || (bdytail != 0.0)) { + if ((cdxtail != 0.0) || (cdytail != 0.0) + || (adxtail != 0.0) || (adytail != 0.0)) { + Two_Product(cdxtail, ady, ti1, ti0); + Two_Product(cdx, adytail, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]); + u[3] = u3; + negate = -cdy; + Two_Product(adxtail, negate, ti1, ti0); + negate = -cdytail; + Two_Product(adx, negate, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]); + v[3] = v3; + catlen = fast_expansion_sum_zeroelim(4, u, 4, v, cat); + + Two_Product(cdxtail, adytail, ti1, ti0); + Two_Product(adxtail, cdytail, tj1, tj0); + Two_Two_Diff(ti1, ti0, tj1, tj0, catt3, catt[2], catt[1], catt[0]); + catt[3] = catt3; + cattlen = 4; + } else { + cat[0] = 0.0; + catlen = 1; + catt[0] = 0.0; + cattlen = 1; + } + + if (bdxtail != 0.0) { + temp16alen = scale_expansion_zeroelim(bxtcalen, bxtca, bdxtail, temp16a); + bxtcatlen = scale_expansion_zeroelim(catlen, cat, bdxtail, bxtcat); + temp32alen = scale_expansion_zeroelim(bxtcatlen, bxtcat, 2.0 * bdx, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + if (cdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, aa, bdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, cdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (adytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, cc, -bdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, adytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + temp32alen = scale_expansion_zeroelim(bxtcatlen, bxtcat, bdxtail, + temp32a); + bxtcattlen = scale_expansion_zeroelim(cattlen, catt, bdxtail, bxtcatt); + temp16alen = scale_expansion_zeroelim(bxtcattlen, bxtcatt, 2.0 * bdx, + temp16a); + temp16blen = scale_expansion_zeroelim(bxtcattlen, bxtcatt, bdxtail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdytail != 0.0) { + temp16alen = scale_expansion_zeroelim(bytcalen, bytca, bdytail, temp16a); + bytcatlen = scale_expansion_zeroelim(catlen, cat, bdytail, bytcat); + temp32alen = scale_expansion_zeroelim(bytcatlen, bytcat, 2.0 * bdy, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + + + temp32alen = scale_expansion_zeroelim(bytcatlen, bytcat, bdytail, + temp32a); + bytcattlen = scale_expansion_zeroelim(cattlen, catt, bdytail, bytcatt); + temp16alen = scale_expansion_zeroelim(bytcattlen, bytcatt, 2.0 * bdy, + temp16a); + temp16blen = scale_expansion_zeroelim(bytcattlen, bytcatt, bdytail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if ((cdxtail != 0.0) || (cdytail != 0.0)) { + if ((adxtail != 0.0) || (adytail != 0.0) + || (bdxtail != 0.0) || (bdytail != 0.0)) { + Two_Product(adxtail, bdy, ti1, ti0); + Two_Product(adx, bdytail, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]); + u[3] = u3; + negate = -ady; + Two_Product(bdxtail, negate, ti1, ti0); + negate = -adytail; + Two_Product(bdx, negate, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]); + v[3] = v3; + abtlen = fast_expansion_sum_zeroelim(4, u, 4, v, abt); + + Two_Product(adxtail, bdytail, ti1, ti0); + Two_Product(bdxtail, adytail, tj1, tj0); + Two_Two_Diff(ti1, ti0, tj1, tj0, abtt3, abtt[2], abtt[1], abtt[0]); + abtt[3] = abtt3; + abttlen = 4; + } else { + abt[0] = 0.0; + abtlen = 1; + abtt[0] = 0.0; + abttlen = 1; + } + + if (cdxtail != 0.0) { + temp16alen = scale_expansion_zeroelim(cxtablen, cxtab, cdxtail, temp16a); + cxtabtlen = scale_expansion_zeroelim(abtlen, abt, cdxtail, cxtabt); + temp32alen = scale_expansion_zeroelim(cxtabtlen, cxtabt, 2.0 * cdx, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + if (adytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, bb, cdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, adytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, aa, -cdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, bdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + temp32alen = scale_expansion_zeroelim(cxtabtlen, cxtabt, cdxtail, + temp32a); + cxtabttlen = scale_expansion_zeroelim(abttlen, abtt, cdxtail, cxtabtt); + temp16alen = scale_expansion_zeroelim(cxtabttlen, cxtabtt, 2.0 * cdx, + temp16a); + temp16blen = scale_expansion_zeroelim(cxtabttlen, cxtabtt, cdxtail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdytail != 0.0) { + temp16alen = scale_expansion_zeroelim(cytablen, cytab, cdytail, temp16a); + cytabtlen = scale_expansion_zeroelim(abtlen, abt, cdytail, cytabt); + temp32alen = scale_expansion_zeroelim(cytabtlen, cytabt, 2.0 * cdy, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + + + temp32alen = scale_expansion_zeroelim(cytabtlen, cytabt, cdytail, + temp32a); + cytabttlen = scale_expansion_zeroelim(abttlen, abtt, cdytail, cytabtt); + temp16alen = scale_expansion_zeroelim(cytabttlen, cytabtt, 2.0 * cdy, + temp16a); + temp16blen = scale_expansion_zeroelim(cytabttlen, cytabtt, cdytail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + + return finnow[finlength - 1]; +} + +REAL incircle(pa, pb, pc, pd) +REAL *pa; +REAL *pb; +REAL *pc; +REAL *pd; +{ + REAL adx, bdx, cdx, ady, bdy, cdy; + REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady; + REAL alift, blift, clift; + REAL det; + REAL permanent, errbound; + REAL inc; + + FPU_ROUND_DOUBLE; + + adx = pa[0] - pd[0]; + bdx = pb[0] - pd[0]; + cdx = pc[0] - pd[0]; + ady = pa[1] - pd[1]; + bdy = pb[1] - pd[1]; + cdy = pc[1] - pd[1]; + + bdxcdy = bdx * cdy; + cdxbdy = cdx * bdy; + alift = adx * adx + ady * ady; + + cdxady = cdx * ady; + adxcdy = adx * cdy; + blift = bdx * bdx + bdy * bdy; + + adxbdy = adx * bdy; + bdxady = bdx * ady; + clift = cdx * cdx + cdy * cdy; + + det = alift * (bdxcdy - cdxbdy) + + blift * (cdxady - adxcdy) + + clift * (adxbdy - bdxady); + + permanent = (Absolute(bdxcdy) + Absolute(cdxbdy)) * alift + + (Absolute(cdxady) + Absolute(adxcdy)) * blift + + (Absolute(adxbdy) + Absolute(bdxady)) * clift; + errbound = iccerrboundA * permanent; + if ((det > errbound) || (-det > errbound)) { + FPU_RESTORE; + return det; + } + + inc = incircleadapt(pa, pb, pc, pd, permanent); + FPU_RESTORE; + return inc; +} + +/*****************************************************************************/ +/* */ +/* inspherefast() Approximate 3D insphere test. Nonrobust. */ +/* insphereexact() Exact 3D insphere test. Robust. */ +/* insphereslow() Another exact 3D insphere test. Robust. */ +/* insphere() Adaptive exact 3D insphere test. Robust. */ +/* */ +/* Return a positive value if the point pe lies inside the */ +/* sphere passing through pa, pb, pc, and pd; a negative value */ +/* if it lies outside; and zero if the five points are */ +/* cospherical. The points pa, pb, pc, and pd must be ordered */ +/* so that they have a positive orientation (as defined by */ +/* orient3d()), or the sign of the result will be reversed. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In insphere() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, insphere() is usually quite */ +/* fast, but will run more slowly when the input points are cospherical or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +static REAL insphereexact(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe) +{ + INEXACT REAL axby1, bxcy1, cxdy1, dxey1, exay1; + INEXACT REAL bxay1, cxby1, dxcy1, exdy1, axey1; + INEXACT REAL axcy1, bxdy1, cxey1, dxay1, exby1; + INEXACT REAL cxay1, dxby1, excy1, axdy1, bxey1; + REAL axby0, bxcy0, cxdy0, dxey0, exay0; + REAL bxay0, cxby0, dxcy0, exdy0, axey0; + REAL axcy0, bxdy0, cxey0, dxay0, exby0; + REAL cxay0, dxby0, excy0, axdy0, bxey0; + REAL ab[4], bc[4], cd[4], de[4], ea[4]; + REAL ac[4], bd[4], ce[4], da[4], eb[4]; + REAL temp8a[8], temp8b[8], temp16[16]; + int temp8alen, temp8blen, temp16len; + REAL abc[24], bcd[24], cde[24], dea[24], eab[24]; + REAL abd[24], bce[24], cda[24], deb[24], eac[24]; + int abclen, bcdlen, cdelen, dealen, eablen; + int abdlen, bcelen, cdalen, deblen, eaclen; + REAL temp48a[48], temp48b[48]; + int temp48alen, temp48blen; + REAL abcd[96], bcde[96], cdea[96], deab[96], eabc[96]; + int abcdlen, bcdelen, cdealen, deablen, eabclen; + REAL temp192[192]; + REAL det384x[384], det384y[384], det384z[384]; + int xlen, ylen, zlen; + REAL detxy[768]; + int xylen; + REAL adet[1152], bdet[1152], cdet[1152], ddet[1152], edet[1152]; + int alen, blen, clen, dlen, elen; + REAL abdet[2304], cddet[2304], cdedet[3456]; + int ablen, cdlen; + REAL deter[5760]; + int deterlen; + int i; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + Two_Product(pa[0], pb[1], axby1, axby0); + Two_Product(pb[0], pa[1], bxay1, bxay0); + Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]); + + Two_Product(pb[0], pc[1], bxcy1, bxcy0); + Two_Product(pc[0], pb[1], cxby1, cxby0); + Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]); + + Two_Product(pc[0], pd[1], cxdy1, cxdy0); + Two_Product(pd[0], pc[1], dxcy1, dxcy0); + Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]); + + Two_Product(pd[0], pe[1], dxey1, dxey0); + Two_Product(pe[0], pd[1], exdy1, exdy0); + Two_Two_Diff(dxey1, dxey0, exdy1, exdy0, de[3], de[2], de[1], de[0]); + + Two_Product(pe[0], pa[1], exay1, exay0); + Two_Product(pa[0], pe[1], axey1, axey0); + Two_Two_Diff(exay1, exay0, axey1, axey0, ea[3], ea[2], ea[1], ea[0]); + + Two_Product(pa[0], pc[1], axcy1, axcy0); + Two_Product(pc[0], pa[1], cxay1, cxay0); + Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]); + + Two_Product(pb[0], pd[1], bxdy1, bxdy0); + Two_Product(pd[0], pb[1], dxby1, dxby0); + Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]); + + Two_Product(pc[0], pe[1], cxey1, cxey0); + Two_Product(pe[0], pc[1], excy1, excy0); + Two_Two_Diff(cxey1, cxey0, excy1, excy0, ce[3], ce[2], ce[1], ce[0]); + + Two_Product(pd[0], pa[1], dxay1, dxay0); + Two_Product(pa[0], pd[1], axdy1, axdy0); + Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]); + + Two_Product(pe[0], pb[1], exby1, exby0); + Two_Product(pb[0], pe[1], bxey1, bxey0); + Two_Two_Diff(exby1, exby0, bxey1, bxey0, eb[3], eb[2], eb[1], eb[0]); + + temp8alen = scale_expansion_zeroelim(4, bc, pa[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, -pb[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ab, pc[2], temp8a); + abclen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + abc); + + temp8alen = scale_expansion_zeroelim(4, cd, pb[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, -pc[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, bc, pd[2], temp8a); + bcdlen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + bcd); + + temp8alen = scale_expansion_zeroelim(4, de, pc[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ce, -pd[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, cd, pe[2], temp8a); + cdelen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + cde); + + temp8alen = scale_expansion_zeroelim(4, ea, pd[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, da, -pe[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, de, pa[2], temp8a); + dealen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + dea); + + temp8alen = scale_expansion_zeroelim(4, ab, pe[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, eb, -pa[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ea, pb[2], temp8a); + eablen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + eab); + + temp8alen = scale_expansion_zeroelim(4, bd, pa[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, da, pb[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ab, pd[2], temp8a); + abdlen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + abd); + + temp8alen = scale_expansion_zeroelim(4, ce, pb[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, eb, pc[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, bc, pe[2], temp8a); + bcelen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + bce); + + temp8alen = scale_expansion_zeroelim(4, da, pc[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, pd[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, cd, pa[2], temp8a); + cdalen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + cda); + + temp8alen = scale_expansion_zeroelim(4, eb, pd[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, pe[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, de, pb[2], temp8a); + deblen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + deb); + + temp8alen = scale_expansion_zeroelim(4, ac, pe[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ce, pa[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ea, pc[2], temp8a); + eaclen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + eac); + + temp48alen = fast_expansion_sum_zeroelim(cdelen, cde, bcelen, bce, temp48a); + temp48blen = fast_expansion_sum_zeroelim(deblen, deb, bcdlen, bcd, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + bcdelen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, bcde); + xlen = scale_expansion_zeroelim(bcdelen, bcde, pa[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pa[0], det384x); + ylen = scale_expansion_zeroelim(bcdelen, bcde, pa[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pa[1], det384y); + zlen = scale_expansion_zeroelim(bcdelen, bcde, pa[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pa[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + alen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, adet); + + temp48alen = fast_expansion_sum_zeroelim(dealen, dea, cdalen, cda, temp48a); + temp48blen = fast_expansion_sum_zeroelim(eaclen, eac, cdelen, cde, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + cdealen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, cdea); + xlen = scale_expansion_zeroelim(cdealen, cdea, pb[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pb[0], det384x); + ylen = scale_expansion_zeroelim(cdealen, cdea, pb[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pb[1], det384y); + zlen = scale_expansion_zeroelim(cdealen, cdea, pb[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pb[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + blen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, bdet); + + temp48alen = fast_expansion_sum_zeroelim(eablen, eab, deblen, deb, temp48a); + temp48blen = fast_expansion_sum_zeroelim(abdlen, abd, dealen, dea, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + deablen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, deab); + xlen = scale_expansion_zeroelim(deablen, deab, pc[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pc[0], det384x); + ylen = scale_expansion_zeroelim(deablen, deab, pc[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pc[1], det384y); + zlen = scale_expansion_zeroelim(deablen, deab, pc[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pc[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + clen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, cdet); + + temp48alen = fast_expansion_sum_zeroelim(abclen, abc, eaclen, eac, temp48a); + temp48blen = fast_expansion_sum_zeroelim(bcelen, bce, eablen, eab, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + eabclen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, eabc); + xlen = scale_expansion_zeroelim(eabclen, eabc, pd[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pd[0], det384x); + ylen = scale_expansion_zeroelim(eabclen, eabc, pd[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pd[1], det384y); + zlen = scale_expansion_zeroelim(eabclen, eabc, pd[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pd[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + dlen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, ddet); + + temp48alen = fast_expansion_sum_zeroelim(bcdlen, bcd, abdlen, abd, temp48a); + temp48blen = fast_expansion_sum_zeroelim(cdalen, cda, abclen, abc, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + abcdlen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, abcd); + xlen = scale_expansion_zeroelim(abcdlen, abcd, pe[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pe[0], det384x); + ylen = scale_expansion_zeroelim(abcdlen, abcd, pe[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pe[1], det384y); + zlen = scale_expansion_zeroelim(abcdlen, abcd, pe[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pe[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + elen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, edet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + cdlen = fast_expansion_sum_zeroelim(clen, cdet, dlen, ddet, cddet); + cdelen = fast_expansion_sum_zeroelim(cdlen, cddet, elen, edet, cdedet); + deterlen = fast_expansion_sum_zeroelim(ablen, abdet, cdelen, cdedet, deter); + + return deter[deterlen - 1]; +} + +static REAL insphereadapt(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe, + REAL permanent) +{ + INEXACT REAL aex, bex, cex, dex, aey, bey, cey, dey, aez, bez, cez, dez; + REAL det, errbound; + + INEXACT REAL aexbey1, bexaey1, bexcey1, cexbey1; + INEXACT REAL cexdey1, dexcey1, dexaey1, aexdey1; + INEXACT REAL aexcey1, cexaey1, bexdey1, dexbey1; + REAL aexbey0, bexaey0, bexcey0, cexbey0; + REAL cexdey0, dexcey0, dexaey0, aexdey0; + REAL aexcey0, cexaey0, bexdey0, dexbey0; + REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4]; + INEXACT REAL ab3, bc3, cd3, da3, ac3, bd3; + REAL abeps, bceps, cdeps, daeps, aceps, bdeps; + REAL temp8a[8], temp8b[8], temp8c[8], temp16[16], temp24[24], temp48[48]; + int temp8alen, temp8blen, temp8clen, temp16len, temp24len, temp48len; + REAL xdet[96], ydet[96], zdet[96], xydet[192]; + int xlen, ylen, zlen, xylen; + REAL adet[288], bdet[288], cdet[288], ddet[288]; + int alen, blen, clen, dlen; + REAL abdet[576], cddet[576]; + int ablen, cdlen; + REAL fin1[1152]; + int finlength; + + REAL aextail, bextail, cextail, dextail; + REAL aeytail, beytail, ceytail, deytail; + REAL aeztail, beztail, ceztail, deztail; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + aex = (REAL) (pa[0] - pe[0]); + bex = (REAL) (pb[0] - pe[0]); + cex = (REAL) (pc[0] - pe[0]); + dex = (REAL) (pd[0] - pe[0]); + aey = (REAL) (pa[1] - pe[1]); + bey = (REAL) (pb[1] - pe[1]); + cey = (REAL) (pc[1] - pe[1]); + dey = (REAL) (pd[1] - pe[1]); + aez = (REAL) (pa[2] - pe[2]); + bez = (REAL) (pb[2] - pe[2]); + cez = (REAL) (pc[2] - pe[2]); + dez = (REAL) (pd[2] - pe[2]); + + Two_Product(aex, bey, aexbey1, aexbey0); + Two_Product(bex, aey, bexaey1, bexaey0); + Two_Two_Diff(aexbey1, aexbey0, bexaey1, bexaey0, ab3, ab[2], ab[1], ab[0]); + ab[3] = ab3; + + Two_Product(bex, cey, bexcey1, bexcey0); + Two_Product(cex, bey, cexbey1, cexbey0); + Two_Two_Diff(bexcey1, bexcey0, cexbey1, cexbey0, bc3, bc[2], bc[1], bc[0]); + bc[3] = bc3; + + Two_Product(cex, dey, cexdey1, cexdey0); + Two_Product(dex, cey, dexcey1, dexcey0); + Two_Two_Diff(cexdey1, cexdey0, dexcey1, dexcey0, cd3, cd[2], cd[1], cd[0]); + cd[3] = cd3; + + Two_Product(dex, aey, dexaey1, dexaey0); + Two_Product(aex, dey, aexdey1, aexdey0); + Two_Two_Diff(dexaey1, dexaey0, aexdey1, aexdey0, da3, da[2], da[1], da[0]); + da[3] = da3; + + Two_Product(aex, cey, aexcey1, aexcey0); + Two_Product(cex, aey, cexaey1, cexaey0); + Two_Two_Diff(aexcey1, aexcey0, cexaey1, cexaey0, ac3, ac[2], ac[1], ac[0]); + ac[3] = ac3; + + Two_Product(bex, dey, bexdey1, bexdey0); + Two_Product(dex, bey, dexbey1, dexbey0); + Two_Two_Diff(bexdey1, bexdey0, dexbey1, dexbey0, bd3, bd[2], bd[1], bd[0]); + bd[3] = bd3; + + temp8alen = scale_expansion_zeroelim(4, cd, bez, temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, -cez, temp8b); + temp8clen = scale_expansion_zeroelim(4, bc, dez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, aex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, -aex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, aey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, -aey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, aez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, -aez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + alen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, adet); + + temp8alen = scale_expansion_zeroelim(4, da, cez, temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, dez, temp8b); + temp8clen = scale_expansion_zeroelim(4, cd, aez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, bex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, bex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, bey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, bey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, bez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, bez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + blen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, bdet); + + temp8alen = scale_expansion_zeroelim(4, ab, dez, temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, aez, temp8b); + temp8clen = scale_expansion_zeroelim(4, da, bez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, cex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, -cex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, cey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, -cey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, cez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, -cez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + clen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, cdet); + + temp8alen = scale_expansion_zeroelim(4, bc, aez, temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, -bez, temp8b); + temp8clen = scale_expansion_zeroelim(4, ab, cez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, dex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, dex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, dey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, dey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, dez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, dez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + dlen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, ddet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + cdlen = fast_expansion_sum_zeroelim(clen, cdet, dlen, ddet, cddet); + finlength = fast_expansion_sum_zeroelim(ablen, abdet, cdlen, cddet, fin1); + + det = estimate(finlength, fin1); + errbound = isperrboundB * permanent; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pe[0], aex, aextail); + Two_Diff_Tail(pa[1], pe[1], aey, aeytail); + Two_Diff_Tail(pa[2], pe[2], aez, aeztail); + Two_Diff_Tail(pb[0], pe[0], bex, bextail); + Two_Diff_Tail(pb[1], pe[1], bey, beytail); + Two_Diff_Tail(pb[2], pe[2], bez, beztail); + Two_Diff_Tail(pc[0], pe[0], cex, cextail); + Two_Diff_Tail(pc[1], pe[1], cey, ceytail); + Two_Diff_Tail(pc[2], pe[2], cez, ceztail); + Two_Diff_Tail(pd[0], pe[0], dex, dextail); + Two_Diff_Tail(pd[1], pe[1], dey, deytail); + Two_Diff_Tail(pd[2], pe[2], dez, deztail); + if ((aextail == 0.0) && (aeytail == 0.0) && (aeztail == 0.0) + && (bextail == 0.0) && (beytail == 0.0) && (beztail == 0.0) + && (cextail == 0.0) && (ceytail == 0.0) && (ceztail == 0.0) + && (dextail == 0.0) && (deytail == 0.0) && (deztail == 0.0)) { + return det; + } + + errbound = isperrboundC * permanent + resulterrbound * Absolute(det); + abeps = (aex * beytail + bey * aextail) + - (aey * bextail + bex * aeytail); + bceps = (bex * ceytail + cey * bextail) + - (bey * cextail + cex * beytail); + cdeps = (cex * deytail + dey * cextail) + - (cey * dextail + dex * ceytail); + daeps = (dex * aeytail + aey * dextail) + - (dey * aextail + aex * deytail); + aceps = (aex * ceytail + cey * aextail) + - (aey * cextail + cex * aeytail); + bdeps = (bex * deytail + dey * bextail) + - (bey * dextail + dex * beytail); + det += (((bex * bex + bey * bey + bez * bez) + * ((cez * daeps + dez * aceps + aez * cdeps) + + (ceztail * da3 + deztail * ac3 + aeztail * cd3)) + + (dex * dex + dey * dey + dez * dez) + * ((aez * bceps - bez * aceps + cez * abeps) + + (aeztail * bc3 - beztail * ac3 + ceztail * ab3))) + - ((aex * aex + aey * aey + aez * aez) + * ((bez * cdeps - cez * bdeps + dez * bceps) + + (beztail * cd3 - ceztail * bd3 + deztail * bc3)) + + (cex * cex + cey * cey + cez * cez) + * ((dez * abeps + aez * bdeps + bez * daeps) + + (deztail * ab3 + aeztail * bd3 + beztail * da3)))) + + 2.0 * (((bex * bextail + bey * beytail + bez * beztail) + * (cez * da3 + dez * ac3 + aez * cd3) + + (dex * dextail + dey * deytail + dez * deztail) + * (aez * bc3 - bez * ac3 + cez * ab3)) + - ((aex * aextail + aey * aeytail + aez * aeztail) + * (bez * cd3 - cez * bd3 + dez * bc3) + + (cex * cextail + cey * ceytail + cez * ceztail) + * (dez * ab3 + aez * bd3 + bez * da3))); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + return insphereexact(pa, pb, pc, pd, pe); +} + +REAL insphere(pa, pb, pc, pd, pe) +REAL *pa; +REAL *pb; +REAL *pc; +REAL *pd; +REAL *pe; +{ + REAL aex, bex, cex, dex; + REAL aey, bey, cey, dey; + REAL aez, bez, cez, dez; + REAL aexbey, bexaey, bexcey, cexbey, cexdey, dexcey, dexaey, aexdey; + REAL aexcey, cexaey, bexdey, dexbey; + REAL alift, blift, clift, dlift; + REAL ab, bc, cd, da, ac, bd; + REAL abc, bcd, cda, dab; + REAL aezplus, bezplus, cezplus, dezplus; + REAL aexbeyplus, bexaeyplus, bexceyplus, cexbeyplus; + REAL cexdeyplus, dexceyplus, dexaeyplus, aexdeyplus; + REAL aexceyplus, cexaeyplus, bexdeyplus, dexbeyplus; + REAL det; + REAL permanent, errbound; + REAL ins; + + FPU_ROUND_DOUBLE; + + aex = pa[0] - pe[0]; + bex = pb[0] - pe[0]; + cex = pc[0] - pe[0]; + dex = pd[0] - pe[0]; + aey = pa[1] - pe[1]; + bey = pb[1] - pe[1]; + cey = pc[1] - pe[1]; + dey = pd[1] - pe[1]; + aez = pa[2] - pe[2]; + bez = pb[2] - pe[2]; + cez = pc[2] - pe[2]; + dez = pd[2] - pe[2]; + + aexbey = aex * bey; + bexaey = bex * aey; + ab = aexbey - bexaey; + bexcey = bex * cey; + cexbey = cex * bey; + bc = bexcey - cexbey; + cexdey = cex * dey; + dexcey = dex * cey; + cd = cexdey - dexcey; + dexaey = dex * aey; + aexdey = aex * dey; + da = dexaey - aexdey; + + aexcey = aex * cey; + cexaey = cex * aey; + ac = aexcey - cexaey; + bexdey = bex * dey; + dexbey = dex * bey; + bd = bexdey - dexbey; + + abc = aez * bc - bez * ac + cez * ab; + bcd = bez * cd - cez * bd + dez * bc; + cda = cez * da + dez * ac + aez * cd; + dab = dez * ab + aez * bd + bez * da; + + alift = aex * aex + aey * aey + aez * aez; + blift = bex * bex + bey * bey + bez * bez; + clift = cex * cex + cey * cey + cez * cez; + dlift = dex * dex + dey * dey + dez * dez; + + det = (dlift * abc - clift * dab) + (blift * cda - alift * bcd); + + aezplus = Absolute(aez); + bezplus = Absolute(bez); + cezplus = Absolute(cez); + dezplus = Absolute(dez); + aexbeyplus = Absolute(aexbey); + bexaeyplus = Absolute(bexaey); + bexceyplus = Absolute(bexcey); + cexbeyplus = Absolute(cexbey); + cexdeyplus = Absolute(cexdey); + dexceyplus = Absolute(dexcey); + dexaeyplus = Absolute(dexaey); + aexdeyplus = Absolute(aexdey); + aexceyplus = Absolute(aexcey); + cexaeyplus = Absolute(cexaey); + bexdeyplus = Absolute(bexdey); + dexbeyplus = Absolute(dexbey); + permanent = ((cexdeyplus + dexceyplus) * bezplus + + (dexbeyplus + bexdeyplus) * cezplus + + (bexceyplus + cexbeyplus) * dezplus) + * alift + + ((dexaeyplus + aexdeyplus) * cezplus + + (aexceyplus + cexaeyplus) * dezplus + + (cexdeyplus + dexceyplus) * aezplus) + * blift + + ((aexbeyplus + bexaeyplus) * dezplus + + (bexdeyplus + dexbeyplus) * aezplus + + (dexaeyplus + aexdeyplus) * bezplus) + * clift + + ((bexceyplus + cexbeyplus) * aezplus + + (cexaeyplus + aexceyplus) * bezplus + + (aexbeyplus + bexaeyplus) * cezplus) + * dlift; + errbound = isperrboundA * permanent; + if ((det > errbound) || (-det > errbound)) { + FPU_RESTORE; + return det; + } + + ins = insphereadapt(pa, pb, pc, pd, pe, permanent); + FPU_RESTORE; + return ins; +} Index: tags/1.0.5/gts/predicates.h =================================================================== --- tags/1.0.5/gts/predicates.h (nonexistent) +++ tags/1.0.5/gts/predicates.h (revision 953) @@ -0,0 +1,41 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/* Header file for robust predicates by Jonathan Richard Shewchuk */ + +#ifndef __PREDICATES_H__ +#define __PREDICATES_H__ + +double orient2d (double * pa, + double * pb, + double * pc); +double orient3d (double * pa, + double * pb, + double * pc, + double * pd); +double incircle (double * pa, + double * pb, + double * pc, + double * pd); +double insphere (double * pa, + double * pb, + double * pc, + double * pd, + double * pe); + +#endif /* __PREDICATES_H__ */ Index: tags/1.0.5/gts/psurface.c =================================================================== --- tags/1.0.5/gts/psurface.c (nonexistent) +++ tags/1.0.5/gts/psurface.c (revision 953) @@ -0,0 +1,471 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "gts.h" + +#define HEAP_INSERT_OBJECT(h, e) (GTS_OBJECT (e)->reserved =\ + gts_eheap_insert (h, e)) +#define HEAP_REMOVE_OBJECT(h, e) (gts_eheap_remove (h, GTS_OBJECT (e)->reserved),\ + GTS_OBJECT (e)->reserved = NULL) + +static void psurface_destroy (GtsObject * object) +{ + GtsPSurface * ps = GTS_PSURFACE (object); + guint i; + + if (!GTS_PSURFACE_IS_CLOSED (ps)) + gts_psurface_close (ps); + + for (i = 0; i < ps->split->len; i++) + if (g_ptr_array_index (ps->split, i)) + gts_object_destroy (GTS_OBJECT (g_ptr_array_index (ps->split, i))); + g_ptr_array_free (ps->split, TRUE); + + (* GTS_OBJECT_CLASS (gts_psurface_class ())->parent_class->destroy) (object); +} + +static void psurface_class_init (GtsObjectClass * klass) +{ + klass->destroy = psurface_destroy; +} + +static void psurface_init (GtsPSurface * psurface) +{ + psurface->s = NULL; + psurface->split = g_ptr_array_new (); + psurface->split_class = gts_split_class (); + psurface->pos = psurface->min = 0; + psurface->vertices = psurface->faces = NULL; +} + +/** + * gts_psurface_class: + * + * Returns: the #GtsPSurfaceClass. + */ +GtsPSurfaceClass * gts_psurface_class (void) +{ + static GtsPSurfaceClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo psurface_info = { + "GtsPSurface", + sizeof (GtsPSurface), + sizeof (GtsPSurfaceClass), + (GtsObjectClassInitFunc) psurface_class_init, + (GtsObjectInitFunc) psurface_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), + &psurface_info); + } + + return klass; +} + +static GtsVertex * edge_collapse (GtsPSurface * ps, + GtsEdge * e, + GtsEHeap * heap, + GtsCoarsenFunc coarsen_func, + gpointer coarsen_data, + gdouble maxcosine2) +{ + GtsVertex * v1 = GTS_SEGMENT (e)->v1, * v2 = GTS_SEGMENT (e)->v2, * mid; + GtsSplit * vs; + GtsObject * o1, * o2; + + /* if the edge is degenerate (i.e. v1 == v2), destroy and return */ + if (v1 == v2) { + gts_object_destroy (GTS_OBJECT (e)); + return NULL; + } + + if (!gts_edge_collapse_is_valid (e) || + /* check that a non-manifold edge is not a contact edge */ + (g_slist_length (e->triangles) > 2 && gts_edge_is_contact (e) > 1)) { + GTS_OBJECT (e)->reserved = + gts_eheap_insert_with_key (heap, e, G_MAXDOUBLE); + return NULL; + } + + mid = (*coarsen_func) (e, ps->s->vertex_class, coarsen_data); + + if (gts_edge_collapse_creates_fold (e, mid, maxcosine2)) { + GTS_OBJECT (e)->reserved = + gts_eheap_insert_with_key (heap, e, G_MAXDOUBLE); + gts_object_destroy (GTS_OBJECT (mid)); + return NULL; + } + + if (GTS_OBJECT (v1)->reserved) + o1 = GTS_OBJECT (v1)->reserved; + else + o1 = GTS_OBJECT (v1); + if (GTS_OBJECT (v2)->reserved) + o2 = GTS_OBJECT (v2)->reserved; + else + o2 = GTS_OBJECT (v2); + vs = gts_split_new (ps->split_class, mid, o1, o2); + gts_split_collapse (vs, ps->s->edge_class, heap); + GTS_OBJECT (vs->v)->reserved = vs; + g_ptr_array_add (ps->split, vs); + + return mid; +} + +static void update_2nd_closest_neighbors (GtsVertex * v, GtsEHeap * heap) +{ + GSList * i = v->segments; + GSList * list = NULL; + + while (i) { + GtsSegment * s = i->data; + if (GTS_IS_EDGE (s)) { + GtsVertex * v1 = s->v1 == v ? s->v2 : s->v1; + GSList * j = v1->segments; + while (j) { + GtsSegment * s1 = j->data; + if (GTS_IS_EDGE (s1) && !g_slist_find (list, s1)) + list = g_slist_prepend (list, s1); + j = j->next; + } + } + i = i->next; + } + + i = list; + while (i) { + GtsEdge * e = i->data; + if (GTS_OBJECT (e)->reserved) + HEAP_REMOVE_OBJECT (heap, e); + HEAP_INSERT_OBJECT (heap, e); + i = i->next; + } + + g_slist_free (list); +} + +static gdouble edge_length2 (GtsEdge * e) +{ + return gts_point_distance2 (GTS_POINT (GTS_SEGMENT (e)->v1), + GTS_POINT (GTS_SEGMENT (e)->v2)); +} + +static void create_heap_coarsen (GtsEdge * e, GtsEHeap * heap) +{ + HEAP_INSERT_OBJECT (heap, e); +} + +/* #define DEBUG_FOLD */ +/* #define DEBUG_CONTACT_VERTEX */ + +#ifdef DEBUG_FOLD +static void check_fold (GtsTriangle * t, gdouble * maxcosine2) +{ + GtsEdge * e1 = t->e1, * e2 = t->e2, * e3 = t->e3; + + + if (gts_triangles_are_folded (e1->triangles, + GTS_SEGMENT (e1)->v1, + GTS_SEGMENT (e1)->v2, + *maxcosine2) || + gts_triangles_are_folded (e2->triangles, + GTS_SEGMENT (e2)->v1, + GTS_SEGMENT (e2)->v2, + *maxcosine2) || + gts_triangles_are_folded (e3->triangles, + GTS_SEGMENT (e3)->v1, + GTS_SEGMENT (e3)->v2, + *maxcosine2)) { + fprintf (stderr, "triangle %p:(%p,%p,%p) is folded\n", t, e1, e2, e3); + g_assert_not_reached (); + } +} +#endif + +/** + * gts_psurface_new: + * @klass: a #GtsPSurfaceClass. + * @surface: a #GtsSurface. + * @split_class: a #GtsSplitClass to use for the new progressive surface. + * @cost_func: cost function for the edge collapse algorithm. + * @cost_data: data to pass to @cost_func. + * @coarsen_func: the function returning the vertex replacement for the edge + * collapse. + * @coarsen_data: data to pass to @coarsen_func. + * @stop_func: the function to call to decide whether to stop the coarsening + * process. + * @stop_data: data to pass to @stop_func. + * @minangle: the minimum angle allowable between two neighboring triangles. + * This is used to avoid introducing folds in the mesh during simplification. + * + * This function works in exactly the same way as the + * gts_surface_coarsen() function, except that the history of edge + * collapse is saved in an array of #GtsSplit objects. This allows for + * dynamic continuous multiresolution control of the input @surface. + * + * Returns: a new progressive surface. + */ +GtsPSurface * gts_psurface_new (GtsPSurfaceClass * klass, + GtsSurface * surface, + GtsSplitClass * split_class, + GtsKeyFunc cost_func, + gpointer cost_data, + GtsCoarsenFunc coarsen_func, + gpointer coarsen_data, + GtsStopFunc stop_func, + gpointer stop_data, + gdouble minangle) +{ + GtsPSurface * psurface; + GtsEHeap * heap; + GtsEdge * e; + gdouble top_cost, maxcosine2; + guint i; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (surface != NULL, NULL); + g_return_val_if_fail (split_class != NULL, NULL); + g_return_val_if_fail (stop_func != NULL, NULL); + + psurface = GTS_PSURFACE (gts_object_new (GTS_OBJECT_CLASS (klass))); + psurface->s = surface; + psurface->split_class = split_class; + + if (cost_func == NULL) + cost_func = (GtsKeyFunc) edge_length2; + if (coarsen_func == NULL) + coarsen_func = (GtsCoarsenFunc) gts_segment_midvertex; + + heap = gts_eheap_new (cost_func, cost_data); + maxcosine2 = cos (minangle); maxcosine2 *= maxcosine2; + + gts_eheap_freeze (heap); + gts_surface_foreach_edge (surface, (GtsFunc) create_heap_coarsen, heap); + gts_eheap_thaw (heap); + /* we want to control edge destruction manually */ + gts_allow_floating_edges = TRUE; + while ((e = gts_eheap_remove_top (heap, &top_cost)) && + (top_cost < G_MAXDOUBLE) && + !(*stop_func) (top_cost, gts_eheap_size (heap) - + gts_edge_face_number (e, surface), stop_data)) { + GtsVertex * v = edge_collapse (psurface, e, heap, + coarsen_func, coarsen_data, maxcosine2); + if (v != NULL) { + update_2nd_closest_neighbors (v, heap); +#ifdef DEBUG_FOLD + { + GSList * triangles = gts_vertex_triangles (v, NULL), * i; + fprintf (stderr, "\n---- Check for folds ----\n%p: ", v); + i = triangles; + while (i) { + GtsTriangle * t = i->data; + fprintf (stderr, "%p:(%p,%p,%p) ", t, t->e1, t->e2, t->e3); + i = i->next; + } + fprintf (stderr, "\n"); + g_slist_free (triangles); + gts_surface_foreach_face (surface, (GtsFunc) check_fold, &maxcosine2); + } +#endif +#ifdef DEBUG_CONTACT_VERTEX + if (gts_vertex_is_contact (v, FALSE) != 1) { + FILE * fptr = fopen ("after", "wt"); + GSList * triangles = gts_vertex_triangles (v, NULL), * i; + + fprintf (stderr, "collapse of %p created a contact vertex\n", e); + + fprintf (fptr, + "(geometry \"sphere\" { = SPHERE 0.1 0. 0. 0. })\n" + "(normalization \"sphere\" none)\n"); + i = triangles; + while (i) { + gts_write_triangle (i->data, GTS_POINT (v), fptr); + i = i->next; + } + g_assert_not_reached (); + } +#endif + } + } + gts_allow_floating_edges = FALSE; + + /* set reserved field of remaining edges back to NULL */ + if (e) GTS_OBJECT (e)->reserved = NULL; + gts_eheap_foreach (heap, (GFunc) gts_object_reset_reserved, NULL); + + gts_eheap_destroy (heap); + + psurface->pos = psurface->split->len; + psurface->min = gts_surface_vertex_number (psurface->s); + + /* set reserved field of vertices (used to build the hierarchy) + back to NULL */ + for (i = 0; i < psurface->split->len; i++) { + GtsSplit * vs = g_ptr_array_index (psurface->split, i); + gts_object_reset_reserved (GTS_OBJECT (vs->v)); + } + + return psurface; +} + +/** + * gts_psurface_add_vertex: + * @ps: a #GtsPSurface. + * + * Adds a vertex to the progressive surface @ps by expanding the next + * available #GtsSplit. + * + * Returns: the expanded #GtsSplit or %NULL if all the #GtsSplit have already + * been expanded. + */ +GtsSplit * gts_psurface_add_vertex (GtsPSurface * ps) +{ + GtsSplit * vs; + + g_return_val_if_fail (ps != NULL, NULL); + g_return_val_if_fail (GTS_PSURFACE_IS_CLOSED (ps), NULL); + + if (ps->pos == 0) + return NULL; + + vs = g_ptr_array_index (ps->split, --ps->pos); + gts_split_expand (vs, ps->s, ps->s->edge_class); + + return vs; +} + +/** + * gts_psurface_remove_vertex: + * @ps: a #GtsPSurface. + * + * Removes one vertex from the progressive surface @ps by collapsing the first + * available #GtsSplit. + * + * Returns: the collapsed #GtsSplit or %NULL if all the #GtsSplit have already + * been collapsed. + */ +GtsSplit * gts_psurface_remove_vertex (GtsPSurface * ps) +{ + GtsSplit * vs; + + g_return_val_if_fail (ps != NULL, NULL); + g_return_val_if_fail (GTS_PSURFACE_IS_CLOSED (ps), NULL); + + if (ps->pos == ps->split->len) + return NULL; + + vs = g_ptr_array_index (ps->split, ps->pos++); + gts_split_collapse (vs, ps->s->edge_class, NULL); + + return vs; +} + +/** + * gts_psurface_max_vertex_number: + * @ps: a #GtsPSurface. + * + * Returns: the maximum number of vertices of @ps i.e. the number of vertices + * if all the #GtsSplit were expanded. + */ +guint gts_psurface_max_vertex_number (GtsPSurface * ps) +{ + g_return_val_if_fail (ps != NULL, 0); + + return ps->min + ps->split->len; +} + +/** + * gts_psurface_min_vertex_number: + * @ps: a #GtsPSurface. + * + * Returns: the minimum number of vertices of @ps i.e. the number of vertices + * if all the #GtsSplit were collapsed. + */ +guint gts_psurface_min_vertex_number (GtsPSurface * ps) +{ + g_return_val_if_fail (ps != NULL, 0); + + return ps->min; +} + +/** + * gts_psurface_set_vertex_number: + * @ps: a #GtsPSurface. + * @n: a number of vertices. + * + * Performs the required number of collapses or expansions to set the number + * of vertices of @ps to @n. + */ +void gts_psurface_set_vertex_number (GtsPSurface * ps, guint n) +{ + g_return_if_fail (ps != NULL); + g_return_if_fail (GTS_PSURFACE_IS_CLOSED (ps)); + + n = ps->min + ps->split->len - n; + while (ps->pos > n && gts_psurface_add_vertex (ps)) + ; + while (ps->pos < n && gts_psurface_remove_vertex (ps)) + ; +} + +/** + * gts_psurface_get_vertex_number: + * @ps: a #GtsPSurface. + * + * Returns: the current number of vertices of @ps. + */ +guint gts_psurface_get_vertex_number (GtsPSurface * ps) +{ + g_return_val_if_fail (ps != NULL, 0); + + if (!GTS_PSURFACE_IS_CLOSED (ps)) + return ps->min + ps->pos; + else + return ps->min + ps->split->len - ps->pos; +} + +/** + * gts_psurface_foreach_vertex: + * @ps: a #GtsPSurface. + * @func: a function to call for each vertex of @ps. + * @data: data to be passed to @func. + * + * Calls @func for each (potential) vertex of @ps, whether actually used + * or not. The vertices are called in the order they were created during the + * edge collapse operation. + */ +void gts_psurface_foreach_vertex (GtsPSurface * ps, + GtsFunc func, + gpointer data) +{ + guint i; + + g_return_if_fail (ps != NULL); + g_return_if_fail (func != NULL); + g_return_if_fail (GTS_PSURFACE_IS_CLOSED (ps)); + + for (i = 0; i < ps->split->len; i++) { + GtsSplit * vs = g_ptr_array_index (ps->split, i); + (*func) (vs->v, data); + } +} Index: tags/1.0.5/gts/refine.c =================================================================== --- tags/1.0.5/gts/refine.c (nonexistent) +++ tags/1.0.5/gts/refine.c (revision 953) @@ -0,0 +1,418 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +/** + * gts_vertex_encroaches_edge: + * @v: a #GtsVertex. + * @e: a #GtsEdge. + * + * Returns: %TRUE if @v is strictly contained in the diametral circle of @e, + * %FALSE otherwise. + */ +gboolean gts_vertex_encroaches_edge (GtsVertex * v, GtsEdge * e) +{ + GtsPoint * p, * p1, * p2; + + g_return_val_if_fail (v != NULL, FALSE); + g_return_val_if_fail (e != NULL, FALSE); + + p = GTS_POINT (v); + p1 = GTS_POINT (GTS_SEGMENT (e)->v1); + p2 = GTS_POINT (GTS_SEGMENT (e)->v2); + + if ((p1->x - p->x)*(p2->x - p->x) + (p1->y - p->y)*(p2->y - p->y) < 0.0) + return TRUE; + return FALSE; +} + +/** + * gts_edge_is_encroached: + * @e: a #GtsEdge. + * @s: a #GtsSurface describing a (constrained) Delaunay triangulation. + * @encroaches: a #GtsEncroachFunc. + * @data: user data to be passed to @encroaches. + * + * Returns: a #GtsVertex belonging to @s and encroaching upon @e + * (as defined by @encroaches) or %NULL if there is none. + */ +GtsVertex * gts_edge_is_encroached (GtsEdge * e, + GtsSurface * s, + GtsEncroachFunc encroaches, + gpointer data) +{ + GSList * i; + + g_return_val_if_fail (e != NULL, NULL); + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (encroaches != NULL, NULL); + + i = e->triangles; + while (i) { + GtsFace * f = i->data; + if (GTS_IS_FACE (f) && gts_face_has_parent_surface (f, s)) { + GtsVertex * v = gts_triangle_vertex_opposite (GTS_TRIANGLE (f), e); + if ((* encroaches) (v, e, s, data)) + return v; + } + i = i->next; + } + + return NULL; +} + +#define ALREADY_ENCROACHED(c) (GTS_OBJECT (c)->reserved) + +static void vertex_encroaches (GtsVertex * v, + GtsSurface * surface, + GtsFifo * encroached, + GtsEncroachFunc encroaches, + gpointer data) +{ + GSList * triangles, * i; + + g_return_if_fail (v != NULL); + g_return_if_fail (surface != NULL); + g_return_if_fail (encroached != NULL); + g_return_if_fail (encroaches != NULL); + + i = triangles = gts_vertex_triangles (v, NULL); + while (i) { + GtsFace * f = i->data; + if (GTS_IS_FACE (f) && gts_face_has_parent_surface (f, surface)) { + GtsEdge * e = gts_triangle_edge_opposite (i->data, v); + if (!ALREADY_ENCROACHED (e) && + GTS_IS_CONSTRAINT (e) && + (* encroaches) (v, e, surface, data)) { + gts_fifo_push (encroached, e); + ALREADY_ENCROACHED (e) = encroached; + } + } + i = i->next; + } + g_slist_free (triangles); +} + +static void make_encroached_fifo (GtsEdge * e, gpointer * datas) +{ + GtsFifo * fifo = datas[0]; + GtsSurface * s = datas[1]; + GtsEncroachFunc encroaches = (GtsEncroachFunc) datas[2]; + gpointer data = datas[3]; + + if (GTS_IS_CONSTRAINT (e) && + gts_edge_is_encroached (e, s, encroaches, data)) { + gts_fifo_push (fifo, e); + ALREADY_ENCROACHED (e) = fifo; + } +} + +#define SQUARE_ROOT_TWO 1.41421356237309504880168872420969807856967187 +#define DISTANCE_2D(v1, v2) (sqrt ((GTS_POINT (v2)->x - GTS_POINT (v1)->x)*\ + (GTS_POINT (v2)->x - GTS_POINT (v1)->x) +\ + (GTS_POINT (v2)->y - GTS_POINT (v1)->y)*\ + (GTS_POINT (v2)->y - GTS_POINT (v1)->y))) + +/* finds where to split the given edge to avoid infinite cycles. (see + Shewchuk's thesis for details */ +static GtsVertex * split_edge (GtsEdge * e, + GtsSurface * surface) +{ + GSList * i = e->triangles; + GtsEdge * c = NULL; + + /* look for constraints touching e */ + while (i && !c) { + GtsTriangle * t = i->data; + if (GTS_IS_FACE (t) && + gts_face_has_parent_surface (GTS_FACE (t), surface)) { + GtsEdge * e1, * e2; + if (t->e1 == e) { e1 = t->e2; e2 = t->e3; } + else if (t->e2 == e) { e1 = t->e1; e2 = t->e3; } + else { e1 = t->e1; e2 = t->e2; } + if (GTS_IS_CONSTRAINT (e1) && !GTS_IS_CONSTRAINT (e2)) + c = e1; + else if (GTS_IS_CONSTRAINT (e2) && !GTS_IS_CONSTRAINT (e1)) + c = e2; + } + i = i->next; + } + if (c) { + /* use power of two concentric shells */ + GtsVertex * v1 = GTS_SEGMENT (e)->v1; + GtsVertex * v2 = GTS_SEGMENT (e)->v2; + gdouble l = DISTANCE_2D (v1, v2); + gdouble nearestpower = 1., split; + + while (l > SQUARE_ROOT_TWO*nearestpower) + nearestpower *= 2.; + while (l < SQUARE_ROOT_TWO*nearestpower/2.) + nearestpower /= 2.; + split = nearestpower/l/2.; + + if (GTS_SEGMENT (c)->v1 == v2 || GTS_SEGMENT (c)->v2 == v2) + split = 1. - split; + return gts_vertex_new (surface->vertex_class, + (1. - split)*GTS_POINT (v1)->x + + split*GTS_POINT (v2)->x, + (1. - split)*GTS_POINT (v1)->y + + split*GTS_POINT (v2)->y, + (1. - split)*GTS_POINT (v1)->z + + split*GTS_POINT (v2)->z); + } + else + return gts_segment_midvertex (GTS_SEGMENT (e), surface->vertex_class); +} + +static gint split_encroached (GtsSurface * surface, + GtsFifo * encroached, + gint steiner_max, + GtsEncroachFunc encroaches, + gpointer data) +{ + GtsSegment * s; + + while (steiner_max-- != 0 && (s = gts_fifo_pop (encroached))) { + GtsVertex * v = split_edge (GTS_EDGE (s), surface); + GtsFace * boundary = gts_edge_is_boundary (GTS_EDGE (s), surface); + GtsFace * f = boundary; +#if 1 + GtsEdge * e1 = GTS_EDGE (gts_object_clone (GTS_OBJECT (s))); + GtsEdge * e2 = GTS_EDGE (gts_object_clone (GTS_OBJECT (s))); + + GTS_SEGMENT (e1)->v1 = s->v1; + s->v1->segments = g_slist_prepend (s->v1->segments, e1); + GTS_SEGMENT (e1)->v2 = v; + v->segments = g_slist_prepend (v->segments, e1); + + GTS_SEGMENT (e2)->v1 = v; + v->segments = g_slist_prepend (v->segments, e2); + GTS_SEGMENT (e2)->v2 = s->v2; + s->v2->segments = g_slist_prepend (s->v2->segments, e2); +#else + GtsEdge * e1 = gts_edge_new (GTS_EDGE_CLASS (GTS_OBJECT (s)->klass), + s->v1, v); + GtsEdge * e2 = gts_edge_new (GTS_EDGE_CLASS (GTS_OBJECT (s)->klass), + v, s->v2); +#endif + + GTS_OBJECT (s)->klass = GTS_OBJECT_CLASS (surface->edge_class); + + if (f == NULL) + g_assert ((f = gts_edge_has_parent_surface (GTS_EDGE (s), surface))); + g_assert (gts_delaunay_add_vertex_to_face (surface, v, f) == NULL); + + if (boundary) + gts_object_destroy (GTS_OBJECT (s)); + + vertex_encroaches (v, surface, encroached, encroaches, data); + + if (gts_edge_is_encroached (e1, surface, encroaches, data)) { + gts_fifo_push (encroached, e1); + ALREADY_ENCROACHED (e1) = encroached; + } + if (gts_edge_is_encroached (e2, surface, encroaches, data)) { + gts_fifo_push (encroached, e2); + ALREADY_ENCROACHED (e2) = encroached; + } + } + + return steiner_max; +} + +/** + * gts_delaunay_conform: + * @surface: a #GtsSurface describing a constrained Delaunay triangulation. + * @steiner_max: maximum number of Steiner points. + * @encroaches: a #GtsEncroachFunc. + * @data: user-data to pass to @encroaches. + * + * Recursively split constraints of @surface which are encroached by + * vertices of @surface (see Shewchuk 96 for details). The split + * constraints are destroyed and replaced by a set of new constraints + * of the same class. If gts_vertex_encroaches_edge() is used for + * @encroaches, the resulting surface will be Delaunay conforming. + * + * If @steiner_max is positive or nul, the recursive splitting + * procedure will stop when this maximum number of Steiner points is + * reached. In that case the resulting surface will not necessarily be + * Delaunay conforming. + * + * Returns: the number of remaining encroached edges. If @steiner_max + * is set to a negative value and gts_vertex_encroaches_edge() is used + * for @encroaches this should always be zero. + */ +guint gts_delaunay_conform (GtsSurface * surface, + gint steiner_max, + GtsEncroachFunc encroaches, + gpointer data) +{ + GtsFifo * encroached; + gpointer datas[4]; + guint encroached_number; + + g_return_val_if_fail (surface != NULL, 0); + g_return_val_if_fail (surface != NULL, 0); + g_return_val_if_fail (encroaches != NULL, 0); + + datas[0] = encroached = gts_fifo_new (); + datas[1] = surface; + datas[2] = encroaches; + datas[3] = data; + gts_surface_foreach_edge (surface, (GtsFunc) make_encroached_fifo, datas); + + split_encroached (surface, + encroached, + steiner_max, + encroaches, data); + gts_fifo_foreach (encroached, (GtsFunc) gts_object_reset_reserved, NULL); + encroached_number = gts_fifo_size (encroached); + gts_fifo_destroy (encroached); + return encroached_number; +} + +#define EHEAP_PAIR(f) (GTS_OBJECT (f)->reserved) + +static void heap_surface_add_face (GtsSurface * s, GtsFace * f) +{ + GtsEHeap * heap = GTS_OBJECT (s)->reserved; + gdouble key = gts_eheap_key (heap, f); + + if (key != 0.) + EHEAP_PAIR (f) = gts_eheap_insert_with_key (heap, f, key); + + if (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass->parent_class)->add_face) + (* GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass->parent_class)->add_face) + (s, f); +} + +static void heap_surface_remove_face (GtsSurface * s, GtsFace * f) +{ + GtsEHeap * heap = GTS_OBJECT (s)->reserved; + + if (EHEAP_PAIR (f)) + gts_eheap_remove (heap, EHEAP_PAIR (f)); + + if (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass->parent_class)->remove_face) + (* GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass->parent_class)->remove_face) + (s, f); +} + +static void heap_surface_class_init (GtsSurfaceClass * klass) +{ + klass->add_face = heap_surface_add_face; + klass->remove_face = heap_surface_remove_face; +} + +static GtsObjectClass * heap_surface_class_new (GtsObjectClass * parent_class) +{ + GtsObjectClassInfo heap_surface_info; + + heap_surface_info = parent_class->info; + heap_surface_info.class_init_func = (GtsObjectClassInitFunc) + heap_surface_class_init; + return gts_object_class_new (parent_class, + &heap_surface_info); +} + +static void make_face_heap (GtsFace * f, GtsEHeap * heap) +{ + gdouble key = gts_eheap_key (heap, f); + + if (key != 0.) + EHEAP_PAIR (f) = gts_eheap_insert_with_key (heap, f, key); +} + +/** + * gts_delaunay_refine: + * @surface: a #GtsSurface describing a conforming Delaunay triangulation. + * @steiner_max: maximum number of Steiner points. + * @encroaches: a #GtsEncroachFunc. + * @encroach_data: user-data to pass to @encroaches. + * @cost: a #GtsKeyFunc used to sort the faces during refinement. + * @cost_data: user-data to pass to @cost. + * + * An implementation of the refinement algorithm described in Ruppert + * (1995) and Shewchuk (1996). + * + * Returns: the number of unrefined faces of @surface left. Should be zero + * if @steiner_max is set to a negative value. + */ +guint gts_delaunay_refine (GtsSurface * surface, + gint steiner_max, + GtsEncroachFunc encroaches, + gpointer encroach_data, + GtsKeyFunc cost, + gpointer cost_data) +{ + GtsObjectClass * heap_surface_class; + GtsObjectClass * original_class; + GtsEHeap * heap; + GtsFifo * encroached; + GtsFace * f; + guint unrefined_number; + + g_return_val_if_fail (surface != NULL, 0); + g_return_val_if_fail (encroaches != NULL, 0); + g_return_val_if_fail (cost != NULL, 0); + + original_class = GTS_OBJECT (surface)->klass; + heap_surface_class = heap_surface_class_new (original_class); + GTS_OBJECT (surface)->klass = heap_surface_class; + + heap = gts_eheap_new (cost, cost_data); + gts_surface_foreach_face (surface, (GtsFunc) make_face_heap, heap); + encroached = gts_fifo_new (); + + GTS_OBJECT (surface)->reserved = heap; + + while (steiner_max-- != 0 && (f = gts_eheap_remove_top (heap, NULL))) { + GtsVertex * c = + GTS_VERTEX (gts_triangle_circumcircle_center (GTS_TRIANGLE (f), + GTS_POINT_CLASS (surface->vertex_class))); + EHEAP_PAIR (f) = NULL; + g_assert (c != NULL); + g_assert (gts_delaunay_add_vertex (surface, c, f) == NULL); + + vertex_encroaches (c, surface, encroached, encroaches, encroach_data); + if (!gts_fifo_is_empty (encroached)) { + gts_delaunay_remove_vertex (surface, c); + steiner_max = split_encroached (surface, + encroached, + steiner_max, + encroaches, + encroach_data); + } + } + + unrefined_number = gts_eheap_size (heap); + gts_eheap_foreach (heap, (GFunc) gts_object_reset_reserved, NULL); + gts_eheap_destroy (heap); + + gts_fifo_foreach (encroached, (GtsFunc) gts_object_reset_reserved, NULL); + gts_fifo_destroy (encroached); + + GTS_OBJECT (surface)->klass = original_class; + GTS_OBJECT (surface)->reserved = NULL; + g_free (heap_surface_class); + + return unrefined_number; +} Index: tags/1.0.5/gts/rounding.h =================================================================== --- tags/1.0.5/gts/rounding.h (nonexistent) +++ tags/1.0.5/gts/rounding.h (revision 953) @@ -0,0 +1,85 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#ifdef HAVE_FPU_CONTROL_H +# include +# ifdef _FPU_EXTENDED +# if !defined(__alpha__) || !defined(__GLIBC__) +# if defined(__arm__) + static fpu_control_t fpu_round_double = _FPU_DEFAULT; +# else + static fpu_control_t fpu_round_double = + (_FPU_DEFAULT & ~ _FPU_EXTENDED)|_FPU_DOUBLE; +# endif + static fpu_control_t fpu_init; +# define FPU_ROUND_DOUBLE { _FPU_GETCW(fpu_init);\ + _FPU_SETCW(fpu_round_double); } +# define FPU_RESTORE {_FPU_SETCW(fpu_init);} +# else /* __alpha__ && __GLIBC__ */ +# define FPU_ROUND_DOUBLE +# define FPU_RESTORE +# endif /* __alpha__ && __GLIBC__ */ +# else /* not FPU_EXTENDED */ +# define FPU_ROUND_DOUBLE +# define FPU_RESTORE +# endif /* not FPU_EXTENDED */ +#else /* not HAVE_FPU_CONTROL_H */ +# ifdef __FreeBSD__ +# include +# define FPU_ROUND_DOUBLE (fpsetprec(FP_PD)) +# define FPU_RESTORE (fpsetprec(FP_PE)) +# else /* not __FreeBSD__ */ +# ifdef WIN32 +# ifdef _MSC_VER +# include + static unsigned int fpu_init; +# define FPU_ROUND_DOUBLE (fpu_init = _controlfp (0, 0),\ + _controlfp (_PC_53, MCW_PC)) +# define FPU_RESTORE (_controlfp (fpu_init, 0xfffff)) +# elif __MINGW32__ +# include + static unsigned int fpu_init; +# define FPU_ROUND_DOUBLE (fpu_init = _controlfp (0, 0),\ + _controlfp (_PC_53, _MCW_PC)) +# define FPU_RESTORE (_controlfp (fpu_init, 0xfffff)) +# else /* not _MSC_VER or __MINGW32__ */ +# error "You need MSVC or MinGW for the Win32 version" +# endif /* not _MSC_VER or __MINGW32__ */ +# else /* not WIN32 */ +# ifdef __CYGWIN__ + typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); + static fpu_control_t fpu_round_double = 0x027f; + static fpu_control_t fpu_init; +# define _FPU_GETCW(cw) __asm__ ("fnstcw %0" : "=m" (*&cw)) +# define _FPU_SETCW(cw) __asm__ ("fldcw %0" : : "m" (*&cw)) +# define FPU_ROUND_DOUBLE { _FPU_GETCW(fpu_init);\ + _FPU_SETCW(fpu_round_double); } +# define FPU_RESTORE { _FPU_SETCW(fpu_init);} +# else /* not __CYGWIN__ */ +# ifdef CPP_HAS_WARNING +# warning "Unknown CPU: assuming default double precision rounding" +# endif /* CPP_HAS_WARNING */ +# define FPU_ROUND_DOUBLE +# define FPU_RESTORE +# endif /* not __CYGWIN__ */ +# endif /* not WIN32 */ +# endif /* not __FreeBSD__ */ +#endif /* not HAVE_FPU_CONTROL_H */ Index: tags/1.0.5/gts/segment.c =================================================================== --- tags/1.0.5/gts/segment.c (nonexistent) +++ tags/1.0.5/gts/segment.c (revision 953) @@ -0,0 +1,233 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +static void segment_destroy (GtsObject * object) +{ + GtsSegment * segment = GTS_SEGMENT (object); + GtsVertex * v1 = segment->v1; + GtsVertex * v2 = segment->v2; + + v1->segments = g_slist_remove (v1->segments, segment); + if (!GTS_OBJECT_DESTROYED (v1) && + !gts_allow_floating_vertices && v1->segments == NULL) + gts_object_destroy (GTS_OBJECT (v1)); + + v2->segments = g_slist_remove (v2->segments, segment); + if (!GTS_OBJECT_DESTROYED (v2) && + !gts_allow_floating_vertices && v2->segments == NULL) + gts_object_destroy (GTS_OBJECT (v2)); + + (* GTS_OBJECT_CLASS (gts_segment_class ())->parent_class->destroy) (object); +} + +static void segment_class_init (GtsObjectClass * klass) +{ + klass->destroy = segment_destroy; +} + +static void segment_init (GtsSegment * segment) +{ + segment->v1 = segment->v2 = NULL; +} + +/** + * gts_segment_class: + * + * Returns: the #GtsSegmentClass. + */ +GtsSegmentClass * gts_segment_class (void) +{ + static GtsSegmentClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo segment_info = { + "GtsSegment", + sizeof (GtsSegment), + sizeof (GtsSegmentClass), + (GtsObjectClassInitFunc) segment_class_init, + (GtsObjectInitFunc) segment_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), + &segment_info); + } + + return klass; +} + +/** + * gts_segment_new: + * @klass: a #GtsSegmentClass. + * @v1: a #GtsVertex. + * @v2: another #GtsVertex different from @v1. + * + * Returns: a new #GtsSegment linking @v1 and @v2. + */ +GtsSegment * gts_segment_new (GtsSegmentClass * klass, + GtsVertex * v1, GtsVertex * v2) +{ + GtsSegment * s; + + g_return_val_if_fail (v1 != NULL, NULL); + g_return_val_if_fail (v2 != NULL, NULL); + g_return_val_if_fail (v1 != v2, NULL); + + s = GTS_SEGMENT (gts_object_new (GTS_OBJECT_CLASS (klass))); + s->v1 = v1; + s->v2 = v2; + v1->segments = g_slist_prepend (v1->segments, s); + v2->segments = g_slist_prepend (v2->segments, s); + + return s; +} + +/** + * gts_segment_is_duplicate: + * @s: a #GtsSegment. + * + * Returns: the first #GtsSegment different from @s which shares the + * same endpoints or %NULL if there is none. + */ +GtsSegment * gts_segment_is_duplicate (GtsSegment * s) +{ + GSList * i; + GtsVertex * v2; + + g_return_val_if_fail (s != NULL, NULL); + + v2 = s->v2; + i = s->v1->segments; + if (s->v1 == v2) /* s is degenerate: special treatment */ + while (i) { + GtsSegment * s1 = i->data; + if (s1 != s && s1->v1 == v2 && s1->v2 == v2) + return s1; + i = i->next; + } + else /* s is not degenerate */ + while (i) { + GtsSegment * s1 = i->data; + if (s1 != s && (s1->v1 == v2 || s1->v2 == v2)) + return s1; + i = i->next; + } + return NULL; +} + +/** + * gts_segments_are_intersecting: + * @s1: a #GtsSegment. + * @s2: a #GtsSegment. + * + * Returns: %GTS_IN if @s1 and @s2 are intersecting, %GTS_ON if one of the + * endpoints of @s1 (resp. @s2) lies on @s2 (resp. @s1), %GTS_OUT otherwise. + */ +GtsIntersect gts_segments_are_intersecting (GtsSegment * s1, GtsSegment * s2) +{ + GtsPoint * p1, * p2, * p3, * p4; + gdouble d1, d2, d3, d4; + + g_return_val_if_fail (s1 != NULL && s2 != NULL, FALSE); + + p1 = GTS_POINT (s1->v1); p2 = GTS_POINT (s1->v2); + p3 = GTS_POINT (s2->v1); p4 = GTS_POINT (s2->v2); + d1 = gts_point_orientation (p1, p2, p3); + d2 = gts_point_orientation (p1, p2, p4); + if ((d1 > 0.0 && d2 > 0.0) || + (d1 < 0.0 && d2 < 0.0)) + return GTS_OUT; + d3 = gts_point_orientation (p3, p4, p1); + d4 = gts_point_orientation (p3, p4, p2); + if ((d3 > 0.0 && d4 > 0.0) || + (d3 < 0.0 && d4 < 0.0)) + return GTS_OUT; + if (d1 == 0.0 || d2 == 0.0 || d3 == 0.0 || d4 == 0.0) + return GTS_ON; + return GTS_IN; +} + +/** + * gts_segment_midvertex: + * @s: a #GtsSegment. + * @klass: a #GtsVertexClass to be used for the new vertex. + * + * Returns: a new #GtsVertex, midvertex of @s. + */ +GtsVertex * gts_segment_midvertex (GtsSegment * s, GtsVertexClass * klass) +{ + GtsPoint * p1, * p2; + + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (klass != NULL, NULL); + + p1 = GTS_POINT (s->v1); p2 = GTS_POINT (s->v2); + return gts_vertex_new (klass, + (p1->x + p2->x)/2., + (p1->y + p2->y)/2., + (p1->z + p2->z)/2.); +} + +/** + * gts_segments_from_vertices: + * @vertices: a list of #GtsVertex. + * + * Returns: a list of unique #GtsSegment which have one of their vertices in + * @vertices. + */ +GSList * gts_segments_from_vertices (GSList * vertices) +{ + GHashTable * hash; + GSList * segments = NULL, * i; + + hash = g_hash_table_new (NULL, NULL); + i = vertices; + while (i) { + GSList * j = GTS_VERTEX (i->data)->segments; + while (j) { + GtsSegment * s = j->data; + if (g_hash_table_lookup (hash, s) == NULL) { + segments = g_slist_prepend (segments, s); + g_hash_table_insert (hash, s, i); + } + j = j->next; + } + i = i->next; + } + g_hash_table_destroy (hash); + return segments; +} + +/** + * gts_segment_is_ok: + * @s: a #GtsSegment. + * + * Returns: %TRUE if @s is not degenerate (i.e. @s->v1 != @s->v2) and not + * duplicate, %FALSE otherwise. + */ +gboolean gts_segment_is_ok (GtsSegment * s) +{ + g_return_val_if_fail (s != NULL, FALSE); + g_return_val_if_fail (s->v1 != s->v2, FALSE); + g_return_val_if_fail (!gts_segment_is_duplicate (s), FALSE); + g_return_val_if_fail (GTS_OBJECT (s)->reserved == NULL, FALSE); + return TRUE; +} Index: tags/1.0.5/gts/split.c =================================================================== --- tags/1.0.5/gts/split.c (nonexistent) +++ tags/1.0.5/gts/split.c (revision 953) @@ -0,0 +1,1840 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "gts.h" + +#define DYNAMIC_SPLIT +#define NEW + +/* #define DEBUG + #define DEBUG_HEXPAND + #define DEBUG_EXPAND */ + +struct _GtsSplitCFace { + GtsFace * f; + GtsTriangle ** a1, ** a2; +}; + +typedef struct _CFace CFace; +typedef struct _CFaceClass CFaceClass; + +struct _CFace { + GtsObject object; + + GtsSplit * parent_split; + GtsTriangle * t; + guint flags; +}; +/* the size of the CFace structure must be smaller or equal to the size + of the GtsFace structure as both structures use the same memory location */ + +struct _CFaceClass { + GtsObjectClass parent_class; +}; + +#define IS_CFACE(obj) (gts_object_is_from_class (obj, cface_class ())) +#define CFACE(obj) ((CFace *) obj) +#define CFACE_ORIENTATION(cf) ((cf)->flags & 0x1) +#define CFACE_ORIENTATION_DIRECT(cf) ((cf)->flags |= 0x1) +#define CFACE_VVS(cf) ((cf)->flags & 0x2) +#define CFACE_VVS_DIRECT(cf) ((cf)->flags |= 0x2) +#define CFACE_E1 0x4 +#define CFACE_E2 0x8 +#define CFACE_KEEP_VVS 0x10 + +#define ROTATE_ORIENT(e, e1, e2, e3) { if (e1 == e) { e1 = e2; e2 = e3; }\ + else if (e2 == e) { e2 = e1; e1 = e3; }\ + else g_assert (e3 == e); } +#define SEGMENT_USE_VERTEX(s, v) ((s)->v1 == v || (s)->v2 == v) +#define TRIANGLE_REPLACE_EDGE(t, e, with) { if ((t)->e1 == e)\ + (t)->e1 = with;\ + else if ((t)->e2 == e)\ + (t)->e2 = with;\ + else {\ + g_assert ((t)->e3 == e);\ + (t)->e3 = with;\ + }\ + } + +#define HEAP_INSERT_OBJECT(h, e) (GTS_OBJECT (e)->reserved =\ + gts_eheap_insert (h, e)) +#define HEAP_REMOVE_OBJECT(h, e) (gts_eheap_remove (h, GTS_OBJECT (e)->reserved),\ + GTS_OBJECT (e)->reserved = NULL) + +static GtsObjectClass * cface_class (void) +{ + static GtsObjectClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo cface_info = { + "GtsCFace", + sizeof (CFace), + sizeof (CFaceClass), + (GtsObjectClassInitFunc) NULL, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &cface_info); + g_assert (sizeof (CFace) <= sizeof (GtsFace)); + } + + return klass; +} + +/* Replace @e with @with for all the triangles using @e but @f. + Destroys @e and removes it from @heap (if not %NULL). + Returns a triangle using e different from f or %NULL. */ +static GtsTriangle * replace_edge_collapse (GtsEdge * e, + GtsEdge * with, + CFace * cf, + GtsEHeap * heap +#ifdef DYNAMIC_SPLIT + , GtsTriangle *** a1 +#endif +#ifdef NEW + , guint edge_flag +#endif + ) +{ + GSList * i; + GtsTriangle * rt = NULL; +#ifdef DYNAMIC_SPLIT + guint size; + GtsTriangle ** a; +#endif + +#ifdef NEW + i = e->triangles; + e->triangles = NULL; + size = g_slist_length (i)*sizeof (GtsTriangle *); + *a1 = a = g_malloc (size > 0 ? size : sizeof (GtsTriangle *)); + while (i) { + GtsTriangle * t = i->data; + GSList * next = i->next; + if (t != ((GtsTriangle *) cf)) { + if (IS_CFACE (t)) { + i->next = e->triangles; + e->triangles = i; + /* set the edge given by edge_flag (CFACE_E1 or CFACE_E2) */ + GTS_OBJECT (t)->reserved = GUINT_TO_POINTER (edge_flag); + cf->flags |= CFACE_KEEP_VVS; + } + else { + TRIANGLE_REPLACE_EDGE (t, e, with); + i->next = with->triangles; + with->triangles = i; + rt = t; + *(a++) = t; + } + } + else + g_slist_free_1 (i); + i = next; + } + *a = NULL; + if (!e->triangles) { + if (heap) + HEAP_REMOVE_OBJECT (heap, e); + gts_object_destroy (GTS_OBJECT (e)); + } +#else /* not NEW */ + i = e->triangles; +#ifdef DYNAMIC_SPLIT + size = g_slist_length (i)*sizeof (GtsTriangle *); + *a1 = a = g_malloc (size > 0 ? size : sizeof (GtsTriangle *)); +#endif + while (i) { + GtsTriangle * t = i->data; + GSList * next = i->next; + if (t != ((GtsTriangle *) cf)) { + TRIANGLE_REPLACE_EDGE (t, e, with); + i->next = with->triangles; + with->triangles = i; + rt = t; +#ifdef DYNAMIC_SPLIT + *(a++) = t; +#endif + } + else + g_slist_free_1 (i); + i = next; + } +#ifdef DYNAMIC_SPLIT + *a = NULL; +#endif + if (heap) + HEAP_REMOVE_OBJECT (heap, e); + e->triangles = NULL; + gts_object_destroy (GTS_OBJECT (e)); +#endif /* NEW */ + + return rt; +} + +static CFace * cface_new (GtsFace * f, + GtsEdge * e, + GtsVertex * v1, + GtsVertex * v2, + GtsSplit * vs, + GtsEHeap * heap, + GtsEdgeClass * klass +#ifdef DYNAMIC_SPLIT + , GtsSplitCFace * scf +#endif + ) +{ + CFace * cf; + GtsVertex * v; + GtsEdge * e1, * e2, * e3, * vvs; + GSList * i; + GtsTriangle * t, * t1 = NULL, * t2 = NULL; + guint flags; + + g_return_val_if_fail (f != NULL, NULL); +#ifndef NEW + g_return_val_if_fail (GTS_IS_FACE (f), NULL); +#endif + g_return_val_if_fail (e != NULL, NULL); + g_return_val_if_fail (vs != NULL, NULL); + + t = ((GtsTriangle *) f); + if (heap) + g_return_val_if_fail (!gts_triangle_is_duplicate (t), NULL); + +#ifdef NEW + /* get CFACE_E1 and CFACE_E2 info */ + flags = GPOINTER_TO_UINT (GTS_OBJECT (f)->reserved); +#endif + GTS_OBJECT_SET_FLAGS (f, GTS_DESTROYED); + + i = f->surfaces; + while (i) { + GSList * next = i->next; + gts_surface_remove_face (i->data, f); + i = next; + } + g_slist_free (f->surfaces); + + e1 = t->e1; e2 = t->e2; e3 = t->e3; + ROTATE_ORIENT (e, e1, e2, e3); + + cf = (CFace *) f; +#ifndef NEW + GTS_OBJECT (cf)->klass = cface_class (); +#else + cf->flags = flags; +#endif + gts_object_init (GTS_OBJECT (cf), cface_class ()); + cf->parent_split = vs; + + if (SEGMENT_USE_VERTEX (GTS_SEGMENT (e1), v2)) { + CFACE_ORIENTATION_DIRECT (cf); /* v1->v2->v */ + e3 = e1; e1 = e2; e2 = e3; + } + v = GTS_SEGMENT (e1)->v1 == v1 ? + GTS_SEGMENT (e1)->v2 : GTS_SEGMENT (e1)->v1; +#ifdef NEW + if ((cf->flags & CFACE_E1) || (cf->flags & CFACE_E2)) + g_assert ((vvs = GTS_EDGE (gts_vertices_are_connected (vs->v, v)))); + else +#endif + vvs = gts_edge_new (klass, v, vs->v); + + t1 = replace_edge_collapse (e1, vvs, cf, heap +#ifdef DYNAMIC_SPLIT + , &scf->a1 +#endif +#ifdef NEW + , CFACE_E1 +#endif + ); + t2 = replace_edge_collapse (e2, vvs, cf, heap +#ifdef DYNAMIC_SPLIT + , &scf->a2 +#endif +#ifdef NEW + , CFACE_E2 +#endif + ); + t = cf->t = t1 ? t1 : t2; + g_assert (t); + + /* set up flags necessary to find vvs */ + if (t->e1 == vvs) e2 = t->e2; + else if (t->e2 == vvs) e2 = t->e3; + else { + g_assert (t->e3 == vvs); + e2 = t->e1; + } + if (SEGMENT_USE_VERTEX (GTS_SEGMENT (e2), v)) + CFACE_VVS_DIRECT (cf); + + return cf; +} + +static void find_vvs (GtsVertex * vs, + GtsTriangle * t, + GtsVertex ** v, GtsEdge ** vvs, + gboolean orientation) +{ + GtsEdge * e1 = t->e1, * e2 = t->e2, * e3 = t->e3, * tmp; + + if (SEGMENT_USE_VERTEX (GTS_SEGMENT (e2), vs)) { + tmp = e1; e1 = e2; e2 = e3; e3 = tmp; + } + else if (SEGMENT_USE_VERTEX (GTS_SEGMENT (e3), vs)) { + tmp = e1; e1 = e3; e3 = e2; e2 = tmp; + } + else + g_assert (SEGMENT_USE_VERTEX (GTS_SEGMENT (e1), vs)); + if (SEGMENT_USE_VERTEX (GTS_SEGMENT (e2), vs) || + !gts_segments_touch (GTS_SEGMENT (e1), GTS_SEGMENT (e2))) { + tmp = e1; e1 = e2; e2 = e3; e3 = tmp; + g_assert (gts_segments_touch (GTS_SEGMENT (e1), GTS_SEGMENT (e2))); + } + + *vvs = orientation ? e1 : e3; + + if (GTS_SEGMENT (*vvs)->v1 != vs) { + g_assert (GTS_SEGMENT (*vvs)->v2 == vs); + *v = GTS_SEGMENT (*vvs)->v1; + } + else + *v = GTS_SEGMENT (*vvs)->v2; +} + +static void replace_edge_expand (GtsEdge * e, + GtsEdge * with, + GtsTriangle ** a, + GtsVertex * v) +{ + GtsTriangle ** i = a, * t; + + while ((t = *(i++))) { +#ifdef DEBUG_EXPAND + g_assert (!IS_CFACE (t)); + fprintf (stderr, "replacing %p->%d: e: %p->%d with: %p->%d\n", + t, id (t), e, id (e), with, id (with)); +#endif + TRIANGLE_REPLACE_EDGE (t, e, with); + with->triangles = g_slist_prepend (with->triangles, t); + if (GTS_OBJECT (t)->reserved) { + /* apart from the triangles having e as an edge, t is the only + triangle using v */ + g_assert (GTS_OBJECT (t)->reserved == v); + GTS_OBJECT (t)->reserved = NULL; + } + else + GTS_OBJECT (t)->reserved = v; + } +} + +static void cface_expand (CFace * cf, + GtsTriangle ** a1, + GtsTriangle ** a2, + GtsEdge * e, + GtsVertex * v1, + GtsVertex * v2, + GtsVertex * vs, + GtsEdgeClass * klass) +{ + GtsVertex * v; + GtsEdge * e1, * e2, * vvs; + gboolean orientation; + guint flags; + + g_return_if_fail (cf != NULL); + g_return_if_fail (IS_CFACE (cf)); + g_return_if_fail (e != NULL); + g_return_if_fail (vs != NULL); + + flags = cf->flags; + orientation = CFACE_ORIENTATION (cf); + + find_vvs (vs, cf->t, &v, &vvs, CFACE_VVS (cf)); + +#ifdef NEW + if (flags & CFACE_E1) + e1 = GTS_EDGE (gts_vertices_are_connected (v1, v)); + else + e1 = gts_edge_new (klass, v, v1); + if (flags & CFACE_E2) + e2 = GTS_EDGE (gts_vertices_are_connected (v2, v)); + else + e2 = gts_edge_new (klass, v, v2); +#else + e1 = gts_edge_new (v, v1); + e2 = gts_edge_new (v, v2); +#endif + + replace_edge_expand (vvs, e1, a1, v1); + replace_edge_expand (vvs, e2, a2, v2); + +#ifdef NEW + if (!(flags & CFACE_KEEP_VVS)) { + g_slist_free (vvs->triangles); + vvs->triangles = NULL; + gts_object_destroy (GTS_OBJECT (vvs)); + } +#else + g_slist_free (vvs->triangles); + vvs->triangles = NULL; + gts_object_destroy (GTS_OBJECT (vvs)); +#endif + + /* gts_face_new : because I am "creating" a face */ + GTS_OBJECT (cf)->klass = GTS_OBJECT_CLASS (gts_face_class ()); + gts_object_init (GTS_OBJECT (cf), GTS_OBJECT (cf)->klass); + + if (orientation) + gts_triangle_set (GTS_TRIANGLE (cf), e, e2, e1); + else + gts_triangle_set (GTS_TRIANGLE (cf), e, e1, e2); +} + +static void split_destroy (GtsObject * object) +{ + GtsSplit * vs = GTS_SPLIT (object); + guint i = vs->ncf; + GtsSplitCFace * cf = vs->cfaces; + + while (i--) { + if (IS_CFACE (cf->f)) + gts_object_destroy (GTS_OBJECT (cf->f)); + g_free (cf->a1); + g_free (cf->a2); + cf++; + } + g_free (vs->cfaces); + + if (!gts_allow_floating_vertices && vs->v && vs->v->segments == NULL) + gts_object_destroy (GTS_OBJECT (vs->v)); + + (* GTS_OBJECT_CLASS (gts_split_class ())->parent_class->destroy) (object); +} + +static void split_class_init (GtsObjectClass * klass) +{ + klass->destroy = split_destroy; +} + +static void split_init (GtsSplit * split) +{ + split->v1 = split->v2 = NULL; + split->v = NULL; + split->cfaces = NULL; + split->ncf = 0; +} + +/** + * gts_split_class: + * + * Returns: the #GtsSplitClass. + */ +GtsSplitClass * gts_split_class (void) +{ + static GtsSplitClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo split_info = { + "GtsSplit", + sizeof (GtsSplit), + sizeof (GtsSplitClass), + (GtsObjectClassInitFunc) split_class_init, + (GtsObjectInitFunc) split_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), + &split_info); + } + + return klass; +} + +#ifdef DEBUG +static gboolean edge_collapse_is_valid (GtsEdge * e) +{ + GSList * i; + + g_return_val_if_fail (e != NULL, FALSE); + + if (gts_segment_is_duplicate (GTS_SEGMENT (e))) { + g_warning ("collapsing duplicate edge"); + return FALSE; + } + + i = GTS_SEGMENT (e)->v1->segments; + while (i) { + GtsEdge * e1 = i->data; + if (e1 != e && GTS_IS_EDGE (e1)) { + GtsEdge * e2 = NULL; + GSList * j = GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e)->v1 ? + GTS_SEGMENT (e1)->v2->segments : GTS_SEGMENT (e1)->v1->segments; + while (j && !e2) { + GtsEdge * e1 = j->data; + if (GTS_IS_EDGE (e1) && + (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e)->v2 || + GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e)->v2)) + e2 = e1; + j = j->next; + } + if (e2 && !gts_triangle_use_edges (e, e1, e2)) { + g_warning ("collapsing empty triangle"); + return FALSE; + } + } + i = i->next; + } + + if (gts_edge_is_boundary (e, NULL)) { + GtsTriangle * t = e->triangles->data; + if (gts_edge_is_boundary (t->e1, NULL) && + gts_edge_is_boundary (t->e2, NULL) && + gts_edge_is_boundary (t->e3, NULL)) { + g_warning ("collapsing single triangle"); + return FALSE; + } + } + else { + if (gts_vertex_is_boundary (GTS_SEGMENT (e)->v1, NULL) && + gts_vertex_is_boundary (GTS_SEGMENT (e)->v2, NULL)) { + g_warning ("collapsing two sides of a strip"); + return FALSE; + } + if (gts_edge_belongs_to_tetrahedron (e)) { + g_warning ("collapsing tetrahedron"); + return FALSE; + } + } + + return TRUE; +} +#endif /* DEBUG */ + +/* Not currently used. May be useful for some debug code */ +#ifdef DEBUG +static void print_split (GtsSplit * vs, FILE * fptr) +{ + guint j; + GtsSplitCFace * cf; + + g_return_if_fail (vs != NULL); + g_return_if_fail (fptr != NULL); + + fprintf (fptr, "%p: v: %p v1: %p v2: %p ncf: %u cfaces: %p\n", + vs, vs->v, vs->v1, vs->v2, vs->ncf, vs->cfaces); + cf = vs->cfaces; + j = vs->ncf; + while (j--) { + fprintf (stderr, " f: %p a1: %p a2: %p\n", + cf->f, cf->a1, cf->a2); + cf++; + } +} +#endif + +/** + * gts_split_collapse: + * @vs: a #GtsSplit. + * @klass: a #GtsEdgeClass. + * @heap: a #GtsEHeap or %NULL. + * + * Collapses the vertex split @vs. Any new edge created during the process will + * be of class @klass. If heap is not %NULL, the new edges will be inserted + * into it and the destroyed edges will be removed from it. + */ +void gts_split_collapse (GtsSplit * vs, + GtsEdgeClass * klass, + GtsEHeap * heap) +{ + GtsEdge * e; + GtsVertex * v, * v1, * v2; + GSList * i, * end; +#ifdef DYNAMIC_SPLIT + GtsSplitCFace * cf; + guint j; +#endif +#ifdef DEBUG + gboolean invalid = FALSE; + static guint ninvalid = 0; +#endif + + g_return_if_fail (vs != NULL); + g_return_if_fail (klass != NULL); + + v = vs->v; + + g_return_if_fail (v->segments == NULL); + + /* we don't want to destroy vertices */ + gts_allow_floating_vertices = TRUE; + + v1 = GTS_SPLIT_V1 (vs); + v2 = GTS_SPLIT_V2 (vs); + g_assert ((e = GTS_EDGE (gts_vertices_are_connected (v1, v2)))); + +#ifdef DEBUG + fprintf (stderr, "collapsing %p: v1: %p v2: %p v: %p\n", vs, v1, v2, v); + if (!edge_collapse_is_valid (e)) { + char fname[80]; + FILE * fptr; + GSList * triangles, * i; + + g_warning ("invalid edge collapse"); + invalid = TRUE; + sprintf (fname, "invalid.%d", ninvalid); + fptr = fopen (fname, "wt"); + gts_write_segment (GTS_SEGMENT (e), GTS_POINT (v), fptr); + triangles = gts_vertex_triangles (v1, NULL); + triangles = gts_vertex_triangles (v2, triangles); + i = triangles; + while (i) { + gts_write_triangle (i->data, GTS_POINT (v), fptr); + i = i->next; + } + g_slist_free (triangles); + fclose (fptr); + } +#endif + + i = e->triangles; +#ifdef DYNAMIC_SPLIT + cf = vs->cfaces; + j = vs->ncf; + while (j--) { + g_free (cf->a1); + g_free (cf->a2); + cf++; + } + g_free (vs->cfaces); + + vs->ncf = g_slist_length (i); + g_assert (vs->ncf > 0); + cf = vs->cfaces = g_malloc (vs->ncf*sizeof (GtsSplitCFace)); +#endif /* DYNAMIC_SPLIT */ +#ifdef NEW + while (i) { + cf->f = i->data; + g_assert (GTS_IS_FACE (cf->f)); + GTS_OBJECT (cf->f)->klass = GTS_OBJECT_CLASS (cface_class ()); + cf++; + i = i->next; + } + i = e->triangles; + cf = vs->cfaces; + while (i) { + cface_new (i->data, e, v1, v2, vs, heap, klass, cf); +#ifdef DEBUG + fprintf (stderr, "cface: %p->%d t: %p->%d a1: ", + cf->f, id (cf->f), CFACE (cf->f)->t, id (CFACE (cf->f)->t)); + { + GtsTriangle * t, ** a; + a = cf->a1; + while ((t = *(a++))) + fprintf (stderr, "%p->%d ", t, id (t)); + fprintf (stderr, "a2: "); + a = cf->a2; + while ((t = *(a++))) + fprintf (stderr, "%p->%d ", t, id (t)); + fprintf (stderr, "\n"); + } +#endif + cf++; + i = i->next; + } +#else /* not NEW */ + while (i) { + cface_new (i->data, e, v1, v2, vs, heap +#ifdef DYNAMIC_SPLIT + , cf +#endif /* DYNAMIC_SPLIT */ + ); +#ifdef DYNAMIC_SPLIT + cf->f = i->data; + cf++; +#endif /* DYNAMIC_SPLIT */ + i = i->next; + } +#endif /* NEW */ + g_slist_free (e->triangles); + e->triangles = NULL; + gts_object_destroy (GTS_OBJECT (e)); + + gts_allow_floating_vertices = FALSE; + + end = NULL; + i = v1->segments; + while (i) { + GtsSegment * s = i->data; + if (s->v1 == v1) + s->v1 = v; + else + s->v2 = v; + end = i; + i = i->next; + } + if (end) { + end->next = v->segments; + v->segments = v1->segments; + v1->segments = NULL; + } + + end = NULL; + i = v2->segments; + while (i) { + GtsSegment * s = i->data; + if (s->v1 == v2) + s->v1 = v; + else + s->v2 = v; + end = i; + i = i->next; + } + if (end) { + end->next = v->segments; + v->segments = v2->segments; + v2->segments = NULL; + } + +#ifdef DEBUG + if (invalid) { + char fname[80]; + FILE * fptr; + GSList * triangles, * i; + GtsSurface * surface = NULL; + + sprintf (fname, "invalid_after.%d", ninvalid); + fptr = fopen (fname, "wt"); + triangles = gts_vertex_triangles (v, NULL); + i = triangles; + while (i) { + GtsTriangle * t = i->data; + fprintf (stderr, "checking %p->%d\n", t, id (t)); + g_assert (GTS_IS_FACE (t)); + gts_write_triangle (t, GTS_POINT (v), fptr); + surface = GTS_FACE (t)->surfaces->data; + if (gts_triangle_is_duplicate (t)) + fprintf (stderr, "%p->%d is duplicate\n", t, id (t)); + if (gts_segment_is_duplicate (GTS_SEGMENT (t->e1))) + fprintf (stderr, "e1 of %p->%d is duplicate\n", t, id (t)); + if (gts_segment_is_duplicate (GTS_SEGMENT (t->e2))) + fprintf (stderr, "e2 of %p->%d is duplicate\n", t, id (t)); + if (gts_segment_is_duplicate (GTS_SEGMENT (t->e3))) + fprintf (stderr, "e3 of %p->%d is duplicate\n", t, id (t)); + i = i->next; + } + fclose (fptr); + g_slist_free (triangles); +#if 0 + gts_split_expand (vs, surface); + + sprintf (fname, "invalid_after_after.%d", ninvalid); + fptr = fopen (fname, "wt"); + triangles = gts_vertex_triangles (v1, NULL); + triangles = gts_vertex_triangles (v2, triangles); + i = triangles; + while (i) { + GtsTriangle * t = i->data; + gts_write_triangle (t, GTS_POINT (v), fptr); + surface = GTS_FACE (t)->surfaces->data; + if (gts_triangle_is_duplicate (t)) + fprintf (stderr, "%p->%d is duplicate\n", t, id (t)); + if (gts_segment_is_duplicate (GTS_SEGMENT (t->e1))) + fprintf (stderr, "e1 of %p->%d is duplicate\n", t, id (t)); + if (gts_segment_is_duplicate (GTS_SEGMENT (t->e2))) + fprintf (stderr, "e2 of %p->%d is duplicate\n", t, id (t)); + if (gts_segment_is_duplicate (GTS_SEGMENT (t->e3))) + fprintf (stderr, "e3 of %p->%d is duplicate\n", t, id (t)); + i = i->next; + } + fclose (fptr); + g_slist_free (triangles); + + exit (1); +#endif + ninvalid++; + } +#endif +} + +/** + * gts_split_expand: + * @vs: a #GtsSplit. + * @s: a #GtsSurface. + * @klass: a #GtsEdgeClass. + * + * Expands the vertex split @vs adding the newly created faces to @s. Any + * new edge will be of class @klass. + */ +void gts_split_expand (GtsSplit * vs, + GtsSurface * s, + GtsEdgeClass * klass) +{ + GSList * i; + GtsEdge * e; + GtsVertex * v, * v1, * v2; + gboolean changed = FALSE; + GtsSplitCFace * cf; + guint j; + + g_return_if_fail (vs != NULL); + g_return_if_fail (s != NULL); + g_return_if_fail (klass != NULL); + + /* we don't want to destroy vertices */ + gts_allow_floating_vertices = TRUE; + + v1 = GTS_SPLIT_V1 (vs); + v2 = GTS_SPLIT_V2 (vs); + v = vs->v; +#ifdef DEBUG_EXPAND + fprintf (stderr, "expanding %p->%d: v1: %p->%d v2: %p->%d v: %p->%d\n", + vs, id (vs), v1, id (v1), v2, id (v2), v, id (v)); +#endif + e = gts_edge_new (klass, v1, v2); + cf = vs->cfaces; + j = vs->ncf; + while (j--) { + cface_expand (CFACE (cf->f), cf->a1, cf->a2, e, v1, v2, v, klass); + gts_surface_add_face (s, cf->f); + cf++; + } + + gts_allow_floating_vertices = FALSE; + + /* this part is described by figure "expand.fig" */ + i = v->segments; + while (i) { + GtsEdge * e1 = i->data; + GtsVertex * with = NULL; + GSList * j = e1->triangles, * next = i->next; + // fprintf (stderr, "e1: %p->%d\n", e1, id (e1)); + while (j && !with) { + with = GTS_OBJECT (j->data)->reserved; + j = j->next; + } + if (with) { + j = e1->triangles; + while (j) { + GtsTriangle * t = j->data; + if (GTS_OBJECT (t)->reserved) { + g_assert (GTS_OBJECT (t)->reserved == with); + GTS_OBJECT (t)->reserved = NULL; + } + else + GTS_OBJECT (t)->reserved = with; + j = j->next; + } + if (GTS_SEGMENT (e1)->v1 == v) + GTS_SEGMENT (e1)->v1 = with; + else + GTS_SEGMENT (e1)->v2 = with; + + v->segments = g_slist_remove_link (v->segments, i); + i->next = with->segments; + with->segments = i; + changed = TRUE; + } + if (next) + i = next; + else { + /* check for infinite loop (the crossed out case in + figure "expand.fig") */ + g_assert (changed); + changed = FALSE; + i = v->segments; + } + } +} + +#ifndef DYNAMIC_SPLIT +static void cface_neighbors (GtsSplitCFace * cf, + GtsEdge * e, + GtsVertex * v1, + GtsVertex * v2) +{ + GtsTriangle * t = GTS_TRIANGLE (cf->f), ** a; + GtsEdge * e1 = t->e1, * e2 = t->e2, * e3 = t->e3; + GSList * i; + guint size; + + ROTATE_ORIENT (e, e1, e2, e3); + if (SEGMENT_USE_VERTEX (GTS_SEGMENT (e1), v2)) { + e3 = e1; e1 = e2; e2 = e3; + } + + i = e1->triangles; + size = g_slist_length (i)*sizeof (GtsTriangle *); + a = cf->a1 = g_malloc (size > 0 ? size : sizeof (GtsTriangle *)); + while (i) { + if (i->data != t) + *(a++) = i->data; + i = i->next; + } + *a = NULL; + + i = e2->triangles; + size = g_slist_length (i)*sizeof (GtsTriangle *); + a = cf->a2 = g_malloc (size > 0 ? size : sizeof (GtsTriangle *)); + while (i) { + if (i->data != t) + *(a++) = i->data; + i = i->next; + } + *a = NULL; +} +#endif /*ifndef DYNAMIC_SPLIT */ + +/** + * gts_split_new: + * @klass: a #GtsSplitClass. + * @v: a #GtsVertex. + * @o1: either a #GtsVertex or a #GtsSplit. + * @o2: either a #GtsVertex or a #GtsSplit. + * + * Creates a new #GtsSplit which would collapse @o1 and @o2 into @v. The + * collapse itself is not performed. + * + * Returns: the new #GtsSplit. + */ +GtsSplit * gts_split_new (GtsSplitClass * klass, + GtsVertex * v, + GtsObject * o1, + GtsObject * o2) +{ + GtsSplit * vs; +#ifndef DYNAMIC_SPLIT + GtsVertex * v1, * v2; + GtsEdge * e; + GSList * i; + GtsSplitCFace * cf; +#endif + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (v != NULL, NULL); + g_return_val_if_fail (GTS_IS_SPLIT (o1) || GTS_IS_VERTEX (o1), NULL); + g_return_val_if_fail (GTS_IS_SPLIT (o2) || GTS_IS_VERTEX (o2), NULL); + + vs = GTS_SPLIT (gts_object_new (GTS_OBJECT_CLASS (klass))); + vs->v = v; + vs->v1 = o1; + vs->v2 = o2; +#ifdef DYNAMIC_SPLIT + vs->ncf = 0; + vs->cfaces = NULL; +#else + v1 = GTS_SPLIT_V1 (vs); + v2 = GTS_SPLIT_V2 (vs); + g_assert ((e = GTS_EDGE (gts_vertices_are_connected (v1, v2)))); + i = e->triangles; + vs->ncf = g_slist_length (i); + g_assert (vs->ncf > 0); + cf = vs->cfaces = g_malloc (vs->ncf*sizeof (GtsSplitCFace)); + while (i) { + cf->f = i->data; + cface_neighbors (cf, e, v1, v2); + i = i->next; + cf++; + } +#endif + + return vs; +} + +static gboolean +split_traverse_pre_order (GtsSplit * vs, + GtsSplitTraverseFunc func, + gpointer data) +{ + if (func (vs, data)) + return TRUE; + if (GTS_IS_SPLIT (vs->v1) && + split_traverse_pre_order (GTS_SPLIT (vs->v1), func, data)) + return TRUE; + if (GTS_IS_SPLIT (vs->v2) && + split_traverse_pre_order (GTS_SPLIT (vs->v2), func, data)) + return TRUE; + return FALSE; +} + +static gboolean +split_depth_traverse_pre_order (GtsSplit * vs, + guint depth, + GtsSplitTraverseFunc func, + gpointer data) +{ + if (func (vs, data)) + return TRUE; + + depth--; + if (!depth) + return FALSE; + + if (GTS_IS_SPLIT (vs->v1) && + split_depth_traverse_pre_order (GTS_SPLIT (vs->v1), depth, func, data)) + return TRUE; + if (GTS_IS_SPLIT (vs->v2) && + split_depth_traverse_pre_order (GTS_SPLIT (vs->v2), depth, func, data)) + return TRUE; + return FALSE; +} + +static gboolean +split_traverse_post_order (GtsSplit * vs, + GtsSplitTraverseFunc func, + gpointer data) +{ + if (GTS_IS_SPLIT (vs->v1) && + split_traverse_post_order (GTS_SPLIT (vs->v1), func, data)) + return TRUE; + if (GTS_IS_SPLIT (vs->v2) && + split_traverse_post_order (GTS_SPLIT (vs->v2), func, data)) + return TRUE; + if (func (vs, data)) + return TRUE; + return FALSE; +} + +static gboolean +split_depth_traverse_post_order (GtsSplit * vs, + guint depth, + GtsSplitTraverseFunc func, + gpointer data) +{ + depth--; + if (depth) { + if (GTS_IS_SPLIT (vs->v1) && + split_depth_traverse_post_order (GTS_SPLIT (vs->v1), + depth, func, data)) + return TRUE; + if (GTS_IS_SPLIT (vs->v2) && + split_depth_traverse_post_order (GTS_SPLIT (vs->v2), + depth, func, data)) + return TRUE; + } + if (func (vs, data)) + return TRUE; + return FALSE; +} + +/** + * gts_split_traverse: + * @root: the #GtsSplit to start the traversal from. + * @order: the order in which nodes are visited - G_PRE_ORDER or G_POST_ORDER. + * @depth: the maximum depth of the traversal. Nodes below this depth + * will not be visited. If depth is -1 all nodes in the tree are + * visited. If depth is 1, only the root is visited. If depth is 2, + * the root and its children are visited. And so on. + * @func: the function to call for each visited #GtsHSplit. + * @data: user data to pass to the function. + * + * Traverses the #GtsSplit tree having @root as root. Calls @func for each + * #GtsSplit of the tree in the order specified by @order. If order is set + * to G_PRE_ORDER @func is called for the #GtsSplit then its children, if order + * is set to G_POST_ORDER @func is called for the children and then for the + * #GtsSplit. + */ +void gts_split_traverse (GtsSplit * root, + GTraverseType order, + gint depth, + GtsSplitTraverseFunc func, + gpointer data) +{ + g_return_if_fail (root != NULL); + g_return_if_fail (func != NULL); + g_return_if_fail (order < G_LEVEL_ORDER); + g_return_if_fail (depth == -1 || depth > 0); + + switch (order) { + case G_PRE_ORDER: + if (depth < 0) + split_traverse_pre_order (root, func, data); + else + split_depth_traverse_pre_order (root, depth, func, data); + break; + case G_POST_ORDER: + if (depth < 0) + split_traverse_post_order (root, func, data); + else + split_depth_traverse_post_order (root, depth, func, data); + break; + default: + g_assert_not_reached (); + } +} + +/** + * gts_split_height: + * @root: a #GtsSplit. + * + * Returns: the maximum height of the vertex split tree having @root as root. + */ +guint gts_split_height (GtsSplit * root) +{ + guint height = 0, tmp_height; + + g_return_val_if_fail (root != NULL, 0); + + if (GTS_IS_SPLIT (root->v1)) { + tmp_height = gts_split_height (GTS_SPLIT (root->v1)); + if (tmp_height > height) + height = tmp_height; + } + if (GTS_IS_SPLIT (root->v2)) { + tmp_height = gts_split_height (GTS_SPLIT (root->v2)); + if (tmp_height > height) + height = tmp_height; + } + + return height + 1; +} + +#ifndef DYNAMIC_SPLIT +static gboolean list_array_are_identical (GSList * list, + gpointer * array, + gpointer excluded) +{ + while (list) { + gpointer data = list->data; + if (data != excluded) { + gboolean found = FALSE; + gpointer * a = array; + + while (!found && *a) + if (*(a++) == data) + found = TRUE; + if (!found) + return FALSE; + } + list = list->next; + } + return TRUE; +} +#endif /* ifndef DYNAMIC_SPLIT */ + +#ifndef NEW +gboolean gts_split_is_collapsable (GtsSplit * vs) +{ + guint i; + GtsSplitCFace * cf; + GtsVertex * v1, * v2; + GtsEdge * e; + + g_return_val_if_fail (vs != NULL, FALSE); + + v1 = GTS_SPLIT_V1 (vs); + v2 = GTS_SPLIT_V2 (vs); + g_return_val_if_fail ((e = GTS_EDGE (gts_vertices_are_connected (v1, v2))), + FALSE); + +#ifdef DYNAMIC_SPLIT + if (!gts_edge_collapse_is_valid (e)) + return FALSE; +#else + i = vs->ncf; + cf = vs->cfaces; + while (i--) { + GtsTriangle * t = GTS_TRIANGLE (cf->f); + GtsEdge * e1 = t->e1, * e2 = t->e2, * e3 = t->e3; + + ROTATE_ORIENT (e, e1, e2, e3); + if (SEGMENT_USE_VERTEX (GTS_SEGMENT (e1), v2)) { + e3 = e1; e1 = e2; e2 = e3; + } + + if (!list_array_are_identical (e1->triangles, (gpointer *) cf->a1, t)) + return FALSE; + if (!list_array_are_identical (e2->triangles, (gpointer *) cf->a2, t)) + return FALSE; + + cf++; + } +#endif + return TRUE; +} +#endif /* not NEW */ + +#ifdef DEBUG_HEXPAND +static guint expand_level = 0; + +static void expand_indent (FILE * fptr) +{ + guint i = expand_level; + while (i--) + fputc (' ', fptr); +} +#endif + +/** + * gts_hsplit_force_expand: + * @hs: a #GtsHSplit. + * @hsurface: a #GtsHSurface. + * + * Forces the expansion of @hs by first expanding all its dependencies not + * already expanded. + */ +void gts_hsplit_force_expand (GtsHSplit * hs, + GtsHSurface * hsurface) +{ + guint i; + GtsSplitCFace * cf; + + g_return_if_fail (hs != NULL); + g_return_if_fail (hsurface != NULL); + g_return_if_fail (hs->nchild == 0); + +#ifdef DEBUG_HEXPAND + expand_level += 2; +#endif + + if (hs->parent && hs->parent->nchild == 0) { +#ifdef DEBUG_HEXPAND + expand_indent (stderr); + fprintf (stderr, "expand parent %p\n", hs->parent); +#endif + gts_hsplit_force_expand (hs->parent, hsurface); + } + + i = GTS_SPLIT (hs)->ncf; + cf = GTS_SPLIT (hs)->cfaces; + while (i--) { + GtsTriangle ** j, * t; + + j = cf->a1; + while ((t = *(j++))) + if (IS_CFACE (t)) { +#ifdef DEBUG_HEXPAND + expand_indent (stderr); + fprintf (stderr, "expand a1: cf->f: %p t: %p parent_split: %p\n", + cf->f, + t, + GTS_HSPLIT (CFACE (t)->parent_split)); +#endif + gts_hsplit_force_expand (GTS_HSPLIT (CFACE (t)->parent_split), + hsurface); +#ifdef DEBUG_HEXPAND + g_assert (!IS_CFACE (t)); +#endif + } + j = cf->a2; + while ((t = *(j++))) + if (IS_CFACE (t)) { +#ifdef DEBUG_HEXPAND + expand_indent (stderr); + fprintf (stderr, "expand a2: cf->f: %p t: %p parent_split: %p\n", + cf->f, + t, + GTS_HSPLIT (CFACE (t)->parent_split)); +#endif + gts_hsplit_force_expand (GTS_HSPLIT (CFACE (t)->parent_split), + hsurface); + } + cf++; + } + + gts_hsplit_expand (hs, hsurface); + +#ifdef DEBUG_HEXPAND + expand_level -= 2; + expand_indent (stderr); + fprintf (stderr, "%p expanded\n", hs); +#endif +} + +static void index_object (GtsObject * o, guint * n) +{ + o->reserved = GUINT_TO_POINTER ((*n)++); +} + +static void index_face (GtsFace * f, gpointer * data) +{ + guint * nf = data[1]; + + g_hash_table_insert (data[0], f, GUINT_TO_POINTER ((*nf)++)); +} + +/** + * gts_psurface_write: + * @ps: a #GtsPSurface. + * @fptr: a file pointer. + * + * Writes to @fptr a GTS progressive surface description. + */ +void gts_psurface_write (GtsPSurface * ps, FILE * fptr) +{ + guint nv = 1; + guint nf = 1; + GHashTable * hash; + gpointer data[2]; + + g_return_if_fail (ps != NULL); + g_return_if_fail (fptr != NULL); + g_return_if_fail (GTS_PSURFACE_IS_CLOSED (ps)); + + while (gts_psurface_remove_vertex (ps)) + ; + + GTS_POINT_CLASS (ps->s->vertex_class)->binary = FALSE; + gts_surface_write (ps->s, fptr); + + gts_surface_foreach_vertex (ps->s, (GtsFunc) index_object, &nv); + hash = g_hash_table_new (NULL, NULL); + data[0] = hash; + data[1] = &nf; + gts_surface_foreach_face (ps->s, (GtsFunc) index_face, data); + + fprintf (fptr, "%u\n", ps->split->len); + while (ps->pos) { + GtsSplit * vs = g_ptr_array_index (ps->split, --ps->pos); + GtsSplitCFace * scf = vs->cfaces; + GtsVertex * v1, * v2; + guint i = vs->ncf; + + fprintf (fptr, "%u %u", + GPOINTER_TO_UINT (GTS_OBJECT (vs->v)->reserved), + vs->ncf); + if (GTS_OBJECT (vs)->klass->write) + (*GTS_OBJECT (vs)->klass->write) (GTS_OBJECT (vs), fptr); + fputc ('\n', fptr); + + v1 = GTS_IS_SPLIT (vs->v1) ? GTS_SPLIT (vs->v1)->v : GTS_VERTEX (vs->v1); + GTS_OBJECT (v1)->reserved = GUINT_TO_POINTER (nv++); + v2 = GTS_IS_SPLIT (vs->v2) ? GTS_SPLIT (vs->v2)->v : GTS_VERTEX (vs->v2); + GTS_OBJECT (v2)->reserved = GUINT_TO_POINTER (nv++); + + (*GTS_OBJECT (v1)->klass->write) (GTS_OBJECT (v1), fptr); + fputc ('\n', fptr); + + (*GTS_OBJECT (v2)->klass->write) (GTS_OBJECT (v2), fptr); + fputc ('\n', fptr); + + while (i--) { + CFace * cf = CFACE (scf->f); + GtsTriangle ** a, * t; + + fprintf (fptr, "%u %u", + GPOINTER_TO_UINT (g_hash_table_lookup (hash, cf->t)), + cf->flags); + if (GTS_OBJECT_CLASS (ps->s->face_class)->write) + (*GTS_OBJECT_CLASS (ps->s->face_class)->write) (GTS_OBJECT (cf), fptr); + fputc ('\n', fptr); + + a = scf->a1; + while ((t = *(a++))) + fprintf (fptr, "%u ", + GPOINTER_TO_UINT (g_hash_table_lookup (hash, t))); + fprintf (fptr, "\n"); + + a = scf->a2; + while ((t = *(a++))) + fprintf (fptr, "%u ", + GPOINTER_TO_UINT (g_hash_table_lookup (hash, t))); + fprintf (fptr, "\n"); + + g_hash_table_insert (hash, cf, GUINT_TO_POINTER (nf++)); + + scf++; + } + + gts_split_expand (vs, ps->s, ps->s->edge_class); + } + + gts_surface_foreach_vertex (ps->s, + (GtsFunc) gts_object_reset_reserved, NULL); + g_hash_table_destroy (hash); +} + +static guint surface_read (GtsSurface * surface, + GtsFile * f, + GPtrArray * vertices, + GPtrArray * faces) +{ + GtsEdge ** edges; + guint n, nv, ne, nf; + + g_return_val_if_fail (surface != NULL, 1); + g_return_val_if_fail (f != NULL, 1); + + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer (number of vertices)"); + return f->line; + } + nv = atoi (f->token->str); + + gts_file_next_token (f); + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer (number of edges)"); + return f->line; + } + ne = atoi (f->token->str); + + gts_file_next_token (f); + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer (number of faces)"); + return f->line; + } + nf = atoi (f->token->str); + + gts_file_next_token (f); + if (f->type == GTS_STRING) { + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsSurfaceClass)"); + return f->line; + } + gts_file_next_token (f); + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsFaceClass)"); + return f->line; + } + gts_file_next_token (f); + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsEdgeClass)"); + return f->line; + } + gts_file_next_token (f); + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsVertexClass)"); + return f->line; + } + if (!strcmp (f->token->str, "GtsVertexBinary")) + GTS_POINT_CLASS (surface->vertex_class)->binary = TRUE; + else + gts_file_first_token_after (f, '\n'); + } + else + gts_file_first_token_after (f, '\n'); + + g_ptr_array_set_size (vertices, nv); + g_ptr_array_set_size (faces, nf); + /* allocate nv + 1 just in case nv == 0 */ + edges = g_malloc ((ne + 1)*sizeof (GtsEdge *)); + + n = 0; + while (n < nv && f->type != GTS_ERROR) { + GtsObject * new_vertex = + gts_object_new (GTS_OBJECT_CLASS (surface->vertex_class)); + + (* GTS_OBJECT_CLASS (surface->vertex_class)->read) (&new_vertex, f); + if (f->type != GTS_ERROR) { + if (!GTS_POINT_CLASS (surface->vertex_class)->binary) + gts_file_first_token_after (f, '\n'); + g_ptr_array_index (vertices, n++) = new_vertex; + } + else + gts_object_destroy (new_vertex); + } + if (f->type == GTS_ERROR) + nv = n; + if (GTS_POINT_CLASS (surface->vertex_class)->binary) + gts_file_first_token_after (f, '\n'); + + n = 0; + while (n < ne && f->type != GTS_ERROR) { + guint p1, p2; + + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (first vertex index)"); + else { + p1 = atoi (f->token->str); + if (p1 == 0 || p1 > nv) + gts_file_error (f, "vertex index `%d' is out of range `[1,%d]'", + p1, nv); + else { + gts_file_next_token (f); + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (second vertex index)"); + else { + p2 = atoi (f->token->str); + if (p2 == 0 || p2 > nv) + gts_file_error (f, "vertex index `%d' is out of range `[1,%d]'", + p2, nv); + else { + GtsEdge * new_edge = + gts_edge_new (surface->edge_class, + g_ptr_array_index (vertices, p1 - 1), + g_ptr_array_index (vertices, p2 - 1)); + + gts_file_next_token (f); + if (f->type != '\n') + if (GTS_OBJECT_CLASS (surface->edge_class)->read) + (*GTS_OBJECT_CLASS (surface->edge_class)->read) + ((GtsObject **) &new_edge, f); + gts_file_first_token_after (f, '\n'); + edges[n++] = new_edge; + } + } + } + } + } + if (f->type == GTS_ERROR) + ne = n; + + n = 0; + while (n < nf && f->type != GTS_ERROR) { + guint s1, s2, s3; + + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (first edge index)"); + else { + s1 = atoi (f->token->str); + if (s1 == 0 || s1 > ne) + gts_file_error (f, "edge index `%d' is out of range `[1,%d]'", + s1, ne); + else { + gts_file_next_token (f); + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (second edge index)"); + else { + s2 = atoi (f->token->str); + if (s2 == 0 || s2 > ne) + gts_file_error (f, "edge index `%d' is out of range `[1,%d]'", + s2, ne); + else { + gts_file_next_token (f); + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (third edge index)"); + else { + s3 = atoi (f->token->str); + if (s3 == 0 || s3 > ne) + gts_file_error (f, "edge index `%d' is out of range `[1,%d]'", + s3, ne); + else { + GtsFace * new_face = gts_face_new (surface->face_class, + edges[s1 - 1], + edges[s2 - 1], + edges[s3 - 1]); + + gts_file_next_token (f); + if (f->type != '\n') + if (GTS_OBJECT_CLASS (surface->face_class)->read) + (*GTS_OBJECT_CLASS (surface->face_class)->read) + ((GtsObject **) &new_face, f); + gts_file_first_token_after (f, '\n'); + gts_surface_add_face (surface, new_face); + g_ptr_array_index (faces, n++) = new_face; + } + } + } + } + } + } + } + + g_free (edges); + + if (f->type == GTS_ERROR) { + gts_allow_floating_vertices = TRUE; + while (nv) + gts_object_destroy (GTS_OBJECT (g_ptr_array_index (vertices, nv-- - 1))); + gts_allow_floating_vertices = FALSE; + return f->line; + } + + return 0; +} + +/** + * gts_psurface_open: + * @klass: a #GtsPSurfaceClass. + * @s: a #GtsSurface. + * @split_class: a #GtsSplitClass to use for the #GtsSplit. + * @f: a #GtsFile. + * + * Creates a new #GtsPSurface prepared for input from the file @f + * containing a valid GTS representation of a progressive surface. The initial + * shape of the progressive surface is loaded into @s. + * + * Before being usable as such this progressive surface must be closed using + * gts_psurface_close(). While open however, the functions + * gts_psurface_get_vertex_number(), gts_psurface_min_vertex_number() and + * gts_psurface_max_vertex_number() can still be used. + * + * Returns: a new #GtsPSurface or %NULL if there was a format error while + * reading the file, in which case @f contains information about the error. + */ +GtsPSurface * gts_psurface_open (GtsPSurfaceClass * klass, + GtsSurface * s, + GtsSplitClass * split_class, + GtsFile * f) +{ + GtsPSurface * ps; + + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (split_class != NULL, NULL); + g_return_val_if_fail (f != NULL, NULL); + + ps = GTS_PSURFACE (gts_object_new (GTS_OBJECT_CLASS (klass))); + ps->s = s; + ps->split_class = split_class; + + ps->vertices = g_ptr_array_new (); + ps->faces = g_ptr_array_new (); + + if (surface_read (s, f, ps->vertices, ps->faces)) { + ps->s = NULL; + gts_object_destroy (GTS_OBJECT (ps)); + return NULL; + } + + ps->min = gts_surface_vertex_number (ps->s); + ps->pos = 0; + + if (f->type == GTS_INT) { + gint ns = atoi (f->token->str); + + if (ns > 0) { + g_ptr_array_set_size (ps->split, ns); + gts_file_first_token_after (f, '\n'); + } + } + + return ps; +} + +/** + * gts_psurface_read_vertex: + * @ps: a #GtsPSurface prealably created with gts_psurface_open(). + * @fp: a #GtsFile. + * + * Reads in one vertex split operation from @fp and performs the expansion. + * + * If an error occurs while reading the file, the @error field of @fp is set. + * + * Returns: the newly created #GtsSplit or %NULL if no vertex split could be + * read from @fp. + */ +GtsSplit * gts_psurface_read_vertex (GtsPSurface * ps, GtsFile * fp) +{ + guint nv, ncf; + GtsSplit * vs, * parent; + GtsSplitCFace * scf; + + g_return_val_if_fail (ps != NULL, NULL); + g_return_val_if_fail (fp != NULL, NULL); + g_return_val_if_fail (!GTS_PSURFACE_IS_CLOSED (ps), NULL); + + if (ps->pos >= ps->split->len) + return NULL; + + if (fp->type == GTS_NONE) + return NULL; + if (fp->type != GTS_INT) { + gts_file_error (fp, "expecting an integer (vertex index)"); + return NULL; + } + nv = atoi (fp->token->str); + if (nv == 0 || nv > ps->vertices->len) { + gts_file_error (fp, "vertex index `%d' is out of range `[1,%d]'", + nv, ps->vertices->len); + return NULL; + } + + gts_file_next_token (fp); + if (fp->type != GTS_INT) { + gts_file_error (fp, "expecting an integer (ncf)"); + return NULL; + } + ncf = atoi (fp->token->str); + + vs = GTS_SPLIT (gts_object_new (GTS_OBJECT_CLASS (ps->split_class))); + + vs->v = g_ptr_array_index (ps->vertices, nv - 1); + vs->v1 = vs->v2 = NULL; + vs->cfaces = NULL; + vs->ncf = 0; + + gts_file_next_token (fp); + if (fp->type != '\n') + if (GTS_OBJECT (vs)->klass->read) + (* GTS_OBJECT (vs)->klass->read) ((GtsObject **) &vs, fp); + gts_file_first_token_after (fp, '\n'); + + if (fp->type != GTS_ERROR) { + vs->v1 = gts_object_new (GTS_OBJECT_CLASS (ps->s->vertex_class)); + (* GTS_OBJECT_CLASS (ps->s->vertex_class)->read) (&(vs->v1), fp); + if (fp->type != GTS_ERROR) { + vs->v1->reserved = vs; + g_ptr_array_add (ps->vertices, vs->v1); + + gts_file_first_token_after (fp, '\n'); + + vs->v2 = gts_object_new (GTS_OBJECT_CLASS (ps->s->vertex_class)); + (*GTS_OBJECT_CLASS (ps->s->vertex_class)->read) (&(vs->v2), fp); + if (fp->type != GTS_ERROR) { + vs->v2->reserved = vs; + g_ptr_array_add (ps->vertices, vs->v2); + gts_file_first_token_after (fp, '\n'); + } + } + } + + if (fp->type != GTS_ERROR) { + scf = vs->cfaces = g_malloc (sizeof (GtsSplitCFace)*ncf); + while (fp->type != GTS_ERROR && ncf--) { + guint it, flags; + GtsFace * f; + CFace * cf; + GPtrArray * a; + + if (fp->type != GTS_INT) + gts_file_error (fp, "expecting an integer (face index)"); + else { + it = atoi (fp->token->str); + if (it == 0 || it > ps->faces->len) + gts_file_error (fp, "face index `%d' is out of range `[1,%d]'", + it, ps->faces->len); + else { + gts_file_next_token (fp); + if (fp->type != GTS_INT) + gts_file_error (fp, "expecting an integer (flags)"); + else { + flags = atoi (fp->token->str); + f = + GTS_FACE (gts_object_new (GTS_OBJECT_CLASS (ps->s->face_class))); + + gts_file_next_token (fp); + if (fp->type != '\n') + if (GTS_OBJECT (f)->klass->read) + (*GTS_OBJECT (f)->klass->read) ((GtsObject **) &f, fp); + gts_file_first_token_after (fp, '\n'); + if (fp->type != GTS_ERROR) { + scf->f = f; + + cf = (CFace *) f; + GTS_OBJECT (cf)->klass = GTS_OBJECT_CLASS (cface_class ()); + cf->parent_split = vs; + cf->t = g_ptr_array_index (ps->faces, it - 1); + cf->flags = flags; + + a = g_ptr_array_new (); + do { + if (fp->type != GTS_INT) + gts_file_error (fp, "expecting an integer (face index)"); + else { + it = atoi (fp->token->str); + if (it > ps->faces->len) + gts_file_error (fp, + "face index `%d' is out of range `[1,%d]'", + it, ps->faces->len); + else { + g_ptr_array_add (a, g_ptr_array_index (ps->faces, + it - 1)); + gts_file_next_token (fp); + } + } + } while (fp->type != GTS_ERROR && fp->type != '\n'); + gts_file_first_token_after (fp, '\n'); + g_ptr_array_add (a, NULL); + scf->a1 = (GtsTriangle **) a->pdata; + g_ptr_array_free (a, FALSE); + + if (fp->type != GTS_ERROR) { + a = g_ptr_array_new (); + do { + if (fp->type != GTS_INT) + gts_file_error (fp, "expecting an integer (face index)"); + else { + it = atoi (fp->token->str); + if (it > ps->faces->len) + gts_file_error (fp, + "face index `%d' is out of range `[1,%d]'", + it, ps->faces->len); + else { + g_ptr_array_add (a, g_ptr_array_index (ps->faces, + it - 1)); + gts_file_next_token (fp); + } + } + } while (fp->type != GTS_ERROR && fp->type != '\n'); + gts_file_first_token_after (fp, '\n'); + g_ptr_array_add (a, NULL); + scf->a2 = (GtsTriangle **) a->pdata; + g_ptr_array_free (a, FALSE); + + g_ptr_array_add (ps->faces, f); + + vs->ncf++; + scf++; + } + } + } + } + } + } + } + + if (fp->type != GTS_ERROR) { + if ((parent = GTS_OBJECT (vs->v)->reserved)) { + GTS_OBJECT (vs->v)->reserved = NULL; + if (parent->v1 == GTS_OBJECT (vs->v)) + parent->v1 = GTS_OBJECT (vs); + else { + g_assert (parent->v2 == GTS_OBJECT (vs->v)); + parent->v2 = GTS_OBJECT (vs); + } + } + g_ptr_array_index (ps->split, ps->pos++) = vs; + gts_split_expand (vs, ps->s, ps->s->edge_class); + + return vs; + } + + if (vs->v1) gts_object_destroy (vs->v1); + if (vs->v2) gts_object_destroy (vs->v2); + gts_object_destroy (GTS_OBJECT (vs)); + + return NULL; +} + +/** + * gts_psurface_close: + * @ps: a #GtsPSurface prealably created with gts_psurface_open(). + * + * Closes a progressive surface. + */ +void gts_psurface_close (GtsPSurface * ps) +{ + g_return_if_fail (ps != NULL); + g_return_if_fail (!GTS_PSURFACE_IS_CLOSED (ps)); + + g_ptr_array_free (ps->vertices, TRUE); + g_ptr_array_free (ps->faces, TRUE); + ps->faces = ps->vertices = NULL; + + gts_surface_foreach_vertex (ps->s, + (GtsFunc) gts_object_reset_reserved, NULL); + if (ps->pos > 0) + g_ptr_array_set_size (ps->split, ps->pos); + if (ps->split->len > 1) { + guint i, half = ps->split->len/2, n = ps->split->len - 1; + + for (i = 0; i < half; i++) { + gpointer p1 = g_ptr_array_index (ps->split, i); + gpointer p2 = g_ptr_array_index (ps->split, n - i); + g_ptr_array_index (ps->split, n - i) = p1; + g_ptr_array_index (ps->split, i) = p2; + } + } + ps->pos = 0; +} Index: tags/1.0.5/gts/stripe.c =================================================================== --- tags/1.0.5/gts/stripe.c (nonexistent) +++ tags/1.0.5/gts/stripe.c (revision 953) @@ -0,0 +1,766 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999-2003 Wagner Toledo Correa, Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +#define PRINT_HEAP_ELEMENTS 0 + +typedef struct { + GtsTriangle * t; + gboolean used; + GSList * neighbors; + GtsEHeapPair *pos; +} tri_data_t; + +typedef struct { + GHashTable * ht; +} map_t; + +typedef struct { + map_t * map; + GtsEHeap * heap; +} heap_t; + +static tri_data_t * tri_data_new (GtsTriangle * t); +static void tri_data_destroy (tri_data_t * td); +static guint tri_data_num_unused_neighbors2 (const tri_data_t * td, + const map_t * map); +static GHashTable * tri_data_unused_neighbors2 (const tri_data_t * td, + const map_t * map); + +static map_t * map_new (GtsSurface * s); +static void map_destroy (map_t * map); +static tri_data_t * map_lookup (const map_t * map, GtsTriangle * t); + + +static heap_t * heap_new (GtsSurface * s); +static void heap_destroy (heap_t * heap); +static gboolean heap_is_empty (const heap_t * heap); +static GtsTriangle * heap_top (const heap_t * heap); +static void heap_remove (heap_t * heap, GtsTriangle * t); + +/* helper functions */ + +static gboolean vertices_are_unique (GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3) +{ + g_assert (v1 && v2 && v3); + return (v1 != v2 && v1 != v3 && v2 != v3); +} + +static gboolean vertex_is_one_of (GtsVertex * v, + GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3) +{ + g_assert (v && v1 && v2 && v3); + return v == v1 || v == v2 || v == v3; +} + +static guint num_shared_vertices (GtsVertex * u1, + GtsVertex * u2, + GtsVertex * u3, + GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3) +{ + guint n = 0; + + g_assert (u1 && u2 && u3); + g_assert (v1 && v2 && v3); + g_assert (vertices_are_unique (u1, u2, u3)); + g_assert (vertices_are_unique (v1, v2, v3)); + + if (vertex_is_one_of (v1, u1, u2, u3)) + n++; + if (vertex_is_one_of (v2, u1, u2, u3)) + n++; + if (vertex_is_one_of (v3, u1, u2, u3)) + n++; + return n; +} + +static gboolean vertices_match (GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3, + GtsVertex ** v4, + GtsVertex ** v5, + GtsVertex ** v6) +{ + guint i; + + g_assert (v4 && v5 && v6); + g_assert (*v4 && *v5 && *v6); + g_assert (vertices_are_unique (*v4, *v5, *v6)); + + for (i = 0; i < 2; i++) { + if ((!v1 || (v1 == *v4)) && + (!v2 || (v2 == *v5)) && + (!v3 || (v3 == *v6))) + return TRUE; + else { + GtsVertex * v7 = * v4; + + *v4 = *v5; + *v5 = *v6; + *v6 = v7; + } + } + return ((!v1 || (v1 == *v4)) && + (!v2 || (v2 == *v5)) && + (!v3 || (v3 == *v6))); +} + +static GtsVertex * non_shared_vertex1 (GtsVertex * u1, + GtsVertex * u2, + GtsVertex * u3, + GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3) +{ + GtsVertex * u = NULL; + + g_assert (u1 && u2 && u3); + g_assert (v1 && v2 && v3); + g_assert (vertices_are_unique (u1, u2, u3)); + g_assert (vertices_are_unique (v1, v2, v3)); + g_assert (num_shared_vertices (u1, u2, u3, v1, v2, v3) == 2); + + if (!vertex_is_one_of (u1, v1, v2, v3)) { + g_assert (vertex_is_one_of (u2, v1, v2, v3)); + g_assert (vertex_is_one_of (u3, v1, v2, v3)); + u = u1; + } else if (!vertex_is_one_of (u2, v1, v2, v3)) { + g_assert (vertex_is_one_of (u1, v1, v2, v3)); + g_assert (vertex_is_one_of (u3, v1, v2, v3)); + u = u2; + } else if (!vertex_is_one_of (u3, v1, v2, v3)) { + g_assert (vertex_is_one_of (u1, v1, v2, v3)); + g_assert (vertex_is_one_of (u2, v1, v2, v3)); + u = u3; + } else + g_assert_not_reached (); + + return u; +} + +static void match_vertex (GtsVertex * v, + GtsVertex ** v1, + GtsVertex ** v2, + GtsVertex ** v3) +{ + g_assert (v && v1 && v2 && v3); + g_assert (*v1 && *v2 && *v3); + g_assert (vertex_is_one_of (v, *v1, *v2, *v3)); + while (*v1 != v) { + GtsVertex *v0 = *v1; + + *v1 = *v2; + *v2 = *v3; + *v3 = v0; + } +} + +/* tri_data_t functions */ + +static tri_data_t * tri_data_new (GtsTriangle * t) +{ + tri_data_t * td; + + td = g_malloc (sizeof (tri_data_t)); + td->t = t; + td->used = FALSE; + td->neighbors = gts_triangle_neighbors (t); + td->pos = NULL; + + return td; +} + +static void tri_data_destroy (tri_data_t * td) +{ + if (!td) + return; + g_slist_free (td->neighbors); + g_free (td); +} + +static guint tri_data_num_unused_neighbors2 (const tri_data_t * td, + const map_t * map) +{ + GHashTable *h; + guint n; + + g_assert (td); + g_assert (map); + h = tri_data_unused_neighbors2 (td, map); + n = g_hash_table_size (h); + g_hash_table_destroy (h); + return n; +} + +static void copy_key_to_array (gpointer key, + gpointer value, + gpointer user_data) +{ + GtsTriangle * t = key; + GtsTriangle *** p = user_data; + + (void) value; + g_assert (t); + g_assert (p && *p); + **p = t; + (*p)++; +} + +static gboolean are_neighbors_unique (GHashTable *h) +{ + GtsTriangle ** a; + GtsTriangle ** p; + gint i, j, n; /* guint won't work if n == 0 */ + + g_assert (h); + n = g_hash_table_size (h); +#ifdef DEBUG + if (n > 9) + g_warning ("triangle has %d 2-level neighbors", n); +#endif /* DEBUG */ + a = g_malloc(n*sizeof (GtsTriangle *)); + p = a; + g_hash_table_foreach (h, copy_key_to_array, &p); + for (i = 0; i < n - 1; i++) { + g_assert (a[i]); + for (j = i + 1; j < n; j++) { + g_assert (a[j]); + if (a[i] == a[j]) { + g_free (a); + return FALSE; + } + } + } + g_free (a); + return TRUE; +} + +static GHashTable * tri_data_unused_neighbors2 (const tri_data_t * td, + const map_t * map) +{ + GHashTable * h = g_hash_table_new (NULL, NULL); + GSList * li; + + g_assert (td); + g_assert (map); + for (li = td->neighbors; li != NULL; li = li->next) { + GtsTriangle * t2 = li->data; + tri_data_t * td2 = map_lookup (map, t2); + GSList * lj; + + g_assert (td2); + if (!td2->used) { + g_hash_table_insert (h, t2, td2); + for (lj = td2->neighbors; lj != NULL; lj = lj->next) { + GtsTriangle * t3 = lj->data; + tri_data_t * td3 = map_lookup (map, t3); + + g_assert (td3); + if (td3 != td && !td3->used) + g_hash_table_insert (h, t3, td3); + } + } + } + g_assert (are_neighbors_unique (h)); + return h; +} + +#if PRINT_HEAP_ELEMENTS +static void tri_data_print (const tri_data_t * td, FILE * fp) +{ + g_assert (td); + g_assert (fp); + fprintf(fp, "td=%p t=%p used=%d pos=%p key=%f\n", + td, td->t, td->used, td->pos, + td->pos ? td->pos->key : -1.0); +} +#endif /* PRINT_HEAP_ELEMENTS */ + +/* heap_t functions */ + +static gdouble triangle_priority (gpointer item, gpointer data) +{ + GtsTriangle * t = item; + map_t * map = data; + tri_data_t * td; + gdouble k; + + g_assert (t); + g_assert (map); + td = map_lookup (map, t); + g_assert (td); + k = tri_data_num_unused_neighbors2 (td, map); + return k; +} + +#if PRINT_HEAP_ELEMENTS +static void print_heap_element (gpointer data, gpointer user_data) +{ + GtsTriangle * t = data; + map_t * map = user_data; + tri_data_t * td; + + g_assert (t); + g_assert (map); + td = map_lookup (map, t); + g_assert (td); + g_assert (!td->used); + g_assert (td->pos); + tri_data_print (td, stderr); +} +#endif /* PRINT_HEAP_ELEMENTS */ + +static void insert_entry_into_heap (gpointer key, + gpointer value, + gpointer user_data) +{ + GtsTriangle * t = key; + tri_data_t * td = value; + GtsEHeap * heap = user_data; + + g_assert (!td->pos); + td->pos = gts_eheap_insert (heap, t); + g_assert (td->pos); +} + +static heap_t * heap_new (GtsSurface *s) +{ + heap_t * heap; + + g_assert (s); + heap = g_malloc (sizeof (heap_t)); + heap->map = map_new (s); + heap->heap = gts_eheap_new (triangle_priority, heap->map); + g_hash_table_foreach (heap->map->ht, + insert_entry_into_heap, + heap->heap); +#if PRINT_HEAP_ELEMENTS + gts_eheap_foreach (heap->heap, print_heap_element, heap->map); +#endif /* PRINT_HEAP_ELEMENTS */ + return heap; +} + +static void heap_destroy (heap_t * heap) +{ + if (!heap) + return; + map_destroy (heap->map); + gts_eheap_destroy (heap->heap); + g_free (heap); +} + +static gboolean heap_is_empty (const heap_t * heap) +{ + g_assert (heap); + g_assert (heap->heap); + return gts_eheap_size (heap->heap) == 0; +} + +typedef struct { + const heap_t * heap; + double min_key; +} min_key_t; + +static GtsTriangle * heap_top (const heap_t * heap) +{ + GtsTriangle * t; + + g_assert (heap); + g_assert (heap->heap); + t = gts_eheap_top (heap->heap, NULL); + return t; +} + +static void decrease_key (gpointer key, gpointer value, gpointer user_data) +{ + GtsTriangle * t = key; + tri_data_t * td = value; + heap_t *heap = user_data; + gdouble k; + + (void) t; + g_assert (heap); + g_assert (heap->map); + g_assert (heap->heap); + g_assert (td); + g_assert (!td->used); + g_assert (td->pos); + + k = tri_data_num_unused_neighbors2 (td, heap->map); + g_assert (k <= td->pos->key); +#ifdef DEBUG + if (k == td->pos->key) + g_warning ("same key: %f\n", k); +#endif /* DEBUG */ + if (k != td->pos->key) { + g_assert (k < td->pos->key); + g_assert (k >= 0.0); + gts_eheap_decrease_key (heap->heap, td->pos, k); + } +} + +static void heap_remove (heap_t * heap, GtsTriangle * t) +{ + tri_data_t * td; + GHashTable * h; + + g_assert (heap); + g_assert (t); + td = map_lookup (heap->map, t); + g_assert (td); + g_assert (!td->used); + g_assert (td->pos); + td->used = TRUE; + gts_eheap_remove (heap->heap, td->pos); + td->pos = NULL; + + /* fprintf(stderr, "td: %p\n", td); */ + h = tri_data_unused_neighbors2 (td, heap->map); + g_hash_table_foreach (h, decrease_key, heap); + g_hash_table_destroy (h); +} + +/* map_t functions */ + +static gint create_map_entry (gpointer item, gpointer data) +{ + GtsTriangle * t = item; + GHashTable * ht = data; + tri_data_t * td; + + g_assert (t); + g_assert (ht); + td = tri_data_new (t); + g_hash_table_insert (ht, t, td); + return 0; +} + +static void free_map_entry (gpointer key, gpointer value, gpointer user_data) +{ + GtsTriangle * t = key; + tri_data_t * td = value; + + (void) user_data; + g_assert (t); + g_assert (td); + g_assert (td->t == t); + tri_data_destroy (td); +} + +static map_t * map_new (GtsSurface * s) +{ + map_t * map; + + map = g_malloc (sizeof (map_t)); + map->ht = g_hash_table_new (NULL, NULL); + gts_surface_foreach_face (s, create_map_entry, map->ht); + return map; +} + +static void map_destroy (map_t * map) +{ + if (!map) + return; + g_hash_table_foreach (map->ht, free_map_entry, NULL); + g_hash_table_destroy (map->ht); + g_free (map); +} + +static tri_data_t * map_lookup (const map_t * map, GtsTriangle * t) +{ + tri_data_t * td; + + g_assert (map); + g_assert (map->ht); + g_assert (t); + td = g_hash_table_lookup (map->ht, t); + g_assert (td); + g_assert (td->t == t); + return td; +} + +/* other helper functions */ + +static GtsTriangle * find_min_neighbor (heap_t * heap, GtsTriangle * t) +{ + GtsTriangle * min_neighbor = NULL; + gdouble min_key = G_MAXDOUBLE; + tri_data_t * td; + GSList * li; + + g_assert (heap); + g_assert (t); + + td = map_lookup (heap->map, t); + for (li = td->neighbors; li != NULL; li = li->next) { + GtsTriangle * t2 = li->data; + tri_data_t * td2 = map_lookup (heap->map, t2); + gdouble k; + + g_assert (td2); + if (td2->used) + continue; + g_assert (td2->pos); + k = td2->pos->key; + if (k < min_key) { + min_key = k; + min_neighbor = t2; + } + } + return min_neighbor; +} + +static GtsTriangle * find_neighbor_forward (heap_t * heap, + GtsTriangle * t, + GtsVertex ** v1, + GtsVertex ** v2, + GtsVertex ** v3, + gboolean left_turn) +{ + GtsTriangle * neighbor = NULL; + tri_data_t * td; + GSList * li; + + g_assert (heap); + g_assert (t); + g_assert (v1 && v2 && v3); + g_assert (vertices_are_unique (*v1, *v2, *v3)); + + td = map_lookup (heap->map, t); + g_assert (td); + for (li = td->neighbors; li && !neighbor; li = li->next) { + GtsTriangle * t2 = li->data; + tri_data_t * td2 = map_lookup (heap->map, t2); + GtsVertex * v4, * v5, * v6; + + g_assert (td2); + if (t2 == t || td2->used) + continue; + gts_triangle_vertices (t2, &v4, &v5, &v6); + if (left_turn) { + if (!vertices_match (*v1, *v3, NULL, &v4, &v5, &v6)) + continue; + } else { + if (!vertices_match (*v3, *v2, NULL, &v4, &v5, &v6)) + continue; + } + neighbor = t2; + *v1 = v4; + *v2 = v5; + *v3 = v6; + } + return neighbor; +} + +static GtsTriangle * find_neighbor_backward (heap_t * heap, + GtsTriangle * t, + GtsVertex ** v1, + GtsVertex ** v2, + GtsVertex ** v3, + gboolean left_turn) +{ + GtsTriangle * neighbor = NULL; + tri_data_t * td; + GSList * li; + + g_assert (heap); + g_assert (t); + g_assert (v1 && v2 && v3); + g_assert (vertices_are_unique (*v1, *v2, *v3)); + + td = map_lookup (heap->map, t); + g_assert (td); + for (li = td->neighbors; li && !neighbor; li = li->next) { + GtsTriangle * t2 = li->data; + tri_data_t * td2 = map_lookup (heap->map, t2); + GtsVertex * v4, * v5, * v6; + + g_assert (td2); + if (t2 == t || td2->used) + continue; + gts_triangle_vertices (t2, &v4, &v5, &v6); + if (left_turn) { + if (!vertices_match (NULL, *v2, *v1, &v4, &v5, &v6)) + continue; + } else if (!vertices_match(*v1, NULL, *v2, &v4, &v5, &v6)) + continue; + neighbor = t2; + *v1 = v4; + *v2 = v5; + *v3 = v6; + } + return neighbor; +} + +static GSList * grow_strip_forward (heap_t * heap, + GSList * strip, + GtsTriangle * t, + GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3) +{ + gboolean left_turn; + + g_assert (heap); + g_assert (g_slist_length(strip) == 2); + g_assert (t); + g_assert (v1 && v2 && v3); + g_assert (vertices_are_unique (v1, v2, v3)); + + left_turn = TRUE; + while ((t = find_neighbor_forward (heap, t, &v1, &v2, &v3, + left_turn)) != NULL) { + heap_remove (heap, t); + strip = g_slist_prepend (strip, t); + left_turn = !left_turn; + } + return strip; +} + +static GSList * grow_strip_backward (heap_t * heap, + GSList * strip, + GtsTriangle * t, + GtsVertex * v1, + GtsVertex * v2, + GtsVertex * v3) +{ + /* we have to make sure we add an even number of triangles */ + GtsTriangle * t2; + + g_assert (heap); + g_assert (g_slist_length(strip) >= 2); + g_assert (t); + g_assert (v1 && v2 && v3); + g_assert (vertices_are_unique (v1, v2, v3)); + + while ((t2 = find_neighbor_backward (heap, t, &v1, &v2, &v3, + FALSE)) != NULL + && (t = find_neighbor_backward (heap, t2, &v1, &v2, &v3, + TRUE)) != NULL) { + heap_remove (heap, t2); + heap_remove (heap, t); + strip = g_slist_prepend (strip, t2); + strip = g_slist_prepend (strip, t); + } + return strip; +} + +static gboolean find_right_turn (GtsVertex ** v1, + GtsVertex ** v2, + GtsVertex ** v3, + GtsVertex ** v4, + GtsVertex ** v5, + GtsVertex ** v6) +{ + GtsVertex * v; + + g_assert (v1 && v2 && v3); + g_assert (v4 && v5 && v6); + g_assert (vertices_are_unique (*v1, *v2, *v3)); + g_assert (vertices_are_unique (*v4, *v5, *v6)); + g_assert (num_shared_vertices (*v1, *v2, *v3, *v4, *v5, *v6) == 2); + + v = non_shared_vertex1 (*v1, *v2, *v3, *v4, *v5, *v6); + match_vertex (v, v1, v2, v3); + match_vertex (*v3, v4, v5, v6); + + g_assert (v1 && v2 && v3); + g_assert (v4 && v5 && v6); + g_assert (*v4 == *v3); + + if (*v5 == *v2) { + g_assert (vertices_are_unique (*v1, *v2, *v3)); + g_assert (vertices_are_unique (*v4, *v5, *v6)); + g_assert (num_shared_vertices (*v1, *v2, *v3, + *v4, *v5, *v6) == 2); + return TRUE; + } else { +#ifdef DEBUG + g_warning ("couldn't find a right turn"); +#endif /* DEBUG */ + return FALSE; + } +} + +/** + * gts_surface_strip: + * @s: a #GtsSurface. + * + * Decompose @s into triangle strips for fast-rendering. + * + * Returns: a list of triangle strips containing all the triangles of @s. + * A triangle strip is itself a list of successive triangles having one edge + * in common. + */ +GSList * gts_surface_strip (GtsSurface *s) +{ + GSList * strips = NULL; + heap_t * heap; + + g_return_val_if_fail (s != NULL, NULL); + + heap = heap_new (s); + while (!heap_is_empty (heap)) { + GtsTriangle * t1, * t2; + GtsVertex * v1, * v2, * v3, * v4, * v5, * v6; + GSList * strip = NULL; + + /* remove heap top */ + t1 = heap_top (heap); + g_assert (t1); + heap_remove (heap, t1); + + /* start a new strip */ + strip = g_slist_prepend (strip, t1); + + /* find second triangle */ + t2 = find_min_neighbor (heap, t1); + if (t2) { + g_assert (t2 != t1); + + /* find right turn */ + gts_triangle_vertices (t1, &v1, &v2, &v3); + gts_triangle_vertices (t2, &v4, &v5, &v6); + if (find_right_turn (&v1, &v2, &v3, &v4, &v5, &v6)) { + heap_remove (heap, t2); + strip = g_slist_prepend (strip, t2); + + /* grow strip forward */ + strip = grow_strip_forward (heap, strip, t2, v4, v5, v6); + + strip = g_slist_reverse (strip); + + /* grow strip backward */ + strip = grow_strip_backward (heap, strip, t1, v1, v2, v3); + } + } + strips = g_slist_prepend (strips, strip); + } + strips = g_slist_reverse (strips); + heap_destroy (heap); + + return strips; +} Index: tags/1.0.5/gts/surface.c =================================================================== --- tags/1.0.5/gts/surface.c (nonexistent) +++ tags/1.0.5/gts/surface.c (revision 953) @@ -0,0 +1,2743 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include "gts.h" + +#include "gts-private.h" + +static void destroy_foreach_face (GtsFace * f, GtsSurface * s) +{ + f->surfaces = g_slist_remove (f->surfaces, s); + if (!GTS_OBJECT_DESTROYED (f) && + !gts_allow_floating_faces && f->surfaces == NULL) + gts_object_destroy (GTS_OBJECT (f)); +} + +static void surface_destroy (GtsObject * object) +{ + GtsSurface * surface = GTS_SURFACE (object); + + gts_surface_foreach_face (surface, (GtsFunc) destroy_foreach_face, surface); +#ifdef USE_SURFACE_BTREE + g_tree_destroy (surface->faces); +#else /* not USE_SURFACE_BTREE */ + g_hash_table_destroy (surface->faces); +#endif /* not USE_SURFACE_BTREE */ + + (* GTS_OBJECT_CLASS (gts_surface_class ())->parent_class->destroy) (object); +} + +static void surface_write (GtsObject * object, FILE * fptr) +{ + fprintf (fptr, " %s %s %s %s", + object->klass->info.name, + GTS_OBJECT_CLASS (GTS_SURFACE (object)->face_class)->info.name, + GTS_OBJECT_CLASS (GTS_SURFACE (object)->edge_class)->info.name, + GTS_POINT_CLASS (GTS_SURFACE (object)->vertex_class)->binary ? + "GtsVertexBinary" : + GTS_OBJECT_CLASS (GTS_SURFACE (object)->vertex_class)->info.name); +} + +static void surface_class_init (GtsSurfaceClass * klass) +{ + GTS_OBJECT_CLASS (klass)->destroy = surface_destroy; + GTS_OBJECT_CLASS (klass)->write = surface_write; + klass->add_face = NULL; + klass->remove_face = NULL; +} + +#ifdef USE_SURFACE_BTREE +static gint compare_pointers (gconstpointer a, gconstpointer b) +{ + if (GPOINTER_TO_UINT (a) < GPOINTER_TO_UINT (b)) + return -1; + if (GPOINTER_TO_UINT (a) > GPOINTER_TO_UINT (b)) + return 1; + return 0; +} +#endif /* USE_SURFACE_BTREE */ + +static void surface_init (GtsSurface * surface) +{ +#ifdef USE_SURFACE_BTREE + surface->faces = g_tree_new (compare_pointers); +#else /* not USE_SURFACE_BTREE */ + surface->faces = g_hash_table_new (NULL, NULL); +#endif /* not USE_SURFACE_BTREE */ + surface->vertex_class = gts_vertex_class (); + surface->edge_class = gts_edge_class (); + surface->face_class = gts_face_class (); + surface->keep_faces = FALSE; +} + +/** + * gts_surface_class: + * + * Returns: the #GtsSurfaceClass. + */ +GtsSurfaceClass * gts_surface_class (void) +{ + static GtsSurfaceClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo surface_info = { + "GtsSurface", + sizeof (GtsSurface), + sizeof (GtsSurfaceClass), + (GtsObjectClassInitFunc) surface_class_init, + (GtsObjectInitFunc) surface_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), &surface_info); + } + + return klass; +} + +/** + * gts_surface_new: + * @klass: a #GtsSurfaceClass. + * @face_class: a #GtsFaceClass. + * @edge_class: a #GtsEdgeClass. + * @vertex_class: a #GtsVertexClass. + * + * Returns: a new empty #GtsSurface. + */ +GtsSurface * gts_surface_new (GtsSurfaceClass * klass, + GtsFaceClass * face_class, + GtsEdgeClass * edge_class, + GtsVertexClass * vertex_class) +{ + GtsSurface * s; + + s = GTS_SURFACE (gts_object_new (GTS_OBJECT_CLASS (klass))); + s->vertex_class = vertex_class; + s->edge_class = edge_class; + s->face_class = face_class; + + return s; +} + +/** + * gts_surface_add_face: + * @s: a #GtsSurface. + * @f: a #GtsFace. + * + * Adds face @f to surface @s. + */ +void gts_surface_add_face (GtsSurface * s, GtsFace * f) +{ + g_return_if_fail (s != NULL); + g_return_if_fail (f != NULL); + + g_assert (s->keep_faces == FALSE); + +#ifdef USE_SURFACE_BTREE + if (!g_tree_lookup (s->faces, f)) { + f->surfaces = g_slist_prepend (f->surfaces, s); + g_tree_insert (s->faces, f, f); + } +#else /* not USE_SURFACE_BTREE */ + if (!g_hash_table_lookup (s->faces, f)) { + f->surfaces = g_slist_prepend (f->surfaces, s); + g_hash_table_insert (s->faces, f, f); + } +#endif /* not USE_SURFACE_BTREE */ + + if (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->add_face) + (* GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->add_face) (s, f); +} + +/** + * gts_surface_remove_face: + * @s: a #GtsSurface. + * @f: a #GtsFace. + * + * Removes face @f from surface @s. + */ +void gts_surface_remove_face (GtsSurface * s, + GtsFace * f) +{ + g_return_if_fail (s != NULL); + g_return_if_fail (f != NULL); + + g_assert (s->keep_faces == FALSE); + +#ifdef USE_SURFACE_BTREE + g_tree_remove (s->faces, f); +#else /* not USE_SURFACE_BTREE */ + g_hash_table_remove (s->faces, f); +#endif /* not USE_SURFACE_BTREE */ + + f->surfaces = g_slist_remove (f->surfaces, s); + + if (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->remove_face) + (* GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->remove_face) (s, f); + + if (!GTS_OBJECT_DESTROYED (f) && + !gts_allow_floating_faces && + f->surfaces == NULL) + gts_object_destroy (GTS_OBJECT (f)); +} + +/** + * gts_surface_read: + * @surface: a #GtsSurface. + * @f: a #GtsFile. + * + * Add to @surface the data read from @f. The format of the file pointed to + * by @f is as described in gts_surface_write(). + * + * Returns: 0 if successful or the line number at which the parsing + * stopped in case of error (in which case the @error field of @f is + * set to a description of the error which occured). + */ +/* Update split.c/surface_read() if modifying this function */ +guint gts_surface_read (GtsSurface * surface, GtsFile * f) +{ + GtsVertex ** vertices; + GtsEdge ** edges; + guint n, nv, ne, nf; + + g_return_val_if_fail (surface != NULL, 1); + g_return_val_if_fail (f != NULL, 1); + + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer (number of vertices)"); + return f->line; + } + nv = atoi (f->token->str); + + gts_file_next_token (f); + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer (number of edges)"); + return f->line; + } + ne = atoi (f->token->str); + + gts_file_next_token (f); + if (f->type != GTS_INT) { + gts_file_error (f, "expecting an integer (number of faces)"); + return f->line; + } + nf = atoi (f->token->str); + + gts_file_next_token (f); + if (f->type == GTS_STRING) { + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsSurfaceClass)"); + return f->line; + } + gts_file_next_token (f); + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsFaceClass)"); + return f->line; + } + gts_file_next_token (f); + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsEdgeClass)"); + return f->line; + } + gts_file_next_token (f); + if (f->type != GTS_STRING) { + gts_file_error (f, "expecting a string (GtsVertexClass)"); + return f->line; + } + if (!strcmp (f->token->str, "GtsVertexBinary")) + GTS_POINT_CLASS (surface->vertex_class)->binary = TRUE; + else { + GTS_POINT_CLASS (surface->vertex_class)->binary = FALSE; + gts_file_first_token_after (f, '\n'); + } + } + else + gts_file_first_token_after (f, '\n'); + + if (nf <= 0) + return 0; + + /* allocate nv + 1 just in case nv == 0 */ + vertices = g_malloc ((nv + 1)*sizeof (GtsVertex *)); + edges = g_malloc ((ne + 1)*sizeof (GtsEdge *)); + + n = 0; + while (n < nv && f->type != GTS_ERROR) { + GtsObject * new_vertex = + gts_object_new (GTS_OBJECT_CLASS (surface->vertex_class)); + + (* GTS_OBJECT_CLASS (surface->vertex_class)->read) (&new_vertex, f); + if (f->type != GTS_ERROR) { + if (!GTS_POINT_CLASS (surface->vertex_class)->binary) + gts_file_first_token_after (f, '\n'); + vertices[n++] = GTS_VERTEX (new_vertex); + } + else + gts_object_destroy (new_vertex); + } + if (f->type == GTS_ERROR) + nv = n; + if (GTS_POINT_CLASS (surface->vertex_class)->binary) + gts_file_first_token_after (f, '\n'); + + n = 0; + while (n < ne && f->type != GTS_ERROR) { + guint p1, p2; + + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (first vertex index)"); + else { + p1 = atoi (f->token->str); + if (p1 == 0 || p1 > nv) + gts_file_error (f, "vertex index `%d' is out of range `[1,%d]'", + p1, nv); + else { + gts_file_next_token (f); + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (second vertex index)"); + else { + p2 = atoi (f->token->str); + if (p2 == 0 || p2 > nv) + gts_file_error (f, "vertex index `%d' is out of range `[1,%d]'", + p2, nv); + else { + GtsEdge * new_edge = + gts_edge_new (surface->edge_class, + vertices[p1 - 1], vertices[p2 - 1]); + + gts_file_next_token (f); + if (f->type != '\n') + if (GTS_OBJECT_CLASS (surface->edge_class)->read) + (*GTS_OBJECT_CLASS (surface->edge_class)->read) + ((GtsObject **) &new_edge, f); + gts_file_first_token_after (f, '\n'); + edges[n++] = new_edge; + } + } + } + } + } + if (f->type == GTS_ERROR) + ne = n; + + n = 0; + while (n < nf && f->type != GTS_ERROR) { + guint s1, s2, s3; + + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (first edge index)"); + else { + s1 = atoi (f->token->str); + if (s1 == 0 || s1 > ne) + gts_file_error (f, "edge index `%d' is out of range `[1,%d]'", + s1, ne); + else { + gts_file_next_token (f); + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (second edge index)"); + else { + s2 = atoi (f->token->str); + if (s2 == 0 || s2 > ne) + gts_file_error (f, "edge index `%d' is out of range `[1,%d]'", + s2, ne); + else { + gts_file_next_token (f); + if (f->type != GTS_INT) + gts_file_error (f, "expecting an integer (third edge index)"); + else { + s3 = atoi (f->token->str); + if (s3 == 0 || s3 > ne) + gts_file_error (f, "edge index `%d' is out of range `[1,%d]'", + s3, ne); + else { + GtsFace * new_face = gts_face_new (surface->face_class, + edges[s1 - 1], + edges[s2 - 1], + edges[s3 - 1]); + + gts_file_next_token (f); + if (f->type != '\n') + if (GTS_OBJECT_CLASS (surface->face_class)->read) + (*GTS_OBJECT_CLASS (surface->face_class)->read) + ((GtsObject **) &new_face, f); + gts_file_first_token_after (f, '\n'); + gts_surface_add_face (surface, new_face); + n++; + } + } + } + } + } + } + } + + if (f->type == GTS_ERROR) { + gts_allow_floating_vertices = TRUE; + while (nv) + gts_object_destroy (GTS_OBJECT (vertices[nv-- - 1])); + gts_allow_floating_vertices = FALSE; + } + + g_free (vertices); + g_free (edges); + + if (f->type == GTS_ERROR) + return f->line; + return 0; +} + +static void sum_area (GtsFace * f, gdouble * area) { + *area += gts_triangle_area (GTS_TRIANGLE (f)); +} + +/** + * gts_surface_area: + * @s: a #GtsSurface. + * + * Returns: the area of @s obtained as the sum of the signed areas of its + * faces. + */ +gdouble gts_surface_area (GtsSurface * s) +{ + gdouble area = 0.0; + gts_surface_foreach_face (s, (GtsFunc)sum_area, &area); + return area; +} + +/** + * gts_range_init: + * @r: a #GtsRange. + * + * Initializes a #GtsRange. + */ +void gts_range_init (GtsRange * r) +{ + g_return_if_fail (r != NULL); + + r->max = - G_MAXDOUBLE; + r->min = G_MAXDOUBLE; + r->sum = r->sum2 = 0.0; + r->n = 0; +} + +/** + * gts_range_reset: + * @r: a #GtsRange. + * + * Sets all the fields of @r to 0. + */ +void gts_range_reset (GtsRange * r) +{ + g_return_if_fail (r != NULL); + + r->max = 0.0; + r->min = 0.0; + r->sum = r->sum2 = 0.0; + r->n = 0; +} + +/** + * gts_range_add_value: + * @r: a #GtsRange. + * @val: a value to add to @r. + * + * Adds @val to @r. + */ +void gts_range_add_value (GtsRange * r, gdouble val) +{ + g_return_if_fail (r != NULL); + + if (val < r->min) r->min = val; + if (val > r->max) r->max = val; + r->sum += val; + r->sum2 += val*val; + r->n++; +} + +/** + * gts_range_update: + * @r: a #GtsRange. + * + * Updates the fields of @r. + */ +void gts_range_update (GtsRange * r) +{ + g_return_if_fail (r != NULL); + + if (r->n > 0) { + if (r->sum2 - r->sum*r->sum/(gdouble) r->n >= 0.) + r->stddev = sqrt ((r->sum2 - r->sum*r->sum/(gdouble) r->n) + /(gdouble) r->n); + else + r->stddev = 0.; + r->mean = r->sum/(gdouble) r->n; + } + else + r->min = r->max = r->mean = r->stddev = 0.; +} + +/** + * gts_range_print: + * @r: a #GtsRange. + * @fptr: a file pointer. + * + * Writes a text representation of @r in @fptr. + */ +void gts_range_print (GtsRange * r, FILE * fptr) +{ + g_return_if_fail (r != NULL); + g_return_if_fail (fptr != NULL); + fprintf (fptr, "min: %g mean: %g | %g max: %g", + r->min, r->mean, r->stddev, r->max); +} + +static void stats_foreach_vertex (GtsVertex * v, GtsSurfaceStats * stats) +{ + GSList * i = v->segments; + guint nedges = 0; + + while (i) { + if (GTS_IS_EDGE (i->data) && + gts_edge_has_parent_surface (i->data, stats->parent)) + nedges++; + i = i->next; + } + gts_range_add_value (&stats->edges_per_vertex, nedges); +} + +static void stats_foreach_edge (GtsEdge * e, GtsSurfaceStats * stats) +{ + guint nt = gts_edge_face_number (e, stats->parent); + + if (gts_segment_is_duplicate (GTS_SEGMENT (e))) + stats->n_duplicate_edges++; + if (nt == 1) + stats->n_boundary_edges++; + else if (nt > 2) + stats->n_non_manifold_edges++; + gts_range_add_value (&stats->faces_per_edge, nt); +} + +static void stats_foreach_face (GtsTriangle * t, GtsSurfaceStats * stats) +{ + if (!gts_face_is_compatible (GTS_FACE (t), stats->parent)) + stats->n_incompatible_faces++; + if (gts_triangle_is_duplicate (t)) + stats->n_duplicate_faces++; + stats->n_faces++; +} + +/** + * gts_surface_stats: + * @s: a #GtsSurface. + * @stats: a #GtsSurfaceStats. + * + * Fills @stats with the statistics relevant to surface @s. + */ +void gts_surface_stats (GtsSurface * s, GtsSurfaceStats * stats) +{ + g_return_if_fail (s != NULL); + g_return_if_fail (stats != NULL); + + stats->parent = s; + stats->n_faces = 0; + stats->n_incompatible_faces = 0; + stats->n_duplicate_faces = 0; + stats->n_duplicate_edges = 0; + stats->n_boundary_edges = 0; + stats->n_non_manifold_edges = 0; + gts_range_init (&stats->edges_per_vertex); + gts_range_init (&stats->faces_per_edge); + + gts_surface_foreach_vertex (s, (GtsFunc) stats_foreach_vertex, stats); + gts_surface_foreach_edge (s, (GtsFunc) stats_foreach_edge, stats); + gts_surface_foreach_face (s, (GtsFunc) stats_foreach_face, stats); + + gts_range_update (&stats->edges_per_vertex); + gts_range_update (&stats->faces_per_edge); +} + +static void quality_foreach_edge (GtsSegment * s, + GtsSurfaceQualityStats * stats) +{ + GSList * i = GTS_EDGE (s)->triangles; + + gts_range_add_value (&stats->edge_length, + gts_point_distance (GTS_POINT (s->v1), + GTS_POINT (s->v2))); + while (i) { + GSList * j = i->next; + while (j) { + gts_range_add_value (&stats->edge_angle, + fabs (gts_triangles_angle (i->data, j->data))); + j = j->next; + } + i = i->next; + } +} + +static void quality_foreach_face (GtsTriangle * t, + GtsSurfaceQualityStats * stats) +{ + gts_range_add_value (&stats->face_quality, gts_triangle_quality (t)); + gts_range_add_value (&stats->face_area, gts_triangle_area (t)); +} + +/** + * gts_surface_quality_stats: + * @s: a #GtsSurface. + * @stats: a #GtsSurfaceQualityStats. + * + * Fills @stats with quality statistics relevant to surface @s. + */ +void gts_surface_quality_stats (GtsSurface * s, GtsSurfaceQualityStats * stats) +{ + g_return_if_fail (s != NULL); + g_return_if_fail (stats != NULL); + + stats->parent = s; + gts_range_init (&stats->face_quality); + gts_range_init (&stats->face_area); + gts_range_init (&stats->edge_length); + gts_range_init (&stats->edge_angle); + + gts_surface_foreach_edge (s, (GtsFunc) quality_foreach_edge, stats); + gts_surface_foreach_face (s, (GtsFunc) quality_foreach_face, stats); + + gts_range_update (&stats->face_quality); + gts_range_update (&stats->face_area); + gts_range_update (&stats->edge_length); + gts_range_update (&stats->edge_angle); +} + +/** + * gts_surface_print_stats: + * @s: a #GtsSurface. + * @fptr: a file pointer. + * + * Writes in the file pointed to by @fptr the statistics for surface @s. + */ +void gts_surface_print_stats (GtsSurface * s, FILE * fptr) +{ + GtsSurfaceStats stats; + GtsSurfaceQualityStats qstats; + + g_return_if_fail (s != NULL); + g_return_if_fail (fptr != NULL); + + gts_surface_stats (s, &stats); + gts_surface_quality_stats (s, &qstats); + + fprintf (fptr, + "# vertices: %u edges: %u faces: %u\n" + "# Connectivity statistics\n" + "# incompatible faces: %u\n" + "# duplicate faces: %u\n" + "# boundary edges: %u\n" + "# duplicate edges: %u\n" + "# non-manifold edges: %u\n", + stats.edges_per_vertex.n, + stats.faces_per_edge.n, + stats.n_faces, + stats.n_incompatible_faces, + stats.n_duplicate_faces, + stats.n_boundary_edges, + stats.n_duplicate_edges, + stats.n_non_manifold_edges); + fputs ("# edges per vertex: ", fptr); + gts_range_print (&stats.edges_per_vertex, fptr); + fputs ("\n# faces per edge: ", fptr); + gts_range_print (&stats.faces_per_edge, fptr); + fputs ("\n# Geometric statistics\n# face quality: ", fptr); + gts_range_print (&qstats.face_quality, fptr); + fputs ("\n# face area : ", fptr); + gts_range_print (&qstats.face_area, fptr); + fputs ("\n# edge length : ", fptr); + gts_range_print (&qstats.edge_length, fptr); + fputc ('\n', fptr); +} + +static void write_vertex (GtsPoint * p, gpointer * data) +{ + (*GTS_OBJECT (p)->klass->write) (GTS_OBJECT (p), (FILE *) data[0]); + if (!GTS_POINT_CLASS (GTS_OBJECT (p)->klass)->binary) + fputc ('\n', (FILE *) data[0]); + g_hash_table_insert (data[2], p, + GUINT_TO_POINTER (++(*((guint *) data[1])))); +} + +static void write_edge (GtsSegment * s, gpointer * data) +{ + fprintf ((FILE *) data[0], "%u %u", + GPOINTER_TO_UINT (g_hash_table_lookup (data[2], s->v1)), + GPOINTER_TO_UINT (g_hash_table_lookup (data[2], s->v2))); + if (GTS_OBJECT (s)->klass->write) + (*GTS_OBJECT (s)->klass->write) (GTS_OBJECT (s), (FILE *) data[0]); + fputc ('\n', (FILE *) data[0]); + g_hash_table_insert (data[3], s, + GUINT_TO_POINTER (++(*((guint *) data[1])))); +} + +static void write_face (GtsTriangle * t, gpointer * data) +{ + fprintf (data[0], "%u %u %u", + GPOINTER_TO_UINT (g_hash_table_lookup (data[3], t->e1)), + GPOINTER_TO_UINT (g_hash_table_lookup (data[3], t->e2)), + GPOINTER_TO_UINT (g_hash_table_lookup (data[3], t->e3))); + if (GTS_OBJECT (t)->klass->write) + (*GTS_OBJECT (t)->klass->write) (GTS_OBJECT (t), data[0]); + fputc ('\n', data[0]); +} + +/** + * gts_surface_write: + * @s: a #GtsSurface. + * @fptr: a file pointer. + * + * Writes in the file @fptr an ASCII representation of @s. The file + * format is as follows. + * + * All the lines beginning with #GTS_COMMENTS are ignored. The first line + * contains three unsigned integers separated by spaces. The first + * integer is the number of vertices, nv, the second is the number of + * edges, ne and the third is the number of faces, nf. + * + * Follows nv lines containing the x, y and z coordinates of the + * vertices. Follows ne lines containing the two indices (starting + * from one) of the vertices of each edge. Follows nf lines containing + * the three ordered indices (also starting from one) of the edges of + * each face. + * + * The format described above is the least common denominator to all + * GTS files. Consistent with an object-oriented approach, the GTS + * file format is extensible. Each of the lines of the file can be + * extended with user-specific attributes accessible through the + * read() and write() virtual methods of each of the objects written + * (surface, vertices, edges or faces). When read with different + * object classes, these extra attributes are just ignored. + */ +void gts_surface_write (GtsSurface * s, FILE * fptr) +{ + guint n; + gpointer data[4]; + GHashTable * vindex, * eindex; + GtsSurfaceStats stats; + + g_return_if_fail (s != NULL); + g_return_if_fail (fptr != NULL); + + data[0] = fptr; + data[1] = &n; + data[2] = vindex = g_hash_table_new (NULL, NULL); + data[3] = eindex = g_hash_table_new (NULL, NULL); + + gts_surface_stats (s, &stats); + fprintf (fptr, "%u %u %u", + stats.edges_per_vertex.n, + stats.faces_per_edge.n, + stats.n_faces); + if (GTS_OBJECT (s)->klass->write) + (*GTS_OBJECT (s)->klass->write) (GTS_OBJECT (s), fptr); + fputc ('\n', fptr); + n = 0; + gts_surface_foreach_vertex (s, (GtsFunc) write_vertex, data); + n = 0; + if (GTS_POINT_CLASS (s->vertex_class)->binary) + fputc ('\n', fptr); + gts_surface_foreach_edge (s, (GtsFunc) write_edge, data); + gts_surface_foreach_face (s, (GtsFunc) write_face, data); + g_hash_table_destroy (vindex); + g_hash_table_destroy (eindex); +} + +static void write_vertex_oogl (GtsPoint * p, gpointer * data) +{ + FILE * fp = data[0]; + + fprintf (fp, "%g %g %g", p->x, p->y, p->z); + if (GTS_OBJECT (p)->klass->color) { + GtsColor c = (* GTS_OBJECT (p)->klass->color) (GTS_OBJECT (p)); + fprintf (fp, " %g %g %g 1.0\n", c.r, c.g, c.b); + } + else + fputc ('\n', fp); + GTS_OBJECT (p)->reserved = GUINT_TO_POINTER ((*((guint *) data[1]))++); +} + +static void write_face_oogl (GtsTriangle * t, FILE * fp) +{ + GtsVertex * v1, * v2, * v3; + gts_triangle_vertices (t, &v1, &v2, &v3); + fprintf (fp, "3 %u %u %u", + GPOINTER_TO_UINT (GTS_OBJECT (v1)->reserved), + GPOINTER_TO_UINT (GTS_OBJECT (v2)->reserved), + GPOINTER_TO_UINT (GTS_OBJECT (v3)->reserved)); + if (GTS_OBJECT (t)->klass->color) { + GtsColor c = (* GTS_OBJECT (t)->klass->color) (GTS_OBJECT (t)); + fprintf (fp, " %g %g %g\n", c.r, c.g, c.b); + } + else + fputc ('\n', fp); +} + +/** + * gts_surface_write_oogl: + * @s: a #GtsSurface. + * @fptr: a file pointer. + * + * Writes in the file @fptr an OOGL (Geomview) representation of @s. + */ +void gts_surface_write_oogl (GtsSurface * s, FILE * fptr) +{ + guint n = 0; + gpointer data[2]; + GtsSurfaceStats stats; + + g_return_if_fail (s != NULL); + g_return_if_fail (fptr != NULL); + + data[0] = fptr; + data[1] = &n; + + gts_surface_stats (s, &stats); + if (GTS_OBJECT_CLASS (s->vertex_class)->color) + fputs ("COFF ", fptr); + else + fputs ("OFF ", fptr); + fprintf (fptr, "%u %u %u\n", + stats.edges_per_vertex.n, + stats.n_faces, + stats.faces_per_edge.n); + gts_surface_foreach_vertex (s, (GtsFunc) write_vertex_oogl, data); + gts_surface_foreach_face (s, (GtsFunc) write_face_oogl, fptr); + gts_surface_foreach_vertex (s, (GtsFunc) gts_object_reset_reserved, NULL); +} + +static void write_vertex_vtk (GtsPoint * p, gpointer * data) +{ + FILE * fp = data[0]; + + fprintf (fp, "%g %g %g\n", p->x, p->y, p->z); + GTS_OBJECT (p)->reserved = GUINT_TO_POINTER ((*((guint *) data[1]))++); +} + +static void write_face_vtk (GtsTriangle * t, FILE * fp) +{ + GtsVertex * v1, * v2, * v3; + gts_triangle_vertices (t, &v1, &v2, &v3); + fprintf (fp, "3 %u %u %u\n", + GPOINTER_TO_UINT (GTS_OBJECT (v1)->reserved), + GPOINTER_TO_UINT (GTS_OBJECT (v2)->reserved), + GPOINTER_TO_UINT (GTS_OBJECT (v3)->reserved)); +} + +/** + * gts_surface_write_vtk: + * @s: a #GtsSurface. + * @fptr: a file pointer. + * + * Writes in the file @fptr a VTK representation of @s. + */ +void gts_surface_write_vtk (GtsSurface * s, FILE * fptr) +{ + guint n = 0; + gpointer data[2]; + GtsSurfaceStats stats; + + g_return_if_fail (s != NULL); + g_return_if_fail (fptr != NULL); + + data[0] = fptr; + data[1] = &n; + + gts_surface_stats (s, &stats); + fprintf (fptr, + "# vtk DataFile Version 2.0\n" + "Generated by GTS\n" + "ASCII\n" + "DATASET POLYDATA\n" + "POINTS %u float\n", + stats.edges_per_vertex.n); + gts_surface_foreach_vertex (s, (GtsFunc) write_vertex_vtk, data); + fprintf (fptr, + "POLYGONS %u %u\n", + stats.n_faces, stats.n_faces*4); + gts_surface_foreach_face (s, (GtsFunc) write_face_vtk, fptr); + gts_surface_foreach_vertex (s, (GtsFunc) gts_object_reset_reserved, NULL); +} + +static void write_edge_oogl_boundary (GtsSegment * s, gpointer * data) +{ + if (!gts_edge_is_boundary (GTS_EDGE (s), data[1])) + return; + + if (GTS_OBJECT (s)->klass->color) { + GtsColor c = (* GTS_OBJECT (s)->klass->color) (GTS_OBJECT (s)); + fprintf (data[0], "VECT 1 2 1 2 1 %g %g %g %g %g %g %g %g %g 1.\n", + GTS_POINT (s->v1)->x, GTS_POINT (s->v1)->y, GTS_POINT (s->v1)->z, + GTS_POINT (s->v2)->x, GTS_POINT (s->v2)->y, GTS_POINT (s->v2)->z, + c.r, c.g, c.b); + } + else + fprintf (data[0], "VECT 1 2 0 2 0 %g %g %g %g %g %g\n", + GTS_POINT (s->v1)->x, GTS_POINT (s->v1)->y, GTS_POINT (s->v1)->z, + GTS_POINT (s->v2)->x, GTS_POINT (s->v2)->y, GTS_POINT (s->v2)->z); +} + +/** + * gts_surface_write_oogl_boundary: + * @s: a #GtsSurface. + * @fptr: a file pointer. + * + * Writes in the file @fptr an OOGL (Geomview) representation of the + * boundary of @s. + */ +void gts_surface_write_oogl_boundary (GtsSurface * s, FILE * fptr) +{ + gpointer data[2]; + + g_return_if_fail (s != NULL); + g_return_if_fail (fptr != NULL); + + data[0] = fptr; + data[1] = s; + fputs ("LIST {\n", fptr); + gts_surface_foreach_edge (s, (GtsFunc) write_edge_oogl_boundary, data); + fputs ("}\n", fptr); +} + +#ifdef USE_SURFACE_BTREE +static gint vertex_foreach_face (GtsTriangle * t, + gpointer t_data, + gpointer * info) +#else /* not USE_SURFACE_BTREE */ +static void vertex_foreach_face (GtsTriangle * t, + gpointer t_data, + gpointer * info) +#endif /* not USE_SURFACE_BTREE */ +{ + GHashTable * hash = info[0]; + gpointer data = info[1]; + GtsFunc func = (GtsFunc) info[2]; + GtsSegment + * s1 = GTS_SEGMENT (t->e1); + + if (!g_hash_table_lookup (hash, s1->v1)) { + (*func) (s1->v1, data); + g_hash_table_insert (hash, s1->v1, GINT_TO_POINTER (-1)); + } + if (!g_hash_table_lookup (hash, s1->v2)) { + (*func) (s1->v2, data); + g_hash_table_insert (hash, s1->v2, GINT_TO_POINTER (-1)); + } + if (!g_hash_table_lookup (hash, gts_triangle_vertex (t))) { + (*func) (gts_triangle_vertex (t), data); + g_hash_table_insert (hash, gts_triangle_vertex (t), + GINT_TO_POINTER (-1)); + } +#ifdef USE_SURFACE_BTREE + return FALSE; +#endif /* USE_SURFACE_BTREE */ +} + +/** + * gts_surface_foreach_vertex: + * @s: a #GtsSurface. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func once for each vertex of @s. + */ +void gts_surface_foreach_vertex (GtsSurface * s, GtsFunc func, gpointer data) +{ + gpointer info[3]; + + g_return_if_fail (s != NULL); + g_return_if_fail (func != NULL); + + /* forbid removal of faces */ + s->keep_faces = TRUE; + info[0] = g_hash_table_new (NULL, NULL); + info[1] = data; + info[2] = func; +#ifdef USE_SURFACE_BTREE + g_tree_traverse (s->faces, (GTraverseFunc) vertex_foreach_face, G_IN_ORDER, + info); +#else /* not USE_SURFACE_BTREE */ + g_hash_table_foreach (s->faces, (GHFunc) vertex_foreach_face, info); +#endif /* not USE_SURFACE_BTREE */ + g_hash_table_destroy (info[0]); + /* allow removal of faces */ + s->keep_faces = FALSE; +} + +#ifdef USE_SURFACE_BTREE +static gint edge_foreach_face (GtsTriangle * t, + gpointer t_data, + gpointer * info) +#else /* not USE_SURFACE_BTREE */ +static void edge_foreach_face (GtsTriangle * t, + gpointer t_data, + gpointer * info) +#endif /* not USE_SURFACE_BTREE */ +{ + GHashTable * hash = info[0]; + gpointer data = info[1]; + GtsFunc func = (GtsFunc) info[2]; + + if (!g_hash_table_lookup (hash, t->e1)) { + (*func) (t->e1, data); + g_hash_table_insert (hash, t->e1, GINT_TO_POINTER (-1)); + } + if (!g_hash_table_lookup (hash, t->e2)) { + (*func) (t->e2, data); + g_hash_table_insert (hash, t->e2, GINT_TO_POINTER (-1)); + } + if (!g_hash_table_lookup (hash, t->e3)) { + (*func) (t->e3, data); + g_hash_table_insert (hash, t->e3, GINT_TO_POINTER (-1)); + } +#ifdef USE_SURFACE_BTREE + return FALSE; +#endif /* not USE_SURFACE_BTREE */ +} + +/** + * gts_surface_foreach_edge: + * @s: a #GtsSurface. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func once for each edge of @s. + */ +void gts_surface_foreach_edge (GtsSurface * s, GtsFunc func, gpointer data) +{ + gpointer info[3]; + + g_return_if_fail (s != NULL); + g_return_if_fail (func != NULL); + + /* forbid removal of faces */ + s->keep_faces = TRUE; + info[0] = g_hash_table_new (NULL, NULL); + info[1] = data; + info[2] = func; +#ifdef USE_SURFACE_BTREE + g_tree_traverse (s->faces, (GTraverseFunc) edge_foreach_face, G_IN_ORDER, + info); +#else /* not USE_SURFACE_BTREE */ + g_hash_table_foreach (s->faces, (GHFunc) edge_foreach_face, info); +#endif /* not USE_SURFACE_BTREE */ + g_hash_table_destroy (info[0]); + /* allow removal of faces */ + s->keep_faces = FALSE; +} + +#ifdef USE_SURFACE_BTREE +static gint foreach_face (GtsFace * f, + gpointer t_data, + gpointer * info) +#else /* not USE_SURFACE_BTREE */ +static void foreach_face (GtsFace * f, + gpointer t_data, + gpointer * info) +#endif /* not USE_SURFACE_BTREE */ +{ + (*((GtsFunc) info[0])) (f, info[1]); +#ifdef USE_SURFACE_BTREE + return FALSE; +#endif /* USE_SURFACE_BTREE */ +} + +/** + * gts_surface_foreach_face: + * @s: a #GtsSurface. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func once for each face of @s. + */ +void gts_surface_foreach_face (GtsSurface * s, + GtsFunc func, + gpointer data) +{ + gpointer info[2]; + + g_return_if_fail (s != NULL); + g_return_if_fail (func != NULL); + + /* forbid removal of faces */ + s->keep_faces = TRUE; + info[0] = func; + info[1] = data; +#ifdef USE_SURFACE_BTREE + g_tree_traverse (s->faces, (GTraverseFunc) foreach_face, G_IN_ORDER, + info); +#else /* not USE_SURFACE_BTREE */ + g_hash_table_foreach (s->faces, (GHFunc) foreach_face, info); +#endif /* not USE_SURFACE_BTREE */ + /* allow removal of faces */ + s->keep_faces = FALSE; +} + +#ifdef USE_SURFACE_BTREE +static gint foreach_face_remove (GtsFace * f, + gpointer t_data, + gpointer * info) +{ + if ((*((GtsFunc) info[0])) (f, info[1])) { + GtsSurface * s = info[2]; + guint * n = info[3]; + + f->surfaces = g_slist_remove (f->surfaces, s); + if (!GTS_OBJECT_DESTROYED (f) && + !gts_allow_floating_faces && + f->surfaces == NULL) + gts_object_destroy (GTS_OBJECT (f)); + + if (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->remove_face) + (* GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->remove_face) (s, f); + + g_tree_remove (s->faces, f); + (*n)++; + } + return FALSE; +} +#else /* not USE_SURFACE_BTREE */ +static gboolean foreach_face_remove (GtsFace * f, + gpointer t_data, + gpointer * info) +{ + if ((*((GtsFunc) info[0])) (f, info[1])) { + GtsSurface * s = info[2]; + + f->surfaces = g_slist_remove (f->surfaces, s); + if (!GTS_OBJECT_DESTROYED (f) && + !gts_allow_floating_faces && + f->surfaces == NULL) + gts_object_destroy (GTS_OBJECT (f)); + + if (GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->remove_face) + (* GTS_SURFACE_CLASS (GTS_OBJECT (s)->klass)->remove_face) (s, f); + + return TRUE; + } + return FALSE; +} +#endif /* not USE_SURFACE_BTREE */ + +/** + * gts_surface_foreach_face_remove: + * @s: a #GtsSurface. + * @func: a #GtsFunc. + * @data: user data to be passed to @func. + * + * Calls @func once for each face of @s. If @func returns %TRUE the + * corresponding face is removed from @s (and destroyed if it does not + * belong to any other surface and #gts_allow_floating_faces is set to + * %FALSE). + * + * Returns: the number of faces removed from @s. + */ +guint gts_surface_foreach_face_remove (GtsSurface * s, + GtsFunc func, + gpointer data) +{ + gpointer info[4]; + guint n = 0; + + g_return_val_if_fail (s != NULL, 0); + g_return_val_if_fail (func != NULL, 0); + + /* forbid removal of faces */ + s->keep_faces = TRUE; + info[0] = func; + info[1] = data; + info[2] = s; +#ifdef USE_SURFACE_BTREE + info[3] = &n; + g_tree_traverse (s->faces, (GTraverseFunc) foreach_face_remove, G_PRE_ORDER, + info); +#else /* not USE_SURFACE_BTREE */ + n = g_hash_table_foreach_remove (s->faces, + (GHRFunc) foreach_face_remove, + info); +#endif /* not USE_SURFACE_BTREE */ + /* allow removal of faces */ + s->keep_faces = FALSE; + + return n; +} + +static void midvertex_insertion (GtsEdge * e, + GtsSurface * surface, + GtsEHeap * heap, + GtsRefineFunc refine_func, + gpointer refine_data, + GtsVertexClass * vertex_class, + GtsEdgeClass * edge_class) +{ + GtsVertex * midvertex; + GtsEdge * e1, * e2; + GSList * i; + + midvertex = (*refine_func) (e, vertex_class, refine_data); + e1 = gts_edge_new (edge_class, GTS_SEGMENT (e)->v1, midvertex); + gts_eheap_insert (heap, e1); + e2 = gts_edge_new (edge_class, GTS_SEGMENT (e)->v2, midvertex); + gts_eheap_insert (heap, e2); + + /* creates new faces and modifies old ones */ + i = e->triangles; + while (i) { + GtsTriangle * t = i->data; + GtsVertex * v1, * v2, * v3; + GtsEdge * te2, * te3, * ne, * tmp; + + gts_triangle_vertices_edges (t, e, &v1, &v2, &v3, &e, &te2, &te3); + ne = gts_edge_new (edge_class, midvertex, v3); + gts_eheap_insert (heap, ne); + if (GTS_SEGMENT (e1)->v1 == v2) { + tmp = e1; e1 = e2; e2 = tmp; + } + e1->triangles = g_slist_prepend (e1->triangles, t); + ne->triangles = g_slist_prepend (ne->triangles, t); + te2->triangles = g_slist_remove (te2->triangles, t); + t->e1 = e1; t->e2 = ne; t->e3 = te3; + gts_surface_add_face (surface, + gts_face_new (surface->face_class, e2, te2, ne)); + i = i->next; + } + /* destroys edge */ + g_slist_free (e->triangles); + e->triangles = NULL; + gts_object_destroy (GTS_OBJECT (e)); +} + +static gdouble edge_length2_inverse (GtsSegment * s) +{ + return - gts_point_distance2 (GTS_POINT (s->v1), GTS_POINT (s->v2)); +} + +static void create_heap_refine (GtsEdge * e, GtsEHeap * heap) +{ + gts_eheap_insert (heap, e); +} + +/** + * gts_surface_refine: + * @surface: a #GtsSurface. + * @cost_func: a function returning the cost for a given edge. + * @cost_data: user data to be passed to @cost_func. + * @refine_func: a #GtsRefineFunc. + * @refine_data: user data to be passed to @refine_func. + * @stop_func: a #GtsStopFunc. + * @stop_data: user data to be passed to @stop_func. + * + * Refine @surface using a midvertex insertion technique. All the + * edges of @surface are ordered according to @cost_func. The edges + * are then processed in order until @stop_func returns %TRUE. Each + * edge is split in two and new edges and faces are created. + * + * If @cost_func is set to %NULL, the edges are sorted according + * to their length squared (the longest is on top). + * + * If @refine_func is set to %NULL gts_segment_midvertex() is used. + * + */ +void gts_surface_refine (GtsSurface * surface, + GtsKeyFunc cost_func, + gpointer cost_data, + GtsRefineFunc refine_func, + gpointer refine_data, + GtsStopFunc stop_func, + gpointer stop_data) +{ + GtsEHeap * heap; + GtsEdge * e; + gdouble top_cost; + + g_return_if_fail (surface != NULL); + g_return_if_fail (stop_func != NULL); + + if (cost_func == NULL) + cost_func = (GtsKeyFunc) edge_length2_inverse; + if (refine_func == NULL) + refine_func = (GtsRefineFunc) gts_segment_midvertex; + + heap = gts_eheap_new (cost_func, cost_data); + gts_eheap_freeze (heap); + gts_surface_foreach_edge (surface, (GtsFunc) create_heap_refine, heap); + gts_eheap_thaw (heap); + while ((e = gts_eheap_remove_top (heap, &top_cost)) && + !(*stop_func) (top_cost, + gts_eheap_size (heap) + + gts_edge_face_number (e, surface) + 2, + stop_data)) + midvertex_insertion (e, surface, heap, refine_func, refine_data, + surface->vertex_class, surface->edge_class); + gts_eheap_destroy (heap); +} + +static GSList * edge_triangles (GtsEdge * e1, GtsEdge * e) +{ + GSList * i = e1->triangles; + GSList * triangles = NULL; + + while (i) { + GtsTriangle * t = i->data; + if (t->e1 == e || t->e2 == e || t->e3 == e) { + GtsEdge * e2; + GSList * j; + if (t->e1 == e) { + if (t->e2 == e1) + e2 = t->e3; + else + e2 = t->e2; + } + else if (t->e2 == e) { + if (t->e3 == e1) + e2 = t->e1; + else + e2 = t->e3; + } + else { + if (t->e2 == e1) + e2 = t->e1; + else + e2 = t->e2; + } + j = e2->triangles; + while (j) { + GtsTriangle * t = j->data; + if (t->e1 != e && t->e2 != e && t->e3 != e) + triangles = g_slist_prepend (triangles, t); + j = j->next; + } + } + else + triangles = g_slist_prepend (triangles, t); + i = i->next; + } + return triangles; +} + +static void replace_vertex (GSList * i, GtsVertex * v1, GtsVertex * v) +{ + while (i) { + GtsSegment * s = i->data; + if (s->v1 == v1) + s->v1 = v; + else + s->v2 = v; + i = i->next; + } +} + +/** + * gts_edge_collapse_creates_fold: + * @e: a #GtsEdge. + * @v: a #GtsVertex. + * @max: the maximum value of the square of the cosine of the angle between + * two triangles. + * + * Returns: %TRUE if collapsing edge @e to vertex @v would create + * faces making an angle the cosine squared of which would be larger than max, + * %FALSE otherwise. + */ +gboolean gts_edge_collapse_creates_fold (GtsEdge * e, + GtsVertex * v, + gdouble max) +{ + GtsVertex * v1, * v2; + GtsSegment * s; + GSList * i; + gboolean folded = FALSE; + + g_return_val_if_fail (e != NULL, TRUE); + g_return_val_if_fail (v != NULL, TRUE); + + s = GTS_SEGMENT (e); + v1 = s->v1; + v2 = s->v2; + replace_vertex (v1->segments, v1, v); + replace_vertex (v2->segments, v2, v); + + i = v1->segments; + while (i && !folded) { + GtsSegment * s = i->data; + if (GTS_IS_EDGE (s)) { + GtsEdge * e1 = GTS_EDGE (s); + if (e1 != e) { + GSList * triangles = edge_triangles (e1, e); + folded = gts_triangles_are_folded (triangles, s->v1, s->v2, max); + g_slist_free (triangles); + } + } + i = i->next; + } + + i = v2->segments; + while (i && !folded) { + GtsSegment * s = i->data; + if (GTS_IS_EDGE (s)) { + GtsEdge * e1 = GTS_EDGE (s); + if (e1 != e) { + GSList * triangles = edge_triangles (e1, e); + folded = gts_triangles_are_folded (triangles, s->v1, s->v2, max); + g_slist_free (triangles); + } + } + i = i->next; + } +#if 1 + if (!folded) { + GSList * triangles = gts_vertex_triangles (v1, NULL); + i = triangles = gts_vertex_triangles (v2, triangles); + while (i && !folded) { + GtsTriangle * t = i->data; + if (t->e1 != e && t->e2 != e && t->e3 != e) { + GtsEdge * e1 = gts_triangle_edge_opposite (t, v); + g_assert (e1); + folded = gts_triangles_are_folded (e1->triangles, + GTS_SEGMENT (e1)->v1, + GTS_SEGMENT (e1)->v2, + max); + } + i = i->next; + } + g_slist_free (triangles); + } +#endif + replace_vertex (v1->segments, v, v1); + replace_vertex (v2->segments, v, v2); + return folded; +} + +/** + * gts_edge_collapse_is_valid: + * @e: a #GtsEdge. + * + * An implementation of the topological constraints described in the + * "Mesh Optimization" article of Hoppe et al (1993). + * + * Returns: %TRUE if @e can be collapsed without violation of the topological + * constraints, %FALSE otherwise. + */ +gboolean gts_edge_collapse_is_valid (GtsEdge * e) +{ + GSList * i; + + g_return_val_if_fail (e != NULL, FALSE); + + i = GTS_SEGMENT (e)->v1->segments; + while (i) { + GtsEdge * e1 = i->data; + if (e1 != e && GTS_IS_EDGE (e1)) { + GtsEdge * e2 = NULL; + GSList * j = GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e)->v1 ? + GTS_SEGMENT (e1)->v2->segments : GTS_SEGMENT (e1)->v1->segments; + while (j && !e2) { + GtsEdge * e1 = j->data; + if (GTS_IS_EDGE (e1) && + (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e)->v2 || + GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e)->v2)) + e2 = e1; + j = j->next; + } + if (e2 && !gts_triangle_use_edges (e, e1, e2)) + return FALSE; + } + i = i->next; + } + + if (gts_edge_is_boundary (e, NULL)) { + GtsTriangle * t = e->triangles->data; + if (gts_edge_is_boundary (t->e1, NULL) && + gts_edge_is_boundary (t->e2, NULL) && + gts_edge_is_boundary (t->e3, NULL)) + return FALSE; + } + else { + if (gts_vertex_is_boundary (GTS_SEGMENT (e)->v1, NULL) && + gts_vertex_is_boundary (GTS_SEGMENT (e)->v2, NULL)) + return FALSE; + if (gts_edge_belongs_to_tetrahedron (e)) + return FALSE; + } + + return TRUE; +} + +#define HEAP_INSERT_EDGE(h, e) (GTS_OBJECT (e)->reserved = gts_eheap_insert (h, e)) +#define HEAP_REMOVE_EDGE(h, e) (gts_eheap_remove (h, GTS_OBJECT (e)->reserved),\ + GTS_OBJECT (e)->reserved = NULL) + +static GtsVertex * edge_collapse (GtsEdge * e, + GtsEHeap * heap, + GtsCoarsenFunc coarsen_func, + gpointer coarsen_data, + GtsVertexClass * klass, + gdouble maxcosine2) +{ + GSList * i; + GtsVertex * v1 = GTS_SEGMENT (e)->v1, * v2 = GTS_SEGMENT (e)->v2, * mid; + + /* if the edge is degenerate (i.e. v1 == v2), destroy and return */ + if (v1 == v2) { + gts_object_destroy (GTS_OBJECT (e)); + return NULL; + } + + if (!gts_edge_collapse_is_valid (e)) { + GTS_OBJECT (e)->reserved = + gts_eheap_insert_with_key (heap, e, G_MAXDOUBLE); + return NULL; + } + + mid = (*coarsen_func) (e, klass, coarsen_data); + + if (gts_edge_collapse_creates_fold (e, mid, maxcosine2)) { + GTS_OBJECT (e)->reserved = + gts_eheap_insert_with_key (heap, e, G_MAXDOUBLE); + gts_object_destroy (GTS_OBJECT (mid)); + return NULL; + } + + gts_object_destroy (GTS_OBJECT (e)); + + gts_vertex_replace (v1, mid); + gts_object_destroy (GTS_OBJECT (v1)); + gts_vertex_replace (v2, mid); + gts_object_destroy (GTS_OBJECT (v2)); + + /* destroy duplicate edges */ + i = mid->segments; + while (i) { + GtsEdge * e1 = i->data; + GtsEdge * duplicate; + while ((duplicate = gts_edge_is_duplicate (e1))) { + gts_edge_replace (duplicate, GTS_EDGE (e1)); + HEAP_REMOVE_EDGE (heap, duplicate); + gts_object_destroy (GTS_OBJECT (duplicate)); + } + i = i->next; + if (!e1->triangles) { + /* e1 is the result of the collapse of one edge of a pair of identical + faces (it should not happen unless duplicate triangles are present in + the initial surface) */ + g_warning ("file %s: line %d (%s): probably duplicate triangle.", + __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION); + HEAP_REMOVE_EDGE (heap, e1); + gts_object_destroy (GTS_OBJECT (e1)); + if (i == NULL) /* mid has been destroyed */ + mid = NULL; + } + } + + return mid; +} + +/* + * I don't see where this code is ever used, but keep it for a bit + * in case it is needed for debugging + */ +#ifdef GTS_NEED_UPDATE_CLOSEST_NEIGHBORS +static void update_closest_neighbors (GtsVertex * v, GtsEHeap * heap) +{ + GSList * i = v->segments; + + while (i) { + GtsSegment * s = i->data; + if (GTS_IS_EDGE (s)) { + HEAP_REMOVE_EDGE (heap, GTS_EDGE (s)); + HEAP_INSERT_EDGE (heap, GTS_EDGE (s)); + } + i = i->next; + } +} +#endif + +static void update_2nd_closest_neighbors (GtsVertex * v, GtsEHeap * heap) +{ + GSList * i = v->segments; + GSList * list = NULL; + + while (i) { + GtsSegment * s = i->data; + if (GTS_IS_EDGE (s)) { + GtsVertex * v1 = s->v1 == v ? s->v2 : s->v1; + GSList * j = v1->segments; + while (j) { + GtsSegment * s1 = j->data; + if (GTS_IS_EDGE (s1) && !g_slist_find (list, s1)) + list = g_slist_prepend (list, s1); + j = j->next; + } + } + i = i->next; + } + + i = list; + while (i) { + GtsEdge * e = i->data; + HEAP_REMOVE_EDGE (heap, e); + HEAP_INSERT_EDGE (heap, e); + i = i->next; + } + + g_slist_free (list); +} + +static gdouble edge_length2 (GtsEdge * e) +{ + return gts_point_distance2 (GTS_POINT (GTS_SEGMENT (e)->v1), + GTS_POINT (GTS_SEGMENT (e)->v2)); +} + +static void create_heap_coarsen (GtsEdge * e, GtsEHeap * heap) +{ + HEAP_INSERT_EDGE (heap, e); +} + +/** + * gts_surface_coarsen: + * @surface: a #GtsSurface. + * @cost_func: a function returning the cost for a given edge. + * @cost_data: user data to be passed to @cost_func. + * @coarsen_func: a #GtsCoarsenVertexFunc. + * @coarsen_data: user data to be passed to @coarsen_func. + * @stop_func: a #GtsStopFunc. + * @stop_data: user data to be passed to @stop_func. + * @minangle: minimum angle between two neighboring triangles. + * + * The edges of @surface are sorted according to @cost_func to + * create a priority heap (a #GtsEHeap). The edges are extracted in + * turn from the top of the heap and collapsed (i.e. the vertices are + * replaced by the vertex returned by the @coarsen_func function) + * until the @stop_func functions returns %TRUE. + * + * If @cost_func is set to %NULL, the edges are sorted according + * to their length squared (the shortest is on top). + * + * If @coarsen_func is set to %NULL gts_segment_midvertex() is used. + * + * The minimum angle is used to avoid introducing faces which would be folded. + */ +void gts_surface_coarsen (GtsSurface * surface, + GtsKeyFunc cost_func, + gpointer cost_data, + GtsCoarsenFunc coarsen_func, + gpointer coarsen_data, + GtsStopFunc stop_func, + gpointer stop_data, + gdouble minangle) +{ + GtsEHeap * heap; + GtsEdge * e; + gdouble top_cost; + gdouble maxcosine2; + + g_return_if_fail (surface != NULL); + g_return_if_fail (stop_func != NULL); + + if (cost_func == NULL) + cost_func = (GtsKeyFunc) edge_length2; + if (coarsen_func == NULL) + coarsen_func = (GtsCoarsenFunc) gts_segment_midvertex; + + heap = gts_eheap_new (cost_func, cost_data); + maxcosine2 = cos (minangle); maxcosine2 *= maxcosine2; + + gts_eheap_freeze (heap); + gts_surface_foreach_edge (surface, (GtsFunc) create_heap_coarsen, heap); + gts_eheap_thaw (heap); + /* we want to control edge destruction manually */ + gts_allow_floating_edges = TRUE; + while ((e = gts_eheap_remove_top (heap, &top_cost)) && + (top_cost < G_MAXDOUBLE) && + !(*stop_func) (top_cost, gts_eheap_size (heap) - + gts_edge_face_number (e, surface), stop_data)) + { + GtsVertex * v = edge_collapse (e, heap, coarsen_func, coarsen_data, + surface->vertex_class, maxcosine2); + if (v != NULL) + update_2nd_closest_neighbors (v, heap); + } + gts_allow_floating_edges = FALSE; + + /* set reserved field of remaining edges back to NULL */ + if (e) GTS_OBJECT (e)->reserved = NULL; + gts_eheap_foreach (heap, (GFunc) gts_object_reset_reserved, NULL); + + gts_eheap_destroy (heap); +} + +/** + * gts_coarsen_stop_number: + * @cost: the cost of the edge collapse considered. + * @nedge: the current number of edges of the surface being simplified. + * @min_number: a pointer to the minimum number of edges desired for the + * surface being simplified. + * + * This function is to be used as the @stop_func argument of + * gts_surface_coarsen() or gts_psurface_new(). + * + * Returns: %TRUE if the edge collapse would create a surface with a smaller + * number of edges than given by @min_number, %FALSE otherwise. + */ +gboolean gts_coarsen_stop_number (gdouble cost, + guint nedge, + guint * min_number) +{ + g_return_val_if_fail (min_number != NULL, TRUE); + + if (nedge < *min_number) + return TRUE; + return FALSE; +} + +/** + * gts_coarsen_stop_cost: + * @cost: the cost of the edge collapse considered. + * @nedge: the current number of edges of the surface being simplified. + * @max_cost: a pointer to the maximum cost allowed for an edge collapse. + * + * This function is to be used as the @stop_func argument of + * gts_surface_coarsen() or gts_psurface_new(). + * + * Returns: %TRUE if the cost of the edge collapse considered is larger than + * given by @max_cost, %FALSE otherwise. + */ +gboolean gts_coarsen_stop_cost (gdouble cost, + guint nedge, + gdouble * max_cost) +{ + g_return_val_if_fail (max_cost != NULL, TRUE); + + if (cost > *max_cost) + return TRUE; + return FALSE; +} + +#define GTS_M_ICOSAHEDRON_X /* sqrt(sqrt(5)+1)/sqrt(2*sqrt(5)) */ \ + 0.850650808352039932181540497063011072240401406 +#define GTS_M_ICOSAHEDRON_Y /* sqrt(2)/sqrt(5+sqrt(5)) */ \ + 0.525731112119133606025669084847876607285497935 +#define GTS_M_ICOSAHEDRON_Z 0.0 + +static guint generate_icosahedron (GtsSurface * s) +{ + GtsVertex * v01 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_Z, +GTS_M_ICOSAHEDRON_X, -GTS_M_ICOSAHEDRON_Y); + GtsVertex * v02 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_X, +GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z); + GtsVertex * v03 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z, -GTS_M_ICOSAHEDRON_X); + GtsVertex * v04 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z, +GTS_M_ICOSAHEDRON_X); + GtsVertex * v05 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_X, -GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z); + GtsVertex * v06 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_Z, +GTS_M_ICOSAHEDRON_X, +GTS_M_ICOSAHEDRON_Y); + GtsVertex * v07 = gts_vertex_new (s->vertex_class, + -GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z, +GTS_M_ICOSAHEDRON_X); + GtsVertex * v08 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_Z, -GTS_M_ICOSAHEDRON_X, -GTS_M_ICOSAHEDRON_Y); + GtsVertex * v09 = gts_vertex_new (s->vertex_class, + -GTS_M_ICOSAHEDRON_X, +GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z); + GtsVertex * v10 = gts_vertex_new (s->vertex_class, + -GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z, -GTS_M_ICOSAHEDRON_X); + GtsVertex * v11 = gts_vertex_new (s->vertex_class, + -GTS_M_ICOSAHEDRON_X, -GTS_M_ICOSAHEDRON_Y, +GTS_M_ICOSAHEDRON_Z); + GtsVertex * v12 = gts_vertex_new (s->vertex_class, + +GTS_M_ICOSAHEDRON_Z, -GTS_M_ICOSAHEDRON_X, +GTS_M_ICOSAHEDRON_Y); + + GtsEdge * e01 = gts_edge_new (s->edge_class, v01, v02); + GtsEdge * e02 = gts_edge_new (s->edge_class, v03, v02); + GtsEdge * e03 = gts_edge_new (s->edge_class, v01, v03); + GtsEdge * e04 = gts_edge_new (s->edge_class, v04, v05); + GtsEdge * e05 = gts_edge_new (s->edge_class, v02, v05); + GtsEdge * e06 = gts_edge_new (s->edge_class, v04, v02); + GtsEdge * e07 = gts_edge_new (s->edge_class, v06, v07); + GtsEdge * e08 = gts_edge_new (s->edge_class, v04, v07); + GtsEdge * e09 = gts_edge_new (s->edge_class, v06, v04); + GtsEdge * e10 = gts_edge_new (s->edge_class, v08, v03); + GtsEdge * e11 = gts_edge_new (s->edge_class, v03, v05); + GtsEdge * e12 = gts_edge_new (s->edge_class, v08, v05); + GtsEdge * e13 = gts_edge_new (s->edge_class, v06, v09); + GtsEdge * e14 = gts_edge_new (s->edge_class, v07, v09); + GtsEdge * e15 = gts_edge_new (s->edge_class, v08, v10); + GtsEdge * e16 = gts_edge_new (s->edge_class, v03, v10); + GtsEdge * e17 = gts_edge_new (s->edge_class, v06, v01); + GtsEdge * e18 = gts_edge_new (s->edge_class, v01, v09); + GtsEdge * e19 = gts_edge_new (s->edge_class, v08, v11); + GtsEdge * e20 = gts_edge_new (s->edge_class, v10, v11); + GtsEdge * e21 = gts_edge_new (s->edge_class, v06, v02); + GtsEdge * e22 = gts_edge_new (s->edge_class, v12, v11); + GtsEdge * e23 = gts_edge_new (s->edge_class, v12, v08); + GtsEdge * e24 = gts_edge_new (s->edge_class, v12, v07); + GtsEdge * e25 = gts_edge_new (s->edge_class, v07, v11); + GtsEdge * e26 = gts_edge_new (s->edge_class, v12, v04); + GtsEdge * e27 = gts_edge_new (s->edge_class, v09, v11); + GtsEdge * e28 = gts_edge_new (s->edge_class, v10, v09); + GtsEdge * e29 = gts_edge_new (s->edge_class, v12, v05); + GtsEdge * e30 = gts_edge_new (s->edge_class, v01, v10); + + gts_surface_add_face (s, gts_face_new (s->face_class, e01, e02, e03)); + gts_surface_add_face (s, gts_face_new (s->face_class, e04, e05, e06)); + gts_surface_add_face (s, gts_face_new (s->face_class, e07, e08, e09)); + gts_surface_add_face (s, gts_face_new (s->face_class, e10, e11, e12)); + gts_surface_add_face (s, gts_face_new (s->face_class, e13, e14, e07)); + gts_surface_add_face (s, gts_face_new (s->face_class, e15, e16, e10)); + gts_surface_add_face (s, gts_face_new (s->face_class, e17, e18, e13)); + gts_surface_add_face (s, gts_face_new (s->face_class, e19, e20, e15)); + gts_surface_add_face (s, gts_face_new (s->face_class, e21, e01, e17)); + gts_surface_add_face (s, gts_face_new (s->face_class, e22, e19, e23)); + gts_surface_add_face (s, gts_face_new (s->face_class, e09, e06, e21)); + gts_surface_add_face (s, gts_face_new (s->face_class, e24, e25, e22)); + gts_surface_add_face (s, gts_face_new (s->face_class, e26, e08, e24)); + gts_surface_add_face (s, gts_face_new (s->face_class, e20, e27, e28)); + gts_surface_add_face (s, gts_face_new (s->face_class, e29, e04, e26)); + gts_surface_add_face (s, gts_face_new (s->face_class, e14, e27, e25)); + gts_surface_add_face (s, gts_face_new (s->face_class, e23, e12, e29)); + gts_surface_add_face (s, gts_face_new (s->face_class, e02, e05, e11)); + gts_surface_add_face (s, gts_face_new (s->face_class, e30, e28, e18)); + gts_surface_add_face (s, gts_face_new (s->face_class, e03, e16, e30)); + + return 0; +} + +static GtsVertex * unit_sphere_arc_midvertex (GtsSegment * s, + GtsVertexClass * vertex_class) +{ + GtsPoint * p1, * p2; + gdouble x, y, z, norm; + + p1 = GTS_POINT (s->v1); p2 = GTS_POINT (s->v2); + + x = 0.5*(p1->x + p2->x); + y = 0.5*(p1->y + p2->y); + z = 0.5*(p1->z + p2->z); + + norm = x*x + y*y + z*z; + norm = sqrt (norm); + + x /= norm; y /= norm; z /= norm; + + return gts_vertex_new (vertex_class, x, y, z); +} + +static void tessellate_face (GtsFace * f, + GtsSurface * s, + GtsRefineFunc refine_func, + gpointer refine_data, + GtsVertexClass * vertex_class, + GtsEdgeClass * edge_class) +{ + GtsTriangle * t; + GtsEdge * e1, * e2, * e3; /* former edges */ + GtsVertex * v1, * v2, * v3; /* initial vertices */ + GtsVertex * v4, * v5, * v6; /* new vertices */ + GtsEdge * e56, * e64, * e45; /* new inside edges */ + GtsEdge * e24, * e34, * e35, * e15, * e16, * e26; /* new border edges */ + GSList * dum; + GtsEdge * edum; + + t = GTS_TRIANGLE (f); + e1 = t->e1; e2 = t->e2; e3 = t->e3; + + if (GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v1) { + v1 = GTS_SEGMENT (e2)->v2; + v2 = GTS_SEGMENT (e1)->v1; + v3 = GTS_SEGMENT (e1)->v2; + } + else if (GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v2) { + v1 = GTS_SEGMENT (e2)->v1; + v2 = GTS_SEGMENT (e1)->v1; + v3 = GTS_SEGMENT (e1)->v2; + } + else if (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e2)->v1) { + v1 = GTS_SEGMENT (e2)->v2; + v2 = GTS_SEGMENT (e1)->v2; + v3 = GTS_SEGMENT (e1)->v1; + } + else if (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e2)->v2) { + v1 = GTS_SEGMENT (e2)->v1; + v2 = GTS_SEGMENT (e1)->v2; + v3 = GTS_SEGMENT (e1)->v1; + } + else { + v1 = v2 = v3 = NULL; + g_assert_not_reached (); + } + + e1->triangles = g_slist_remove (e1->triangles, t); + e2->triangles = g_slist_remove (e2->triangles, t); + e3->triangles = g_slist_remove (e3->triangles, t); + + if (GTS_OBJECT (e1)->reserved) { + dum = (GTS_OBJECT (e1)->reserved); + e24 = dum->data; + e34 = dum->next->data; + v4 = GTS_SEGMENT (e24)->v2; + if (GTS_SEGMENT (e24)->v1 == v3) { + edum = e34; e34 = e24; e24 = edum; + } + } + else { + v4 = (*refine_func) (e1, vertex_class, refine_data); + e24 = gts_edge_new (edge_class, v2, v4); + e34 = gts_edge_new (edge_class, v3, v4); + dum = g_slist_append (NULL, e24); + dum = g_slist_append (dum, e34); + GTS_OBJECT (e1)->reserved = dum; + } + if (GTS_OBJECT (e2)->reserved) { + dum = (GTS_OBJECT (e2)->reserved); + e35 = dum->data; + e15 = dum->next->data; + v5 = GTS_SEGMENT (e35)->v2; + if (GTS_SEGMENT (e35)->v1 == v1) { + edum = e15; e15 = e35; e35 = edum; + } + } + else { + v5 = (*refine_func) (e2, vertex_class, refine_data); + e35 = gts_edge_new (edge_class, v3, v5); + e15 = gts_edge_new (edge_class, v1, v5); + dum = g_slist_append (NULL, e35); + dum = g_slist_append (dum, e15); + GTS_OBJECT (e2)->reserved = dum; + } + if (GTS_OBJECT (e3)->reserved) { + dum = (GTS_OBJECT (e3)->reserved); + e16 = dum->data; + e26 = dum->next->data; + v6 = GTS_SEGMENT (e16)->v2; + if (GTS_SEGMENT (e16)->v1 == v2) { + edum = e16; e16 = e26; e26 = edum; + } + } + else { + v6 = (*refine_func) (e3, vertex_class, refine_data); + e16 = gts_edge_new (edge_class, v1, v6); + e26 = gts_edge_new (edge_class, v2, v6); + dum = g_slist_append (NULL, e16); + dum = g_slist_append (dum, e26); + GTS_OBJECT (e3)->reserved = dum; + } + + if (e1->triangles == NULL) { + g_slist_free (GTS_OBJECT (e1)->reserved); + GTS_OBJECT (e1)->reserved = NULL; + gts_object_destroy (GTS_OBJECT (e1)); + e1 = NULL; + } + if (e2->triangles == NULL) { + g_slist_free (GTS_OBJECT (e2)->reserved); + GTS_OBJECT (e2)->reserved = NULL; + gts_object_destroy (GTS_OBJECT (e2)); + e2 = NULL; + } + if (e3->triangles == NULL) { + g_slist_free (GTS_OBJECT (e3)->reserved); + GTS_OBJECT (e3)->reserved = NULL; + gts_object_destroy (GTS_OBJECT (e3)); + e3 = NULL; + } + + e56 = gts_edge_new (edge_class, v5, v6); + e64 = gts_edge_new (edge_class, v6, v4); + e45 = gts_edge_new (edge_class, v4, v5); + t->e1 = e56; e56->triangles = g_slist_prepend (e56->triangles, t); + t->e2 = e64; e64->triangles = g_slist_prepend (e64->triangles, t); + t->e3 = e45; e45->triangles = g_slist_prepend (e45->triangles, t); + + gts_surface_add_face (s, gts_face_new (s->face_class, e16, e56, e15)); + gts_surface_add_face (s, gts_face_new (s->face_class, e26, e24, e64)); + gts_surface_add_face (s, gts_face_new (s->face_class, e45, e34, e35)); +} + +static void create_array_tessellate (GtsFace * f, GPtrArray * array) +{ + g_ptr_array_add (array, f); +} + +/** + * gts_surface_tessellate: + * @s: a #GtsSurface. + * @refine_func: a #GtsRefineFunc. + * @refine_data: user data to be passed to @refine_func. + * + * Tessellate each triangle of @s with 4 triangles: + * the number of triangles is increased by a factor of 4. + * http://mathworld.wolfram.com/GeodesicDome.html + * + * If @refine_func is set to %NULL a mid arc function is used: if + * the surface is a polyhedron with the unit sphere as circum sphere, + * then gts_surface_tessellate() corresponds to a geodesation step + * (see gts_surface_generate_sphere()). + * + */ +void gts_surface_tessellate (GtsSurface * s, + GtsRefineFunc refine_func, + gpointer refine_data) +{ + GPtrArray * array; + guint i; + + g_return_if_fail (s != NULL); + + if (refine_func == NULL) /* tessellate_surface == geodesate_surface */ + refine_func = (GtsRefineFunc) unit_sphere_arc_midvertex; + + array = g_ptr_array_new (); + gts_surface_foreach_face (s, (GtsFunc) create_array_tessellate, array); + for(i = 0; i < array->len; i++) + tessellate_face (g_ptr_array_index (array, i), + s, refine_func, refine_data, + s->vertex_class, s->edge_class); + g_ptr_array_free (array, TRUE); +} + +/** + * gts_surface_generate_sphere: + * @s: a #GtsSurface. + * @geodesation_order: a #guint. + * + * Add a triangulated unit sphere generated by recursive subdivision to @s. + * First approximation is an isocahedron; each level of refinement + * (@geodesation_order) increases the number of triangles by a factor of 4. + * http://mathworld.wolfram.com/GeodesicDome.html + * + * Returns: @s. + */ +GtsSurface * gts_surface_generate_sphere (GtsSurface * s, + guint geodesation_order) +{ + guint cgo; + + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (geodesation_order != 0, NULL); + + generate_icosahedron (s); + + for (cgo = 1; cgo < geodesation_order; cgo++) + gts_surface_tessellate (s, NULL, NULL); + + return s; +} + +static void foreach_vertex_copy (GtsPoint * p, GtsVertexClass * klass) +{ + GTS_OBJECT (p)->reserved = gts_vertex_new (klass, p->x, p->y, p->z); +} + +static void foreach_edge_copy (GtsSegment * s, GtsEdgeClass * klass) +{ + GTS_OBJECT (s)->reserved = gts_edge_new (klass, + GTS_OBJECT (s->v1)->reserved, + GTS_OBJECT (s->v2)->reserved); +} + +static void foreach_face_copy (GtsTriangle * t, + GtsSurface * s) +{ + gts_surface_add_face (s, gts_face_new (s->face_class, + GTS_OBJECT (t->e1)->reserved, + GTS_OBJECT (t->e2)->reserved, + GTS_OBJECT (t->e3)->reserved)); +} + +/** + * gts_surface_copy: + * @s1: a #GtsSurface. + * @s2: a #GtsSurface. + * + * Add a copy of all the faces, edges and vertices of @s2 to @s1. + * + * Returns: @s1. + */ +GtsSurface * gts_surface_copy (GtsSurface * s1, GtsSurface * s2) +{ + g_return_val_if_fail (s1 != NULL, NULL); + g_return_val_if_fail (s2 != NULL, NULL); + + gts_surface_foreach_vertex (s2, (GtsFunc) foreach_vertex_copy, + s1->vertex_class); + gts_surface_foreach_edge (s2, (GtsFunc) foreach_edge_copy, s1->edge_class); + gts_surface_foreach_face (s2, (GtsFunc) foreach_face_copy, s1); + + gts_surface_foreach_vertex (s2, (GtsFunc) gts_object_reset_reserved, NULL); + gts_surface_foreach_edge (s2, (GtsFunc) gts_object_reset_reserved, NULL); + + return s1; +} + +static void merge_foreach_face (GtsFace * f, + GtsSurface * s) +{ + gts_surface_add_face (s, f); +} + +/** + * gts_surface_merge: + * @s: a #GtsSurface. + * @with: another #GtsSurface. + * + * Adds all the faces of @with which do not already belong to @s + * to @s. + */ +void gts_surface_merge (GtsSurface * s, GtsSurface * with) +{ + g_return_if_fail (s != NULL); + g_return_if_fail (with != NULL); + + gts_surface_foreach_face (with, (GtsFunc) merge_foreach_face, s); +} + +static void manifold_foreach_edge (GtsEdge * e, gpointer * data) +{ + gboolean * is_manifold = data[0]; + + if (*is_manifold) { + if (gts_edge_face_number (e, data[1]) > 2) + *is_manifold = FALSE; + } +} + +/** + * gts_surface_is_manifold: + * @s: a #GtsSurface. + * + * Returns: %TRUE if the surface is a manifold, %FALSE otherwise. + */ +gboolean gts_surface_is_manifold (GtsSurface * s) +{ + gboolean is_manifold = TRUE; + gpointer data[2]; + + g_return_val_if_fail (s != NULL, FALSE); + + data[0] = &is_manifold; + data[1] = s; + gts_surface_foreach_edge (s, (GtsFunc) manifold_foreach_edge, data); + return is_manifold; +} + +static void closed_foreach_edge (GtsEdge * e, gpointer * data) +{ + gboolean * is_closed = data[0]; + + if (*is_closed) { + if (gts_edge_face_number (e, data[1]) != 2) + *is_closed = FALSE; + } +} + +/** + * gts_surface_is_closed: + * @s: a #GtsSurface. + * + * Returns: %TRUE if @s is a closed surface, %FALSE otherwise. Note that a + * closed surface is also a manifold. + */ +gboolean gts_surface_is_closed (GtsSurface * s) +{ + gboolean is_closed = TRUE; + gpointer data[2]; + + g_return_val_if_fail (s != NULL, FALSE); + + data[0] = &is_closed; + data[1] = s; + gts_surface_foreach_edge (s, (GtsFunc) closed_foreach_edge, data); + return is_closed; +} + +static void orientable_foreach_edge (GtsEdge * e, gpointer * data) +{ + gboolean * is_orientable = data[0]; + + if (*is_orientable) { + GtsSurface * surface = data[1]; + GtsFace * f1 = NULL, * f2 = NULL; + GSList * i = e->triangles; + while (i && *is_orientable) { + GtsFace * f = i->data; + if (GTS_IS_FACE (f) && gts_face_has_parent_surface (f, surface)) { + if (!f1) f1 = f; + else if (!f2) f2 = f; + else *is_orientable = FALSE; + } + i = i->next; + } + if (f1 && f2 && !gts_triangles_are_compatible (GTS_TRIANGLE (f1), + GTS_TRIANGLE (f2), e)) + *is_orientable = FALSE; + } +} + +/** + * gts_surface_is_orientable: + * @s: a #GtsSurface. + * + * Returns: %TRUE if all the faces of @s have compatible orientation + * as checked by gts_faces_are_compatible(), %FALSE otherwise. Note that + * an orientable surface is also a manifold. + */ +gboolean gts_surface_is_orientable (GtsSurface * s) +{ + gboolean is_orientable = TRUE; + gpointer data[2]; + + g_return_val_if_fail (s != NULL, FALSE); + + data[0] = &is_orientable; + data[1] = s; + gts_surface_foreach_edge (s, (GtsFunc) orientable_foreach_edge, data); + return is_orientable; +} + +static void volume_foreach_face (GtsTriangle * t, + gdouble * volume) +{ + GtsVertex * va, * vb, * vc; + GtsPoint * pa, * pb, * pc; + + gts_triangle_vertices (t, &va, &vb, &vc); + pa = GTS_POINT (va); + pb = GTS_POINT (vb); + pc = GTS_POINT (vc); + + *volume += (pa->x * (pb->y * pc->z - pb->z * pc->y) + + pb->x * (pc->y * pa->z - pc->z * pa->y) + + pc->x * (pa->y * pb->z - pa->z * pb->y)); +} + +/** + * gts_surface_volume: + * @s: a #GtsSurface. + * + * Returns: the signed volume of the domain bounded by the surface @s. It + * makes sense only if @s is a closed and orientable manifold. + */ +gdouble gts_surface_volume (GtsSurface * s) +{ + gdouble volume = 0.0; + + g_return_val_if_fail (s != NULL, 0.0); + + gts_surface_foreach_face (s, (GtsFunc) volume_foreach_face, &volume); + + return volume/6.; +} + +static void center_of_mass_foreach_face (GtsTriangle * t, + gpointer * data) +{ + GtsVertex * v1, * v2, * v3; + GtsPoint * p1, * p2, * p3; + gdouble x1, y1, z1, x2, y2, z2, nx, ny, nz; + gdouble * volume = data[0]; + gdouble * cm = data[1]; + + gts_triangle_vertices (t, &v1, &v2, &v3); + p1 = GTS_POINT (v1); + p2 = GTS_POINT (v2); + p3 = GTS_POINT (v3); + + x1 = p2->x - p1->x; + y1 = p2->y - p1->y; + z1 = p2->z - p1->z; + + x2 = p3->x - p1->x; + y2 = p3->y - p1->y; + z2 = p3->z - p1->z; + + nx = y1*z2 - z1*y2; + ny = z1*x2 - x1*z2; + nz = x1*y2 - y1*x2; + + cm[0] += nx*(p1->x*p1->x + p2->x*p2->x + p3->x*p3->x + + p1->x*p2->x + p1->x*p3->x + p2->x*p3->x); + cm[1] += ny*(p1->y*p1->y + p2->y*p2->y + p3->y*p3->y + + p1->y*p2->y + p1->y*p3->y + p2->y*p3->y); + cm[2] += nz*(p1->z*p1->z + p2->z*p2->z + p3->z*p3->z + + p1->z*p2->z + p1->z*p3->z + p2->z*p3->z); + + *volume += nx*(p1->x + p2->x + p3->x); +} + + +/** + * gts_surface_center_of_mass: + * @s: a #GtsSurface. + * @cm: a #GtsVector. + * + * Fills @cm with the coordinates of the center of mass of @s. + * + * Returns: the signed volume of the domain bounded by the surface @s. + */ +gdouble gts_surface_center_of_mass (GtsSurface * s, + GtsVector cm) +{ + gdouble volume = 0.; + gpointer data[2]; + + g_return_val_if_fail (s != NULL, 0.0); + + data[0] = &volume; + data[1] = &(cm[0]); + cm[0] = cm[1] = cm[2] = 0.; + gts_surface_foreach_face (s, (GtsFunc) center_of_mass_foreach_face, data); + + if (volume != 0.) { + cm[0] /= 4.*volume; + cm[1] /= 4.*volume; + cm[2] /= 4.*volume; + } + + return volume/6.; +} + +static void center_of_area_foreach_face (GtsTriangle * t, + gpointer * data) +{ + GtsVertex * v1, * v2, * v3; + GtsPoint * p1, * p2, * p3; + gdouble a; + gdouble * area = data[0]; + gdouble * cm = data[1]; + + gts_triangle_vertices (t, &v1, &v2, &v3); + p1 = GTS_POINT (v1); + p2 = GTS_POINT (v2); + p3 = GTS_POINT (v3); + + a = gts_triangle_area (t); + cm[0] += a*(p1->x + p2->x + p3->x); + cm[1] += a*(p1->y + p2->y + p3->y); + cm[2] += a*(p1->z + p2->z + p3->z); + *area += a; +} + + +/** + * gts_surface_center_of_area: + * @s: a #GtsSurface. + * @cm: a #GtsVector. + * + * Fills @cm with the coordinates of the center of area of @s. + * + * Returns: the area of surface @s. + */ +gdouble gts_surface_center_of_area (GtsSurface * s, + GtsVector cm) +{ + gdouble area = 0.; + gpointer data[2]; + + g_return_val_if_fail (s != NULL, 0.0); + + data[0] = &area; + data[1] = &(cm[0]); + cm[0] = cm[1] = cm[2] = 0.; + gts_surface_foreach_face (s, (GtsFunc) center_of_area_foreach_face, data); + + if (area != 0.) { + cm[0] /= 3.*area; + cm[1] /= 3.*area; + cm[2] /= 3.*area; + } + + return area; +} + +static void number_foreach (gpointer data, guint * n) +{ + (*n)++; +} + +/** + * gts_surface_vertex_number: + * @s: a #GtsSurface. + * + * Returns: the number of vertices of @s. + */ +guint gts_surface_vertex_number (GtsSurface * s) +{ + guint n = 0; + + g_return_val_if_fail (s != NULL, 0); + + gts_surface_foreach_vertex (s, (GtsFunc) number_foreach, &n); + + return n; +} + +/** + * gts_surface_edge_number: + * @s: a #GtsSurface. + * + * Returns: the number of edges of @s. + */ +guint gts_surface_edge_number (GtsSurface * s) +{ + guint n = 0; + + g_return_val_if_fail (s != NULL, 0); + + gts_surface_foreach_edge (s, (GtsFunc) number_foreach, &n); + + return n; +} + +/** + * gts_surface_face_number: + * @s: a #GtsSurface. + * + * Returns: the number of faces of @s + */ +guint gts_surface_face_number (GtsSurface * s) +{ + g_return_val_if_fail (s != NULL, 0); + +#ifdef USE_SURFACE_BTREE + return g_tree_nnodes (s->faces); +#else /* not USE_SURFACE_BTREE */ + return g_hash_table_size (s->faces); +#endif /* not USE_SURFACE_BTREE */ +} + +static void build_list_face (GtsTriangle * t, GSList ** list) +{ + *list = g_slist_prepend (*list, gts_bbox_triangle (gts_bbox_class (), t)); +} + +static void build_list_boundary (GtsEdge * e, GSList ** list) +{ + if (gts_edge_is_boundary (e, NULL)) + *list = g_slist_prepend (*list, gts_bbox_segment (gts_bbox_class (), + GTS_SEGMENT (e))); +} + +/** + * gts_surface_distance: + * @s1: a #GtsSurface. + * @s2: a #GtsSurface. + * @delta: a spatial increment defined as the percentage of the diagonal + * of the bounding box of @s2. + * @face_range: a #GtsRange. + * @boundary_range: a #GtsRange. + * + * Using the gts_bb_tree_surface_distance() and + * gts_bb_tree_surface_boundary_distance() functions fills @face_range + * and @boundary_range with the min, max and average Euclidean + * (minimum) distances between the faces of @s1 and the faces of @s2 + * and between the boundary edges of @s1 and @s2. + */ +void gts_surface_distance (GtsSurface * s1, GtsSurface * s2, gdouble delta, + GtsRange * face_range, GtsRange * boundary_range) +{ + GNode * face_tree, * boundary_tree; + GSList * bboxes; + + g_return_if_fail (s1 != NULL); + g_return_if_fail (s2 != NULL); + g_return_if_fail (delta > 0. && delta < 1.); + g_return_if_fail (face_range != NULL); + g_return_if_fail (boundary_range != NULL); + + bboxes = NULL; + gts_surface_foreach_face (s2, (GtsFunc) build_list_face, &bboxes); + if (bboxes != NULL) { + face_tree = gts_bb_tree_new (bboxes); + g_slist_free (bboxes); + + gts_bb_tree_surface_distance (face_tree, s1, + (GtsBBoxDistFunc) gts_point_triangle_distance, + delta, face_range); + gts_bb_tree_destroy (face_tree, TRUE); + + bboxes = NULL; + gts_surface_foreach_edge (s2, (GtsFunc) build_list_boundary, &bboxes); + if (bboxes != NULL) { + boundary_tree = gts_bb_tree_new (bboxes); + g_slist_free (bboxes); + + gts_bb_tree_surface_boundary_distance (boundary_tree, + s1, + (GtsBBoxDistFunc) gts_point_segment_distance, + delta, boundary_range); + gts_bb_tree_destroy (boundary_tree, TRUE); + } + else + gts_range_reset (boundary_range); + } + else { + gts_range_reset (face_range); + gts_range_reset (boundary_range); + } +} + +static void surface_boundary (GtsEdge * e, gpointer * data) +{ + GSList ** list = data[0]; + + if (gts_edge_is_boundary (e, data[1])) + *list = g_slist_prepend (*list, e); +} + +/** + * gts_surface_boundary: + * @surface: a #GtsSurface. + * + * Returns: a list of #GtsEdge boundary of @surface. + */ +GSList * gts_surface_boundary (GtsSurface * surface) +{ + GSList * list = NULL; + gpointer data[2]; + + g_return_val_if_fail (surface != NULL, NULL); + + data[0] = &list; + data[1] = surface; + gts_surface_foreach_edge (surface, (GtsFunc) surface_boundary, data); + + return list; +} + +struct _GtsSurfaceTraverse { + GtsFifo * q; + GtsSurface * s; +}; + +/** + * gts_surface_traverse_new: + * @s: a #GtsSurface. + * @f: a #GtsFace belonging to @s. + * + * Returns: a new #GtsSurfaceTraverse, initialized to start traversing + * from face @f of surface @s. + */ +GtsSurfaceTraverse * gts_surface_traverse_new (GtsSurface * s, + GtsFace * f) +{ + GtsSurfaceTraverse * t; + + g_return_val_if_fail (s != NULL, NULL); + g_return_val_if_fail (f != NULL, NULL); + g_return_val_if_fail (gts_face_has_parent_surface (f, s), NULL); + + t = g_malloc (sizeof (GtsSurfaceTraverse)); + t->q = gts_fifo_new (); + t->s = s; + GTS_OBJECT (f)->reserved = GUINT_TO_POINTER (1); + gts_fifo_push (t->q, f); + return t; +} + +static void push_neighbor (GtsFace * v, gpointer * data) +{ + if (!GTS_OBJECT (v)->reserved) { + GTS_OBJECT (v)->reserved = + GUINT_TO_POINTER (GPOINTER_TO_UINT (GTS_OBJECT (data[1])->reserved) + 1); + gts_fifo_push (data[0], v); + } +} + +/** + * gts_surface_traverse_next: + * @t: a #GtsSurfaceTraverse. + * @level: a pointer to a guint or %NULL. + * + * Returns: the next face of the traversal in breadth-first order or + * %NULL if no faces are left. If @level if not %NULL, it is filled + * with the level of the returned face (0 for the initial face, 1 for + * its neighbors and so on). + */ +GtsFace * gts_surface_traverse_next (GtsSurfaceTraverse * t, + guint * level) +{ + GtsFace * u; + + g_return_val_if_fail (t != NULL, NULL); + + u = gts_fifo_pop (t->q); + if (u) { + gpointer data[2]; + + if (level) + *level = GPOINTER_TO_UINT (GTS_OBJECT (u)->reserved); + data[0] = t->q; + data[1] = u; + gts_face_foreach_neighbor (u, t->s, (GtsFunc) push_neighbor, data); + } + return u; +} + +/** + * gts_surface_traverse_destroy: + * @t: a #GtsSurfaceTraverse. + * + * Frees all the memory allocated for @t. + */ +void gts_surface_traverse_destroy (GtsSurfaceTraverse * t) +{ + g_return_if_fail (t != NULL); + + gts_surface_foreach_face (t->s, (GtsFunc) gts_object_reset_reserved, NULL); + gts_fifo_destroy (t->q); + g_free (t); +} + +static void traverse_manifold (GtsTriangle * t, GtsSurface * s) +{ + if (g_slist_length (GTS_FACE (t)->surfaces) > 1) + return; + + gts_surface_add_face (s, GTS_FACE (t)); + if (g_slist_length (t->e1->triangles) == 2) { + if (t->e1->triangles->data != t) + traverse_manifold (t->e1->triangles->data, s); + else + traverse_manifold (t->e1->triangles->next->data, s); + } + if (g_slist_length (t->e2->triangles) == 2) { + if (t->e2->triangles->data != t) + traverse_manifold (t->e2->triangles->data, s); + else + traverse_manifold (t->e2->triangles->next->data, s); + } + if (g_slist_length (t->e3->triangles) == 2) { + if (t->e3->triangles->data != t) + traverse_manifold (t->e3->triangles->data, s); + else + traverse_manifold (t->e3->triangles->next->data, s); + } +} + +static void non_manifold_edges (GtsEdge * e, gpointer * data) +{ + GtsSurface * s = data[0]; + GSList ** non_manifold = data[1]; + + if (gts_edge_face_number (e, s) > 2) { + GSList * i = e->triangles; + + while (i) { + if (gts_face_has_parent_surface (i->data, s) && + !g_slist_find (*non_manifold, i->data)) + *non_manifold = g_slist_prepend (*non_manifold, i->data); + i = i->next; + } + } +} + +static void traverse_boundary (GtsEdge * e, gpointer * data) +{ + GtsSurface * orig = data[0]; + GSList ** components = data[1]; + GtsFace * f = gts_edge_is_boundary (e, orig); + + if (f != NULL && g_slist_length (f->surfaces) == 1) { + GtsSurface * s = + gts_surface_new (GTS_SURFACE_CLASS (GTS_OBJECT (orig)->klass), + orig->face_class, + orig->edge_class, + orig->vertex_class); + GSList * non_manifold = NULL, * i; + gpointer data[2]; + + *components = g_slist_prepend (*components, s); + data[0] = s; + data[1] = &non_manifold; + traverse_manifold (GTS_TRIANGLE (f), s); + + gts_surface_foreach_edge (s, (GtsFunc) non_manifold_edges, data); + i = non_manifold; + while (i) { + gts_surface_remove_face (s, i->data); + i = i->next; + } + g_slist_free (non_manifold); + } +} + +static void traverse_remaining (GtsFace * f, gpointer * data) +{ + GtsSurface * orig = data[0]; + GSList ** components = data[1]; + + if (g_slist_length (f->surfaces) == 1) { + GtsSurface * s = + gts_surface_new (GTS_SURFACE_CLASS (GTS_OBJECT (orig)->klass), + orig->face_class, + orig->edge_class, + orig->vertex_class); + GSList * non_manifold = NULL, * i; + gpointer data[2]; + + *components = g_slist_prepend (*components, s); + data[0] = s; + data[1] = &non_manifold; + traverse_manifold (GTS_TRIANGLE (f), s); + + gts_surface_foreach_edge (s, (GtsFunc) non_manifold_edges, data); + i = non_manifold; + while (i) { + gts_surface_remove_face (s, i->data); + i = i->next; + } + g_slist_free (non_manifold); + } +} + +/** + * gts_surface_split: + * @s: a #GtsSurface. + * + * Splits a surface into connected and manifold components. + * + * Returns: a list of new #GtsSurface. + */ +GSList * gts_surface_split (GtsSurface * s) +{ + gpointer data[2]; + GSList * components = NULL; + + g_return_val_if_fail (s != NULL, NULL); + + data[0] = s; + data[1] = &components; + + /* boundary components */ + gts_surface_foreach_edge (s, (GtsFunc) traverse_boundary, data); + + /* remaining components */ + gts_surface_foreach_face (s, (GtsFunc) traverse_remaining, data); + + return components; +} Index: tags/1.0.5/gts/triangle.c =================================================================== --- tags/1.0.5/gts/triangle.c (nonexistent) +++ tags/1.0.5/gts/triangle.c (revision 953) @@ -0,0 +1,1094 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +static void triangle_destroy (GtsObject * object) +{ + GtsTriangle * triangle = GTS_TRIANGLE (object); + GtsEdge * e1 = triangle->e1; + GtsEdge * e2 = triangle->e2; + GtsEdge * e3 = triangle->e3; + + e1->triangles = g_slist_remove (e1->triangles, triangle); + if (!GTS_OBJECT_DESTROYED (e1) && + !gts_allow_floating_edges && e1->triangles == NULL) + gts_object_destroy (GTS_OBJECT (e1)); + + e2->triangles = g_slist_remove (e2->triangles, triangle); + if (!GTS_OBJECT_DESTROYED (e2) && + !gts_allow_floating_edges && e2->triangles == NULL) + gts_object_destroy (GTS_OBJECT (e2)); + + e3->triangles = g_slist_remove (e3->triangles, triangle); + if (!GTS_OBJECT_DESTROYED (e3) && + !gts_allow_floating_edges && e3->triangles == NULL) + gts_object_destroy (GTS_OBJECT (e3)); + + (* GTS_OBJECT_CLASS (gts_triangle_class ())->parent_class->destroy) (object); +} + +static void triangle_class_init (GtsObjectClass * klass) +{ + klass->destroy = triangle_destroy; +} + +static void triangle_init (GtsTriangle * triangle) +{ + triangle->e1 = triangle->e2 = triangle->e3 = NULL; +} + +/** + * gts_triangle_class: + * + * Returns: the #GtsTriangleClass. + */ +GtsTriangleClass * gts_triangle_class (void) +{ + static GtsTriangleClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo triangle_info = { + "GtsTriangle", + sizeof (GtsTriangle), + sizeof (GtsTriangleClass), + (GtsObjectClassInitFunc) triangle_class_init, + (GtsObjectInitFunc) triangle_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (gts_object_class (), + &triangle_info); + } + + return klass; +} + +/** + * gts_triangle_set: + * @triangle: a #GtsTriangle. + * @e1: a #GtsEdge. + * @e2: another #GtsEdge touching @e1. + * @e3: another #GtsEdge touching both @e1 and @e2. + * + * Sets the edge of @triangle to @e1, @e2 and @e3 while checking that they + * define a valid triangle. + */ +void gts_triangle_set (GtsTriangle * triangle, + GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3) +{ + g_return_if_fail (e1 != NULL); + g_return_if_fail (e2 != NULL); + g_return_if_fail (e3 != NULL); + g_return_if_fail (e1 != e2 && e1 != e3 && e2 != e3); + + triangle->e1 = e1; + triangle->e2 = e2; + triangle->e3 = e3; + + if (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e2)->v1) + g_return_if_fail (gts_segment_connect (GTS_SEGMENT (e3), + GTS_SEGMENT (e1)->v2, + GTS_SEGMENT (e2)->v2)); + else if (GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v1) + g_return_if_fail (gts_segment_connect (GTS_SEGMENT (e3), + GTS_SEGMENT (e1)->v1, + GTS_SEGMENT (e2)->v2)); + else if (GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v2) + g_return_if_fail (gts_segment_connect (GTS_SEGMENT (e3), + GTS_SEGMENT (e1)->v1, + GTS_SEGMENT (e2)->v1)); + else if (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e2)->v2) + g_return_if_fail (gts_segment_connect (GTS_SEGMENT (e3), + GTS_SEGMENT (e1)->v2, + GTS_SEGMENT (e2)->v1)); + else + g_assert_not_reached (); + + e1->triangles = g_slist_prepend (e1->triangles, triangle); + e2->triangles = g_slist_prepend (e2->triangles, triangle); + e3->triangles = g_slist_prepend (e3->triangles, triangle); +} + +/** + * gts_triangle_new: + * @klass: a #GtsTriangleClass. + * @e1: a #GtsEdge. + * @e2: another #GtsEdge touching @e1. + * @e3: another #GtsEdge touching both @e1 and @e2. + * + * Returns: a new #GtsTriangle having @e1, @e2 and @e3 as edges. + */ +GtsTriangle * gts_triangle_new (GtsTriangleClass * klass, + GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3) +{ + GtsTriangle * t; + + t = GTS_TRIANGLE (gts_object_new (GTS_OBJECT_CLASS (klass))); + gts_triangle_set (t, e1, e2, e3); + + return t; +} + +/** + * gts_triangle_vertex_opposite: + * @t: a #GtsTriangle. + * @e: a #GtsEdge used by @t. + * + * This function fails if @e is not an edge of @t. + * + * Returns: a #GtsVertex, vertex of @t which does not belong to @e. + */ +GtsVertex * gts_triangle_vertex_opposite (GtsTriangle * t, GtsEdge * e) +{ + g_return_val_if_fail (t != NULL, NULL); + g_return_val_if_fail (e != NULL, NULL); + + if (t->e1 == e) { + GtsVertex * v = GTS_SEGMENT (t->e2)->v1; + if (v != GTS_SEGMENT (e)->v1 && v != GTS_SEGMENT (e)->v2) + return v; + return GTS_SEGMENT (t->e2)->v2; + } + if (t->e2 == e) { + GtsVertex * v = GTS_SEGMENT (t->e1)->v1; + if (v != GTS_SEGMENT (e)->v1 && v != GTS_SEGMENT (e)->v2) + return v; + return GTS_SEGMENT (t->e1)->v2; + } + if (t->e3 == e) { + GtsVertex * v = GTS_SEGMENT (t->e2)->v1; + if (v != GTS_SEGMENT (e)->v1 && v != GTS_SEGMENT (e)->v2) + return v; + return GTS_SEGMENT (t->e2)->v2; + } + g_assert_not_reached (); + return NULL; +} + +/** + * gts_triangle_edge_opposite: + * @t: a #GtsTriangle. + * @v: a #GtsVertex of @t. + * + * Returns: the edge of @t opposite @v or %NULL if @v is not a vertice of @t. + */ +GtsEdge * gts_triangle_edge_opposite (GtsTriangle * t, GtsVertex * v) +{ + GtsSegment * s1, * s2, * s3; + + g_return_val_if_fail (t != NULL, NULL); + g_return_val_if_fail (v != NULL, NULL); + + s1 = GTS_SEGMENT (t->e1); + s2 = GTS_SEGMENT (t->e2); + + if (s1->v1 != v && s1->v2 != v) { + if (s2->v1 != v && s2->v2 != v) + return NULL; + return t->e1; + } + if (s2->v1 != v && s2->v2 != v) + return t->e2; + s3 = GTS_SEGMENT (t->e3); + g_assert (s3->v1 != v && s3->v2 != v); + return t->e3; +} + +/** + * gts_triangles_angle: + * @t1: a #GtsTriangle. + * @t2: a #GtsTriangle. + * + * Returns: the value (in radians) of the angle between @t1 and @t2. + */ +gdouble gts_triangles_angle (GtsTriangle * t1, + GtsTriangle * t2) +{ + gdouble nx1, ny1, nz1, nx2, ny2, nz2; + gdouble pvx, pvy, pvz; + gdouble theta; + + g_return_val_if_fail (t1 != NULL && t2 != NULL, 0.0); + + gts_triangle_normal (t1, &nx1, &ny1, &nz1); + gts_triangle_normal (t2, &nx2, &ny2, &nz2); + + pvx = ny1*nz2 - nz1*ny2; + pvy = nz1*nx2 - nx1*nz2; + pvz = nx1*ny2 - ny1*nx2; + + theta = atan2 (sqrt (pvx*pvx + pvy*pvy + pvz*pvz), + nx1*nx2 + ny1*ny2 + nz1*nz2) - M_PI; + return theta < - M_PI ? theta + 2.*M_PI : theta; +} + +/** + * gts_triangles_are_compatible: + * @t1: a #GtsTriangle. + * @t2: a #GtsTriangle. + * @e: a #GtsEdge used by both @t1 and @t2. + * + * Checks if @t1 and @t2 have compatible orientations i.e. if @t1 and + * @t2 can be part of the same surface without conflict in the surface + * normal orientation. + * + * Returns: %TRUE if @t1 and @t2 are compatible, %FALSE otherwise. + */ +gboolean gts_triangles_are_compatible (GtsTriangle * t1, + GtsTriangle * t2, + GtsEdge * e) +{ + GtsEdge * e1 = NULL, * e2 = NULL; + + g_return_val_if_fail (t1 != NULL, FALSE); + g_return_val_if_fail (t2 != NULL, FALSE); + g_return_val_if_fail (e != NULL, FALSE); + + if (t1->e1 == e) e1 = t1->e2; + else if (t1->e2 == e) e1 = t1->e3; + else if (t1->e3 == e) e1 = t1->e1; + else + g_assert_not_reached (); + if (t2->e1 == e) e2 = t2->e2; + else if (t2->e2 == e) e2 = t2->e3; + else if (t2->e3 == e) e2 = t2->e1; + else + g_assert_not_reached (); + if (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e2)->v1 || + GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e2)->v2 || + GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v1 || + GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v2) + return FALSE; + return TRUE; +} + +/** + * gts_triangle_area: + * @t: a #GtsTriangle. + * + * Returns: the area of the triangle @t. + */ +gdouble gts_triangle_area (GtsTriangle * t) +{ + gdouble x, y, z; + + g_return_val_if_fail (t != NULL, 0.0); + + gts_triangle_normal (t, &x, &y, &z); + + return sqrt (x*x + y*y + z*z)/2.; +} + +/** + * gts_triangle_perimeter: + * @t: a #GtsTriangle. + * + * Returns: the perimeter of the triangle @t. + */ +gdouble gts_triangle_perimeter (GtsTriangle * t) +{ + GtsVertex * v; + + g_return_val_if_fail (t != NULL, 0.0); + + v = gts_triangle_vertex (t); + return + gts_point_distance (GTS_POINT (GTS_SEGMENT (t->e1)->v1), + GTS_POINT (GTS_SEGMENT (t->e1)->v2)) + + gts_point_distance (GTS_POINT (GTS_SEGMENT (t->e1)->v1), + GTS_POINT (v)) + + gts_point_distance (GTS_POINT (GTS_SEGMENT (t->e1)->v2), + GTS_POINT (v)); +} + +/* perimeter of the equilateral triangle of area unity */ +#define GOLDEN_PERIMETER 4.5590141139 + +/** + * gts_triangle_quality: + * @t: a #GtsTriangle. + * + * The quality of a triangle is defined as the ratio of the square + * root of its surface area to its perimeter relative to this same + * ratio for an equilateral triangle with the same area. The quality + * is then one for an equilateral triangle and tends to zero for a + * very stretched triangle. + * + * Returns: the quality of the triangle @t. + */ +gdouble gts_triangle_quality (GtsTriangle * t) +{ + gdouble perimeter; + + g_return_val_if_fail (t != NULL, 0.0); + + perimeter = gts_triangle_perimeter (t); + return perimeter > 0.0 ? + GOLDEN_PERIMETER*sqrt (gts_triangle_area (t))/perimeter : + 0.0; +} + +/** + * gts_triangle_normal: + * @t: a #GtsTriangle. + * @x: the x coordinate of the normal. + * @y: the y coordinate of the normal. + * @z: the z coordinate of the normal. + * + * Computes the coordinates of the oriented normal of @t as the + * cross-product of two edges, using the left-hand rule. The normal is + * not normalized. If this triangle is part of a closed and oriented + * surface, the normal points to the outside of the surface. + */ +void gts_triangle_normal (GtsTriangle * t, + gdouble * x, + gdouble * y, + gdouble * z) +{ + GtsVertex * v1, * v2 = NULL, * v3 = NULL; + GtsPoint * p1, * p2, * p3; + gdouble x1, y1, z1, x2, y2, z2; + + g_return_if_fail (t != NULL); + + v1 = GTS_SEGMENT (t->e1)->v1; + if (GTS_SEGMENT (t->e1)->v1 == GTS_SEGMENT (t->e2)->v1) { + v2 = GTS_SEGMENT (t->e2)->v2; + v3 = GTS_SEGMENT (t->e1)->v2; + } + else if (GTS_SEGMENT (t->e1)->v2 == GTS_SEGMENT (t->e2)->v2) { + v2 = GTS_SEGMENT (t->e1)->v2; + v3 = GTS_SEGMENT (t->e2)->v1; + } + else if (GTS_SEGMENT (t->e1)->v1 == GTS_SEGMENT (t->e2)->v2) { + v2 = GTS_SEGMENT (t->e2)->v1; + v3 = GTS_SEGMENT (t->e1)->v2; + } + else if (GTS_SEGMENT (t->e1)->v2 == GTS_SEGMENT (t->e2)->v1) { + v2 = GTS_SEGMENT (t->e1)->v2; + v3 = GTS_SEGMENT (t->e2)->v2; + } + else { + fprintf (stderr, "t: %p t->e1: %p t->e2: %p t->e3: %p t->e1->v1: %p t->e1->v2: %p t->e2->v1: %p t->e2->v2: %p t->e3->v1: %p t->e3->v2: %p\n", + t, t->e1, t->e2, + t->e3, GTS_SEGMENT (t->e1)->v1, GTS_SEGMENT (t->e1)->v2, + GTS_SEGMENT (t->e2)->v1, GTS_SEGMENT (t->e2)->v2, + GTS_SEGMENT (t->e3)->v1, GTS_SEGMENT (t->e3)->v2); + g_assert_not_reached (); + } + + p1 = GTS_POINT (v1); + p2 = GTS_POINT (v2); + p3 = GTS_POINT (v3); + + x1 = p2->x - p1->x; + y1 = p2->y - p1->y; + z1 = p2->z - p1->z; + + x2 = p3->x - p1->x; + y2 = p3->y - p1->y; + z2 = p3->z - p1->z; + + *x = y1*z2 - z1*y2; + *y = z1*x2 - x1*z2; + *z = x1*y2 - y1*x2; +} + +/** + * gts_triangle_orientation: + * @t: a #GtsTriangle. + * + * Checks for the orientation of the plane (x,y) projection of a + * triangle. See gts_point_orientation() for details. This function + * is geometrically robust. + * + * Returns: a number depending on the orientation of the vertices of @t. + */ +gdouble gts_triangle_orientation (GtsTriangle * t) +{ + GtsVertex * v1, * v2 = NULL, * v3 = NULL; + + g_return_val_if_fail (t != NULL, 0.0); + + v1 = GTS_SEGMENT (t->e1)->v1; + if (GTS_SEGMENT (t->e1)->v1 == GTS_SEGMENT (t->e2)->v1) { + v2 = GTS_SEGMENT (t->e2)->v2; + v3 = GTS_SEGMENT (t->e1)->v2; + } + else if (GTS_SEGMENT (t->e1)->v2 == GTS_SEGMENT (t->e2)->v2) { + v2 = GTS_SEGMENT (t->e1)->v2; + v3 = GTS_SEGMENT (t->e2)->v1; + } + else if (GTS_SEGMENT (t->e1)->v1 == GTS_SEGMENT (t->e2)->v2) { + v2 = GTS_SEGMENT (t->e2)->v1; + v3 = GTS_SEGMENT (t->e1)->v2; + } + else if (GTS_SEGMENT (t->e1)->v2 == GTS_SEGMENT (t->e2)->v1) { + v2 = GTS_SEGMENT (t->e1)->v2; + v3 = GTS_SEGMENT (t->e2)->v2; + } + else + g_assert_not_reached (); + return gts_point_orientation (GTS_POINT (v1), + GTS_POINT (v2), + GTS_POINT (v3)); +} + +/** + * gts_triangle_revert: + * @t: a #GtsTriangle. + * + * Changes the orientation of triangle @t, turning it inside out. + */ +void gts_triangle_revert (GtsTriangle * t) +{ + GtsEdge * e; + + g_return_if_fail (t != NULL); + + e = t->e1; + t->e1 = t->e2; + t->e2 = e; +} + +/** + * gts_triangles_from_edges: + * @edges: a list of #GtsEdge. + * + * Builds a list of unique triangles which have one of their edges in @edges. + * + * Returns: the list of triangles. + */ +GSList * gts_triangles_from_edges (GSList * edges) +{ + GHashTable * hash; + GSList * triangles = NULL, * i; + + hash = g_hash_table_new (NULL, NULL); + i = edges; + while (i) { + GSList * j = GTS_EDGE (i->data)->triangles; + while (j) { + GtsTriangle * t = j->data; + if (g_hash_table_lookup (hash, t) == NULL) { + triangles = g_slist_prepend (triangles, t); + g_hash_table_insert (hash, t, i); + } + j = j->next; + } + i = i->next; + } + g_hash_table_destroy (hash); + + return triangles; +} + +/** + * gts_triangle_vertices_edges: + * @t: a #GtsTriangle. + * @e: a #GtsEdge belonging to the edges of @t or %NULL. + * @v1: a #GtsVertex used by @t. + * @v2: a #GtsVertex used by @t. + * @v3: a #GtsVertex used by @t. + * @e1: a #GtsEdge used by @t. + * @e2: a #GtsEdge used by @t. + * @e3: a #GtsEdge used by @t. + * + * Given @t and @e, returns @v1, @v2, @v3, @e1, @e2 and @e3. @e1 + * has @v1 and @v2 as vertices, @e2 has @v2 and @v3 as vertices + * and @e3 has @v3 and @v1 as vertices. @v1, @v2 and @v3 respects + * the orientation of @t. If @e is not NULL, @e1 and @e are + * identical. + */ +void gts_triangle_vertices_edges (GtsTriangle * t, + GtsEdge * e, + GtsVertex ** v1, + GtsVertex ** v2, + GtsVertex ** v3, + GtsEdge ** e1, + GtsEdge ** e2, + GtsEdge ** e3) +{ + GtsEdge * ee1, * ee2; + + g_return_if_fail (t != NULL); + + if (e == t->e1 || e == NULL) { + *e1 = ee1 = t->e1; *e2 = ee2 = t->e2; *e3 = t->e3; + } + else if (e == t->e2) { + *e1 = ee1 = e; *e2 = ee2 = t->e3; *e3 = t->e1; + } + else if (e == t->e3) { + *e1 = ee1 = e; *e2 = ee2 = t->e1; *e3 = t->e2; + } + else { + g_assert_not_reached (); + ee1 = ee2 = NULL; /* to avoid complaints from the compiler */ + } + if (GTS_SEGMENT (ee1)->v2 == GTS_SEGMENT (ee2)->v1) { + *v1 = GTS_SEGMENT (ee1)->v1; + *v2 = GTS_SEGMENT (ee1)->v2; + *v3 = GTS_SEGMENT (ee2)->v2; + } + else if (GTS_SEGMENT (ee1)->v2 == GTS_SEGMENT (ee2)->v2) { + *v1 = GTS_SEGMENT (ee1)->v1; + *v2 = GTS_SEGMENT (ee1)->v2; + *v3 = GTS_SEGMENT (ee2)->v1; + } + else if (GTS_SEGMENT (ee1)->v1 == GTS_SEGMENT (ee2)->v1) { + *v1 = GTS_SEGMENT (ee1)->v2; + *v2 = GTS_SEGMENT (ee1)->v1; + *v3 = GTS_SEGMENT (ee2)->v2; + } + else if (GTS_SEGMENT (ee1)->v1 == GTS_SEGMENT (ee2)->v2) { + *v1 = GTS_SEGMENT (ee1)->v2; + *v2 = GTS_SEGMENT (ee1)->v1; + *v3 = GTS_SEGMENT (ee2)->v1; + } + else + g_assert_not_reached (); +} + +/* sqrt(3) */ +#define SQRT3 1.73205080757 + +/** + * gts_triangle_enclosing: + * @klass: the class of the new triangle. + * @points: a list of #GtsPoint. + * @scale: a scaling factor (must be larger than one). + * + * Builds a new triangle (including new vertices and edges) enclosing + * the plane projection of all the points in @points. This triangle is + * equilateral and encloses a rectangle defined by the maximum and + * minimum x and y coordinates of the points. @scale is an homothetic + * scaling factor. If equal to one, the triangle encloses exactly the + * enclosing rectangle. + * + * Returns: a new #GtsTriangle. + */ +GtsTriangle * gts_triangle_enclosing (GtsTriangleClass * klass, + GSList * points, gdouble scale) +{ + gdouble xmax, xmin, ymax, ymin; + gdouble xo, yo, r; + GtsVertex * v1, * v2, * v3; + GtsEdge * e1, * e2, * e3; + + if (points == NULL) + return NULL; + + xmax = xmin = GTS_POINT (points->data)->x; + ymax = ymin = GTS_POINT (points->data)->y; + points = points->next; + while (points) { + GtsPoint * p = points->data; + if (p->x > xmax) xmax = p->x; + else if (p->x < xmin) xmin = p->x; + if (p->y > ymax) ymax = p->y; + else if (p->y < ymin) ymin = p->y; + points = points->next; + } + xo = (xmax + xmin)/2.; + yo = (ymax + ymin)/2.; + r = scale*sqrt((xmax - xo)*(xmax - xo) + (ymax - yo)*(ymax - yo)); + if (r == 0.0) r = scale; + v1 = gts_vertex_new (gts_vertex_class (), + xo + r*SQRT3, yo - r, 0.0); + v2 = gts_vertex_new (gts_vertex_class (), + xo, yo + 2.*r, 0.0); + v3 = gts_vertex_new (gts_vertex_class (), + xo - r*SQRT3, yo - r, 0.0); + e1 = gts_edge_new (gts_edge_class (), v1, v2); + e2 = gts_edge_new (gts_edge_class (), v2, v3); + e3 = gts_edge_new (gts_edge_class (), v3, v1); + return gts_triangle_new (gts_triangle_class (), e1, e2, e3); +} + +/** + * gts_triangle_neighbor_number: + * @t: a #GtsTriangle. + * + * Returns: the number of triangles neighbors of @t. + */ +guint gts_triangle_neighbor_number (GtsTriangle * t) +{ + GSList * i; + guint nn = 0; + GtsEdge * ee[4], ** e = ee; + + g_return_val_if_fail (t != NULL, 0); + + ee[0] = t->e1; ee[1] = t->e2; ee[2] = t->e3; ee[3] = NULL; + while (*e) { + i = (*e++)->triangles; + while (i) { + GtsTriangle * t1 = i->data; + if (t1 != t) + nn++; + i = i->next; + } + } + return nn; +} + +/** + * gts_triangle_neighbors: + * @t: a #GtsTriangle. + * + * Returns: a list of #GtsTriangle neighbors of @t. + */ +GSList * gts_triangle_neighbors (GtsTriangle * t) +{ + GSList * i, * list = NULL; + GtsEdge * ee[4], ** e = ee; + + g_return_val_if_fail (t != NULL, NULL); + + ee[0] = t->e1; ee[1] = t->e2; ee[2] = t->e3; ee[3] = NULL; + while (*e) { + i = (*e++)->triangles; + while (i) { + GtsTriangle * t1 = i->data; + if (t1 != t) + list = g_slist_prepend (list, t1); + i = i->next; + } + } + return list; +} + +/** + * gts_triangles_common_edge: + * @t1: a #GtsTriangle. + * @t2: a #GtsTriangle. + * + * Returns: a #GtsEdge common to both @t1 and @t2 or %NULL if @t1 and @t2 + * do not share any edge. + */ +GtsEdge * gts_triangles_common_edge (GtsTriangle * t1, + GtsTriangle * t2) +{ + g_return_val_if_fail (t1 != NULL, NULL); + g_return_val_if_fail (t2 != NULL, NULL); + + if (t1->e1 == t2->e1 || t1->e1 == t2->e2 || t1->e1 == t2->e3) + return t1->e1; + if (t1->e2 == t2->e1 || t1->e2 == t2->e2 || t1->e2 == t2->e3) + return t1->e2; + if (t1->e3 == t2->e1 || t1->e3 == t2->e2 || t1->e3 == t2->e3) + return t1->e3; + return NULL; +} + +/** + * gts_triangle_is_duplicate: + * @t: a #GtsTriangle. + * + * Returns: a #GtsTriangle different from @t but sharing all its edges + * with @t or %NULL if there is none. + */ +GtsTriangle * gts_triangle_is_duplicate (GtsTriangle * t) +{ + GSList * i; + GtsEdge * e2, * e3; + + g_return_val_if_fail (t != NULL, NULL); + + e2 = t->e2; + e3 = t->e3; + i = t->e1->triangles; + while (i) { + GtsTriangle * t1 = i->data; + if (t1 != t && + (t1->e1 == e2 || t1->e2 == e2 || t1->e3 == e2) && + (t1->e1 == e3 || t1->e2 == e3 || t1->e3 == e3)) + return t1; + i = i->next; + } + + return NULL; +} + +/** + * gts_triangle_use_edges: + * @e1: a #GtsEdge. + * @e2: a #GtsEdge. + * @e3: a #GtsEdge. + * + * Returns: a #GtsTriangle having @e1, @e2 and @e3 as edges or %NULL if @e1, + * @e2 and @e3 are not part of any triangle. + */ +GtsTriangle * gts_triangle_use_edges (GtsEdge * e1, + GtsEdge * e2, + GtsEdge * e3) +{ + GSList * i; + + g_return_val_if_fail (e1 != NULL, NULL); + g_return_val_if_fail (e2 != NULL, NULL); + g_return_val_if_fail (e3 != NULL, NULL); + + i = e1->triangles; + while (i) { + GtsTriangle * t = i->data; + if ((t->e1 == e2 && (t->e2 == e3 || t->e3 == e3)) || + (t->e2 == e2 && (t->e1 == e3 || t->e3 == e3)) || + (t->e3 == e2 && (t->e1 == e3 || t->e2 == e3))) + return t; + i = i->next; + } + + return NULL; +} + +/** + * gts_triangle_is_ok: + * @t: a #GtsTriangle. + * + * Returns: %TRUE if @t is a non-degenerate, non-duplicate triangle, + * %FALSE otherwise. + */ +gboolean gts_triangle_is_ok (GtsTriangle * t) +{ + g_return_val_if_fail (t != NULL, FALSE); + g_return_val_if_fail (t->e1 != NULL, FALSE); + g_return_val_if_fail (t->e2 != NULL, FALSE); + g_return_val_if_fail (t->e3 != NULL, FALSE); + g_return_val_if_fail (t->e1 != t->e2 && t->e1 != t->e3 && t->e2 != t->e3, + FALSE); + g_return_val_if_fail (gts_segments_touch (GTS_SEGMENT (t->e1), + GTS_SEGMENT (t->e2)), + FALSE); + g_return_val_if_fail (gts_segments_touch (GTS_SEGMENT (t->e1), + GTS_SEGMENT (t->e3)), + FALSE); + g_return_val_if_fail (gts_segments_touch (GTS_SEGMENT (t->e2), + GTS_SEGMENT (t->e3)), + FALSE); + g_return_val_if_fail (GTS_SEGMENT (t->e1)->v1 != GTS_SEGMENT (t->e1)->v2, + FALSE); + g_return_val_if_fail (GTS_SEGMENT (t->e2)->v1 != GTS_SEGMENT (t->e2)->v2, + FALSE); + g_return_val_if_fail (GTS_SEGMENT (t->e3)->v1 != GTS_SEGMENT (t->e3)->v2, + FALSE); + g_return_val_if_fail (GTS_OBJECT (t)->reserved == NULL, FALSE); + g_return_val_if_fail (!gts_triangle_is_duplicate (t), FALSE); + return TRUE; +} + +/** + * gts_triangle_vertices: + * @t: a #GtsTriangle. + * @v1: a pointer on a #GtsVertex. + * @v2: a pointer on a #GtsVertex. + * @v3: a pointer on a #GtsVertex. + * + * Fills @v1, @v2 and @v3 with the oriented set of vertices, summits of @t. + */ +void gts_triangle_vertices (GtsTriangle * t, + GtsVertex ** v1, GtsVertex ** v2, GtsVertex ** v3) +{ + GtsSegment * e1, * e2; + + g_return_if_fail (t != NULL); + g_return_if_fail (v1 != NULL && v2 != NULL && v3 != NULL); + + e1 = GTS_SEGMENT (t->e1); + e2 = GTS_SEGMENT (t->e2); + + if (GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v1) { + *v1 = GTS_SEGMENT (e1)->v1; + *v2 = GTS_SEGMENT (e1)->v2; + *v3 = GTS_SEGMENT (e2)->v2; + } + else if (GTS_SEGMENT (e1)->v2 == GTS_SEGMENT (e2)->v2) { + *v1 = GTS_SEGMENT (e1)->v1; + *v2 = GTS_SEGMENT (e1)->v2; + *v3 = GTS_SEGMENT (e2)->v1; + } + else if (GTS_SEGMENT (e1)->v1 == GTS_SEGMENT (e2)->v1) { + *v1 = GTS_SEGMENT (e1)->v2; + *v2 = GTS_SEGMENT (e1)->v1; + *v3 = GTS_SEGMENT (e2)->v2; + } + else { + *v1 = GTS_SEGMENT (e1)->v2; + *v2 = GTS_SEGMENT (e1)->v1; + *v3 = GTS_SEGMENT (e2)->v1; + } +} + +/** + * gts_triangle_circumcircle_center: + * @t: a #GtsTriangle. + * @point_class: a #GtsPointClass. + * + * Returns: a new #GtsPoint, center of the circumscribing circle of @t or + * %NULL if the circumscribing circle is not defined. + */ +GtsPoint * gts_triangle_circumcircle_center (GtsTriangle * t, + GtsPointClass * point_class) +{ + GtsVertex * v1, * v2, * v3; + gdouble xa, ya, xb, yb, xc, yc; + gdouble xd, yd, xe, ye; + gdouble xad, yad, xae, yae; + gdouble det; + + g_return_val_if_fail (t != NULL, NULL); + g_return_val_if_fail (point_class != NULL, NULL); + + gts_triangle_vertices (t, &v1, &v2, &v3); + + xa = GTS_POINT (v1)->x; ya = GTS_POINT (v1)->y; + xb = GTS_POINT (v2)->x; yb = GTS_POINT (v2)->y; + xc = GTS_POINT (v3)->x; yc = GTS_POINT (v3)->y; + xd = (xa + xb)/2.; yd = (ya + yb)/2.; + xe = (xa + xc)/2.; ye = (ya + yc)/2.; + xad = xd - xa; yad = yd - ya; + xae = xe - xa; yae = ye - ya; + det = xad*yae - xae*yad; + if (det == 0.) + return NULL; + return gts_point_new (point_class, + (yae*yad*(yd - ye) + xad*yae*xd - xae*yad*xe)/det, + -(xae*xad*(xd - xe) + yad*xae*yd - yae*xad*ye)/det, + 0.); +} + +/* square of the maximum area ratio admissible */ +#define AREA_RATIO_MAX2 1e8 + +static gboolean points_are_folded (GtsPoint * A, + GtsPoint * B, + GtsPoint * C, + GtsPoint * D, + gdouble max) +{ + GtsVector AB, AC, AD; + GtsVector n1, n2; + gdouble nn1, nn2, n1n2; + + gts_vector_init (AB, A, B); + gts_vector_init (AC, A, C); + gts_vector_init (AD, A, D); + gts_vector_cross (n1, AB, AC); + gts_vector_cross (n2, AD, AB); + + nn1 = gts_vector_scalar (n1, n1); + nn2 = gts_vector_scalar (n2, n2); + if (nn1 >= AREA_RATIO_MAX2*nn2 || nn2 >= AREA_RATIO_MAX2*nn1) + return TRUE; + n1n2 = gts_vector_scalar (n1, n2); + if (n1n2 > 0.) + return FALSE; + if (n1n2*n1n2/(nn1*nn2) > max) + return TRUE; + return FALSE; +} + +static GtsVertex * triangle_use_vertices (GtsTriangle * t, + GtsVertex * A, + GtsVertex * B) +{ + GtsVertex + * v1 = GTS_SEGMENT (t->e1)->v1, + * v2 = GTS_SEGMENT (t->e1)->v2, + * v3 = gts_triangle_vertex (t); + + if (v1 == A) { + if (v2 == B) + return v3; + g_assert (v3 == B); + return v2; + } + if (v2 == A) { + if (v1 == B) + return v3; + g_assert (v3 == B); + return v1; + } + if (v3 == A) { + if (v1 == B) + return v2; + g_assert (v2 == B); + return v1; + } + g_assert_not_reached (); + return NULL; +} + +/** + * gts_triangles_are_folded: + * @triangles: a list of #GtsTriangle. + * @A: a #GtsVertex. + * @B: another #GtsVertex. + * @max: the maximum value of the square of the cosine of the angle between + * two triangles. + * + * Given a list of triangles sharing @A and @B as vertices, checks if any + * two triangles in the list make an angle larger than a given value defined + * by @max. + * + * Returns: %TRUE if any pair of triangles in @triangles makes an angle larger + * than the maximum value, %FALSE otherwise. + */ +gboolean gts_triangles_are_folded (GSList * triangles, + GtsVertex * A, GtsVertex * B, + gdouble max) +{ + GSList * i; + + g_return_val_if_fail (A != NULL, TRUE); + g_return_val_if_fail (B != NULL, TRUE); + + i = triangles; + while (i) { + GtsVertex * C = triangle_use_vertices (i->data, A, B); + GSList * j = i->next; + while (j) { + GtsVertex * D = triangle_use_vertices (j->data, A, B); + if (points_are_folded (GTS_POINT (A), + GTS_POINT (B), + GTS_POINT (C), + GTS_POINT (D), + max)) + return TRUE; + j = j->next; + } + i = i->next; + } + return FALSE; +} + +/** + * gts_triangle_is_stabbed: + * @t: a #GtsTriangle. + * @p: a #GtsPoint. + * @orientation: a pointer or %NULL. + * + * Returns: one of the vertices of @t, one of the edges of @t or @t if + * any of these are stabbed by the ray starting at @p (included) and + * ending at (@p->x, @p->y, +infty), %NULL otherwise. If the ray is + * contained in the plane of the triangle %NULL is also returned. If + * @orientation is not %NULL, it is set to the value of the + * orientation of @p relative to @t (as given by + * gts_point_orientation_3d()). + */ +GtsObject * gts_triangle_is_stabbed (GtsTriangle * t, + GtsPoint * p, + gdouble * orientation) +{ + GtsVertex * v1, * v2, * v3, * inverted = NULL; + GtsEdge * e1, * e2, * e3, * tmp; + gdouble o, o1, o2, o3; + + g_return_val_if_fail (t != NULL, NULL); + g_return_val_if_fail (p != NULL, NULL); + + gts_triangle_vertices_edges (t, NULL, &v1, &v2, &v3, &e1, &e2, &e3); + o = gts_point_orientation (GTS_POINT (v1), GTS_POINT (v2), GTS_POINT (v3)); + if (o == 0.) + return NULL; + if (o < 0.) { + inverted = v1; + v1 = v2; + v2 = inverted; + tmp = e2; + e2 = e3; + e3 = tmp; + } + o = gts_point_orientation_3d (GTS_POINT (v1), + GTS_POINT (v2), + GTS_POINT (v3), + p); + if (o < 0.) + return NULL; + o1 = gts_point_orientation (GTS_POINT (v1), GTS_POINT (v2), p); + if (o1 < 0.) + return NULL; + o2 = gts_point_orientation (GTS_POINT (v2), GTS_POINT (v3), p); + if (o2 < 0.) + return NULL; + o3 = gts_point_orientation (GTS_POINT (v3), GTS_POINT (v1), p); + if (o3 < 0.) + return NULL; + if (orientation) *orientation = inverted ? -o : o; + if (o1 == 0.) { + if (o2 == 0.) + return GTS_OBJECT (v2); + if (o3 == 0.) + return GTS_OBJECT (v1); + return GTS_OBJECT (e1); + } + if (o2 == 0.) { + if (o3 == 0.) + return GTS_OBJECT (v3); + return GTS_OBJECT (e2); + } + if (o3 == 0.) + return GTS_OBJECT (e3); + return GTS_OBJECT (t); +} + +/** + * gts_triangle_interpolate_height: + * @t: a #GtsTriangle. + * @p: a #GtsPoint. + * + * Fills the z-coordinate of point @p belonging to the plane + * projection of triangle @t with the linearly interpolated value of + * the z-coordinates of the vertices of @t. + */ +void gts_triangle_interpolate_height (GtsTriangle * t, GtsPoint * p) +{ + GtsPoint * p1, * p2, * p3; + gdouble x1, x2, y1, y2, det; + + g_return_if_fail (t != NULL); + g_return_if_fail (p != NULL); + + p1 = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + p2 = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + p3 = GTS_POINT (gts_triangle_vertex (t)); + + x1 = p2->x - p1->x; + y1 = p2->y - p1->y; + x2 = p3->x - p1->x; + y2 = p3->y - p1->y; + det = x1*y2 - x2*y1; + if (det == 0.) + p->z = (p1->z + p2->z + p3->z)/3.; + else { + gdouble x = p->x - p1->x; + gdouble y = p->y - p1->y; + gdouble a = (x*y2 - y*x2)/det; + gdouble b = (y*x1 - x*y1)/det; + + p->z = (1. - a - b)*p1->z + a*p2->z + b*p3->z; + } +} Index: tags/1.0.5/gts/tribox3.c =================================================================== --- tags/1.0.5/gts/tribox3.c (nonexistent) +++ tags/1.0.5/gts/tribox3.c (revision 953) @@ -0,0 +1,192 @@ +/** + * History: + * 2004-10-27 Stephane Popinet: changed float to double + */ + +/********************************************************/ +/* AABB-triangle overlap test code */ +/* by Tomas Akenine-Möller */ +/* Function: int triBoxOverlap(float boxcenter[3], */ +/* float boxhalfsize[3],float triverts[3][3]); */ +/* History: */ +/* 2001-03-05: released the code in its first version */ +/* 2001-06-18: changed the order of the tests, faster */ +/* */ +/* Acknowledgement: Many thanks to Pierre Terdiman for */ +/* suggestions and discussions on how to optimize code. */ +/* Thanks to David Hunt for finding a ">="-bug! */ +/********************************************************/ +#include +#include + +#define X 0 +#define Y 1 +#define Z 2 + +#define CROSS(dest,v1,v2) \ + dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \ + dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \ + dest[2]=v1[0]*v2[1]-v1[1]*v2[0]; + +#define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]) + +#define SUB(dest,v1,v2) \ + dest[0]=v1[0]-v2[0]; \ + dest[1]=v1[1]-v2[1]; \ + dest[2]=v1[2]-v2[2]; + +#define FINDMINMAX(x0,x1,x2,min,max) \ + min = max = x0; \ + if(x1max) max=x1;\ + if(x2max) max=x2; + +int planeBoxOverlap(double normal[3], double vert[3], double maxbox[3]) // -NJMP- +{ + int q; + double vmin[3],vmax[3],v; + for(q=X;q<=Z;q++) + { + v=vert[q]; // -NJMP- + if(normal[q]>0.0f) + { + vmin[q]=-maxbox[q] - v; // -NJMP- + vmax[q]= maxbox[q] - v; // -NJMP- + } + else + { + vmin[q]= maxbox[q] - v; // -NJMP- + vmax[q]=-maxbox[q] - v; // -NJMP- + } + } + if(DOT(normal,vmin)>0.0f) return 0; // -NJMP- + if(DOT(normal,vmax)>=0.0f) return 1; // -NJMP- + + return 0; +} + + +/*======================== X-tests ========================*/ +#define AXISTEST_X01(a, b, fa, fb) \ + p0 = a*v0[Y] - b*v0[Z]; \ + p2 = a*v2[Y] - b*v2[Z]; \ + if(p0rad || max<-rad) return 0; + +#define AXISTEST_X2(a, b, fa, fb) \ + p0 = a*v0[Y] - b*v0[Z]; \ + p1 = a*v1[Y] - b*v1[Z]; \ + if(p0rad || max<-rad) return 0; + +/*======================== Y-tests ========================*/ +#define AXISTEST_Y02(a, b, fa, fb) \ + p0 = -a*v0[X] + b*v0[Z]; \ + p2 = -a*v2[X] + b*v2[Z]; \ + if(p0rad || max<-rad) return 0; + +#define AXISTEST_Y1(a, b, fa, fb) \ + p0 = -a*v0[X] + b*v0[Z]; \ + p1 = -a*v1[X] + b*v1[Z]; \ + if(p0rad || max<-rad) return 0; + +/*======================== Z-tests ========================*/ + +#define AXISTEST_Z12(a, b, fa, fb) \ + p1 = a*v1[X] - b*v1[Y]; \ + p2 = a*v2[X] - b*v2[Y]; \ + if(p2rad || max<-rad) return 0; + +#define AXISTEST_Z0(a, b, fa, fb) \ + p0 = a*v0[X] - b*v0[Y]; \ + p1 = a*v1[X] - b*v1[Y]; \ + if(p0rad || max<-rad) return 0; + +int triBoxOverlap(double boxcenter[3],double boxhalfsize[3],double triverts[3][3]) +{ + + /* use separating axis theorem to test overlap between triangle and box */ + /* need to test for overlap in these directions: */ + /* 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */ + /* we do not even need to test these) */ + /* 2) normal of the triangle */ + /* 3) crossproduct(edge from tri, {x,y,z}-directin) */ + /* this gives 3x3=9 more tests */ + double v0[3],v1[3],v2[3]; +// double axis[3]; + double min,max,p0,p1,p2,rad,fex,fey,fez; // -NJMP- "d" local variable removed + double normal[3],e0[3],e1[3],e2[3]; + + /* This is the fastest branch on Sun */ + /* move everything so that the boxcenter is in (0,0,0) */ + SUB(v0,triverts[0],boxcenter); + SUB(v1,triverts[1],boxcenter); + SUB(v2,triverts[2],boxcenter); + + /* compute triangle edges */ + SUB(e0,v1,v0); /* tri edge 0 */ + SUB(e1,v2,v1); /* tri edge 1 */ + SUB(e2,v0,v2); /* tri edge 2 */ + + /* Bullet 3: */ + /* test the 9 tests first (this was faster) */ + fex = fabsf(e0[X]); + fey = fabsf(e0[Y]); + fez = fabsf(e0[Z]); + AXISTEST_X01(e0[Z], e0[Y], fez, fey); + AXISTEST_Y02(e0[Z], e0[X], fez, fex); + AXISTEST_Z12(e0[Y], e0[X], fey, fex); + + fex = fabsf(e1[X]); + fey = fabsf(e1[Y]); + fez = fabsf(e1[Z]); + AXISTEST_X01(e1[Z], e1[Y], fez, fey); + AXISTEST_Y02(e1[Z], e1[X], fez, fex); + AXISTEST_Z0(e1[Y], e1[X], fey, fex); + + fex = fabsf(e2[X]); + fey = fabsf(e2[Y]); + fez = fabsf(e2[Z]); + AXISTEST_X2(e2[Z], e2[Y], fez, fey); + AXISTEST_Y1(e2[Z], e2[X], fez, fex); + AXISTEST_Z12(e2[Y], e2[X], fey, fex); + + /* Bullet 1: */ + /* first test overlap in the {x,y,z}-directions */ + /* find min, max of the triangle each direction, and test for overlap in */ + /* that direction -- this is equivalent to testing a minimal AABB around */ + /* the triangle against the AABB */ + + /* test in X-direction */ + FINDMINMAX(v0[X],v1[X],v2[X],min,max); + if(min>boxhalfsize[X] || max<-boxhalfsize[X]) return 0; + + /* test in Y-direction */ + FINDMINMAX(v0[Y],v1[Y],v2[Y],min,max); + if(min>boxhalfsize[Y] || max<-boxhalfsize[Y]) return 0; + + /* test in Z-direction */ + FINDMINMAX(v0[Z],v1[Z],v2[Z],min,max); + if(min>boxhalfsize[Z] || max<-boxhalfsize[Z]) return 0; + + /* Bullet 2: */ + /* test if the box intersects the plane of the triangle */ + /* compute plane equation of triangle: normal*x+d=0 */ + CROSS(normal,e0,e1); + // -NJMP- (line removed here) + if(!planeBoxOverlap(normal,v0,boxhalfsize)) return 0; // -NJMP- + + return 1; /* box and triangle overlaps */ +} + Index: tags/1.0.5/gts/vertex.c =================================================================== --- tags/1.0.5/gts/vertex.c (nonexistent) +++ tags/1.0.5/gts/vertex.c (revision 953) @@ -0,0 +1,780 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "gts.h" + +gboolean gts_allow_floating_vertices = FALSE; + +static void vertex_destroy (GtsObject * object) +{ + GtsVertex * vertex = GTS_VERTEX (object); + GSList * i; + + i = vertex->segments; + while (i) { + GTS_OBJECT_SET_FLAGS (i->data, GTS_DESTROYED); + i = i->next; + } + i = vertex->segments; + while (i) { + GSList * next = i->next; + gts_object_destroy (i->data); + i = next; + } + g_assert (vertex->segments == NULL); + + (* GTS_OBJECT_CLASS (gts_vertex_class ())->parent_class->destroy) (object); +} + +static void vertex_clone (GtsObject * clone, GtsObject * object) +{ + (* GTS_OBJECT_CLASS (gts_vertex_class ())->parent_class->clone) (clone, + object); + GTS_VERTEX (clone)->segments = NULL; +} + +static void vertex_class_init (GtsVertexClass * klass) +{ + klass->intersection_attributes = NULL; + GTS_OBJECT_CLASS (klass)->clone = vertex_clone; + GTS_OBJECT_CLASS (klass)->destroy = vertex_destroy; +} + +static void vertex_init (GtsVertex * vertex) +{ + vertex->segments = NULL; +} + +/** + * gts_vertex_class: + * + * Returns: the #GtsVertexClass. + */ +GtsVertexClass * gts_vertex_class (void) +{ + static GtsVertexClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo vertex_info = { + "GtsVertex", + sizeof (GtsVertex), + sizeof (GtsVertexClass), + (GtsObjectClassInitFunc) vertex_class_init, + (GtsObjectInitFunc) vertex_init, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_point_class ()), + &vertex_info); + } + + return klass; +} + +/** + * gts_vertex_new: + * @klass: a #GtsVertexClass. + * @x: the x-coordinate of the vertex to create. + * @y: the y-coordinate of the vertex to create. + * @z: the y-coordinate of the vertex to create. + * + * Returns: a new #GtsVertex with @x, @y and @z as coordinates. + */ +GtsVertex * gts_vertex_new (GtsVertexClass * klass, + gdouble x, gdouble y, gdouble z) +{ + GtsVertex * v; + + v = GTS_VERTEX (gts_object_new (GTS_OBJECT_CLASS (klass))); + gts_point_set (GTS_POINT (v), x, y, z); + + return v; +} + +/** + * gts_vertex_replace: + * @v: a #GtsVertex. + * @with: another #GtsVertex. + * + * Replaces vertex @v with vertex @with. @v and @with must be + * different. All the #GtsSegment which have @v has one of their + * vertices are updated. The segments list of vertex @v is freed and + * @v->segments is set to %NULL. + */ +void gts_vertex_replace (GtsVertex * v, GtsVertex * with) +{ + GSList * i; + + g_return_if_fail (v != NULL); + g_return_if_fail (with != NULL); + g_return_if_fail (v != with); + + i = v->segments; + while (i) { + GtsSegment * s = i->data; + if (s->v1 != with && s->v2 != with) + with->segments = g_slist_prepend (with->segments, s); + if (s->v1 == v) s->v1 = with; + if (s->v2 == v) s->v2 = with; + i = i->next; + } + g_slist_free (v->segments); + v->segments = NULL; +} + +/** + * gts_vertex_is_unattached: + * @v: a #GtsVertex. + * + * Returns: %TRUE if @v is not the endpoint of any #GtsSegment, + * %FALSE otherwise. + */ +gboolean gts_vertex_is_unattached (GtsVertex * v) +{ + g_return_val_if_fail (v != NULL, FALSE); + if (v->segments == NULL) + return TRUE; + return FALSE; +} + +/** + * gts_vertices_are_connected: + * @v1: a #GtsVertex. + * @v2: another #GtsVertex. + * + * Returns: if @v1 and @v2 are the vertices of the same #GtsSegment + * this segment else %NULL. + */ +GtsSegment * gts_vertices_are_connected (GtsVertex * v1, GtsVertex * v2) +{ + GSList * i; + + g_return_val_if_fail (v1 != NULL, FALSE); + g_return_val_if_fail (v2 != NULL, FALSE); + + i = v1->segments; + while (i) { + GtsSegment * s = i->data; + + if (s->v1 == v2 || s->v2 == v2) + return s; + i = i->next; + } + return NULL; +} + +/** + * gts_vertices_from_segments: + * @segments: a list of #GtsSegment. + * + * Returns: a list of #GtsVertex, vertices of a #GtsSegment in @segments. + * Each element in the list is unique (no duplicates). + */ +GSList * gts_vertices_from_segments (GSList * segments) +{ + GHashTable * hash; + GSList * vertices = NULL, * i; + + hash = g_hash_table_new (NULL, NULL); + i = segments; + while (i) { + GtsSegment * s = i->data; + if (g_hash_table_lookup (hash, s->v1) == NULL) { + vertices = g_slist_prepend (vertices, s->v1); + g_hash_table_insert (hash, s->v1, s); + } + if (g_hash_table_lookup (hash, s->v2) == NULL) { + vertices = g_slist_prepend (vertices, s->v2); + g_hash_table_insert (hash, s->v2, s); + } + i = i->next; + } + g_hash_table_destroy (hash); + return vertices; +} + +/** + * gts_vertex_triangles: + * @v: a #GtsVertex. + * @list: a list of #GtsTriangle. + * + * Adds all the #GtsTriangle which share @v as a vertex and do not + * already belong to @list. + * + * Returns: the new list of unique #GtsTriangle which share @v as a + * vertex. + */ +GSList * gts_vertex_triangles (GtsVertex * v, + GSList * list) +{ + GSList * i; + + g_return_val_if_fail (v != NULL, NULL); + + i = v->segments; + while (i) { + GtsSegment * s = i->data; + if (GTS_IS_EDGE (s)) { + GSList * j = GTS_EDGE (s)->triangles; + while (j) { + if (!g_slist_find (list, j->data)) + list = g_slist_prepend (list, j->data); + j = j->next; + } + } + i = i->next; + } + return list; +} + +/** + * gts_vertex_faces: + * @v: a #GtsVertex. + * @surface: a #GtsSurface or %NULL. + * @list: a list of #GtsFace. + * + * Adds all the #GtsFace belonging to @surface (if not %NULL) which share + * @v as a vertex and do not already belong to @list. + * + * Returns: the new list of unique #GtsFace belonging to @surface + * which share @v as a vertex. + */ +GSList * gts_vertex_faces (GtsVertex * v, + GtsSurface * surface, + GSList * list) +{ + GSList * i; + + g_return_val_if_fail (v != NULL, NULL); + + i = v->segments; + while (i) { + GtsSegment * s = i->data; + if (GTS_IS_EDGE (s)) { + GSList * j = GTS_EDGE (s)->triangles; + while (j) { + GtsTriangle * t = j->data; + if (GTS_IS_FACE (t) + && + (!surface || gts_face_has_parent_surface (GTS_FACE (t), surface)) + && + !g_slist_find (list, t)) + list = g_slist_prepend (list, t); + j = j->next; + } + } + i = i->next; + } + return list; +} + +/** + * gts_vertex_neighbors: + * @v: a #GtsVertex. + * @list: a list of #GtsVertex. + * @surface: a #GtsSurface or %NULL. + * + * Adds to @list all the #GtsVertex connected to @v by a #GtsSegment and not + * already in @list. If @surface is not %NULL only the vertices connected to + * @v by an edge belonging to @surface are considered. + * + * Returns: the new list of unique #GtsVertex. + */ +GSList * gts_vertex_neighbors (GtsVertex * v, + GSList * list, + GtsSurface * surface) +{ + GSList * i; + + g_return_val_if_fail (v != NULL, NULL); + + i = v->segments; + while (i) { + GtsSegment * s = i->data; + GtsVertex * v1 = s->v1 == v ? s->v2 : s->v1; + if (v1 != v && + (!surface || + (GTS_IS_EDGE (s) && + gts_edge_has_parent_surface (GTS_EDGE (s), surface))) && + !g_slist_find (list, v1)) + list = g_slist_prepend (list, v1); + i = i->next; + } + return list; +} + +/** + * gts_vertex_is_boundary: + * @v: a #GtsVertex. + * @surface: a #GtsSurface or %NULL. + * + * Returns: %TRUE if @v is used by a #GtsEdge boundary of @surface as + * determined by gts_edge_is_boundary(), %FALSE otherwise. + */ +gboolean gts_vertex_is_boundary (GtsVertex * v, GtsSurface * surface) +{ + GSList * i; + + g_return_val_if_fail (v != NULL, FALSE); + + i = v->segments; + while (i) { + if (GTS_IS_EDGE (i->data) && + gts_edge_is_boundary (i->data, surface)) + return TRUE; + i = i->next; + } + + return FALSE; +} + +/** + * gts_vertices_merge: + * @vertices: a list of #GtsVertex. + * @epsilon: half the size of the bounding box to consider for each vertex. + * @check: function called for each pair of vertices about to be merged + * or %NULL. + * + * For each vertex v in @vertices look if there are any vertex of + * @vertices contained in a box centered on v of size 2*@epsilon. If + * there are and if @check is not %NULL and returns %TRUE, replace + * them with v (using gts_vertex_replace()), destroy them and remove + * them from list. This is done efficiently using Kd-Trees. + * + * Returns: the updated list of vertices. + */ +GList * gts_vertices_merge (GList * vertices, + gdouble epsilon, + gboolean (* check) (GtsVertex *, GtsVertex *)) +{ + GPtrArray * array; + GList * i; + GNode * kdtree; + + g_return_val_if_fail (vertices != NULL, 0); + + array = g_ptr_array_new (); + i = vertices; + while (i) { + g_ptr_array_add (array, i->data); + i = i->next; + } + kdtree = gts_kdtree_new (array, NULL); + g_ptr_array_free (array, TRUE); + + i = vertices; + while (i) { + GtsVertex * v = i->data; + if (!GTS_OBJECT (v)->reserved) { /* Do something only if v is active */ + GtsBBox * bbox; + GSList * selected, * j; + + /* build bounding box */ + bbox = gts_bbox_new (gts_bbox_class (), + v, + GTS_POINT (v)->x - epsilon, + GTS_POINT (v)->y - epsilon, + GTS_POINT (v)->z - epsilon, + GTS_POINT (v)->x + epsilon, + GTS_POINT (v)->y + epsilon, + GTS_POINT (v)->z + epsilon); + + /* select vertices which are inside bbox using kdtree */ + j = selected = gts_kdtree_range (kdtree, bbox, NULL); + while (j) { + GtsVertex * sv = j->data; + if (sv != v && !GTS_OBJECT (sv)->reserved && (!check || (*check) (sv, v))) { + /* sv is not v and is active */ + gts_vertex_replace (sv, v); + GTS_OBJECT (sv)->reserved = sv; /* mark sv as inactive */ + } + j = j->next; + } + g_slist_free (selected); + gts_object_destroy (GTS_OBJECT (bbox)); + } + i = i->next; + } + + gts_kdtree_destroy (kdtree); + + /* destroy inactive vertices and removes them from list */ + + /* we want to control vertex destruction */ + gts_allow_floating_vertices = TRUE; + + i = vertices; + while (i) { + GtsVertex * v = i->data; + GList * next = i->next; + if (GTS_OBJECT (v)->reserved) { /* v is inactive */ + gts_object_destroy (GTS_OBJECT (v)); + vertices = g_list_remove_link (vertices, i); + g_list_free_1 (i); + } + i = next; + } + gts_allow_floating_vertices = FALSE; + + return vertices; +} + +/* returns the list of edges belonging to @surface turning around @v */ +static GSList * edge_fan_list (GtsVertex * v, + GtsSurface * surface, + GtsFace * f, + GtsEdge * e, + GtsFace * first) +{ + GSList * i = e->triangles; + GtsFace * neighbor = NULL; + GtsEdge * next = NULL, * enext = NULL; + + while (i) { + GtsFace * f1 = i->data; + if (GTS_IS_FACE (f1) && + f1 != f && + gts_face_has_parent_surface (f1, surface)) { + g_return_val_if_fail (neighbor == NULL, NULL); /* non-manifold edge */ + neighbor = f1; + } + i = i->next; + } + if (neighbor == NULL || neighbor == first) /* end of fan */ + return NULL; + + if (GTS_TRIANGLE (neighbor)->e1 == e) { + next = GTS_TRIANGLE (neighbor)->e2; + enext = GTS_TRIANGLE (neighbor)->e3; + } + else if (GTS_TRIANGLE (neighbor)->e2 == e) { + next = GTS_TRIANGLE (neighbor)->e3; + enext = GTS_TRIANGLE (neighbor)->e1; + } + else if (GTS_TRIANGLE (neighbor)->e3 == e) { + next = GTS_TRIANGLE (neighbor)->e1; + enext = GTS_TRIANGLE (neighbor)->e2; + } + else + g_assert_not_reached (); + + /* checking for correct orientation */ + g_return_val_if_fail (GTS_SEGMENT (enext)->v1 == v || + GTS_SEGMENT (enext)->v2 == v, NULL); + + return g_slist_prepend (edge_fan_list (v, surface, neighbor, enext, first), + next); +} + +/** + * gts_vertex_fan_oriented: + * @v: a #GtsVertex. + * @surface: a #GtsSurface. + * + * Returns: a list of #GtsEdge describing in counterclockwise order the + * boundary of the fan of summit @v, the faces of the fan belonging to + * @surface. + */ +GSList * gts_vertex_fan_oriented (GtsVertex * v, GtsSurface * surface) +{ + GtsFace * f = NULL; + guint d = 2; + GSList * i; + GtsVertex * v1, * v2, * v3; + GtsEdge * e1, * e2, * e3; + + g_return_val_if_fail (v != NULL, NULL); + g_return_val_if_fail (surface != NULL, NULL); + + i = v->segments; + while (i) { + GtsEdge * e = i->data; + if (GTS_IS_EDGE (e)) { + GSList * j = e->triangles; + GtsFace * f1 = NULL; + guint degree = 0; + while (j) { + if (GTS_IS_FACE (j->data) && + gts_face_has_parent_surface (j->data, surface)) { + f1 = j->data; + degree++; + } + j = j->next; + } + if (f1 != NULL) { + g_return_val_if_fail (degree <= 2, NULL); /* non-manifold edge */ + if (degree == 1) { + gts_triangle_vertices_edges (GTS_TRIANGLE (f1), NULL, + &v1, &v2, &v3, &e1, &e2, &e3); + if (v == v2) { + e2 = e3; + e3 = e1; + } + else if (v == v3) { + e3 = e2; + e2 = e1; + } + if (e3 != e) { + d = 1; + f = f1; + } + } + else if (degree <= d) + f = f1; + } + } + i = i->next; + } + + if (f == NULL) + return NULL; + + gts_triangle_vertices_edges (GTS_TRIANGLE (f), NULL, + &v1, &v2, &v3, &e1, &e2, &e3); + if (v == v2) { + e2 = e3; + e3 = e1; + } + else if (v == v3) { + e3 = e2; + e2 = e1; + } + + return g_slist_prepend (edge_fan_list (v, surface, f, e3, f), e2); +} + +#define edge_use_vertex(e, v) (GTS_SEGMENT(e)->v1 == v ||\ + GTS_SEGMENT(e)->v2 == v) + +static GtsEdge * replace_vertex (GtsTriangle * t, + GtsEdge * e1, + GtsVertex * v, + GtsVertex * with) +{ + GtsEdge * e = NULL; + + if (t->e1 != e1 && edge_use_vertex (t->e1, v)) + e = t->e1; + else if (t->e2 != e1 && edge_use_vertex (t->e2, v)) + e = t->e2; + else if (t->e3 != e1 && edge_use_vertex (t->e3, v)) + e = t->e3; + else + return NULL; + + if (with != v) { + GtsSegment * s = GTS_SEGMENT (e); + if (s->v1 == v) s->v1 = with; + if (s->v2 == v) s->v2 = with; + with->segments = g_slist_prepend (with->segments, s); + v->segments = g_slist_remove (v->segments, s); + } + + return e; +} + +static void triangle_next (GtsEdge * e, GtsVertex * v, GtsVertex * with) +{ + GSList * i; + + if (e == NULL) + return; + + i = e->triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_OBJECT (t)->reserved) { + GTS_OBJECT (t)->reserved = NULL; + triangle_next (replace_vertex (t, e, v, with), v, with); + } + i = i->next; + } +} + +/** + * gts_vertex_is_contact: + * @v: a #GtsVertex. + * @sever: if %TRUE and if @v is a contact vertex between two or more + * sets of connected triangles replaces it with as many vertices, + * clones of @v. + * + * Returns: the number of sets of connected triangles sharing @v as a + * contact vertex. + */ +guint gts_vertex_is_contact (GtsVertex * v, gboolean sever) +{ + GSList * triangles, * i; + GtsVertex * with = v; + guint ncomponent = 0; + + g_return_val_if_fail (v != NULL, 0); + + triangles = gts_vertex_triangles (v, NULL); + i = triangles; + while (i) { + GTS_OBJECT (i->data)->reserved = i; + i = i->next; + } + + i = triangles; + while (i) { + GtsTriangle * t = i->data; + if (GTS_OBJECT (t)->reserved) { + GtsEdge * e; + if (ncomponent && sever) + with = GTS_VERTEX (gts_object_clone (GTS_OBJECT (v))); + GTS_OBJECT (t)->reserved = NULL; + e = replace_vertex (t, NULL, v, with); + triangle_next (e, v, with); + triangle_next (replace_vertex (t, e, v, with), v, with); + ncomponent++; + } + i = i->next; + } + g_slist_free (triangles); + + return ncomponent; +} + +/* GtsVertexNormal: Object */ + +static void vertex_normal_attributes (GtsVertex * v, + GtsObject * e, + GtsObject * t) +{ + g_return_if_fail (GTS_IS_EDGE (e)); + g_return_if_fail (GTS_IS_TRIANGLE (t)); + + if (GTS_IS_VERTEX_NORMAL (GTS_SEGMENT (e)->v1) && + GTS_IS_VERTEX_NORMAL (GTS_SEGMENT (e)->v2)) { + GtsPoint * p1 = GTS_POINT (GTS_SEGMENT (e)->v1); + GtsPoint * p2 = GTS_POINT (GTS_SEGMENT (e)->v2); + GtsPoint * p = GTS_POINT (v); + gdouble a, b, lambda; + guint i; + + a = p2->x - p1->x; b = p->x - p1->x; + if (fabs (p2->y - p1->y) > fabs (a)) { + a = p2->y - p1->y; b = p->y - p1->y; + } + if (fabs (p2->z - p1->z) > fabs (a)) { + a = p2->z - p1->z; b = p->z - p1->z; + } + lambda = a != 0. ? b/a : 0.; + for (i = 0; i < 3; i++) + GTS_VERTEX_NORMAL (v)->n[i] = + (1. - lambda)*GTS_VERTEX_NORMAL (GTS_SEGMENT (e)->v1)->n[i] + + lambda*GTS_VERTEX_NORMAL (GTS_SEGMENT (e)->v2)->n[i]; + } + else { + GtsVertex * v1, * v2, * v3; + + gts_triangle_vertices (GTS_TRIANGLE (t), &v1, &v2, &v3); + if (GTS_IS_VERTEX_NORMAL (v1) && + GTS_IS_VERTEX_NORMAL (v2) && + GTS_IS_VERTEX_NORMAL (v3)) { + GtsVector a1, a2, a3, det; + guint i, j = 0; + gdouble l1, l2; + + gts_vector_init (a1, GTS_POINT (v1), GTS_POINT (v)); + gts_vector_init (a2, GTS_POINT (v1), GTS_POINT (v2)); + gts_vector_init (a3, GTS_POINT (v1), GTS_POINT (v3)); + gts_vector_cross (det, a2, a3); + if (fabs (det[1]) > fabs (det[0])) j = 1; + if (fabs (det[2]) > fabs (det[j])) j = 2; + if (det[j] == 0.) { + g_warning ("vertex_normal_attributes: det[%d] == 0.", j); + return; + } + switch (j) { + case 0: + l1 = (a1[1]*a3[2] - a1[2]*a3[1])/det[0]; + l2 = (a1[2]*a2[1] - a1[1]*a2[2])/det[0]; + break; + case 1: + l1 = (a1[2]*a3[0] - a1[0]*a3[2])/det[1]; + l2 = (a1[0]*a2[2] - a1[2]*a2[0])/det[1]; + break; + case 2: + l1 = (a1[0]*a3[1] - a1[1]*a3[0])/det[2]; + l2 = (a1[1]*a2[0] - a1[0]*a2[1])/det[2]; + break; + default: + l1 = l2 = 0.; + } + for (i = 0; i < 3; i++) + GTS_VERTEX_NORMAL (v)->n[i] = + GTS_VERTEX_NORMAL (v1)->n[i]*(1. - l1 - l2) + + GTS_VERTEX_NORMAL (v2)->n[i]*l1 + + GTS_VERTEX_NORMAL (v3)->n[i]*l2; + } + } +} + +static void gts_vertex_normal_class_init (GtsVertexClass * klass) +{ + klass->intersection_attributes = vertex_normal_attributes; +} + +GtsVertexClass * gts_vertex_normal_class (void) +{ + static GtsVertexClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo gts_vertex_normal_info = { + "GtsVertexNormal", + sizeof (GtsVertexNormal), + sizeof (GtsVertexClass), + (GtsObjectClassInitFunc) gts_vertex_normal_class_init, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_vertex_class ()), + >s_vertex_normal_info); + } + + return klass; +} + +/* GtsColorVertex: Object */ + +GtsVertexClass * gts_color_vertex_class (void) +{ + static GtsVertexClass * klass = NULL; + + if (klass == NULL) { + GtsObjectClassInfo gts_color_vertex_info = { + "GtsColorVertex", + sizeof (GtsColorVertex), + sizeof (GtsVertexClass), + (GtsObjectClassInitFunc) NULL, + (GtsObjectInitFunc) NULL, + (GtsArgSetFunc) NULL, + (GtsArgGetFunc) NULL + }; + klass = gts_object_class_new (GTS_OBJECT_CLASS (gts_vertex_class ()), + >s_color_vertex_info); + } + + return klass; +} + Index: tags/1.0.5/gts/vopt.c =================================================================== --- tags/1.0.5/gts/vopt.c (nonexistent) +++ tags/1.0.5/gts/vopt.c (revision 953) @@ -0,0 +1,521 @@ +/* GTS - Library for the manipulation of triangulated surfaces + * Copyright (C) 1999 Stéphane Popinet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gts.h" + +/* #define DEBUG_VOPT */ + +/* compute the normal (nx, ny, nz) as the cross-product of the first two + oriented edges and the norm nt = |t| as (v1xv2).v3 */ +static void triangle_normal (GtsTriangle * t, + gdouble * nx, + gdouble * ny, + gdouble * nz, + gdouble * nt) +{ + GtsPoint * p1, * p2 = NULL, * p3 = NULL; + gdouble x1, y1, z1, x2, y2, z2; + + g_return_if_fail (t != NULL); + + p1 = GTS_POINT (GTS_SEGMENT (t->e1)->v1); + if (GTS_SEGMENT (t->e1)->v1 == GTS_SEGMENT (t->e2)->v1) { + p2 = GTS_POINT (GTS_SEGMENT (t->e2)->v2); + p3 = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + } + else if (GTS_SEGMENT (t->e1)->v2 == GTS_SEGMENT (t->e2)->v2) { + p2 = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + p3 = GTS_POINT (GTS_SEGMENT (t->e2)->v1); + } + else if (GTS_SEGMENT (t->e1)->v1 == GTS_SEGMENT (t->e2)->v2) { + p2 = GTS_POINT (GTS_SEGMENT (t->e2)->v1); + p3 = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + } + else if (GTS_SEGMENT (t->e1)->v2 == GTS_SEGMENT (t->e2)->v1) { + p2 = GTS_POINT (GTS_SEGMENT (t->e1)->v2); + p3 = GTS_POINT (GTS_SEGMENT (t->e2)->v2); + } + else + g_assert_not_reached (); + + x1 = p2->x - p1->x; + y1 = p2->y - p1->y; + z1 = p2->z - p1->z; + + x2 = p3->x - p1->x; + y2 = p3->y - p1->y; + z2 = p3->z - p1->z; + + *nt = ((p1->y*p2->z - p1->z*p2->y)*p3->x + + (p1->z*p2->x - p1->x*p2->z)*p3->y + + (p1->x*p2->y - p1->y*p2->x)*p3->z); + *nx = y1*z2 - z1*y2; + *ny = z1*x2 - x1*z2; + *nz = x1*y2 - y1*x2; +} + +static void boundary_preservation (GtsEdge * edge, + GtsFace * f, + GtsVector e1, GtsVector e2, + GtsMatrix * H, GtsVector c) +{ + GtsTriangle * t = GTS_TRIANGLE (f); + GtsEdge * edge2; + GtsVertex * v1 = GTS_SEGMENT (edge)->v1, * v2 = GTS_SEGMENT (edge)->v2; + GtsPoint * p1, * p2; + GtsVector e, e3; + + /* find orientation of segment */ + edge2 = edge == t->e1 ? t->e2 : edge == t->e2 ? t->e3 : t->e1; + if (v2 != GTS_SEGMENT (edge2)->v1 && v2 != GTS_SEGMENT (edge2)->v2) { + v2 = v1; v1 = GTS_SEGMENT (edge)->v2; + } + p1 = GTS_POINT (v1); + p2 = GTS_POINT (v2); + + e[0] = p2->x - p1->x; + e[1] = p2->y - p1->y; + e[2] = p2->z - p1->z; + + e1[0] += e[0]; + e1[1] += e[1]; + e1[2] += e[2]; + + e3[0] = p2->y*p1->z - p2->z*p1->y; + e3[1] = p2->z*p1->x - p2->x*p1->z; + e3[2] = p2->x*p1->y - p2->y*p1->x; + + e2[0] += e3[0]; + e2[1] += e3[1]; + e2[2] += e3[2]; + + H[0][0] += e[1]*e[1] + e[2]*e[2]; + H[0][1] -= e[0]*e[1]; + H[0][2] -= e[0]*e[2]; + H[1][0] = H[0][1]; + H[1][1] += e[0]*e[0] + e[2]*e[2]; + H[1][2] -= e[1]*e[2]; + H[2][0] = H[0][2]; + H[2][1] = H[1][2]; + H[2][2] += e[0]*e[0] + e[1]*e[1]; + + c[0] += e[1]*e3[2] - e[2]*e3[1]; + c[1] += e[2]*e3[0] - e[0]*e3[2]; + c[2] += e[0]*e3[1] - e[1]*e3[0]; +} + +static gdouble boundary_cost (GtsEdge * edge, + GtsFace * f, + GtsVertex * v) +{ + GtsTriangle * t = GTS_TRIANGLE (f); + GtsEdge * edge2; + GtsVertex * v1 = GTS_SEGMENT (edge)->v1, * v2 = GTS_SEGMENT (edge)->v2; + GtsPoint * p1, * p2; + GtsVector e; + GtsPoint * p = GTS_POINT (v); + + /* find orientation of segment */ + edge2 = edge == t->e1 ? t->e2 : edge == t->e2 ? t->e3 : t->e1; + if (v2 != GTS_SEGMENT (edge2)->v1 && v2 != GTS_SEGMENT (edge2)->v2) { + v2 = v1; v1 = GTS_SEGMENT (edge)->v2; + } + p1 = GTS_POINT (v1); + p2 = GTS_POINT (v2); + + e[0] = (p2->y - p1->y)*(p->z - p2->z) - (p2->z - p1->z)*(p->y - p2->y); + e[1] = (p2->z - p1->z)*(p->x - p2->x) - (p2->x - p1->x)*(p->z - p2->z); + e[2] = (p2->x - p1->x)*(p->y - p2->y) - (p2->y - p1->y)*(p->x - p2->x); + + return e[0]*e[0] + e[1]*e[1] + e[2]*e[2]; +} + +static gdouble edge_boundary_cost (GtsEdge * e, GtsVertex * v) +{ + gdouble cost = 0.; + GSList * i; + + i = GTS_SEGMENT (e)->v1->segments; + while (i) { + GtsFace * f; + if (GTS_IS_EDGE (i->data) && + (f = gts_edge_is_boundary (i->data, NULL))) + cost += boundary_cost (i->data, f, v); + i = i->next; + } + i = GTS_SEGMENT (e)->v2->segments; + while (i) { + GtsFace * f; + if (i->data != e && + GTS_IS_EDGE (i->data) && + (f = gts_edge_is_boundary (i->data, NULL))) + cost += boundary_cost (i->data, f, v); + i = i->next; + } + + return cost/4.; +} + +static gdouble edge_volume_cost (GtsEdge * e, GtsVertex * v) +{ + GSList * i, * triangles; + gdouble n1, n2, n3, nt; + gdouble cost = 0.0, a; + + triangles = gts_vertex_triangles (GTS_SEGMENT (e)->v1, NULL); + triangles = gts_vertex_triangles (GTS_SEGMENT (e)->v2, triangles); + + i = triangles; + while (i) { + if (GTS_IS_FACE (i->data)) { + triangle_normal (i->data, &n1, &n2, &n3, &nt); + a = GTS_POINT (v)->x*n1 + + GTS_POINT (v)->y*n2 + + GTS_POINT (v)->z*n3 - nt; + cost += a*a; + } + i = i->next; + } + g_slist_free (triangles); + + return cost/36.; +} + +static gdouble edge_shape_cost (GtsEdge * e, GtsVertex * v) +{ + GSList * list, * i; + GtsVertex + * v1 = GTS_SEGMENT (e)->v1, + * v2 = GTS_SEGMENT (e)->v2; + gdouble cost = 0.; + + list = gts_vertex_neighbors (v1, NULL, NULL); + list = gts_vertex_neighbors (v2, list, NULL); + i = list; + while (i) { + GtsPoint * p = i->data; + if (p != GTS_POINT (v1) && p != GTS_POINT (v2)) + cost += gts_point_distance2 (p, GTS_POINT (v)); + i = i->next; + } + g_slist_free (list); + + return cost; +} + +/** + * gts_volume_optimized_vertex: + * @edge: a #GtsEdge. + * @klass: a #GtsVertexClass to be used for the new vertex. + * @params: a #GtsVolumeOptimizedParms. + * + * Returns: a #GtsVertex which can be used to replace @edge for an + * edge collapse operation. The position of the vertex is optimized in + * order to minimize the changes in area and volume for the surface + * using @edge. The volume enclosed by the surface is locally + * preserved. For more details see "Fast and memory efficient + * polygonal simplification" (1998) and "Evaluation of memoryless + * simplification" (1999) by Lindstrom and Turk. + */ +GtsVertex * gts_volume_optimized_vertex (GtsEdge * edge, + GtsVertexClass * klass, + GtsVolumeOptimizedParams * params) +{ + GSList * triangles, * i; + gdouble sn1 = 0., sn2 = 0., sn3 = 0.; + gdouble sn11 = 0., sn22 = 0., sn33 = 0.; + gdouble sn12 = 0., sn13 = 0., sn23 = 0.; + gdouble st = 0., stn1 = 0., stn2 = 0., stn3 = 0.; + gdouble n1, n2, n3, nt; + GtsMatrix * A, * Ai; + GtsVector A1, b; + GtsVector e1 = {0., 0., 0.}, e2 = {0., 0., 0.}; + GtsMatrix * Hb; + GtsVector cb = {0., 0., 0.}; + GtsVertex * v; + GtsVertex * v1, * v2; + guint n = 0, nb = 0; +#ifdef DEBUG_VOPT + guint nold = 0; +#endif + + g_return_val_if_fail (edge != NULL, NULL); + g_return_val_if_fail (klass != NULL, NULL); + g_return_val_if_fail (params != NULL, NULL); + + A = gts_matrix_zero (NULL); + Hb = gts_matrix_zero (NULL); + v1 = GTS_SEGMENT (edge)->v1; + v2 = GTS_SEGMENT (edge)->v2; + + /* boundary preservation */ + i = v1->segments; + while (i) { + GtsEdge * edge1 = i->data; + GtsFace * f; + if (GTS_IS_EDGE (edge1) && + (f = gts_edge_is_boundary (edge1, NULL))) { + boundary_preservation (edge1, f, e1, e2, Hb, cb); + nb++; + } + i = i->next; + } + i = v2->segments; + while (i) { + GtsEdge * edge1 = i->data; + GtsFace * f; + if (edge1 != edge && + GTS_IS_EDGE (edge1) && + (f = gts_edge_is_boundary (edge1, NULL))) { + boundary_preservation (edge1, f, e1, e2, Hb, cb); + nb++; + } + i = i->next; + } + if (nb > 0) { + GtsMatrix * H = gts_matrix_new ( + e1[2]*e1[2] + e1[1]*e1[1], - e1[0]*e1[1], - e1[0]*e1[2], 0., + - e1[0]*e1[1], e1[2]*e1[2] + e1[0]*e1[0], - e1[1]*e1[2], 0., + - e1[0]*e1[2], - e1[1]*e1[2], e1[1]*e1[1] + e1[0]*e1[0], 0., + 0., 0., 0., 0.); + GtsVector c; + + c[0] = e1[1]*e2[2] - e1[2]*e2[1]; + c[1] = e1[2]*e2[0] - e1[0]*e2[2]; + c[2] = e1[0]*e2[1] - e1[1]*e2[0]; + n = gts_matrix_quadratic_optimization (A, b, n, H, c); + gts_matrix_destroy (H); + } + + g_assert (n <= 2); + +#ifdef DEBUG_VOPT + if (n != nold) { + fprintf (stderr, "--- boundary preservation ---\n"); + gts_matrix_print (A, stderr); + gts_vector_print (b, stderr); + nold = n; + } +#endif + + /* volume preservation */ + triangles = gts_vertex_triangles (v1, NULL); + triangles = gts_vertex_triangles (v2, triangles); + + i = triangles; + while (i) { + if (GTS_IS_FACE (i->data)) { + triangle_normal (i->data, &n1, &n2, &n3, &nt); + sn1 += n1; sn2 += n2; sn3 += n3; + sn11 += n1*n1; sn22 += n2*n2; sn33 += n3*n3; + sn12 += n1*n2; sn13 += n1*n3; sn23 += n2*n3; + st += nt; stn1 += nt*n1; stn2 += nt*n2; stn3 += nt*n3; + } + i = i->next; + } + g_slist_free (triangles); + + A1[0] = sn1; A1[1] = sn2; A1[2] = sn3; + n = gts_matrix_compatible_row (A, b, n, A1, st); + +#ifdef DEBUG_VOPT + if (n != nold) { + fprintf (stderr, "--- volume preservation ---\n"); + gts_matrix_print (A, stderr); + gts_vector_print (b, stderr); + nold = n; + } +#endif + +#if 1 /* Weighted average of volume and boundary optimization */ + if (n < 3) { + /* volume optimization and boundary optimization */ + GtsMatrix * H = gts_matrix_new (sn11, sn12, sn13, 0., + sn12, sn22, sn23, 0., + sn13, sn23, sn33, 0., + 0., 0., 0., 0.); + GtsVector c; + gdouble le = 9.*params->boundary_weight* + gts_point_distance2 (GTS_POINT (v1), + GTS_POINT (v2)); + guint i, j; + + c[0] = - stn1; c[1] = - stn2; c[2] = - stn3; + if (nb > 0) + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) + H[i][j] = params->volume_weight*H[i][j] + le*Hb[i][j]; + c[i] = params->volume_weight*c[i] + le*cb[i]; + } + n = gts_matrix_quadratic_optimization (A, b, n, H, c); + gts_matrix_destroy (H); + } + +#ifdef DEBUG_VOPT + if (n != nold) { + fprintf (stderr, "--- volume and boundary optimization ---\n"); + gts_matrix_print (A, stderr); + gts_vector_print (b, stderr); + nold = n; + } +#endif + + if (n < 3) { + /* triangle shape optimization */ + gdouble nv = 0.0; + GtsMatrix * H; + GtsVector c = {0., 0., 0.}; + GSList * list, * i; + + list = gts_vertex_neighbors (v1, NULL, NULL); + list = gts_vertex_neighbors (v2, list, NULL); + + i = list; + while (i) { + GtsPoint * p1 = i->data; + if (p1 != GTS_POINT (v1) && p1 != GTS_POINT (v2)) { + nv += 1.0; + c[0] -= p1->x; + c[1] -= p1->y; + c[2] -= p1->z; + } + i = i->next; + } + g_slist_free (list); + + H = gts_matrix_new (nv, 0., 0., 0., + 0., nv, 0., 0., + 0., 0., nv, 0., + 0., 0., 0., 0.); + n = gts_matrix_quadratic_optimization (A, b, n, H, c); + gts_matrix_destroy (H); + } + +#ifdef DEBUG_VOPT + if (n != nold) { + fprintf (stderr, "--- triangle shape optimization ---\n"); + gts_matrix_print (A, stderr); + gts_vector_print (b, stderr); + nold = n; + } +#endif +#else /* Weighted average of volume, boundary and shape optimization */ + if (n < 3) { + /* volume optimization, boundary and shape optimization */ + GtsMatrix * H; + GtsVector c; + gdouble l2 = gts_point_distance2 (GTS_POINT (v1), + GTS_POINT (v2)); + gdouble wv = params->volume_weight/32.; + gdouble wb = params->boundary_weight/4.*l2; + gdouble ws = params->shape_weight*l2*l2; + + gdouble nv = 0.0; + GtsVector cs = {0., 0., 0.}; + GSList * list, * i; + + list = gts_vertex_neighbors (v1, NULL, NULL); + list = gts_vertex_neighbors (v2, list, NULL); + + i = list; + while (i) { + GtsPoint * p1 = i->data; + if (p1 != GTS_POINT (v1) && p1 != GTS_POINT (v2)) { + nv += 1.0; + cs[0] -= p1->x; + cs[1] -= p1->y; + cs[2] -= p1->z; + } + i = i->next; + } + g_slist_free (list); + + H = gts_matrix_new (wv*sn11 + wb*Hb[0][0] + ws*nv, + wv*sn12 + wb*Hb[0][1], + wv*sn13 + wb*Hb[0][2], + wv*sn12 + wb*Hb[1][0], + wv*sn22 + wb*Hb[1][1] + ws*nv, + wv*sn23 + wb*Hb[1][2], + wv*sn13 + wb*Hb[2][0], + wv*sn23 + wb*Hb[2][1], + wv*sn33 + wb*Hb[2][2] + ws*nv); + + c[0] = - wv*stn1 + wb*cb[0] + ws*cs[0]; + c[1] = - wv*stn2 + wb*cb[1] + ws*cs[1]; + c[2] = - wv*stn3 + wb*cb[2] + ws*cs[2]; + + n = gts_matrix_quadratic_optimization (A, b, n, H, c); + gts_matrix_destroy (H); + } + +#ifdef DEBUG_VOPT + if (n != nold) { + fprintf (stderr, "--- volume, boundary and shape optimization ---\n"); + gts_matrix_print (A, stderr); + gts_vector_print (b, stderr); + nold = n; + } +#endif +#endif /* Weighted average of volume, boundary and shape optimization */ + + g_assert (n == 3); + g_assert ((Ai = gts_matrix3_inverse (A))); + + v = gts_vertex_new (klass, + Ai[0][0]*b[0] + Ai[0][1]*b[1] + Ai[0][2]*b[2], + Ai[1][0]*b[0] + Ai[1][1]*b[1] + Ai[1][2]*b[2], + Ai[2][0]*b[0] + Ai[2][1]*b[1] + Ai[2][2]*b[2]); + + gts_matrix_destroy (A); + gts_matrix_destroy (Ai); + gts_matrix_destroy (Hb); + + return v; +} + +/** + * gts_volume_optimized_cost: + * @e: a #GtsEdge. + * @params: a #GtsVolumeOptimizedParams. + * + * Returns: the cost for the collapse of @e as minimized by the function + * gts_volume_optimized_vertex(). + */ +gdouble gts_volume_optimized_cost (GtsEdge * e, + GtsVolumeOptimizedParams * params) +{ + GtsVertex * v; + gdouble cost; + gdouble length2; + + g_return_val_if_fail (e != NULL, G_MAXDOUBLE); + g_return_val_if_fail (params != NULL, G_MAXDOUBLE); + + v = gts_volume_optimized_vertex (e, gts_vertex_class (), params); + + length2 = gts_point_distance2 (GTS_POINT (GTS_SEGMENT (e)->v1), + GTS_POINT (GTS_SEGMENT (e)->v2)); + cost = + params->volume_weight*edge_volume_cost (e, v) + + params->boundary_weight*length2*edge_boundary_cost (e, v) + + params->shape_weight*length2*length2*edge_shape_cost (e, v); + gts_object_destroy (GTS_OBJECT (v)); + + return cost; +} Index: tags/1.0.5/old/ChangeLog.original =================================================================== --- tags/1.0.5/old/ChangeLog.original (nonexistent) +++ tags/1.0.5/old/ChangeLog.original (revision 953) @@ -0,0 +1,17654 @@ +2011-09-18 DJ Delorie * dj AT delorie dot com * + + * po/POTFILES.in: Remove src/hid/common/hidgl_package_vrml_y.c from + POTFILES.in Reverts 61bd0cb1e134bbea96abd6fd2d5fb94d09c0b3c8 as this file + doesn't exist in this repository, causing a distcheck failure. + +2011-09-18 DJ Delorie * dj AT delorie dot com * + + * : Update golden files for nanometers hid_png3 was off by a pixel on a line end. I retested my UV and TT + films to verify that the nanometers conversion didn't affect line + *widths* and updated the golden file to accept this one-pixel + difference. + +2011-09-17 DJ Delorie * dj AT delorie dot com * + + * src/action.c: [windows] use unix-style path separators when + calling gnetlist + +2011-09-17 Felix Ruoff * Felix AT posaunenmission dot de * + + * : commit 70db91fc3dfb8b378962794fc8f86f71b52f7af8 Author: + Kai-Martin Knaak * kmk AT lilalaser dot de * Date: Fri Sep 16 + 01:07:32 2011 +0200 + +2011-09-16 Kai-Martin Knaak * kmk AT lilalaser dot de * + + * doc/pcb.texi: remove panner control from documentation There is no panner control in the GUI (anymore?) since at least five + years. this pathc removes its description from the texi manual. + +2011-09-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c, src/main.c: Don't adjust the Library command settings + if they are NULL, or an empty string. (The empty string part is a fixup for commit + 31df66e87a810aac852139da9119b15c47fa8c71 - this will teach me for bikeshedding) The NULL part should fix bug lp-852598 Closes-bug: lp-852598 + +2011-09-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c, src/main.c: Bikeshed commit + 11700ba8c3c951a788c8190073eb09822060dfdd I don't like magic strings, and IMO, using a blank + LibraryContentsCommand string to imply "don't use this feature" is + better than "*NONE*". + +2011-09-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Set the LC_NUMERIC locale + to "C" rather than "POSIX" This value is supported on Win32 platforms, whereas "POSIX" doesn't + appear to have any effect. This was one possible way to fix the "zoom doesn't work" bug on + Win32 for locales which use "," as the decimal separator. DJ fixed the Zoom action to be locale independent in commit + fd5399c67b988f2f7c9d1a0b4ab7c13bc2e95158, which worked around the + problem for this particular action, but I feel it would be best that + we made our locale handling consistent between Linux and Win32 as + well. Affects-bug: lp-843577 + +2011-09-08 Dima Kogan * dima AT secretsauce dot net * + + * src/djopt.c: fixed an instance of the "only-optimize-autorouted" + flag being ignored Signed-off-by: Dima Kogan * dima AT secretsauce dot net * + +2011-09-16 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/main.c: Skip the M4 library on Windows On Windows, set the LibraryContentsCommand to the magic string + "*NONE*" and check for that string while loading the libraries. + This avoids the windows pcb.exe from trying to run bash or m4 + scripts, which are normally not available, yet allows the user a way + to re-enable them if they want. + +2011-09-16 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: De-localize + zoom parsing The values used for Zoom() were being parsed with strtod(), which + switches between '.' and ',' depending on locale. Switch to + g_ascii_strtod() which always uses '.' and thus always matches our + actions. Note: I didn't change the command line parsing, because I didn't + think we should impose '.'-centric syntax on other locales. + +2011-09-16 DJ Delorie * dj AT delorie dot com * + + * lib/generic.list: Add DIL footprint names and R025. Existing tutorials say to use "DIL 16 300" for DIPs (we use "N 16 + 300") and often call for the R025 footprint, so add them as aliases + so the m4-to-newlib converter includes them. + +2011-09-16 DJ Delorie * dj AT delorie dot com * + + * lib/m4lib_to_newlib.sh: Fix m4-to-newlib converter filenames The m4 library uses macros and parameters to describe footprints, + which allows for a *very* flexible footprint naming scheme. While + it is impossible for pcb to know all valid footprint values, it does + have a list of "standard" ones, and knows how to obtain those. + However, the m4 to newlib converter wasn't using the same footprint + naming convention as everyone else, so produced *.fp files that + weren't always useful. For example, there were a large number of + 300.fp files that all collided. With this fix, the footprint name matches the value in [...] in the + library window, which is what we tell people to use for the + "footprint=" attribute anyway. + +2011-09-16 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/lesstif.h: Wrap all XmStrings in gettext() + +2011-09-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * po/POTFILES.in: Add another missing source file to POTFILES.in + +2011-09-15 DJ Delorie * dj AT delorie dot com * + + * src/main.c: Add locale functions Add textdomain() and setlocale() to connect to our message catalogs. + +2011-09-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * po/POTFILES.in: Add some missing files to POTFILES.in (And sorted the file contents). Reported-by: Bert Timmerman * bert dot timmerman AT xs4all dot nl * + Affects-bug: lp-846368 + +2011-09-09 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * po/nl.po: Updated the Dutch translation. + +2011-09-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/report.c: report.c: Don't leave actions in the undo stack or + change the user's flags Some actions in ReportNetLength*() would have been lumped in with + whatever actions were next added to the undo stack. These functions + also left the user's board with a different "FOUND" flags on various + items. In the case of the "Report(AllNetLenths)" action, a very long undo + stack would be created, which is not very helpful to the user. These changes hide the internal flag changes made during the net + length calculation from the undo system. We are able to get back to the inital board state because we save + the operations caused by our initial RestConnections() on the undo + stack. After we have done our work (modifying various flags in the + process), we reset the flags again (this time bypassing the Undo + system), so the board is consistent with the ResetConnections() call + we DID save undo data for. We then Undo() these changes before we + leave the function. + +2011-09-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/report.c: report.c: Return 1 for all failure conditions in + ReportNetLengthByName() + +2011-09-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/undo.c: undo.c: Add error message where + RestoreUndoSerialNumber() will break things If operations are addded to the undo stack between a call to + IncrementUndoSerialNumber() and a subsequent call for + RestoreUndoSerialNumber(), those added operations will be placed in + the undo stack with an inconsistent serial number. The {Save,Restore}UndoSerialNumber() API is pretty fragile in this + regard, and we should avoid using it where possible. An better alternative might be to implement a + "LockUndoSerialNumber()" call which temporarily disables + IncrementUndoSerialNumber(), and a "UnlockUndoSerialNumber()" call + which re-enables its increment function. Better yet - we could make these functions nestable, so we need not + worry whether some action uses this new feature internally when we + are also using it. + +2011-09-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/undo.c: undo.c: Handle undo failures in a more sane manner Our current error-case handling can cause serial number + inconsistency when something goes wrong when performing an Undo + operation. There are also various logic flaws in our handling, as it + only catches failures where every sub-undo operation with that + serial number fails. Remove the confusing do-loop which decrements the serial number in + the failure case, and return some sensible error message instead. This patch also removes the code which looked like it was intended + to loop over the undo stack until a serial number was found to + operate on. It is advantageous for code like the DRC to be able to + add increment the undo serial number, then safely perform an Undo - + even if there were no changes logged in the undo system during the + previous serial number. Closes-bug: lp-848509 + +2011-09-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/undo.c: undo.c: Allow undo of locked objects Our internal actions can make changes to locked objects, then use + the undo mechanism to revert these changes. An example is DRC, which + changes flags on objects and uses the Undo system to restore their + original values. Affects-bug: lp-848509 + +2011-09-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c: find.c: Remove stray RestoreUndoSerialNumber() calls These will cause havoc with the undo system, as we don't actually + save a serial number to restore to. Until a commit efd212c1deb264e9a7f2be17e9338fbb60e22cc0 we were + saving a serial number at the start of each "ResetConnections + (true);" call, and it would have been that serial number which got + restored. With this and some other fixes to the undo system, these restores + are no longer required. Affects-bug: lp-848509 + +2011-09-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: gtk: Fix ghid_zoom_view_fit() to work + when the board is flipped. Affects-bug: lp-850311 + +2011-09-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c, src/hid/gtk/gtkhid-gl.c: Fixup OpenGL + includes for better compatibility with OSX Not tested ;) + +2011-09-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * autogen.sh, configure.ac, m4/ax_check_gl.m4, m4/ax_check_glu.m4, + m4/ax_lang_compiler_ms.m4, m4/ax_pthread.m4: Better autoconf tests + for GL and GLU (from GtkGLExt - GPL v2 or later) These tests should give better cross platform support for our build. + +2011-09-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * .gitignore, m4/.gitignore: Remove the m4 directory from the root + .gitignore file and add its own + +2011-09-13 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/styles.c: [lesstif] set units for styles dialog in + more places The styles dialog was segfaulting as the units hadn't been set yet, + if you open the style dialog before doing anything with the grid. + +2011-09-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: hid/gtk: Remove misplaced (and redundant) + hidgl_flush_triangles() call. If we were to flush the triangle buffer in ghid_show_crosshair(), we + should do it before we set XOR mode on the GL context (assuming the + buffer might be dirty when we are called), and we should do it after + we finish drawing (if we wish to leave the buffer clean when we + return). The location the flush was in before this commit is just plain + wrong. As we currently have flushes of the triangle buffer wrapping the + call to ghid_show_crosshair(), just leave the flushing out of this + function. Does this commit message provide an adequate example of simple + patch, complex commit message phenomenon? + +2011-09-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui.h: hid/gtk: Remove + auto-pan feature (kill it with fire). This seems to be fairly universally unpopular on geda-user, and its + implementation is a little fragile, often leading the board to pan + off to some corner of the board as the poor user reaches for the + layer selector or a menu without having remembered to click the + feature off. The fact that the pan direction and speed was set the instant you + leave the drawing window also made it particularly unhelpful. A + proper implementation should have grabbed the mouse - or at least + implemented some buffer zone in which the mouse could be used to + give feedback on the pan direction. + +2011-09-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c: [windows] set GDK_PIXBUF_MODULE_FILE If we're using a local gdk-pixbuf installation, we need to set this + env variable to point to it. + +2011-09-11 Bdale Garbee * bdale AT gag dot com * + + * doc/Makefile.am: Invoke eps2png in $(srcdir), no . + +2011-09-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c: hid/common: Remove #include "draw.h" from + hidgl.c (twice!) + +2011-09-11 Dima Kogan * dima AT secretsauce dot net * + + * src/hid/gtk/ghid-route-style-selector.c, + src/hid/gtk/ghid-route-style-selector.h, src/hid/gtk/gtkhid-main.c: + Re-ordered all references in the style selector dialog to have one + consistent ordering. Everything that refers to the settings in the style selector dialog + now does so in order of Line thickness Hole size Hole thickness (hole + annular ring) + keepaway region size This wasn't 100% consistent previously, which resulted in a bug + (fixed in a previous patch). This patch doesn't touch the + functionality, but improves the style to avoid future bugs. Modified to apply on recent route style selector changes by Bert + Timmerman. Signed-off-by: Andrew Poelstra (local) * apoelstra AT wpsoftware + dot net * Affects-bug: lp-844635 + +2011-09-11 Dima Kogan * dima AT secretsauce dot net * + + * src/hid/gtk/ghid-route-style-selector.c: Swap via-hole and -ring + size connection in route style selector dialog Closes-bug: lp-844635 Signed-off-by: Andrew Poelstra (local) * apoelstra AT wpsoftware + dot net * + +2011-09-10 Andrew Poelstra (local) * apoelstra AT wpsoftware dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: Repopulate route style selector on PCBChanged + action When loading a new pcb, Bad Things happen to the route style + selector because pcb's route style data is freed. This patch removes + all styles from the route style selector and re-adds them whenever a + new pcb is loaded. + +2011-09-10 Andrew Poelstra (local) * apoelstra AT wpsoftware dot net * + + * src/hid/gtk/ghid-route-style-selector.c, + src/hid/gtk/ghid-route-style-selector.h: Add + ghid_route_style_selector_empty to GHidRouteStyleSelector + +2011-09-10 Andrew Poelstra (local) * apoelstra AT wpsoftware dot net * + + * src/hid/gtk/ghid-route-style-selector.c: Add finalize function to + GHidRouteStyleSelector + +2011-09-09 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * po/POTFILES.in: Remove the src/hid/gtk/gui-dialog-size.c entry + from the translatable files list. This is a completion of commit: + a914d5ba58104d8559395b66798b35761afb991a "Replace old route style + selector with GHidRouteStyleSelector" dated 20110903 11:09 PM + +2011-09-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/ghid-layer-selector.c: hid/gtk: Filter out double + clicks on the layer selector widget This makes things behave a little nicer if you click to toggle a + layer's visibility twice in quick succession. Previously, this would + be interpreted as a double-click, causing an extra synthetic click + event which would toggle the visibility an extra time. + +2011-09-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Update file-changed + notification bar to match gedit a bit more 1. Add a stock "refresh" image to the "Reload" button. 2. Change the message text when the board has modifications. 3. Reload without further prompting if the user presses "Reload", even if the board is modified. (We already warned them due to + 2.) + +2011-09-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: hid/gtk: Reimplement file-change monitor without + GFileMonitor I must have had a brain-fail when I hooked up setting up the + file-changed monitor in the function which sets the window title. + NB: That also gets called after every menu operation! A better place to hook up the monitor would be + ghid_sync_with_new_layout(), however changing this alone revealed + another issue - we would get notified for changes WE make to the + files. We were avoiding those events as the file-monitor was being + reset before it could pop up, at the end of the menu action which + invoked the save). However - due to a race condition bug in GLib / GIO, we would + sometimes see change notify events for changes we made, even when we + hooked up the GFileMonitor AFTER having saved (and synced) our + changes to disk. Rather than attempt to work around this bug, implement the + file-change notification in a much more simple way - look at the + file mtime when we update the layout, and at each time the mouse + pointer enters the main window. FWIW, this is how gedit currently + achieves the same feature. + +2011-09-06 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Warn user if footprints can't be found on import Since the message log doesn't make it obvious, add a pop-up dialog + whenever there are missing footprints during an import. Affects-bug: lp-828388 + +2011-09-06 DJ Delorie * dj AT delorie dot com * + + * src/search.c: Fix math error in IsPointOnLine() The math in C didn't match the math in the comment (and, apparently, + hasn't for quite some time). To test: Draw three lines, from 1000,3000 to 1500,2500, then to + 2000,3000, then back to the start at 1000,3000. Without this patch, + the first and last lines are removed and replaced with a copy of the + second line. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/file.c, src/file.h, src/hid/common/actions.c: + Implement a new RevertPCB() call, sharing code with LoadPCB() The RevertPCB() takes no filename parameter, and aside from that, + the only difference to LoadPCB is that when it calls the GUI's + "PCBChanged" action, it passes a new "revert" argument. This should + let the GUIs optionally do less work resetting the view state for a + board being reverted. + +2011-09-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/command.c, src/hid.h: Add a HID API call, + notify_pcb_filename_change() This is so the core can tell the GUI when the PCB being edited is + saved into a different file. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c, src/hid.h: Add a HID API call, notify_save_pcb() + called around saving the PCB The intention of this API is so that GUIs monitoring the active PCB + file on disk for changes, can filter out changes which occur as we + save the file ourselves. + +2011-09-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/command.c, src/file.c: file.c: Don't set the PCB + filename or changed flags inside SavePCB (Filename) Save this for the caller to do. (action.c already set the filename + for the SaveAs case anyway). + +2011-09-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: Revert "hid/gtk: Avoid the deprecated + gdk_drawable_get_display()" This reverts commit c6d6ca16e58b5c7f2248c21e3248825f54e52374. Turns out the replacement API I used was only introduced in GTK + 2.24, which is still a little new for us here. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui-utils.c: hid/gtk: + Remove usage of deprecated gtk_range_set_update_policy() We only set this to the default value anyway, and the API has been + removed with no replacements. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui-utils.c: hid/gtk: + Replace gtk_container_border_width with + gtk_container_set_border_width Replaces the old deprecated API. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-utils.c: hid/gtk: Use g_signal_connect(), not + gtk_signal_connect() gtk_signal_connect() is deprecated. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-dialog-print.c: hid/gtk: Re-write the tool-tip + handling code to use newer tooltip API Use the gtk_widget_set_tooltip* API introduced in GTK 2.12. This + avoids the APIs deprecated in GTK 2.12, and also avoids the + requirement to pack GTK_WIDGET_NO_WINDOW widgets inside + gtk_event_box() widgets to make their tooltips work. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-drc-window.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-netlist-window.c, + src/hid/gtk/gui-pinout-window.c, src/hid/gtk/gui-top-window.c: + hid/gtk: Replace usage of the deprecated gtk_widget_set_uposition() + call The closest replacement is gtk_window_move(), and looking at the GTK + sources, appears to be what gtk_widget_set_uposition() calls + internally. We are still rather at the mercy of the user's window manager as to + whether it will honour the request we make, and arguably we ought to + remove this (mis-)feature anyway. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-dialog.c: hid/gtk: Replace deprecated function + call gtk_box_pack_start_defaults() + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Avoid the deprecated + gdk_drawable_get_display() Grab the active display using gdk_window_get_display() on the window + belonging to the drawing area. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Use the g_timeout_add() + function, not the deprecated GTK one. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/ghid-main-menu.c: hid/gtk: Fix not accessing + GtkMenuShell's children harder I missed a critical part of the fix from commit + 3584101f67f6ca2f0a252c312cb0c6c9c4fa016f + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-pinout-preview.c: hid/gtk: Replace + GTK_WIDGET_REALIZED() test with a check for window != NULL This avoids the use of the deprecated GTK_WIDGET_REALIZED macro, + without needing to use the GTK2.20 function + gtk_widget_get_realized(). The check for a NULL window should be + sufficient here I hope. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-command-window.c: hid/gtk: Use gtk_bin_get_child() + accessor In GTK3.0, direct access to bin->child will be impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-config.c: hid/gtk: Use gtk_notebook_get_n_pages() + rather than diving in and counting In GTK3.0, direct access to notebook->children will be impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/ghid-main-menu.c: hid/gtk: Don't access a + GtkMenuShell's children directly In GTK3.0, direct access to shell->children will be impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/ghid-main-menu.c: hid/gtk: Free list returned from + gtk_container_get_children() We can (and should) g_list_free() the list of children returned when + we are finished with it. Whilst we are at it, convert the while loop to a for loop and use a + tighter condition on the loop termination test. The existing test + worked, but would leave a negative number in the object counter we + test against. This would not work if the object counters were ever + unsigned integers (as they might plausibly be). + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/ghid-route-style-selector.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui-dialog.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-utils.c: hid/gtk: Use accessors to get the vbox from + GtkDialog In GTK3.0, direct access to dialog->vbox will be impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Use accessor functions + for handling GtkAdjustments In GTK3.0, direct access to these member variables will be + impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c: hid/gtk: + Don't use GTK_WIDGET_SET_FLAGS() Call the appropriate setter function instead. (For GTK3.0 + compatibility). + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-library-window.c: hid/gtk: Don't test for NOOP + before calling gtk_widget_set_sensitive() We were using a deprecated test macro anyway, GTK already does a + NOOP test inside gtk_widget_set_sensitive(). + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h: hid/gtk: Remove unused + function ghid_button_set_text() + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h: hid/gtk: Remove unused + function ghid_button_active() + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui-drc-window.c: hid/gtk: + Use gtk_widget_get_style() accessor, rather than direct access In GTK3.0, direct access to widget->style will be impossible. Swap out the GTK_WIDGET_STATE() macro for gtk_widget_get_state(), + which does not directly access the GSeal'd member widget->state. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-pinout-preview.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui-utils.c: hid/gtk: Use gtk_widget_get_window() + accessor In GTK3.0, direct access to widget->window will be impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c, src/hid/gtk/gui-drc-window.c, + src/hid/gtk/gui-keyref-window.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-netlist-window.c, + src/hid/gtk/gui-top-window.c: hid/gtk: Use + gtk_widget_get_allocation() accessor In GTK3.0, direct access to widget->allocation will be impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c: hid/gtk: Use + gtk_widget_get_allocation() not gdk_window_get_geometry() This avoids an unnecessary round-trip the the X server on X11 + platforms. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Avoid warning caused by early + drawing before gport->pixmap is set Avoids a command line warning: (pcb:28876): Gdk-CRITICAL **: IA__gdk_draw_drawable: assertion + `GDK_IS_DRAWABLE (src)' failed With the GDK renderer in use. This trigger appears to be some state changes triggered as the new + layer selector widget initialises. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-misc.c: hid/gtk: Clean and make + gport_set_cursor_type() more GTK3.0 compatible Also removes the DEFAULT_CURSOR return value (for the case of no + window being setup) to GDK_X_CURSOR (the 0 enum value), as the code + path which returned DEFAULT_CURSOR would never have been hit. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/ghid-cell-renderer-visibility.c: hid/gtk: Use + gtk_cell_renderer_get_{align,pad} accessors In GTK3.0, direct access to these fields will be impossible. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Avoid double-destroying the + file-changed info_bar on "Reload" This was caused by an addition I made in the earlier patch to + destroy the info_bar when the user manually reverts or loads a new + file). The callback on revert button was trying to delete it (again) after + the revert _action_ we call triggered a destroy of the widget. Avoid + this by destroying the info_bar before we call the revert action. + +2011-09-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: gtk: use + gtk_action_block_activate() in layer selector The GHidLayerSelector widget now uses gtk_action_block_activate() + instead of storing/blocking signal IDs. This is the proper way to + suppress signal emission since 2.16. This also fixes the lockup bug that was supposed to be fixed by the + recent commit 8857757, but still occured when using the menus to + toggle layers. + +2011-09-05 DJ Delorie * dj AT delorie dot com * + + * src/const.h, src/draw.c, src/misc.c, src/print.c, src/report.c: + Fix text scaling exceeding Coord max. The old way of scaling text was to multiply by scale/100 but this + could easily overflow on reasonably sized boards with a 32-bit Coord + type. The new code scales by (double)scale/100.0 instead. Since we + don't store scaled values in the PCB file, a loss of precision won't + matter, but a double has 53 bits of precision - in nanometers, + that's a board about the size of North America. Closes-bug: lp-832451 + +2011-09-05 DJ Delorie * dj AT delorie dot com * + + * configure.ac, globalconst.h, src/global.h: Add configure selection + of 32/64 Coord type --enable-coord64 Force 64-bit coordinate types --enable-coord32 Force 32-bit coordinate types Defaults to "long" as before, but if you give one of the above, the + type changes to a suitable 32-bit or 64-bit type. Note that this is + only guaranteed to be the size you choose if you have + which most OSs provide, else the "int" and "long long" types are + used instead. + +2011-09-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: gtk: Fix "clicking on layer + selector separator bug" If you click on the selector between real and virtual layers in the + pcb layer selector, it will toggle the first layer. This patch + simply ignores the click. + +2011-09-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c, src/hid/gtk/gui-top-window.c: + gtk: fix behavior when hiding the last visible layer When you try to toggle the last layer invisible, pcb should refuse + to let you do so, since something has to be selected, and we don't + allow selection of invisible layers. What actually happens is that pcb locks up. This patch fixes that. + +2011-09-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: gtk: Force silk and rat layers + visible when they are selected. + +2011-09-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-route-style-selector.c, + src/hid/gtk/ghid-route-style-selector.h, src/hid/gtk/gtkhid-main.c: + Implement RouteStylesChanged action This action looks at the actual route-style settings (i.e., + Settings.LineThickness), and gives these to the route style + selector. The selector looks in its list and selects a style, if one + matches. Otherwise, it does nothing. + +2011-09-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-route-style-selector.c, + src/hid/gtk/ghid-route-style-selector.h, + src/hid/gtk/gui-command-window.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: Add Ctrl+F1,F2,F3,... accelerators to route style + selector Since we now have three accelerator groups to worry about (those of + the layer selector, route style selector and main menu), I have + moved the hooking/unhooking code into two functions: ghid_install_accel_groups () ghid_remove_accel_groups () These should be used whenever accelerators need to be disabled, for + example, when the user has the command box active. + +2011-09-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: Remove the last + of ghidgui->toggle_holdoff + +2011-09-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-dialog-size.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: Replace old route style selector with + GHidRouteStyleSelector TODO: The RouteStylesChanged action is now very broken. Menu accelerators need to be installed + +2011-09-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-main-menu.c, src/hid/gtk/ghid-main-menu.h: + Introduce functions for GHidRouteStyleSelector handling to menu + +2011-09-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/ghid-route-style-selector.c, + src/hid/gtk/ghid-route-style-selector.h: Introduce + GHidRouteStyleSelector widget, don't use it yet + +2011-09-04 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Add file + change notification for the currently open PCB If the file is modified on disk, a bar appears at the top of the PCB + area offering the user a choice as to whether they wish to reload + the board or cancel (do nothing). If the user has changes, and hits reload - they are prompted as to + whether they wish to throw away their changes. Requires GTK 2.18 or higher due to use of the GtkInfoBar widget. + +2011-09-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac: Require GTK 2.18 or later for the GTK HID. This is for some new widgets, like the GtkInfoBar. + +2011-09-04 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Fix + styling of menubar area so it is consistent across its width This relies on some nasty tricks copying GtkStyle's between the + menubar widget and a new GtkEventBox widget we pack the top bar in + to give us a background to paint on. We also adjust the styles of + the coordinate read- out labels and frames to ensure they are + legible. There may still be some inconsistencies, as the coordinate selector + button is themed as if it were a toolbar button, hence the + colourings used may be designed to work with a different background + colour than we have. + +2011-09-04 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Create a + GtkToolbar of mode buttons for compact vertical mode Rather than packing our mode buttons into an hbox, use a proper + GtkToolbar so theming will match the rest of the user's desktop. This simplifies code to switch compact mode on and off, as we have + two distinct widgets to show / hide, rather than having to reparent + the mode buttons each time. It does, however mean we have to be careful not to double-trigger + events when keeping the two sets of mode buttons in sync with each + other, so that isn't ideal. In the longer term, we probably ought to split out the mode button + area on the left-hand toolbar as a separate self-contained widget. + +2011-09-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-cell-renderer-visibility.c: gtk: Prelight toggle + swatches in layer selector This brightens the layer visibility swatches subtly when the mouse + hovers over them. IMHO this improves the discoverability of the + widget without being distracting or misleading. + +2011-09-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: gtk: Don't gray out invisible + layers' text in the selector + +2011-09-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: gtk: toggle non-activatable + layers on click, without checking for swatch + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: hid/gtk: Remove compact_vbox and compact_hbox + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: hid/gtk: Always show the PCB name on the + title-bar, not the toolbar This saves space and reduces code complexity + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Don't + use a GtkEventBox as a container widget We weren't making use of the events from the event box, and appeared + just to be using it as a convenient container to allow setting the + sensitivity on our entire left hand toolbar at once. Scrap the event box widget and just store a pointer to the vbox + widget which the left toobar items are packed into. We can set the + sensitivity on this and get the desired effect. + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-pinout-window.c, src/hid/gtk/gui-top-window.c: + hid/gtk: Don't pack the drawing area in a GtkViewport widget (For both the main window and the pinout preview). The GtkViewport + widget is designed to add scroll bars to a widget which doesn't have + native scroll capabilities. We are handling out own scroll-bars, so + the only gain we had from the GtkViewport we added was a shadow + around the widget. If we decide we want the shadow back, a more appropriate widget to + pack the drawing area with might be a GtkFrame. + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Remove the vbox used to + pack ghidgui->compact_hbox The main effect here is that the contents of the compact_hbox will + get more vertical space assigned to them if the menu bar section is + taller than the natural size of those widgets. The visual change seems acceptable, and we could use every bit of + code-cleanup in ghid_build_pcb_top_window() + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Remove some more temporary + variable assignments These make the code harder to follow, as the same temporary variable + is used again and again to refer to different widgets. + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Don't + use an hbox to pack the board name label The hbox only has one child, so use the name label directly. + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Skip the generic "hbox" + variable when storing the widget anyway For widgets we keep references to in the ghidgui structure, we avoid + confusion by assigning directly to the more descriptive ghidgui + variable. + +2011-09-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Don't pack a frame around + the menu bar + +2011-09-02 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-dialog-size.c, src/misc.c, src/misc.h: Move + make_route_string() from gtk into misc.c + +2011-09-02 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/mymem.c, src/mymem.h: Const-correct StripWhiteSpaceAndDup in + mymem.c + +2011-09-01 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Attempt to fix logic to flip + component / solder group visibility on flip Should get back to better behaviour. I probably broke this somewhat + with commit f903b4be6b85efc110852f7be40edf8245f0a513, which + attempted to re-state the previous logic in a clearer fashon. The logic now should: If flipping sides, and only ONE of the solder / component layers + (groups) is visible, and that layer (group) is _active_, then swap + the visibilities of the component / solder layers (groups), and make + the newly visible layer (group) active. There are still bugs in this code relating to the assumption that + the first entry in the layer group is the one which is being + toggled. This breaks if the first entry in the group is that + corresponding to the silk for that side of the board. + +2011-08-31 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: gtk: fix typo preventing layer + selector menu items from working + +2011-08-31 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: gtk: remove in_toggle_view + recursion-prevention flag We don't call ToggleView programmatically anywhere, so it is + impossible for there to be recursion. + +2011-08-31 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-main-menu.c: Block signals in + ghid_main_menu_update_toggle_state() The function ghid_main_menu_update_toggle_state() is supposed to + sync the menu checkboxes to the actual state of pcb, by checking the + flags given in the resource file. If this function is emitting signals and changing pcb's state, this + is a bug. Fortunately, this appears not to be the case, so the + effect of this commit is to eliminate one more use of + ghidgui->toggle_holdoff. + +2011-08-31 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: gtk: sync visiibility of layer + selector with core state in LayersChanged + +2011-08-31 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c, + src/hid/gtk/ghid-layer-selector.h: Use signal blocking for + visibility toggling in GHidLayerSelector + +2011-08-31 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-config.c: Add call to + ghid_layer_buttons_color_update() when loading new colors + +2011-08-30 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/change.c: Change change.c to treat text scale as mils + +2011-08-30 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: Configure layer selector to + only accept left-clicks Suggested by Kai-Martin Knaak, seconded by me. + +2011-08-30 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: Fix invalid free of ~/.pcb/filename + path in gui-top-window.c + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c, + src/hid/gtk/ghid-layer-selector.h: minor: fix comment and forward + declaration in ghid-layer-selector + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: Remove default layer selection + from ghid-layer-selector.c Having the layer selector select its own first layer is not needed - + pcb does this for us, after making the widget. It's not the sort of + decision a widget should be making on its own, anyway. + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: Use g_signal_handler_block + instead of flags in ghid-layer-selector.c Thanks to Peter C. for this code-cleanliness tip. Now the two + layer-selection interfaces (menu button and selector widget) set + each other's GUI state but do not raise any signals past the + original. + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: Add missing free_ldata() in + ghid-layer-selector.c + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-command-window.c: Disable layer selector's + GtkAccelGroup while in command mode + +2011-08-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Add const qualifiers to some BoxType + *drawn_area parameters + +2011-08-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c, src/misc.h: misc.c: Add const qualifier to BoxType * + parameter passed to CountHoles + +2011-08-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Fold DrawLayerCommon() into DrawLayer() Since the last commit, DrawLayer() just calls DrawLayerCommon with + the "clear_pins" argument set to true. The only other + DrawLayerCommon caller passes clear_pins as true, so having + functions is redundant. + +2011-08-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: DrawLayer(): Pass true to clear_pins of + DrawLayerCommon This should not affect any rendering. If the check planes flag is + set, we should only draw polygons, nothing more. Only a handful of + cases draw layers via this code-path, and in all but the exporter + cases, they are not called if CHECKPLANES is set. The exporters which call DrawLayer explicitly clear the CHECKPLANES + flag (since commit 3c01bd38cb59922692408b71cd5d77892dbe6ade), so + nothing should be affected by this argument change. + +2011-08-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gerber/gerber.c, src/hid/ps/eps.c, src/hid/ps/ps.c: + hid/{ps,eps,gerber}: Clear CHECKPLANESFLAG before exporting Ensure we are in a sensible view state before exporting. This update + those HIDs which cleared other similar renedering flags before + exporting to include the CHECKPLANES flag. + +2011-08-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Have DrawLayerGroup() call DrawPPV for non-gui + exporters This means DrawLayerGroup() can have a void return type as most of + the other drawing functions, and makes things a little neater. Only the GUI renderers special case the pin / pad / via to wait + until a later rendering oass than the layers they reside on. + +2011-08-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Remove unused "button" + parameter from Popup function. Remove the dead code and comments refering to the fact the + function's second argument indicates a mouse button number. + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c, + src/hid/gtk/ghid-layer-selector.h, src/hid/gtk/ghid-main-menu.c, + src/hid/gtk/ghid-main-menu.h, src/hid/gtk/gui-top-window.c: Link + GHidLayerSelector and GHidMainMenu Layer visibility-toggle and selection menu items now appear in the + main menu. Accelerators work correctly and are reassigned on + deletion/addition of layers to simulate the old behavior. + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: Clean up layer data handling in + ghid-layer-selector.c + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c: Give GHidLayerSelector an + internal layer structure Before we had various arrays to resize and index; now each row has a + structure associated with it, that is easier to access and maintain. + +2011-08-28 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-command-window.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: Replace gtk UI manager with GHidMainMenu widget This commit replaces the old UI manager with a customize gtk widget + that builds menus directly from a resource tree. This eliminates the + translate-to-XML step, the ugly hacks used to access individual + actions, and all the associated manual memory management. This will also give us the ability to have more dynamic menus, in + particular layer lists without maximum capacities. Layers and route styles are still not hooked into the menu. This + means that those accelerators DO NOT WORK. (This will be fixed in a + later commit.) Checkboxes have been replaced with radio buttons + where appropriate. There are now tearoffs on the context-menu's + submenus. Other than that, there should be no user-visible changes. ;) + +2011-08-28 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/ghid-main-menu.c, + src/hid/gtk/ghid-main-menu.h: Created ghid-main-menu.[ch] Still need to hook up layer selector and route styles. + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: Fix select-hidden-layer behavior When you select a hidden layer, it should toggle the visibility so + that the currently-selected layer is always visible. We were + toggling twice. + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/ghid-layer-selector.c, src/hid/gtk/gui-top-window.c: + Prevent recursion in layer selector events + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/ghid-coord-entry.c, + src/hid/gtk/ghid-coord-entry.h, src/hid/gtk/gtk-pcb-coord-entry.c, + src/hid/gtk/gtk-pcb-coord-entry.h, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-dialog-print.c, src/hid/gtk/gui-dialog-size.c, + src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h: Rename GtkPcbCoordEntry + to GHidCoordEntry + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/ghid-layer-selector.c, + src/hid/gtk/ghid-layer-selector.h, + src/hid/gtk/gtk-pcb-layer-selector.c, + src/hid/gtk/gtk-pcb-layer-selector.h, src/hid/gtk/gui-top-window.c: + Rename GtkPcbLayerSelector to GHidLayerSelector + +2011-08-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/ghid-cell-renderer-visibility.c, + src/hid/gtk/ghid-cell-renderer-visibility.h, + src/hid/gtk/gtk-pcb-cell-renderer-visibility.c, + src/hid/gtk/gtk-pcb-cell-renderer-visibility.h, + src/hid/gtk/gtk-pcb-layer-selector.c: Rename + GtkPcbCellRendererVisibility to GHidCellRendererVisibility + +2011-08-28 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/gpcb-menu.res.in: Add mnemonics to menus in default + gpcb-menu.res.in You can now access the main menu without a mouse, by doing Alt+F, + for example, to select the File menu. + +2011-08-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/common/hid_resource.c, src/hid/common/hid_resource.h, + src/hid/gtk/gui-top-window.c, src/res_parse.y, src/resource.h: gtk: + Const-correct add_resource_to_menu and related functions Five files have had const keywords added: ../common/hid_resource.c ../common/hid_resource.h gui-top-window.c ../../res_parse.y ../../resource.h No casts were added. No compilation warnings were added. + +2011-08-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtk-pcb-layer-selector.c: Delete GtkAction along with + layer in gtk-pcb-layer-selector.c + +2011-08-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/ps/eps.c: hid/ps/eps.c: Remove assigned by unused + lastgroup variable + +2010-10-21 Markus Hitter * mah AT jump-ing dot de * + + * src/hid/gcode/gcode.c: HID-gcode: make use of MAXPATHLEN. Affects-bug: lp-699497 + +2011-08-28 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/bom/bom.c, src/hid/gerber/gerber.c, src/main.c: Add + attributes to docu for commandline options + +2011-08-28 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi: Docu: Fix some references to command-line options and remove the documentation for a non-working X11-Interface option. + +2011-08-28 Dima Kogan * dkogan AT cds dot caltech dot edu * + + * src/find.c: Better handling of unplated vias The attached patch adds checks in the geometry intersection + functions to no longer treat unplated vias (mounting holes) as + conducting. The implementation in the patch will act as if the + unplated via doesn't intersect with metal objects at all, which is + possibly not what is desired. Should the conductivity check happen + on a higher level from the geometry intersection routines? A case + that would require this is not obvious to me. Closes-bug: lp-699499 + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gcode/gcode.c, src/hid/gerber/gerber.c, + src/hid/lpr/lpr.c, src/hid/nelma/nelma.c, src/hid/png/png.c, + src/hid/ps/ps.c: Unify HID description (no fullstop at end of + description) Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/ps/ps.c: Add docu for ps HID commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/ps/eps.c: Add docu for eps HID commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/png/png.c: Add docu for png HID commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/nelma/nelma.c: Add docu for nemla HID commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/lpr/lpr.c: Add docu for lpt HID commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gerber/gerber.c: Add docu for Gerber HID commandline + options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/bom/bom.c: Add docu for the BOM HID commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gui-top-window.c, src/hid/lesstif/main.c: Add docu for + commandline-options for GTK+ and lesstif GUI Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-18 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/main.c: Add docu for DRC commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-18 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/main.c: Add docu for general gui commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-18 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/main.c: Add docu for path commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-18 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/main.c: Add docu for commandline commands Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-18 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/main.c: Add docu for layer names commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-18 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/main.c: Add docu for size commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-18 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/main.c: Add docu for color commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-28 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi, src/main.c: Docu: Add general description for + commandline options ... and for general options. (Patch 3/19 of this patch-serie is + missing on purpose) Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-28 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi: Remove out-dated docu for commandline options Most parts of this patch-serie was written by Kai-Martin Knaak. + Adaption to actual git HEAD and some modifications by Felix Ruoff. + +2011-08-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/misc.c, src/misc.h: Move CountHoles() from draw.c + to misc.c and export it This function may be more generally useful. + +2011-08-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Move doing_assy flag assignment into + PrintAssembly() Keeps things tidier + +2011-08-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gcode/gcode.c, src/hid/nelma/nelma.c: hid/{nelma,gcode}: + Remove assigned but unused variables lastcap and lastgroup + +2011-08-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.h, src/main.c: Remove traces of LoadBackgroundImage() + from the core of PCB + +2011-08-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c: hid/gtk: Use + view_data struct to simplify saving and restoring views + +2011-08-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: + Encapsulate view parameters in a structure + +2011-08-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Remove unnecessary prototype + +2011-08-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui.h: hid/gtk: crosshair_{x,y} should be Coord, not + int. + +2011-08-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/fontmode.c: fontmode.c: Add missing #include "pcb-printf.h" + +2011-08-26 DJ Delorie * dj AT delorie dot com * + + * src/fontmode.c: Fix FontEdit() Move top/bottom meta-layers to layers 0 and 1 so they'll exist after + we trim out the layers. Set up DRC values to avoid interfereing + with the font layout. Closes-bug: lp-808591 + +2011-08-26 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: Use correct units when setting up the + Sizes dialog. Replace %mm with %mS so it auto-selects units, to match the scanning + that's done when you save the settings. + +2011-08-26 DJ Delorie * dj AT delorie dot com * + + * src/parse_l.l: Avoid segfault tmp-saving partial board. Check for both PCB and PCB->Data to avoid trying to save a backup + copy of a partially created layout. + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: gtk: Sync selection with pcb state + in ghid_layer_buttons_update It was possible for PCB's active layer to come out of sync with the + selected entry in the layer selector. This fixes that. + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtk-pcb-layer-selector.c, + src/hid/gtk/gtk-pcb-layer-selector.h, src/hid/gtk/gui-top-window.c: + Support adding/deletion of layers in GtkPcbLayerSelector If you add a layer to a GtkPcbLayerSelector, and its ID is already + in the selector, it will update the layer instead of adding a new + one. This way, we can update the layer selector by: 1. Deleting all recently-deleted and non-copper layers. 2. Re-adding all layers (including new ones) 3. Re-adding all non-copper layers (so they go to the end) The old layer selector maintained MAX_LAYER + n layers (where n was + the number of non-copper layers), and showed/hid the gui widget to + managed deletion and adding of layers. The new one has no notion of + MAX_LAYER, nor does it care whether a layer is copper or not. :) + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-drc-window.c: hid/gtk: Fix DRC preview pixmap + rendering Another hard-coded constant in the old PCB coordinate system + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Remove duplicated render pass + in ghid_pinout_preview_expose() This looks like it was a copy+paste error. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-pinout-preview.c, + src/hid/gtk/gui-pinout-preview.h: hid/gtk: Fix pinout preview + default zoom after unit conversion Apparently the scale factor equation was dependant on the old PCB + units of 100th mils to produce a sensible zoom level. Since this code is monumentally obtuse, just re-write something + completley new. The old code probably bit-rot when we split out the + rendering widget. Lets just suggest a fixed size of 100 pixels natural size for each + 150 mil of element bounding box. That seems to work nicely. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c: misc.c: Rework SetTextBoundingBox() to make it more + clear how it works. Add lots of comments, change the coding style and rename variables + to make them more obvious. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Redefine pin / pad name label text size in terms of + FONT_CAPHEIGHT This reduces the proliferation of various "magic numbers" which + combine constants from several sources and aren't appearent why they + are a particular number. There is a slight rounding error in the + converted pin label size, but it is insignificant. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * globalconst.h, src/change.c, src/report.c: Introduce global + #define for the text cap-height of the PCB font. This should save the proliferation of rather opaque + MIL_TO_COORD(45)'s in various places. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/change.c, src/draw.c, src/report.c: Fix some text scale + factors This commit fixes pin / pad name drawing, the pinout preview and two + actions which change the size of text based on user input. To recap: Text->Scale is a percentage scaling (from the font definition). The + default font has has an approximate cap-height of 45-50 mils, and + PCB assumes this to be the case. Text->Scale is not a Coord, it is an integer, so use int as the + resulting type for any calculations involving this number. (100% is + stored as 100 in Text->scale). Code which scales text based upon + other object sizes does so by dividing to a dimensionless scale + factor. We may have to be careful about the width of intermediate + results when scaling based on Coords if Coord is changed to 64bit at + some point. ChangeTextSize() and ChangeElementNameSize accept absolute (or + delta) sizes in units of distance. These are converted to a Scale by + assuming a 100% scaled font is 45mils high. YMMV. Oh - and just to note.. the line-thickness is drawn at half the + width stored in the font definition. This is clearly bonkers, but we + would break designs if we changed it now. Grr. (Thanks a bunch + commit 66592387176ba2578dfc14023a6fe49226f3a3df). + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/hid/ps/ps.c: action.c: Fix missing #include + "mirror.h" + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : hid/ps: Fix inaccurate comment and twiddle some whitespace The whitespace changes in the if statement were from an earlier + revision which actually had functional changes - but I prefer this + way, so I'm committing it anyway. Also adds some != 0 to the end of strcmp tests, as I believe this + aids clarity by reminding readers strcmp returns 0 for a match. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c: + hid/gtk: Allow zooming out past the board size (up to 1/10 viewport + size) The 1/10 viewport size should be the same as the Lesstif HID allows. + The purpose of the limit is to avoid zooming in so small the PCB is + lost as a tiny dot, and also to avoid coodinate overflows when + representing screen coordinats in PCB Coords. (Since we switched to + nanometers, this could potentially raise its head more readily until + we move to 64bit integers). The explicit pan fixup added to ghid_view_zoom_fit() is required as + pan_common() no longer clamps the view back to the origin. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui.h: hid/gtk: Remove ghid_port_ranges_pan for new + replacement ghid_pan_view_rel ghid_pan_view_rel() does less heavy lifting directly, sharing common + code with the other view altering routines for zooming and panning. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui.h: hid/gtk: Remove prototype for non-existant + ghid_port_ranges_update_ranges The functionality this prototype implies is in + ghid_port_ranges_scale(). + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Don't recompute view size in + PCB coords in ScrollAction() We aleady keep around the view size in PCB coords, so use it + directly. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Add fixup for stored + gport->pcb_{x,y} coords when changing view This updates the stored (in PCB coordinates) mouse pointer location + on the board as we perform a pan / zoom. This is mostly relevant to + panning and clipped zoom operations, as non-clipped zoom operations + aim to leave the mouse pointer at the same PCB coordinate anyway. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: polygon.c: Fix dicer to give up if the clipping + region passed is invalid. Most of the dance checking return codes from polyBoolean_free was + unnecessary, as it sets the output to NULL if there is a problem, so + remove that. Whilst we're at it, fix up some variable names to make + the operation of the function clearer. + +2011-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: polygon.c: Make RectPoly return NULL for zero or + negatively sized rectangles Previously we would hit an assertion failure, where we could + indicate the problem by returning NULL. I've hit an issue in which some expose events in the GTK (+GL) HID + are collapsing to a zero-width region on the PCB, and some code is + tripping up on the bad clip polygon produced using RectPoly on the + coordinates. This causes segfaults in the branch which contains + code to clip rendering of the soldermask at the board outline. We could (and perhaps should) test in the expose handler, but the + failure mode here is not ideal. Since most builds of PCB run with + asserts disabled, the asserts are not hit here and a bad polygon is + silently gets created with no contours. This upsets the polygon + algebra routines somewhat, but returning a NULL (empty) polygon + would be fine. + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c: gtk: + remove call to ghid_layer_buttons_color_update The call to ghid_layer_buttons_color_update() in config_read() is + now unnecessary; the Gtk layer selection widget does not exist, nor + do the PCB struct's colors need to be synced with the ones in the + Settings struct. So this call makes no sense. Oh, and it causes a segfault. Also: remove color-changing debug code from gui-top-window.c + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtk-pcb-coord-entry.c: Add doxygen comments to + gtk-pcb-coord-entry.c No code changes. + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtk-pcb-cell-renderer-visibility.c, + src/hid/gtk/gtk-pcb-layer-selector.c: Add doxygen comments to + gtk-pcb-cell-renderer-visibility.c Also fix the file description for gtk-pcb-layer-selector.c. No code + changes. + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c: Add doxygen comments to pcb-printf.c No code changes. + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/flags.c: Fix const-correctness warning in flags.c + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * globalconst.h: Make EMARK_SIZE unit-agnostic Closes-bug: lp-832455 + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: Use + GtkPcbLayerSelector in gtk GUI Closes-bug: lp-699482 + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/gtk-pcb-cell-renderer-visibility.c, + src/hid/gtk/gtk-pcb-cell-renderer-visibility.h, + src/hid/gtk/gtk-pcb-layer-selector.c, + src/hid/gtk/gtk-pcb-layer-selector.h: Introduce GtkPcbLayerSelector + widget -- not used yet This widget will replace the layer-selection buttons in the Gtk GUI, + as well as the layer selection and visibility-toggling parts of the + menu. This is to make layer manipulation more consistent and more + keyboard-accessible. In future, it would be good to update this widget with context menus + with things like "hide all but this layer". + +2011-08-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: Change Gtk layer_process() to use + colors from Settings, not PCB Now the only code that uses the colors in the PCB struct is draw.c. + Hopefully in a future commit we can remove this too and remove the + duplication of color data in the Settings and PCB structs. + +2011-08-25 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Fix File->Import for elements on back side. Mirror pasted footprints when replacing back-side elements. Also + clear element cache when reloading the new footprint, to avoid + getting a stale pointer. Closes-bug: lp-699331 + +2011-08-25 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Fix texinfo bug in report.c patch {} are special characters in texinfo + +2011-08-25 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Lesstif: force widget update on grid unit + change If the grid units change, force a redraw of the coordinates window + and allow a resize. + +2011-08-25 DJ Delorie * dj AT delorie dot com * + + * src/flags.c, src/hid/common/flags.c: Fix unitless menu flags. Numbers without units are counting numbers in flags, not cmil. + Also, cache the lookup of units in flags.c + +2011-08-24 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * src/report.c: This patch adds support for doing + Report(netlength,net_name) Affects-bug: lp-699451 Updated patch to nanometers, fixed a few minor bugs, applied. + +2011-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Don't compensate for crosshair + position when panning Perhaps this was necessary before.. it is not now, and is causing + the crosshair to be errenously offset whilst panning with the scroll + wheel. + +2011-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Simplify viewport setup in + PCBChanged() This version still works ;) + +2011-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Refactor common view clamping + code from ghid_{pan,zoom}_view_abs Inspection of the zoom-fit code which triggers if the view exceeds + the size of the board suggests that it will never be called, so + remove it. + +2011-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: A couple of NOOP + cosmetic changes to ghid_port_ranges_pan() + +2011-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c: hid/gtk: Don't + render of soldermask outside board area + +2011-08-22 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/create.c: Fix negative-angle handling in create.c This bug could be seen by taking a component with an arc (say, a + 3-pin TO transistor, with curved silk), flipping it with 'b', and + trying to move it. The arc would be inverted. + +2011-08-22 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/report.c: Fix segfault in report.c text report output + +2011-08-22 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui.h: hid/gtk: Remove emit_changed parameter from + ghid_port_ranges_scale. The one caller which passed TRUE, PCBChanged () also immediately + aftwewards calls ghid_port_ranges_pan(), which will take car of any + changes necessary. + +2011-08-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Rework view flip code + +2011-08-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui.h: hid/gtk: Rework zoom + / pan API + +2011-08-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Some NOOP and whitespace + changes to the SwapSides() function Split from of a later patch which reworks the view flipping APIs. + Hopefully this makes the function a little simpler. + +2011-08-19 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c: hid/gtk: + Convert line width to Coord units in renderer GC structs. + +2011-08-19 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c: find.c: Remove unused variables in LineLineIntersect() + +2011-08-15 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/main.c: Add --help and -? to options that will dump usage() + without loading GUI Closes-bug: lp-826931 + +2011-08-15 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/batch/batch.c: Fix compilation warnings in + hid/batch/batch.c + +2011-08-15 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtk-pcb-coord-entry.c, src/hid/gtk/gui-dialog-print.c: + Fix: spin increments not working in GtkPcbCoordEntry after unit + change + +2011-08-15 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-config.c: Parse options of type CONFIG_Coord in + preferences file + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * globalconst.h, src/const.h, src/global.h, src/main.c: *** CONVERT + PCB'S BASE UNITS TO NANOMETERS *** Convert base units to nm, change Coord from int to long, change + LARGE_VALUE from a magic number to (LONG_MAX / 2 - 1). Fixes-bug: lp-772027 + +2011-08-11 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/const.h: Make MARK_SIZE base-unit-agnostic + +2011-08-10 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtk-pcb-coord-entry.c: Implement "change unit" submenu + of GtkPcbCoordEntry context menu + +2011-08-10 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-dialog-print.c, src/hid/ps/ps.c: Use + GtkPcbCoordEntry in gui-dialog-print.c Also set ps-bloat to HID_Coord from HID_Integer in ps.c + +2011-08-10 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtk-pcb-coord-entry.c, + src/hid/gtk/gtk-pcb-coord-entry.h, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-dialog-size.c, src/pcb-printf.c, src/pcb-printf.h: + Use GtkPcbCoordEntry in gui-dialog-size.c + +2011-08-10 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/hid/gtk/gtk-pcb-coord-entry.c, + src/hid/gtk/gtk-pcb-coord-entry.h, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h: Introduce + GtkPcbCoordEntry widget, use it in gui-config.c The GtkPcbCoordEntry is a modified spinbox that handles pcb units + internally and outputs them as human units. It uses the step sizes + given in pcb-printf and adjusts automatically when units are + changed. If you manually change the unit suffix, it will change its interal + unit, so that if you change "10mil" to "10mm" it will do the right + thing. TODO: handle overflows add a unit selector to the context menu + +2011-08-07 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/common/hidgl.c, src/hid/common/hidgl.h, + src/hid/gtk/gtkhid-gl.c: Audit hidgl stuff, implement Coord I did not touch any code, only change 'int' to Coord where + appropriate (and in a couple cases 'double' to Coord), under the + assumption that any real changes should be done by Peter C. + +2011-08-07 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid.h, src/hid/common/hidinit.c, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-dialog-print.c, src/hid/lesstif/dialogs.c, + src/hid/lesstif/lesstif.h, src/hid/lesstif/main.c, src/main.c: + Introduce HID_Coord type and related changes Give measure-specific HID options their own datatype, so that things + like the --grid option can support suffixes instead of exposing the + base unit. (In fact, since they use GetValue, they will keep right + on pretending the base unit is cmil.) This gives us the opportunity to write measure-entry GUI widgets + that will handle units correctly and whatnot, though I have not yet + done this. Fixes-bug: lp-699640 Fixes-bug: lp-699641 + +2011-08-11 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/lesstif/dialogs.c: Change lesstif_logv to use pcb-printf + [rebase-after: audit lesstif] + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/global.h, src/gpcb-menu.res.in, src/hid/lesstif/dialogs.c, + src/hid/lesstif/main.c, src/hid/lesstif/styles.c, + src/pcb-menu.res.in: Audit lesstif HID We can now remove LocationType and BDimension! This marks the + completion of the code audit. Remaining to do is the conversion and + test. + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui.h: Audit Gtk HID + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/common/draw_helpers.c, src/hid/common/extents.c, + src/hid/common/hidnogui.c: Audit HID nogui/common code + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/nelma/nelma.c: Audit nelma HID + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/png/png.c: Audit png HID + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gcode/gcode.c: Audit gcode HID + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/ps/ps.c: Audit ps.c + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/ps/eps.c: Audit eps.c + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: Audit gerber HID + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/bom/bom.c: Implement new unit selector in BOM HID, audit + bom.c + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid.h, src/hid/bom/bom.c, src/hid/common/hidinit.c, + src/hid/gcode/gcode.c, src/hid/gerber/gerber.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h, src/hid/lpr/lpr.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c, src/main.c: Introduce HID_Unit option type + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid.h: Change drawing function coords in hid.h to Coord from + int Note that this causes a slew of compilation warnings about + mismatched pointer types, since the HIDs themselves are still using + int-taking functions. These warnings will be cleaned up over the + next few commits. + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/crosshair.c, src/crosshair.h: Audit crosshair.[ch], implement + Coord + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/parse_y.y: Audit parse_y.y, implement Coord + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/mtspace.c, src/mtspace.h: Audit mtspace.[ch], implement Coord + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.h, src/report.c: Audit report.c, implement Coord Includes fixes for the original pcb-printf conversion: Fix drill report spacing in report.c Use %ma spec outputting angles in report.c + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/autoroute.c: Audit autoroute.[ch], implement Coord There are many magic numbers in this file. It is likely they will be + skewed by base-unit changes, though I have worked to mitigate this. + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/autoplace.c: Audit autoplace.c, implement Coord Note that there are -many- magic numbers in this file. I believe + I've caught all of them that are supposed to be unit conversions and + used macros instead. + +2011-08-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/action.c, src/create.c, src/create.h: Audit create.[ch], + implement Coord + +2011-08-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/intersect.c, src/line.c, src/line.h: Audit line.[ch], + intersect.c, implement Coord + +2011-08-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/find.c, src/find.h: Audit find.[ch], implement Coord Note that this commits brings major simplifications to some DRC + functions. My tests show everything okay, but there will likely be + some bugs (or bug fixes) as a result of this commit. + +2011-08-02 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/find.c: Remove fBloat from find.c fBloat does nothing except act as a floating point copy of the + integer Bloat variable. It should not be (and is not) necessary. + +2011-08-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/find.c: Fix g_string_free (NULL) error + +2011-08-02 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/global.h, src/hid/gtk/gui-drc-window.c, + src/hid/gtk/gui-drc-window.h: Remove coord suffix/precision from DRC + error struct Display units for DRC errors are now handled by the UI, rather than + in the error struct. The struct now stores everything in Coord's, + and pcb-printf worries about how to display them. + +2011-08-02 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/file.c: Audit file.c, implement Coord + +2011-08-02 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/find.c, src/pcb-printf.c, src/pcb-printf.h: Use pcb-printf in + DRC code in find.c Also, expose pcb_vprintf in pcb_printf.h. + +2011-07-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/draw.c, src/draw.h: Audit draw.[ch], implement Coord + +2011-07-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/box.h, src/change.c, src/change.h: Audit change.[ch], box.h, + implement Coord + +2011-07-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/copy.c, src/copy.h, src/insert.c, src/insert.h, src/mirror.c, + src/mirror.h: Audit copy.[ch], insert.[ch], mirror.[ch], implement + Coord + +2011-07-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/misc.c, src/misc.h: Audit misc.[ch], implement Coord + +2011-07-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/move.c, src/move.h: Audit move.[ch], implement Coord + +2011-07-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/polyarea.h, src/polygon.c, src/polygon.h, src/polygon1.c: + Audit polygon*, polyarea.h, implement Coord + +2011-07-25 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/rotate.c, src/rotate.h: Audit rotate.[ch], implement Coord + +2011-07-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/search.c, src/search.h: Audit search.[ch], implement Coord + unit This does not affect the "IsPointOnArc assumes circular arc" bug; it + is just more obvious now with the cleaner code. Affects-bug: lp-815527 + +2011-07-13 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/rubberband.c, src/set.c, src/set.h, src/thermal.c, + src/undo.c, src/undo.h: Audit undo.[ch], thermal.c, set.[ch], + rubberband.c, introduce Coord + +2011-08-07 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/action.c, src/buffer.c, src/buffer.h, src/command.c, + src/djopt.c, src/djopt.h, src/fontmode.c, src/global.h, src/hid.h, + src/hid/batch/batch.c, src/hid/common/actions.c, + src/hid/common/hidnogui.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-netlist-window.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h, src/hid/lesstif/dialogs.c, + src/hid/lesstif/lesstif.h, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/netlist.c, src/hid/lesstif/styles.c, src/misc.c, + src/move.c, src/netlist.c, src/puller.c, src/report.c, + src/toporouter.c, src/vendor.c: Change get_coord and action + signatures to use Coord + +2011-07-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/file.c, src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: + Introduce PCB::grid::unit attribute This is PCB's first use of the Attribute() field in the file format. + It is a unit suffix string denoting the unit setting used by pcb + when loading the file. Note the namespacing: as Attributes are persistent across + file-saves, other programs may use them in future for purposes + unknown and irrelevant to pcb. Therefore we will put all pcb + attributes under the PCB namespace. If this attribute is missing or invalid (i.e., the unit given is + unsupported by pcb-printf), PCB will then use the --grid-units + command-line option. Failing that, it will use the grid-units entry + in ~/.pcb/preferences. Failing that, it will use mils. Fixes-bug: lp-811393 + +2011-08-10 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c: Modify get_unit_struct()'s bad-unit forgiveness Suffixes passed to get_unit_struct() may now start or end with + whitespace, without affecting the result. However, incomplete units + will NOT be matched. This means that "mi" will no longer return the "mil" struct, for + example. The reasons for this change are: 1. The old behavior returned the first potential match, regardless of other matches: "c" is always "cm", never "cmil". 2. Prevent surprises (due to point #1, or typos). 3. Prevent user dependence on behavior that will change as units are added or removed. It still supports plural units, like "inches" or "mils". However, + it will read "miles" as "mil" because of this. ;) + +2011-08-05 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/main.c, src/pcb-printf.c, src/pcb-printf.h: Add alias support, + get_unit_list() to pcb-printf Add pcb-printf support for unit aliases (just one per unit for now, + we will fix this if the need arises). Map "inch" to "in" and "pcb" + to "cmil" for backward compatibility. Move initialize_units() call to main.c to ensure it is called before + any other unit-handling code. Also, add the functions get_unit_list (); get_n_units (); which do exactly what they look like. These will + be used to build HID-export unit selectors. + +2011-07-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/gpcb-menu.res.in, src/pcb-menu.res.in: Use suffixed units in + gpcb-menu.res and pcb-menu.res + +2011-07-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/buffer.c, src/buffer.h, src/create.c, src/file.c, + src/global.h, src/misc.c, src/misc.h, src/pcb-printf.c, + src/pcb-printf.h, src/rotate.c: Make file.c use %mr pcb-printf spec I have changed the %mr spec to always output cmils, no suffix, and + changed file.c to use this. The reason is that the %mc spec (cmils, + no suffix) is locale- dependent, while %mr is not. When we change the actual file format, file.c can be left alone and + the relevant changes should be done to the %mr spec in pcb-printf. + +2011-07-13 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-config.c: Update hid/gtk/gui-config.c with new + grid preferences + +2011-07-13 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/file.c, src/find.c, src/flags.c, src/global.h, + src/gpcb-menu.res.in, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-dialog-size.c, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h, src/hid/lesstif/dialogs.c, + src/hid/lesstif/main.c, src/hid/lesstif/styles.c, + src/pcb-menu.res.in, src/pcb-printf.h, src/report.c: Remove mm/mil + dichotomy, support arbitrary user units Currently, pcb assumes the user's display units are either mm or + mil, and uses the Settings.grid_unit_mm boolean (and flag + "grid_unit_mm") to determine which is which. This patch removes the boolean and replaces it with the new + Settings.grid_unit, which can be set to any unit supported by + pcb-printf. The user-visible interface has not changed (there is + still a mm/mil toggle in Gtk and the menus only contain mm and mil + units), but new units can be accessed though the :SetUnits command. The flag is still there and can be used in pcb-menu.res as usual. + However, the new flag "grid_unit_mil" should be checked to see if + mils are selected, since this is no longer implied by grid_unit_mm + == 0. There will be some user-visible changes to the precision of + displayed values, since I have removed a lot of special-case code + for this sort of this thing and use the default_prec of applicable + units instead. Because of the new flexibility, some idioms have been changed: Settings.grid_unit_mm ? COORD_TO_MM (x) : COORD_TO_MIL (x) becomes coord_to_unit (Settings.grid_unit, x) Settings.grid_unit_mm ? "mm" : "mil" becomes Settings.grid_unit->suffix Settings.grid_unit_mm = 1; becomes Settings.grid_unit = get_unit_struct ("mm"); For GUI use, the Unit structure returned by get_unit_struct exposes + certain members: suffix : "mm"/"mil"/etc in_suffix : i18n version of the above default_prec : precision used for spinboxes, labels, etc step_tiny : step_small : step_medium : step sizes for various spinboxes step_large : step_huge : Additionally, the *_increment_mm and *_increment_mil variables have + their own structure containing default, min and max values. These + can no longer be set on the command line. + +2011-07-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/main.c: Cleanup default values in main.c + +2011-07-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/misc.c, src/pcb-printf.c, src/pcb-printf.h: Introduce new + structures (unit, increment) to pcb-printf Constants for gui spinbox steps are now in pcb-printf.h: Unit.step_tiny Unit.step_small Unit.step_medium Unit.step_large Unit.step_huge Additionally, the default/max/min values for the preferences + Increments tab are in their own structure in pcb-printf.h. These changes are needed to bring all unit-specific constants into + one place. The spinbox values can be shared by gtk and lesstif. + +2011-07-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/misc.c, src/pcb-printf.c, src/pcb-printf.h: Add scale factor + lookups to pcb_printf.c, tell GetValue to use them GetValue and pcb-printf have their own lookup tables to determine + scale factors. To unify them, this patch adds two functions to pcb- + printf, coord_to_unit and unit_to_coord. These a const char *suffix and return an appropriate scale factor. I have also added a NO_PRINT entry to the allow_mask array for + suffixes like "inch" that we can read but never output. The definitive unit lookup table should now be in pcb_printf.c. Any + other tables used in the code should be merged into this. + +2011-07-11 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/action.c, src/autoplace.c, src/crosshair.c, src/crosshair.h, + src/djopt.c, src/file.c, src/flags.c, src/fontmode.c, src/global.h, + src/hid/common/hidgl.c, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui.h, src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/main.c, src/misc.c, src/misc.h, src/set.c, src/set.h: Convert + grid/increments from double to Coord Since Coord is an integer unit, there will be (often severe) + precision errors until we convert the base unit to nm. + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/global.h: Remove unused variable + +2011-08-14 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/global.h, src/main.c: Remove broken --menu-file option The expected functionality is given by the option --pcb-menu for the + GTK+ GUI and lesstif GUI. + +2011-08-13 DJ Delorie * dj AT delorie dot com * + + * src/change.c, src/find.c, src/global.h, + src/hid/common/draw_helpers.c, src/misc.c, src/polygon.c, + src/search.c: Make toggling the HOLE flag reversible Closes-bug: lp-699483 When toggling the HOLE flag, the Thickness is no longer changed. + Instead, use PIN_SIZE() to select from Thickness or DrillingHole + accordingly, and use that throughout. Mask size is handled thusly: For tented vias, the mask is opened up + to just over the hole size. For untented vias, the mask gap is held + constant. Also, various minor changes to ensure that untented holes are drawn + correctly. + +2011-08-13 Jared Casper * jaredcasper AT gmail dot com * + + * src/action.c, src/create.c, src/create.h, src/file.c, src/main.c, + src/parse_y.y: refdes labels in new layout can't be moved. The .pcb file that gsch2pcb creates does not have a font in it. + When loading files, the bounding box for all the text is calculated + as the file is read. In the case that there is no font, this is + before the default font is installed, so the bounding box is way too + small. This patch remedies this by making all new PCB structures contain + the default font by calling CreateDefaultFont in CreateNewPCB + (CreateDefaultFont now takes in a PCBTypePtr instead of using the + global PCB). Previously, each time CreateNewPCB was called, + CreateDefaultFont was called soon thereafter. In the case of loading a PCB from a file. The default font in the + newly created struct PCB is marked invalid but not removed. If the + .pcb file contains a font, the default font will be overwritten by + the file's font. If it does not, PCB->Font will still be invalid + after LoadPCB, a message is displayed that the default font is being + used, and PCB->Font.Valid is set to true. Also fixes a related bug where the memory for a symbols lines wasn't + being cleared when a new file was brought into place. Previously, + this only happened if a new Font was loaded into an existing PCB. + Now the font will be replaced every time a file with symbol + information is loaded. Rebased to actual git-head by Felix Ruoff Closes-bug: lp-699478 + +2011-08-13 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c, src/hid/lesstif/lesstif.h, + src/hid/lesstif/library.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/lesstif/netlist.c, + src/hid/lesstif/styles.c: Centralize Lesstif XmStringCreate* Closes-bug: lp-699472 To save time in the future, all XmString creation is done via + XmStringCreatePCB which is a macro in lesstif.h. Meanwhile, this + macro is defined to XmStringCreateLtoR instead of + XmStringCreateLocalized. + +2011-08-13 Cesar Strauss * cstrauss AT not2005 dot cea dot inpe dot br * + + * Makefile.am, README.w32, configure.ac, w32/.gitignore, + w32/Makefile.am, w32/README, w32/build-all.sh, w32/minipack.conf, + w32/mpk, + w32/patches/gd/0001-Export-sysbols-when-building-as-a-DLL.patch, + w32/patches/gd/0002-Libtool-requires-no-undefined-to-build-a-DLL.pa + tch, + w32/patches/gd/0003-Avoid-conflit-between-libjpeg-and-windows-heade + rs.patch, w32/patches/gettext/01-revert-sed-string.patch, + w32/patches/gettext/02-Avoid-missing-open-argument-error.patch, + w32/patches/gtk+/01-mousewheel.patch, + w32/patches/zlib/01-shared-lib-support.patch, + w32/patches/zlib/02-cross-build.patch, w32/recipes/atk.recipe, + w32/recipes/cairo.recipe, w32/recipes/gd.recipe, + w32/recipes/gettext.recipe, w32/recipes/glib.recipe, + w32/recipes/gtk+.recipe, w32/recipes/jpeg.recipe, + w32/recipes/libiconv.recipe, w32/recipes/libpng.recipe, + w32/recipes/pango.recipe, w32/recipes/pcb.recipe, + w32/recipes/pixman.recipe, w32/recipes/tiff.recipe, + w32/recipes/zlib.recipe, w32/tools/mpk-build, w32/tools/mpk-clean, + w32/tools/mpk-config.guess, w32/tools/mpk-help, + w32/tools/mpk-install, w32/tools/mpk-remove, w32/tools/mpk-shell, + w32/tools/mpk-source, w32/tools/mpk-unpack, w32/tools/mpk-version, + w32/tools/tool.template: Add Windows cross-build script. Closes-bug: lp-699494 + +2011-08-13 Cesar Strauss * cstrauss AT not2005 dot cea dot inpe dot br * + + * Makefile.am, README.win32, configure.ac, win32/.cvsignore, + win32/Makefile.am, win32/Readme.txt, win32/build_pcb, + win32/extract_gtk_win32, win32/pcb.nsi.in, + win32/registerExtension.nsh: Remove previous Windows build script. Affects-bug: lp-699494 + +2011-08-10 DJ Delorie * dj AT delorie dot com * + + * src/action.h, src/autoplace.h, src/autoroute.h, src/box.h, + src/buffer.h, src/change.h, src/clip.h, src/command.h, + src/compat.h, src/const.h, src/copy.h, src/create.h, + src/crosshair.h, src/data.h, src/dbus-pcbmain.h, src/dbus.h, + src/djopt.h, src/draw.h, src/edif_parse.h, src/error.h, src/file.h, + src/find.h, src/global.h, src/heap.h, src/hid.h, + src/hid/common/actions.h, src/hid/common/hid_resource.h, + src/hid/common/hidgl.h, src/hid/common/hidinit.h, + src/hid/common/hidnogui.h, src/hid/gcode/lists.h, + src/hid/gtk/gtkhid.h, src/hid/gtk/gui-drc-window.h, + src/hid/gtk/gui-library-window.h, src/hid/gtk/gui-pinout-preview.h, + src/hid/gtk/gui.h, src/insert.h, src/intersect.h, src/line.h, + src/lrealpath.h, src/macro.h, src/mirror.h, src/misc.h, src/move.h, + src/mtspace.h, src/mymem.h, src/parse_l.h, src/pcb-printf.h, + src/polyarea.h, src/polygon.h, src/print.h, src/rats.h, + src/remove.h, src/report.h, src/resource.h, src/rotate.h, + src/rtree.h, src/rubberband.h, src/search.h, src/select.h, + src/set.h, src/strflags.h, src/thermal.h, src/toporouter.h, + src/undo.h, src/vector.h, src/vendor.h: Fix header guard macro names Closes-bug: lp-699161 Make all headers use standard-compliant guard macro names. + +2011-08-10 DJ Delorie * dj AT delorie dot com * + + * configure.ac, src/hid/lesstif/main.c, src/hid/lesstif/xincludes.h: + Detect XRender + Xinerama to avoid BadMatch Closes-bug: lp-699251 This seems to happen when your X server is using both Xinerama and + XRender, and only affects the XRenderChangePicture() call with a + clip_mask. So, I added code to detect Xinerama+XRender and disable + XRender if they're found. + +2011-08-10 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Don't set FOUND flag on silk lines. Closes-bug: lp-699291 + +2011-08-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Clean up ghid_pan_fixup () + +2011-08-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Re-write some routines with + the new ghid_pcb_to_event_coords API. Cleans up ghid_set_crosshair() and Center() in gtkhid-main.c + +2011-08-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gui.h: hid/gtk: Add API to convert pcb units into + drawing widget coordinates. + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c: misc.c: Remove comment missed from commit e82ad9b + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/macro.h: macro.h: Remove now unused SCREEN_SIGN_{X,Y} macros + +2011-07-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui.h: hid/gtk: + Implement an API to draw the user into a particular location This is renderer-specific, but the general idea is to help the user + find a particular location on the board. + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c, src/select.c, src/select.h: Move + the SelectPin() function into the file of its only caller. The new function is in hid/gtk/gui-netlist-window.c, and is called + toggle_pin_selected (). Whilst we're at it, simplify the function, removing its always- + constant argument and condense the redrawing calls. + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Remove unused parser token F_Scroll + ("Scroll") + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/action.h: action.c: Remove unused action + "MovePointer" + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-misc.c: hid/gtk: Remove dead "MovePointer" + keyboard navigation code. This was not working correctly anyway, as the action was not + properly registered. Obviously no-one missed it, so let it die. Whilst we are here, kill off the hard-coded panning actions in this + sub-main loop. Eventually, we should use common code for any + keyboard navigation. This only affects operation of the ghid_get_user_xy() function, e.g. + the one which temporarily greys out the PCB user interface whilst + waiting for the user to supply a location. + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Simplify ActionMovePointer() The save / restore of the crosshair coordinates is unnecessary since + we are emitting the appropriate change notifications. + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Remove dead code, IgnoreMotionEvents + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/find.c, src/hid/gtk/gui-drc-window.c, + src/misc.c, src/misc.h, src/select.c: misc.c: Remove unused "delta" + argument from CenterDisplay() All the callers are passing absolute locations. + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * po/POTFILES.in, src/Makefile.am, src/gpcb-menu.res, + src/gpcb-menu.res.in, src/pcb-menu.res, src/pcb-menu.res.in: + Generate pcb-menu.res and gpcb-menu.res from ".in" files No functional changes here, just a preliminary cleaning before + adding the topological autorouter to the menus. Doing so requies + conditional inclusion of certain lines, as the toporouter is not + always built. Based on a patch by Stanislav Brabec * sbrabec AT suse dot cz * Affects-bug: lp-812429 + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/pcb-menu.res: pcb-menu.res: Fixup some more whitespace + +2011-07-18 Stanislav Brabec * sbrabec AT suse dot cz * + + * src/action.c: RipUp(): Rip arcs created by toporouter. Toporouter creates not only lines but also arcs. Rip up all auto + routed tracks should rip these arcs as well. Closes-bug: lp-812380 Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * po/POTFILES.in: POTFILES.in: Add src/crosshair.c and + src/autoroute.c We were missing translations before. "make distcheck" now passes ;) + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * doc/Makefile.am: doc: Don't make any DVI targets We don't have rules to build all the prerequisites, and we don't + care about DVI. This is one of the issues causing "make distcheck" + to fail. + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * doc/Makefile.am, doc/gs/Makefile.am: doc: Remove execute + permissions on Makefile.am and gs/Makefile.am + +2011-08-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/gpcb-menu.res, src/pcb-menu.res: Clean up whitespace in + [g]pcb-menu.res + +2011-08-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Fix layer check for off-grid line + snapping in line-draw mode + +2011-08-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Revise heuristic for snapping on + off-grid lines Only snap to an off-grid section of a line when: Drawing lines on the same layer as the one being snapped to When + manipulating the end-point of a _different) line on the same layer + as the one being snapped to. This should hopefully reduce the tendancy of the off-grid-line code + to cause lots of unnecessary snapping. + +2011-08-01 Gabriel Paubert * paubert AT iram dot es * + + * src/hid/lesstif/main.c: Correct parameter order in Distance + function in hid/lesstif/main.c in src/did/lesstif/main.c, the Distance function is called with the + parameters in the wrong order. This small patches fixes the problem. I still think that the format + is wrong, or at least the rounding to integer mm/mil taking only the + grid into account, but I've not yet decided on how to fix it. The + worse is that often the display is wrong because the decimal part is + truncated (displaying say -24 between two grid points on a 5mil + grid). Gabriel + +2011-07-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/png/png.c: hid/png: Increase the maximum allowable DPI of + the exporter Sometimes for rendering fiddly boards, you just need the detail. Move the arbitrary 1000 dpi limit to still arbitrary, 10000 dpi. + +2011-07-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/ps/ps.c: hid/ps: Fix arc drawing since pcb_printf patch The last parameter to the arc macro we use for drawing arcs is + unitless, so should be a double. This was broken by: commit fa9ae1f6b1eabaab961795ce7be53afe46eaa735 Convert ps/eps/lpr HID's to use pcb-printf I've reverted the change, and added an extra (double) cast compared + to what was there before, I'm not sure we wouldn't get an integer + division without it. One day I should learn these type promotion / + casting rules properly! ;) + +2011-07-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Add a + shutdown function to the renderer backends This will be necessary to stop any event handlers / timers which + should not fire as the GUI is being shut down. This code isn't actually very "live" at the moment, as the place + I've hooked up its trigger (the destroy event of the main window), + doesn't actually appear to get called. This seems to be because the core "Quit" action just kills the + program dead, rather than attempting to shut down the GUI. + +2011-07-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c: hid/gtk: Do not run a main loop + from within the netlist window code. It turns out that this is a really bad idea.. if the main loop is + kept busy, the new main-loop never exits and the events can become + reentrant. I discovered this when testing code for an animation which used the + main event loop for its timing. Each time a node was selected in the + netlist window, stack-frame would grow - as the new nested main + loops never became idle. Segfaults ensued quite readily, presumably + due to the code not being designed to be reentrant. It appears from reading the code, that these: while (gtk_events_pending ()) /* Make sure everything gets + built */ gtk_main_iteration (); Are not actually necessary. + +2011-07-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c: hid/gtk: Skip check before + calling ghid_netlist_window_create If the window already exists, ghid_netlist_window_create() is a + NOOP, so there is no point in checking twice. + +2011-07-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui.h: hid/gtk: + Remove unused function ghid_netlist_nodes_update () + +2011-07-25 DJ Delorie * dj AT delorie dot com * + + * src/default_font: Tweak default font. Minor changes to various glyphs to improve readability and + legibility, such as making V look less like U, or 8 less like 0. No + changes to font metrics, bounding boxes, or spacing. + +2011-07-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Fix up paning when flipping + the board. I'm not sure when this got broken, but it was probably my fault ;) + +2011-07-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : commit f9ad6634a55f7f79106945e3307aafe0d39eae61 Author: Andrew + Poelstra * asp11 AT sfu dot ca * Date: Mon Jul 25 00:33:23 2011 + -0700 + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : hid/gtk: Refactor viewport handling + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Fixup Zoom() and zoom_by() so + they don't ignore passed coordinates. The Zoom() action was passing bogus coordinates (in pixels), and + zoom_by() was ignoring the passed coordinates and just using the + mouse pointer location last recorded in gport->pcb_x and + gport->pcb_y. Fix zoom_by() to use the passed coordinates, fix Zoom() to not + mangle the passed board coordinates into screen space.. zoom_by() + wants board coords. Finally, remove a special case from the Zoom() action where if the + passed coordinates were both zero, we would pass the PCB coordinates + of the board center. I'm hopeful that things will "just work" + without this. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui.h: hid/gtk: Introduce a zoom_fit() function, remove + duplicated code. Several places in the code invoke a "zoom_fit" type function by + calling zoom_to() or ghid_port_ranges_zoom() with bogus parameters. Implement a specific function which restricts this to one location, + then remove the now redundant ghid_port_ranges_zoom(), which + basically just duplicated the code from zoom_by() with an added + check for a 0.0 zoom factor to trigger the zoom-to-fit feature. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Add missing static parameter + to zoom_by() function. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Some cleanups to the zoom_to() + function Still confusing, but at least its not the fault of the code + formatting now. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Remove old debugging code from + zoom_to and zoom_by() functions This code was adding to clutter in the functions, and appears in + some cases to be bit-rotten. (The coordinates it operated on don't + appear to be have been consistent with the current GUI code). + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui.h: hid/gtk: + Abstract away event coordinate conversion to PCB base units + +2010-12-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui.h: hid/gtk: Refactor semantics of, and rename + view_x, view_y coordinates Rather than storing pointer coordinates in the imaginary "view" + system, where the coordinates (in PCB base units) represent that of + an unflipped board, store them such that they are directly + meaningful on the board. As they now directly represent the cursor coordinats on the actual + board, they don't require passing through the SIDE_{X,Y} macros + before use with APIs that expect board coordinates. To avoid confusion, view_x and view_y have been renamed to pcb_x and + pcb_y to reflect the change of semantics. In a number of cases, SIDE_{X,Y} macro calls were added to preserve + correct functionality of old code which manipulates the mouse + position in "view" coordinates. These are primarily concerned with + zooming and panning. Also rename the confusingly titled VIEW_{X,Y} macros to + EVENT_TO_PCB_{X,Y} + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui.h: hid/gtk: Rename {x,y}_crosshair to + crosshair_{x,y} (Just because!) + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: gtk+gl: Convert crosshair drawing to use + PCB world coordinates Whilst I'm at it, add a z-coordinate to the crosshair drawing + functions to future proof them for when we add some 3D effects. + +2011-07-08 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/file.c, src/global.h, src/pcb-printf.c: Introduce Coord/Angle + types, convert global.h and pcb-printf to use it For now Grid (in PCB and Settings) and its increments are still + doubles to avoid serious breakage. Will change these to Coords in a + separate commit. Also add %ma spec for Angle, tell file.c to use it, to prevent + printf problems with Angle when changing ctypes. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * gts/boolean.c, gts/cdt.c, gts/edge.c, gts/partition.c, + gts/split.c: gts: Fixup warnings due to assigned but unused + variables As I'm not 100% familiar with this code, I have commented out some + of the redundant code rather than deleting it completely. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c: hid/common/hidgl.c: Cast the function + pointers passed to gluTessCallback() Silences compiler warnings about incompatible pointer types + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/line.c: line.c: Fix a bogus compiler warning regarding a (X + + c) >= X being always true. line.c: In function ‘EnforceLineDRC’: line.c:491:7: warning: + assuming signed overflow does not occur when assuming that (X + c) + >= X is always true [-Wstrict-overflow] It would appear that gcc (4.6.1-5ubuntu1) is identifying the + conditional portions of INDEXOFCURRENT which would always evaluate a + particular way if a given condition is met. It is "probably" safe to + assume that this warning manifests due to gcc considering each + portion of the INDEXOFCURRENT definition in turn. It appears we can avoid this particular warning by temporarily + assigning INDEXOFCURRENT into a variable before we test with it. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/toporouter.c: toporouter.c: Fixup warnings due to assigned but + unused variables As I'm not 100% familiar with this code, I have commented out some + of the redundant code rather than deleting it completely. + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/undo.c: undo.c: Fixup warnings due to assigned but unused + variables + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rtree.c: rtree.c: Fixup warnings due to assigned but unused + variables Adds a nasty cludge using #ifndef NDEBUG around a variable + assignment which is only used in a later assert() statement. (NB: + assert() evaluates to nothing if NDEBUG is defined). + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/print.c: print.c: Fixup warnings due to assigned but unused + variables + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/puller.c: puller.c: Fixup warnings due to assigned but unused + variables + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: polygon1.c: Fixup warnings due to assigned but + unused variables Adds a nasty cludge using #ifndef NDEBUG around a variable + assignment which is only used in a later assert() statement. (NB: + assert() evaluates to nothing if NDEBUG is defined). + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/fontmode.c: fontmode.c: Fixup warnings due to assigned but + unused variables + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c: find.c: Fixup warnings due to assigned but unused + variables + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/djopt.c: djopt.c: Fixup warnings due to assigned but unused + variables + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/copy.c: copy.c: Fixup warnings due to assigned but unused + variables + +2011-07-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: Fixup warnings due to assigned but + unused variables Adds a nasty cludge using #ifndef NDEBUG around a variable + assignment which is only used in a later assert() statement. (NB: + assert() evaluates to nothing if NDEBUG is defined). + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Fixup warnings due to assigned but unused + variables + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gcode/trace.c: hid/gcode: Fixup warnings due to assigned + but unused variables + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/bom/bom.c: hid/bom: Fixup warnings due to assigned but + unused variables + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-top-window.c: hid/gtk: Fixup warnings due to + assigned but unused variables + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Snap to points along off-grid lines + when drawing tracks This should greatly easy making tidy layouts where some lines have + (perhaps by necessity) ended up off-grid. This patch adds code to snap onto the center of a line. It finds the + nearest grid point to the cursor, then will allow snapping at the + intersections between the line in question and the lines of an + imaginary X and + centered on the nearest grid-point to the cursor. This allows neat drawing of horizontal, vertical and 45 degree lines + which will land correctly on the existing line. + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Rename some variables for clarity + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Always allow snapping to the element + mark (except in rat-draw mode) + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Don't snap to an element's mark in + rat-draw mode. + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Drop checks to ensure the crosshair + is inside the PCB It would seem that the MIN, MAX functions applied when setting + Crosshair.X and Crosshair.Y should already constrain the coordinates + such that the removed code was never triggered. It isn't obvious that these removed checks are even correct, or are + being triggered. Drop the checks in the hope that the now simplified + code continues to "just work" without the special casing. + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/parse_y.y: parse_y.y: Remove unused GRIDFIT macro + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: Try snapping to element marks first, as they are + only a weak snap. Because the element mark is never chosen in preference to a closer + grid point, we should try snapping to it first - rather than last. Currently, we might have a crosshair location where (say), a pad is + snapped to in preference to the nearest grid-point, then the element + mark is tested and snapped to because it is closer than the pad. + This can occur even when there is a closer grid point than the + element mark, since the grid snap (nearest_is_grid == true) has + already been discarded by the snap to the pad. + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: Refactor crosshair snap code to reduce + duplication and improve readability + +2011-07-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/search.c: Allow editing of ordinary text objects when element + names are hidden Closes-bug: lp-810678 + +2011-07-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-netlist-window.c: Fix crash in netlist window + caused by heirarchical netlists See http://archives.seul.org/geda/user/Jul-2011/msg00133.html + +2011-07-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: Remove special grid-change handling + from Gtk + +2011-07-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/lesstif/dialogs.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c: Convert lesstif hid to use pcb-printf Should be no user-visible changes, except this bug: Closes-bug: + lp-805273 + +2011-07-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c: Add support for + and .* subspecifiers in + pcb-printf + +2011-07-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/lesstif/main.c: Clean up coords_to_widget() in + lesstif/main.c The coords_to_widget() function is used in exactly two places, for + different purposes. To differentiate between the two uses, the + ``state'' parameter is set to -1. The parameter is confusing enough without overloading it in this + way. Therefore I have split the function into two: mark_delta_to_widget cursor_pos_to_widget Further, I have converted the code inside the functions to use + g_printf_strdup instead of a fixed buffer. The functions should both + be easier to read now than the original. There is one small change to user-visible output, which I think is + justified: if you have a very small metric grid (<= 5um), the + mark_delta output now uses .3f for both cartesian and radial + display. Before it would use .3f for cartesian, .2f for radial. + +2011-07-01 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog-size.c, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui-top-window.c: Convert gtk + gui to use pcb-printf There should be no user-visible changes. Note that as long as base units are cmils, the .9999 bug in the + cursor status is back. This is not a problem with smaller base units + (I am using 17nm and all is okay.) Note also that the report dialogs are entirely based on report.c, so + that is not part of this commit. + +2011-06-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/ps/eps.c, src/hid/ps/ps.c: Convert ps/eps/lpr HID's to use + pcb-printf The postscript HID now uses pcb-printf to output all units as inches + rather than cmils; therefore the default scale is now 1:1 rather + than 1:10000. Therefore there will be a change in raw ps output but + not in printed output. As inches are output with 5 digits after the decimal point, there + will be no loss in precision, though in future this will be easy to + increase. Also, minor code cleanups in ps.c to reduce global state and make + global variables more visible. + +2011-06-28 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c: Make pcb_fprintf ignore NULL file handle There is a lot of code in the HID's that looks like if (f != NULL) fprintf (f, "..."); I have moved the NULL check inside pcb-printf to remove this + repetition/potential mistake. + +2011-06-26 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/file.c: Make sure scale/direction are not output as measures + in file.c + +2011-06-25 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/report.c: Fix typo in unplated hole output in report.c + +2011-06-22 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/toporouter.c: Convert toporouter trace code to use pcb-printf There is still a fair amount of trace code outputting measurements + that are floating-point values. I left these alone since they will + work independently of the actual type of BDimension. Everything should still be output in base units. + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/polygon.c, src/polygon1.c: Convert polygon and polygon1.c + debug code to use pcb-printf + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/puller.c: Convert puller.c trace code to use pcb-printf Minor changes to trace output (addition of parens, mainly). Should + be no user-visible output. No longer assumes BDimension == int. + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/djopt.c: Convert djopt.c to use pcb-printf No change in user-visible output. Debug output is slightly changed since pcb-printf likes to put + parens around tuples, so "%d,%d" is now effectively "(%d, %d)". + Debug output is all base units, so the numbers will not change until + the base unit size is changed. + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/autoroute.c: Convert autoroute.c debug code to use pcb-printf Should be no change in output. Only change is that we no longer + assume BDimension == int. + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/action.c: Change action.c *WARN* lines to use pcb-printf Now instead of outputting unsuffixed cmils, warnings about + locked/unnamed elements will refer to the part's position in either + mm or mil, with an appropriate suffix. Non-warning-related output is unchanged. + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/file.c: Convert file.c to use pcb-printf for cmil output file.c now uses pcb-printf, though in a limited way: everything is + still output in unsuffixed cmils, though this is now independent of + pcb's internal unit size. I have also removed the old-style output for symbols. Aside from that, everything should be the same. Any other change in + output, or file format incompatibility of any kind, is a bug. + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c, src/pcb-printf.h: Add # subspecifier to + pcb-printf to prevent scaling for debug output + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/puller.c: Convert puller.c to use Distance() intead of its own + function + +2011-06-21 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c, src/pcb-printf.h: Add pcb_printf to pcb_*printf + family of functions + +2011-06-19 Krzysztof KoÅ›ciuszkiewicz * k dot kosciuszkiewicz AT gmail dot com * + + * doc/Makefile.am: doc: do not distribute dvi files DVI files cannot be generated without LaTeX, and since commit + 3afdb7efdaf6cc8094cc6143269e7df519183197 only pdfLaTeX is supported. + +2011-06-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/lesstif/menu.c: Allow 1...9 and Ctrl+1...9 accellerators + for silk/rats in lesstif + +2011-06-19 Levente Kovacs * leventelist AT gmail dot com * + + * src/find.c, src/global.h: gEDA-user: skpi_drc patch On Fri, 17 Jun 2011 17:30:22 -0400 DJ Delorie * dj AT delorie dot + com * wrote: > You want the (already global) AttributeGet() function. > > + l->no_drc = AttributeGet (l, "PCB::skip-drc") != NULL; > > This does + assume that the attribute has *some* value, even if the > value is + the empty string. Thanks for pointing this out. Attached is the new patch. Levente -- Levente Kovacs http://levente.logonex.eu + +2011-06-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Lesstif: ignore crosshair changes before + window exists. + +2011-06-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gui-top-window.c: Allow 1..9 accelerator keys to be + applied to non-copper layers in gtk Closes-bug lp-699327 + +2011-06-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/report.c: Change report.c to use pcb-printf Right now there should be no change in the output from report.c; + this is essentially just a code cleanup. The prec/UNIT nastiness is + cleaned up -- precision is handled by the defaults in pcb-printf (.2 + for mil, .4 for mm, same as before) and unit selection is done with + the %m+ specifier. It's easy now to expand to allow auto-scaling or even automatic + selection of metric/imperial based on sig. figs., but I've played + around with this and it looks like mixing units is confusing and + hard-to-read, so we're sticking with just one of mm/mil for now. + +2011-06-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c, src/pcb-printf.h: Add %m+ specifier to + pcb-printf As long as our base units are cmils, allowing pcb-printf to guess + the most natural units for displaying measures is a bad idea -- it + cannot reliably count significant figures for many values. The + result, for example, in report.c, is inconsistent and confusing + dialogs with a mix of metric and imperial measurements. The %m+ specifier is used to force pcb-printf to only use certain + units; in this case, the user's gui setting of metric/imperial. + +2011-06-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/misc.c, src/misc.h: Add Distance() function to avoid overflow + with sqrt(x*x + y*y) + +2011-06-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/move.c: Fix typo (Polygon++ ==> PolygonN++) in src/move.c Closes-bug: lp-796059 + +2011-06-19 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: Set file pointer to NULL after closing in + gerber.c Closes-bug: lp-795734 When cleaning up the gerber HID, I had changed the file pointer used + in maybe_close_f from a global to a (local) argument -- which made + the line ``f = NULL'' effectively a no-op. However, the global variable f does need to be set to NULL for the + code to recognize that the file is closed; otherwise it tries to + keep using the (now invalid) file handle, causing crashes whenever + the gerber HID is used more than once. This is now done after every call to maybe_close_f(), rather than + depending on the function itself to have side effects. + +2011-06-17 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Check for empty layers in photo mode Now that the default stackup is for six layer boards, the PNG photo + mode output needs to check to see if the user has used the inner + layers, and automatically adapt - so that a two layer board *looks* + like a two-layer board. + +2011-06-17 Gabriel Paubert * paubert AT iram dot es * + + * src/hid/gerber/gerber.c, + tests/golden/hid_gerber3/arcs.plated-drill.cnc: Fix printf specifier + for gerber drill output + +2011-06-16 Andrew Poelstra * asp11 AT sfu dot ca * + + * configure.ac, tests/golden/Makefile.am, + tests/golden/hid_gerber3/Makefile.am, + tests/golden/hid_gerber3/arcs.bottom.gbr, + tests/golden/hid_gerber3/arcs.fab.gbr, + tests/golden/hid_gerber3/arcs.group1.gbr, + tests/golden/hid_gerber3/arcs.group4.gbr, + tests/golden/hid_gerber3/arcs.plated-drill.cnc, + tests/golden/hid_gerber3/arcs.top.gbr, tests/inputs/Makefile.am, + tests/inputs/gerber_arcs.pcb, tests/tests.list: Add hid_gerber3 test + to check arc rendering + +2011-06-16 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: Re-insert casts to unit conversion macros + in gerber.c + +2011-06-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: Convert gerber hid to use pcb-printf + +2011-06-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gcode/gcode.c: Convert gcode hid to use pcb-printf + +2011-06-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/bom/bom.c: Convert BOM hid to use pcb-printf + +2011-06-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/pcb-printf.c, src/pcb-printf.h: Correct handling of %.*f in + pcb-printf, remove from known issues + +2011-06-12 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/batch/batch.c: Convert batch HID to use pcb-printf + +2011-06-11 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/Makefile.am, src/pcb-printf.c, src/pcb-printf.h: Add + pcb-printf.c to allow custom specifiers for unit output From the header: /* This file defines a wrapper around sprintf, that * defines new specifiers that take pcb BDimension * objects as input. * * The new specifiers are: * %mm output a measure in mm * %mM output a measure in scaled (mm/um) metric * %ml output a measure in mil * %mL output a measure in scaled (mil/in) imperial * %ms output a measure in most natural mm/mil units * %mS output a measure in most natural scaled units * %md output a pair of measures in most natural mm/mil units * %mD output a pair of measures in most natural scaled units * %m3 output 3 measures in most natural scaled units * ... * %m9 output 9 measures in most natural scaled units * %m* output a measure with unit given as an additional * const char* parameter * %mr output a measure in a unit readable by parse_l.l * (this will always append a unit suffix) * * These accept the usual printf modifiers for %f, * as well as the additional modifier $ which is * used to output a unit suffix after the measure. * * KNOWN ISSUES: * No support for %zu size_t printf spec * No support for .* subspecifier for pcb specs */ + +2011-06-09 DJ Delorie * dj AT delorie dot com * + + * globalconst.h, src/buffer.c, src/global.h, src/parse_y.y: Fix + shift/reduce conflicts Closes-bug: lp-794743 I moved the interpretation of what "measurement" means even further + up the heirarchy, by storing the original integer part as well as + the units in a structure, and applying the new/old/unitless meanings + where they're used. This way, there's no conflicts between a number + which is a measurement, and a number which is a flag or mask, for + the old formats that differ only in the number of parameters. I also cleaned up the parser rules for "zero or more" type lists, to + remove most of the remaining conflicts. There's still one at the + toplevel because we try to parse different types of files with the + same parser. Lastly, the symbol rules were combined into a "symbol head" rule + with a common "symbol body" rule. As a side effect, we can now reliably use units on old-style formats + again, since the *100 scale factor is only applied if the units are + not specified. + +2011-06-06 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/autoroute.c, src/macro.h: Remove memory allocation from + src/macro.h When we started using GLists for various objects, we also changed + the looping macros to allocate copies of the list in order to avoid + problems with list integrity in case items were removed during the + iteration. However, this caused memory leaks whenever there was an early return + from the middle of the list. Bug lp-792139 shows pcb using over 2Gb + of memory and crashing when optimizing rats on a large board. This patch saves the next pointer before the loop body, rather than + allocating a whole new list, to handle element deletions. Closes-bug: lp-792139 + +2011-06-01 Krzysztof KoÅ›ciuszkiewicz * k dot kosciuszkiewicz AT gmail dot com * + + * configure.ac, doc/Makefile.am, doc/gs/Makefile.inc: doc: use + pdflatex instead of latex + +2011-06-01 Krzysztof KoÅ›ciuszkiewicz * k dot kosciuszkiewicz AT gmail dot com * + + * doc/Makefile.am, doc/gs/Makefile.inc: doc: skip generation of GIF + images + +2011-06-04 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/file.h, src/parse_l.l, src/parse_y.y: Add support for reading + unit suffixes in parser Bumped PCB_FILE_VERSION up to 20110703. Removed old unit-reading code from parse_l.l since it was missing + several units that we plan to support, and the scaling was backward + for non-base units. Also, we now read all numbers as doubles, except those that need + integers (array indices and flags, mainly). All measurements are + round()ed to ints, after scaling, since that's what BDimension is + and we don't want anomalies. The old NUMBER and FLOAT terminals in parse_y have been replaced by: 1. INTEGER - an integer, unscaled 2. number - floating or integer, unscaled 3. measure - a (possibly suffixed) measurement, with non-suffixed measurements read in cmils 4. oldmeasue - non-suffixed measurement, read in mils One exception is the PolyArea[] field. This is still read in cmil^2 + until we figure out what to do with it. This way the parser works independently of PCB's internal base + units, and supports umil, cmil, mil, in, nm, um, mm, m and km unit + suffixes. The parsing code should also be clearer now since not + everything is NUMBER, with scale factors handled after-the-fact with + /100's or in the lexer. Additionally, we now allow floating-point values for all + measurements (even old-style mil fields), and pcb will allow spaces + between measurements and their suffixes. Actually using these + ``features'' will probably break tools that read .pcb files, though. + +2011-05-27 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi: Replace @extend with @noindent in docu-source If the @extend keyword is used to remove an intentation, the text + will have a linebreak, where the source has one. If @noindent is + used instead, the lines will be breaked as in normal paragraphs. + +2011-05-25 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Fix docu for 'ImportGUI()' + +2011-05-27 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi: Docu: Remove incomplete irritating sentence + +2011-05-31 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi: Remove repeated word in documentation + +2011-05-17 Alberto Maccioni * alberto dot maccioni AT gmail dot com * + + * doc/Makefile.am, doc/gcode.pcb, doc/gcode_control_img.eps, + doc/gcode_tool_path.eps, doc/pcb.texi: Add documentation for G-Code + export GUI This patch contains the documentation changes from lp:699476. It + adds a new manual section on exporters and documents the gcode + exporter. Sample pcb file is added with control image and the + resulting toolpath. Reviewed-by: Felix Ruoff * Felix AT posaunenmission dot de * + Reviewed-by: Krzysztof KoÅ›ciuszkiewicz * k dot kosciuszkiewicz AT + gmail dot com * Closes-bug: lp-699476 + +2011-05-24 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: gEDA-dev: + gerber-cleanup-0006-Change-a-couple-more-0-s-to-NULL-s.patch + +2011-05-24 Andrew Poelstra * asp11 AT sfu dot ca * + + * globalconst.h, src/hid/gerber/gerber.c: gEDA-dev: + + gerber-cleanup-0005-Remove-old-now-unused-aperture-structures-functions.patch + +2011-05-24 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: gEDA-dev: + + gerber-cleanup-0004-Use-new-aperture-functions-output-100-equal-to-origi.patch + +2011-05-24 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: gEDA-dev: + + gerber-cleanup-0003-Add-new-aperture-functions-but-don-t-use-them.patch + +2011-05-24 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: gEDA-dev: + + gerber-cleanup-0002-Remove-global-variable-dependence-from-maybe_close-a.patch + +2011-05-24 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: gEDA-dev: + gerber-cleanup-0001-Remove-unused-Aperture-structure.patch + +2011-05-25 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Fix tooltips Closes-bug: lp-786733 + +2011-05-25 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi, src/global.h: gEDA-user: PCB: option dumpmenu + missing A patch to remove this from documentation (and one variable from the + source) is appended. Kind regards, Felix Am 25.05.2011 19:11, schrieb DJ Delorie: > I think that option is a + leftover from my initial HID conversion. > > It would have been + lesstif-specific anyway, the gtk hid has its own > menu file + (gpcb-menu.res, same locations) > > > + _______________________________________________ > geda-user mailing + list > geda-user AT moria dot seul dot org > + http://www.seul.org/cgi-bin/mailman/listinfo/geda-user > >From 94458c63ae97135964c41f4966b9cdf65ee4ec27 Mon Sep 17 00:00:00 + 2001 From: Felix Ruoff * Felix AT posaunenmission dot de * Date: + Wed, 25 May 2011 14:36:34 +0200 Subject: [PATCH 50/50] Remove + commandline-option 'dumpmenu' from docu and source + +2011-05-23 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gerber/gerber.c: gEDA-dev: Gerber hid code cleanup New patch is as follows (sizeof and casts fixed): + +2010-03-18 Newell Jensen * pillar2012 AT gmail dot com * + + * src/hid/png/png.c: hid/png: draw zero-length arcs properly on + export Closes-bug: lp-699314 Reviewed-by: Patrick Bernaud * patrickb AT + chez dot com * Reviewed-by: Krzysztof KoÅ›ciuszkiewicz * k dot + kosciuszkiewicz AT gmail dot com * + +2008-01-04 Wojciech Kazubski * wk0 AT o2 dot pl * + + * lib/geda.inc, lib/misc.inc: add more crystal footprints to m4 + library Currently m4 symbols contain one footprint for crystal holder + (HC49), wich is not accurate, pin spacing is a bit too big and the + outline is too small. This patch adds several m4 crystal holder footprints of different + size, 2 or 3 pin, both standing and laying. Closes-bug: lp-699440 Reviewed-by: Bert Timmerman * bert dot + timmerman AT xs4all dot nl * Reviewed-by: Krzysztof + KoÅ›ciuszkiewicz * k dot kosciuszkiewicz AT gmail dot com * + +2011-01-02 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c: hid/gtk: use + GTK dialog for confirming file-overwrite Since GTK 2.8 GTK provides an dialog for confirming + file-overwriting. This dialog will be introduced by this patch. + Needless code which was used for this will be removed. Closes-bug: lp-699508 Reviewed-by: Krzysztof KoÅ›ciuszkiewicz * k + dot kosciuszkiewicz AT gmail dot com * + +2011-01-09 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/refcard.tex: Fix refcard (missing footnote and add rotate + buffer) The shortcut 'shift-F7' for rotating paste buffer by 90 degree is + added as suggested in bug LP-699391 (formerly sf-1112590). Fix footnote used in the tabular environment. Closes-bug: lp-699391 Reviewed-by: Krzysztof KoÅ›ciuszkiewicz * k + dot kosciuszkiewicz AT gmail dot com * + +2011-05-17 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi: Fix doku for invisibleObjectsColor (color) Closes-bug: lp-699306 + +2011-04-24 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/gpcb-menu.res: Fix warning for gtk describing menuitems With GTK+ there are no 'describing menuitems' avaiable (the + out-grayed items in lesstif-GUI). For this reason, the items in + gpcb-menu.res are ignored and a warning is displayed at the + message-log. This patch fixes this by removing these describing menuitems for the + gtk-GUI and renamed the described items to a more explaining label. + It also added mnemonics for these menu-items. Closes-bug: lp-769815 + +2010-12-28 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Cleanup conditional code + because GTK 2.12 is required now Closes-bug: lp-699510 + +2011-05-20 Colin D Bennett * colin AT gibibit dot com * + + * src/draw.c: Fix typo exporting plated vs unplated drills. Closes-bug: lp-785463 + +2011-05-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Don't register the PNG hid if there are no file + formats to use. In some cases, the GD library may not have any usable image formats + for us to use, resulting in an empty filetypes[] table. Rather than + trying to accomodate an empty table during export, it's easier (and + perhaps better) to simply not register the PNG hid in that case. + Thus, the exporter is simply not available when the table is empty. + +2011-03-23 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/file.c: Ignore *.pcb files on generating library Closes-bug: lp-699261 + +2011-05-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/flags.c, src/hid/gcode/gcode.c, + src/hid/gerber/gerber.c, src/hid/hidint.h, src/hid/nelma/nelma.c, + src/hid/ps/ps.c: Add option to specify gerber output file style. --name-style Naming style for individual gerber files Default is "fixed" which uses a fixed name (foo.top.gbr) for each + layer. "single" uses the layer's name if there's exactly one layer + in that group, else the fixed name. "first" always uses the layer + name, choosing the first layer in each group for the name. "eagle" + mode adds a three-character suffix instead of a separate type and + extension. Affects-bug: lp-700877 + +2011-05-19 DJ Delorie * dj AT delorie dot com * + + * src/move.c: Avoid top/bottom issues with layer deletion. PCB does not currently support boards without a top or bottom, so + prevent the user from deleting them (they'd need to reassign the + top/bottom groups first). + +2011-05-19 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Fix Mark size math wrt unplated holes. When computing the Mark size, check for the first pin being a hole + and use the drill size rather than the copper size. + +2011-05-19 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/buffer.c: buffer.c: Update polygon r-tree when adding a + polygon to the buffer. This resulted in a crash when rotating a buffer containing a + polygon, as the polygon r-tree associated with the buffer was NULL + despite the polygon count being non-zero. Reported-by: Gabriel Paubert * paubert AT iram dot es * + +2011-05-18 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/move.c: move.c: Adjust the object counters when moving objects + between layers This fixes a crash introduced by commit + 2ce35292b9e96da38cb56878005aba20891689eb, "Convert board objects to + GLists of g_slice allocated memory" It doesn't fix entirity of the defect reported in that bug, but it + restores the prior behaviour where PCB would hang, not segfault. Reported-by: Colin Bennett * colin AT gibibit dot com * Affects-bug: lp-783640 + +2011-05-17 Gabriel Paubert * paubert AT iram dot es * + + * src/hid/gtk/gui-output-events.c, src/hid/lesstif/menu.c: Lesstif + + GTK HIDs: Ignore ISO Level3 shift modifier key This key press is found on some international keyboards (e.g. + Spanish). If we don't ignore it, PCB complains about the key not + being tied to an action when it is pressed. From the committer, Peter Clifton * pcjc2 AT cam dot ac dot uk * + ... Thanks to Gabriel for reporting this and providing the patch + for Lesstif. I have updated the patch to make the equivalent change + to the GTK HID as well. Signed-off-By: Peter Clifton * pcjc2 AT cam dot ac dot uk * + +2011-05-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/buffer.c: buffer.c: Fix crash in SmashBufferElement The element is allocated with g_slice_new, so must be free'd with + g_slice_free. Broken since commit 2ce35292b9e96da38cb56878005aba20891689eb: Convert board objects to GLists of g_slice allocated memory + +2011-05-16 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rtree.c, src/rtree.h: rtree.c: Remove unused r_substitute() + function This function was used to update r-trees when they contained objects + changed memory location. Since we no longer shuffle objects around + when we delete them, this function is no longer required. + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: GTK/GL: Draw pretty translucent polygons + in thindraw-poly mode Eventually we need some way to configure this.. it might be nice in + non-thindraw mode too. If people want thin-draw to gain extra speed, + rather than have it actually slower (due to fill + outline), then a + way to turn it off would also be useful. + +2011-05-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: GTK/GL: Add facility to set an alpha + multiplier for the current rendering + +2011-05-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: GTK/GL: Refactor alpha handling Replace "alpha_mult" in set_gl_color_for_gc () with just explicitly + calling this the "a" (alpha) value of the colour in question. + +2011-05-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: GTK/GL: Refactor GL colour setup handling + +2011-05-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c: hid/gtk: Remove + unused gc->erase parameter from GDK and GL renderers + +2011-05-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui.h: hid/gtk: Setup custom + polygon renderer for the GL HID only + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: gtk/gl: Don't set "magenta" for a NULL + color passed to ghid_set_color The code has a strdup (name), followed by a test for name == NULL. + If name _were_ ever NULL, the strdup would crash, so we can remove + this test. + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c: hid/common/hidgl.c: Use tags on circular + contours to render them faster This lets us avoid the polygon tesselator for circular contours, and + lets us render a different number of vertices in our appoximation + depending upon zoom level. + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c: hid/common/hidgl.c: Fix vertex array state + preservation Fixes a bug with crosshair attached objects not being visible when + the grid was rendered. Reported-by: Colin D Bennett * colin AT gibibit dot com * + Closes-bug: lp-780958 + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/hidinit.c, src/hid/common/hidnogui.c, + src/hid/common/hidnogui.h, src/hid/gcode/gcode.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/hidint.h, src/hid/lesstif/main.c, src/hid/lpr/lpr.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: Refactor application of the default hidnogui HID + handlers. Replace usage of apply_default_hid() just prior to registering a HID + with an early call to the new common_nogui_init() function which + pre- applies the defaults, rather than post-replacing NULL handlers. As this was the last user of the apply_default_hid() function, + remove it. Good riddance to yet another place which had to be + updated every time a new HID member was added. The default nogui HID is now constructed explicitly by a call to + nogui_hid_get_hid (), which is called from hid_init(). This is + different to the other HIDs, as the nogui "hid" is never explicitly + registered. + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c: hid/batch: #include + "hid/common/draw_helpers.h" which was missing Fixes a compiler warning about an implicitly declared function. + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lpr/lpr.c, src/hid/ps/ps.c, src/hid/ps/ps.h: hid/ps: + Provide helper function to fill in HID members useful to other HIDs This avoids setting up the drawing routines of the lpr HID with + apply_default_hid, which is a little opaque. + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidinit.c: hid/common: Remove unused function + hid_register_gui() GUIs are registered with the same API as exporter HIDs. + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am: src/Makefile.am: Use AM_CFLAGS instead of + overriding CFLAGS directly + +2011-05-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: Apply the + default hidnogui HID to the GUIs as well. This saves them having to re-implement NOOP implementations for + functions the "nogui" HID provides a non "CRASH;" implementation + for. + +2011-05-09 Ineiev * ineiev AT users dot berlios dot de * + + * src/hid/batch/batch.c: fix batch gui + +2011-05-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/search.c: search.c: Don't allow selecting pads or pins of + locked elements The locked flag test was mistakenly being applied ot the pad or pin + its-self, not the parent element. + +2011-05-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: GTK/GL: Split out sub-compositing setup + into a separate function. + +2011-05-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: GTK/GL: Make the silk layer translucent + +2011-05-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: GTK/GL: Sub-composite objects on each + layer using the stencil buffer This avoids the highlight where translucent objects on a given layer + are drawn over each other. It enables us to have a translucent silk + screen layer and still be able to read the text. + +2011-05-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/hid.h, src/hid/common/hidnogui.c: Add end_layer() + function to HID API to mark the end of a layer's drawing This is going to be useful for the GTK/GL renderer to manage sub- + compositing translucent objects within each layer. + +2011-05-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gl.c: hid/gtk: Enable transparent lines in GL + renderer + +2011-05-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c, src/hid/common/hidgl.h, + src/hid/gtk/gtkhid-gl.c: Manage stencil bitplanes so we don't have + to clear them every time. Clearing the stencil buffer is a slow operation (especially on cards + limited by fill rate (cough.. Intel.. cough), so the more clears we + can avoid, the better. + +2011-05-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c: hid/common/hidgl.c: Tidy up polygon + contour tessleation Move the gluTessBeginPolygon and gluTessEndPolygon calls inside + tesselate_contour, rather than duplicating it in each caller. Also, fix up some comments which were out of date or inaccurate. + +2011-05-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid.h, src/hid/common/draw_helpers.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/png/png.c: HID: Remove "dicer" flag from HID structure. We don't pay any attention to this flag - always dicing the polygons + in our common_fill_pcb_polygon routine. HIDs which don't want diced + polygons implement their own hook for fill_pcb_polygon. + +2011-05-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidgl.c, src/hid/common/hidgl.h, + src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui.h: Add raw polygons + support for the GTK+GL HID, bypassing the no-holes dicer Uses the OpenGL stencil buffer to make drawing polygons with holes + faster. 1. Turn Stenciling on, updates to colour buffer off 2. Clear stencil buffer to 0 3. Paint polygon holes, setting those areas of the stencil buffer to + 1 4. Switch on stencil test (== 0), turn on updates to colour buffer 5. Paint outer polygon through areas of the stencil buffer still 0 6. Clear stencil buffer, switch off stencilling. Caveat: This function might throw up if it is used whilst drawing the mask, + since that uses stenciling as well. We don't use polygons on the + mask, so its not a a problem. (Mask cutouts for octagonal pins do + work correctly). + +2011-05-05 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Don't prematurely dismiss the progress + dialog. + +2011-05-05 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Improve lesstif progress dialog. Closing the progress dialog cancels the operation. Add a sliding + scale that shows progress. Make the dialog modal so you can't edit + the pcb while autorouting. Fix event loop to handle all pending + events and redraw. Fix elapsed time logic. + +2011-05-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Don't auto-close progress + dialog until commanded to We pass the cancel return value to our caller, but it is up to them + to dismiss the progress dialog. Utilise the response_id to determine when the dialog has been closed + or cancelled, rather than a separate stop_loop variable (which was a + legacy from the blocking gtk_dialog_run() this code was based upon. Tidy up due to resulting simplifications. + +2011-05-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/main.c: hid/lesstif: Fix testing timeout value in + lesstif_progress This looks like a typo, but was me testing different values of time + interval between processing events. + +2011-05-04 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/main.c: hid/lesstif: Simple progress() + implementation to present a cancel button Does not yet draw an actual progress bar, as I'm not familiar enough + with coding for Lesstif. + +2011-05-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: When live-drawing, only emit one via + per location I'd accidentally put the live-draw via in a place where it would + emit one via for every layer group - causing warnings in PCB's log + about dropped vias. + +2011-05-04 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-library-window.c: hid/gtk: Fix crash in library + window I missed a (GList *)->data dereference when converting to GList + object storage. Unfortunately, the parameter in question was void * + typed, so the compiler didn't notice my mistake. + +2011-05-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: Provide a progress update for the + autorouter Provide a completion metric related to what pass the auto-router is + processing, how many objects on its heap within a given pass it has + processed, and how many sub-nets it has routed from the total. The progress isn't entirely linear, but the subdivision of process + steps means it does at least march along without too many pauses. It is now possible to cancel the autorouting with a non-zero + response code from the gui's progress dialog. Tested with the GTK HID, Lesstif doesn't yet have an implementation + for HID->progress() + +2011-05-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Provide a simple progress + dialog implementation + +2011-05-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-gl.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: Fix mesa crash on + startup (for some mesa versions) I'm not sure why it crashed, but it seems that providing a realize + handler which fiddles with the GL context solves it. The underlying + problem appears to have been fixed in later mesa versions. Leaving this commit for the benefit users of broken mesa versions. + +2011-05-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac: Make --enable-gl default when building the GTK HID Lets get this feature some testing for now - we may decide to revert + the default before the next release, depending on how things + progress. + +2011-05-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac, src/Makefile.am, src/hid/common/hidgl.c, + src/hid/common/hidgl.h, src/hid/gtk/gtkhid-gl.c, src/hid/gtk/gui.h: + hid/gtk: Drop in GL renderer - WOOT! Much of the generic GL drawing stuff lives in a new common helper, + hid/common/hidgl.[ch]. Unavoidably, there is a lot of GUI specific + setup and teardown code. There are probably still bits of code in hid/gtk/gtkhid-gl.c which + could be moved to a shared place if / when other HIDs wish to use GL + rendering. Currently only rat lines are drawn transparent, as we need to sub- + composite each layer to avoid a confusing field of hightlights being + drawn where line ends overlap. configure --enable-gl now checks for the required GL, glu and + GtkGLEext. More good stuff to come soon! Credits: Algorithm to calculate number of segments to use in circular curve approximation suggested by DJ Delorie. Thanks to Krzysztof KoÅ›ciuszkiewicz for testing and debugging some issues with the GL_SCISSOR_TEST being used. An small team of dedicated testers who have provided feedback, bug reports and encoragement throught the long development of this branch. + +2011-05-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/common/flags.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/main.c, src/misc.c, src/misc.h, + src/parse_y.y: Universal use of GetValue This is a patch to make all numeric code use GetValue, to unify + parsing code and make sure everything uses the same units. Contained + is almost a complete rewrite of GetValue to simplify code that uses + funny units. Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * When committing the patch from Launchpad, I rebased it to apply with + strcasecmp and strncasecmp changed to strcmp and strncmp, as changed + by commit 31b7309764f2e4bd40141038c30f1f38309efb4a Affects-bug: lp-772027 + +2011-05-03 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c, + src/hid/png/png.c, src/misc.c, src/parse_l.l, src/report.c: Add + case-sensitivity to all unit-reading code Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * This breaks existing behaviour for any users using capitalised units + in scripts, but as in general, units ARE case sensitive, we should + not support anything other than their canonical names. Affects-bug: lp-772027 + +2011-05-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: Simplify some long if statements In a couple of cases, almost all the processing logic was burried + inside an if statement checking for validity of this processing + pass. Re-organise to test for an invalid condition, then "continue;" + the loop if that is hit. This reduces the nesting of some rather complex functions. + +2011-05-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: change.c: Fix drawing artaefacts when rotating the + buffer In commit 0213e4791f9aa4008c8d06a48c377b338f6e1a43 converting + {Hide,Restore}Crosshair calls to become notify_crosshair_changed, I + mixed up two of the true / false parameters to to + nofify_crosshair_changed. This caused the GUI to get out of sync undrawing and redrawing the + crosshair attached objects around the change. Manually checking the diff from the offending commit, I don't see + any other calls which were transposed incorrectly. Reported-by: DJ Delorie * dj AT delorie dot com * + +2011-05-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/main.c: hid/lesstif: Fix dropped crosshair + artaefacts when dragging objects. It seems that the idle_proc redraw code assumed the crosshair was + switched off upon entry, proceeding to redraw everything (and + obliterate the crosshair in the process). The final show_crosshair + (1) call only has any effect if the crosshair was notionally off + before hand. As a quick work-around (you could probably do it with less flicker + with a little more logic), ensure the crosshair is turned off just + prior to redrawing the screen - so it will switch back on correctly + afterwards. + +2011-05-01 DJ Delorie * dj AT delorie dot com * + + * src/macro.h: Fix typo in new ELEMENTARC_LOOP macro. line -> arc + +2011-05-01 DJ Delorie * dj AT delorie dot com * + + * src/insert.c: Fix polygon clears on insert. Add the calls to update polygon clearances when a point is inserted + into a line. + +2011-05-01 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/file.h: Make file version smarter. Restructure the FileVersion[] output to only output the actual + needed version, in cases where a rarely used feature requires a new + pcb. This avoids unnecessary backwards incompatibility. + +2011-05-01 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Fix conversion from world to + screen in ghid_invalidate_lr I accidentally muddled the Vx and Vy conversions routines for the + right and top coordinates. In general, this resulted in the + incorrect region being invalidated - manifesting as artaefacts on + the the screen, such as when dragging objects around. Also drop the (double) cast.. having checked, Vx and Vy take integer + arguments. I'm not sure why the rest of this file casts to double. + +2011-05-01 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Rest clip region for bg_gc, as + it is used for expose events. We set the clip region in the redraw_region() function to clip + drawing to the area which we intend to repaint, but we did not clear + the clip again. This caused expose events to be clipped to the last redraw area + rather than the required damaged area. + +2011-05-01 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Remove unused variable in + use_mask() function + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/main.c: hid/lesstif: Remove unused variable in + use_mask routine + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/mymem.c: mymem.c: Provide an optional implementation of + g_list_free_full () This API was only added in GLib 2.28, and it is just a small + convenience function. If an insufficient GLib version is found, + provide our own implementation. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid.h, src/hid/gtk/gtkhid-gdk.c, src/hid/lesstif/main.c: + Remove live drawing parameters for HID->use_mask() These are no longer used by the autorouter, so lets clean the + use_mask() interface to JUST deal with _masking_ from now on ;) + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: Utilise new HID interface for debug + drawing This gives the HID an opportunity to refuse the autorouter's + drawing. Both the GTK/GDK and Lesstif GUIs accept this drawing, so + either should be suitable for use whilst debugging workings of the + auto-router. The PCB+GL renderer (not yet landed) needs quite a lot of setup + calls to be made before it can allow the core do draw, hence the + need for this notification / permissioning. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: Fix livedraw to work with normal rendering APIs NB: This relies on the immutability of board object pointers, so + must not be applied to older PCB code-bases which would often + re-locate storage of board objects to keep them in a contiguous + array. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/autoroute.c, src/buffer.c, src/create.c, + src/djopt.c, src/draw.c, src/file.c, src/find.c, src/fontmode.c, + src/global.h, src/macro.h, src/move.c, src/mymem.c, src/mymem.h, + src/puller.c, src/rats.c, src/remove.c, src/toporouter.c: Convert + board objects to GLists of g_slice allocated memory This enables pointers for these objects to be immutable during their + lifetime, which is a _huge_ benefit for some operations. Having otherwise was becoming VERY tiresome, and was a perenial + source of bugs tripping up novice and experts of the codebase alike. Due to the risks associated with modifying the structure being + iterated over, this patch makes the relevant *_LOOP macros iterate + over a shallow copy of the underlying GList. This is slight overkill + for many cases, but until we have identified which do not modify the + data-structures it is wise to keep as we are. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/puller.c: puller.c: Re-write parts to use hash tables to store + stashed extra info This vastly simplifies some of the pointer arithmetic which was + previously used to account for underlying location changes when + objects moved. Having tested this, it produces different results than before + application. This may be due to it zapping some underlying bug + which has been removed in the patch, or perhaps more likely, that + its slightly different iteration order over the lines and arcs (due + to g_hash_table_foreach) will result in different pathologies being + hit. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/djopt.c: djopt.c: Tidy up padcleaner() using loop macros + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/djopt.c: djopt.c: Tidy up element_name_for() by using loop + macros + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/move.c: src/move.c: Gratuitous cosmetic changes Split from a future patch which ended up making these changes to + help with consistency. Pre-patching here to avoid a huge delta when + that patch lands. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/buffer.c: src/buffer.c: More cosmetic changes + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/buffer.c: src/buffer.c: Gratuitous cosmetic changes Split from a future patch which ended up making these changes to + help with consistency. Pre-patching here to avoid a huge delta when + that patch lands. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/remove.c: remove.c: Gratuitous cosmetic changes s/return (NULL)/return NULL/ Split from another patch where I just couldn't resist some tidying. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/move.c, src/move.h: Make Move*ToLayerLowLevel() local to + move.c No point in exporting these functions. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rats.c: rats.c: Tidy up FindPad() Changes are aimed to simplify the delta of a future patch relating + to object storage. Moves indexed addressing of object structures to + fewer places. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/toporouter.c: src/toporouter.c: Tidy up escape() routine Changes are aimed to simplify the delta of a future patch relating + to object storage. Moves indexed addressing of object structures to + fewer places. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/parse_y.y: parse.y: Convert an open-coded loop to use + ALLPOLYGON_LOOP + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-pinout-preview.c: hid/gtk: Remove unused code from + pinout_set_data + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Tidy up DrawEMark Changes are aimed to simplify the delta of a future patch relating + to object storage. Moves indexed addressing of object structures to + fewer places. + +2011-04-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c, src/crosshair.c, src/edif.y, src/global.h, + src/mtspace.c, src/polygon1.c: Include glib.h from global.h To avoid compiler warnings, remove the now duplicated (or + unecessary) #define ABS definitions from various files. There has been a build-time dependance on GLib since the toporouter + was added. Lets start to make use of it where it is useful. + +2011-04-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/main.c: hid/lesstif: Hook up debug drawing APIs + +2011-04-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui.h: hid/gtk: Hook up debug drawing APIs + +2011-04-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid.h, src/hid/common/hidnogui.c: Add HID apis to handle live + debug drawing from the core It is envisaved that this API should ONLY be used for debugging, not + presenting a user-interface. In general, the GUIs may have their own + special requirements for drawing the board, and this API is not + meant to allow the core to augment or present user-visible drawing. + This is reflected in the API naming. Request permission for debug drawing HID *ddraw = gui->request_debug_draw (void); Returns a HID pointer which should be used rather than the global + gui-> for making drawing calls. If the return value is NULL, then + permission has been denied, and the debug drawing must not continue. Flush pending drawing to the screen void ddraw->flush_debug_draw (void); May be implemented as a NOOP if the GUI has chosen to send the debug + drawing directly to the screen. When finished, the user must inform the GUI to clean up resources: ddraw->finish_debug_draw (void); Any remaining rendering will be flushed to the screen. + +2011-04-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/main.c: hid/lesstif: Ensure crosshair and mark + updates go to the screen The "pixmap" global might be pointing at one of the backing pixmaps + when we are called. Does not fix any known bug, just in preparation for another patch + relating to debug drawing which may leave pixmap pointing to the + backing store. + +2011-04-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Invalidate the damaged region, + not the whole view + +2011-04-29 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/print.c: Subject: PCB / Physical unit macros patch 2: print.c This patch works correctly (i.e., no change in output) for my test + file; about 6800 lines of postscript. The only differences were in + the timestamps, which naturally were slightly different. I also confirmed visually that the before and after printouts look + the same :) Rebased to git HEAD by Peter Clifton * pcjc2 AT cam dot ac dot uk * + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: Remove a couple of completely unused + debug routines + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/global.h: global.h: Remove unused OutputType members Width and + Height + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: Fixup usage of the never initialised, obsolete, + Output.{Width,Height} For the stroke handling case (relating to zooming) it isn't clear + what is correct, but for now, substitute PCB->MaxWidth and + PCB->MaxHeight. This may still leave stroke based zooming broken, but it was + CERTAINLY broken before. + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-pinout-preview.c: hid/gtk: Remove dead code (due + to bitrot) from pinout_zoom_fit() function The code tried to compare against the uninitialised, unused + Output.Width and Output.Height. Assuming these were initialised to + zero by the compiler, the conditional would always cause the + function to return FALSE. Remove the conditional, and drop the boolean return value from this + function, short-cutting the caller to the utilised code-path. This removes the (long broken) feature where by the natural size (in + pixels) of the pinout preview would be reduced if it was greater + than 3/4 of the viewport size (in pixels) of the active PCB. + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/global.h: Remove unused old{Obj,Line,Box}State members from + the OutputType structure + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/main.c: main.c: Remove setup of global graphics + contexts which are never used draw.c stashes these ones creates its own. Drop the unused ones, and + drop the stashing in draw.c + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: Use the autoroute graphics context, + not Output.fgGC I'm aiming to confine Output.* graphics contexts to draw.c for now. + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/data.c, src/data.h: Remove unused global variable + Zoom_Multiplier Along with a following commented series of numbers which git log + suggests was originally related to pre-defined zoom ratios. + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/macro.h: macro.h: Remove unused (obsolete) conversion macro + TO_PCB + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Replace use of obsolete conversion macro + TO_PCB with a constant. This changes the location tolerance in NotifyLine()'s call to + LookupConnection() from what previously evaluated to 100 internal + units, to a constant of one internal unit. This is consistent with other similar calls to LookupConnection(), + where it appears that a wide search area is not desired, so the + smallest possible value is passed. + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/data.c, src/data.h, src/file.c: Remove unused variables Xorig + and Yorig + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/macro.h: macro.h: Remove unused, obsolete conversion macros + TO_PCB_X and TO_PCB_Y + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Partially fix up some stroke handling bugs 1. Stroke event coordinates are already in PCB units, drop bogus + conversions 2. Fix incorrect variable name + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c: file.c: Write out correct cursor location in the PCB + file + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/data.c, src/data.h: data.c: Remove unused globals theScreen, + clipBox, vxl, vxh, vyl, vyh + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/print.c, src/print.h: print.c: Pass an explicit + graphics context to PrintFab() and friends This is a step towards being able to move the active graphics + contexts out of the global scope. + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/global.h, src/main.c: Remove unused Output.GridGC variable + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rtree.c: rtree.c: Remove old X11 based debug drawing code The core doesn't do drawing any more.. and can't assume that the + GUI's graphics contexts are actually X11 or GDK graphics context, so + this code can't work any more - remove it. + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c, src/hid/common/extents.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui.h, + src/hid/lesstif/main.c, src/hid/png/png.c, src/hid/ps/eps.c: HIDs: + Remove NOOP set_draw_faded implementations + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidnogui.c: hid: Provided non-CRASH default + implementation of HID->set_draw_faded There is no point in various HIDs providing their own NOOP + implementation + +2011-04-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid.h, src/hid/batch/batch.c, src/hid/common/extents.c, + src/hid/common/hidnogui.c, src/hid/gcode/gcode.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui.h, + src/hid/lesstif/main.c, src/hid/nelma/nelma.c, src/hid/png/png.c, + src/hid/ps/eps.c, src/hid/ps/ps.c: hid: Remove unused + set_line_cap_angle API + +2011-04-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui.h: hid/gtk: Make + ghid_show_crosshair() local to the GDK implementation + +2011-04-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Invalidate the crosshair + rather than drawing it immediately + +2011-04-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui.h: Revert "hid/gtk: Add hooks to tell the render + when we start/stop drawing" This reverts commit 332cb8ddc1cc032ac29c7d2b9a0051ccc228b6da. Since crosshair updates are now handled by notifications to the GUI, + this isn't required for the forthcoming PCB+GL support. + +2011-04-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Avoid extra crosshair + and attached object redraws The crosshair movement is handled by a notify_crosshair_change() + call in ghid_note_event_location(). + +2011-04-27 Andrew Poelstra * asp11 AT sfu dot ca * + + * globalconst.h, src/action.c, src/autoplace.c, src/buffer.c, + src/change.c, src/const.h, src/create.c, src/djopt.c, src/find.c, + src/hid/batch/batch.c, src/hid/gcode/gcode.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-drc-window.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h, + src/hid/lesstif/dialogs.c, src/hid/lesstif/lesstif.h, + src/hid/lesstif/main.c, src/hid/lesstif/styles.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c, src/main.c, src/misc.c, src/parse_l.l, + src/print.c, src/report.c, src/vendor.c: PCB / Physical unit macros + patch Specify various constants in physical units, converting to PCB + internal units using macros. When reporting to the user (or + exporting), convert dimensions to physical units using macros so the + code does not rely on details of PCB's internal coordinates in so + many places. + +2011-04-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove old commented debug printf + +2011-04-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove unused function thin_callback() + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/crosshair.h, src/global.h, + src/hid/lesstif/main.c: Move crosshair on / off functionality into + lesstif HID. Lesstif is the only GUI which turns attached objects on and off, + when the mouse leaves the viewport, so it might as well manage it + internally. + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/hid.h, src/hid/common/hidnogui.c, + src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui.h, src/hid/lesstif/main.c: Give the HIDs control + over attached object (crosshair, mark) drawing This is required if a renderer doesn't want to follow the current + drawing model where it is assumed the core can call the HID's + drawing APIs at any arbitrary point in time. Expose some API from crosshair.c to perform the actual drawing on + demand, and add hooks to the HID structure to notify the GUI when it + would previously have called the crosshair or mark drawing routines. This allows renderers with defined setup and tear-down requirements + around drawing to execute them before the objects are drawn. CrosshairOn() and CrosshairOff() now simply set the Crosshair.On + flag and call the appropriate notification hooks. This commit replaces all HideCrosshair() and RestoreCrosshair() + calls with the new hooks notify_{crosshair|mark}_changed(), with an + argument specifying whether a change is about to happen (false + argument), or has been completed (true argument). + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Convert some explicit mark redrawing to + notification + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/crosshair.h, src/set.c: Separate out mark + change notification from crosshair change notification Hook it up to notify the crosshair (which also redraws the mark) for + now. + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/buffer.c, src/crosshair.c, src/crosshair.h, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui-output-events.c, src/hid/lesstif/main.c, + src/misc.c, src/set.c: Rename HideCrosshair() and RestoreCrosshair() Whist this is a tedious rename which will probably have implications + for some plugins, it helps to clarify what is going on with the + crosshair across forthcoming patches which put it under the control + of the GUIs. The old APIs are retained for backwards compatibility with plugins, + and will print a one-shot warning for each which is called. + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: DrawMark from + ghid_invalidate_all() as well as DrawAttached + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: Let the GUIs manage the crosshair across a redraw Removes several {Hide/Restore}Crosshair() calls from the GTK HID. These are not requried any more, as they are followed by + invalidate_all() calls which take care of the crosshair as well. Changes to draw.c were tested not to affect Lesstif HID + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui.h: hid/gtk: Remove duplicated prototype + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove obsolete comment + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove clip_box global variable in favour of a + more targeted one Used for polygon clipping during drawing. + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: EraseRat() should just gather the affected + area These were missed (or incorrectly converted) in the previous patch + series which split gathering routines from drawing routines. Tidy up DrawRat() to be consistent with the new code in EraseRat() + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Separate out common code for drawing holes Makes things a bit clearer + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove Gathering variable This variable is no longer needed since the "Gathering" Draw* + functions are separate from the draw_... implementations which are + triggered by the GUI calling for a repaint of the gathered area. + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" routines from real drawing + routines (Text) Moves code from DrawRegularText() into its only caller + text_callback() + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" routines from real drawing + routines (Polygons) Moves code from DrawPlainPolygon() into its only caller + poly_callback() + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" routines from real drawing + routines (Arcs) + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" routines from real drawing + routines (Lines) + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" from real drawing routines + (Rats) + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" routines from real drawing + routines (Pads) + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" routines from real drawing + routines (Pins + Vias) + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" from real drawing routines + (Element Pins and Pads) + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" from real drawing routines + (Element names) + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" from real drawing routines + (Element Package) + +2011-04-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Split "Gathering" from real drawing routines + (Element) + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Fold DrawHole into its only caller, + hole_callback + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Move DrawPlainPin and DrawPlainVia into their + only callers Make their code part of pin_callback and via_callback. Drop the Gathering tests within this code, as their only callers are + within a block where Gathering is definately set. + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/autoplace.c, src/autoroute.c, src/draw.c, + src/draw.h, src/find.c, src/toporouter.c, src/vendor.c: draw.c: + Remove API ClearAndRedrawOutput(), in favour of Redraw(). These do the same thing anyway. + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/draw.c, src/draw.h, src/set.c: draw.c: Remove + UpdateAll() API, in favour of Redraw(), which is identical + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/draw.c, src/draw.h: draw.c: Expose local + Redraw() function, and remove wrapper RedrawOutput() Within the one caller ActionDisplay, combine the F_ClearAndRedraw + and F_Redraw cases which have exactly the same effect. + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Drop unused area parameters from Redraw(...) + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Only set Gathering during + hid_expose_callback() Removes setting of Gathering to false prior to calling UpdateAll() + in ClearAndRedrawOutput(), and removes setting of Gathering to true + after calling gui->invalidate_all() in Redraw() + +2011-04-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : Regenerate test golden files for the png output hid The colour drawn for vias changed due to the fix in commit + c095adf5ea890284cddc2730944b980ac1275109 (Build was broken due to the above commit until commit + c9b915d7f2f49f5ebde0abeb5756b1e11e756edc) + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Use the ON_SIDE() macro rather then open-code + the test + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Add a DrawPaste() helper function for paste + layers + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c, src/misc.h: misc.c: Add query function IsPasteEmpty() + to query a paste layer is empty + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/macro.h: Make the ON_SIDE() macro global, not + local do draw.c + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/draw_helpers.c: hid/common: Fix + common_thindraw_pcb_pad()'s handling of square pads I made a mistake in a logic test when simplifying this routine in + commit 4efcedeeac06cd4d5e559a7fe0a0ee8685f2137a This caused slanted rendering of horizontal or vertical pads. + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Rename the "screen" parameter of + DrawLayerGroup to "drawn_area" (For consistency with other code in draw.c) + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Use DrawPPV() where we can to save duplication + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Change PrintAssembly() to use a layer side + parameter Drops the "swap_ident" parameter in favour of a more explicit "side" + parameter. Also drops the side_group parameter, as we can easily + determine that from the requested side to draw. + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Change DrawSilk() to use a layer side + parameter, not SWAP_IDENT + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Make DrawPPV() always draw for non gui HIDs, rather than doing_assy The gui HIDs don't accept the assembly drawaing, so testing for + !gui->gui will catch this case, and we can drop the doing_assy + override for PCB->PinOn and PCB->ViaOn + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Change DrawTop() to DrawPPV(), and teach it to + work for any layer (PPV stands for Pins, Pads and Vias). Extend its functionality to + work for pins and vias on any layer. + +2011-04-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Rename DrawTop() "screen" parameter + "drawn_area" For consistency with other code in draw.c + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Fix order of farside object drawing Backside silk should be drawn before bakside pads + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Add prototype for via_callback Fixes breakage since commit c095adf5ea890284cddc2730944b980ac1275109 + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove a couple of redundant if statements The outer if statement already ensures this code-path isn't followed + for a gui hid.. don't repeat ourselves. One statement will always + return false, hence is dead code - the other is always true. + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Use the via callback when drawing vias. Since this code-path is only hit for exporters, (and the only + difference between the pin and via callback is the drawing colour) + it is not likely this matters, but lets be correct. + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Add layer side parameter to DrawMask() Don't use the global variable SWAP_IDENT to choose which side to + draw. + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Combine front and back element and name + callbacks Pass an integer "side" parameter to determine which is desired + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/macro.h: Remove commented TEXT_IS_VISIBLE implementation I'm cleaning up code which uses SWAP_IDENT, and this comment scored + a hit. + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/change.c, src/copy.c, src/draw.c, src/draw.h, + src/find.c, src/hid/gtk/gui-drc-window.c, src/insert.c, src/move.c, + src/polygon.c, src/rats.c, src/remove.c, src/rotate.c, + src/select.c, src/toporouter.c, src/undo.c: draw.c: Remove unused + parameter from various calls: DrawObject DrawVia DrawViaName DrawLine DrawArc DrawText DrawRegularText DrawPolygon DrawElement DrawElementPackage DrawElementPackageLowLevel DrawElementName DrawElementPinsAndPads DrawRat DrawPin DrawPinName DrawPad DrawPadName + +2011-04-23 Andrew Poelstra * asp11 AT sfu dot ca * + + * src/hid/png/png.c: hid/png: Fix incorrect um unit conversion in + bloat parser. (Split from a larger patch by Peter Clifton * pcjc2 AT cam dot ac + dot uk *) + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * globalconst.h: globalconst.h: Remove some unused constants + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/png/png.c: hid/png: Fix segfault when no image formats are + configured in. Based on a patch by Felix Ruoff * Felix AT posaunenmission dot de * Catch the case where the selected image format is actually the NULL + terminator at the end of the format list. This happens when the list + is empty. Don't strcmp against that terminator! Closes-bug: lp-699290 (sf-2669324) + +2011-04-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/png/png.c: Revert "Fix potential segfault" This reverts commit 2d2040e92d5ebb069af42567855055b096532e71. This patch causes segfaults in the GTK and Lesstif hids, so + reverting, as it removes the required NULL termination from an + attribute enumeration. Any code which can't deal with an empty + enumeration list should be fixed instead. Reopens-bug: lp-699290 (sf-2669324) Closes-bug: lp-769336 + +2011-04-22 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/main.c, src/misc.c, src/polygon.c, src/polygon.h, + src/thermal.c: Fix geometry errors caused by commit + 2d8dc8a3a3a55158b4e6278dd9f40588e4111c2d This fixes up problems from the following commit: [PATCH] fix bug 2793480 (vias/arcs-to-polygon clearances) frac_circle(): introduce radius_adjustment factor to make the polygon outline the arc rather than connet points on the arc ArcPolyNoIntersect(): compute number of segments so that polygon diverges from the arc no more than 0.02 of required thickness; adjust outer "arc" radius like in + frac_circle() The object bounding boxes for arcs, vias, lines and rounded pads + which determine the maximum area affected by that object were no + longer correct, leading to artaefacts when doing incremental polygon + processing. It also lead to missing fragments in (the non-curved + and x type + thermals). These are also fixed up by this patch. + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Tidy up hole_callback routine + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove unnecessary pin_info struct. The argument specifying whether to clear pins was always true in any + case where clearPin_callback was called (the only user of this + info). + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/macro.h: macro.h: Remove unused X11 specific macros + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/macro.h: macro.h: Remove unused object visibility macros + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/line.c, src/macro.h: Remove some old unused + coordinate conversion macros from the core Sadly, there are still some left to expunge which are being used - + and their usage appears broken in many cases! + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * tests/golden/hid_gcode1/Makefile.am, + tests/golden/hid_gcode10/Makefile.am, + tests/golden/hid_gcode11/Makefile.am, + tests/golden/hid_gcode2/Makefile.am, + tests/golden/hid_gcode3/Makefile.am, + tests/golden/hid_gcode4/Makefile.am, + tests/golden/hid_gcode5/Makefile.am, + tests/golden/hid_gcode6/Makefile.am, + tests/golden/hid_gcode7/Makefile.am, + tests/golden/hid_gcode8/Makefile.am, + tests/golden/hid_gcode9/Makefile.am, + tests/golden/hid_gerber1/Makefile.am, + tests/golden/hid_gerber2/Makefile.am: Fix test-suite harder Fixup Makefile.am files to match renames in last commit + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * tests/golden/hid_gcode1/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode1/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode1/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode1/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode10/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode10/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode10/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode10/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode11/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode11/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode11/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode11/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode2/out.back.cnc, + tests/golden/hid_gcode2/out.bottom.cnc, + tests/golden/hid_gcode2/out.front.cnc, + tests/golden/hid_gcode2/out.top.cnc, + tests/golden/hid_gcode3/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode3/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode3/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode3/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode4/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode4/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode4/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode4/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode5/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode5/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode5/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode5/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode6/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode6/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode6/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode6/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode7/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode7/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode7/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode7/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode8/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode8/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode8/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode8/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gcode9/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode9/gcode_oneline.gcode.bottom.cnc, + tests/golden/hid_gcode9/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode9/gcode_oneline.gcode.top.cnc, + tests/golden/hid_gerber1/gerber_oneline.back.gbr, + tests/golden/hid_gerber1/gerber_oneline.bottom.gbr, + tests/golden/hid_gerber1/gerber_oneline.front.gbr, + tests/golden/hid_gerber1/gerber_oneline.top.gbr, + tests/golden/hid_gerber2/out.back.gbr, + tests/golden/hid_gerber2/out.bottom.gbr, + tests/golden/hid_gerber2/out.front.gbr, + tests/golden/hid_gerber2/out.top.gbr, tests/tests.list: Fix + test-suite files to match component->front and solder->back rename Test-suite now passes again. + +2011-04-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: hid/common: Draw the hole outline for pins / vias + being moved or placed + +2011-04-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Use a dummy via structure to draw + vias being created + +2011-04-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/draw.c, src/global.h, src/hid.h, + src/hid/common/draw_helpers.c, src/hid/common/draw_helpers.h, + src/hid/common/hidnogui.c: Consolidate pin / via drawing routines, + moving them under the HID API Adds two new HID APIs, fill_pcb_pv and thindraw_pcb_pv, splitting + drawing code from DrawPadLowlevel() to common_fill_pcb_pv() and + common_thindraw_pcb_pv() in hid/common/draw_helpers.c. Octagonal vias and pins are now correctly drawn when attached to the + cursor. + +2011-04-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/draw.c, src/global.h, src/hid.h, + src/hid/common/draw_helpers.c, src/hid/common/draw_helpers.h, + src/hid/common/hidnogui.c: Consolidate pad drawing routines, moving + them under the HID API Adds two new HID APIs, fill_pcb_pad and thindraw_pcb_pad, splitting + drawing code from DrawPadLowlevel() to common_fill_pcb_pad() and + common_thindraw_pcbpad() in hid/common/draw_helpers.c. I simplified the code somewhat as I moved it, reducing the number of + special cases. gui->{thindraw|fill}_pcb_pad() is called from DrawPadLowlevel(), and + is used to replace an incomplete thindraw implementation for pads in + XORDrawElement(). Outlines for angled pads are now drawn in their entirety when + attached to the cursor, not just their center line, and rounded end + pads are also now drawn correctly in this mode. + +2011-04-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c, src/hid/common/draw_helpers.c, + src/hid/common/draw_helpers.h, src/hid/common/extents.c, + src/hid/gcode/gcode.c, src/hid/gerber/gerber.c, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: hid/common: Provide a helper function for HIDs to + use drawing helpers Gives the following changes to various HIDs: extents: now has thindraw_polygon implemented - should not be an + issue gcode: now has thindraw_polygon implemented - should not + be an issue gerber: now has thindraw_polygon implemented - should + not be an issue nelma: now has thindraw_polygon implemented - + should not be an issue png: now has thindraw_polygon implemented + - should not be an issue eps: now has thindraw_polygon + implemented - should not be an issue ps: now has + thindraw_polygon implemented - should not be an issue batch: no + longer has NOP fill_pcb_polygon and thindraw_pcb_polygon routines - + should not be an issue, as the drawing calls the common helper + routines use are still NOPs for the batch HID. + +2011-04-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/draw_helpers.c: hid/common: Some formatting changes + in draw_helpers.c + +2011-04-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gcode/gcode.c, src/hid/png/png.c: Add missing HID + structure zero initialisation for gcode and png HIDs. Missed from commit commit d67f4335b5d4f97330448b833ea1bf04377c3a57 "Initialise the HID vtable by function, rather than as a struct + initialiser." I missed the memset from these two HIDs. + +2011-04-19 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Fix damage area computation We should reset the left and top bounds to MAXINT, and the right and + bottom bounds to -MAXINT. This way the correct bounds are computed + when gathering. The code previously every coordinate to 0, meaning that the box + encompasing (0, 0) up to the (max_x, max_y) would be invalidated, + rather than (min_x, min_y) to (max_x, max_y). No improvement is going to be seen, as both the GTK and Lesstif GUIs + ignore the damaged bounds and repaint the whole screen each time - + it is just for correctness. + +2011-04-18 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/crosshair.h, src/hid/lesstif/main.c: Don't + abuse CrosshairOn() API to force a redraw. Expose DrawAttached() to the HIDs so they can call it themselves, + and don't have to cheat by forcing Crosshair.On to false. Make DrawAttached() and DrawMark() a NOP if the relevant item is not + being shown. Ie. if !Crosshair.On, both functions draw nothing. If + !Marked.status, DrawMark() draws nothing. A minor change is required in CrosshairOff() to XOR un-draw before + switching the flag to off. Not known to fix any particular bug, but it is possible that the + crosshair should not be drawn at a given point (due to changes + taking place inside a HideCrosshair() / RestoreCrosshair() pair. Tested with Lesstif and GTK HIDs. + +2011-04-18 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/hid/gtk/gui-output-events.c: hid/gtk: Don't + call CrosshairOn() when re-entering the viewport The GTK HID doesn't turn the crosshair off, so we don't turn it back + on if we default to having it switched on in the first place. Make + that default change, and remove the CrosshairOn() call. (Also tested not to break the Lesstif HID). + +2011-04-18 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/extents.c, src/hid/gcode/gcode.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/hid/lpr/lpr.c, src/hid/nelma/nelma.c, + src/hid/nelma/nelma.h, src/hid/png/png.c, src/hid/png/png.h, + src/hid/ps/eps.c, src/hid/ps/ps.c: Initialise the HID vtable by + function, rather than as a struct initialiser. This allows adding new items without having to update every HID. It + also reduces bloat for those HIDs which have a lot of zero entries. + +2011-04-12 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Add t/b synonyms for group list Allow 't' as well as 'c', and 'b' as well as 's', in the groups + string. + +2011-03-31 Ineiev * ineiev AT users dot berlios dot de * + + * src/hid/png/png.c: Fix potential segfault Closes-bug: lp-699290 (sf-2669324) + +2011-04-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/flags.c: Update file names to top/bottom convention Yes, I know this will break some scripts - mine included. I + couldn't think of a good way to auto-detect when the old names + should be used. + +2011-04-11 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Remove (now) unused variable. + +2011-04-11 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Don't draw an empty outline layer. If the design has an outline layer, and it's empty, draw an outline + anyway - around the whole work area. + +2011-04-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Fix PS rect/outline logic PS's draw_rect was actually doing a fill_rect. Fixed. If the design has an outline layer, draw it in more of the cases + where we would draw the synthetic outline. + +2011-04-11 DJ Delorie * dj AT delorie dot com * + + * src/misc.c, src/misc.h: Add IsEmpty functions Add functions to test if a given layer or layer group is "empty" - + i.e. has none of its own drawing items on it. + +2011-04-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Fix gerber output Use the correct DRC minimums for drawn outlines on silk and copper + layers. Draw rectangles as unfilled, not filled. + +2011-04-11 DJ Delorie * dj AT delorie dot com * + + * src/main.c: Tweak default layer stack. Change the default layer stack to reflect a six layer board, + allowing for 2 or 4 layer designs with the same stack. Add an + outline layer by default. Change the default names from + "component/solder" to "top/bottom" to be consistent with names used + by popular packages. + +2011-04-08 Krzysztof Kościuszkiewicz * k dot kosciuszkiewicz AT gmail dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Change menu location of "Move + to current layer" To be consistent with other menu actions (like Flip/Flip selected): * "Move to current layer" is now located in the Info > Key + bindings, * "Move selected to current layer" is now located in the + Select menu. Closes-bug: lp-699106 + +2011-04-01 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gui-dialog.c: hid/gtk: Select adequate folder in + file-save-dialog Since now, the 'Save layout as' - dialog gives full path and + filename in name-line, but did not switches to given path in + folder-list (lower part of the dialog). For me, this is + uncomfortable, e.g. if I just want to switch to another near-by - + folder. This solution was suggested by Krzysztof Kościuszkiewicz. Thank + you! Closes-lp: 699491 Reviewed-by: Krzysztof Kościuszkiewicz * k dot + kosciuszkiewicz AT gmail dot com * + +2011-04-07 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gui-library-window.c: hid/gtk: expand library tree + after filtering This patch changes the behavior of the library selection dialog. + After filtering by name is applied the tree view of matching + components is automatically expanded so that all leafs are + immediately selectable. The tree view is collapsed when the filter + is cleared. Patch is adapted from Krzysztof Kosciuszkiewicz's patch for gschem. Closes-bug: lp-753643 Reviewed-by: Krzysztof Kościuszkiewicz * k + dot kosciuszkiewicz AT gmail dot com * + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c, src/hid/gtk/gui.h: hid/gtk: + Consolidate the mechanisms used for holding off scrollbar updates Don't duplicate mechanisms - it is confusing! + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Remove unused variables + from {h,v}_adjument_changed_cb() + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui-output-events.c: + hid/gtk: Only redraw the crosshair when necessary If we're about to repaint the screen from our backing pixmap, there + is no point un-XOR drawing our current crosshair first. + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: Don't issue CrosshairOff() from the + DestroyCrosshair() function. We shouldn't assume we can make call GUI calls at this point. NB: The DestroyCrosshair() function is actually unused! + +2011-04-05 Ed Maste * emaste AT freebsd dot org * + + * configure.ac: Small change to get pcb to build on FreeBSD Add check for wish 8.5 + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Remove some unneded crosshair hide/restore + calls Removed calls from various actions which should not have any effect + on the objects drawn attached to the crosshair. + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: In ActionLoadFrom(), only hide the + crosshair where required + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: In ActionUnselect(), only hide the + crosshair where required + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: In ActionSelect(), only hide the crosshair + where required + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: In ActionDisplay(), Only invalidate + crosshair where needed Rather than wrapping the whole function in a crosshair hide/restore, + only do it for the sub-paths which require it. + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Combine the crosshair / restore for all + paths in click_cb() Reduces code duplication in the different sub-paths of this routine. + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/buffer.c, src/hid/gtk/gui-command-window.c, + src/report.c: Don't undraw the crosshair attached object when + showing dialogue prompts + +2011-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Remove commented out line of code Left from commit 089fbaf59c78fe75475db737e7e2827cd745d570 (Initial + C++ compatibility patch) + +2011-04-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : Commit hook test This commit is deliberately blank, but should close bug lp-700413 + due to the line below. Closes-bug: lp-700413 + +2011-02-11 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/draw.c: Remove unused function DrawVText() used GDK; it shouldn't have been implemented this way in + any case. Closes-bug: lp-717294 + +2011-03-23 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gui-dialog-print.c: Fix warning at exporting png with + GTK+ GUI An 'Gtk-CRITICAL'-Error was thrown on opening the png-exporter + dialog because there is no default-string for the 'png-bloat' + option. Closes-bug: lp-740526 + +2011-03-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: Remove comment which is no longer + relevant + +2011-03-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/buffer.c, src/crosshair.c, src/crosshair.h, + src/draw.c, src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-command-window.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/main.c, src/misc.c, src/report.c, src/set.c: Remove + BlockToo argument from various crosshair hide / restore functions Goodness knows what it is supposed to do, but everything appears to + work fine without it. For the majority of cases, the argument passed + is true. When passed as false, the effect is to surpress drawing an attached + selection / rubberband rectangle in the AttachedBox.state == + STATE_THIRD state. Digging through the version control history, this code appears to + have been present since the project was initially placed under CVS + control. The 23 places this argument was previously false are: ActionMovePointer - HideCrosshair (false); - RestoreCrosshair (false); EventMoveCrosshair - RestoreCrosshair (false); ActionDisplay - RestoreCrosshair (false); ActionFreeRotateBuffer - HideCrosshair(false); - RestoreCrosshair(false); MoveCrosshairAbsolute - HideCrosshair (false); ghid_invalidate_all - RestoreCrosshair (FALSE); ScrollAction (GTK HID) - HideCrosshair (FALSE); - RestoreCrosshair (FALSE); ghid_port_ranges_changed - HideCrosshair (FALSE); ghid_note_event_location - RestoreCrosshair (false); idle_proc (Lesstif HID) - CrosshairOn (0); CenterDisplay - RestoreCrosshair(false); ReportDialog - HideCrosshair (false); - RestoreCrosshair (false); ReportFoundPins - HideCrosshair (false); - RestoreCrosshair (false); ReportNetLength - HideCrosshair (false); - RestoreCrosshair (false); SetLocalRef - RestoreCrosshair (false); - HideCrosshair (false); - RestoreCrosshair (false); + +2011-03-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/crosshair.c, src/crosshair.h: Remove visibility + overriding argument from DrawMark() Because of the places it was used, we can gaurantee this doesn't + change any behaviour - the mark visibility status is always correct, + so doesn't need overriding. + +2011-03-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: g_return_if_reached() for + receipt of gui->use_mask(HID_MASK_BEFORE) This means one less untranslated printf which is never hit. If for + some reason the core sends us one of these - logging a warning and + continuing is probably better than a hard abort() + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Don't make GUI drawing calls to erase objects Changing the colour here is unnecessary (as drawing is deferred). + Delete the gui->set_color() calls. + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/change.c, src/find.c: Allow zero clearance pads and pins to + touch polygons This was already supported for vias, lets be consistent. + +2011-03-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Fix mask drawing at high zooms (only draw the + bit on-screen) This probably papers over a bug in the GTK hid's fill_rect routine, + as the only reason this should fix anything is because it avoids + coordinate overflow at high zoom. The GTK hid really ought to clip coords to the screen before + transforming them for rendering. + +2011-03-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Tidy up mask drawing code Since the gerber HID now supports putting the outline on various + layers, we can also safely remove the commented out code for doing + that in draw.c + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Make benchmark() + implementation suit multiple drawing models Invalidate and process updates, rather than calling redraw directly. + This suits the coming GL renderer which will use an + invalidate/expose model. + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui.h: hid/gtk: Move set_layer function into GDK + specific code. Not that this is particularly GDK specific, just that the GL + renderer hopefully coming soon needs to do some extra work. + +2011-03-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui.h: hid/gtk: Add hooks to tell the render when we + start/stop drawing This is necessary if the renderer requires certain state to be + configured before its drawing calls can be operated. + +2011-03-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui-pinout-preview.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Add hooks + for the renderer to initalise drawing widgets + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Remove some unnecessary + gtk_widget_realize() calls. + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gerber/gerber.c: hid/gerber: Remove unused variables + outline_trace_size and absolute Left over accidentally from commit + 35b137c3e193471e07f0873dfb149cebd059dca2 + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: hid/gtk: Create a + private structure for the gdk render backend This is in an effort to isolate some of its internals from the rest + of the GTK hid. Also create a hook for configure events on the main drawing area to + allow the renderer to reconfigure its-self as necessary as the area + changes in size. + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-pinout-preview.c, + src/hid/gtk/gui-render-pixmap.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: hid/gtk: Move more GDK specific routines to + gtkhid-gdk.c + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gerber/gerber.c: hid/gerber: Remove option for thickness + of auto-generated outline layer We don't mess with the thickness of the user's hand-drawn outline, + and this option implies that we do. I cannot think of a sensible way + to present the option without confusing the user, so lets remove it. Whilst the previous default of 10 mil was fine, 8 mil matches the + width used on the fab drawing, so I have changed to that value. + +2011-03-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/print.c: src/print.c: Fix fab drawing width text annotation. The text hard-coded that the outline is 10mil, in fact it is not, + the current #define sets it at 8 mil. Report the actual value used. + +2011-03-23 Ineiev * ineiev AT users dot berlios dot de * + + * src/hid/gtk/gui-misc.c: suppress annoying decimals in relative + coordinates The threshold for non-aligned object is increased because in case of + relative coordinates the round-off error may double. Closes-bug: lp-699452 (sf-2117383) Closes-bug: lp-699169 + (sf-1741659) + +2011-03-22 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/global.h: Save footprints as footprints. If the user loads a footprint as a PCB (i.e. File->Load) and tries + to save it, save only the elements in the pcb, not the whole pcb. + +2011-03-22 DJ Delorie * dj AT delorie dot com * + + * src/misc.c, src/misc.h: Fix mkdir() in plugins. Plugins include misc.h without having a valid config.h, which meant + they'd get a build error. This patch moves the error check into + pcb's misc.c, which always has a config.h, and lets plugins have a + MKDIR() macro that uses pcb's detected values. + +2011-03-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Add copy-outline mode New gerber export options to copy the outline layer onto one or more + other layers. Some fabs want the outline separate; others want it + on a "working" layer. + +2011-03-22 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Allow space between value and units in GetValue(). + +2011-03-22 Ineiev * ineiev AT users dot berlios dot de * + + * src/polygon.c: simplify an expression return to the form written in d5d894d977e610 (lost in + 2d8dc8a3a3a551) + +2011-03-06 Ineiev * ineiev AT users dot berlios dot de * + + * src/action.c, src/const.h, src/crosshair.c, src/gpcb-menu.res, + src/hid/gtk/gui-misc.c, src/misc.c, src/misc.h, src/pcb-menu.res, + src/set.c, src/set.h: (GTK HID) fix annoying decimals When in metric grid mode, the coordinates are displayed with + irregular tails of nines, e.g. "116.9998 43.9999" when the grid is + set to 1mm. The fix includes using more precise metric-to-imperial and crosshair + calculations and fitting crosshair values into metric grids. To address the issue in a really reliable way we need at least one + more separate variable, to explicitly mark the grid as metric (as + opposed to the displayed units); this flag should also be saved in + PCB files. First reported by Kai-Martin Knaak. Closes-bug: lp-699452 (sf-2117383) Closes-bug: lp-699169 + (sf-1741659) + +2009-11-27 Ineiev * ineiev AT users dot berlios dot de * + + * doc/pcb.texi: fix sections hierarhy + +2010-12-07 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/action.c, src/buffer.c, src/djopt.c, src/fontmode.c, + src/hid/gtk/gui-top-window.c, src/move.c: Cleanup action + documentation Add missing documentation * Display(ToggleLockNames) * Display(ToggleOnlyNames) * Select(Object) Remove invalid documentation * Connection(Measure) * Display(Scroll, Direction) * Display(Step, direction, amount, units) Cosmetic modifications: * dots at end of sentences * capital letter at start of sentences * remove some curious signs at the beginning of some lines. * fix a couple of typos Closes-bug: lp-699506 + +2011-03-12 DJ Delorie * dj AT delorie dot com * + + * src/misc.h: Make io.h inclusion conditional on the mingw case. + +2011-01-23 Bob Paddock * bobpspam AT gmail dot com * + + * configure.ac, m4/m4_ax_func_mkdir.m4, src/hid/common/hidinit.c, + src/hid/gtk/gui-config.c, src/misc.h: mkdir() takes only one + argument under WIN32. Add check whether mkdir() is mkdir or _mkdir, and whether it takes + one or two arguments. WIN32 mkdir takes one argument and POSIX + takes two. Use MKDIR() macro from misc.h everyplace to get correct behavior + depending on platform. + +2011-01-23 Bob Paddock * bobpspam AT gmail dot com * + + * configure.ac, src/action.c, src/hid/png/png.c, src/main.c: Use + rand() in place of random(). The 'random', 'srandom', functions are those from BSD derived + UNIX's, and may not be available under WIN32. The 'rand' and + 'srand' functions are required by the ANSI standard. rand(): Return a random integer between 0 and RAND_MAX inclusive. + random(): Return a random long integer between 0 and RAND_MAX + inclusive. Standard MinGW stdlib.h only supports rand() and RAND_MAX is limited + to the 32 bit value of 32767, which is significantly smaller than + that returned by random(). This turncation of range should not + effect usage in our application. Added srand( time(NULL) ) to main.c to set the seed. + +2010-12-31 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * po/LINGUAS: Added an entry for the Dutch translation in LINGUAS. + +2010-12-31 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * po/nl.po: First issue of the Dutch translation. + +2011-02-14 Krzysztof Kosciuszkiewicz * k dot kosciuszkiewicz AT gmail dot com * + + * src/hid/gtk/gui-library-window.c: hid/gtk: handle CTRL-C in + library window Handle CTRL-C keypress in library window and copy name of the + selected component into the default GTK clipboard. The change facilitates workflow where one browses footprints in pcb + and copies component names into gattrib or gschem. + +2011-03-10 Felix Ruoff * Felix AT posaunenmission dot de * + + * doc/pcb.texi: Describe layer groupings in GTK+ GUI Add information to the documentation where the 'Edit Layer Grouping' + option can be found in the GTK+ GUI. Closes-bug: lp-699175 + +2011-03-07 Kai-Martin Knaak * kmk AT lilalaser dot de * + + * doc/pcb.texi: expand the regexp appendix in pcb manual * Add special character "|" to concatenate * Add special character $" to denote the end of a string * Mention the special meaning of brackets. * Make the table of examples conform to "example -> description" rather than the other way round. * Add examples for the use of "|", "[]" and "{}". Closes-bug: lp-723931 + +2011-01-31 Markus Hitter * mah AT jump-ing dot de * + + * gts/.gitignore, tests/.gitignore: Clean up "git status" output. Closes-bug: lp-710719 + +2011-02-25 Stephen Ecob * silicon dot on dot inspiration AT gmail dot com * + + * src/draw.c: better heuristics for paste openings Prohibit paste windows wider than mask ones (suggested by Kai-Martin + Knaak). Suppress zero width paste windows (suggested by DJ Delorie). Discussed on + http://www.seul.org/pipermail/geda-user/2011-February/052413.html Closes-bug: lp-718342 + +2011-02-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: Fix auto-router - we need to actually increment + the dir variable! Was broken accidentally in commit + 5f0f788dc12a10a3c01ade7cf00d5ed63922ca47 (Initial C++ compatibility patch) + +2011-02-21 Ineiev * ineiev AT users dot berlios dot de * + + * src/polygon.c: fix polygon regression Introduced by 2d8dc8a3a3a55158b4e6278dd9f40588e4111c2d Reported by Kai-Martin Knaak + +2011-02-19 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Fix solder mask drawing glitch in pcb Applied patch from lp-699498 by rdrehmel Closes-bug: lp-699498 + +2011-02-10 DJ Delorie * dj AT delorie dot com * + + * src/strflags.c: Use onsolder for text, not auto. The flags table wasn't using onsolder for text, which meant the + default "auto" was used for it, which doesn't make sense. This + makes text on the solder side use the "onsolder" name instead. + +2011-01-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Conditionally use "class" or "c_class" + depending on the compiler language. The X11 headers define some classes differently based on whether + they're being used for C or C++, so we have to make our access to + them conditional also. + +2011-01-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/batch/batch.c: C++ compatibility for the batch HID. Just a keyword rename (xor). + +2011-01-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c, src/hid/lesstif/lesstif.h, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/styles.c: C++ compatibility for the lesstif HID. Minor changes - casts, consts, keyword renames, so that the lesstif + HID can be compiled as C or C++. + +2011-01-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/change.c: change.c: Restore and clear to polygons when + changing hole sizes This is more consistent with other code-paths and is useful if the + thermal gemoetry were to depend in on the hole size (which it + doesn't currently, but used to do before the clipper branch). + +2011-01-24 Markus Hitter * mah AT jump-ing dot de * + + * configure.ac: configure.ac: remove the now obsolete test for + gethostname(). No longer required since commit + 00c556b02dfa0113eab62b894eff4cf5d55b8e5f Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * + Affects-bug: lp-703914 + +2011-01-23 Markus Hitter * mah AT jump-ing dot de * + + * doc/gs/fb-blinker.pcb, doc/gs/fb-led-5.pcb, doc/gs/fb-led.pcb, + doc/gs/fb-smt.pcb, doc/gs/term-annulus-1.pcb, + doc/gs/term-clearance-1.pcb, doc/gs/term-element-1.pcb, + doc/gs/term-pad-1.pcb, doc/gs/term-pin-1.pcb, + doc/gs/term-platedhole-1.pcb, doc/gs/term-tented-1.pcb, + doc/gs/term-thermal-1.pcb, doc/gs/term-thickness-1.pcb, + doc/pad.pcb, doc/puller.pcb, doc/thermal.pcb, example/LED.pcb, + example/LED2.pcb, tests/inputs/bom_general.pcb, + tests/inputs/gcode_oneline.pcb, tests/inputs/gerber_oneline.pcb, + tutorial/tut1.pcb: Remove all date, user and host comments on all + test and sample files. These items are no longer written, so sample files shouldn't contain + them either. Usually, this was line 2...4. Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * + Affects-bug: lp-703914 + +2011-01-23 Markus Hitter * mah AT jump-ing dot de * + + * src/file.c: src/file.c: don't write user name or date to the + stored layout file. Notes from Peter Clifton: The consensus from bug lp-703914 was that that recording the + username, data and host which produced the file is unnecessary and + causes version control clashes which are otherwise unnecessary. Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * + Closes-bug: lp-703914 + +2011-01-22 Bob Paddock * bobpspam AT gmail dot com * + + * src/action.c: Compiling with MinGW requires cast to const for + _spawnvp to compile without warning. + +2011-01-22 Bob Paddock * bobpspam AT gmail dot com * + + * src/hid/gcode/gcode.c, src/hid/nelma/nelma.c: Add missing + Message() prototype to remove warning about same. + +2011-01-22 Bob Paddock * bobpspam AT gmail dot com * + + * src/polygon1.c: Initialize min_dist to zero before using in if(). + +2011-01-23 Newell Jensen * pillar2012 AT gmail dot com * + + * configure.ac, src/action.c, src/autoplace.c, src/autoroute.c, + src/change.c, src/create.c, src/dbus-pcbmain.c, src/draw.c, + src/drill.c, src/edif.y, src/file.c, src/find.c, src/free_atexit.c, + src/global.h, src/heap.c, src/hid.h, src/hid/bom/bom.c, + src/hid/common/actions.c, src/hid/common/draw_helpers.c, + src/hid/common/extents.c, src/hid/common/flags.c, + src/hid/common/hid_resource.c, src/hid/common/hidinit.c, + src/hid/common/hidnogui.c, src/hid/gcode/gcode.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-command-window.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui-dialog-size.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui-drc-window.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-pinout-preview.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h, src/hid/nelma/nelma.c, + src/hid/png/png.c, src/hid/ps/eps.c, src/hid/ps/ps.c, src/insert.c, + src/intersect.c, src/main.c, src/misc.c, src/move.c, src/mtspace.c, + src/mymem.c, src/netlist.c, src/parse_l.l, src/parse_y.y, + src/polygon.c, src/polygon1.c, src/puller.c, src/rats.c, + src/rats.h, src/report.c, src/rtree.c, src/toporouter.c, + src/undo.c, src/vector.c, src/vendor.c: Initial C++ compatibility + patch Doesn't cover lesstif or batch hids. Makes source code build + without warnings on C, and build with warnings on C++. + +2011-01-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/netlist.c: Add header for Draw() prototype. Silences a warning building the lesstif hid. + +2011-01-23 DJ Delorie * dj AT delorie dot com * + + * src/edif.y: FindContext() takes an int, not a pointer. + +2011-01-14 Markus Hitter * mah AT jump-ing dot de * + + * INSTALL: INSTALL: add instructions on how to create configure. Closes-bug: lp-702484 + +2011-01-07 Jared Casper * jaredcasper AT gmail dot com * + + * configure.ac: Heed and remove warning issued by autoconf 2.68. Starting in autoconf 2.68, "the macros AC_PREPROC_IFELSE, + AC_COMPILE_IFELSE, AC_LINK_IFELSE, and AC_RUN_IFELSE now warn if the + first argument failed to use AC_LANG_SOURCE or AC_LANG_PROGRAM to + generate the conftest file contents." Closes-bug: lp-700180 Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac * + +2009-02-20 Ineiev * ineiev AT users dot sourceforge dot net * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Fix disappearing + reference mark Fixes the following symptoms (Bug sf-1882970 reported by Steven + Michalske): (0) when the cursor leaves the window, the mark disappears (with attached objects); when the cursor enters again, the mark is redrawn only if there are any attached objects; (1) When there are no attached objects, the mark disappears on button press, but is not redrawn again when button press and release form a click. (Commit message edited by Peter Clifton * pcjc2 AT cam dot ac dot + uk *) Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * Closes-bug: lp-699244 Closes-bug: lp-699453 + +2011-01-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/lpr/lpr.c, src/hid/ps/ps.c: Fix postscript page scaling Calculate page sizes *after* selecting the page, not before. + +2011-01-10 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Calculate text bounding boxes based on that actual + drawn glyphs. Previously, a text's bounding box was calculated based on overall + font metrics, not the actual glyphs. This meant that text clearing + a polygon would have far more space around it than called for. + +2011-01-10 DJ Delorie * dj AT delorie dot com * + + * src/file.c: Make new PCB active during parsing Set the global PCB pointer to the "new" pcb while it's being loaded. + Some of the creation functions use the DRC values in PCB to compute, + for example, bounding boxes. Before, it used whatever was hanging + around in the previous PCB (or the default values). + +2011-01-09 DJ Delorie * dj AT delorie dot com * + + * Makefile.am, configure.ac, gts/.gitignore, gts/Makefile.am, + gts/NOTES, gts/bbtree.c, gts/boolean.c, gts/cdt.c, gts/container.c, + gts/curvature.c, gts/edge.c, gts/eheap.c, gts/face.c, gts/fifo.c, + gts/graph.c, gts/gts-private.h, gts/gts.h, gts/heap.c, + gts/hsurface.c, gts/iso.c, gts/isotetra.c, gts/kdtree.c, + gts/matrix.c, gts/misc.c, gts/named.c, gts/object.c, gts/oocs.c, + gts/partition.c, gts/pgraph.c, gts/point.c, gts/predicates.c, + gts/predicates.h, gts/psurface.c, gts/refine.c, gts/rounding.h, + gts/segment.c, gts/split.c, gts/stripe.c, gts/surface.c, + gts/triangle.c, gts/tribox3.c, gts/vertex.c, gts/vopt.c, + src/Makefile.am, src/gts/.gitignore, src/gts/NOTES, + src/gts/bbtree.c, src/gts/boolean.c, src/gts/cdt.c, + src/gts/container.c, src/gts/curvature.c, src/gts/edge.c, + src/gts/eheap.c, src/gts/face.c, src/gts/fifo.c, src/gts/graph.c, + src/gts/gts-private.h, src/gts/gts.h, src/gts/heap.c, + src/gts/hsurface.c, src/gts/iso.c, src/gts/isotetra.c, + src/gts/kdtree.c, src/gts/matrix.c, src/gts/misc.c, + src/gts/named.c, src/gts/object.c, src/gts/oocs.c, + src/gts/partition.c, src/gts/pgraph.c, src/gts/point.c, + src/gts/predicates.c, src/gts/predicates.h, src/gts/psurface.c, + src/gts/refine.c, src/gts/rounding.h, src/gts/segment.c, + src/gts/split.c, src/gts/stripe.c, src/gts/surface.c, + src/gts/triangle.c, src/gts/tribox3.c, src/gts/vertex.c, + src/gts/vopt.c: Add top-level build changes to enable C++ + compilation This patch moves GTS (gts.sourceforce.net) out of the src/ tree and + gives it its own Makefile, and changes src/Makefile.am so that C++ + compilation is used if configure requests it. ./configure --enable-build-with-cxx ./configure + --disable-build-with-cxx (the default is disable at the moment) Makefiles with these lines will use C++ if the user requests it: CC = @CC_OR_CXX@ CFLAGS = @CC_OR_CXX_FLAGS@ + +2011-01-07 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: Support far-side polygons when converting buffer to + element. + +2011-01-07 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Fix command-injection bug in Import() Use "--" before the list of schematics, to prevent the src list from + containing other gnetlist options (or arbitrary guile code) + +2011-01-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Fix prelight state for + layer button to show current status One of the ways we identify whether a layer is switched on or off is + by changing the background colour of the GtkToggleButton + representing that layer. Fix the prelight (mouse-over) background style to match the current + button state, so as to give immediate feed-back when the user + presses the button, and make the interface less confusing. Closes-bug: lp-699150 + +2010-12-28 Felix Ruoff * Felix AT posaunenmission dot de * + + * src/hid/gtk/gui-command-window.c, src/hid/gtk/gui-dialog-size.c, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-top-window.c: hid/gtk: Modify window title to match + the GNOME Human Interface Guidelines Modifies the title of the main window as suggested in the GNOME HIG: + + (http://library.gnome.org/devel/hig-book/nightly/windows-primary.html)The following will be shown there: - A star (*) if the layout has unsaved changes (this patch also removes this sign from the statusbar, where it currently is) - The name of the layout, if set in the config-dialog ('Put layout name on the window title bar') - The filename (in braces, if layout name is shown) - The string " - PCB" Closes-bug: lp-699509 Acked-by: Peter Clifton * pcjc2 AT cam dot ac + dot uk * (Also modified commit message) + +2011-01-05 DJ Delorie * dj AT delorie dot com * + + * src/select.c: Fix "select pads on hidden far side" If an SMT pad is on the far side of the board, and the far side + layer is not visible, do not select that pad. Exception: if that + pad is part of an element which *is* on the visible side, the pad is + selected as part of selecting the whole element. But, elements on + the far side (the common case) won't have their pads selected when + those pads aren't visible. + +2011-01-04 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Allow zoom-out-past-board for Lesstif The lesstif GUI has been modified two ways: 1. You may zoom out "past" the board, making the board smaller than + the window. Note that the crosshair is still limited to the board's + extents. 2. You may pan the board so that edges need not be on the edge of + the window, such as centering an edge for inspection. Note that the smallest the board can be is 1/10th the window size. + While this is arbitrary, it's easily changed if needed, and avoids + problems with miniscule boards (and thus maxiscule coordinate + systems). The 'v' key still zooms the board to fit, but now centers the board + in the window rather than placing it at the upper left. + +2011-01-04 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/netlist.c: ResetConncetions -> ResetConnections Typo. + +2011-01-04 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Fix lesstif segfault in key handling. When a key handler calls an action, the key table might change + before the action returns (via nested key handlers), so save a + pointer to the table we're parsing to ensure it will be around when + we return. + +2011-01-04 DJ Delorie * dj AT delorie dot com * + + * lib/geda.inc: Add 80-pin headers. Add 80 pin DIP and Ribbon 0.1" header macros to the usual list. + +2010-12-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-netlist-window.c, + src/hid/gtk/gui.h: hid/gtk: Fix warping pointer to correct location + from netlist window We weren't updating the pointer location after having panned the + connection into the center of the screen. Also fixes the open-coded panning code to work for flipped views. + The patch is pretty horrible at best, but appears to fix the issue. Unfortunately the locical call to use (the "Center" action) cannot + be made through the generic action code as we need to specify the + location explicitly. We could perhaps export the Centre action + function, or refactor it as a wrapper around a helper function which + we would then export and call. I aim to eventually rework the GTK HID's coordinate transforms + (including flipped views), event handling, view panning and pointer + warping in order to give greater sepeatation between the renderer + agnostic parts of the HID and the renderer. This will be needed for + the 3D portions of the PCB+GL branch. It seems most sensible to start refactoring from a state where the + existing code at least functions correctly (even if it isn't + pretty), rather than work in fixes as I refactor. + +2010-12-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-main.c: hid/gtk: + Remove unused Vx2 and Vy2 functions from gtkhid-{main,gdk}.c + +2010-12-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Remove unused file scope + variables event_x and event_y + +2010-12-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Compute warp pointer offset + without reading current position This is closer to the way the old code which used the an + XWarpPointer call worked, and makes the two code-paths where we warp + the pointer consistent. Also, remove some unnecessary comments which + were more relevant to explain why we previously had too + implementations. + +2010-12-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Fix "Center" action in a + couple of ways We need to update the adjustments together otherwise the center + action will only work on one axis at a time. Fix typo for out-of bounds check which mixed width and height. + +2010-12-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac, src/hid/gtk/gtkhid-main.c: hid/gtk: Clean up mouse + warping code now we require a later GTK version Remove the X11 specific implementation and remove some comments in + the GDK one which were more relevant to explain why we previously + had two implementations. + +2010-12-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-dialog.c: Cleanup conditional code now we require + a later GTK version + +2010-12-27 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac: Bump required GTK version in configure.ac test to + 2.12 This is required, as we utilise some of the newer APIs. NB: GTK+ 2.12.0 was released in September 2007 + +2010-12-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui.h: hid/gtk: Remove unused DRAW_Z, VIEW_Z macros + +2010-12-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Don't avoid panning when + further X11 events are pending Since we are using motion hints, we should not get bogged down with + motion events, so we should probably just act upon them. + +2010-12-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: hid/gtk: Use motion notify events to avoid too + rapid pointer events Not fixing a specific problem - just a backport from the GL branch. + +2010-12-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c, src/find.h, src/hid/gtk/gui-netlist-window.c, + src/hid/lesstif/netlist.c, src/rats.c, src/select.c: Revert undo + changes relating to RatFindHook calls This reverts commit 1aac06b665330507ca42f380e38f32875a979cd9 and commit d3b508ca272b7d89aa27f552ab78943f9bed27f9. I made a mistake by assuming the undo data saved by the RatFindHook + (when looking up nets to select) was redundant. I had presumed this + since the flags being set are reset again before we finish + processing. What actually happens, is that further processing sets the SELECTED + flag on the FOUND objects. Undo data is saved for the SELECTED flag + addition, which stores the previous flags of the object. When an + undo is performed, it also restores the FOUND flag we wanted to keep + unset. In order to get back to our original state, we need the RatFindHook + to store undo information for when the FOUND flag was initially set. The ResetConnections() call after the RatFindHook should still be ok + not saving undo information, as it only touches object flags which + will be restored anyway by the undo data now saved by the + RatFindHook. NB: Revert was manually modified to retain an indenting change in + find.c and to add the required changes to select.c, which had + additions using the RatFindHook API since the above reverted commits + were made. + +2010-12-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/find.c, src/report.c, src/set.c: Remove Draw() + call from ResetFound*() Let the caller do it This allows multiple changes to be grouped into one repaint + operation. Use this where appropriate, such as the Netlist lookup + functions. + +2010-12-23 Martin Kupec * martin dot kupec AT kupson dot cz * + + * src/action.c, src/const.h, src/select.c: Add NetByName to the + select action options v2: Check Net name appropriately v3: Ensure we set the changed flag Reviewed-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * + +2010-12-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c, src/find.h, src/hid/gtk/gui-netlist-window.c, + src/hid/lesstif/netlist.c, src/rats.c: find.c: Remove "undo" + parameter to RatFindHook Since all callers pass false for the "undo" parameter since the last + commit, remove it from the function prototype. NB: The file-global variable "User", which it previously set can be + assumed to be false, as it defaults to false - and is restored after + any code which temporarily sets it to true. + +2010-12-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c, src/hid/lesstif/netlist.c: We + don't need the RatFindHook to save undo state when doing netlist + lookup We already save undo information to get to a known state when + resetting the FOUND flags. Since we later reset back to this state, + we don't need to save undo data. + +2010-12-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c, src/hid/lesstif/netlist.c: Fix + netlist selection to save undo information for wiped "FOUND" flags When we wipe the found flags on objects, we should also queue them + for redraw - this fixes that too, as the ResetConnections() argument + controls both redraw AND saving undo data. + +2010-12-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c, src/hid/lesstif/netlist.c: + Remove unneeded Undo serial number save / restore in netlist lookup The RatFindHook function does not call anything which will increment + the Undo serial number, so the save / restore calls are not + required. + +2010-12-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/autoroute.c, src/find.c, src/find.h, + src/hid/gtk/gui-netlist-window.c, src/hid/lesstif/netlist.c, + src/rats.c, src/report.c, src/set.c, src/toporouter.c: Fix broken + undo handling for ResetFound*() and ResetConnections() Many callers have this idiom: SaveUndoSerialNumber (); ResetFoundPinsViasAndPads (AndDraw); RestoreUndoSerialNumber (); ResetFoundLinesAndPolygons (AndDraw); The intent is to squash the two operations into one undo operation. + The ResetFound* functions DO increment the Undo serial number but + ONLY if that particular function makes a change. Assume for the example that the first ResetFound* call makes some + change and increments the serial number. This is then reset by the + caller. If the second ResetFound* call doesn't find anything, there + is no overall increment to the serial number. Move the undo serial number handling out of the ResetFound* calls, + and let the callers increment the serial number if desired. To + facilitate this, return a boolean value from these functions to + indicate whether any changes were made which could be undone. For convenience, expose previously static find.c function + ResetConnections() in order to avoid repeating Undo handling in each + caller to the two ResetFound* functions which are often called + together. + +2010-12-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/hid/gtk/gui-netlist-window.c, + src/hid/lesstif/netlist.c, src/select.c: select.c: Remove Draw() + call from SelectConnection Make callers responsible for calling the final Draw(), to avoid + multiple redraws if other operations are to occur, such as changing + "FOUND" flags on objects after making the selection. + +2010-12-23 Patrick Bernaud * patrickb AT chez dot com * + + * src/free_atexit.h: Fix substitutions for leaky_*alloc functions + +2010-12-22 Tibor Palinkas * geda AT igor2 dot repo dot hu * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Use leaky_* functions for + deliberate leaks in ghid_ui_info_append Allocate cached temporary memory with the leak_* memory allocation + wrapers which allow these to be freed at exit. + +2010-12-22 Tibor Palinkas * geda AT igor2 dot repo dot hu * + + * src/free_atexit.c, src/free_atexit.h: free_atexit.c: Add + leaky_calloc() function for deliberately leaked calloc's Stores a pointer to the calloc'd memory to be free'd at exit of the + program. Returned memory must not be free'd manually. + +2010-12-22 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/report.c: report.c: Fix missing return value + +2010-12-22 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/toporouter.c: toporouter.c: Make inline functions "static + inline" gcc builds break for CFLAGS="-g" only builds (no -O2). Inlineing is + only performed when optimisation is enabled, and unless we make all + local inlined functions "static inline", it does not emit the + non-inlined assembly for them, resulting in undefined symbols at + link time. + +2010-12-22 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui.h: hid/gtk: Move + more gdk specific drawing routines to gtkhid-gdk.c + +2010-12-22 Tibor Palinkas * geda AT igor2 dot repo dot hu * + + * src/Makefile.am, src/free_atexit.c, src/free_atexit.h, src/main.c: + Add leaky_{malloc,realloc} functions for deliberate non-free'd + allocations These are to be used for local allocations made and cached for the + lifetime of the program (never free'd). Typically, these are stored + in a static char * variable (or similar) within a function. The leaky_*() functions store the addresses of all memory they + allocate, and for debugging builds, free it upon exit of the + program, thus allowing leak detectors such as valgrind to ignore our + deliberate "leaks". The memory returned by leaky_*() must not be free'd. Build system and PCB integration, and leaky_atexit.c reindenting by + Peter Clifton * pcjc2 AT cam dot ac dot uk * + +2010-12-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/parse_l.l: parse_l.l: Fix warning implicit definition of + function ‘CreateBeLenient’ Warning was introduced in commit + e8dd18a2f7b83c6108d2c9398903d4be92e22d4c The required prototype was + added to create.h, but create.h was not included in parse_l.l Note to developers: Please "make clean" and build with "make -s" before pushing changes. + This kind of bug is really easy to catch, and I just recently spent + a log of effort cleaning up PCB's compile so we can catch real bugs! Pretty please? + +2010-12-20 Martin Kupec * martin dot kupec AT kupson dot cz * + + * src/action.c: action.c: Change macro ARG, to return NULL instead + of 0 When the argument number requested does not exist, return NULL, not + 0, as this is more in keeping with the type (char *) normally + returned. Commit message modified by Peter Clifton * pcjc2 AT cam dot ac dot + uk * + +2010-12-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : commit 7392b020deca9ef155f3b1449f1ad8fac6d6083b Author: Peter + Clifton * pcjc2 AT cam dot ac dot uk * Date: Mon Dec 20 13:54:41 + 2010 +0000 + +2010-12-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/search.c, src/search.h: Improve grid snapping + heuristics + +2010-12-19 DJ Delorie * dj AT delorie dot com * + + * src/create.c, src/create.h, src/parse_l.l: Allow via copper to + overlap; preserve illegal vias from file. Reduce "overlapping via" tests to check for overlapping drills, not + overlapping copper. If a file being loaded has "illegal" vias, load + them anyway - the check only happens at create time, if the user + figures out a way around it, preserve it. + +2010-12-16 DJ Delorie * dj AT delorie dot com * + + * src/rats.c: Further work on rats patch. Add a lot of comments to clarify what's happening in that function + (the previous patch was bogus because the function re-uses a + structure in an unintended way). Fixed the logic to be mew + paranoid. + +2010-12-16 DJ Delorie * dj AT delorie dot com * + + * src/rats.c: Fix rats bug (SF 3137324) When adding rats from a netlist, we want to skip nets with too few + connections, not netlists with too few nets. + +2009-02-20 Ineiev * ineiev AT users dot sourceforge dot net * + + * src/report.c: report object coordinates in selected units SF patch 1621915 HOW TO TEST load a pcb; Ctrl-R on objects of different types; the + reported units should be either mm or mils according to selected + units 04 Oct 2010: merged with Joerg Wunsch's patch 2995918 "Add + human-readable info to polygon report" + +2010-12-12 Ineiev * ineiev AT users dot berlios dot de * + + * src/polygon.c: [PATCH] fix bug 2793480 (vias/arcs-to-polygon + clearances) frac_circle(): introduce radius_adjustment factor to make the + polygon outline the arc rather than connet points on the arc ArcPolyNoIntersect(): compute number of segments so that polygon + diverges from the arc no more than 0.02 of required thickness; + adjust outer "arc" radius like in frac_circle() + +2010-12-11 DJ Delorie * dj AT delorie dot com * + + * src/file.c: Check for special name "(local)" to mean "." When expanding a tree of footprints, we want the symbolic name + "(local)" to mean the "." subdir. Now that we check for chdir() + failures, we can no longer "just work" because the chdir didn't + change directories. + +2010-12-11 David Dandar * ddandar AT users dot sourceforge dot net * + + * src/action.c: Let RealignGrid align grid to a pin or pad snap. SF patch 2476262: Realign grid has been broken for a while. Darn mm and mil mix + components were killing me. I got desperate and fixed it, but I'm + not sure if it's the right fix. It does work though. Hope this + helps. + +2010-12-11 Seb James * seb AT esfnet dot co dot uk * + + * src/rats.c: SF patch 1674895: This crash occurs in rats.c, around line 610 in the function + DrawShortestRats() where CreateNewRat() is called with some + arguments which don't exist. It occurred for me when I tried to "optimize rats nest" on an + invalid design. There's no check in DrawShortestRats() that the firstposition and + secondposition pointers are not NULL. firstposition->X (and Y) and + secondposition->X (and Y) are passed as arguments to CreateNewRat(). + It is possible in some cases that firstposition and secondposition + are not reset from 0 in the code preceding the call to + CreateNewRat(). In these cases a segfault will occur. + +2010-10-09 Cesar Strauss * cstrauss AT not2005 dot cea dot inpe dot br * + + * configure.ac, src/action.c: Check for the _spawnvp function and + use it if present. + +2010-10-09 Cesar Strauss * cstrauss AT not2005 dot cea dot inpe dot br * + + * src/.gitignore: Ignore generated files on Windows. + +2010-12-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/buffer.c, src/command.c, src/create.c, + src/drill.c, src/file.c, src/find.c, src/hid/common/flags.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gui-dialog-size.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/styles.c, src/intersect.c, src/main.c, src/misc.c, + src/mymem.c, src/mymem.h, src/netlist.c, src/parse_l.l, + src/parse_y.y, src/rats.c, src/remove.c, src/report.c, src/undo.c: + Remove My* memory allocation routines. Just use the standard APIs + directly This means the following changes: 1. Replace all calls to MyCalloc() with calls to calloc() 2. Replace all calls to MyMalloc() with calls to malloc() 3. Replace all calls to MyRealloc() with calls to realloc() 4. Replace all calls to SaveFree() with calls to free() 5a. Where the MYFREE(x) macro is used and its pointer clearing + side- effect is required, call free (x); and (x) = NULL; directly. 5b. Where the MYFREE(x) macro is used, and (x) is immediately re- assigned, or its location free'd or zero'd, skip the (x) = + NULL; 6. Replace all calls to MyStrdup() with calls to the STRDUP(x) + macro, which expands to (((x) != NULL) ? strdup (x) : NULL). NB: The previous commit already replaced various known "safe" calls + of MyStrdup() with strdup(), when the argument is known to be + non-NULL. 1,2,3 and 6. mean that we discard the following features of the mymem.c allocators: 7. Logging messages when MEM_DEBUF defined 8. Logic to assign 1 unit of memory if 0 is requested 9. Allocation failure handling via MyFatal() -> EmergencySave() With feedback from Stephen Ecob * silicon dot on dot inspiration AT + gmail dot com * 7. Is old debug code which is rarely (if ever) used. Current debug + tools such as Valgrind can do a much better job of memory debugging + now. 8. This is really papering over the possibility of a caller bug, and should never have been included in the first place. 9. This is unlikely to actually ever save someone from loosing their + PCB. Patch created with the assistance and testing of Stephen Ecob * + silicon dot on dot inspiration AT gmail dot com * + +2010-12-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/buffer.c, src/copy.c, src/create.c, src/file.c, + src/fontmode.c, src/main.c, src/misc.c, src/move.c, src/netlist.c, + src/rats.c: Convet some "safe" usage of MyStrdup to plain strdup These cases are ones where we know the caller will not risk passing + a NULL string to duplicate. Patch created with the assistance and testing of Stephen Ecob * + silicon dot on dot inspiration AT gmail dot com * + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/create.c: Ensure CreateNewText() returns NULL if called with + NULL text. Ensuring that text will not be NULL allows us to replace the + MyStrdup call with a simple strdup. + +2010-12-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c: file.c: c Attempt to handle failure of + GetWorkingDirectory() and chdir() Report the error to the user if any GetWorkingDirectory or chdir + call fails. Add attempts to change back to the original working + directory on error paths. Ideally, these functions would be re-implemented to operate without + changing the current working directory at all. + +2010-12-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/change.c: Plug some memory leaks of strings + returned from gui->prompt_for() + +2010-12-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/vendor.c: vendor.c: Fix memory leak and unused variable in + ActionLoadVendorFrom() Also, don't bother testing x != NULL before calling free (x). + +2010-12-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidnogui.c: hid/common: Fix / re-write + nogui_{prompt_for,fileselect,confirm_dialog}() Fixes some pretty nasty bugs in these functions: 1. These functions must return allocated memory, strdup will do + nicely. 2. fgets will insert the newline character into the buffer, so we + need to check if we just got a '\r' or '\n' as our first character, + not just '\0' when deciding whether to return the default string or + not. 3. DO NOT strcpy a the default string... we don't know if it will overflow our buffer 4. For the "fileselect" case, return NULL if the user didn't give us + a filename, and the caller didn't specify a default string. Prompt + for will return strdup (""), equivalent to what it previously did. + +2010-12-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c: hid/batch: Use hidnogui as a default base + hid to avoid code duplication + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Mark some strings as translateable in + ActionImport() + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c, src/misc.h, src/mymem.c, src/mymem.h: Make the strings + passed to AttributePutToList and MyStrdup (const char *) Silences some compiler warnings when using const char * strings. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/dialogs.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/lesstif/netlist.c, + src/hid/lesstif/styles.c: hid/lesstif: Revert some Boolean->bool + type changes as required by Xt* APIs This is a partial revert of commit + ad5eb5a165442be38624aa622beeb57dc1d2afbd For consistency, I have also reverted the changes of True->true and + False->false when calling X11 APIs. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/dialogs.c: hid/lesstif: Use an intervening size_t + casts to aovid compiler warnings This is to avoid the compiler warning us what we already know.. that + we are passing an integer value cast into what might be a different + sized pointer. (On 64 bit builds). + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c: hid/batch: Add some missing header files + for prototypes + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/batch/batch.c, src/hid/common/hidinit.h, + src/hid/gcode/gcode.c, src/hid/gerber/gerber.c, src/hid/lpr/lpr.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: hid/common: Provide a header to define + hid_parse_command_line() Avoids having each caller having to pull it in with an extern + declaration. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/batch/batch.c, src/hid/common/actions.h, + src/main.c: hid/common: Provide a header file to define + print_actions() Avoids having each caller having to pull it in with an extern + declaration. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c: Fix function prototypes and dummy return + values for batch HID Most of these are dummy functions, but we should get the prototypes + right! Also, return 0 from dummy functions which are supposed to + return an integer. Fixes various compiler warnings. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid.h, src/hid/batch/batch.c, src/hid/common/hidnogui.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui.h, src/hid/lesstif/dialogs.c, + src/hid/lesstif/lesstif.h: HID: Make arguments to the prompt_for + method const char *, not char * Avoids compiler warnings calling gui->prompt_for() with a const char + * + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: Rename "r" variables used in calls to GetValue() to + be more descriptive A purely cosmetic change. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: action.c: Fix data types in GetValue calls We passed an (int *) rather than a (bool *) in ActionImport() and + parse_layout_attribute_units() + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c, src/misc.h: Change unmodifed parameters to GetValue to + const char * Silences some compiler warnings in action.c + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c: autoroute.c: #if 0 out an unused static function + add_clearance() Silences compiler warning. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/djopt.c: djopt.c: #if 0 out an unused static function + nudge_corner() Silences a compiler warning. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/buffer.c: buffer.c: Declare variables before code in + ActionFreeRotateBuffer() Avoids compiler warning "ISO C90 forbids mixed declarations and + code" + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/change.c: change.c: Remove unused variable in + ChangeElementText() + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: Remove unused variables in ActionElementList() and + ActionImport() + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: Add missing return value in ActionImport() + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rtree.c: Silence used function warning for __r_tree_is_good() + (Non-debug builds) __r_tree_is_good() and its helper functions are only used when + debugging, and are called from assert() macros. If "NDEBUG" is + defined, these expand to nothing, and the function is not called. Wrap __r_tree_is_good() and its helper, __r_tree_node_is_good() with + #ifndef NDEBUG + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c: file.c: The "elapsed" variable in LoadPCB is debugging + only Silence compiler warning by moving it inside the #ifdef DEBUG + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/flags.c: flags.c: Avoid compiler warning when casting our + OffsetOf value Strictly, our OffsetOf calculation "could" return a number as large + as the pointer size on the system - so the compiler will complain + when we squash it directly into an int. Casting via a size_t will + avoid the warning. Our structure offsets are small, so this is safe - if somewhat ugly. + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/toporouter.c: Toporouter: Comment unused debug variable Silences compiler warning + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/gts/pgraph.c: gts: Comment some unused variables left as + placeholders Silences compiler warnings + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/gts/edge.c: gts: Add cast to silence compiler warning + +2010-12-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/parse_l.l, src/res_lex.l: *.l: Add #define YY_NO_INPUT to + avoid defining unused "input()" function Silences compiler warnings + +2010-12-09 Stephen Ecob * silicon dot on dot inspiration AT gmail dot com * + + * src/buffer.c: Fix SmashBufferElement(), broken by fixing a memory + leak in FreeDataMemory() Commit 466b0183758ef3ca44623c43de60a233b175d2ad broke + SmashBufferElement() by changing FreeDataMemory() (which + SmashBufferElement() calls via ClearBuffer()). SmashBufferElement() + depended on the memory leak of Data->Element in FreeDataMemory(). This patch removes the dependence on the leak. Commit-message-reformatted-by: Peter Clifton * pcjc2 AT cam dot ac + dot uk * + +2010-12-07 Stephen Ecob * silicon dot on dot inspiration AT gmail dot com * + + * src/misc.c, src/mymem.c: Fixed some memory leaks associated with + the global PCB structure. + +2010-11-28 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Store is_pad flag for each line rather than trying to + deduce if a line is a pad or not. + +2010-11-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : commit 093a606b182229c8e28118ace1be7d6b6ad5cf7f Author: Peter + Clifton * pcjc2 AT cam dot ac dot uk * Date: Fri Nov 26 03:26:08 + 2010 +0000 + +2010-11-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Various speedups to the polygon code. Attempt to fix polygon slowness by avoiding the need to create a + completely new polygon for each boolean operation. This mostly + relies upon r-tree searches to find contours to operate on - rather + than searching each in turn. We avoid labelling all of the "A" polygon's contours, use the + contour r-trees to dynamically search the required data. Added code to reparent holes which end up in the wrong polygon piece + after inserting a new hole in InsertHoles. This means we don't have + to dump every potental hole we encounter in the holes insersion + queue, hopefully leading to better dynamic update performance. At this point, polygon performance has finally seen a net gain. HOWEVER: Due to differences in the order of polygon operations, the data-structures resulting from a boolean polygon operation may be sorted differently. In certain contrived cases, where a polygon is clipped into identically sized pieces, the resulting piece of polygon which PCB will keep and use on the board is different after this commit. + +2010-11-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Use heap structure to insert holes quicker in + InsertHoles() + +2010-11-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polyarea.h, src/polygon.c, src/polygon1.c: Optimise polygon + operations by keeping an rtree of POLYAREA contours Attempt to speed up the intersect() routine using this rtree rather + than generating a new one at each call. Due to the increased overheads of keeping an r-tree up to date, + there is a significant overall slow-down at this point in the patch + series. + +2010-11-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Use rtree of countours when computing an + intersection NOTE: This is more complex than the existing code, and on its own, actually slows things down a little. The intention is that the r-tree should be maintained + continually, so it doesn't need to be recreated with each call + to intersect(). + +2010-11-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: polygon.c: Accumulate vias and lines into batches + before subtracting them Accumulate polygons to clear from lines and pins in batches, then + clear from the polygon. Not quite sure why, but this _really_ seems + to speed up loading very complex boards. (e.g. 50sec -> 10sec for + one example). Possibly this is because withing the assembled batches, it is + cheaper to produce a more unified contour (touching lines), and the + complex contours of the main polygon are broken less frequently. It isn't quite clear why this helps so much for pins / vias (which + won't usually touch each-other), however it changes a 50sec load + time to 10 sec. This could perhaps be because any contours which + are smashed by clearance of closely spaced vias / pins now only + incurr the penalty of breaking the main contour once every batch + (100 vias / pins). Batch sizes (20 for lines, 100 for pins / vias) aren't necessarily + optimal! Also, clear pins and vias last... There is a chance these objects are simpler, and just end up as + holes in the main polygon, rather than causing a contour + intersection. This means it is cheaper to add them last. If we add them first, and make the polygon complex, objects (usually + lines) which pierce the polygon's outer contour cause all the holes + to be removed and queued for re-insersion after the new contour is + constructed. + +2010-11-07 DJ Delorie * dj AT delorie dot com * + + * lib/geda.inc: Add more ACY, ACPY, ALF, RCY, RCYP, JUMPER, and + HEADER macros to fill in the gaps. + +2010-11-07 DJ Delorie * dj AT delorie dot com * + + * src/toporouter.c: Comment out code to dump toporouter surfaces. + +2010-09-29 DJ Delorie * dj AT delorie dot com * + + * NEWS: Update NEWS from ChangeLog + +2010-09-29 DJ Delorie * dj AT delorie dot com * + + * ChangeLog: Update ChangeLog from git logs. + +2010-09-29 DJ Delorie * dj AT delorie dot com * + + * po/POTFILES.in: Fix for distcheck errors. + +2010-09-29 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Make new text clear polygons + +2010-09-20 DJ Delorie * dj AT delorie dot com * + + * src/parse_l.l: Don't print "can't open ./default_font for reading" + all the time + +2010-09-19 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/parse_l.l: Wrap more messages in debug Messages about where fonts were found, or how many milliseconds it + takes to load a file, are not normally needed. Wrap them in DEBUG + conditionals. + +2010-09-14 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: If we don't use the outline to clip, don't draw + it either. + +2010-09-14 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Fix bug tracker # 3064887 PNG exported all black in photo mode if the "outline" was exactly + the board size, because the left/bottom edges were clipped leaving a + big hole. With this patch, we do two things: 1. Detect a non-trivial outline, and only do outline processing if + found. Thus, a rectangular outline exactly the size of the board is + just ignored - no black border on the output image. 2. Any outline line that's drawn exactly on the bottom/right edge is + brought in by half a pixel to ensure it's drawn in the resulting + image. + +2010-09-13 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Avoid divide-by-zero Check for a zero dispersion before computing it. + +2010-09-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/thermal.c: thermal.c: Initialise flags of the LineType object + in square_therm() Keeps valgrind quiet about conditionals based upon uninitialised + variables.. must be a good thing. + +2010-09-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/autoplace.c, src/autoroute.c, src/buffer.c, + src/copy.c, src/create.c, src/crosshair.c, src/data.h, src/djopt.c, + src/draw.c, src/file.c, src/find.c, src/flags.c, + src/hid/batch/batch.c, src/hid/common/extents.c, + src/hid/common/flags.c, src/hid/gcode/gcode.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-top-window.c, src/hid/lesstif/dialogs.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c, src/line.c, src/macro.h, src/misc.c, src/move.c, + src/polygon.c, src/print.c, src/puller.c, src/rats.c, src/rtree.c, + src/rubberband.c, src/search.c, src/select.c, src/toporouter.c: + Split usage of "max_layer" into max_copper_layer and max_group PCB has an equal number of layer groups as copper layers, so the + "max_layer" #define'd variable has been used throught the codebase + to delimit iteration over both layer groups, and layers. This makes it hard for people reading the codebase to identify + whether a given loop is over layers or layer groups (since the + counter variable is often fairly terse or indescript). Confusingly, + in some of the code, layer groups indexes are stored in a variable + called "layer". To aid understanding of the code, this commit removes the max_layer + variable (#define'd to (PCB->Data->LayerN)), and replaces it with + two similarly #define'd variables, "max_copper_layer" and + "max_group". This commit also introduces convenience macros: #define solder_silk_layer (max_copper_layer + SOLDER_LAYER) #define component_silk_layer (max_copper_layer + COMPONENT_LAYER) Which make the code intention much clearer for a common case of the + old max_layer variable usage. + +2010-09-10 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Fix lesstif SwapSides magic layer option. If the first layer in the layer group is silk, the swap sides key + won't auto-toggle the solder and component groups, nor properly + activate them if it does. Add code to find a visible *copper* layer + in the layer group and use that. + +2010-09-09 Ineiev * ineiev AT gmail dot com * + + * src/find.c: find.c: Add RATLINE_TYPE to switch statement in + BuildObjectList Part of Ineiev's patch from: + http://archives.seul.org/geda/user/Nov-2009/msg00456.html Modified-by: Peter Clifton * pcjc2 AT cam dot ac dot uk * + +2010-09-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c: Fix crash due to uninitalised variable in DRC check + Bug #3033772 Andrew Armenia noted that the second pointer returned from + BuildObjectList(), "object_type_list" would be left uninitialised if + the object type was not encountered. A subsequent call to free() in + DRCFind() would then cause memory corruption. The issue was originally reported by Ineiev: + http://archives.seul.org/geda/user/Nov-2009/msg00456.html That patch addresses the lack of a RATLINE_TYPE in the + BuildObjectType function, but does not prevent a segfault for other + unknown types. + +2010-09-08 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Fix arc bounding box math. Calculations for Arc bounding boxes weren't taking into account the + wide range of possible starting arcs. This patch uses modulus to + force angles into canonical forms and iterates through quadrants to + capture the full extents of each arc. + +2010-09-08 DJ Delorie * dj AT delorie dot com * + + * src/parse_y.y: Fix typo in parse_y.y A typo in parse_y.y was causing the documentation to be corrupted. + +2010-09-07 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: Fix layer + visibility logic for some boards. If the Groups() line listed the c/s layer before the copper layer, + disabling silk would also disable the copper. This change searches + the entire layer group looking for any layer that might need to be + drawn, and uses that as the exemplar instead of blindly choosing the + first layer in the list. + +2010-09-01 DJ Delorie * dj AT delorie dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Add import settings to menus At the bottom of the Settings menu, add a submenu for import + settings for placing new elements. + +2010-09-01 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Store units for import::disperse If the user specified the dispersement as "123mm" for example, store + that string as-is for convenience. + +2010-09-01 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Enhance GetValue Allow cm and in as units. Allow the units to be part of the value + string or separate. + +2010-09-01 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Add new-part-location to import Adds import::newX, import::newY, and import::disperse attributes. + These determine where new parts are located when they're added to + the layout, including some random variation to keep them from being + all on exactly the same spot. Parameters were added to Import() to + set these: In @code{Import()} is called with @code{setnewpoint} then the + location of new components can be specified. This is where parts + show up when they're added to the board. The default is the center + of the board. @table @code @item Import(setnewpoint) Prompts the user to click on the board somewhere, uses that point. + If called by a hotkey, uses the current location of the crosshair. @item Import(setnewpoint,mark) Uses the location of the mark. If no mark is present, the point is + not changed. @item Import(setnewpoint,center) Resets the point to the center of the board. @item Import(setnewpoint,X,Y,units) Sets the point to the specific coordinates given. Example: + @code{Import(setnewpoint,50,25,mm)} @end table Note that the X and Y locations are stored in attributes named + @code{import::newX} and @code{import::newY} so you could change + them manually if you wished. Calling @code{Import(setdisperse,D,units)} sets how much the newly + placed elements are dispersed relative to the set point. For + example, @code{Import(setdisperse,10,mm)} will offset each part + randomly up to 10mm away from the point. The default dispersion is + 1/10th of the smallest board dimension. Dispersion is saved in the + @code{import::disperse} attribute. + +2010-09-01 DJ Delorie * dj AT delorie dot com * + + * src/misc.c, src/misc.h: Add AttributeRemove functions Add AttributeRemoveFromList() and the wrapper AttributeRemove() + +2010-08-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Remove unused colour + allocation for "BlackPixel" + +2010-08-28 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Remove unused extern HID + ghid_hid from gui-top-window.c + +2010-08-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove the unused "Erasing" flag / counter This variable tracks whether the object being drawn is to be erased. + It is never actually tested, so remove it. + +2010-08-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Initialise integer counters with 0, not + "false". For the "doing_assy" flag, fix its type to "bool" rather than "int". + +2010-08-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Remove "HaveGathered" parameter from + DrawLineLowLevel() This is superflous, as it is only passed as TRUE when the Gathering + variable it overrides is known to be FALSE anyway. + +2010-08-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/data.c, src/data.h, src/draw.c: Remove unused global variable + "render", and "extern bool RedrawOnEnter" The "render" variable was set and reset, but was not used anywhere. + +2010-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Track previous state of + crosshair attachements when undrawing For correctness - this doesn't necessarily fix any rendering bugs. + +2010-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-utils.c: hid/gtk: Simplify ghid_draw_area_update() If the rect passed is NULL, we can simply pass that on to + gdk_window_invalidate_rect() which will invalidate the whole area. + +2010-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h: hid/gtk: Remove unused + functions relating to string display Removes ghid_string_markup_extents() and ghid_string_markup() + +2010-08-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-utils.c: hid/gtk: Remove unused + ghid_draw_area_clear() function + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-top-window.c: Merge GTK attributes. Since the new help system only allows one attribute (i.e. command + line) list per HID, combine the two GTK lists into one. + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c, src/hid/lesstif/menu.c: Merge lesstif + attributes. Since the new help system only allows one attribute (i.e. command + line) list per HID, combine the two Lesstif lists into one. + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/main.c: Print all command line options with help. Keep track of which attributes we've printed as part of the HID + help. After that, print any remaining attributes we know about that + we haven't already printed. + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-top-window.c: Export + GTK attributes. The new help system uses export attribute lists for help, so the + Lesstif HID needs to export them. + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Export lesstif attributes. The new help system uses export attribute lists for help, so the + Lesstif HID needs to export them. + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Check for NULL element name when adding attributes. When setting element attributes, if the element is as yet unnamed, + use an "unnamed element" title instead of segfaulting. + +2010-08-15 Robert Spanton * rspanton AT zepler dot net * + + * po/ru.po, src/hid/gtk/gui-dialog.c: Add a keyboard shortcut to + pcb's "close without saving" option This patch adds a keyboard mnemonic to the "close without saving" + option in the close confirmation dialog box. + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Update Import() docs Fix capitalization. Mention that elements that should be removed + are left, but selected, after an Import. + +2010-08-15 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c, src/gpcb-menu.res, src/pcb-menu.res: Add + FreeRotateBuffer to the Menu Modify FreeRotateBuffer() to prompt the user if no angle is passed. + Add an entry to the menus to call it that way. + +2010-08-10 kai-martin * kmk AT bibo dot iqo dot uni-hannover dot de * + + * src/action.c: modified: action.c (fix element name position on + import schematic) + +2010-08-14 DJ Delorie * dj AT delorie dot com * + + * tools/gnet-pcbfwd.scm: Quote strings Quote all strings that might contains commas or close parens, to + avoid syntax errors when those names are passed to actions. + +2010-08-03 DJ Delorie * dj AT delorie dot com * + + * src/select.c: Don't select silk on the far side if the far side is + not shown The logic for determining if a layer was "on" didn't take into + account that the two silkscreen layers are handled differently. + Thus, if you tried to select shown silk, you would select hidden + silk on the other side too, unknowingly moving that around. With this patch, silk on the far side is only selected if the far + side ("invisible" side) is shown. + +2010-06-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/const.h, src/crosshair.c, src/flags.c, + src/gpcb-menu.res, src/hid/gtk/gui-icons-mode-buttons.data, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-top-window.c, src/hid/lesstif/main.c, + src/pcb-menu.res, src/set.c: Introduce POLYGONHOLE_MODE for creating + holes in polygons Having selected polygon hole mode, the first click selects which + polygon to cut a hole in. A second click defines the start point of + the hole contour. The tool then behaves in a similar way to the + polygon drawing tool, with the hole ending when the start point is + re-clicked. To avoid creating illegal polygons, the hole drawn is subtracted + from a representation of the original polygon with the + poly_Boolean_free(). This consolidates any contours it intersects + with and prevents the user defining contours which intersect each + other. (Although we don't currently prevent the the user drawing + self-intersecting contours). The resulting POLYAREA is re-processed into PolygonType objects, + potentially more than one - if the hole drawn bisects the original + polygon. To keep undo operations simple, these are added as + completely new objects and the original polygon is deleted - along + with its ID. + +2010-06-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c, src/polygon.h: Expose APIs for creating POLYAREA + from PolygonType objects and back The PolygonPoly() API wraps polygon.c's original_poly() function, + whilst PolyToPolygonsOnLayer() converts the passed POLYAREA and all + those linked to it into discrete PolygonType objects on the board. + +2010-06-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/autoroute.c, src/buffer.c, src/copy.c, + src/create.c, src/create.h, src/crosshair.c, src/file.c, + src/file.h, src/global.h, src/insert.c, src/insert.h, src/mymem.c, + src/mymem.h, src/parse_l.l, src/parse_y.y, src/polygon.c, + src/polygon.h, src/remove.c, src/report.c, src/undo.c, src/undo.h: + Support holes in input polygons (incl. file-format addition) PCB file-format date is now 20100606, and files saved with this or + greater PCB version will not load with older versions of PCB. If a + particular board doesn't make use of the polygon hole feature, the + PCB revision date in the file can be manually reset to 20070407. The file-format addition is as follows. Previously, a polygon would + be specified as a series of coordinates, such as: Layer(1 "component") ( Polygon("clearpoly") ( [6000 6000] [81000 6000] [81000 59000] [6000 59000] ) ) This commit introduces the ability to specify negative contours + which form holes in the polygon shape, e.g.: Layer(1 "component") ( Polygon("") ( [6000 6000] [81000 6000] [81000 59000] [6000 59000] Hole ( [76000 55000] [76000 38000] [58000 38000] [58000 55000] ) Hole ( [10000 10000] [10000 28000] [27000 28000] [27000 10000] ) ) ) The winding order of the contours specified in the file does not + matter, since PCB will automatically invert the order of the points + as necessary (as it always did with the outer contour). Hole contours should not intersect or self-intersect (although this + isn't checked for at load time). Hole contours must not intersect + the polygon's outer contour. Technical details: The PolygonType structure has a number of new fields, the critical + ones being an array of indices defining the start of hole contours. (PolygonType *)->HoleIndex[n] The number of hole contours is stored in (PolygonType + *)->HoleIndexN, and the maximum allocated memory for indices in + (...)->HoleIndexMax. The first hole contour starts at the point + given by (...)->Points[(...)->HoleIndex[0]], and continues until the start of + the next contour, or the last point defined. By storing all polygon points (including holes) in the existing + array (...)->Points[], existing code which operates on the polygon as a + whole, e.g. translation and rotation, can operate without change. For other operations, determining wrap-around to operate within the + same contour requires more computation. Some helper functions have + been introduced in polygon.c to aid this, next_contour_point() and + prev_contour_point(). Where applicable, these have been used to + simplify existing code which used ad-hoc wrap-around code. polygon_point_idx() computes the array index of a point in a polygon + from its PointTypePtr address. This is used to replace a search + idiom used in a number of places. polygon_point_contour() returns + the number of the contour a given point index belongs in, 0 for the + outer contour, 1 for the first hole etc.. Undo: Undo with holes has become a little more complex. The undo for a + point removal must now record which contour the point came from. + This is determined by the index of the removed point, and a new + boolean flag "last_in_contour", indicating if the point was at the + end of its contour. This flag is passed to InsertPointIntoObject(), + which uses it to disambiguate inserting a point at an index on the + boundary of two contours. Undo operations for removing hole contours "cheat" by saving a copy + of the whole polygon into the undo buffer rather than attempting to + describe the operation as a delta change to an existing polygon. + When undoing, the object IDs are swapped to keep them consistent. + +2010-06-05 Jared Casper * jaredcasper AT gmail dot com * + + * src/hid/gtk/gui-log-window.c: Add missing return statement. + +2010-06-05 Jared Casper * jaredcasper AT gmail dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Fix Bug #2717258, Lock mode + with F12. Binds F12 to lock mode in the default gcpb-menu.res and pcb-menu.res + files, bringing them inline with existing documentation. + +2010-06-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/hid/lesstif/main.c: Revert some "True" -> + "true" string changes These were inadvertently changed by the mechanised Boolean -> bool + replacement in commit ad5eb5a165442be38624aa622beeb57dc1d2afbd + +2010-06-05 Robert Spanton * rspanton AT zepler dot net * + + * src/action.c, src/action.h, src/autoplace.c, src/autoplace.h, + src/autoroute.c, src/autoroute.h, src/box.h, src/buffer.c, + src/buffer.h, src/change.c, src/change.h, src/clip.c, src/clip.h, + src/command.c, src/copy.c, src/copy.h, src/create.c, src/create.h, + src/crosshair.c, src/crosshair.h, src/data.c, src/data.h, + src/djopt.c, src/draw.c, src/draw.h, src/drill.c, src/file.c, + src/file.h, src/find.c, src/find.h, src/flags.c, src/global.h, + src/gts/gts.h, src/hid/gerber/gerber.c, + src/hid/gtk/gui-command-window.c, src/hid/gtk/gui-dialog-size.c, + src/hid/gtk/gui-drc-window.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui-netlist-window.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/dialogs.c, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/netlist.c, src/hid/lesstif/styles.c, + src/hid/nelma/nelma.c, src/insert.c, src/insert.h, src/line.c, + src/main.c, src/misc.c, src/misc.h, src/move.c, src/move.h, + src/mtspace.c, src/mtspace.h, src/mymem.c, src/netlist.c, + src/parse_l.l, src/parse_y.y, src/polygon.c, src/polygon.h, + src/polygon1.c, src/rats.c, src/rats.h, src/remove.c, src/remove.h, + src/report.c, src/rotate.c, src/rtree.c, src/rtree.h, + src/rubberband.c, src/search.c, src/search.h, src/select.c, + src/select.h, src/set.c, src/set.h, src/thermal.c, + src/toporouter.c, src/undo.c, src/undo.h, src/vendor.c, + src/vendor.h: Change all Booleans to bool. c99 provides bool. Declaring Boolean adds some obscurity to the + code, and could also miss out on some machine-specific + optimisations. This patch removes the definition of Boolean, and changes all + instances of it to bool. If you've come across this commit because it's causing you issues + when rebasing on mainline pcb, then you should find the following + script useful. You can use it to rewrite all of your local commits + to use bool instead of Boolean like so: git filter-branch --tree-filter rename-bool.sh HEAD...${HASH} Replacing ${HASH} with the latest commit that's in mainline. if [ ! -f src/autoplace.c ] then echo "This doesn't look like the PCB source directory." echo "Cowardly exiting to avoid causing misery!" exit fi chg_bool () { FNAME=$1 ADDR=$2 sed -i -e "${ADDR}s/\bBoolean\b/bool/g" "$FNAME" sed -i -e "${ADDR}s/\bTrue\b/true/g" "$FNAME" sed -i -e "${ADDR}s/\bFalse\b/false/g" "$FNAME" } find -name '*.[ch]' | while read f do chg_bool "$f" done find -name '*.[yl]' | while read f do # Replace first '%%' line with __TMP_MARKER_ sed -i -e '0,/^%%/s/^%%/__TMP_MARKER_/' "$f" # Replace in section before the first '%%' chg_bool "$f" "0,/^__TMP_MARKER_/" # Replace in section after the last '%%' chg_bool "$f" "/^%%/,$" # Remove the temporary marker: sed -i -e 's/^__TMP_MARKER_/%%/' "$f" done + +2010-06-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c, src/parse_y.y: Refer to git, not cvs when reading a + file from newer PCB. + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * po/LINGUAS, po/ru.po: Add Russian translation + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * po/POTFILES.in: Add source files with localized strings to .po + generation + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * src/hid/gtk/gui-keyref-window.c, src/rats.c: Adjust punctuation + and capitalisation of some messages + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * src/gpcb-menu.res: Add top level menu to localization + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: String unification and white + space cleanup String Rip up selected auto-routed tracks unified, so it can be + translated as one string. Also some white spaces at end of line + removed. + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * src/hid/common/actions.c: Localize need coord message before + output + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * src/action.c, src/change.c, src/create.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-command-window.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c, + src/hid/ps/ps.c: Add strings to localization + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * src/global.h, src/hid/gtk/gui.h: Move internationalization macros + to one header + +2010-06-02 Sergey Alyoshin * alyoshin dot s AT gmail dot com * + + * autogen.sh: Add rule to extract localized stings from .res files + +2010-06-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Don't call gdk_draw_points() + when we have no grid points to draw Fixes this warning seen when zooming close in on a course grid + setting: Gdk-CRITICAL **: gdk_draw_points: assertion `(points != NULL) && + (n_points > 0)' failed + +2010-06-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Fix node_label() function to work with + self-intersection Rather than just giving up if we encounter our own edges in the CVC + list at first, skip them until we either run out of edges, or find + one belonging to the other polygon. I'm not 100% sure this is the correct fix, but it "seems to work". Test-case: Layer(1 "component") ( Line[60000 70000 60000 90000 4000 2000 "clearline"] Line[80000 60000 80000 90000 4000 2000 "clearline"] Line[90000 90000 90000 50000 4000 6000 "clearline"] Line[60000 40000 80000 60000 4000 6000 "clearline"] Polygon("clearpoly") ( [10000 10000] [140000 10000] [140000 140000] [10000 140000] ) ) + +2010-06-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Fix the polygon touching contour test in + poly_ChkContour The following test-cases were used to help verify the changes: This polygon forms a self-touching shape like this: \| However, the right-hand edge does NOT have a node at the + junction. /| This previously caused it to fail the + self-intersection test. It should be reported as good. Polygon("") ( [85000 50000] [85000 90000] [83000 90000] [83536 63535] [85000 59999] [83535 56464] ) This polygon forms a self-intersecting shape like this: |/ (The vertical section is a straight line with no node in the + middle) /| It must be reported as bad. Polygon("") ( [85000 50000] [85000 90000] [83000 90000] [83536 63535] [85000 59999] [89535 56464] ) This polygon self-intersects, and must be reported as bad: Polygon("") ( [160000 50000] [160000 90000] [170000 100000] [180000 120000] [180000 150000] [160000 150000] [160000 120000] [170000 100000] [180000 90000] [180000 50000] ) This polygon self-touches, and should be reported as good: Polygon("clearpoly") ( [120000 50000] [120000 90000] [130000 100000] [120000 120000] [120000 150000] [140000 150000] [140000 120000] [130000 100000] [140000 90000] [140000 50000] ) + +2010-06-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Fix poly_ComputeInteriorPoint() to work correctly + for holes The step where the algorithm finds a convex node to start from must + take into account whether the polygon vertices are ordered as a hole + or an outer contour. We now correctly compute a point inside the + hole, rather than possibly outside it. This fixes an assertion on the following test-case. Prior to this + commit, the incorrect "interior" point tested for the concave hole + happens to lie inside the polygon's other hole, causing it to fail + an assert during processing. Layer(2 "solder") ( Line[340000 160000 183700 108000 1500 3000 "clearline"] Line[92000 121000 120000 90000 1500 3000 "clearline"] Line[270000 90000 120000 90000 1500 3000 "clearline"] Polygon("clearpoly") ( [40000 40000] [320000 40000] [320000 200000] [40000 200000] ) ) The bug was created in my attempt to speed up poly_ContourInContour: + commit 3d0a8bd1dae0816d364a774bf9b958faf2983ec7 + +2010-05-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Speed up poly_ContourInContour() test by computing + interior point NB: This introduces a behaviour change in the boundary case, that + two identical contours will now be considered to be inside each + other. First perform a test on an arbitrary boundary node (proving that the + contour being testing for "insideness" is not outside the other + contour. (This cannot not conclusively prove the contour is inside). In many cases, this simple node test gives enough evidence to return + 0 for the ContourInContour test computing and testing an interior + point. Rather than checking each exterior point, compute a strictly + interior point (not on the boundary), and test that against the + second contour. Benchmarked to improve performance over other fixes for the buggy + test. Example board load (CPU) times for a complex board: 21.50 (buggy contour_in_contour - single node point test) 24.43 (brute-force node point tests) 21.79 (single node test, then internal point test) + +2010-05-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Fix poly_ContourInContour() test not to return + TRUE for touching contours This test could previously return true for touching contours, such + as: __________.... |_________ | : :........ || : :: /\ : || : + Note that the bounding box of A is inside that of B, :: / \ :/ \ : + such that initial bounding box checks won't reject the ::/ A \/ B + \: possibility of A being inside B. ::\ /\ /: :: \ / :\ / + : ::..\/..:.\/..: When testing for insideness, the first point on A's contour is + picked. In this case, unfortunately being the touching X point + between the two contours. This point (correctly) returns as being + inside B - and the false presumption is that the whole A contour is + inside B. This commit introduces an unfortunately slow, but more robust test, + where we check each node in A for whether it is inside B. We return + as soon as we find an A node outside B, however this means the test + is VERY much slower for the case where A _is_ inside B. + +2010-05-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Add comment explaining assumptions for + poly_ContourInContour function Also, document its buggy boundary condition where the arbitrary + point chosen to test happens to be a common node shared between two + separate contours (which the test should return FALSE for). + +2010-05-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac: Make --enable-dbus default for the GTK and Lesstif + HIDs + +2010-05-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/main.c: Allow running of action scripts when running PCB as an + exporter + +2010-05-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Improve dump_poly() output Make it print each contour of a POLYAREA, and move the NEXT PLINE + and NEXT POLY messages inside the loops interating over these + structures. + +2010-05-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Add tool-tip to identify + element, pin and net when hovering + +2010-05-09 DJ Delorie * dj AT delorie dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Clarify the meaning of keys + bound to SetValue() Clarifies that keys which are bound to SetValue change the styles, + not the existing objects, so they really affect *new* objects. + +2010-05-04 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Fix PNG bloat for drills. Keep track of when the GC is doing an erase or drill, and invert the + bloat for holes. + +2010-04-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c: Allow for only one confirm button. The GTK confirm_dialog() hook now supports the user passing only one + button. Before, if you passed just "ok" it would create two OK + buttons. + +2010-04-23 DJ Delorie * dj AT delorie dot com * + + * src/change.c: Add hint about :MinClearGap(Selected,=10,mil) Add a hint to the user about how to change the clearance of a group + of objects. + +2010-04-23 DJ Delorie * dj AT delorie dot com * + + * src/change.c, src/change.h: Handle attempts to change clearance on + polygons. If the user attempts to change the clearance between polygons and + objects within the polygon by pressing 'k' over the *polygon*, + notice that attemp and tell the user how to accomplish what they + want. + +2010-04-12 Kai-Martin Knaak * kmk AT lilalaser dot de * + + * doc/extract-docs: expand the syntax of documentating comments This is part of the effort to derive the command line option entries + in the manual dynamically from the source. The expanded syntax + allows for more control on the actual headings rendered in the + manual. 1) accept keys enclosed in quotation marks ("). This allows for + multiple word nodes in the documentation. 2) strip leading digits of the key after sort. This allows to + control the order of nodes from the source. + +2010-04-16 Jared Casper * jaredcasper AT gmail dot com * + + * doc/pcb.texi, doc/thermal.pcb: Fix pr2136131. Clarify image of + thermal in doc. Also added some text about changing the style of thermal using + shift-click in the sections that talk about it. + +2010-03-18 Jared Casper * jaredcasper AT gmail dot com * + + * src/hid/common/actions.c: Check action name at registration. Prevent actions with spaces and '(' in their names from being + registered; these will cause ambiguity and problems in + hid_parse_actionstring. + +2010-03-18 Jared Casper * jaredcasper AT gmail dot com * + + * doc/pcb.texi, src/action.c, src/hid.h, src/hid/batch/batch.c, + src/hid/common/actions.c, src/hid/common/hid_resource.c, + src/hid/gtk/gui-command-window.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, src/main.c: + Consolidate hid action parsing. - Create a common routine hid_parse_command, which handles both + action script style "action(arg1, arg2);" and command entry style + "action arg1 arg2". This is done by making a static + hid_parse_actionstring function, which takes a boolean to determine + whether or not it should accept command entry style strings. + hid_parse_actions functions as it currently does, only accepting + action script style, but does so by calling hid_parse_actionstring + with TRUE. - Use hid_parse_command across all hids for user command entry, + removing command_parse in lesstif/main.c and batch/batch.c. - Added extra error handling to common hid_actionv to match + lesstif_call_action and remove lesstif_call_action. + +2010-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/toporouter.c: Fix some "mixed declarations and code" issues. + +2010-04-04 Ineiev * ineiev AT gmail dot com * + + * src/misc.c: Fix "Request for bounding box of unsupported type + 1024" Tracker bug # 2893717 + + https://sourceforge.net/tracker/?func=detail&atid=538811&aid=2893717&group_id=73743 + +2010-04-03 DJ Delorie * dj AT duopoly dot delorie dot com * + + * src/hid/lesstif/dialogs.c: Fix doc typo + +2010-04-03 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c: Open + schematic file chooser dialog if PCB name is not set. (cherry picked from commit 209e1031656f58ffe40189d93893457975c4042f) + +2010-04-03 DJ Delorie * dj AT duopoly dot delorie dot com * + + * src/hid/lesstif/dialogs.c: Implement lesstif ImportGUI() + +2010-04-03 DJ Delorie * dj AT duopoly dot delorie dot com * + + * src/action.c: Add missing newline. + +2010-04-03 DJ Delorie * dj AT duopoly dot delorie dot com * + + * src/action.c: Let the GUI deal with choosing schematics. If the PCB is as yet unnamed, or if the pcb name doesn't correspond + to a schematic file, have Import() call ImportGUI() to let the user + tell PCB what to do. Note: corresponding HID changes are separate commits. + +2010-04-03 DJ Delorie * dj AT duopoly dot delorie dot com * + + * src/misc.c, src/misc.h: Add AttributePut functionality. Add the logic to put arbitrary attributes into a PCB. + +2010-04-03 Stuart Brorson * sdb AT cloud9 dot net * + + * src/file.h: Remove conflicting declaration of ParseLibraryTree. This is a static function declared in file.c. Therefore I took it + out of file.h. + +2010-04-03 Stuart Brorson * sdb AT cloud9 dot net * + + * src/action.c: Place components in middle of board instead of at + 0,0. + +2010-03-01 Stuart Brorson * sdb AT cloud9 dot net * + + * src/action.c, src/buffer.c, src/change.c, src/copy.c, + src/create.c, src/file.c, src/file.h, src/global.h, src/main.c: + Support for footprints not in subdirectories Added tons of debug spew to various files to aid in program tracing + Also, modify library loading stuff in file.c to allow footprints to + live directly in library directory (rather than only one level + down). + +2010-04-02 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: When built with less than all of the graphic + formats that the png exporter supports, don't segfault anymore. The + problem is an array is defined differently at compile time but the + default value for the format was constant and a ways into the array. + Problem reported by jean on irc. + +2010-04-01 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: Inform the user where (what file or + compiled in defaults) the menu config came from. Should help with + some of the gpcb-menu.res versus pcb-menu.res and the + ./gpcb-menu.res versus ~/.pcb/gpcb-menu.res confusion which comes up + from time to time. + +2010-04-01 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Return non-fail for ReportAllNetLengths() + +2010-04-01 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Record the calculated length in Report(NetLength) + +2010-03-24 Dan McMahill * dan AT mcmahill dot net * + + * : commit d9e4279e4c0af142bc776bdd4a3b905388ce6b5a Author: Dan + McMahill * dan AT mcmahill dot net * Date: Wed Mar 24 17:38:17 + 2010 -0400 + +2010-03-22 anthonix * anthonix AT anthonix-desktop dot (none) * + + * : commit 6081daa8966c8c83bb734789c38dd5c42dd97443 Author: + anthonix * anthonix AT anthonix-desktop dot (none) * Date: Mon Mar + 22 12:38:01 2010 +1300 + +2010-03-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Fix Typo + +2010-03-20 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Speccut bug fix + +2010-03-20 anthonix * anthonix AT anthonix-desktop dot (none) * + + * : commit 1ee723379413c20973bdad27b1e1cf1d722cf3d1 Author: + anthonix * anthonix AT anthonix-desktop dot (none) * Date: Sat Mar + 20 19:45:05 2010 +1300 + +2010-03-19 Anthony M. Blake * anthonix AT anthonix dot resnet dot scms dot waikato dot ac dot nz * + + * : commit e45f4e8d15f2c30f8ccb37de5b0bfa801fca572c Author: Anthony + M. Blake * anthonix AT anthonix dot resnet dot scms dot waikato dot + ac dot nz * Date: Fri Mar 19 16:25:38 2010 +1300 + +2010-03-18 Dan McMahill * dan AT mcmahill dot net * + + * tests/run_tests.sh: Missed the copyright bump when adding the + gcode compare routines a few weeks back. + +2010-03-18 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, tests/golden/Makefile.am, + tests/golden/hid_png2/Makefile.am, + tests/golden/hid_png3/Makefile.am, tests/tests.list: Add tests for + --outfile and --dpi arguments to the PNG exporter + +2010-03-13 Kai-Martin Knaak * kmk AT lilalaser dot de * + + * README, doc/pcb.texi, src/main.c, win32/Readme.txt: replaces + "pcb.sourceforge.net" with "pcb.gpleda.org" + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid.h, src/hid/common/actions.c: Apply patch from Patrick + Bernaud: Add function to register single action. The possibility to register a single action has been introduced with + commit 337fa8ba8094cee1ed291cec7bf29895ac7c9d72 but then reverted + later when changing way of passing context to action callback. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid/common/actions.c: Apply patch from Patrick Bernaud: Modify + HID actions storage. It removes the HID_ActionNode structure and directly store + registered actions in an array of HID_Action*. It also provides a nicer way of making sure the array is sorted and + the code for binary search within the array has been removed in + favor of a call to bsearch(). + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/main.c: Apply patch from Patrick Bernaud: Set 'exporter' + global variable before printing defaults. In print_defaults(), when the HID to print defaults is not a gui, + set 'exporter' global variable prior to calling HID's + get_export_options() callback. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/main.c: Apply patch from Patrick Bernaud: Rewrite function + that print HID options. The previous version of usage_hid() had a strange search for gui HID + attributes through 'hid_attr_node' rather than requesting them + directly from the HID. As a result it was calling the get_export_options() callback on + exporter without prior setting of the exporter global variable. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid/gtk/gui-dialog-print.c: Apply patch from Patrick Bernaud: + gtkhid: Avoid use of 'exporter' when testing for exporter + availability. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid/gtk/gui-dialog-print.c: Apply patch from Patrick Bernaud: + gtkhid: Set and unset global variable 'exporter' when printing. The GTK hid was not setting the global variable 'exporter' before + exporting the layout in ghid_dialog_print(): exporter HID relying on + this variable being set were lost. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid.h, src/hid/common/actions.c, src/hid/lesstif/menu.c: Apply + patch from Patrick Bernaud: Provide context to callbacks of actions + through global variable. Providing a context to action is necessary for scripting languages + (for example). To do so, a global variable ('current_action') is + being defined: it is saved, set and restored when running the + callback of an action in a way similar to what PCB already does with + HIDs. The callback function may access the action it belongs to and cast + it the way it wants to extract information from a potentially + extended HID_Action structure. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid/common/actions.c: Apply patch from Patrick Bernaud: Sort + actions by references in 'all_actions'. Previously, when building 'all_actions', a copy of every HID_Action + was performed for each action. Now it builds 'all_actions' with + pointers to the actual HID_Action structures (without reallocating). + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid.h, src/hid/common/actions.c, src/hid/hidint.h, + src/hid/lesstif/menu.c: Apply patch from Patrick Bernaud: Revert + "single-action register/deregister". This reverts commits 337fa8ba8094cee1ed291cec7bf29895ac7c9d72 and + b274cf8fe9c8caf5bcd4edc28935c88cf5bab7f4 before the introduction of + a new context passing scheme for actions. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid.h: Apply patch from Patrick Bernaud: Fix comment for + global variable 'gui' in hid.h. hid_start_gui() does not exist. The variable is instead set in + main() and hid_expose_callback(). + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/draw.c: Apply patch from Patrick Bernaud: Modify + DrawSpecialPolygon() prototype to not take a pointer on HID. DrawSpecialPolygon() was the only function to take a HID as + parameter. Every other draw function works on the current HID + through global variable 'gui'. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid/gtk/gui-dialog-print.c: Apply patch from Patrick Bernaud: + Support HID_Mixed options in attribute dialog Since an HID_Mixed attribute is the combination of a real and an + enum, reuse the code for HID_Enum to provide a combo box next to the + spin button for the real part. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/hid/common/hidinit.c, src/hid/gtk/gui-config.c, src/main.c: + Apply patch from Patrick Bernaud. Modified code to not abort on HID_Mixed attributes. Th gtk HID is + modified to understand such an attribute (though the attribute + dialog has still no support for them), the lesstif HID is unchanged. + +2010-03-14 Stuart Brorson * sdb AT cloud9 dot net * + + * src/main.c: Applying patch from Patrick Bernaud. HIDs with a name too long were breaking alignement in usage() as the + code requested insertion of a tab after the name even for HID names + already exceeding the length of the tabulation. This is similar to how usage_attr() already does alignment of name + and help text. + +2010-03-13 Dan McMahill * dan AT mcmahill dot net * + + * : commit b75d1fe8d42c138ae499898db5b926948b73f767 Author: Dan + McMahill * dan AT mcmahill dot net * Date: Sat Mar 13 09:08:06 + 2010 -0500 + +2010-03-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gcode/gcode.c: Remove invalidate_wh from the new gcode HID + too. + +2010-03-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/global.h, src/main.c, src/misc.c: Remove Settings.init_done + variable and its usage This variable was previously used to allow action scripts run prior + to loading the GUI to avoid GUI startup if they executed a "Quit" + action. The requirement dates back prior to the HID split, where the "Quit" + action would cause PCB to call gtk_main_quit(), an operation which + is illegal if the GUI main loop was not yet started. The init_done + flag was used in QuitApplication(), both to determine whether the + GUI had started, and if not - to note that the GUI should not be + initialised later. (Instead of calling gtk_main_quit()). With the HID split, the QuitApplication() function was changed to + call exit(0) rather than gtk_main_quit(), so this dance isn't + necessary at all now.. in either case, we can just exit the + application immediately. + +2010-03-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/global.h: Remove unused HistorySize field from the settings + structure + +2010-03-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/hid.h, src/hid/batch/batch.c, + src/hid/common/hidnogui.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c: Remove unused "last" parameter from HID + "invalidate_lr" method + +2010-03-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid.h, src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/extents.c, src/hid/common/hidnogui.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/hid/lpr/lpr.c, src/hid/nelma/nelma.c, + src/hid/png/png.c, src/hid/ps/eps.c, src/hid/ps/ps.c: Remove unused + HID method invalidate_wh() invalidate_lr and invalidate_all are sufficient APIs for our needs. + +2010-03-11 Dan McMahill * dan AT mcmahill dot net * + + * data/pcb.desktop.in: Revert "As silly as it seems to group any + sort of scientific or EDA" I've pushed really hard to sort this nonsense out, and this patch is + not in my opinion suitable for applcation. gEDA, gerbv and PCB all + deliberately omit the Education category.. this is not where we need + to fix this issue. I strongly object to putting bogus categories into our apps. If + Debian want to patch these in, let them. This reverts commit b402a144e19225f0648189bca6fbfad95d046047. + +2010-03-11 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: Fix an obvious bug in the previous commit. + Caught by harry. + +2010-03-11 Dan McMahill * dan AT mcmahill dot net * + + * data/pcb.desktop.in: As silly as it seems to group any sort of + scientific or EDA software under "Education", this appears to be the + standard documented by + http://standards.freedesktop.org/menu-spec/1.0/apa.html Noted in + patch #2889228 by Ahmed El-Mahmoudy. + +2010-03-11 Dan McMahill * dan AT mcmahill dot net * + + * data/pcb.desktop.in: "Encoding" is deprecated. + http://standards.freedesktop.org/desktop-entry-spec/1.0/apc.html + Noted in patch #2889228 + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: It is gcode/hid.conf not gcode/gcode.conf that + needs to be distributed. Also put this file in the correct sorted + location. + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: Add missing AC_PROG_MKDIR_P check. + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: Fix building outside of the source tree with + dependency tracking disabled. In that case some directories need to + be manually created. Fixes bug #2889226. + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: In the rectangle fill code fix a bug in swapping + of the coordinates. It doesn't appear that this code path is + encountered much. + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: Add DSC to the postscript outputs to keep certain + windows based postscript viewers a little happier. Patch supplied + in patch #2700352 by Bob Paddock. + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * INSTALL, configure.ac: The gcode exporter used libgd so make sure + we check for it and document that we need it. Noted by Patrick + Bernaud in bug #2967313 + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * tests/inputs/Makefile.am: Make sure the simple gcode test layout + makes it into the distfile. + +2010-03-10 Dan McMahill * dan AT mcmahill dot net * + + * : commit 802576013b5d780cd87caafa31c694279ee2dc4f Author: Dan + McMahill * dan AT mcmahill dot net * Date: Wed Mar 10 13:15:26 + 2010 -0500 + +2010-03-09 Stephen Ecob * silicon dot on dot inspiration AT gmail dot com * + + * src/djopt.c: Fix Freckles The autorouter sometimes ends a trace just past a pad. The + optimizer cuts this trace at the pad center, leaving a tiny trace + left over. This tiny trace is a "freckle" and it inhibits mitering. + Check for such freckles and remove them. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * tests/run_tests.sh: Make the xy file check actually do something. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, tests/golden/Makefile.am, + tests/golden/hid_gcode1/Makefile.am, + tests/golden/hid_gcode1/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode1/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode1/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode10/Makefile.am, + tests/golden/hid_gcode10/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode10/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode10/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode11/Makefile.am, + tests/golden/hid_gcode11/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode11/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode11/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode2/Makefile.am, + tests/golden/hid_gcode2/out.back.cnc, + tests/golden/hid_gcode2/out.drill.cnc, + tests/golden/hid_gcode2/out.front.cnc, + tests/golden/hid_gcode3/Makefile.am, + tests/golden/hid_gcode3/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode3/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode3/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode4/Makefile.am, + tests/golden/hid_gcode4/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode4/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode4/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode5/Makefile.am, + tests/golden/hid_gcode5/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode5/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode5/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode6/Makefile.am, + tests/golden/hid_gcode6/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode6/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode6/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode7/Makefile.am, + tests/golden/hid_gcode7/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode7/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode7/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode8/Makefile.am, + tests/golden/hid_gcode8/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode8/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode8/gcode_oneline.gcode.front.cnc, + tests/golden/hid_gcode9/Makefile.am, + tests/golden/hid_gcode9/gcode_oneline.gcode.back.cnc, + tests/golden/hid_gcode9/gcode_oneline.gcode.drill.cnc, + tests/golden/hid_gcode9/gcode_oneline.gcode.front.cnc, + tests/inputs/gcode_oneline.pcb, tests/run_tests.sh, + tests/tests.list: Add testsuite entries to test the gcode export HID + and all of its command line options. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/gcode.c: Remove RCSID. We don't use those anymore. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/gcode.c: Change options like 'drill depth' to + 'drill-depth' as a space in a command line option is non-standard. + Also be consistent with having or not having a "." at the end of the + option help strings. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/gcode.c: Remove unix2dos system() call. It was not + needed. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/trace.c: Get rid of compiler warnings. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/gcode.c: Get rid of some gcc warnings. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/gcode.c: C++ style comments -> C style comments + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.1: Fix nroff error. Noted in sf patch #2889227 by Ahmed + El-Mahmoudy. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add the gcode exporter to the export hid list + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * INSTALL: add notes about what libs may be needed (none) for the + gcode exporter. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/auxiliary.h, src/hid/gcode/bitmap.h, + src/hid/gcode/curve.c, src/hid/gcode/curve.h, + src/hid/gcode/decompose.c, src/hid/gcode/decompose.h, + src/hid/gcode/gcode.c, src/hid/gcode/gcode.h, + src/hid/gcode/lists.h, src/hid/gcode/potracelib.h, + src/hid/gcode/trace.c, src/hid/gcode/trace.h: indent to conform to + the coding style used by pcb. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: gcode_lists.h should depend on gcode sources, not + png sources. + +2010-03-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gcode/auxiliary.h, src/hid/gcode/bitmap.h, + src/hid/gcode/curve.c, src/hid/gcode/curve.h, + src/hid/gcode/decompose.c, src/hid/gcode/decompose.h, + src/hid/gcode/gcode.c, src/hid/gcode/gcode.h, + src/hid/gcode/hid.conf, src/hid/gcode/lists.h, + src/hid/gcode/potracelib.h, src/hid/gcode/trace.c, + src/hid/gcode/trace.h: Apply sf patch 2948711 from Alberto Maccioni + which adds a g-code exporter. + +2010-03-08 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: When building the docs have configure check for + epsf.tex being in the TeX installation. Problem noted by Kai-Martin + Knaak and the method for checking suggested by Peter Clifton. + +2010-03-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac: Fix test for whether to rebuild the shipped + pcblib-newlib library ${top_srcdir} is a Makefile variable, we need $srcdir in + configure.ac + +2010-03-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * lib/Makefile.am: Fix make distcheck by removing regenerated newlib + footprints The generated newlib files need to be removed by make distclean if + they are being updated by the build process. If the files aren't + being updated, we should not delete them as they were originally + distributed with the source tarball. + +2010-03-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * tools/Makefile.am: Fix distribution of gnet-pcbfwd.scm in the dist + tarball Use the dist_ prefix to make this simple, so our installed targets + are now listed in dist_..._DATA, rather than ..._DATA and + EXTRA_DIST. + +2010-03-01 DJ Delorie * dj AT delorie dot com * + + * src/parse_y.y: Allow empty attribute values. The STRING token is NULL when an empty string is indicated, but + empty attributes are different than missing attributes, so if a + STRING is NULL, store an empty string instead. + +2010-02-28 DJ Delorie * dj AT delorie dot com * + + * src/change.c: Fix bogus cast to BoxType Instead of casting, which hides real bugs, pass the address of the + bounding box itself. + +2010-02-24 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Add more flexibility to the import::make option. New attributes: make::outfile - the intermediate action file make::target - the + makefile target to call (defaults to outfile or pcb_import) + make::makefile - adds -f to make Added more documentation too. + +2010-02-24 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: Check both FOO and FOO.fp for footprints. + +2010-02-24 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Check for NULL names. + +2010-02-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/main.c: Use strdup to copy environment strings into our + settings structure. getenv returns a const char * which is part of the environment and + must not be free'd. + +2010-02-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/main.c: Fix default gnetlist executable name to be "gnetlist" The old value "defgnetlist" appears to have been a mistake. + +2010-02-22 Jared Casper * jaredcasper AT gmail dot com * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-netlist-window.c, + src/hid/gtk/gui.h: hid/gtk: Prevent extra windows from showing + unnecessarily Prevent the library, log, and netlist windows in the GTK HID from + being shown unless explicitely requested. This is done by splitting + ghid_*_window_show into ghid_*_window_create, which creates all the + resources for the window, and ghid_*_window_show, which actually + shows the window (and optionally "presents" it, which pulls it to + the foreground and gives it focus). Since the NetlistShow action no longer actually shows the netlist + window, but sets the node/net that is shown in the window (if and + when it is visible), this patch also adds NetlistPresent which + presents the netlist window. This can be added to the + FindConnections menu item to restore the behavior of bringing up the + netlist window on a find. Added an action LogShowOnAppend() which can restore the old behavior + that the log window is shown whenever something is appended to it + (currently off by default). + +2010-02-22 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: Document that it is pcb-menu.res for the lesstif HID + and gpcb-menu.res for the GTK+ HID. + +2010-02-19 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh: Add some quoting to handle the case where + there are spaces in some of the directory names. As noted by peque on irc, this script failed when the build + directory was located somewhere that had a space in a directory + name. Adding the extra quotes fixes that. + +2010-02-16 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Revert an unintended change. + +2010-02-16 Ineiev * ineiev AT gmail dot com * + + * src/global.h: Fix broken build due to missing struct members Looks like a part of commit ef2efdd2a18a744eb715ffc1278aace1a2cded46 + was omitted by mistake. + +2010-02-07 Ineiev * ineiev AT gmail dot com * + + * src/find.c, src/search.c: Fix bugs in the arc intersection + routine. Bug #2942582 This bug resulted in various false identificaton of connectivity + between arcs and other object. Notes from Ineiev's emails: So I built a montecarlo; fixed some ugly unrealistic cases like thin + arc merged in bloat and arc->Delta<-360; ran the test program + (aat.c) several hours on different machins; that discovered no + errors, though the number of points was not very high (a thousand or + slightly more): the reference functions are really slow. That resulted in arc.bis.patch. I tested it also with already + mentioned teardropped OSDCU.pcb and t1.pcb. Then, eliminate two + precision losses. I feel I ought to stop here: the patch fixes many more bugs than + originally reported. + +2010-02-13 Dan McMahill * dan AT mcmahill dot net * + + * : commit ef2efdd2a18a744eb715ffc1278aace1a2cded46 Author: Dan + McMahill * dan AT mcmahill dot net * Date: Sat Feb 13 12:41:35 + 2010 -0500 + +2010-02-11 DJ Delorie * dj AT delorie dot com * + + * src/action.c, tools/gnet-pcbfwd.scm: Fix pcb forward annotation + bugs Finish rename of pcblf -> pcbfwd, handle pcb-has-no-name case. + +2010-02-09 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/action.c: When mkdtemp() is available use it + instead of tmpnam() for creating temp file names to be used by + gnetlist or make. + +2010-02-06 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: Remove some gcc warnings about unitialized variables. Remove some gcc warnings about uninitialized variables. The logic + was such that if the variables weren't ever assigned to somethign + then they also would not have been accessed but by getting rid of + this warning, we increase the chances of paying attention to other + warnings which may indicate real bugs. + +2010-02-06 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: Add missing return on an action function which is + supposed to return an int. + +2010-02-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: Remove some gcc warnings. Use GPOINTER_TO_INT(), GINT_TO_POINTER() and remove a couple of + unused variables to eliminate some gcc warnings. + +2010-02-06 Dan McMahill * dan AT mcmahill dot net * + + * src/netlist.c: In functions returning non-void, give a return + value for returns. + +2010-02-06 Dan McMahill * dan AT mcmahill dot net * + + * src/file.h: Add missing prototype for sort_netlist() which is + called in netlist.c. + +2010-02-06 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/action.c: Remove some gcc warnings. Add missing headers for fork(), execvp(), wait(). Also remove a + couple of unused variables. + +2010-02-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-netlist-window.c, src/hid/lesstif/netlist.c: + Rename NetlistChanged() to avoid conflicts Rename the existing static NetlistChanged() functions in the Gtk and + Lesstif HIDs to avoid conflicts with the core global + NetlistChanged() function. + +2010-02-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: swap png bloat too When computing the bloat offsets for filled rectangles, apply the + bloat after sorting the Y coordinates but before swapping them if + we're printing the solder side. + +2010-02-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Fix drawn circles When drawing a "line" that's zero length, check for rounded ends + (circle) vs square ends (square). + +2010-01-31 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/data.h, src/hid.h, src/misc.h, src/netlist.c, + src/rats.c, src/undo.c, tools/Makefile.am, tools/gnet-pcbfwd.scm, + tools/gnet-pcblf.scm: Changed element/netlist syntax as follows: ElementList(start) ElementList(need,...) ElementList(done) Netlist(freeze) Netlist(add,...) Netlist(thaw) Hooked all NetlistChanged() actions into a wrapper that checks for + frozen. + +2010-01-29 DJ Delorie * dj AT delorie dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Add import to gtk menu, + change lesstif menu to match. + +2010-01-29 DJ Delorie * dj AT delorie dot com * + + * tools/Makefile.am, tools/gnet-pcblf.scm: Add the new netlister. Adds the new script-based netlister and the install rules. Note + that this installs PCB's netlister in gEDA's data directory. + Unusual, but it's the best way to keep pcb in sync with its own + netlister. + +2010-01-01 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/global.h, src/gpcb-menu.res, src/hid.h, + src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/hidnogui.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/dialogs.c, src/hid/lesstif/lesstif.h, + src/hid/lesstif/main.c, src/hid/lesstif/xincludes.h, + src/hid/lpr/lpr.c, src/hid/nelma/nelma.c, src/hid/png/png.c, + src/hid/ps/eps.c, src/hid/ps/ps.c, src/pcb-menu.res: Add attribute + editor GUI to gtk and lesstif. Attributes(Layout|Layer|Element) Attributes(Layer,layername) Let the user edit the attributes of the layout, current or given + layer, or selected element. + +2009-12-27 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/misc.c, src/misc.h, src/pcb-menu.res: Add + Import() action Add an action to import schematics into the pcb. It allows for a + list of schematics to be specified in the action or in the pcb, as + well as supporting using a Makfile instead of gnetlist. + +2009-12-27 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Undo an accidental change. + +2009-04-21 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/buffer.c, src/buffer.h, src/change.c, + src/change.h, src/create.c, src/draw.c, src/file.c, + src/hid/lesstif/main.c, src/misc.c, src/misc.h, src/netlist.c: + Work-in-progress for LF: netlist importing + +2010-01-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Check for empty layers. If you have a four-layer board but the inner layers are empty, photo + mode dies. This checks for at least the more common case, but + further work to protect against *any* empty layer is warranted. + +2010-01-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Fix photo-mode mask layer. The addition of mask support to PNG export broke photo mode; this + patch undoes the mask support when photo mode is enabled. + +2009-12-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c, src/misc.c: Add support for specifying + soldermask and solderside from the command line Added "solderside" and "mask" as valid layers for --layer-stack. + Also added "silk" as an alias for "elements". Added mask support to + the PNG exporter so that it draws soldermask properly. Also added + support to PNG for showing the board from the solder side, and + removed some leftover cruft from when it was copied from the PS hid. + +2009-12-22 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Removed superfluous debug function + +2009-12-22 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c, src/toporouter.h: Toporouter: A few fixes The main fix is in the 'special cut' code, which had a tricky corner + case to deal with. The special cut code has also been commented in + the critical spots. There are a few other minor fixes, and a couple of heuristic + changes. + +2009-12-13 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Handle NULL strings when replacing elements. Sometimes, when you're building a board from the library, elements + won't have values for their strings. When replacing those elements, + replicate the NULL pointer rather than trying to strup it. + +2009-12-07 Chitlesh GOORAH * chitlesh dot goorah AT gmail dot com * + + * doc/refcard.tex: Update the quick reference From: Chitlesh GOORAH * chitlesh dot goorah AT gmail dot com * To: + gEDA user mailing list Hello there, The current layout of the PCB command reference PDF document (the + one currently being shipped) is broken. It looks like it on life + support. http://chitlesh.fedorapeople.org/pcb/refcard_old.pdf I've updated only the layout of refcard.tex + http://chitlesh.fedorapeople.org/pcb/refcard.tex to give + http://chitlesh.fedorapeople.org/pcb/refcard.pdf . Unfortunately, I + don't have enough time currently to update it to the latest key + shortcuts. Can you guys please apply it to the next release ? I hope + someone will update it in the meantime, else I'll dig into it next + year. Chitlesh + +2009-11-25 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: In the -h (help) output, mention which gui the gui + options are for. + +2009-11-25 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: Rather than having @code{Pcb} all over, refer to + the program name with @pcb{}. To help keep how we refer to and mark up the name of the program, + define a macro at the start and use it all over. Also change some of the "for X11" text since pcb really runs on what + ever windowing system gtk (X11 or windows) or lesstif (X11 for this + one) runs on. + +2009-11-23 Dan McMahill * dan AT mcmahill dot net * + + * : commit c81b2d09b281a357910759a373bd8e8bdc4b3cd1 Author: Dan + McMahill * dan AT mcmahill dot net * Date: Mon Nov 23 21:16:36 + 2009 -0500 + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c: hid/gtk: Add a guard against GC's being + passed from another HID Various other HIDs have this check. + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-gdk.c, src/hid/gtk/gui.h: hid/gtk: Move + definition of the device context inside gtkhid-gdk.c Keep it private to the drawing routines. + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: hid/gtk: Remove unused HID + "ghid_extents" + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/gtk/gtkhid-gdk.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: hid/gtk: Move various gdk drawing routines into a + new file gtkhid-gdk.c This separates some of the drawing code so it could be replaced more + easily. Pretty much a straight move at this point, but renamed the static + function "draw_grid()" to ghid_draw_grid() now it is no longer local + to gtkhid-main. Removed all #include not required to build in gtkhid-main.c and + gtkhid-gdk.c + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/hid.h, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c: Add SL_RATS layer ID to tell the GUI we're + drawing rats Also, let the GUI decide whether it wants to draw rats or not, + rather than have the core test PCB->RatsOn directly. + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/draw.h: draw.c: Apply const qualifier to DrawLayer + and DrawSilk bounds This keeps the compiler happier. + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: By popular(*) request, Make the cross-hair snap + to the center of pads * Popular.. or vocal?, I'm not sure. If more people don't like the new behaviour, there is always git + revert. There was of course, a third possibility - adding support to snap to + pad end-points _and_ their centers. I rejected this because of + "nearly" square pads - it becomes difficult to know if you've picked + up the center of the pad, and many of those asking for + snap-to-center wanted it in order to pick up and align components by + their pads. NB: Optimised rat-lines still go to the edge of pads, as this can + often look less cluttered. Rat-lines drawn to the center of a pad + will work correctly, and remain on the pad center until the next + time "optimise" is run on the rats-nest. + +2009-11-15 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c, src/rubberband.c: Add support for rat-lines ending at + the center of pads Optimised rats are still located at the edges of pads, but the rat + connection checking code will now also accept rats ending at the + center of a pad. + +2009-11-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.h: draw.h: Remove ClearPin prototype missed in last + commit + +2009-11-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Don't clear pins / vias from polygons... it is + already done! Our polygons already the required holes for pins, vias, pads etc.. + so don't waste drawing clearances twice. This looks to be a legacy + from the way PCB used to draw polygons. + +2009-11-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/draw_helpers.c, src/polyarea.h, src/polygon.c, + src/polygon1.c: polygons: Tag circular contours so they can be + special-cased when drawing. Tagging circular contours allows GUIs (if they wish) to draw + circular holes in polygons more accurately, and potentially faster - + depending on whether they use mask based rendering or rely on the + dicer. When zoomed far out (and using a mask based scheme), the drawing + routine can use a lower vertex count approximation to the contour - + leading to rendering speed improvements. This is used to reasonable + effect in the experimental OpenGL branch. Modify hid/common/draw_helpers.c to use these tags when thin-drawing + polygon contours with common_thindraw_pcb_polygon(). This allows the + GUI to change the level of detail rendered with zoom, and serves to + test this feature. DRC checking and output are still done using the fixed resolution + approximation present in the polygon contour, so in this respect - + it makes rendering somewhat unfaithful to the final output. + +2009-11-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: draw.c: Draw all vias, pins and pads under the mask + layer This fixes an issue where the rendering of a partially masked via is + inaccurate. The down-side is that partially, or completely masked + vias become obscured by the mask drawn above them. If the user is previewing the mask rendering, it is probably best + that they see an accurate representation - even if this means hiding + vias. + +2009-11-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Fix thindraw mask drawing for pins, including + octagonal ones We need to set the line-width for round pins when in thin-draw and + clearing the mask. We need to tell DrawSpecialPolygon() whether we need thin-draw or + not depending on whether we're clearing the mask or not. We don't + need to set the line-width outside of DrawSpecialPolygon(), since it + sets it its-self. Fix DrawSpecialPolygon() to set the line width and cap style on the + correct GC. + +2009-11-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/draw_helpers.c: hid/common: Control update of + NoHoles cache based on clip region If at least 50% of the bounding box of a polygon is within the clip + region, compute the whole NoHoles polygon and cache it for later + rendering. If less of the polygon is within the clip region, just compute what + we need to draw the piece we've been asked for. + +2009-11-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/draw_helpers.c: hid/common: Fix memory leak in + polygon NoHoles clipping routine poly_CopyContour creates the edge tree, as does ContourToPoly(), + which overwrite the one created in poly_CopyContour(). Replace call to ContourToPoly() with a discrete alternative without + the poly_PreContour() call. Also, don't try to poly_Free() the output of poly_Boolean_free() in + an error condition. poly_Boolean_free() re-uses the A input polygon + for its output, so attempting to free that might be dangerous. poly_Boolean_free() should free its inputs (and any partial output) + if it encounters an error. + +2009-11-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/draw_helpers.c: hid/common: Clip no-holes polygon + pieces before calling fill_contour This avoids integer overflow in some HIDs (GTK, Lesstif?) when + drawing at high zoom level. Such overflow would lead to incorrectly + drawn polygons. It is possible that a similar bug could effect thin-drawn polygons, + but that has not manifested its-self so far. If we were to clip + these in the future, we need to be careful to extend the clip region + slightly off-screen, so the outlines are not drawn. Ideally we would clip these vertices using a Sutherland-Hodgman + clipping algorithm, then we could simply discard edges which are + clipped completely. + +2009-11-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/hid/common/flags.c, src/hid/gerber/gerber.c, + src/hid/png/png.c, src/hid/ps/ps.c, src/print.c: Use strcmp() for + special layer names, rather than strcasecmp() Before commit 086aa491fae18f1ec72da047b772fa3510f72d0b, we were + using strcmp() and strcasecmp() in different places. That commit + changed to strcasecmp(). Lets choose to keep the more restrictive + option for now, which reduces the number of "magic" layer names PCB + supports. + +2009-11-12 Patrick Bernaud * b-patrick AT wanadoo dot fr * + + * src/hid/gtk/gui-top-window.c: hid/gtk: Fix strncat length when + building accelerator string. (CODE!) (Oops, I pushed an empty patch last time - Peter Clifton) Commit d6b396c4a34bb619c8e91da1e9cd9bd27ff54657 was not enough: + strncat() must be given the remaining length of buffer to ensure it + does not overflow. Plus it now emits a message in the unlikely case + of a too small buffer for an accelerator. + +2009-11-12 Patrick Bernaud * b-patrick AT wanadoo dot fr * + + * : hid/gtk: Fix strncat length when building accelerator string. Commit d6b396c4a34bb619c8e91da1e9cd9bd27ff54657 was not enough: + strncat() must be given the remaining length of buffer to ensure it + does not overflow. Plus it now emits a message in the unlikely case + of a too small buffer for an accelerator. + +2009-11-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/find.c, src/polygon.c: Correct rendering and + connectivity checks for zero clearance pads and pins NB: These areren't technically allowed by PCB, but it is nice that + when a user hacks zero clearance in their PCB file, that we: a) Draw polygons without any cleared gaps in the output b) Correctly determine that these objects will be connected to the + polygon + +2009-11-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/hid/gerber/gerber.c, src/hid/ps/ps.c: Use + strcasecmp when looking for the "outline" or "route" layer A some cases previously used strcmp, leading to inconsistencies in + our handling of these "special" layers. + +2009-11-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: polygon.c: Remove unused #define COARSE_CIRCLE 0 + +2009-11-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: Speed up unsubtraction from polygons when objects + are deleted This process worked by adding a new "blob" of polygon to cover in + the hole made by the object being deleted. If this "blob" + intersected the contour of the original polygon, it would cause the + polygon's contour to be damaged. To avoid this, the unsubract code + would always clip the resulting polygon against the original + (pristine) polygon contour. Unfortunately.. this clipping operation is gauranteed to intersect + the contour of the polygon - a very expensive operation, since all + holes inside the polygon (many on a complex board) have to be + re-processed. This speed-up is achieved by reversing the order of operation. The + "blob" to be added to the polygon is first clipped against the + pristine contour (a relatively cheap operation). This then allows us + to add the new clipped blob to the more complex polygon on the board + without worry that the contour may be compromised. + +2009-11-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c: file.c: Add profiling of CPU seconds consumed during + file load This information is useful to benchmark the load of complex boards + which consume a lot of CPU cycles clipping polygons during loading. Adding this upstream will allow me to gain information from users + describing load slowness, without having a copy their design. + +2009-11-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/ps/ps.c: hid/ps: Don't use diced polygons for postscript + output This speeds up postscript output on boards with complex polygons. It has the added advantage for some postscript and pdf readers that + there are no accidental gaps rendered between pieces of the diced + polygon due to non-global anti-aliasing in their renderer. + +2009-11-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: Play with number of line segments in line caps By changing from 36 lines-segments per circle to 40, we create a + symmetry at 45 degrees - a common angle for lines on a circuit board + to intersect at. This avoids building additional complexity in the + polygons which are cut by these intersections. + +2009-11-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: Fixup frac_circle to avoid repeating a vertex the + caller will add Before we were getting self-intersecting polygons in some cases, a + big no-no. One less vertex should be added than the expected + (CIRC_SEGS / range), since the caller adds the last vertex. + +2009-11-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: polygon1.c: #ifdef DEBUG_ALL_LABELS build + print_labels() Avoids warnings when building with DEBUG defined, but without + DEBUG_ALL_LABELS. + +2009-11-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: polygon1.c: Tidy up poly_Valid debug print + routines to match pline_dump Avoids a superfluous line: %d %d 10 10 ""] at the beginning of each output block. + +2009-11-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: polygon1.c: Fixup pline_dump() (debug code) to + match correct edge state The old code would mistakenly annotate with the edge state for the + next edge. From polygon1.c: /* 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) */ + +2009-11-11 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon1.c: Re-write node_label() to only label the edge being + passed as its argument. Breifly, the old code tried to walk the entire CVCList labeling + multiple edges. The new code tries only to label the argument vertex + i.e. the forward ('N') edge from this vertex. It tries to look + counter-clockwise just one edge which will give the answer in most + cases. If that fails it looks further into the CVCList until it can + find the answer, then stops. The code is much simpler because we + know that the edge we are labeling is always departing the + cross-vertex point. (Futher comments and original bug diagnosis by Peter Clifton) This prevents "double labeling", where the old routine could label + any edges which intersect at the vertex passed to node_label(). This fixes a bug discovered by Stefan Salewski, where certain boards + could trigger an assert failure when PCB was built with debugging. The bug, it would seem - is relating to the way (and order) we were + labeling edges of polygon contours: 2 |/\ In this diagram, x is on the outer contour of our polygon, + x | and is in fact two vertices at the same point, lets denote + |\/ these as |\ and |/ 1 The labelling algorithm works up from point 1, gets to |\, whereupon + it gets the CVCList for the spatial point x - which contains |\ AND + |/ along with the (shared) edges from the clipping contour. node_label is called with the |\ vertex, but in the process of + scanning the CVCList at this point, it also checks for SHARED edges. + It _only_ checks shared edges against the |\ vertex, NOT the |/ one. During this pass, the | edge coming from the |/ vertex gets + mis-labelled as "OUTSIDE", where is should eventually get labelled + "SHARED" BUG: We then skip over calling node_label with the |/ vertex, since | has + already been labelled. We next get to point 2. Point 2 looks at the | edge, and declares it to be "INSIDE". (It + should already have been labelled "SHARED" by this point, so + node_label doesn't know any better. The | edge is already labelled "OUTSIDE" when we go to label it + "INSIDE".. assertion fail. This commit avoids missing the correct labelling of shared edges, by + ensuring we never label any edges in advance of calling node_label + for them. + +2009-11-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Reindent polygon1.c with "indent" This is a painful one for me to push, as it will certainly cause + rebase misery against all my local branches. Oh well... got to be done! + +2009-11-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/file.c: file.c: Don't walk off the end of a string in + string_cmp() We need to check that we don't advance past the terminating \0 in + the string. + +2009-11-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: polygon1.c: Fix some printf format arguments in + DEBUG sections %ld is for long int, and we are passing int, so use %d + +2009-11-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-dialog.c, src/hid/gtk/gui-top-window.c: hid/gtk: + Don't pass non-literat format argument to printf style functions. + +2009-11-09 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-top-window.c: Pass correct length to strncat We need to pass "sizeof (string) - 1", due to the NULL pointer. + +2009-11-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * win32/Makefile.am, win32/build_pcb, win32/pcb.nsi.in: win32: + Install Readme.txt in @docdir@ Also removes unnecessary fiddling with pkgdatadir which was + responsible for creating an empty directory $datadir/pcb-$VERSION/ Adjusted pcb.nsi.in to match new location of Readme.txt, but have + not test-built the Win32 package due to non-availablility. Adjusted build_pcb to put @docdir@ at ${pcb_inst}/doc, as this fits + the rest of the win32 build better. + +2009-11-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * example/Makefile.am, example/libraries/Makefile.am, + tutorial/Makefile.am: Install examples under @docdir@ This is what distro packaging scripts have been doing anyway, so + save them the work by moving our defaults. Suggested by Chitlesh GOORAH * chitlesh dot goorah AT gmail dot com + * + +2009-11-07 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * example/LED, example/LED.NET, example/LED.net, example/LED.pcb, + example/LED2, example/LED2.pcb, example/Makefile.am: examples: Add + ".pcb" extension to "PCB(2)", move "LED.NET" to "LED.net" ".pcb" change suggested by Chitlesh GOORAH * chitlesh dot goorah AT + gmail dot com * ".net" change was my doing, to match our registered + mime-types + +2009-11-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/lesstif/main.c: lesstif: Remove errornous & operator in + free () call GCC spotted this one. + +2009-11-05 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: Fix some details on branching and pushing a + local branch. + +2009-11-03 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: Update how to release files on sourceforge since + it has all changed. + +2009-11-03 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: Welcome to pcb-1.99z (decision time is looming) + +2009-11-03 Dan McMahill * dan AT mcmahill dot net * + + * : commit 7f38f164addcbfc0a9873d2e0782f921f2d005c9 Author: Dan + McMahill * dan AT mcmahill dot net * Date: Tue Nov 3 17:56:38 2009 + -0500 + +2009-11-03 Dan McMahill * dan AT mcmahill dot net * + + * utils/git2cl: Be more agressive about obfuscating email addresses. + +2009-11-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c, src/move.c: Fix mistaken use of MAX_LAYER + instead of max_layer. (Why this wasn't obvious, I can't possibly imagine ;)) Bug relates to batch HID, and move of text items onto the solder + layer. + +2009-11-02 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: Add a few more news item for the upcoming release. + +2009-11-02 Dan McMahill * dan AT mcmahill dot net * + + * : commit ccd37c7db665e3b0f15bc5377a54f89ba997296d Author: Dan + McMahill * dan AT mcmahill dot net * Date: Mon Nov 2 22:24:29 2009 + -0500 + +2009-09-22 Ineiev * ineiev AT users dot berlios dot de * + + * src/file.c, src/global.h, src/mymem.c, src/parse_y.y: add + attributes to layers Fix memory leaks of attributes + +2009-10-30 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, doc/Makefile.am, lib/Makefile.am: Provide better + support for building from anoncvs sources. There were a few conditionals which turned on additional portions of + the makefiles if it was determined that the build was from sources + obtained via git. Expand this to also detect if sources were from + CVS since we still support anonymous cvs for tracking sources. + +2009-10-29 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: Add some missing 'git push' to the instructions. + +2009-10-29 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: Add some last minute news items for 20091101 + +2009-10-29 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: Recommend using the -O (obfuscate email + addresses) option to git2cl + +2009-10-29 Dan McMahill * dan AT mcmahill dot net * + + * utils/git2cl: Teach git2cl how to obfuscate email addresses. Also + add a --help. + +2009-10-29 Dan McMahill * dan AT mcmahill dot net * + + * : commit dc0cdd25a1e490e7288622e9bcb5efd1f253c9cb Author: Dan + McMahill * dan AT mcmahill dot net * Date: Wed Oct 28 22:58:43 + 2009 -0400 + +2009-10-28 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: Take a first pass at updating the release + documentation for git instead of cvs. + +2009-10-28 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: Update the target release date for the next snapshot + +2009-10-22 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: Pass r_NoHolesPolygonDicer a POLYAREA *, not a + PLINE * No functional changes to callers of NoHolesPolygonDicer() The allows state in the POLYAREA to be passed into the recursive + dicer. This is needed in order to maintain an up to date r-tree of + contours in the POLYAREA. + +2009-10-22 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Fix bug with polygon boolean operation PBO_XOR (I + think!) If the contour in A is outside of B, it should be kept. It seems + this case may have been missed. PCB does not use the PBO_XOR operation, so it is difficult to test + whether this is correct or not. + +2009-10-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/global.h, src/polyarea.h, src/polygon1.c: Make rtree_t type + available to polygon1.c This saves a load of casting, and helps the compiler doing its job + catching programming errors. + +2009-10-21 Jared Casper * jaredcasper AT gmail dot com * + + * src/hid/gtk/gui-top-window.c: Fix a bug in gtk hid which caused + layer buttons to get confused (sourceforge bug 1988951) In ghid_layer_enable_buttons_update, the layer_buttons array was + being indexed using a counter which stoped at the current max_layer, + which was wrong. Changed this to use the constants LAYER_BUTTON_*. Also made the handling of the silk and rats buttons match the + (slightly more correct) handling of the other buttons in + layer_enable_button_cb. + +2009-10-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/create.c, src/global.h, src/hid/common/draw_helpers.c, + src/mymem.c, src/polygon.c, src/polygon.h: Add cache for "noholes", + diced versions of polygons + +2009-10-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/draw_helpers.c, src/polygon.c: Give callback from + NoHolesPolygonDicer ownership of the returned contour This means callers of NoHolesPolygonDicer() should call + poly_FreeContours on the contour they are passed (if they do not + wish to retain it). + +2009-10-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polyarea.h, src/polygon1.c: Replace poly_Clear(POLYAREA *) + function with poly_FreeContours(PLINE **) The poly_Clear function only clears the contours of the polygon + anyway, so make a more explicitly named function to do this work, + and pass the contours directly. This will be useful should we want to deal with a series of contours + separately from a POLYAREA object. + +2009-10-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/create.c, src/strflags.c: Fix "newfullpoly" flag + test and save its state into the .pcb file. The flag controlling this behaviour is kept up to date as a PCB + flag, not something which is updated in Settings.FullPoly. Change + the test accordingly. Added a PCB flag "newfullpoly" to save this state in the .pcb file. NOTE: "full" polygons severly break connectivity checking, as the + code always treats broken up pieces of the polygon as being + connected. It _might_ have been better to leave this support broken - so users don't inadvertently create polygons with the "fullpoly" + flag. TODO: Consider removing, hiding or adding warnings to this feature. + +2009-10-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: hid/gtk: Remove unused function + in_draw_state() + +2009-10-19 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/actions.c: hid/common: Fix dereference bug in + hid_find_action(). We want to check context for being NULL, not *context. + +2009-10-19 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/actions.c: hid/common: Don't walk off end of string + whilst parsing. Fixed a bug where the action parser would walk off the end of a + string when given an action without a "(" in it, e.g. "benchmark". + +2009-10-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/find.c: Tidy up IsPolygonInPolygon No functional changes + +2009-10-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/global.h, src/polygon1.c, src/rtree.c: Add some annotations to + help optimise branch prediction. Macros G_LIKELY and G_UNLIKELY were taken from GLib (LGPL 2), and + renamed without the G_ prefix. This hasn't had much discernable effect + +2009-10-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Rework iteration over contours in "intersect" to + improve performance We don't need to be using an r_tree search to determine if a + contour's bounding box hits anything in another contour. Just + compare the bounding boxes directly, then continue to the more + expensive testing. Rather than counting the vertices of each POLYAREA then swapping to + ensure we loop over the the small one, wait until we've worked out + which contours we're comparing. Rather than swapping, we just choose + which to loop over. This saves us time in the case where the larger + intersecting contour belongs to the polygon with fewer vertices. In one case, this change reduced a complex board's load time from + ~140 seconds to ~70. + +2009-10-14 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/.gitignore: Add dbus-introspect.h to src/.gitignore dbus-introspect.h is a generated file. + +2009-09-14 Dan McMahill * dan AT mcmahill dot net * + + * : commit 7ae3210e58b682577bbae1ff4d8ffc89a6666ad9 Author: Dan + McMahill * dan AT mcmahill dot net * Date: Mon Sep 14 07:20:50 + 2009 -0400 + +2009-09-11 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Fix "Design Rule Checker moves elements and traces off + grid" Patch from Ineiev * ineiev AT gmail dot com * to keep the grid from + changing just because DRC ran. + +2009-08-29 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * src/hid/batch/batch.c: gEDA-dev: [pcb patch] Correction of the pcb + homepage url in the batch HID Hi, Subject says it all. Kind regards, Bert Timmerman. >From 54b7d8e1d7704c1f467e0711f94dc564cc0a2c6d Mon Sep 17 00:00:00 + 2001 From: Bert Timmerman * bert dot timmerman AT xs4all dot nl * + Date: Sat, 29 Aug 2009 21:57:22 +0200 Subject: [PATCH] Correction of + the pcb homepage url in the batch HID. + +2009-08-14 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * src/misc.c: gEDA-dev: pcb [PATCH] Correction of the geda homepage + url and wiki url in the about dialog window. Hi all, Here is another one :) Kind regards, Bert Timmerman. >From c383fc1aabfcefb3c688bb5274f08874c86e7a8a Mon Sep 17 00:00:00 + 2001 From: Bert Timmerman * bert dot timmerman AT xs4all dot nl * + Date: Fri, 14 Aug 2009 00:33:26 +0200 Subject: [PATCH] Correction of + the geda homepage url and wiki url in the about dialog window. + +2009-08-13 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * src/misc.c: Correction of the pcb homepage url in the about dialog + window. + +2009-03-31 Bert Timmerman * bert dot timmerman AT xs4all dot nl * + + * src/hid/gtk/gui-dialog.c: Apply filters to load filechooser + dialogs. [1988982] [2686963] Applies filters to the filechooser dialogs when loading layouts, + layouts (to buffer), elements (to buffer) and netlists. Default behaviour is to not filter in the filechooser dialog. + Choosing a predefined filefilter in the filechooser dialog filters + on registered mime types, lowercase and uppercase file extensions. + Predefined filters are selected upon the action chosen in the "File" + pulldown menu. + +2009-08-04 Peter TB Brett * peter AT peter-b dot co dot uk * + + * README.cvs, README.git: Replace 'README.cvs' with 'README.git'. + [2810417] Provide information on how to use git to access the PCB repository. + Fixes bug #2810417. + +2009-08-04 Peter TB Brett * peter AT peter-b dot co dot uk * + + * doc/.gitignore: Add some generated .texi files to doc/.gitignore. + +2009-08-01 Uwe Hermann * uwe AT hermann-uwe dot de * + + * doc/gs/fb-blinker.texi, doc/gs/fb-smt.texi: gEDA-user: [PATCH] + s/pj-102.fp/pj102.fp/ in PCB tutorial Replace pj-102.fp filename with pj102.fp to make the PCB example + work. + +2009-07-30 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: Do not try to call gdImageCreate() on a 0x0 + sized image. This hopefully addresses some of the segfaults seen recently with + the latest version of gd. If a brush size scales to give a size of + 0 then bump it up to a single pixel. + +2009-07-29 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: Check return codes from the various gd + allocation functions. Check returns codes for gdImageCreate(), gdImageColorAllocate(), and + gdImageColorAllocateAlpha() calls to check for problems. + +2009-07-27 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: Don't disperse locked elements. When dispersing elements do not disperse locked elements. Locked + elements often times are mechanical and really should not be moved. + Noted by Levente Kovacs on gEDA-user. + +2009-07-07 anthonix * anthonix AT anthonix-desktop dot (none) * + + * : commit 2f80c6fc0c4aa1b7b5bb85d0d45f8415564dbe68 Author: + anthonix * anthonix AT anthonix-desktop dot (none) * Date: Tue Jul + 7 02:21:33 2009 +1200 + +2009-07-02 Dan McMahill * dan AT mcmahill dot net * + + * po/POTFILES.in: add src/toporoute.c add src/toporoute.c which lets this pass 'make distcheck' again. + +2009-07-03 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c, src/toporouter.h: Toporouter: ROAR + +2009-06-27 anthonix * anthonix AT anthonix-desktop dot (none) * + + * : commit ffb17f87f0d5c4e06574750f36a15e51f4ff89d3 Author: + anthonix * anthonix AT anthonix-desktop dot (none) * Date: Sat Jun + 27 11:27:55 2009 +1200 + +2009-06-25 Dan McMahill * dan AT mcmahill dot net * + + * : commit b17582ba2e192f42cd87d8466f16ea48fbde0d5b Author: Dan + McMahill * dan AT mcmahill dot net * Date: Thu Jun 25 22:58:29 + 2009 -0400 + +2009-06-26 anthonix * anthonix AT anthonix-desktop dot (none) * + + * : commit 889ee4f3a223c90d376c68524bce75423ef776bc Author: + anthonix * anthonix AT anthonix-desktop dot (none) * Date: Fri Jun + 26 13:56:48 2009 +1200 + +2009-06-26 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c, src/toporouter.h: Toporouter: One pass + curvilinear wiring + +2009-06-25 Dan McMahill * dan AT mcmahill dot net * + + * tests/run_tests.sh: When using the gerber HID, always use + --fab-author to make the resuls repeatable. Always use the --fab-author flag to the gerber HID to avoid many + false failures which would occur when different users try to run the + testsuite. Also fix a minor glitch when building from a read-only + source tree while here. + +2009-06-24 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, configure.ac: Top level configure stuff for the + testsuite. Add top level configure stuff missed in the previous few commits for + the testsuite. + +2009-06-24 Dan McMahill * dan AT mcmahill dot net * + + * tests/golden/Makefile.am, tests/golden/hid_png1/Makefile.am, + tests/run_tests.sh, tests/tests.list: Teach the testsuite how to + compare image files. Teach testsuite how to compare image files and add a very basic test + on the PNG HID. + +2009-06-24 Dan McMahill * dan AT mcmahill dot net * + + * : commit 81fdd6f7753046121b268cc562faab2d4bcb69f6 Author: Dan + McMahill * dan AT mcmahill dot net * Date: Wed Jun 24 22:16:17 + 2009 -0400 + +2009-06-23 Dan McMahill * dan AT mcmahill dot net * + + * src/buffer.c: Document the FreeRotateBuffer() action. Add syntax and help strings as well as the manual documentation for + the FreeRotateBuffer() action. + +2009-06-23 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: Add a comment about breakouts for fine pitch power + pins and the autorouter. Add a comment about breakouts for fine pitch power pins and the + autorouter. Suggested by harry on geda-user. + +2009-06-22 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: Add a short chapter on using the autorouter. Add a short chapter on using the autorouter based on email + instructions from harry on geda-user. + +2009-06-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Add bloat to PNG hid Add a --png-bloat option that takes a bloat setting, much like the + postscript HID. Optionally, a units suffix is allowed: --png-bloat + 10px or --png-bloat 1.2mil. + +2009-06-21 harry * harry AT harry-laptop dot (none) * + + * src/autoroute.c: calculate total wire length for result + +2009-06-21 harry * harry AT harry-laptop dot (none) * + + * src/buffer.c, src/create.c, src/polygon1.c, src/rats.c, + src/remove.c, src/search.c: Fix several errors, some more + point-boxes that weren't half open and several found with valgrind. + valgrind is your friend! + +2009-06-21 harry * harry AT harry-laptop dot (none) * + + * src/misc.c: fix single-point rectangles to correctly have + half-closed boxes + +2009-06-21 harry * harry AT harry-laptop dot (none) * + + * src/action.c: don't count one rat line twice when deleting them + +2009-06-21 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in: Improve the pre-install pcb wrapper script. The pcbtest.sh wrapper script is used to run pcb for testing before + pcb is installed. Improve the robustness of this script to allow it + to be run from a different directory from where it is created as + well as allowing the export HID's to be called with it. + +2009-06-21 harry * harry AT harry-laptop dot (none) * + + * : commit dfc097708cf04983767be89b4e29a551cc0b3bc3 Author: harry * + harry AT harry-laptop dot (none) * Date: Sun Jun 21 14:33:59 2009 + -0400 + +2009-06-21 harry * harry AT harry-laptop dot (none) * + + * src/autoroute.c, src/box.h, src/heap.c, src/heap.h, src/hid.h, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c, src/mtspace.c, + src/mtspace.h, src/rtree.c, src/vector.c, src/vector.h: Major + updates to the autorouter. Fixes bug created from prior changes + elsewhere and changes significantly the way that expansion searching + is performed. + +2009-06-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/actions.c: Oops, re-comment-out a debug statement. Re-comment out a debug statement that was accidentally left + uncommented in the last commit. + +2009-06-19 Jared Casper * jaredcasper AT gmail dot com * + + * src/hid/common/actions.c: Allow quoted strings and escaped + characters in action arguments. Quoting works similar to bash quoting: A backslash (\) is the escape character. It preserves the literal + value of the next character that follows. To get a literal '\' use + "\\". Enclosing characters in single quotes preseves the literal value of + each character within the quotes. A single quote may not occur + between single quotes, even when preceded by a blackslash. Enclosing characters in double quotes preserves the literal value of + all characters within the quotes, with the exception of '\' which + maintains its special meaning as an escape character. + +2009-06-16 Dan McMahill * dan AT mcmahill dot net * + + * : commit 8039b7114c038b05688f0e7c2a527a187cda242e Author: Dan + McMahill * dan AT mcmahill dot net * Date: Tue Jun 16 21:03:51 + 2009 -0400 + +2009-06-17 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Fix for routing_edge_insert() with + same coordinates + +2009-06-14 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Fix for TCS candidate vertices leak + +2009-06-14 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Fix for arc orientation in export + checks + +2009-06-14 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Fix for arc orientation in export + checks + +2009-06-14 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.h: Toporouter: Wiring score calculation + +2009-06-14 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Better cleanup of routing edges + +2009-06-14 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Fix for arc removal not updating + vertex link + +2009-06-14 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c, src/toporouter.h: Toporouter: Work on traces + arcing back around vertices + +2009-06-10 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: RESC3216M was defined twice. The first was supposed + to be INDC3216M. Noted by John Luciana on the gEDA user list. + +2009-06-11 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/Makefile.am, src/gts/gts.h, src/gts/predicates.c, + src/gts/predicates_init.c, src/toporouter.c, src/toporouter.h: + Toporouter: Dynamic computation of GTS predicates + +2009-06-10 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Workaround for older GLib + +2009-06-10 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Workaround for older GLib + +2009-06-10 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Workaround for older GLib + +2009-06-10 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: Workaround for older GLib + +2009-06-10 anthonix * anthonix AT anthonix-desktop dot (none) * + + * : commit 9653a6371aa41f873932062ef6d6b838bf98a987 Author: + anthonix * anthonix AT anthonix-desktop dot (none) * Date: Wed Jun + 10 13:28:10 2009 +1200 + +2009-06-09 Dan McMahill * dan AT mcmahill dot net * + + * : commit 6878692f1e13a09a7191c8f9cf09e05c403fbe33 Author: + anthonix * anthonix AT anthonix-desktop dot (none) * Date: Wed Jun + 10 13:23:27 2009 +1200 + +2009-06-10 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c: Toporouter: disabled some experimental stuff + +2009-06-10 anthonix * anthonix AT anthonix-desktop dot (none) * + + * src/toporouter.c, src/toporouter.h: Misc Toporouter Changes + +2009-06-09 Dan McMahill * dan AT mcmahill dot net * + + * src/gts/boolean.c, src/gts/split.c, src/gts/surface.c, + src/report.c: Remove some unused variables Remove some unused variables. On some others which are only + conditionally used, then only conditionally declare them. Same for + some functions. This clears out some of the compiler warning + clutter. + +2009-06-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-pinout-preview.c: Revert "avoid trying to use the + background graphics context before it is created." This reverts commit 1138b9419b56c6c4a5861dce79ed058ee4e513ba. As + noted by Peter Clifton, there is a visible artifact that results + from this. We'll look for a better way to make sure the GC is + created when it is needed. + +2009-06-08 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-pinout-preview.c: avoid trying to use the + background graphics context before it is created. On startup, some code was trying to access the background graphics + context before it was created. Check to make sure the context has + been created before we do anything with it. + +2009-06-08 Jared A. Casper * jcasper AT youngmc dot Stanford dot EDU * + + * src/hid/common/actions.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c: Fix command line exporting. Previously, hid_actionv was changed to always call gui->get_coords + wether or not the action had a need_coord_msg, in an attempt to + always get the latest coords for things like zoom or pan that didn't + have a need_coord_msg. However, this broke command line exporting + because it was trying to call get_coords on the nogui hid. Added the check back in to only call gui->get_coords when the action + has a need_coord_msg and added need_coord_msg's to actions that need + coords. + +2009-06-08 Jared Casper * jaredcasper AT gmail dot com * + + * src/gpcb-menu.res, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-output-events.c: Adding ability to customize mouse + scroll action in GTK. Changed the mouse_scroll gtk event handler to use do_mouse_action + instead of manually handling the event. gtk treats scrolling + differently as a mouse button event, and doesn't give a mouse button + number, so this patch just hard codes up/down/left/right to buttons + 4 through 7. This corresponds to the default names used in the + resource file, and, for X11, gtk hardcodes mouse buttons 4 - 7 to + the scrolling events anyway. This may cause problems in quartz or + windows if some mouse has a bunch of buttons and quartz/windows maps + those buttons to numbers 4 - 7, but I don't have a system to test + that (and in that case the names in the resource file would be wrong + as well). Added a Scroll action to the gtk hid to be able to mimic the + existing scroll wheel behavior with an action script. + +2009-06-08 Steven Michalske * smichalske AT gmail dot com * + + * src/line.c: Allow mod1(alt)(option) to bypass AUTO enforce DRC For Apples, which use ctrl-click to simulate right-click. + +2009-06-08 Steven Michalske * smichalske AT gmail dot com * + + * src/hid.h, src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/extents.c, src/hid/common/hidnogui.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui.h, src/hid/lesstif/main.c, src/hid/lpr/lpr.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: Adding the ability to use mod1 (alt)(option) in + HIDs This is useful for OSX installs as crtl-click, is mapped to right + click. so when drawing a line that you want to force a DRC + "Violation" and you need to use the control key, it will cancel the + line being drawn, and start a new point. This is tested in the lesstif and GTK hids, under OSX wher ehte + option key is the "alt" key. I leave it to the patch integrator th + verify on linux for GTK and lesstif. This is a bit hackish on detecting the alt key/option key, I + #ifdefed it to __APPLE__ because the option key returns 1<<13 not + GDK_MOD1_MASK Under lesstif I might guess that the alt/mod1 is not + quite the same as option. + +2009-06-07 Jared Casper * jaredcasper AT gmail dot com * + + * src/Makefile.am, src/action.c, src/gpcb-menu.res, + src/hid/common/actions.c, src/hid/common/hid_resource.c, + src/hid/common/hid_resource.h, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h, src/hid/lesstif/lesstif.h, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c: Teaching GTK hid to + use mouse resources I had some free time over the weekend and have been wanting to get + my hands dirty in the PCB code so I took a crack at this and wanted + to get some feedback. Attached is a patch with a detailed commit message of what I did, + but the general idea was to move the lesstif hid's handling of the + mouse resources into a common hid file (which I called hid_resource) + and have the gtk hid use that instead of being hardcoded. This way + the hid's are only responsible for catching the button press, + determining which modifier keys were active, then calling the common + code to handle it. The common code does what the lesstif hid does, + calls the actions defined in the resource file. In theory more + common stuff could be moved to hid_resource, the code to find and + load the resource file, for example, is nearly identical in both + hids. I changed up the Mouse resource in gpcb-menu.res to match the + hardcoded behavior of the gtk hid as closely as possible (see the + commit message for details). I've played around with it a bit and it seems to be working, but as + this my first time meddling with the code, I'm sure I missed some + stuff. If anybody has time to look it over and/or try it out that + would be great. Comments regarding the approach, formatting, style, + etc. are all appreciated (I did my best to match the style of the + surrounding code). Jared + +2009-06-05 Dan McMahill * dan AT mcmahill dot net * + + * src/edif.y: Use the appropriate header files instead of providing + extern foo() prototypes. Use the correct headers for a handful of function prototypes. This + should fix some build issues reported on geda-uers. + +2009-06-03 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: When building from git sources and building docs, + force maintainer-mode. When building from git sources, maintainer mode is required to build + the manual. So, unless the user has specified --disable-doc then + force maintainer mode. When building from a tarball, the + preformatted manual is already contained and we do not impose + maintainer-mode. Hopefully this puts to rest the documentation + building issues once and for all! + +2009-06-01 Dan McMahill * dan AT mcmahill dot net * + + * po/pcb.pot: Remove generated file that cause continual git churn. This file is generated and also removed by the clean target. + Removing a file from the source tree via 'make clean' that is under + version control just causes headaches. + +2009-06-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/fractional_size.texi, doc/letter_size.texi, + doc/metric_size.texi, doc/wire_size.texi: Remove additional + generated files. Remove the .texi files that are generated from the ASCII .tab files + from git to avoid gratitous storage of and changing of generated + files. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/.gitignore, doc/gs/.gitignore: Add a few more missing + .gitignore entries. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/.gitignore: Expand out the list of files since git didn't like + the patterns I used. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/.gitignore: Add gitignore file for the manual + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * src/.gitignore, src/gts/.gitignore: Add some missing .gitignore + entries for the new gts code + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs: update this a bit to reflect the new repository home + and also remove references to needing maintainer-mode + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * utils/git2cl: add git2cl utility to help update ChangeLog's for + releases. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/pcbfile.texi, doc/version.texi: remove some + generated files from git. These are only needed if you are building + the documentation in which case you have all the tools and makefile + rules for them to be regenrated anyway. Eliminates all the + headaches associated with generated files in version control. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/gs/gafrc, doc/gs/gschemrc: these are generated at configure + time now. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/gs/gafrc.in, doc/gs/gschemrc.in: to handle the case where we + may be building outside the source directory, generate gafrc and + gschemrc at configure time. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/gs/print-eps.scm: comment out a color theme that relied on a + path only present on DJ's machine. It isn't really needed anyway. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * po/POTFILES.in: add a missing file. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, doc/Makefile.am, doc/gs/Makefile.inc, + lib/Makefile.am: Remove the use of maintainer mode to gate on/off + rules for building the documentation. Instead look for the + existance of $(top_srcdir)/.git and decide based on that if this is + a tarball build (in which case the documentation ships already + built) or a git build. If it is a git build, then simply require + all the needed tools for building the docs. If the tools are not + found then configure will exit with an explicit message saying why + it has failed and that either tools need to be installed or + --disable-doc needs to be given. Hopefully this will eliminate the + previous strange behavior of needing --maintainer-mode when building + docs from cvs/git. + +2009-05-29 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: add gts/predicates_init.h to DISTCLEANFILES. + Also comment out the section that extracts REGISTER lines from the + gts code. We currently don't have any REGISTER lines in the gts + code and so make was exiting because a grep failed. + +2009-05-23 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/to.inc: Add TO18, TO39, and fix pinout on TO92. Added TO18 and TO39 footprints based on the JEDEC drawings. Note + that the pinout used is the one from the JEDEC drawings and it may + or may not match a particular vendors pin numbering. I have in fact + seen different vendors number the pins differently on these + packages. It is entirely up to the user to make sure that their CAD + symbols have the correct mapping from E, B, C (for a bipolar) to + pins 1, 2, 3 and that the JEDEC numbering is used. While here correct the TO92 pinout. It now also matches the JEDEC + drawing and is more consistent with the most common vendor + numberings. How on earth has this not caused problems before? + +2009-05-17 Jared Casper * jaredcasper AT gmail dot com * + + * ChangeLog, configure.ac, src/hid/lpr/hid.conf: Some cleanup of + configure script Added top level check for pkg-config with PKG_PROG_PKG_CONFIG and + removed AC_PATH_PROG call for pkg-config from inside a block + conditional on enable_dbus. Added a PKG_CHECK_MODULE for cairo if the toporouter output is + enabled. Added a check for HID dependencies. A hid's hid.conf can set a + variable "deps" which is a list of other HIDs that must be included + with that hid. Added ps the lpr's deps. + +2009-05-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh: Remove an extra '' quote in a comment + which caused confusion on some systems. + +2009-05-05 Ineiev * ineiev AT gmail dot com * + + * ChangeLog, configure.ac, src/Makefile.am, src/gts/cdt.c, + src/toporouter.c, src/toporouter.h: Toporouter: portability fixes 1) add #include 2) add configure options for toporouter --disable-toporouter + switches off toporouter --disable-toporouter-output switches off + toporouter cairo output 3) make toporouter compatible with glib < 2.10.0 provide + slist_insert_sorted_with_data() for those cases 4) fix VPATH builds gts/predicates_init stuff was not quite clean 5) fix find_closest() implementation for glib < 2.4.0 The earlier + version combined with toporouter produced segfault on tut1.pcb (on + top of glib-2.0.1 and glib-2.6.4); furthermore, it accessed to + undocumented glib structures. + +2009-04-30 Anthony Blake * tonyb33 AT gmail dot com * + + * src/gts/gts.h: gts.h fix Fixes the include of gtsconfig.h + +2009-04-24 Anthony Blake * tonyb33 AT gmail dot com * + + * gts/Makefile.am, gts/NOTES, gts/bbtree.c, gts/boolean.c, + gts/cdt.c, gts/config.h.win32, gts/container.c, gts/curvature.c, + gts/edge.c, gts/eheap.c, gts/face.c, gts/fifo.c, gts/graph.c, + gts/gts-config.in, gts/gts-private.h, gts/gts.def, gts/gts.h, + gts/gts.m4, gts/gtsconfig.h, gts/heap.c, gts/hsurface.c, gts/iso.c, + gts/isotetra.c, gts/kdtree.c, gts/makefile.msc, gts/matrix.c, + gts/misc.c, gts/named.c, gts/object.c, gts/oocs.c, gts/partition.c, + gts/pgraph.c, gts/point.c, gts/predicates.c, gts/predicates.h, + gts/predicates_init.c, gts/psurface.c, gts/refine.c, + gts/rounding.h, gts/segment.c, gts/split.c, gts/stripe.c, + gts/surface.c, gts/triangle.c, gts/tribox3.c, gts/vertex.c, + gts/vopt.c, src/Makefile.am, src/gts/NOTES, src/gts/bbtree.c, + src/gts/boolean.c, src/gts/cdt.c, src/gts/container.c, + src/gts/curvature.c, src/gts/edge.c, src/gts/eheap.c, + src/gts/face.c, src/gts/fifo.c, src/gts/graph.c, + src/gts/gts-private.h, src/gts/gts.h, src/gts/heap.c, + src/gts/hsurface.c, src/gts/iso.c, src/gts/isotetra.c, + src/gts/kdtree.c, src/gts/matrix.c, src/gts/misc.c, + src/gts/named.c, src/gts/object.c, src/gts/oocs.c, + src/gts/partition.c, src/gts/pgraph.c, src/gts/point.c, + src/gts/predicates.c, src/gts/predicates.h, + src/gts/predicates_init.c, src/gts/psurface.c, src/gts/refine.c, + src/gts/rounding.h, src/gts/segment.c, src/gts/split.c, + src/gts/stripe.c, src/gts/surface.c, src/gts/triangle.c, + src/gts/tribox3.c, src/gts/vertex.c, src/gts/vopt.c, + src/toporouter.c, src/toporouter.h: GTS build script changes Changed build scripts to include GTS. + +2009-04-22 Anthony Blake * tonyb33 AT gmail dot com * + + * gts/Makefile.am, gts/NOTES, gts/bbtree.c, gts/boolean.c, + gts/cdt.c, gts/config.h.win32, gts/container.c, gts/curvature.c, + gts/edge.c, gts/eheap.c, gts/face.c, gts/fifo.c, gts/graph.c, + gts/gts-config.in, gts/gts-private.h, gts/gts.def, gts/gts.h, + gts/gts.m4, gts/gtsconfig.h, gts/heap.c, gts/hsurface.c, gts/iso.c, + gts/isotetra.c, gts/kdtree.c, gts/makefile.msc, gts/matrix.c, + gts/misc.c, gts/named.c, gts/object.c, gts/oocs.c, gts/partition.c, + gts/pgraph.c, gts/point.c, gts/predicates.c, gts/predicates.h, + gts/predicates_init.c, gts/psurface.c, gts/refine.c, + gts/rounding.h, gts/segment.c, gts/split.c, gts/stripe.c, + gts/surface.c, gts/triangle.c, gts/tribox3.c, gts/vertex.c, + gts/vopt.c, src/Makefile.am, src/toporouter.c, src/toporouter.h: + Added topological autorouter Topological autorouter (not yet exporting geometry) GTS with small + but crucial bug fixes + +2009-04-19 Ben Jackson * ben AT ben dot com * + + * .gitignore: Add *.backup to gitignore (in case you test run PCB in + the tree) + +2009-04-19 Ben Jackson * ben AT ben dot com * + + * src/hid/gtk/gui-config.c: GTK HID: Background color can be set + live from config dialog Background, off-limit and grid color changes require a special + update that was missing when colors were edited in the config + dialog. + +2009-04-17 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Add "report all net lengths" option Usage: Report (AllNetLengths[,(mm|in|mil|pcb)]) + +2009-04-09 Ben Jackson * ben AT ben dot com * + + * .gitignore, data/.gitignore, lib/.gitignore, po/.gitignore, + src/.gitignore, src/hid/.gitignore: Add initial gitignore files + covering autogen files and GTK HID build + +2009-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-render-pixmap.c: GTK HID: Use clipping region when + drawing DRC violation previews Should speed up rendering quite a bit for non-trivial boards. + +2009-04-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui.h: GTK HID: Move inline + coordinate conversions from gtkhid-main.c to gui.h This allows other source files easy access to the routines Vx(), + Vy(), Vz() and Px(), Py, Pz(). + +2009-04-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: Allow PolygonHoles() to be passed a NULL region Passing a NULL region implies we wish to be called back for all + holes in the polygon, as we don't have a region to test against. Fixes crash in the DRC window when the design has polygons, and is + viewed with either thindraw, or thindraw polygons. + +2009-04-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-drc-window.c: GTK HID: Add "Refresh" button to DRC + window to re-run the DRC. Allows the user to more quickly get an updated view of their + progress fixing design rule violations. + +2009-04-05 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-drc-window.c: GTK HID: Fix pango markup in DRC + window to be more compatible Avoid using the attribute alias "font_size" in the markup. Older + pango versions only support "size", which is functionally identical. + +2009-04-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: GTK HID: Fix cursor warping on flipped + boards + +2009-04-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/gtk/gui-drc-window.c, + src/hid/gtk/gui-drc-window.h, src/hid/gtk/gui-render-pixmap.c, + src/hid/gtk/gui.h: GTK HID: Add preview images in the drc violations + window + +2009-04-03 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-drc-window.c, + src/hid/gtk/gui-drc-window.h, src/hid/gtk/gui.h: GTK HID: Add DRC + list window using the new DRC_GUI hooks. + +2009-04-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c, src/find.c, src/global.h, src/gpcb-menu.res, + src/hid.h, src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c, + src/hid/lpr/lpr.c, src/hid/nelma/nelma.c, src/hid/png/png.c, + src/hid/ps/eps.c, src/hid/ps/ps.c: Refactor DRC reporting to work + around a DrcViolationType structure. Add hooks to the HID structure allowing a GUI to consume this data + directly (if it wants), rather than being called to display ordinary + message dialog boxes. No HID yet utilises this interface. Remove log messages for individual design rule violations, instead + writing log entries based on the title in the DrcViolationType. This + modifies some of the logged messages slightly. All now prefix: + "WARNING! Design Rule error - ", as was present on some of the old + messges. + +2009-04-01 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Fix leak of input objects for certain short-cut + cases in poly_Boolean_free When either a or b input object is NULL, depending on the boolean + operation selected, either a, b or NULL is returned as the result. + Make sure we free any non NULL, and non-returned inputs when taking + these shortcut paths. + +2009-04-01 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: Fix leak of cross vertex connectivity lists when + deleting contours Free these lists as we free the contour's nodes in poly_DelContour() + +2009-03-25 Tibor Palinkas * igor2 AT inno dot bme dot hu * + + * src/hid/lesstif/menu.c: pass context in lesstif Minor patch to get the action context properly passed to actions + with lesstif, which doesn't use hid_actionv() for some reason. + +2009-03-25 DJ Delorie * dj AT delorie dot com * + + * src/hid.h, src/hid/common/actions.c, src/hid/hidint.h, + src/hid/lesstif/menu.c: single-action register/deregister New API to support registering individual actions with a context for + them, for example for scripting languages to register a hub + dispatcher. From Igor2 AT inno dot bme dot hu (Tibor Palinkas) + +2009-03-08 DJ Delorie * dj AT delorie dot com * + + * src/report.c: bugfix: avoid NULL pin names with Report(NetLength) There was an assumption that all pins and pads have non-NULL names, + but if you create a .pcb with a script you could end up with + anything. Make sure the names we get are non-NULL before using + them. + +2009-03-06 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gerber/gerber.c, src/hid/png/png.c: Fix exporters to cope + with hairlines now they are passed as width 0, not 1 This fixes breakage introduced in commit + 8dd739f9bd72dc3c8beb6e4e5e32c124cac0d13b png exporter: - Needs a minimum 1x1 pixel brush for drawing hairlines - Report and patch by Levente Kovacs * leventelist AT gmail dot + com * gerber exporter: - The hairline drawn around holes must be ignored - Report and diagnosis by Ineiev * ineiev AT gmail dot com * + +2009-03-05 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: Add a note for next time about some increased + test coverage. We need to do a distcheck build with a wider variety of requested + HID's to catch things like the missing src/hid/batch/hid.conf + +2009-03-05 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: add missing hid/batch/hid.conf to EXTRA_DIST. + Noted by Stefan Salewski. + +2009-02-27 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: Bump the required autoconf version to 2.60. pdfdir, psdir, and friends appeared in version 2.60 of autoconf. + Since we use those, we need 2.60 or higher. Problem noted by Bert + Timmerman. + +2009-02-27 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: Remove some now unused RCS ID's + +2009-02-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/dbus.c, src/draw.c, src/global.h, src/hid.h, + src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/draw_helpers.c, src/hid/common/draw_helpers.h, + src/hid/common/extents.c, src/hid/common/hidinit.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-config.c, + src/hid/gtk/gui.h, src/hid/lesstif/main.c, src/hid/lpr/lpr.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c, src/polygon.c, src/polygon.h: Add support for + filling / thindrawing raw polygons to the HID interface Refactor core polygon drawing to use these member functions, and + split the old code which used the HID's fill_polygon and draw_line + functions into a helper function which the guis now use to convert + the polygon into the primitives it knows how to draw. Alter the NoHoles dicer to pass back PLINE contours, rather than + wrapping them in a POLYAREA and PolygonType. + +2009-02-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c, src/polygon.c, src/polygon.h: Add user_data parameter + to NoHolesPolygonDicer Also switch the clip_box parameter before the ones defining the + callback and its user_data. + +2009-02-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Thindraw with 0 width, not 1 PCB unit width. This allows the gui to differentiate between when the core wants + hairline drawing, and when the core is drawing primitives which are + actually 1 PCB unit wide. + +2009-02-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Thindraw polygons with circular line-caps. Set an explicit cap style for consistency with other "special" + polygon drawing code. + +2009-02-17 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c: Bisect and union self-intersecting arcs in + ArcPoly() Avoids creating a self-intersecting contour which produces incorrect + result. Bug noted when clearing a 360 degree arc from a polygon. For self-intersecting arcs, we now bisect, produce two polygons + (with non-self-intersecting contours), then compute their union. + +2009-02-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/bom/bom.c, src/hid/gerber/gerber.c, src/hid/lpr/lpr.c, + src/hid/nelma/nelma.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: Various HIDs: Add missing pointers for the watch + and block hander methods These were missed when adding DBus support, since the initialisation + of the HID structure assumes that unspecified members are zero, and + all subsequent function pointers were explicitly 0, so as not to + cause a type mismatch. Hids fixed: bom gerber lpr nelma png eps ps + +2009-02-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/nelma/nelma.c: nelma: Fix prototype on set_layer() method + to take the "empty" flag. Fixes warning about incompatible types when intialising the HID + structure. + +2009-02-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon1.c: polygon1.c: Implement poly_Boolean() by calling + poly_Boolean_free() Reduces duplicated code. The poly_Boolean() implemetation already + copied the original contours, then duplicated the processing steps + taken in poly_Boolean_free(). + +2009-02-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c: gtkhid: Return NULL from + ghid_get_net_from_node_name() Fixes calling return; from function returning non-void type. + +2009-02-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c: crosshair.c: When drawing via DRC clearence, pass + correct angle. 360 * 64 was a hold-over from before the HID split. The passed angle + should be 360. + +2009-01-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c, src/polygon.h, src/rats.c: Make rats to polygons + work for arbitrary clipped shapes The rat will still be drawn to the first point on the polygon, which + might not necessarily be the closest. + +2009-01-14 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: Skip undocumented options. + +2009-01-14 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-dialog-print.c: Don't show undocumented options. + +2009-01-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c: GTK HID: Avoid critical warning + looking up connectivity without netlist + +2009-01-10 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Add only-visible support to photo-mode, check + for more outline fill spots. + +2009-01-10 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Add outline mode for photo-mode, from Mark + Rages + +2009-01-10 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Handle wrap-around when searching the string hash + table. + +2009-01-08 Dan McMahill * dan AT mcmahill dot net * + + * lib/misc.inc: for the axial footprints, put the mark on pin 1 + instead of on the body of the footprint. This gives you a much + better chance of the pins being on-grid when working with the + coarser grids typically found in a thru-hole design. + +2008-12-30 DJ Delorie * dj AT delorie dot com * + + * src/polygon.c: Add description of how polygon data works from Ben, + and debug routines for dumping polygon structures within gdb. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/const.h, src/draw.c, src/flags.c, + src/gpcb-menu.res, src/pcb-menu.res, src/search.c, src/strflags.c: + Add "hide names" option to hide all refdes on the board temporarily. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: Fix flipping of + arcs. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/parse_y.y: fix parsing of old-syntax arcs. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Include explicit text/lines/etc on silk layers in + assembly drawings. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Make sure the user has specified an element for the + pinout window. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-config.c: Add min-drill and min-ring to the saved + config list, and save the config file *after* updating it, not + before. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: sf patch 2162834 from d.ineiev - count + apertures for diagonal pads + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/draw.c, src/hid.h, src/hid/batch/batch.c, + src/hid/common/extents.c, src/hid/common/hidnogui.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: Add "empty layer" hint to HID. Add option + --all-layers to gerber export which causes it to export all layers, + empty or otherwise. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Rename ben-mode to photo-mode. + +2008-12-27 DJ Delorie * dj AT delorie dot com * + + * src/hid.h, src/main.c: Add an option for undocumented attributes. + +2008-12-27 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, newlib/Makefile.am: deprecate the analog-devices and + burr-brown newlib libraries + +2008-12-27 Dan McMahill * dan AT mcmahill dot net * + + * newlib/analog-devices/ADC12138CIMSA, + newlib/analog-devices/Makefile.am, newlib/burr-brown/Makefile.am, + newlib/burr-brown/OPA340_SOT23-5: remove some footprints of + questionable use + +2008-12-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/mymem.c: Regenerate rats r-tree when re-allocating a bigger + rats array. Shuould fix crashes observed on a board with a large number of rats. + +2008-12-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidinit.c: Typo. + +2008-12-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidinit.c: Make sure we clean up if dlopen fails. + +2008-12-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidinit.c: Avoid checking memory before short-named + files. + +2008-12-24 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c: Fix off-by one error in the GTK + HID's netlist window model generation Broken when I added support for a hierarchical view of nets. The bug + caused invalid memory to be read, possibly leading to a crash, as + the last (and missing) element from g_new0 was supposed to be a + terminator. + +2008-12-21 DJ Delorie * dj AT delorie dot com * + + * src/find.c: Fix via annulus calculations, from Jasper + +2008-12-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Set home from homedir. + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * doc/gs/gs.css: More missing files + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * doc/gs/gafrc, doc/gs/gschemrc: missed files + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * configure.ac: add texi2dvi check and doc/gs subdir + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * doc/eps2png, doc/gs/555.sym, doc/gs/555.symdef, + doc/gs/Makefile.am, doc/gs/Makefile.inc, doc/gs/fb-blinker-sch.sch, + doc/gs/fb-blinker.net, doc/gs/fb-blinker.pcb, + doc/gs/fb-blinker.prj, doc/gs/fb-blinker.texi, doc/gs/fb-led-5.pcb, + doc/gs/fb-led.pcb, doc/gs/fb-led.texi, doc/gs/fb-smt-sch.sch, + doc/gs/fb-smt.net, doc/gs/fb-smt.pcb, doc/gs/fb-smt.prj, + doc/gs/fb-smt.texi, doc/gs/firstboard.texi, doc/gs/gs.texi, + doc/gs/installation.texi, doc/gs/introduction.texi, + doc/gs/pj102.fp, doc/gs/powerjack.sym, doc/gs/print-eps.scm, + doc/gs/term-annulus-1.pcb, doc/gs/term-clearance-1.pcb, + doc/gs/term-element-1.pcb, doc/gs/term-pad-1.pcb, + doc/gs/term-pin-1.pcb, doc/gs/term-platedhole-1.pcb, + doc/gs/term-tented-1.pcb, doc/gs/term-thermal-1.pcb, + doc/gs/term-thickness-1.pcb, doc/gs/terminology.texi, + doc/gs/texinfo.tex: Add initial "getting started" guide. + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * src/hid.h: append '-' on all parameter names to prevent + mis-interpretation of such. Example: "xor" is a C++ reserved name. + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Increase resolution of gerbers to 0.01 + mil; drills remain at 0.1 mil + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * src/parse_l.l: Add support for suffixes on numbers, like "mm", + "um", "in", or "mil". No suffix defaults to "pcb units" as before. + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * src/flags.c: Add flags for whether various layers are shown. + +2008-12-20 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Add MinClearGap() action. + +2008-12-12 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: try to clean up the logic around cross compiling and + an executible pcb. Hopefully addresses some corner cases when cross + compiling. + +2008-12-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/version.texi, lib/Makefile.am, + lib/m4lib_to_newlib.sh.in: use if FOO stuff endif instead of @FOOTRUE@ stuff as the latter prevents automake from properly understanding some + dependencies. + +2008-12-05 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi: regen + +2008-12-05 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, doc/Makefile.am, lib/Makefile.am, + lib/m4lib_to_newlib.sh: Correctly deal with the case where one wants + to do a maintainer cross compile which requires an installed pcb + that can be executed on the build host. As part of this, also do + not build the png previews of the pcblib-newlib library by default. + They were not really used for anything and it really slows the + build. They can be built with --enable-m4lib-png. + +2008-12-03 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/Makefile.am: check for windres as a build tool + instead of hard coding 'windres'. Should help with cross-compiling + with windows as the target. Noted as a patch for gerbv by Cesar + Strauss. + +2008-12-03 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Merge thermals from old flags, not overwrite them. + +2008-11-30 Dan McMahill * dan AT mcmahill dot net * + + * win32/pcb.nsi.in: fix some shortcut removal issues on Vista. + +2008-11-30 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: add a --nsis-only option that only creates the + installer + +2008-11-30 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: fix up the PATH used during the build so pcb can + run when generating the pcblib-newlib previews + +2008-11-30 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb, win32/pcb.nsi.in: try to fix the pdf and html + manual links. Noted by Bob Paddock. + +2008-11-29 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-output-events.c: Fix bug 2011285 auto-pan on + solder side not working properly. Patch provided in the bug report. + +2008-11-29 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/crosshair.c, src/global.h, src/gpcb-menu.res, + src/hid/gtk/gui-output-events.c, src/hid/lesstif/main.c, + src/pcb-menu.res: Add additional crosshair shapes. ctrl-right click + cycles through. Patch 2170634 from D. Ineiev. + +2008-11-29 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-dialog.c: teach ghid_confirm_dialog to remember + its last position and to come up at the same place the next time. Patch 1900832 from Tomaz Solc. + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: Minor formatting updates for some long lines and + also minor updates to reflect some sourceforge changes. + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-config.c: fix up the library path dialog for + windows + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-config.c: Use PCB_PATH_DELIMETER instead of ":" in + a few key places + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: bump rev after 20081128 branch + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: update dates for 20081128 snapshot + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: update for 20081128 snapshot + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update for 20081128 snapshot + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi: regen. + +2008-11-28 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am: Make DISTCHECK_CONFIGURE_FLAGS actually work again so + we can check that 'make distcheck' passes for lesstif. + +2008-11-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: honor psdir, pdfdir, docdir, htmldir, dvidir. + Noted in sf bug #1916057. + +2008-11-27 DJ Delorie * dj AT delorie dot com * + + * src/create.c: Test the two lines, not the line vs the current pcb, + for compatible poly-join flags. + +2008-11-27 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in: get rid of an insecure usage of a temp file + +2008-11-25 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: do not free() the result of getenv(). Noted by Peter + Clifton + +2008-11-25 Dan McMahill * dan AT mcmahill dot net * + + * src/global.h, src/hid/common/hidinit.c, + src/hid/gtk/gui-top-window.c, src/hid/lesstif/menu.c, src/main.c: + Determine the users home directory on program startup and remember + it for use in other places later. This avoids repeated use of + getenv("HOME") which may have issues especially under windows. + +2008-11-25 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: create a DOS batch file wrapper for the installer + to make it easier to run the installer immediately after building it + from the cygwin shell. Without this, vista doesn't seem to like to + run it for some reason. + +2008-11-25 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/version.texi: regen + +2008-11-25 Dan McMahill * dan AT mcmahill dot net * + + * win32/Makefile.am, win32/build_pcb, win32/extract_gtk_win32, + win32/pcb.nsi.in, win32/registerExtension.nsh: - various minor updates for a more recent download of gtk and + friends largely taken from gerbv. - associate .pcb and .fp file extensions with pcb - make sure we start up pcb in the My Documents area to discourage writing into Program Files. + +2008-11-24 Dan McMahill * dan AT mcmahill dot net * + + * po/POTFILES.in: add 2 missing files that have translations + +2008-11-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Fix the foo.ps.type.ps bug + +2008-11-19 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Move splitlines even earlier, to avoid unwanted + changes. + +2008-11-11 DJ Delorie * dj AT delorie dot com * + + * src/create.c: Don't merge two lines if the join flag differs. + +2008-10-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-pinout-preview.c: Fix preview drawing broken by + resetting "Gathering" mode after painting. Seems that the pinout preview widget relied on the bug fixed in + commit 0647d028e6c755715d2fcdbd0b4f2be73d36ae7f. In the expose + handler of the preview, We should be calling the + hid_expose_callback() function rather than DrawElement() directly. + +2008-10-21 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: Remove logged warning when + pressing a key with no defined binding Poping up the log window in these cases is very intrusive, and it + triggered for keys such as capslock, Mod4/Windows etc. There is no + real need to log errant key-presses, so remove this feature. + +2008-10-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/autoroute.c, src/mtspace.c: Fix two assertion test to allow + compiling a debug build. Due to code-restructures, a couple of assert tests (not normally + compiled) had bit-rotted. Remove one, rejig the other. + +2008-10-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rtree.c: rtree.c: Fix typo in assertion test inside __r_search Caused false assertion failures when running a debugging build. + +2008-10-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/search.c: Fix IsPointInBox to work with wide as well as tall + boxes Actually implement the test, rather than trying to construct a pad + to test which has the right geometry. + +2008-10-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rtree.c: Change rtree penalty function in rtree.c to use + doubles, not long long. Since the exact integer result doesn't matter, this is ok. + Marginally faster on Core Duo machine. + +2008-10-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/rtree.c: Check all r-tree node children for fit before working + out penalties Working out the penalty involves multiplications which produce a + "long long" result, and is seen to be appear in profiling. Make a pass at testing all children for the fast case of the child + node containing the desired box, before working out size penalties + to expanding each child. + +2008-10-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/heap.c: Increase initial heap size from 32 to 256 In complex boards with lots of polygons, we were realloc'ing up to + this kind of number anyway, in x2 size steps. Save all the + memcpy'ing by making the heap larger to start with. My test board still has some requirement for heaps >256, <512, but + the frequency is low. + +2008-10-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: GTK HID: Raise already open command + window to top with ":" key Previously, ":" only opened the window, but would not raise it if + already open. + +2008-10-02 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/move.c: Fix array index out of bounds over layer groups Off by one error in for loop, picked out by a recent version of GCC + being better at spotting this kind of bug. The effects (if any) this + bug caused are unknown. + +2008-10-01 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c: GTK HID: Fix crash when + highlighting connectivity caused by net tree. Seems I caused a crash in the connectivity highlighting code which + assumed the net model of in the netlist window is a list structure + where each element represents a net. Adapted the code to hunt out + the right net / node with a tree model of nets. + +2008-10-01 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots, utils/cvs2cl.pl: add a local coyp of cvs2cl.pl + +2008-09-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/polygon.c, src/polygon.h: Don't bother unsubtracting complex + polygons when doing incremental updates Since the polygon is re-cleared against any objects existing within + the bounding box of the update region, there is no point wasting CPU + cycles intersecting a more complex polygon than necessary. Just take + the UNION of the polygon being unsubtracted, and the bounding box of + the hole to be filed in. + +2008-09-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c, src/polygon.c: Fix text bounds to include the area + cleared into a polygon Fixes re-clearing the polygon when a closely touching object is + incrementally updated. + +2008-09-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Ensure "Gathering" mode is set after painting the + screen. In between repaints initiated from the GUI, with this flag set, all + Draw{object_type} operations just update a dirtied bounds. A final + Draw() call then calls the HID to invalidate the bounds gathered. Setting "Gathering = True" after an expose event callback ensures + subsequent drawing is batched up for the next screen update. + +2008-09-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Add debugging code to visually check a pad's bounding + box Proved useful in fixing the pad bounding box update routine. + Disabled with #if 0 block. + +2008-09-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c, src/move.h: Fix bounding boxes for rotated square + ended pads. Bounding box compution only worked for round ended pads before. In + addition, the "move" code previously called SetLineBoundingBox for + pads, which computes the wrong result. + +2008-09-30 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-library-window.c: GTK HID: Make double clicking on + a footprint library expand / contract it Usability improvement. + +2008-09-30 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: Put exploded pads on the correct layer + +2008-09-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-netlist-window.c: Display nets as a hierarchical + tree in the netlist window. The view splits netnames at "/" characters, and builds the netlist + view as a tree accordingly. Allows more strutured viewing of nets + coming from hierarchical designs. + +2008-09-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidinit.c: Improve hashing algorithm for storing + color data Curosry testing showed the old algorithm encountered a lot of hash + collisions. Swap to a more sensible hashing algorithm. + +2008-09-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/common/hidinit.c: Fix lru heuristic to shortcut color + cache lookup Heuristic didn't work before as the lru element wasn't saved. + +2008-09-23 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/batch/batch.c: Fix batch HID by adding stub functions for + file watches and block hooks This was broken when these features were added to the HID interface. + +2008-09-11 DJ Delorie * dj AT delorie dot com * + + * src/polygon.c: Fix poly clearance around rotated pads - Robert + Fitzsimons and Ineiev + +2008-09-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Fix lesstif crosshair color - joel + silvestre + +2008-08-22 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs: update the anoncvs server name + +2008-08-19 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/Makefile.am: add a --enable-debug mode that does + not disable assert() + +2008-08-16 DJ Delorie * dj AT delorie dot com * + + * src/hid/batch/batch.c: Add missing parameter name + +2008-08-06 DJ Delorie * dj AT delorie dot com * + + * globalconst.h: Bump up font size and aperture count. + +2008-08-03 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Add --ben-flip-x and --ben-flip-y options to + produce "ben mode" images of the other side of the board. + +2008-07-10 Ben Jackson * ben AT ben dot com * + + * src/hid/png/png.c: Fix crash with 'ben-mode' if your layer stack + is the reverse of DJ's. + +2008-07-08 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Add "Ben Mode". Fix export of thindrawn + polygons. + +2008-07-05 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Oops, fix bug from previous patch. + +2008-07-05 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Do not require a second paramter for SaveTo(Layout) + +2008-06-02 DJ Delorie * dj AT delorie dot com * + + * src/print.c: Allow outline layers that have nothing but arcs. + +2008-05-28 DJ Delorie * dj AT delorie dot com * + + * src/macro.h: Add ELEMENTARC_LOOP + +2008-05-20 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/pcb.xml.in, doc/actions.texi, doc/pcbfile.texi: Add mime + magic "M48" for detection of excellon drill files. + +2008-05-07 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Don't say ,TZ as we're not omitting + trailing zeros. + +2008-04-28 Dan McMahill * dan AT mcmahill dot net * + + * src/mtspace.c, src/report.c: fix a few more code before + declarations bugs. Patch by der Mouse. + +2008-04-28 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: if the compiler takes it, turn on code before + declarations warnings + +2008-04-28 Dan McMahill * dan AT mcmahill dot net * + + * src/edif.y, src/puller.c: Fix some code before declarations bugs + noted by der Mouse. + +2008-04-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/action.c: Applied patch from Tomaz Solc fixing crosshair + issues with ActionNew() ActionNew() function didn't call a RestoreCrosshair() after a + HideCrosshair() in most cases. This causes symptoms similar to those described in #1900255 when + "Start new layout" is selected in the File menu in GTK HID (most + probably also in Lesstiff, but I haven't checked). This patch adds two missing RestoreCrosshair() calls and fixes that + issue. Minor re-indentation by Peter Clifton during application. + +2008-04-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/misc.c: Applied patch from Tomaz Solc fixing a bug in the + CenterDisplay function. This patch fixes a bug in the CenterDisplay function that doesn't do + a RestoreCrosshair() after HideCrosshair(). This causes the crosshair stack overflow when using the DRC checker + (which calls CenterDisplay a lot). Minor re-indentation by Peter Clifton during application. + +2008-04-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/crosshair.c, src/hid/gtk/gui-output-events.c: Applied patch + from Tomaz Solc fixing bug #1882970. This patch fixes a bug where objects attached to the cursor (line + segments during drawing, etc.) permanently disappear if mouse cursor + leaves a window during dragging. Minor re-indentation by Peter Clifton during application. + +2008-04-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: Apply patch from Igor to ensure when + flipping the board, the cursor remains on the same point on the + layout. Thanks! + +2008-04-13 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * doc/actions.texi, src/action.c, src/command.c, src/hid.h, + src/hid/batch/batch.c, src/hid/bom/bom.c, src/hid/common/extents.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui.h, src/hid/lesstif/dialogs.c, + src/hid/lesstif/main.c, src/hid/lpr/lpr.c, src/hid/nelma/nelma.c, + src/hid/png/png.c, src/hid/ps/eps.c, src/hid/ps/ps.c: Add HID hook, + close_confirm_dialog() for closing modified layouts. This allows GUI HIDs to present a more native looking "save before + closing" dialog. The HID is responsible for any save which the user + requests and the subsequent return codes from the HID are as before, + 0 for cancel and 1 for close. This checkin also fixes the GTK HID's Save() action to return 1 for + cancel if the user cancels from the "Save As" dialog. + +2008-04-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Fix off-by-one bug drawing pads. + +2008-03-31 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: When drawing zero-length lines, draw a square or + circle according to the end cap value. + +2008-03-30 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: If a layer selected through --layer-stack isn't found, + let the user know and print a list of available layers. + +2008-03-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Ignore zero-radius filled circles. + +2008-03-16 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c, src/parse_y.y: Only use the min annular ring parameter + for checking the annular rings on pins and vias. Previously the + minimum copper width setting was also used. Changed after a + discussion on geda-user. Also make sure we use the minimum copper + width as the default if the .pcb file doesn't specify the minimum + annulus. + +2008-03-15 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gerber/gerber.c: Add a missing terminating '*' on the + first G04 line of the output files. Noted on #geda. + +2008-02-27 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: revert most of the previous commit which + accidentally added some stuff that was not meant to be checked in. + +2008-02-26 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/pcbtest.sh.in: use absolute paths (set at + configure time) so this script may be called from other directories + as part of a test suite. + +2008-02-22 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: add 128 pin 14x14 mm LQFP with exposed padded. Add + 128 pin 14x14 mm TQFP with and without exposed paddle + +2008-02-10 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Allow negative bloats + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: add file size to checksum file + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * po/LINGUAS, po/fr.po, po/fr_FR.po: move fr_FR to fr as the latter + seems to be recommended these days + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: bump to 1.99x after branching 20080202 + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update for 20080202 + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: update to deal with the desktop integration and + 20080202 + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: add some news items for 20080202 + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: add 2008 to copyright year + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi: regen + +2008-02-01 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-utils.c: fix mark up rendering on status line + +2008-01-31 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: add a --with-tex and --with-etex to work around + some cygwin/tex bugs + +2008-01-31 Dan McMahill * dan AT mcmahill dot net * + + * win32/pcb.nsi.in: fix the start menu shortcut icon + +2008-01-31 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: use tr to kill the extra \r that end up in the + Makefiles courtesy of pkg-config. This builds all but the docs on + windows again. + +2008-01-31 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gtkhid.h, + src/hid/gtk/gui-top-window.c: avoid segfaults on loading certain + boards from the command line. This patch introduces a flag that + indicates when the gui is up and calls to ghid_shift_is_pressed() + and ghid_control_is_pressed() can proceed as normal. + +2008-01-30 Dan McMahill * dan AT mcmahill dot net * + + * win32/extract_gtk_win32: clean up a comment + +2008-01-30 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb, win32/extract_gtk_win32, win32/pcb.nsi.in: copy + over build_pcb improvements from gerbv. Add gdwin32 to the extract + script. + +2008-01-30 Dan McMahill * dan AT mcmahill dot net * + + * win32/Makefile.am, win32/extract_gtk_win32, win32/pcb.nsi.in: add + script to help setup build environmnet. Also add all the various + licenses to the installer. + +2008-01-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * icon-theme-installer: Fix bug in icon-theme-installer where the + -?? size was not stripped from the installed icon name. + +2008-01-28 Dan McMahill * dan AT mcmahill dot net * + + * src/flags.c, src/gpcb-menu.res, src/pcb-menu.res: Repair the + buffer # menus by changing CheckedWhen() to checked=. As part of + this, added a buffer flag. + +2008-01-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-misc.c, src/hid/gtk/gui-utils.c, + src/hid/gtk/gui.h: add a bunch of const fixups from Larry Doolittle. + +2008-01-22 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: After we run DRC, force a redraw since we've possibly + turned on and off layers (like silk). Should address SF bug + 1843181. + +2008-01-16 Dan McMahill * dan AT mcmahill dot net * + + * autogen.sh: drop the intltool required version to 0.35 as that + seems to work + +2008-01-16 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, configure.ac, data/Makefile.am, icon-theme-installer: + check for gtk-update-icon-cache and use it. For distcheck, disable + that via setting the GTK_UPDATE_ICON_CACHE_BIN to 'true' to avoid + creating a cache file which then is not removed. A better way would + probably be a uninstall hook which noticed that it was a distcheck + uninstall and simply removed the file. + +2008-01-16 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi: regen + +2008-01-16 Dan McMahill * dan AT mcmahill dot net * + + * win32/Makefile.am: remove deprecated icon generation code + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * : regen + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * data/regen_files: add some help output, add options to only do the + .png's or the .ico, check for imagemagick and netpbm. + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/Makefile.am, win32/Xdefaults.tgif, + win32/pcb_icon_big.obj, win32/pcb_icon_med.obj, + win32/pcb_icon_sml.obj: Use the same icons for windows as in the + kde/gnome desktop. Remove the old windows icons which were really + placeholders anyway. Remove the rules for regenerating these + obsolete icons. + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * doc/Xdefaults.tgif: this file is no longer used. The drawings for + the documentation are drawn with pcb. + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.man.in, doc/pcb.man.raw: remove some old and very obsolete + files. + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * data/Makefile.am, icon-theme-installer: Remove the use of + #!/bin/bash for the benefit of systems which don't install bash in + /bin. In the Makefile, call out the name of the shell to help + systems like solaris where it is more likely that SHELL will be + /bin/ksh instead of the broken solaris /bin/sh + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * autogen.sh: Check for the version of intltool. Also apply some + fixups to the po/Makefile.in.in file created by intltoolize. + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * src/autoroute.c: fix an unitialized variable + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * src/edif.y, src/hid/lesstif/menu.c: fix a few gcc4 warnings + +2008-01-15 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am: skip adding m4/ChangeLog to the distfile. It seems + to be installation dependent + +2008-01-14 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am: it helps if we build libintl before using it... + +2008-01-14 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add missing $INTLLIBS to LIBS. Fixes building with + lesstif and batch. + +2008-01-13 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/hid/gtk/gui-top-window.c: check for and include + locale.h. Should fix solaris build problems. + +2008-01-13 Dan McMahill * dan AT mcmahill dot net * + + * mkinstalldirs: remove generated file. This comes from the + ./autogen.sh bootstrap + +2008-01-12 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/regen_files: Fix script to regenerate icon files, including + mask channel for windows icons. + +2008-01-12 Dan McMahill * dan AT mcmahill dot net * + + * autogen.sh: put in a check for autopoint version + +2008-01-11 Dan McMahill * dan AT mcmahill dot net * + + * data/README: note the regen_files script + +2008-01-11 Dan McMahill * dan AT mcmahill dot net * + + * data/regen_files: hopefully fix a few minor bugs in inkscape + exporting + +2008-01-11 Dan McMahill * dan AT mcmahill dot net * + + * data/Makefile.am, data/regen_files: add windows icon and script to + generate it + +2008-01-11 DJ Delorie * dj AT delorie dot com * + + * src/polygon1.c: Strict aliasing patch from Larry Doolittle. + +2008-01-11 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: fix pincount for MSOP10 + +2008-01-11 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/batch/.cvsignore, src/hid/bom/.cvsignore, + src/hid/common/.cvsignore, src/hid/gerber/.cvsignore, + src/hid/gtk/.cvsignore, src/hid/lesstif/.cvsignore, + src/hid/lpr/.cvsignore, src/hid/nelma/.cvsignore, + src/hid/png/.cvsignore, src/hid/ps/.cvsignore: add .dirstamp + +2008-01-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * lib/gtag.m4: Fix typo in gtag.m4 file + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac, src/Makefile.am, src/hid/gtk/gui.h, src/main.c: + Activate gettext support in PCB by setting up the domain and locale + dir. + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/pcb.desktop.in: Add application/x-pcb-footprint to the + mime-types PCB will be launched for + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/pcb.xml.in: Add an attempt at a glob pattern to match PCB + footprints Searches for the string "Element[" starting between and offset of 0 + and 20 bytes into the file. + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/pcb.desktop.in: Fix mime type registered to open PCB to + application/x-pcb-layout + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/Makefile.am: Fix data/Makefile.am where xdgdir was used + instead of xdgdatadir + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * Makefile.am: Add intltool-XXX.in to EXTRA_DIST and add appropriate + cleaning rules. + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * Makefile.am, icon-theme-installer: Add missed icon-theme-installer + script required for installing icons + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * Makefile.am: Add make distcheck ./configure flag + --disable-desktop-database Ensures cache files won't be left during make distcheck which could + break the distcheck. + +2008-01-10 Dan McMahill * dan AT mcmahill dot net * + + * win32/.cvsignore: add missing cvsignore + +2008-01-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/.cvsignore: add hidlist.h + +2008-01-10 Dan McMahill * dan AT mcmahill dot net * + + * .cvsignore, src/.cvsignore, src/hid/.cvsignore, + src/hid/batch/.cvsignore, src/hid/bom/.cvsignore, + src/hid/common/.cvsignore, src/hid/gerber/.cvsignore, + src/hid/gtk/.cvsignore, src/hid/lesstif/.cvsignore, + src/hid/lpr/.cvsignore, src/hid/nelma/.cvsignore, + src/hid/png/.cvsignore, src/hid/ps/.cvsignore, src/icons/.cvsignore: + add a cvsignore file + +2008-01-10 Dan McMahill * dan AT mcmahill dot net * + + * data/README: fix a typo + +2008-01-10 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, configure.ac: wire in the desktop stuff + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/gpcb-menu.res, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-library-window.c, src/hid/gtk/gui-library-window.h, + src/hid/gtk/gui.h: Change library window to give a preview and + filterable list of components. Code for the libarary window is based on x_compselect.c from + gEDA/gaf's gschem schematic editor, and the libray window code + pre-existing in PCB. Also added a shortcut "i" to the library window, matching gschem's + insert component shortcut. + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac, po/LINGUAS, po/POTFILES.in: Ensure GETTEXT_PACKAGE + is set, and add missing LINGUAS and POTFILES.in files. + +2008-01-10 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, README.cvs, autogen.sh, configure.ac: add i18n + framework. + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/Makefile.am: Add Makefile.am for data dir, with rules to + install icons and desktop data + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/pcb.desktop.in: Commit pcb.desktop.in template menu file for + translation + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/pcb.xml.in, data/x-excellon.desktop.in, + data/x-gerber.desktop.in, data/x-pcb-footprint.desktop.in, + data/x-pcb-layout.desktop.in, data/x-pcb-netlist.desktop.in: Check + in KDE mimelnk .desktop.in and XDG pcb.xml.in MIME registrations Files are annotated suitably for translation with intltool + +2008-01-10 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * data/README, data/application-x-excellon-16.svg, + data/application-x-excellon-22.svg, + data/application-x-excellon-32.svg, + data/application-x-excellon-48.svg, + data/application-x-excellon.svg, data/application-x-gerber-16.svg, + data/application-x-gerber-22.svg, data/application-x-gerber-32.svg, + data/application-x-gerber-48.svg, data/application-x-gerber.svg, + data/application-x-pcb-footprint-16.svg, + data/application-x-pcb-footprint-22.svg, + data/application-x-pcb-footprint-32.svg, + data/application-x-pcb-footprint-48.svg, + data/application-x-pcb-footprint.svg, + data/application-x-pcb-layout-16.svg, + data/application-x-pcb-layout-22.svg, + data/application-x-pcb-layout-32.svg, + data/application-x-pcb-layout-48.svg, + data/application-x-pcb-layout.svg, + data/application-x-pcb-netlist-16.svg, + data/application-x-pcb-netlist-22.svg, + data/application-x-pcb-netlist-32.svg, + data/application-x-pcb-netlist-48.svg, + data/application-x-pcb-netlist.svg, data/pcb.svg: Check in MIME and + app icons along with a README with origins and copyright + +2008-01-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * configure.ac, src/dbus-pcbmain.c: Avoid using deprecated + dbus_watch_get_fd() in newer dbus versions. Use a configure test (copied from PulseAudio) for the newer API, + dbus_watch_get_unix_fd(), and use that if available. + +2008-01-08 Dan McMahill * dan AT mcmahill dot net * + + * src/polygon1.c: add a FIXME comment + +2008-01-08 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/Makefile.am, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-pinout-preview.c, src/hid/gtk/gui-pinout-preview.h, + src/hid/gtk/gui-pinout-window.c, src/hid/gtk/gui.h: Refactored + pinout preview code into a new widget, GhidPinoutPreview In the refactoring, fix a bug where if the pinout window was larger + than the PCB window's viewport, elements in the preview were clipped + to the viewport size. In a break from the old behaviour, the previewed element is centered + in the preview area. + +2008-01-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-misc.c, src/hid/gtk/gui-output-events.c: remove a + handful of strict aliasing rule violation warnings generate by gcc4 + +2008-01-07 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_l.l, src/res_lex.l: avoid some 'defined but not used' + gcc warnings. + +2008-01-07 Dan McMahill * dan AT mcmahill dot net * + + * src/autoroute.c, src/hid/nelma/nelma.c, src/misc.c: clear out a + few more compiler warnings + +2008-01-07 Dan McMahill * dan AT mcmahill dot net * + + * src/gpcb-menu.res: remove some duplicated entries and remove some + conflicting hot keys. + +2008-01-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: be a little smarter about parsing + the hotkey parts of the menu resource file. Now give a sane message + instead of segfaulting on a malformed input. Also check for + duplicate hot keys and drop the duplicates with a message. + +2008-01-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-output-events.c: correctly scale the step sizes + for scroll bar scrolling of the main drawing area. This addresses + the "scoll bars scroll by tiny tiny steps" part of sf bug [ 1796016 + ] Cursor/scrolling madness + +2008-01-06 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: add some extra dependencies to get this working + with parallel make jobs. + +2008-01-06 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add min version for automake + +2008-01-06 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: specify the minimum autoconf version + +2008-01-06 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README.cvs, README_FILES/Makefile.in, aclocal.m4, + config.h.in, configure, doc/Makefile.in, doc/actions.texi, + doc/pcbfile.texi, doc/version.texi, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/electro-optics/Makefile.in, newlib/headers/Makefile.in, + newlib/keystone/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, src/Makefile.in, src/icons/Makefile.in, + tools/Makefile.in, tutorial/Makefile.in, win32/Makefile.in: remove a + bunch of autotools generated files and update the instructions for + building from cvs accordingly. + +2008-01-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: before exporting png, clear out any existing + color or brush cache. They are stale. Should fix sf bug [ 1807726 ] png HID exports transparent copper + rectangles + +2008-01-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: apply the patch provided in sf bug [ 1792119 ] + Slanted squared pads: png output which corrects the drawing of non + 90-deg square cap lines in the png output. + +2008-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/action.c, src/edif.y, src/edif_parse.h, + src/file.c, src/file.h: add the ability to load edif netlists + provided in sf patch [ 1516885 ] added edif netlist import by Jeff + Bailey. + +2008-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c: remove some + unused variables + +2008-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui.h: fix a bug where sometimes the confirm dialog had + corrupt button names. + +2008-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: apply the patch provided in sf bug [ 1850097 ] Grid + off by 1 after setting to 1 + +2008-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: apply a patch provided in sf bug [ + 1840422 ] GTK HID panning bug. Keeps the scroll bars in sync when + the display is panned. + +2008-01-05 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/actions.c: Re-initialize num so that multiple + actions will be parsed properly. + +2008-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: remove some code from set_cursor() that + tries to limit the cursor position in a way which seems to cause + spurious scrolling in a number of situations. Should hopefully fix sf bug [ 1796016 ] Cursor/scrolling madness + +2008-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: update a comment + +2008-01-04 Dan McMahill * dan AT mcmahill dot net * + + * src/buffer.c: Allow the conversion of a selection which contains + only silk to an element instead of requiring a pad or pin. Useful + for logos. Requested in sf bug [ 1820380 ] convert-to-element requires at least + one pin or pad + +2008-01-04 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add missing check for texi2dvi. sf bug [ 1840645 ] texi2dvi: Missing configure check + +2008-01-04 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: Add an option that turns off the scale and file + name in the postscript output. This is useful when trying to do a + toner transfer or print transparencies that use the whole page. Requested in sf bug [ 1858547 ] unwanted text lines in printouts + makes these useless + +2008-01-04 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c, src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui.h: Apply sf patch [ 1848465 ] brief error info in + "DRC continue" dialog While here, add some missing bits of code in the dialog_confirm + function for the gtk hid that lets you specify the ok and cancel + messages. + +2008-01-04 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: fix a printf format string compiler + warning. + +2008-01-04 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/file.c, src/hid/gerber/gerber.c, src/misc.c: add + some casts to silence some gcc4 warnings + +2008-01-04 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/qfpdj.inc: apply sf patch 1784721 to move the + QFP footprints to 0.01 mil resolution. Also the remaining SO + packages have been moved to the hi-res format. Minor corrections to the patch by me. + +2008-01-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in, lib/png_diff.sh: add a utility + script for comparing .png's of an entire footprint library. + +2008-01-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh.in: add a -d|--dpi flag to use a fixed + scale factor for the exported png files + +2008-01-03 Ben Jackson * ben AT ben dot com * + + * src/parse_y.y: Temporarily change PCB=yyPCB while InitClip after + load (similar hacks exist in other load code) + +2008-01-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/qfpdj.inc: add missing PKG_QFP_40 + +2008-01-03 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c: apply + patch 1852864 GTK HID: scrolled layer preferences To enable a + scroll window for the layers. This is needed if the user uses more + than 8 or so layers. + +2008-01-02 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/bom/bom.c: Fix a problem with the X-Y output file where + the y values were mirrored and offset with respect to the RS274-X + output. Given that this bug has been here since the code was + written 3 years ago, I conclude that in fact no one has used this + feature. + +2007-12-26 Dan McMahill * dan AT mcmahill dot net * + + * src/lrealpath.c: change the preprocessor logic a bit to avoid + #ifdef-ing in code that will never be reached. + +2007-12-26 Dan McMahill * dan AT mcmahill dot net * + + * src/puller.c: add a couple of casts to make pointer compares work + on identical pointer types. + +2007-12-26 DJ Delorie * dj AT delorie dot com * + + * src/hid/png/png.c: Fix some off-by-one bugs. + +2007-12-26 Dan McMahill * dan AT mcmahill dot net * + + * src/puller.c: get rid of a handful of compiler warnings (printf + format strings, and unused variables). + +2007-12-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/netlist.c: Cast parameters to right type. + +2007-12-21 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: add 10x10mm TQFP64, 12x12mm TQFP80, and 12x12mm + TQFP100 footprints + +2007-12-19 Dan McMahill * dan AT mcmahill dot net * + + * lib/connector.inc: make sure both rows of CONNECTOR_DIL use 38 mil + pins. Noted on geda-user by Michael Stovenour + +2007-12-19 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: Resolve some const-cast issues. + +2007-12-18 DJ Delorie * dj AT delorie dot com * + + * lib/geda.inc: Add TSSOP14 and TSSOP16 + +2007-12-13 Dan McMahill * dan AT mcmahill dot net * + + * lib/plcc.inc: fix a few more cases of = being used where == was + called for + +2007-12-13 Dan McMahill * dan AT mcmahill dot net * + + * lib/plcc.inc: use == instead of = for testing equality. Gets rid + of a bunch of warnings. Verified that pcblib-newlib contents did + not change with this commit. + +2007-12-11 DJ Delorie * dj AT delorie dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Various changes from Kai; + cut-copy swap for lesstif. + +2007-12-11 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * : Forced checkin with no changes due to missed log entry from in + commit Initialise static variables x_prev and y_prev in + ghid_port_window_motion_cb() to -1, to avoid the (unlikely) case + they are used initialised. + +2007-12-10 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-output-events.c: Fix enter/leave logic to avoid + leaving obsolete crosshair-attached elements on the screen when the + cursor leaves the working area. + +2007-12-10 Ben Jackson * ben AT ben dot com * + + * src/hid/lesstif/main.c, src/pcb-menu.res: Add Zoom(Toggle) and + bind it to ` (backtick). Fix all warnings in hid/lesstif/main.c + +2007-12-10 Ben Jackson * ben AT ben dot com * + + * src/draw.c: Make 'outline' layer test case-insensitive to match + other instances. + +2007-12-10 Ben Jackson * ben AT ben dot com * + + * src/draw.c: Add gross hack to avoid using mask in DrawRats() for + othet than lesstif HID, as lesstif and gtk provide different + capabilities in CLEAR mode. + +2007-12-10 Ben Jackson * ben AT ben dot com * + + * src/draw.c, src/hid/lesstif/main.c, src/hid/lesstif/xincludes.h: + Add XRENDER support to the Lesstif HID. Rat lines and soldermasks + are now displayed at 50% intensity on top of other drawn elements. + +2007-12-09 Ben Jackson * ben AT ben dot com * + + * configure: Rebuild with 2.61 + +2007-12-09 DJ Delorie * dj AT delorie dot com * + + * config.h.in, configure, configure.ac: Check for Xrender library. + +2007-12-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon1.c: Sometimes single-point touching will leave no + starting point on the 'A' pline for an ISECTED contour. Check for + starting points on the 'B' pline (only at the point of intersection) + just in case it has a valid starting point. + +2007-12-04 Ben Jackson * ben AT ben dot com * + + * src/hid/png/png.c: ignore paste layers when exporting 'as shown': + Correct logic for silk display; Add logic for mask display ignore + soldermask layers for normal output add option to make + background/erasures transparent + +2007-12-03 Ben Jackson * ben AT ben dot com * + + * src/crosshair.c: Avoid moving elements snapping to their own pins + or pads. Don't snap moving vias to any kind of pins (they can't + overlap anyway). + +2007-12-03 Ben Jackson * ben AT ben dot com * + + * src/action.c: Don't create empty text objects. + +2007-12-02 Ben Jackson * ben AT ben dot com * + + * src/misc.c, src/polygon.c: Data->LayerN should generally be + avoided. It's not initialized for buffers. All buffers should have + max_layer available (which is a macro for PCB->Data->LayerN, the + number of layers in the current board). + +2007-12-02 Ben Jackson * ben AT ben dot com * + + * src/action.c: Partial fix? [ 1775101 ] Undo with the line tool + sometimes switches to wrong node If you auto-drc and you extend a + line (causing a delete and re-add of a longer line), then undo, this + patch ensures the restored short segment has FOUNDFLAG so you can + continue drawing. + +2007-12-02 Ben Jackson * ben AT ben dot com * + + * src/macro.h, src/move.c: Fix [ 1820398 ] Inconsistant vias with + move-to-layer Add explicit check for silk layer when making vias due + to movelinetolayer + +2007-12-02 Ben Jackson * ben AT ben dot com * + + * src/action.c: Fix [ 1836169 ] undo of shift-paste element + replacement broken Code was "stealing" the original name memory + before removing it, so the element went into the undo buffer + nameless. Copy string instead. + +2007-12-02 Ben Jackson * ben AT ben dot com * + + * src/action.c: Fix [ 1836172 ] shift-create two vias, undo twice, + internal error Caused by my addition of shift-click vias -- the new + via undo was happening before the new flag undo. + +2007-12-02 Ben Jackson * ben AT ben dot com * + + * src/buffer.c: Missed a spot when adding 'clearlineflag' support to + Text. Also Fixed a bug in movearctobuffer + +2007-11-30 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c, src/hid/lesstif/dialogs.c, + src/hid/ps/ps.c: Fix printer calibration. + +2007-11-30 DJ Delorie * dj AT delorie dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Add 50 mil grid setting. Add + global puller submenu. + +2007-11-30 Ben Jackson * ben AT ben dot com * + + * src/action.c: Fix a typo. Do not use grid size for + Connection(Find) search radius + +2007-11-30 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Attach the show soldermask layer button to + its flag. + +2007-11-30 Ben Jackson * ben AT ben dot com * + + * src/polygon.c: In case 'biggest()' polygon is 0 area, init size = + -1 instead of 0. + +2007-11-27 Ben Jackson * ben AT ben dot com * + + * src/rats.c: Fix two bugs in my via-rats patch: 1) Certain combinations of objects (presumably rare!) could lead to + a crash. 2) Fix a cut/paste error where the wrong coordinate was tested. + Add explanatory comment. + +2007-11-25 DJ Delorie * dj AT delorie dot com * + + * src/puller.c: Add global puller. + +2007-11-25 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Draw arc start/end radii in separate + colors, and dotted, if enabled. + +2007-11-25 DJ Delorie * dj AT delorie dot com * + + * src/draw.c, src/draw.h: Export DrawLayer() for the ps exporter. + +2007-11-25 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Draw outline layer on all other copper layers + when "draw outline" is selected. Make alignment marks less + obtrusive. Make drill helpers half the board's minimum drill size, + not twice PCB's minimum drill size. Include commented out helpers + for brass paste stencil etching. + +2007-11-25 DJ Delorie * dj AT delorie dot com * + + * src/undo.c: Don't just clean out RemoveList, free it, so it's + created properly later. + +2007-11-25 Ben Jackson * ben AT ben dot com * + + * src/polyarea.h: Add some prototypes for global functions returning + double that will confuse the heck out of you if treated as returning + int! + +2007-11-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/netlist.c: Don't crash if a scanned element has no + text. + +2007-11-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/library.c: lesstif_show_library: Don't reset the + dialog when we're just re-displaying it. + +2007-11-24 Ben Jackson * ben AT ben dot com * + + * src/action.c: Apply [ 1726201 ] SaveTo(PasteBuffer.file) for + footprint creation with cleanups (original patch from Christian + Riggenbach - gizmotron) + +2007-11-23 Ben Jackson * ben AT ben dot com * + + * src/actionlist.c: Remove obsolete (generated, even!) file + +2007-11-23 Ben Jackson * ben AT ben dot com * + + * src/gpcb-menu.res, src/pcb-menu.res: Change all the GetXY prompts + for greater clarity. + +2007-11-23 Ben Jackson * ben AT ben dot com * + + * src/hid/gtk/gui-config.c: Apply patch [ 1835365 ] Fix for [ + 1820385 ] Can't close the preference dialog from denis77 + +2007-11-23 Ben Jackson * ben AT ben dot com * + + * src/autoroute.c: LIST_LOOP works on circular lists, but at least + some code will produce a head pointer of NULL for an empty list, + causing LIST_LOOP to crash. Since I'm not sure which is the bug, I + changed LIST_LOOP to assert() on a NULL list head and skip the loop. + With assert disabled, the loop becomes a no-op, which seems + appropriate. + +2007-11-23 DJ Delorie * dj AT delorie dot com * + + * src/search.c, src/search.h: Additional slanted-pad patch for + missed DRC + +2007-11-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/styles.c: Update the status line even when we + don't have a styles dialog. + +2007-11-19 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Add annulus and mask gap to pin/via report. + +2007-11-19 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: add a missing AC_MSG_RESULT in the + makeinfo version test. Patch from Peter Brett. While here, remove + a bashism (== vs =). + +2007-11-18 DJ Delorie * dj AT delorie dot com * + + * globalconst.h: Expand min/max values. + +2007-11-14 DJ Delorie * dj AT delorie dot com * + + * src/misc.c, src/parse_y.y: Fix pin bound calculations based on new + thermal calculations. + +2007-11-12 DJ Delorie * dj AT delorie dot com * + + * src/crosshair.c: Snap to pin/pads whenever we're within the + pin/pad copper, unless shift is pressed, then snap to the nearest + grid point if it's closer. + +2007-11-12 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidnogui.c: Don't complain about checking the shift + key when exporting pngs from the command line. + +2007-11-12 Ben Jackson * ben AT ben dot com * + + * src/buffer.c: Fix bugs intoduced by revision 1.41 while preserving + the fixes in 1.41. + +2007-11-10 DJ Delorie * dj AT delorie dot com * + + * lib/connector.inc: Reduce silk width of connector/header/jumpers + (some fabs clip it to the pads) to be similar to other elements. + +2007-11-10 DJ Delorie * dj AT delorie dot com * + + * lib/qfpdj.inc, lib/smt.inc: Move silk away from pads. Fix notch + in SO footprints. + +2007-11-05 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: fix DIN41651_20 and DIN41651_20S. Those are 20 pin + footprints not 10 pin footprints. Reported by Marshall Jose. + +2007-11-04 Ben Jackson * ben AT ben dot com * + + * src/change.c, src/change.h, src/move.c, src/polygon.c, + src/rotate.c, src/strflags.c: Add support for clearing text from + polygons. Text with the clearline flag (set with the J key by + default, just like lines and arcs) will have a rounded rectangle + hole cut in any overlapping polygons. + +2007-11-04 Ben Jackson * ben AT ben dot com * + + * src/action.c: Shift-click with the via tool to connect it to the + current layer as you place it. + +2007-11-04 Ben Jackson * ben AT ben dot com * + + * src/hid/lesstif/netlist.c, src/netlist.c, src/rats.h: Plumb the + NetlistShow() hid action in lesstif. Takes a pin name or a net name + and sets the current selection in the netlist window. Does not pop + up the netlist. + +2007-11-02 Dan McMahill * dan AT mcmahill dot net * + + * configure, doc/actions.texi, doc/version.texi: regen + +2007-11-02 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Properly thin-draw slanted pads. + +2007-11-02 DJ Delorie * dj AT delorie dot com * + + * src/find.c, src/polygon.c, src/search.c, src/search.h: Fixes for + DRC of slanted pads. Tracker bug 1791388 and patch 1791392. + +2007-11-02 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Don't draw pins/holes on the outline layer. Include + commented-out code to put board outline on mask layers, for fabs + that need that. + +2007-11-02 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/buffer.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-top-window.c, src/select.c: fix some compiler + warnings + +2007-11-02 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: Improve the robustness of the makeinfo version test. + Patch provided by Peter Brett. + +2007-11-02 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: Don't segfault when clicking the top + right button which toggles units. Problem noted by and solution + provided by Christian Riggenbach. + +2007-10-24 Ben Jackson * ben AT ben dot com * + + * src/search.c: Treat VIAFLAG rats (displayed as donuts) as round + targets, not as the invisible lines they are internally. + +2007-10-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: Make sure the leftmost end of the line + is visible in the log window. + +2007-10-21 Ben Jackson * ben AT ben dot com * + + * src/action.c: Fix printf format warnings. + +2007-10-21 Ben Jackson * ben AT ben dot com * + + * src/crosshair.c, src/draw.c, src/rats.c: Ratlist generation is + changed to favor connecting to polygons when they are available and + surround the pin needing a connection. Such rats are still + internally lines to the corner of the polygon, but have the VIAFLAG + set. The drawing code is modified to show them as little donuts + (suggesting the via that would be used to connect the pin, vs a + line). The crosshair rubberband code is modified to NOT draw these + lines while dragging. These changes are forward and backward + compatible. + +2007-10-21 Ben Jackson * ben AT ben dot com * + + * src/action.c, src/find.c, src/find.h: Make DRC dialog + next/continue to clarify its function. When DRC is over, message + now indicates if it was cancelled (so log can distinguish lack of + DRC errors from aborted DRC). + +2007-10-20 Ben Jackson * ben AT ben dot com * + + * src/rubberband.c: The correct point on a line now moves with a + polygon (fix cut'n'paste typo) When you move a line endpoint, only + *exactly* connected lines go with you. When you move a line, if + another segment fully overlaps the end of the moving line, the + entire segment (not an arbitrary end of it) will move. When you + move an element, any segments completely covered by a pad move with + the pad. (there are still some bugs in the drawing code as you + drag??) + +2007-10-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: Fix some really broken spurious panning + of the drawing area which happens when the board is viewed from the + back. Reported by Peter Clifton who also helped getting this patch + working right. + +2007-10-04 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gui-output-events.c: Reject double and triple clicks + in ghid_port_button_press_cb() Fixes a bug where a component would be rotated by more steps than + desired if clicking quickly with the rotate tool. + +2007-09-24 Ben Jackson * ben AT ben dot com * + + * src/polygon.c: Change rendering of rounded corners used when + clearing polygons. This fixes a slight rotation in rounded + rectangles and asymmetry of all rounded clearances besides complete + circles (which were not affected by the bug). For an illustration, + see: http://ad7gd.net/geda/roundrectanim.gif (include error code + print in returns from the polygon code -- not much use) + +2007-09-24 Ben Jackson * ben AT ben dot com * + + * src/autoroute.c: Add (under ifdef) code I used to debug a report + of "The rats nest is stale! Aborting autoroute...". It leaves the + rat in question selected after the error. + +2007-09-19 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: add missing 2007 in copyright year (for all the gtk + usermenu stuff) + +2007-09-17 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: avoid free()-ing some memory a bit + too soon. Patch from Ineiev. + +2007-09-14 Dan McMahill * dan AT mcmahill dot net * + + * src/gpcb-menu.res, src/pcb-menu.res: use mil and mm instead of + mils and mms for grid units + +2007-09-13 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: a few minor corrections + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: welcome to 1.99w + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: news for 20070912 + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update for 20070912 snapshot + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: set date for 20070912 + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, aclocal.m4, configure, + doc/Makefile.in, doc/actions.texi, doc/pcbfile.texi, + doc/version.texi, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/electro-optics/Makefile.in, newlib/headers/Makefile.in, + newlib/keystone/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, src/Makefile.in, src/icons/Makefile.in, + tools/Makefile.in, tutorial/Makefile.in, win32/Makefile.in: regen + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: fill in the missing code to get the gtk + HID set_crosshair() function working as well as the Cursor() action + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c: fix a typo in a help string + +2007-09-12 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-output-events.c: remove unused variable + +2007-09-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Add missing else. + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/buffer.c: Fix bugs with undoing "group" moves of objects over + a polygon. The group code uses the buffer code (sort of an + automatic cut/paste) so it applies to inserting elements and using + the buffers as well. + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/action.c: Fix [ 1751568 ] shorted nets stay orange after + fixing and re-opt netlist + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/rotate.c: Fix [ 1751574 ] undoing rotation that put an elt + inside a poly didn't fix plow Properly restores/clears rubber band + lines during rotate and undo. Still shockingly slow if you try this + on an even moderately full board! + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/find.c, src/rtree.h: Search for rat-end connections using 3x3 + "fat" ends to avoid having rat-to-polygon-corner connections missed. + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/select.c: Fix [ 1751566 ] When 'far side' hidden, hidden + elements don't deselect Change the SelectBlock to ignore visibility + for deselect while looping over all elements. The diffs are large + because the original code used VISIBLE_*_LOOP so all of the looping + was replaced. + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/search.c: Apply [ 1751580 ] polys should not be + selectable/considered when thin-drawn + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/search.c: Fix the crash from [ 1724453 ] PCB Crashes with bad + footprint (in its library) Does not fix whatever bug in the input + allowed a bogus element in (see bug for description of the problem + with the element and the source of the bad element). + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/remove.c: Fix bugs 1751572 and 1743534 by allowing a remove on + an endpoint to delete the segment if it's not just deleting a kink + from a longer line. + +2007-09-08 Ben Jackson * ben AT ben dot com * + + * src/move.c: Fix [ 1751578 ] 'move to current layer' doesn't + re-plow polygon correctly by clearing the NEW line pointer instead + of the old (destroyed) one. + +2007-09-06 Dan McMahill * dan AT mcmahill dot net * + + * lib/dil.inc: Patch [ 1784693 ] Fix Mark position for SDIP packages + +2007-09-06 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: Add newlib/keystone/Makefile. Forgot to + check this in earlier. + +2007-09-05 Dan McMahill * dan AT mcmahill dot net * + + * newlib/Makefile.am, newlib/Makefile.in, + newlib/keystone/KEYSTONE_1062.fp, newlib/keystone/Makefile.am, + newlib/keystone/Makefile.in: add Keystone SMT battery holder for + CR2032 coin cells. + +2007-09-05 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in, lib/candk.inc, lib/common.m4, + lib/nichicon.inc, lib/optek.inc: Add C&K ES series switches, Optek + white LED, and Nichicon WT series of SMT electrolytics. + +2007-09-04 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-dialog-print.c, src/hid/gtk/gui.h: gut + ghid_print_dialog() and use the attribute editor to do all of the + dialog box work. Removes a bunch of duplicated code. + +2007-09-04 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/file.c, src/gpcb-menu.res, src/hid.h, + src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui-dialog.c, src/hid/gtk/gui.h, + src/hid/lesstif/dialogs.c, src/hid/lesstif/lesstif.h, + src/hid/lesstif/main.c, src/hid/lpr/lpr.c, src/hid/nelma/nelma.c, + src/hid/png/png.c, src/hid/ps/ps.c, src/vendor.c: Add a + ->fileselect() function to the HID interface. Now actions can use + gui->fileselect() instead of gui->prompt_for() when they are + specifically looking for a file. Currently the gtk HID implements + this and the lesstif one has the old behaviour. While messing around with dialogs, add a "descr" argument to the + attribute editor. That can be used as a tooltip, help string, or + ignored. + +2007-08-26 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/ps/ps.c: Fixed .ps output with "drill-copper" and + "drill-helper" options. Holes in the soldermask (and other non-copper layers) are now drawn + correctly when the "drill-copper" option is set to false. With the + "drill-helper" option on, only holes on copper layers are affected. + +2007-08-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid.h, src/hid/batch/batch.c, src/hid/common/hidnogui.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui.h, src/hid/lesstif/dialogs.c, + src/hid/lesstif/main.c, src/hid/ps/ps.c: add a title argument to the + HID attribute_dialog function so the dialogs can have appropriate + titles + +2007-08-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui.h: Implement the missing attribute editor dialog for + the GTK HID and now that it is available, add the PrintCalibrate() + action to match the lesstif one. + +2007-08-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: indent + +2007-08-19 Dan McMahill * dan AT mcmahill dot net * + + * src/draw.c: when drawing the mark for an element also put an "L" + on it if the element is locked. Patch from Bert Timmerman + +2007-08-17 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: clean up the regexp appendix a bit + +2007-08-17 Dan McMahill * dan AT mcmahill dot net * + + * lib/qfn.inc: use a default pad clearance of 20 mils instead of + zero. Bug [ 1742394 ] Zero clearance QFN footprints. + +2007-08-17 Dan McMahill * dan AT mcmahill dot net * + + * src/gpcb-menu.res, src/hid/gtk/gui-top-window.c: Teach the GTK HID + about active= in the menu resource file. Now that this works, + sync up the active=have_regex menus with the lesstif menu resource + file. + +2007-08-06 DJ Delorie * dj AT delorie dot com * + + * src/global.h: Give data->pcb a real type. + +2007-08-06 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: Make sure loaded buffers have a proper pcb + backpointer. + +2007-08-06 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: [ 1751567 ] with thin-draw-poly on, soldermask display + is messed up + +2007-08-06 DJ Delorie * dj AT delorie dot com * + + * src/select.c: Match whole names with regex's, when possible. + [1741650] + +2007-08-06 DJ Delorie * dj AT delorie dot com * + + * src/flags.c, src/pcb-menu.res: Fix the have_regex flag in + pcb-menu.res [1751564] + +2007-08-06 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/actions.c, src/hid/lesstif/menu.c: More empty + :command checks [1751582] + +2007-08-06 DJ Delorie * dj AT delorie dot com * + + * src/polygon.c: Ben: Avoid duplicate passes through pad clearances. + +2007-08-05 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/const.h, src/draw.c, src/flags.c, src/global.h, + src/gpcb-menu.res, src/main.c, src/pcb-menu.res, src/polygon.c, + src/strflags.c: patch 1738364: flag for non-clipped polygons. + +2007-08-05 DJ Delorie * dj AT delorie dot com * + + * src/hid/bom/bom.c: Adds an export in mm to the BOM export dialog + [1742399] + +2007-08-05 DJ Delorie * dj AT delorie dot com * + + * src/set.c: Don't limit keepaway size to minimum *line* size. + +2007-08-04 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Apply bloat to drawn rectangles. + +2007-08-04 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Tracker 1753084 - fixes 1751589, merged soldermask has + larger than expected outline. + +2007-08-03 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-top-window.c: More paranoid check for "gui is up" + +2007-08-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-top-window.c: Don't allow LayersChanged if there's + no GUI yet. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Protect against empty :command string. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/strflags.c: Fixed a bug in flags_to_string where the LOCALREF + pcb flag would be discarded. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Fix references to RouteStyleChanged (should be + RouteStylesChanged). Call it when :RouteStyle is called. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/file.c: When a board is loaded, the first route style is + automatically selected if the old style doesn't happen to match any + styles. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Add missing variable. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: When the layer stack is reset, bring the component + layer to the front and make it active. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: When swapping board sides, swap top/bot + layers even if both layers are visible. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Swap the direction of scroll bars when the + board is swapped. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c, src/hid/ps/eps.c, src/hid/ps/ps.c: + Gerber, PS, and EPS ignore the thindraw settings. Fix bug in PS + when first item on the board is an arc. PS "drill helper" changed + to a simple hole reduction so that copper extends to drilled hole + even when hole is off-center. + +2007-08-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Don't free home_pcbmenu until after it's + used. + +2007-06-28 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-config.c: Don't forget to fclose() the config file + after we're done reading it. CID 27, scan #1. + +2007-06-28 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/bom/bom.c: Fix a few memory leaks. Coverity ID 22, 23, + and 24, scan #1. + +2007-06-13 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: add missing save_syntax and save_help. + Also allow Save(PasteBuffer) so we have more compatibility with the + lesstif HID. This also fixes the regression about saving buffer + elements which appeared after the user menu branch was merged. + +2007-06-13 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/dialogs.c: add Save(PasteBuffer) to save_syntax. + +2007-06-09 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/pcb-menu.res: Add Delete() action. No + arguments: delete selected ELSE object, but options for selected + only, object only, selected rats, all rats. + +2007-05-29 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Revert patch to hide far-side (invisible) pads when + near-side pins / pads are switched off. Old behaviour was + intentional. + +2007-05-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/ps/ps.c: Add option "drill-copper" to draw / not draw + drill holes in the copper layers of the ps exporter. This is useful + for plated through processes which require the etch mask to protect + the vias / pins during etching. + +2007-05-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Change drawing code for square pads to use + gui->fill_rect (...) as on Win32, the current method of drawing a + zero length line doesn't work. + +2007-05-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/draw.c: Stop far side 'invisible' pads being drawn when pins / + pads are switched off. + +2007-05-25 Peter Clifton * pcjc2 AT cam dot ac dot uk * + + * src/hid/gtk/gtkhid-main.c: Fix drawing of filled rectangles when + the board is flipped. Makes soldermask view on the back of the + board work. + +2007-05-24 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2007-05-24 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: check for buggy versions of m4 which seem to think + eval(-2/2) should be 2147483647. Noted by Peter Clifton. + +2007-05-23 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: Avoid a stack corruption. Noted by + Peter Clifton. Should probably replace all instances of sprintf in + pcb with snprintf, but that will take some work. + +2007-05-17 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c, src/hid/lesstif/menu.c, src/main.c: + check for getenv() return codes everywhere and deal if getenv + returns NULL. Noted by Peter Clifton. + +2007-05-16 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: if the popen fails for the ListLibraryContents.sh + shell script, continue on with the newlib processing instead of + failing. This helps on systems where either the user has disabled + m4 libraries or on systems like windows where the popen will not + work. + +2007-05-04 Dan McMahill * dan AT mcmahill dot net * + + * src/todo: remove a few fixed things + +2007-05-04 Dan McMahill * dan AT mcmahill dot net * + + * lib/connector.inc: Increase the hole size on the DIN* connectors + (are these named wrong btw?) from 28 mils to 40 mils. This is more + in line with what is recommended for Tyco *-1634689-* box headers in + Tyco drawing 1634689. Noted by Seb James. + +2007-05-02 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c: When refusing to create overlapping vias spit out a + warning. We should probably allow overlapping vias but turn it into + a DRC violation. But until then, at least give a warning instead of + silently dropping them. More details are in bug reports: [ 1687692 + ] Large Pads (150 mils) silently dropped [ 1266154 ] lost vias + +2007-05-02 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c, src/file.h, src/misc.c: avoid triggering an emergency + save on normal exit. Reported and patch provided in bug [ 1705607 ] + Emergency save on normal exit. + +2007-05-01 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-pinout-window.c: - make arcs show up in the pinout window - don't rotate the element in the pinout window. Rather display + with the same rotation as in the layout. Besides being more useful + this avoid a segfault in some cases. + +2007-05-01 Dan McMahill * dan AT mcmahill dot net * + + * src/gpcb-menu.res: remove the menu mneumonics as some conflict + with hotkeys + +2007-05-01 Dan McMahill * dan AT mcmahill dot net * + + * src/gpcb-menu.res, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: Teach the GTK HID how to trap certain hotkeys + which gtk usually captures for its own use. This lets PCB use the + arrow keys and the tab key again. So restore the hotkey for + flipping sides in the menu resource file. Start on the Cursor() + action which is needed for the arrow keys. That part is not done + yet. + +2007-04-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Don't double the pad thickness when restoring to + the polygon. For speedup, just add back a simple rectangle since it + only has 4 points. Should do that for lines too, but didn't. + + ---------------------------------------------------------------------- + +2007-04-27 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: fix bloating of region to search for re-clearance + after a portion of polyogn is restored. + + ---------------------------------------------------------------------- + +2007-04-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Draw non-circular arcs manually. + +2007-04-21 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/buffer.c, src/copy.c, src/create.c, + src/create.h, src/parse_y.y: Preserve width *and* height when + manipulating arcs. + +2007-04-21 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: Add FreeRotatebuffer(Angle) (angle can be any angle) + +2007-04-21 DJ Delorie * dj AT delorie dot com * + + * src/crosshair.c, src/search.c: Allow for diagonal pads. + +2007-04-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: Use ".fp" when loading element data. + +2007-04-21 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c, src/create.c: Permit the existence of diagonal pads. + +2007-04-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Use polygons to draw square ended + diagonal lines. + +2007-04-21 Dan McMahill * dan AT mcmahill dot net * + + * src/autoplace.c: add a check to make sure malloc() succeeds. + Noted in bug [ 1657886 ] Check return codes everywhere + +2007-04-21 Dan McMahill * dan AT mcmahill dot net * + + * src/gpcb-menu.res, src/pcb-menu.res: Change "Select all" to + "Select all visible" to match up with what actually happens. + Reported in bug [ 1013719 ] Select all objects: misleading name? + +2007-04-20 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/main.c, src/hid/ps/ps.c, src/hid/ps/ps.h: fix a + handful of compiler warnings + +2007-04-20 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi: regen after usermenu merge + +2007-04-20 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac, src/Makefile.am, + src/Makefile.in, src/action.c, src/gpcb-menu.res, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h, src/misc.c, src/pcbtest.sh.in, src/set.c, + src/todo: Merge the usermenu branch. This reworks how the menus + and hotkeys are defined and handled for the gtk HID. In particular, + instead of being hard coded, the menus are loaded from a menu + resource file like in the lesstif gui. All hotkeys are defined via + the menu hotkeys and thus are visually presented in the menus. The + gtk HID looks for "gpcb-menu.res" instead of "pcb-menu.res" so that + the menu organization may be different between the lesstif and gtk + HID's. + +2007-04-19 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/change.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-pinout-window.c, src/hid/gtk/gui-top-window.c, + src/misc.c, src/output.c, src/output.h, src/set.c, src/thermal.c: + Remove references to the now unused output.h. To help keep it that + way, go ahead and remove the unused output.c and output.h files. + +2007-04-12 DJ Delorie * dj AT delorie dot com * + + * src/command.c: Allow :s without filename to use current filename. + +2007-04-11 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, src/Makefile.am, src/Makefile.in, + src/hid/nelma/hid.conf, src/hid/nelma/nelma.c, + src/hid/nelma/nelma.h: add the nelma export HID provided in patch: [ + 1601099 ] Nelma export HID by Tomaz Solc with a few minor updates by + me. + +2007-04-11 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-output-events.c: Apply patch supplied in patch [ + 1692014 ] Patch for "click on focus for zoom" bug from Tomaz Solc. + +2007-04-10 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/pcbfile.texi, doc/version.texi, + src/Makefile.in: regen + +2007-04-08 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-config.c: Initialize command history size to 5 if + no config setting is given. Patch [ 1608559 ] Patch for command + entry history bug. + +2007-04-08 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-misc.c: add distance and angle to the relative + readout. Mostly provided in patch submission [ 1621913 ] Euclidian + distance from mark. Minor update (fix the fact that in PCB units, + positive Y is down) from me. + +2007-04-08 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c, src/file.h, src/parse_y.y: turn on the code which + marks the file format version in the file. pcb has had the code in + place for a bit now that parses that and gives a warning if the + version of pcb is not new enough to read the current file version. + +2007-04-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-misc.c, src/hid/gtk/gui-top-window.c: prevent the + cursor position labels from growing/shrinking as you move the cursor + around. + +2007-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/flags.c: Change the stringflag in the settings from showdrc to + showdrcmode since we already used showdrc for the flag. This fixes + the menu choice for "crosshairs show drc clearance". + +2007-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/rats.c: avoid using an unitialized variable (even though we + ignore the result of that access) + +2007-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/move.c: document MoveLayer() action + +2007-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/file.h: add missing prototypes + +2007-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: add missing header, remove unused variable + +2007-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c, src/find.c: remove unused variable + +2007-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: format string fix + +2007-03-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rats.c: find rats regardless of how far the coordinates are + out of bounds + + ---------------------------------------------------------------------- + +2007-03-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rats.c: Handle case for connections are close to or beyond + MAX_COORD + + ---------------------------------------------------------------------- + +2007-03-09 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Makefile.in, src/clip.c, src/clip.h, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: Add basic line + clipping to both GUIs. + +2007-03-04 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: Fix a bug when looking for square pad to square pad + clearance. The old way simply grew one of the pads by Bloat on all + 4 sides and looked for overlap. This is not the correct test in the + case where the closest line between the two pads is a unique line + from two of the corners. The new way should correctly handle all + cases. + +2007-03-04 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Makefile.in, src/action.c, src/action.h, + src/autoroute.c, src/change.c, src/const.h, src/crosshair.c, + src/data.c, src/data.h, src/djopt.c, src/draw.c, src/file.c, + src/find.c, src/flags.c, src/global.h, src/hid.h, + src/hid/batch/batch.c, src/hid/common/hidinit.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/lesstif/netlist.c, + src/hid/png/png.c, src/hid/ps/eps.c, src/hid/ps/ps.c, src/macro.h, + src/main.c, src/misc.c, src/misc.h, src/parse_y.y, + src/pcb-menu.res, src/report.c, src/search.c, src/set.c, + src/strflags.c, src/strflags.h, src/todo: Made flags type big enough + to hold PCB flags. Added hash table for parameter lookup in action.c Moved thindraw code out of lesstif hid. Added "thin draw polygons" flag to toplevel stuff. Fixed "check polygons" so it works again. Added "lock names" setting: When set, the arrow tool ignores element + names and text objects, so you can select the elements or objects + beneath them. Added "only names" setting: When set, the arrow tool can only select + element names and text objects; you won't accidentally move an + element. Made the crosshair-move code draw the outline of pads, not the + centerline. It does still draw round-end pads as rectangles, + though. Allow "--no-foo" to shut off boolean "--foo" options that default to + on. Added "--layer-stack" option that takes a string and sets the layer + stack to it (for eps/png export, mostly). Layers are numbers + 0..N-1, the names of the layers from the loaded PCB file, or the + special names "rats", "invisible", "pins", "vias", or "elements". + Layers may be separated by spaces, commas, semicolons, or colons. Added Display(Step,[1..9]) to move the cursor in steps. Implemented + in lesstif HID, attached to arrow keys. Added "what to do with the + pointer" parameter - warp pointer to match crosshair, or pan window + to put crosshair under cursor. Make autorouter show live trials. Clean up various FIXMEs. Add support for string encoded PCB flags. thindraw exports: off by default? Follow current setting? Or put + it in their own attribute list? Added Report(NetLength) which reports on the total length of + segments (lines and arcs) for the net under the cursor. It will + also tell you the name of the net. Remove obsolete UseLogWindow and RaiseLogWindow. + +2007-03-02 Dan McMahill * dan AT mcmahill dot net * + + * win32/pcb.nsi.in: remove some left over links on uninstall + +2007-02-27 DJ Delorie * dj AT delorie dot com * + + * src/file.c: Avoid segfaults when loading elements, fixes bug in + load-element-as-pcb patch. + +2007-02-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Add calibration values to the attribute list so + they can be stored in the settings file, or given on the command + line. + +2007-02-24 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/parse_y.y: Allow the user to load a footprint as a + pcb; create a suitably-sized pcb around it. + +2007-02-23 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Report on pads as rectangles, not lines, so we get + width and height for the pad and mask. Also, report the gap between + the pad and the mask. + +2007-02-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Silence some compiler warnings. + +2007-02-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Don't print the scale if we're filling the page. + Don't print (null) if there's no board name. + +2007-02-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Attach status bar widgets to the correct + siblings. + +2007-02-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Don't use the crosshair's position to keep + track of whether it's in the window or not; have a separate variable + so we can avoid panning when we're just resetting the crosshair + after a tool change. + +2007-02-15 DJ Delorie * dj AT delorie dot com * + + * src/autoroute.c, src/hid/ps/ps.c, src/parse_l.l, src/polygon.c: + Move declarations before statements (patch by Ben Jackson * ben AT + ben dot com *) + +2007-02-13 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/change.c, src/draw.c, src/draw.h, src/move.c, + src/print.c, src/remove.c, src/rotate.c, src/undo.c: Keep track of + the minimum line size for text depending on which layer the text is + on (copper, silk, pin numbers). + +2007-02-12 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in, src/Pcb.ad.in, src/Pcb.ad.raw, + src/Pcb.ad.small: Remove the appdefaults files. These were leftover + from Xaw days and weren't really doing anything other than providing + a filename conflict on case insensitive file systems (pcb vs Pcb). + +2007-02-12 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Compensate for rotated boards. Allow the print + step to be skipped. + +2007-02-10 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/hid/lesstif/dialogs.c, src/hid/lpr/lpr.c, + src/hid/ps/ps.c, src/pcb-menu.res: Add printer calibration code for + lesstif HID. + +2007-02-10 DJ Delorie * dj AT delorie dot com * + + * src/vendor.c: Cache vendor lookups. Use binary search instead of + linear. + +2007-02-10 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/parse_l.l: Properly deal with quoted characters in + both string reading and string writing. + +2007-02-10 DJ Delorie * dj AT delorie dot com * + + * src/vendor.c: Call busy before applying the vendor map. + +2007-02-10 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/djopt.c, src/hid.h, src/hid/batch/batch.c, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: Change the way + the busy cursor is done. Called for autoplace, autoroute, and + optimize. + +2007-02-10 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c, src/pcb-menu.res: Add "C" for Center() + action. Provide examples for zooming-with-centering in + pcb-menu.res. + +2007-02-10 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs_branches: note the usermenu branch + +2007-02-09 DJ Delorie * dj AT delorie dot com * + + * src/create.c: Always initialize default layer names. + +2007-02-09 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c: use MAX_LAYER in a spot instead of max_layer. + Prevents a segfault with the lesstif hid. + +2007-02-09 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: bump rev after 20070208 branch + +2007-02-09 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog, NEWS: update for 20070208 snapshot + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, src/main.c: if we somehow fail to find + the install path from lrealpath(argv[0]) or by searching through the + PATH environment variable, fall back to the configure time path + which is compiled into the binary. + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/version.texi: regen + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in: Modify how the dependencies work + a bit for the newlib library that is generated from the m4 + libraries. In particular, make sure that a normal user building + from a tarball doesn't have to build the libraries since they take + quite a bit of time. Also make sure things work with a read-only + source tree. + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: When pcb is called with no path, i.e. "pcb" instead of + "../src/pcb" or /usr/local/bin/pcb, then we can't just look at + argv[0] to figure out the installation path. In this situation, + search through PATH to find which pcb was called. Should fix + problems noted on geda-dev by Tomaz Solc. + +2007-02-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/pcbtest.sh.in: fix pcbtest script to use the new binary name + ('pcb') even when not using gdb + + ---------------------------------------------------------------------- + +2007-02-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon1.c: Prevent degenrate holes with no points from being + added to polygon. This is a stop-gap measure until I figure out why + coincident edges in opposite directions are being created in some + polygons. + + ---------------------------------------------------------------------- + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, aclocal.m4, configure, + doc/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/electro-optics/Makefile.in, newlib/headers/Makefile.in, + newlib/msp430/Makefile.in, newlib/not_vetted_ingo/Makefile.in, + newlib/sockets/Makefile.in, newlib/tests/Makefile.in, + src/Makefile.in, src/icons/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in, win32/Makefile.in: regen + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * : remove these generated files + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: update for 20070208 snapshot + +2007-02-08 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add a GIF AM_CONDITIONAL to go along with the PNG + one + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/Makefile.in: s/pcb-bin/pcb + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: fix botched commit + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: add a --enable-maintainer-mode flag + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * win32/pcb.nsi.in: Include in the installer the licenses for the + included libraries (gd, png, jpeg, freetype, zlib). + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb, win32/pcb.nsi.in: Add in the png HID to the + non-cygwin windows build. + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh.in: When generating the previews of the + footprints, run pcb on an input and output file in the current + directory instead of a different directory. This becomes important + on filesystems that use \ instead of / for the directory separator. + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac: On non-cygwin windows, look + for -lbgd instead of -lgd since the former is what is available as a + pre-build dll. + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: remove some illegal casts to unions. + +2007-02-06 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh.in: the executible is now pcb not pcb-bin + +2007-02-05 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_l.l: If the passed path to Parse is "" then don't use + it. + +2007-02-05 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_l.l: make sure r is always initialized + +2007-02-04 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, acinclude.m4, aclocal.m4, + config.h.in, configure, configure.ac, doc/Makefile.in, + example/Makefile.in, example/libraries/Makefile.in, + lib/Makefile.in, newlib/2_pin_thru-hole_packages/Makefile.in, + newlib/Makefile.in, newlib/analog-devices/Makefile.in, + newlib/burr-brown/Makefile.in, newlib/connectors/Makefile.in, + newlib/crystal/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, src/Makefile.in, src/file.c, + src/icons/Makefile.in, src/main.c, src/parse_l.l, + tools/Makefile.in, tutorial/Makefile.in, win32/Makefile.in: More + work on the relocatability stuff to handle the annoying "\" instead + of "/" for directory separators in windows. Use ";" instead of ":" + for path seperators under windows since it is common to have + "c:\some\path". With this change things seem to work under + non-cygwin windows. + +2007-02-04 Dan McMahill * dan AT mcmahill dot net * + + * win32/pcb.nsi.in: install pcb.exe instead of pcb-bin.exe + +2007-02-04 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, lib/Makefile.am, lib/Makefile.in, + newlib/Makefile.am, newlib/Makefile.in, newlib/cypress/Makefile.am, + newlib/cypress/Makefile.in, + newlib/generic_SMD_packages/0805_reflow_solder, + newlib/generic_SMD_packages/0805_wave_solder, + newlib/generic_SMD_packages/1206_reflow_solder, + newlib/generic_SMD_packages/Makefile.am, + newlib/generic_SMD_packages/Makefile.in, + newlib/generic_SMD_packages/SOT-23_Transistor, + newlib/toko/Makefile.am, newlib/toko/Makefile.in: Remove some empty + newlib directories, some poorly maintained footprints, and some + "heavy" footprints. There is still much more to be done but this is + a start. + +2007-02-04 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac, doc/actions.texi, + doc/pcb.texi, doc/version.texi, src/Makefile.am, src/Makefile.in, + src/file.c, src/global.h, src/hid/common/hidinit.c, + src/hid/gtk/gui-config.c, src/main.c, src/pcbtest.sh.in, + src/script/Makefile.am, src/script/Makefile.in, src/script/pcb.in: + Take a stab at making pcb installations be relocatable. By this I + mean you can configure and install with ./configure --prefix=/original/path make make install mv + /original/path /new/path and still have pcb work. To make this work, the binary path is determined at runtime and all + of the other paths are computed relative to this. As part of this, go ahead and kill off the pcb wrapper script around + pcb-bin. That was leftover from Xaw days and wasn't really needed + anymore. As a side effect, the --program-prefix and + --program-suffix configure options will probably work now. + +2007-02-03 Dan McMahill * dan AT mcmahill dot net * + + * acinclude.m4, config.h.in, configure, configure.ac: add autoconf + macros from + http://autoconf-archive.cryp.to/adl_compute_relative_paths.html and + http://autoconf-archive.cryp.to/adl_normalize_path.html and use them + to find relative paths from $bindir (where the pcb binary gets + installed) to the directories with the default font and the + footprints. This is the first step in making an installation be + relocatable. + +2007-02-03 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c, src/file.h, src/hid/gtk/gui-config.c, src/main.c: - Instead of tying the saving of preferences to the autobackup + timer, save them when we press ok on the preferences form. - Move the autosave code out of the gtk hid and put it in the core. + Now autosave should work on all gui's instead of just the gtk one. + +2007-02-03 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-netlist-window.c: Add a "find" and "rip-up" button + to the netlist window. Patch from Hans Nieuwenhuis on the geda-user + mailing list. + +2007-02-03 Dan McMahill * dan AT mcmahill dot net * + + * globalconst.h, src/file.c: Instead of writing the backup file + always to /tmp/something derive a backup name from the pcb file name + (if the pcb file name exists, otherwise use PCB.%i.save in the + current directory). This should make it easier to find the backup + file for a particular layout and also helps in cases where /tmp is + not appropriate (windows). + +2007-02-02 DJ Delorie * dj AT delorie dot com * + + * src/main.c: Add command line option for setting DrawGrid + +2007-02-02 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Round drill sizes before reporting them. + +2007-02-02 DJ Delorie * dj AT delorie dot com * + + * src/netlist.c, src/rats.c, src/rats.h: Fix logic for adding new + rat lines to the netlist. + +2007-02-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gtkhid-main.c: Fix gtk grid when board flipped. + +2007-02-02 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, configure, + doc/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in, win32/Makefile.in: regen + +2007-02-01 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Draw plated holes when exporting. + +2007-01-29 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c, src/hid/lesstif/netlist.c: Add more + functionality to netlist dialog. + +2007-01-27 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Make sure we have a current mark when we convert + selection to an element. + +2007-01-22 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in: Fix a problem where we ended up + with "//" in a full path name. This caused problems on cygwin. + +2007-01-20 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: add some code showing how to get the + installation path on windows. Right now, just print out the + directory to show it works until I figure out how to get it to the + rest of the program. + +2007-01-20 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: clean out the old install directory prior to + installing to avoid leftover cruft showing up in the installer. + +2007-01-20 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: add a number of flags to this script to help when + using it with cvs sources or in debug mode. See "build_pcb --help" + for details on the flags. + +2007-01-20 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, src/main.c: Break apart PCBTREEDIR into + the original plus PCBTREEPATH where the latter is a : seperated path + and the former is just the base installation directory for newlib. + +2007-01-19 Dan McMahill * dan AT mcmahill dot net * + + * src/compat.c, src/compat.h, src/hid/common/hidinit.c: Add + replacement wrappers for dlopen() and friends on windows. Update + the hid initialization code to pull in the compat header. Also work + around windows limitations with stat(). No change on real operating + systems. + +2007-01-19 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac: - check for dlfcn.h and windows.h - fix the test for if the PNG hid is being compiled in or not + +2007-01-17 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: exclude .html and .png files from newlib directories + +2007-01-17 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, src/pcbtest.sh.in: add the generated + (from m4lib) newlib to the library search path + +2007-01-16 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in, lib/footprint.pcb: - Add missing template .pcb file for generating previews of all the + footprints. Building the previews also verifies that there are no + syntax errors in the m4lib footprints. - fix the logic for rebuilding the newlib library from m4 libs. + +2007-01-16 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Use a global aperture list instead of + per-layer lists. + +2007-01-16 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/macro.h, src/main.c, src/parse_l.l: Don't call + popen() if we don't need to. + +2007-01-15 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in: Build and install a newlib + library from the m4lib library. Currently nothing else has changed, + the default for pcb is still the old behaviour. This is just the + first step. + +2007-01-15 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh.in: Make building the png preview optional. + Other minor cleanups. + +2007-01-15 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: add an AM_CONDITIONAL indicating if the + png HID was compiled in + +2007-01-15 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, doc/pcbfile.texi, doc/version.texi: Update from + ../src + +2007-01-15 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Keep canonicalizing lines until they're all + canonicalized. Don't delete vias that aren't tented (assume they're + test points). Add an option to just canonicalize lines. + +2007-01-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/mtspace.c, src/mtspace.h: More thurough via + site searching, cost function changes and some better handling of + certain search conditions. Much improved smoothing pass + implementation. Doesn't gratuitously pack traces at minimum + clearance during smoothing pass. Overall much better routing is + acheived. + + ---------------------------------------------------------------------- + +2007-01-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: From: Hans Nieuwenhuis * vzzbx AT xs4all dot nl + * Check for failed opens. + +2007-01-09 DJ Delorie * dj AT delorie dot com * + + * src/draw.c, src/hid/gerber/gerber.c: Don't draw plated holes on + outline gerber. + +2007-01-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/move.c: fix segfault when moving polygon to layer. Also user + r_search to find the pin/via thermals. + + ---------------------------------------------------------------------- + +2006-12-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: Cast away const-ness. + +2006-12-22 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c: don't indicate line end-point if the line is + selected since move will move the whole selection. + + ---------------------------------------------------------------------- + +2006-12-22 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui.h, src/hid/lesstif/main.c, + src/search.h, src/todo: provide a cursor shape change when the arrow + mode crosshair is over a line end-point. + + ---------------------------------------------------------------------- + +2006-12-22 DJ Delorie * dj AT delorie dot com * + + * src/todo: Take "enums" off the lesstif list. + +2006-12-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: Add support for HID_Enum in attribute + dialogs. + +2006-12-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Increase default size of main window. + +2006-12-21 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: if the configure or build fails, then abort the + whole process. + +2006-12-21 Dan McMahill * dan AT mcmahill dot net * + + * win32/pcb.nsi.in: the link should be to pcb-bin.exe not pcb + +2006-12-21 DJ Delorie * dj AT delorie dot com * + + * src/todo: Remove completed projects, add some new ones. + +2006-12-18 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidnogui.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c: ... and return 0 for progress hooks. + +2006-12-18 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidnogui.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c: Fix progress prototypes. + +2006-12-17 DJ Delorie * dj AT delorie dot com * + + * src/hid.h, src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/hidnogui.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/hid/lpr/lpr.c, src/hid/png/png.c, + src/hid/ps/ps.c: Add progress() hook to HID structure. No actual + implementation yet. + +2006-12-17 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Add automatic busy cursor. Add (disabled) + debug code for arc thindraw. + +2006-12-17 DJ Delorie * dj AT delorie dot com * + + * lib/geda.inc: Add SDIP20. Fix comment. + +2006-12-15 DJ Delorie * dj AT delorie dot com * + + * src/parse_y.y: Allow attributes in old-style elements too. + +2006-12-14 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-output-events.c, src/hid/gtk/gui.h: Fix a bug in + GTK hid that causes the view port to scroll in a random direction on + a mouse click inside the view port (for example when drawing a + line). This bug only shows itself when an X application that steals window + focus is running together with PCB on the same X server. At least + GNOME and XFCE window managers are known to do that. See the following and related GNOME bugs for some discussion about + this: http://bugzilla.gnome.org/show_bug.cgi?id=102209 See also GTK documentation for GtkWidget and GdkEvent. Analysis and patch provided in patch [ 1610717 ] Patch for auto-pan + bug by Tomaz Solc. This should also address bug report [ 1593578 ] Display sometimes + auto-scrolls when drawing lines by Garth Webb. + +2006-12-14 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.in: regen + +2006-12-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon1.c: avoid duplicate removal of duplicate points + + ---------------------------------------------------------------------- + +2006-12-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/hid/gtk/gui-config.c: beginnings of support for isleArea as a + dialog changeable item + + ---------------------------------------------------------------------- + +2006-12-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: fix arc drawing on the flipped board + + ---------------------------------------------------------------------- + +2006-12-14 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: add missing lrealpath.h + +2006-12-14 Dan McMahill * dan AT mcmahill dot net * + + * src/dbus.c: change a libiberty.h include to lrealpath.h since + thats what we have now + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * src/buffer.c, src/mymem.c, src/undo.c: Avoid some null pointer + dereferences. Also make sure UndoList and RemoveList are + initialized at startup to avoid any strange behavior there. This + fixes a bug reported on geda-user where starting pcb with an empty + board and then doing 'load layout to buffer' and pasting and then + doing it again causes a segfault. Thanks to Peter Clifton for + pointing this out. + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * src/dbus-pcbmain.c, src/dbus-pcbmain.h, src/dbus.c, src/dbus.h: + indent new code -- no other changes + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, src/Makefile.in: regen + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * acinclude.m4: fix underquoting of libiberty_NEED_DECLARATION + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: when building dbus, compile in lrealpath.c + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * acinclude.m4, configure.ac: add configure checks needed for + lrealpath.c + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * src/lrealpath.c: remove ansidecls.h + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * src/lrealpath.c, src/lrealpath.h: add a header with the lrealpath + prototype and point to that instead of libiberty.h + +2006-12-13 Dan McMahill * dan AT mcmahill dot net * + + * src/lrealpath.c: Add lrealpath.c from gcc's libiberty. For now + lets just add this one libiberty function. This is the unmodified + version from gcc current as of 2006-12-12. Last modified on + 2005-05-24. + +2006-12-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/misc.c: scan all layers for match because buffers don't always + have LayerN set properly + + ---------------------------------------------------------------------- + +2006-12-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: break loops when exploring new paths, plus some + other enhancements. + + ---------------------------------------------------------------------- + +2006-12-07 Dan McMahill * dan AT mcmahill dot net * + + * src/dbus.c: put back the unused variable but protect it with + #ifdef DEBUG. From Peter Clifton + +2006-12-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: fix broken dereference from last commit + +2006-12-07 Dan McMahill * dan AT mcmahill dot net * + + * src/dbus.c: remove an unused variable + +2006-12-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c: Don't try to + cast to a union. This practice does not work with all compilers. + Fixes compilation with sun compilers. + +2006-12-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: add --scale for postscript scaling. Patch from + Hans Nieuwenhuis on geda-user. + +2006-12-07 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, config.h.in, configure, + configure.ac, doc/Makefile.in, doc/pcbfile.texi, + example/Makefile.in, example/libraries/Makefile.in, + lib/Makefile.in, newlib/2_pin_thru-hole_packages/Makefile.in, + newlib/Makefile.in, newlib/analog-devices/Makefile.in, + newlib/burr-brown/Makefile.in, newlib/connectors/Makefile.in, + newlib/crystal/Makefile.in, newlib/cypress/Makefile.in, + newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.am, + src/Makefile.in, src/dbus-pcbmain.c, src/dbus-pcbmain.h, + src/dbus.c, src/dbus.h, src/dbus.xml, src/hid.h, + src/hid/common/extents.c, src/hid/common/hidnogui.c, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/main.c, + src/icons/Makefile.in, src/main.c, src/script/Makefile.in, + tools/Makefile.in, tutorial/Makefile.in, win32/Makefile.in: Initial + checkin of Peter Cliftons DBus work. Currently dbus is disabled by + default but can be enabled with --enable-dbus + +2006-12-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: Intercept window manager delete + events. This prevents data loss when the window manager closes or + deletes a window. Reported as [ 1458340 ] data loss with closing + main PCB windows and also on geda-dev by Peter Clifton. + +2006-12-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-library-window.c, src/hid/gtk/gui-log-window.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-pinout-window.c: + Stop preventing the library, log, netlist, and pinout windows from + accepting focus. Preventing them from accepting focus had the side + effect of breaking those dialogs on some systems with certain window + managers. + +2006-12-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: allow searching across expansion boxes in each + direction which can find lower cost routes. + + ---------------------------------------------------------------------- + +2006-12-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: Various changes to improve the ability to find + routes and make better looking, more efficient routes. + +2006-12-03 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/misc.c, src/polygon.c: use Data->LayerN instead of max_layer + where Data may not be PCB->Data + + ---------------------------------------------------------------------- + +2006-12-02 DJ Delorie * dj AT delorie dot com * + + * src/move.c: Handle edge conditions when adding/removing layers wrt + thermals. + +2006-12-02 DJ Delorie * dj AT delorie dot com * + + * src/move.c: Move thermals when we move layers. + +2006-12-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Move layer ID text outside of the "board" area. + Print board name, layer name, and mirror flag in lower left near + margin. When both mirror and auto-mirror are checked, xor them. + +2006-12-01 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lpr/lpr.c, src/hid/ps/ps.c, src/hid/ps/ps.h: make sure the + postscript header line makes it in the lpr HID. Should fix problems + where the postscript text was being printed instead of executed. + +2006-11-16 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c, src/polygon.h, src/thermal.c: make clearances + around rectangular pins and pads have rounded rectangle features + + ---------------------------------------------------------------------- + +2006-11-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: remove dead code accidentally left behind + + ---------------------------------------------------------------------- + +2006-11-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c, src/polygon.c, src/polygon.h: always draw with dicing + so that polygons can reside in holes of other polygons + + ---------------------------------------------------------------------- + +2006-11-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui.h: Make the invalidate + rectangle only include the drawn region. This vastly speeds up + drawing when zoomed in on a complex deisgn. + + ---------------------------------------------------------------------- + +2006-11-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c: Warn if non-manhattan lines are trying to become + pads. + +2006-11-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: preven silk clipping copper polygons and copper + clipping silk polygons + +2006-11-11 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_y.y: minor fix to the FileVersion documentation + +2006-11-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: add us and international business card media + +2006-11-10 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c, src/file.h, src/parse_l.l, src/parse_y.y: Add code to + the parser which looks for a line like FileVersion[20061101] at the top of the .pcb file. If this line is seen and indicates a + version which is too new for this version of pcb then issue a + complaint and explain why. This should help out when the file + format changes and someone tries to load a new design with an older + version of pcb. Of course the real benefit won't happen until + versions of pcb prior to this check all go away... For now, the actual output file from pcb hasn't changed. There is a + two line change to include the FileVersion[] line that can be + included the next time the file format is changed. However, there + is no reason to not have the program start watching for it. + +2006-11-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c, src/undo.c: fix some segfaults due to clearing pcb + pointer in data structure. + +2006-11-09 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: Add several more media types and for the existing + metric ones, recompute the bounding box size since pcb has more + internal resolution that the old values. + +2006-11-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/remove.c: prevent segfault when removing polyogn points + resulting in fewer than 3 points in the poly + + ---------------------------------------------------------------------- + +2006-11-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c, src/polygon1.c: fix some bugs for unusual clipping + conditions. Specifically holes touching at one point (or edge) as an + acceptable self-intersection and snap-rounding expanding the + bounding box by 1. + + ---------------------------------------------------------------------- + +2006-11-05 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/pcbfile.texi: regen + +2006-11-05 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/change.c, src/change.h, src/const.h, + src/draw.c, src/find.c, src/strflags.c: Add a 'nopaste' flag for + pads. This lets you produce fiducial marks that should not have + solder paste. In addition you can use it for things like card edge + connectors where you may not want solder paste. Since this is + moderately dangerous (how do you make sure you don't set this flag + somewhere where you _need_ solder paste), the drc check reports a + count of how many times this flag is used. + +2006-11-04 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/intersect.c: fix crash due to not checking for no overlaps. + Thanks to Anread Kemnade for the patch. + + ---------------------------------------------------------------------- + +2006-11-03 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: use *FILEVERSION* instead of *VERSION* for the + annotation file to help avoid possible confusion between file + version and program version. + +2006-10-29 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Report units in mm or mils as selected by user. + +2006-10-29 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/parse_y.y: fix polyarea ordering to correspond to file saving + + ---------------------------------------------------------------------- + +2006-10-25 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c: fix setsame layer changing + + ---------------------------------------------------------------------- + +2006-10-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: allow pins/vias with zero clearance to touch polygons + + ---------------------------------------------------------------------- + +2006-10-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon1.c: speed improvement by avoiding r_search call + overhead when there is no overlap + + ---------------------------------------------------------------------- + +2006-10-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/file.c, src/global.h, src/main.c, src/parse_l.l: support for + polygon island size in the pcb file + + ---------------------------------------------------------------------- + +2006-10-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/parse_y.y, src/polygon.c: Avoid use of 'max_layer' macro - it + assumes the Data is the loaded PCB which doesn't work during file + reading. + + ---------------------------------------------------------------------- + +2006-10-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c, src/thermal.c, src/thermal.h: use the saved thermal + scale when loading a design + + ---------------------------------------------------------------------- + +2006-10-20 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/hidinit.c, src/hid/gerber/gerber.c: Cast the char's + which are being fed to isspace() and friends to ints which is what + they want. + +2006-10-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: check the coming regions, not the one we're at over + and over + + ---------------------------------------------------------------------- + +2006-10-20 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-misc.c, src/hid/gtk/gui-output-events.c: add a + couple of casts and kill the rest of the remaining gcc and SunPRO + warnings! + +2006-10-19 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/dialogs.c, src/hid/lesstif/menu.c, + src/hid/lesstif/styles.c: cast to a size_t before converting + callback data between ints and pointers + +2006-10-19 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-icons-misc.data, src/hid/gtk/gui-top-window.c: + remove some SunPRO compiler complaints about initilizers being out + of range + +2006-10-19 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/hidinit.c: catch HID_Mixed in a switch + +2006-10-19 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/bom/bom.c, src/hid/gerber/gerber.c, src/print.c: avoid gcc + warnings when using %c with strftime + +2006-10-19 Dan McMahill * dan AT mcmahill dot net * + + * src/polygon1.c: #ifdef DEBUG out a couple of things which are + defined but not used unless DEBUG is defined + +2006-10-19 Dan McMahill * dan AT mcmahill dot net * + + * src/draw.c: cast to a size_t before an int when passing an int to + a callback function. + +2006-10-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: even faster tree searching and insertion + + ---------------------------------------------------------------------- + +2006-10-19 Dan McMahill * dan AT mcmahill dot net * + + * src/polygon1.c: modify the DEBUGP macro slightly so it can be + legally called with only one argument like DEBUGP("\n"); + +2006-10-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon1.c: oops, don't manage the contour bounding boxes in + the tree + + ---------------------------------------------------------------------- + +2006-10-18 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: {T,}QFN16_3{,_EP} needs to use PKG_QFN_50S not + PKG_QFN_50. Noted by Matthias Wenzel. + +2006-10-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon1.c: speed up hole insertion further. Trees everywhere! + + ---------------------------------------------------------------------- + +2006-10-18 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: Only apply the -rdynamic check if we're + using gcc. This probably isn't the correct long term fix but for + now it lets users with SunPRO build again. The problem is -rdynamic + with SunPRO's cc doesn't have the same behaviour as with gcc but it + returns 0 so configure thinks it is ok to add -rdynamic. + +2006-10-17 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: Use the media option to set the page size and + margins. Selecting different paper size should work now. + +2006-10-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/create.c, src/polyarea.h, src/polygon.c, src/polygon1.c, + src/rtree.c: bug fixes for hole insertion and fast point inside + polygon checking + + ---------------------------------------------------------------------- + +2006-10-17 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac: check for dlopen in -ldl. + Needed on solaris 9 + +2006-10-17 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: be verbose about the rdynamic test + +2006-10-16 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: add some 16 pin 3x3 mm QFN packages + +2006-10-15 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: If we're converting a buffer to an element and the + buffer has no associated PCB; assign the current one so we have *a* + group table to use. + +2006-10-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-top-window.c, src/hid/lesstif/menu.c: Keep + ElemenOn and *SILK->On in sync. + +2006-10-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: handle polygon clearance for unplated holes + + ---------------------------------------------------------------------- + +2006-10-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: fix rat<->polygon connection test + + ---------------------------------------------------------------------- + +2006-10-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c, src/polygon.c: fix undo handling for all change + operations that affect polygon clip + + ---------------------------------------------------------------------- + +2006-10-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: fix rat to polygon connection test + + ---------------------------------------------------------------------- + +2006-10-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: fix the sense of set/clear for line join + + ---------------------------------------------------------------------- + +2006-10-12 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/macro.h: Fix GROUP_LOOP macro + +2006-10-12 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/create.c, src/global.h, src/heap.h, src/polygon.c, + src/polygon1.c: fix GROUP_LOOP macro, optimize hole insertion and + fix some small bugs + + ---------------------------------------------------------------------- + +2006-10-12 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c: Morph selections + + ---------------------------------------------------------------------- + +2006-10-11 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/dialogs.c, src/hid/lesstif/menu.c: fix a few + pointer bugs. + +2006-10-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/dialogs.c: remove some unused variables + +2006-10-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/menu.c: - include resource.h before lesstif.h to make sure we get a + prototype for lesstif_note_mouse_resource(). - remove some unused variables. + +2006-10-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c: remove some unused variables and add a + missing return value + +2006-10-10 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/lesstif.h: - Be consistent with underscores in __RESOURCE_INCLUDED__. Now this + file matches what resource.h has! - Add a couple of missing prototypes. + +2006-10-10 Dan McMahill * dan AT mcmahill dot net * + + * src/resource.h: be consistent with underscores in + __RESOURCE_INCLUDED__ + +2006-10-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c, src/polyarea.h, src/polygon.c, src/polygon.h, + src/polygon1.c: fix polygon search bug introduced with + optimizations. fix a layer group bug in polygon clearing. speed up + gerber generation a little + + ---------------------------------------------------------------------- + +2006-10-09 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: regen + +2006-10-09 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: bump rev to 1.99u in light of the clipper + code going in + +2006-10-09 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/ideas/database.txt, doc/pcbfile.texi, + src/Makefile.am, src/Makefile.in, src/action.c, src/autoplace.c, + src/autoroute.c, src/buffer.c, src/buffer.h, src/change.c, + src/change.h, src/command.c, src/compat.c, src/const.h, src/copy.c, + src/copy.h, src/create.c, src/crosshair.c, src/dev_ps.c, + src/dev_ps.h, src/dev_rs274x.c, src/dev_rs274x.h, src/djopt.c, + src/draw.c, src/drill.c, src/file.c, src/find.c, src/fontmode.c, + src/global.h, src/hid.h, src/hid/batch/batch.c, src/hid/bom/bom.c, + src/hid/common/extents.c, src/hid/common/hidnogui.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-pinout-window.c, src/hid/lesstif/main.c, + src/hid/lpr/lpr.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c, src/insert.c, src/line.c, src/macro.h, src/main.c, + src/mirror.c, src/misc.c, src/misc.h, src/move.c, src/mtspace.c, + src/mymem.c, src/netlist.c, src/parse_y.y, src/polyarea.h, + src/polygon.c, src/polygon.h, src/polygon1.c, src/print.c, + src/puller.c, src/rats.c, src/remove.c, src/report.c, src/rotate.c, + src/rtree.c, src/rubberband.c, src/search.c, src/search.h, + src/select.c, src/strflags.c, src/thermal.c, src/thermal.h, + src/undo.c, src/undo.h, src/vendor.c: Merge clipper branch back to + the trunk. + +2006-10-08 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidinit.c: Add RTLD_GLOBAL. + +2006-10-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/hidinit.c: add missing header for Message() + prototype and remove an unused variable + +2006-10-07 Dan McMahill * dan AT mcmahill dot net * + + * src/hid.h: add missing hid_{load,save}_settings prototypes + +2006-10-06 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-dialog-print.c: Minor bug fix for exporter. + +2006-10-05 DJ Delorie * dj AT delorie dot com * + + * src/hid.h, src/hid/common/hidinit.c, + src/hid/gtk/gui-dialog-print.c, src/hid/lesstif/dialogs.c, + src/main.c: Add global "exporter" option. + +2006-10-02 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, src/action.c, src/hid.h, + src/hid/common/hidinit.c, src/main.c: Load settings from + ./pcb.settings and ~/.pcb/settings. Add :savesettings action. + +2006-10-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidinit.c: Remove debugging printf. + +2006-10-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/hidinit.c: Fix plugin init function logic. + +2006-10-02 DJ Delorie * dj AT delorie dot com * + + * configure, configure.ac, src/hid.h, src/hid/batch/batch.c, + src/hid/bom/bom.c, src/hid/common/extents.c, + src/hid/common/hidinit.c, src/hid/common/hidnogui.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/hid/lpr/lpr.c, src/hid/png/png.c, + src/hid/ps/eps.c, src/hid/ps/ps.c: Dynamically load plug-ins (hids, + actions, etc) at runtime. + +2006-10-01 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: extract the version from configure.ac instead of + hard coding it. + +2006-10-01 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Fix off-by-one error. + +2006-10-01 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac: Check for popen(). So far + nothing is done as a result of this. + +2006-10-01 Dan McMahill * dan AT mcmahill dot net * + + * win32/build_pcb: It should be "-mms-bitfields" instead of + "--mms-bitfields". Noted by Cesar Strauss. + +2006-09-30 DJ Delorie * dj AT delorie dot com * + + * configure, configure.ac: Add -rdynamic when it's available. + +2006-09-30 DJ Delorie * dj AT delorie dot com * + + * src/todo: I did the one about separate ps files. + +2006-09-29 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, win32/build_pcb: Move the gcc flags that + cause builds under cygwin to produce non-cygwin binaries out of the + configure script and into the script which is used to build a + non-cygwin binary under cygwin. The end result should be the same for users who use + ./win32/build_pcb but users who wish to compile a cygwin binary + should be able to now. Adapated from patch #1567401 "Re-enabling the Cygwin port" by Cesar + Strauss. + +2006-09-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/extract-docs: make this script more robust with respect to the + formatting of the help and syntax strings. In particular, variable + whitespace is now allowed in the "static const char" declaration and + the string may not begin on the same line as the declaration. This + allows the source code to run through indent(1) and still have the + docs extracted properly. + +2006-09-26 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: We don't directly need X stuff anymore + unless we're using the lesstif HID so don't look for X except in + that case. This avoids some issues seen on some systems which have + older libraries in /usr/X11R6/lib (like freetype or fontconfig). + +2006-09-25 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/dialogs.c: use the unified "about" string. + +2006-09-25 Dan McMahill * dan AT mcmahill dot net * + + * src/mymem.c, src/mymem.h: const-ify DSAddString + +2006-09-25 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-dialog.c, src/misc.c, src/misc.h: Improve the gtk + "about" dialog box output to explicitly list the HID's which have + been compiled in. As part of this, pull out the code which + generates the text of the dialog box into its own function so that + it can be used by other HID's. + +2006-09-25 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: A layer group that only contains a layer named + "outline" or "route" will not have pins, pads, or vias drawn. + +2006-09-25 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/flags.c: A layer group containing only an "outline" + or "route" layer will be named "outline" when exported. + +2006-09-25 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Add a --verbose option to list gerber + files as they're printed. + +2006-09-24 Dan McMahill * dan AT mcmahill dot net * + + * src/rats.c: When optimizing rats, if there are > 0 of them, + display a message indicating how many. This way when the layout is + not complete you see how far you have to go and also you see that + the operation has done something. + +2006-09-24 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: If Settings.RatThickness is less than 20, it's a pixel + size, not a pcb size. + +2006-09-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Display remaining rats in status bar. + +2006-09-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c, + src/search.h: Note pixel slop in gtk hid. Increase slop to 10 + pixels. + +2006-09-22 Dan McMahill * dan AT mcmahill dot net * + + * src/fontmode.c: add missing return value + +2006-09-22 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c, src/file.c: remove some unused variables + +2006-09-22 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: Fix bug in poly point sorting for element + conversion. + +2006-09-22 DJ Delorie * dj AT delorie dot com * + + * src/buffer.c: Allow rectangular polygons when converting a buffer + to an element. + +2006-09-21 DJ Delorie * dj AT delorie dot com * + + * src/drill.c, src/mymem.c: Avoid attempts to realloc to zero bytes. + +2006-09-21 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Fix undo for MinMaskGap() + +2006-09-21 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, src/action.c: Add MinMaskGap() action. + +2006-09-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Add multi-file output option. + +2006-09-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/flags.c, src/hid/gerber/gerber.c, src/hid/hidint.h: + Break out layer->filename code. Fix bug in top/bottom detection. + +2006-09-14 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gerber/gerber.c: If the output file(s) can't be opened for + writing then spit out an error message instead of segfaulting. The + segfaults were noted in bug [ 1556894 ] "segfault when exporting to + non-existing directory" reported by Stephan Boettcher. + +2006-09-13 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Draw the elements' marks. + +2006-09-13 Dan McMahill * dan AT mcmahill dot net * + + * lib/amp.inc, lib/amphenol.inc, lib/bga.inc, lib/bourns.inc, + lib/connector.inc, lib/dil.inc, lib/gtag.m4, lib/johnstech.inc, + lib/lsi.m4, lib/misc.inc, lib/pci.inc, lib/plcc.inc, lib/qfn.inc, + lib/qfp.inc, lib/qfp2.inc, lib/qfpdj.inc, lib/resistor_adjust.inc, + lib/to.inc, lib/zif.inc: quote the refdes parameter (name on board + parameter) on the PKG_* macros. This prevents problems when a + refdes matches the name of a macro and m4 expands it. Patch + provided by Peter Clifton. + +2006-09-13 Dan McMahill * dan AT mcmahill dot net * + + * lib/to.inc: remove a ' in an output comment line which threw off a + closing ) that broke the TO3_90 element. + +2006-09-13 DJ Delorie * dj AT delorie dot com * + + * src/hid/common/actions.c: * pcjc2 AT cam dot ac dot uk * Patch to + fix bug #1553558, Stack corruption PCB bug in hid_parse_actions + +2006-09-04 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, lib/Makefile.am, lib/Makefile.in, + lib/m4lib_to_newlib.sh.in: Go ahead and let configure process the + m4lib_to_newlib script. Also remove a couple of hardcoded paths in + the same script. + +2006-09-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/to.inc: Fix up the pads and drill sizes on the TO* packages. + Based on patch [ 1108881 ] "Fix to m4 library hole sizes" by Walter + Fetter Lages. I added comments containing the actual dimensions + from the JEDEC drawings and comments about how the pad size and + drill size were selected. Based on the JEDEC drawings I adjusted + some of the drill and pad sizes. I did not change or examine pin + locations, numbering, or silk. + +2006-09-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/misc.inc: improve the drill sizes for several footprints. + Changes provided by patch [ 1108881 ] "Fix to m4 library hole sizes" + by Walter Fetter Lages. + +2006-09-02 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/hidinit.c: ensure that derive_default_filename() + always comes back with a valid string even when we don't have a name + for the pcbfile. This fixes bug [ 1548756 ] "Segfault when + exporting png files" reported by Werner Hoch. + +2006-09-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/connector.inc: increase PKG_CONNECTOR and PKG_CONNECTOR_DIL + hole size to something more reasonable. + +2006-09-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: - remove the BRE* footprints. The required PKG_RECTANGULAR macro + doesn't exist anywhere and I can't figure out what the correct + behaviour should be anyway so rather than propagate a very + questionable footprint name, kill it right here. - Fix the problem where the ACY*P and RCY*P packages called + non-existant macros. They now produce the same footprints as the + ACY* and RCY* packages but with a polarity marking. The suitability + for any particular part number should be still verified before using + them on a board. + +2006-09-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/misc.inc: expand the PKG_AXIAL_LAY and PKG_RADIAL_CAN macros + to take an extra optional argument. When set to 1, this optional + argument causes the part to have a "+" by pin 1 and "-" by pin 2. + This was done instead of implementing the missing + PKG_AXIAL_LAY_POLAR and PKG_RADIAL_CAN_POLAR macros. + +2006-09-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh.in: Rather than putting a huge list of + footprints into one index file, break it out by library. + +2006-09-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: remove unused PKG_DUMMY which did not do anything + anyway + +2006-09-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh.in: - put both the index.html file and the broken.html file in the + output directory. - run pcb-bin from the src build directory to avoid complaints about + not being able to find the font - use .fp as the file extension for footprints - fix up the .png output file names - fix up the links in the index file + +2006-09-01 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Shift-click replaces element on pcb with element in + buffer. + +2006-08-30 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, doc/pcbfile.texi, doc/version.texi: Regenerate + to add attributes + +2006-08-30 DJ Delorie * dj AT delorie dot com * + + * src/parse_y.y: Doc typo. + +2006-08-30 DJ Delorie * dj AT delorie dot com * + + * src/copy.c: Copy attributes when copying element data. + +2006-08-30 DJ Delorie * dj AT delorie dot com * + + * src/create.c, src/create.h, src/file.c, src/global.h, + src/parse_l.l, src/parse_y.y: Add arbitrary attributes to PCB and + Element types. Ignore optional flags on Layer types. + +2006-08-30 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Remove obsolete comment. + +2006-08-29 Dan McMahill * dan AT mcmahill dot net * + + * lib/m4lib_to_newlib.sh.in: add the start of a m4lib to newlib + conversion script + +2006-08-28 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, doc/Makefile.in, + example/Makefile.in, example/libraries/Makefile.in, + lib/Makefile.in, newlib/2_pin_thru-hole_packages/Makefile.in, + newlib/Makefile.in, newlib/analog-devices/Makefile.in, + newlib/burr-brown/Makefile.in, newlib/connectors/Makefile.in, + newlib/crystal/Makefile.in, newlib/cypress/Makefile.in, + newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in, win32/Makefile.in: regen after the lex/yacc + configure.ac change + +2006-08-27 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Constrain arc start angles to -180..180 + degrees. + +2006-08-24 DJ Delorie * dj AT delorie dot com * + + * src/netlist.c: Fix rats enable/disable code. + +2006-08-23 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: error out if yacc or lex could not be + found + +2006-08-23 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: bump rev after 20060822 branch + +2006-08-23 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: bump rev after 20060822 branch + +2006-08-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/eps.c: When printing as-shown, mirror the image if + we're viewing the solder side. + +2006-08-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/eps.c: Don't consider off layers for fast mask. Don't + print paste. + +2006-08-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/eps.c: Don't print invisible silk. + +2006-08-22 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: add a note about how I test the distcheck target + for the lesstif HID + +2006-08-22 DJ Delorie * dj AT delorie dot com * + + * src/find.c: Special case: allow vias with exactly zero clearance. + +2006-08-22 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog, NEWS, README.snapshots: update for 20060822 snapshot + +2006-08-22 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: fill_rect needs the same point-ordering as + draw_rect + +2006-08-22 DJ Delorie * dj AT delorie dot com * + + * src/change.c: Allow via clearance to be reduced to zero. + +2006-08-22 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: If a pad/via's clearance is zero, don't attempt to + draw a zero-width clear. + +2006-08-21 DJ Delorie * dj AT delorie dot com * + + * src/main.c: Add default colors for layers 9..16 + +2006-08-21 DJ Delorie * dj AT delorie dot com * + + * src/file.c: post-initialize PCBs loaded from files. + +2006-08-21 DJ Delorie * dj AT delorie dot com * + + * src/pcb-menu.res: Let right-mouse do "rotate" for now. + +2006-08-21 DJ Delorie * dj AT delorie dot com * + + * src/search.c, src/todo: Don't let search find backsilk if + invisible objects are off. + +2006-08-21 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Draw via annulii on assembly drawings. + +2006-08-18 Dan McMahill * dan AT mcmahill dot net * + + * configure, doc/actions.texi, doc/pcbfile.texi: regen + +2006-08-18 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/global.h, src/undo.c, src/undo.h: add a + Renumber() action which renumbers reference designators and outputs + a "was/is" sort of file which can be used for back annotation if + someone writes a utility to apply those changes to a schematic. For now Renumber() is still considered somewhat experimental and + hence is not hooked up to the menus yet. + +2006-08-15 DJ Delorie * dj AT delorie dot com * + + * configure, configure.ac: Add X_CFLAGS to CFLAGS so that Xm/Xm.h + can be found. + +2006-08-15 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/ps.c: add header for a missing prototype + +2006-08-15 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: Apply patch from patch [ 1496742 ] Make 'a' key + (SetSame) work again submitted by Wim Lewis. + +2006-08-14 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: when pkg-config fails to find the desired + version of gtk or glib, then print the pkg-config output as part of + the error message. Suggested in bug # 1507555 by Mark Whitis. + +2006-08-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: use 0.01 mm instead of 0.05 mm for the roundoff for + 01005 footprints because they are so small. This bumps the gap + between pads just over 6 mils instead of just under 6 mils. + +2006-08-11 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lpr/lpr.c: Fix bug [ 1534098 ] Segmentation fault in GTK + print dialog reported by Mark Rages. Symptom was changing the lpr + command in the gtk dialog box gave an instant crash. + +2006-08-10 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: add hid/batch/batch_lists.h to + DISTCLEANFILES + +2006-08-10 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: Add 01005 footprints. + +2006-08-04 Dan McMahill * dan AT mcmahill dot net * + + * src/copy.c: Remove extra calls to Draw(). This greatly speeds up + copy operations. This is especially true when pasting large blocks + of layout. Patch supplied by Tibor Palinkas as patch #1532922. + +2006-08-03 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Makefile.in, src/fontmode.c: Add font editing + mode (FontEdit() and FontSave()) + +2006-08-03 DJ Delorie * dj AT delorie dot com * + + * src/file.c: Use the old style (mil) syntax when saving font info, + if the values permit it, for readability and to save file space. + +2006-08-03 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Allow New() to take a name, so that the user need + not be prompted during scripts and such. + +2006-08-03 DJ Delorie * dj AT delorie dot com * + + * src/move.c: When deleting a layer, make sure to zero out the + now-unused slot at the end. + +2006-08-02 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: After running PATH_XTRA and checking for + various X libs (Xpm, etc), we need to use $X_LIBS as part of LIBS in + subsequent library tests or we'll have a failure. This should + address some issues noted recently on one of the gEDA lists and + configuring with lesstif and the png HID's. + +2006-08-02 DJ Delorie * dj AT delorie dot com * + + * src/Pcb.ad.in, src/Pcb.ad.raw, src/Pcb.ad.small, src/action.c, + src/autoroute.c, src/buffer.c, src/create.c, src/crosshair.c, + src/data.c, src/dev_rs274x.c, src/djopt.c, src/draw.c, src/error.c, + src/file.c, src/find.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/line.c, src/misc.c, src/mtspace.h, + src/mymem.c, src/netlist.c, src/output.c, src/parse_l.l, + src/parse_y.y, src/polygon.c, src/puller.c, src/rats.c, + src/rtree.c, src/rubberband.c, src/search.c, src/select.c, + src/undo.c: spelling fixes from Larry. + +2006-08-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c, src/print.c, src/print.h: When the drill list + fits "naturally", no offset is added, which makes me happy. When + the drill list would otherwise fall off the left edge of the paper, + just enough offset is added to keep that from happening. + +2006-08-02 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/netlist.c: Allow extended selections. + +2006-08-01 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs: - Note that automake-1.7 and older are too old. - Add a pointer to the README.snapshot document + +2006-07-26 DJ Delorie * dj AT delorie dot com * + + * src/file.c: Enable loaded netlists by default. + +2006-07-26 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/lesstif.h, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/pcb-menu.res: Add the ability to + user-configure mouse actions. + +2006-07-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/lesstif.h, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c: Add support for multi-key hotkeys, via + abc syntax for a/b/c sequence. + +2006-07-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/dialogs.c: use "top" and "bottom" to describe the + side flags, instead of using "solder" and "component", which are + common layer names. + +2006-07-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/mtspace.c, src/rtree.c: Various improvements + to speed up auto-routing. Mainly optimizing the r-tree searching + even more. + + ---------------------------------------------------------------------- + +2006-07-14 DJ Delorie * dj AT delorie dot com * + + * src/crosshair.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c: Fix draw_rect vs board flipping bug. + +2006-07-14 DJ Delorie * dj AT delorie dot com * + + * src/autoplace.c, src/djopt.c, src/main.c, src/move.c, src/mymem.c: + Minor patches from Larry. + +2006-07-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/rats.c: fix some autorouter bugs and improve + ability to round around non-manhattan lines + + ---------------------------------------------------------------------- + +2006-07-10 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: remove circular dependency which + breaks non-GNU make programs. + +2006-07-08 Dan McMahill * dan AT mcmahill dot net * + + * INSTALL: summarize the dependencies for building pcb + +2006-07-08 Dan McMahill * dan AT mcmahill dot net * + + * INSTALL: fix a typo + +2006-07-08 Dan McMahill * dan AT mcmahill dot net * + + * README: remove some redundant and out of date notes + +2006-07-07 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Fix minor rounding bug in c_dtostr(). + +2006-07-07 DJ Delorie * dj AT delorie dot com * + + * src/misc.c: Fix layer group parsing code. Avoid trailing colon in + group string. + +2006-07-04 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/bom/bom.c, src/hid/common/hidinit.c, + src/hid/gerber/gerber.c, src/hid/gtk/gui-top-window.c, + src/hid/hidint.h, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: Apply a patch from Larry Doolittle. Refactors filename handling code common to the file export HIDs + (bom, gerber, png, eps, ps). The png code had one feature (last_made_filename) that was missing + in the others. This refactoring brings all the HIDs to feature + parity, which lets pcb -x bom --bomfile=foo.txt bar.pcb work as expected. The old code ignores the command line flag, and + writes the bom to bar.bom. Likewise for .xy, .gbr, .eps, and .ps + files. Also fixes a couple of spelling errors. + +2006-07-04 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/pcbfile.texi, src/Makefile.in, + src/action.c, src/create.c, src/dev_rs274x.c, src/drill.c, + src/file.c, src/find.c, src/mymem.c, src/mymem.h, src/parse_l.l, + src/rats.c, src/remove.c, src/undo.c: Apply a patch from Larry + Doolittle that switches from the MyFree() function to the new + MYFREE() macro to avoid strict aliasing violations. + +2006-06-26 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Don't delete vias with thermals. Try to split + diagonal lines at pins and vias. + +2006-06-25 DJ Delorie * dj AT delorie dot com * + + * src/todo: MoveLayers cleanup tasks - thermals, pips, undo + +2006-06-22 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs: add a comment about needing the png HID for building + docs from cvs + +2006-06-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Account for board flipping when zooming. + +2006-06-11 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Remove obsolete ActionSwapSides() + +2006-06-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c, src/pcb-menu.res: Merge lesstif's Flip() + action into SwapSides to avoid conflict with core Flip(). + +2006-06-11 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Print actions called when verbose. + +2006-06-10 DJ Delorie * dj AT delorie dot com * + + * globalconst.h, src/action.c, src/autoplace.c, src/autoroute.c, + src/buffer.c, src/copy.c, src/create.c, src/create.h, + src/crosshair.c, src/data.h, src/djopt.c, src/draw.c, src/file.c, + src/find.c, src/global.h, src/hid/common/extents.c, + src/hid/common/flags.c, src/hid/gerber/gerber.c, + src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-config.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h, + src/hid/lesstif/dialogs.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c, src/line.c, src/macro.h, src/main.c, src/misc.c, + src/misc.h, src/move.c, src/move.h, src/parse_y.y, + src/pcb-menu.res, src/polygon.c, src/print.c, src/rats.c, + src/rtree.c, src/rubberband.c, src/search.c, src/undo.c, src/undo.h: + flexible max_layers + +2006-06-09 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Compensate for board flipping in the + panning code. + +2006-06-06 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Fix rounding bug when collecting drill + sizes. + +2006-06-03 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Fix logic a bit, don't try to move pins. + +2006-06-03 DJ Delorie * dj AT delorie dot com * + + * src/pcb-menu.res: Syntax fix for DisperseElements() + +2006-05-29 DJ Delorie * dj AT delorie dot com * + + * src/todo: Remove lesstif board flipping item. + +2006-05-29 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c, src/pcb-menu.res: Add Flip action, both + vertical and horizontal. + +2006-05-29 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Adjust endpoints of lines that don't quite reach + adjoining lines. + +2006-05-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c, src/report.c: Report on locked objects if + there are no unlocked objects under the cursor. Save the cursor + position even if we don't initially need it, in case we call an + action that does. + +2006-05-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Reset layer value cache before we + shortcut for counting apertures. + +2006-05-20 DJ Delorie * dj AT delorie dot com * + + * src/draw.c, src/hid.h, src/hid/common/extents.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/lesstif/main.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c: Split plated and unplated drills in gerber output. + +2006-05-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Name internal gerber layers sanely. + +2006-05-20 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c: Change gerber names to be compatible with + pre-hid. + +2006-05-20 DJ Delorie * dj AT delorie dot com * + + * src/const.h, src/search.c: Ignore locked objects unless + LOCKED_TYPE is passed (lock tool). + +2006-05-16 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: add the batch HID to the list of gui HIDs + in the help output + +2006-05-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/gtk/gui-top-window.c: Fig typo in ChangeDrillSize menu. + +2006-05-15 DJ Delorie * dj AT delorie dot com * + + * src/hid/batch/batch.c: Fix test for interactiveness. + +2006-05-15 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Makefile.in, src/hid/batch/batch.c, + src/hid/batch/hid.conf: Add batch-mode HID. + +2006-05-14 DJ Delorie * dj AT delorie dot com * + + * src/crosshair.c: Fix drawing of box around text items in buffer. + +2006-05-14 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Add support for drawing/exporting paste layers. + +2006-05-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/version.texi, src/action.c: add Message() + action + +2006-04-30 Dan McMahill * dan AT mcmahill dot net * + + * src/buffer.c: fix a bug where mirroring a buffer with only traces + triggered the "can't mirror a buffer with text" if there was text + anywhere in the layout. Patch provided as part of bug #1467446. + +2006-04-29 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui-top-window.c: Update status line after menu Save + layout and Save layout as. Change file select response button from "Open" to "Ok". Don't try to Save layout when user hits Cancel and file name is + NULL. + +2006-04-29 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-utils.c: Couple + of small typo bugs: a missing "break" and needed -1 arg to size + request. + +2006-04-28 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: prevent segfaults when trying to undo in the middle + of drawing ratlines. Problem noted by Daniel Wisehart, fixed by me. + +2006-04-28 DJ Delorie * dj AT delorie dot com * + + * src/file.c, src/misc.c, src/misc.h, src/parse_l.l: Use + locale-independent strtod and dtostr functions. + +2006-04-27 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in: regen + +2006-04-27 Dan McMahill * dan AT mcmahill dot net * + + * INSTALL: minor updates, mention gd-2.0.23 as having been used + +2006-04-27 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: if gdlib-config is not found, try and + just check for -lgd on the off chance that it works. The user in + this case may have to add things like -lpng to their LDFLAGS + variable in the environment or just update to a newer version of + gdlib. gdlib-config has been around for at least a few years + anyway. + +2006-04-26 Dan McMahill * dan AT mcmahill dot net * + + * README_FILES/Makefile.in: remove obsolete README file + +2006-04-26 Dan McMahill * dan AT mcmahill dot net * + + * INSTALL: bring the install docs up to date + +2006-04-26 Dan McMahill * dan AT mcmahill dot net * + + * README-GTK_PORT, README_FILES/INSTALL, README_FILES/Makefile.am, + README_FILES/Makefile.in: remove obsolete README file + +2006-04-25 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: complain if the png HID has been + requested but all formats disabled + +2006-04-24 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: do not crash if the input pipe + terminates when using --listen + +2006-04-24 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c: remove a debugging printf + +2006-04-24 DJ Delorie * dj AT delorie dot com * + + * src/global.h: Comment tweak. + +2006-04-24 DJ Delorie * dj AT delorie dot com * + + * src/global.h: Define on-board objects in terms of base types. + +2006-04-23 Dan McMahill * dan AT mcmahill dot net * + + * src/buffer.c: when smashing the pastebuffer, don't set the pure + hole flag on the vias unless is was set on the original pin. + Reported by Levente Kovacs on geda-user. + +2006-04-23 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: update newlib creation section for the latest GTK + HID. Addresses bug 1473640. + +2006-04-22 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: add 20060422 release notes + +2006-04-22 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: update for 20060422 + +2006-04-22 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update for 20060422 snapshot + +2006-04-21 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-config.c: Comment out locale.h since the code + which needed that was also commented out. Fixes builds on solaris + with sunpro and the gtk HID. + +2006-04-21 Dan McMahill * dan AT mcmahill dot net * + + * src/macro.h: protect some GNU C specific stuff with #ifdef + __GNUC__ + +2006-04-21 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-utils.c: change from NONE_PRESSED to + NO_BUTTON_PRESSED since the former is not part of the ButtonState + enum while the latter is. + +2006-04-21 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c: comment out with #if 0 the code related to + lesstif_options and lesstif_resources since those were both empty. + With this change pcb should build correctly on 64-bit Irix-6.5 with + version 7.41 of the MIPSpro compilers. There are still a handful of + compiler warnings to investigate. + +2006-04-20 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, src/hid.h, src/hid/common/actions.c, + src/hid/lesstif/dialogs.c, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/netlist.c, src/hid/lesstif/styles.c: Document + lesstif hid actions. + +2006-04-20 Dan McMahill * dan AT mcmahill dot net * + + * src/box.h, src/find.c: rely on the autoconf test for inline + instead of using our own based on __GNUC__. This will let other + non-gcc C99 compilers take advantage of inline. + +2006-04-19 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac, doc/actions.texi, + doc/version.texi, src/Makefile.am, src/Makefile.in, src/djopt.c, + src/draw.c, src/file.c, src/flags.c, src/hid/lesstif/dialogs.c, + src/hid/lesstif/library.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/lesstif/netlist.c, + src/hid/lesstif/styles.c, src/hid/lesstif/xincludes.h, src/misc.c, + src/parse_y.y, src/strflags.c, src/strflags.h: - add checks for sys/param.h and compiler understanding of 'inline'. - remove a handful of warnings which showed up with the sunpro + compiler. - move the X11 includes into a header where they can be included in + a way which keeps them from messing up the namespace of the rest of pcb. Fixes some obscure warnings from sunpro. + +2006-04-19 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: get this to properly link when --disable-gif is + used and the installed libgd does not have gif support. + +2006-04-19 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/ps.c: Add --psfade option. + +2006-04-18 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/command.c, src/data.c: Clean out Gtk HID related FIXMEs + +2006-04-18 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/draw.c: Clean out Gtk HID related FIXMEs. Also old background + image code which is now done in the Gtk and Lesstif HIDs. + +2006-04-18 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/main.c, src/set.c: Clean out FIXMEs specific to the Gtk HID. + +2006-04-18 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/misc.c, src/misc.h: Remove Gtk HID specific + build_route_string() function. + +2006-04-18 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-dialog-size.c, + src/hid/gtk/gui-top-window.c: Fix route style "Save as default" bug. Update status line when new route style selected. + +2006-04-17 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, doc/extract-docs, doc/pcb.texi, + doc/pcbfile.texi, doc/version.texi, src/const.h, src/hid.h, + src/hid/common/actions.c, src/hid/lesstif/main.c, src/parse_y.y: + Remove all the prev-next-up links, reformat all the texi files to + allow for automatic structure generation. Add helper hooks in the + extractor to let the source files control what types of nodes and + document structure is used for each category. Auto-create nodes and + document substructure for each key within each category. + +2006-04-17 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h: For the Gtk HID, add an + alternate vertical window layout mode to help on lower vertical + resolution displays. + +2006-04-17 DJ Delorie * dj AT delorie dot com * + + * src/netlist.c: Include sys/types.h so that regex compiles on more + hosts. + +2006-04-16 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-command-window.c, + src/hid/gtk/gui-keyref-window.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-netlist-window.c, + src/hid/gtk/gui-top-window.c, src/hid/gtk/gui.h: Fix soldermask draw + while TAB view from solder side. Don't raise windows if already shown so library & netlist window + won't grab focus. Focus can still be grabbed if an already shown + window is reshown via the top menu bar. Not sure yet how to handle + this case. + +2006-04-16 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: switch the output scaling to default to 100 dpi + instead of fixing the max dimension at 800 pixels. This at makes + the default be a sort of to scale (for 100 dpi monitors it will be + to scale) image. + +2006-04-15 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, src/report.c: Document actions in report.c. + +2006-04-15 DJ Delorie * dj AT delorie dot com * + + * doc/Makefile.am, doc/Makefile.in, doc/actions.texi, + doc/puller.pcb, doc/version.texi, src/puller.c: Document the puller + action. + +2006-04-15 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-output-events.c: Make ghid_get_coords() x value + account for side viewed (when using TAB). + +2006-04-14 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui.h: Support --bg-image in the Gtk HID. Images can be + jpg, png, gif, etc. as supported by the Gdk installation. Zooming gets slow at higher zoom levels, but I can address that + later when I have more time. + +2006-04-14 DJ Delorie * dj AT delorie dot com * + + * src/global.h: Make sure the Message and return are in the same + scope. + +2006-04-14 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: make sure we set the default icon + _before_ any windows are created + +2006-04-14 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: bump rev after 20060414 branch + +2006-04-14 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: 20060414 release notes + +2006-04-14 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update for 20060414 snapshot + +2006-04-14 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: update the instructions a bit + +2006-04-14 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi: regen + +2006-04-14 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, Makefile.in: fix a distcheck problem + +2006-04-14 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Add --bg-image option to lesstif hid to + load a background image. + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: on win32, figure out the path to the + installed package so we can set the newlib directory. + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: add missing return value + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/compat.c: add a (lame) random() replacement + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/autoplace.c, src/strflags.c: add compat.h header for missing + system functions + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, Makefile.in, README.win32: add a win32 README file + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: add a dependency on the icon + resource object if this is win32 + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * win32/Makefile.in: add missing file + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * : add generated icon file + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, Makefile.in: add win32 to SUBDIRS + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * win32/Makefile.am, win32/Xdefaults.tgif: add a tgif Xdefaults file + needed for generating the correct XPM version + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * win32/pcb_icon_big.obj, win32/pcb_icon_med.obj, + win32/pcb_icon_sml.obj: replace wcalc icons with placeholder pcb + icons + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, configure, configure.ac, + doc/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.am, + src/Makefile.in, src/icons/Makefile.in, src/script/Makefile.in, + tools/Makefile.in, tutorial/Makefile.in: check for a few tools used + to regenerate windows icons + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/error.c, src/file.c, src/find.c, src/main.c, src/misc.c, + win32/build_pcb: add a few more checks to let this build under + cygwin/mingw + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac: check for getcwd() + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/pcb.rc: add windres file for win32 icons + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac: one more header check + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * config.guess, config.sub: add some new configure related files + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: add stuff to compile in icons + for win32 + +2006-04-13 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, config.h.in, configure, + configure.ac, doc/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/compat.c, src/compat.h, src/file.c, src/hid/gerber/gerber.c, + src/icons/Makefile.in, src/misc.c, src/print.c, + src/script/Makefile.in, tools/Makefile.in, tutorial/Makefile.in: Add + a couple more configure checks for functions (gethostname and + password related functions) and headers which may not be present on + win32. This should be enough to get things to compile under cygwin + although there are still runtime issues. + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * win32/Makefile.am, win32/Readme.txt, win32/build_pcb, + win32/pcb.nsi.in, win32/pcb_icon_big.obj, win32/pcb_icon_med.obj, + win32/pcb_icon_sml.obj: Add some stuff to help build under win32. + Note: win32 support is not finished and PCB does not yet work + correctly under win32, but this is some progress. + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * src/error.c, src/error.h, src/hid.h, src/hid/common/hidnogui.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui.h, + src/hid/lesstif/dialogs.c, src/hid/lesstif/main.c: const-ify the log + message functions + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: add the About action + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/global.h, src/vendor.c: use AFAIL() when an + action fails due to a syntax error + +2006-04-12 DJ Delorie * dj AT delorie dot com * + + * src/hid/ps/eps.c: Determine when we need to use the complex erase + logic, and when we can just paint white. Painting white is a LOT + faster, and avoids rasterization in ps2pdf. + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: add thermals to glossary + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add thermal to the glossary + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/Makefile.in: increase resolution of PDFs of + drawings. 72dpi looked pretty bad on the thermal drawing + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/Makefile.in: add thermal drawing + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/thermal.pcb: change name of board + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/thermal.pcb: add a drawing showing what a thermal relief looks + like + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/database.txt, doc/ideas/database.txt, doc/ideas/keepouts.txt, + doc/keepouts.txt: move these to an ideas subdirectory to hopefully + more clearly indicate that not only are these not implemented yet + but that they are not even certain to ever be implemented. + +2006-04-12 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, doc/version.texi, src/netlist.c: Document + actions in netlist.c + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, src/action.c: add support for units and relative + coordinates in PasteBuffer(ToLayout) + +2006-04-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/database.txt, doc/keepouts.txt: add two documents in progress + describing a plan for future work + +2006-04-11 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, src/action.c, src/global.h: Add a "ToLayout" + option for the PasteBuffer() action. You can now do things like + PasteBuffer(ToLayout, 10000, 200000) to paste from the current + buffer Also add a DumpLibrary() action. + +2006-04-11 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, doc/extract-docs, src/action.c, src/command.c: + Document actions in command.c. + +2006-04-11 Dan McMahill * dan AT mcmahill dot net * + + * lib/crystal.list, lib/crystal.m4, lib/generic.list, + lib/generic.m4, lib/resistor_0.25W.list, lib/resistor_array.list, + lib/texas_inst_voltage_reg.m4, lib/transistor.m4: - add a missing description and move some footprints from the wrong + .list file to the correct .list file to be able to pick up the + descriptions and parameters from the corresponding .m4 file. - all of the m4 libs should at least be correct in the sense that + the pieces are all there and they all run through m4 correctly. + They have not been verified any more for correctness, but this is + progress. + +2006-04-11 DJ Delorie * dj AT delorie dot com * + + * src/print.c, src/report.c: Print correct symbol counts for drills + on fab drawing. + +2006-04-11 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in: regen (after checking for perl) + +2006-04-11 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/version.texi, src/action.c, src/select.c, + src/select.h: - for the Select(*ByName) action, allow a 2nd argument to specify + the name and only use the gui dialog box if the 2nd argument is not + specified. - Add *ByName options for the Unselect() action. + +2006-04-11 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: garbage collect some printf output + +2006-04-11 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: Fix bug [ 1462380 ] saving buffer + elemnts to file does nothing. + +2006-04-11 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, doc/Makefile.am, doc/Makefile.in: When + building docs, look for a perl to use. This will let the user set + PERL in their environment and have configure pick it up. + +2006-04-11 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: turn off debugging by default + + ---------------------------------------------------------------------- + +2006-04-11 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: fixed list overflow with element connection listing + + ---------------------------------------------------------------------- + +2006-04-11 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: added overflow error reporting to the ADD* routines + + ---------------------------------------------------------------------- + +2006-04-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: fixed bug using in LookupLOConnectionsToPVList where + the wrong variable was used. + + ---------------------------------------------------------------------- + +2006-04-10 DJ Delorie * dj AT delorie dot com * + + * doc/actions.texi, doc/version.texi, src/action.c: Document the + rest of the registered actions in action.c. + +2006-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: move some initializations inside a loop so they don't + get missed + +2006-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: declare dump_actions() right before using it + +2006-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: add some missing const-s + +2006-04-06 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-top-window.c: mode_button_toggled_cb() didn't sync + ghidgui->settings_mode with current mode button state. + +2006-04-06 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: revert the previous, this part + wasn't quite right. + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/mymem.c, src/mymem.h: add a MyMalloc to go along with MyCalloc + +2006-04-05 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui.h: Fix netlist + window to scroll to net/node when user lookups connection. + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-output-events.c, src/hid/gtk/gui-top-window.c: - make the ESC key return you to the arrow tool if you are in via, + thermal, lock, etc modes. - in line, poly, arc, etc. modes, the first ESC press returns you to + "tool neutral" and the 2nd ESC press returns you to the arrow tool. + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-dialog.c, src/hid/lesstif/dialogs.c: add pointer + to the geda homepage and wiki as well as the pcb home page in the + about dialog + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-dialog-print.c: fix a bug which prevented the + File->Export menu from working more than once in a pcb session. + +2006-04-05 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/djopt.c, src/hid.h, src/hid/common/actions.c, + src/hid/gtk/gtkhid-main.c, src/hid/lesstif/dialogs.c, + src/hid/lesstif/main.c, src/main.c, src/vendor.c: Initial chunk of + inline action docs. + +2006-04-05 DJ Delorie * dj AT delorie dot com * + + * doc/Makefile.am, doc/Makefile.in, doc/actions.texi, + doc/extract-docs, doc/pcb.texi, doc/version.texi: Fix eps->pdf rule + to set size and resolution right. Limit pcb->* to visible areas. + Add support for action extraction from sources. + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/script/Makefile.am, src/script/Makefile.in, + src/script/pcb-print: remove the pcb-print script. It is obsolete + now that the HID version directly supports command line export/print + through the export HID's. + +2006-04-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: Expand search box during bloat in case the box overlap + would otherwise prevent checking. This repairs a really bad bug + introduced when the rtrees were used to speed the find tracing. + + ---------------------------------------------------------------------- + +2006-04-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/misc.c: fixed pin/via bounding box to include thermal tails; + bug reported by CL + + ---------------------------------------------------------------------- + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui.h: Be a bit more careful with rouding issues when + converting to pcb units. Hopefully this will help with the issue + reported on the geda lists about 23.99 mil vias when the user + thought they picked 24 mil ones. Patch posted on geda-user by DJ. + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure, configure.ac, src/hid/png/png.c: check to + see which graphic file formats are supported by the installed GD. + If the desired list is not found, abort and tell the user they can + explicitly disable certain file types. Should deal with installed + versions of gd which do not support GIF output. + +2006-04-05 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/styles.c: fix a prototype + +2006-03-28 Dan McMahill * dan AT mcmahill dot net * + + * src/dolists.h, src/hid/lesstif/dialogs.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/lesstif/styles.c: move variable + declarations to the beginning of blocks to make gcc-2.95 and + probably other non-gcc compilers happy. + +2006-03-28 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: Check to make sure a pointer is not NULL before + dereferencing it. This seems to be the place where the segfault was + happening sometimes when saving connection data. For now, spit out + a warning message because I think there may be some other underlying + bug which causes the NULL pointer in the first place. + +2006-03-28 Dan McMahill * dan AT mcmahill dot net * + + * src/mymem.h: do not redefine malloc if we are using dmalloc + +2006-03-28 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/autoplace.c, src/autoroute.c, src/buffer.c, + src/change.c, src/command.c, src/crosshair.c, src/djopt.c, + src/draw.c, src/error.c, src/file.c, src/insert.c, src/intersect.c, + src/line.c, src/main.c, src/misc.c, src/mtspace.c, src/netlist.c, + src/output.c, src/print.c, src/puller.c, src/report.c, + src/res_parse.y, src/rtree.c, src/select.c, src/set.c, + src/strflags.c, src/vector.c, src/vendor.c: put back dmalloc support + +2006-03-28 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/find.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-misc.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-top-window.c, src/hid/lesstif/dialogs.c, + src/hid/lesstif/library.c, src/hid/lesstif/main.c, + src/hid/lesstif/netlist.c, src/main.c, src/set.c: hid_actionl must + be terminated with NULL, not a plain 0, in case integers and + pointers are different sizes. + +2006-03-28 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: access djopt_set_auto_only() via the + associated action instead of directly + +2006-03-28 Dan McMahill * dan AT mcmahill dot net * + + * src/djopt.c, src/djopt.h: fix prototype for an action. kills one + more compiler warning + +2006-03-28 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c: add a missing typecase + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/hid/gtk/gui-top-window.c, src/pcb-menu.res: - When changing selected line size from the menu, do it to the + selected arcs to. - Add a SelectedArcs option to the ChangeSize action. + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/select.c: Fix a bug where actions using SelectedPads did + nothing and SelectedPins picked up both pins and pads. Noted by bug + #1438523 + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/strflags.c: avoid allocating 0 bytes + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: fix a typo in a comment + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: No need to use strdup(Concat()) as Concat already + gives us allocated memory that is not referenced anywhere else. + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: Fix an off by one overflow of a malloc'ed buffer. + Found with ElectricFence. + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: in a function which is supposed to return a string but + is commented out with #ifdef FIXME, return a big warning string + rather than no return value until I/we figure out how to fix it. + Hopefully if this triggers bugs it will be easier to locate. + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: add back in the --enable-efence and + --enable-dmalloc configure flags to turn on ElectricFence and + dmalloc debugging respectively. + +2006-03-27 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/command.c, src/djopt.c, src/hid.h, + src/hid/common/actions.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/dialogs.c, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/netlist.c, src/hid/lesstif/styles.c, src/netlist.c, + src/puller.c, src/report.c, src/vendor.c: hid actions: remove + needs_coords, use need_coord_msg to determine when to get coords. + +2006-03-27 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c, src/hid/gtk/gui-utils.c: Make sure + we initialize some variables before using them. Fixes a segfault on + startup problem noted on NetBSD/alpha when displaying to an 8-bit + Xvnc. + +2006-03-27 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c: I wrapped too much into the verbose + option so the file load stopped working - fixed. + +2006-03-26 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: bump the rev letter to help identify this + as the HID version if someone pulls up the "about" dialog box. + +2006-03-26 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gtkhid-main.c: - Remove a debug printf which tried to print a NULL string. Avoids + a segfault bug. - When chosing "Save Layout" on a new layout (that hadn't already + been given a name or filename), correctly use the new file name that + is selected with the dialog box. + +2006-03-26 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/dialogs.c: - remove a debug printf which was trying to print a NULL string. + Fixes a segfault bug on solaris-2.9/sparc. - Fix the behaviour when doing "Save Layout" on a new board that didn't have a file name yet. + +2006-03-26 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c: add a --listen option for the lesstif HID + too (works the same as the gtk one -- listens on stdin for actions). + +2006-03-26 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-output-events.c: + Pan to a netlist window selected node if it's not visible. Fix a pan bug. + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-netlist-window.c: add cast to avoid compiler + warnings + +2006-03-25 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/hid/gtk/gui-top-window.c, src/pcb-menu.res: Add + File->Revert. + +2006-03-25 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-netlist-window.c: Turn + of Disable all nets button when NetlistChanged. Make some diagnostic output only if verbose. + +2006-03-25 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-netlist-window.c: Set netlist nodes enabled by + default when NetlistChanged. + +2006-03-25 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c: Fix draw arc when flipped. + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * doc/actions.texi, doc/fractional_size.texi, doc/letter_size.texi, + doc/metric_size.texi, doc/overview.texi, doc/pcbfile.texi, + doc/wire_size.texi: add some of the generated files to see if that + will help with those who don't read the README.cvs file... + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: use fileno(stdin) instead of 1 to + get the stdin file descriptor. + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * src/drill.c: fix a segfault when printing a board with no drill + holes at all. + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-top-window.c: add a --listen option which causes + pcb to listen on the standard input for actions. This should open + the door to experimenting with having gschem interact directly with + pcb. + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-config.c: Fix a bug in options parsing where the + loop looking for matches continued after a match had already been + found. + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: add a help string for --lib-newlib + +2006-03-25 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/Makefile.in: minor cleanup of status output + +2006-03-24 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/menu.c: Also look for ~/.pcb/pcb-menu.res. + Actually use the path we found ;-) + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: List the available HID's in the + ./configure --help output. Ideally, we'd have the help text be + automatic, but until we figure out how, just statically list the HID + (in the help text) + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, config.h.in, configure, + doc/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in: regen + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.am, README.cvs, configure.ac, doc/Makefile.am: - when not in maintainer mode, do not list all the dependencies for + the manual. This allows regular users who are building from a + tarball to avoid having to rebuild the manual and lets them simply + take the preformatted one. This avoids recently noted issues with + incompatibility with older versions of texinfo which seem somewhat + common. It also removes the requirement for having latex installed + and for building the png HID for pcb. - add a --disable-doc flag which allows users who are building from + CVS to skip the doc directory and thus avoid the need for the + documentation formatting tools. + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: note the DISTCHECK_CONFIGURE_FLAGS variable + +2006-03-24 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-top-window.c: Fix gtk magenta color messages -> + initialize all new hidGC colornames to Settings.BackgroundColor + because bgGC color outside of ghid_expose_callback() is never + initialized and it's used to draw outside of the callback when an + object is selected. + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/Makefile.in: Fix the calculation of the names + of the generated .texi tables for the drill sizes. + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, aclocal.m4, + doc/Makefile.in, doc/pad.eps, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in: regen after configure.ac changes + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * autogen.sh: don't automatically run ./configure. Simplifies + things a bit when trying to have several different builds share the + same source tree. + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * doc/extract-docs: put the generated files in the build directory + instead of the source directory (in case they are not the same) + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/Makefile.in: Rework the dependencies on the + various generated files a bit to hopefully correctly include all + dependencies. Also allow this to continue and just use the shipped + preformatted docs in the case where latex and friends are not + available. + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in: correctly find the font file correctly find the + m4lib stuff when building outside the source tree. + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, lib/ListLibraryContents.sh, + lib/ListLibraryContents.sh.in: move ListLibraryContents.sh to being + something created at configure time like the rest of the m4lib + stuff. This puts it in the build directory and allows you to run + pcb out of the build directory prior to installation even in the + case of a read only source tree. While here add some + AM_CONDITIONALS to indicate when latex and friends are not available + for formating the reference card. + +2006-03-24 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: add missing lesstif header to + get it in the distfile + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: fix a bug when specifying the output file name + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in: also set the font path + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in: fix a couple of paths when building outside the + source directory + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c, src/hid/lesstif/menu.c: avoid some + compiler warnings on solaris-2.9/sparc (gcc-3.3.5) + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/main.c: check the result of the --install options + _after_ the options have been processed. Thanks to DJ for finding + this one. + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Makefile.in: Change the way we handle built + include files. + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/strflags.c: avoid some compiler warnings on solaris-2.9/sparc + (gcc-3.3.5) + +2006-03-23 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gui-config.c, src/hid/gtk/gui-top-window.c: + ghid_invalidate_all() when colors change. + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/actions.c, src/misc.c, src/mymem.c: avoid some + compiler warnings on solaris-2.9/sparc (gcc-3.3.5) + +2006-03-23 Bill Wilson * billw2 AT users dot sourceforge dot net * + + * src/hid/gtk/gtkhid-main.c, src/hid/gtk/gui-output-events.c: Fix a + zoom glitch. + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: avoid some complier warnings on solaris-2.9/sparc + (gcc-3.3.5) + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/drill.c, src/drill.h, src/hid/gerber/gerber.c, src/print.c: + Round drill sizes to nearest mil for fab drawings and gerber drill + file. + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/mtspace.c: Avoid aliasing problems. + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in: add some missing arguments when running in gdb + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: don't include the full path for the default value of + the LibraryCommand and LibraryContentsCommand. That prevented + --lib-command-dir from working. + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/undo.c: Use void * pointers to avoid aliasing problems. + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/search.c: Use explicit void** pointers to avoid aliasing + problems. + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/gerber/gerber.c, src/hid/lesstif/dialogs.c, + src/hid/lesstif/lesstif.h, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/lesstif/netlist.c, + src/hid/lesstif/styles.c: Misc bugfixes and changes, to silence + compiler warnings. + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/mymem.c, src/mymem.h: MyCalloc, MyRealloc, MyStrdup: make + final parameter (tag string) const, to avoid compiler warnings. + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: fix the ChangeFlag action (compiler warning pointed + to the bug) + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: quote the regexp passed to grep + to keep solaris-2.9 happy + +2006-03-23 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/main.c: Don't try to run the idle proc until the + GUI is created. + +2006-03-23 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/command.c, src/djopt.c, src/dolists.h, + src/flags.c, src/hid.h, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/dialogs.c, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/netlist.c, + src/hid/lesstif/styles.c, src/hid/png/png.c, src/hid/ps/eps.c, + src/hid/ps/ps.c, src/main.c, src/netlist.c, src/puller.c, + src/report.c, src/vendor.c: Revert the ";" thing. The REGISTER_* + macros now contain ";" where needed and a ";" should not be used + when the macros are called. This is because the REGISTER_* macros + in hid.h expand to a function like int foo(){/* code here */} where + no ";" should be used at the end. gcc ignores the resulting empty + declaration but the sunpro c compiler doesn't like it. + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/action.h, src/actionlist.c, src/autoplace.c, + src/autoplace.h, src/autoroute.c, src/autoroute.h, src/box.h, + src/buffer.c, src/buffer.h, src/change.c, src/change.h, src/clip.c, + src/clip.h, src/command.c, src/command.h, src/compat.c, + src/compat.h, src/const.h, src/copy.c, src/copy.h, src/create.c, + src/create.h, src/crosshair.c, src/crosshair.h, src/data.c, + src/data.h, src/dev_ps.c, src/dev_ps.h, src/dev_rs274x.c, + src/dev_rs274x.h, src/djopt.c, src/djopt.h, src/dolists.h, + src/draw.c, src/draw.h, src/drill.c, src/drill.h, src/error.c, + src/error.h, src/file.c, src/file.h, src/find.c, src/find.h, + src/flags.c, src/global.h, src/heap.c, src/heap.h, src/hid.h, + src/hid/hidint.h, src/hid/lesstif/dialogs.c, + src/hid/lesstif/lesstif.h, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/netlist.c, src/hid/lesstif/styles.c, + src/hid/lpr/lpr.c, src/hid/png/png.c, src/hid/png/png.h, + src/hid/ps/eps.c, src/hid/ps/ps.c, src/hid/ps/ps.h, + src/icons/Makefile.in, src/insert.c, src/insert.h, src/intersect.c, + src/intersect.h, src/line.c, src/macro.h, src/main.c, src/mirror.c, + src/mirror.h, src/misc.c, src/misc.h, src/move.c, src/move.h, + src/mtspace.c, src/mtspace.h, src/mymem.c, src/mymem.h, + src/netlist.c, src/output.c, src/output.h, src/parse_l.h, + src/polygon.c, src/polygon.h, src/print.c, src/print.h, + src/puller.c, src/rats.c, src/rats.h, src/remove.h, src/report.c, + src/resource.h, src/rotate.c, src/rotate.h, src/rtree.c, + src/rtree.h, src/rubberband.c, src/rubberband.h, + src/script/Makefile.in, src/search.c, src/search.h, src/select.c, + src/select.h, src/set.c, src/set.h, src/strflags.c, src/strflags.h, + src/undo.c, src/undo.h, src/vector.c, src/vector.h, src/vendor.c, + src/vendor.h: indent + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/bom/bom.c, src/hid/common/actions.c, + src/hid/common/extents.c, src/hid/common/flags.c, + src/hid/common/hidinit.c, src/hid/common/hidnogui.c, + src/hid/gerber/gerber.c, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gtkhid.h, src/hid/gtk/gui-command-window.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui-dialog-size.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui-keyref-window.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-pinout-window.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h: indent + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/command.c, src/djopt.c, src/dolists.h, + src/flags.c, src/hid.h, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-top-window.c, + src/hid/lesstif/dialogs.c, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/netlist.c, src/hid/lesstif/styles.c, + src/hid/png/png.c, src/hid/ps/eps.c, src/hid/ps/ps.c, src/main.c, + src/netlist.c, src/puller.c, src/report.c, src/vendor.c: Take the + ";" out of the REGISTER_* defines and put them in the invocations. + This will let indent work correctly. + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/command.c, src/crosshair.c, src/draw.c, + src/main.c, src/misc.c, src/polygon.c, src/polygon.h, src/puller.c, + src/rats.c: fix several more compiler warnings by removing some + unused variables and adding/removing return values where + appropriate. + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-icons-mode-buttons.data, + src/hid/gtk/gui-top-window.c, src/hid/ps/eps.c: remove more compiler + warnings + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lpr/lpr.c: add missing member to the lpr_hid + initialization + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: remove unused variable + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: add missing header + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/flags.c: remove an unused variable + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/hidnogui.c: remove compiler warning + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/vendor.c: remove unused variable + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/report.c: format string fix + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/puller.c: add a couple of missing headers + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/print.c: add missing draw.h header + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/flags.c: add RCSID and dmalloc.h + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/flags.c: remove a spurious ";" + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gerber/gerber.c: remove unused variable + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-misc.c: remove a duplicate header and Id + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/lesstif.h: add RCS Id + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/lesstif/dialogs.c, src/hid/lesstif/library.c, + src/hid/lesstif/main.c, src/hid/lesstif/menu.c, + src/hid/lesstif/netlist.c, src/hid/lesstif/styles.c: add config.h, + dmalloc.h, and RCS Id + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/gtk/gui-misc.c: add dmalloc.h + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/hidint.h: add RCS Id + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/common/actions.c, src/hid/common/extents.c, + src/hid/common/flags.c, src/hid/common/hidinit.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/lpr/lpr.c: add config.h, dmalloc.h, and RCS Id + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/ps/eps.c, src/hid/ps/ps.c, src/hid/ps/ps.h: remove + compiler warning and add config.h, dmalloc.h, and RCS Id + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/png/png.c: remove a compiler warning + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/bom/bom.c: add missing header + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: add the generated headers to + DISTCLEANFILES and add a bunch of missing headers to the various + *_SOURCES. With this change, the 'distcheck' target works again. + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add $srcdir in a couple of places for configuring + outside of the source directory. + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * src/dolists.h: add missing RCS Id + +2006-03-22 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac, doc/Makefile.am, doc/Makefile.in, + doc/pad.eps, doc/pad.obj: Replace the tgif drawing with a pcb + drawing. The suffix rules are now in place to use .pcb files as + part of the manual. + +2006-03-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/lpr/lpr.c: Call lpr, don't just save the file. + +2006-03-21 DJ Delorie * dj AT delorie dot com * + + * src/hid/lesstif/library.c: Remove a debug printf. + +2006-03-21 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/file.c, src/main.c, src/misc.h, src/set.c, + src/set.h: Remove UpdateSettingsOnScreen. Call InitCrosshair only + for GUIs. + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/pad.pcb: correctly identify the poly clearance + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * configure, doc/Makefile.in: regen + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, doc/Makefile.am: detect when tgif is not found and + give a warning instead of crashing the build + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/pad.eps: include the tgif output here until I replace the + drawings with pcb drawings + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/pad.pcb: improve this drawing a bit + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * src/hid/bom/bom.c: Use log() instead of logv(). Fixes compilation + on NetBSD/alpha, gcc-3.3.3 + +2006-03-21 DJ Delorie * dj AT delorie dot com * + + * compile: New file, from automake 1.9. + +2006-03-21 DJ Delorie * dj AT delorie dot com * + + * depcomp, doc/mdate-sh, doc/texinfo.tex, install-sh, missing, + mkinstalldirs, ylwrap: Update to automake 1.9 files. + +2006-03-21 DJ Delorie * dj AT delorie dot com * + + * Makefile.in, README_FILES/Makefile.in, aclocal.m4, config.h.in, + configure, doc/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in: regenerate everything with FC4. + +2006-03-21 DJ Delorie * dj AT delorie dot com * + + * config.h.in, configure, configure.ac, src/Makefile.am, + src/Makefile.in, src/Pcb.ad.in, src/action.c, src/action.h, + src/autoplace.c, src/autoroute.c, src/buffer.c, src/change.c, + src/command.c, src/command.h, src/const.h, src/control.c, + src/control.h, src/copy.c, src/create.c, src/create.h, + src/crosshair.c, src/data.c, src/data.h, src/dialog.c, + src/dialog.h, src/djopt.c, src/djopt.h, src/dolists.h, src/draw.c, + src/draw.h, src/error.c, src/file.c, src/fileselect.c, + src/fileselect.h, src/find.c, src/find.h, src/flags.c, + src/global.h, src/gui-command-window.c, src/gui-config.c, + src/gui-dialog-print.c, src/gui-dialog-size.c, src/gui-dialog.c, + src/gui-icons-misc.data, src/gui-icons-mode-buttons.data, + src/gui-keyref-window.c, src/gui-library-window.c, + src/gui-log-window.c, src/gui-misc.c, src/gui-netlist-window.c, + src/gui-output-events.c, src/gui-pinout-window.c, + src/gui-top-window.c, src/gui-utils.c, src/gui.c, src/gui.h, + src/heap.c, src/hid.h, src/hid/bom/bom.c, src/hid/bom/hid.conf, + src/hid/common/actions.c, src/hid/common/extents.c, + src/hid/common/flags.c, src/hid/common/hidinit.c, + src/hid/common/hidnogui.c, src/hid/gerber/gerber.c, + src/hid/gerber/hid.conf, src/hid/gtk/gtkhid-main.c, + src/hid/gtk/gtkhid.h, src/hid/gtk/gui-command-window.c, + src/hid/gtk/gui-config.c, src/hid/gtk/gui-dialog-print.c, + src/hid/gtk/gui-dialog-size.c, src/hid/gtk/gui-dialog.c, + src/hid/gtk/gui-icons-misc.data, + src/hid/gtk/gui-icons-mode-buttons.data, + src/hid/gtk/gui-keyref-window.c, src/hid/gtk/gui-library-window.c, + src/hid/gtk/gui-log-window.c, src/hid/gtk/gui-misc.c, + src/hid/gtk/gui-netlist-window.c, src/hid/gtk/gui-output-events.c, + src/hid/gtk/gui-pinout-window.c, src/hid/gtk/gui-top-window.c, + src/hid/gtk/gui-utils.c, src/hid/gtk/gui.h, src/hid/gtk/hid.conf, + src/hid/hidint.h, src/hid/lesstif/dialogs.c, + src/hid/lesstif/hid.conf, src/hid/lesstif/lesstif.h, + src/hid/lesstif/library.c, src/hid/lesstif/main.c, + src/hid/lesstif/menu.c, src/hid/lesstif/netlist.c, + src/hid/lesstif/styles.c, src/hid/lpr/hid.conf, src/hid/lpr/lpr.c, + src/hid/png/hid.conf, src/hid/png/png.c, src/hid/png/png.h, + src/hid/ps/eps.c, src/hid/ps/hid.conf, src/hid/ps/ps.c, + src/hid/ps/ps.h, src/insert.c, src/intersect.c, src/lgdialog.c, + src/lgdialog.h, src/library.c, src/library.h, src/line.c, + src/log.c, src/log.h, src/macro.h, src/main.c, src/menu.c, + src/menu.h, src/misc.c, src/misc.h, src/move.c, src/mtspace.c, + src/mymem.c, src/mymem.h, src/netlist.c, src/netlist.h, + src/output.c, src/output.h, src/parse_l.l, src/parse_y.y, + src/pcb-menu.res, src/pcbtest.sh.in, src/pinout.c, src/pinout.h, + src/polygon.c, src/print.c, src/print.h, src/printdialog.c, + src/printdialog.h, src/printpanner.c, src/printpanner.h, + src/puller.c, src/rats.c, src/report.c, src/report.h, + src/res_lex.l, src/res_parse.y, src/resmenu.c, src/resmenu.h, + src/rotate.c, src/rtree.c, src/search.c, src/select.c, + src/selector.c, src/selector.h, src/set.c, src/set.h, + src/sizedialog.c, src/sizedialog.h, src/strflags.c, src/todo, + src/undo.c, src/undo.h, src/vector.c, src/vendor.c, src/vendor.h: + HID merge. + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs_branches: note what some of the branches are + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: add a few more notes about the snapshot process + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * README_FILES/Makefile.in, aclocal.m4, example/Makefile.in, + example/libraries/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in: + regen + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: add news for the 20060321 snapshot + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * AUTHORS: update authors a bit + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update with changes for 20060321 snapshot. + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, tutorial/Makefile.in: regen + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: bump updated date + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen + +2006-03-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: Minor updates to fix the 'distcheck' target. + Adds a missing file (extract-docs) to the list of distributed files, uses $(srcdir) in a + couple of spots, etc. + +2006-03-20 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2006-03-20 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: - replace obsolete AC_ERROR with AC_MSG_ERROR - store the path to the m4 executible + +2006-03-16 DJ Delorie * dj AT delorie dot com * + + * src/parse_y.y: Document ElementArc, ElementLine, and Mark. + +2006-03-14 Dan McMahill * dan AT mcmahill dot net * + + * doc/pad.pcb: add drawing of soldermask opening around a pad + +2006-03-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/QueryLibrary.sh.in, lib/common.m4: add an optional -fp + argument which will display the correct footprint= attribute for + gschem. Generally useful for debugging. + +2006-03-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/pci.inc, lib/pci.list, lib/pci.m4: Remove the abuse of the + value field as a way of passing in multiple extra parameters. While + here fix the pinlists. These footprints still have diagonal pads + which are not allowed. + +2006-03-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.in, src/Makefile.in: regen + +2006-03-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/genericsmt.inc, lib/genericsmt.list, + lib/genericsmt.m4: garbage collect some footprints that were not at + all conforming to the correct usage of the m4 library system. In + addition, they were rather redundant. + +2006-03-13 Dan McMahill * dan AT mcmahill dot net * + + * lib/CreateLibraryContents.sh.in: put the correct gschem footprint= + attribute in [] at the end of each description + +2006-03-12 DJ Delorie * dj AT delorie dot com * + + * doc/extract-docs: New file, for extracting inline documentation. + +2006-03-12 Dan McMahill * dan AT mcmahill dot net * + + * lib/QueryLibrary.sh.in: eat blank lines of which there can be many + in the element output + +2006-03-11 DJ Delorie * dj AT delorie dot com * + + * doc/Makefile.am, doc/Makefile.in, doc/pcb.css, doc/pcb.texi, + src/const.h, src/parse_y.y: Inline documentation. + +2006-03-11 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/change.c, src/change.h: Add "join" to SetFlag, + ClrFlag, and ChangeFlag actions. + +2006-03-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: Fixed bug where pads were assumed to be on the + same side as the element + + ---------------------------------------------------------------------- + +2006-03-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c: Crosshair snap to pad ends instead of center - + necessary for rat drawing because rats only connect at pad end + points. + + ---------------------------------------------------------------------- + +2006-03-06 DJ Delorie * dj AT delorie dot com * + + * src/print.c: Fab author fixes from Karel. + +2006-03-06 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_y.y: Fix reduce-reduce conflicts (patch from DJ). + +2006-03-03 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: - clarify that the manual does not currently document the very + latest pcb output file format. - add a (sparsely populated) glossary appendix - add a note about how to change layers + +2006-03-03 Dan McMahill * dan AT mcmahill dot net * + + * globalconst.h, src/action.c, src/create.c, src/file.c, + src/find.c, src/global.h, src/gui-config.c, src/parse_y.y, + src/rotate.c, src/sizedialog.c, src/vendor.c: add DRC checks for + minimum drill diameter and minimum annular ring. + +2006-03-02 Dan McMahill * dan AT mcmahill dot net * + + * src/rats.c: When manually adding nets, make sure we actually pick + a unique name when a new net is created. Fixes a bug noted by + Vanessa Dannenberg. + +2006-02-28 Dan McMahill * dan AT mcmahill dot net * + + * doc/pad.pcb: Add a pad drawing showing how a pad is drawn with a + rectangular aperture. Not used yet, but this will replace the tgif + drawing at some point. + +2006-01-29 Dan McMahill * dan AT mcmahill dot net * + + * src/error.c: apply some fixes for DragonFly BSD + +2006-01-18 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: format cleanup of ActionChangePinName() to bring + more in line with GNU coding standards for C code formatting. + +2006-01-17 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: document ChangePinName action + +2006-01-17 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/action.h, src/command.c: add a ChangePinName() + action which lets you change the name of a pin/pad on an element. + For example, ChangePinName(U1, 7, VCC) changes the name of pin #7 on + U1 to "VCC". This makes it simple to propagate pin names from a + schematic capture tool to the layout without requiring the layout + library to know the pin names for every component. + +2006-01-16 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c, src/copy.c, src/create.c, src/draw.c, src/find.c, + src/insert.c, src/move.c, src/mymem.c, src/parse_y.y, + src/polygon.c, src/print.c, src/remove.c, src/report.c, + src/search.c, src/select.c: Updated to use rtrees for polygon + handling + +2006-01-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Fixed bugs in GetClosestPolygonPoint where (a) the + passed point was not used, and (b) projection of the segment past + the end was being used when it shouldn't. + + ---------------------------------------------------------------------- + +2006-01-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: Speed computation of route costs, it uses about + 13% of the CPU time during routing. + + ---------------------------------------------------------------------- + +2006-01-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: Speed up the rtree searches by establishing better + balance of the cluster size during a node split. This reduces the + tree depth resulting in faster searching. + + ---------------------------------------------------------------------- + +2006-01-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/strflags.c: Fixed clearline flag so that arcs also have this + property + + ---------------------------------------------------------------------- + +2006-01-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Fixed bug where clearances could be set 1 below the + spacing setting + + ---------------------------------------------------------------------- + +2005-12-09 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen [put the html manual in 1 file] + +2005-12-09 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: put the html manual in 1 file. Its a bit easier + to manage + +2005-12-09 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: bump date last touched + +2005-12-07 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: cause the missing ) in PKG_SMT_2PAD_MM100 to appear + +2005-12-06 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: - added the pad drawing showing how a pad is drawn with an aperture. - added some comments about the evolving file format for layout + files. + +2005-12-02 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c, src/global.h, src/gui-netlist-window.c, src/rats.c: + fix a bug which prevented disabling nets from the ratsnest + +2005-12-02 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: fix duplicate PKG_SME4 which should have been called + SME5. Reported by Wojciech Kazubski in bug #1353304 + +2005-12-02 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in: Be sure to set the library path to the source + tree. Patch supplied by Wim Lewis in patch #1362564 + +2005-10-11 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: redo the 0201, 0402, etc passives to bring them in + line with the IPC recommendations. The pads on, for example 0603, + were too small before. They worked, were really not adequate. + +2005-10-11 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: add a PKG_SMT_2PAD_MM100 which directly takes + dimensions for the pads, silk, and placement courtyard from IPC-7351 + for things like 0402 capacitor and resistor footprints. + +2005-09-06 Dan McMahill * dan AT mcmahill dot net * + + * autogen.sh: make this script a bit more verbose and also abort on + errors + +2005-09-06 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2005-09-06 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: make sure to check for -lX11 even when we're using + the gtk gui. action.c still has a direct call to an X function + (XWarpPointer) so on some systems (Solaris) you need to explicitly + link -lX11 instead of getting it through the gtk dependencies + +2005-08-05 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2005-08-05 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: check for gtk+ >= 2.4.0 instead of 2.2.0 since we + need >= 2.4.0 + +2005-08-05 Dan McMahill * dan AT mcmahill dot net * + + * src/script/Makefile.am, src/script/Makefile.in: add pcb-print to + the list of distributed files + +2005-08-05 Dan McMahill * dan AT mcmahill dot net * + + * src/script/pcb-print: fix a bug in the --add-alignment option. + Noted by David Baird + +2005-08-04 Dan McMahill * dan AT mcmahill dot net * + + * src/gui-library-window.c: fix -auto-place for the library window + +2005-08-04 Dan McMahill * dan AT mcmahill dot net * + + * src/script/pcb-print: add script to make it easier to print from + the command line + +2005-08-04 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/action.h, src/command.c, src/global.h, + src/gui-library-window.c, src/gui-log-window.c, + src/gui-netlist-window.c, src/gui-pinout-window.c, + src/gui-top-window.c, src/main.c, src/misc.c, + src/script/Makefile.am, src/script/Makefile.in: - change the Print action to PrintDialog since it causes the print dialog box to come up - add a new Print action provided by David Baird as patch # 1212168. Modified by me to work with the gtk version of pcb. - to let this action work, allow actions to take a parameter list + and # of parameters to allow large numbers of arguments. - modify the Quit action and some of the initialization code so that you can use Quit() in a startup script. - add a -auto-place command line option which causes the windows to + be automatically placed rather than letting the window manager do + it. This is useful when printing via the command line. - add a command line shell script for printing. This is a wrapper + which takes a whole bunch of flags relating to the print parameters + and translates that to the correct invocation of the Print() action. Shell script provided by David Baird as part of patch #1212168 and modified by me to make it portable. + +2005-07-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: add 1008 package + +2005-07-27 Dan McMahill * dan AT mcmahill dot net * + + * lib/bourns.inc: fix the pin order. + +2005-07-24 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/gui-config.c: Fix initial layer groups so that layer named + 'component' is actually on the component side and layer named + 'solder' is actually on the solder side. Unfortunately the GTK + version saves the old bug in the .pcb/preferences file so no + patching will fix existing installations. They must manually edit + the layer groups and check the "use as default" to fix their + installation. + + ---------------------------------------------------------------------- + +2005-07-23 Dan McMahill * dan AT mcmahill dot net * + + * aclocal.m4, configure: regen (fix botched commit which was missing + some M4 paths) + +2005-07-22 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi, doc/version.texi: add appendix describing the + centroid file format along with the algorithm for finding the + centroid and rotation. + +2005-07-22 Dan McMahill * dan AT mcmahill dot net * + + * src/print.c: remove some redundant code to make things more clear + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * lib/genericsmt.m4: fix typo + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * aclocal.m4, configure: regen + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/vendor.c: add a check for sys/types.h and then + if found, include in vendor.c. Needed to build on FreeBSD. Problem + and fix reported in bug #1220963. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * lib/qfn.inc: hires-ify the QFN packages. While here make sure we + use an appropriate soldermask relief for this style of package. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * src/gui-dialog-print.c, src/gui-dialog-size.c, src/set.c: remove + the inclusion of menu.h. We don't use that file anymore and the + only reason we could still build on some systems is we'd find the + /usr/include/menu.h from curses! Problem noted in bug #1226924 by + Axeloide. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * doc/refcard.tex, src/gui-keyref-window.c, src/gui-output-events.c: + apply patches provided by Bill Wilson in patch #1230708. Fix key bindings for drill size changes to be s and s to agree with the Xaw default key bindings. Add missing key bindings '/' and '.' for cycle multiline mode and toggle 45 degree enforcement respectively. Fix refcard.tex to reflect the current set of key binding. Now the gtk key bindings and the refcard should be in sync and be the same as the default Xaw PCB bindings with one exception: the buffer selection binding is 1...5 instead of 1...5. This can be fixed but at the cost of removing the shortcuts from the menus because gtk can't use digits as menu shortcuts. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * INSTALL, NEWS, README-GTK_PORT: apply patches provided by Bill + Wilson in patch #1230704 This patch adds a note to the README-GTK_PORT about runtime warnings if using early gtk+2.4.0 versions. It also makes small adjustments to the INSTALL file to remove an outdated Xt reference and a non-existent 68HC11 file reference. In addition, note that gtk+2.4 is needed, not gtk+2.2. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * src/global.h, src/gui-config.c, src/gui-top-window.c, src/gui.h: + apply patches provided by Bill Wilson in patch #1227292 As per a request on the gEDA list, this patch adds a Preferences option to make the layout name appear on the window title bar instead of on the main menu bar area. This is convenient when the layout name might be somewhat long and takes up too much horizontal space on the menu bar area. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c, src/gui-config.c, src/gui-top-window.c: apply patches + provided by Bill Wilson in patch #1227205 When loading layouts using + alternating mil/mm units, the PCB units displaying can get out of + sync. This patch fixes it. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c, src/gui-utils.c: apply patches provided by Bill Wilson + in patch #1215935 1) The DRC user interface issue has been reported on the gEDA + mailing list and is listed on the PCB bugs page as request id + 1206762 dated 2005-05-23 01:29 and is fixed in this patch. 3) Fix a dangling DRC check g_message() which I overlooked fixing + during the final Gtk port cleanup. 4) Adjust the DRC draw centering to be 1/4 screen offset since the + continue dialog is centered (under window manager control) and that + was covering up the DRC highlighted portion of the draw which was + previously also centered. 2) The log window was not scrolling to keep most recent log items + added in view and this patch fixes that. + +2005-07-18 Dan McMahill * dan AT mcmahill dot net * + + * src/const.h, src/global.h, src/gui-netlist-window.c: apply the + patches provided by Wim Lewis in patch #1189989 to allow pcb to + compile more cleanly on OpenBSD. + +2005-06-11 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/autoroute.c, src/buffer.c, src/change.c, + src/const.h, src/copy.c, src/create.c, src/create.h, + src/crosshair.c, src/data.h, src/dev_rs274x.c, src/djopt.c, + src/draw.c, src/file.c, src/find.c, src/global.h, + src/gui-top-window.c, src/insert.c, src/line.c, src/macro.h, + src/misc.c, src/misc.h, src/move.c, src/mymem.c, src/parse_l.l, + src/parse_y.y, src/polygon.c, src/print.c, src/rats.c, + src/report.c, src/rotate.c, src/search.c, src/strflags.c, + src/strflags.h, src/undo.c, src/undo.h: Update sources to support + more than 8 layers. + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: add news for 20050609 + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: add changes for 20050609 + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * globalconst.h: reduce minimum board size from 1.2 to 0.6 inches + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.in: regen [add missing strflags.h] + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: add missing strflags.h + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: make sure we still set the X library rpath (yes, it + is still possible to use --disable-rpath debian folks). + +2005-06-08 Dan McMahill * dan AT mcmahill dot net * + + * src/draw.c, src/global.h, src/gui-config.c, + src/gui-output-events.c, src/gui-top-window.c, src/gui-utils.c, + src/main.c: convert several c++ style comments to c comments. not + all compilers like // + +2005-06-03 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Avoid name conflict with abs/min/max + +2005-05-26 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen [error out if m4 not found] + +2005-05-26 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: error out if m4 is not found + +2005-03-28 DJ Delorie * dj AT delorie dot com * + + * src/strflags.c: Fix the "all pads are ovals" bug. + +2005-03-21 DJ Delorie * dj AT delorie dot com * + + * src/strflags.c: Minor bugfixes related to error handling + +2005-03-21 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Makefile.in, src/file.c, src/parse_y.y, + src/strflags.c, src/strflags.h: When saving files, convert flags to + symbolic format instead of storing the actual internal bitfield. + +2005-03-21 DJ Delorie * dj AT delorie dot com * + + * src/const.h: Put parens around computed macros. Use ~0 instead of + -1 for "all bits". + +2005-03-14 Dan McMahill * dan AT mcmahill dot net * + + * src/gui-icons-misc.data, src/gui-icons-mode-buttons.data: add some + files missed in the gtk-pcb checkin + +2005-03-13 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcbrc-sample, src/file.c, src/global.h, src/gui-config.c, + src/gui-top-window.c, src/gui.h, src/main.c, src/misc.c, + src/misc.h, src/pcbtest.sh.in: add some config file patches from + Bill Wilson + +2005-03-12 Dan McMahill * dan AT mcmahill dot net * + + * README-GTK_PORT, configure, configure.ac, doc/version.texi, + globalconst.h, po/fr_FR.po, po/pcb.pot, src/Makefile.am, + src/Makefile.in, src/Pcb.ad.in, src/action.c, src/action.h, + src/autoplace.c, src/autoroute.c, src/buffer.c, src/change.c, + src/clip.c, src/clip.h, src/command.c, src/command.h, src/const.h, + src/create.c, src/crosshair.c, src/data.c, src/data.h, + src/dev_ps.c, src/dev_rs274x.c, src/djopt.c, src/djopt.h, + src/draw.c, src/draw.h, src/drill.c, src/error.c, src/error.h, + src/file.c, src/file.h, src/find.c, src/global.h, + src/gui-command-window.c, src/gui-config.c, src/gui-dialog-print.c, + src/gui-dialog-size.c, src/gui-dialog.c, src/gui-keyref-window.c, + src/gui-library-window.c, src/gui-log-window.c, src/gui-misc.c, + src/gui-netlist-window.c, src/gui-output-events.c, + src/gui-pinout-window.c, src/gui-top-window.c, src/gui-utils.c, + src/gui.h, src/heap.c, src/insert.c, src/intersect.c, src/line.c, + src/macro.h, src/main.c, src/menu.h, src/misc.c, src/misc.h, + src/move.c, src/mtspace.c, src/mymem.c, src/output.c, src/output.h, + src/parse_l.l, src/parse_y.y, src/pcb-menu.res, src/pcbtest.sh.in, + src/polygon.c, src/print.c, src/rats.c, src/rats.h, src/report.c, + src/res_parse.y, src/rotate.c, src/rtree.c, src/script/pcb.in, + src/select.c, src/select.h, src/set.c, src/set.h, src/undo.c, + src/vector.c, src/vendor.c, src/vendor.h: Import Bill Wilson's port + of pcb to gtk. Things seem to compile and run but this should be + considered a work in progress at the moment. + +2005-03-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen + +2005-03-12 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: add a few missing files to EXTRA_DIST + +2005-03-10 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update with latest changes + +2005-03-10 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, doc/Makefile.in, + doc/version.texi, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in: regen after adding gtk configure.ac stuff + +2005-03-10 Dan McMahill * dan AT mcmahill dot net * + + * autogen.sh: use ACLOCAL_FLAGS if set + +2005-03-10 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/misc.inc, lib/to.inc: add MULTIWATT and friends. + Fix drill size for several versions of the TO-220 package, fix some + bugs which caused several TO-220 packages and others to generate + syntax errors, and fix the drill size on several TO-* packages. You + can't fit a 40 mil pin in a 20 mil hole! + +2005-02-23 DJ Delorie * dj AT delorie dot com * + + * src/global.h, src/main.c, src/print.c: Allow FAB author name to be + set by .Xdefaults + +2005-02-10 Dan McMahill * dan AT mcmahill dot net * + + * src/action.h: add a few missing prototypes + +2005-02-09 Dan McMahill * dan AT mcmahill dot net * + + * aclocal.m4: regen + +2005-02-09 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen after adding --enable-gtk and --disable-xaw + +2005-02-09 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add --enable-gtk and --disable-xaw configure flags + which will turn on the configuring of gtk+ and turn off the + configuring of Athena widgets respectively. At this time the effect + is that you will not be able to compile if you use these options. + They are added to help support some gtk+ development work. + +2005-02-02 Dan McMahill * dan AT mcmahill dot net * + + * src/data.c, src/dialog.c, src/printdialog.c: fix a segfault bug + when using Up and Down to try and adjust the scale slider + in the print dialog box. While here fix up the print dialog box so + that you can use the arrow keys to fine adjust the scale slider. + Noted in bug #1111847 filed by Bob Paddock. + +2005-02-02 Dan McMahill * dan AT mcmahill dot net * + + * src/rotate.c: fix a segfault bug on the pinout window (no null + pointer dereference) + +2005-02-02 Dan McMahill * dan AT mcmahill dot net * + + * src/Pcb.ad.in: change units to 1/100 mil for pinout window offset + +2005-01-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: Add DIP44. Provided by Walter Fetter Lages in patch + #1108881 + +2005-01-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/misc.inc: fix drill size for ZIP packages. Noted by Walter + Fetter Lages in patch #1108881 + +2005-01-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/connector.inc: fix drill size for PKG_BNC_LAY. Provided by + Walter Fetter Lages in patch #1108881 + +2005-01-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: add TQFP packages provided by Walter Fetter Lages in + patch #1108881. More to come from that patch... + +2005-01-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen + +2005-01-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: add flag to keep building the html manual as a + single page. Having multiple pages seems to do strange things to + the install. + +2005-01-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen + +2005-01-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: fix typo in target for creating texi files from + the ascii list of drills + +2005-01-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen + +2005-01-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/ascii2texi.awk, doc/fractional_size.tab, + doc/letter_size.tab, doc/metric_size.tab, doc/pcb.texi, + doc/wire_size.tab: add an appendix with a big list of drill sizes. + Included are American Standard wire size, letter size, fractional + size, and metric. + +2005-01-27 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: add news for snapshot 20050127 + +2005-01-27 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update to get ready for next snapshot + +2005-01-27 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, aclocal.m4, + doc/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in: update to latest automake + +2005-01-27 Dan McMahill * dan AT mcmahill dot net * + + * src/Pcb.ad.in, src/main.c: change pcb to Pcb in a commented out + resource + +2005-01-27 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/misc.inc: fix the LED3 and LED5 footprints for + T-1 and T-1 3/4 (3mm and 5mm) standard LED's. The old footprint had + drill holes which were too small and also there was silk on the pad. + +2005-01-26 Dan McMahill * dan AT mcmahill dot net * + + * lib/plcc.inc: increase the padsize and drill size for through-hole + PLCC sockets + +2005-01-25 DJ Delorie * dj AT delorie dot com * + + * src/pcb-menu.res: Oops, take out test entry + +2005-01-25 DJ Delorie * dj AT delorie dot com * + + * src/menu.c, src/pcb-menu.res, src/resmenu.c, src/resmenu.h: Move + right-click popup menu to pcb-menu.res also. + +2005-01-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: bump date + +2005-01-21 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c: do not complain about MIN_PINORVIACOPPER on a + mounting hole + +2005-01-21 Dan McMahill * dan AT mcmahill dot net * + + * src/Pcb.ad.in, src/main.c, src/set.c: - break the status line into 2 lines as it was getting rather long - put the cursor position line below the menu as it is also getting rather long with the metric display. Besides keeping the 2 lines from being cutoff on smaller displays, + it seems to avoid some of the strange Xaw issues seen in bug + #1099862 and patch #1042731 where the porthole for the main drawing + area is not properly sized and where the status line is sometimes + covered by the porthole. + +2005-01-21 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.in: regen + +2005-01-21 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: for the .test/Pcb apps-default file (the one used + when running before installation), use the pcb-menu.res file in the + source directory. + +2005-01-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi, src/action.c, src/pcb-menu.res: Add "Selected" and + "All" arguments to DisperseElements so you have the option to not + disperse all of them. Add corresponding menu choices. + +2005-01-18 Dan McMahill * dan AT mcmahill dot net * + + * src/print.c: avoid having text overlaying text in the fab drawing + when a very small number of drill sizes are used. Problem reported + in bug #1100163. Patch provided by Mick. + +2005-01-18 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2005-01-18 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add a --disable-rpath flag to disable hardcoding of + the X11 library path. Default behaviour is unchanged. + +2005-01-17 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: use LAYOUT_BOTTOM to always put the status line at the + bottom of the main window. Gets rid of some annoying bugs on + solaris and some other systems where the status line would sometimes + get covered up when the window was resized. + +2005-01-17 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c: in the message log produced when a via size has to + be increased to meet the minimum copper, add a location to make it + easier to locate the via. + +2005-01-17 Dan McMahill * dan AT mcmahill dot net * + + * src/Pcb.ad.in, src/main.c: Increase + Pcb.masterForm*cursorPosition.width to make room for metric display. + Provided by Mark Whitis in patch #1042731 + +2005-01-17 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add docs for ChangeClearSize() action. Also apply + some other fixes provided in patch #1068842 + +2005-01-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/misc.inc: increase quoting of $2 in PKG_CRYSTAL to avoid the + refdes from being expanded by m4. Lets you use "X1" as the refdes + in gschem and gsch2pcb + +2005-01-13 Dan McMahill * dan AT mcmahill dot net * + + * README_FILES/Makefile.in: regen + +2005-01-13 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: udate data + +2005-01-13 Dan McMahill * dan AT mcmahill dot net * + + * src/pcb-menu.res: add DisperseElements() to menu + +2005-01-13 Dan McMahill * dan AT mcmahill dot net * + + * src/control.c, src/main.c, src/resmenu.c: remove some more + compiler warnings + +2005-01-13 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi, src/action.c, src/action.h, src/main.c: add a + DisperseElements() action which will disperse all elemnents in a + layout. The purpose is to spread out elements which are all on top + of each other at the very beginning of a design. + +2005-01-06 Dan McMahill * dan AT mcmahill dot net * + + * README, README_FILES/LICENSE, README_FILES/MAILING, + README_FILES/Makefile.am, README_FILES/README: remove duplicated + files and fix some out of date info + +2005-01-06 Dan McMahill * dan AT mcmahill dot net * + + * src/djopt.c, src/rtree.c: cast some pointers to (void *) when + printing debug output. reduces the # of compiler warnings + +2005-01-03 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/autoplace.c, src/autoroute.c, src/box.h, + src/buffer.c, src/buffer.h, src/change.c, src/change.h, src/clip.c, + src/clip.h, src/copy.c, src/copy.h, src/create.c, src/create.h, + src/crosshair.c, src/crosshair.h, src/data.c, src/data.h, + src/dev_ps.c, src/dev_rs274x.c, src/draw.c, src/file.c, src/find.c, + src/find.h, src/global.h, src/insert.c, src/insert.h, + src/intersect.c, src/line.c, src/macro.h, src/mirror.c, + src/mirror.h, src/misc.c, src/misc.h, src/move.c, src/move.h, + src/mtspace.c, src/output.c, src/output.h, src/pinout.c, + src/polygon.c, src/polygon.h, src/print.c, src/print.h, + src/printdialog.c, src/rotate.c, src/rotate.h, src/rubberband.c, + src/search.c, src/search.h, src/set.c, src/set.h, src/undo.c, + src/undo.h: change "Location" to "LocationType". Avoids some + confusion with some compilers (SunPRO in particular) when "Location" + is also used as part of a struct. + +2004-12-31 Dan McMahill * dan AT mcmahill dot net * + + * src/vendor.c: move the regfree() call _before_ the return from the + function that calls it so that it actually happens. + +2004-12-12 Dan McMahill * dan AT mcmahill dot net * + + * src/vendor.c: remove a compiler warning + +2004-11-20 Dan McMahill * dan AT mcmahill dot net * + + * src/set.c: add metric output to the location display. Based on + patches provided in patch #1042731 by Mark Whitis + +2004-11-20 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: adjust Pcb.masterForm*cursorPosition.width to match + the app-defaults file value + +2004-11-20 Dan McMahill * dan AT mcmahill dot net * + + * src/actionlist.c: revert previous. Seems to have snuck in by + mistake in the strcmp() cleanup. + +2004-11-20 Dan McMahill * dan AT mcmahill dot net * + + * src/pcb-menu.res: add . as the hotkey for toggling 45 degree + line mode. addressed bug #1069665 filed by Mark Whitis. + +2004-11-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c: Snap to pads go to pad centers and allow snapping + to element mark too. + + ---------------------------------------------------------------------- + +2004-11-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/actionlist.c, src/autoplace.c, src/create.c, + src/dev_rs274x.c, src/dialog.c, src/djopt.c, src/draw.c, + src/file.c, src/fileselect.c, src/macro.h, src/main.c, src/misc.c, + src/netlist.c, src/print.c, src/rats.c, src/res_parse.y, + src/search.c, src/selector.c, src/set.c, src/vendor.c: Replace all + strcmp with a macro that tests for NULL pointers + + ---------------------------------------------------------------------- + +2004-11-08 Dan McMahill * dan AT mcmahill dot net * + + * src/control.c: Restore translation table for the mode buttons. + This seems to fix the "mode buttons are not responsive" bug reported + in bug #716517 Patch provided by Daniel Nilsson in patch #1023078. + +2004-11-07 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c, src/change.h: Allow element names to be edited over + the name itself + + ---------------------------------------------------------------------- + +2004-11-02 Dan McMahill * dan AT mcmahill dot net * + + * src/Pcb.ad.in: Fix the . binding to toggle 45 degree mode. + Addresses bug #1022800 + +2004-11-01 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure: regen [add support for ElectricFence + debugging. --enable-efence] + +2004-11-01 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add support for ElectricFence debugging. + --enable-efence + +2004-11-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi, doc/version.texi: clarify the units used by PCB a + bit + +2004-10-31 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi, src/vendor.c: Allow the use of regular expressions + in the resources which specify elements which should not have their + drill holes mapped to the vendor table. + +2004-10-30 Dan McMahill * dan AT mcmahill dot net * + + * src/pcb-menu.res, src/vendor.c: Modify the LoadVendor() action so + if the file name is not give, the user is presented with a file + selection dialog box to choose a file. Also add a menu choice for + this. + +2004-10-30 Dan McMahill * dan AT mcmahill dot net * + + * src/script/pcb.in: Quote "$@" to keep args whole + +2004-10-29 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/Makefile.in: add missing vendor.h + +2004-10-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: document vendor drill mapping + +2004-10-29 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.in, src/actionlist.c: regen after adding vendor + resource/mapping code + +2004-10-29 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/action.c, src/change.c, src/change.h, + src/create.c, src/pcb-menu.res, src/vendor.c, src/vendor.h: Add + support for a loadable vendor resource. The primary purpose is to + import a list of vendor supported or prefered drill sizes. The + design is then modified to change drills to sizes in the drill list. + Additionally, the vendor resource file may include DRC settings. + +2004-10-27 DJ Delorie * dj AT delorie dot com * + + * src/resmenu.c: Support multiple actions per line for -action and + -script + +2004-10-27 DJ Delorie * dj AT delorie dot com * + + * src/pcbtest.sh.in: Quote "$@" to keep args whole + +2004-10-27 DJ Delorie * dj AT delorie dot com * + + * src/actionlist.c, src/global.h, src/main.c, src/resmenu.c: Add + -action command line, to execute one action string at startup + +2004-10-27 DJ Delorie * dj AT delorie dot com * + + * src/pcb-menu.res, src/res_lex.l: Add support for comments. + Comments begin with '#' and extend to the end of the line. + +2004-10-27 DJ Delorie * dj AT delorie dot com * + + * doc/pcb.texi, doc/version.texi: Document resource file comments + +2004-10-26 Dan McMahill * dan AT mcmahill dot net * + + * src/dialog.c: remove unused variable, make sure return returns a + value on a non-void fn + +2004-10-25 Dan McMahill * dan AT mcmahill dot net * + + * src/dialog.c: Add date and compile time to the About dialog. + Patch provided as patch #1053444 by Bob Paddock. + +2004-10-25 Dan McMahill * dan AT mcmahill dot net * + + * src/buffer.c: Fix one more (last one maybe?) hires bug where when + converting a selection or buffer to element, the soldermask relief + is 100x smaller than the default. Address bug report #1049033. + +2004-10-25 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, README_FILES/Makefile.in, example/Makefile.in, + example/libraries/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, src/script/Makefile.in, tools/Makefile.in, + tutorial/Makefile.in: regen so that all Makefile.in files came from + the same version of automake + +2004-10-25 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: update date on manual since there have been + additions + +2004-10-23 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: minor fixups to make this happy again with the new + texinfo.tex + +2004-10-23 Dan McMahill * dan AT mcmahill dot net * + + * doc/texinfo.tex: update to texinfoversion 2004-09-06.16 + +2004-10-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Fix borking of name_tree when changing an element + name + + ---------------------------------------------------------------------- + +2004-10-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen + +2004-10-21 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: - override the mostlyclean-aminfo target to avoid deleting the .dvi, + .html, .pdf, and .ps versions of the manual with 'make clean'. + Since these files already go in the distfile, we don't want a 'make + clean' to remove them as that would force a dependency on TeX. This + issue was noted by Stuart Brorson. - while here let automake handle the html and pdf conversions + automatically. This ends up defaulting to texi2pdf for PDF which + seems to do a better job than ps2pdf anyway. + +2004-10-21 Dan McMahill * dan AT mcmahill dot net * + + * aclocal.m4, configure: regen + +2004-10-21 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: check for ps2pdf which is used for building the + refcard + +2004-10-21 Dan McMahill * dan AT mcmahill dot net * + + * acinclude.m4: improve the quoting so that aclocal-1.9.2 is happier + +2004-10-20 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: minor fixup in the newlib element creation guide. + +2004-10-20 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: Apply several improvements from Bob Paddock + including: - spell check - improved section on modifying newlib footprints - add section on searching for elements - add section on measurements - add appendix on regular expressions Some texinfo fixes from me. + +2004-10-17 DJ Delorie * dj AT delorie dot com * + + * src/resmenu.c: Sort actions by modifier so that both Ctrlx + and x work. + +2004-10-17 DJ Delorie * dj AT delorie dot com * + + * src/actionlist.c: Regenerated + +2004-10-17 DJ Delorie * dj AT delorie dot com * + + * src/action.c: Add FlagHaveRegex (have_regex) so that the + SelectByName menu entries work. + +2004-10-12 DJ Delorie * dj AT delorie dot com * + + * src/global.h: Oops, overzealous patching ;-) + +2004-10-12 DJ Delorie * dj AT delorie dot com * + + * src/global.h: add non-gcc definition of ATTRIBUTE_UNUSED + +2004-10-12 Dan McMahill * dan AT mcmahill dot net * + + * src/global.h: add missing #else clause in defining + ATTRIBUTE_UNUSED on non-gcc or older gcc version. Problem noted by + Dave McGuire. + +2004-10-08 DJ Delorie * dj AT delorie dot com * + + * src/rats.c: Check for numberless pins. + +2004-10-08 DJ Delorie * dj AT delorie dot com * + + * src/print.c: Print plated and unplated hole counts on separate + lines. + +2004-10-06 DJ Delorie * dj AT delorie dot com * + + * src/print.c: Avoid checking pin numbers for unnumbered pins. + +2004-09-24 DJ Delorie * dj AT delorie dot com * + + * src/actionlist.c, src/data.c, src/dialog.c, src/global.h, + src/main.c: Add command history to : widget. + +2004-09-24 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: minor tweaks to instructions + +2004-09-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c, src/move.c, src/pinout.c: Fixes for pinout window + crash. Still need to fix pinout scroll range at high zoom + +2004-09-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/misc.c: Fix error on non-quarter circle arc bounding box + calculations + +2004-09-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/menu.c: Don't ask for X,Y coordinates in third-button pop-up + menu; the coordinate is where the cursor was when the menu was + popped up. + +2004-09-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: Fixed return value of Emark_callback. (Didn't really + matter, we weren't count number of marks drawn). + +2004-09-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c: Allow Ctrl-drag to copy objects in arrow mode. + +2004-09-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Fix bug with polygon clearances from other layers + in the group. + +2004-09-08 Dan McMahill * dan AT mcmahill dot net * + + * src/set.c: add an extra digit to the display of metric + measurements. Patch from Gabriel Paubert. + +2004-09-04 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: mention the background image in 20040903 + +2004-09-03 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: update with pcb-20040903 news items + +2004-09-03 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update to get ready for next snapshot + +2004-09-03 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: add more detailed snapshot instructions + +2004-08-30 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c, src/resmenu.h: add missing headers + +2004-08-30 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_y.y: add missing prototype + +2004-08-30 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: remove unused variable + +2004-08-30 Dan McMahill * dan AT mcmahill dot net * + + * src/res_lex.l: add missing prototype + +2004-08-30 Dan McMahill * dan AT mcmahill dot net * + + * src/res_parse.y: clean up a few more compiler warnings + +2004-08-30 Dan McMahill * dan AT mcmahill dot net * + + * src/djopt.c: get rid of a bunch of format string compiler warnings + along with some unused variable warnings + +2004-08-30 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/autoplace.c, src/autoroute.c, src/buffer.c, + src/change.c, src/clip.c, src/command.c, src/compat.c, + src/control.c, src/copy.c, src/create.c, src/crosshair.c, + src/data.c, src/dev_ps.c, src/dev_rs274x.c, src/dialog.c, + src/djopt.c, src/draw.c, src/drill.c, src/error.c, src/file.c, + src/fileselect.c, src/find.c, src/global.h, src/gui.c, src/heap.c, + src/insert.c, src/intersect.c, src/lgdialog.c, src/library.c, + src/line.c, src/log.c, src/main.c, src/menu.c, src/mirror.c, + src/misc.c, src/move.c, src/mtspace.c, src/mymem.c, src/netlist.c, + src/output.c, src/parse_l.l, src/parse_y.y, src/pinout.c, + src/polygon.c, src/print.c, src/printdialog.c, src/printpanner.c, + src/rats.c, src/remove.c, src/report.c, src/res_lex.l, + src/res_parse.y, src/resmenu.c, src/rotate.c, src/rtree.c, + src/rubberband.c, src/search.c, src/select.c, src/selector.c, + src/set.c, src/sizedialog.c, src/undo.c, src/vector.c: rework the + lines which have static char *rcsid=.... to include an unused + attribute on gcc. This gets rid of a bunch of gcc -Wall warnings + which can cause some actual bugs to be lost in the noise. While here, make sure we include config.h and also dmalloc.h if + dmalloc debugging has been requested. + +2004-08-29 Dan McMahill * dan AT mcmahill dot net * + + * src/draw.c: fix a "=" instead of "==" bug + +2004-08-28 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs: update this to more closely match the current reality + +2004-08-28 Dan McMahill * dan AT mcmahill dot net * + + * src/actionlist.c: add actionlist.c for non-maintainers + +2004-08-28 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen (if we are using gcc then add -Wall) + +2004-08-28 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: if we are using gcc then add -Wall + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * src/draw.c: add missing header (for isdigit) + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * src/dev_rs274x.c: use long int in some places to avoid assigning a + long int to an int + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/rtree.c: remove some unused variables + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * src/output.c, src/resmenu.c: add a missing header + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c: remove an unused variable + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: bump updated date + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen (add pcb.1 to EXTRA_DIST) + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: add pcb.1 to EXTRA_DIST + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: document the ExecuteFile() action and the -script + command line option + +2004-08-27 Dan McMahill * dan AT mcmahill dot net * + + * src/global.h, src/main.c, src/misc.c, src/resmenu.c: add an + ExecuteFile(file) action which executes the actions contained in the + specified file. In addition, add a "-script " option + which will invoke ExecuteFile() upon startup. Eventually + (but not yet) this will be able to be used for things like + generating postscript and RS-274-X output from the command line. + +2004-08-26 Dan McMahill * dan AT mcmahill dot net * + + * src/resmenu.c: Fix a minor memory leak bug which allocated space + for 10 more pointers everytime invoke_action() was called. While here add a few comments about whats going on in this function. + +2004-08-25 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: update the table of the output files generated by + PCB + +2004-08-25 Dan McMahill * dan AT mcmahill dot net * + + * src/pcb-menu.res: use "Reference Designator" instead of "Name on + PCB" as the former is more standard + +2004-08-25 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c: exclude Makefile, Makefile.am, and Makefile.in as + valid element names as these may reside in a lib directory + +2004-08-25 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add a brief comment about what M4 is and where to + find more info + +2004-08-25 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: add one more Usage message. this time for the + RemoveSelected() action + +2004-08-25 Dan McMahill * dan AT mcmahill dot net * + + * src/main.c, src/misc.c: allow --version, --help, and --copyright + to also work since those are typically supported by GNU programs. + +2004-08-25 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: In the Usage() function be sure to restore stderr at + the beginning since this function calls exit(). This will ensure + that the Usage() message can actually be seen in all cases. Fixes + the following: clock AT oberon:~$ pcb --version clock AT oberon:~$ noted by Karel Kulhav on the gEDA mailing + list. + +2004-08-24 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen after adding pcb.1 + +2004-08-24 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am, doc/pcb.1: add a man page which says where to + look for the manual + +2004-07-31 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: avoid 'inline' unless we're using gcc. + +2004-07-31 Dan McMahill * dan AT mcmahill dot net * + + * src/res_parse.y: use foo?foo:bar instead of foo?:bar as the latter + is a gcc extension. Makes the irix c compiler happy. + +2004-07-29 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: update the 150 and 300 mil width SOIC packages per + the IPC recommendations at footprint.ipc.org. Partially addresses + the "silk on pad" bug noted in bug report #995401. + +2004-07-29 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: improve the decision on adding or not adding a silk + arc on the COMMON_SMT_DIL_MIL macro + +2004-07-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/print.c: Only clear silk on same side as pad. Patch + contributed by burto + +2004-07-10 DJ Delorie * dj AT delorie dot com * + + * doc/pcb.texi, src/draw.c, src/draw.h, src/global.h, src/main.c, + src/misc.c: Add limited support for a behind-the-board background + image. + +2004-07-08 Dan McMahill * dan AT mcmahill dot net * + + * src/rubberband.c: Fix a bug related to checking for the + intersection of a circular region defined by an line end point and + its radius and a rectangular pin/pad. The old code looked for the + intersection of the smallest square which encloses the circular + region and the rectangular pin/pad region. However this method + claims that there are intersections when in fact there are not. For + example a very wide trace has a significant area enclosed by the + square which encloses the circular region defined by the line end + and radius that is not enclosed by the circular region. The new code actually looks for intersection of the circular region + and the square region. + +2004-07-07 Dan McMahill * dan AT mcmahill dot net * + + * src/rubberband.c: fix some errors where the diameter was used + where the radius should have been used when looking for circular + regions which intersect. Fixes bug report #978412. Partial patch + provided in the bug report, additional bugs fixed by me. Note: a bug still exists when calculating line -> rectangular pad + intersection. A fix will be coming. + +2004-07-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/undo.c: Fix UndoChangeMaskSize assuming LINESTRUCT has the + mask parameter + +2004-06-30 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in, src/script/pcb.in: when running under gdb set + XAPPLRESDIR and unset XUSERFILESEARCHPATH + +2004-06-30 Dan McMahill * dan AT mcmahill dot net * + + * src/resmenu.c: make 'str' static so that the memory allocated by + MyStrdup() can properly be freed on the next call of invoke_action. + +2004-06-25 DJ Delorie * dj AT delorie dot com * + + * src/pcb-menu.res: Change size of selected objects, fix enlarge + options to actually enlarge (bug 978408) + +2004-06-25 DJ Delorie * dj AT delorie dot com * + + * src/menu.c: Cut and Copy from the popup menu now wait for a click + before acting (bug 978406) + +2004-06-24 DJ Delorie * dj AT delorie dot com * + + * src/Pcb.ad.in, src/main.c, src/menu.c, src/pcb-menu.res, + src/resmenu.c, src/resmenu.h: Add support for menu accelerators. + Replace hotkey translations with menu accelerators where + appropriate. + +2004-06-20 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Makefile.in: Run gather-actions only if + maintainer-mode + +2004-06-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/autoroute.c, src/const.h, src/menu.c, + src/pcb-menu.res: Fix live routing menu handling; patch segfault on + breaking element with no element specified. Autorouter tweaks. + +2004-06-10 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: add a few more 400mil width DIP packages (DIPxM) + +2004-06-10 Dan McMahill * dan AT mcmahill dot net * + + * src/dev_rs274x.c: make sure we define all aperture codes used by + arcs. Fixes the bug reported in bug #969903 by Werner Hoch where an + arc of a width not used by anything else in the layout does not have + its aperture defined. + +2004-06-09 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: fix the function name strings passed to MyCalloc(). + +2004-06-09 Dan McMahill * dan AT mcmahill dot net * + + * src/pcb-menu.res: Do not arbitrarily change the zoom setting + whenever running DRC. Especially if there are no DRC errors, we + don't want/need to change the zoom. Noted by Mark Becker. + +2004-06-09 Dan McMahill * dan AT mcmahill dot net * + + * src/pcb-menu.res: Add 0.5 and 0.1 mil grid selections. Requested + in RFE #876549 by John Griessen. + +2004-06-09 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c, src/misc.c, src/misc.h: Save layerstack settings prior + to running DRC and restore them afterwards so that things like + current input layer are not changed by DRC. Noted by Mark Becker. + +2004-06-05 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen after rpath flag order change + +2004-06-05 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: change the order in the list of rpath flags which + are tried out. This is because when -R was tried first, it was + accepted on linux systems because even though gcc didn't like it, it + still exited with 0. The new order seems to do the right thing on + solaris, linux, and netbsd as the compiler now actually gives an + error code for the flags it does not like. + +2004-06-05 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Be even more picky about which line is chosen as an + example. + +2004-06-04 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen (If --enable-dmalloc is given but dmalloc is not + found then error out instead of disabling dmalloc + +2004-06-04 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: If --enable-dmalloc is given but dmalloc is not + found then error out instead of disabling dmalloc + +2004-06-03 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: add usage output for several more actions + +2004-06-03 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c: Add usage output if the input arguments are not + quite right for several actions. Still have more to add, but this + is a start. + +2004-06-02 Dan McMahill * dan AT mcmahill dot net * + + * src/default_font: add @ character. Absence noted by Dave + McGuire. + +2004-06-01 Dan McMahill * dan AT mcmahill dot net * + + * src/pcb-menu.res: add a GetXY() to the 'copy selection to buffer' + menu. Needed to have a resonable reference point for the copy. + Noted by Mark Becker. + +2004-06-01 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen (fail configuration if Xaw is not found) + +2004-06-01 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: fail configuration if Xaw is not found + +2004-05-31 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: add a note to remember to do something better + with versions on the next snapshot + +2004-05-31 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: remove duplicated line + +2004-05-31 Dan McMahill * dan AT mcmahill dot net * + + * ChangeLog: update changelog with cvs2cl.pl. This file previously + was empty. + +2004-05-31 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: bump updated date to match snapshot date + +2004-05-31 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: add some release notes for the upcoming 20040530 snapshot + +2004-05-29 Dan McMahill * dan AT mcmahill dot net * + + * src/change.c: add missing prototype + +2004-05-29 Dan McMahill * dan AT mcmahill dot net * + + * globalconst.h: set MASKFRAME to be 3 (mils) instead of 0. This + way the soldermask opening will be larger than the pads for + components defined using the older style format which did not + explicitly give soldermask relief size. + +2004-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: document the SetFlag(), ClrFlag(), and ChangeFlag() + actions + +2004-05-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: correct location for Pcb appdefaults file + +2004-05-29 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in, src/script/pcb.in: For the pcb wrapper script, + if the first argument is "-gdb", pick off that flag and run pcb + inside of the gdb debugger. Should simplify debugging a bit. + +2004-05-29 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/action.h, src/change.c, src/change.h, + src/main.c: Add SetFlag, ClrFlag, and ChangeFlag actions. These + currently let you set, clear, or change the square, octagon, or + thermal pads. For example :SetFlag(SelectedVias,thermal) + :ClrFlag(SelectedObjects,square) :ChangeFlag(SelectedPads,octagon,1) + +2004-05-28 Dan McMahill * dan AT mcmahill dot net * + + * src/djopt.c: Fix the segfault bug noted in bug report #959073 by + Bob Paddock. While here, also fix a bug which can potentially cause + a floating point exception. + +2004-05-28 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure: regen after adding rint() test + +2004-05-28 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add test for rint() + +2004-05-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/version.texi: bump date + +2004-05-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add INFO-DIR-SECTION Miscellaneous per bug #957369 + submitted by Mike Frysinger + +2004-05-23 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: update the COMMON_SMT_2PAD_MIL macro to the newer + element format. With this change, the soldermask relief and + clearance can now be specified for the pads. This fixes the issue + noted recently on the geda mailing list about 0805 footprints from + the ~geda library having soldermask openings which are the same size + as the pads. + +2004-05-14 Dan McMahill * dan AT mcmahill dot net * + + * src/dev_ps.c: make sure we get the preamble in all EPS output + files. Bug noted by David Koski + +2004-05-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: add SOJ packages (lots of them) + +2004-05-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: fix a hi-res bug in the polarity arc silk for some + SMT DIL pkgs + +2004-05-14 Dan McMahill * dan AT mcmahill dot net * + + * src/res_parse.y: add missing string.h (for strcmp). Noted by Dave + McGuire + +2004-05-14 Dan McMahill * dan AT mcmahill dot net * + + * src/pcbtest.sh.in, src/script/pcb.in: unset XUSERFILESEARCHPATH + which causes a conflict with XAPPLRESDIR + +2004-05-14 Dan McMahill * dan AT mcmahill dot net * + + * src/resource.h: add a comment + +2004-05-13 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: correct the pin/pad bounding box calculation. Bug + noted by David Koski. + +2004-05-05 Dan McMahill * dan AT mcmahill dot net * + + * src/macro.h: fix typo in comment + +2004-05-02 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c, src/pcb-menu.res: Add flag to default to optimizing + only autorouted nets, plus menu option to control it. + +2004-05-02 DJ Delorie * dj AT delorie dot com * + + * src/resmenu.c: Don't use local var for widget name. + +2004-05-02 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Fix bug wrt intersecting layer groups in miter + +2004-05-02 DJ Delorie * dj AT delorie dot com * + + * src/menu.c, src/resmenu.c: Remove gcc-isms + +2004-05-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: fix typo + +2004-05-01 Dan McMahill * dan AT mcmahill dot net * + + * src/resmenu.c: protect the inclusion of string.h with + HAVE_STRING_H + +2004-04-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/minicircuits.inc: adjust spacing between the 2 rows of pins to + better match the datasheet + +2004-04-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: clarify a comment + +2004-04-30 Dan McMahill * dan AT mcmahill dot net * + + * src/Pcb.ad.in, src/action.c, src/file.c, src/find.c, + src/global.h, src/macro.h, src/main.c, src/parse_y.y, + src/sizedialog.c: Add some DRC checking of silkscreen layers. + Currently this check looks for minimum widths of silk lines. + Currently not checked are: - silk polygons - silk text - wide silk lines made by overlapping several narrow silk lines + +2004-04-30 Dan McMahill * dan AT mcmahill dot net * + + * src/find.c: put a string which is repeated several times into a + #define and use that macro instead. + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * src/autoplace.h, src/autoroute.h, src/djopt.h, src/drill.h, + src/heap.h, src/intersect.h, src/netlist.h, src/output.c, + src/rats.c, src/resmenu.h, src/rtree.h, src/selector.c, + src/vector.h: RCS Id police + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.in: regen + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am: minor fixes to get the distcheck target working + again. + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add a note about the centroid and bill of materials + output. While here add a feature list near the top of the document + to help a new user quickly answer the question "what is pcb and what + can it do?". + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * src/resmenu.c: RCS Id and config.h police + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * src/print.c: When printing to RS-274-X also generate a centroid + data file (X-Y data) with the required data to drive a pick and + place machine. The centroid of each part is calculated from the + center of each pin/pad. The rotation is determined by looking at + the angle of pin1 relative to the centroid. In addition, generate a bill of materials file. This lists the + part, quantity, and list of reference designators. + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * src/res_lex.l, src/res_parse.y, src/resmenu.c: fix some 64-bit + bugs to get this working on my alpha. Of prime importance, an int + isn't big enough to hold a pointer. + +2004-04-29 Dan McMahill * dan AT mcmahill dot net * + + * src/resource.h: RCS Id police + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * src/res_lex.l, src/res_parse.y: RCS Id police + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * src/misc.c: put variable declarations at the beginning of + functions. Avoids syntax error on gcc-2.95 + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * lib/amp.inc, lib/bourns.inc, lib/johnstech.inc, + lib/minicircuits.inc, lib/panasonic.inc: fix the EXTRACT_END flag + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in, lib/common.m4, lib/cts.inc: add + cts library containing CTS series 742/3/4/5/6 resistor packs + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * lib/johnstech.inc, lib/smt.inc: fix refdes silk size + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * lib/dil.inc, lib/geda.inc: Fix SDIP (shrink DIP) footprints. + Patch from Wojciech Kazubski in RFE #929697 slightly modified by me. + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * lib/panasonic.inc: Correct the spacing between the rows of pads. + Also fix one of the pad widths on a footprint which was obviously + broken. + +2004-04-28 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: hires-ify the COMMON_SMT_DIL_MIL macro. The macro + already took input arguments in 1/1000 mil so now we simple only + reduce the resolution to 1/100 mil in the output instead of to 1 + mil. This also helps the COMMON_SMT_DIL_MM which calls the + COMMON_SMT_DIL_MIL macro. + +2004-04-27 Dan McMahill * dan AT mcmahill dot net * + + * src/tmp.txt: test commit #3 + +2004-04-27 Dan McMahill * dan AT mcmahill dot net * + + * src/tmp.txt: test commit #2 + +2004-04-27 Dan McMahill * dan AT mcmahill dot net * + + * src/tmp.txt: test commit + +2004-04-27 DJ Delorie * dj AT delorie dot com * + + * doc/version.texi: add version.texi for non-maintainers + +2004-04-27 DJ Delorie * dj AT delorie dot com * + + * doc/pcb.texi, src/Makefile.am, src/Makefile.in, src/Pcb.ad.in, + src/Pcb.ad.raw, src/Pcb.ad.small, src/action.h, src/dialog.c, + src/gather-actions, src/global.h, src/gui.c, src/main.c, + src/menu.c, src/menu.h, src/misc.c, src/misc.h, src/pcb-menu.res, + src/res_lex.l, src/res_parse.y, src/resmenu.c, src/resmenu.h, + src/resource.h, src/set.c, src/sizedialog.c: add file-driven menus + +2004-04-27 DJ Delorie * dj AT delorie dot com * + + * Makefile.in, ylwrap: add ylwrap + +2004-04-27 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: More autorouter improvements, some bug fixes + +2004-04-26 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/mtspace.c: Significant improvements to + autorouting of congested designs + +2004-04-25 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/global.h, src/rtree.c: Fix rtree memory management bugs + +2004-04-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: Fix a bug that allocates too much memory to store + pointers + +2004-04-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c, src/move.c: Fix some bugs with rtree based name + handling + +2004-04-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/find.c, src/rats.c: More autorouter + improvements. Improve trace appearance, slightly speed up and allow + it to use power planes + +2004-04-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/change.c, src/copy.c, src/file.c, src/insert.c, + src/move.c, src/polygon.c, src/polygon.h, src/remove.c, + src/rotate.c: Fix pin-in-poly bug; because polys can overlap can + never check one single polygon. + +2004-04-12 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/djopt.c: Restore mistakenly lost lines in + djopt, and various improvements to auto-router + +2004-04-11 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/move.c: Argh, another attempt to properly fix the bug + +2004-04-11 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/djopt.c, src/move.c: Fixup some errors introduced in last + patch + +2004-04-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/djopt.c: Fix segfault with edge-connector elements (pads on + both sides) + +2004-04-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c, src/insert.c, src/move.c, src/output.c: Various bug + fixes + +2004-03-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/autoroute.c, src/global.h, src/menu.c: Still + more improvements to the router, plus can show it's action on + screen. + +2004-03-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/box.h, src/mtspace.c, src/mtspace.h: More + improvements to the autorouter + +2004-03-26 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/create.c: Forbid diagonal pads when created externally with an + editor + +2004-03-25 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: Some improvements to autorouter - still need to + better handle mtspace structures so there is not so much duplicate + effort with multiple route styles + +2004-03-23 DJ Delorie * dj AT delorie dot com * + + * src/parse_y.y: Provide our own yywrap(), just in case. + +2004-03-22 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in: Fix a couple of key binding bugs + +2004-03-22 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: Fix some re-drawing issues after finding connections + +2004-03-22 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: Fix some autoroute bugs; add proper style + handling to autorouter + +2004-03-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/report.c, src/rtree.c: Provide better rtree visualization + capability + +2004-03-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c, src/change.c, src/create.c, src/dev_ps.c, + src/draw.c, src/global.h, src/misc.c, src/move.c, src/move.h, + src/mymem.c, src/print.c, src/printpanner.c, src/remove.c, + src/rotate.c, src/search.c: Use rtree to search element names; fix + postscript paper handling; fix silk names clipped over pins/pads + +2004-03-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c, src/rtree.h: Slight optimization of tree + construction, plus add means to visualize tree + +2004-03-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/file.c: Don't use _LOOP macros for writing files in order to + preserver ordering so that diff can be effectively used on pcb files + +2004-03-19 Dan McMahill * dan AT mcmahill dot net * + + * lib/johnstech.inc: increase soldermask relief on mounting pads + +2004-03-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/const.h, src/draw.c, src/polygon.c: Use sqrt(2)/2 defined in + math library when available + +2004-03-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rats.c: Handle shorts to unnamed elements and pins + +2004-03-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/line.c: Forgot to check this in with the _LOOP macro changes + +2004-03-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/dev_ps.c, src/print.c: Add assembly drawing output for + postscript + +2004-03-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/autoplace.c, src/autoroute.c, src/buffer.c, + src/change.c, src/copy.c, src/create.c, src/crosshair.c, + src/dev_ps.c, src/dev_rs274x.c, src/djopt.c, src/draw.c, + src/drill.c, src/file.c, src/find.c, src/global.h, src/library.c, + src/macro.h, src/menu.c, src/mirror.c, src/misc.c, src/move.c, + src/mymem.c, src/netlist.c, src/pinout.c, src/polygon.c, + src/print.c, src/rats.c, src/remove.c, src/report.c, src/rotate.c, + src/rtree.c, src/rubberband.c, src/search.c, src/select.c, + src/set.c, src/undo.c: Change _LOOP macros so that gdb can break + inside the loop + +2004-03-17 Dan McMahill * dan AT mcmahill dot net * + + * src/rtree.c: revert last change. Some compilers including + gcc-2.95.3 do not like it. ok'ed by harry. + +2004-03-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoplace.c, src/intersect.c: Various fixes to autoplacement + code + +2004-03-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/set.c: auto drc bug fix + +2004-03-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c: Acknowledge placement + +2004-03-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/netlist.c, src/rats.c: Fix memory leaks + +2004-03-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rotate.c: corrctly distinguish rubberand rat lines + +2004-03-11 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: Remove unnecessary union identifier to clarify code + +2004-03-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c: Fix polygon insert point bug introduced when + reorganizing code + +2004-03-10 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: 100 pin QFP packages have 100 pins not 72 + +2004-03-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/error.c: Fix for bad pipe handling under cygwin + +2004-03-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: Minimize rectangle fills + +2004-03-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Oops - this fixes the error introduced moving to + IsPadInPolygon + +2004-03-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c: Use SQUARE macro + +2004-03-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/change.c, src/create.c, src/rats.c: clean up + code to use SQUARE macro and fix via mask update bug + +2004-03-09 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c, src/find.c, src/find.h, src/polygon.c, src/print.c, + src/search.c, src/search.h: Erase silk over solder regions when they + cross and display that way on screen + +2004-03-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: Streamline code for clustering + +2004-03-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in, src/action.c: Added a function { AddRats(Close) + bound to shift-n } that selects the shortest unselected ratline and + centers the screen view on it. + +2004-03-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c, src/crosshair.h, src/line.c, src/line.h: New + Auto-DRC line drawing mode implemented. + +2004-03-07 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c, src/draw.h: Forgot to checkin draw.h; fix some bugs + with really high zoom + +2004-03-07 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: Avoid doubling DRC clearance between non-clearing + polygons and square pins/pads + +2004-03-07 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/buffer.c, src/change.c, src/create.c, + src/dialog.c, src/draw.c, src/find.c, src/global.h, src/move.c, + src/move.h, src/mymem.c, src/output.c, src/printpanner.c, + src/remove.c, src/rotate.c, src/rtree.c, src/search.c, src/select.c: + Fixes for various bugs introduced with the rtree database + infrastructure + +2004-03-07 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/menu.c, src/misc.c: A couple of bug fixes: absolute negative + value entries (e.g. =-4) also check the correct zoom level in the + menu + +2004-03-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/select.h: Fix conditional compile variable name + +2004-03-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/library.c, src/mymem.c, src/output.c, src/polygon.c: Fixes for + several memory leaks and some uninitialized varibable bugs + +2004-03-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/file.c, src/parse_l.l, src/parse_y.y: Save the DRC settings in + the board file + +2004-03-04 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in, src/dev_ps.c, src/global.h, src/printdialog.c, + src/printpanner.c: Fix the postscript print panner bugs introduced + with hi-res; also fix the long-standing bug where the default media + selection wasn't used + +2004-03-04 Dan McMahill * dan AT mcmahill dot net * + + * src/select.h: one more regex bug fix noted by Matt Ettus + +2004-03-04 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: document the ToggleVisibility action + +2004-03-04 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/action.h, src/main.c: Added a new action which + will toggle the visibility of layers without clicking on them. + Intended to be bound to keys. Patch provided by Matt Ettus in patch + #908658. + +2004-03-04 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/menu.c, src/select.c: enable the regex select + stuff. A trial of a regex select of some components seems to work. + Prompted by patches provided by Matt Ettus in patch submission + 908651. + +2004-03-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: a HEADER60_2 should have 60 pins not 50 as noted in + bug report 900231 + +2004-03-03 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * globalconst.h, src/action.c, src/draw.c, src/misc.c, src/move.c, + src/report.c: Fixes for element line boundry handling + +2004-03-01 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/move.c: Fix for search element bounding box error + +2004-03-01 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c, src/crosshair.h: These were updated too for the + auto-DRC infrastructure + +2004-03-01 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/change.c, src/control.c, src/control.h, + src/find.c, src/find.h, src/global.h, src/misc.c, src/misc.h, + src/move.c, src/output.c, src/search.c, src/set.c: Some intersection + bug fixes and more rtree infrastructure change Also more ground work + for auto drc line mode + +2004-02-29 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.in: Regenerate. + +2004-02-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/buffer.c, src/change.c, src/const.h, + src/create.c, src/draw.c, src/find.c, src/global.h, src/insert.c, + src/menu.c, src/misc.c, src/misc.h, src/move.c, src/remove.c, + src/search.c, src/set.c, src/undo.c: More usage of rtrees for rats, + pins and pads. Some foundation work for a new auto-drc line drawing + mode, and some bug fixes. + +2004-02-27 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c, src/create.c, src/find.c, src/global.h, src/menu.c, + src/misc.c, src/move.c, src/mymem.c, src/remove.c, src/rtree.c, + src/rtree.h: Store pins/pads in rtree + +2004-02-27 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: Fixes for some compiler warnings + +2004-02-27 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/clip.c, src/clip.h: Oh Yeah, the drawing clipping won't work + without these files! + +2004-02-27 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Makefile.am, src/Makefile.in, src/action.c, src/create.c, + src/data.c, src/data.h, src/draw.c, src/global.h, src/insert.c, + src/insert.h, src/line.c, src/line.h, src/macro.h, src/misc.c, + src/output.c, src/parse_y.y, src/polygon.c, src/report.c: Fixes for + clipping the drawing. Simple saturation could change the geometry + when zoomed way in. Also some organizational changes to make the + code easier to maintain. + +2004-02-27 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: clarify the pad creation a little + +2004-02-27 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/misc.c: Fix for text bounding box error + +2004-02-25 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/const.h, src/crosshair.c, src/menu.c: Add a + feature to display design-rule clearance arround prospective + line/arc/via + +2004-02-25 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c, src/search.c: Fix some DRC bugs with square pins + +2004-02-20 Dan McMahill * dan AT mcmahill dot net * + + * lib/misc.inc: whitespace fix + +2004-02-19 Dan McMahill * dan AT mcmahill dot net * + + * lib/connector.inc: add a PKG_CONNECTOR_DIL for 2 column headers + with DIL pin numbering. This fixes the HEADER*_1 entries in the + geda footprint library. + +2004-02-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c: Fix typo that caused bug in via tree handling. + +2004-02-17 Dan McMahill * dan AT mcmahill dot net * + + * lib/generic.list: remove extra whitespace in generic208_lqfp + +2004-02-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/draw.c, src/find.c, src/polygon.c, + src/polygon.h, src/print.c, src/report.c, src/rtree.c: Bug fixes for + design rule checking + +2004-02-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: Make rtree routines reentrant since now they are used + that way when drawing during DRC. + +2004-02-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/autoplace.c, src/autoroute.c, src/buffer.c, + src/change.c, src/copy.c, src/create.c, src/dev_ps.c, src/draw.c, + src/file.c, src/find.c, src/find.h, src/global.h, src/insert.c, + src/macro.h, src/main.c, src/mirror.c, src/mirror.h, src/misc.c, + src/misc.h, src/move.c, src/move.h, src/mtspace.c, src/mymem.c, + src/mymem.h, src/parse_y.y, src/pinout.c, src/polygon.c, + src/polygon.h, src/print.c, src/rats.c, src/remove.c, src/report.c, + src/rotate.c, src/rotate.h, src/rtree.c, src/rtree.h, + src/rubberband.c, src/search.c, src/search.h, src/select.c, + src/undo.c: Large number of changes to keep most of the database in + rtrees and avoid linear searches + +2004-02-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Fix minor bug in pad clearance adjustment + +2004-02-15 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.in: regen after adding compat.c/h + +2004-02-15 Dan McMahill * dan AT mcmahill dot net * + + * src/Makefile.am, src/compat.c, src/compat.h, src/draw.c, + src/set.c: add a place for putting our own implementation of + missing/broken functions. For now add a logf and expf to help + solaris. + +2004-02-15 Dan McMahill * dan AT mcmahill dot net * + + * tools/Makefile.am, tools/Makefile.in: install MergePCBPS and + Merge_dimPBPS + +2004-02-15 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in, configure: regen after adding logf and expf checks + +2004-02-15 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add checks for logf and expf + +2004-02-15 Dan McMahill * dan AT mcmahill dot net * + + * src/create.c, src/dev_ps.c, src/dev_rs274x.c, src/draw.c, + src/file.c, src/global.h, src/parse_l.l, src/parse_y.y: add a way to + control the scale factor associated with thermals. This is a global + value stored in the .pcb file. The default gives the same behaviour + as previous version. By increasing the scale factor, the width of + the spokes increases. Eventually it would be nice to make this be + per pin/via. + +2004-02-15 Dan McMahill * dan AT mcmahill dot net * + + * src/report.c: correct the drill diameter in the drill report after + the hi-res changes + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Fixed syntax error and potential bug + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: Elliminate pre-computing of octagons - there are too + many with .01 mil resolution + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c, src/polygon.c: More non-clearing polygon fixes + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c, src/dev_rs274x.c, src/draw.c, src/macro.h, + src/menu.c, src/polygon.c, src/print.c, src/rubberband.c: Fixed some + bugs with non-clearing polygons and made GROUP_LOOP macro + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/crosshair.c, src/macro.h: Fix arc creation tool + when crosshair is on-axis with start point + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/report.c, src/report.h: Report on points and fix some + formating + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/set.c: Fix formatting mismatch + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Fixup includes and trivial bug + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/move.c: fix includes for Message() + +2004-02-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/menu.c: add left/right buffer mirror menu entry + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in, src/action.c, src/find.c, src/global.h, + src/insert.c, src/main.c, src/polygon.c, src/polygon.h, + src/print.c, src/report.c, src/set.c, src/sizedialog.c: More + complete and sensible DRC checking + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/move.c, src/search.c: Prevent changing layers of locked + objects, find ratlines before other layer objects + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/buffer.c, src/buffer.h, src/menu.c: Added + function to mirror the buffer + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c: Recalculate arc bounding box when swaping the side + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/dialog.c: Updated about dialog + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rats.c: Use warn color on pins/pads even when netname is known + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Only change masks with size change when they're + non-zero to begin with + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Allow +0 change to mask size to make it equal the + underlying copper + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/change.c, src/select.c: Proper handling of all + text scalings + +2004-02-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/select.c: Handle element name size changing + properly + +2004-02-12 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Automatically adjust mask size when copper size is + changed + +2004-02-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/print.c: Fixed output bug with persistant thermal changes + +2004-02-09 Dan McMahill * dan AT mcmahill dot net * + + * tools/Makefile.in: regen after adding Merge_dimPCBPS + +2004-02-09 Dan McMahill * dan AT mcmahill dot net * + + * tools/Makefile.am: add Merge_dimPCBPS + +2004-02-09 Dan McMahill * dan AT mcmahill dot net * + + * tools/MergePCBPS, tools/Merge_dimPCBPS: #/bin/sh -> #!/bin/sh to + make these execute correctly. While here, add RCS Id's. + +2004-02-07 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: Find more errors when skipping through DRCs + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/find.c, src/find.h: Added feature to continue + checking drc after first error is found + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Prevent clearance size adjustment from changing + joined lines to unjoined + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/set.c: Fix bug where local reference mark was not erased + properly + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/file.c: Fix bug where loading pcb didn't restore saved view + position correctly + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/global.h, src/undo.c: Fixed undo change text size bug + introduced with hi-res changes + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: Special drawing mode to examine planes for break-up + due to tracks routing through them. + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * tools/Merge_dimPCBPS: Add a tool to merge to PCB postscript files + where the first one is printed in a light gray color. This is useful + for making an assembly drawing where the front tracks are shown in + light gray while the silkscreen is solid black. + +2004-02-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c, src/macro.h, src/polygon.c, src/print.c: Make + persistant thermal flags for easier changes to polygons + +2004-02-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/const.h, src/menu.c: Add mode for poly viewing + to help spot broken planes + +2004-02-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/main.c: Fix text scaling intialization + +2004-02-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/dev_rs274x.c: Fix a couple of gerber bugs introduced with + hi-res + +2004-02-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Warn on unplated holes piercing polygons + +2004-02-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/print.c: Don't clear pure-holes in polygons + +2004-02-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Fix bug in PIP flags + +2004-02-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/dev_rs274x.c, src/find.c, src/find.h, src/print.c: Fixed some + gerber hi-res bugs and some complex ground-plane print issues + +2004-02-04 DJ Delorie * dj AT delorie dot com * + + * example/libraries/Makefile.in: * Detect re_comp(), regcomp(), and (select.c doesn't use + the new HAVE_* yet, this is a prelude to it). * Set -DNDEBUG for all src/* compiles. * Support maintainer mode (--enable-maintainer-mode) (I got tired of having half the world regenerated just because I did a "cvs + update") * Detect tgif, if not found pad.{png,eps} just isn't built (what's that for, anyway?) Prebuilt copies of those should be checked in too at some point. + +2004-02-04 DJ Delorie * dj AT delorie dot com * + + * Makefile.in, README_FILES/Makefile.in, aclocal.m4, config.h.in, + configure, configure.ac, doc/Makefile.am, doc/Makefile.in, + example/Makefile.in, lib/Makefile.in, + newlib/2_pin_thru-hole_packages/Makefile.in, newlib/Makefile.in, + newlib/analog-devices/Makefile.in, newlib/burr-brown/Makefile.in, + newlib/connectors/Makefile.in, newlib/crystal/Makefile.in, + newlib/cypress/Makefile.in, newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.am, + src/Makefile.in, src/icons/Makefile.in, src/script/Makefile.in, + tools/Makefile.in, tutorial/Makefile.in: * Detect re_comp(), regcomp(), and (select.c doesn't use + the new HAVE_* yet, this is a prelude to it). * Set -DNDEBUG for all src/* compiles. * Support maintainer mode (--enable-maintainer-mode) (I got tired of having half the world regenerated just because I did a "cvs + update") * Detect tgif, if not found pad.{png,eps} just isn't built (what's that for, anyway?) Prebuilt copies of those should be checked in too at some point. + +2004-02-04 DJ Delorie * dj AT delorie dot com * + + * src/draw.c: Don't assume that an all-ones pixel is white. + +2004-02-03 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/menu.c: Fixes for hi-res bugs + +2004-02-03 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/print.c: Changes to the fab drawing for improved clarity and + allows for a an outline route by naming a layer "outline" or "route" + +2004-02-03 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/error.c: Added a line count to Message mechanism + +2004-02-03 Dan McMahill * dan AT mcmahill dot net * + + * NEWS: note harry's hi-res changes. + +2004-02-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/heap.c, src/heap.h: More speed-ups for the + router + +2004-02-01 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/print.c: Change gerber drill files to have .cnc suffix and + name the component side output group "front", the solder-side output + "back" + +2004-02-01 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/parse_y.y: A couple of bug fixes for arc + handling in hi-res + +2004-01-31 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c: More speed-up changes. Limit the intial search in + FindIntersecting + +2004-01-31 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c: Minor comment changes and some tiny tweaks + +2004-01-31 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/buffer.c: Fix bug in element name mirroring when elements are + created on the solder side + +2004-01-30 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/main.c: Fix initial screen/offscreen zoom + +2004-01-30 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/polygon.c: Some Hi-res fixes plus elliminat too close to + polygon concept + +2004-01-30 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/output.c: Fixed the auto-scroll broken when switched to hi-res + +2004-01-30 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rats.c: Fix bug introduced changing to hi-res + +2004-01-29 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/box.h: More speed ups to the auto-router + code. This is only code streamlining, there is no algorithm change + +2004-01-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/kdtree.c, src/kdtree.h: The kdtree has been replaced with + rtree which is faster given the way it is used + +2004-01-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/rtree.c, src/rtree.h: rtree for faster rectangle intersection + searching + +2004-01-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Makefile.am, src/Makefile.in, src/autoplace.c, + src/autoroute.c, src/mtspace.c: replaced kd-tree with r-tree for + faster auto-routing + +2004-01-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c: Fix for smashing element in place + +2004-01-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/heap.h, src/kdtree.c, src/kdtree.h: Fixes for + auto-router with hi-res and some speed-ups of its operation + +2004-01-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: Speed up polygon/polygon intersection testing. The + special case is *all* points inside polygon, not just some points so + only one point need be tested + +2004-01-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/const.h, src/data.c, src/data.h, src/draw.c, src/draw.h, + src/file.c, src/global.h, src/macro.h, src/main.c, src/menu.c, + src/parse_y.y, src/pinout.c, src/set.c, src/set.h: Modifications to + support arbitrary zoom ratios + +2004-01-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/menu.c: Fix for intermediate zoom levels + +2004-01-18 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * globalconst.h, src/Pcb.ad.in, src/data.c, src/draw.c, + src/macro.h, src/output.c, src/parse_y.y, src/set.c: Added some + intermediate zooms, so now it goes by sqrt(2) + +2004-01-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/menu.c: Add menu item to auto-route only selected rats + +2004-01-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/output.c: Increase the minimum size of the panner control + +2004-01-17 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/main.c: Fix some default sizes for hi-res when no resource + file is available + +2004-01-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/action.h, src/menu.c: Added support to smash an + element in place + +2004-01-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/const.h, src/menu.c, src/misc.c, src/set.c: + Added Local reference measurement for line drawing and allow + not-overriding the mark position for moves and line-drawing + +2004-01-15 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in, src/action.c, src/main.c, src/set.c, src/set.h: Fix + to keep mode setting and add a function for moving an object by/to + numerical coordinates + +2004-01-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in, src/action.c, src/command.c, src/misc.c: Tweaks for + case-insensitive command arguments, keyboard adjust of grid and + fixed a couple of absolute/relative bugs. + +2004-01-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/misc.c: Turned off debugging messages + +2004-01-14 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/macro.h, src/misc.c, src/output.c: Fixes for several + solder-side viewing bugs introduced with hi-res changes + +2004-01-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/djopt.c: Fixed for new definition of mils for savings report + +2004-01-13 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/box.h, src/mtspace.c: Fix for mtspace coalesce; hi-res + requires floats for area computation + +2004-01-10 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/draw.c, src/report.c: Fixes for text scaling + +2004-01-10 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_y.y: One more hi-res buglet. Correct parsing of 'Arc'. + Thanks to Bill Wilson for catching this one. + +2004-01-09 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: partially undo the last change with respect to + quoting. Only quote $2. This keeps the reference designator from + being expanded as desired but lets the Description field get + expanded as desired. + +2004-01-08 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * Makefile.in, aclocal.m4, configure, doc/Makefile.in, + lib/Makefile.in, newlib/2_pin_thru-hole_packages/Makefile.in, + newlib/Makefile.in, newlib/analog-devices/Makefile.in, + newlib/burr-brown/Makefile.in, newlib/connectors/Makefile.in, + newlib/crystal/Makefile.in, newlib/cypress/Makefile.in, + newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Pcb.ad.in, + src/action.c, src/icons/Makefile.in, src/main.c, src/misc.c, + src/script/Makefile.in: Fixes for absolute/relative size change. + Also added repeat last typed command and fixed a few hi-res bugs. + +2004-01-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/set.c: Fixed sign display in fractional mil part of crosshair + +2004-01-06 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c: Fix for Display(Save|Restore) + +2004-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/print.c: fix generation of fab drawing with the high + resolution changes + +2004-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/dev_rs274x.c: fix a couple of other bugs related to the high + res changes. In particular, correct the aperture for the fab + drawing and for the outline. Also fix up text output. + +2004-01-05 Dan McMahill * dan AT mcmahill dot net * + + * lib/johnstech.inc: Convert to a high resolution footprint. Pads + are a little more accurate now. + +2004-01-05 Dan McMahill * dan AT mcmahill dot net * + + * src/dev_rs274x.c: correct the aperture definition output lines and + the drill tool definition output lines after the hi-res change. + Gerber output should be ok again. + +2004-01-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in: fixed missing continuation in scroll commands + +2004-01-05 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * configure, configure.ac, globalconst.h, src/Makefile.in, + src/Pcb.ad.in, src/action.c, src/action.h, src/autoplace.c, + src/autoplace.h, src/autoroute.c, src/autoroute.h, src/box.h, + src/buffer.c, src/buffer.h, src/change.c, src/change.h, + src/const.h, src/copy.c, src/copy.h, src/create.c, src/create.h, + src/crosshair.c, src/crosshair.h, src/data.c, src/data.h, + src/dev_ps.c, src/dev_rs274x.c, src/djopt.c, src/djopt.h, + src/draw.c, src/drill.h, src/file.c, src/find.c, src/find.h, + src/global.h, src/gui.c, src/gui.h, src/heap.h, src/insert.c, + src/insert.h, src/intersect.c, src/intersect.h, src/kdtree.c, + src/kdtree.h, src/macro.h, src/main.c, src/menu.c, src/mirror.c, + src/mirror.h, src/misc.c, src/misc.h, src/move.c, src/move.h, + src/mtspace.c, src/mtspace.h, src/netlist.c, src/netlist.h, + src/output.c, src/output.h, src/parse_y.y, src/pinout.c, + src/polygon.c, src/polygon.h, src/print.c, src/print.h, src/rats.c, + src/report.c, src/rotate.c, src/rotate.h, src/rubberband.c, + src/search.c, src/search.h, src/set.c, src/set.h, src/sizedialog.c, + src/undo.c, src/undo.h, src/vector.h: Many changes to add 0.01 mil + resolution + +2004-01-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/change.c: Display pin/pad number when prompting for name + +2004-01-02 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: Minor correction to not attempt to write vertical null + strings + +2004-01-02 Dan McMahill * dan AT mcmahill dot net * + + * doc/refcard.tex: add missing RCS Id + +2004-01-02 Dan McMahill * dan AT mcmahill dot net * + + * src/autoplace.c, src/autoplace.h, src/autoroute.c, + src/autoroute.h, src/box.h, src/djopt.c, src/djopt.h, src/drill.h, + src/gui.c, src/gui.h, src/heap.c, src/heap.h, src/intersect.c, + src/intersect.h, src/kdtree.c, src/kdtree.h, src/mtspace.c, + src/mtspace.h, src/netlist.c, src/netlist.h, src/rats.c, + src/vector.c, src/vector.h: add missing RCS Id + +2004-01-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: - modify the 2 pad smt base definition to put the origin of the + footprint at the common centroid. Useful both for driving pick and + place as noted in bug report 716519 and for centering a part on a + grid. - while here make sure the $1, $2, and $3 arguments to the various macros are properly quoted. This helps avoid some obscure bugs with generated layouts from gEDA. + +2004-01-01 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/draw.c: Font metrics need to be outside TO_DRAW() macros + +2004-01-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: fix some quoting + +2004-01-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/amphenol.inc: bump copyright date + +2004-01-01 Dan McMahill * dan AT mcmahill dot net * + + * lib/amphenol.inc: properly pass down the arguments to the + underlying macro for the PKG_AMPHENOL_ARFX123{0,1,2} packages + +2004-01-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/wishlist.txt: add element versioning and database of good + elements + +2004-01-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/wishlist.txt: add a features wish list. not sure if this is + the best place for such a thing, but for now it'll do. + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.in: regen after adding amp library + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/amp.inc, lib/common.m4: add Amp connector + library. Currently its populated with the 767054 series of Mictor + connectors. + +2003-12-31 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/menu.c: Fixed menu selection of metric grids: The + C-preprocessor won't change string literals of course. + +2003-12-31 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/Pcb.ad.in, src/const.h, src/draw.c, src/misc.c: Added vertical + text support for pinout descriptions + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: with reverse order numbering in COMMON_SMT_DIL_MIL + and COMMON_SMT_DIL_MM, make sure the pin number matches the pin + name. + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/panasonic.inc: fix typo in a comment + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/smt.inc: add SC70_3, SC70_4, SC70_5, and SC70_6 + footprints (the 3,4,5, and 6 pin SC70 family). + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/to.inc: rename the SOT23 and SOT323 footprints here to + SOT23_CEL and SOT323_CEL to avoid a conflict with the ones defined + in the geda library. The "CEL" part reflects that the pin numbering + is the one used by CEL which is different from what others seem to + use. + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.in: regen after adding panasonic library + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/common.m4, lib/panasonic.inc: Add the + panasonic EXB series of chip resistor arrays. + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: deal with SMT DIL packages with an odd number of pads + per side + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: add an extra argument to COMMON_SMT_DIL_MIL and + COMMON_SMT_DIL_MM to allow the pins to go in the reverse order to + deal with some non-standard pinouts like the mini-circuits KK81 + package. + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.in: regen after adding minicircuits + +2003-12-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/common.m4, lib/minicircuits.inc: add several + minicircuits packages + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.in: regen after adding bourns library + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/smt.inc: - add a handful of 3 pin SMT EMI filter footprints - add US* family of SMT packages. + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/connector.inc: add through hole test point footprint. + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/common.m4: include the bourns library + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/amphenol.inc, lib/amphenol.list, lib/amphenol.m4: add some + more SMA connectors + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/bourns.inc: add bourns 3224G, 3224J, 3224W, + and 3224X trim pots + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add note about the dangers of whitespace in .list + files + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/amphenol.m4: correct capitalization for amphenol_ARFX1229 + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/amphenol.list: remove extra whitespace at end of ARFX1229 line + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.in: regen after adding amphenol library + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/amphenol.inc, lib/amphenol.list, + lib/amphenol.m4, lib/common.m4: Add amphenol connectors. Start out + with the ARFX1229 SMA connector. + +2003-12-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/connector.inc, lib/geda.inc: add MTA100 connectors + +2003-12-30 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/autoplace.c, src/buffer.c, src/change.c, + src/copy.c, src/create.c, src/crosshair.c, src/dev_ps.c, + src/dev_rs274x.c, src/dialog.c, src/draw.c, src/drill.c, + src/file.c, src/find.c, src/library.c, src/menu.c, src/mirror.c, + src/misc.c, src/move.c, src/mymem.c, src/netlist.c, src/pinout.c, + src/polygon.c, src/print.c, src/rats.c, src/remove.c, src/report.c, + src/rotate.c, src/rubberband.c, src/search.c, src/select.c, + src/set.c, src/undo.c: Ok, this complete the formating changes. + Whew! + +2003-12-29 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/file.c: Fixed another glitch during format change + +2003-12-29 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c: Fixed a polygon/polygon intersection bug where a wrong + point index was used + +2003-12-29 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/file.c: Restored accidentally deleted line during formating + change. + +2003-12-29 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/action.c, src/autoplace.c, src/buffer.c, src/change.c, + src/command.c, src/control.c, src/copy.c, src/create.c, + src/crosshair.c, src/dev_ps.c, src/dev_rs274x.c, src/dialog.c, + src/draw.c, src/drill.c, src/error.c, src/file.c, src/fileselect.c, + src/find.c, src/gui.c, src/insert.c, src/kdtree.c, src/lgdialog.c, + src/library.c, src/log.c, src/main.c, src/menu.c, src/mirror.c, + src/misc.c, src/move.c, src/mtspace.c, src/mymem.c, src/netlist.c, + src/output.c, src/pinout.c, src/polygon.c, src/print.c, + src/printdialog.c, src/printpanner.c, src/rats.c, src/remove.c, + src/report.c, src/rotate.c, src/rubberband.c, src/search.c, + src/select.c, src/set.c, src/sizedialog.c, src/undo.c, src/vector.c: + Cleaned up coding formating from long-ago indent diaster with _LOOP + macros. These should be formating changes only. + +2003-12-28 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/insert.c, src/polygon.c, src/remove.c, src/search.c, + src/search.h, src/undo.c: fixed polygon undo bugs; speed-up of undo + operations + +2003-12-26 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Use the layer groups to determine which layers are + solder and component. Fix bugs in check2 and padcleaner where + deleted lines weren't skipped. + +2003-12-26 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/djopt.c: added undo capability for trace optimizations + +2003-12-25 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/autoroute.c, src/copy.c, src/dev_rs274x.c, src/draw.c, + src/find.c, src/macro.h, src/polygon.c, src/print.c, + src/rubberband.c, src/undo.c: using macro LAYER_PTR(n) to go from + layer number to pointer. this simplifies the code a little bit + +2003-12-25 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/move.c, src/remove.c: simplified ObjectMove undo serial number + handling + +2003-12-24 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/select.c: fixed bug where null F->Pad could be called (e.g. + change drill size) + +2003-12-22 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/netlist.c: Both ends of an added rat line must have named + elements + +2003-12-22 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/find.c, src/search.c: Fixed various DRC errors with arcs, + square pads and square pins + +2003-12-21 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/netlist.c: Disallow drawing rat-lines to unnamed elements; + fixed a problem with netlist window being doubly disposed. + +2003-12-20 Dan McMahill * dan AT mcmahill dot net * + + * lib/smt.inc: add -*- m4 -*- + +2003-12-17 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in, lib/common.m4, + lib/gen_list.awk, lib/gen_m4.awk, lib/johnstech.inc: add footprints + for Johnstech Evaluation Socket for QFN packages Johnstech Socket + Part Numbers 724810 through 724839. Note, the footprint has been + checked by hand but not yet verified through fabrication. + +2003-12-01 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen after -R fix + +2003-12-01 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: When trying out the various -R, --rpath, etc. + compiler flags, actually try them out instead of just claiming to. + Addresses part of bug report 850369 filed by Tom Saunders. + +2003-11-29 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/crosshair.c: Allow snap to line end-points and vias when + off-grid + +2003-11-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/dev_rs274x.c: restored bug fixes that got lost, fixed some + bugs and cleaned the code a little + +2003-11-20 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/dev_rs274x.c: removed #include that accidentally got + in on the last commit + +2003-11-19 Harry Eaton * haceaton AT users dot sourceforge dot net * + + * src/dev_rs274x.c, src/print.c: Changed print.c and dev_rs274x.c in + order to provide negative image ground planes for gerber output when + possible. Some fab vendors can't handle or charge extra for + composite ground planes which is the motivation for this. Negative + image planes are made when (1) There are no lines, arcs, text, or + pads on a layer and (2) There is exactly 1 polygon on the layer and (3) All vias/holes/pins pierce the polygon. The polygon is then + assumed to consume all of the area and only the thermal reliefs and + pin/via clearances are needed. haceaton 11/19/03 + +2003-11-13 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.in: regen + +2003-11-13 Dan McMahill * dan AT mcmahill dot net * + + * doc/Makefile.am: add rules for creating postscript and png from a + tgif drawing. Needed for improved docs. + +2003-11-13 Dan McMahill * dan AT mcmahill dot net * + + * config.h.in: regen after adding Xpm check + +2003-11-13 Dan McMahill * dan AT mcmahill dot net * + + * src/print.c: Change how the polarity of the soldermask relief + layer is handled. The polarity is not changed but it now correctly + works for postscript output as well as gerber output. Previously + the postscript output produced white on a white background or black + on a black background. This addresses PR 825680 filed by Russ Dill. + +2003-11-08 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: use AC_PATH_PROGS to search through a + list of candidates for wish + +2003-11-08 Dan McMahill * dan AT mcmahill dot net * + + * configure, src/Makefile.in, src/script/Makefile.in: regen after + moving the pcb script to a subdirectory. + +2003-11-08 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, src/Makefile.am, src/pcb.in, + src/script/Makefile.am, src/script/pcb.in: move the pcb script to a + subdirectory to avoid name conflicts with the Pcb application + default file on systems such as cygwin that are not case sensitive. + +2003-11-08 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: search for libXpm which is needed on + cygwin libXaw + +2003-11-08 Dan McMahill * dan AT mcmahill dot net * + + * configure, configure.ac: add a few more variants of wish (wish83, + cygwish80, etc) to search for + +2003-10-15 Dan McMahill * dan AT mcmahill dot net * + + * src/dev_rs274x.c: fix two bugs related to gerber file generation. + The first bug is triggered when the first aperture used in a file is + the same as the last aperture used in the previous file. In this + case the aperture selection code is missing from the output file. The second bug is when the first point drawn has its Y coordinate + (in PCB coordinates) equal to zero. The output will be at gerber Y + coordinate zero which is on the opposite side of the board. Thanks to Gabriel Paubert (paubert at iram dot es) for noting these + bugs and supplying a patch. + +2003-10-13 Dan McMahill * dan AT mcmahill dot net * + + * src/report.c: correct the reporting of soldermask relief for pads + and via's. Patch provided by Gabriel Paubert, paubert at iram dot + es on the geda-dev mailing list. + +2003-10-11 Dan McMahill * dan AT mcmahill dot net * + + * src/report.c: show pad names in object report. patch supplied in + bug report 787711 by Olof Tangrot. + +2003-10-11 Dan McMahill * dan AT mcmahill dot net * + + * src/cmask.grb, src/cpaste.grb, src/csilk.grb, src/pdrill.grb, + src/smask.grb, src/spaste.grb, src/ssilk.grb, src/udrill.grb: remove + some output files which should have never been in CVS. + +2003-10-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.in: regen after qfn.inc additions + +2003-10-03 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/common.m4, lib/geda.inc, lib/qfn.inc: add 60 + members of the Quad Flat No-lead (QFN) package family. Based on + package drawings downloaded from www.maxim-ic.com and Intersil + technical brief TB389.1 "PCB Land Pattern Desugn and Surface Mount + Guidelines for QFN (MLFP) Packages". + +2003-10-01 Dan McMahill * dan AT mcmahill dot net * + + * doc/Xdefaults.tgif, doc/pad.obj: add a figure to help with + describing the pads. Also add an Xresources file needed to convert + the tgif drawing to png + +2003-09-30 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: update copyright for last changes + +2003-09-30 Dan McMahill * dan AT mcmahill dot net * + + * configure, example/Makefile.in, example/libraries/Makefile.in: + regen after example/libraries addition + +2003-09-30 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac, example/Makefile.am: add example/libraries/Makefile + +2003-09-30 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi, example/libraries/Makefile.am, + example/libraries/example.inc, example/libraries/example.list, + example/libraries/example.m4: Add two new chapters to the manual. + The first attempts to provide some more documentation about library + creation. It includes a complete example of adding footprints using + M4 style libraries as well as giving instructions on creating newlib + style footprints. The second added chapter shows how to take a + design from start to finish using gEDA as the schematic capture and + PCB as the layout tool. This chapter still needs work, but early + feedback is good and its better than no documentation. + +2003-09-03 DJ Delorie * dj AT delorie dot com * + + * src/dev_ps.c, src/dev_rs274x.c, src/draw.c, src/drill.c, + src/print.c, src/report.c: Add FAB drawing page. Use thinner traces + for larger fonts. + +2003-09-03 Dan McMahill * dan AT mcmahill dot net * + + * aclocal.m4, configure: regen + +2003-09-03 Dan McMahill * dan AT mcmahill dot net * + + * acinclude.m4, configure.ac: don't hardcode -lXaw in the FUNCPROTO + and related tests. + +2003-09-03 Dan McMahill * dan AT mcmahill dot net * + + * configure: regen + +2003-09-03 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add a --with-xaw= option that lets you select an + alternative to Xaw. For example, --with-xaw=Xaw3d will search for + the Xaw3d library. + +2003-09-03 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add brief section about the trace optimizer. + +2003-08-31 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc: change 'Square' to 'Rectangular' to the comment for + the rectangular QFP section. + +2003-08-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/gen_geda_list.awk, lib/gen_geda_m4.awk: remove the lines which + tried to copy the source file RCS Id to the generated files. CVS + broke this feature by expanding keywords on me. + +2003-08-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.list, lib/geda.m4: these files are autogenerated now + +2003-08-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/qfpdj.inc: rework the QFP packages fixing + several bugs and greatly expanding the footprint database. Patches + supplied in bug report 785400 by Wojciech Kazubski. Many thanks for + the contribution! + +2003-08-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/common.m4: add qfpdj.inc to the include list + +2003-08-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/CreateLibraryContents.sh.in: when given a -I flag, look both + there and the current directory for .list files. Needed for + building outside the source tree directory. + +2003-08-30 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am, lib/Makefile.in, lib/gen_geda_list.awk, + lib/gen_geda_m4.awk: add scripts which autogenerate geda.m4 and + geda.list from geda.inc. + +2003-08-26 Dan McMahill * dan AT mcmahill dot net * + + * lib/geda.inc, lib/geda.list, lib/geda.m4, lib/plcc.inc: Add + 20,28,32 pin PLCC footprints, both unsocketed and socketed (through + hole). Provided in bug report 777539 by Troy Jacobson. + +2003-08-23 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Support however many layers are configured. + +2003-08-16 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add info-dir entry + +2003-08-16 Dan McMahill * dan AT mcmahill dot net * + + * newlib/2_pin_thru-hole_packages/Makefile.in: regen + +2003-08-16 Dan McMahill * dan AT mcmahill dot net * + + * newlib/2_pin_thru-hole_packages/Makefile.am: Makefile.am is not a + library component so do not install it as one + +2003-08-15 Dan McMahill * dan AT mcmahill dot net * + + * README.snapshots: add a note on creating snapshots + +2003-08-15 Dan McMahill * dan AT mcmahill dot net * + + * doc/pcb.texi: add DJ and myself + +2003-08-14 Dan McMahill * dan AT mcmahill dot net * + + * lib/lsi.list, lib/lsi.m4: Remove extra space in one of the pin + names in AT90S2313_dil and add missing AT90S4434_dil AT90S8535_dil + AT90S8535_plcc. Patch provided in bug report 770829 by Daniel + Mooney (dbmk). + +2003-08-06 Dan McMahill * dan AT mcmahill dot net * + + * lib/texas_inst_voltage_reg.m4: fix parse error on uA7952C. Patch + provided in bug report 770829 by Daniel Mooney (dbmk). + +2003-08-05 Dan McMahill * dan AT mcmahill dot net * + + * lib/texas_inst_amplifier.m4: fix parse errors in TL083 and ua747. + Patch provided in bug report 770829 by Daniel Mooney (dbmk). + +2003-08-05 Dan McMahill * dan AT mcmahill dot net * + + * lib/jerry.m4: fix parse errors on DS1225 and DS1230. Patch + provided in bug report 770829 by Daniel Mooney (dbmk). + +2003-07-25 DJ Delorie * dj AT delorie dot com * + + * : second dummy commit + +2003-07-20 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs: note that autoconf 2.13 is not new enough and mention + how to get the version + +2003-07-20 DJ Delorie * dj AT delorie dot com * + + * src/dev_rs274x.c: polygon fills must have a defined aperture also + +2003-07-20 DJ Delorie * dj AT delorie dot com * + + * src/dev_rs274x.c, src/print.c: Solder mask layers are reliefs and + normally are positive prints. Support inverted gerber plots. + +2003-07-07 DJ Delorie * dj AT delorie dot com * + + * src/dev_rs274x.c: Properly scale outline and alignment. Add + segment to alignment to act as registration. + +2003-07-06 DJ Delorie * dj AT delorie dot com * + + * src/report.c: Sort drill report by hole size, list total hole + count. + +2003-07-02 DJ Delorie * dj AT delorie dot com * + + * src/djopt.c: Fix off-by-one bug in handling bloat. Be more + careful about cleaning up traces within pads. + +2003-07-01 DJ Delorie * dj AT delorie dot com * + + * src/sizedialog.c: The minimum size of a board should never be more + than the current actual size of the board. + +2003-06-25 DJ Delorie * dj AT delorie dot com * + + * src/Pcb.ad.in, src/change.c: Automatically set CLEARLINEFLAG if + the user modifies the clearance. Add keys for changing clearance by + selection instead of pointer. + +2003-06-22 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.in: Regenerate with djopt.c + +2003-06-22 DJ Delorie * dj AT delorie dot com * + + * src/action.c, src/const.h, src/crosshair.c, src/menu.c: Add + orthogonal move feature + +2003-06-22 DJ Delorie * dj AT delorie dot com * + + * src/Pcb.ad.in, src/action.c, src/const.h, src/draw.c, src/menu.c: + Add Thindraw + +2003-06-22 DJ Delorie * dj AT delorie dot com * + + * src/Makefile.am, src/Pcb.ad.in, src/djopt.c, src/djopt.h, + src/main.c, src/menu.c: Add trace optimizer. + +2003-06-13 Dan McMahill * dan AT mcmahill dot net * + + * Makefile.in, aclocal.m4, config.h.in, configure, depcomp: add + automake/conf output to make it easier for users to build + +2003-06-13 Dan McMahill * dan AT mcmahill dot net * + + * README_FILES/Makefile.in, doc/Makefile.in, example/Makefile.in, + lib/Makefile.in, newlib/2_pin_thru-hole_packages/Makefile.in, + newlib/Makefile.in, newlib/analog-devices/Makefile.in, + newlib/burr-brown/Makefile.in, newlib/connectors/Makefile.in, + newlib/crystal/Makefile.in, newlib/cypress/Makefile.in, + newlib/electro-optics/Makefile.in, + newlib/generic_SMD_packages/Makefile.in, + newlib/headers/Makefile.in, newlib/msp430/Makefile.in, + newlib/not_vetted_ingo/Makefile.in, newlib/sockets/Makefile.in, + newlib/tests/Makefile.in, newlib/toko/Makefile.in, src/Makefile.in, + src/icons/Makefile.in, tools/Makefile.in, tutorial/Makefile.in: add + the automake/conf generated files to make building from CVS sources + easier for people. + +2003-06-13 Dan McMahill * dan AT mcmahill dot net * + + * src/error.c: only declare sys_nerr if we're using the sys_errlist + interface. This fixes compilation on NetBSD/alpha using gcc-3.3. + +2003-06-13 Dan McMahill * dan AT mcmahill dot net * + + * src/dev_rs274x.c: remove unused varargs.h header which breaks + gcc-3.3 compilation + +2003-06-05 Dan McMahill * dan AT mcmahill dot net * + + * src/action.c, src/menu.c: Allow '=' at the beginning of the zoom + exponent to indicate an absolute number rather than a relative + number. This lets a value of "=-2" be used to indicate an absolute + -2 while "-2" still indicates a relative -2. Also correct the + position of the check mark on the zoom menu. Patch from DJ Delorie. + +2003-05-26 Dan McMahill * dan AT mcmahill dot net * + + * src/file.c, src/fileselect.c, src/misc.c, src/misc.h: Fix a bug in + the way the current working directory is found. This caused the + file dialog box to always start in the library tree directory. In addition add a loop in ParseLibraryTree() to allow multiple + newlib style directory tree's to be specified in the Xresource. + This provides an easy way to have per-user and per-project library + directories. These directories may either be specified as an + absolute or relative path. Patches provided by Tony (droghedra at users dot sourceforge dot + net) in bug report 736010 with minor changes by me. + +2003-05-22 Dan McMahill * dan AT mcmahill dot net * + + * lib/Makefile.am: add missing rules.inc + +2003-05-22 Dan McMahill * dan AT mcmahill dot net * + + * src/menu.c: add 2 more levels of zooming to the menu. Inspired by + an email from DJ Delorie on the gEDA mailing list. + +2003-05-21 Dan McMahill * dan AT mcmahill dot net * + + * src/parse_l.l: change yy_current_buffer to YY_CURRENT_BUFFER. + This addresses the build \ problem reported in bug 734403 and also + agrees with the man page for \ flex-2.5.4.\ \ In addition add a + %option yylineno to address part of bug 736010\ where the line + number associated with a parse error is incorrectly\ displayed as 1. + \ + +2003-05-20 Dan McMahill * dan AT mcmahill dot net * + + * lib/common.m4: add missing bga.inc and resistor_adjust.inc + included. The latter addresses part of bug report 734403. + +2003-03-17 Dan McMahill * dan AT mcmahill dot net * + + * : remove spurious file which should not have been imported. Noted + by Mark Becker. + +2003-03-17 Dan McMahill * dan AT mcmahill dot net * + + * ...: remove spurious file which should not have been imported. + Noted by Mark Becker. + +2003-03-05 Dan McMahill * dan AT mcmahill dot net * + + * src/error.c: if strerror() is present on our system then use it + instead of trying to use sys_errlist. Patch from harry, with the + check for strerror from me. + +2003-03-05 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: move the strerror test up in the configure process + so we don't need to link to the X libraries for the test. + +2003-03-05 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: add check for strerror() + +2003-02-24 Dan McMahill * dan AT mcmahill dot net * + + * src/autoroute.c: when checking for a NULL pointer compare to NULL + rather than 0 for enhanced portability. + +2003-02-21 Dan McMahill * dan AT mcmahill dot net * + + * configure.ac: bump to 1.99o since a 1.99n version was posted to + the geda list. We should avoid further updates to this version + number until a release. If users want snapshots, they can get them + from CVS. + +2003-02-21 Dan McMahill * dan AT mcmahill dot net * + + * src/kdtree.c: change c++ style comments to c style and remove the + use of non-static initializers to allow the SunPRO c compiler to be + able to compile this file. + +2003-02-21 Dan McMahill * dan AT mcmahill dot net * + + * src/autoroute.c: coding style fixes to allow this to be compiled + with the SunPRO c compiler. Changes are moving from c++ style + comments to c style comments and getting rid of non-static + initializers. + +2003-02-21 Dan McMahill * dan AT mcmahill dot net * + + * README.cvs: - add section on checking out via anoncvs and updating via anoncvs. - point to INSTALL document for what to do afte bootstrapping the + auto* tools + +2003-02-20 Dan McMahill * dan AT mcmahill dot net * + + * doc/Imakefile, doc/pcb.texi.in, doc/pcb.texi.raw, + doc/refcard.tex.in, doc/refcard.tex.raw: remove obsolete files + +2003-02-20 Dan McMahill * dan AT mcmahill dot net * + + * : these don't really belong in CVS. The sources are in the doc/ + directory and they do get generated and put into the distfile when a + release is made. + +2003-02-20 Dan McMahill * dan AT mcmahill dot net * + + * : remove obsolete file (the contents live in pcb/newlib/ now + +2003-02-20 Dan McMahill * dan AT mcmahill dot net * + + * lib/CreateLibrary.sh.raw, lib/CreateLibraryContents.sh.raw, + lib/Imakefile, lib/QueryLibrary.sh.raw: remove obsolete files + +2003-02-20 Dan McMahill * dan AT mcmahill dot net * + + * src/CreateSedScript.sh, src/Imakefile: remove obsolete files + +2003-02-20 Dan McMahill * dan AT mcmahill dot net * + + * src/1.grb, src/2.grb, src/3.grb, src/4.grb, src/5.grb: remove + unneeded output files + +2003-02-20 Dan McMahill * dan AT mcmahill dot net * + + * Initial revision + Index: tags/1.0.5/old/NEWS.old =================================================================== --- tags/1.0.5/old/NEWS.old (nonexistent) +++ tags/1.0.5/old/NEWS.old (revision 953) @@ -0,0 +1,928 @@ +(pcb-rnd release notes are in Release_notes) + +======================================================================== +Release Notes for PCB snapshot 20110918 +======================================================================== +This release represents over 797 commits and as such this summary +clearly is not complete. See the ChangeLog file for the complete list +of changes. + +Features +-------- + +- Internal coordinate space is now metric. This should fix the "trace + nubs on metric grids" issue. Also, units are allowed on pretty much + every "coordinate" that PCB accepts. Example: 5.4in, 10cm, 0.55mm. + New configure option --enable-coord64 to force (slower?) 64-bit type + for coordinates on 32-bit systems (if you need a board bigger than 1 + meter across). The internal precision is 1 nanometer, the internal + type is "Coord". +- MinGW support. +- New GL mode for the gtk hid with translucent traces. + +- New GTK layer view/choose widget and other GUI enhancements. +- GTK HID warns if the *.pcb file has changed on disk. +- Enhanced grid snapping logic. +- Select/report nets by name. +- Auto-pan has been removed. +- Zoom can zoom out beyond the edge of the board's workspace. +- GTK: title string matches GNOME conventions. +- Personally identifiable information is no longer stored in the PCB. +- Toggling vias from hole to plated is reversible. +- Gerber exporter has options for including outlines on other layers. +- Edited footprint files are saved as footprints, not pcbs. +- Improved gtk library search/filter. +- Default layer stack is now a six-layer template with outline. +- If the board has an outline layer, an outline will be shown if no + other outline is specified. +- Group[] string allows t/b synonyms for c/s. "top" and "bottom" are + the standard names now. +- PCB will save files with an older version tag if newer features aren't needed. +- Autorouter has a progress dialog. +- PCB will no longer let you delete the last top/bottom layer. +- Refcard has been updated. +- Documentation updates. +- Layes with the PCB::skip-drc attribute set are ignored during DRC. +- Allow numeric keys to also choose the silk layer. +- Minor readability tweaks to the default font. +- Via copper may overlap. +- User is notified if an Import() cannot find all the footprints. + +Bug Fixes +--------- + +- Optimizer won't try to optimize overlapping pads +- Undo should fail less, in corner cases. +- Nested key-bound actions won't crash lesstif. +- Do not select invisible pads on the far side. +- Protect Import() from command injection. +- Fix conversion of far-side polygons to element pads. +- Fix initial clearance values of text when loading PCBs. +- Fix solder mask drawing on vias. +- Add missing action documentation. +- Fab drawing notes actual outline trace width. +- Zero clearance pins and pads won't cause DRC failures. +- PS export: fix draw-rectangle (used to do fill, not outline) +- Gerber export no longer fills unfilled rectanges. +- If there are no image formats available, the PNG hid is not enabled. +- You can no longer select pins/pads of locked elements. +- The m4-to-newlib converter now creates file names that match the + library view. +- Never set the FOUND flag on new silk lines. +- Lesstif HID won't crash if both Xinerama and XRender are detected. +- Lesstif menu is now internationalizable. +- Refdes labels in a font-less layout can be moved. +- Import can correctly update elements on the bottom side. +- DRC no longer treats unplated holes as conducting. + +Other +----- + +- Updated and new translations, including Dutch. +- Many polygon speedups. +- Numerous build-related cleanups. +- Numerous minor speed-related cleanups. +- GTK 2.18 is the minimum required version. +- GTS moved out of the src/ tree so it can be built with different flags. +- More C++ compatible. +- Expanded regex documentation. +- Much code which is no longer needed has been removed. +- HID init method changed to allow for hid struct expansion without + breaking everything. +- New HID calls for whole-pad and whole-pin drawing. +- ClearAndRedrawOutput() replaced with Redraw(). +- Board objects use hashes instead of lists to store parts, so + pointers don't change. +- DVI documentation output is no longer generated. + +======================================================================== +Release Notes for PCB snapshot 20100929 +======================================================================== +This release represents over 240 commits and as such this summary +clearly is not complete. See the ChangeLog file for the complete list +of changes. + +Features +-------- + +- PCB can directly import (forward annotate) schematics while running. +- Many places where measurements are entered now accept units, like + "5mm", and "cm" and "in" are allowed too. +- Free Rotate Buffer added to menu +- Polygon Hole tool. +- F12 invokes the Lock tool. +- Russian translation added. +- DBUS is enabled by default when possible. +- Command-line exporters can run action scripts too. +- GTK tool tips on elements, pins, and nets. +- Command-line actions in GUIs do not require (,,) syntax. +- PCB can import footprints both in subdirectories and the named directories. +- New GCode exporter. +- Footprint files use ".fp" as the suffix; this is automatically + searched for if needed. +- GTK dialogs do not show at startup unless requested. +- Stackup can be specified on the command line for command-line exporting. +- Reference card updated. +- The snap-point in pads is the center. +- The 's' key toggles polygons to clear/notclear all pads and pins + +Bug Fixes +--------- + +- Various PNG export fixes. +- lesstif's magic toggle-layers-on-flip fixed. +- Arc bounding box math fixed. +- Fixed: sometimes, disabling silk also disabled the solder layer. +- "pcb --help" prints all options again +- Add mnemonic for "close without saving" +- Don't select silk on the back side when it's invisible. +- Various polygon rendering bugs fixed. +- PNG drill bloat export fixed. +- Attempts to change polygon clearance *on* polygons results in a hint. +- PNG doesn't segfault if not all graphic formats are supported. +- Various toporouter fixes and improvements +- HID_Mixed is supported in attribute dialogs +- Flipped rectangles in PS exports are drawn correctly. +- Optimizer removes micro-traces under pads. +- Vias, pins, and pads are now drawn under the mask instead of over. +- Windows supported better. + +Other +----- + +- Sources converted to C99 +- Doc extraction gives more control over categories. +- Thermal documentation updated. +- Actions can see the context they were invoked in + +======================================================================== +Release Notes for PCB snapshot 20091103 +======================================================================== +This release represents almost 200 commits and as such this summary +clearly is not complete. See the ChangeLog file for the complete list +of changes. + +- [feature] Add attributes to layers +- [bugfix] Remove memory leak in attributes +- [bugfix] Avoid layer buttons getting confused (GTK) +- [bugfix] Fix dereference bug in hid_find_action() +- [feature] Speed up some polygon operations +- [bugfix] Don't let DRC change the grid setting +- [bugfix] Correct URL's in some dialogs and output +- [feature] Add filters to load file chooser dialog (GTK) +- [bugfix] Avoid segfaults with png HID with newer versions of libgd +- [bugfix] Don't disperse locked elements +- [feature] Added experimental topological autorouter +- [feature] Added the beginning of a testsuite. +- [docs] Document FreeRotateBuffer() +- [docs] Add some additional notes on the usage of the existing + autorouter +- [feature] Add --png-bloat option +- [bugfix] Fix several bugs found with valgrind +- [bugfix] Improve the pre-install wrapper script +- [bugfix] Several fixes to the autorouter +- [feature] Allow quoted strings and escaped characters in action + arguments +- [footprints] Add missing INDC3216M, remove duplicated RESC3216M +- [feature] Added the ability to customize mouse events via gpcb-menu.res + in the GTK HID. +- [feature] Added the ability to use mod1 (alt)(option) in + HIDs. Useful on OSX. +- [bugfix] Fix compilation issues on centos +- [bugfix] Make the detection of tools and build system around + building the documentation be more robust. Users should + not be worrying about --disable-doc or --enable-maintainer-mode + anymore +- [footprints] Add T018, T039, fix pinout of T092 to match JEDEC +- [bugfix] Speed up rendering of DRC violation previews under GTK +- [bugfix] Fix some crashing bugs related to polygons and thindraw mode +- [feature] Added a DRC refresh button +- [bugfix] Fix some pango markup in the GTK DRC dialog +- [bugfix] Fix cursor warping on flipped boards (GTK) +- [feature] Added preview images in the DRC violations window (GTK) +- [feature] Add a DrcViolationType structure and add hooks to allow HID's to use this +- [bugfix] Fix some polygon memory leaks +- [feature] Add an API for registering actions with a context to support scripting + languages like GPMI. +- [bugfix] Fix a bug with the Report(NetLength) action and NULL pin/pad names +- [bugfix] Allow exporters to work with hairlines (width of 0) +- [tools] Increase autoconf version to 2.60 since we were using some features of it +- [bugfix] Fix a number of polygon related issues +- [bugfix] Fix a number of gcc warnings +- [feature] Don't display undocumented options in help output. This helps + the transition when deprecating an option. +- [feature] Add outline mode for photo-mode exporting +- [footprints] Put the mark on pin 1 for axial footprints to make them more likely + to fall on grid +- [bugfix] Fix flipping of arcs +- [bugfix] Fix parsing of old-syntax arcs +- [bugfix] Include explicit text/lines on silk layers in the assembly drawing output +- [feature] '--ben-mode' has been renamed to '--photo-mode' +- [bugfix] Fix some crashign bugs on boards with a large number of rats +- [bugfix] Fix an off-by-one bug in the GTK netlist window +- [docs] Add getting started guide +- [feature] Add support for parsing suffixes on numbers ("um", "mm", "in", "mil") +- [bugfix] Fix some configure/build issues when cross compiling +- [bugfix] Fix some improperly used automake conditionals +- [bugfix] Fix some uninstall of shortcuts issues under windows Vista +- [feature] Add additional crosshair shapes +- [bugfix] Various windows build script improvements + +======================================================================== +Release Notes for PCB snapshot 20081128 +======================================================================== +This release represents over 70 commits and as such this summary +clearly is not complete. See the ChangeLog file for the complete list +of changes. + +- Minor bug fixes in RS274-X output. +-.Bug fixes in postscript output +- DRC checks for annular ring on pads only uses the mininum annular ring + drc setting instead of also checking minimum copper width. +- Fix postscript output for zero length lines. +- Improve the 'save before closing' dialogs. +- Fixed bugs where objects attached to the cursor vanish sometimes. +- Various minor code portability improvements. +- Enabled additional gcc warnings (when using gcc) +- Allow outline layers to have only arcs. +- Added "Ben Mode" png output which provides a simulated "photograph" + of the board. Very nice for publications. +- Fix poly clearance around rotated pads. +- Fix the batch HID which had bit rotted a little. +- Display net names hierarchically. +- Various speed improvements in the GTK HID. +- Various speed improvements in the autorouter. +- Minor improvements to the windows port. +- Other various bug fixes. + +======================================================================== +Release Notes for PCB snapshot 20080202 +======================================================================== +This release represents over 180 commits and as such this summary +clearly is not complete. See the ChangeLog file for the complete list +of changes. + +- Added a footprin preview in the library window +- Added gnome/kde desktop integration files (app and mime icons, and + .desktop file) +- Added i18n support +- Updated dbus support +- Fix a number of GCC 4 compiler warnings +- Make the gtk gui more robust against malformed menu resource files +- Added checking for duplicate hot key definitions in the menu resource + file in the gtk gui. +- Improved support for building on win32. +- Removed automake/autoconf generated files from cvs +- Fixed some parallel make bugs +- Fixed some scrolling/panning bugs in the gtk gui. +- Added the ability to load edif netlists +- Closed a number of bugs in the sourceforge tracker +- Fix a bg in the x-y output files where the y values were mirrored and offset +- Add XRENDER support to the lesstif HID to support layer transparency +- Fix some polygon dicer bugs +- Fix a handful of bugs in the png export HID +- Avoid vias snapping to pins and moving elements snapping to their own + pins/pads +- Fix a number of undo bugs +- Fix printer calibration +- Add global puller +- Various improvements to the postscript export HID +- Improve all the GetXY prompts in the menu resource files +- Improved the pin/via report +- Improved pin/pad vs grid snapping +- Various footprint improvements + o fixed some drill sizes + o fixed some silk sizes + o Added a handful of QFP family footprints + o Converted the QFP family to the hi-res format +- Several other bug fixes + +======================================================================== +Release Notes for PCB snapshot 20070912 +======================================================================== +This release represents nearly 200 commits and as such this summary +clearly is not complete. See the ChangeLog file for the complete list +of changes. + +- Many many bug fixes. Too many to list. +- Added keystone, C&K, Nichicon, and Optek footprint libraries +- Add attribute editor to the GTK HID +- Add a fileselect() function to the HID spec +- Fix ps output with drill helper on +- Add a visual indicater when elements are locked +- Corrections to the manual +- BOM can export in mm as well as mil +- Fix a ps output bug with arcs +- Fix some memory leaks found with Coverity +- Added autoconf test for buggy versions of m4 +- Fixed some footprint drill sizes +- Add user customizable menus for the gtk HID. The gtk HID now is capable + of reading the same format menu resource files as the lesstif HID. + This represents significant rework of the menu code and menu callback code. +- Added Center() action +- Store the file format in the .pcb file. This will let pcb know when + presented with a file which is too new. The code for checking the format + was present in the prior snapshot. +- Fix DRC checking of square pads to square pads +- Added window panning/cursor warping +- Add the ability to directly load a footprint from a file as if it were + a complete layout. +- Add a Popup() action + +======================================================================== +Release Notes for PCB snapshot 20070208 +======================================================================== +- Add polygon clipping code. This is a big change to how polygons are handled. + The new code now removes islands and correctly identifies open circuits caused + by a trace fully cutting through a polygon. In addition, the RS-274-X output + is now simpler and works with some board houses that use older non-conforming + sofware. Different styles for thermal reliefs are also now supported as part + of the polygon clipper code. +- Add support for plugins +- Many improvements to the autorouter. +- Various improvements to the trace optimizer. +- Add a fontmode for editing pcb fonts +- Add progress() hook to HID structure +- Fix a bug with non-functional windows on some window managers commonly + found on OS-X +- Add support for controlling pcb via dbus +- Fix various bugs which would cause a crash +- Add --scale for postscript scaling +- Intercept window manager delete events with the GTK gui +- Scan the .pcb file for a FileVersion value. This is not written out yet + but will be in future versions. +- Warn if non-manhattan lines are trying to become pads. +- Allow no-solder paste pads to support fiducials +- Report in mm or mils as selected by user +- Allow reordering of layers +- add some more QFN packages +- fix building with sun studio c compiler +- Made a pcb installation be relocatable. +- Convert the m4 libraries to newlib libraries as part of building a distfile. + The m4 libraries are still considered the sources and as such are still + distributed but this eliminates the need for m4 at runtime for footprints. +- Got rid of the pcb wrapper script around pcb-bin. +- Remove some old footprints of questionable naming, accuracy, or usefulness. +- Get the autosave/backup code working on all GUI's +- Fix some drill size rounding in the reports +- Changed the backup file name to be derived from the .pcb file name +- Added a command line option for DrawGrid +- Fix logic for adding new ratlines +- Fix gtk grid when board is flipped +- Add "find" and "rip-up" buttons to the netlist window +- Draw plated holes when exporting +- Fix some bugs when converting selection to element +- Fix build on cygwin +- Enhance the win32/build_pcb script used to generate a non-cygwin windows + installer. +- Make pcb work under non-cygwin windows + +======================================================================== +Release Notes for PCB snapshot 20060822 +======================================================================== +- various manual updates +- update the INSTALL documentation +- fix a bug where pins turned into pure holes when an element + was smashed. +- use locale-independent strtod and dtostr functions to avoid problems + loading files saved in some locales. +- fixed various bugs which caused pcb to crash +- update the gtk status line after save/save as +- make the gerber file names be compatible with pre-HID versions +- split plated and unplated drill output +- fix various typos in menus and comments +- add a batch mode HID. +- fix drawing of box around text in the buffer +- various fixes and improvements to the trace optimizer and the + autorouter +- fix board flipping code +- fix rounding bug when creating list of drill sizes +- add support for > 8 copper layers +- avoid strict aliasing violations encountered with gcc4 +- refactor code related to handling the filenames in the export + HID's +- fix layer group parsing code +- add the ability to user-configure mouse actions in the lesstif GUI. +- enable loaded netlists by default +- improve the positioning of the drill list in the postscript output +- various improvements to the configure script to improve robustness + and improve error messages when thing don't go well. +- add IPC style footprints for 01005 passives. +- added a Renumber() action which will renumber all reference designators + and produced an annotation file for backannotating to schematics. +- Draw via annulii on assembly drawings +- various other bug fixes and improvements. + +======================================================================== +Release Notes for PCB snapshot 20060422 +======================================================================== +- Several minor portability fixes for Solaris and the SunPRO compiler and + for Irix and the MIPSpro compiler. + +- Added --psfade option for the postscript HID. + +- Fixed a bug where the "load layout" and some other menu choices + didn't do anything. + +- Added remaining actions to the actions reference section of the manual. + +- Worked around X11 polluting the name space with some of the X header files. + +- Fix route style "Save as default" bug. + +- For the Gtk HID, add an alternate vertical window layout mode to + help on lower vertical resolution displays. + +- Fix soldermask draw while TAB view from solder side. + +- Change default PNG output scaling to be 100 dpi instead of fixing + the max dimension at 800 pixels. + +- Added background image support for the GTK HID (lesstif one has it too). + +- Fix missing window icons for the main GTK window and log window. + +======================================================================== +Release Notes for PCB snapshot 20060414 +======================================================================== +- This is the first snapshot of the new HID version of PCB. HID, which + stands for Human Interface Device is the abstraction created by + DJ Delorie which seperates the core PCB code from the graphical user + interface. In this release, two GUI HID's are supported, gtk and lesstif. + In addition, there are HID exporters for postscript and encapsulated + postscript, RS-274-X (gerber), bill of materials, centroid file, and + png/gif/jpeg. This represents a major restructuring of the code and + many months of work. + +- PCB's actions (the commands which drive the core of the program and + may be directly accessed by the user) now have the documentation in-line + in the code and the actions reference section of the manual is + extracted from the in-line documentation. The goal it to provide more + complete and accurate documentation. As always the manual is still + a work in progress but it is getting more complete and up to date. + +- Fixed a long standing segfault when saving connection data + +- Fixed a DRC bug + +- Fix some rounding issues when setting sizes. Hopefully this will address + the issue with 23.99 mil drills and related problems. + +- The html manual is now in one file instead of many files + +- The lesstif HID now supports loading of background images to help + recover a layout which may exist in hardcopy form only. + +======================================================================== +Release Notes for PCB snapshot 20060321 +======================================================================== +- Add internal support for more than 8 layers. By default PCB is still + compiled for 8 copper layers. +- Fixed several minor bugs in the GTK user interface including fixing + scrolling of the log window, fixed up some of the DRC reporting + and mm/mil units. +- Fixed several key bindings. +- Updated refcard.tex to reflect the current set of key bindings. +- Fixed some minor bugs which caused compilation problems on some + systems. +- Converted the QFN footprints to hi-res. +- Added documentation to the manual for the centroid file format and + the algorithm used for finding the centroid and rotation. +- Fixed a bug so that the initial layer named 'component' is actually + on the component side of the board and 'solder' is actually on the + solder side of the board. +- Fixed the pin order in the bourns trim pots (~bourns library) +- Added actions and a script to allow command line printing. +- Added IPC-7351 recommended footprints for 0201, 0402, etc passives. +- Fixed SME5 package. +- Fixed a bug which prevented disabling nets from the ratsnest +- Fixed a bug where clearances could be set 1 below the spacing +- Fixed clearline flag so that arcs also have this property. +- Speed up rtree searches and other autorouter speedups. +- Fixed a bug in computation of the closest polygon point. +- Use rtrees for polygon handling for speed improvements. +- Add a ChangePinName() action. +- Fix a bug which caused duplicate rats names when manually adding + rats lines. +- Added DRC checks for minimum drill diameter and minimum annular ring. +- Add a minimal glossary to the manual +- Fix the author name in the fab drawing +- Cause the crosshair to snap to pad ends instead of center for rat + drawing. +- Add "join" to SetFlag, ClrFlag and ChangeFlag. +- Added inline documentation for the pcb file syntax. The manual now + is up to date and correctly documents the file format. In addition + the inline documentation will make it much easier to maintain the + documentation. +- Remove some broken m4lib footprints +- Put the correct setting for the gschem footprint= attribute in [] + in the library window for the m4 libraries. + +======================================================================== +Release Notes for PCB snapshot 20050609 +======================================================================== + +- **** The GUI is now based on gtk2 instead of Xaw **** This represents + a fairly major change. You will now need gtk-2.4 or higher installed + along with any of its dependencies to build pcb. On linux + distributions, it is probably the case that you already have this, + but see the README-GTK_PORT file for a note on gtk versions. + For *BSD, Solaris, and others, you may want to use NetBSD's pkgsrc + to help install gtk2 and its dependencies. + +- Flags are stored symbolically in the .pcb file. This is the start + of moving to support >8 layers. Please note that >8 layer support + is not yet available in this snapshot. + +- Fixes for gcc-4 + +- As part of the switch to gtk2, the user customizable menu feature has + been temporarily broken. Hopefully this will be fixed by the next + snapshot. In addition, the loading of background images has also been + temporarily broken. + +======================================================================== +Release Notes for PCB snapshot 20050315 +======================================================================== + +- Several footprint library fixes including TO-220 parse errors and + incorrect drill holes on several componenets. + +- Fixed a crashing bug in the pinout window. + +- Allow the FAB author to be set via an Xresource to override what + PCB might have gotten from the gecos information. + +- Added table of standard drill sizes to the manual. + +- Fixed a crashing bug when trying to use arrow keys to adjust the scale + slider in the print dialog box. + +======================================================================== +Release Notes for PCB snapshot 20050127 +======================================================================== + +- Fix drill size for PLCC sockets in ~geda library. Fix drill size for + LED3 and LED5 footprints in ~geda library. + +- Move the right-click popup menu to pcb-menu.res. + +- Add DisperseElements() action for spreading out elements in an initial + layout. + +- Fix fab drawing output for the case where a very small number of + drill sizes are used. + +- Various documentation improvements. + +- Remove many compiler warnings. + +- Added metric output to the cursor display + +- Fix . for toggling 45 degree mode. + +- Crosshair snap snaps to center of pads and also to the mark of the + element. + +- Protect all strcmp() calls with a check for a NULL pointer. Fixes + various crashes. + +- Fixed the mode buttons which were unresponsive in some versions of + the X libraries. + +- Element names may be edited over the element. + +- Added --enable-efence for ElectricFence debugging. Off by default + +- Added --disable-rpath to avoid using rpath for the X libraries. + +- Added vendor resource file support. This allows lets you specify + a set of allowed drill sizes and drc rules for a particular vendor. + +- Added -action command line option to allow executing an action on + startup. + +- Date and time of compilation added to About dialog. + +- Fix a bug where the soldermask relief on a new element is 100x smaller + than the default when "convert buffer to element" is used. + +- Fix a name_tree corruption bug when changing an element name. + +- Don't remove the formatted manual with a 'make clean' since they are + part of the distfile. + +- Let automake handle the html and pdf conversion. This ends up using + texi2pdf for the pdf output which seems to do a better job than ps2pdf. + +- Sort actions by modifier so that both Ctrlx and x work. + +- Fix a SelectByName bug. + +- Fix non-gcc compilation + +- Command history added to : + +- Fixed pinout window crash + +- Allow Ctrl-drag to copy objects in arrow mode. + +- Fixed a polygon clearance bug + +- Fix an arc bounding box calculation error. + +======================================================================== +Release Notes for PCB snapshot 20040903 +======================================================================== + +- enable -Wall when compiling with gcc. Many compiler warnings have + been fixed. + +- add a short man page which refers the user to the real documentation + +- Added ExecuteFile(file) action which allows the execution of several + actions contained in a text file. + +- Added -script flag which specifies a file containing actions + to be executed upon startup. + +- Various documentation improvements + +- Protect some gcc extensions with tests for gcc. This allows + compilation with the IRIX c compiler. + +- Add support for a background image in the drawing area which can + help in importing a layout from a scanned image. + +- Updated the ~geda library 150 and 300 mil width SOIC packages + to remove silk on pads and to more closely follow the IPC + recommendations + +- Added support for menu accelerators. + +- segfault when breaking apart an element with no element selected + bug fixed. + +- autorouter improvements + +- added more 400mil DIP packages to ~geda library + +- fix a trace optimizer bug which produced a segfault + +- other various bug fixes + + +======================================================================== +Release Notes for PCB snapshot 20040530 +======================================================================== +This has been an exciting 3 months for PCB. Many improvements have +been made in the program as well as additions and improvements to the +footprint library. Thanks to everyone who has provided feedback, +patches, etc. + +---------------------- +Additions/Improvements +---------------------- + - Expanded DRC checking + - "Realtime" DRC checking + - DRC settings are now stored in the board fle + - Centroid (X-Y) and bill of materials output + - Dynamic menus. Users can now customize the menus via a + site-wide, per-user, or per-project menu resource file. + - Significant improvements to autorouting of congested designs. + - Autorouter can now use power planes. + - Improved appearance in autorouter output. + - Silk on pads/pins is clipped in RS-274-X output + - Ordering is preserved when writing output files so that diff + may be effectively used on pcb files. + - The autoplace feature now actually works + - Added ToggleVisibility action + - Most of the database is now kept in rtrees which avoids linear + searches. This speeds up operation significantly. + - Added SetFlag, ClrFlag, ChangeFlag actions + +--------- +Bug Fixes +--------- + - pin/pad bounding box calculation fixed. Components can + now be placed closer to the edge of the board. + - miter trace optimization bug. + - Fix bug with pins which are enclosed by multiple polygons. + - Shorts to unnamed elements and pins are handled correctly. + - Various memory leaks fixed. + - Fixed some bugs with a really high zoom. + - Fixed default media selection in postscript print dialog + - Fix some DRC bugs with square pins. + +------------------ +Footprint Library: +------------------ + - Added SOJ footprint family (~geda library) + - Added CTS series 742/3/4/5/6 resistor pack footprints (~cts library) + - Added PKG_CONNECTOR_DIL macro to let the HEADER*_1 footprints work + (~geda library) + - Correct the SDIP footprints (~geda library) + - Correct some Minicircuits footprints (~minicircuits library) + - Correct some panasonic footprints (~panasonic library) + - Change refdes silk size for sockets (~johnstech library) + - Increase soldermask relief on some mounting holes + (~johnstech library) + - Convert the COMMON_SMT_DIL_MIL and COMMON_SMT_DIL_MM macros + used by several other libraries to the hi-res format. + - Correct pin count on 100 pin QFP packages (100 not 72) + (~geda library) + - Correct pin count on HEADER60_2 (60 not 50) (~geda library) + +======================================================================== + +New Features for 2.0 + +(1) New library system. A directory tree is parsed and added to the library +selector window. This directory is specified in the config.h file as +PCBTREEDIR and should point to a directory where any pcb user that needs to +create library elements has write privileges. The "-libtree X" switch will +cause pcb to use directory X instead of the installed default for the new +library directory. You should continue to be wary of the old library +elements, many of them are not quite right. (Just check them carefully before +fabing to be sure there are no surprises). My intent is to create a +repository for new elements THAT PEOPLE HAVE FABRICATED SUCCESSFULLY in order +to grow a reliable library. + +(2) Element files can now contain layers (line, arcs, polygons), vias and +elements. The new library system reads from element files (no need to learn +M4). The expanded capability of element files allows you to put useful +sub-circuits into the library. For example, a QFP package with a break-out +via pattern can be stored as a library element. Be careful with this as the +layers are saved simply by their layer number and lose any association with a +group (e.g. whether it is the component, or solder-side layer). + +(3) Improved fascilities for creating elements from drawn objects. Now you +can put an element in the buffer, and break it into it's consitutent parts. +Paste this to the layout, make changes, then put it back in the buffer to +convert to an element. You can also save a buffer's contents to an element +file (i.e. add it to the library). Of course element files are still just +text files so you can edit them at will. Draw the element outline on the silk +layer (lines and arcs, no polygons), use Vias to make pins or holes, and lines +on the component and/or solder layers for SMD pads. Number the pins and pads +with the name ("n" key) entry, then cut it all to the buffer and select +"convert buffer to element". Saved elements always appear in the file in a +component-side orientation (even if you save while viewing the solder side). + +(4) Support for elements with surface-mount pads on both sides of the board. +e.g. edge connectors. This also allows creation of elements with multiple +pins/pads having the same "number" string. This can be used, for example, +to create a DIP footprint that has a pad on top and bottom coincident +with each pin. This effectively makes the pins have elongated copper pads +on the top and bottom - something several home-made board makers have +requested. If you do create an element with multiple pins having the +same number, and that number appears in the netlist, they MUST be connected +before the board is considered routed. See the "14DIP_oval_pad" example +in the "test" section of the library for an example. + +(5) Support for the strokes library. Compiling with strokes enabled (see +config.h) binds the middle button to recognize strokes for the user +interface. Zoom in, Zoom out, choose the line, arrow, or via tools, rotate an +object, etc. can be done with simple strokes. Check the source code +(FinishStroke() in action.c) to see what the strokes are. + +(6) Better fascilites for panning at high zoom: Shift-button3 down shows the +whole layout - move the crosshair to where you want the display centered, +then release the mouse button - the previous zoom level is restored, centered +at the new location. You can do this while in the middle of drawing, moving, +etc. You can also place the cursor in the panner area, and use the arrow keys +on the keyboard to scroll half a window view per keypress. Of course you can +still drag the screen with button1 with the panner tool (previously known +as no tool). +Auto-scrolling is also improved. If you want to use menus, buttons, +the panner, placing the pointer over them stops auto-scroll. If you +want to go to another window and not auto-scroll, pass the pointer +over one of those things before heading to the other window. + +(7) Auto-router. The auto-router routes with the active line size, via size, +and keep-away. It is a grid-less router, and will automatically avoid any +existing traces, etc. that you've placed on the board. It uses all layers +that are visible when invoked, so turn off any layers you don't want it to +use. You can auto-route all rat lines, or selected rat lines. This was +written by C. Scott Ananian + +(8) Fascilities to rip-up tracks and vias that were placed by the +auto-router. You can rip-up all auto-routed tracks, or just those that are +selected (and were auto-routed). + +(9) Auto-placement code. It's broken. Don't use it. + +(10) Many functions added to the menus that were previously accessible only +through keys or typed commands. e.g. SetValue(Grid,1), DRC(). + +(11) You can turn on/off the requirement for unique element names. When +unique names are required, they may be automatically generated when pasting. +Turn on uniqueness for a single layout, turn off if placing several boards in +a panel (or if you just want duplicate names). It's in the settings menu. + +(12) Support for metric grids. Coordinates are still always integer mils, +but you can have the grid fall on a regular metric spacing to within ++/- 1 mil. Selectable in the "Screen" menu and also with the "SetValue(Grid, x)" +command; the value x is still in mils, but it's floating point now. Also +the concept of "absolute" grid has been eliminated - just align it where +you want. + +(13) Support for viewing the soldermask. The Screen menu has a selection for +turning on/off the display of the solder mask. You can also change the +size of mask holes when the mask is displayed by using the +"ChangeClearSize(what, change)" function (k key). If the mask is not +displayed, this function changes polygon clearances as before. For example +you could elliminate all via soldermask holes by selecting everything +(make sure vias are turned on), then typing the command: +":ChangeClearSize(SelectedVias, 0)" There is a special case for +vias to change the mask diameter equal to the via diameter, by using ++0 as the size change. + +(14) Support for creation/addition of netlist by drawing rat lines. +Select "netlist" from the drawing layer, and use the line tool to +add nets. Undo removes the rat, but not the created net. To delete +a netlist entry, select the connection in the netlist window and +hit the backspace key. The "netlist" layer must be the active layer +to delete connections like this. This is NOT the recommended way +to create a netlist, but a lot of people asked for it. + +(15) Support for snapping the crosshair to pins/pads even when they're not on +grid. Selectable in the "Settings" menu. Thanks to Borges for this +great idea. + +(16) Doesn't draw negative lines and arcs in print output unless +necessary. It still does this for all pads though. Doesn't technically +matter, but there are a lot of bogus gerber viewers out there and +people that are easily confused by gerber files that completely meet +the specification. + +(17) Added a "Lock" feature that lets you lock an object so it +can't be selected, moved, or modified. Very handy for making a +board-outline element (e.g. pc104 card) invisible to the Arrow +tool. + +(18) lots of bug fixes (plus, no doubt, lots of newly introduced ones). + +(19) a tool (in the tools folder) for converting to/from ncap files +for auto-routing with MUCS-PCB. I have not tried this myself. Written +By Luis Claudio G. Lopes + +(20) a new build system based on the GNU automake and autoconf tools. +This should make compiling on different systems easier than with the +old imake based build system. + +(21) A program for quickly generating QFP elements. Its invoked +from the old library (~generic/qfp menu, generic) + +(22) Increased resolution. The internal unit is now 0.01 mil +as opposed to 1.0 mil which was the previous unit. + +Quick and dirty explanation of some as-yet undocumented features: + +Netlist window: double-click on a net-name to enable/disable it. A "*" +appears next to the name when it is disabled. Disabled means rats nests will +ignore the net. Click on a connection to select it (and center it) in the +layout window. "Finding" a connection starting from a pin or pad will +select it in the netlist window. + +The "j" key controls whether a line (arc) clears (plow through) polygons or +touches them. Newly created lines and arcs follow the setting in the +"settings" menu. Put the cursor over the line or arc you want to change, then +hit the "j" (j for join) key. + +The "k" key controls the width of clearance around a line (arc) when it +plows. "k" key increases clearance by 2, Shift-K decreases it by 2, also +works for pins and vias piercing polygons. The initial value for new objects +(but not element pins/pads which is in the element definition) +is controlled by the "keepaway" setting, changeable in the "sizes" menu. + +When drawing lines, you can start a new anchor point without drawing from +the previous point by either clicking button3, or Ctrl-button1. DON'T +USE BUTTON2 - that would be wrong, even if it sort of works. + +The Arrow tool is for selecting/deselecting objects, and moving them. +Shift-click to add to the existing selection. You can click-drag to draw +boxes for box selection. If you click-drag on an already selected item, you +will move the selection. If you click-drag on an un-selected item, you will +move that item without selecting it. This last technique is the only way to +move a point (e.g. end point of a line), and is also the only way to perform +moves with rubber-banding (i.e. rubber-banding doesn't work with selections). +Moving a selection actually cuts it to a special paste buffer, then pastes it +at the new location. Always start a box selection by clicking in an empty +region of the board. It may be desireable to turn off some visibility in +order to simplify the box selection operation. You can also lock +an object to make it invisible to the Arrow tool (so box selections can +begin over the object). If you don't configure for +strokes, the middle button is bound to the arrow tool. + +To move an element or silk text to the opposite side of the board, use the +"b" key (b for backside) to send it to the opposite side. You can also cut an +object to a buffer, switch viewing sides (tab), then paste it. The buffer can +be used this way to flip layout traces to the other side too, although if +layer groups are used, the precise layer they appear on may not have the +color you want, but the connectivity should not change. + + +Installation tip: BE SURE TO INSTALL THE NEW X11 RESOURCE FILE - run +make install to do this. If you just want to test without installing, +run the pcbtest.sh script in the src directory. + Index: tags/1.0.5/old/README_FILES/CHANGES =================================================================== --- tags/1.0.5/old/README_FILES/CHANGES (nonexistent) +++ tags/1.0.5/old/README_FILES/CHANGES (revision 953) @@ -0,0 +1,92 @@ +/* + * This package is PCB 2.0 release by harry eaton. + * + * This file is totally out of date. + * + * I'm too lazy to document all of the changed files + * (there are a lot! run diff to see em all) + * + * below is some of the history of PCB's changes. It is necessarily + * out-of-date. + */ + +- Changes to add the gerber driver: + + dev_gerber.h Clone from dev_ps.h. + + dev_gerber.c Clone from dev_ps.c. + Added support for the Outline & Alignment + device operation. + + dev_gerberX.h Clone from dev_gerber.h + + dev_gerberX.c Clone from dev_gerber.c + Added support for the Outline & Alignment + device operation. + + default_aperture Changes for new pads and changed formats + with leading D & X for the two + different gerber standards. + + data.h Up size of PrintingDevice. + + data.c Include "dev_gerber.h" & "dev_gerberX.h" + + print.h Added support for the "Render Text on + Silkscreen" option. + + print.c Include "dev_gerber.h" & "dev_gerberX.h" *A* + Disable silkscreening of pads and pins; these + surfaces must be soldered and + should not be silkscreened. + Added support for the Text() device operation. + Added support for the "Render Text on + Silkscreen" option. + + printdialog.c Include "dev_gerber.h" & "dev_gerberX.h" *A* + Added support for the "Render Text on + Silkscreen" option. + + const.h Up limit on maximum number of print/output + files. + + Imakefile Include support for dev_gerber.[co]. + & dev_gerberX.[co] + + pcbtogbr.gcf Created default gerber control file (gcf). + This belongs in the layout file, also. + + pcbtogbr.pcb Created test data file. + + *.gbr Generated Gerber files from pcbtogbr.pcb + + *.gbx "ditto" ^^^^ for Gerber Extented + + gerbertotk.c Converts Gerber files to tcl/tk programs. + + gbrtest Exports test gerber conversion data to a + MS-DOG subdirectory for testing + via a Gerber interpreter. + + ../config.h Amended the RELEASE definition to protect the + innocent. + + global.h Added support for the Text() device operation. + + dev_ps.c Added support for the Text() device operation. + + ../lib/*.* Added Radial & Axial Caps, Axial Resistors, + 14-pin can oscillators, one generic + matched pair of transistors + 2N3904 NPN & 2N3906 PNP, + ovenized oscillator, etc... + + ALPHA.06 + + + dev_gerberX.c Deleted RS-274X calls to read default_aperture + file. gerberX now generates internal + aperture information specific to each + layer. ApertureFunctions deleted, + since the G0(1|2|3) deterrmine the + action to be taken. + + Tested with OrCAD GerberTool Demo 6.2b1, + it works but some the silkscreens for + arcs are wacky. Most items have a + normal appearance with GO3 CCW draw + command. + + Device->(function) Any file that has this type of call got + assaulted and had an "int unused" + added. + + + dev_gerber.c Working on having a file called + "default.map" or "default.app" + to dynamically generate an aperture + table that is dependent on the + gerber RS-274D file generation. +--- PCB 1.4.5.ALPHA.02a + + + dev_gerber.c gerber RS-274D now does dynamic aperture + table generation +- Note: *A* + + It might not be needed to include dev_*.h within this source + files. Investigate. + Index: tags/1.0.5/old/README_FILES/Makefile.am =================================================================== --- tags/1.0.5/old/README_FILES/Makefile.am (nonexistent) +++ tags/1.0.5/old/README_FILES/Makefile.am (revision 953) @@ -0,0 +1,8 @@ +## $Id$ +## + +EXTRA_DIST= \ + CHANGES \ + Tools \ + Whats_new_in_2.0 + Index: tags/1.0.5/old/README_FILES/Tools =================================================================== --- tags/1.0.5/old/README_FILES/Tools (nonexistent) +++ tags/1.0.5/old/README_FILES/Tools (revision 953) @@ -0,0 +1,9 @@ +There is a script for converting pcb files directly into +HPGL for printing. It does not support all of pcb's features. +There is a tcl script that converts Tango netlist format +into a pcb compatible netlist format. It was written by Ingo Cyliax. +There's a tool to merge several PCB generated PostScript files +into a single one. Check the code for details. +There is a gzipped tar file containing a program to help you +use the MUCS PCB auto router if you want to. + Index: tags/1.0.5/old/README_FILES/Whats_new_in_2.0 =================================================================== --- tags/1.0.5/old/README_FILES/Whats_new_in_2.0 (nonexistent) +++ tags/1.0.5/old/README_FILES/Whats_new_in_2.0 (revision 953) @@ -0,0 +1,191 @@ +New Features for 2.0 + +(1) New library system. A directory tree is parsed and added to the library +selector window. This directory is specified in the config.h file as +PCBTREEDIR and should point to a directory where any pcb user that needs to +create library elements has write privileges. The "-libtree X" switch will +cause pcb to use directory X instead of the installed default for the new +library directory. You should continue to be wary of the old library +elements, many of them are not quite right. (Just check them carefully before +fabing to be sure there are no surprises). My intent is to create a +repository for new elements THAT PEOPLE HAVE FABRICATED SUCCESSFULLY in order +to grow a reliable library. + +(2) Element files can now contain layers (line, arcs, polygons), vias and +elements. The new library system reads from element files (no need to learn +M4). The expanded capability of element files allows you to put useful +sub-circuits into the library. For example, a QFP package with a break-out +via pattern can be stored as a library element. Be careful with this as the +layers are saved simply by their layer number and lose any association with a +group (e.g. whether it is the component, or solder-side layer). + +(3) Improved fascilities for creating elements from drawn objects. Now you +can put an element in the buffer, and break it into it's consitutent parts. +Paste this to the layout, make changes, then put it back in the buffer to +convert to an element. You can also save a buffer's contents to an element +file (i.e. add it to the library). Of course element files are still just +text files so you can edit them at will. Draw the element outline on the silk +layer (lines and arcs, no polygons), use Vias to make pins or holes, and lines +on the component and/or solder layers for SMD pads. Number the pins and pads +with the name ("n" key) entry, then cut it all to the buffer and select +"convert buffer to element". Saved elements always appear in the file in a +component-side orientation (even if you save while viewing the solder side). + +(4) Support for elements with surface-mount pads on both sides of the board. +e.g. edge connectors. This also allows creation of elements with multiple +pins/pads having the same "number" string. This can be used, for example, +to create a DIP footprint that has a pad on top and bottom coincident +with each pin. This effectively makes the pins have elongated copper pads +on the top and bottom - something several home-made board makers have +requested. If you do create an element with multiple pins having the +same number, and that number appears in the netlist, they MUST be connected +before the board is considered routed. See the "14DIP_oval_pad" example +in the "test" section of the library for an example. + +(5) Support for the strokes library. Compiling with strokes enabled (see +config.h) binds the middle button to recognize strokes for the user +interface. Zoom in, Zoom out, choose the line, arrow, or via tools, rotate an +object, etc. can be done with simple strokes. Check the source code +(FinishStroke() in action.c) to see what the strokes are. + +(6) Better fascilites for panning at high zoom: Shift-button3 down shows the +whole layout - move the crosshair to where you want the display centered, +then release the mouse button - the previous zoom level is restored, centered +at the new location. You can do this while in the middle of drawing, moving, +etc. You can also place the cursor in the panner area, and use the arrow keys +on the keyboard to scroll half a window view per keypress. Of course you can +still drag the screen with button1 with the panner tool (previously known +as no tool). +Auto-scrolling is also improved. If you want to use menus, buttons, +the panner, placing the pointer over them stops auto-scroll. If you +want to go to another window and not auto-scroll, pass the pointer +over one of those things before heading to the other window. + +(7) Auto-router. The auto-router routes with the active line size, via size, +and keep-away. It is a grid-less router, and will automatically avoid any +existing traces, etc. that you've placed on the board. It uses all layers +that are visible when invoked, so turn off any layers you don't want it to +use. You can auto-route all rat lines, or selected rat lines. This was +written by C. Scott Ananian + +(8) Fascilities to rip-up tracks and vias that were placed by the +auto-router. You can rip-up all auto-routed tracks, or just those that are +selected (and were auto-routed). + +(9) Auto-placement code. It's broken. Don't use it. + +(10) Many functions added to the menus that were previously accessible only +through keys or typed commands. e.g. SetValue(Grid,1), DRC(). + +(11) You can turn on/off the requirement for unique element names. When +unique names are required, they may be automatically generated when pasting. +Turn on uniqueness for a single layout, turn off if placing several boards in +a panel (or if you just want duplicate names). It's in the settings menu. + +(12) Support for metric grids. Coordinates are still always integer mils, +but you can have the grid fall on a regular metric spacing to within ++/- 1 mil. Selectable in the "Screen" menu and also with the "SetValue(Grid, x)" +command; the value x is still in mils, but it's floating point now. Also +the concept of "absolute" grid has been eliminated - just align it where +you want. + +(13) Support for viewing the soldermask. The Screen menu has a selection for +turning on/off the display of the solder mask. You can also change the +size of mask holes when the mask is displayed by using the +"ChangeClearSize(what, change)" function (k key). If the mask is not +displayed, this function changes polygon clearances as before. For example +you could elliminate all via soldermask holes by selecting everything +(make sure vias are turned on), then typing the command: +":ChangeClearSize(SelectedVias, 0)" There is a special case for +vias to change the mask diameter equal to the via diameter, by using ++0 as the size change. + +(14) Support for creation/addition of netlist by drawing rat lines. +Select "netlist" from the drawing layer, and use the line tool to +add nets. Undo removes the rat, but not the created net. To delete +a netlist entry, select the connection in the netlist window and +hit the backspace key. The "netlist" layer must be the active layer +to delete connections like this. This is NOT the recommended way +to create a netlist, but a lot of people asked for it. + +(15) Support for snapping the crosshair to pins/pads even when they're not on +grid. Selectable in the "Settings" menu. Thanks to Borges for this +great idea. + +(16) Doesn't draw negative lines and arcs in print output unless +necessary. It still does this for all pads though. Doesn't technically +matter, but there are a lot of bogus gerber viewers out there and +people that are easily confused by gerber files that completely meet +the specification. + +(17) Added a "Lock" feature that lets you lock an object so it +can't be selected, moved, or modified. Very handy for making a +board-outline element (e.g. pc104 card) invisible to the Arrow +tool. + +(18) lots of bug fixes (plus, no doubt, lots of newly introduced ones). + +(19) a tool (in the tools folder) for converting to/from ncap files +for auto-routing with MUCS-PCB. I have not tried this myself. Written +By Luis Claudio G. Lopes + +(20) A program for quickly generating QFP elements. Its invoked +from the old library (~generic/qfp menu, generic) + +(21) The old imake based build system has been replaced by a GNU +autoconf/automake build system. This should simplify the installation +and provide greater portability. + + Quick and dirty explanation of some as-yet undocumented features: + +Quick and dirty explanation of some as-yet undocumented features: + +Netlist window: double-click on a net-name to enable/disable it. A "*" +appears next to the name when it is disabled. Disabled means rats nests will +ignore the net. Click on a connection to select it (and center it) in the +layout window. "Finding" a connection starting from a pin or pad will +select it in the netlist window. + +The "j" key controls whether a line (arc) clears (plow through) polygons or +touches them. Newly created lines and arcs follow the setting in the +"settings" menu. Put the cursor over the line or arc you want to change, then +hit the "j" (j for join) key. + +The "k" key controls the width of clearance around a line (arc) when it +plows. "k" key increases clearance by 2, Shift-K decreases it by 2, also +works for pins and vias piercing polygons. The initial value for new objects +(but not element pins/pads which is in the element definition) +is controlled by the "keepaway" setting, changeable in the "sizes" menu. + +When drawing lines, you can start a new anchor point without drawing from +the previous point by either clicking button3, or Ctrl-button1. DON'T +USE BUTTON2 - that would be wrong, even if it sort of works. + +The Arrow tool is for selecting/deselecting objects, and moving them. +Shift-click to add to the existing selection. You can click-drag to draw +boxes for box selection. If you click-drag on an already selected item, you +will move the selection. If you click-drag on an un-selected item, you will +move that item without selecting it. This last technique is the only way to +move a point (e.g. end point of a line), and is also the only way to perform +moves with rubber-banding (i.e. rubber-banding doesn't work with selections). +Moving a selection actually cuts it to a special paste buffer, then pastes it +at the new location. Always start a box selection by clicking in an empty +region of the board. It may be desireable to turn off some visibility in +order to simplify the box selection operation. You can also lock +an object to make it invisible to the Arrow tool (so box selections can +begin over the object). If you don't configure for +strokes, the middle button is bound to the arrow tool. + +To move an element or silk text to the opposite side of the board, use the +"b" key (b for backside) to send it to the opposite side. You can also cut an +object to a buffer, switch viewing sides (tab), then paste it. The buffer can +be used this way to flip layout traces to the other side too, although if +layer groups are used, the precise layer they appear on may not have the +color you want, but the connectivity should not change. + + +Installation tip: BE SURE TO INSTALL THE NEW X11 RESOURCE FILE - run +make install to do this. If you just want to test without installing, +run the pcbtest.sh script in the src directory. + + Index: tags/1.0.5/old/conf =================================================================== --- tags/1.0.5/old/conf (nonexistent) +++ tags/1.0.5/old/conf (revision 953) @@ -0,0 +1,4 @@ +#!/bin/sh +./configure --prefix=/usr --disable-dbus --disable-gl \ + --disable-update-desktop-database --enable-jpeg --enable-png + Property changes on: tags/1.0.5/old/conf ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/missing =================================================================== --- tags/1.0.5/old/missing (nonexistent) +++ tags/1.0.5/old/missing (revision 953) @@ -0,0 +1,357 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-02-08.22 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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, 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Property changes on: tags/1.0.5/old/missing ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/CreateLibrary.sh.in =================================================================== --- tags/1.0.5/old/oldlib/lib/CreateLibrary.sh.in (nonexistent) +++ tags/1.0.5/old/oldlib/lib/CreateLibrary.sh.in (revision 953) @@ -0,0 +1,65 @@ +#!/bin/sh +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# creates a library +# +# usage: CreateContents.sh library common_macro_file file... + +M4=@GNUM4@ + +while test -n "$1" ; do +case "$1" +in + -I|--include) + m4_flags="$m4_flags -I $2" + shift 2 + ;; + + -*) + echo "error: unknown flag $1 to $0" + exit 1 + ;; + + *) + break + ;; +esac +done + +if [ $# -lt 3 ]; then + echo "usage: $0 library common_macro_file file..." >&2; exit 1 +fi +Library=$1 +CommonFile=$2 +shift; shift + +if [ ! -r $CommonFile ]; then + echo "$0: file '$CommonFile' isn't readable or doesn't exit" >&2; exit 1 +fi + +echo "$M4 $m4_flags -F $Library $CommonFile $@" +$M4 $m4_flags -F $Library $CommonFile $@ Property changes on: tags/1.0.5/old/oldlib/lib/CreateLibrary.sh.in ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/CreateLibraryContents.sh.in =================================================================== --- tags/1.0.5/old/oldlib/lib/CreateLibraryContents.sh.in (nonexistent) +++ tags/1.0.5/old/oldlib/lib/CreateLibraryContents.sh.in (revision 953) @@ -0,0 +1,129 @@ +#!/bin/sh +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# create all objects as defined in passed list_files +# +# usage: CreateLibraryContents.sh common_macro_file file... + +M4=@GNUM4@ + +## +# Check for input flags +## + +while test -n "$1" ; do +case "$1" +in + -I|--include) + m4_flags="$m4_flags -I $2" + srcdir=$2 + shift 2 + ;; + + -*) + echo "error: unknown flag $1 to $0" + exit 1 + ;; + + *) + break + ;; +esac +done + +# a TAB plus one blank for some stupid old sed implementations +# +SPACE="[ ]" + +## +# Make sure we've been given a common file plus at least 1 list file +# as arguments +## + +if [ $# -lt 2 ]; then + echo "usage: $0 common_macro_file file..." >&2; exit 1 +fi +CommonFile=$1 +shift + +## +# Make sure the common file exists +## + +if [ ! -r $CommonFile ]; then + echo "$0: file '$CommonFile' isn't readable or doesn't exit" >&2; exit 1 +fi + +## +# Process the list files +## + +while [ $# -ne 0 ]; do +# strip the extension '.list' +# + + ## + # Turn something like foo.list in to + # /path/to/foo.m4 + ## + if [ -f $srcdir/$1 ]; then + ListFile="$srcdir/$1" + else + ListFile="$1" + fi + PlainFile=`dirname $ListFile`/`basename $ListFile .list` + M4File=$PlainFile.m4 + + if [ ! -r $ListFile ]; then + echo "$0: file '$ListFile' isn't readable or doesn't exit" >&2; exit 1 + fi + if [ ! -r $M4File ]; then + echo "$0: file '$M4File' isn't readable or doesn't exit" >&2; exit 1 + fi + + ## + # for foo.list spit out "TYPE=~foo". This defines the library + # in the PCB library window + ## + echo "TYPE=~`basename $PlainFile | sed -e 's/_/ /g'`" + + sed -e 's/'"$SPACE"'*#.*$//' \ + -e 's/'"$SPACE"'*:'"$SPACE"'*/:/g' \ + -e '/^'"$SPACE"'*$/d' $ListFile | + { + IFS=: + export IFS + while read mask package values; do + set -- $values + while [ $# -ne 0 ]; do + echo "\`$mask:$package:$1:'Description_$mask\` [$package'ifdef(\`Param1_$mask', \` Param1_$mask')\`'ifdef(\`Param2_$mask', \` Param2_$mask')]" + shift + done + done + } | $M4 $m4_flags $CommonFile $M4File - | sed -e '/^'"$SPACE"'*$/d' + shift +done Property changes on: tags/1.0.5/old/oldlib/lib/CreateLibraryContents.sh.in ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/Makefile =================================================================== --- tags/1.0.5/old/oldlib/lib/Makefile (nonexistent) +++ tags/1.0.5/old/oldlib/lib/Makefile (revision 953) @@ -0,0 +1,22 @@ +# This Makefile is a plain old hand written one; all configuration settings +# are included from ../Makefile.conf which is scconfig generated + +all: + +install_: + $(MKDIR) $(DATADIR) + $(CPC) `pwd`/ListLibraryContents.sh $(DATADIR)/ListLibraryContents.sh + +install: + make install_ CPC="$(CP)" + +linstall: + make install_ CPC="$(LN)" + +uninstall: + $(RM) $(DATADIR)/ListLibraryContents.sh + +clean: + +include ../Makefile.conf + Index: tags/1.0.5/old/oldlib/lib/Makefile.am =================================================================== --- tags/1.0.5/old/oldlib/lib/Makefile.am (nonexistent) +++ tags/1.0.5/old/oldlib/lib/Makefile.am (revision 953) @@ -0,0 +1,266 @@ +## -*- makefile -*- +## + +PCBLIBDIR= @PCBLIBDIR@ +LIBRARYFILENAME= @LIBRARYFILENAME@ + +pcblibdir= $(PCBLIBDIR) +pcblib_SCRIPTS= ${LIBSCRIPTS} +LIBSCRIPTS= \ + CreateLibraryContents.sh \ + CreateLibrary.sh \ + ListLibraryContents.sh \ + QueryLibrary.sh \ + qfp-ui + +dist_noinst_SCRIPTS= \ + m4lib_to_newlib.sh + +pcblib_DATA= ${LIBCONTENTS} ${DAT_FILES} + +LIBCONTENTS= \ + ${LIBRARYFILENAME} \ + ${LIBRARYFILENAME}.contents + + +# ###################################################### +# +# Process the entire m4lib library and create a newlib +# library from it. +# + +NEWLIB=${LIBRARYFILENAME}-newlib + +all-local: $(NEWLIB).stamp + +# if we have compiled in PNG export capability then +# generate previews of all the footprints. This has +# the added benefit of doing a PCB syntax check on all of them +if PNG_PREVIEW +PREVIEW= --png +PREVIEW_MSG= png-preview=yes +else +PREVIEW= +PREVIEW_MSG= png-preview=no +endif + +if BUILD_PCBLIB_NEWLIB +NEWLIB_DEPS= ${LIBCONTENTS} ${srcdir}/m4lib_to_newlib.sh +else +NEWLIB_DEPS= +endif + +${NEWLIB}.stamp : footprint.pcb ${NEWLIB_DEPS} + rm -fr ${NEWLIB} + ${SHELL} ${srcdir}/m4lib_to_newlib.sh --contents \ + ${LIBRARYFILENAME}.contents --output ${NEWLIB} \ + ${PREVIEW} --pcb "${PCB}" --awk "${AWK}" + echo '${PREVIEW_MSG}' > $@ + +# Remove any rebuilt footprints +if BUILD_PCBLIB_NEWLIB +distclean-local: + rm -fr ${NEWLIB} +endif + +install-data-local: ${NEWLIB}.stamp + if test -d ${NEWLIB} ; then \ + tar cf - ${NEWLIB} | (cd $(DESTDIR)$(PCBLIBDIR) && tar -xf -) ; \ + else \ + cd $(srcdir) && tar -cf - ${NEWLIB} | (cd $(DESTDIR)$(PCBLIBDIR) && tar -xf -) ; \ + fi + +uninstall-local: + chmod -R a+w $(DESTDIR)$(PCBLIBDIR)/${NEWLIB} + rm -fr $(DESTDIR)$(PCBLIBDIR)/${NEWLIB} + +EXTRA_DIST= ${NEWLIB} footprint.pcb ${NEWLIB}.stamp png_diff.sh + +if BUILD_PCBLIB_NEWLIB +DISTCLEANFILES= ${NEWLIB}.stamp +else +DISTCLEANFILES= +endif + +# +# +# ###################################################### + +pcblibm4dir= $(PCBLIBDIR)/m4 +pcblibm4_DATA= $(LIB_FILES) + +##pcblibm4_SCRIPTS= update-pcb +## XXX what was this about? +##(cd $(pcblibm4dir) && sh ./update-pcb) + +# note: only some of the scripts listed in LIBSCRIPTS are generated by autoconf +# and hence need chmod-ing. The others (ListLIbraryContents.sh in particular) +# is just one of the distribution files and thus will not exist in the build +# directory if the build is not done in the source directory +all-local: + for f in ${LIBSCRIPTS} ${noinst_SCRIPTS}; do if test -f $$f ; then chmod 755 $$f ; fi ; done + +COMMON_FILE= common.m4 + +M4_DIST_FILES= \ + TTL_74xx_DIL.m4 \ + amphenol.m4 \ + connector.m4 \ + crystal.m4 \ + generic.m4 \ + gtag.m4 \ + jerry.m4 \ + linear.m4 \ + logic.m4 \ + lsi.m4 \ + memory.m4 \ + optical.m4 \ + pci.m4 \ + resistor_0.25W.m4 \ + resistor_adjust.m4 \ + resistor_array.m4 \ + texas_inst_amplifier.m4 \ + texas_inst_voltage_reg.m4 \ + transistor.m4 + +# These files are for old footprint libraries and will be +# removed in future releases +OBSOLETE_LIST_DIST_FILES= \ + TTL_74xx_DIL.list \ + jerry.list \ + linear.list \ + logic.list \ + lsi.list \ + memory.list \ + resistor_0.25W.list \ + resistor_adjust.list \ + resistor_array.list \ + texas_inst_amplifier.list \ + texas_inst_voltage_reg.list \ + transistor.list + +LIST_DIST_FILES= \ + amphenol.list \ + connector.list \ + crystal.list \ + generic.list \ + gtag.list \ + optical.list \ + pci.list + +INC_FILES= \ + bga.inc \ + amp.inc \ + amphenol.inc \ + bourns.inc \ + candk.inc \ + connector.inc \ + cts.inc \ + dil.inc \ + geda.inc \ + johnstech.inc \ + minicircuits.inc \ + misc.inc \ + nichicon.inc \ + optek.inc \ + panasonic.inc \ + pci.inc \ + plcc.inc \ + qfn.inc \ + qfp.inc \ + qfp2.inc \ + qfpdj.inc \ + resistor_adjust.inc \ + rules.inc \ + smt.inc \ + to.inc \ + zif.inc + +DAT_FILES= \ + qfp.dat + +M4_FILES= ${M4_DIST_FILES} amp.m4 bourns.m4 candk.m4 cts.m4 geda.m4 johnstech.m4 minicircuits.m4 nichicon.m4 optek.m4 panasonic.m4 +LIST_FILES= ${LIST_DIST_FILES} amp.list bourns.list candk.list cts.list geda.list johnstech.list minicircuits.list nichicon.list \ + optek.list panasonic.list + +LIB_FILES= ${COMMON_FILE} ${M4_FILES} ${LIST_FILES} ${INC_FILES} + +EXTRA_DIST+= ListLibraryContents.sh ${COMMON_FILE} ${M4_DIST_FILES} ${OBSOLETE_LIST_DIST_FILES} \ + ${LIST_DIST_FILES} ${INC_FILES} \ + ${LIBCONTENTS} \ + ${DAT_FILES} gen_list.awk gen_m4.awk gen_geda_m4.awk gen_geda_list.awk + +DISTCLEANFILES+= ${LIBRARYFILENAME} ${LIBRARYFILENAME}.contents amp.m4 amp.list \ + cts.m4 cts.list bourns.m4 bourns.list \ + candk.m4 candk.list \ + geda.m4 geda.list johnstech.m4 johnstech.list minicircuits.m4 minicircuits.list \ + nichicon.m4 nichicon.list \ + optek.m4 optek.list \ + panasonic.m4 panasonic.list + +${LIBRARYFILENAME}: ${COMMON_FILE} ${INC_FILES} ${DAT_FILES} ${M4_FILES} CreateLibrary.sh + ${SHELL} ./CreateLibrary.sh -I $(srcdir) $@ $(srcdir)/${COMMON_FILE} ${M4_FILES} + +${LIBRARYFILENAME}.contents: ${COMMON_FILE} ${INC_FILES} ${DAT_FILES} ${LIST_FILES} CreateLibraryContents.sh + ${SHELL} ./CreateLibraryContents.sh -I $(srcdir) $(srcdir)/${COMMON_FILE} ${LIST_FILES} > $@ + +amp.list: amp.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=amp $(srcdir)/amp.inc > $@ + +amp.m4: amp.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=amp $(srcdir)/amp.inc > $@ + +bourns.list: bourns.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=bourns $(srcdir)/bourns.inc > $@ + +bourns.m4: bourns.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=bourns $(srcdir)/bourns.inc > $@ + +candk.list: candk.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=candk $(srcdir)/candk.inc > $@ + +candk.m4: candk.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=candk $(srcdir)/candk.inc > $@ + +cts.list: cts.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=cts $(srcdir)/cts.inc > $@ + +cts.m4: cts.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=cts $(srcdir)/cts.inc > $@ + +johnstech.list: johnstech.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=johnstech $(srcdir)/johnstech.inc > $@ + +johnstech.m4: johnstech.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=johnstech $(srcdir)/johnstech.inc > $@ + +minicircuits.list: minicircuits.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=minicircuits $(srcdir)/minicircuits.inc > $@ + +minicircuits.m4: minicircuits.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=minicircuits $(srcdir)/minicircuits.inc > $@ + +nichicon.list: nichicon.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=nichicon $(srcdir)/nichicon.inc > $@ + +nichicon.m4: nichicon.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=nichicon $(srcdir)/nichicon.inc > $@ + +optek.list: optek.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=optek $(srcdir)/optek.inc > $@ + +optek.m4: optek.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=optek $(srcdir)/optek.inc > $@ + +panasonic.list: panasonic.inc gen_list.awk + ${AWK} -f $(srcdir)/gen_list.awk name=panasonic $(srcdir)/panasonic.inc > $@ + +panasonic.m4: panasonic.inc gen_m4.awk + ${AWK} -f $(srcdir)/gen_m4.awk name=panasonic $(srcdir)/panasonic.inc > $@ + +geda.m4: geda.inc gen_geda_m4.awk + ${AWK} -f $(srcdir)/gen_geda_m4.awk $(srcdir)/geda.inc > $@ + +geda.list: geda.inc gen_geda_list.awk + ${AWK} -f $(srcdir)/gen_geda_list.awk $(srcdir)/geda.inc > $@ + Index: tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.list =================================================================== --- tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.list (revision 953) @@ -0,0 +1,319 @@ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# mask package values... +# +7400_dil:N:7400 +7401_dil:N:7401 +7402_dil:N:7402 +7403_dil:N:7403 +7404_dil:N:7404 +7405_dil:N:7405 +7406_dil:N:7406 +7407_dil:N:7407 +7408_dil:N:7408 +7409_dil:N:7409 +7410_dil:N:7410 +7411_dil:N:7411 +7412_dil:N:7412 +7413_dil:N:7413 +7414_dil:N:7414 +7415_dil:N:7415 +7416_dil:N:7416 +7418_dil:N:7418 +7419_dil:N:7419 +7420_dil:N:7420 +7421_dil:N:7421 +7422_dil:N:7422 +7423_dil:N:7423 +7424_dil:N:7424 +7425_dil:N:7425 +7426_dil:N:7426 +7427_dil:N:7427 +7428_dil:N:7428 +7430_dil:N:7430 +7431_dil:N:7431 +7432_dil:N:7432 +7433_dil:N:7433 +7437_dil:N:7437 +7438_dil:N:7438 +7439_dil:N:7439 +7440_dil:N:7440 +7442_dil:N:7442 +7445_dil:N:7445 +7446_dil:N:7446 +7447_dil:N:7447 +7448_dil:N:7448 +7449_dil:N:7449 +7450_dil:N:7450 +7451L_dil:N:74LS51 +7451S_dil:N:74S51 +7453_dil:N:7453 +7454_dil:N:7454 +7455_dil:N:7455 +7457_dil:N:7457 +7464_dil:N:7464 +7465_dil:N:7465 +7468_dil:N:7468 +7469_dil:N:7469 +7470_dil:N:7470 +7472_dil:N:7472 +7473_dil:N:7473 +7474_dil:N:7474 +7475_dil:N:7475 +7476_dil:N:7476 +7478_dil:N:7478 +7483_dil:N:7483 +7485_dil:N:7485 +7486_dil:N:7486 +7490_dil:N:7490 +7491_dil:N:7491 +7492_dil:N:7492 +7493_dil:N:7493 +7495_dil:N:7495 +7496_dil:N:7496 +7497_dil:N:7497 +74107_dil:N:74107 +74109_dil:N:74109 +74111_dil:N:74111 +74112_dil:N:74112 +74113_dil:N:74113 +74114_dil:N:74114 +74116_dil:N:74116 +74120_dil:N:74120 +74121_dil:N:74121 +74122_dil:N:74122 +74123_dil:N:74123 +74124_dil:N:74124 +74125_dil:N:74125 +74126_dil:N:74126 +74128_dil:N:74128 +74132_dil:N:74132 +74133_dil:N:74133 +74134_dil:N:74134 +74135_dil:N:74135 +74136_dil:N:74136 +74137_dil:N:74137 +74138_dil:N:74138 +74139_dil:N:74139 +74140_dil:N:74140 +74143_dil:N:74143 +74145_dil:N:74145 +74147_dil:N:74147 +74148_dil:N:74148 +74150_dil:N:74150 +74151_dil:N:74151 +74153_dil:N:74153 +74154_dil:N:74154 +74155_dil:N:74155 +74156_dil:N:74156 +74157_dil:N:74157 +74158_dil:N:74158 +74159_dil:N:74159 +74160_dil:N:74160 +74161_dil:N:74161 +74162_dil:N:74162 +74163_dil:N:74163 +74164_dil:N:74164 +74165_dil:N:74165 +74166_dil:N:74166 +74167_dil:N:74167 +74169_dil:N:74169 +74170_dil:N:74170 +74171_dil:N:74171 +74172_dil:N:74172 +74173_dil:N:74173 +74174_dil:N:74174 +74175_dil:N:74175 +74176_dil:N:74176 +74177_dil:N:74177 +74178_dil:N:74178 +74180_dil:N:74180 +74181_dil:N:74181 +74182_dil:N:74182 +74183_dil:N:74183 +74190_dil:N:74190 +74191_dil:N:74191 +74192_dil:N:74192 +74193_dil:N:74193 +74194_dil:N:74194 +74195_dil:N:74195 +74196_dil:N:74196 +74197_dil:N:74197 +74198_dil:N:74198 +74199_dil:N:74199 +74221_dil:N:74221 +74240_dil:N:74240 +74241_dil:N:74241 +74242_dil:N:74242 +74243_dil:N:74243 +74244_dil:N:74244 +74245_dil:N:74245 +74247_dil:N:74247 +74248_dil:N:74248 +74251_dil:N:74251 +74253_dil:N:74253 +74257_dil:N:74257 +74258_dil:N:74258 +74259_dil:N:74259 +74260_dil:N:74260 +74261_dil:N:74261 +74265_dil:N:74265 +74266_dil:N:74266 +74273_dil:N:74273 +74276_dil:N:74276 +74278_dil:N:74278 +74279_dil:N:74279 +74280_dil:N:74280 +74283_dil:N:74283 +74285_dil:N:74285 +74290_dil:N:74290 +74292_dil:N:74292 +74293_dil:N:74293 +74294_dil:N:74294 +74295_dil:N:74295 +74297_dil:N:74297 +74298_dil:N:74298 +74299_dil:N:74299 +74320_dil:N:74320 +74321_dil:N:74321 +74322_dil:N:74322 +74323_dil:N:74323 +74348_dil:N:74348 +74352_dil:N:74352 +74353_dil:N:74353 +74354_dil:N:74354 +74355_dil:N:74355 +74356_dil:N:74356 +74365_dil:N:74365 +74366_dil:N:74366 +74367_dil:N:74367 +74368_dil:N:74368 +74373_dil:N:74373 +74374_dil:N:74374 +74375_dil:N:74375 +74376_dil:N:74376 +74377_dil:N:74377 +74378_dil:N:74378 +74379_dil:N:74379 +74381_dil:N:74381 +74382_dil:N:74382 +74384_dil:N:74384 +74385_dil:N:74385 +74386_dil:N:74386 +74390_dil:N:74390 +74393_dil:N:74393 +74395_dil:N:74395 +74396_dil:N:74396 +74399_dil:N:74399 +74422_dil:N:74422 +74423_dil:N:74423 +74440_dil:N:74440 +74441_dil:N:74441 +74442_dil:N:74442 +74443_dil:N:74443 +74444_dil:N:74444 +74446_dil:N:74446 +74449_dil:N:74449 +74465_dil:N:74465 +74466_dil:N:74466 +74467_dil:N:74467 +74468_dil:N:74468 +74490_dil:N:74490 +74518_dil:N:74518 +74519_dil:N:74519 +74520_dil:N:74520 +74521_dil:N:74521 +74522_dil:N:74522 +74538_dil:N:74538 +74540_dil:N:74540 +74541_dil:N:74541 +74573_dil:N:74573 +74574_dil:N:74574 +74575_dil:N:74575 +74580_dil:N:74580 +74590_dil:N:74590 +74591_dil:N:74591 +74592_dil:N:74592 +74593_dil:N:74593 +74594_dil:N:74594 +74595_dil:N:74595 +74596_dil:N:74596 +74597_dil:N:74597 +74598_dil:N:74598 +74599_dil:N:74599 +74604_dil:N:74604 +74606_dil:N:74606 +74607_dil:N:74607 +74620_dil:N:74620 +74621_dil:N:74621 +74623_dil:N:74623 +74624_dil:N:74624 +74625_dil:N:74625 +74626_dil:N:74626 +74627_dil:N:74627 +74628_dil:N:74628 +74629_dil:N:74629 +74630_dil:N:74630 +74631_dil:N:74631 +74636_dil:N:74636 +74637_dil:N:74637 +74638_dil:N:74638 +74639_dil:N:74639 +74640_dil:N:74640 +74641_dil:N:74641 +74642_dil:N:74642 +74644_dil:N:74644 +74645_dil:N:74645 +74646_dil:N:74646 +74647_dil:N:74647 +74648_dil:N:74648 +74649_dil:N:74649 +74651_dil:N:74651 +74652_dil:N:74652 +74653_dil:N:74653 +74668_dil:N:74668 +74669_dil:N:74669 +74670_dil:N:74670 +74671_dil:N:74671 +74672_dil:N:74672 +74673_dil:N:74673 +74674_dil:N:74674 +74681_dil:N:74681 +74682_dil:N:74682 +74683_dil:N:74683 +74684_dil:N:74684 +74685_dil:N:74685 +74686_dil:N:74686 +74687_dil:N:74687 +74688_dil:N:74688 +74689_dil:N:74689 +74690_dil:N:74690 +74691_dil:N:74691 +74693_dil:N:74693 +74696_dil:N:74696 +74697_dil:N:74697 +74699_dil:N:74699 Property changes on: tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.m4 (revision 953) @@ -0,0 +1,1483 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +define(`Description_7400_dil', ``4 dual-NAND'') +define(`Param1_7400_dil', 14) +define(`Param2_7400_dil', 300) +define(`PinList_7400_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3B',`3A',`4Y',`4B',`4A',`Vcc'') + +define(`Description_7401_dil', ``4 dual-NAND OC'') +define(`Param1_7401_dil', 14) +define(`Param2_7401_dil', 300) +define(`PinList_7401_dil', ``1Y',`1A',`1B',`2Y',`2A',`2B',`Gnd',`3A',`3B',`3Y',`4A',`4B',`4Y',`Vcc'') + +define(`Description_7402_dil', ``4 dual-NOR'') +define(`Param1_7402_dil', 14) +define(`Param2_7402_dil', 300) +define(`PinList_7402_dil', ``1Y',`1A',`1B',`2Y',`2A',`2B',`Gnd',`3A',`3B',`3Y',`4A',`4B',`4Y',`Vcc'') + +define(`Description_7403_dil', ``4 dual-NAND OC'') +define(`Param1_7403_dil', 14) +define(`Param2_7403_dil', 300) +define(`PinList_7403_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3A',`3B',`4Y',`4A',`4B',`Vcc'') + +define(`Description_7404_dil', ``6 inverters'') +define(`Param1_7404_dil', 14) +define(`Param2_7404_dil', 300) +define(`PinList_7404_dil', ``1A',`1Y',`2A',`2Y',`3A',`3Y',`Gnd',`4Y',`4A',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7405_dil', ``6 inverters OC'') +define(`Param1_7405_dil', 14) +define(`Param2_7405_dil', 300) +define(`PinList_7405_dil', ``1A',`1Y',`2A',`2Y',`3A',`3Y',`Gnd',`4Y',`4A',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7406_dil', ``6 inverters OC high-voltage'') +define(`Param1_7406_dil', 14) +define(`Param2_7406_dil', 300) +define(`PinList_7406_dil', ``1A',`1Y',`2A',`2Y',`3A',`3Y',`Gnd',`4Y',`4A',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7407_dil', ``6 buffers OC'') +define(`Param1_7407_dil', 14) +define(`Param2_7407_dil', 300) +define(`PinList_7407_dil', ``1A',`1Y',`2A',`2Y',`3A',`3Y',`Gnd',`4Y',`4A',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7408_dil', ``4 dual-AND'') +define(`Param1_7408_dil', 14) +define(`Param2_7408_dil', 300) +define(`PinList_7408_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3A',`3B',`4Y',`4A',`4B',`Vcc'') + +define(`Description_7409_dil', ``4 dual-AND OC'') +define(`Param1_7409_dil', 14) +define(`Param2_7409_dil', 300) +define(`PinList_7409_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3A',`3B',`4Y',`4A',`4B',`Vcc'') + +define(`Description_7410_dil', ``3 triple-NAND'') +define(`Param1_7410_dil', 14) +define(`Param2_7410_dil', 300) +define(`PinList_7410_dil', ``A1',`B1',`A2',`B2',`C2',`Y2',`Gnd',`Y3',`A3',`B3',`C3',`Y1',`C1',`Vcc'') + +define(`Description_7411_dil', ``3 triple-AND'') +define(`Param1_7411_dil', 14) +define(`Param2_7411_dil', 300) +define(`PinList_7411_dil', ``A1',`B1',`A2',`B2',`C2',`Y2',`Gnd',`Y3',`A3',`B3',`C3',`Y1',`C1',`Vcc'') + +define(`Description_7412_dil', ``3 triple-NAND OC'') +define(`Param1_7412_dil', 14) +define(`Param2_7412_dil', 300) +define(`PinList_7412_dil', ``A1',`B1',`A2',`B2',`C2',`Y2',`Gnd',`Y3',`A3',`B3',`C3',`Y1',`C1',`Vcc'') + +define(`Description_7413_dil', ``2 quad-input NAND Schmitt trigger'') +define(`Param1_7413_dil', 14) +define(`Param2_7413_dil', 300) +define(`PinList_7413_dil', ``1A',`1B',`NC',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`NC',`2C',`2D',`Vcc'') + +define(`Description_7414_dil', ``6 Schmitt trigger inverter'') +define(`Param1_7414_dil', 14) +define(`Param2_7414_dil', 300) +define(`PinList_7414_dil', ``1A',`1Y',`2A',`2Y',`3A',`3Y',`Gnd',`4Y',`4A',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7415_dil', ``3 triple-AND OC'') +define(`Param1_7415_dil', 14) +define(`Param2_7415_dil', 300) +define(`PinList_7415_dil', ``A1',`B1',`A2',`B2',`C2',`Y2',`Gnd',`Y3',`A3',`B3',`C3',`Y1',`C1',`Vcc'') + +define(`Description_7416_dil', ``6 inverters OC high-voltage'') +define(`Param1_7416_dil', 14) +define(`Param2_7416_dil', 300) +define(`PinList_7416_dil', ``1A',`1Y',`2A',`2Y',`3A',`3Y',`Gnd',`4Y',`4A',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7418_dil', ``2 quad-NAND Schmitt trigger'') +define(`Param1_7418_dil', 14) +define(`Param2_7418_dil', 300) +define(`PinList_7418_dil', ``1A',`1B',`NC',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`NC',`2C',`2D',`Vcc'') + +define(`Description_7419_dil', ``6 inverter Schmitt trigger'') +define(`Param1_7419_dil', 14) +define(`Param2_7419_dil', 300) +define(`PinList_7419_dil', ``1A',`1Y',`2A',`2Y',`3A',`3Y',`Gnd',`4Y',`4A',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7420_dil', ``2 quad-NAND'') +define(`Param1_7420_dil', 14) +define(`Param2_7420_dil', 300) +define(`PinList_7420_dil', ``1A',`1B',`NC',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`NC',`2C',`2D',`Vcc'') + +define(`Description_7421_dil', ``2 quad-AND'') +define(`Param1_7421_dil', 14) +define(`Param2_7421_dil', 300) +define(`PinList_7421_dil', ``1A',`1B',`NC',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`NC',`2C',`2D',`Vcc'') + +define(`Description_7422_dil', ``2 quad-NAND OC'') +define(`Param1_7422_dil', 14) +define(`Param2_7422_dil', 300) +define(`PinList_7422_dil', ``1A',`1B',`NC',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`NC',`2C',`2D',`Vcc'') + +define(`Description_7423_dil', ``2 quad-NOR with strobe'') +define(`Param1_7423_dil', 16) +define(`Param2_7423_dil', 300) +define(`PinList_7423_dil', ``1X',`1A',`1B',`1G',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`2G',`2C',`2D',`/X',`Vcc'') + +define(`Description_7424_dil', ``4 dual-NAND Schmitt trigger'') +define(`Param1_7424_dil', 14) +define(`Param2_7424_dil', 300) +define(`PinList_7424_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3A',`3B',`4Y',`4A',`4B',`Vcc'') + +define(`Description_7425_dil', ``2 quad-NOR w. strobe'') +define(`Param1_7425_dil', 14) +define(`Param2_7425_dil', 300) +define(`PinList_7425_dil', ``1A',`1B',`1G',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`2G',`2C',`2D',`Vcc'') + +define(`Description_7426_dil', ``4 dual NAND high-voltage'') +define(`Param1_7426_dil', 14) +define(`Param2_7426_dil', 300) +define(`PinList_7426_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3A',`3B',`4Y',`4A',`4B',`Vcc'') + +define(`Description_7427_dil', ``3 triple-NOR'') +define(`Param1_7427_dil', 14) +define(`Param2_7427_dil', 300) +define(`PinList_7427_dil', ``1A',`1B',`2A',`2B',`2C',`2Y',`Gnd',`3Y',`3A',`3B',`3C',`1Y',`1C',`Vcc'') + +define(`Description_7428_dil', ``4 dual-NOR buffer'') +define(`Param1_7428_dil', 14) +define(`Param2_7428_dil', 300) +define(`PinList_7428_dil', ``1Y',`1A',`1B',`2Y',`2A',`2B',`Gnd',`3A',`3B',`3Y',`4A',`4B',`4Y',`Vcc'') + +define(`Description_7430_dil', ``octal-NAND'') +define(`Param1_7430_dil', 14) +define(`Param2_7430_dil', 300) +define(`PinList_7430_dil', ``A',`B',`C',`D',`E',`F',`Gnd',`Y',`NC',`NC',`G',`H',`NC',`Vcc'') + +define(`Description_7431_dil', ``delay elements'') +define(`Param1_7431_dil', 16) +define(`Param2_7431_dil', 300) +define(`PinList_7431_dil', ``1A',`1Y',`2A',`2Y',`3A',`3B',`3Y',`Gnd',`4Y',`4A',`4B',`5Y',`5A',`6Y',`6A',`Vcc'') + +define(`Description_7432_dil', ``4 dual-OR'') +define(`Param1_7432_dil', 14) +define(`Param2_7432_dil', 300) +define(`PinList_7432_dil', ``A1',`B1',`Y1',`A2',`B2',`Y2',`Gnd',`Y3',`A3',`B3',`Y4',`A4',`B4',`Vcc'') + +define(`Description_7433_dil', ``4 dual-NOR buffer OC'') +define(`Param1_7433_dil', 14) +define(`Param2_7433_dil', 300) +define(`PinList_7433_dil', ``1Y',`1A',`1B',`2Y',`2A',`2B',`Gnd',`3A',`3B',`3Y',`4A',`4B',`4Y',`Vcc'') + +define(`Description_7437_dil', ``4 dual-NAND buffer'') +define(`Param1_7437_dil', 14) +define(`Param2_7437_dil', 300) +define(`PinList_7437_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3A',`3B',`4Y',`4A',`4B',`Vcc'') + +define(`Description_7438_dil', ``4 dual-NAND buffer OC'') +define(`Param1_7438_dil', 14) +define(`Param2_7438_dil', 300) +define(`PinList_7438_dil', ``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3A',`3B',`4Y',`4A',`4B',`Vcc'') + +define(`Description_7439_dil', ``4 dual-NAND buffer OC'') +define(`Param1_7439_dil', 14) +define(`Param2_7439_dil', 300) +define(`PinList_7439_dil', ``1Y',`1A',`1B',`2Y',`2A',`2B',`Gnd',`3A',`3B',`3Y',`4A',`4B',`4Y',`Vcc'') + +define(`Description_7440_dil', ``2 quad-NAND buffer'') +define(`Param1_7440_dil', 14) +define(`Param2_7440_dil', 300) +define(`PinList_7440_dil', ``1A',`1B',`NC',`1C',`1D',`1Y',`Gnd',`2Y',`2A',`2B',`NC',`2C',`2D',`Vcc'') + +define(`Description_7442_dil', ``4-to-10 decoder'') +define(`Param1_7442_dil', 16) +define(`Param2_7442_dil', 300) +define(`PinList_7442_dil', ``0',`1',`2',`3',`4',`5',`6',`Gnd',`7',`8',`9',`D',`C',`B',`A',`Vcc'') + +define(`Description_7445_dil', ``BCD to decimal decoder/driver'') +define(`Param1_7445_dil', 16) +define(`Param2_7445_dil', 300) +define(`PinList_7445_dil', ``0',`1',`2',`3',`4',`5',`6',`Gnd',`7',`8',`9',`D',`C',`B',`A',`Vcc'') + +define(`Description_7446_dil', ``BCD to 7-segment driver OC'') +define(`Param1_7446_dil', 16) +define(`Param2_7446_dil', 300) +define(`PinList_7446_dil', ``B',`C',`/LT',`/BI-/RBO',`/RBI',`D',`A',`Gnd',`e',`d',`c',`b',`a',`g',`f',`Vcc'') + +define(`Description_7447_dil', ``BCD to 7-segment driver OC'') +define(`Param1_7447_dil', 16) +define(`Param2_7447_dil', 300) +define(`PinList_7447_dil', ``B',`C',`/LT',`/BI-/RBO',`/RBI',`D',`A',`Gnd',`e',`d',`c',`b',`a',`g',`f',`Vcc'') + +define(`Description_7448_dil', ``BCD to 7-segment driver w. pullup'') +define(`Param1_7448_dil', 16) +define(`Param2_7448_dil', 300) +define(`PinList_7448_dil', ``B',`C',`/LT',`/BI-/RBO',`/RBI',`D',`A',`Gnd',`e',`d',`c',`b',`a',`g',`f',`Vcc'') + +define(`Description_7449_dil', ``BCD to 7-segment driver OC w. blanking input'') +define(`Param1_7449_dil', 14) +define(`Param2_7449_dil', 300) +define(`PinList_7449_dil', ``B',`C',`/BI',`D',`A',`e',`Gnd',`d',`c',`b',`a',`g',`f',`Vcc'') + +define(`Description_7450_dil', ``2 AND-OR inverters (2x2 inputs)'') +define(`Param1_7450_dil', 14) +define(`Param2_7450_dil', 300) +define(`PinList_7450_dil', ``1A',`2A',`2B',`2C',`2D',`2Y',`Gnd',`1Y',`1C',`1D',`1X',`1/X',`1B',`Vcc'') + +define(`Description_7451L_dil', ``2 AND-OR inverters (2x2,2x3 inputs)'') +define(`Param1_7451L_dil', 14) +define(`Param2_7451L_dil', 300) +define(`PinList_7451L_dil', ``1A',`2A',`2B',`2C',`2D',`2Y',`Gnd',`1Y',`1D',`1E',`1F',`1B',`1C',`Vcc'') + +define(`Description_7451S_dil', ``2 AND-OR inverters (2x2 inputs)'') +define(`Param1_7451S_dil', 14) +define(`Param2_7451S_dil', 300) +define(`PinList_7451S_dil', ``1A',`2A',`2B',`2C',`2D',`2Y',`Gnd',`1Y',`1C',`1D',`NC',`NC',`1B',`Vcc'') + +define(`Description_7453_dil', ``AND-OR inverter (4x2 inputs)'') +define(`Param1_7453_dil', 14) +define(`Param2_7453_dil', 300) +define(`PinList_7453_dil', ``A',`C',`D',`E',`F',`NC',`Gnd',`Y',`G',`H',`X',`/X',`B',`Vcc'') + +define(`Description_7454_dil', ``AND-OR inverter (4x2 inputs)'') +define(`Param1_7454_dil', 14) +define(`Param2_7454_dil', 300) +define(`PinList_7454_dil', ``A',`C',`D',`E',`F',`NC',`Gnd',`Y',`G',`H',`NC',`NC',`B',`Vcc'') + +define(`Description_7455_dil', ``AND-OR inverter (2x4 inputs)'') +define(`Param1_7455_dil', 14) +define(`Param2_7455_dil', 300) +define(`PinList_7455_dil', ``A',`B',`C',`D',`NC',`NC',`Gnd',`Y',`NC',`E',`F',`G',`H',`Vcc'') + +define(`Description_7457_dil', ``frequency divider'') +define(`Param1_7457_dil', 8) +define(`Param2_7457_dil', 300) +define(`PinList_7457_dil', ``ClkB',`Vcc',`Qa',`Gnd',`ClkA',`Clr',`Qb',`Qc'') + +define(`Description_7464_dil', ``AND-OR inverter (4-2-3-2 inputs)'') +define(`Param1_7464_dil', 14) +define(`Param2_7464_dil', 300) +define(`PinList_7464_dil', ``A',`E',`F',`G',`H',`I',`Gnd',`Y',`J',`K',`B',`C',`D',`Vcc'') + +define(`Description_7465_dil', ``AND-OR inverter OC (4-2-3-2 inputs)'') +define(`Param1_7465_dil', 14) +define(`Param2_7465_dil', 300) +define(`PinList_7465_dil', ``A',`E',`F',`G',`H',`I',`Gnd',`Y',`J',`K',`B',`C',`D',`Vcc'') + +define(`Description_7468_dil', ``2 4bit decade counter'') +define(`Param1_7468_dil', 16) +define(`Param2_7468_dil', 300) +define(`PinList_7468_dil', ``1ClkA',`1Qb',`1Qd',`/1Clr',`2Qc',`NC',`2Qa',`Gnd',`2Clk',`2Qb',`/2Clr',`2Qd',`1Qc',`1Qa',`1ClkB',`Vcc'') + +define(`Description_7469_dil', ``2 4bit binary counter'') +define(`Param1_7469_dil', 16) +define(`Param2_7469_dil', 300) +define(`PinList_7469_dil', ``1ClkA',`1Qb',`1Qd',`/1Clr',`2Qc',`NC',`2Qa',`Gnd',`2Clk',`2Qb',`/2Clr',`2Qd',`1Qc',`1Qa',`1ClkB',`Vcc'') + +define(`Description_7470_dil', ``AND-gated JK pos-edge-FF w. preset/clear'') +define(`Param1_7470_dil', 14) +define(`Param2_7470_dil', 300) +define(`PinList_7470_dil', ``NC',`/Clr',`J1',`J2',`/J',`/Q',`Gnd',`Q',`/K',`K1',`K2',`Clk',`/Pre',`Vcc'') + +define(`Description_7472_dil', ``AND-gated MS-FF w. preset/clear'') +define(`Param1_7472_dil', 14) +define(`Param2_7472_dil', 300) +define(`PinList_7472_dil', ``NC',`/Clr',`J1',`J2',`J3',`/Q',`Gnd',`Q',`K1',`K2',`K3',`Clk',`/Pre',`Vcc'') + +define(`Description_7473_dil', ``2 JK FF w. clear'') +define(`Param1_7473_dil', 14) +define(`Param2_7473_dil', 300) +define(`PinList_7473_dil', ``1Clk',`/1Clr',`1K',`Vcc',`2Clk',`/2Clr',`2J',`/2Q',`2Q',`2K',`Gnd',`1Q',`/1Q',`1J'') + +define(`Description_7474_dil', ``2 D-type pos-edge FF w. preset/clear'') +define(`Param1_7474_dil', 14) +define(`Param2_7474_dil', 300) +define(`PinList_7474_dil', ``/1Clr',`1D',`1Clk',`/1Pre',`1Q',`/1Q',`Gnd',`/2Q',`2Q',`/2Pre',`2Clk',`2D',`/2Clr',`Vcc'') + +define(`Description_7475_dil', ``4bit bi-stable latch w. compl. outputs'') +define(`Param1_7475_dil', 16) +define(`Param2_7475_dil', 300) +define(`PinList_7475_dil', ``/1Q',`1D',`2D',`3C-4C',`Vcc',`3D',`4D',`/4Q',`4Q',`3Q',`/3Q',`Gnd',`1C-2C',`/2Q',`2Q',`1Q'') + +define(`Description_7476_dil', ``2 JK FF w. preset/clear'') +define(`Param1_7476_dil', 16) +define(`Param2_7476_dil', 300) +define(`PinList_7476_dil', ``1Clk',`/1Pre',`/1Clr',`1J',`Vcc',`2Clk',`/2Pre',`/2Clr',`2J',`/2Q',`2Q',`2K',`Gnd',`/1Q',`1Q',`1K'') + +define(`Description_7478_dil', ``2 JK FF w. preset and common Clk/Clr'') +define(`Param1_7478_dil', 14) +define(`Param2_7478_dil', 300) +define(`PinList_7478_dil', ``Clk',`/1Pre',`1J',`Vcc',`/Clr',`/2Pre',`2K',`2Q',`/2Q',`2J',`Gnd',`/1Q',`1Q',`1K'') + +define(`Description_7483_dil', ``4bit binary adder w. fast carry'') +define(`Param1_7483_dil', 16) +define(`Param2_7483_dil', 300) +define(`PinList_7483_dil', ``A4',`Sum3',`A3',`B3',`Vcc',`Sum2',`B2',`A2',`Sum1',`A1',`B1',`Gnd',`C0',`C4',`Sum4',`B4'') + +define(`Description_7485_dil', ``4bit magnitude comperator'') +define(`Param1_7485_dil', 16) +define(`Param2_7485_dil', 300) +define(`PinList_7485_dil', ``B3',`ABin',`A>Bout',`A=Bout',`AQ',`P0',`Q0',`P1',`Q1',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`P7',`Q7',`/P=Q',`Vcc'') + +define(`Description_74683_dil', ``8bit magnitute comperator OC w. input pull-up'') +define(`Param1_74683_dil', 20) +define(`Param2_74683_dil', 300) +define(`PinList_74683_dil', ``/P>Q',`P0',`Q0',`P1',`Q1',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`P7',`Q7',`/P=Q',`Vcc'') + +define(`Description_74684_dil', ``8bit magnitute comperator'') +define(`Param1_74684_dil', 20) +define(`Param2_74684_dil', 300) +define(`PinList_74684_dil', ``/P>Q',`P0',`Q0',`P1',`Q1',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`P7',`Q7',`/P=Q',`Vcc'') + +define(`Description_74685_dil', ``8bit magnitute comperator OC'') +define(`Param1_74685_dil', 20) +define(`Param2_74685_dil', 300) +define(`PinList_74685_dil', ``/P>Q',`P0',`Q0',`P1',`Q1',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`P7',`Q7',`/P=Q',`Vcc'') + +define(`Description_74686_dil', ``8bit magnitute comperator w. enable'') +define(`Param1_74686_dil', 24) +define(`Param2_74686_dil', 300) +define(`PinList_74686_dil', ``/P>Q',`/G1',`P0',`Q0',`P1',`Q1',`NC',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`NC',`P7',`Q7',`/P=Q',`/G2',`Vcc'') + +define(`Description_74687_dil', ``8bit magnitute comperator OC w. enable'') +define(`Param1_74687_dil', 24) +define(`Param2_74687_dil', 300) +define(`PinList_74687_dil', ``/P>Q',`/G1',`P0',`Q0',`P1',`Q1',`NC',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`NC',`P7',`Q7',`/P=Q',`/G2',`Vcc'') + +define(`Description_74688_dil', ``8bit identity comperator'') +define(`Param1_74688_dil', 20) +define(`Param2_74688_dil', 300) +define(`PinList_74688_dil', ``/G',`P0',`Q0',`P1',`Q1',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`P7',`Q7',`/P=Q',`Vcc'') + +define(`Description_74689_dil', ``8bit identity comperator OC'') +define(`Param1_74689_dil', 20) +define(`Param2_74689_dil', 300) +define(`PinList_74689_dil', ``/G',`P0',`Q0',`P1',`Q1',`P2',`Q2',`P3',`Q3',`Gnd',`P4',`Q4',`P5',`Q5',`P6',`Q6',`P7',`Q7',`/P=Q',`Vcc'') + +define(`Description_74690_dil', ``4bit synchronous decade counter w. direct clear, output register 3-state'') +define(`Param1_74690_dil', 20) +define(`Param2_74690_dil', 300) +define(`PinList_74690_dil', ``/CClr',`CCK',`A',`B',`C',`D',`ENP',`/RClr',`RCK',`Gnd',`R-/C',`/G',`/Load',`ENT',`Qd',`Qc',`Qb',`Qa',`RCO',`Vcc'') + +define(`Description_74691_dil', ``4bit synchronous binary counter w. direct clear, output register 3-state'') +define(`Param1_74691_dil', 20) +define(`Param2_74691_dil', 300) +define(`PinList_74691_dil', ``/CClr',`CCK',`A',`B',`C',`D',`ENP',`/RClr',`RCK',`Gnd',`R-/C',`/G',`/Load',`ENT',`Qd',`Qc',`Qb',`Qa',`RCO',`Vcc'') + +define(`Description_74693_dil', ``4bit synchronous binary counter w. sync. clear, output register 3-state'') +define(`Param1_74693_dil', 20) +define(`Param2_74693_dil', 300) +define(`PinList_74693_dil', ``/CClr',`CCK',`A',`B',`C',`D',`ENP',`/RClr',`RCK',`Gnd',`R-/C',`/G',`/Load',`ENT',`Qd',`Qc',`Qb',`Qa',`RCO',`Vcc'') + +define(`Description_74696_dil', ``4bit synchronous decade counter w. direct clear 3-state'') +define(`Param1_74696_dil', 20) +define(`Param2_74696_dil', 300) +define(`PinList_74696_dil', ``U-/D',`CCK',`A',`B',`C',`D',`/ENP',`/CClr',`RCK',`Gnd',`R-/C',`/G',`/Load',`/ENT',`Qd',`Qc',`Qb',`Qa',`/RCO',`Vcc'') + +define(`Description_74697_dil', ``4bit synchronous binary counter w. direct clear 3-state'') +define(`Param1_74697_dil', 20) +define(`Param2_74697_dil', 300) +define(`PinList_74697_dil', ``U-/D',`CCK',`A',`B',`C',`D',`/ENP',`/CClr',`RCK',`Gnd',`R-/C',`/G',`/Load',`/ENT',`Qd',`Qc',`Qb',`Qa',`/RCO',`Vcc'') + +define(`Description_74699_dil', ``4bit synchronous binary counter w. sync. clear 3-state'') +define(`Param1_74699_dil', 20) +define(`Param2_74699_dil', 300) +define(`PinList_74699_dil', ``U-/D',`CCK',`A',`B',`C',`D',`/ENP',`/CClr',`RCK',`Gnd',`R-/C',`/G',`/Load',`/ENT',`Qd',`Qc',`Qb',`Qa',`/RCO',`Vcc'') + +divert(0)dnl Property changes on: tags/1.0.5/old/oldlib/lib/TTL_74xx_DIL.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/amp.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/amp.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/amp.inc (revision 953) @@ -0,0 +1,193 @@ +# -*- m4 -*- +# +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003 Dan McMahill +# +# 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. +# +# +# +# Amp (www.amp.com) Specific Footprints + +# ------------------------------------------------------------------- +# the definition of a MICTOR connector +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins +# $5: pad width (1/1000 mil) +# $6: pad length (1/1000 mil) +# $7: pad pitch (1/1000 mil) +# $8: pad seperation center to center for pads on opposite sides of +# the package (1/1000 mil) +# $9: define to make the pins get numbered starting with the highest pin +# instead of pin 1. Needed for certain brain damaged packages like +# the Mini-Circuits KK81 +# pin 1 will be upper left, pin N/2 will be lower left, +# pin N will be upper right as defined here +define(`COMMON_AMP_MICTOR_MIL', + ` + # number of pads + define(`NPADS', `$4') + + # number of segments of 38 pins each + define(`NSEG', eval(NPADS/38)) + + # pad width in 1/1000 mil + define(`PADWIDTH', `$5') + # pad length in 1/1000 mil + define(`PADLENGTH',`$6') + # pad pitch 1/1000 mil + define(`PITCH',`$7') + # seperation between pads on opposite sides 1/1000 mil + define(`PADSEP',`$8') + + # X coordinates for the right hand column of pads (mils) + define(`X1', `eval( (PADSEP/2 + PADLENGTH - PADWIDTH/2)/1000)') + define(`X2', `eval( (PADSEP/2 + PADWIDTH/2)/1000)') + + # silk screen width (mils) + define(`SILKW', `10') + define(`SILKSEP', `5') + + + # figure out if we have an even or odd number of pins per side + define(`TMP1', eval(NPADS/4)) + define(`TMP2', eval((4*TMP1 - NPADS) == 0)) + ifelse(TMP2, 1, `define(`EVEN',"yes")', `define(`EVEN',"no")') + + # silk bounding box is -XMAX,-YMAX, XMAX,YMAX (mils) + define(`XMAX', `200') + define(`YMAX', `eval(250 + NSEG*250 + 125)') + + define(`REV', `$9') + + ifelse(REV,"reverse", + `define(`CURPIN', NPADS)' + , + `define(`CURPIN', `1')' + ) +Element(0x00 "$1" "`$2'" "$3" -20 -60 0 100 0x00) +( + define(`SEG', `1') + define(`YOFS', eval((1-NSEG)*25000/2)) + forloop(`i', 1, eval(NPADS / 2), + ` + ifelse(eval(i > SEG*19), 1, + `define(`SEG', incr(SEG)) + define(`YOFS', eval((1-NSEG)*25000/2 + (SEG-1)*25000))',) + ifelse(EVEN,"yes", + `Pad( -X1 eval( (-(NPADS/4)*PITCH - PITCH/2 + i*PITCH + YOFS)/1000) + -X2 eval( (-(NPADS/4)*PITCH - PITCH/2 + i*PITCH + YOFS)/1000) + eval(PADWIDTH/1000) "CURPIN" "CURPIN" 0x0)', + `Pad( -X1 eval( (-(NPADS/4)*PITCH - PITCH + i*PITCH + YOFS)/1000) + -X2 eval( (-(NPADS/4)*PITCH - PITCH + i*PITCH + YOFS)/1000) + eval(PADWIDTH/1000) "CURPIN" "CURPIN" 0x0)') + + ifelse(REV,"reverse", + `define(`CURPIN', decr(CURPIN)) + define(`CURPIN', decr(CURPIN))', + `define(`CURPIN', incr(CURPIN)) + define(`CURPIN', incr(CURPIN))' + ) + ') + ifelse(REV,"reverse", + `define(`CURPIN', `2')' + , + `define(`CURPIN', `NPADS')' + ) + + define(`SEG', `1') + define(`YOFS', eval((NSEG-1)*25000/2)) + forloop(`i', eval((NPADS / 2) + 1), NPADS, + ` + ifelse(eval(i - NPADS/2 > SEG*19), 1, + `define(`SEG', incr(SEG)) + define(`YOFS', eval((NSEG-1)*25000/2 - (SEG-1)*25000))',) + ifelse(EVEN,"yes", + `Pad( X1 eval( ((NPADS/4)*PITCH + PITCH/2 - (i-NPADS/2)*PITCH + YOFS)/1000) + X2 eval( ((NPADS/4)*PITCH + PITCH/2 - (i-NPADS/2)*PITCH + YOFS)/1000) + eval(PADWIDTH/1000) "CURPIN" "CURPIN" 0x0)', + `Pad( X1 eval( ((NPADS/4)*PITCH + PITCH - (i-NPADS/2)*PITCH + YOFS)/1000) + X2 eval( ((NPADS/4)*PITCH + PITCH - (i-NPADS/2)*PITCH + YOFS)/1000) + eval(PADWIDTH/1000) "CURPIN" "CURPIN" 0x0)') + ifelse(REV,"reverse", + `define(`CURPIN', incr(CURPIN)) + define(`CURPIN', incr(CURPIN))', + `define(`CURPIN', decr(CURPIN)) + define(`CURPIN', decr(CURPIN))' + ) + ') + + define(`GNDpad', `60') + define(`GNDdrl', `32') +# now add the center row of grounding pins + define(`CURPIN', incr(NPADS)) + define(`YOFS', `eval(250-NSEG*250)') + forloop(`j', 1, NSEG, + `forloop(`i', -2, 2, + `Pin(0 eval(i*100 + YOFS) GNDpad GNDdrl "GND" "CURPIN" 0x01) + define(`CURPIN', incr(CURPIN))' + ) + define(`YOFS', eval(YOFS + 500))' + ) +# the latch pins + Pin(0 eval(-YOFS - 55) 80 53 "LATCH" "CURPIN" 0x01) + define(`CURPIN', incr(CURPIN)) + Pin(0 eval(YOFS + 55) 80 53 "LATCH" "CURPIN" 0x01) + define(`CURPIN', incr(CURPIN)) +# and the orientation pin + Pin(0 eval(-YOFS+50) 84 84 "ORIENT" "CURPIN" 0x09) + +# and finally the silk screen + ElementLine(-XMAX -YMAX -XMAX YMAX SILKW) + ElementLine(-XMAX YMAX XMAX YMAX SILKW) + ElementLine( XMAX YMAX XMAX -YMAX SILKW) + ElementLine(-XMAX -YMAX -25 -YMAX SILKW) + ElementLine( XMAX -YMAX 25 -YMAX SILKW) + + # punt on the arc on small parts as it can cover the pads + ifelse(eval((PADSEP-PADLENGTH)/1000 > 50), 1, `ElementArc(0 -YMAX 25 25 0 180 SILKW)', ) + + # Mark at the common centroid + Mark(0 0) +)') + +# dimensions are given in 1/100 mm. +# $5-$8 are pad width, length, pitch, and sep +define(`COMMON_AMP_MICTOR_MM', `COMMON_AMP_MICTOR_MIL(`$1',`$2',`$3',`$4', + eval($5*100000/254),eval($6*100000/254),eval($7*100000/254),eval($8*100000/254), `$9')') + + +define(`COMMON_AMP_MICTOR_767054', `COMMON_AMP_MICTOR_MIL(`$1',`$2',`$3',`$4',17000,50000,25000,278000)') + +# EXTRACT_BEGIN + +# +## Amp Mictor Connectors +# +define(`PKG_AMP_MICTOR_767054_1', `COMMON_AMP_MICTOR_767054(`$1',`$2',`$3',38)') +define(`PKG_AMP_MICTOR_767054_2', `COMMON_AMP_MICTOR_767054(`$1',`$2',`$3',76)') +define(`PKG_AMP_MICTOR_767054_3', `COMMON_AMP_MICTOR_767054(`$1',`$2',`$3',114)') +define(`PKG_AMP_MICTOR_767054_4', `COMMON_AMP_MICTOR_767054(`$1',`$2',`$3',152)') +define(`PKG_AMP_MICTOR_767054_5', `COMMON_AMP_MICTOR_767054(`$1',`$2',`$3',190)') +define(`PKG_AMP_MICTOR_767054_6', `COMMON_AMP_MICTOR_767054(`$1',`$2',`$3',228)') +define(`PKG_AMP_MICTOR_767054_7', `COMMON_AMP_MICTOR_767054(`$1',`$2',`$3',266)') + +# EXTRACT_END + Index: tags/1.0.5/old/oldlib/lib/amphenol.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/amphenol.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/amphenol.inc (revision 953) @@ -0,0 +1,67 @@ +# -*- m4 -*- +# +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003, 2004 Dan McMahill +# +# 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. +# +# +# Amphenol Connectors + + +# ARFX1229 SMA Connector +# 5.08 mm (200 mil) outer pin spacing +# 1.70 mm (67 mil, #51 drill) hole sizes + +define(`PKG_AMPHENOL_ARFX1229', + `define(`PAD_SIZE', `100') + define(`HOLE_SIZE', `67') + define(`CPAD_SIZE', `100') + define(`CHOLE_SIZE', `67') + define(`PAD_SPACE', `200') + define(`CENTER', `eval(PAD_SPACE/2)') + define(`SILK', `70') + define(`XMIN', `eval(-1*SILK)') + define(`XMAX', `eval(PAD_SPACE+SILK)') + define(`YMIN', `eval(-1*SILK)') + define(`YMAX', `eval(PAD_SPACE+SILK)') +Element(0x00 "$1" "`$2'" "$3" eval(XMIN+20) eval(YMAX+20) 0 100 0x00) +( + + Pin(CENTER CENTER CPAD_SIZE CHOLE_SIZE "1" 0x01) + Pin(0 0 PAD_SIZE HOLE_SIZE "2" 0x01) + Pin(0 PAD_SPACE PAD_SIZE HOLE_SIZE "3" 0x01) + Pin(PAD_SPACE 0 PAD_SIZE HOLE_SIZE "4" 0x01) + Pin(PAD_SPACE PAD_SPACE PAD_SIZE HOLE_SIZE "5" 0x01) + + # silk screen + # ends + ElementLine(XMIN YMIN XMIN YMAX 10) + ElementLine(XMAX YMAX XMAX YMIN 10) + ElementLine(XMIN YMIN XMAX YMIN 10) + ElementLine(XMAX YMAX XMIN YMAX 10) + Mark(CENTER CENTER) +)') + +# XXX once we get some sort of annotation layer in PCB, the right +# angle connectors should have an annotation showing where the connector +# really goes to. Same for a keep out layer. +define(`PKG_AMPHENOL_ARFX1230',`PKG_AMPHENOL_ARFX1229(`$1', `$2', `$3')') +define(`PKG_AMPHENOL_ARFX1231',`PKG_AMPHENOL_ARFX1229(`$1', `$2', `$3')') +define(`PKG_AMPHENOL_ARFX1232',`PKG_AMPHENOL_ARFX1229(`$1', `$2', `$3')') + Property changes on: tags/1.0.5/old/oldlib/lib/amphenol.inc ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/amphenol.list =================================================================== --- tags/1.0.5/old/oldlib/lib/amphenol.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/amphenol.list (revision 953) @@ -0,0 +1,30 @@ +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003 Dan McMahill +# +# 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. +# +# +# Amphenol Connectors + +# SMA +amphenol_ARFX1229:AMPHENOL_ARFX1229:AMPHENOL_ARFX1229 +amphenol_ARFX1230:AMPHENOL_ARFX1230:AMPHENOL_ARFX1230 +amphenol_ARFX1231:AMPHENOL_ARFX1231:AMPHENOL_ARFX1231 +amphenol_ARFX1232:AMPHENOL_ARFX1232:AMPHENOL_ARFX1232 + + Property changes on: tags/1.0.5/old/oldlib/lib/amphenol.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/amphenol.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/amphenol.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/amphenol.m4 (revision 953) @@ -0,0 +1,38 @@ +divert(-1) +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003 Dan McMahill +# +# 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. +# +# +# Amphenol Connectors + +# SMA +define(`Description_amphenol_ARFX1229', `Amphenol ARFX1229 Vertical SMA Connector (M)') +define(`PinList_amphenol_ARFX1229', ``SIG',`GND',`GND',`GND',`GND'') + +define(`Description_amphenol_ARFX1230', `Amphenol ARFX1230 Right Angle SMA Connector (M)') +define(`PinList_amphenol_ARFX1230', ``SIG',`GND',`GND',`GND',`GND'') + +define(`Description_amphenol_ARFX1231', `Amphenol ARFX1231 Vertical SMA Connector (F)') +define(`PinList_amphenol_ARFX1231', ``SIG',`GND',`GND',`GND',`GND'') + +define(`Description_amphenol_ARFX1232', `Amphenol ARFX1232 Right Angle SMA Connector (F)') +define(`PinList_amphenol_ARFX1232', ``SIG',`GND',`GND',`GND',`GND'') + +divert(0)dnl Property changes on: tags/1.0.5/old/oldlib/lib/amphenol.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/bga.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/bga.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/bga.inc (revision 953) @@ -0,0 +1,35 @@ +# BGA packages +# A. G. Major, 2000 + +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins along outer edge +# $5: number of rows +# +define(`PKG_BGA', + `define(`XBLOCK', `$4') + define(`YBLOCK', `$5') + define(`PITCH', `50') + define(`DIAMETER', `25') + define(`NUMPINS', `eval(4*(XBLOCK-4)*YBLOCK)') +Element(0x00 "$1" "`$2'" "$3" 100 0 0 100 0x00) +( + forloop(`i', 0, eval(XBLOCK-1), + `forloop(`j', 0, eval(YBLOCK-1), + `PAD(eval(i*PITCH), eval(j*PITCH), eval(i*PITCH), eval(j*PITCH), DIAMETER, 1)' + `PAD(eval((XBLOCK+YBLOCK-j-1)*PITCH), eval(i*PITCH), eval((XBLOCK+YBLOCK-j-1)*PITCH), eval(i*PITCH), DIAMETER, 1)' + `PAD(eval((XBLOCK+YBLOCK-i-1)*PITCH), eval((XBLOCK+YBLOCK-j-1)*PITCH), eval((XBLOCK+YBLOCK-i-1)*PITCH), eval((XBLOCK+YBLOCK-j-1)*PITCH), DIAMETER, 1)' + `PAD(eval(j*PITCH), eval((XBLOCK+YBLOCK-i-1)*PITCH), eval(j*PITCH), eval((XBLOCK+YBLOCK-i-1)*PITCH), DIAMETER, 1)' + )' + ) + ElementLine(eval(-PITCH/2) eval(-1*PITCH) eval((XBLOCK+YBLOCK)*PITCH) eval(-1*PITCH) 10) + ElementLine(eval((XBLOCK+YBLOCK)*PITCH) eval(-1*PITCH) eval((XBLOCK+YBLOCK)*PITCH) eval((XBLOCK+YBLOCK)*PITCH) 10) + ElementLine(eval(-1*PITCH) eval((XBLOCK+YBLOCK)*PITCH) eval((XBLOCK+YBLOCK)*PITCH) eval((XBLOCK+YBLOCK)*PITCH) 10) + ElementLine(eval(-1*PITCH) eval(-PITCH/2) eval(-1*PITCH) eval((XBLOCK+YBLOCK)*PITCH) 10) + ElementLine(eval(-PITCH/2) eval(-PITCH) eval(-PITCH/2) eval(-PITCH/2) 10) + ElementLine(eval(-PITCH) eval(-PITCH/2) eval(-PITCH/2) eval(-PITCH/2) 10) + Mark(eval((YBLOCK+1)*PITCH) eval((YBLOCK+1)*PITCH)) +)') + +# ------------------------------------------------------------------- Index: tags/1.0.5/old/oldlib/lib/bourns.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/bourns.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/bourns.inc (revision 953) @@ -0,0 +1,149 @@ +# -*- m4 -*- +# +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003, 2005 Dan McMahill +# +# 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. +# +# +# +# Bourns Specific Footprints + + +# Surface mount trim pots, such as the 3224 series. +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pin 1,3 width (1/100 mm) width is in the direction parallel to the +# $5: pin 1,3 length (1/100 mm) line which intersects pins 1 and 3 +# $6: pin 2 width (1/100 mm) +# $7: pin 2 length (1/100 mm) +# $8: spacing from pad center to pad center between 2 and 1,3 (1/100 mm) +# $9: spacing from pad center to pad center between 1 and 3 (1/100 mm) +# $10: package width (1/100 mm) + +define(`PKG_BOURNS_GENERIC_POT', + ` + # pin 1,3 width, length (1/100 mm) + define(`W13', `$4') + define(`L13', `$5') + + # pin 2 width, length (1/100 mm) + define(`W2', `$6') + define(`L2', `$7') + + # spacing from pad center to pad center between 2 and 1,3 (1/100 mm) + define(`S12', `$8') + # spacing from pad center to pad center between 1 and 3 (1/100 mm) + define(`S13', `$9') + + # package width (1/100 mm) + define(`WIDTH', `$10') + + # silkscreen width (mils) + define(`SILKW', `10') + + # how much space to leave around the part before the + # silk screen (mils) + define(`SILKS', `8') + # lower right corner for silk screen (mil) + ifelse(eval(L2 > L13), 1 + define(`SILKX', `eval((S12+L2)*50/254 + SILKS + SILKW/2)'), + define(`SILKX', `eval((S12+L13)*50/254 + SILKS + SILKW/2)') + ) + define(`SILKY', `eval((WIDTH/2)*100/254 + SILKS + SILKW/2)') + + # refdes text size (mil) + define(`TEXTSIZE', 100) + # x,y coordinates for refdes label (mil) + define(`TEXTX', -SILKX) + define(`TEXTY', `eval(-SILKY - 10 - TEXTSIZE/2)') + +Element(0x00 "$1" "`$2'" "$3" TEXTX TEXTY 0 TEXTSIZE 0x00) +( + +# pin 1 +ifelse(0, eval(W13>L13), + # Pads which have the perpendicular pad dimension less + # than or equal to the parallel pad dimension + Pad(eval( (S12 - L13 + W13)*50/254) eval( S13*50/254) + eval( (S12 + L13 - W13)*50/254) eval( S13*50/254) eval(W13*100/254) "1" 0x100) + , + # Pads which have the perpendicular pad dimension greater + # than or equal to the parallel pad dimension + Pad(eval( (S12 + L13)*50/254) eval((-S13 - W13 + L13)*50/254) + eval( (S12 + L13)*50/254) eval((-S13 + W13 - L13)*50/254) eval(L13*100/254) "1" 0x100) + ) + +# pin 2 +ifelse(0, eval(W2>L2), + # Pads which have the perpendicular pad dimension less + # than or equal to the parallel pad dimension + Pad(eval( (-S12 - L2 + W2)*50/254) 0 + eval( (-S12 + L2 - W2)*50/254) 0 eval(W2*100/254) "2" 0x100) + , + # Pads which have the Y (width) pad dimension greater + # than or equal to the X (length) pad dimension + Pad(eval( -S12*50/254) eval((- W2 + L2)*50/254) + eval( -S12*50/254) eval(( W2 - L2)*50/254) eval(L2*100/254) "2" 0x100) + ) + +# pin 3 +ifelse(0, eval(W13>L13), + # Pads which have the perpendicular pad dimension less + # than or equal to the parallel pad dimension + Pad(eval( (S12 - L13 + W13)*50/254) eval(-S13*50/254) + eval( (S12 + L13 - W13)*50/254) eval(-S13*50/254) eval(W13*100/254) "3" 0x100) + , + # Pads which have the perpendicular pad dimension greater + # than or equal to the parallel pad dimension + Pad(eval( (S12 + L13)*50/254) eval((-S13 - W13 + L13)*50/254) + eval( (S12 + L13)*50/254) eval((-S13 + W13 - L13)*50/254) eval(L13*100/254) "3" 0x100) + ) + +# Silk screen around package +ElementLine( SILKX SILKY SILKX -SILKY SILKW) +ElementLine( SILKX -SILKY -SILKX -SILKY SILKW) +ElementLine(-SILKX -SILKY -SILKX SILKY SILKW) +ElementLine(-SILKX SILKY SILKX SILKY SILKW) + +# Mark at the center of the part +Mark(0 0) +)') + +# ------------------------------------------------------------------- + +# EXTRACT_BEGIN + + +# +## Bourns 3224 Series SMT Trim Pot +# + +define(`PKG_BOURNS_3224G', `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3', + `127', `127', `200', `127', `520', `230', `480')') +define(`PKG_BOURNS_3224J', `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3', + `130', `200', `200', `200', `400', `230', `480')') +define(`PKG_BOURNS_3224W', `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3', + `130', `160', `200', `160', `290', `254', `480')') +define(`PKG_BOURNS_3224X', `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3', + `132', `190', `200', `190', `510', `254', `480')') + +# EXTRACT_END + Index: tags/1.0.5/old/oldlib/lib/candk.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/candk.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/candk.inc (revision 953) @@ -0,0 +1,190 @@ +# -*- m4 -*- +# +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2007 Dan McMahill +# +# 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; version 2 of the License. +# +# 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. +# +# The symbols produced by this file may be used and redistributed +# without restriction as part of a PCB layout file. Distribution +# of footprints produced by this file as part of a footprint +# library is governed by the same license as this source file. +# + +# C&K Specific Footprints + + +# ES series surface mount switches + +# $1: canonical name +# $2: name on PCB +# $3: value + +define(`PKG_CANDK_ES_SMT_SWITCH', + ` + # pad 1,2,3 width (1/100 mil) + define(`PADW1', `3500') + + # pad 1,2,3 length (1/100 mil) + define(`PADL1', `8200') + + # x value for pads 1,3 (1/100 mil) + define(`PADX1', `10000') + + # y value for pads 1,2,3 (1/100 mil) + define(`PADY1', `17500') + define(`PADY1A', `eval(PADY1 - (PADL1 - PADW1)/2)') + define(`PADY1B', `eval(PADY1 + (PADL1 - PADW1)/2)') + + + # mounting pad width (1/100 mil) + define(`PADW2', `9150') + + # mounting pad length (1/100 mil) + define(`PADL2', `6000') + + # x value for the mounting pads (1/100 mil) + define(`PADX2', `21175') + define(`PADX2A', `eval(PADX2 - (PADW2 - PADL2)/2)') + define(`PADX2B', `eval(PADX2 + (PADW2 - PADL2)/2)') + + # y value for the mounting pads (1/100 mil) + define(`PADY2', `-17500') + + # package width (1/100 mil) + define(`PACKW', `39500') + + # package height (1/100 mil) + define(`PACKH', `36000') + + # component veritcal height off board (1/100 mil) + define(`COMPH', `eval($9*10000/254)') + + # pad width and length + define(`PADW', `eval(PINW + 2000)') + define(`PADL', `eval(PINL + 2000)') + + # y values for drawing the pad. + # The Y center of the pad is 0.5*(PINL + PINS) + # we need a line segment of length PADL - PADW so we have end points: + # 0.5*(PINL + PINS) +/- 0.5*(PADL - PADW) + define(`PY1', `eval((PINL + PINS + PADL - PADW)/2)') + define(`PY2', `eval((PINL + PINS - PADL + PADW)/2)') + + # width of soldermask relief (5 mil on each side) + define(`MASKW1', `eval(PADW1 + 1000)') + define(`MASKW2', `eval(PADL2 + 1000)') + + # top edge of switch body (1/100 mil) + define(`SWTOP', `eval(PADY2 - 5000)') + + # bottom edge of switch body (1/100 mil) + define(`SWBOT', `eval(SWTOP + PACKH)') + + # how much the switch extends beyond the body + define(`SWEXT', `12100') + + # y value for the far end of the switch + define(`SWYMAX', `eval(SWTOP - SWEXT)') + + # silkscreen width (1/100 mils) + define(`SILKW', `1000') + + # how much space to leave around the part before the + # silk screen (1/100 mils) + define(`SILKS', `800') + + # X values for silk on sides and bottom of switch + define(`SX1', `eval( (PACKW + 2*SILKS + SILKW)/2)') + define(`SX2', `eval( 10000 + PADW1/2 + SILKS + SILKW/2)') + + # bottom edge of the switch body + define(`SY1', `eval( SWBOT + SILKS + SILKW/2 )') + + # bottom edge of upper pads + define(`SY2', `eval( PADY2 + PADL2/2 + SILKS + SILKW/2)') + + # bottom edge of the lower pads + define(`SY3', `eval( PADY1 + PADL1/2 + SILKS + SILKW/2)') + + # top edge of the switch body + define(`SY4', `eval( PADY2 - PADL2/2 - SILKS - SILKW/2)') + + # top edge of the switch + define(`SY5', `eval( SWTOP - SILKS - SILKW/2)') + + +# Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags] +Element[ "" "`$1'" "`$2'" "`$3'" 0 0 0 0 0 100 ""] +( + +# Pad [rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" SFlags] + +# the signal pads +Pad[ -PADX1 PADY1A -PADX1 PADY1B PADW1 1000 MASKW1 "1" "1" "square"] +Pad[ 0 PADY1A 0 PADY1B PADW1 1000 MASKW1 "2" "2" "square"] +Pad[ PADX1 PADY1A PADX1 PADY1B PADW1 1000 MASKW1 "3" "3" "square"] + +# the mounting pads +Pad[ -PADX2A PADY2 -PADX2B PADY2 PADL2 1000 MASKW2 "4" "4" "square"] +Pad[ PADX2A PADY2 PADX2B PADY2 PADL2 1000 MASKW2 "4" "4" "square"] + +# Silk screen around package +# ElementLine[ x1 y1 x2 y2 width] + +# bottom edge +ElementLine[ SX1 SY1 SX2 SY1 SILKW ] +ElementLine[-SX1 SY1 -SX2 SY1 SILKW ] +ElementLine[-SX2 SY1 -SX2 SY3 SILKW ] +ElementLine[ SX2 SY1 SX2 SY3 SILKW ] +ElementLine[-SX2 SY3 SX2 SY3 SILKW ] + +# left/right +ElementLine[ SX1 SY1 SX1 SY2 SILKW ] +ElementLine[-SX1 SY1 -SX1 SY2 SILKW ] + +# top edge +ElementLine[-SX1 SWYMAX SX1 SWYMAX SILKW ] +ElementLine[-SX1 SY5 SX1 SY5 SILKW ] +ElementLine[-SX1 SY4 -SX1 SWYMAX SILKW ] +ElementLine[ SX1 SY4 SX1 SWYMAX SILKW ] + +# cross at top where switch moves +ElementLine[-SX1 SWYMAX SX1 SY5 SILKW ] +ElementLine[-SX1 SY5 SX1 SWYMAX SILKW ] + +)') + +# ------------------------------------------------------------------- + +# EXTRACT_BEGIN + + +# +## C&K ES Series Switches +# + +# See www.ittcannon.com. + +define(`PKG_CANDK_ES01MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')') +define(`PKG_CANDK_ES02MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')') +define(`PKG_CANDK_ES03MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')') + + + +# EXTRACT_END + Index: tags/1.0.5/old/oldlib/lib/common.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/common.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/common.m4 (revision 953) @@ -0,0 +1,115 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# common defines for packages +# +# ------------------------------------------------------------------- +# create a single object +# $1: mask name +# $2: 'value' of the new object +# $3: package of the circuit +# +define(`CreateObject', + `ifdef(`PinList_$1', `DefinePinList(PinList_$1)')' + `PKG_$3(`Description_$1', ,``$2'', Param1_$1, Param2_$1)' +) + +# this one is used to show the correct value for the footprint attribute +# in a gschem (www.geda.seul.org) schematic. See QueryLibrary.sh +define(`QueryObject', + `ifdef(`PinList_$1', `DefinePinList(PinList_$1)')' +`$3 ifdef(`Param1_$1', `Param1_$1') ifdef(`Param2_$1', `Param2_$1')' +) + +# ------------------------------------------------------------------- +# define for-loops like the manual tells us +# +define(`forloop', + `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')') +define(`_forloop', + `$4`'ifelse($1, `$3', , + `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')') + +# ------------------------------------------------------------------- +# the following definitions evaluate the list of pin-names +# missing names will be defined as 'P_#' +# +# the first two arguments are skipped +# +define(`PIN', `Pin($1 $2 $3 $4 ifdef(`P_$5', "P_$5", "$5") ifelse($5, 1, 0x101, 0x01))') +define(`PAD', `Pad($1 $2 $3 $4 $5 ifdef(`P_$6', "P_$6", "$6") ifelse($6, 1, 0x00, 0x100))') + +define(`EDGECONN', `Pad($1 $2 $3 $4 $5 ifdef(`P_$6', "P_$6", "$6") "$6" $7)') +define(`DEFPIN', `define(`count', incr(count))' `define(`P_'count, $1)') +define(`DefinePinList', `ifelse($#, 1, , + `pushdef(`count')' + `define(`count', 0)' + `_DEFPINLIST($@)' + `popdef(`count')')') +define(`_DEFPINLIST', `ifelse($#, 0, , $#, 1, `DEFPIN(`$1')', + `DEFPIN(`$1')'` + _DEFPINLIST(shift($@))')') + +define(`args',` + ifelse($#, 0, , $#, 1,`define(`arg'cnt,`$1')', + `define(`arg'cnt,`$1') define(`cnt',incr(cnt)) args(shift($@))')') + +include(amp.inc) +include(amphenol.inc) +include(bga.inc) +include(bourns.inc) +include(candk.inc) +include(connector.inc) +include(cts.inc) +include(dil.inc) +include(geda.inc) +include(johnstech.inc) +include(minicircuits.inc) +include(misc.inc) +include(nichicon.inc) +include(optek.inc) +include(panasonic.inc) +include(pci.inc) +include(plcc.inc) +include(qfn.inc) +include(qfp.inc) +include(qfp2.inc) +include(qfpdj.inc) +include(resistor_adjust.inc) +include(rules.inc) +include(smt.inc) +include(to.inc) +include(zif.inc) + +# if any of these files exist, then include them. +# this makes it a bit easier to configure pcb without +# mucking with app-defaults every time you launch it +sinclude(site-config.inc) +sinclude(user-config.inc) +sinclude(proj-config.inc) + +divert(0)dnl Index: tags/1.0.5/old/oldlib/lib/connector.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/connector.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/connector.inc (revision 953) @@ -0,0 +1,766 @@ +*# -*- m4 -*- +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# connector packages + +# ------------------------------------------------------------------- +# the definition of a single connector +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of rows +# $5: number of columns +# +define(`PKG_CONNECTOR', + `define(`MAXY', `eval(`$4' * 100)') + define(`MAXX', `eval(`$5' * 100)') +Element(0x00 "$1" "`$2'" "$3" eval(MAXX + 60) 0 3 100 0x00) +( + forloop(`row', 1, $4, `forloop(`col', 1, $5, + `PIN(eval(col * 100 -50), eval(row * 100 -50), 60, 38, eval((row-1)*$5+col)) + ') ') + ElementLine(0 0 0 MAXY 10) + ElementLine(0 MAXY MAXX MAXY 10) + ElementLine(MAXX MAXY MAXX 0 10) + ElementLine(MAXX 0 0 0 10) + ElementLine(0 100 100 100 10) + ElementLine(100 100 100 0 10) + Mark(50 50) +)') + +# ------------------------------------------------------------------- +# the definition of a 2 column header connector with DIP +# pin numbering. Use PKG_CONNECTOR for ribbon cable numbering +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of rows +# +define(`PKG_CONNECTOR_DIL', + `define(`MAXY', `eval(`$4' * 100)') + define(`MAXX', `200') +Element(0x00 "$1" "`$2'" "$3" eval(MAXX + 60) 0 3 100 0x00) +( + forloop(`row', 1, eval(`$4'), + `PIN(50, eval(row * 100 -50), 60, 38, eval(row)) + ') + forloop(`row', 1, eval(`$4'), + `PIN(150, eval(($4 + 1 - row) * 100 -50), 60, 38, eval($4 + row)) + ') + ElementLine(0 0 0 MAXY 10) + ElementLine(0 MAXY MAXX MAXY 10) + ElementLine(MAXX MAXY MAXX 0 10) + ElementLine(MAXX 0 0 0 10) + ElementLine(0 100 100 100 10) + ElementLine(100 100 100 0 10) + Mark(50 50) +)') + + + +# --------------------------------------------------------------- +# base definition (housing) for connector DIN 41.612 +# 11/95 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de) +# female package added 05/96 also by Volker Bosch +# +# derived from above for 48 - Pin Connectors from the same series +# Holm Tiffe +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: requested rows a,b,c +# +define(`PKG_DIN41_612MALE_SMALL', + `define(`XPOS', `eval(300 + 100 * i)') + define(`MINY', 300) +Element(0x00 "$1" "`$2'" "$3" 520 550 0 200 0x00) +( + # Reihe a + ifelse(index(`$4', `a'), `-1', , + forloop(`i', 1, 16, `PIN(eval(2000 - 100 *i), 300, 60, 30, i) + ')) + + # Reihe b + ifelse(index(`$4', `b'), `-1', , `define(`MINY', 200)' + forloop(`i', 1, 16, `PIN(eval(2000 - 100 *i), 200, 60, 30, eval(16 + i)) + ')) + + # Reihe c + ifelse(index(`$4', `c'), `-1', , `define(`MINY', 100)' + forloop(`i', 1, 16, `PIN(eval(2000 - 100 *i), 100, 60, 30, eval(32 + i)) + ')) + # Rueckseite Kontaktstifte + forloop(`i', 1, 16, `ElementLine(XPOS MINY XPOS 375 40) + ') + + # Befestigungsbohrung + Pin( 200 400 120 80 "M1" 0x01) + Pin(2100 400 120 80 "M2" 0x01) + + # Begrenzung M1 + ElementLine( 100 300 320 300 20) + ElementLine( 320 300 320 395 20) + ElementLine( 320 395 320 620 10) + ElementLine( 320 620 200 620 10) + ElementLine( 200 620 100 620 20) + ElementLine( 100 620 100 300 20) + + # Begrenzung M2 + ElementLine(1980 300 2200 300 20) + ElementLine(2200 300 2200 620 20) + ElementLine(2200 620 2100 620 20) + ElementLine(2100 620 1980 620 10) + ElementLine(1980 620 1980 395 10) + ElementLine(1980 395 1980 300 20) + + # Kante Pins + ElementLine( 320 395 1980 395 20) + + # Kanten Stifte + ElementLine( 200 620 200 800 20) + ElementLine( 200 800 2100 800 20) + ElementLine(2100 800 2100 620 20) + + Mark(1900 300) +)') + +define(`PKG_DIN41_612FEMALE_SMALL', + `define(`MAXX', 420) + define(`MAXX1', `eval(MAXX -170)') + define(`MAXX2', `eval(MAXX -40)') +Element(0x00 "$1" "`$2'" "$3" 50 100 3 200 0x00) +( + # Reihe a + ifelse(index(`$4', `a'), `-1', , + forloop(`i', 1, 16, `PIN(200, eval(300 + 100 *i), 60, 30, i) + ')) + + # Reihe b + ifelse(index(`$4', `b'), `-1', , + forloop(`i', 1, 16, `PIN(300, eval(300 + 100 *i), 60, 30, eval(16 + i)) + ')) + + # Reihe c + ifelse(index(`$4', `c'), `-1', , `define(`MAXX', 520)' + forloop(`i', 1, 16, `PIN(400, eval(300 + 100 *i), 60, 30, eval(32 + i)) + ')) + + # Befestigungsbohrung + Pin(290 180 120 80 "M1" 0x01) + Pin(290 2120 120 80 "M2" 0x01) + + # Aeussere Begrenzung + ElementLine( 80 80 MAXX 80 20) + ElementLine(MAXX 80 MAXX 2220 20) + ElementLine(MAXX 2220 80 2220 20) + ElementLine( 80 2220 80 80 20) + + # Innere Begrenzung + ElementLine(120 320 MAXX1 320 10) + ElementLine(MAXX1 320 MAXX1 360 10) + ElementLine(MAXX1 360 MAXX2 360 10) + ElementLine(MAXX2 360 MAXX2 1940 10) + ElementLine(MAXX2 1940 MAXX1 1940 10) + ElementLine(MAXX1 1940 MAXX1 1980 10) + ElementLine(MAXX1 1980 120 1980 10) + ElementLine(120 1980 120 320 10) + + # Markierung: Pin 1a + Mark(200 400) +)') + + +# --------------------------------------------------------------- +# base definition (housing) for connector DIN 41.612 +# 11/95 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de) +# female package added 05/96 also by Volker Bosch +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: requested rows a,b,c +# +define(`PKG_DIN41_612MALE', + `define(`XPOS', `eval(300 + 100 * i)') + define(`MINY', 300) +Element(0x00 "$1" "`$2'" "$3" 520 550 0 200 0x00) +( + # Reihe a + ifelse(index(`$4', `a'), `-1', , + forloop(`i', 1, 32, `PIN(eval(3600 - 100 *i), 300, 60, 30, i) + ')) + + # Reihe b + ifelse(index(`$4', `b'), `-1', , `define(`MINY', 200)' + forloop(`i', 1, 32, `PIN(eval(3600 - 100 *i), 200, 60, 30, eval(32 + i)) + ')) + + # Reihe c + ifelse(index(`$4', `c'), `-1', , `define(`MINY', 100)' + forloop(`i', 1, 32, `PIN(eval(3600 - 100 *i), 100, 60, 30, eval(64 + i)) + ')) + # Rueckseite Kontaktstifte + forloop(`i', 1, 32, `ElementLine(XPOS MINY XPOS 375 40) + ') + + # Befestigungsbohrung + Pin( 200 400 120 80 "M1" 0x01) + Pin(3700 400 120 80 "M2" 0x01) + + # Begrenzung M1 + ElementLine( 100 300 320 300 20) + ElementLine( 320 300 320 395 20) + ElementLine( 320 395 320 620 10) + ElementLine( 320 620 200 620 10) + ElementLine( 200 620 100 620 20) + ElementLine( 100 620 100 300 20) + + # Begrenzung M2 + ElementLine(3580 300 3800 300 20) + ElementLine(3800 300 3800 620 20) + ElementLine(3800 620 3700 620 20) + ElementLine(3700 620 3580 620 10) + ElementLine(3580 620 3580 395 10) + ElementLine(3580 395 3580 300 20) + + # Kante Pins + ElementLine( 320 395 3580 395 20) + + # Kanten Stifte + ElementLine( 200 620 200 800 20) + ElementLine( 200 800 3700 800 20) + ElementLine(3700 800 3700 620 20) + + Mark(3500 300) +)') + +define(`PKG_DIN41_612FEMALE', + `define(`MAXX', 420) + define(`MAXX1', `eval(MAXX -170)') + define(`MAXX2', `eval(MAXX -40)') +Element(0x00 "$1" "`$2'" "$3" 50 100 3 200 0x00) +( + # Reihe a + ifelse(index(`$4', `a'), `-1', , + forloop(`i', 1, 32, `PIN(200, eval(300 + 100 *i), 60, 30, i) + ')) + + # Reihe b + ifelse(index(`$4', `b'), `-1', , + forloop(`i', 1, 32, `PIN(300, eval(300 + 100 *i), 60, 30, eval(32 + i)) + ')) + + # Reihe c + ifelse(index(`$4', `c'), `-1', , `define(`MAXX', 520)' + forloop(`i', 1, 32, `PIN(400, eval(300 + 100 *i), 60, 30, eval(64 + i)) + ')) + + # Befestigungsbohrung + Pin(290 180 120 80 "M1" 0x01) + Pin(290 3720 120 80 "M2" 0x01) + + # Aeussere Begrenzung + ElementLine( 80 80 MAXX 80 20) + ElementLine(MAXX 80 MAXX 3820 20) + ElementLine(MAXX 3820 80 3820 20) + ElementLine( 80 3820 80 80 20) + + # Innere Begrenzung + ElementLine(120 320 MAXX1 320 10) + ElementLine(MAXX1 320 MAXX1 360 10) + ElementLine(MAXX1 360 MAXX2 360 10) + ElementLine(MAXX2 360 MAXX2 3540 10) + ElementLine(MAXX2 3540 MAXX1 3540 10) + ElementLine(MAXX1 3540 MAXX1 3580 10) + ElementLine(MAXX1 3580 120 3580 10) + ElementLine(120 3580 120 320 10) + + # Markierung: Pin 1a + Mark(200 400) +)') + +# --------------------------------------------------------------- +# base definition (housing) for connector DIN 41.651 laying and standing +# 05/96 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de) +# +# Changed hole size from 20 mils to 28 mils; 07/00 LRDoolittle@lbl.gov +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins +# +define(`PKG_DIN41_651LAY', + `define(`MAXY', `eval($4/2 *100 +400)') + define(`CENTERY', `eval($4/2 *50 +425)') +Element(0x00 "$1" "`$2'" "$3" 400 250 3 200 0x00) +( + forloop(`i', 1, eval($4 / 2), + `PIN(100, eval(100*i +400), 60, 40, eval(2*i-1)) + PIN(200, eval(100*i +400), 60, 40, eval(2*i)) + ') + + # Befestigungsbohrung + Pin(180 270 100 80 "M1" 0x01) + Pin(180 eval(MAXY+230) 100 80 "M2" 0x01) + + # aeusserer Rahmen + ElementLine(80 70 335 70 20) + ElementLine(335 70 770 200 20) + ElementLine(770 200 770 300 20) + ElementLine(770 300 610 390 20) + ElementLine(610 390 610 eval(MAXY+150) 20) + ElementLine(610 eval(MAXY+150) 770 eval(MAXY+200) 20) + ElementLine(770 eval(MAXY+200) 770 eval(MAXY+300) 20) + ElementLine(770 eval(MAXY+300) 335 eval(MAXY+430) 20) + ElementLine(335 eval(MAXY+430) 80 eval(MAXY+430) 20) + ElementLine( 80 eval(MAXY+430) 80 70 20) + + # Codieraussparung + ElementLine(610 eval(CENTERY -50) 435 eval(CENTERY -50) 5) + ElementLine(435 eval(CENTERY -50) 435 eval(CENTERY +100) 5) + ElementLine(435 eval(CENTERY +100) 610 eval(CENTERY +100) 5) + + # Markierung Pin 1 + ElementLine(610 450 500 500 5) + ElementLine(500 500 610 550 5) + + # Plazierungsmarkierung == Pin 1 + Mark(100 500) +)') + +define(`PKG_DIN41_651STAND', + `define(`MAXY', `eval($4/2 *100 +400)') + define(`CENTERY', `eval($4/2 *50 +425)') +Element(0x00 "$1" "`$2'" "$3" 50 100 3 200 0x00) +( + forloop(`i', 1, eval($4 / 2), + `PIN(200, eval(100*i +400), 60, 40, eval(2*i-1)) + PIN(300, eval(100*i +400), 60, 40, eval(2*i)) + ') + # aeusserer Rahmen + ElementLine(90 70 410 70 20) + ElementLine(410 70 410 eval(MAXY +430) 20) + ElementLine(410 eval(MAXY +430) 90 eval(MAXY +430) 20) + ElementLine(90 eval(MAXY +430) 90 70 20) + + # innerer Rahmen mit Codieraussparung + ElementLine(110 350 390 350 5) + ElementLine(390 350 390 eval(MAXY +150) 5) + ElementLine(390 eval(MAXY +150) 110 eval(MAXY +150) 5) + ElementLine(110 eval(MAXY +150) 110 eval(CENTERY +100) 5) + ElementLine(110 eval(CENTERY +100) 90 eval(CENTERY +100) 5) + ElementLine(90 eval(CENTERY -50) 110 eval(CENTERY -50) 5) + ElementLine(110 eval(CENTERY -50) 110 350 5) + + # Markierung Pin 1 + ElementLine(110 390 150 350 5) + + # Auswurfhebel oben + ElementLine(200 70 200 350 5) + ElementLine(300 70 300 350 5) + + # Auswurfhebel unten + ElementLine(200 eval(MAXY+150) 200 eval(MAXY+430) 5) + ElementLine(300 eval(MAXY+150) 300 eval(MAXY+430) 5) + + # Plazierungsmarkierung == Pin 1 + Mark(200 500) +)') + +# --------------------------------------------------------------- +# base definition (housing) for SUB-D connectors, laying +# 11/95 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de) +# female package added 05/96 also by Volker Bosch +# Pins reordered, 12/99 Larry Doolittle + +# Connector dimensions changed! No, these stupid things don't +# line up neatly on a 50 mil grid. Now corresponds to AMP's +# Application Specification 114-40013 03-APR-97 Rev B, for +# AMPLIMITE[TM] HD-20 Series 454 and 545. +# Also pulled silkscreen lines away from pins by NOSMUDGE. +# 12/99 Larry Doolittle +# +# Parameterized silkscreen in terms of PANEL_DISTANCE, the distance +# from the drilling holes to the intended edge of the board. +# According to the drawing listed above, that should be 398 or 489 +# plus some unknown flange thickness. For the part I have in my hand +# (AMP 747846-4), it's about 365 mils. The original version of this +# macro had it hard coded at 460. I also reduced size of pads and holes +# to 60/35. The drawing listed above recommends 47 mil holes, the part +# in my hand has 28 mil pins. +# +# Status: Female tested, works great, 07-Jan-2000. +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pins +# +# base is upper drilling hole +# +define(`PKG_SUBD_LAY_BASE', + `define(`BASEX', 1000) + define(`BASEY', 1000) + define(`PY1', `eval(BASEY +270)') + define(`PY2', `eval(PY1 +($4-1)/2*108)') + define(`OFFSET', `eval(($4+1)/2)') + define(`PANEL_DISTANCE', 365) +Element(0x00 "$1" "`$2'" "$3" eval(BASEX-0) eval(PY2-0) 1 150 0x00) +( + # Gehaeuse (schmaler Kasten incl. Bohrungen) + define(`X1', `eval(BASEX-PANEL_DISTANCE)') + define(`Y1', `eval(PY1-390)') + define(`X2', `eval(BASEX-PANEL_DISTANCE+30)') + define(`Y2', `eval(PY2+390)') + ElementLine(X1 Y1 X2 Y1 10) + ElementLine(X2 Y1 X2 Y2 10) + ElementLine(X2 Y2 X1 Y2 10) + ElementLine(X1 Y2 X1 Y1 10) + ElementLine(X1 eval(Y1+60) X2 eval(Y1+60) 10) + ElementLine(X1 eval(Y1+180) X2 eval(Y1+180) 10) + ElementLine(X1 eval(Y2-60) X2 eval(Y2-60) 10) + ElementLine(X1 eval(Y2-180) X2 eval(Y2-180) 10) + + # Gehaeuse (aeusserer Kasten) + # This part of the connector normally hangs off the circuit board, + # so it is confusing to actually mark it on the silkscreen + # define(`X1', `eval(BASEX-PANEL_DISTANCE-260)') + # define(`Y1', `eval(PY1-100)') + # define(`X2', `eval(BASEX-PANEL_DISTANCE)') + # define(`Y2', `eval(PY2+100)') + # ElementLine(X1 Y1 X2 Y1 20) + # ElementLine(X2 Y1 X2 Y2 10) + # ElementLine(X2 Y2 X1 Y2 20) + # ElementLine(X1 Y2 X1 Y1 20) + + # Gehaeuse (innerer Kasten) + define(`X1', `eval(BASEX-PANEL_DISTANCE+30)') + define(`Y1', `eval(PY1-160)') + define(`X2', `eval(BASEX-230)') + define(`Y2', `eval(PY2+160)') + ElementLine(X1 Y1 X2 Y1 20) + ElementLine(X2 Y1 X2 Y2 20) + ElementLine(X2 Y2 X1 Y2 20) + ElementLine(X1 Y2 X1 Y1 10) + + # Pins + SUBD_SUBFUNCTION + + # Befestigungsbohrung + Pin(BASEX BASEY 250 125 "C1" 0x01) + Pin(BASEX eval(PY2+270) 250 125 "C2" 0x01) + +)') + +define(`PKG_SUBD_MALE_LAY', + `define(`SUBD_SUBFUNCTION', + ` + define(`NOSMUDGE', 40) + # First row + forloop(`i', 1, eval($4/2), + `define(`Y', eval(PY1 +(i-1)*108)) + PIN(eval(BASEX+56), Y, 60, 35, i) + ElementLine(eval(BASEX+56-NOSMUDGE) Y X2 Y 20) + ') + + # Last pin in first row + PIN(eval(BASEX+56), PY2, 60, 35, OFFSET) + ElementLine(eval(BASEX+56-NOSMUDGE) PY2 X2 PY2 20) + + # Second row + forloop(`i', 1, eval($4/2), + `define(`Y', eval(PY1 +(i-1)*108+54)) + PIN(eval(BASEX-56), Y, 60, 35, eval(i+OFFSET)) + ElementLine(eval(BASEX-56-NOSMUDGE) Y X2 Y 20) + ') + # Plazierungsmarkierung == PIN 1 + Mark(eval(BASEX +50) PY1) + ')' + `PKG_SUBD_LAY_BASE(`$1', `$2', `$3', `$4')' +) + +define(`PKG_SUBD_FEMALE_LAY', + `define(`SUBD_SUBFUNCTION', + ` + define(`NOSMUDGE', 40) + # Pin 1 + PIN(eval(BASEX+56), PY2, 60, 35, 1) + ElementLine(eval(BASEX+56-NOSMUDGE) PY2 X2 PY2 20) + + # Plazierungsmarkierung == PIN 1 + # Changed PY1 to PY2 13-Dec-1999 LRD + Mark(eval(BASEX +56) PY2) + + # Remainder of the first row + forloop(`i', 1, eval($4/2), + `define(`Y', eval(PY1 +($4/2-i)*108)) + PIN(eval(BASEX+56), Y, 60, 35, eval($4/2+i+2-OFFSET)) + ElementLine(eval(BASEX+56-NOSMUDGE) Y X2 Y 20) + ') + + # Second row + forloop(`i', 1, eval($4/2), + `define(`Y', eval(PY1 +($4/2-i)*108+54)) + PIN(eval(BASEX-56), Y, 60, 35, eval($4/2+i+1)) + ElementLine(eval(BASEX-56-NOSMUDGE) Y X2 Y 20) + ') + ')' + `PKG_SUBD_LAY_BASE(`$1', `$2', `$3', `$4')' +) + +# --------------------------------------------------------------- +# definition for a right angle BNC connector, +# such as Amphenol 31-5640-1010 or OUPIIN 8928 +# 12/99 Larry Doolittle +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pins +# +# base is one of the pegs +# +define(`PKG_BNC_LAY', + `define(`BASEX', 200) + define(`BASEY', -200) +Element(0x00 "$1" "`$2'" "$3" BASEX eval(BASEY+200) 3 100 0x00) +( + define(`X1', `eval(BASEX-260)') + define(`Y1', `eval(BASEY-90)') + define(`X2', `eval(BASEX+290)') + define(`Y2', `eval(BASEY+490)') + ElementLine(X1 Y1 X2 Y1 10) + ElementLine(X2 Y1 X2 Y2 10) + ElementLine(X2 Y2 X1 Y2 10) + ElementLine(X1 Y2 X1 Y1 10) + PIN(eval(BASEX-200), eval(BASEY+200), 60, 35, 1) + PIN(eval(BASEX-200), eval(BASEY+100), 60, 35, 2) + PIN(eval(BASEX), eval(BASEY), 100, 81, m1) + PIN(eval(BASEX), eval(BASEY+400), 100, 81, m2) +)') + + +# --------------------------------------------------------------- +# definition for MTA-100 header, +# such as AMP 640456-x +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pins +# +# 0.100" pin pitch +# 0.038" drill diameter +# 0.060" pad diameter +# Available with 2 through 15 pins +# +define(`PKG_MTA_100', +` + define(`PITCH', `100') + define(`NPINS', `eval($4)') + define(`SILKW', `10') + define(`SILKXOFS', `75') + define(`SILKYOFS', `115') + define(`SILKX1', `-SILKXOFS') + define(`SILKX2', `eval((NPINS-1)*PITCH + SILKXOFS)') + define(`SILKY1', `-SILKYOFS') + define(`SILKY2', `SILKYOFS') + define(`SILKY3', `eval(SILKYOFS+2*SILKW)') + +Element(0x00 "$1" "`$2'" "$3" 0 140 0 150 0x00) +( + forloop(`i', 1, `$4', + `PIN(eval((i-1)*100), 0, 60, 38, `i') + ') + define(`X1',-78) + define(`X2', `eval(`$4'*100-78)') + ElementLine(SILKX1 SILKY1 SILKX2 SILKY1 SILKW) + ElementLine(SILKX2 SILKY1 SILKX2 SILKY3 SILKW) + ElementLine(SILKX2 SILKY2 SILKX1 SILKY2 SILKW) + ElementLine(SILKX1 SILKY3 SILKX1 SILKY1 SILKW) + + ElementLine(SILKX2 SILKY3 SILKX1 SILKY3 SILKW) + + Mark(0 0) +)') + +# --------------------------------------------------------------- +# definition for MTA-156 header, +# such as AMP 640445-x +# 12/99 Larry Doolittle +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pins +# +# base is pin 1 (although I don't claim to know which end is +# conventionally pin 1) +# 0.156 pin pitch +# 0.070 holes +# 0.078 end clearance +# 0.180 and 0.120 side clearance +# Available with 2 through 24 pins +# +define(`PKG_MTA_156', + ` +Element(0x00 "$1" "`$2'" "$3" 0 140 0 150 0x00) +( + forloop(`i', 1, `$4', + `PIN(eval((i-1)*156), 0, 100, 70, `i') + ') + define(`X1',-78) + define(`X2', `eval(`$4'*156-78)') + ElementLine(X1 120 X2 120 10) + ElementLine(X2 120 X2 -180 10) + ElementLine(X2 -180 X1 -180 10) + ElementLine(X2 -80 X1 -80 10) + ElementLine(X1 -180 X1 120 10) +)') + +# --------------------------------------------------------------- +# definition for a vertical SMA connector, +# 6/00 Larry Doolittle +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pins +# +# base is the center pin +# +define(`PKG_SMA_VERT', + `define(`BASEX', 0) + define(`BASEY', 0) +Element(0x00 "$1" "`$2'" "$3" BASEX eval(BASEY+150) 3 100 0x00) +( + define(`X1', `eval(BASEX-160)') + define(`Y1', `eval(BASEY-160)') + define(`X2', `eval(BASEX+160)') + define(`Y2', `eval(BASEY+160)') + ElementLine(X1 Y1 X2 Y1 10) + ElementLine(X2 Y1 X2 Y2 10) + ElementLine(X2 Y2 X1 Y2 10) + ElementLine(X1 Y2 X1 Y1 10) + PIN( BASEX , BASEY , 80, 30, 1) + PIN(eval(BASEX-100), eval(BASEY+100), 80, 30, 2) + PIN(eval(BASEX-100), eval(BASEY-100), 80, 30, 3) + PIN(eval(BASEX+100), eval(BASEY+100), 80, 30, 4) + PIN(eval(BASEX+100), eval(BASEY-100), 80, 30, 5) +)') + +# --------------------------------------------------------------- +# definition for a Molex high density connector, 53467/53645 +# Board-to-Board 0.635mm (0.25") Ptich Plug - SMT Dual Row, Vertical Stacking +# Reference: http://www.molex.com/product/micro/53467.html +# 4/01 Larry Doolittle +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pins +# +# base is on the symmetry line, between pins 1 and 2 +# +define(`PKG_MOLEX_025', + `define(`PINPAIRS',`eval($4/2)') +Element(0x00 "$1" "`$2'" "$3" 0 0 3 100 0x00) +( + forloop(`i', 1, PINPAIRS, + `define(`Y', eval(25*(i-1)) )' + `PAD( 54, Y, 111, Y, 14, eval(i*2-1))' + `PAD(-111, Y, -54, Y, 14, eval(i*2))' + ) + define(`ENDY',eval(25*(PINPAIRS-1))) + + # Keying is done with two sizes of alignment pins: 35 and 28 mils + Pin(0 -50 50 35 "M1" 0x01) + Pin(0 eval(ENDY+50) 43 28 "M2" 0x01) + + # ends of mounting pads are 71 and 169 mils from end pad centers + PAD(0, -110, 0, -130, 79, M3) + PAD(0, eval(ENDY+110), 0, eval(ENDY+130), 79, M4) + + define(`BOXY',eval(ENDY+150)) + ElementLine(-100 -150 50 -150 10) + ElementLine( 50 -150 100 -100 10) + ElementLine( 100 -100 100 BOXY 10) + ElementLine( 100 BOXY -100 BOXY 10) + ElementLine(-100 BOXY -100 -150 10) + + # Support for aggregate parts built from this base, like + # the nanoEngine below. + ifdef(`MOLEX_EXTRA', `MOLEX_EXTRA', ) +)') + +# --------------------------------------------------------------- +# definition for a Bright Star nanoEngine, StrongARM single board computer +# Reference: http://www.brightstar.com/arm/nanoman.pdf +# 4/01 Larry Doolittle +# +# $1: canonical name +# $2: name on PCB +# $3: value +# +# base borrowed from the Molex connector +# +define(`PKG_NANOENGINE', + `define(`MOLEX_EXTRA', ` + ElementLine(-175 -215 -175 2185 15) + ElementLine(-175 2185 1225 2185 15) + ElementLine(1225 2185 1225 -215 15) + ElementLine(1225 -215 -175 -215 15) + Pin(525 -115 125 70 "M5" 0x01) + Pin(525 2085 125 70 "M6" 0x01) + ')' + `PKG_MOLEX_025($1, $2, $3, 160)' +) + +# ------------------------------------------------------------------- +# the definition of a through hole test point +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: drill diameter (mils) +# $5: silk diameter (mils) +# +define(`PKG_TP', + ` + define(`DRILL', `$4') + define(`SILK', `eval($5/2)') + define(`PADDIA', `eval(DRILL + 20)') + define(`SILKW', `10') +Element(0x00 "$1" "`$2'" "$3" -20 eval(-SILK - 60) 0 100 0x00) +( + Pin( 0 0 PADDIA DRILL "1" "1" 0x0) + ElementArc(0 0 SILK SILK 0 360 SILKW) + + # Mark at the common centroid + Mark(0 0) +)') Property changes on: tags/1.0.5/old/oldlib/lib/connector.inc ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/connector.list =================================================================== --- tags/1.0.5/old/oldlib/lib/connector.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/connector.list (revision 953) @@ -0,0 +1,103 @@ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# mask package values... +# +connector2:CONNECTOR:2 +connector4:CONNECTOR:4 +connector6:CONNECTOR:6 +connector8:CONNECTOR:8 +connector10:CONNECTOR:10 +connector12:CONNECTOR:12 +connector14:CONNECTOR:14 +connector15:CONNECTOR:15 +connector16:CONNECTOR:16 +connector18:CONNECTOR:18 +connector20:CONNECTOR:20 +connector50:CONNECTOR:50 +DIN41_612_abc48female_s:DIN41_612FEMALE_SMALL:abc48f +DIN41_612_abc48male_s:DIN41_612MALE_SMALL:abc48m +DIN41_612_ab64female:DIN41_612FEMALE:ab64f +DIN41_612_ab64male:DIN41_612MALE:ab64m +DIN41_612_ac64female:DIN41_612FEMALE:ac64f +DIN41_612_ac64male:DIN41_612MALE:ac64m +DIN41_612_abc96female:DIN41_612FEMALE:abc96f +DIN41_612_abc96male:DIN41_612MALE:abc96m +DIN41_651_10lay:DIN41_651LAY:10l +DIN41_651_10stand:DIN41_651STAND:10s +DIN41_651_14lay:DIN41_651LAY:14l +DIN41_651_14stand:DIN41_651STAND:14s +DIN41_651_16lay:DIN41_651LAY:16l +DIN41_651_16stand:DIN41_651STAND:16s +DIN41_651_18lay:DIN41_651LAY:18l +DIN41_651_18stand:DIN41_651STAND:18s +DIN41_651_20lay:DIN41_651LAY:20l +DIN41_651_20stand:DIN41_651STAND:20s +DIN41_651_22lay:DIN41_651LAY:22l +DIN41_651_22stand:DIN41_651STAND:22s +DIN41_651_24lay:DIN41_651LAY:24l +DIN41_651_24stand:DIN41_651STAND:24s +DIN41_651_26lay:DIN41_651LAY:26l +DIN41_651_26stand:DIN41_651STAND:26s +DIN41_651_34lay:DIN41_651LAY:34l +DIN41_651_34stand:DIN41_651STAND:34s +DIN41_651_40lay:DIN41_651LAY:40l +DIN41_651_40stand:DIN41_651STAND:40s +DIN41_651_50lay:DIN41_651LAY:50l +DIN41_651_50stand:DIN41_651STAND:50s +DIN41_651_64lay:DIN41_651LAY:64l +DIN41_651_64stand:DIN41_651STAND:64s +PC_Centronics:SUBD_FEMALE_LAY:PC-centronics +PC_V24_9P:SUBD_MALE_LAY:PC-RS232 +PC_V24_25P:SUBD_MALE_LAY:PC-RS232 +SCSI_SE:CONNECTOR:single-ended SCSI +SUBD_9F:SUBD_FEMALE_LAY:9f +SUBD_9M:SUBD_MALE_LAY:9m +SUBD_15F:SUBD_FEMALE_LAY:15f +SUBD_15M:SUBD_MALE_LAY:15m +SUBD_25F:SUBD_FEMALE_LAY:25f +SUBD_25M:SUBD_MALE_LAY:25m +BNC_rightangle:BNC_LAY:1 +MTA_156_2:MTA_156:2 +SMA_vertical:SMA_VERT:1 +MOLEX_025_20:MOLEX_025:20 +MOLEX_025_30:MOLEX_025:30 +MOLEX_025_40:MOLEX_025:40 +MOLEX_025_50:MOLEX_025:50 +MOLEX_025_60:MOLEX_025:60 +MOLEX_025_68:MOLEX_025:68 +MOLEX_025_70:MOLEX_025:70 +MOLEX_025_80:MOLEX_025:80 +MOLEX_025_90:MOLEX_025:90 +MOLEX_025_100:MOLEX_025:100 +MOLEX_025_120:MOLEX_025:120 +MOLEX_025_140:MOLEX_025:140 +MOLEX_025_160:MOLEX_025:160 +MOLEX_025_180:MOLEX_025:180 +MOLEX_025_200:MOLEX_025:200 +MOLEX_025_240:MOLEX_025:240 +NANOENGINE:NANOENGINE:160 + Property changes on: tags/1.0.5/old/oldlib/lib/connector.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/connector.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/connector.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/connector.m4 (revision 953) @@ -0,0 +1,274 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +define(`Description_connector2', `connector 2x1 pins') +define(`Param1_connector2', 1) +define(`Param2_connector2', 2) + +define(`Description_connector4', `connector 2x2 pins') +define(`Param1_connector4', 2) +define(`Param2_connector4', 2) + +define(`Description_connector6', `connector 2x3 pins') +define(`Param1_connector6', 3) +define(`Param2_connector6', 2) + +define(`Description_connector8', `connector 2x4 pins') +define(`Param1_connector8', 4) +define(`Param2_connector8', 2) + +define(`Description_connector10', `connector 2x5 pins') +define(`Param1_connector10', 5) +define(`Param2_connector10', 2) + +define(`Description_connector12', `connector 2x6 pins') +define(`Param1_connector12', 6) +define(`Param2_connector12', 2) + +define(`Description_connector12', `connector 3x4 pins') +define(`Param1_connector12', 4) +define(`Param2_connector12', 3) + +define(`Description_connector14', `connector 2x7 pins') +define(`Param1_connector14', 7) +define(`Param2_connector14', 2) + +define(`Description_connector15', `connector 3x5 pins') +define(`Param1_connector15', 5) +define(`Param2_connector15', 3) + +define(`Description_connector16', `connector 2x8 pins') +define(`Param1_connector16', 8) +define(`Param2_connector16', 2) + +define(`Description_connector18', `connector 2x9 pins') +define(`Param1_connector18', 9) +define(`Param2_connector18', 2) + +define(`Description_connector18', `connector 3x6 pins') +define(`Param1_connector18', 6) +define(`Param2_connector18', 3) + +define(`Description_connector20', `connector 2x10 pins') +define(`Param1_connector20', 10) +define(`Param2_connector20', 2) + +define(`Description_connector50', `connector 2x25 pins') +define(`Param1_connector50', 25) +define(`Param2_connector50', 2) + + +define(`Description_DIN41_612_abc48male_s', `DIN41.612 row a+b+c male') +define(`Param1_DIN41_612_abc48male', `abc') +define(`PinList_DIN41_612_abc48male', + `forloop(`i', 1, 16, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 16, `define(`P_'eval(i +16), `b'i)')' + `forloop(`i', 1, 16, `define(`P_'eval(i +32), `c'i)')') + +define(`Description_DIN41_612_abc48female_s', `DIN41.612 row a+b+c female') +define(`Param1_DIN41_612_abc48female', `abc') +define(`PinList_DIN41_612_abc48female', + `forloop(`i', 1, 16, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 16, `define(`P_'eval(i +16), `b'i)')' + `forloop(`i', 1, 16, `define(`P_'eval(i +32), `c'i)')') + +define(`Description_DIN41_612_ab64male', `DIN41.612 row a+b male') +define(`Param1_DIN41_612_ab64male', `ab') +define(`PinList_DIN41_612_ab64male', + `forloop(`i', 1, 32, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +32), `b'i)')') + +define(`Description_DIN41_612_ab64female', `DIN41.612 row a+b female') +define(`Param1_DIN41_612_ab64female', `ab') +define(`PinList_DIN41_612_ab64female', + `forloop(`i', 1, 32, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +32), `b'i)')') + +define(`Description_DIN41_612_ac64male', `DIN41.612 row a+c male') +define(`Param1_DIN41_612_ac64male', `ac') +define(`PinList_DIN41_612_ac64male', + `forloop(`i', 1, 32, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +64), `c'i)')') + +define(`Description_DIN41_612_ac64female', `DIN41.612 row a+c female') +define(`Param1_DIN41_612_ac64female', `ac') +define(`PinList_DIN41_612_ac64female', + `forloop(`i', 1, 32, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +64), `c'i)')') + +define(`Description_DIN41_612_abc96male', `DIN41.612 row a+b+c male') +define(`Param1_DIN41_612_abc96male', `abc') +define(`PinList_DIN41_612_abc96male', + `forloop(`i', 1, 32, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +32), `b'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +64), `c'i)')') + +define(`Description_DIN41_612_abc96female', `DIN41.612 row a+b+c female') +define(`Param1_DIN41_612_abc96female', `abc') +define(`PinList_DIN41_612_abc96female', + `forloop(`i', 1, 32, `define(`P_'i, `a'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +32), `b'i)')' + `forloop(`i', 1, 32, `define(`P_'eval(i +64), `c'i)')') + +define(`Description_DIN41_651_10lay', `DIN41.651 laying 10 pins') +define(`Param1_DIN41_651_10lay', 10) + +define(`Description_DIN41_651_10stand', `DIN41.651 standing 10 pins') +define(`Param1_DIN41_651_10stand', 10) + +define(`Description_DIN41_651_14lay', `DIN41.651 laying 14 pins') +define(`Param1_DIN41_651_14lay', 14) + +define(`Description_DIN41_651_14stand', `DIN41.651 standing 14 pins') +define(`Param1_DIN41_651_14stand', 14) + +define(`Description_DIN41_651_16lay', `DIN41.651 laying 16 pins') +define(`Param1_DIN41_651_16lay', 16) + +define(`Description_DIN41_651_16stand', `DIN41.651 standing 16 pins') +define(`Param1_DIN41_651_16stand', 16) + +define(`Description_DIN41_651_18lay', `DIN41.651 laying 18 pins') +define(`Param1_DIN41_651_18lay', 18) + +define(`Description_DIN41_651_18stand', `DIN41.651 standing 18 pins') +define(`Param1_DIN41_651_18stand', 18) + +define(`Description_DIN41_651_20lay', `DIN41.651 laying 20 pins') +define(`Param1_DIN41_651_20lay', 20) + +define(`Description_DIN41_651_20stand', `DIN41.651 standing 20 pins') +define(`Param1_DIN41_651_20stand', 20) + +define(`Description_DIN41_651_22lay', `DIN41.651 laying 22 pins') +define(`Param1_DIN41_651_22lay', 22) + +define(`Description_DIN41_651_22stand', `DIN41.651 standing 22 pins') +define(`Param1_DIN41_651_22stand', 22) + +define(`Description_DIN41_651_24lay', `DIN41.651 laying 24 pins') +define(`Param1_DIN41_651_24lay', 24) + +define(`Description_DIN41_651_24stand', `DIN41.651 standing 24 pins') +define(`Param1_DIN41_651_24stand', 24) + +define(`Description_DIN41_651_26lay', `DIN41.651 laying 26 pins') +define(`Param1_DIN41_651_26lay', 26) + +define(`Description_DIN41_651_26stand', `DIN41.651 standing 26 pins') +define(`Param1_DIN41_651_26stand', 26) + +define(`Description_DIN41_651_34lay', `DIN41.651 laying 34 pins') +define(`Param1_DIN41_651_34lay', 34) + +define(`Description_DIN41_651_34stand', `DIN41.651 standing 34 pins') +define(`Param1_DIN41_651_34stand', 34) + +define(`Description_DIN41_651_40lay', `DIN41.651 laying 40 pins') +define(`Param1_DIN41_651_40lay', 40) + +define(`Description_DIN41_651_40stand', `DIN41.651 standing 40 pins') +define(`Param1_DIN41_651_40stand', 40) + +define(`Description_DIN41_651_50lay', `DIN41.651 laying 50 pins') +define(`Param1_DIN41_651_50lay', 50) + +define(`Description_DIN41_651_50stand', `DIN41.651 standing 50 pins') +define(`Param1_DIN41_651_50stand', 50) + +define(`Description_DIN41_651_64lay', `DIN41.651 laying 64 pins') +define(`Param1_DIN41_651_64lay', 64) + +define(`Description_DIN41_651_64stand', `DIN41.651 standing 64 pins') +define(`Param1_DIN41_651_64stand', 64) + +define(`Description_PC_Centronics', `PC Centronics Connector') +define(`Param1_PC_Centronics', 25) +define(`PinList_PC_Centronics', ``/Strb',`D0',`D1',`D2',`D3',`D4',`D5',`D6',`D7',`/Ack',`Busy',`PaperE',`Sel',`AutoF',`/Fault',`/Res',`SelIn',`Gnd',`Gnd',`Gnd',`Gnd',`Gnd',`Gnd',`Gnd',`Gnd'') + +define(`Description_PC_V24_9P', `PC V24 9-pins') +define(`Param1_PC_V24_9P', 9) +define(`PinList_PC_V24_9P', ``DCD',`RxD',`TxD',`DTR',`Gnd',`DSR',`RTS',`CTS',`RI'') + +define(`Description_PC_V24_25P', `PC V24 25-pins') +define(`Param1_PC_V24_25P', 25) +define(`PinList_PC_V24_25P', ``PE',`TxD',`RxD',`RTS',`CTS',`DSR',`Gnd',`DCD',`9',`10',`11',`12',`13',`14',`15',`16',`17',`18',`19',`DTR',`21',`RI',`23',`24',`25'') + +define(`Description_SCSI_SE', `single-ended SCSI 2x25 pins') +define(`Param1_SCSI_SE', 25) +define(`Param2_SCSI_SE', 2) +define(`PinList_SCSI_SE', ``Gnd',`/DB0',`Gnd',`/DB1',`Gnd',`/DB2',`Gnd',`/DB3',`Gnd',`/DB4',`Gnd',`/DB5',`Gnd',`/DB6',`Gnd',`/DB7',`Gnd',`/DBP',`Gnd',`NC',`Gnd',`NC',`Gnd',`NC',`NC',`TermPwr',`Gnd',`NC',`Gnd',`NC',`Gnd',`/Atn',`Gnd',`NC',`Gnd',`/Bsy',`Gnd',`/Ack',`Gnd',`/Rst',`Gnd',`/Msg',`Gnd',`/Sel',`Gnd',`/CD',`Gnd',`/Req',`Gnd',`/IO'') + +define(`Description_SUBD_9F', `SUB-D female 9 pins') +define(`Param1_SUBD_9F', 9) + +define(`Description_SUBD_9M', `SUB-D male 9 pins') +define(`Param1_SUBD_9M', 9) + +define(`Description_SUBD_15F', `SUB-D female 15 pins') +define(`Param1_SUBD_15F', 15) + +define(`Description_SUBD_15M', `SUB-D male 15 pins') +define(`Param1_SUBD_15M', 15) + +define(`Description_SUBD_25F', `SUB-D female 25 pins') +define(`Param1_SUBD_25F', 25) + +define(`Description_SUBD_25M', `SUB-D male 25 pins') +define(`Param1_SUBD_25M', 25) + +define(`Description_BNC_rightangle', `right angle BNC') + +define(`Description_MTA_156_2', `MTA-156 header') +define(`Param1_MTA_156_2', 2) + +define(`Description_SMA_vertical', `vertical SMA') + +define(`Molex_025_style', + `define(`Description_MOLEX_025_$1', `Molex .025 pitch $1 pin plug')' + `define(`Param1_MOLEX_025_$1', $1)' +) +Molex_025_style(20) +Molex_025_style(30) +Molex_025_style(40) +Molex_025_style(50) +Molex_025_style(60) +Molex_025_style(68) +Molex_025_style(70) +Molex_025_style(80) +Molex_025_style(90) +Molex_025_style(100) +Molex_025_style(120) +Molex_025_style(140) +Molex_025_style(160) +Molex_025_style(180) +Molex_025_style(200) +Molex_025_style(240) + +define(`Description_NANOENGINE', `Bright Star nanoEngine SBC') + +divert(0)dnl Property changes on: tags/1.0.5/old/oldlib/lib/connector.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/crystal.list =================================================================== --- tags/1.0.5/old/oldlib/lib/crystal.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/crystal.list (revision 953) @@ -0,0 +1,30 @@ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# mask package values... +# +crystal_300:CRYSTAL:1MHz:8MHZ +crystal_300:CRYSTAL:crystal Property changes on: tags/1.0.5/old/oldlib/lib/crystal.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/crystal.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/crystal.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/crystal.m4 (revision 953) @@ -0,0 +1,31 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +define(`Description_crystal_300', `crystal 300mil') +define(`Param1_crystal_300', 300) + +divert(0) Property changes on: tags/1.0.5/old/oldlib/lib/crystal.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/cts.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/cts.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/cts.inc (revision 953) @@ -0,0 +1,91 @@ +# -*- m4 -*- +# +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2004 Dan McMahill +# +# 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. +# +# +# +# CTS (http://www.ctscorp.com) Specific Footprints +# +# for the 742/3/4/5/6 resistors see +# http://www.ctscorp.com/components/Datasheets/CTSChipArrayDs.pdf + +# EXTRACT_BEGIN + +# COMMON_SMT_DIL_MM +# $4: number of pins +# $5: pad width (1/100 mm) +# $6: pad length (1/100 mm) +# $7: pad pitch (1/100 mm) +# $8: pad seperation for pads on opposite sides of +# the package (1/100 mm) +# $9: define to make the pins get numbered starting with the highest pin +# instead of pin 1. Needed for certain brain damaged packages like +# the Mini-Circuits KK81 + +# +## CTS 742C Series Chip Resistor Array +# + +define(`PKG_CTS_742C_04', `COMMON_SMT_DIL_MM(`$1',`$2',`$3' ,4,50,90,80,90)') +define(`PKG_CTS_742C_08', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 8,50,90,80,90)') +define(`PKG_CTS_742C_16', `COMMON_SMT_DIL_MM(`$1',`$2',`$3',16,50,90,80,90)') + +# +## CTS 742C Series Chip Resistor Array +# + +define(`PKG_CTS_742X_08', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 8,50,90,80,90)') + +# +## CTS 743C Series Chip Resistor Array +# + +define(`PKG_CTS_743C_04', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',4,32000,47000,50000,28000)') +define(`PKG_CTS_743C_08', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',8,32000,47000,50000,28000)') + +# +## CTS 744C Series Chip Resistor Array +# + +define(`PKG_CTS_744C_04', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',4,32000,51000,50000,67000)') +define(`PKG_CTS_744C_08', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',8,32000,51000,50000,67000)') + +# +## CTS 745C Series Chip Resistor Array +# + +define(`PKG_CTS_745C_10', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',10,32000,51000,50000,67000)') + +# +# +## CTS 745X Series Chip Resistor Array +# + +define(`PKG_CTS_745X_10', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',10,32000,51000,50000,67000)') + +# +## CTS 746X Series Chip Resistor Array +# + +define(`PKG_CTS_746X_10', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',10,14000,32000,25000,28000)') + +# EXTRACT_END + Index: tags/1.0.5/old/oldlib/lib/dil.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/dil.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/dil.inc (revision 953) @@ -0,0 +1,126 @@ +# -*- m4 -*- +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# DIL packages + +# ------------------------------------------------------------------- +# the definition of a dual-inline package N and similar types +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins +# $5: package size (300, 600, 900 + 100 for socket space) +# $6: pin spacing +# $7: pad size +# $8: drill size +# +define(`PKG_DIL', + ` +# retain backwards compatibility to older versions of PKG_DIL +# which did not have $6,$7,$8 args + + ifelse("`$6'","", + `define(`PINSPACE', `100')' + , + `define(`PINSPACE', eval(`$6'))' + ) + ifelse("`$7'","", + `define(`PADSIZE', `60')' + , + `define(`PADSIZE', `$7')' + ) + ifelse("`$8'","", + `define(`DRILLSIZE', `28')' + , + `define(`DRILLSIZE', `$8')' + ) + define(`MAXY', `eval(`$4' / 2 * PINSPACE)') + define(`MAXX', `eval(`$5' + 100)') + define(`CENTERX', `eval(MAXX / 2)') + define(`MARKY', `eval(PINSPACE / 2)') +Element(0x00 "$1" "`$2'" "$3" eval(CENTERX + 20) 100 3 100 0x00) +( + forloop(`i', 1, eval($4 / 2), + `PIN(50, eval((2*i-1) * PINSPACE/2), + eval(PADSIZE), eval(DRILLSIZE), i) + ') + forloop(`i', 1, eval($4 / 2), + `PIN(eval(MAXX -50), eval(MAXY - (2*i-1) * PINSPACE/2), + eval(PADSIZE), eval(DRILLSIZE), eval(i + $4/2)) + ') + ElementLine(0 0 0 MAXY 10) + ElementLine(0 MAXY MAXX MAXY 10) + ElementLine(MAXX MAXY MAXX 0 10) + ElementLine(0 0 eval(CENTERX - 50) 0 10) + ElementLine(eval(CENTERX + 50) 0 MAXX 0 10) + ElementArc(CENTERX 0 50 50 0 180 10) + Mark(50 MARKY) +)') +define(`PKG_J', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)') +define(`PKG_JD', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)') +define(`PKG_JG', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)') +define(`PKG_N', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)') +define(`PKG_NT', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)') +define(`PKG_P', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)') +#shrink DIP +define(`PKG_NS', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 70, 55, 28)') + +# ------------------------------------------------------------------- +# the definition of a dual-inline package D and DW +# never used by circuits, just a short-cut for others +# width D==244, DW==419 +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins +# $5: width +# +define(`COMMON_D_DW', + `define(`MAXY', `eval(`$4' / 2 * 50)') + define(`MAXX', `$5') + define(`XLOW', `50') + define(`XHIGH', `eval(MAXX - 50)') + define(`CENTERX', `eval(MAXX / 2)') +Element(0x00 "$1" "`$2'" "$3" eval(CENTERX + 20) 50 3 100 0x00) +( + forloop(`i', 1, eval($4 / 2), + `PAD(0, eval(i * 50 -25), XLOW, eval(i * 50 -25), 20, i) + ') + forloop(`i', 1, eval($4 / 2), + `PAD(XHIGH, eval(MAXY - i * 50 +25), MAXX, eval(MAXY - i * 50 +25), 20, eval(i + $4/2)) + ') + ElementLine(XLOW 0 XLOW MAXY 10) + ElementLine(XLOW MAXY XHIGH MAXY 10) + ElementLine(XHIGH MAXY XHIGH 0 10) + ElementLine(XLOW 0 eval(CENTERX - 25) 0 10) + ElementLine(eval(CENTERX + 25) 0 XHIGH 0 10) + ElementArc(CENTERX 0 25 25 0 180 10) + Mark(25 25) +)') + +define(`PKG_D', `COMMON_D_DW(`$1', `$2', `$3', `$4', 244)') +define(`PKG_DW', `COMMON_D_DW(`$1', `$2', `$3', `$4', 419)') + Property changes on: tags/1.0.5/old/oldlib/lib/dil.inc ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/footprint.pcb =================================================================== --- tags/1.0.5/old/oldlib/lib/footprint.pcb (nonexistent) +++ tags/1.0.5/old/oldlib/lib/footprint.pcb (revision 953) @@ -0,0 +1,823 @@ +PCB["" 4000000 4000000] + +Grid[500.00000000 0 0 0] +Cursor[0 0 0.000000] +Thermal[0.500000] +DRC[1000 1000 1000 1000] +Flags(0x0000000000001c40) +Groups("1,c:2,s:3:4:5:6:7:8") +Styles["Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600"] + +Symbol(' ' 18) +( +) +Symbol('!' 12) +( + SymbolLine(0 35 0 40 8) + SymbolLine(0 0 0 25 8) +) +Symbol('"' 12) +( + SymbolLine(0 0 0 10 8) + SymbolLine(10 0 10 10 8) +) +Symbol('#' 12) +( + SymbolLine(0 25 20 25 8) + SymbolLine(0 15 20 15 8) + SymbolLine(15 10 15 30 8) + SymbolLine(5 10 5 30 8) +) +Symbol('$' 12) +( + SymbolLine(15 5 20 10 8) + SymbolLine(5 5 15 5 8) + SymbolLine(0 10 5 5 8) + SymbolLine(0 10 0 15 8) + SymbolLine(0 15 5 20 8) + SymbolLine(5 20 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(20 25 20 30 8) + SymbolLine(15 35 20 30 8) + SymbolLine(5 35 15 35 8) + SymbolLine(0 30 5 35 8) + SymbolLine(10 0 10 40 8) +) +Symbol('%' 12) +( + SymbolLine(0 5 0 10 8) + SymbolLine(0 5 5 0 8) + SymbolLine(5 0 10 0 8) + SymbolLine(10 0 15 5 8) + SymbolLine(15 5 15 10 8) + SymbolLine(10 15 15 10 8) + SymbolLine(5 15 10 15 8) + SymbolLine(0 10 5 15 8) + SymbolLine(0 40 40 0 8) + SymbolLine(35 40 40 35 8) + SymbolLine(40 30 40 35 8) + SymbolLine(35 25 40 30 8) + SymbolLine(30 25 35 25 8) + SymbolLine(25 30 30 25 8) + SymbolLine(25 30 25 35 8) + SymbolLine(25 35 30 40 8) + SymbolLine(30 40 35 40 8) +) +Symbol('&' 12) +( + SymbolLine(0 35 5 40 8) + SymbolLine(0 5 0 15 8) + SymbolLine(0 5 5 0 8) + SymbolLine(0 25 15 10 8) + SymbolLine(5 40 10 40 8) + SymbolLine(10 40 20 30 8) + SymbolLine(0 15 25 40 8) + SymbolLine(5 0 10 0 8) + SymbolLine(10 0 15 5 8) + SymbolLine(15 5 15 10 8) + SymbolLine(0 25 0 35 8) +) +Symbol(''' 12) +( + SymbolLine(0 10 10 0 8) +) +Symbol('(' 12) +( + SymbolLine(0 35 5 40 8) + SymbolLine(0 5 5 0 8) + SymbolLine(0 5 0 35 8) +) +Symbol(')' 12) +( + SymbolLine(0 0 5 5 8) + SymbolLine(5 5 5 35 8) + SymbolLine(0 40 5 35 8) +) +Symbol('*' 12) +( + SymbolLine(0 10 20 30 8) + SymbolLine(0 30 20 10 8) + SymbolLine(0 20 20 20 8) + SymbolLine(10 10 10 30 8) +) +Symbol('+' 12) +( + SymbolLine(0 20 20 20 8) + SymbolLine(10 10 10 30 8) +) +Symbol(',' 12) +( + SymbolLine(0 50 10 40 8) +) +Symbol('-' 12) +( + SymbolLine(0 20 20 20 8) +) +Symbol('.' 12) +( + SymbolLine(0 40 5 40 8) +) +Symbol('/' 12) +( + SymbolLine(0 35 30 5 8) +) +Symbol('0' 12) +( + SymbolLine(0 35 5 40 8) + 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 30 20 10 8) +) +Symbol('1' 12) +( + SymbolLine(5 40 15 40 8) + SymbolLine(10 0 10 40 8) + SymbolLine(0 10 10 0 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(20 5 20 35 8) + SymbolLine(15 40 20 35 8) + SymbolLine(5 40 15 40 8) + SymbolLine(0 35 5 40 8) + SymbolLine(5 20 20 20 8) +) +Symbol('4' 12) +( + SymbolLine(0 20 20 0 8) + SymbolLine(0 20 25 20 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 20 20 25 8) + SymbolLine(0 20 15 20 8) + SymbolLine(5 40 15 40 8) + SymbolLine(15 40 20 35 8) + SymbolLine(20 25 20 35 8) +) +Symbol('7' 12) +( + SymbolLine(0 40 25 15 8) + SymbolLine(25 0 25 15 8) + SymbolLine(0 0 25 0 8) +) +Symbol('8' 12) +( + SymbolLine(0 35 5 40 8) + SymbolLine(0 25 0 35 8) + SymbolLine(0 25 5 20 8) + SymbolLine(5 20 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(20 25 20 35 8) + SymbolLine(15 40 20 35 8) + SymbolLine(5 40 15 40 8) + SymbolLine(0 15 5 20 8) + SymbolLine(0 5 0 15 8) + SymbolLine(0 5 5 0 8) + SymbolLine(5 0 15 0 8) + SymbolLine(15 0 20 5 8) + SymbolLine(20 5 20 15 8) + SymbolLine(15 20 20 15 8) +) +Symbol('9' 12) +( + SymbolLine(0 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(':' 12) +( + SymbolLine(0 15 5 15 8) + SymbolLine(0 25 5 25 8) +) +Symbol(';' 12) +( + SymbolLine(0 40 10 30 8) + SymbolLine(10 15 10 20 8) +) +Symbol('<' 12) +( + SymbolLine(0 20 10 10 8) + SymbolLine(0 20 10 30 8) +) +Symbol('=' 12) +( + SymbolLine(0 15 20 15 8) + SymbolLine(0 25 20 25 8) +) +Symbol('>' 12) +( + SymbolLine(0 10 10 20 8) + SymbolLine(0 30 10 20 8) +) +Symbol('?' 12) +( + SymbolLine(10 20 10 25 8) + SymbolLine(10 35 10 40 8) + SymbolLine(0 5 0 10 8) + SymbolLine(0 5 5 0 8) + SymbolLine(5 0 15 0 8) + SymbolLine(15 0 20 5 8) + SymbolLine(20 5 20 10 8) + SymbolLine(10 20 20 10 8) +) +Symbol('A' 12) +( + SymbolLine(0 5 0 40 8) + SymbolLine(0 5 5 0 8) + SymbolLine(5 0 20 0 8) + SymbolLine(20 0 25 5 8) + SymbolLine(25 5 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 25 25 35 8) + SymbolLine(20 20 25 25 8) + SymbolLine(5 20 20 20 8) + 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) +) +Symbol('C' 12) +( + SymbolLine(5 40 20 40 8) + SymbolLine(0 35 5 40 8) + SymbolLine(0 5 0 35 8) + SymbolLine(0 5 5 0 8) + SymbolLine(5 0 20 0 8) +) +Symbol('D' 12) +( + SymbolLine(5 0 5 40 8) + SymbolLine(20 0 25 5 8) + SymbolLine(25 5 25 35 8) + SymbolLine(20 40 25 35 8) + SymbolLine(0 40 20 40 8) + SymbolLine(0 0 20 0 8) +) +Symbol('E' 12) +( + SymbolLine(0 20 15 20 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 20 15 20 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(0 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) +) +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 15 8) + SymbolLine(15 15 30 0 8) + SymbolLine(30 0 30 40 8) +) +Symbol('N' 12) +( + SymbolLine(0 0 0 40 8) + SymbolLine(0 0 0 5 8) + SymbolLine(0 5 25 30 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 35 8) + SymbolLine(15 40 20 35 8) + SymbolLine(5 40 15 40 8) + SymbolLine(0 35 5 40 8) + SymbolLine(10 30 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(5 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 0 30 8) + SymbolLine(0 30 10 40 8) + SymbolLine(10 40 20 30 8) + SymbolLine(20 0 20 30 8) +) +Symbol('W' 12) +( + SymbolLine(0 0 0 40 8) + SymbolLine(0 40 15 25 8) + SymbolLine(15 25 30 40 8) + SymbolLine(30 0 30 40 8) +) +Symbol('X' 12) +( + SymbolLine(0 0 0 5 8) + SymbolLine(0 5 25 30 8) + SymbolLine(25 30 25 40 8) + SymbolLine(0 30 0 40 8) + SymbolLine(0 30 25 5 8) + SymbolLine(25 0 25 5 8) +) +Symbol('Y' 12) +( + SymbolLine(0 0 0 5 8) + SymbolLine(0 5 10 15 8) + SymbolLine(10 15 20 5 8) + SymbolLine(20 0 20 5 8) + SymbolLine(10 15 10 40 8) +) +Symbol('Z' 12) +( + SymbolLine(0 0 25 0 8) + SymbolLine(25 0 25 5 8) + SymbolLine(0 30 25 5 8) + SymbolLine(0 30 0 40 8) + SymbolLine(0 40 25 40 8) +) +Symbol('[' 12) +( + SymbolLine(0 0 5 0 8) + SymbolLine(0 0 0 40 8) + SymbolLine(0 40 5 40 8) +) +Symbol('\' 12) +( + SymbolLine(0 5 30 35 8) +) +Symbol(']' 12) +( + SymbolLine(0 0 5 0 8) + SymbolLine(5 0 5 40 8) + SymbolLine(0 40 5 40 8) +) +Symbol('^' 12) +( + SymbolLine(0 5 5 0 8) + SymbolLine(5 0 10 5 8) +) +Symbol('_' 12) +( + SymbolLine(0 40 20 40 8) +) +Symbol('a' 12) +( + SymbolLine(15 20 20 25 8) + SymbolLine(5 20 15 20 8) + SymbolLine(0 25 5 20 8) + SymbolLine(0 25 0 35 8) + SymbolLine(0 35 5 40 8) + SymbolLine(20 20 20 35 8) + SymbolLine(20 35 25 40 8) + SymbolLine(5 40 15 40 8) + SymbolLine(15 40 20 35 8) +) +Symbol('b' 12) +( + SymbolLine(0 0 0 40 8) + SymbolLine(0 35 5 40 8) + SymbolLine(5 40 15 40 8) + SymbolLine(15 40 20 35 8) + SymbolLine(20 25 20 35 8) + SymbolLine(15 20 20 25 8) + SymbolLine(5 20 15 20 8) + SymbolLine(0 25 5 20 8) +) +Symbol('c' 12) +( + SymbolLine(5 20 20 20 8) + SymbolLine(0 25 5 20 8) + SymbolLine(0 25 0 35 8) + SymbolLine(0 35 5 40 8) + SymbolLine(5 40 20 40 8) +) +Symbol('d' 12) +( + SymbolLine(20 0 20 40 8) + SymbolLine(15 40 20 35 8) + SymbolLine(5 40 15 40 8) + SymbolLine(0 35 5 40 8) + SymbolLine(0 25 0 35 8) + SymbolLine(0 25 5 20 8) + SymbolLine(5 20 15 20 8) + SymbolLine(15 20 20 25 8) +) +Symbol('e' 12) +( + SymbolLine(5 40 20 40 8) + SymbolLine(0 35 5 40 8) + SymbolLine(0 25 0 35 8) + SymbolLine(0 25 5 20 8) + SymbolLine(5 20 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(0 30 20 30 8) + SymbolLine(20 30 20 25 8) +) +Symbol('f' 10) +( + SymbolLine(5 5 5 40 8) + SymbolLine(5 5 10 0 8) + SymbolLine(10 0 15 0 8) + SymbolLine(0 20 10 20 8) +) +Symbol('g' 12) +( + SymbolLine(15 20 20 25 8) + SymbolLine(5 20 15 20 8) + SymbolLine(0 25 5 20 8) + SymbolLine(0 25 0 35 8) + SymbolLine(0 35 5 40 8) + SymbolLine(5 40 15 40 8) + SymbolLine(15 40 20 35 8) + SymbolLine(0 50 5 55 8) + SymbolLine(5 55 15 55 8) + SymbolLine(15 55 20 50 8) + SymbolLine(20 20 20 50 8) +) +Symbol('h' 12) +( + SymbolLine(0 0 0 40 8) + SymbolLine(0 25 5 20 8) + SymbolLine(5 20 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(20 25 20 40 8) +) +Symbol('i' 10) +( + SymbolLine(0 10 0 15 8) + SymbolLine(0 25 0 40 8) +) +Symbol('j' 10) +( + SymbolLine(5 10 5 15 8) + SymbolLine(5 25 5 50 8) + SymbolLine(0 55 5 50 8) +) +Symbol('k' 12) +( + SymbolLine(0 0 0 40 8) + SymbolLine(0 25 15 40 8) + SymbolLine(0 25 10 15 8) +) +Symbol('l' 10) +( + SymbolLine(0 0 0 35 8) + SymbolLine(0 35 5 40 8) +) +Symbol('m' 12) +( + SymbolLine(5 25 5 40 8) + SymbolLine(5 25 10 20 8) + SymbolLine(10 20 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(20 25 20 40 8) + SymbolLine(20 25 25 20 8) + SymbolLine(25 20 30 20 8) + SymbolLine(30 20 35 25 8) + SymbolLine(35 25 35 40 8) + SymbolLine(0 20 5 25 8) +) +Symbol('n' 12) +( + SymbolLine(5 25 5 40 8) + SymbolLine(5 25 10 20 8) + SymbolLine(10 20 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(20 25 20 40 8) + SymbolLine(0 20 5 25 8) +) +Symbol('o' 12) +( + SymbolLine(0 25 0 35 8) + SymbolLine(0 25 5 20 8) + SymbolLine(5 20 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(20 25 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 25 5 55 8) + SymbolLine(0 20 5 25 8) + SymbolLine(5 25 10 20 8) + SymbolLine(10 20 20 20 8) + SymbolLine(20 20 25 25 8) + SymbolLine(25 25 25 35 8) + SymbolLine(20 40 25 35 8) + SymbolLine(10 40 20 40 8) + SymbolLine(5 35 10 40 8) +) +Symbol('q' 12) +( + SymbolLine(20 25 20 55 8) + SymbolLine(15 20 20 25 8) + SymbolLine(5 20 15 20 8) + SymbolLine(0 25 5 20 8) + SymbolLine(0 25 0 35 8) + SymbolLine(0 35 5 40 8) + SymbolLine(5 40 15 40 8) + SymbolLine(15 40 20 35 8) +) +Symbol('r' 12) +( + SymbolLine(5 25 5 40 8) + SymbolLine(5 25 10 20 8) + SymbolLine(10 20 20 20 8) + SymbolLine(0 20 5 25 8) +) +Symbol('s' 12) +( + SymbolLine(5 40 20 40 8) + SymbolLine(20 40 25 35 8) + SymbolLine(20 30 25 35 8) + SymbolLine(5 30 20 30 8) + SymbolLine(0 25 5 30 8) + SymbolLine(0 25 5 20 8) + SymbolLine(5 20 20 20 8) + SymbolLine(20 20 25 25 8) + SymbolLine(0 35 5 40 8) +) +Symbol('t' 10) +( + SymbolLine(5 0 5 35 8) + SymbolLine(5 35 10 40 8) + SymbolLine(0 15 10 15 8) +) +Symbol('u' 12) +( + SymbolLine(0 20 0 35 8) + SymbolLine(0 35 5 40 8) + SymbolLine(5 40 15 40 8) + SymbolLine(15 40 20 35 8) + SymbolLine(20 20 20 35 8) +) +Symbol('v' 12) +( + SymbolLine(0 20 0 30 8) + SymbolLine(0 30 10 40 8) + SymbolLine(10 40 20 30 8) + SymbolLine(20 20 20 30 8) +) +Symbol('w' 12) +( + SymbolLine(0 20 0 35 8) + SymbolLine(0 35 5 40 8) + SymbolLine(5 40 10 40 8) + SymbolLine(10 40 15 35 8) + SymbolLine(15 20 15 35 8) + SymbolLine(15 35 20 40 8) + SymbolLine(20 40 25 40 8) + SymbolLine(25 40 30 35 8) + SymbolLine(30 20 30 35 8) +) +Symbol('x' 12) +( + SymbolLine(0 20 20 40 8) + SymbolLine(0 40 20 20 8) +) +Symbol('y' 12) +( + SymbolLine(0 20 0 35 8) + SymbolLine(0 35 5 40 8) + SymbolLine(20 20 20 50 8) + SymbolLine(15 55 20 50 8) + SymbolLine(5 55 15 55 8) + SymbolLine(0 50 5 55 8) + SymbolLine(5 40 15 40 8) + SymbolLine(15 40 20 35 8) +) +Symbol('z' 12) +( + SymbolLine(0 20 20 20 8) + SymbolLine(0 40 20 20 8) + SymbolLine(0 40 20 40 8) +) +Symbol('{' 12) +( + SymbolLine(5 5 10 0 8) + SymbolLine(5 5 5 15 8) + SymbolLine(0 20 5 15 8) + SymbolLine(0 20 5 25 8) + SymbolLine(5 25 5 35 8) + SymbolLine(5 35 10 40 8) +) +Symbol('|' 12) +( + SymbolLine(0 0 0 40 8) +) +Symbol('}' 12) +( + SymbolLine(0 0 5 5 8) + SymbolLine(5 5 5 15 8) + SymbolLine(5 15 10 20 8) + SymbolLine(5 25 10 20 8) + SymbolLine(5 25 5 35 8) + SymbolLine(0 40 5 35 8) +) +Symbol('~' 12) +( + SymbolLine(0 25 5 20 8) + SymbolLine(5 20 10 20 8) + SymbolLine(10 20 15 25 8) + SymbolLine(15 25 20 25 8) + SymbolLine(20 25 25 20 8) +) +Symbol('@' 12) +( + SymbolLine(0 0 0 30 8) + SymbolLine(0 30 10 40 8) + SymbolLine(10 40 40 40 8) + SymbolLine(50 25 50 0 8) + SymbolLine(50 0 40 -10 8) + SymbolLine(40 -10 10 -10 8) + SymbolLine(10 -10 0 0 8) + SymbolLine(15 10 15 20 8) + SymbolLine(15 20 20 25 8) + SymbolLine(20 25 30 25 8) + SymbolLine(30 25 35 20 8) + SymbolLine(35 20 40 25 8) + SymbolLine(35 20 35 5 8) + SymbolLine(35 10 30 5 8) + SymbolLine(20 5 30 5 8) + SymbolLine(20 5 15 10 8) + SymbolLine(40 25 50 25 8) +) + +ELEMENT + +Layer(1 "component") +( +) +Layer(2 "solder") +( +) +Layer(3 "GND") +( +) +Layer(4 "power") +( +) +Layer(5 "signal1") +( +) +Layer(6 "signal2") +( +) +Layer(7 "signal3") +( +) +Layer(8 "signal4") +( +) +Layer(9 "silk") +( +) +Layer(10 "silk") +( +) Index: tags/1.0.5/old/oldlib/lib/geda.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/geda.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/geda.inc (revision 953) @@ -0,0 +1,1195 @@ +# -*- m4 -*- +# $Id$ +# +# gEDA compatible footprint names +# +# the real component definitions are in the *.inc files +# +# Initial version from Egil Kvaleberg , +# Oct 10 2002 +# + +# +## Dual in-line package, narrow (300 mil) +# DIP6 .. DIP64, DIP24N, DIP28N +# +define(`PKG_DIP6', `PKG_N(`$1', `$2', `$3', 6, 300)'); +define(`PKG_DIP8', `PKG_N(`$1', `$2', `$3', 8, 300)'); +define(`PKG_DIP14', `PKG_N(`$1', `$2', `$3', 14, 300)'); +define(`PKG_DIP16', `PKG_N(`$1', `$2', `$3', 16, 300)'); +define(`PKG_DIP18', `PKG_N(`$1', `$2', `$3', 18, 300)'); +define(`PKG_DIP20', `PKG_N(`$1', `$2', `$3', 20, 300)'); +define(`PKG_DIP22', `PKG_N(`$1', `$2', `$3', 22, 300)'); +define(`PKG_DIP24N', `PKG_N(`$1', `$2', `$3', 24, 300)'); +define(`PKG_DIP28N', `PKG_N(`$1', `$2', `$3', 28, 300)'); +## Dual in-line package, medium wide (400 mil) +define(`PKG_DIP8M', `PKG_N(`$1', `$2', `$3', 8, 400)'); +define(`PKG_DIP14M', `PKG_N(`$1', `$2', `$3', 14, 400)'); +define(`PKG_DIP16M', `PKG_N(`$1', `$2', `$3', 16, 400)'); +define(`PKG_DIP18M', `PKG_N(`$1', `$2', `$3', 18, 400)'); +define(`PKG_DIP20M', `PKG_N(`$1', `$2', `$3', 20, 400)'); +define(`PKG_DIP22M', `PKG_N(`$1', `$2', `$3', 22, 400)'); +define(`PKG_DIP24M', `PKG_N(`$1', `$2', `$3', 24, 400)'); +define(`PKG_DIP28M', `PKG_N(`$1', `$2', `$3', 28, 400)'); +## Dual in-line package, wide (600 mil) +define(`PKG_DIP24', `PKG_N(`$1', `$2', `$3', 24, 600)'); +define(`PKG_DIP28', `PKG_N(`$1', `$2', `$3', 28, 600)'); +define(`PKG_DIP32', `PKG_N(`$1', `$2', `$3', 32, 600)'); +define(`PKG_DIP36', `PKG_N(`$1', `$2', `$3', 36, 600)'); +define(`PKG_DIP40', `PKG_N(`$1', `$2', `$3', 40, 600)'); +define(`PKG_DIP42', `PKG_N(`$1', `$2', `$3', 42, 600)'); +define(`PKG_DIP44', `PKG_N(`$1', `$2', `$3', 44, 600)'); +define(`PKG_DIP48', `PKG_N(`$1', `$2', `$3', 48, 600)'); +## Dual in-line package, wide (900 mil) +define(`PKG_DIP64', `PKG_N(`$1', `$2', `$3', 64, 900)'); + +# +## Shrink dual in-line package, wide (300 mil) +# +define(`PKG_SDIP18', `PKG_NS(`$1', `$2', `$3', 18, 300)'); +define(`PKG_SDIP20', `PKG_NS(`$1', `$2', `$3', 20, 300)'); +define(`PKG_SDIP22', `PKG_NS(`$1', `$2', `$3', 22, 300)'); +define(`PKG_SDIP24', `PKG_NS(`$1', `$2', `$3', 24, 300)'); +# +## Shrink dual in-line package, wide (400 mil) +define(`PKG_SDIP30', `PKG_NS(`$1', `$2', `$3', 30, 400)'); +define(`PKG_SDIP32', `PKG_NS(`$1', `$2', `$3', 32, 400)'); +# +## Shrink dual in-line package, wide (600 mil) +define(`PKG_SDIP42', `PKG_NS(`$1', `$2', `$3', 42, 600)'); + +# +## Single in line package +# SIP1 .. SIP13 +# +define(`PKG_SIP1', `PKG_CSIL(`$1', `$2', `$3', 1)'); +define(`PKG_SIP2', `PKG_CSIL(`$1', `$2', `$3', 2)'); +define(`PKG_SIP3', `PKG_CSIL(`$1', `$2', `$3', 3)'); +define(`PKG_SIP4', `PKG_CSIL(`$1', `$2', `$3', 4)'); +define(`PKG_SIP5', `PKG_CSIL(`$1', `$2', `$3', 5)'); +define(`PKG_SIP6', `PKG_CSIL(`$1', `$2', `$3', 6)'); +define(`PKG_SIP7', `PKG_CSIL(`$1', `$2', `$3', 7)'); +define(`PKG_SIP8', `PKG_CSIL(`$1', `$2', `$3', 8)'); +define(`PKG_SIP9', `PKG_CSIL(`$1', `$2', `$3', 9)'); +define(`PKG_SIP10', `PKG_CSIL(`$1', `$2', `$3', 10)'); +define(`PKG_SIP11', `PKG_CSIL(`$1', `$2', `$3', 11)'); +define(`PKG_SIP12', `PKG_CSIL(`$1', `$2', `$3', 12)'); +define(`PKG_SIP13', `PKG_CSIL(`$1', `$2', `$3', 13)'); + +# +## Ultra (Micro?) Small outline package +# +# pins, width (1/100mil), pitch (1/100 mil) +define(`PKG_US8', `PKG_US( `$1', `$2', `$3', 8)'); +define(`PKG_US14', `PKG_US( `$1', `$2', `$3', 14)'); +define(`PKG_US16', `PKG_US( `$1', `$2', `$3', 16)'); + +# +## Small outline package, narrow (150mil) +# aka SOP8, aka S8 +# +# COMMON_SMT_DIL_{MIL,MM} +# $4: number of pins +# $5: pad width (1/1000 mil or 1/100 mm) +# $6: pad length (1/1000 mil or 1/100 mm) +# $7: pad pitch (1/1000 mil 1/100 mm) +# $8: pad seperation for pads on opposite sides of +# the package (1/1000 mil or 1/100 mm) +# $9: define to make the pins get numbered starting with the highest pin +# instead of pin 1. Needed for certain brain damaged packages like +# the Mini-Circuits KK81 + +# dimensions from http://landpatterns.ipc.org/ +define(`PKG_SO8', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 8, 20000, 85000, 50000, 120000)'); +define(`PKG_SO14', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 14, 20000, 85000, 50000, 120000)'); +define(`PKG_SO16', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 16, 20000, 85000, 50000, 120000)'); +define(`PKG_SO18N', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 18, 20000, 85000, 50000, 120000)'); +define(`PKG_SO20N', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 20, 20000, 85000, 50000, 120000)'); + +## Small outline package, medium (200mil) +# aka 8S2 +define(`PKG_SO8M', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 8, 20000, 85000, 50000, 170000)'); +define(`PKG_SO18M', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 18, 20000, 85000, 50000, 170000)'); +define(`PKG_SO20M', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 20, 20000, 85000, 50000, 170000)'); +define(`PKG_SO22M', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 22, 20000, 85000, 50000, 170000)'); +define(`PKG_SO24M', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 24, 20000, 85000, 50000, 170000)'); + +## Small outline package, wide (300mil) +# dimensions from http://landpatterns.ipc.org/ +define(`PKG_SO8W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 8, 20000, 80000, 50000, 280000)'); +define(`PKG_SO14W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 14, 20000, 80000, 50000, 280000)'); +define(`PKG_SO16W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 16, 20000, 80000, 50000, 280000)'); +define(`PKG_SO18W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 18, 20000, 80000, 50000, 280000)'); +define(`PKG_SO20W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 20, 20000, 80000, 50000, 280000)'); +define(`PKG_SO24W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 24, 20000, 80000, 50000, 280000)'); +define(`PKG_SO28', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 28, 20000, 80000, 50000, 280000)'); +define(`PKG_SO32', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 32, 20000, 80000, 50000, 280000)'); + +## Small outline package, wider (325mil) +define(`PKG_SO28W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 28, 20000, 80000, 50000, 305000)'); + +## Small outline package, wider (450mil) +define(`PKG_SO32W', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 32, 20000, 80000, 50000, 430000)'); + +## Small outline package, wide (525mil) +define(`PKG_SO44', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 44, 20000, 80000, 50000, 505000)'); + + + +# NOTE: There is also SOJ20,28,32,40,42 +# 0.300" size, 28,32 pin (MO-088, MO-077 respectively) +# 0.400" size, 28,32,36 pin (MO-061) +# +# +# from http://landpatterns.ipc.org/ +# 14-28 pin 0.300" - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 5 +# 14-28 pin 0.350" - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 6.2 +# 14-28 pin 0.400" - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 7.4 +# 14-28 pin 0.450" - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 8.8 +# +# Cypress (www.cypress.com) has 20, 24, 28, 32 in the 0.3" and +# 28, 32, 36, 44 in the 0.4" + +## Small outline J-leaded package (300 mil) +define(`PKG_SOJ14_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,196850)'); +define(`PKG_SOJ16_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,196850)'); +define(`PKG_SOJ18_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,196850)'); +define(`PKG_SOJ20_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,196850)'); +define(`PKG_SOJ22_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,196850)'); +define(`PKG_SOJ24_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,196850)'); +define(`PKG_SOJ26_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,196850)'); +define(`PKG_SOJ28_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,196850)'); +define(`PKG_SOJ30_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,196850)'); +define(`PKG_SOJ32_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,196850)'); +define(`PKG_SOJ34_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,196850)'); +define(`PKG_SOJ36_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,196850)'); +define(`PKG_SOJ38_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,196850)'); +define(`PKG_SOJ40_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,196850)'); +define(`PKG_SOJ42_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,196850)'); +define(`PKG_SOJ44_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,196850)'); + +## Small outline J-leaded package (350 mil) +define(`PKG_SOJ14_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,244094)'); +define(`PKG_SOJ16_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,244094)'); +define(`PKG_SOJ18_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,244094)'); +define(`PKG_SOJ20_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,244094)'); +define(`PKG_SOJ22_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,244094)'); +define(`PKG_SOJ24_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,244094)'); +define(`PKG_SOJ26_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,244094)'); +define(`PKG_SOJ28_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,244094)'); +define(`PKG_SOJ30_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,244094)'); +define(`PKG_SOJ32_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,244094)'); +define(`PKG_SOJ34_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,244094)'); +define(`PKG_SOJ36_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,244094)'); +define(`PKG_SOJ38_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,244094)'); +define(`PKG_SOJ40_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,244094)'); +define(`PKG_SOJ42_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,244094)'); +define(`PKG_SOJ44_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,244094)'); + +## Small outline J-leaded package (400 mil) +define(`PKG_SOJ14_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,291339)'); +define(`PKG_SOJ16_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,291339)'); +define(`PKG_SOJ18_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,291339)'); +define(`PKG_SOJ20_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,291339)'); +define(`PKG_SOJ22_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,291339)'); +define(`PKG_SOJ24_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,291339)'); +define(`PKG_SOJ26_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,291339)'); +define(`PKG_SOJ28_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,291339)'); +define(`PKG_SOJ30_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,291339)'); +define(`PKG_SOJ32_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,291339)'); +define(`PKG_SOJ34_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,291339)'); +define(`PKG_SOJ36_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,291339)'); +define(`PKG_SOJ38_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,291339)'); +define(`PKG_SOJ40_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,291339)'); +define(`PKG_SOJ42_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,291339)'); +define(`PKG_SOJ44_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,291339)'); + +## Small outline J-leaded package (450 mil) +define(`PKG_SOJ14_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,346457)'); +define(`PKG_SOJ16_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,346457)'); +define(`PKG_SOJ18_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,346457)'); +define(`PKG_SOJ20_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,346457)'); +define(`PKG_SOJ22_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,346457)'); +define(`PKG_SOJ24_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,346457)'); +define(`PKG_SOJ26_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,346457)'); +define(`PKG_SOJ28_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,346457)'); +define(`PKG_SOJ30_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,346457)'); +define(`PKG_SOJ32_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,346457)'); +define(`PKG_SOJ34_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,346457)'); +define(`PKG_SOJ36_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,346457)'); +define(`PKG_SOJ38_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,346457)'); +define(`PKG_SOJ40_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,346457)'); +define(`PKG_SOJ42_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,346457)'); +define(`PKG_SOJ44_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,346457)'); + + +# +# NOTE: +# Shrink small outline SSOP is a full confusion of +# pitch 25.00 mil, 0.65mm, 0.8mm +# widths 244, 260, 311, 323 etc +# there are really too many variants, the ones listed here are +# fairly industry standard +# +## Shrink small outline package, .65mm, narrow +define(`PKG_SSOP8', `PKG_SSO( `$1', `$2', `$3', 8, 323, 2559)'); +define(`PKG_SSOP14', `PKG_SSO( `$1', `$2', `$3', 14, 323, 2559)'); +define(`PKG_SSOP16', `PKG_SSO( `$1', `$2', `$3', 16, 244, 2559)'); +define(`PKG_SSOP20', `PKG_SSO( `$1', `$2', `$3', 20, 260, 2559)'); +define(`PKG_SSOP24', `PKG_SSO( `$1', `$2', `$3', 24, 323, 2559)'); +define(`PKG_SSOP28', `PKG_SSO( `$1', `$2', `$3', 28, 323, 2559)'); + +# +## Shrink small outline package, .65mm, wide +#define(`PKG_SSOP16W', `PKG_SSO( `$1', `$2', `$3', 16, 420, 2559)'); +#define(`PKG_SSOP20W', `PKG_SSO( `$1', `$2', `$3', 20, 420, 2559)'); +#define(`PKG_SSOP28W', `PKG_SSO( `$1', `$2', `$3', 28, 420, 2559)'); +#define(`PKG_SSOP30W', `PKG_SSO( `$1', `$2', `$3', 30, 420, 2559)'); +#define(`PKG_SSOP32W', `PKG_SSO( `$1', `$2', `$3', 32, 420, 2559)'); +#define(`PKG_SSOP36W', `PKG_SSO( `$1', `$2', `$3', 36, 420, 2559)'); + +# +## Shrink small outline package, 25mil, wide +define(`PKG_SSOP48W', `PKG_SSO( `$1', `$2', `$3', 48, 420, 2500)'); +define(`PKG_SSOP56W', `PKG_SSO( `$1', `$2', `$3', 56, 420, 2500)'); + +# +## Shrink small outline package, .80mm, wider +define(`PKG_SSOP64W', `PKG_SSO( `$1', `$2', `$3', 64, 545, 3150)'); + +## Shrink small outline package, .65mm, narrow +# BUG:(`PKG_MSOP8', `PKG_SSO( `$1', `$2', `$3', 8, 323, 2559)'); +# +## Mini small outline package, .65mm +define(`PKG_MSOP8', `PKG_SSO( `$1', `$2', `$3', 8, 199, 2559)'); +## Mini small outline package, .5mm +define(`PKG_MSOP10', `PKG_TSOP( `$1', `$2', `$3', 10, 199, 1969)'); + +## Quarter size small outline package +define(`PKG_QSOP16', `PKG_SSO( `$1', `$2', `$3', 16, 244, 2500)'); +define(`PKG_QSOP20', `PKG_SSO( `$1', `$2', `$3', 20, 244, 2500)'); +define(`PKG_QSOP24', `PKG_SSO( `$1', `$2', `$3', 24, 244, 2500)'); +define(`PKG_QSOP28', `PKG_SSO( `$1', `$2', `$3', 28, 244, 2500)'); + +# +## Thin small outline package +# BUG: TSOP in 26(x2),28(x2),32,44(x2),48,50(x2),54,66,70(x2),86 +# +define(`PKG_TSOP28', `PKG_TSOP( `$1', `$2', `$3', 28, 535, 2165)'); +define(`PKG_TSOP32A', `PKG_TSOP( `$1', `$2', `$3', 32, 795, 2000)'); +define(`PKG_TSOP32B', `PKG_TSOP( `$1', `$2', `$3', 32, 559, 2000)'); + +## Thin shrink small outline package, narrow (3mm) +# +define(`PKG_TSSOP8', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 8, 33, 150, 65, 300)'); +define(`PKG_TSSOP10', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 10, 30, 150, 50, 300)'); + +## Thin shrink small outline package, standard (4.4mm) +# +define(`PKG_TSSOP8W', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 8, 33, 150, 65, 440)'); +define(`PKG_TSSOP14', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 14, 33, 150, 65, 440)'); +define(`PKG_TSSOP16', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 16, 33, 150, 65, 440)'); +define(`PKG_TSSOP20', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 20, 33, 150, 65, 440)'); +define(`PKG_TSSOP24', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 24, 33, 150, 65, 440)'); +define(`PKG_TSSOP28', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 28, 33, 150, 65, 440)'); +define(`PKG_TSSOP38N', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 38, 30, 150, 50, 440)'); +define(`PKG_TSSOP48N', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 48, 25, 150, 40, 440)'); +define(`PKG_TSSOP56N', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 56, 25, 150, 40, 440)'); + +## Thin shrink small outline package, wide (6.1mm) +# +define(`PKG_TSSOP32', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 32, 33, 150, 65, 610)'); +define(`PKG_TSSOP48', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 48, 30, 150, 50, 610)'); +define(`PKG_TSSOP56', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 56, 30, 150, 50, 610)'); +define(`PKG_TSSOP64', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 64, 30, 150, 50, 610)'); +define(`PKG_TSSOP80', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 80, 25, 150, 40, 610)'); + +# +## Plastic leadless chip carrier +# PLCC44 .. PLCC84 +# +# BUG: similar: +# QFJ 18,20,22,28,32,44,68,84 +# +define(`PKG_PLCC20', `PKG_PLCC(`$1', `$2', `$3', 20, 150)'); +define(`PKG_PLCC28', `PKG_PLCC(`$1', `$2', `$3', 28, 150)'); +define(`PKG_PLCC32', `PKG_PLCC(`$1', `$2', `$3', 32, 150)'); +define(`PKG_PLCC44', `PKG_PLCC(`$1', `$2', `$3', 44, 150)'); +define(`PKG_PLCC52', `PKG_PLCC(`$1', `$2', `$3', 52, 150)'); +define(`PKG_PLCC68', `PKG_PLCC(`$1', `$2', `$3', 68, 150)'); +define(`PKG_PLCC84', `PKG_PLCC(`$1', `$2', `$3', 84, 150)'); + +# +## Plastic leadless chip carrier with pin socket +# PLCC44X .. PLCC84X +# +define(`PKG_PLCC20X', `PKG_PLCC_SOCKET(`$1', `$2', `$3', 20, 150)'); +define(`PKG_PLCC28X', `PKG_PLCC_SOCKET(`$1', `$2', `$3', 28, 150)'); +define(`PKG_PLCC32X', `PKG_PLCC_SOCKET(`$1', `$2', `$3', 32, 150)'); +define(`PKG_PLCC44X', `PKG_PLCC_SOCKET(`$1', `$2', `$3', 44, 150)'); +define(`PKG_PLCC52X', `PKG_PLCC_SOCKET(`$1', `$2', `$3', 52, 150)'); +define(`PKG_PLCC68X', `PKG_PLCC_SOCKET(`$1', `$2', `$3', 68, 150)'); +define(`PKG_PLCC84X', `PKG_PLCC_SOCKET(`$1', `$2', `$3', 84, 150)'); + +## Square Quad Flat Nolead (QFN) package +# + +# 3x3 mm +define(`PKG_QFN16_3', `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `0')') +define(`PKG_TQFN16_3', `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `0')') +define(`PKG_QFN16_3_EP', `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `150')') +define(`PKG_TQFN16_3_EP', `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `150')') + +# 4x4 mm +define(`PKG_QFN12_4', `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `0')') +define(`PKG_TQFN12_4', `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `0')') +define(`PKG_QFN12_4_EP', `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `210')') +define(`PKG_TQFN12_4_EP', `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `210')') + +define(`PKG_QFN16_4', `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `0')') +define(`PKG_TQFN16_4', `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `0')') +define(`PKG_QFN16_4_EP', `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `210')') +define(`PKG_TQFN16_4_EP', `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `210')') + +define(`PKG_QFN20_4', `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `0')') +define(`PKG_TQFN20_4', `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `0')') +define(`PKG_QFN20_4_EP', `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `210')') +define(`PKG_TQFN20_4_EP', `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `210')') + +define(`PKG_QFN24_4', `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `0')') +define(`PKG_TQFN24_4', `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `0')') +define(`PKG_QFN24_4_EP', `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `210')') +define(`PKG_TQFN24_4_EP', `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `260')') + +# 5x5 mm +define(`PKG_QFN16_5', `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `0')') +define(`PKG_TQFN16_5', `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `0')') +define(`PKG_QFN16_5_EP', `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `310')') +define(`PKG_TQFN16_5_EP', `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `310')') + +define(`PKG_QFN20_5', `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `0')') +define(`PKG_TQFN20_5', `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `0')') +define(`PKG_QFN20_5_EP', `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `310')') +define(`PKG_TQFN20_5_EP', `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `310')') + +define(`PKG_QFN28_5', `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `0')') +define(`PKG_TQFN28_5', `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `0')') +define(`PKG_QFN28_5_EP', `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `310')') +define(`PKG_TQFN28_5_EP', `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `325')') + +define(`PKG_QFN32_5', `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `0')') +define(`PKG_TQFN32_5', `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `0')') +define(`PKG_QFN32_5_EP', `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `310')') +define(`PKG_TQFN32_5_EP', `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `310')') + +# 6x6 mm +define(`PKG_QFN36_6', `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `0')') +define(`PKG_TQFN36_6', `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `0')') +define(`PKG_QFN36_6_EP', `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `370')') +define(`PKG_TQFN36_6_EP', `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `370')') + +define(`PKG_QFN40_6', `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `0')') +define(`PKG_TQFN40_6', `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `0')') +define(`PKG_QFN40_6_EP', `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `410')') +define(`PKG_TQFN40_6_EP', `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `410')') + +# 7x7 mm +define(`PKG_QFN32_7', `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `0')') +define(`PKG_TQFN32_7', `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `0')') +define(`PKG_QFN32_7_EP', `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `470')') +define(`PKG_TQFN32_7_EP', `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `470')') + +define(`PKG_QFN44_7', `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `0')') +define(`PKG_TQFN44_7', `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `0')') +define(`PKG_QFN44_7_EP', `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `470')') +define(`PKG_TQFN44_7_EP', `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `470')') + +define(`PKG_QFN48_7', `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `0')') +define(`PKG_TQFN48_7', `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `0')') +define(`PKG_QFN48_7_EP', `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `560')') +define(`PKG_TQFN48_7_EP', `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `560')') + +# 8x8 mm +define(`PKG_QFN56_8', `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `0')') +define(`PKG_TQFN56_8', `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `0')') +define(`PKG_QFN56_8_EP', `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `665')') +define(`PKG_TQFN56_8_EP', `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `665')') + +# 10x10 mm +define(`PKG_QFN68_10', `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `0')') +define(`PKG_TQFN68_10', `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `0')') +define(`PKG_QFN68_10_EP', `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `770')') +define(`PKG_TQFN68_10_EP', `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `770')') + +# +## Square Quad-side flat pack +# QFP 32,44,56,64,80,100,128,160,208,240,272,304 +# LQFP 144,176,208 +# TQFP 44,48,64,80,120 + +define(`PKG_LQFP24_4', `PKG_LQFP_50(`$1',`$2',`$3', `24', `4',`0')'); +define(`PKG_LQFP32_5', `PKG_LQFP_50(`$1',`$2',`$3', `32', `5',`0')'); +define(`PKG_LQFP32_7', `PKG_LQFP_80(`$1',`$2',`$3', `32', `7',`0')'); +define(`PKG_LQFP44_10', `PKG_LQFP_80(`$1',`$2',`$3', `44',`10',`0')'); +define(`PKG_LQFP48_7', `PKG_LQFP_50(`$1',`$2',`$3', `48', `7',`0')'); +define(`PKG_LQFP48_12', `PKG_LQFP_80(`$1',`$2',`$3', `48',`12',`0')'); +define(`PKG_LQFP52_10', `PKG_LQFP_65(`$1',`$2',`$3', `52',`10',`0')'); +define(`PKG_LQFP64_7', `PKG_LQFP_40(`$1',`$2',`$3', `64', `7',`0')'); +define(`PKG_LQFP64_10', `PKG_LQFP_50(`$1',`$2',`$3', `64',`10',`0')'); +define(`PKG_LQFP64_14', `PKG_LQFP_80(`$1',`$2',`$3', `64',`14',`0')'); +define(`PKG_LQFP72_10', `PKG_LQFP_50(`$1',`$2',`$3', `72',`10',`0')'); +define(`PKG_LQFP80_12', `PKG_LQFP_50(`$1',`$2',`$3', `80',`12',`0')'); +define(`PKG_LQFP80_14', `PKG_LQFP_65(`$1',`$2',`$3', `80',`14',`0')'); +define(`PKG_LQFP100_10', `PKG_LQFP_40(`$1',`$2',`$3',`100',`10',`0')'); +define(`PKG_LQFP100_14', `PKG_LQFP_50(`$1',`$2',`$3',`100',`14',`0')'); +define(`PKG_LQFP112_20', `PKG_LQFP_65(`$1',`$2',`$3',`112',`20',`0')'); +define(`PKG_LQFP120_16', `PKG_LQFP_50(`$1',`$2',`$3',`120',`16',`0')'); +define(`PKG_LQFP128_14', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`0')'); +define(`PKG_LQFP128_14_EP', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`970')'); +define(`PKG_LQFP144_20', `PKG_LQFP_50(`$1',`$2',`$3',`144',`20',`0')'); +define(`PKG_LQFP160_24', `PKG_LQFP_50(`$1',`$2',`$3',`160',`24',`0')'); +define(`PKG_LQFP176_24', `PKG_LQFP_50(`$1',`$2',`$3',`176',`24',`0')'); + + +define(`PKG_QFP32_7', `PKG_QFP_80(`$1',`$2',`$3', `32', `7',`0')'); +define(`PKG_QFP44_10', `PKG_QFP_80(`$1',`$2',`$3', `44',`10',`0')'); +define(`PKG_QFP52_10', `PKG_QFP_65(`$1',`$2',`$3', `52',`10',`0')'); +define(`PKG_QFP64_14', `PKG_QFP_80(`$1',`$2',`$3', `64',`14',`0')'); +define(`PKG_QFP80_14', `PKG_QFP_65(`$1',`$2',`$3', `80',`14',`0')'); +define(`PKG_QFP100_14', `PKG_QFP_50(`$1',`$2',`$3',`100',`14',`0')'); +define(`PKG_QFP120_28', `PKG_QFP_80(`$1',`$2',`$3',`120',`28',`0')'); +define(`PKG_QFP128_28', `PKG_QFP_80(`$1',`$2',`$3',`128',`28',`0')'); +define(`PKG_QFP144_28', `PKG_QFP_65(`$1',`$2',`$3',`144',`28',`0')'); +define(`PKG_QFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')'); +define(`PKG_QFP208_28', `PKG_QFP_50(`$1',`$2',`$3',`208',`28',`0')'); +define(`PKG_QFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')'); +define(`PKG_QFP240_32', `PKG_QFP_50(`$1',`$2',`$3',`240',`32',`0')'); +define(`PKG_QFP304_40', `PKG_QFP_50(`$1',`$2',`$3',`304',`40',`0')'); + +define(`PKG_TQFP32_7', `PKG_QFP_80(`$1',`$2',`$3', `32', `7',`0')'); +define(`PKG_TQFP44_10', `PKG_QFP_80(`$1',`$2',`$3', `44',`10',`0')'); +define(`PKG_TQFP52_10', `PKG_QFP_65(`$1',`$2',`$3', `52',`10',`0')'); +define(`PKG_TQFP64_10', `PKG_QFP_50(`$1',`$2',`$3', `64',`10',`0')'); +define(`PKG_TQFP64_14', `PKG_QFP_80(`$1',`$2',`$3', `64',`14',`0')'); +define(`PKG_TQFP80_12', `PKG_QFP_50(`$1',`$2',`$3', `80',`12',`0')'); +define(`PKG_TQFP80_14', `PKG_QFP_65(`$1',`$2',`$3', `80',`14',`0')'); +define(`PKG_TQFP100_12', `PKG_QFP_40(`$1',`$2',`$3',`100',`12',`0')'); +define(`PKG_TQFP100_14', `PKG_QFP_50(`$1',`$2',`$3',`100',`14',`0')'); +define(`PKG_TQFP120_28', `PKG_QFP_80(`$1',`$2',`$3',`120',`28',`0')'); +define(`PKG_TQFP128_14', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`0')'); +define(`PKG_TQFP128_14_EP', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`970')'); +define(`PKG_TQFP128_28', `PKG_QFP_80(`$1',`$2',`$3',`128',`28',`0')'); +define(`PKG_TQFP144_28', `PKG_QFP_65(`$1',`$2',`$3',`144',`28',`0')'); +define(`PKG_TQFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')'); +define(`PKG_TQFP208_28', `PKG_QFP_50(`$1',`$2',`$3',`208',`28',`0')'); +define(`PKG_TQFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')'); +define(`PKG_TQFP240_32', `PKG_QFP_50(`$1',`$2',`$3',`240',`32',`0')'); +define(`PKG_TQFP304_40', `PKG_QFP_50(`$1',`$2',`$3',`304',`40',`0')'); + +# +## Rectangular Quad-side flat pack + +define(`PKG_QFP64_R', `PKG_QFP_100(`$1',`$2',`$3', `64',`0',`0')'); +define(`PKG_QFP80_R', `PKG_QFP_80L(`$1',`$2',`$3', `80',`0',`0')'); +define(`PKG_QFP100_R', `PKG_QFP_65L(`$1',`$2',`$3',`100',`0',`0')'); +define(`PKG_QFP128_R', `PKG_QFP_50L(`$1',`$2',`$3',`128',`0',`0')'); +define(`PKG_LQFP128_R', `PKG_LQFP_50(`$1',`$2',`$3',`128',`0',`0')'); + +## Zig-zag in-line package +# ZIP20 .. ZIP40 +# +define(`PKG_ZIP9', `PKG_SD(`$1', `$2', `$3', 9)'); +define(`PKG_ZIP12', `PKG_SD(`$1', `$2', `$3', 12)'); +define(`PKG_ZIP16', `PKG_SD(`$1', `$2', `$3', 16)'); +define(`PKG_ZIP18', `PKG_SD(`$1', `$2', `$3', 18)'); +define(`PKG_ZIP20', `PKG_SD(`$1', `$2', `$3', 20)'); +define(`PKG_ZIP24', `PKG_SD(`$1', `$2', `$3', 24)'); +define(`PKG_ZIP28', `PKG_SD(`$1', `$2', `$3', 28)'); +define(`PKG_ZIP40', `PKG_SD(`$1', `$2', `$3', 40)'); + +# +## Axial non-polar component (typically resistor or capacitor), +# 100 through 1600 mil between pins +# AXN100 .. AXN1600 +# +define(`PKG_ACY100', `PKG_AXIAL_LAY(`$1', `$2', `$3', 100)'); +define(`PKG_ACY150', `PKG_AXIAL_LAY(`$1', `$2', `$3', 150)'); +define(`PKG_ACY200', `PKG_AXIAL_LAY(`$1', `$2', `$3', 200)'); +define(`PKG_ACY300', `PKG_AXIAL_LAY(`$1', `$2', `$3', 300)'); +define(`PKG_ACY400', `PKG_AXIAL_LAY(`$1', `$2', `$3', 400)'); +define(`PKG_ACY500', `PKG_AXIAL_LAY(`$1', `$2', `$3', 500)'); +define(`PKG_ACY600', `PKG_AXIAL_LAY(`$1', `$2', `$3', 600)'); +define(`PKG_ACY700', `PKG_AXIAL_LAY(`$1', `$2', `$3', 700)'); +define(`PKG_ACY800', `PKG_AXIAL_LAY(`$1', `$2', `$3', 800)'); +define(`PKG_ACY900', `PKG_AXIAL_LAY(`$1', `$2', `$3', 900)'); +define(`PKG_ACY1000', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1000)'); +define(`PKG_ACY1100', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1100)'); +define(`PKG_ACY1200', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1200)'); +define(`PKG_ACY1300', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1300)'); +define(`PKG_ACY1400', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1400)'); +define(`PKG_ACY1500', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1500)'); +define(`PKG_ACY1600', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1600)'); + + +## Axial polar component (typically capacitor), +# 100 through 1600 mil between pins +# +define(`PKG_ACY100P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 100, 1)') +define(`PKG_ACY150P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 150, 1)') +define(`PKG_ACY200P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 200, 1)') +define(`PKG_ACY300P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 300, 1)') +define(`PKG_ACY400P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 400, 1)') +define(`PKG_ACY500P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 500, 1)') +define(`PKG_ACY600P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 600, 1)') +define(`PKG_ACY700P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 700, 1)') +define(`PKG_ACY800P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 800, 1)') +define(`PKG_ACY900P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 900, 1)') +define(`PKG_ACY1000P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1000, 1)') +define(`PKG_ACY1100P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1100, 1)') +define(`PKG_ACY1200P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1200, 1)') +define(`PKG_ACY1300P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1300, 1)') +define(`PKG_ACY1400P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1400, 1)') +define(`PKG_ACY1500P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1500, 1)') +define(`PKG_ACY1600P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1600, 1)') + +# +## Axial diode (pin 1 is cathode) +# ALF300 .. ALF1000 +# +# +define(`PKG_ALF300', `PKG_DIODE_LAY(`$1', `$2', `$3', 300)'); +define(`PKG_ALF400', `PKG_DIODE_LAY(`$1', `$2', `$3', 400)'); +define(`PKG_ALF500', `PKG_DIODE_LAY(`$1', `$2', `$3', 500)'); +define(`PKG_ALF600', `PKG_DIODE_LAY(`$1', `$2', `$3', 600)'); +define(`PKG_ALF700', `PKG_DIODE_LAY(`$1', `$2', `$3', 700)'); +define(`PKG_ALF800', `PKG_DIODE_LAY(`$1', `$2', `$3', 800)'); +define(`PKG_ALF900', `PKG_DIODE_LAY(`$1', `$2', `$3', 900)'); +define(`PKG_ALF1000',`PKG_DIODE_LAY(`$1', `$2', `$3', 1000)'); + +# +## Bottom lead non-polar circular component (typically capacitor) +# pin spacing 100 mil and up +# RCY100 .. RCY1000 +# +define(`PKG_RCY100', `PKG_RADIAL_CAN(`$1', `$2', `$3', 200)'); +define(`PKG_RCY150', `PKG_RADIAL_CAN(`$1', `$2', `$3', 300)'); +define(`PKG_RCY200', `PKG_RADIAL_CAN(`$1', `$2', `$3', 400)'); +define(`PKG_RCY250', `PKG_RADIAL_CAN(`$1', `$2', `$3', 500)'); +define(`PKG_RCY300', `PKG_RADIAL_CAN(`$1', `$2', `$3', 600)'); +define(`PKG_RCY350', `PKG_RADIAL_CAN(`$1', `$2', `$3', 700)'); +define(`PKG_RCY400', `PKG_RADIAL_CAN(`$1', `$2', `$3', 800)'); +define(`PKG_RCY500', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1000)'); +define(`PKG_RCY600', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1200)'); +define(`PKG_RCY700', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1400)'); +define(`PKG_RCY800', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1600)'); +define(`PKG_RCY900', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1800)'); +define(`PKG_RCY1000', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2000)'); +define(`PKG_RCY1100', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2200)'); +define(`PKG_RCY1200', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2400)'); + + +## Bottom lead polar circular component (typically capacitor) +# pin spacing 100 mil and up +# +define(`PKG_RCY100P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 200, 1)'); +define(`PKG_RCY150P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 300, 1)'); +define(`PKG_RCY200P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 400, 1)'); +define(`PKG_RCY250P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 500, 1)'); +define(`PKG_RCY300P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 600, 1)'); +define(`PKG_RCY350P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 700, 1)'); +define(`PKG_RCY400P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 800, 1)'); +define(`PKG_RCY500P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1000, 1)'); +define(`PKG_RCY600P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1200, 1)'); +define(`PKG_RCY700P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1400, 1)'); +define(`PKG_RCY800P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1600, 1)'); +define(`PKG_RCY900P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1800, 1)'); +define(`PKG_RCY1000P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2000, 1)'); +define(`PKG_RCY1100P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2200, 1)'); +define(`PKG_RCY1200P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2400, 1)'); + +# +## Crystals +# +# +define(`PKG_HC49U', `PKG_CRYSTAL_V(`$1', `$2', `$3', 192, 435, 183, 60, 32, 2)'); +define(`PKG_HC49UH', `PKG_CRYSTAL_H(`$1', `$2', `$3', 192, 435, 515, 60, 32, 2)'); +define(`PKG_HC49U_3', `PKG_CRYSTAL_V(`$1', `$2', `$3', 96, 435, 183, 60, 32, 3)'); +define(`PKG_HC49U_3H',`PKG_CRYSTAL_H(`$1', `$2', `$3', 96, 435, 515, 60, 32, 3)'); +define(`PKG_HC51U', `PKG_CRYSTAL_V(`$1', `$2', `$3', 485, 757, 352, 80, 40, 2)'); +define(`PKG_HC51UH', `PKG_CRYSTAL_H(`$1', `$2', `$3', 485, 757, 775, 80, 40, 2)'); +define(`PKG_UM1', `PKG_CRYSTAL_V(`$1', `$2', `$3', 148, 311, 126, 60, 32, 2)'); +define(`PKG_UM1H', `PKG_CRYSTAL_H(`$1', `$2', `$3', 148, 311, 322, 60, 32, 2)'); +define(`PKG_UM1_3', `PKG_CRYSTAL_V(`$1', `$2', `$3', 74, 311, 126, 60, 32, 3)'); +define(`PKG_UM1_3H', `PKG_CRYSTAL_H(`$1', `$2', `$3', 74, 311, 322, 60, 32, 3)'); +# +# HC49 +# +define(`PKG_HC49', `PKG_CRYSTAL(`$1', `$2', `$3', 300)'); + +# +## Crystal oscillator +# pins are NC, GND, CLK, VCC +# OSC14 +# +define(`PKG_OSC14', `PKG_OSC(`$1', `$2', `$3')'); + +# +## LED, size in mm (pin 1 is +, 2 is -) +# LED3, LED5 +# +define(`PKG_LED3', `PKG_LED(`$1', `$2', `$3', 118)'); +define(`PKG_LED5', `PKG_LED(`$1', `$2', `$3', 236)'); + +# +## Transistor +# TO3_90 +# TO3_45 +# TO126LAY +# TO126W for wide +# TO126S for standing +# TO126SW for both +# TO220 +# TO220W for wide +# TO220S for standing +# TO220SW for both +# +# as is TO3_90 +# as is TO3_45 +# as is TO5 +# as is TO92 +define(`PKG_TO126', `PKG_TO126LAY( `$1', `$2', `$3')'); +define(`PKG_TO126S', `PKG_TO126LAY_WIDE( `$1', `$2', `$3')'); +define(`PKG_TO126W', `PKG_TO126STAND( `$1', `$2', `$3')'); +define(`PKG_TO126SW',`PKG_TO126STAND_WIDE(`$1', `$2', `$3')'); +define(`PKG_TO220', `PKG_TO220LAY( `$1', `$2', `$3')'); +define(`PKG_TO220S', `PKG_TO220LAY_WIDE( `$1', `$2', `$3')'); +define(`PKG_TO220W', `PKG_TO220STAND( `$1', `$2', `$3')'); +define(`PKG_TO220SW',`PKG_TO220STAND_WIDE(`$1', `$2', `$3')'); + +# these are just wrappers around the footprints from to.inc. +# they are done here to be in a standard format that will +# make them show up in the footprint window and also get +# generated via the m4lib_to_newlib.sh script +define(`PKG_TO18', `PKG_TO18BASE(`$1', `$2', `$3')'); +define(`PKG_TO39', `PKG_TO39BASE(`$1', `$2', `$3')'); +define(`PKG_TO92', `PKG_TO92BASE(`$1', `$2', `$3')'); + +## diode in TO220 +# +define(`PKG_TO220ACS', `PKG_TO220ACSTAND(`$1', `$2', `$3')'); +define(`PKG_TO218', `GENERIC_PL_POWER(`$1', `$2', `$3', 3, 219, 615, 200, 120,100, 60, 0)'); +# aka TOP3 +define(`PKG_TO247', `GENERIC_PL_POWER(`$1', `$2', `$3', 3, 219, 630, 210, 130,100, 60, 0)'); +# diode in TO247/TOP3 +define(`PKG_TO247_2', `GENERIC_PL_POWER(`$1', `$2', `$3', 2, 438, 630, 210, 130,100, 60, 0)'); +# aka TOP3BIG +define(`PKG_TO264', `GENERIC_PL_POWER(`$1', `$2', `$3', 3, 219, 800, 210, 130,100, 60, 0)'); +# aka IPAK +define(`PKG_TO251', `GENERIC_PL_POWER(`$1', `$2', `$3', 3, 90, 265, 100, 50, 70, 40, 0)'); + +define(`PKG_TO220ACSTAND', `GENERIC_PL_POWER(`$1', `$2', `$3', 2, 200, 400, 180, 100, 80, 40, 0)') + +# the definitions of PKG_TO220STAND PKG_TO220STAND-WIDE can be replaced by following lines: +#define(`PKG_TO220STAND', `GENERIC_PL_POWER(`$1', `$2', `$3', 3, 100, 400, 180, 100, 80, 40, 0)') +#define(`PKG_TO220STAND-WIDE', `GENERIC_PL_POWER(`$1', `$2', `$3', 3, 100, 400, 180, 200, 80, 40,-100)') + +# +## Power IC, as in MULTIWATT15 +# +# See the following: +# PENTAWATT: http://www.st.com/stonline/books/pdf/docs/9262.pdf +# HEPTAWATT: http://www.st.com/stonline/books/pdf/docs/5430.pdf +# MULTIWATT8: http://www.st.com/stonline/books/pdf/docs/5437.pdf +# MULTIWATT11: http://www.st.com/stonline/books/pdf/docs/5433.pdf +# MULTIWATT15: http://www.st.com/stonline/books/pdf/docs/5439.pdf + +# GENERIC_PL_POWER +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pin count +# $5: pin spacing +# $6: body length (dimension parallel to rows of pins) +# $7: body width (dimension perpendicular to rows of pins) +# $8: pin/tab spacing +# $9: pad size +# $10: drill size +# $11: pin row spacing + +define(`PKG_PENTAWATT', `GENERIC_PL_POWER(`$1', `$2', `$3', 5, 67, 409, 189, 177, 90, 60, 157)' ); +define(`PKG_HEPTAWATT', `GENERIC_PL_POWER(`$1', `$2', `$3', 7, 50, 409, 189, 110, 90, 60, 200)' ); +define(`PKG_MULTIWATT8', `GENERIC_PL_POWER(`$1', `$2', `$3', 8, 100, 800, 200, 115, 90, 60, 0)' ); +define(`PKG_MULTIWATT11', `GENERIC_PL_POWER(`$1', `$2', `$3', 11, 67, 800, 200, 180, 90, 60, 200)' ); +define(`PKG_MULTIWATT15', `GENERIC_PL_POWER(`$1', `$2', `$3', 15, 50, 800, 200, 180, 90, 60, 200)' ); + +# +## Jumper, i.e. single row headers +# +define(`PKG_JUMPER1', `PKG_CONNECTOR(`$1', `$2', `$3', 1, 1)'); +define(`PKG_JUMPER2', `PKG_CONNECTOR(`$1', `$2', `$3', 2, 1)'); +define(`PKG_JUMPER3', `PKG_CONNECTOR(`$1', `$2', `$3', 3, 1)'); +define(`PKG_JUMPER4', `PKG_CONNECTOR(`$1', `$2', `$3', 4, 1)'); +define(`PKG_JUMPER5', `PKG_CONNECTOR(`$1', `$2', `$3', 5, 1)'); +define(`PKG_JUMPER6', `PKG_CONNECTOR(`$1', `$2', `$3', 6, 1)'); +define(`PKG_JUMPER7', `PKG_CONNECTOR(`$1', `$2', `$3', 7, 1)'); +define(`PKG_JUMPER8', `PKG_CONNECTOR(`$1', `$2', `$3', 8, 1)'); +define(`PKG_JUMPER9', `PKG_CONNECTOR(`$1', `$2', `$3', 9, 1)'); +define(`PKG_JUMPER10', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 1)'); +define(`PKG_JUMPER11', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 1)'); +define(`PKG_JUMPER12', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 1)'); +define(`PKG_JUMPER13', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 1)'); +define(`PKG_JUMPER14', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 1)'); +define(`PKG_JUMPER15', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 1)'); +define(`PKG_JUMPER16', `PKG_CONNECTOR(`$1', `$2', `$3', 16, 1)'); +define(`PKG_JUMPER17', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 1)'); +define(`PKG_JUMPER18', `PKG_CONNECTOR(`$1', `$2', `$3', 18, 1)'); +define(`PKG_JUMPER19', `PKG_CONNECTOR(`$1', `$2', `$3', 19, 1)'); +define(`PKG_JUMPER20', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 1)'); +define(`PKG_JUMPER21', `PKG_CONNECTOR(`$1', `$2', `$3', 21, 1)'); +define(`PKG_JUMPER22', `PKG_CONNECTOR(`$1', `$2', `$3', 22, 1)'); +define(`PKG_JUMPER23', `PKG_CONNECTOR(`$1', `$2', `$3', 23, 1)'); +define(`PKG_JUMPER24', `PKG_CONNECTOR(`$1', `$2', `$3', 24, 1)'); +define(`PKG_JUMPER25', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 1)'); +define(`PKG_JUMPER26', `PKG_CONNECTOR(`$1', `$2', `$3', 26, 1)'); + +# +## MTA Connector, (0.100 inch pitch) +# +define(`PKG_MTA100_2', `PKG_MTA_100(`$1', `$2', `$3', 2)'); +define(`PKG_MTA100_3', `PKG_MTA_100(`$1', `$2', `$3', 3)'); +define(`PKG_MTA100_4', `PKG_MTA_100(`$1', `$2', `$3', 4)'); +define(`PKG_MTA100_5', `PKG_MTA_100(`$1', `$2', `$3', 5)'); +define(`PKG_MTA100_6', `PKG_MTA_100(`$1', `$2', `$3', 6)'); +define(`PKG_MTA100_7', `PKG_MTA_100(`$1', `$2', `$3', 7)'); +define(`PKG_MTA100_8', `PKG_MTA_100(`$1', `$2', `$3', 8)'); +define(`PKG_MTA100_9', `PKG_MTA_100(`$1', `$2', `$3', 9)'); +define(`PKG_MTA100_10', `PKG_MTA_100(`$1', `$2', `$3', 10)'); +define(`PKG_MTA100_11', `PKG_MTA_100(`$1', `$2', `$3', 11)'); +define(`PKG_MTA100_12', `PKG_MTA_100(`$1', `$2', `$3', 12)'); +define(`PKG_MTA100_13', `PKG_MTA_100(`$1', `$2', `$3', 13)'); +define(`PKG_MTA100_14', `PKG_MTA_100(`$1', `$2', `$3', 14)'); +define(`PKG_MTA100_15', `PKG_MTA_100(`$1', `$2', `$3', 15)'); + +# +## Header connector, DIP pin numbering +# Corresponding to gEDA symbols header2-1 .. header64-1 +# +define(`PKG_HEADER2_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 1)'); +define(`PKG_HEADER4_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 2)'); +define(`PKG_HEADER6_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 3)'); +define(`PKG_HEADER8_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 4)'); +define(`PKG_HEADER10_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 5)'); +define(`PKG_HEADER12_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 6)'); +define(`PKG_HEADER14_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 7)'); +define(`PKG_HEADER16_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 8)'); +define(`PKG_HEADER18_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 9)'); +define(`PKG_HEADER20_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 10)'); +define(`PKG_HEADER22_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 11)'); +define(`PKG_HEADER24_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 12)'); +define(`PKG_HEADER26_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 13)'); +define(`PKG_HEADER28_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 14)'); +define(`PKG_HEADER30_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 15)'); +define(`PKG_HEADER32_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 16)'); +define(`PKG_HEADER34_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 17)'); +define(`PKG_HEADER36_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 18)'); +define(`PKG_HEADER38_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 19)'); +define(`PKG_HEADER40_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 20)'); +define(`PKG_HEADER42_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 21)'); +define(`PKG_HEADER44_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 22)'); +define(`PKG_HEADER46_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 23)'); +define(`PKG_HEADER48_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 24)'); +define(`PKG_HEADER50_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 25)'); +define(`PKG_HEADER52_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 26)'); +define(`PKG_HEADER54_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 27)'); +define(`PKG_HEADER56_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 28)'); +define(`PKG_HEADER58_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 29)'); +define(`PKG_HEADER60_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 30)'); +define(`PKG_HEADER62_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 31)'); +define(`PKG_HEADER64_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 32)'); +define(`PKG_HEADER80_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 40)'); + +# +## Header connector, ribbon cable numbering +# corresponding to gEDA symbols header2-2 .. header64-2 +# +define(`PKG_HEADER2_2', `PKG_CONNECTOR(`$1', `$2', `$3', 1, 2)'); +define(`PKG_HEADER4_2', `PKG_CONNECTOR(`$1', `$2', `$3', 2, 2)'); +define(`PKG_HEADER6_2', `PKG_CONNECTOR(`$1', `$2', `$3', 3, 2)'); +define(`PKG_HEADER8_2', `PKG_CONNECTOR(`$1', `$2', `$3', 4, 2)'); +define(`PKG_HEADER10_2', `PKG_CONNECTOR(`$1', `$2', `$3', 5, 2)'); +define(`PKG_HEADER12_2', `PKG_CONNECTOR(`$1', `$2', `$3', 6, 2)'); +define(`PKG_HEADER14_2', `PKG_CONNECTOR(`$1', `$2', `$3', 7, 2)'); +define(`PKG_HEADER16_2', `PKG_CONNECTOR(`$1', `$2', `$3', 8, 2)'); +define(`PKG_HEADER18_2', `PKG_CONNECTOR(`$1', `$2', `$3', 9, 2)'); +define(`PKG_HEADER20_2', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 2)'); +define(`PKG_HEADER22_2', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 2)'); +define(`PKG_HEADER24_2', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 2)'); +define(`PKG_HEADER26_2', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 2)'); +define(`PKG_HEADER28_2', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 2)'); +define(`PKG_HEADER30_2', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 2)'); +define(`PKG_HEADER32_2', `PKG_CONNECTOR(`$1', `$2', `$3', 16, 2)'); +define(`PKG_HEADER34_2', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 2)'); +define(`PKG_HEADER36_2', `PKG_CONNECTOR(`$1', `$2', `$3', 18, 2)'); +define(`PKG_HEADER38_2', `PKG_CONNECTOR(`$1', `$2', `$3', 19, 2)'); +define(`PKG_HEADER40_2', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 2)'); +define(`PKG_HEADER42_2', `PKG_CONNECTOR(`$1', `$2', `$3', 21, 2)'); +define(`PKG_HEADER44_2', `PKG_CONNECTOR(`$1', `$2', `$3', 22, 2)'); +define(`PKG_HEADER46_2', `PKG_CONNECTOR(`$1', `$2', `$3', 23, 2)'); +define(`PKG_HEADER48_2', `PKG_CONNECTOR(`$1', `$2', `$3', 24, 2)'); +define(`PKG_HEADER50_2', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 2)'); +define(`PKG_HEADER52_2', `PKG_CONNECTOR(`$1', `$2', `$3', 26, 2)'); +define(`PKG_HEADER54_2', `PKG_CONNECTOR(`$1', `$2', `$3', 27, 2)'); +define(`PKG_HEADER56_2', `PKG_CONNECTOR(`$1', `$2', `$3', 28, 2)'); +define(`PKG_HEADER58_2', `PKG_CONNECTOR(`$1', `$2', `$3', 29, 2)'); +define(`PKG_HEADER60_2', `PKG_CONNECTOR(`$1', `$2', `$3', 30, 2)'); +define(`PKG_HEADER62_2', `PKG_CONNECTOR(`$1', `$2', `$3', 31, 2)'); +define(`PKG_HEADER64_2', `PKG_CONNECTOR(`$1', `$2', `$3', 32, 2)'); +define(`PKG_HEADER80_2', `PKG_CONNECTOR(`$1', `$2', `$3', 40, 2)'); + +# +## Header connector with latches +# +define(`PKG_DIN41651_10', `PKG_DIN41_651LAY( `$1', `$2', `$3', 10)'); +define(`PKG_DIN41651_14', `PKG_DIN41_651LAY( `$1', `$2', `$3', 14)'); +define(`PKG_DIN41651_16', `PKG_DIN41_651LAY( `$1', `$2', `$3', 16)'); +define(`PKG_DIN41651_20', `PKG_DIN41_651LAY( `$1', `$2', `$3', 20)'); +define(`PKG_DIN41651_26', `PKG_DIN41_651LAY( `$1', `$2', `$3', 26)'); +define(`PKG_DIN41651_34', `PKG_DIN41_651LAY( `$1', `$2', `$3', 34)'); +define(`PKG_DIN41651_40', `PKG_DIN41_651LAY( `$1', `$2', `$3', 40)'); +define(`PKG_DIN41651_50', `PKG_DIN41_651LAY( `$1', `$2', `$3', 50)'); +define(`PKG_DIN41651_60', `PKG_DIN41_651LAY( `$1', `$2', `$3', 60)'); +define(`PKG_DIN41651_64', `PKG_DIN41_651LAY( `$1', `$2', `$3', 64)'); + +define(`PKG_DIN41651_10S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 10)'); +define(`PKG_DIN41651_14S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 14)'); +define(`PKG_DIN41651_16S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 16)'); +define(`PKG_DIN41651_20S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 20)'); +define(`PKG_DIN41651_26S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 26)'); +define(`PKG_DIN41651_34S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 34)'); +define(`PKG_DIN41651_40S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 40)'); +define(`PKG_DIN41651_50S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 50)'); +define(`PKG_DIN41651_60S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 60)'); +define(`PKG_DIN41651_64S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 64)'); + +# +## DSUB connector, female/male +# DB9F .. DB37F +# DB9M .. DB37M +# +define(`PKG_DB9F', `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3', 9)'); +define(`PKG_DB15F', `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3', 15)'); +define(`PKG_DB25F', `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3', 25)'); +define(`PKG_DB37F', `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3', 37)'); +define(`PKG_DB9M', `PKG_SUBD_MALE_LAY( `$1', `$2', `$3', 9)'); +define(`PKG_DB15M', `PKG_SUBD_MALE_LAY( `$1', `$2', `$3', 15)'); +define(`PKG_DB25M', `PKG_SUBD_MALE_LAY( `$1', `$2', `$3', 25)'); +define(`PKG_DB37M', `PKG_SUBD_MALE_LAY( `$1', `$2', `$3', 37)'); + +# +## DIN connector, 96 pin housing +# DIN41612C96F ... +# +define(`PKG_DIN41612C96F', `PKG_DIN41_612FEMALE(`$1', `$2', `$3', `abc')'); +define(`PKG_DIN41612C96M', `PKG_DIN41_612MALE( `$1', `$2', `$3', `abc')'); +define(`PKG_DIN41612C64F', `PKG_DIN41_612FEMALE(`$1', `$2', `$3', `ac')'); +define(`PKG_DIN41612C64M', `PKG_DIN41_612MALE( `$1', `$2', `$3', `ac')'); + +define(`PKG_DIN41612C96FS', `PKG_DIN41_612FEMALE_SMALL(`$1', `$2', `$3', `abc')'); +define(`PKG_DIN41612C96MS', `PKG_DIN41_612MALE_SMALL( `$1', `$2', `$3', `abc')'); +define(`PKG_DIN41612C64FS', `PKG_DIN41_612FEMALE_SMALL(`$1', `$2', `$3', `ac')'); +define(`PKG_DIN41612C64MS', `PKG_DIN41_612MALE_SMALL( `$1', `$2', `$3', `ac')'); + +# +## Standard SMT resistor, capacitor etc +# 0201 .. 2706 +# +#define(`PKG_0201', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 20, 10)'); +#define(`PKG_0402', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 40, 20)'); +#define(`PKG_0603', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 60, 30)'); +#define(`PKG_0805', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 80, 50)'); +#define(`PKG_1008', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 100, 80)'); +#define(`PKG_1206', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 120, 60)'); +#define(`PKG_1210', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 120, 100)'); +#define(`PKG_1806', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 180, 60)'); +#define(`PKG_1812', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 180, 120)'); +#define(`PKG_1825', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 180, 250)'); +define(`PKG_2706', `PKG_SMT_2PAD_MIL( `$1', `$2', `$3', 270, 60)'); + +# The following are recommendations from IPC-7351 +# The naming convention, like 'CAPC0603L' follows the IPC standard. At the end +# of each size is a package named like '0603', '1206' which is more or less a compromise part based +# on the nominal IPC footprints for that package size. Any additions to this section +# should follow the IPC naming convention and size. +# +# The base macro accepts the numbers directly (after multiplying by 100) from the IPC +# standard so they are fairly simple to add. + +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: pad X (size of pad in direction perpendicular to axis of part) [1/100 mm] +# $5: pad Y (size of pad in direction parallel to axis of part) [1/100 mm] +# $6: pad center to center spacing [1/100 mm] +# $7: courtyard size in direction parallel to axis of part [1/100 mm] (V1) +# $8: courtyard size in direction perpendicular to axis of part [1/100 mm] (V2) +# $9: length of silk screen line [1/100 mm] (R1) +# $10: spacing of silk screen line [1/100 mm] (R2) + +# 01005 +# See for example Murata GRM02 series. +# package X is 0.2 mm +/- 0.02 mm +# package Y is 0.07 to 0.14 mm +# package inner pad edge to pad edge is 0.13 min +# package outer pad edge to outer pad edge is 0.4 mm +/- 0.02 mm +# package height is 0.2mm +/- 0.02 mm + +# From page 10 of IPC-7351, Feb 2005, +# Zmax = length of pattern = Lmin (overall length of the component) + 2*Jt + sqrt(Cl^2 + F^2 + P^2) +# Gmin = Distance between lands of the pattern = Smax (distance between terminals) - 2*Jh - sqrt(Cs^2 + F^2 + P^2) +# Xmax = Width of pattern = Wmin (width of lead) + 2*Js + sqrt(Cw^2 + F^2 + P^2) +# +# C = component tolerance = *max - *min +# F = PCB tolerance - used 0.05 +# P = placement tolerance - used 0.05 +# +# X = Xmax = 0.18/0.18/0.23 round to get 0.20/0.20/0.25 +# Y = 0.5 * (Zmax - Gmin) +# center to center = 0.5 * (Zmax + Gmin) +# +# +# Jt = 0.00/0.10/0.20 +# Jh = -0.05/-0.05/-0.05 +# Js = 0.00/0.00/0.05 +# Round to nearest 0.05 +# Courtyard excess 0.10/0.15/0.20 +# +# +# Note that rounding to 0.05 mm produces a roundoff error of up to +/- 1 mil. This can be significant +# when we're talking about gaps on the order of 6 mils. So for this really tiny part, round to 0.01 mm +define(`PKG_CAPC0402L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 26, 15, 31, 56, 28, 0, 0)'); +define(`PKG_CAPC0402N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 26, 25, 41, 81, 33, 0, 0)'); +define(`PKG_CAPC0402M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 36, 35, 51, 106, 38, 0, 0)'); + +define(`PKG_INDC0402L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 26, 15, 31, 56, 28, 0, 0)'); +define(`PKG_INDC0402N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 26, 25, 41, 81, 33, 0, 0)'); +define(`PKG_INDC0402M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 36, 35, 51, 106, 38, 0, 0)'); + +define(`PKG_RESC0402L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 26, 15, 31, 56, 28, 0, 0)'); +define(`PKG_RESC0402N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 26, 25, 41, 81, 33, 0, 0)'); +define(`PKG_RESC0402M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 36, 35, 51, 106, 38, 0, 0)'); + +define(`PKG_01005', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 26, 25, 41, 81, 33, 0, 0)'); + +# 0201 +define(`PKG_CAPC0603L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 30, 30, 50, 100, 60, 0, 0)'); +define(`PKG_CAPC0603N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 40, 40, 60, 130, 80, 0, 0)'); +define(`PKG_CAPC0603M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 50, 50, 80, 160, 90, 0, 0)'); + +define(`PKG_RESC0603L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 30, 30, 50, 100, 60, 0, 0)'); +define(`PKG_RESC0603N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 40, 40, 60, 130, 80, 0, 0)'); +define(`PKG_RESC0603M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 50, 50, 80, 160, 90, 0, 0)'); + +define(`PKG_0201', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 40, 40, 60, 130, 80, 0, 0)'); + +# 0402 (C,L = 0.6 mm high, R = 0.4 mm high) +define(`PKG_CAPC1005L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 55, 40, 90, 150, 80, 0, 0)'); +define(`PKG_CAPC1005N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 65, 50, 90, 170, 100, 0, 0)'); +define(`PKG_CAPC1005M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 75, 60, 100, 200, 120, 0, 0)'); + +define(`PKG_INDC1005L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 60, 50, 80, 150, 90, 0, 0)'); +define(`PKG_INDC1005N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 70, 50, 80, 170, 100, 0, 0)'); +define(`PKG_INDC1005M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 80, 70, 100, 200, 120, 0, 0)'); + +define(`PKG_RESC1005L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 55, 35, 90, 150, 80, 0, 0)'); +define(`PKG_RESC1005N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 65, 45, 100, 170, 100, 0, 0)'); +define(`PKG_RESC1005M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 75, 55, 110, 200, 120, 0, 0)'); + +define(`PKG_0402', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 70, 50, 80, 170, 100, 0, 0)'); + +# 0603 (C = 0.85 mm high, L = 0.95 mm high, R = 0.60 mm high) +define(`PKG_CAPC1608L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 90, 65, 120, 200, 120, 0, 0)'); +define(`PKG_CAPC1608N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 100, 75, 130, 230, 130, 0, 0)'); +define(`PKG_CAPC1608M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 110, 85, 140, 270, 150, 0, 0)'); + +define(`PKG_INDC1608L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 90, 65, 120, 200, 120, 0, 0)'); +define(`PKG_INDC1608N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 100, 75, 130, 230, 130, 0, 0)'); +define(`PKG_INDC1608M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 110, 85, 140, 270, 150, 0, 0)'); + +define(`PKG_RESC1608L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 90, 50, 120, 200, 120, 0, 90)'); +define(`PKG_RESC1608N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 100, 60, 140, 230, 130, 0, 0)'); +define(`PKG_RESC1608M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 110, 70, 150, 270, 150, 10, 110)'); + +define(`PKG_0603', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 100, 75, 130, 230, 130, 0, 0)'); + +# 0805 (C = 1.1 mm high, L = 1.2 mm high, R = 0.65 mm high) +define(`PKG_CAPC2012L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 140, 110, 160, 280, 170, 0, 0)'); +define(`PKG_CAPC2012N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 150, 130, 180, 350, 200, 0, 0)'); +define(`PKG_CAPC2012M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 160, 150, 200, 440, 260, 0, 0)'); + +define(`PKG_INDC2012L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 140, 110, 160, 280, 170, 0, 0)'); +define(`PKG_INDC2012N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 150, 130, 180, 350, 200, 0, 0)'); +define(`PKG_INDC2012M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 160, 150, 200, 440, 260, 0, 0)'); + +define(`PKG_RESC2012L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 130, 100, 160, 280, 160, 20, 130)'); +define(`PKG_RESC2012N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 140, 120, 180, 350, 190, 20, 140)'); +define(`PKG_RESC2012M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 150, 140, 200, 440, 250, 20, 150)'); + +define(`PKG_0805', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 150, 130, 180, 350, 200, 20, 140)'); + +# 1008 (L = 2.2 mm high) +define(`PKG_INDC2520L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 220, 90, 240, 340, 250, 80, 220)'); +define(`PKG_INDC2520N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 230, 110, 260, 410, 280, 70, 230)'); +define(`PKG_INDC2520M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 240, 130, 280, 500, 340, 80, 240)'); + +define(`PKG_1008', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 230, 110, 260, 410, 280, 70, 230)'); + +# 1206 (C = 1.35 mm high, L = 1.9 mm high, R = 0.71 mm high) +define(`PKG_CAPC3216L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 170, 110, 280, 400, 200, 90, 170)'); +define(`PKG_CAPC3216N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 180, 130, 300, 470, 230, 100, 180)'); +define(`PKG_CAPC3216M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 190, 150, 320, 560, 290, 100, 190)'); + +define(`PKG_INDC3216L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 180, 100, 300, 420, 210, 120, 180)'); +define(`PKG_INDC3216N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 190, 120, 320, 490, 240, 120, 190)'); +define(`PKG_INDC3216M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 200, 140, 340, 580, 300, 130, 200)'); + +define(`PKG_RESC3216L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 170, 110, 280, 400, 200, 90, 170)'); +define(`PKG_RESC3216N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 180, 130, 300, 470, 230, 100, 180)'); +define(`PKG_RESC3216M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 190, 150, 320, 560, 290, 100, 190)'); + +define(`PKG_1206', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 190, 130, 300, 490, 240, 120, 190)'); + +# 1210 (C = 1.35 mm high, L = 1.35 mm high, R = 0.71 mm high) +define(`PKG_CAPC3225L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 260, 110, 280, 400, 290, 90, 260)'); +define(`PKG_CAPC3225N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 270, 130, 300, 470, 320, 100, 270)'); +define(`PKG_CAPC3225M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 280, 150, 320, 560, 380, 100, 280)'); + +define(`PKG_INDC3225L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 260, 110, 280, 400, 290, 90, 260)'); +define(`PKG_INDC3225N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 270, 130, 300, 470, 320, 100, 270)'); +define(`PKG_INDC3225M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 280, 150, 320, 560, 380, 100, 280)'); + +define(`PKG_RESC3225L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 260, 110, 280, 400, 290, 90, 260)'); +define(`PKG_RESC3225N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 270, 130, 300, 470, 320, 100, 270)'); +define(`PKG_RESC3225M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 280, 150, 320, 560, 380, 100, 280)'); + +define(`PKG_1210', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 270, 130, 300, 470, 320, 100, 270)'); + +# 1806 (L = 1.9 mm high) + +define(`PKG_INDC4509L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 110, 130, 400, 540, 150, 200, 110)'); +define(`PKG_INDC4509N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 120, 150, 420, 610, 170, 190, 120)'); +define(`PKG_INDC4509M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 130, 170, 440, 700, 230, 200, 130)'); + +define(`PKG_1806', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 120, 150, 420, 610, 170, 190, 120)'); + +# 1812 (C = 1.35 mm high, L = 1.75 mm high, R = 1.1 mm high) +define(`PKG_CAPC4532L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 330, 140, 380, 540, 370, 160, 330)'); +define(`PKG_CAPC4532N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 340, 160, 400, 610, 390, 160, 340)'); +define(`PKG_CAPC4532M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 350, 180, 420, 700, 450, 160, 350)'); + +define(`PKG_INDC4532L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 330, 140, 380, 540, 370, 160, 330)'); +define(`PKG_INDC4532N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 340, 160, 400, 610, 390, 160, 340)'); +define(`PKG_INDC4532M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 350, 180, 420, 700, 450, 160, 350)'); + +define(`PKG_RESC4532L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 330, 140, 380, 540, 370, 160, 330)'); +define(`PKG_RESC4532N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 340, 160, 400, 610, 390, 160, 340)'); +define(`PKG_RESC4532M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 350, 180, 420, 700, 450, 160, 350)'); + +define(`PKG_1806', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 340, 160, 400, 610, 390, 160, 340)'); + +# 1825 (C = 1.1 mm high, R = 1.35 mm high) +define(`PKG_CAPC4564L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 670, 140, 380, 540, 700, 160, 670)'); +define(`PKG_CAPC4564N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 680, 160, 400, 610, 730, 160, 680)'); +define(`PKG_CAPC4564M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 690, 180, 420, 700, 790, 160, 690)'); + +define(`PKG_RESC4564L', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 670, 140, 380, 540, 700, 160, 670)'); +define(`PKG_RESC4564N', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 680, 160, 400, 610, 730, 160, 680)'); +define(`PKG_RESC4564M', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 690, 180, 420, 700, 790, 160, 690)'); + +define(`PKG_1825', `PKG_SMT_2PAD_MM100( `$1', `$2', `$3', 680, 160, 400, 610, 730, 160, 680)'); + + + +# +## 3-Pin SMT EMI Filter based on standard SMT sizes +# See www.murata.com for example +# +define(`PKG_EMI0603', `COMMON_SMT_3PAD_MIL( `$1', `$2', `$3', 24, 24, 63, 47, 16, 10, 10)'); +define(`PKG_EMI0805', `COMMON_SMT_3PAD_MIL( `$1', `$2', `$3', 32, 24, 79, 75, 24, 10, 10)'); +define(`PKG_EMI1206', `COMMON_SMT_3PAD_MIL( `$1', `$2', `$3', 32, 28, 126, 79, 39, 10, 10)'); +define(`PKG_EMI1806', `COMMON_SMT_3PAD_MIL( `$1', `$2', `$3', 39, 39, 177, 102, 59, 10, 10)'); + +# +## Tantalum SMT capacitor (pin 1 is +) +# pin 1 is marked (and is presumably +), pin 2 is minus +# EIA3216 .. EIA7343 +# +define(`PKG_EIA3216', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 32, 16)'); +define(`PKG_EIA3528', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 35, 28)'); +define(`PKG_EIA6032', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 60, 32)'); +define(`PKG_EIA7343', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 73, 43)'); + +define(`PKG_TANT_A', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 32, 16)'); +define(`PKG_TANT_B', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 35, 28)'); +define(`PKG_TANT_C', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 60, 32)'); +define(`PKG_TANT_D', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 73, 43)'); + +# +## Surface mount electrolytic capacitor, number is dia in mm +define(`PKG_SME3', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 33, 33)'); +define(`PKG_SME4', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 43, 43)'); +define(`PKG_SME5', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 53, 53)'); +define(`PKG_SME6', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 66, 66)'); +define(`PKG_SME8', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 84, 84)'); +define(`PKG_SME10', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3',104,104)'); + +# +## SMT diode (pin 1 is cathode) +# (pin 2 is anode) +# SOD110 .. +# +# SOD23D is a SOT23 housing with pin numbers that match diodes +# it can also be used for transistors that used this numbering +# dimensions of `PKG_SMT_DIODE( `$1', `$2', `$3', len=mm/10, wid=mm/10)'); #JG +# dimensions of `PKG_SM/EIT_2PAD_EIA( `$1', `$2', `$3', len=mm/10, wid=mm/10)'); #JG +# +define(`PKG_SOD80', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 37, 16)'); +define(`PKG_SOD87', `PKG_SMT_2PAD_EIA( `$1', `$2', `$3', 37, 21)'); +define(`PKG_SOD106A', `PKG_SMT_DIODE( `$1', `$2', `$3', 55, 25)'); +define(`PKG_SOD110', `PKG_SMT_DIODE( `$1', `$2', `$3', 21, 14)'); +# BUG: pads are only 0.65 mm wide: +define(`PKG_SOD123', `PKG_SMT_DIODE( `$1', `$2', `$3', 40, 15)'); +# BUG: pads are only 0.60 mm wide: +define(`PKG_SOD323', `PKG_SMT_DIODE( `$1', `$2', `$3', 27, 13)'); +define(`PKG_DO214', `PKG_SMT_DIODE( `$1', `$2', `$3', 77, 33)'); #JG +define(`PKG_DO214AB', `PKG_SMT_DIODE( `$1', `$2', `$3', 79, 34)'); #JG +define(`PKG_SOT23D', `PKG_SMT_TRANSISTOR2( `$1', `$2', `$3', 20, 21)'); +define(`PKG_SOT323D', `PKG_SMT_TRANSISTOR2( `$1', `$2', `$3', 13, 18)'); + +# +## SMT transistor, 3 pins +define(`PKG_SOT23', `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 20, 21)'); +define(`PKG_SOT323', `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 13, 18)'); +define(`PKG_SC90', `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 10, 15)'); +define(`PKG_SC70_3', `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 13, 18)'); + +## SMT transistor, 4 pins +define(`PKG_SOT89', `PKG_SMT_TRANSISTOR4X(`$1', `$2', `$3', 31, 31)'); +define(`PKG_SOT143', `PKG_SMT_TRANSISTOR4( `$1', `$2', `$3', 19, 21)'); +define(`PKG_SOT223', `PKG_SMT_TRANSISTOR4X(`$1', `$2', `$3', 46, 62)'); +define(`PKG_SC70_4', `PKG_SMT_TRANSISTOR4( `$1', `$2', `$3', 13, 18)'); + +## SMT transistor, 5 pins +# aka SOT23-5 +define(`PKG_SOT25', `PKG_SMT_TRANSISTOR5( `$1', `$2', `$3', 20, 21)'); +define(`PKG_SOT325', `PKG_SMT_TRANSISTOR5( `$1', `$2', `$3', 13, 18)'); +define(`PKG_SC70_5', `PKG_SMT_TRANSISTOR5A(`$1', `$2', `$3', 13, 18)'); + +## SMT transistor, 6 pins +# aka SOT23-6 +define(`PKG_SOT26', `PKG_SMT_TRANSISTOR6( `$1', `$2', `$3', 20, 21)'); +define(`PKG_SOT326', `PKG_SMT_TRANSISTOR6( `$1', `$2', `$3', 13, 18)'); +define(`PKG_SC70_6', `PKG_SMT_TRANSISTOR6( `$1', `$2', `$3', 13, 18)'); + +## Pressure transducer +define(`PKG_MPAK', `COMMON_SMT_TRANSISTORX_MIL(`$1', `$2', `$3', 150, 437, 20, `12345')'); + Index: tags/1.0.5/old/oldlib/lib/gen_geda_list.awk =================================================================== --- tags/1.0.5/old/oldlib/lib/gen_geda_list.awk (nonexistent) +++ tags/1.0.5/old/oldlib/lib/gen_geda_list.awk (revision 953) @@ -0,0 +1,32 @@ +#!/usr/bin/awk -f +# +# $Id$ +# +# Script to regenerate geda.list from geda.inc +# +# Usage: +# +# awk -f gen_geda_list.awk geda.inc > geda.list +# + +BEGIN { + printf("#\n"); + printf("# NOTE: Auto-generated. Do not change.\n"); + printf("#"); +} + +/^\#\#/ { + printf("#\n"); + next; +} + + +/^[ \t]*define/ { + pkg = $1; + ind = index(pkg, "PKG"); + pkg = substr(pkg, ind+4); + ind = index(pkg, "'"); + pkg = substr(pkg, 1, ind-1); + printf("geda_%s:%s:%s\n", pkg, pkg, pkg); +} + Property changes on: tags/1.0.5/old/oldlib/lib/gen_geda_list.awk ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/gen_geda_m4.awk =================================================================== --- tags/1.0.5/old/oldlib/lib/gen_geda_m4.awk (nonexistent) +++ tags/1.0.5/old/oldlib/lib/gen_geda_m4.awk (revision 953) @@ -0,0 +1,40 @@ +#!/usr/bin/awk -f +# +# $Id$ +# +# Script to regenerate geda.m4 from geda.inc +# +# Usage: +# +# awk -f gen_geda_m4.awk geda.inc > geda.m4 +# + +BEGIN { + printf("divert(-1)\n"); + printf("#\n"); + printf("# NOTE: Auto-generated. Do not change.\n"); + printf("#"); +} + +/^\#\#/ { + descr = $0; + ind = index(descr, $2); + descr = substr(descr, ind); + printf("#\n"); + next; +} + + +/^[ \t]*define/ { + pkg = $1; + ind = index(pkg, "PKG"); + pkg = substr(pkg, ind+4); + ind = index(pkg, "'"); + pkg = substr(pkg, 1, ind-1); + printf("define(`Description_geda_%s',\t``%s'')\n", pkg, descr); +} + +END { + printf("divert(0)dnl\n"); +} + Property changes on: tags/1.0.5/old/oldlib/lib/gen_geda_m4.awk ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/gen_list.awk =================================================================== --- tags/1.0.5/old/oldlib/lib/gen_list.awk (nonexistent) +++ tags/1.0.5/old/oldlib/lib/gen_list.awk (revision 953) @@ -0,0 +1,64 @@ +#!/usr/bin/awk -f +# +# $Id$ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003 Dan McMahill +# +# 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. +# +# Script to regenerate geda.list from geda.inc +# +# Usage: +# +# awk -f gen_list.awk name=foo foo.inc > foo.list +# + +BEGIN { + printf("#\n"); + printf("# NOTE: Auto-generated. Do not change.\n"); + printf("#"); + do_process = 0; +} + +/^\#[ \t]*EXTRACT_BEGIN/ { + do_process = 1; +} + +/^\#[ \t]*EXTRACT_END/ { + do_process = 0; +} + +do_process == 0 { + next; +} + +/^\#\#/ { + printf("#\n"); + next; +} + + +/^[ \t]*define/ { + pkg = $1; + ind = index(pkg, "PKG"); + pkg = substr(pkg, ind+4); + ind = index(pkg, "'"); + pkg = substr(pkg, 1, ind-1); + printf("%s_%s:%s:%s\n", name, pkg, pkg, pkg); +} + Property changes on: tags/1.0.5/old/oldlib/lib/gen_list.awk ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/gen_m4.awk =================================================================== --- tags/1.0.5/old/oldlib/lib/gen_m4.awk (nonexistent) +++ tags/1.0.5/old/oldlib/lib/gen_m4.awk (revision 953) @@ -0,0 +1,72 @@ +#!/usr/bin/awk -f +# +# $Id$ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003 Dan McMahill +# +# 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. +# +# Script to regenerate *.m4 from *.inc +# +# Usage: +# +# awk -f gen_m4.awk name=foo foo.inc > foo.m4 +# + +BEGIN { + printf("divert(-1)\n"); + printf("#\n"); + printf("# NOTE: Auto-generated. Do not change.\n"); + printf("#"); + do_process = 0; +} + +/^\#[ \t]*EXTRACT_BEGIN/ { + do_process = 1; +} + +/^\#[ \t]*EXTRACT_END/ { + do_process = 0; +} + +do_process == 0 { + next; +} + +/^\#\#/ { + descr = $0; + ind = index(descr, $2); + descr = substr(descr, ind); + printf("#\n"); + next; +} + + +/^[ \t]*define/ { + pkg = $1; + ind = index(pkg, "PKG"); + pkg = substr(pkg, ind+4); + ind = index(pkg, "'"); + pkg = substr(pkg, 1, ind-1); + printf("define(`Description_%s_%s',\t``%s'')\n", name, pkg, descr); +} + +END { + printf("divert(0)dnl\n"); +} + Property changes on: tags/1.0.5/old/oldlib/lib/gen_m4.awk ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/generic.list =================================================================== --- tags/1.0.5/old/oldlib/lib/generic.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/generic.list (revision 953) @@ -0,0 +1,155 @@ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# mask package values... +# +generic8_dil:DIL:DIL 8 +generic8_dil:N:DIL 8 +generic8smd_dil:D:SMD 8 +generic14_dil:DIL:DIL 14 +generic14_dil:N:DIL 14 +generic14smd_dil:D:SMD 14 +generic16_dil:DIL:DIL 16 +generic16_dil:N:DIL 16 +generic16smd_dil:D:SMD 16 +generic18_dil:DIL:DIL 18 +generic18_dil:N:DIL 18 +generic18smd_dil:D:SMD 18 +generic20_dil:DIL:DIL 20 +generic20_dil:N:DIL 20 +generic20smd_dil:D:SMD 20 +generic24_dil:DIL:DIL 24 +generic24_dil:N:DIL 24 +generic24smd_dil:D:SMD 24 +generic24w_dil:DIL:W-DIL 24 +generic24w_dil:N:W-DIL 24 +generic24smdw_dil:DW:SMD-W 24 +generic28_dil:DIL:DIL 28 +generic28_dil:N:DIL 28 +generic28smd_dil:D:SMD 28 +generic28w_dil:DIL:W-DIL 28 +generic28w_dil:N:W-DIL 28 +generic28smdw_dil:DW:SMD-W 28 +generic32_dil:DIL:DIL 32 +generic32_dil:N:DIL 32 +generic40_dil:DIL:DIL 40 +generic40_dil:N:DIL 40 +generic64_dil:DIL:DIL 64 +generic64_dil:N:DIL 64 +generic44_plcc:PLCC:PLCC 44 +generic44_plcc:PLCC_SOCKET:PLCC 44 socket +generic52_plcc:PLCC:PLCC 52 +generic52_plcc:PLCC_SOCKET:PLCC 52 socket +generic68_plcc:PLCC:PLCC 68 +generic68_plcc:PLCC_SOCKET:PLCC 68 socket +generic84_plcc:PLCC:PLCC 84 +generic84_plcc:PLCC_SOCKET:PLCC 84 socket + +generic44_qfp:QFP:QFP 44 +generic44_qfp:OLD_QFP:QFP 44 OLD +generic208_lqfp:208_LQFP:QFP 208 +menu_qfp:MENU_QFP:QFP menu +generic80_qfp:QFP2:QFP 80 +generic16_zif:ZIF:ZIF 16 +generic20_zif:ZIF:ZIF 20 + +generic20_zip:SD:ZIP 20 +generic24_zip:SD:ZIP 24 +generic28_zip:SD:ZIP 28 +generic40_zip:SD:ZIP 40 + +generic_diode_300:DIODE_LAY:300 +generic_diode_400:DIODE_LAY:400 +generic_diode_500:DIODE_LAY:500 +generic_diode_600:DIODE_LAY:600 +generic_diode_800:DIODE_LAY:800 + +# +oscillator_1:OSC:1 MHz OSC +oscillator_2:OSC:2 MHz OSC +oscillator_4:OSC:4 MHz OSC +oscillator_5:OSC:5 MHz OSC +oscillator_8:OSC:8 MHz OSC +oscillator_10:OSC:10 MHz OSC +oscillator_12:OSC:12 MHz OSC +oscillator_16:OSC:16 MHz OSC +oscillator_20:OSC:20 MHz OSC +oscillator_24:OSC:24 MHz OSC +oscillator_32:OSC:32 MHz OSC + +ovenized_oscillator_5:OVEN_OSC:5 MHz OSC + +r_025:R025:0.25W Resistor (300 mil) +generic_resistor_axial_300:AXIAL_LAY:300 +generic_resistor_axial_400:AXIAL_LAY:400 +generic_resistor_axial_500:AXIAL_LAY:500 +generic_resistor_axial_600:AXIAL_LAY:600 +generic_resistor_axial_800:AXIAL_LAY:800 + +generic_capacitor_axial_300:AXIAL_LAY:300 +generic_capacitor_axial_400:AXIAL_LAY:400 +generic_capacitor_axial_500:AXIAL_LAY:500 +generic_capacitor_axial_600:AXIAL_LAY:600 +generic_capacitor_axial_800:AXIAL_LAY:800 + +generic_capacitor_radial_200:RADIAL_CAN:200 +generic_capacitor_radial_300:RADIAL_CAN:300 +generic_capacitor_radial_400:RADIAL_CAN:400 +generic_capacitor_radial_500:RADIAL_CAN:500 +generic_capacitor_radial_600:RADIAL_CAN:600 + +generic_smd_chip_402:SMD_CHIP:Resistor:Capacitor +generic_smd_chip_603:SMD_CHIP:Resistor:Capacitor +generic_smd_chip_805:SMD_CHIP:Resistor:Capacitor +generic_smd_chip_1206:SMD_CHIP:Resistor:Capacitor +generic_smd_chip_1210:SMD_CHIP:Resistor:Capacitor + +smd_resistor_603:SMD_SIMPLE:603 +smd_resistor_805:SMD_SIMPLE:805 +smd_resistor_1206:SMD_SIMPLE:1206 + +smd_capacitor_603:SMD_SIMPLE:603 +smd_capacitor_805:SMD_SIMPLE:805 +smd_capacitor_1206:SMD_SIMPLE:1206 + +smd_capacitor_polarized_603:SMD_POLAR:603 +smd_capacitor_polarized_805:SMD_POLAR:805 +smd_capacitor_polarized_1206:SMD_POLAR:1206 + +smd_EIA_A_capacitor:SMD_POLAR:EIA A +smd_EIA_B_capacitor:SMD_POLAR:EIA B +smd_EIA_C_capacitor:SMD_POLAR:EIA C +smd_EIA_D_capacitor:SMD_POLAR:EIA D + +smd_diode_603:SMD_DIODE:603 +smd_diode_805:SMD_DIODE:805 +smd_diode_1206:SMD_DIODE:1206 + +isa_eight_bit:ISA8:XT8BIT + +sot_23:SOT23:SOT-23 +sot_323:SOT323:SOT-323 +sot_nec19:NEC19:SOT-NE19 Property changes on: tags/1.0.5/old/oldlib/lib/generic.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/generic.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/generic.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/generic.m4 (revision 953) @@ -0,0 +1,469 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +define(`Description_generic8_dil', ``generic'') +define(`Param1_generic8_dil', 8) +define(`Param2_generic8_dil', 300) + +define(`Description_generic8smd_dil', ``generic'') +define(`Param1_generic8smd_dil', 8) + +define(`Description_generic14_dil', ``generic'') +define(`Param1_generic14_dil', 14) +define(`Param2_generic14_dil', 300) + +define(`Description_generic14smd_dil', ``generic'') +define(`Param1_generic14smd_dil', 14) + +define(`Description_generic16_dil', ``generic'') +define(`Param1_generic16_dil', 16) +define(`Param2_generic16_dil', 300) + +define(`Description_generic16smd_dil', ``generic'') +define(`Param1_generic16smd_dil', 16) + +define(`Description_generic18_dil', ``generic'') +define(`Param1_generic18_dil', 18) +define(`Param2_generic18_dil', 300) + +define(`Description_generic18smd_dil', ``generic'') +define(`Param1_generic18smd_dil', 18) + +define(`Description_generic20_dil', ``generic'') +define(`Param1_generic20_dil', 20) +define(`Param2_generic20_dil', 300) + +define(`Description_generic20smd_dil', ``generic'') +define(`Param1_generic20smd_dil', 20) + +define(`Description_generic24_dil', ``generic'') +define(`Param1_generic24_dil', 24) +define(`Param2_generic24_dil', 300) + +define(`Description_generic24smd_dil', ``generic'') +define(`Param1_generic24smd_dil', 24) + +define(`Description_generic24w_dil', ``generic'') +define(`Param1_generic24w_dil', 24) +define(`Param2_generic24w_dil', 600) + +define(`Description_generic24smdw_dil', ``generic'') +define(`Param1_generic24smdw_dil', 24) + +define(`Description_generic28_dil', ``generic'') +define(`Param1_generic28_dil', 28) +define(`Param2_generic28_dil', 300) + +define(`Description_generic28smd_dil', ``generic'') +define(`Param1_generic28smd_dil', 28) + +define(`Description_generic28w_dil', ``generic'') +define(`Param1_generic28w_dil', 28) +define(`Param2_generic28w_dil', 600) + +define(`Description_generic28smdw_dil', ``generic'') +define(`Param1_generic28smdw_dil', 28) + +define(`Description_generic32_dil', ``generic'') +define(`Param1_generic32_dil', 32) +define(`Param2_generic32_dil', 600) + +define(`Description_generic40_dil', ``generic'') +define(`Param1_generic40_dil', 40) +define(`Param2_generic40_dil', 600) + +define(`Description_generic64_dil', ``generic'') +define(`Param1_generic64_dil', 64) +define(`Param2_generic64_dil', 900) + +define(`Description_generic44_plcc', ``generic'') +define(`Param1_generic44_plcc', 44) +define(`Param2_generic44_plcc', 150) + +define(`Description_generic52_plcc', ``generic'') +define(`Param1_generic52_plcc', 52) +define(`Param2_generic52_plcc', 150) + +define(`Description_generic68_plcc', ``generic'') +define(`Param1_generic68_plcc', 68) +define(`Param2_generic68_plcc', 150) + +define(`Description_generic84_plcc', ``generic'') +define(`Param1_generic84_plcc', 84) +define(`Param2_generic84_plcc', 150) + +define(`Description_generic44_qfp', ``generic'') +define(`Param1_generic44_qfp', 44) +define(`Param2_generic44_qfp', 150) + +define(`Description_generic80_qfp', ``generic'') +define(`Param1_generic80_qfp', 80) +define(`Param2_generic80_qfp', 150) + +define(`Description_generic208_lqfp', ``generic'') + +define(`Description_menu_qfp', ``generic'') + +define(`Description_generic16_zif', ``generic'') +define(`Param1_generic16_zif', 16) + +define(`Description_generic20_zif', ``generic'') +define(`Param1_generic20_zif', 20) + +define(`Description_generic208_lqfp', ``generic'') + +define(`Description_menu_qfp', ``generic'') + +define(`Description_generic208_lqfp', ``generic'') + +define(`Description_menu_qfp', ``generic'') + +define(`Description_generic20_zip', ``generic'') +define(`Param1_generic20_zip', 20) + +define(`Description_generic24_zip', ``generic'') +define(`Param1_generic24_zip', 24) + +define(`Description_generic28_zip', ``generic'') +define(`Param1_generic28_zip', 28) + +define(`Description_generic40_zip', ``generic'') +define(`Param1_generic40_zip', 40) + +define(`Description_generic_diode_300', ``diode'') +define(`Param1_generic_diode_300', 300) + +define(`Description_generic_diode_400', ``diode'') +define(`Param1_generic_diode_400', 400) + +define(`Description_generic_diode_500', ``diode'') +define(`Param1_generic_diode_500', 500) + +define(`Description_generic_diode_600', ``diode'') +define(`Param1_generic_diode_600', 600) + +define(`Description_generic_diode_800', ``diode'') +define(`Param1_generic_diode_800', 800) + +define(`Description_oscillator_1', ``oscillator'') +define(`Param1_oscillator_1', 1) + +define(`Description_oscillator_2', ``oscillator'') +define(`Param1_oscillator_2', 2) + +define(`Description_oscillator_4', ``oscillator'') +define(`Param1_oscillator_4', 4) + +define(`Description_oscillator_5', ``oscillator'') +define(`Param1_oscillator_5', 5) + +define(`Description_oscillator_8', ``oscillator'') +define(`Param1_oscillator_8', 8) + +define(`Description_oscillator_10', ``oscillator'') +define(`Param1_oscillator_10', 10) + +define(`Description_oscillator_12', ``oscillator'') +define(`Param1_oscillator_12', 12) + +define(`Description_oscillator_16', ``oscillator'') +define(`Param1_oscillator_16', 16) + +define(`Description_oscillator_20', ``oscillator'') +define(`Param1_oscillator_20', 20) + +define(`Description_oscillator_24', ``oscillator'') +define(`Param1_oscillator_24', 24) + +define(`Description_oscillator_32', ``oscillator'') +define(`Param1_oscillator_32', 32) + +define(`Description_ovenized_oscillator_5', ``ovenized'') +define(`Param1_ovenized_oscillator_5', 5) + +define(`Description_generic_resistor_axial_300', ``resistor_axial'') +define(`Param1_generic_resistor_axial_300', 300) + +define(`Description_generic_resistor_axial_400', ``resistor_axial'') +define(`Param1_generic_resistor_axial_400', 400) + +define(`Description_generic_resistor_axial_500', ``resistor_axial'') +define(`Param1_generic_resistor_axial_500', 500) + +define(`Description_generic_resistor_axial_600', ``resistor_axial'') +define(`Param1_generic_resistor_axial_600', 600) + +define(`Description_generic_resistor_axial_800', ``resistor_axial'') +define(`Param1_generic_resistor_axial_800', 800) + +define(`Description_generic_capacitor_axial_300', ``capacitor_axial'') +define(`Param1_generic_capacitor_axial_300', 300) + +define(`Description_generic_capacitor_axial_400', ``capacitor_axial'') +define(`Param1_generic_capacitor_axial_400', 400) + +define(`Description_generic_capacitor_axial_500', ``capacitor_axial'') +define(`Param1_generic_capacitor_axial_500', 500) + +define(`Description_generic_capacitor_axial_600', ``capacitor_axial'') +define(`Param1_generic_capacitor_axial_600', 600) + +define(`Description_generic_capacitor_axial_800', ``capacitor_axial'') +define(`Param1_generic_capacitor_axial_800', 800) + +define(`Description_generic_capacitor_radial_200', ``capacitor_radial'') +define(`Param1_generic_capacitor_radial_200', 200) + +define(`Description_generic_capacitor_radial_300', ``capacitor_radial'') +define(`Param1_generic_capacitor_radial_300', 300) + +define(`Description_generic_capacitor_radial_400', ``capacitor_radial'') +define(`Param1_generic_capacitor_radial_400', 400) + +define(`Description_generic_capacitor_radial_500', ``capacitor_radial'') +define(`Param1_generic_capacitor_radial_500', 500) + +define(`Description_generic_capacitor_radial_600', ``capacitor_radial'') +define(`Param1_generic_capacitor_radial_600', 600) + +define(`Description_generic_smd_chip_402', `smd chip 402') +define(`Param1_generic_smd_chip_402', 402) + +define(`Description_generic_smd_chip_603', `smd chip 603') +define(`Param1_generic_smd_chip_603', 603) + +define(`Description_generic_smd_chip_805', `smd chip 805') +define(`Param1_generic_smd_chip_805', 805) + +define(`Description_generic_smd_chip_1206', `smd chip 1206') +define(`Param1_generic_smd_chip_1206', 1206) + +define(`Description_generic_smd_chip_1210', `smd chip 1210') +define(`Param1_generic_smd_chip_1210', 1210) + +define(`Description_isa_eight_bit', ``isa_eight_bit'') + +define(`Description_smd_resistor_603', ``chip_resistor'') +define(`Param1_smd_resistor_603', 60) +define(`Param2_smd_resistor_603', 30) + +define(`Description_smd_resistor_805', ``chip_resistor'') +define(`Param1_smd_resistor_805', 80) +define(`Param2_smd_resistor_805', 50) + +define(`Description_smd_resistor_1206', ``chip_resistor'') +define(`Param1_smd_resistor_1206', 120) +define(`Param2_smd_resistor_1206', 60) + +define(`Description_smd_capacitor_603', ``chip_capacitor'') +define(`Param1_smd_capacitor_603', 60) +define(`Param2_smd_capacitor_603', 30) + +define(`Description_smd_capacitor_805', ``chip_capacitor'') +define(`Param1_smd_capacitor_805', 80) +define(`Param2_smd_capacitor_805', 50) + +define(`Description_smd_capacitor_1206', ``chip_capacitor'') +define(`Param1_smd_capacitor_1206', 120) +define(`Param2_smd_capacitor_1206', 60) + +define(`Description_smd_capacitor_polarized_603', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_603', 60) +define(`Param2_smd_capacitor_polarized_603', 30) + +define(`Description_smd_capacitor_polarized_805', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_805', 80) +define(`Param2_smd_capacitor_polarized_805', 50) + +define(`Description_smd_capacitor_polarized_1206', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_1206', 120) +define(`Param2_smd_capacitor_polarized_1206', 60) + +define(`Description_smd_EIA_A_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_A_capacitor', 120) +define(`Param2_smd_EIA_A_capacitor', 50) + +define(`Description_smd_EIA_B_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_B_capacitor', 140) +define(`Param2_smd_EIA_B_capacitor', 90) + +define(`Description_smd_EIA_C_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_C_capacitor', 240) +define(`Param2_smd_EIA_C_capacitor', 90) + +define(`Description_smd_EIA_D_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_D_capacitor', 280) +define(`Param2_smd_EIA_D_capacitor', 100) + +define(`Description_smd_diode_603', ``chip_diode'') +define(`Param1_smd_diode_603', 60) +define(`Param2_smd_diode_603', 30) + +define(`Description_smd_diode_805', ``chip_diode'') +define(`Param1_smd_diode_805', 80) +define(`Param2_smd_diode_805', 50) + +define(`Description_smd_diode_1206', ``chip_diode'') +define(`Param1_smd_diode_1206', 120) +define(`Param2_smd_diode_1206', 60) + +define(`Description_smd_resistor_603', ``chip_resistor'') +define(`Param1_smd_resistor_603', 60) +define(`Param2_smd_resistor_603', 30) + +define(`Description_smd_resistor_805', ``chip_resistor'') +define(`Param1_smd_resistor_805', 80) +define(`Param2_smd_resistor_805', 50) + +define(`Description_smd_resistor_1206', ``chip_resistor'') +define(`Param1_smd_resistor_1206', 120) +define(`Param2_smd_resistor_1206', 60) + +define(`Description_smd_capacitor_603', ``chip_capacitor'') +define(`Param1_smd_capacitor_603', 60) +define(`Param2_smd_capacitor_603', 30) + +define(`Description_smd_capacitor_805', ``chip_capacitor'') +define(`Param1_smd_capacitor_805', 80) +define(`Param2_smd_capacitor_805', 50) + +define(`Description_smd_capacitor_1206', ``chip_capacitor'') +define(`Param1_smd_capacitor_1206', 120) +define(`Param2_smd_capacitor_1206', 60) + +define(`Description_smd_capacitor_polarized_603', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_603', 60) +define(`Param2_smd_capacitor_polarized_603', 30) + +define(`Description_smd_capacitor_polarized_805', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_805', 80) +define(`Param2_smd_capacitor_polarized_805', 50) + +define(`Description_smd_capacitor_polarized_1206', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_1206', 120) +define(`Param2_smd_capacitor_polarized_1206', 60) + +define(`Description_smd_EIA_A_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_A_capacitor', 120) +define(`Param2_smd_EIA_A_capacitor', 50) + +define(`Description_smd_EIA_B_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_B_capacitor', 140) +define(`Param2_smd_EIA_B_capacitor', 90) + +define(`Description_smd_EIA_C_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_C_capacitor', 240) +define(`Param2_smd_EIA_C_capacitor', 90) + +define(`Description_smd_EIA_D_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_D_capacitor', 280) +define(`Param2_smd_EIA_D_capacitor', 100) + +define(`Description_smd_diode_603', ``chip_diode'') +define(`Param1_smd_diode_603', 60) +define(`Param2_smd_diode_603', 30) + +define(`Description_smd_diode_805', ``chip_diode'') +define(`Param1_smd_diode_805', 80) +define(`Param2_smd_diode_805', 50) + +define(`Description_smd_diode_1206', ``chip_diode'') +define(`Param1_smd_diode_1206', 120) +define(`Param2_smd_diode_1206', 60) + +define(`Description_smd_resistor_603', ``chip_resistor'') +define(`Param1_smd_resistor_603', 60) +define(`Param2_smd_resistor_603', 30) + +define(`Description_smd_resistor_805', ``chip_resistor'') +define(`Param1_smd_resistor_805', 80) +define(`Param2_smd_resistor_805', 50) + +define(`Description_smd_resistor_1206', ``chip_resistor'') +define(`Param1_smd_resistor_1206', 120) +define(`Param2_smd_resistor_1206', 60) + +define(`Description_smd_capacitor_603', ``chip_capacitor'') +define(`Param1_smd_capacitor_603', 60) +define(`Param2_smd_capacitor_603', 30) + +define(`Description_smd_capacitor_805', ``chip_capacitor'') +define(`Param1_smd_capacitor_805', 80) +define(`Param2_smd_capacitor_805', 50) + +define(`Description_smd_capacitor_1206', ``chip_capacitor'') +define(`Param1_smd_capacitor_1206', 120) +define(`Param2_smd_capacitor_1206', 60) + +define(`Description_smd_capacitor_polarized_603', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_603', 60) +define(`Param2_smd_capacitor_polarized_603', 30) + +define(`Description_smd_capacitor_polarized_805', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_805', 80) +define(`Param2_smd_capacitor_polarized_805', 50) + +define(`Description_smd_capacitor_polarized_1206', ``chip_capacitor_polarized'') +define(`Param1_smd_capacitor_polarized_1206', 120) +define(`Param2_smd_capacitor_polarized_1206', 60) + +define(`Description_smd_EIA_A_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_A_capacitor', 120) +define(`Param2_smd_EIA_A_capacitor', 50) + +define(`Description_smd_EIA_B_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_B_capacitor', 140) +define(`Param2_smd_EIA_B_capacitor', 90) + +define(`Description_smd_EIA_C_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_C_capacitor', 240) +define(`Param2_smd_EIA_C_capacitor', 90) + +define(`Description_smd_EIA_D_capacitor', ``chip_capacitor_polarized'') +define(`Param1_smd_EIA_D_capacitor', 280) +define(`Param2_smd_EIA_D_capacitor', 100) + +define(`Description_smd_diode_603', ``chip_diode'') +define(`Param1_smd_diode_603', 60) +define(`Param2_smd_diode_603', 30) + +define(`Description_smd_diode_805', ``chip_diode'') +define(`Param1_smd_diode_805', 80) +define(`Param2_smd_diode_805', 50) + +define(`Description_smd_diode_1206', ``chip_diode'') +define(`Param1_smd_diode_1206', 120) +define(`Param2_smd_diode_1206', 60) + +define(`Description_sot_23', ``SOT-23 package'') +define(`Description_sot_323', ``SOT-323 package'') +define(`Description_sot_nec19', ``NEC SOT-NE19 package'') + +define(`Description_crystal_300', `crystal 300mil') +define(`Param1_crystal_300', 300) + +divert(0) Property changes on: tags/1.0.5/old/oldlib/lib/generic.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/gtag.list =================================================================== --- tags/1.0.5/old/oldlib/lib/gtag.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/gtag.list (revision 953) @@ -0,0 +1,5 @@ +cy7c64603_qfp:PQFP52_10X10:cy7c64603 +conn_usb:CONN_USB:conn_usb +conn_jtag:CONN_JTAG:conn_jtag +sm0805:SM0805:sm0805 +sm1206:SM1206:sm1206 Index: tags/1.0.5/old/oldlib/lib/gtag.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/gtag.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/gtag.m4 (revision 953) @@ -0,0 +1,147 @@ +divert(-1) +# +# gTag components +# +define(`PKG_PQFP52_10X10', +`Element(0x00 "$1" "`$2'" "$3" 250 200 0 150 0x00) +( + Pad(0 129 80 129 16 "1" 0x00000101) + Pad(0 155 80 155 16 "2" 0x00000001) + Pad(0 180 80 180 16 "3" 0x00000001) + Pad(0 206 80 206 16 "4" 0x00000001) + Pad(0 232 80 232 16 "5" 0x00000001) + Pad(0 257 80 257 16 "6" 0x00000001) + Pad(0 283 80 283 16 "7" 0x00000001) + Pad(0 308 80 308 16 "8" 0x00000001) + Pad(0 334 80 334 16 "9" 0x00000001) + Pad(0 359 80 359 16 "10" 0x00000001) + Pad(0 385 80 385 16 "11" 0x00000001) + Pad(0 411 80 411 16 "12" 0x00000001) + Pad(0 436 80 436 16 "13" 0x00000001) + + Pad(129 565 129 485 16 "14" 0x00000001) + Pad(155 565 155 485 16 "15" 0x00000001) + Pad(180 565 180 485 16 "16" 0x00000001) + Pad(206 565 206 485 16 "17" 0x00000001) + Pad(232 565 232 485 16 "18" 0x00000001) + Pad(257 565 257 485 16 "19" 0x00000001) + Pad(283 565 283 485 16 "20" 0x00000001) + Pad(308 565 308 485 16 "21" 0x00000001) + Pad(334 565 334 485 16 "22" 0x00000001) + Pad(359 565 359 485 16 "23" 0x00000001) + Pad(385 565 385 485 16 "24" 0x00000001) + Pad(411 565 411 485 16 "25" 0x00000001) + Pad(436 565 436 485 16 "26" 0x00000001) + + Pad(485 436 565 436 16 "27" 0x00000001) + Pad(485 411 565 411 16 "28" 0x00000001) + Pad(485 385 565 385 16 "29" 0x00000001) + Pad(485 359 565 359 16 "30" 0x00000001) + Pad(485 334 565 334 16 "31" 0x00000001) + Pad(485 308 565 308 16 "32" 0x00000001) + Pad(485 283 565 283 16 "33" 0x00000001) + Pad(485 257 565 257 16 "34" 0x00000001) + Pad(485 232 565 232 16 "35" 0x00000001) + Pad(485 206 565 206 16 "36" 0x00000001) + Pad(485 180 565 180 16 "37" 0x00000001) + Pad(485 155 565 155 16 "38" 0x00000001) + Pad(485 129 565 129 16 "39" 0x00000001) + + Pad(436 0 436 80 16 "40" 0x00000001) + Pad(411 0 411 80 16 "41" 0x00000001) + Pad(385 0 385 80 16 "42" 0x00000001) + Pad(359 0 359 80 16 "43" 0x00000001) + Pad(334 0 334 80 16 "44" 0x00000001) + Pad(308 0 308 80 16 "45" 0x00000001) + Pad(283 0 283 80 16 "46" 0x00000001) + Pad(257 0 257 80 16 "47" 0x00000001) + Pad(232 0 232 80 16 "48" 0x00000001) + Pad(206 0 206 80 16 "49" 0x00000001) + Pad(180 0 180 80 16 "50" 0x00000001) + Pad(155 0 155 80 16 "51" 0x00000001) + Pad(129 0 129 80 16 "52" 0x00000001) + + ElementLine( 135 129 436 129 20) + ElementLine( 129 135 129 436 20) + ElementLine( 129 436 436 436 20) + ElementLine( 436 436 436 129 20) + ElementLine( 129 135 135 129 20) + + Mark(0 0) +)') + +define(`Description_cy7c64603_qfp', ``USB Microcontroller'') +define(`Param1_cy7c64603_qfp', 52) +define(`PinList_cy7c64603_qfp', ``1',`2',`3',`4',`5',`6',`7',`8',`9',`10',`11',`12',`13',`14',`15',`16',`17',`18',`19',`20',`21',`22',`23',`24',`25',`26',`27',`28',`29',`30',`31',`32',`33',`34',`35',`36',`37',`38',`39',`40',`41',`42',`43',`44',`45',`46',`47',`48',`49',`50',`51',`52'') + +define(`PKG_CONN_USB', +`Element(0x00 "$1" "`$2'" "$3" 4140 2050 0 100 0x00) +( + Pin(4140 2050 60 28 "1" "1" 0x00000101) + Pin(4040 2050 60 28 "2" "2" 0x00000001) + Pin(4040 2130 60 28 "3" "3" 0x00000001) + Pin(4140 2130 60 28 "4" "4" 0x00000001) + Pin(3850 2240 90 90 "" "5" 0x00000009) + Pin(4330 2240 90 90 "" "6" 0x00000009) + + ElementLine( 3850 1900 4330 1900 20) + ElementLine( 3850 1900 3850 2150 20) + ElementLine( 4330 1900 4330 2150 20) + + Mark (4140 2050) +)') + +define(`Description_conn_usb',``USB Male Connector'') +define(`PinList_conn_usb', ``1', `2', `3', `4'') + +define(`PKG_SM0805', +`Element(0x00 "$1" "`$2'" "$3" 0 100 0 100 0x00) +( + Pad(100 100 100 100 50 "1" 0x00000100) + Pad(100 180 100 180 50 "2" 0x00000100) + + Mark(100 100) +)') + +define(`PKG_SM1206', +`Element(0x00 "$1" "`$2'" "$3" 0 100 0 100 0x00) +( + Pad(100 100 100 100 60 "1" 0x00000100) + Pad(100 230 100 230 60 "2" 0x00000100) + + Mark(100 100) +)') + +define(`Description_sm0805',``SMT 0805'') +define(`PinList_sm0805', ``1', `2'') + +define(`Description_sm1206',``SMT 1206'') +define(`PinList_sm1206', ``1', `2'') + + +define(`PKG_CONN_JTAG', +`Element(0x00 "$1" "`$2'" "$3" 0 0 0 100 0x00) +( + Pin(100 100 60 28 "1" "1" 0x00000101) + Pin(100 200 60 28 "2" "2" 0x00000001) + Pin(100 300 60 28 "3" "3" 0x00000001) + Pin(100 400 60 28 "4" "4" 0x00000001) + Pin(100 500 60 28 "5" "5" 0x00000001) + Pin(100 600 60 28 "6" "6" 0x00000001) + Pin(100 700 60 28 "7" "7" 0x00000001) + Pin(100 800 60 28 "8" "8" 0x00000001) + + ElementLine( 0 0 200 0 20) + ElementLine( 0 150 200 150 10) + ElementLine( 200 0 200 900 20) + ElementLine( 200 900 0 900 20) + ElementLine( 0 900 0 0 20) + + Mark (0 0) +)') + +define(`Description_conn_jtag',``JTAG Connector'') +define(`PinList_conn_jtag', ``1', `2', `3', `4', `5', `6', `7', `8'') + + +divert(0) Index: tags/1.0.5/old/oldlib/lib/jerry.list =================================================================== --- tags/1.0.5/old/oldlib/lib/jerry.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/jerry.list (revision 953) @@ -0,0 +1,51 @@ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ + +# Arcade machine parts needed by Scott "Jerry" Lawrence +# jsl@absynth.com + +# this should be in the lsi file perhaps. +z80_dil:N:Z80 + +# these should be in the memory file. + +# RAM +4016_dil:N:4016 +2114_dil:N:2114 +6116_dil:N:6116 + +# NVSRAM +DS1220_dil:N:DS1220 +DS1225_dil:N:DS1225 +DS1230_dil:N:DS1230 + +# EPROM +2532_dil:N:2532 +2716_dil:N:2716 +2732_dil:N:2732 +2764_dil:N:2764 +27128_dil:N:27128 +27256_dil:N:27256 Index: tags/1.0.5/old/oldlib/lib/jerry.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/jerry.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/jerry.m4 (revision 953) @@ -0,0 +1,115 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# + +# Arcade machine parts needed by Scott "Jerry" Lawrence +# jsl@absynth.com + + +# this should be in the lsi file perhaps. + +define(`Description_z80_dil', ``Zilog Z80'') +define(`Param1_z80_dil', 40) +define(`Param2_z80_dil', 600) +define(`PinList_z80_dil', ``A11', `A12', `A13', `A14', `A15', `theta', `D3', `D4', `D5', `D6', `+5v', `D2', `D7', `D0', `D1', `/INT', `/NMI', `/HALT', `/MREQ', `/IORQ', `/RD', `/WR', `/BUSAK', `/WAIT', `/BUSRQ', `/RESET', `/M1', `/RFSH', `GND', `A0', `A1', `A2', `A3', `A4', `A5', `A6', `A7', `A8', `A9', `A10'') + + + +# these should be in the memory file. + +# RAM + +define(`Description_4016_dil', ``Static RAM 2Kx8'') +define(`Param1_4016_dil', 24) +define(`Param2_4016_dil', 600) +define(`PinList_4016_dil', ``A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Cs',`A10',`/Oe',`/W',`A9',`A8',`Vcc'') + +define(`Description_6116_dil', ``Static RAM 2Kx8'') +define(`Param1_6116_dil', 24) +define(`Param2_6116_dil', 600) +define(`PinList_6116_dil', ``A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Cs',`A10',`/Oe',`/We',`A9',`A8',`Vcc'') + + +define(`Description_2114_dil', ``Static RAM 1Kx4'') +define(`Param1_2114_dil', 18) +define(`Param2_2114_dil', 300) +define(`PinList_2114_dil', ``A6', `A5', `A4', `A3', `A0', `A1', `A2', `/Ce', `Gnd', `/We', `D3', `D2', `D1', `D0', `A9', `A8', `A7', `Vcc'') + + +# some Dallas Semiconductor parts: +# http://www.dalsemi.com/products/memory/index.html +# Battery Backed NVSRAM + +define(`Description_DS1220_dil', ``NVSRAM 2Kx8'') +define(`Param1_DS1220_dil', 24) +define(`Param2_DS1220_dil', 600) +define(`PinList_DS1220_dil', ``A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Ce',`A10',`/Oe',`/We',`A9',`A8',`Vcc'') + +define(`Description_DS1225_dil', ``NVSRAM 8Kx8'') +define(`Param1_DS1225_dil', 28) +define(`Param2_DS1225_dil', 600) +define(`PinList_DS1225_dil', ``n/c', `A12', `A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Ce',`A10',`/Oe',`A11',`A9',`A8',`n/c', `/We', `Vcc'') + +define(`Description_DS1230_dil', ``NVSRAM 32Kx8'') +define(`Param1_DS1230_dil', 28) +define(`Param2_DS1230_dil', 600) +define(`PinList_DS1230_dil', ``A14', `A12', `A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Ce',`A10',`/Oe',`A11',`A9',`A8',`A13', `/We', `Vcc'') + + +# EPROM + +define(`Description_2532_dil', ``EPROM 4Kx8'') +define(`Param1_2532_dil', 24) +define(`Param2_2532_dil', 600) +define(`PinList_2532_dil', ``A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`A11',`A10',`/Oe',`Vpp',`A9',`A8',`Vcc'') + +define(`Description_2716_dil', ``EPROM 2Kx8'') +define(`Param1_2716_dil', 24) +define(`Param2_2716_dil', 600) +define(`PinList_2716_dil', ``n/c',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/CeP',`A10',`/Oe',`Vpp',`A9',`A8',`Vcc'') + +define(`Description_2732_dil', ``EPROM 4Kx8'') +define(`Param1_2732_dil', 24) +define(`Param2_2732_dil', 600) +define(`PinList_2732_dil', ``A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Cs',`A10',`/Oe',`A11',`A9',`A8',`Vcc'') + +define(`Description_2764_dil', ``EPROM 8Kx8'') +define(`Param1_2764_dil', 28) +define(`Param2_2764_dil', 600) +define(`PinList_2764_dil', ``Vpp', `A12', `A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Cs',`A10',`/Oe',`A11',`A9',`A8', `n/c', `/PGM', `Vcc'') + +define(`Description_27128_dil', ``EPROM 16Kx8'') +define(`Param1_27128_dil', 28) +define(`Param2_27128_dil', 600) +define(`PinList_27128_dil', ``Vpp', `A12', `A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Cs',`A10',`/Oe',`A11',`A9',`A8', `A13', `A14', `Vcc'') + +define(`Description_27256_dil', ``EPROM 32Kx8'') +define(`Param1_27256_dil', 28) +define(`Param2_27256_dil', 600) +define(`PinList_27256_dil', ``Vpp', `A12', `A7',`A6',`A5',`A4',`A3',`A2',`A1',`A0',`D0',`D1',`D2',`Gnd',`D3',`D4',`D5',`D6',`D7',`/Cs',`A10',`/Oe',`A11',`A9',`A8', `A13', `A14', `Vcc'') + +divert(0)dnl Index: tags/1.0.5/old/oldlib/lib/johnstech.inc =================================================================== --- tags/1.0.5/old/oldlib/lib/johnstech.inc (nonexistent) +++ tags/1.0.5/old/oldlib/lib/johnstech.inc (revision 953) @@ -0,0 +1,326 @@ +# -*- m4 -*- +# $Id$ +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 2003 Dan McMahill +# +# 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. +# +# +# +# Johnstech Evaluation Socket for QFN packages +# Johnstech Socket Part Numbers 724810 through 724839 +# +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins +# $5: body size (mm) +# $6: pad pitch (1/100 mm) +# $7: PCB pad width (1/100 mm) +# $8: Package pad length (1/100 mm) +# $9: Exposed paddle size, 0 for no exposed paddle (1/100 mm) + +define(`PKG_GENERIC_JOHNSTECH7248_QFN', + ` + # number of pins on left/right sides (pin1 is upper pin on left side) + define(`LRPINS', `eval($4 / 4)') + # number of pins on top/bottom sides + define(`TBPINS', `eval(`$4' / 2 - LRPINS)') + # pin pitch (1/1000 mil) + define(`PITCH',`eval(`$6'*100000/254)') + # y-coordinate for upper pin on left/right sides (1/1000 mil) + define(`LRYMAX', `eval((LRPINS-1)*PITCH/2)') + # x-coordinate for right pin on top/bottom sides (1/1000 mil) + define(`TBXMAX', `eval((TBPINS-1)*PITCH/2)') + # total horizontal package width (1/1000 mil) + define(`LRWIDTHMM', `ifelse(0,`$5',`787',`eval($5)')') + define(`LRWIDTH', `ifelse(0,`$5',`787',`eval(`$5'*10000000/254)')') + # total vertical package width (1/1000 mil) + define(`TBWIDTHMM', `ifelse(0,`$5',`551',`eval($5)')') + define(`TBWIDTH',`ifelse(0,`$5',`551',`eval(`$5'*10000000/254)')') + # how much pads extend beyond the package edge (1/1000 mil) (the 75 is 0.75 mm) + define(`EXTOUT', eval(75*100000/254)) + # how much pads extend inward from the package pad edge (1/1000 mil) + define(`EXTIN', eval(5*100000/254)) + # pad length/width (1/1000 mil) + define(`PADLENGTH', `eval(`$8'*100000/254)') + define(`PADWIDTH', `eval(`$7'*100000/254)') + # pad width (mil/100) + define(`PADWIDTHMIL100', `eval(PADWIDTH/10)') + # min/max x coordinates for the pads on the left/right sides of the package (mil/100) + define(`LRXMAX',`eval((LRWIDTH/2 + EXTOUT - PADWIDTH/2)/10)') + define(`LRXMIN',`eval((LRWIDTH/2 -PADLENGTH - EXTIN + PADWIDTH/2)/10)') + # min/max y coordinates for the pads on the top/bottom sides of the package (mil/100) + define(`TBYMAX',`eval((TBWIDTH/2 + EXTOUT - PADWIDTH/2)/10)') + define(`TBYMIN',`eval((TBWIDTH/2 -PADLENGTH - EXTIN + PADWIDTH/2)/10)') + + # pad size and drill size (mil/100) for the mounting holes + define(`MOUNTPAD', 7700) + define(`MOUNTDRILL', 2000) + # soldermask relief size for mounting holes (mil/100) + define(`MOUNTMASK', `eval(MOUNTPAD + 1000)') + + # silkscreen width (mils/100) + define(`SILKW', 1000) + # how much the silk screen is moved away from the package (1/1000 mil) + define(`SILKEXT', `eval(200*100000/254 + SILKW*10/2 + 5*1000)') + # upper right corner for silk screen (mil/100) + define(`SILKX', `eval((LRWIDTH/2 + SILKEXT )/10)') + define(`SILKY', `eval((TBWIDTH/2 + SILKEXT )/10)') + # refdes text size (mil/100) + define(`TEXTSIZE', 100) + # x,y coordinates for refdes label (mil/100) + define(`TEXTX', -SILKX) + define(`TEXTY', `eval(-SILKY - 1000 - TEXTSIZE/2)') + # square exposed paddle size (mil/100) + define(`EPSIZE', `eval(`$9'*10000/254)') + + # location of mounting holes (mil/100) + define(`MOUNTX', `eval((LRWIDTH/2 + 39370)/10)') + define(`MOUNTY', `eval((TBWIDTH/2 + 39370)/10)') + + # latch silkscreen width (mils/100) + define(`LSILKW', 100) + # points for latch silk on the left/right sides of the part (mil/100) + define(`LATCHLRYMIN', `eval((-TBWIDTH/2 - 25*100000/254 )/10)') + define(`LATCHLRYMAX', `eval(( TBWIDTH/2 + 25*100000/254 )/10)') + define(`LATCHLRXMIN', SILKX) + define(`LATCHLRXMAX', `eval(( LRWIDTH/2 + 400*100000/254 )/10)') + # points for latch silk on the top/bottom sides of the part (mil/100) + define(`LATCHTBXMIN', `eval((-LRWIDTH/2 - 25*100000/254 )/10)') + define(`LATCHTBXMAX', `eval(( LRWIDTH/2 + 25*100000/254 )/10)') + define(`LATCHTBYMIN', SILKY) + define(`LATCHTBYMAX', `eval(( TBWIDTH/2 + 400*100000/254 )/10)') + + # points for silk showing where the exposed paddle contacts are (mil/100) + define(`CONTL', 100) + ifelse(1, eval(TBWIDTHMM>4), define(`CONTL', 200)) + ifelse(1, eval(TBWIDTHMM>5), define(`CONTL', 300)) + + # spacing between rows of EP contacts in 1/100 mm. + define(`CONTS', 0) + ifelse(1, eval(TBWIDTHMM>5), define(`CONTS', `eval(TBWIDTHMM*100 - 430)')) + + define(`EPY', `eval((CONTL*100000/254)/10)') + define(`EPXMIN', `eval(((CONTS/2 - 20/2)*100000/254)/10)') + define(`EPXMAX', `eval(((CONTS/2 + 20/2)*100000/254)/10)') + + # soldermask opening (mil/100) + define(`MASKSIZE', `eval((400*100000/254 + TBWIDTH)/10)') + + +# element_flags, description, pcb-name, value, mark_x, mark_y, +# text_x, text_y, text_direction, text_scale, text_flags +Element[0x00000000 "$1" "`$2'" "$3" 0 0 TEXTX TEXTY 0 TEXTSIZE 0x00000000] +( + +# left row +define(`CURPIN', 1) +define(`idx',0) +forloop(`i', 1, LRPINS, + `define(`Y', `eval((-LRYMAX + PITCH*idx)/10)')' + `Pad[-LRXMAX Y -LRXMIN Y PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000000]' + `define(`CURPIN', incr(CURPIN))' + `define(`idx',incr(idx))' +) + +# bottom row +define(`idx',0) +forloop(`i', 1, TBPINS, + `define(`X', `eval((-TBXMAX + PITCH*idx)/10)')' + `Pad[X TBYMAX X TBYMIN PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000800]' + `define(`CURPIN', incr(CURPIN))' + `define(`idx',incr(idx))' +) + +# right row +define(`idx',0) +forloop(`i', 1, LRPINS, + `define(`Y', `eval(( LRYMAX - PITCH*idx)/10)')' + `Pad[LRXMAX Y LRXMIN Y PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000000]' + `define(`CURPIN', incr(CURPIN))' + `define(`idx',incr(idx))' +) + +# top row +define(`idx',0) +forloop(`i', 1, TBPINS, + `define(`X', `eval((TBXMAX - PITCH*idx)/10)')' + `Pad[X -TBYMAX X -TBYMIN PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000800]' + `define(`CURPIN', incr(CURPIN))' + `define(`idx',incr(idx))' +) + +# Exposed paddle. Note that this pad also sets the soldermask +# relief for the entire part. +# Pad(X1, Y1, X2, Y3, width, clearance, +# soldermask, "pin name", "pin number", flags) +Pad[0 0 0 0 EPSIZE 0 MASKSIZE "CURPIN" "CURPIN" 0x00000100] +define(`CURPIN', incr(CURPIN)) +# Mounting pins + +# Pin(x, y, thickness, clearance, mask, drilling hole, name, +# number, flags +Pin[ MOUNTX MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount1" "CURPIN" 0x0] +define(`CURPIN', incr(CURPIN)) +Pin[ -MOUNTX MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount2" "CURPIN" 0x0] +define(`CURPIN', incr(CURPIN)) +Pin[ -MOUNTX -MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount3" "CURPIN" 0x0] +define(`CURPIN', incr(CURPIN)) +Pin[ MOUNTX -MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount4" "CURPIN" 0x0] + +# Silk screen around package +ElementLine[ SILKX SILKY SILKX -SILKY SILKW] +ElementLine[ SILKX -SILKY -SILKX -SILKY SILKW] +ElementLine[-SILKX -SILKY -SILKX SILKY SILKW] +ElementLine[-SILKX SILKY SILKX SILKY SILKW] + +# Pin 1 indicator +ElementLine[-SILKX -SILKY eval(-SILKX - 1500) eval(-SILKY - 1500) SILKW] + +# Silk showing latch area + +# top +ElementLine[ LATCHTBXMIN -LATCHTBYMIN LATCHTBXMIN -LATCHTBYMAX LSILKW ] +ElementLine[ LATCHTBXMIN -LATCHTBYMAX LATCHTBXMAX -LATCHTBYMAX LSILKW ] +ElementLine[ LATCHTBXMAX -LATCHTBYMIN LATCHTBXMAX -LATCHTBYMAX LSILKW ] + +# bottom +ElementLine[ LATCHTBXMIN LATCHTBYMIN LATCHTBXMIN LATCHTBYMAX LSILKW ] +ElementLine[ LATCHTBXMIN LATCHTBYMAX LATCHTBXMAX LATCHTBYMAX LSILKW ] +ElementLine[ LATCHTBXMAX LATCHTBYMIN LATCHTBXMAX LATCHTBYMAX LSILKW ] + +# left +ElementLine[ -LATCHLRXMIN LATCHLRYMAX -LATCHLRXMAX LATCHLRYMAX LSILKW ] +ElementLine[ -LATCHLRXMAX LATCHLRYMAX -LATCHLRXMAX LATCHLRYMIN LSILKW ] +ElementLine[ -LATCHLRXMIN LATCHLRYMIN -LATCHLRXMAX LATCHLRYMIN LSILKW ] + +# right +ElementLine[ LATCHLRXMIN LATCHLRYMAX LATCHLRXMAX LATCHLRYMAX LSILKW ] +ElementLine[ LATCHLRXMAX LATCHLRYMAX LATCHLRXMAX LATCHLRYMIN LSILKW ] +ElementLine[ LATCHLRXMIN LATCHLRYMIN LATCHLRXMAX LATCHLRYMIN LSILKW ] + +# Silk showing area for exposed paddle socket contacts +ElementLine[ EPXMIN -EPY EPXMIN EPY LSILKW ] +ElementLine[ EPXMAX -EPY EPXMAX EPY LSILKW ] +ElementLine[ EPXMIN EPY EPXMAX EPY LSILKW ] +ElementLine[ EPXMIN -EPY EPXMAX -EPY LSILKW ] + +# packages with width >= 6.0 mm have 2 rows of contacts +ifelse(1, eval(TBWIDTHMM>5), +ElementLine[ -EPXMIN -EPY -EPXMIN EPY LSILKW ] +ElementLine[ -EPXMAX -EPY -EPXMAX EPY LSILKW ] +ElementLine[ -EPXMIN EPY -EPXMAX EPY LSILKW ] +ElementLine[ -EPXMIN -EPY -EPXMAX -EPY LSILKW ] +) + +)') + +# ------------------------------------------------------------------- + +# The following macros take: +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins +# $5: body size (mm) +# $6: exposed paddle size (1/100 mm). 0 for no exposed paddle + + +# For an exposed paddle package, the paddle for an 'n' pin package is pin 'n+1' + +# 0.8 mm pitch +define(`PKG_JOHNSTECH_QFN_80', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `80',`36',`50', `$6')') +# 0.65 mm pitch +define(`PKG_JOHNSTECH_QFN_65', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `65',`36',`50', `$6')') +# 0.50 mm pitch, 0.6 mm pad length +define(`PKG_JOHNSTECH_QFN_50', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `50',`36',`50', `$6')') +# 0.50 mm pitch, 0.4 mm pad length +define(`PKG_JOHNSTECH_QFN_50S',`PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `50',`36',`50', `$6')') +# 0.40 mm pitch +define(`PKG_JOHNSTECH_QFN_40', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `40',`36',`50', `$6')') + + +# PKG_GENERIC_JOHNSTECH7248_QFN +# $1: canonical name +# $2: name on PCB +# $3: value +# $4: number of pins +# $5: body size (mm) +# $6: pad pitch (1/100 mm) +# $7: PCB pad width (1/100 mm) +# $8: Package pad length (1/100 mm) +# $9: Exposed paddle size, 0 for no exposed paddle (1/100 mm) +# ------------------------------------------------------------------- + +# EXTRACT_BEGIN + +## Johnstech QFN Socket, Series 1MM (724812-724839) + +# 4x4 mm +define(`PKG_JOHNSTECH_QFN12_4', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `12', `4', `210')') +#define(`PKG_JOHNSTECH_TQFN12_4', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `12', `4', `210')') + +define(`PKG_JOHNSTECH_QFN16_4', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `16', `4', `210')') +#define(`PKG_JOHNSTECH_TQFN16_4', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `16', `4', `210')') + +define(`PKG_JOHNSTECH_QFN20_4', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `20', `4', `210')') +#define(`PKG_JOHNSTECH_TQFN20_4', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `20', `4', `210')') + +define(`PKG_JOHNSTECH_QFN24_4', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `24', `4', `210')') +#define(`PKG_JOHNSTECH_TQFN24_4', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `24', `4', `260')') + +# 5x5 mm +define(`PKG_JOHNSTECH_QFN16_5', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `16', `5', `310')') +#define(`PKG_JOHNSTECH_TQFN16_5', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `16', `5', `310')') + +define(`PKG_JOHNSTECH_QFN20_5', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `20', `5', `310')') +#define(`PKG_JOHNSTECH_TQFN20_5', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `20', `5', `310')') + +define(`PKG_JOHNSTECH_QFN28_5', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `28', `5', `310')') +#define(`PKG_JOHNSTECH_TQFN28_5', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `28', `5', `325')') + +define(`PKG_JOHNSTECH_QFN32_5', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `32', `5', `310')') +#define(`PKG_JOHNSTECH_TQFN32_5', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `32', `5', `310')') + +# 6x6 mm +define(`PKG_JOHNSTECH_QFN36_6', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `36', `6', `370')') +#define(`PKG_JOHNSTECH_TQFN36_6', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `36', `6', `370')') + +define(`PKG_JOHNSTECH_QFN40_6', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `40', `6', `410')') +#define(`PKG_JOHNSTECH_TQFN40_6', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `40', `6', `410')') + +# 7x7 mm +define(`PKG_JOHNSTECH_QFN32_7', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `32', `7', `470')') +#define(`PKG_JOHNSTECH_TQFN32_7', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `32', `7', `470')') + +define(`PKG_JOHNSTECH_QFN44_7', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `44', `7', `470')') +#define(`PKG_JOHNSTECH_TQFN44_7', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `44', `7', `470')') + +define(`PKG_JOHNSTECH_QFN48_7', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `48', `7', `560')') +#define(`PKG_JOHNSTECH_TQFN48_7', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `48', `7', `560')') + +# 8x8 mm +define(`PKG_JOHNSTECH_QFN56_8', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `56', `8', `665')') +#define(`PKG_JOHNSTECH_TQFN56_8', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `56', `8', `665')') + +# 10x10 mm +define(`PKG_JOHNSTECH_QFN68_10', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `68', `10', `770')') +#define(`PKG_JOHNSTECH_TQFN68_10', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `68', `10', `770')') + +# EXTRACT_END + Index: tags/1.0.5/old/oldlib/lib/linear.list =================================================================== --- tags/1.0.5/old/oldlib/lib/linear.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/linear.list (revision 953) @@ -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@rz.uni-ulm.de +# +# RCS: $Id$ +# +# mask package values... +# +L297_dil:N:L297 +L297A_dil:N:L297A +L298_multiwatt:MULTIWATT15:L298 +MAX222_dil:N:MAX222 +MAX232_dil:N:MAX232 +MAX232A_dil:N:MAX232A +MAX233_dil:N:MAX233 +MAX233A_dil:N:MAX233A +MAX667_dil:N:MAX667 +MAX680_dil:N:MAX680 +MAX690_dil:N:MAX690 +MAX691_dil:N:MAX691 +NE4558_dil:N:NE4558 Property changes on: tags/1.0.5/old/oldlib/lib/linear.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/linear.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/linear.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/linear.m4 (revision 953) @@ -0,0 +1,94 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +define(`Description_MAX222_dil', `high-speed dual RS232 driver w. shutdown') +define(`Param1_MAX222_dil', 18) +define(`Param2_MAX222_dil', 300) +define(`PinList_MAX222_dil', ``NC',`C1+',`V+',`C1-',`C2+',`C2-',`V-',`T2out',`R2in',`R2out',`T2in',`T1in',`R1out',`R1in',`T1out',`GND',`Vcc',`/Shdn'') + +define(`Description_MAX232_dil', `dual RS232 driver') +define(`Param1_MAX232_dil', 16) +define(`Param2_MAX232_dil', 300) +define(`PinList_MAX232_dil', ``C1+',`V+',`C1-',`C2+',`C2-',`V-',`T2out',`R2in',`R2out',`T2in',`T1in',`R1out',`R1in',`T1out',`GND',`Vcc'') + +define(`Description_MAX232A_dil', `high-speed dual RS232 driver') +define(`Param1_MAX232A_dil', 16) +define(`Param2_MAX232A_dil', 300) +define(`PinList_MAX232A_dil', ``C1+',`V+',`C1-',`C2+',`C2-',`V-',`T2out',`R2in',`R2out',`T2in',`T1in',`R1out',`R1in',`T1out',`GND',`Vcc'') + +define(`Description_MAX233_dil', `dual RS232 driver without external components') +define(`Param1_MAX233_dil', 20) +define(`Param2_MAX233_dil', 300) +define(`PinList_MAX233_dil', ``T2in',`T1in',`R1out',`R1in',`T1out',`Gnd',`Vcc',`C1+',`Gnd',`C2-',`C2+',`V-',`C1-',`V+',`C2+',`C2-',`V-',`T2out',`R2in',`R2out'') + +define(`Description_MAX233A_dil', `high-speed dual RS232 driver without external components') +define(`Param1_MAX233A_dil', 20) +define(`Param2_MAX233A_dil', 300) +define(`PinList_MAX233A_dil', ``T2in',`T1in',`R1out',`R1in',`T1out',`Gnd',`Vcc',`C1+',`Gnd',`C2-',`C2+',`V-',`C1-',`V+',`C2+',`C2-',`V-',`T2out',`R2in',`R2out'') + +define(`Description_MAX667_dil', `5V/adjustable low-dropout linear regulator') +define(`Param1_MAX667_dil', 8) +define(`Param2_MAX667_dil', 300) +define(`PinList_MAX667_dil', ``DD',`OUT',`LBI',`GND',`SHDN',`SET',`LBO',`IN'') + +define(`Description_MAX680_dil', `+-10V voltage converter') +define(`Param1_MAX680_dil', 8) +define(`Param2_MAX680_dil', 300) +define(`PinList_MAX680_dil', ``C1-',`C2+',`C2-',`V-',`GND',`Vcc',`C1+',`V+'') + +define(`Description_MAX690_dil', `uP supervisor w. watchdog and power-fail signal') +define(`Param1_MAX690_dil', 8) +define(`Param2_MAX690_dil', 300) +define(`PinList_MAX690_dil', ``Vout',`Vcc',`Gnd',`PFI',`/PFO',`WDI',`/RESET',`VBatt'') + +define(`Description_MAX691_dil', `uP supervisor w. watchdog, chip-enable and power-fail signal') +define(`Param1_MAX691_dil', 16) +define(`Param2_MAX691_dil', 300) +define(`PinList_MAX691_dil', ``Vbatt',`Vout',`Vcc',`Gnd',`BattOn',`/LowLine',`OSC_In',`OSC_Out',`PFI',`/PFO',`WDI',`/CE_Out',`/CE_In',`/WDO',`/Reset',`Reset'') + +# -------------------------------------------------------------------- +# based on data mailed by Olaf Kaluza (olaf@criseis.ruhr.de) +# +define(`Description_L297_dil', `stepper-motor controller') +define(`Param1_L297_dil', 20) +define(`Param2_L297_dil', 300) +define(`PinList_L297_dil', ``Sync',`Gnd',`Home',`A',`/Inh1',`B',`C',`/Inh2',`D',`Enable',`Control',`Vs',`Sens2',`Sens1',`Vref',`Osc',`CW/CCW',`/Clock',`Half/Full',`/Reset'') + +define(`Description_L297A_dil', `stepper-motor controller') +define(`Param1_L297A_dil', 20) +define(`Param2_L297A_dil', 300) +define(`PinList_L297A_dil', ``Sync',`Gnd',`Home',`A',`/Inh1',`B',`C',`/Inh2',`D',`Enable',`Dir-Mem',`Vs',`Sens2',`Sens1',`Vref',`Osc',`CW/CCW',`/Clock',`Half/Full',`/Reset'') + +define(`Description_NE4558_dil', `dual operating-amplifier') +define(`Param1_NE4558_dil', 8) +define(`Param2_NE4558_dil', 300) +define(`PinList_NE4558_dil', ``Out1',`Inv1',`NoInv1',`-Us',`NoInv2',`Inv2',`Out2',`+Us'') + +define(`Description_L298_multiwatt', `dual full-bridge driver') +define(`PinList_L298_multiwatt', ``I-Sens1', `Out1', `Out2', `Vcc', `In1', `Enable A', `In2', `Gnd', `Logic-Vcc', `In3', `Enable B', `In4', `Out3', `Out4', `I-Sens2'') + +divert(0)dnl Property changes on: tags/1.0.5/old/oldlib/lib/linear.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/logic.list =================================================================== --- tags/1.0.5/old/oldlib/lib/logic.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/logic.list (revision 953) @@ -0,0 +1,31 @@ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# mask package values... +# +GAL16V8_dil:N:GAL16V8 +GAL20V8_dil:N:GAL20V8 +GAL22V10_dil:N:GAL22V10 Property changes on: tags/1.0.5/old/oldlib/lib/logic.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/logic.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/logic.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/logic.m4 (revision 953) @@ -0,0 +1,46 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# ------------------------------------------------------------------------ +# based on mail by Olaf Kaluza (olaf@criseis.ruhr.de) +# +define(`Description_GAL16V8_dil', `generic PAL replacement') +define(`Param1_GAL16V8_dil', 20) +define(`Param2_GAL16V8_dil', 300) +define(`PinList_GAL16V8_dil', ``CLK/I1',`I2',`I3',`I4',`I5',`I6',`I7',`I8',`I9',`Gnd',`I10',`I/O/Qh',`I/O/Qg',`I/O/Qf',`I/O/Qe',`I/O/Qd',`I/O/Qc',`I/O/Qb',`I/O/Qa',`Vcc'') + +define(`Description_GAL20V8_dil', `generic PAL replacement') +define(`Param1_GAL20V8_dil', 24) +define(`Param2_GAL20V8_dil', 300) +define(`PinList_GAL20V8_dil', ``CLK/I1',`I2',`I3',`I4',`I5',`I6',`I7',`I8',`I9',`I10',`I11',`Gnd',`I12/OE',`I13',`I/O/Qh',`I/O/Qg',`I/O/Qf',`I/O/Qe',`I/O/Qd',`I/O/Qc',`I/O/Qb',`I/O/Qa',`I14',`Vcc'') + +define(`Description_GAL22V10_dil', `generic PAL replacement') +define(`Param1_GAL22V10_dil', 24) +define(`Param2_GAL22V10_dil', 300) +define(`PinList_GAL22V10_dil', ``CLK/I1',`I2',`I3',`I4',`I5',`I6',`I7',`I8',`I9',`I10',`I11',`Gnd',`I12',`I/O/Qj',`I/O/Qi',`I/O/Qh',`I/O/Qg',`I/O/Qf',`I/O/Qe',`I/O/Qd',`I/O/Qc',`I/O/Qb',`I/O/Qa',`Vcc'') + +divert(0)dnl Property changes on: tags/1.0.5/old/oldlib/lib/logic.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/lsi.list =================================================================== --- tags/1.0.5/old/oldlib/lib/lsi.list (nonexistent) +++ tags/1.0.5/old/oldlib/lib/lsi.list (revision 953) @@ -0,0 +1,72 @@ +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# mask package values... +# +6551_dil:N:6551 +6801_dil:N:6801 +81C17_dil:N:81C17 +AT90S1200_dil:N:AT90S1200 +AT90S1300_dil:N:AT90S1300 +AT90S2313_dil:N:AT90S2313 +BT484_plcc:PLCC:BT484 +BT484_plcc:PLCC_SOCKET:BT484 socket +I82077_plcc:PLCC:I82077 +I82077_plcc:PLCC_SOCKET:I82077 socket +MAB8031AH_dil:N:MAB8031AH +MC68000_dil:N:MC68000 +MC68008_plcc:PLCC:MC68008 +MC68008_plcc:PLCC_SOCKET:MC68008 socket +MC68030_pga:MC68030_pga:MC68030 +MC68332_qfp:QFP132:MC68332 +MC68681_dil:N:MC68681 DIL +MC68681_plcc:PLCC:MC68681 PLCC +MC68681_plcc:PLCC_SOCKET:MC68681 PLCC socket +PEB2086N_plcc:PLCC:PEB2086N PLCC +PEB2086N_plcc:PLCC_SOCKET:PEB2086N PLCC socket +MC68881_pga:MC68881_pga:MC68881 +MC68881_pga:MC68881_pga:MC68882 +MC68HC11_plcc:PLCC:MC68HC11 +MC68HC11_plcc:PLCC_SOCKET:MC68HC11 socket +PIC16C54_dil:N:PIC16C54:PIC16C55:PIC16C58 +PIC16C55_dil:N:PIC16C55:PIC16C57 +PIC16C61_dil:N:PIC16C61 +PIC16C64_dil:N:PIC16C64 +PIC16C71_dil:N:PIC16C71 +PIC16C74_dil:N:PIC16C74 +PIC16C84_dil:N:PIC16C84 +PIC17C42_dil:N:PIC17C42 +RTC62421_dil:N:RTC62421 +TI34010_plcc:PLCC:TI34010 +TI34010_plcc:PLCC_SOCKET:TI34010 socket +WD33C93A_dil:N:WD33C93A +Z8536_dil:N:Z8536 +AT90S8535_plcc:PLCC:AT90S8535 PLCC +AT90S8535_plcc:PLCC_SOCKET:AT90S8535 PLCC socket +AT90S8535_dil:N:AT90S8535 dil +AT90S4434_dil:N:AT90S4434 dil + + Property changes on: tags/1.0.5/old/oldlib/lib/lsi.list ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/lsi.m4 =================================================================== --- tags/1.0.5/old/oldlib/lib/lsi.m4 (nonexistent) +++ tags/1.0.5/old/oldlib/lib/lsi.m4 (revision 953) @@ -0,0 +1,422 @@ +divert(-1) +# +# COPYRIGHT +# +# PCB, interactive printed circuit board design +# Copyright (C) 1994,1995,1996 Thomas Nau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# Contact addresses for paper mail and Email: +# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany +# Thomas.Nau@rz.uni-ulm.de +# +# RCS: $Id$ +# +# ---------------------------------------------------------------------- +# several different microcontrollers from the PIC family +# donated by ?!?, thanks anyway +# +define(`Description_BT484_plcc', `color lookup table') +define(`Param1_BT484_plcc', 84) +define(`Param2_BT484_plcc', 150) +define(`PinList_BT484_plcc', ``PA0',`PA1',`PA2',`PA3',`PA4',`PA5',`PA6',`PA7',`PB0',`PB1',`PB2',`PB3',`PB4',`PB5',`PB6',`PB7',`PC0',`PC1',`PC2',`PC3',`PC4',`PC5',`PC6',`PC7',`PD0',`PD1',`PD2',`PD3',`PD4',`PD5',`PD6',`PD7',`Adjust',`Gnd',`Red',`Gnd',`Green',`Gnd',`Blue',`Vaa',`Comp',`Vaa',`VRefIn',`VRefOut',`Vaa',`/Sense',`/Reset',`/Wr',`/Rd',`RS0',`RS1',`RS2',`RS3',`D0',`D1',`D2',`D3',`D4',`D5',`D6',`D7',`/OddEven',`CDE',`/CSync',`/CBlank',`PortSel',`V0',`V1',`V2',`V3',`V4',`V5',`V6',`V7',`Vaa',`PClk1',`Vaa',`PClk0',`Vaa',`Gnd',`LClk',`Gnd',`SClk',`Gnd'') + +define(`Description_I82077_plcc', `floppy controller') +define(`Param1_I82077_plcc', 68) +define(`Param2_I82077_plcc', 150) +define(`PinList_I82077_plcc', ``WP',`Trk0',`/Dack',`/RD',`/WR',`/CS',`A0',`A1',`Gnd',`A2',`D0',`Gnd',`D1',`D2',`D3',`Gnd',`D4',`Vcc',`D5',`D6',`Gnd',`D7',`Int',`Drq',`TC',`INDX',`IDENT',`DRate0',`DRate1',`DRV2',`DskChg',`Reset',`X1',`X2',`/Invert',`Gnd',`LoFil',`HiFil',`PLL0',`Vcc',`RdData',`NC',`NC',`NC',`AGnd',`AVcc',`NC',`MFM',`DenSel',`Gnd',`HDSel',`We',`WrData',`Gnd',`Step',`Dir',`ME0',`DS0',`Gnd',`Vcc',`ME1',`DS1',`ME2',`DS2',`Gnd',`ME3',`DS3',`Vcc'') + +define(`Description_MC68000_dil', `CPU') +define(`Param1_MC68000_dil', 64) +define(`Param2_MC68000_dil', 900) +define(`PinList_MC68000_dil', ``D4',`D3',`D2',`D1',`D0',`/As',`/Uds',`/Lds',`R/W',`/Dtack',`/Bg',`/Bgack',`/Br',`Vcc',`Clk',`Gnd',`/Halt',`/Reset',`/Vma',`E',`/Vpa',`/Berr',`/Ipl2',`/Ipl1',`/Ipl0',`Fc2',`Fc1',`Fc0',`A1',`A2',`A3',`A4',`A5',`A6',`A7',`A8',`A9',`A10',`A11',`A12',`A13',`A14',`A15',`A16',`A17',`A18',`A19',`A20',`Vcc',`A21',`A22',`A23',`Gnd',`D15',`D14',`D13',`D12',`D11',`D10',`D9',`D8',`D7',`D6',`D5'') + +define(`Description_MC68008_plcc', `CPU') +define(`Param1_MC68008_plcc', 52) +define(`Param2_MC68008_plcc', 150) +define(`PinList_MC68008_plcc', ``A2',`A3',`A4',`A5',`A6',`A7',`A8',`A9',`A10',`A11',`A12',`A13',`A21',`A14',`Vcc',`A15',`Gnd',`A16',`A17',`A18',`A19',`A20',`D7',`D6',`D5',`D4',`D3',`D2',`D1',`D0',`/As',`/Ds',`R/W',`/Dtack',`/Bg',`/BgAck',`/Br',`Clk',`Gnd',`/Halt',`/Reset',`E',`/Vpa',`/Berr',`/Ipl1',`/Ipl2',`/Ipl0',`Fc2',`Fc1',`Fc0',`A0',`A1'') + +define(`Description_MC68681_dil', `DUART') +define(`Param1_MC68681_dil', 40) +define(`Param2_MC68681_dil', 600) +define(`PinList_MC68681_dil', ``Rs1',`Ip3',`Rs2',`Ip1',`Rs3',`Rs4',`Ip0',`R/W',`/Dtack',`RxDB',`TxDB',`Op1',`Op3',`Op5',`Op7',`D1',`D3',`D5',`D7',`Gnd',`/Irq',`D6',`D4',`D2',`D0',`Op6',`Op4',`Op2',`Op0',`TxDA',`RxDA',`X1/Clk',`X2',`/Reset',`/Cs',`Ip2',`/Iack',`Ip5',`Ip4',`Vcc'') + +define(`Description_MC68681_plcc', `DUART') +define(`Param1_MC68681_plcc', 44) +define(`Param2_MC68681_plcc', 150) +define(`PinList_MC68681_plcc', ``NC',`RS1',`IP3',`RS2',`IP1',`RS3',`RS4',`IP0',`R-/W',`/DTAck',`RxD1',`NC',`TxD1',`OP1',`OP3',`OP5',`OP7',`D1',`D3',`D5',`D7',`Gnd',`NC',`/Irq',`D6',`D4',`D2',`D0',`OP6',`OP4',`OP2',`OP0',`TxD0',`NC',`RxD0',`X1-Clk',`X2',`/Reset',`/CS',`IP2',`/IAck',`IP5',`IP4',`Vcc'') + +define(`Description_PEB2086N_plcc', `ISAC-S') +define(`Param1_PEB2086N_plcc', 44) +define(`Param2_PEB2086N_plcc', 150) +define(`PinList_PEB2086N_plcc', ``AD4',`AD5',`AD6',`AD7',`SDAR',`A1',`SDAX/SDS1',`SCA/SDS2',`RST',`A5',`Vssd',`DCL',`FSC1',`FSC2',`M1',`X2',`A4',`A3',`NC',`X1',`M0',`CP/BCL',`/INT',`Vssa',`XTAL2',`XTAL1',`SR2',`SR1',`NC',`NC',`Vdd',`SX1',`SX2',`IDP0',`IDP1',`ALE',`/CS',`/WR',`/RD',`A0',`AD0',`AD1',`AD2',`AD3'') + +define(`Description_MC68HC11_plcc', `micro controller') +define(`Param1_MC68HC11_plcc', 52) +define(`Param2_MC68HC11_plcc', 150) +define(`PinList_MC68HC11_plcc', ``Vss',`MdB_StB',`MdA_/LIR',`StA_/AS',`E',`StB_R/W',`EXTAL',`XTAL',`PC0_AD0',`PC1_AD1',`PC2_AD2',`PC3_AD3',`PC4_AD4',`PC5_AD5',`PC6_AD6',`PC7_AD7',`/RESET',`/XIRQ',`/IRQ',`PD0_RxD',`PD1_Txd',`PD2_MISO',`PD3_MOSI',`PD4_SCK',`PD5_/SS',`Vdd',`PA7_OCAI',`PA6_OC2',`PA5_OC3',`PA4_OC4',`PA3_OCIC',`PA2_IC1',`PA1_IC2',`PA0_IC3',`PB7_A15',`PB6_A14',`PB5_A13',`PB4_A12',`PB3_A11',`PB2_A10',`PB1_A9',`PB0_A8',`PE0_AN0',`PE4_AN4',`PE1_AN1',`PE5_AN5',`PE2_AN2',`PE6_AN6',`PE3_AN3',`PE7_AN7',`VRef_l',`VRef_h'') + +define(`Description_PIC16C54_dil', `micro controller') +define(`Param1_PIC16C54_dil', 18) +define(`Param2_PIC16C54_dil', 300) +define(`PinList_PIC16C54_dil', ``RA2',`RA3',`RTCC',`/MCLR',`VSS',`RB0',`RB1',`RB2',`RB3',`RB4',`RB5',`RB6',`RB7',`VDD',`OSC2',`OSC1',`RA0',`RA1'') + +define(`Description_PIC16C55_dil', `micro controller') +define(`Param1_PIC16C55_dil', 28) +define(`Param2_PIC16C55_dil', 600) +define(`PinList_PIC16C55_dil', ``RTCC',`VDD',`nc',`VSS',`nc',`RA0',`RA1',`RA2',`RA3',`RB0',`RB1',`RB2',`RB3',`RB4',`RB5',`RB6',`RB7',`RC0',`RC1',`RC2',`RC3',`RC4',`RC5',`RC6',`RC7',`OSC2',`OSC1',`/MCLR'') + +define(`Description_PIC16C61_dil', `micro controller') +define(`Param1_PIC16C61_dil', 18) +define(`Param2_PIC16C61_dil', 300) +define(`PinList_PIC16C61_dil', ``RA2',`RA3',`RA4',`/MCLR',`VSS',`RB0/INT',`RB1',`RB2',`RB3',`RB4',`RB5',`RB6',`RB7',`VDD',`OSC2',`OSC1',`RA0',`RA1'') + +define(`Description_PIC16C64_dil', `micro controller') +define(`Param1_PIC16C64_dil', 40) +define(`Param2_PIC16C64_dil', 600) +define(`PinList_PIC16C64_dil', ``/MCLR',`RA0',`RA1',`RA2',`RA3',`RA4/T0CKI',`RA5/SS',`RE0/RD',`RE1/WR',`RE2/CS',`VDD',`VSS',`OSC1',`OSC2',`RC0/T0OSO/T1CKI',`RC1/T0OSI',`RC2/CCPI',`RC3/SCK/SCL',`RD0/PSP0',`RD1/PSP1',`RD2/PSP2',`RD3/PSP3',`RC4/SDI/SDA',`RC5/SDO',`RC6',`RC7',`RD4/PSP4',`RD5/PSP5',`RD6/PSP6',`RD7/PSP7',`VSS',`VDD',`RB0/INT',`RB1',`RB2',`RB3',`RB4',`RB5',`RB6',`RB7'') + +define(`Description_PIC16C71_dil', `micro controller') +define(`Param1_PIC16C71_dil', 18) +define(`Param2_PIC16C71_dil', 300) +define(`PinList_PIC16C71_dil', ``RA2/AIN2',`RA3/AIN3',`RA4/T0CKI',`/MCLR',`VSS',`RB0/INT',`RB1',`RB2',`RB3',`RB4',`RB5',`RB6',`RB7',`VDD',`OSC2',`OSC1',`RA0/AIN0',`RA1/AIN1'') + +define(`Description_PIC16C74_dil', `micro controller') +define(`Param1_PIC16C74_dil', 40) +define(`Param2_PIC16C74_dil', 600) +define(`PinList_PIC16C74_dil', ``/MCLR',`RA0/AN0',`RA1/AN1',`RA2/AN2',`RA3/AN3',`RA4/T0CKI',`RA5/AN4/SS',`RE0/RD/AN5',`RE1/WR/AN6',`RE2/CS/AN7',`VDD',`VSS',`OSC1',`OSC2',`RC0/T1OSO/T1CKI',`RC1/T0OSI/CCP2',`RC2/CCPI',`RC3/SCK/SCL',`RD0/PSP0',`RD1/PSP1',`RD2/PSP2',`RD3/PSP3',`RC4/SDI/SDA',`RC5/SDO',`RC6/TX/CK',`RC7/RX/DT',`RD4/PSP4',`RD5/PSP5',`RD6/PSP6',`RD7/PSP7',`VSS',`VDD',`RB0/INT',`RB1',`RB2',`RB3',`RB4',`RB5',`RB6',`RB7'') + +define(`Description_PIC16C84_dil', `micro controller') +define(`Param1_PIC16C84_dil', 18) +define(`Param2_PIC16C84_dil', 300) +define(`PinList_PIC16C84_dil', ``RA2',`RA3',`RA4/T0CKI',`/MCLR',`VSS',`RB0/INT',`RB1',`RB2',`RB3',`RB4',`RB5',`RB6',`RB7',`VDD',`OSC2',`OSC1',`RA0',`RA1'') + +define(`Description_PIC17C42_dil', `micro controller') +define(`Param1_PIC17C42_dil', 40) +define(`Param2_PIC17C42_dil', 600) +define(`PinList_PIC17C42_dil', ``VDD',`RC0/AD0',`RC1/AD1',`RC2/AD2',`RC3/AD3',`RC4/AD4',`RC5/AD5',`RC6/AD6',`RC7/AD7',`VSS',`RB0/CAP1',`RB1/CAP2',`RB2/PWM1',`RB3/PWM2',`RB4/TCLK12',`RB5/TCLK3',`RB6',`RB7',`OSC1',`OSC2',`RA5/TX/CK',`RA4/RX/DT',`RA3',`RA2',`RA1/T0CKI',`RA0/INT',`TEST',`RE2/WR',`RE1/OE',`RE0/ALE',`VSS',`/MCLR',`RD7/AD15',`RD6/AD14',`RD5/AD13',`RD4/AD12',`RD3/AD11',`RD2/AD10',`RD1/AD9',`RD0/AD8'') + +define(`Description_RTC62421_dil', `real-time clock') +define(`Param1_RTC62421_dil', 18) +define(`Param2_RTC62421_dil', 300) +define(`PinList_RTC62421_dil', ``Std.P',`/Cs0',`Ale',`A0',`A1',`A2',`A3',`/Read',`Gnd',`/Write',`D3',`D2',`D1',`D0',`Cs1',`(Vdd)',`(Vdd)',`Vdd'') + +define(`Description_TI34010_plcc', `graphic processor') +define(`Param1_TI34010_plcc', 68) +define(`Param2_TI34010_plcc', 150) +define(`PinList_TI34010_plcc', ``Gnd',`Run/Emu',`/Reset',`VClk',`InClk',`/LInt1',`/LInt2',`/Hold',`LRdy',`LAD0',`LAD1',`LAD2',`LAD3',`LAD4',`LAD5',`LAD6',`LAD7',`Gnd',`LAD8',`LAD9',`LAD10',`LAD11',`LAD12',`LAD13',`LAD14',`LAD15',`Vcc',`LClk1',`LClk2',`/HSync',`/VSync',`/Blank',`/Hlda/Emu',`/LAL',`Gnd',`DDout',`/DEn',`/RAS',`/CAS',`/We',`/TRQE',`/HInt',`HRdy',`HD15',`HD14',`HD13',`HD12',`HD11',`HD10',`HD9',`HD8',`Gnd',`HD7',`HD6',`HD5',`HD4',`HD3',`HD2',`HD1',`HD0',`Vcc',`/HUDS',`/HLDS',`/HRead',`/HWrite',`/HCs',`HFS0',`HFS1'') + +define(`Description_WD33C93A_dil', `SE-SCSI-I controller') +define(`Param1_WD33C93A_dil', 40) +define(`Param2_WD33C93A_dil', 600) +define(`PinList_WD33C93A_dil', ``I/O',`/MSG',`GND',`C/D',`/BSY',`/SEL',`CLK',`/DRQ',`/DACK',`INTRQ',`D0',`D1',`D2',`D3',`D4',`D5',`D6',`D7',`A0',`GND',`/CS',`/WE',`/RE',`ALE',`/SDP',`/SD0',`/SD1',`GND',`/SD2',`/SD3',`/SD4',`/SD5',`/SD6',`/SD7',`GND',`/RESET',`/ATN',`/ACK',`/REQ',`Vcc'') + +# ---------------------------------------------------------------------- +# use a special definition for some PGA packaged circuits +# +define(`Description_MC68030_pga', `CPU') +define(`PKG_MC68030_pga', + `Element(0x00 "$1" "`$2'" "$3" 450 650 0 100 0x00) + ( + Pin(50 50 50 20 "/BR" 0x201) + Pin(150 50 50 20 "A0" 0x01) + Pin(250 50 50 20 "A30" 0x01) + Pin(350 50 50 20 "A28" 0x01) + Pin(450 50 50 20 "A26" 0x01) + Pin(550 50 50 20 "A24" 0x01) + Pin(650 50 50 20 "A23" 0x01) + Pin(750 50 50 20 "A21" 0x01) + Pin(850 50 50 20 "A19" 0x01) + Pin(950 50 50 20 "A17" 0x01) + Pin(1050 50 50 20 "A15" 0x01) + Pin(1150 50 50 20 "A13" 0x01) + Pin(1250 50 50 20 "A10" 0x01) + Pin(50 150 50 20 "/RMC" 0x01) + Pin(150 150 50 20 "/BG" 0x01) + Pin(250 150 50 20 "A31" 0x01) + Pin(350 150 50 20 "A29" 0x01) + Pin(450 150 50 20 "A27" 0x01) + Pin(550 150 50 20 "A25" 0x01) + Pin(650 150 50 20 "A22" 0x01) + Pin(750 150 50 20 "A20" 0x01) + Pin(850 150 50 20 "A16" 0x01) + Pin(950 150 50 20 "A14" 0x01) + Pin(1050 150 50 20 "A12" 0x01) + Pin(1150 150 50 20 "A8" 0x01) + Pin(1250 150 50 20 "A7" 0x01) + Pin(50 250 50 20 "FC1" 0x01) + Pin(150 250 50 20 "/CIOUT" 0x01) + Pin(250 250 50 20 "/BGACK" 0x01) + Pin(350 250 50 20 "A1" 0x01) + Pin(450 250 50 20 "GND" 0x01) + Pin(550 250 50 20 "VCC" 0x01) + Pin(650 250 50 20 "GND" 0x01) + Pin(750 250 50 20 "A18" 0x01) + Pin(850 250 50 20 "GND" 0x01) + Pin(950 250 50 20 "A11" 0x01) + Pin(1050 250 50 20 "A9" 0x01) + Pin(1150 250 50 20 "A5" 0x01) + Pin(1250 250 50 20 "A4" 0x01) + Pin(50 350 50 20 "FC2" 0x01) + Pin(150 350 50 20 "FC0" 0x01) + Pin(250 350 50 20 "/OCS" 0x01) + Pin(350 350 50 20 "VCC" 0x01) + Pin(450 350 50 20 "NC" 0x01) + Pin(950 350 50 20 "VCC" 0x01) + Pin(1050 350 50 20 "A6" 0x01) + Pin(1150 350 50 20 "A3" 0x01) + Pin(1250 350 50 20 "A2" 0x01) + Pin(50 450 50 20 "CLK" 0x01) + Pin(150 450 50 20 "/AVEC" 0x01) + Pin(250 450 50 20 "GND" 0x01) + Pin(1050 450 50 20 "GND" 0x01) + Pin(1150 450 50 20 "NC" 0x01) + Pin(1250 450 50 20 "/IPEND" 0x01) + Pin(50 550 50 20 "/DSACK0" 0x01) + Pin(150 550 50 20 "VCC" 0x01) + Pin(250 550 50 20 "GND" 0x01) + Pin(350 550 50 20 "NC" 0x01) + Pin(950 550 50 20 "NC" 0x01) + Pin(1050 550 50 20 "VCC" 0x01) + Pin(1150 550 50 20 "/RESET" 0x01) + Pin(1250 550 50 20 "/MMUDIS" 0x01) + Pin(50 650 50 20 "/STERM" 0x01) + Pin(150 650 50 20 "/DSACK1" 0x01) + Pin(250 650 50 20 "GND" 0x01) + Pin(1050 650 50 20 "GND" 0x01) + Pin(1150 650 50 20 "/IPL2" 0x01) + Pin(1250 650 50 20 "/IPL1" 0x01) + Pin(50 750 50 20 "/BERR" 0x01) + Pin(150 750 50 20 "/HALT" 0x01) + Pin(250 750 50 20 "VCC" 0x01) + Pin(1050 750 50 20 "VCC" 0x01) + Pin(1150 750 50 20 "/CDIS" 0x01) + Pin(1250 750 50 20 "/IPL0" 0x01) + Pin(50 850 50 20 "/CBACK" 0x01) + Pin(150 850 50 20 "/AS" 0x01) + Pin(250 850 50 20 "GND" 0x01) + Pin(1050 850 50 20 "GND" 0x01) + Pin(1150 850 50 20 "/STATUS" 0x01) + Pin(1250 850 50 20 "/REFILL" 0x01) + Pin(50 950 50 20 "/CBREQ" 0x01) + Pin(150 950 50 20 "/DS" 0x01) + Pin(250 950 50 20 "SIZ1" 0x01) + Pin(350 950 50 20 "VCC" 0x01) + Pin(450 950 50 20 "NC" 0x01) + Pin(950 950 50 20 "VCC" 0x01) + Pin(1050 950 50 20 "D5" 0x01) + Pin(1150 950 50 20 "D1" 0x01) + Pin(1250 950 50 20 "D0" 0x01) + Pin(50 1050 50 20 "/CIIN" 0x01) + Pin(150 1050 50 20 "SIZ0" 0x01) + Pin(250 1050 50 20 "R/W" 0x01) + Pin(350 1050 50 20 "D30" 0x01) + Pin(450 1050 50 20 "GND" 0x01) + Pin(550 1050 50 20 "VCC" 0x01) + Pin(650 1050 50 20 "GND" 0x01) + Pin(750 1050 50 20 "GND" 0x01) + Pin(850 1050 50 20 "GND" 0x01) + Pin(950 1050 50 20 "D10" 0x01) + Pin(1050 1050 50 20 "D7" 0x01) + Pin(1150 1050 50 20 "D4" 0x01) + Pin(1250 1050 50 20 "D2" 0x01) + Pin(50 1150 50 20 "/DBEN" 0x01) + Pin(150 1150 50 20 "/ECS" 0x01) + Pin(250 1150 50 20 "D29" 0x01) + Pin(350 1150 50 20 "D27" 0x01) + Pin(450 1150 50 20 "D24" 0x01) + Pin(550 1150 50 20 "D22" 0x01) + Pin(650 1150 50 20 "D20" 0x01) + Pin(750 1150 50 20 "D17" 0x01) + Pin(850 1150 50 20 "D14" 0x01) + Pin(950 1150 50 20 "D12" 0x01) + Pin(1050 1150 50 20 "D9" 0x01) + Pin(1150 1150 50 20 "D6" 0x01) + Pin(1250 1150 50 20 "D3" 0x01) + Pin(50 1250 50 20 "D31" 0x01) + Pin(150 1250 50 20 "D28" 0x01) + Pin(250 1250 50 20 "D26" 0x01) + Pin(350 1250 50 20 "D25" 0x01) + Pin(450 1250 50 20 "D23" 0x01) + Pin(550 1250 50 20 "D21" 0x01) + Pin(650 1250 50 20 "D19" 0x01) + Pin(750 1250 50 20 "D18" 0x01) + Pin(850 1250 50 20 "D16" 0x01) + Pin(950 1250 50 20 "D15" 0x01) + Pin(1050 1250 50 20 "D13" 0x01) + Pin(1150 1250 50 20 "D11" 0x01) + Pin(1250 1250 50 20 "D8" 0x01) + ElementLine(30 0 1300 0 20) + ElementLine(1300 0 1300 1300 20) + ElementLine(1300 1300 0 1300 20) + ElementLine(0 1300 0 30 20) + ElementLine(0 30 30 0 20) + ElementLine(0 100 100 100 10) + ElementLine(100 100 100 0 10) + Mark(50 50) + ) +') + +define(`Description_MC68881_pga', `FPU') +define(`PKG_MC68881_pga', + `Element(0x00 "$1" "`$2'" "$3" 350 450 0 100 0x00) + ( + Pin(50 50 50 20 "VCC" 0x201) + Pin(150 50 50 20 "GND" 0x01) + Pin(250 50 50 20 "D0" 0x01) + Pin(350 50 50 20 "D1" 0x01) + Pin(450 50 50 20 "D3" 0x01) + Pin(550 50 50 20 "D4" 0x01) + Pin(650 50 50 20 "D6" 0x01) + Pin(750 50 50 20 "D7" 0x01) + Pin(850 50 50 20 "D8" 0x01) + Pin(950 50 50 20 "GND" 0x01) + Pin(50 150 50 20 "VCC" 0x01) + Pin(150 150 50 20 "GND" 0x01) + Pin(250 150 50 20 "GND" 0x01) + Pin(350 150 50 20 "/SENSE" 0x01) + Pin(450 150 50 20 "D2" 0x01) + Pin(550 150 50 20 "D5" 0x01) + Pin(650 150 50 20 "GND" 0x01) + Pin(750 150 50 20 "VCC" 0x01) + Pin(850 150 50 20 "D10" 0x01) + Pin(950 150 50 20 "D11" 0x01) + Pin(50 250 50 20 "GND" 0x01) + Pin(150 250 50 20 "CLK" 0x01) + Pin(250 250 50 20 "GND" 0x01) + Pin(750 250 50 20 "D9" 0x01) + Pin(850 250 50 20 "D13" 0x01) + Pin(950 250 50 20 "D14" 0x01) + Pin(50 350 50 20 "/RESET" 0x01) + Pin(150 350 50 20 "GND" 0x01) + Pin(850 350 50 20 "D12" 0x01) + Pin(950 350 50 20 "D15" 0x01) + Pin(50 450 50 20 "NC" 0x01) + Pin(150 450 50 20 "VCC" 0x01) + Pin(850 450 50 20 "VCC" 0x01) + Pin(950 450 50 20 "GND" 0x01) + Pin(50 550 50 20 "/SIZE" 0x01) + Pin(150 550 50 20 "GND" 0x01) + Pin(850 550 50 20 "D17" 0x01) + Pin(950 550 50 20 "D16" 0x01) + Pin(50 650 50 20 "/DS" 0x01) + Pin(150 650 50 20 "A4" 0x01) + Pin(850 650 50 20 "D20" 0x01) + Pin(950 650 50 20 "D18" 0x01) + Pin(50 750 50 20 "/AS" 0x01) + Pin(150 750 50 20 "A2" 0x01) + Pin(250 750 50 20 "A0" 0x01) + Pin(750 750 50 20 "VCC" 0x01) + Pin(850 750 50 20 "GND" 0x01) + Pin(950 750 50 20 "D19" 0x01) + Pin(50 850 50 20 "A3" 0x01) + Pin(150 850 50 20 "VCC" 0x01) + Pin(250 850 50 20 "/CS" 0x01) + Pin(350 850 50 20 "/DSACK0" 0x01) + Pin(450 850 50 20 "D31" 0x01) + Pin(550 850 50 20 "D28" 0x01) + Pin(650 850 50 20 "D25" 0x01) + Pin(750 850 50 20 "GND" 0x01) + Pin(850 850 50 20 "D23" 0x01) + Pin(950 850 50 20 "D21" 0x01) + Pin(50 950 50 20 "A1" 0x01) + Pin(150 950 50 20 "R/W" 0x01) + Pin(250 950 50 20 "GND" 0x01) + Pin(350 950 50 20 "/DSACK1" 0x01) + Pin(450 950 50 20 "D30" 0x01) + Pin(550 950 50 20 "D29" 0x01) + Pin(650 950 50 20 "D27" 0x01) + Pin(750 950 50 20 "D26" 0x01) + Pin(850 950 50 20 "D24" 0x01) + Pin(950 950 50 20 "D22" 0x01) + ElementLine(30 0 1000 0 20) + ElementLine(1000 0 1000 1000 20) + ElementLine(1000 1000 0 1000 20) + ElementLine(0 1000 0 30 20) + ElementLine(0 30 30 0 20) + ElementLine(0 100 100 100 10) + ElementLine(100 100 100 0 10) + Mark(50 50) + ) +') + +# ------------------------------------------------------------------------ +# based on mail by Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de) +# +define(`Description_MC68332_qfp', `micro controller') +define(`Param1_MC68332_qfp', 132) +define(`PinList_MC68332_qfp', ``Vdd',`Vss(g)',`TpuCh11',`TpuCh10',`TpuCh9',`TpuCh8',`Vdd',`Vss(g)',`TpuCh7',`TpuCh6',`TpuCh5',`TpuCh4',`TpuCh3',`TpuCh2',`TpuCh1',`TpuCh0',`Vss(g)',`Vdd',`Vstby',`A1',`A2',`A3',`A4',`A5',`A6',`A7',`A8',`Vdd',`Vss(g)',`A9',`A10',`A11',`A12',`Vss(g)',`A13',`A14',`A15',`A16',`Vdd',`Vss(g)',`A17',`A18',`MISO',`MOSI',`SCk',`/SS',`PCS1',`PCS2',`PCS3',`Vdd',`Vss(g)',`TxD',`RxD',`DSO',`DSI',`DSClk',`TSC',`Freeze',`Vss(g)',`Xtal',`VddSyn',`EXtal',`Vdd',`XFc',`Vdd',`ClkOut',`Vss(g)',`/Res',`/Halt',`/BErr',`PF7',`PF6',`PF5',`PF4',`PF3',`PF2',`PF1',`PF0',`R/W',`PE7',`PE6',`PE5',`Vss(g)',`Vdd',`PE4',`PE3',`PE2',`PE1',`PE0',`A0',`D15',`D14',`D13',`D12',`Vss(g)',`Vdd',`D11',`D10',`D9',`D8',`Vss(g)',`D7',`D6',`D5',`D4',`Vss(g)',`Vdd',`D3',`D2',`D1',`D0',`/CSboot',`/CS0',`/CS1',`/CS2',`Vdd',`Vss(g)',`/CS3',`/CS4',`/CS5',`/CS6',`/CS7',`/CS8',`/CS9',`/CS10',`Vdd',`Vss(g)',`T2Clk',`TpuCh15',`TpuCh14',`TpuCh13',`TpuCh12'') + +# ------------------------------------------------------------------------ +# based on mail by Olaf Kaluza (olaf@criseis.ruhr.de) +# +define(`Description_MAB8031AH_dil', `micro controller') +define(`Param1_MAB8031AH_dil', 40) +define(`Param2_MAB8031AH_dil', 600) +define(`PinList_MAB8031AH_dil', ``P1.0',`P1.1',`P1.2',`P1.3',`P1.4',`P1.5',`P1.6',`P1.7',`RST',`RxD/P3.0',`TxD/P3.1',`/INT0/P3.2',`/INT1/P3.3',`T0/P3.4',`T1/P3.5',`/WR/P3.6',`/RD/P3.7',`Xtal2',`Xtal1',`Uss',`P2.0/A8',`P2.1/A9',`P2.2/A10',`P2.3/A11',`P2.4/A12',`P2.5/A13',`P2.6/A14',`P2.7/A15',`/PSEN',`ALE',`/EA',`AD7',`AD6',`AD5',`AD4',`AD3',`AD2',`AD1',`AD0',`Ucc'') + +define(`Description_Z8536_dil', `CIO counter/timer with parallel I/O unit') +define(`Param1_Z8536_dil', 40) +define(`Param2_Z8536_dil', 600) +define(`PinList_Z8536_dil', ``D4',`D5',`D6',`D7',`/RD',`/WR',`Gnd',`PB0',`PB1',`PB2',`PB3',`PB4',`PB5',`PB6',`PB7',`PCLK',`IEI',`IEO',`PC0',`PC1',`PC2',`PC3',`/Vcc',`/INT',`/INTACK',`PA7',`PA6',`PA5',`PA4',`PA3',`PA2',`PA1',`PA0',`A0',`A1',`/CE',`D0',`D1',`D2',`D3'') + +define(`Description_6551_dil', `ACIA for 65xx series') +define(`Param1_6551_dil', 28) +define(`Param2_6551_dil', 600) +define(`PinList_6551_dil', ``Vss',`CS0',`/CS1',`/Reset',`RxC',`XTLI',`XTLO',`/RTS',`/CTS',`TxD',`/DTR',`RxD',`RS0',`RS1',`Vcc',`/DCD',`/DSR',`D0',`D1',`D2',`D3',`D4',`D5',`D6',`D7',`/Irq',`Phi2',`R-/W'') + +define(`Description_6801_dil', `micro controller') +define(`Param1_6801_dil', 40) +define(`Param2_6801_dil', 600) +define(`PinList_6801_dil', ``Vss',`XTAL1',`EXTAL2',`/NMI',`/IRQ1',`/Reset',`Vcc',`P20-Mode0',`P21-Mode1',`P22-Mode2',`P23-RxD',`P24-TxD',`P10',`P11',`P12',`P13',`P14',`P15',`P16',`P17',`Vcc-StdBy',`P47-A15',`P46-A14',`P45-A13',`P44-A12',`P43-A11',`P42-A10',`P41-A9',`P40-A8',`P37-A7-D7',`P36-A6-D6',`P35-A5-D5',`P34-A4-D4',`P33-A3-D3',`P32-A2-D2',`P31-A1-D1',`P30-A0-D0',`SC2-R-/W',`SC1-/AS',`E'') + +define(`Description_81C17_dil', `UART') +define(`Param1_81C17_dil', 20) +define(`Param2_81C17_dil', 300) +define(`PinList_81C17_dil', ``D=',`D1',`/CS',`/Rd',`D2',`D3',`D4',`/Wr',`D5',`Gnd',`D6',`D7',`Clk',`/Int',`RS',`RxD',`TxD',`/CP1',`/CP2',`Vcc'') + + +define(`Description_AT90S1200_dil', `AVR Enhanced RISC microcontroller') +define(`Param1_AT90S1200_dil', 20) +define(`Param2_AT90S1200_dil', 300) +define(`PinList_AT90S1200_dil', ``/Reset',`PD0',`PD1',`XTAL2',`XTAL1',`PD2/INT0',`PD3',`PD4/T0',`PD5',`Gnd' ,`PD6',`PB0/AIN0',`PB1/AIN1',`PB2',`PB3',`PB4',`PB5/MOSI',`PB6/MISO',`PB7/S CK',`Vcc'') + +define(`Description_AT90S1300_dil', `AVR Enhanced RISC microcontroller') +define(`Param1_AT90S1300_dil', 20) +define(`Param2_AT90S1300_dil', 300) +define(`PinList_AT90S1300_dil', ``/Reset',`PD0',`PD1',`XTAL2',`XTAL1',`PD2/INT0',`PD3',`PD4/T0',`PD5',`Gnd' ,`PD6',`PB0/AIN0',`PB1/AIN1',`PB2',`PB3',`PB4',`PB5/MOSI',`PB6/MISO',`PB7/S CK',`Vcc'') + +define(`Description_AT90S2313_dil', `AVR Enhanced RISC microcontroller') +define(`Param1_AT90S2313_dil', 20) +define(`Param2_AT90S2313_dil', 300) +define(`PinList_AT90S2313_dil', ``/Reset',`PD0/RxD',`PD1/TxD',`XTAL2',`XTAL1',`PD2/INT0',`PD3/INT1',`PD4/T0',`PD5/T1',`Gnd',`PD6/ICP',`PB0/AIN0',`PB1/AIN1',`PB2/OC0',`PB3/OC1',`PB4', `PB5/MOSI',`PB6/MISO',`PB7/SCK',`Vcc'') + +define(`Description_AT90S4434_dil', `AVR Enhanced RISC microcontroller') +define(`Param1_AT90S4434_dil', 28) +define(`Param2_AT90S4434_dil', 300) +define(`PinList_AT90S4434_dil', ``/Reset',`PD0/RxD',`PD1/TxD',`PD2/INT0',`PD3/INT1',`PD4/T0',`Vcc',`Gnd',`XTAL1',`XTAL2',`PD5/T1',`PD6/AIN0',`PD7/AIN1',`PB0/ICP',`PB1/OC1',`PB2//SS', `PB3/MOSI',`PB4/MISO',`PB5/SCK',`AVcc',`AREF',`AGnd',`PC0/ADC0',`PC1/ADC1',`PC2/ADC2',`PC3/ADC3',`PC4/ADC4',`PC5/ADC5'') + +define(`Description_AT90S8535_dil', `AVR Enhanced RISC microcontroller') +define(`Param1_AT90S8535_dil', 40) +define(`Param2_AT90S8535_dil', 600) +define(`PinList_AT90S8535_dil', ``PB0/T0',`PB1/T1',`PB2/AIN0',`PB3/AIN1',`PB4//SS',`PB5/MOSI',`PB6/MISO',`PB7/SCK',`/Reset',`Vcc',`Gnd',`XTAL2',`XTAL1',`PD0/RxD',`PD1/TxD',`PD2/INT0', `PD3/INT1',`PD4/OC1B',`PD5/OC1A',`PD6/ICP',`PD7/OC2',`PC0',`PC1',`PC2',`PC3',`PC4',`PC5',`PC6/TOSC1',`PC7/TOSC2',`AVcc',`AGnd',`AREF',`PA7/ADC7',`PA6/ADC6',`PA5/ADC5',`PA4/ADC4',`PA3/ADC3',`PA2/ADC2',`PA1/ADC1',`PA0/ADC0'') + +define(`Description_AT90S8535_plcc', `AVR Enhanced RISC microcontroller') +define(`Param1_AT90S8535_plcc', 44) +define(`Param2_AT90S8535_plcc', 150) +define(`PinList_AT90S8535_plcc', ``Gnd',`PB0/T0',`PB1/T1',`PB2/AIN0',`PB3/AIN1',`PB4//SS',`PB5/MOSI',`PB6/MISO',`PB7/SCK',`/Reset',`Vcc',`Gnd',`XTAL2',`XTAL1',`PD0/RxD',`PD1/TxD',`PD2/INT0', `PD3/INT1',`PD4/OC1B',`PD5/OC1A',`PD6/ICP',`PD7/OC2',`Vcc',`Gnd',`PC0',`PC1',`PC2',`PC3',`PC4',`PC5',`PC6/TOSC1',`PC7/TOSC2',`AVcc',`AGnd',`AREF',`PA7/ADC7',`PA6/ADC6',`PA5/ADC5',`PA4/ADC4',`PA3/ADC3',`PA2/ADC2',`PA1/ADC1',`PA0/ADC0',`Vcc'') + +divert(0)dnl Property changes on: tags/1.0.5/old/oldlib/lib/lsi.m4 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/1.0.5/old/oldlib/lib/m4lib_to_newlib.sh =================================================================== --- tags/1.0.5/old/oldlib/lib/m4lib_to_newlib.sh (nonexistent) +++ tags/1.0.5/old/oldlib/lib/m4lib_to_newlib.sh (revision 953) @@ -0,0 +1,338 @@ +#!/bin/sh +# +# $Id$ +# + +# This script is used to extract all elements from an "oldlib" (M4) +# style library and place them in individual "newlib" style files. + +outd=/tmp/newlib +contents=pcblib.contents +AWK=${AWK:-awk} +PCB=${PCB:-pcb} + +usage() { +cat << EOF +Usage: + $0 [-h | --help] + $0 [-v | --version] + $0 [-c|--contents contents_file] [-o|--output output_directory] [-p|--png] [-d|--dpi] + +Extracts all footprints from an m4 library and creates a "newlib" style +library. + +The following options are supported: + + -a | --awk awk : Specifies the awk implementation to use. Defaults to "${AWK}". + + -c | --contents file : Specifies the contents file to be use as an input. + Default is "${contents}". + + -d | --dpi : Specifies that the png output should use a fixed pixels + per inch scaling instead of a fixed maximum size. This + option is useful when comparing the before and after footprints + when making footprint library changes. + + -h | --help : Outputs this message and exits. + + -o | --output dir : Specifies the directory that the newlib library will be + written to. This directory must exist and be empty. + Default is "${outd}". + + -P | --pcb pcb : Specifies the pcb binary to use for creating png previews. Defaults to + "${PCB}" + + -p | --png : Generates png previews for all the footprints. + + -v | --version : Displays the version of this script and exits. + +EOF +} + +version() { + $AWK '/# [\$]Id:.*$/ {sub(/,v/,""); \ + print $3 " Version "$4", "$5}' $0 +} + +do_png=0 +png_flag="--xy-max 200" + +while test $# -gt 0 ; do + case $1 in + -a|--awk ) + AWK="$2" + shift 2 + ;; + + -c|--contents ) + contents=$2 + shift 2 + ;; + + -d|--dpi ) + png_flag="--dpi 1000" + shift + ;; + + -h|--help ) + usage + exit 0 + ;; + + -o|--output ) + outd=$2 + shift 2 + ;; + + -P|--pcb ) + PCB="$2" + shift 2 + ;; + + -p|--png ) + do_png=1 + shift + ;; + + -v|--version ) + version + exit 0 + ;; + + -* ) + echo "ERROR: $0: Unknown option $1" + usage + exit 1 + ;; + + * ) + break + ;; + esac +done + + +if test -d ${outd} ; then + echo "Output directory ${outd} already exists" + exit 1 +else + mkdir -p ${outd} +fi +outd_full="`cd $outd && pwd`" + +$AWK ' + +BEGIN { + first = 1; + libind = ""; +} + +# we have to use this trick because variables like outd are not yet defined +# in BEGIN. +first == 1 { + brokenurl = "broken.html"; + broken = outd "/" brokenurl; + print "" > broken; + + ind = outd "/index.html"; + + print "" > ind; + print "PCB Footprint Library" >> ind; + print "" >> ind; + print "

PCB Footprint Library

" >> ind; + print "