You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(4) |
Mar
(5) |
Apr
|
May
(5) |
Jun
(30) |
Jul
(2) |
Aug
(18) |
Sep
(14) |
Oct
(7) |
Nov
(21) |
Dec
(44) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(63) |
Feb
(94) |
Mar
(54) |
Apr
(39) |
May
(34) |
Jun
(25) |
Jul
(10) |
Aug
(33) |
Sep
(16) |
Oct
(62) |
Nov
(12) |
Dec
(2) |
| 2005 |
Jan
(71) |
Feb
(8) |
Mar
(50) |
Apr
|
May
(2) |
Jun
(12) |
Jul
(19) |
Aug
(8) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(8) |
| 2006 |
Jan
(10) |
Feb
(1) |
Mar
(301) |
Apr
(232) |
May
(26) |
Jun
(20) |
Jul
(26) |
Aug
(79) |
Sep
(92) |
Oct
(174) |
Nov
(17) |
Dec
(93) |
| 2007 |
Jan
(27) |
Feb
(179) |
Mar
(37) |
Apr
(81) |
May
(20) |
Jun
(5) |
Jul
|
Aug
(40) |
Sep
(68) |
Oct
(8) |
Nov
(47) |
Dec
(34) |
| 2008 |
Jan
(154) |
Feb
(15) |
Mar
(5) |
Apr
(21) |
May
(4) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(8) |
Oct
(9) |
Nov
(35) |
Dec
(50) |
| 2009 |
Jan
(8) |
Feb
(10) |
Mar
(6) |
Apr
(9) |
May
(7) |
Jun
(40) |
Jul
(7) |
Aug
(5) |
Sep
(2) |
Oct
(16) |
Nov
(42) |
Dec
(5) |
| 2010 |
Jan
(3) |
Feb
(15) |
Mar
(32) |
Apr
(18) |
May
(6) |
Jun
(9) |
Jul
|
Aug
(11) |
Sep
(16) |
Oct
|
Nov
(4) |
Dec
(35) |
| 2011 |
Jan
(24) |
Feb
(6) |
Mar
(27) |
Apr
(119) |
May
(72) |
Jun
(20) |
Jul
(31) |
Aug
(88) |
Sep
(86) |
Oct
(14) |
Nov
(11) |
Dec
(30) |
| 2012 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gi...@gp...> - 2011-04-22 17:45:01
|
The branch, master has been updated
via 79417191949173c16579554dc8f8d5b9cbb22b3a (commit)
from 93dbc950600032062d26ffa73c99c5f634a0478c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/main.c | 2 ++
src/misc.c | 24 ++++++++++++++++++------
src/polygon.c | 40 ++++++++++++++++++----------------------
src/polygon.h | 17 +++++++++++++++++
src/thermal.c | 14 ++++++++++----
5 files changed, 65 insertions(+), 32 deletions(-)
=================
Commit Messages
=================
commit 79417191949173c16579554dc8f8d5b9cbb22b3a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 581c7cb... d14c935... M src/main.c
:100644 100644 649208c... 02a883f... M src/misc.c
:100644 100644 78cc3b2... 37e0528... M src/polygon.c
:100644 100644 e29f67f... 315e69b... M src/polygon.h
:100644 100644 f9dd369... d1df1fc... M src/thermal.c
=========
Changes
=========
commit 79417191949173c16579554dc8f8d5b9cbb22b3a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/main.c b/src/main.c
index 581c7cb..d14c935 100644
--- a/src/main.c
+++ b/src/main.c
@@ -55,6 +55,7 @@
#include "misc.h"
#include "lrealpath.h"
#include "free_atexit.h"
+#include "polygon.h"
#include "hid/common/actions.h"
@@ -909,6 +910,7 @@ main (int argc, char *argv[])
srand ( time(NULL) ); /* Set seed for rand() */
+ polygon_init ();
hid_init ();
hid_load_settings ();
diff --git a/src/misc.c b/src/misc.c
index 649208c..02a883f 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -173,6 +173,10 @@ SetPinBoundingBox (PinTypePtr Pin)
*/
width = (Pin->Clearance + Pin->Thickness + 1) / 2;
width = MAX (width, (Pin->Mask + 1) / 2);
+
+ /* Adjust for our discrete polygon approximation */
+ width = (int)((float)width * POLY_CIRC_RADIUS_ADJ + 0.5);
+
Pin->BoundingBox.X1 = Pin->X - width;
Pin->BoundingBox.Y1 = Pin->Y - width;
Pin->BoundingBox.X2 = Pin->X + width;
@@ -226,6 +230,9 @@ SetPadBoundingBox (PadTypePtr Pad)
}
else
{
+ /* Adjust for our discrete polygon approximation */
+ width = (int)((float)width * POLY_CIRC_RADIUS_ADJ + 0.5);
+
Pad->BoundingBox.X1 = MIN (Pad->Point1.X, Pad->Point2.X) - width;
Pad->BoundingBox.X2 = MAX (Pad->Point1.X, Pad->Point2.X) + width;
Pad->BoundingBox.Y1 = MIN (Pad->Point1.Y, Pad->Point2.Y) - width;
@@ -244,6 +251,9 @@ SetLineBoundingBox (LineTypePtr Line)
width = (Line->Thickness + Line->Clearance + 1) / 2;
+ /* Adjust for our discrete polygon approximation */
+ width = (int)((float)width * POLY_CIRC_RADIUS_ADJ + 0.5);
+
Line->BoundingBox.X1 = MIN (Line->Point1.X, Line->Point2.X) - width;
Line->BoundingBox.X2 = MAX (Line->Point1.X, Line->Point2.X) + width;
Line->BoundingBox.Y1 = MIN (Line->Point1.Y, Line->Point2.Y) - width;
@@ -1333,10 +1343,10 @@ GetObjectBoundingBox (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
void
SetArcBoundingBox (ArcTypePtr Arc)
{
- register double ca1, ca2, sa1, sa2;
+ double ca1, ca2, sa1, sa2;
double minx, maxx, miny, maxy;
- register LocationType ang1, ang2, delta, a;
- register LocationType width;
+ LocationType ang1, ang2, delta, a;
+ LocationType width;
/* first put angles into standard form */
if (Arc->Delta > 360)
@@ -1398,14 +1408,16 @@ SetArcBoundingBox (ArcTypePtr Arc)
}
Arc->BoundingBox.X2 = Arc->X - Arc->Width * minx;
-
Arc->BoundingBox.X1 = Arc->X - Arc->Width * maxx;
-
Arc->BoundingBox.Y2 = Arc->Y + Arc->Height * maxy;
-
Arc->BoundingBox.Y1 = Arc->Y + Arc->Height * miny;
width = (Arc->Thickness + Arc->Clearance) / 2;
+
+ /* Adjust for our discrete polygon approximation */
+ width = (int)((float)width * MAX (POLY_CIRC_RADIUS_ADJ,
+ (1.0 + POLY_ARC_MAX_DEVIATION)) + 0.5);
+
Arc->BoundingBox.X1 -= width;
Arc->BoundingBox.X2 += width;
Arc->BoundingBox.Y1 -= width;
diff --git a/src/polygon.c b/src/polygon.c
index 78cc3b2..37e0528 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -108,20 +108,17 @@ dicer output is used for HIDs which cannot render things with holes
#define SUBTRACT_PIN_VIA_BATCH_SIZE 100
#define SUBTRACT_LINE_BATCH_SIZE 20
-/* ---------------------------------------------------------------------------
- * local prototypes
- */
+static double rotate_circle_seg[4];
-#define CIRC_SEGS 40
-static double circleVerticies[] = {
- 1.0, 0.0,
- 0.98768834059513777, 0.15643446504023087,
-};
-/* adjustment to make the segments
- * outline the circle rather than connect
- * points on the circle
- * 1 - cos(\alpha/2) < (\alpha/2)^2/2 */
-static double radius_adjustment = (M_PI/CIRC_SEGS)*(M_PI/CIRC_SEGS)/2;
+void
+polygon_init (void)
+{
+ double cos_ang = cos (2.0 * M_PI / POLY_CIRC_SEGS_F);
+ double sin_ang = sin (2.0 * M_PI / POLY_CIRC_SEGS_F);
+
+ rotate_circle_seg[0] = cos_ang; rotate_circle_seg[1] = -sin_ang;
+ rotate_circle_seg[2] = sin_ang; rotate_circle_seg[3] = cos_ang;
+}
Cardinal
polygon_point_idx (PolygonTypePtr polygon, PointTypePtr point)
@@ -401,16 +398,16 @@ frac_circle (PLINE * c, LocationType X, LocationType Y, Vector v, int range)
poly_InclVertex (c->head.prev, poly_CreateNode (v));
/* move vector to origin */
- e1 = (v[0] - X) * (1 + radius_adjustment);
- e2 = (v[1] - Y) * (1 + radius_adjustment);
+ e1 = (v[0] - X) * POLY_CIRC_RADIUS_ADJ;
+ e2 = (v[1] - Y) * POLY_CIRC_RADIUS_ADJ;
/* NB: the caller adds the last vertex, hence the -1 */
- range = CIRC_SEGS / range - 1;
+ range = POLY_CIRC_SEGS / range - 1;
for (i = 0; i < range; i++)
{
/* rotate the vector */
- t1 = e1 * circleVerticies[2] - e2 * circleVerticies[3];
- e2 = e1 * circleVerticies[3] + e2 * circleVerticies[2];
+ t1 = rotate_circle_seg[0] * e1 + rotate_circle_seg[1] * e2;
+ e2 = rotate_circle_seg[2] * e1 + rotate_circle_seg[3] * e2;
e1 = t1;
v[0] = X + ROUND (e1);
v[1] = Y + ROUND (e2);
@@ -480,8 +477,6 @@ ArcPolyNoIntersect (ArcType * a, BDimension thick)
int i, segs;
double ang, da, rx, ry;
long half;
- static const double delta_th = 0.02; /* polygon diverges from modelled arc
- no more than delta_th * thick */
double radius_adj;
if (thick <= 0)
@@ -498,8 +493,9 @@ ArcPolyNoIntersect (ArcType * a, BDimension thick)
ry = MAX (a->Height - half, 0);
segs = 1;
if(thick > 0)
- segs = MAX (segs, a->Delta * M_PI / 360
- * sqrt(sqrt((double)rx*rx + (double)ry*ry)/delta_th/2/thick));
+ segs = MAX (segs, a->Delta * M_PI / 360 *
+ sqrt (sqrt ((double)rx * rx + (double)ry * ry) /
+ POLY_ARC_MAX_DEVIATION / 2 / thick));
segs = MAX(segs, a->Delta / ARC_ANGLE);
ang = a->StartAngle;
diff --git a/src/polygon.h b/src/polygon.h
index e29f67f..315e69b 100644
--- a/src/polygon.h
+++ b/src/polygon.h
@@ -33,6 +33,23 @@
#include "global.h"
+/* Implementation constants */
+
+#define POLY_CIRC_SEGS 40
+#define POLY_CIRC_SEGS_F ((float)POLY_CIRC_SEGS)
+
+/* adjustment to make the segments outline the circle rather than connect
+ * points on the circle: 1 - cos (\alpha / 2) < (\alpha / 2) ^ 2 / 2
+ */
+#define POLY_CIRC_RADIUS_ADJ (1.0 + M_PI / POLY_CIRC_SEGS_F * \
+ M_PI / POLY_CIRC_SEGS_F / 2.0)
+
+/* polygon diverges from modelled arc no more than MAX_ARC_DEVIATION * thick */
+#define POLY_ARC_MAX_DEVIATION 0.02
+
+/* Prototypes */
+
+void polygon_init (void);
Cardinal polygon_point_idx (PolygonTypePtr polygon, PointTypePtr point);
Cardinal polygon_point_contour (PolygonTypePtr polygon, Cardinal point);
Cardinal prev_contour_point (PolygonTypePtr polygon, Cardinal point);
diff --git a/src/thermal.c b/src/thermal.c
index f9dd369..d1df1fc 100644
--- a/src/thermal.c
+++ b/src/thermal.c
@@ -436,15 +436,21 @@ ThermPoly (PCBTypePtr p, PinTypePtr pin, Cardinal laynum)
/* fix me needs error checking */
if (style == 2)
{
- pa = RectPoly (pin->X - t, pin->X + t, pin->Y - w, pin->Y + w);
+ /* t is the theoretically required length, but we use twice that
+ * to avoid descritisation errors in our circle approximation.
+ */
+ pa = RectPoly (pin->X - t * 2, pin->X + t * 2, pin->Y - w, pin->Y + w);
poly_Boolean_free (m, pa, &arc, PBO_SUB);
- pa = RectPoly (pin->X - w, pin->X + w, pin->Y - t, pin->Y + t);
+ pa = RectPoly (pin->X - w, pin->X + w, pin->Y - t * 2, pin->Y + t * 2);
}
else
{
- pa = diag_line (pin->X, pin->Y, t, w, true);
+ /* t is the theoretically required length, but we use twice that
+ * to avoid descritisation errors in our circle approximation.
+ */
+ pa = diag_line (pin->X, pin->Y, t * 2, w, true);
poly_Boolean_free (m, pa, &arc, PBO_SUB);
- pa = diag_line (pin->X, pin->Y, t, w, false);
+ pa = diag_line (pin->X, pin->Y, t * 2, w, false);
}
poly_Boolean_free (arc, pa, &m, PBO_SUB);
return m;
|
|
From: <gi...@gp...> - 2011-04-21 15:34:53
|
The branch, master has been updated
via 93dbc950600032062d26ffa73c99c5f634a0478c (commit)
from bcd7d69b63ea85a6b83e28e66fb87aebe2d26901 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
=================
Commit Messages
=================
commit 93dbc950600032062d26ffa73c99c5f634a0478c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Tidy up hole_callback routine
:100644 100644 8b9b86a... d6dce62... M src/draw.c
=========
Changes
=========
commit 93dbc950600032062d26ffa73c99c5f634a0478c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Tidy up hole_callback routine
diff --git a/src/draw.c b/src/draw.c
index 8b9b86a..d6dce62 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -298,19 +298,11 @@ hole_callback (const BoxType * b, void *cl)
{
PinTypePtr pin = (PinTypePtr) b;
int plated = cl ? *(int *) cl : -1;
- switch (plated)
- {
- case -1:
- break;
- case 0:
- if (!TEST_FLAG (HOLEFLAG, pin))
- return 1;
- break;
- case 1:
- if (TEST_FLAG (HOLEFLAG, pin))
- return 1;
- break;
- }
+
+ if ((plated == 0 && !TEST_FLAG (HOLEFLAG, pin)) ||
+ (plated == 1 && TEST_FLAG (HOLEFLAG, pin)))
+ return 1;
+
DrawHole ((PinTypePtr) b);
return 1;
}
|
|
From: <gi...@gp...> - 2011-04-21 15:18:54
|
The branch, master has been updated
via bcd7d69b63ea85a6b83e28e66fb87aebe2d26901 (commit)
from 76ce4ff37d8b36207fdfb10d06ae4f5d1fec5299 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 45 +++++++++++++--------------------------------
1 files changed, 13 insertions(+), 32 deletions(-)
=================
Commit Messages
=================
commit bcd7d69b63ea85a6b83e28e66fb87aebe2d26901
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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).
:100644 100644 865bab2... 8b9b86a... M src/draw.c
=========
Changes
=========
commit bcd7d69b63ea85a6b83e28e66fb87aebe2d26901
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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).
diff --git a/src/draw.c b/src/draw.c
index 865bab2..8b9b86a 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -645,32 +645,22 @@ DrawTop (const BoxType * screen)
r_search (PCB->Data->pin_tree, screen, NULL, hole_callback, NULL);
}
-struct pin_info
-{
- bool arg;
- LayerTypePtr Layer;
-};
-
static int
clearPin_callback (const BoxType * b, void *cl)
{
PinType *pin = (PinTypePtr) b;
- struct pin_info *i = (struct pin_info *) cl;
- if (i->arg)
- {
- if (TEST_FLAG (THINDRAWFLAG, PCB) || TEST_FLAG (THINDRAWPOLYFLAG, PCB))
- gui->thindraw_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
- else
- gui->fill_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
- }
+ if (TEST_FLAG (THINDRAWFLAG, PCB) || TEST_FLAG (THINDRAWPOLYFLAG, PCB))
+ gui->thindraw_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
+ else
+ gui->fill_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
return 1;
}
static int
poly_callback (const BoxType * b, void *cl)
{
- struct pin_info *i = (struct pin_info *) cl;
+ LayerType *layer = cl;
- DrawPlainPolygon (i->Layer, (PolygonTypePtr) b);
+ DrawPlainPolygon (layer, (PolygonTypePtr) b);
return 1;
}
@@ -694,7 +684,6 @@ DrawSilk (int new_swap, int layer, const BoxType * drawn_area)
/* This code is used when you want to mask silk to avoid exposed
pins and pads. We decided it was a bad idea to do this
unconditionally, but the code remains. */
- struct pin_info info;
#endif
int save_swap = SWAP_IDENT;
SWAP_IDENT = new_swap;
@@ -714,10 +703,9 @@ DrawSilk (int new_swap, int layer, const BoxType * drawn_area)
}
gui->use_mask (HID_MASK_CLEAR);
- info.arg = true;
- r_search (PCB->Data->pin_tree, drawn_area, NULL, clearPin_callback, &info);
- r_search (PCB->Data->via_tree, drawn_area, NULL, clearPin_callback, &info);
- r_search (PCB->Data->pad_tree, drawn_area, NULL, clearPad_callback, &info);
+ r_search (PCB->Data->pin_tree, drawn_area, NULL, clearPin_callback, NULL);
+ r_search (PCB->Data->via_tree, drawn_area, NULL, clearPin_callback, NULL);
+ r_search (PCB->Data->pad_tree, drawn_area, NULL, clearPad_callback, NULL);
if (gui->poly_after)
{
@@ -758,11 +746,8 @@ DrawMaskBoardArea (int mask_type, BoxType *screen)
static void
DrawMask (BoxType * screen)
{
- struct pin_info info;
int thin = TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB);
- info.arg = true;
-
if (thin)
gui->set_color (Output.pmGC, PCB->MaskColor);
else
@@ -771,9 +756,9 @@ DrawMask (BoxType * screen)
gui->use_mask (HID_MASK_CLEAR);
}
- r_search (PCB->Data->pin_tree, screen, NULL, clearPin_callback, &info);
- r_search (PCB->Data->via_tree, screen, NULL, clearPin_callback, &info);
- r_search (PCB->Data->pad_tree, screen, NULL, clearPad_callback, &info);
+ r_search (PCB->Data->pin_tree, screen, NULL, clearPin_callback, NULL);
+ r_search (PCB->Data->via_tree, screen, NULL, clearPin_callback, NULL);
+ r_search (PCB->Data->pad_tree, screen, NULL, clearPad_callback, NULL);
if (thin)
gui->set_color (Output.pmGC, "erase");
@@ -829,13 +814,9 @@ text_callback (const BoxType * b, void *cl)
void
DrawLayerCommon (LayerTypePtr Layer, const BoxType * screen, bool clear_pins)
{
- struct pin_info info;
-
/* print the non-clearing polys */
- info.Layer = Layer;
- info.arg = clear_pins;
clip_box = screen;
- r_search (Layer->polygon_tree, screen, NULL, poly_callback, &info);
+ r_search (Layer->polygon_tree, screen, NULL, poly_callback, Layer);
if (clear_pins && TEST_FLAG (CHECKPLANESFLAG, PCB))
return;
|
|
From: <gi...@gp...> - 2011-04-21 01:57:57
|
The branch, master has been updated
via 76ce4ff37d8b36207fdfb10d06ae4f5d1fec5299 (commit)
via 29111f3faa0c3e0e4820ffc0b8449bf478fb05dc (commit)
via 198057f8123c97ab84fcfff96cb5bf633f842187 (commit)
from 537a453ae39cc440c62f24b76df2482ce64699aa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 2 -
src/line.c | 2 -
src/macro.h | 90 -----------------------------------------------------------
3 files changed, 0 insertions(+), 94 deletions(-)
=================
Commit Messages
=================
commit 76ce4ff37d8b36207fdfb10d06ae4f5d1fec5299
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
macro.h: Remove unused X11 specific macros
:100644 100644 484f284... 7cba5ac... M src/macro.h
commit 29111f3faa0c3e0e4820ffc0b8449bf478fb05dc
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
macro.h: Remove unused object visibility macros
:100644 100644 1a82f69... 484f284... M src/macro.h
commit 198057f8123c97ab84fcfff96cb5bf633f842187
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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!
:100644 100644 76c9a89... 865bab2... M src/draw.c
:100644 100644 d1faaec... 0411afc... M src/line.c
:100644 100644 ddb1fb3... 1a82f69... M src/macro.h
=========
Changes
=========
commit 76ce4ff37d8b36207fdfb10d06ae4f5d1fec5299
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
macro.h: Remove unused X11 specific macros
diff --git a/src/macro.h b/src/macro.h
index 484f284..7cba5ac 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -149,20 +149,6 @@ extern int mem_any_set (unsigned char *, int);
#define NAMEONPCB_TEXT(e) ((e)->Name[NAMEONPCB_INDEX])
#define VALUE_TEXT(e) ((e)->Name[VALUE_INDEX])
-/* ----------------------------------------------------------------------
- * checks for correct X values
- */
-#define VALID_PIXMAP(p) ((p) != BadValue && \
- (p) != BadAlloc && \
- (p) != BadDrawable)
-
-#define VALID_GC(p) ((p) != BadValue && \
- (p) != BadAlloc && \
- (p) != BadDrawable && \
- (p) != BadFont && \
- (p) != BadMatch && \
- (p) != BadPixmap)
-
/* ---------------------------------------------------------------------------
* Determines if text is actually visible
#define TEXT_IS_VISIBLE(b, l, t) \
commit 29111f3faa0c3e0e4820ffc0b8449bf478fb05dc
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
macro.h: Remove unused object visibility macros
diff --git a/src/macro.h b/src/macro.h
index 1a82f69..484f284 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -81,64 +81,6 @@
#define TO_RADIANS(degrees) (M180 * (degrees))
/* ---------------------------------------------------------------------------
- * macros to determine if something is on the visible part of the screen
- */
-
-#define VELEMENT(e) ((e)->BoundingBox.X1 <= vxh && \
- (e)->BoundingBox.X2 >= vxl && \
- (e)->BoundingBox.Y1 <= vyh && \
- (e)->BoundingBox.Y2 >= vyl)
-#define VELTEXT(e) (ELEMENT_TEXT(PCB,(e)).BoundingBox.X1 <= vxh && \
- ELEMENT_TEXT(PCB,(e)).BoundingBox.X2 >= vxl && \
- ELEMENT_TEXT(PCB,(e)).BoundingBox.Y1 <= vyh && \
- ELEMENT_TEXT(PCB,(e)).BoundingBox.Y2 >= vyl)
-#define VTEXT(t) ((t)->BoundingBox.X1 <= vxh && \
- (t)->BoundingBox.X2 >= vxl && \
- (t)->BoundingBox.Y1 <= vyh && \
- (t)->BoundingBox.Y2 >= vyl)
-#define VLINE(l) ((((l)->Point2.X >= vxl - (l)->Thickness && \
- (l)->Point1.X <= vxh + (l)->Thickness) || \
- ((l)->Point1.X >= vxl - (l)->Thickness && \
- (l)->Point2.X <= vxh + (l)->Thickness)) && \
- ((((l)->Point2.Y >= vyl - (l)->Thickness && \
- (l)->Point1.Y <= vyh + (l)->Thickness) || \
- ((l)->Point1.Y >= vyl - (l)->Thickness && \
- (l)->Point2.Y <= vyh + (l)->Thickness))))
-#define VARC(a) ((a)->BoundingBox.X1 <= vxh && \
- (a)->BoundingBox.X2 >= vxl && \
- (a)->BoundingBox.Y1 <= vyh && \
- (a)->BoundingBox.Y2 >= vyl)
-#define VPOLY(p) (IsRectangleInPolygon(vxl, vyl, vxh, vyh, (p)))
-/* (p)->BoundingBox.X1 <= vxh && \
- (p)->BoundingBox.X2 >= vxl && \
- (p)->BoundingBox.Y1 <= vyh && \
- (p)->BoundingBox.Y2 >= vyl)
-*/
-#define VVIA(v) ((v)->X+(v)->Thickness >= vxl && (v)->X - (v)->Thickness <= vxh && \
- (v)->Y+(v)->Thickness >= vyl && (v)->Y - (v)->Thickness <= vyh)
-#define VTHERM(v) ((v)->X + (v)->Thickness + (v)->Clearance >= vxl && \
- (v)->X - (v)->Thickness - (v)->Clearance <= vxh && \
- (v)->Y + (v)->Thickness + (v)->Thickness >= vyl && \
- (v)->Y - (v)->Thickness - (v)->Clearance <= vyh)
-
-#undef VELEMENT
-#define VELEMENT(e) 1
-#undef VELTEXT
-#define VELTEXT(e) 1
-#undef VTEXT
-#define VTEXT(e) 1
-#undef VLINE
-#define VLINE(e) 1
-#undef VARC
-#define VARC(e) 1
-#undef VPOLY
-#define VPOLY(e) 1
-#undef VVIA
-#define VVIA(e) 1
-#undef VTHERM
-#define VTHERM(e) 1
-
-/* ---------------------------------------------------------------------------
* layer macros
*/
#define LAYER_ON_STACK(n) (&PCB->Data->Layer[LayerStack[(n)]])
commit 198057f8123c97ab84fcfff96cb5bf633f842187
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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!
diff --git a/src/draw.c b/src/draw.c
index 76c9a89..865bab2 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -1001,8 +1001,6 @@ DrawPinOrViaNameLowLevel (PinTypePtr Ptr)
AddPart (&box);
return;
}
-/*printf("DrawPin(%d,%d): x=%d y=%d w=%d h=%d\n",
- TO_DRAW_X(Ptr->X), TO_DRAW_Y(Ptr->Y), box.X1, box.Y1, width, height);*/
gui->set_color (Output.fgGC, PCB->PinNameColor);
diff --git a/src/line.c b/src/line.c
index d1faaec..0411afc 100644
--- a/src/line.c
+++ b/src/line.c
@@ -31,8 +31,6 @@
#include "config.h"
#endif
-#define NUDGE (TO_PCB (6))
-
#include <math.h>
#include <setjmp.h>
#include <stdlib.h>
diff --git a/src/macro.h b/src/macro.h
index ddb1fb3..1a82f69 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -40,28 +40,13 @@
#define SWAP_IDENT Settings.ShowSolderSide
#endif
-#ifndef XORIG
-#define XORIG Xorig
-#define YORIG Yorig
-#endif
-
#define SWAP_SIGN_X(x) (x)
#define SWAP_SIGN_Y(y) (-(y))
#define SWAP_ANGLE(a) (-(a))
#define SWAP_DELTA(d) (-(d))
#define SWAP_X(x) (SWAP_SIGN_X(x))
#define SWAP_Y(y) (PCB->MaxHeight +SWAP_SIGN_Y(y))
-#define SATURATE(x) ((x) > 32767 ? 32767 : ((x) < -32767 ? -32767 : (x)))
-
-#define TO_DRAW_X(x) TO_SCREEN((SWAP_IDENT ? SWAP_X(x) : (x)) - XORIG)
-#define TO_DRAWABS_X(x) (TO_SCREEN((x) - XORIG))
-#define TO_DRAW_Y(y) TO_SCREEN((SWAP_IDENT ? SWAP_Y(y) : (y)) - YORIG)
-#define TO_DRAWABS_Y(y) (TO_SCREEN((y) - YORIG))
-#define TO_LIMIT_X(x) ((Position)(SATURATE(Local_Zoom * ((x) - XORIG))))
-#define TO_LIMIT_Y(y) ((Position)(SATURATE(Local_Zoom * \
- ((SWAP_IDENT ? SWAP_Y(y) : (y)) - YORIG))))
-#define TO_SCREEN_ANGLE(a) (SWAP_IDENT ? SWAP_ANGLE((a)) : (a))
-#define TO_SCREEN_DELTA(d) (SWAP_IDENT ? SWAP_DELTA((d)) : (d))
+
#define TO_SCREEN_SIGN_X(x) (SWAP_IDENT ? SWAP_SIGN_X(x) : (x))
#define TO_SCREEN_SIGN_Y(y) (SWAP_IDENT ? SWAP_SIGN_Y(y) : (y))
@@ -71,9 +56,6 @@
#define TO_PCB_X(x) TO_PCB(x) + Xorig
#define TO_PCB_Y(y) (SWAP_IDENT ? \
PCB->MaxHeight - TO_PCB(y) - Yorig : TO_PCB(y) + Yorig)
-#ifdef __GNUC__
-#pragma GCC poison TO_SCREEN TO_SCREEN_X TO_SCREEN_Y
-#endif
/* ---------------------------------------------------------------------------
* misc macros, some might already be defined by <limits.h>
|
|
From: <gi...@gp...> - 2011-04-21 01:03:03
|
The branch, master has been updated
via 537a453ae39cc440c62f24b76df2482ce64699aa (commit)
from 956a2588056b1e39cb6e925f8b091bc17529201e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
tests/golden/hid_gcode1/Makefile.am | 4 ++--
tests/golden/hid_gcode10/Makefile.am | 4 ++--
tests/golden/hid_gcode11/Makefile.am | 4 ++--
tests/golden/hid_gcode2/Makefile.am | 4 ++--
tests/golden/hid_gcode3/Makefile.am | 4 ++--
tests/golden/hid_gcode4/Makefile.am | 4 ++--
tests/golden/hid_gcode5/Makefile.am | 4 ++--
tests/golden/hid_gcode6/Makefile.am | 4 ++--
tests/golden/hid_gcode7/Makefile.am | 4 ++--
tests/golden/hid_gcode8/Makefile.am | 4 ++--
tests/golden/hid_gcode9/Makefile.am | 4 ++--
tests/golden/hid_gerber1/Makefile.am | 4 ++--
tests/golden/hid_gerber2/Makefile.am | 4 ++--
13 files changed, 26 insertions(+), 26 deletions(-)
=================
Commit Messages
=================
commit 537a453ae39cc440c62f24b76df2482ce64699aa
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Fix test-suite harder
Fixup Makefile.am files to match renames in last commit
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode1/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode10/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode11/Makefile.am
:100644 100644 a757c9e... a771564... M tests/golden/hid_gcode2/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode3/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode4/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode5/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode6/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode7/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode8/Makefile.am
:100644 100644 b071e19... b07c896... M tests/golden/hid_gcode9/Makefile.am
:100644 100644 9d32ff3... 67f1c2a... M tests/golden/hid_gerber1/Makefile.am
:100644 100644 e07c8b4... 4553101... M tests/golden/hid_gerber2/Makefile.am
=========
Changes
=========
commit 537a453ae39cc440c62f24b76df2482ce64699aa
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Fix test-suite harder
Fixup Makefile.am files to match renames in last commit
diff --git a/tests/golden/hid_gcode1/Makefile.am b/tests/golden/hid_gcode1/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode1/Makefile.am
+++ b/tests/golden/hid_gcode1/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode10/Makefile.am b/tests/golden/hid_gcode10/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode10/Makefile.am
+++ b/tests/golden/hid_gcode10/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode11/Makefile.am b/tests/golden/hid_gcode11/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode11/Makefile.am
+++ b/tests/golden/hid_gcode11/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode2/Makefile.am b/tests/golden/hid_gcode2/Makefile.am
index a757c9e..a771564 100644
--- a/tests/golden/hid_gcode2/Makefile.am
+++ b/tests/golden/hid_gcode2/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- out.back.cnc \
+ out.bottom.cnc \
out.drill.cnc \
- out.front.cnc
+ out.top.cnc
diff --git a/tests/golden/hid_gcode3/Makefile.am b/tests/golden/hid_gcode3/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode3/Makefile.am
+++ b/tests/golden/hid_gcode3/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode4/Makefile.am b/tests/golden/hid_gcode4/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode4/Makefile.am
+++ b/tests/golden/hid_gcode4/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode5/Makefile.am b/tests/golden/hid_gcode5/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode5/Makefile.am
+++ b/tests/golden/hid_gcode5/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode6/Makefile.am b/tests/golden/hid_gcode6/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode6/Makefile.am
+++ b/tests/golden/hid_gcode6/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode7/Makefile.am b/tests/golden/hid_gcode7/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode7/Makefile.am
+++ b/tests/golden/hid_gcode7/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode8/Makefile.am b/tests/golden/hid_gcode8/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode8/Makefile.am
+++ b/tests/golden/hid_gcode8/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gcode9/Makefile.am b/tests/golden/hid_gcode9/Makefile.am
index b071e19..b07c896 100644
--- a/tests/golden/hid_gcode9/Makefile.am
+++ b/tests/golden/hid_gcode9/Makefile.am
@@ -1,6 +1,6 @@
## -*- makefile -*-
EXTRA_DIST= \
- gcode_oneline.gcode.back.cnc \
+ gcode_oneline.gcode.bottom.cnc \
gcode_oneline.gcode.drill.cnc \
- gcode_oneline.gcode.front.cnc
+ gcode_oneline.gcode.top.cnc
diff --git a/tests/golden/hid_gerber1/Makefile.am b/tests/golden/hid_gerber1/Makefile.am
index 9d32ff3..67f1c2a 100644
--- a/tests/golden/hid_gerber1/Makefile.am
+++ b/tests/golden/hid_gerber1/Makefile.am
@@ -1,7 +1,7 @@
## -*- makefile -*-
EXTRA_DIST= \
- gerber_oneline.back.gbr \
+ gerber_oneline.bottom.gbr \
gerber_oneline.fab.gbr \
- gerber_oneline.front.gbr \
+ gerber_oneline.top.gbr \
gerber_oneline.plated-drill.cnc
diff --git a/tests/golden/hid_gerber2/Makefile.am b/tests/golden/hid_gerber2/Makefile.am
index e07c8b4..4553101 100644
--- a/tests/golden/hid_gerber2/Makefile.am
+++ b/tests/golden/hid_gerber2/Makefile.am
@@ -1,7 +1,7 @@
## -*- makefile -*-
EXTRA_DIST= \
- out.back.gbr \
+ out.bottom.gbr \
out.fab.gbr \
- out.front.gbr \
+ out.top.gbr \
out.plated-drill.cnc
|
|
From: <gi...@gp...> - 2011-04-21 00:58:35
|
The branch, master has been updated
via 956a2588056b1e39cb6e925f8b091bc17529201e (commit)
from 5f82d26c2f66fe8ed772077b5675d15978565f69 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
.../hid_gcode2/{out.back.cnc => out.bottom.cnc} | 0
.../hid_gcode2/{out.front.cnc => out.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
...ode.back.cnc => gcode_oneline.gcode.bottom.cnc} | 0
...gcode.front.cnc => gcode_oneline.gcode.top.cnc} | 0
..._oneline.back.gbr => gerber_oneline.bottom.gbr} | 0
...er_oneline.front.gbr => gerber_oneline.top.gbr} | 0
.../hid_gerber2/{out.back.gbr => out.bottom.gbr} | 0
.../hid_gerber2/{out.front.gbr => out.top.gbr} | 0
tests/tests.list | 28 ++++++++++----------
27 files changed, 14 insertions(+), 14 deletions(-)
rename tests/golden/hid_gcode1/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode1/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode10/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode10/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode11/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode11/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode2/{out.back.cnc => out.bottom.cnc} (100%)
rename tests/golden/hid_gcode2/{out.front.cnc => out.top.cnc} (100%)
rename tests/golden/hid_gcode3/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode3/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode4/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode4/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode5/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode5/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode6/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode6/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode7/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode7/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode8/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode8/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gcode9/{gcode_oneline.gcode.back.cnc => gcode_oneline.gcode.bottom.cnc} (100%)
rename tests/golden/hid_gcode9/{gcode_oneline.gcode.front.cnc => gcode_oneline.gcode.top.cnc} (100%)
rename tests/golden/hid_gerber1/{gerber_oneline.back.gbr => gerber_oneline.bottom.gbr} (100%)
rename tests/golden/hid_gerber1/{gerber_oneline.front.gbr => gerber_oneline.top.gbr} (100%)
rename tests/golden/hid_gerber2/{out.back.gbr => out.bottom.gbr} (100%)
rename tests/golden/hid_gerber2/{out.front.gbr => out.top.gbr} (100%)
=================
Commit Messages
=================
commit 956a2588056b1e39cb6e925f8b091bc17529201e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Fix test-suite files to match component->front and solder->back rename
Test-suite now passes again.
:100644 000000 2031270... 0000000... D tests/golden/hid_gcode1/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... 2031270... A tests/golden/hid_gcode1/gcode_oneline.gcode.bottom.cnc
:100644 000000 afd6cb2... 0000000... D tests/golden/hid_gcode1/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... afd6cb2... A tests/golden/hid_gcode1/gcode_oneline.gcode.top.cnc
:100644 000000 19a703d... 0000000... D tests/golden/hid_gcode10/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... 19a703d... A tests/golden/hid_gcode10/gcode_oneline.gcode.bottom.cnc
:100644 000000 a1d48bd... 0000000... D tests/golden/hid_gcode10/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... a1d48bd... A tests/golden/hid_gcode10/gcode_oneline.gcode.top.cnc
:100644 000000 c144b05... 0000000... D tests/golden/hid_gcode11/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... c144b05... A tests/golden/hid_gcode11/gcode_oneline.gcode.bottom.cnc
:100644 000000 ddf7394... 0000000... D tests/golden/hid_gcode11/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... ddf7394... A tests/golden/hid_gcode11/gcode_oneline.gcode.top.cnc
:100644 000000 c3b0526... 0000000... D tests/golden/hid_gcode2/out.back.cnc
:000000 100644 0000000... c3b0526... A tests/golden/hid_gcode2/out.bottom.cnc
:100644 000000 ca2b079... 0000000... D tests/golden/hid_gcode2/out.front.cnc
:000000 100644 0000000... ca2b079... A tests/golden/hid_gcode2/out.top.cnc
:100644 000000 e67b085... 0000000... D tests/golden/hid_gcode3/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... e67b085... A tests/golden/hid_gcode3/gcode_oneline.gcode.bottom.cnc
:100644 000000 d7c8c9f... 0000000... D tests/golden/hid_gcode3/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... d7c8c9f... A tests/golden/hid_gcode3/gcode_oneline.gcode.top.cnc
:100644 000000 d049972... 0000000... D tests/golden/hid_gcode4/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... d049972... A tests/golden/hid_gcode4/gcode_oneline.gcode.bottom.cnc
:100644 000000 78e64a5... 0000000... D tests/golden/hid_gcode4/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... 78e64a5... A tests/golden/hid_gcode4/gcode_oneline.gcode.top.cnc
:100644 000000 8041f98... 0000000... D tests/golden/hid_gcode5/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... 8041f98... A tests/golden/hid_gcode5/gcode_oneline.gcode.bottom.cnc
:100644 000000 e3bbd7e... 0000000... D tests/golden/hid_gcode5/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... e3bbd7e... A tests/golden/hid_gcode5/gcode_oneline.gcode.top.cnc
:100644 000000 7d33799... 0000000... D tests/golden/hid_gcode6/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... 7d33799... A tests/golden/hid_gcode6/gcode_oneline.gcode.bottom.cnc
:100644 000000 7dfd6a0... 0000000... D tests/golden/hid_gcode6/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... 7dfd6a0... A tests/golden/hid_gcode6/gcode_oneline.gcode.top.cnc
:100644 000000 b92e532... 0000000... D tests/golden/hid_gcode7/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... b92e532... A tests/golden/hid_gcode7/gcode_oneline.gcode.bottom.cnc
:100644 000000 4c64804... 0000000... D tests/golden/hid_gcode7/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... 4c64804... A tests/golden/hid_gcode7/gcode_oneline.gcode.top.cnc
:100644 000000 286cab5... 0000000... D tests/golden/hid_gcode8/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... 286cab5... A tests/golden/hid_gcode8/gcode_oneline.gcode.bottom.cnc
:100644 000000 a57aeb7... 0000000... D tests/golden/hid_gcode8/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... a57aeb7... A tests/golden/hid_gcode8/gcode_oneline.gcode.top.cnc
:100644 000000 49ebcd5... 0000000... D tests/golden/hid_gcode9/gcode_oneline.gcode.back.cnc
:000000 100644 0000000... 49ebcd5... A tests/golden/hid_gcode9/gcode_oneline.gcode.bottom.cnc
:100644 000000 638cec1... 0000000... D tests/golden/hid_gcode9/gcode_oneline.gcode.front.cnc
:000000 100644 0000000... 638cec1... A tests/golden/hid_gcode9/gcode_oneline.gcode.top.cnc
:100644 000000 b5b70e8... 0000000... D tests/golden/hid_gerber1/gerber_oneline.back.gbr
:000000 100644 0000000... b5b70e8... A tests/golden/hid_gerber1/gerber_oneline.bottom.gbr
:100644 000000 c24a8fe... 0000000... D tests/golden/hid_gerber1/gerber_oneline.front.gbr
:000000 100644 0000000... c24a8fe... A tests/golden/hid_gerber1/gerber_oneline.top.gbr
:100644 000000 5e9aa06... 0000000... D tests/golden/hid_gerber2/out.back.gbr
:000000 100644 0000000... 5e9aa06... A tests/golden/hid_gerber2/out.bottom.gbr
:100644 000000 37f79a8... 0000000... D tests/golden/hid_gerber2/out.front.gbr
:000000 100644 0000000... 37f79a8... A tests/golden/hid_gerber2/out.top.gbr
:100644 100644 ac1a11a... 1f63488... M tests/tests.list
=========
Changes
=========
commit 956a2588056b1e39cb6e925f8b091bc17529201e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Fix test-suite files to match component->front and solder->back rename
Test-suite now passes again.
diff --git a/tests/golden/hid_gcode1/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode1/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index 2031270..0000000
--- a/tests/golden/hid_gcode1/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:31:54 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.770667 Y13.546667 (start point)
-G1 Z#101
-G1 X27.559000 Y13.462000
-G1 X27.305000 Y13.292667
-G1 X7.450667 Y13.292667
-G1 X7.196667 Y13.081000
-G1 X6.985000 Y12.827000
-G1 X6.985000 Y12.530667
-G1 X7.196667 Y12.276667
-G1 X7.450667 Y12.065000
-G1 X27.305000 Y12.065000
-G1 X27.643667 Y11.853333
-G1 X28.194000 Y11.853333
-G1 X28.532667 Y12.065000
-G1 X28.744333 Y12.403667
-G1 X28.744333 Y12.954000
-G1 X28.532667 Y13.292667
-G1 X28.194000 Y13.504333
-G1 X27.770667 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode1/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode1/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..2031270
--- /dev/null
+++ b/tests/golden/hid_gcode1/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:31:54 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.770667 Y13.546667 (start point)
+G1 Z#101
+G1 X27.559000 Y13.462000
+G1 X27.305000 Y13.292667
+G1 X7.450667 Y13.292667
+G1 X7.196667 Y13.081000
+G1 X6.985000 Y12.827000
+G1 X6.985000 Y12.530667
+G1 X7.196667 Y12.276667
+G1 X7.450667 Y12.065000
+G1 X27.305000 Y12.065000
+G1 X27.643667 Y11.853333
+G1 X28.194000 Y11.853333
+G1 X28.532667 Y12.065000
+G1 X28.744333 Y12.403667
+G1 X28.744333 Y12.954000
+G1 X28.532667 Y13.292667
+G1 X28.194000 Y13.504333
+G1 X27.770667 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode1/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode1/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index afd6cb2..0000000
--- a/tests/golden/hid_gcode1/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:31:51 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.733000 Y13.546667 (start point)
-G1 Z#101
-G1 X22.521333 Y13.462000
-G1 X22.267333 Y13.292667
-G1 X2.413000 Y13.292667
-G1 X2.159000 Y13.081000
-G1 X1.947333 Y12.827000
-G1 X1.947333 Y12.530667
-G1 X2.159000 Y12.276667
-G1 X2.413000 Y12.065000
-G1 X22.267333 Y12.065000
-G1 X22.606000 Y11.853333
-G1 X23.156333 Y11.853333
-G1 X23.495000 Y12.065000
-G1 X23.706667 Y12.403667
-G1 X23.706667 Y12.954000
-G1 X23.495000 Y13.292667
-G1 X23.156333 Y13.504333
-G1 X22.733000 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode1/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode1/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..afd6cb2
--- /dev/null
+++ b/tests/golden/hid_gcode1/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:31:51 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.733000 Y13.546667 (start point)
+G1 Z#101
+G1 X22.521333 Y13.462000
+G1 X22.267333 Y13.292667
+G1 X2.413000 Y13.292667
+G1 X2.159000 Y13.081000
+G1 X1.947333 Y12.827000
+G1 X1.947333 Y12.530667
+G1 X2.159000 Y12.276667
+G1 X2.413000 Y12.065000
+G1 X22.267333 Y12.065000
+G1 X22.606000 Y11.853333
+G1 X23.156333 Y11.853333
+G1 X23.495000 Y12.065000
+G1 X23.706667 Y12.403667
+G1 X23.706667 Y12.954000
+G1 X23.495000 Y13.292667
+G1 X23.156333 Y13.504333
+G1 X22.733000 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode10/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode10/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index 19a703d..0000000
--- a/tests/golden/hid_gcode10/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:32 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=0.002000 (safe Z)
-#101=-0.000050 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.770667 Y13.462000 (start point)
-G1 Z#101
-G1 X27.516667 Y13.335000
-G1 X27.347333 Y13.208000
-G1 X7.408333 Y13.165667
-G1 X7.112000 Y12.869333
-G1 X7.112000 Y12.488333
-G1 X7.408333 Y12.192000
-G1 X27.347333 Y12.149667
-G1 X27.643667 Y11.938000
-G1 X27.940000 Y11.895667
-G1 X28.278667 Y11.980333
-G1 X28.532667 Y12.192000
-G1 X28.702000 Y12.530667
-G1 X28.702000 Y12.827000
-G1 X28.532667 Y13.165667
-G1 X28.321000 Y13.335000
-G1 X28.024667 Y13.462000
-G1 X27.770667 Y13.462000
-G0 Z#100
-(polygon end, distance 44.84)
-(end, total distance 44.84mm = 1.77in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode10/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode10/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..19a703d
--- /dev/null
+++ b/tests/golden/hid_gcode10/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:32 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=0.002000 (safe Z)
+#101=-0.000050 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.770667 Y13.462000 (start point)
+G1 Z#101
+G1 X27.516667 Y13.335000
+G1 X27.347333 Y13.208000
+G1 X7.408333 Y13.165667
+G1 X7.112000 Y12.869333
+G1 X7.112000 Y12.488333
+G1 X7.408333 Y12.192000
+G1 X27.347333 Y12.149667
+G1 X27.643667 Y11.938000
+G1 X27.940000 Y11.895667
+G1 X28.278667 Y11.980333
+G1 X28.532667 Y12.192000
+G1 X28.702000 Y12.530667
+G1 X28.702000 Y12.827000
+G1 X28.532667 Y13.165667
+G1 X28.321000 Y13.335000
+G1 X28.024667 Y13.462000
+G1 X27.770667 Y13.462000
+G0 Z#100
+(polygon end, distance 44.84)
+(end, total distance 44.84mm = 1.77in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode10/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode10/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index a1d48bd..0000000
--- a/tests/golden/hid_gcode10/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:28 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=0.002000 (safe Z)
-#101=-0.000050 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.733000 Y13.462000 (start point)
-G1 Z#101
-G1 X22.479000 Y13.335000
-G1 X22.309667 Y13.208000
-G1 X2.370667 Y13.165667
-G1 X2.074333 Y12.869333
-G1 X2.074333 Y12.488333
-G1 X2.370667 Y12.192000
-G1 X22.309667 Y12.149667
-G1 X22.606000 Y11.938000
-G1 X22.902333 Y11.895667
-G1 X23.241000 Y11.980333
-G1 X23.495000 Y12.192000
-G1 X23.664333 Y12.530667
-G1 X23.664333 Y12.827000
-G1 X23.495000 Y13.165667
-G1 X23.283333 Y13.335000
-G1 X22.987000 Y13.462000
-G1 X22.733000 Y13.462000
-G0 Z#100
-(polygon end, distance 44.84)
-(end, total distance 44.84mm = 1.77in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode10/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode10/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..a1d48bd
--- /dev/null
+++ b/tests/golden/hid_gcode10/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:28 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=0.002000 (safe Z)
+#101=-0.000050 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.733000 Y13.462000 (start point)
+G1 Z#101
+G1 X22.479000 Y13.335000
+G1 X22.309667 Y13.208000
+G1 X2.370667 Y13.165667
+G1 X2.074333 Y12.869333
+G1 X2.074333 Y12.488333
+G1 X2.370667 Y12.192000
+G1 X22.309667 Y12.149667
+G1 X22.606000 Y11.938000
+G1 X22.902333 Y11.895667
+G1 X23.241000 Y11.980333
+G1 X23.495000 Y12.192000
+G1 X23.664333 Y12.530667
+G1 X23.664333 Y12.827000
+G1 X23.495000 Y13.165667
+G1 X23.283333 Y13.335000
+G1 X22.987000 Y13.462000
+G1 X22.733000 Y13.462000
+G0 Z#100
+(polygon end, distance 44.84)
+(end, total distance 44.84mm = 1.77in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode11/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode11/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index c144b05..0000000
--- a/tests/golden/hid_gcode11/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,49 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:55 2010 )
-(600 dpi)
-(Unit: inch)
-(Board size: 2.00x1.00 inches)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
-G0 Z#100
-(polygon 1)
-G0 X1.085000 Y0.630000 (start point)
-G1 Z#101
-G1 X1.063333 Y0.625000
-G1 X1.055000 Y0.621667
-G1 X0.276667 Y0.618333
-G1 X0.251667 Y0.610000
-G1 X0.230000 Y0.598333
-G1 X0.200000 Y0.568333
-G1 X0.188333 Y0.546667
-G1 X0.180000 Y0.521667
-G1 X0.180000 Y0.476667
-G1 X0.188333 Y0.451667
-G1 X0.200000 Y0.430000
-G1 X0.230000 Y0.400000
-G1 X0.251667 Y0.388333
-G1 X0.276667 Y0.380000
-G1 X1.055000 Y0.376667
-G1 X1.068333 Y0.371667
-G1 X1.093333 Y0.368333
-G1 X1.121667 Y0.370000
-G1 X1.140000 Y0.375000
-G1 X1.171667 Y0.390000
-G1 X1.191667 Y0.406667
-G1 X1.208333 Y0.426667
-G1 X1.223333 Y0.458333
-G1 X1.228333 Y0.478333
-G1 X1.228333 Y0.520000
-G1 X1.223333 Y0.540000
-G1 X1.208333 Y0.571667
-G1 X1.191667 Y0.591667
-G1 X1.171667 Y0.608333
-G1 X1.140000 Y0.623333
-G1 X1.121667 Y0.628333
-G1 X1.085000 Y0.630000
-G0 Z#100
-(polygon end, distance 2.39)
-(end, total distance 60.74mm = 2.39in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode11/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode11/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..c144b05
--- /dev/null
+++ b/tests/golden/hid_gcode11/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,49 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:55 2010 )
+(600 dpi)
+(Unit: inch)
+(Board size: 2.00x1.00 inches)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
+G0 Z#100
+(polygon 1)
+G0 X1.085000 Y0.630000 (start point)
+G1 Z#101
+G1 X1.063333 Y0.625000
+G1 X1.055000 Y0.621667
+G1 X0.276667 Y0.618333
+G1 X0.251667 Y0.610000
+G1 X0.230000 Y0.598333
+G1 X0.200000 Y0.568333
+G1 X0.188333 Y0.546667
+G1 X0.180000 Y0.521667
+G1 X0.180000 Y0.476667
+G1 X0.188333 Y0.451667
+G1 X0.200000 Y0.430000
+G1 X0.230000 Y0.400000
+G1 X0.251667 Y0.388333
+G1 X0.276667 Y0.380000
+G1 X1.055000 Y0.376667
+G1 X1.068333 Y0.371667
+G1 X1.093333 Y0.368333
+G1 X1.121667 Y0.370000
+G1 X1.140000 Y0.375000
+G1 X1.171667 Y0.390000
+G1 X1.191667 Y0.406667
+G1 X1.208333 Y0.426667
+G1 X1.223333 Y0.458333
+G1 X1.228333 Y0.478333
+G1 X1.228333 Y0.520000
+G1 X1.223333 Y0.540000
+G1 X1.208333 Y0.571667
+G1 X1.191667 Y0.591667
+G1 X1.171667 Y0.608333
+G1 X1.140000 Y0.623333
+G1 X1.121667 Y0.628333
+G1 X1.085000 Y0.630000
+G0 Z#100
+(polygon end, distance 2.39)
+(end, total distance 60.74mm = 2.39in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode11/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode11/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index ddf7394..0000000
--- a/tests/golden/hid_gcode11/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,45 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:43 2010 )
-(600 dpi)
-(Unit: inch)
-(Board size: 2.00x1.00 inches)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
-G0 Z#100
-(polygon 1)
-G0 X0.886667 Y0.630000 (start point)
-G1 Z#101
-G1 X0.865000 Y0.625000
-G1 X0.856667 Y0.621667
-G1 X0.078333 Y0.618333
-G1 X0.053333 Y0.610000
-G1 X0.031667 Y0.598333
-G1 X0.000000 Y0.566667
-G1 X0.000000 Y0.431667
-G1 X0.031667 Y0.400000
-G1 X0.053333 Y0.388333
-G1 X0.078333 Y0.380000
-G1 X0.856667 Y0.376667
-G1 X0.870000 Y0.371667
-G1 X0.895000 Y0.368333
-G1 X0.923333 Y0.370000
-G1 X0.941667 Y0.375000
-G1 X0.973333 Y0.390000
-G1 X0.993333 Y0.406667
-G1 X1.010000 Y0.426667
-G1 X1.025000 Y0.458333
-G1 X1.030000 Y0.478333
-G1 X1.030000 Y0.520000
-G1 X1.025000 Y0.540000
-G1 X1.010000 Y0.571667
-G1 X0.993333 Y0.591667
-G1 X0.973333 Y0.608333
-G1 X0.941667 Y0.623333
-G1 X0.923333 Y0.628333
-G1 X0.886667 Y0.630000
-G0 Z#100
-(polygon end, distance 2.38)
-(end, total distance 60.56mm = 2.38in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode11/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode11/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..ddf7394
--- /dev/null
+++ b/tests/golden/hid_gcode11/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,45 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:43 2010 )
+(600 dpi)
+(Unit: inch)
+(Board size: 2.00x1.00 inches)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
+G0 Z#100
+(polygon 1)
+G0 X0.886667 Y0.630000 (start point)
+G1 Z#101
+G1 X0.865000 Y0.625000
+G1 X0.856667 Y0.621667
+G1 X0.078333 Y0.618333
+G1 X0.053333 Y0.610000
+G1 X0.031667 Y0.598333
+G1 X0.000000 Y0.566667
+G1 X0.000000 Y0.431667
+G1 X0.031667 Y0.400000
+G1 X0.053333 Y0.388333
+G1 X0.078333 Y0.380000
+G1 X0.856667 Y0.376667
+G1 X0.870000 Y0.371667
+G1 X0.895000 Y0.368333
+G1 X0.923333 Y0.370000
+G1 X0.941667 Y0.375000
+G1 X0.973333 Y0.390000
+G1 X0.993333 Y0.406667
+G1 X1.010000 Y0.426667
+G1 X1.025000 Y0.458333
+G1 X1.030000 Y0.478333
+G1 X1.030000 Y0.520000
+G1 X1.025000 Y0.540000
+G1 X1.010000 Y0.571667
+G1 X0.993333 Y0.591667
+G1 X0.973333 Y0.608333
+G1 X0.941667 Y0.623333
+G1 X0.923333 Y0.628333
+G1 X0.886667 Y0.630000
+G0 Z#100
+(polygon end, distance 2.38)
+(end, total distance 60.56mm = 2.38in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode2/out.back.cnc b/tests/golden/hid_gcode2/out.back.cnc
deleted file mode 100644
index c3b0526..0000000
--- a/tests/golden/hid_gcode2/out.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:35:19 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.770667 Y13.546667 (start point)
-G1 Z#101
-G1 X27.559000 Y13.462000
-G1 X27.305000 Y13.292667
-G1 X7.450667 Y13.292667
-G1 X7.196667 Y13.081000
-G1 X6.985000 Y12.827000
-G1 X6.985000 Y12.530667
-G1 X7.196667 Y12.276667
-G1 X7.450667 Y12.065000
-G1 X27.305000 Y12.065000
-G1 X27.643667 Y11.853333
-G1 X28.194000 Y11.853333
-G1 X28.532667 Y12.065000
-G1 X28.744333 Y12.403667
-G1 X28.744333 Y12.954000
-G1 X28.532667 Y13.292667
-G1 X28.194000 Y13.504333
-G1 X27.770667 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode2/out.bottom.cnc b/tests/golden/hid_gcode2/out.bottom.cnc
new file mode 100644
index 0000000..c3b0526
--- /dev/null
+++ b/tests/golden/hid_gcode2/out.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:35:19 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.770667 Y13.546667 (start point)
+G1 Z#101
+G1 X27.559000 Y13.462000
+G1 X27.305000 Y13.292667
+G1 X7.450667 Y13.292667
+G1 X7.196667 Y13.081000
+G1 X6.985000 Y12.827000
+G1 X6.985000 Y12.530667
+G1 X7.196667 Y12.276667
+G1 X7.450667 Y12.065000
+G1 X27.305000 Y12.065000
+G1 X27.643667 Y11.853333
+G1 X28.194000 Y11.853333
+G1 X28.532667 Y12.065000
+G1 X28.744333 Y12.403667
+G1 X28.744333 Y12.954000
+G1 X28.532667 Y13.292667
+G1 X28.194000 Y13.504333
+G1 X27.770667 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode2/out.front.cnc b/tests/golden/hid_gcode2/out.front.cnc
deleted file mode 100644
index ca2b079..0000000
--- a/tests/golden/hid_gcode2/out.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:35:16 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.733000 Y13.546667 (start point)
-G1 Z#101
-G1 X22.521333 Y13.462000
-G1 X22.267333 Y13.292667
-G1 X2.413000 Y13.292667
-G1 X2.159000 Y13.081000
-G1 X1.947333 Y12.827000
-G1 X1.947333 Y12.530667
-G1 X2.159000 Y12.276667
-G1 X2.413000 Y12.065000
-G1 X22.267333 Y12.065000
-G1 X22.606000 Y11.853333
-G1 X23.156333 Y11.853333
-G1 X23.495000 Y12.065000
-G1 X23.706667 Y12.403667
-G1 X23.706667 Y12.954000
-G1 X23.495000 Y13.292667
-G1 X23.156333 Y13.504333
-G1 X22.733000 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode2/out.top.cnc b/tests/golden/hid_gcode2/out.top.cnc
new file mode 100644
index 0000000..ca2b079
--- /dev/null
+++ b/tests/golden/hid_gcode2/out.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:35:16 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.733000 Y13.546667 (start point)
+G1 Z#101
+G1 X22.521333 Y13.462000
+G1 X22.267333 Y13.292667
+G1 X2.413000 Y13.292667
+G1 X2.159000 Y13.081000
+G1 X1.947333 Y12.827000
+G1 X1.947333 Y12.530667
+G1 X2.159000 Y12.276667
+G1 X2.413000 Y12.065000
+G1 X22.267333 Y12.065000
+G1 X22.606000 Y11.853333
+G1 X23.156333 Y11.853333
+G1 X23.495000 Y12.065000
+G1 X23.706667 Y12.403667
+G1 X23.706667 Y12.954000
+G1 X23.495000 Y13.292667
+G1 X23.156333 Y13.504333
+G1 X22.733000 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode3/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode3/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index e67b085..0000000
--- a/tests/golden/hid_gcode3/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,40 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:36:04 2010 )
-(1200 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.813000 Y13.546667 (start point)
-G1 Z#101
-G1 X27.664833 Y13.504333
-G1 X27.453167 Y13.398500
-G1 X27.326167 Y13.292667
-G1 X7.535333 Y13.292667
-G1 X7.323667 Y13.229167
-G1 X7.069667 Y12.975167
-G1 X7.006167 Y12.763500
-G1 X7.006167 Y12.615333
-G1 X7.069667 Y12.403667
-G1 X7.323667 Y12.149667
-G1 X7.535333 Y12.086167
-G1 X27.326167 Y12.086167
-G1 X27.495500 Y11.959167
-G1 X27.728333 Y11.853333
-G1 X28.130500 Y11.853333
-G1 X28.448000 Y12.001500
-G1 X28.638500 Y12.213167
-G1 X28.765500 Y12.488333
-G1 X28.765500 Y12.890500
-G1 X28.638500 Y13.165667
-G1 X28.448000 Y13.377333
-G1 X28.130500 Y13.525500
-G1 X27.813000 Y13.546667
-G0 Z#100
-(polygon end, distance 45.35)
-(end, total distance 45.35mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode3/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode3/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..e67b085
--- /dev/null
+++ b/tests/golden/hid_gcode3/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,40 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:36:04 2010 )
+(1200 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.813000 Y13.546667 (start point)
+G1 Z#101
+G1 X27.664833 Y13.504333
+G1 X27.453167 Y13.398500
+G1 X27.326167 Y13.292667
+G1 X7.535333 Y13.292667
+G1 X7.323667 Y13.229167
+G1 X7.069667 Y12.975167
+G1 X7.006167 Y12.763500
+G1 X7.006167 Y12.615333
+G1 X7.069667 Y12.403667
+G1 X7.323667 Y12.149667
+G1 X7.535333 Y12.086167
+G1 X27.326167 Y12.086167
+G1 X27.495500 Y11.959167
+G1 X27.728333 Y11.853333
+G1 X28.130500 Y11.853333
+G1 X28.448000 Y12.001500
+G1 X28.638500 Y12.213167
+G1 X28.765500 Y12.488333
+G1 X28.765500 Y12.890500
+G1 X28.638500 Y13.165667
+G1 X28.448000 Y13.377333
+G1 X28.130500 Y13.525500
+G1 X27.813000 Y13.546667
+G0 Z#100
+(polygon end, distance 45.35)
+(end, total distance 45.35mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode3/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode3/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index d7c8c9f..0000000
--- a/tests/golden/hid_gcode3/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,40 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:35:46 2010 )
-(1200 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.754167 Y13.546667 (start point)
-G1 Z#101
-G1 X22.606000 Y13.504333
-G1 X22.394333 Y13.398500
-G1 X22.267333 Y13.292667
-G1 X2.476500 Y13.292667
-G1 X2.264833 Y13.229167
-G1 X2.010833 Y12.975167
-G1 X1.947333 Y12.763500
-G1 X1.947333 Y12.615333
-G1 X2.010833 Y12.403667
-G1 X2.264833 Y12.149667
-G1 X2.476500 Y12.086167
-G1 X22.267333 Y12.086167
-G1 X22.436667 Y11.959167
-G1 X22.669500 Y11.853333
-G1 X23.071667 Y11.853333
-G1 X23.389167 Y12.001500
-G1 X23.579667 Y12.213167
-G1 X23.706667 Y12.488333
-G1 X23.706667 Y12.890500
-G1 X23.579667 Y13.165667
-G1 X23.389167 Y13.377333
-G1 X23.071667 Y13.525500
-G1 X22.754167 Y13.546667
-G0 Z#100
-(polygon end, distance 45.35)
-(end, total distance 45.35mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode3/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode3/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..d7c8c9f
--- /dev/null
+++ b/tests/golden/hid_gcode3/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,40 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:35:46 2010 )
+(1200 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.754167 Y13.546667 (start point)
+G1 Z#101
+G1 X22.606000 Y13.504333
+G1 X22.394333 Y13.398500
+G1 X22.267333 Y13.292667
+G1 X2.476500 Y13.292667
+G1 X2.264833 Y13.229167
+G1 X2.010833 Y12.975167
+G1 X1.947333 Y12.763500
+G1 X1.947333 Y12.615333
+G1 X2.010833 Y12.403667
+G1 X2.264833 Y12.149667
+G1 X2.476500 Y12.086167
+G1 X22.267333 Y12.086167
+G1 X22.436667 Y11.959167
+G1 X22.669500 Y11.853333
+G1 X23.071667 Y11.853333
+G1 X23.389167 Y12.001500
+G1 X23.579667 Y12.213167
+G1 X23.706667 Y12.488333
+G1 X23.706667 Y12.890500
+G1 X23.579667 Y13.165667
+G1 X23.389167 Y13.377333
+G1 X23.071667 Y13.525500
+G1 X22.754167 Y13.546667
+G0 Z#100
+(polygon end, distance 45.35)
+(end, total distance 45.35mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode4/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode4/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index d049972..0000000
--- a/tests/golden/hid_gcode4/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:36:12 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=5.000000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.770667 Y13.546667 (start point)
-G1 Z#101
-G1 X27.559000 Y13.462000
-G1 X27.305000 Y13.292667
-G1 X7.450667 Y13.292667
-G1 X7.196667 Y13.081000
-G1 X6.985000 Y12.827000
-G1 X6.985000 Y12.530667
-G1 X7.196667 Y12.276667
-G1 X7.450667 Y12.065000
-G1 X27.305000 Y12.065000
-G1 X27.643667 Y11.853333
-G1 X28.194000 Y11.853333
-G1 X28.532667 Y12.065000
-G1 X28.744333 Y12.403667
-G1 X28.744333 Y12.954000
-G1 X28.532667 Y13.292667
-G1 X28.194000 Y13.504333
-G1 X27.770667 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode4/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode4/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..d049972
--- /dev/null
+++ b/tests/golden/hid_gcode4/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:36:12 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=5.000000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.770667 Y13.546667 (start point)
+G1 Z#101
+G1 X27.559000 Y13.462000
+G1 X27.305000 Y13.292667
+G1 X7.450667 Y13.292667
+G1 X7.196667 Y13.081000
+G1 X6.985000 Y12.827000
+G1 X6.985000 Y12.530667
+G1 X7.196667 Y12.276667
+G1 X7.450667 Y12.065000
+G1 X27.305000 Y12.065000
+G1 X27.643667 Y11.853333
+G1 X28.194000 Y11.853333
+G1 X28.532667 Y12.065000
+G1 X28.744333 Y12.403667
+G1 X28.744333 Y12.954000
+G1 X28.532667 Y13.292667
+G1 X28.194000 Y13.504333
+G1 X27.770667 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode4/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode4/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index 78e64a5..0000000
--- a/tests/golden/hid_gcode4/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:36:08 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=5.000000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.733000 Y13.546667 (start point)
-G1 Z#101
-G1 X22.521333 Y13.462000
-G1 X22.267333 Y13.292667
-G1 X2.413000 Y13.292667
-G1 X2.159000 Y13.081000
-G1 X1.947333 Y12.827000
-G1 X1.947333 Y12.530667
-G1 X2.159000 Y12.276667
-G1 X2.413000 Y12.065000
-G1 X22.267333 Y12.065000
-G1 X22.606000 Y11.853333
-G1 X23.156333 Y11.853333
-G1 X23.495000 Y12.065000
-G1 X23.706667 Y12.403667
-G1 X23.706667 Y12.954000
-G1 X23.495000 Y13.292667
-G1 X23.156333 Y13.504333
-G1 X22.733000 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode4/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode4/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..78e64a5
--- /dev/null
+++ b/tests/golden/hid_gcode4/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:36:08 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=5.000000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.733000 Y13.546667 (start point)
+G1 Z#101
+G1 X22.521333 Y13.462000
+G1 X22.267333 Y13.292667
+G1 X2.413000 Y13.292667
+G1 X2.159000 Y13.081000
+G1 X1.947333 Y12.827000
+G1 X1.947333 Y12.530667
+G1 X2.159000 Y12.276667
+G1 X2.413000 Y12.065000
+G1 X22.267333 Y12.065000
+G1 X22.606000 Y11.853333
+G1 X23.156333 Y11.853333
+G1 X23.495000 Y12.065000
+G1 X23.706667 Y12.403667
+G1 X23.706667 Y12.954000
+G1 X23.495000 Y13.292667
+G1 X23.156333 Y13.504333
+G1 X22.733000 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode5/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode5/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index 8041f98..0000000
--- a/tests/golden/hid_gcode5/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 18:06:42 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=10.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.770667 Y13.546667 (start point)
-G1 Z#101
-G1 X27.559000 Y13.462000
-G1 X27.305000 Y13.292667
-G1 X7.450667 Y13.292667
-G1 X7.196667 Y13.081000
-G1 X6.985000 Y12.827000
-G1 X6.985000 Y12.530667
-G1 X7.196667 Y12.276667
-G1 X7.450667 Y12.065000
-G1 X27.305000 Y12.065000
-G1 X27.643667 Y11.853333
-G1 X28.194000 Y11.853333
-G1 X28.532667 Y12.065000
-G1 X28.744333 Y12.403667
-G1 X28.744333 Y12.954000
-G1 X28.532667 Y13.292667
-G1 X28.194000 Y13.504333
-G1 X27.770667 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode5/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode5/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..8041f98
--- /dev/null
+++ b/tests/golden/hid_gcode5/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 18:06:42 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=10.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.770667 Y13.546667 (start point)
+G1 Z#101
+G1 X27.559000 Y13.462000
+G1 X27.305000 Y13.292667
+G1 X7.450667 Y13.292667
+G1 X7.196667 Y13.081000
+G1 X6.985000 Y12.827000
+G1 X6.985000 Y12.530667
+G1 X7.196667 Y12.276667
+G1 X7.450667 Y12.065000
+G1 X27.305000 Y12.065000
+G1 X27.643667 Y11.853333
+G1 X28.194000 Y11.853333
+G1 X28.532667 Y12.065000
+G1 X28.744333 Y12.403667
+G1 X28.744333 Y12.954000
+G1 X28.532667 Y13.292667
+G1 X28.194000 Y13.504333
+G1 X27.770667 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode5/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode5/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index e3bbd7e..0000000
--- a/tests/golden/hid_gcode5/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 18:06:40 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=10.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.733000 Y13.546667 (start point)
-G1 Z#101
-G1 X22.521333 Y13.462000
-G1 X22.267333 Y13.292667
-G1 X2.413000 Y13.292667
-G1 X2.159000 Y13.081000
-G1 X1.947333 Y12.827000
-G1 X1.947333 Y12.530667
-G1 X2.159000 Y12.276667
-G1 X2.413000 Y12.065000
-G1 X22.267333 Y12.065000
-G1 X22.606000 Y11.853333
-G1 X23.156333 Y11.853333
-G1 X23.495000 Y12.065000
-G1 X23.706667 Y12.403667
-G1 X23.706667 Y12.954000
-G1 X23.495000 Y13.292667
-G1 X23.156333 Y13.504333
-G1 X22.733000 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode5/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode5/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..e3bbd7e
--- /dev/null
+++ b/tests/golden/hid_gcode5/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 18:06:40 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=10.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.733000 Y13.546667 (start point)
+G1 Z#101
+G1 X22.521333 Y13.462000
+G1 X22.267333 Y13.292667
+G1 X2.413000 Y13.292667
+G1 X2.159000 Y13.081000
+G1 X1.947333 Y12.827000
+G1 X1.947333 Y12.530667
+G1 X2.159000 Y12.276667
+G1 X2.413000 Y12.065000
+G1 X22.267333 Y12.065000
+G1 X22.606000 Y11.853333
+G1 X23.156333 Y11.853333
+G1 X23.495000 Y12.065000
+G1 X23.706667 Y12.403667
+G1 X23.706667 Y12.954000
+G1 X23.495000 Y13.292667
+G1 X23.156333 Y13.504333
+G1 X22.733000 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode6/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode6/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index 7d33799..0000000
--- a/tests/golden/hid_gcode6/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,43 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:05 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X0.000000 Y25.400000 (start point)
-G1 Z#101
-G1 X0.000000 Y0.000000
-G1 X37.295667 Y0.000000
-G1 X38.057667 Y0.635000
-G1 X39.073667 Y1.524000
-G1 X39.962667 Y2.540000
-G1 X40.597667 Y3.302000
-G1 X41.486667 Y4.656667
-G1 X41.952333 Y5.503333
-G1 X42.418000 Y6.477000
-G1 X42.883667 Y7.704667
-G1 X43.264667 Y9.017000
-G1 X43.518667 Y10.329333
-G1 X43.645667 Y11.514667
-G1 X43.645667 Y13.843000
-G1 X43.518667 Y15.028333
-G1 X43.264667 Y16.340667
-G1 X42.883667 Y17.653000
-G1 X42.418000 Y18.880667
-G1 X41.952333 Y19.854333
-G1 X41.486667 Y20.701000
-G1 X40.597667 Y22.055667
-G1 X39.962667 Y22.817667
-G1 X39.073667 Y23.833667
-G1 X38.057667 Y24.722667
-G1 X37.253333 Y25.400000
-G1 X0.000000 Y25.400000
-G0 Z#100
-(polygon end, distance 129.45)
-(end, total distance 129.45mm = 5.10in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode6/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode6/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..7d33799
--- /dev/null
+++ b/tests/golden/hid_gcode6/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,43 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:05 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X0.000000 Y25.400000 (start point)
+G1 Z#101
+G1 X0.000000 Y0.000000
+G1 X37.295667 Y0.000000
+G1 X38.057667 Y0.635000
+G1 X39.073667 Y1.524000
+G1 X39.962667 Y2.540000
+G1 X40.597667 Y3.302000
+G1 X41.486667 Y4.656667
+G1 X41.952333 Y5.503333
+G1 X42.418000 Y6.477000
+G1 X42.883667 Y7.704667
+G1 X43.264667 Y9.017000
+G1 X43.518667 Y10.329333
+G1 X43.645667 Y11.514667
+G1 X43.645667 Y13.843000
+G1 X43.518667 Y15.028333
+G1 X43.264667 Y16.340667
+G1 X42.883667 Y17.653000
+G1 X42.418000 Y18.880667
+G1 X41.952333 Y19.854333
+G1 X41.486667 Y20.701000
+G1 X40.597667 Y22.055667
+G1 X39.962667 Y22.817667
+G1 X39.073667 Y23.833667
+G1 X38.057667 Y24.722667
+G1 X37.253333 Y25.400000
+G1 X0.000000 Y25.400000
+G0 Z#100
+(polygon end, distance 129.45)
+(end, total distance 129.45mm = 5.10in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode6/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode6/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index 7dfd6a0..0000000
--- a/tests/golden/hid_gcode6/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,43 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:39:31 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X0.000000 Y25.400000 (start point)
-G1 Z#101
-G1 X0.000000 Y0.000000
-G1 X32.258000 Y0.000000
-G1 X33.020000 Y0.635000
-G1 X34.036000 Y1.524000
-G1 X34.925000 Y2.540000
-G1 X35.560000 Y3.302000
-G1 X36.449000 Y4.656667
-G1 X36.914667 Y5.503333
-G1 X37.380333 Y6.477000
-G1 X37.846000 Y7.704667
-G1 X38.227000 Y9.017000
-G1 X38.481000 Y10.329333
-G1 X38.608000 Y11.514667
-G1 X38.608000 Y13.843000
-G1 X38.481000 Y15.028333
-G1 X38.227000 Y16.340667
-G1 X37.846000 Y17.653000
-G1 X37.380333 Y18.880667
-G1 X36.914667 Y19.854333
-G1 X36.449000 Y20.701000
-G1 X35.560000 Y22.055667
-G1 X34.925000 Y22.817667
-G1 X34.036000 Y23.833667
-G1 X33.020000 Y24.722667
-G1 X32.215667 Y25.400000
-G1 X0.000000 Y25.400000
-G0 Z#100
-(polygon end, distance 119.38)
-(end, total distance 119.38mm = 4.70in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode6/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode6/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..7dfd6a0
--- /dev/null
+++ b/tests/golden/hid_gcode6/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,43 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:39:31 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X0.000000 Y25.400000 (start point)
+G1 Z#101
+G1 X0.000000 Y0.000000
+G1 X32.258000 Y0.000000
+G1 X33.020000 Y0.635000
+G1 X34.036000 Y1.524000
+G1 X34.925000 Y2.540000
+G1 X35.560000 Y3.302000
+G1 X36.449000 Y4.656667
+G1 X36.914667 Y5.503333
+G1 X37.380333 Y6.477000
+G1 X37.846000 Y7.704667
+G1 X38.227000 Y9.017000
+G1 X38.481000 Y10.329333
+G1 X38.608000 Y11.514667
+G1 X38.608000 Y13.843000
+G1 X38.481000 Y15.028333
+G1 X38.227000 Y16.340667
+G1 X37.846000 Y17.653000
+G1 X37.380333 Y18.880667
+G1 X36.914667 Y19.854333
+G1 X36.449000 Y20.701000
+G1 X35.560000 Y22.055667
+G1 X34.925000 Y22.817667
+G1 X34.036000 Y23.833667
+G1 X33.020000 Y24.722667
+G1 X32.215667 Y25.400000
+G1 X0.000000 Y25.400000
+G0 Z#100
+(polygon end, distance 119.38)
+(end, total distance 119.38mm = 4.70in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode7/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode7/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index b92e532..0000000
--- a/tests/golden/hid_gcode7/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:12 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.770667 Y13.546667 (start point)
-G1 Z#101
-G1 X27.559000 Y13.462000
-G1 X27.305000 Y13.292667
-G1 X7.450667 Y13.292667
-G1 X7.196667 Y13.081000
-G1 X6.985000 Y12.827000
-G1 X6.985000 Y12.530667
-G1 X7.196667 Y12.276667
-G1 X7.450667 Y12.065000
-G1 X27.305000 Y12.065000
-G1 X27.643667 Y11.853333
-G1 X28.194000 Y11.853333
-G1 X28.532667 Y12.065000
-G1 X28.744333 Y12.403667
-G1 X28.744333 Y12.954000
-G1 X28.532667 Y13.292667
-G1 X28.194000 Y13.504333
-G1 X27.770667 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode7/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode7/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..b92e532
--- /dev/null
+++ b/tests/golden/hid_gcode7/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:12 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.770667 Y13.546667 (start point)
+G1 Z#101
+G1 X27.559000 Y13.462000
+G1 X27.305000 Y13.292667
+G1 X7.450667 Y13.292667
+G1 X7.196667 Y13.081000
+G1 X6.985000 Y12.827000
+G1 X6.985000 Y12.530667
+G1 X7.196667 Y12.276667
+G1 X7.450667 Y12.065000
+G1 X27.305000 Y12.065000
+G1 X27.643667 Y11.853333
+G1 X28.194000 Y11.853333
+G1 X28.532667 Y12.065000
+G1 X28.744333 Y12.403667
+G1 X28.744333 Y12.954000
+G1 X28.532667 Y13.292667
+G1 X28.194000 Y13.504333
+G1 X27.770667 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode7/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode7/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index 4c64804..0000000
--- a/tests/golden/hid_gcode7/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:08 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.733000 Y13.546667 (start point)
-G1 Z#101
-G1 X22.521333 Y13.462000
-G1 X22.267333 Y13.292667
-G1 X2.413000 Y13.292667
-G1 X2.159000 Y13.081000
-G1 X1.947333 Y12.827000
-G1 X1.947333 Y12.530667
-G1 X2.159000 Y12.276667
-G1 X2.413000 Y12.065000
-G1 X22.267333 Y12.065000
-G1 X22.606000 Y11.853333
-G1 X23.156333 Y11.853333
-G1 X23.495000 Y12.065000
-G1 X23.706667 Y12.403667
-G1 X23.706667 Y12.954000
-G1 X23.495000 Y13.292667
-G1 X23.156333 Y13.504333
-G1 X22.733000 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode7/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode7/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..4c64804
--- /dev/null
+++ b/tests/golden/hid_gcode7/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:08 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.733000 Y13.546667 (start point)
+G1 Z#101
+G1 X22.521333 Y13.462000
+G1 X22.267333 Y13.292667
+G1 X2.413000 Y13.292667
+G1 X2.159000 Y13.081000
+G1 X1.947333 Y12.827000
+G1 X1.947333 Y12.530667
+G1 X2.159000 Y12.276667
+G1 X2.413000 Y12.065000
+G1 X22.267333 Y12.065000
+G1 X22.606000 Y11.853333
+G1 X23.156333 Y11.853333
+G1 X23.495000 Y12.065000
+G1 X23.706667 Y12.403667
+G1 X23.706667 Y12.954000
+G1 X23.495000 Y13.292667
+G1 X23.156333 Y13.504333
+G1 X22.733000 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode8/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode8/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index 286cab5..0000000
--- a/tests/golden/hid_gcode8/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:19 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X27.770667 Y13.546667 (start point)
-G1 Z#101
-G1 X27.559000 Y13.462000
-G1 X27.305000 Y13.292667
-G1 X7.450667 Y13.292667
-G1 X7.196667 Y13.081000
-G1 X6.985000 Y12.827000
-G1 X6.985000 Y12.530667
-G1 X7.196667 Y12.276667
-G1 X7.450667 Y12.065000
-G1 X27.305000 Y12.065000
-G1 X27.643667 Y11.853333
-G1 X28.194000 Y11.853333
-G1 X28.532667 Y12.065000
-G1 X28.744333 Y12.403667
-G1 X28.744333 Y12.954000
-G1 X28.532667 Y13.292667
-G1 X28.194000 Y13.504333
-G1 X27.770667 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode8/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode8/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..286cab5
--- /dev/null
+++ b/tests/golden/hid_gcode8/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:19 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X27.770667 Y13.546667 (start point)
+G1 Z#101
+G1 X27.559000 Y13.462000
+G1 X27.305000 Y13.292667
+G1 X7.450667 Y13.292667
+G1 X7.196667 Y13.081000
+G1 X6.985000 Y12.827000
+G1 X6.985000 Y12.530667
+G1 X7.196667 Y12.276667
+G1 X7.450667 Y12.065000
+G1 X27.305000 Y12.065000
+G1 X27.643667 Y11.853333
+G1 X28.194000 Y11.853333
+G1 X28.532667 Y12.065000
+G1 X28.744333 Y12.403667
+G1 X28.744333 Y12.954000
+G1 X28.532667 Y13.292667
+G1 X28.194000 Y13.504333
+G1 X27.770667 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode8/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode8/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index a57aeb7..0000000
--- a/tests/golden/hid_gcode8/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:16 2010 )
-(600 dpi)
-(Unit: mm)
-(Board size: 50.80x25.40 mm)
-#100=2.000000 (safe Z)
-#101=-0.050000 (cutting depth)
-(---------------------------------)
-G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
-G0 Z#100
-(polygon 1)
-G0 X22.733000 Y13.546667 (start point)
-G1 Z#101
-G1 X22.521333 Y13.462000
-G1 X22.267333 Y13.292667
-G1 X2.413000 Y13.292667
-G1 X2.159000 Y13.081000
-G1 X1.947333 Y12.827000
-G1 X1.947333 Y12.530667
-G1 X2.159000 Y12.276667
-G1 X2.413000 Y12.065000
-G1 X22.267333 Y12.065000
-G1 X22.606000 Y11.853333
-G1 X23.156333 Y11.853333
-G1 X23.495000 Y12.065000
-G1 X23.706667 Y12.403667
-G1 X23.706667 Y12.954000
-G1 X23.495000 Y13.292667
-G1 X23.156333 Y13.504333
-G1 X22.733000 Y13.546667
-G0 Z#100
-(polygon end, distance 45.38)
-(end, total distance 45.38mm = 1.79in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode8/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode8/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..a57aeb7
--- /dev/null
+++ b/tests/golden/hid_gcode8/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:16 2010 )
+(600 dpi)
+(Unit: mm)
+(Board size: 50.80x25.40 mm)
+#100=2.000000 (safe Z)
+#101=-0.050000 (cutting depth)
+(---------------------------------)
+G17 G21 G90 G64 P0.003 M3 S3000 M7 F25
+G0 Z#100
+(polygon 1)
+G0 X22.733000 Y13.546667 (start point)
+G1 Z#101
+G1 X22.521333 Y13.462000
+G1 X22.267333 Y13.292667
+G1 X2.413000 Y13.292667
+G1 X2.159000 Y13.081000
+G1 X1.947333 Y12.827000
+G1 X1.947333 Y12.530667
+G1 X2.159000 Y12.276667
+G1 X2.413000 Y12.065000
+G1 X22.267333 Y12.065000
+G1 X22.606000 Y11.853333
+G1 X23.156333 Y11.853333
+G1 X23.495000 Y12.065000
+G1 X23.706667 Y12.403667
+G1 X23.706667 Y12.954000
+G1 X23.495000 Y13.292667
+G1 X23.156333 Y13.504333
+G1 X22.733000 Y13.546667
+G0 Z#100
+(polygon end, distance 45.38)
+(end, total distance 45.38mm = 1.79in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode9/gcode_oneline.gcode.back.cnc b/tests/golden/hid_gcode9/gcode_oneline.gcode.back.cnc
deleted file mode 100644
index 49ebcd5..0000000
--- a/tests/golden/hid_gcode9/gcode_oneline.gcode.back.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:25 2010 )
-(600 dpi)
-(Unit: inch)
-(Board size: 2.00x1.00 inches)
-#100=0.002000 (safe Z)
-#101=-0.000050 (cutting depth)
-(---------------------------------)
-G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
-G0 Z#100
-(polygon 1)
-G0 X1.093333 Y0.530000 (start point)
-G1 Z#101
-G1 X1.083333 Y0.525000
-G1 X1.076667 Y0.520000
-G1 X0.291667 Y0.518333
-G1 X0.280000 Y0.506667
-G1 X0.280000 Y0.491667
-G1 X0.291667 Y0.480000
-G1 X1.076667 Y0.478333
-G1 X1.088333 Y0.470000
-G1 X1.100000 Y0.468333
-G1 X1.113333 Y0.471667
-G1 X1.123333 Y0.480000
-G1 X1.130000 Y0.493333
-G1 X1.130000 Y0.505000
-G1 X1.123333 Y0.518333
-G1 X1.115000 Y0.525000
-G1 X1.103333 Y0.530000
-G1 X1.093333 Y0.530000
-G0 Z#100
-(polygon end, distance 1.77)
-(end, total distance 44.84mm = 1.77in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode9/gcode_oneline.gcode.bottom.cnc b/tests/golden/hid_gcode9/gcode_oneline.gcode.bottom.cnc
new file mode 100644
index 0000000..49ebcd5
--- /dev/null
+++ b/tests/golden/hid_gcode9/gcode_oneline.gcode.bottom.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:25 2010 )
+(600 dpi)
+(Unit: inch)
+(Board size: 2.00x1.00 inches)
+#100=0.002000 (safe Z)
+#101=-0.000050 (cutting depth)
+(---------------------------------)
+G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
+G0 Z#100
+(polygon 1)
+G0 X1.093333 Y0.530000 (start point)
+G1 Z#101
+G1 X1.083333 Y0.525000
+G1 X1.076667 Y0.520000
+G1 X0.291667 Y0.518333
+G1 X0.280000 Y0.506667
+G1 X0.280000 Y0.491667
+G1 X0.291667 Y0.480000
+G1 X1.076667 Y0.478333
+G1 X1.088333 Y0.470000
+G1 X1.100000 Y0.468333
+G1 X1.113333 Y0.471667
+G1 X1.123333 Y0.480000
+G1 X1.130000 Y0.493333
+G1 X1.130000 Y0.505000
+G1 X1.123333 Y0.518333
+G1 X1.115000 Y0.525000
+G1 X1.103333 Y0.530000
+G1 X1.093333 Y0.530000
+G0 Z#100
+(polygon end, distance 1.77)
+(end, total distance 44.84mm = 1.77in)
+M5 M9 M2
diff --git a/tests/golden/hid_gcode9/gcode_oneline.gcode.front.cnc b/tests/golden/hid_gcode9/gcode_oneline.gcode.front.cnc
deleted file mode 100644
index 638cec1..0000000
--- a/tests/golden/hid_gcode9/gcode_oneline.gcode.front.cnc
+++ /dev/null
@@ -1,34 +0,0 @@
-(Created by G-code exporter)
-( Tue Mar 9 17:45:22 2010 )
-(600 dpi)
-(Unit: inch)
-(Board size: 2.00x1.00 inches)
-#100=0.002000 (safe Z)
-#101=-0.000050 (cutting depth)
-(---------------------------------)
-G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
-G0 Z#100
-(polygon 1)
-G0 X0.895000 Y0.530000 (start point)
-G1 Z#101
-G1 X0.885000 Y0.525000
-G1 X0.878333 Y0.520000
-G1 X0.093333 Y0.518333
-G1 X0.081667 Y0.506667
-G1 X0.081667 Y0.491667
-G1 X0.093333 Y0.480000
-G1 X0.878333 Y0.478333
-G1 X0.890000 Y0.470000
-G1 X0.901667 Y0.468333
-G1 X0.915000 Y0.471667
-G1 X0.925000 Y0.480000
-G1 X0.931667 Y0.493333
-G1 X0.931667 Y0.505000
-G1 X0.925000 Y0.518333
-G1 X0.916667 Y0.525000
-G1 X0.905000 Y0.530000
-G1 X0.895000 Y0.530000
-G0 Z#100
-(polygon end, distance 1.77)
-(end, total distance 44.84mm = 1.77in)
-M5 M9 M2
diff --git a/tests/golden/hid_gcode9/gcode_oneline.gcode.top.cnc b/tests/golden/hid_gcode9/gcode_oneline.gcode.top.cnc
new file mode 100644
index 0000000..638cec1
--- /dev/null
+++ b/tests/golden/hid_gcode9/gcode_oneline.gcode.top.cnc
@@ -0,0 +1,34 @@
+(Created by G-code exporter)
+( Tue Mar 9 17:45:22 2010 )
+(600 dpi)
+(Unit: inch)
+(Board size: 2.00x1.00 inches)
+#100=0.002000 (safe Z)
+#101=-0.000050 (cutting depth)
+(---------------------------------)
+G17 G20 G90 G64 P0.003 M3 S3000 M7 F1
+G0 Z#100
+(polygon 1)
+G0 X0.895000 Y0.530000 (start point)
+G1 Z#101
+G1 X0.885000 Y0.525000
+G1 X0.878333 Y0.520000
+G1 X0.093333 Y0.518333
+G1 X0.081667 Y0.506667
+G1 X0.081667 Y0.49166...
[truncated message content] |
|
From: <gi...@gp...> - 2011-04-20 23:15:16
|
The branch, master has been updated
via 5f82d26c2f66fe8ed772077b5675d15978565f69 (commit)
via 6eeed5e36bd59a70eccbfe41bfc1ee2e01ec0637 (commit)
via da75262390e3f9c7097a4a7a377d646d394230a5 (commit)
from 4efcedeeac06cd4d5e559a7fe0a0ee8685f2137a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/crosshair.c | 71 +++++++------
src/draw.c | 224 ++--------------------------------------
src/global.h | 5 +-
src/hid.h | 2 +
src/hid/common/draw_helpers.c | 164 ++++++++++++++++++++++++++++++
src/hid/common/draw_helpers.h | 2 +
src/hid/common/hidnogui.c | 16 +++
7 files changed, 239 insertions(+), 245 deletions(-)
=================
Commit Messages
=================
commit 5f82d26c2f66fe8ed772077b5675d15978565f69
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Draw the hole outline for pins / vias being moved or placed
:100644 100644 14b6491... 054610b... M src/crosshair.c
commit 6eeed5e36bd59a70eccbfe41bfc1ee2e01ec0637
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
crosshair.c: Use a dummy via structure to draw vias being created
:100644 100644 4b20885... 14b6491... M src/crosshair.c
commit da75262390e3f9c7097a4a7a377d646d394230a5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 64cf020... 4b20885... M src/crosshair.c
:100644 100644 8d6e0f6... 76c9a89... M src/draw.c
:100644 100644 0eca83b... 904d6fe... M src/global.h
:100644 100644 d6f494a... 0a81ddd... M src/hid.h
:100644 100644 9de587f... b043d92... M src/hid/common/draw_helpers.c
:100644 100644 4b1e827... 8243fe4... M src/hid/common/draw_helpers.h
:100644 100644 b6d26f8... 1568cd5... M src/hid/common/hidnogui.c
=========
Changes
=========
commit 5f82d26c2f66fe8ed772077b5675d15978565f69
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Draw the hole outline for pins / vias being moved or placed
diff --git a/src/crosshair.c b/src/crosshair.c
index 14b6491..054610b 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -94,7 +94,7 @@ thindraw_moved_pv (PinType *pv, int x, int y)
moved_pv.X += x;
moved_pv.Y += y;
- gui->thindraw_pcb_pv (Crosshair.GC, Crosshair.GC, &moved_pv, false, false);
+ gui->thindraw_pcb_pv (Crosshair.GC, Crosshair.GC, &moved_pv, true, false);
}
/* ---------------------------------------------------------------------------
@@ -573,7 +573,7 @@ DrawAttached (void)
via.Mask = 0;
via.Flags = NoFlags ();
- gui->thindraw_pcb_pv (Crosshair.GC, Crosshair.GC, &via, false, false);
+ gui->thindraw_pcb_pv (Crosshair.GC, Crosshair.GC, &via, true, false);
if (TEST_FLAG (SHOWDRCFLAG, PCB))
{
commit 6eeed5e36bd59a70eccbfe41bfc1ee2e01ec0637
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
crosshair.c: Use a dummy via structure to draw vias being created
diff --git a/src/crosshair.c b/src/crosshair.c
index 4b20885..14b6491 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -556,28 +556,35 @@ XORDrawMoveOrCopyObject (void)
void
DrawAttached (void)
{
- BDimension s;
-
if (!Crosshair.On)
return;
switch (Settings.Mode)
{
case VIA_MODE:
- gui->draw_arc (Crosshair.GC,
- Crosshair.X,
- Crosshair.Y,
- Settings.ViaThickness / 2,
- Settings.ViaThickness / 2, 0, 360);
- if (TEST_FLAG (SHOWDRCFLAG, PCB))
- {
- s = Settings.ViaThickness / 2 + PCB->Bloat + 1;
- gui->set_color (Crosshair.GC, Settings.CrossColor);
- gui->draw_arc (Crosshair.GC,
- Crosshair.X, Crosshair.Y, s, s, 0, 360);
- gui->set_color (Crosshair.GC, Settings.CrosshairColor);
- }
- break;
+ {
+ /* Make a dummy via structure to draw from */
+ PinType via;
+ via.X = Crosshair.X;
+ via.Y = Crosshair.Y;
+ via.Thickness = Settings.ViaThickness;
+ via.Clearance = 2 * Settings.Keepaway;
+ via.DrillingHole = Settings.ViaDrillingHole;
+ via.Mask = 0;
+ via.Flags = NoFlags ();
+
+ gui->thindraw_pcb_pv (Crosshair.GC, Crosshair.GC, &via, false, false);
+
+ if (TEST_FLAG (SHOWDRCFLAG, PCB))
+ {
+ /* XXX: Naughty cheat - use the mask to draw DRC clearance! */
+ via.Mask = Settings.ViaThickness + PCB->Bloat * 2;
+ gui->set_color (Crosshair.GC, Settings.CrossColor);
+ gui->thindraw_pcb_pv (Crosshair.GC, Crosshair.GC, &via, false, true);
+ gui->set_color (Crosshair.GC, Settings.CrosshairColor);
+ }
+ break;
+ }
/* the attached line is used by both LINEMODE, POLYGON_MODE and POLYGONHOLE_MODE*/
case POLYGON_MODE:
commit da75262390e3f9c7097a4a7a377d646d394230a5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/crosshair.c b/src/crosshair.c
index 64cf020..4b20885 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -86,6 +86,17 @@ static void XORDrawAttachedLine (LocationType, LocationType, LocationType,
LocationType, BDimension);
static void XORDrawAttachedArc (BDimension);
+static void
+thindraw_moved_pv (PinType *pv, int x, int y)
+{
+ /* Make a copy of the pin structure, moved to the correct position */
+ PinType moved_pv = *pv;
+ moved_pv.X += x;
+ moved_pv.Y += y;
+
+ gui->thindraw_pcb_pv (Crosshair.GC, Crosshair.GC, &moved_pv, false, false);
+}
+
/* ---------------------------------------------------------------------------
* creates a tmp polygon with coordinates converted to screen system
*/
@@ -245,10 +256,7 @@ XORDrawElement (ElementTypePtr Element, LocationType DX, LocationType DY)
/* pin coordinates and angles have to be converted to X11 notation */
PIN_LOOP (Element);
{
- gui->draw_arc (Crosshair.GC,
- DX + pin->X,
- DY + pin->Y,
- pin->Thickness / 2, pin->Thickness / 2, 0, 360);
+ thindraw_moved_pv (pin, DX, DY);
}
END_LOOP;
@@ -352,13 +360,11 @@ XORDrawBuffer (BufferTypePtr Buffer)
}
END_LOOP;
- /* and the vias, move offset by thickness/2 */
+ /* and the vias */
if (PCB->ViaOn)
VIA_LOOP (Buffer->Data);
{
- gui->draw_arc (Crosshair.GC,
- x + via->X, y + via->Y,
- via->Thickness / 2, via->Thickness / 2, 0, 360);
+ thindraw_moved_pv (via, x, y);
}
END_LOOP;
}
@@ -396,13 +402,9 @@ XORDrawMoveOrCopyObject (void)
{
case VIA_TYPE:
{
- PinTypePtr via = (PinTypePtr) Crosshair.AttachedObject.Ptr1;
-
- gui->draw_arc (Crosshair.GC,
- via->X + dx,
- via->Y + dy,
- via->Thickness / 2, via->Thickness / 2, 0, 360);
- break;
+ PinTypePtr via = (PinTypePtr) Crosshair.AttachedObject.Ptr1;
+ thindraw_moved_pv (via, dx, dy);
+ break;
}
case LINE_TYPE:
diff --git a/src/draw.c b/src/draw.c
index 8d6e0f6..76c9a89 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -68,15 +68,6 @@ RCSID ("$Id$");
/* ---------------------------------------------------------------------------
- * some local types
- */
-typedef struct
-{
- double X, Y;
-}
-FloatPolyType, *FloatPolyTypePtr;
-
-/* ---------------------------------------------------------------------------
* some local identifiers
*/
static BoxType Block = {MAXINT, MAXINT, -MAXINT, -MAXINT};
@@ -94,7 +85,6 @@ static void DrawEverything (BoxTypePtr);
static void DrawTop (const BoxType *);
static int DrawLayerGroup (int, const BoxType *);
static void DrawPinOrViaLowLevel (PinTypePtr, bool);
-static void ClearOnlyPin (PinTypePtr, bool);
static void DrawPlainPin (PinTypePtr, bool);
static void DrawPlainVia (PinTypePtr, bool);
static void DrawPinOrViaNameLowLevel (PinTypePtr);
@@ -664,10 +654,15 @@ struct pin_info
static int
clearPin_callback (const BoxType * b, void *cl)
{
- PinTypePtr pin = (PinTypePtr) b;
+ PinType *pin = (PinTypePtr) b;
struct pin_info *i = (struct pin_info *) cl;
if (i->arg)
- ClearOnlyPin (pin, true);
+ {
+ if (TEST_FLAG (THINDRAWFLAG, PCB) || TEST_FLAG (THINDRAWPOLYFLAG, PCB))
+ gui->thindraw_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
+ else
+ gui->fill_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
+ }
return 1;
}
static int
@@ -907,161 +902,21 @@ DrawLayerGroup (int group, const BoxType * screen)
}
/* ---------------------------------------------------------------------------
- * draws one polygon
- * x and y are already in display coordinates
- * the points are numbered:
- *
- * 5 --- 6
- * / \
- * 4 7
- * | |
- * 3 0
- * \ /
- * 2 --- 1
- */
-static void
-DrawSpecialPolygon (hidGC DrawGC,
- LocationType X, LocationType Y, int Thickness,
- int thin_draw)
-{
- static FloatPolyType p[8] = {
- {
- 0.5, -TAN_22_5_DEGREE_2},
- {
- TAN_22_5_DEGREE_2, -0.5},
- {
- -TAN_22_5_DEGREE_2, -0.5},
- {
- -0.5, -TAN_22_5_DEGREE_2},
- {
- -0.5, TAN_22_5_DEGREE_2},
- {
- -TAN_22_5_DEGREE_2, 0.5},
- {
- TAN_22_5_DEGREE_2, 0.5},
- {
- 0.5, TAN_22_5_DEGREE_2}
- };
- static int special_size = 0;
- static int scaled_x[8];
- static int scaled_y[8];
- int polygon_x[9];
- int polygon_y[9];
- int i;
-
-
- if (Thickness != special_size)
- {
- special_size = Thickness;
- for (i = 0; i < 8; i++)
- {
- scaled_x[i] = p[i].X * special_size;
- scaled_y[i] = p[i].Y * special_size;
- }
- }
- /* add line offset */
- for (i = 0; i < 8; i++)
- {
- polygon_x[i] = X + scaled_x[i];
- polygon_y[i] = Y + scaled_y[i];
- }
- if (thin_draw)
- {
- int i;
- gui->set_line_cap (DrawGC, Round_Cap);
- gui->set_line_width (DrawGC, 0);
- polygon_x[8] = X + scaled_x[0];
- polygon_y[8] = Y + scaled_y[0];
- for (i = 0; i < 8; i++)
- gui->draw_line (DrawGC, polygon_x[i], polygon_y[i],
- polygon_x[i + 1], polygon_y[i + 1]);
- }
- else
- gui->fill_polygon (DrawGC, 8, polygon_x, polygon_y);
-}
-
-/* ---------------------------------------------------------------------------
* lowlevel drawing routine for pins and vias
*/
static void
-DrawPinOrViaLowLevel (PinTypePtr Ptr, bool drawHole)
+DrawPinOrViaLowLevel (PinTypePtr pv, bool drawHole)
{
if (Gathering)
{
- AddPart (Ptr);
+ AddPart (pv);
return;
}
- if (TEST_FLAG (HOLEFLAG, Ptr))
- {
- if (drawHole)
- {
- gui->fill_circle (Output.bgGC, Ptr->X, Ptr->Y, Ptr->Thickness / 2);
- gui->set_line_cap (Output.fgGC, Round_Cap);
- gui->set_line_width (Output.fgGC, 0);
- gui->draw_arc (Output.fgGC, Ptr->X, Ptr->Y,
- Ptr->Thickness / 2, Ptr->Thickness / 2, 0, 360);
- }
- return;
- }
- if (TEST_FLAG (SQUAREFLAG, Ptr))
- {
- int l, r, t, b;
- l = Ptr->X - Ptr->Thickness / 2;
- b = Ptr->Y - Ptr->Thickness / 2;
- r = l + Ptr->Thickness;
- t = b + Ptr->Thickness;
- if (TEST_FLAG (THINDRAWFLAG, PCB))
- {
- gui->set_line_cap (Output.fgGC, Round_Cap);
- gui->set_line_width (Output.fgGC, 0);
- gui->draw_line (Output.fgGC, r, t, r, b);
- gui->draw_line (Output.fgGC, l, t, l, b);
- gui->draw_line (Output.fgGC, r, t, l, t);
- gui->draw_line (Output.fgGC, r, b, l, b);
- }
- else
- {
- gui->fill_rect (Output.fgGC, l, b, r, t);
- }
- }
- else if (TEST_FLAG (OCTAGONFLAG, Ptr))
- {
- DrawSpecialPolygon (Output.fgGC, Ptr->X, Ptr->Y, Ptr->Thickness,
- TEST_FLAG (THINDRAWFLAG, PCB));
- }
+ if (TEST_FLAG (THINDRAWFLAG, PCB))
+ gui->thindraw_pcb_pv (Output.fgGC, Output.fgGC, pv, drawHole, false);
else
- { /* draw a round pin or via */
- if (TEST_FLAG (THINDRAWFLAG, PCB))
- {
- gui->set_line_cap (Output.fgGC, Round_Cap);
- gui->set_line_width (Output.fgGC, 0);
- gui->draw_arc (Output.fgGC, Ptr->X, Ptr->Y,
- Ptr->Thickness / 2, Ptr->Thickness / 2, 0, 360);
- }
- else
- {
- gui->fill_circle (Output.fgGC, Ptr->X, Ptr->Y, Ptr->Thickness / 2);
- }
- }
-
- /* and the drilling hole (which is always round */
- if (drawHole)
- {
- if (TEST_FLAG (THINDRAWFLAG, PCB))
- {
- gui->set_line_cap (Output.fgGC, Round_Cap);
- gui->set_line_width (Output.fgGC, 0);
- gui->draw_arc (Output.fgGC,
- Ptr->X, Ptr->Y, Ptr->DrillingHole / 2,
- Ptr->DrillingHole / 2, 0, 360);
- }
- else
- {
- gui->fill_circle (Output.bgGC, Ptr->X, Ptr->Y,
- Ptr->DrillingHole / 2);
- }
- }
+ gui->fill_pcb_pv (Output.fgGC, Output.bgGC, pv, drawHole, false);
}
/**************************************************************
@@ -1102,61 +957,6 @@ DrawHole (PinTypePtr Ptr)
}
}
-/*******************************************************************
- * draw clearance in pixmask around pins and vias that pierce polygons
- */
-static void
-ClearOnlyPin (PinTypePtr Pin, bool mask)
-{
- BDimension half =
- (mask ? Pin->Mask / 2 : (Pin->Thickness + Pin->Clearance) / 2);
-
- if (!mask && TEST_FLAG (HOLEFLAG, Pin))
- return;
- if (half == 0)
- return;
- if (!mask && Pin->Clearance <= 0)
- return;
-
- /* Clear the area around the pin */
- if (TEST_FLAG (SQUAREFLAG, Pin))
- {
- int l, r, t, b;
- l = Pin->X - half;
- b = Pin->Y - half;
- r = l + half * 2;
- t = b + half * 2;
- if (TEST_FLAG (THINDRAWFLAG, PCB) || TEST_FLAG (THINDRAWPOLYFLAG, PCB))
- {
- gui->set_line_cap (Output.pmGC, Round_Cap);
- gui->set_line_width (Output.pmGC, 0);
- gui->draw_line (Output.pmGC, r, t, r, b);
- gui->draw_line (Output.pmGC, l, t, l, b);
- gui->draw_line (Output.pmGC, r, t, l, t);
- gui->draw_line (Output.pmGC, r, b, l, b);
- }
- else
- gui->fill_rect (Output.pmGC, l, b, r, t);
- }
- else if (TEST_FLAG (OCTAGONFLAG, Pin))
- {
- DrawSpecialPolygon (Output.pmGC, Pin->X, Pin->Y, half * 2,
- TEST_FLAG (THINDRAWFLAG, PCB) ||
- TEST_FLAG (THINDRAWPOLYFLAG, PCB));
- }
- else
- {
- if (TEST_FLAG (THINDRAWFLAG, PCB) || TEST_FLAG (THINDRAWPOLYFLAG, PCB))
- {
- gui->set_line_cap (Output.pmGC, Round_Cap);
- gui->set_line_width (Output.pmGC, 0);
- gui->draw_arc (Output.pmGC, Pin->X, Pin->Y, half, half, 0, 360);
- }
- else
- gui->fill_circle (Output.pmGC, Pin->X, Pin->Y, half);
- }
-}
-
/* ---------------------------------------------------------------------------
* lowlevel drawing routine for pin and via names
*/
diff --git a/src/global.h b/src/global.h
index 0eca83b..904d6fe 100644
--- a/src/global.h
+++ b/src/global.h
@@ -55,6 +55,7 @@
typedef struct BoxType BoxType, *BoxTypePtr;
typedef struct polygon_st PolygonType, *PolygonTypePtr;
typedef struct pad_st PadType, *PadTypePtr;
+typedef struct pin_st PinType, *PinTypePtr, **PinTypeHandle;
typedef struct drc_violation_st DrcViolationType, *DrcViolationTypePtr;
typedef struct rtree rtree_t;
typedef struct AttributeListType AttributeListType, *AttributeListTypePtr;
@@ -320,7 +321,7 @@ struct pad_st /* a SMD pad */
void *Spare;
};
-typedef struct
+struct pin_st
{
ANYOBJECTFIELDS;
BDimension Thickness, Clearance, Mask, DrillingHole;
@@ -329,7 +330,7 @@ typedef struct
char *Name, *Number;
void *Element;
void *Spare;
-} PinType, *PinTypePtr, **PinTypeHandle;
+};
typedef struct
{
diff --git a/src/hid.h b/src/hid.h
index d6f494a..0a81ddd 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -384,6 +384,8 @@ typedef enum
const BoxType *clip_box);
void (*fill_pcb_pad) (hidGC gc_, PadType *pad, bool clip, bool mask);
void (*thindraw_pcb_pad) (hidGC gc_, PadType *pad, bool clip, bool mask);
+ void (*fill_pcb_pv) (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask);
+ void (*thindraw_pcb_pv) (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask);
void (*fill_rect) (hidGC gc_, int x1_, int y1_, int x2_, int y2_);
diff --git a/src/hid/common/draw_helpers.c b/src/hid/common/draw_helpers.c
index 9de587f..b043d92 100644
--- a/src/hid/common/draw_helpers.c
+++ b/src/hid/common/draw_helpers.c
@@ -303,6 +303,168 @@ common_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
}
}
+/* ---------------------------------------------------------------------------
+ * draws one polygon
+ * x and y are already in display coordinates
+ * the points are numbered:
+ *
+ * 5 --- 6
+ * / \
+ * 4 7
+ * | |
+ * 3 0
+ * \ /
+ * 2 --- 1
+ */
+
+typedef struct
+{
+ double X, Y;
+}
+FloatPolyType;
+
+static void
+draw_octagon_poly (hidGC gc, LocationType X, LocationType Y,
+ int Thickness, int thin_draw)
+{
+ static FloatPolyType p[8] = {
+ { 0.5, -TAN_22_5_DEGREE_2},
+ { TAN_22_5_DEGREE_2, -0.5 },
+ {-TAN_22_5_DEGREE_2, -0.5 },
+ {-0.5, -TAN_22_5_DEGREE_2},
+ {-0.5, TAN_22_5_DEGREE_2},
+ {-TAN_22_5_DEGREE_2, 0.5 },
+ { TAN_22_5_DEGREE_2, 0.5 },
+ { 0.5, TAN_22_5_DEGREE_2}
+ };
+ static int special_size = 0;
+ static int scaled_x[8];
+ static int scaled_y[8];
+ int polygon_x[9];
+ int polygon_y[9];
+ int i;
+
+ if (Thickness != special_size)
+ {
+ special_size = Thickness;
+ for (i = 0; i < 8; i++)
+ {
+ scaled_x[i] = p[i].X * special_size;
+ scaled_y[i] = p[i].Y * special_size;
+ }
+ }
+ /* add line offset */
+ for (i = 0; i < 8; i++)
+ {
+ polygon_x[i] = X + scaled_x[i];
+ polygon_y[i] = Y + scaled_y[i];
+ }
+
+ if (thin_draw)
+ {
+ int i;
+ gui->set_line_cap (gc, Round_Cap);
+ gui->set_line_width (gc, 0);
+ polygon_x[8] = X + scaled_x[0];
+ polygon_y[8] = Y + scaled_y[0];
+ for (i = 0; i < 8; i++)
+ gui->draw_line (gc, polygon_x[i ], polygon_y[i ],
+ polygon_x[i + 1], polygon_y[i + 1]);
+ }
+ else
+ gui->fill_polygon (gc, 8, polygon_x, polygon_y);
+}
+
+void
+common_fill_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask)
+{
+ int w = mask ? pv->Mask : pv->Thickness;
+ int r = w / 2;
+
+ if (TEST_FLAG (HOLEFLAG, pv))
+ {
+ if (drawHole)
+ {
+ gui->fill_circle (bg_gc, pv->X, pv->Y, r);
+ gui->set_line_cap (fg_gc, Round_Cap);
+ gui->set_line_width (fg_gc, 0);
+ gui->draw_arc (fg_gc, pv->X, pv->Y, r, r, 0, 360);
+ }
+ return;
+ }
+
+ if (TEST_FLAG (SQUAREFLAG, pv))
+ {
+ int l = pv->X - r;
+ int b = pv->Y - r;
+ int r = l + w;
+ int t = b + w;
+
+ gui->fill_rect (fg_gc, l, b, r, t);
+ }
+ else if (TEST_FLAG (OCTAGONFLAG, pv))
+ draw_octagon_poly (fg_gc, pv->X, pv->Y, w, false);
+ else /* draw a round pin or via */
+ gui->fill_circle (fg_gc, pv->X, pv->Y, r);
+
+ /* and the drilling hole (which is always round) */
+ if (drawHole)
+ gui->fill_circle (bg_gc, pv->X, pv->Y, pv->DrillingHole / 2);
+}
+
+void
+common_thindraw_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask)
+{
+ int w = mask ? pv->Mask : pv->Thickness;
+ int r = w / 2;
+
+ if (TEST_FLAG (HOLEFLAG, pv))
+ {
+ if (drawHole)
+ {
+ gui->set_line_cap (bg_gc, Round_Cap);
+ gui->set_line_width (bg_gc, 0);
+ gui->draw_arc (bg_gc, pv->X, pv->Y, r, r, 0, 360);
+ }
+ return;
+ }
+
+ if (TEST_FLAG (SQUAREFLAG, pv))
+ {
+ int l = pv->X - r;
+ int b = pv->Y - r;
+ int r = l + w;
+ int t = b + w;
+
+ gui->set_line_cap (fg_gc, Round_Cap);
+ gui->set_line_width (fg_gc, 0);
+ gui->draw_line (fg_gc, r, t, r, b);
+ gui->draw_line (fg_gc, l, t, l, b);
+ gui->draw_line (fg_gc, r, t, l, t);
+ gui->draw_line (fg_gc, r, b, l, b);
+
+ }
+ else if (TEST_FLAG (OCTAGONFLAG, pv))
+ {
+ draw_octagon_poly (fg_gc, pv->X, pv->Y, w, true);
+ }
+ else /* draw a round pin or via */
+ {
+ gui->set_line_cap (fg_gc, Round_Cap);
+ gui->set_line_width (fg_gc, 0);
+ gui->draw_arc (fg_gc, pv->X, pv->Y, r, r, 0, 360);
+ }
+
+ /* and the drilling hole (which is always round */
+ if (drawHole)
+ {
+ gui->set_line_cap (bg_gc, Round_Cap);
+ gui->set_line_width (bg_gc, 0);
+ gui->draw_arc (bg_gc, pv->X, pv->Y, pv->DrillingHole / 2,
+ pv->DrillingHole / 2, 0, 360);
+ }
+}
+
void
common_draw_helpers_init (HID *hid)
{
@@ -310,4 +472,6 @@ common_draw_helpers_init (HID *hid)
hid->thindraw_pcb_polygon = common_thindraw_pcb_polygon;
hid->fill_pcb_pad = common_fill_pcb_pad;
hid->thindraw_pcb_pad = common_thindraw_pcb_pad;
+ hid->fill_pcb_pv = common_fill_pcb_pv;
+ hid->thindraw_pcb_pv = common_thindraw_pcb_pv;
}
diff --git a/src/hid/common/draw_helpers.h b/src/hid/common/draw_helpers.h
index 4b1e827..8243fe4 100644
--- a/src/hid/common/draw_helpers.h
+++ b/src/hid/common/draw_helpers.h
@@ -4,4 +4,6 @@ void common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly,
const BoxType *clip_box);
void common_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask);
void common_thindraw_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask);
+void common_fill_pcb_pv (hidGC gc, PinType *pv, bool drawHole, bool mask);
+void common_thindraw_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask);
void common_draw_helpers_init (HID *hid);
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index b6d26f8..1568cd5 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -171,6 +171,18 @@ nogui_thindraw_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
}
static void
+nogui_fill_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pad, bool drawHole, bool mask)
+{
+ CRASH;
+}
+
+static void
+nogui_thindraw_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pad, bool drawHole, bool mask)
+{
+ CRASH;
+}
+
+static void
nogui_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
CRASH;
@@ -451,6 +463,8 @@ HID hid_nogui = {
0 /* nogui_thindraw_pcb_polygon */ ,
nogui_fill_pcb_pad,
nogui_thindraw_pcb_pad,
+ nogui_fill_pcb_pv,
+ nogui_thindraw_pcb_pv,
nogui_fill_rect,
nogui_calibrate,
nogui_shift_is_pressed,
@@ -508,6 +522,8 @@ apply_default_hid (HID * d, HID * s)
AD (thindraw_pcb_polygon);
AD (fill_pcb_pad);
AD (thindraw_pcb_pad);
+ AD (fill_pcb_pv);
+ AD (thindraw_pcb_pv);
AD (calibrate);
AD (shift_is_pressed);
AD (control_is_pressed);
|
|
From: <gi...@gp...> - 2011-04-20 17:05:45
|
The branch, master has been updated
via 4efcedeeac06cd4d5e559a7fe0a0ee8685f2137a (commit)
from 1adeb2d51143b51033840e75d971c88d1e11c11d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/crosshair.c | 30 +++-------
src/draw.c | 133 +----------------------------------------
src/global.h | 5 +-
src/hid.h | 2 +
src/hid/common/draw_helpers.c | 106 ++++++++++++++++++++++++++++++++
src/hid/common/draw_helpers.h | 2 +
src/hid/common/hidnogui.c | 16 +++++
7 files changed, 139 insertions(+), 155 deletions(-)
=================
Commit Messages
=================
commit 4efcedeeac06cd4d5e559a7fe0a0ee8685f2137a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 7d9fcb4... 64cf020... M src/crosshair.c
:100644 100644 707969a... 8d6e0f6... M src/draw.c
:100644 100644 e449a34... 0eca83b... M src/global.h
:100644 100644 b13e75b... d6f494a... M src/hid.h
:100644 100644 a9835d0... 9de587f... M src/hid/common/draw_helpers.c
:100644 100644 6710b24... 4b1e827... M src/hid/common/draw_helpers.h
:100644 100644 fd86b6a... b6d26f8... M src/hid/common/hidnogui.c
=========
Changes
=========
commit 4efcedeeac06cd4d5e559a7fe0a0ee8685f2137a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/crosshair.c b/src/crosshair.c
index 7d9fcb4..64cf020 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -255,29 +255,15 @@ XORDrawElement (ElementTypePtr Element, LocationType DX, LocationType DY)
/* pads */
PAD_LOOP (Element);
{
- if ((TEST_FLAG (ONSOLDERFLAG, pad) != 0) ==
- Settings.ShowSolderSide || PCB->InvisibleObjectsOn)
+ if (PCB->InvisibleObjectsOn ||
+ (TEST_FLAG (ONSOLDERFLAG, pad) != 0) == Settings.ShowSolderSide)
{
- if (pad->Point1.X == pad->Point2.X
- || pad->Point1.Y == pad->Point2.Y)
- {
- int minx, miny, maxx, maxy;
- minx = DX + MIN (pad->Point1.X, pad->Point2.X) - pad->Thickness/2;
- maxx = DX + MAX (pad->Point1.X, pad->Point2.X) + pad->Thickness/2;
- miny = DY + MIN (pad->Point1.Y, pad->Point2.Y) - pad->Thickness/2;
- maxy = DY + MAX (pad->Point1.Y, pad->Point2.Y) + pad->Thickness/2;
- gui->draw_line (Crosshair.GC, minx, miny, maxx, miny);
- gui->draw_line (Crosshair.GC, minx, miny, minx, maxy);
- gui->draw_line (Crosshair.GC, maxx, miny, maxx, maxy);
- gui->draw_line (Crosshair.GC, minx, maxy, maxx, maxy);
- }
- else
- {
- /* FIXME: draw outlines, not centerlines. */
- gui->draw_line (Crosshair.GC,
- DX + pad->Point1.X, DY + pad->Point1.Y,
- DX + pad->Point2.X, DY + pad->Point2.Y);
- }
+ /* Make a copy of the pad structure, moved to the correct position */
+ PadType moved_pad = *pad;
+ moved_pad.Point1.X += DX; moved_pad.Point1.Y += DY;
+ moved_pad.Point2.X += DX; moved_pad.Point2.Y += DY;
+
+ gui->thindraw_pcb_pad (Crosshair.GC, &moved_pad, false, false);
}
}
END_LOOP;
diff --git a/src/draw.c b/src/draw.c
index 707969a..8d6e0f6 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -1227,9 +1227,6 @@ DrawPinOrViaNameLowLevel (PinTypePtr Ptr)
static void
DrawPadLowLevel (hidGC gc, PadTypePtr Pad, bool clear, bool mask)
{
- int w = clear ? (mask ? Pad->Mask : Pad->Thickness + Pad->Clearance)
- : Pad->Thickness;
-
if (Gathering)
{
AddPart (Pad);
@@ -1241,135 +1238,9 @@ DrawPadLowLevel (hidGC gc, PadTypePtr Pad, bool clear, bool mask)
if (TEST_FLAG (THINDRAWFLAG, PCB) ||
(clear && TEST_FLAG (THINDRAWPOLYFLAG, PCB)))
- {
- int x1, y1, x2, y2, t, t2;
- t = w / 2;
- t2 = w - t;
- x1 = Pad->Point1.X;
- y1 = Pad->Point1.Y;
- x2 = Pad->Point2.X;
- y2 = Pad->Point2.Y;
- if (x1 > x2 || y1 > y2)
- {
- /* this is a silly way to swap the variables */
- x1 ^= x2;
- x2 ^= x1;
- x1 ^= x2;
- y1 ^= y2;
- y2 ^= y1;
- y1 ^= y2;
- }
- gui->set_line_cap (gc, Round_Cap);
- gui->set_line_width (gc, 0);
- if (TEST_FLAG (SQUAREFLAG, Pad)
- && (x1 == x2 || y1 == y2))
- {
- x1 -= t;
- y1 -= t;
- x2 += t2;
- y2 += t2;
- gui->draw_line (gc, x1, y1, x1, y2);
- gui->draw_line (gc, x1, y2, x2, y2);
- gui->draw_line (gc, x2, y2, x2, y1);
- gui->draw_line (gc, x2, y1, x1, y1);
- }
- else if (TEST_FLAG (SQUAREFLAG, Pad))
- {
- /* slanted square pad */
- float tx, ty, theta;
-
- theta = atan2 (y2-y1, x2-x1);
-
- /* T is a vector half a thickness long, in the direction of
- one of the corners. */
- tx = t * cos (theta + M_PI/4) * sqrt(2.0);
- ty = t * sin (theta + M_PI/4) * sqrt(2.0);
-
- gui->draw_line (gc, x1-tx, y1-ty, x2+ty, y2-tx);
- gui->draw_line (gc, x2+ty, y2-tx, x2+tx, y2+ty);
- gui->draw_line (gc, x2+tx, y2+ty, x1-ty, y1+tx);
- gui->draw_line (gc, x1-ty, y1+tx, x1-tx, y1-ty);
- }
- else if (x1 == x2 && y1 == y2)
- {
- gui->draw_arc (gc, x1, y1, w / 2, w / 2, 0, 360);
- }
- else if (x1 == x2)
- {
- gui->draw_line (gc, x1 - t, y1, x2 - t, y2);
- gui->draw_line (gc, x1 + t2, y1, x2 + t2, y2);
- gui->draw_arc (gc, x1, y1, w / 2, w / 2, 0, -180);
- gui->draw_arc (gc, x2, y2, w / 2, w / 2, 180, -180);
- }
- else if (y1 == y2)
- {
- gui->draw_line (gc, x1, y1 - t, x2, y2 - t);
- gui->draw_line (gc, x1, y1 + t2, x2, y2 + t2);
- gui->draw_arc (gc, x1, y1, w / 2, w / 2, 90, -180);
- gui->draw_arc (gc, x2, y2, w / 2, w / 2, 270, -180);
- }
- else
- {
- /* Slanted round-end pads. */
- LocationType dx, dy, ox, oy;
- float h;
-
- dx = x2 - x1;
- dy = y2 - y1;
- h = t / sqrt (SQUARE (dx) + SQUARE (dy));
- ox = dy * h + 0.5 * SGN (dy);
- oy = -(dx * h + 0.5 * SGN (dx));
-
- gui->draw_line (gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy);
-
- if (abs (ox) >= pixel_slop || abs (oy) >= pixel_slop)
- {
- LocationType angle = atan2 ((float) dx, (float) dy) * 57.295779;
- gui->draw_line (gc, x1 - ox, y1 - oy, x2 - ox, y2 - oy);
- gui->draw_arc (gc,
- x1, y1, t, t, angle - 180, 180);
- gui->draw_arc (gc, x2, y2, t, t, angle, 180);
- }
- }
- }
- else if (Pad->Point1.X == Pad->Point2.X
- && Pad->Point1.Y == Pad->Point2.Y)
- {
- if (TEST_FLAG (SQUAREFLAG, Pad))
- {
- int l, r, t, b;
- l = Pad->Point1.X - w / 2;
- b = Pad->Point1.Y - w / 2;
- r = l + w;
- t = b + w;
- gui->fill_rect (gc, l, b, r, t);
- }
- else
- {
- gui->fill_circle (gc, Pad->Point1.X, Pad->Point1.Y, w / 2);
- }
- }
+ gui->thindraw_pcb_pad (gc, Pad, clear, mask);
else
- {
- gui->set_line_cap (gc,
- TEST_FLAG (SQUAREFLAG,
- Pad) ? Square_Cap : Round_Cap);
- gui->set_line_width (gc, w);
-
- gui->draw_line (gc,
- Pad->Point1.X, Pad->Point1.Y,
- Pad->Point2.X, Pad->Point2.Y);
- }
-#if 0
- { /* Draw bounding box for test */
- BoxType *box = &Pad->BoundingBox;
- gui->set_line_width (gc, 0);
- gui->draw_line (gc, box->X1, box->Y1, box->X1, box->Y2);
- gui->draw_line (gc, box->X1, box->Y2, box->X2, box->Y2);
- gui->draw_line (gc, box->X2, box->Y2, box->X2, box->Y1);
- gui->draw_line (gc, box->X2, box->Y1, box->X1, box->Y1);
- }
-#endif
+ gui->fill_pcb_pad (gc, Pad, clear, mask);
}
/* ---------------------------------------------------------------------------
diff --git a/src/global.h b/src/global.h
index e449a34..0eca83b 100644
--- a/src/global.h
+++ b/src/global.h
@@ -54,6 +54,7 @@
/* Forward declarations for structures the HIDs need. */
typedef struct BoxType BoxType, *BoxTypePtr;
typedef struct polygon_st PolygonType, *PolygonTypePtr;
+typedef struct pad_st PadType, *PadTypePtr;
typedef struct drc_violation_st DrcViolationType, *DrcViolationTypePtr;
typedef struct rtree rtree_t;
typedef struct AttributeListType AttributeListType, *AttributeListTypePtr;
@@ -310,14 +311,14 @@ typedef struct /* a rat-line */
Cardinal group1, group2; /* the layer group each point is on */
} RatType, *RatTypePtr;
-typedef struct /* a SMD pad */
+struct pad_st /* a SMD pad */
{
ANYLINEFIELDS;
BDimension Mask;
char *Name, *Number; /* 'Line' */
void *Element;
void *Spare;
-} PadType, *PadTypePtr;
+};
typedef struct
{
diff --git a/src/hid.h b/src/hid.h
index b13e75b..d6f494a 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -382,6 +382,8 @@ typedef enum
const BoxType *clip_box);
void (*thindraw_pcb_polygon) (hidGC gc_, PolygonType *poly,
const BoxType *clip_box);
+ void (*fill_pcb_pad) (hidGC gc_, PadType *pad, bool clip, bool mask);
+ void (*thindraw_pcb_pad) (hidGC gc_, PadType *pad, bool clip, bool mask);
void (*fill_rect) (hidGC gc_, int x1_, int y1_, int x2_, int y2_);
diff --git a/src/hid/common/draw_helpers.c b/src/hid/common/draw_helpers.c
index a9835d0..9de587f 100644
--- a/src/hid/common/draw_helpers.c
+++ b/src/hid/common/draw_helpers.c
@@ -200,8 +200,114 @@ common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly,
}
void
+common_thindraw_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
+{
+ int w = clear ? (mask ? pad->Mask
+ : pad->Thickness + pad->Clearance)
+ : pad->Thickness;
+ int x1, y1, x2, y2;
+ int t = w / 2;
+ x1 = pad->Point1.X;
+ y1 = pad->Point1.Y;
+ x2 = pad->Point2.X;
+ y2 = pad->Point2.Y;
+ if (x1 > x2 || y1 > y2)
+ {
+ int temp_x = x1;
+ int temp_y = y1;
+ x1 = x2; x2 = temp_x;
+ y1 = y2; y2 = temp_y;
+ }
+ gui->set_line_cap (gc, Round_Cap);
+ gui->set_line_width (gc, 0);
+ if (TEST_FLAG (SQUAREFLAG, pad))
+ {
+ /* slanted square pad */
+ float tx, ty, theta;
+
+ if (x1 == x2 || y1 == y2)
+ theta = 0;
+ else
+ theta = atan2 (y2 - y1, x2 - x1);
+
+ /* T is a vector half a thickness long, in the direction of
+ one of the corners. */
+ tx = t * cos (theta + M_PI / 4) * sqrt (2.0);
+ ty = t * sin (theta + M_PI / 4) * sqrt (2.0);
+
+ gui->draw_line (gc, x1 - tx, y1 - ty, x2 + ty, y2 - tx);
+ gui->draw_line (gc, x2 + ty, y2 - tx, x2 + tx, y2 + ty);
+ gui->draw_line (gc, x2 + tx, y2 + ty, x1 - ty, y1 + tx);
+ gui->draw_line (gc, x1 - ty, y1 + tx, x1 - tx, y1 - ty);
+ }
+ else if (x1 == x2 && y1 == y2)
+ {
+ gui->draw_arc (gc, x1, y1, t, t, 0, 360);
+ }
+ else
+ {
+ /* Slanted round-end pads. */
+ LocationType dx, dy, ox, oy;
+ float h;
+
+ dx = x2 - x1;
+ dy = y2 - y1;
+ h = t / sqrt (SQUARE (dx) + SQUARE (dy));
+ ox = dy * h + 0.5 * SGN (dy);
+ oy = -(dx * h + 0.5 * SGN (dx));
+
+ gui->draw_line (gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy);
+
+ if (abs (ox) >= pixel_slop || abs (oy) >= pixel_slop)
+ {
+ LocationType angle = atan2 (dx, dy) * 57.295779;
+ gui->draw_line (gc, x1 - ox, y1 - oy, x2 - ox, y2 - oy);
+ gui->draw_arc (gc, x1, y1, t, t, angle - 180, 180);
+ gui->draw_arc (gc, x2, y2, t, t, angle, 180);
+ }
+ }
+}
+
+void
+common_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
+{
+ int w = clear ? (mask ? pad->Mask
+ : pad->Thickness + pad->Clearance)
+ : pad->Thickness;
+
+ if (pad->Point1.X == pad->Point2.X &&
+ pad->Point1.Y == pad->Point2.Y)
+ {
+ if (TEST_FLAG (SQUAREFLAG, pad))
+ {
+ int l, r, t, b;
+ l = pad->Point1.X - w / 2;
+ b = pad->Point1.Y - w / 2;
+ r = l + w;
+ t = b + w;
+ gui->fill_rect (gc, l, b, r, t);
+ }
+ else
+ {
+ gui->fill_circle (gc, pad->Point1.X, pad->Point1.Y, w / 2);
+ }
+ }
+ else
+ {
+ gui->set_line_cap (gc, TEST_FLAG (SQUAREFLAG, pad) ?
+ Square_Cap : Round_Cap);
+ gui->set_line_width (gc, w);
+
+ gui->draw_line (gc, pad->Point1.X, pad->Point1.Y,
+ pad->Point2.X, pad->Point2.Y);
+ }
+}
+
+void
common_draw_helpers_init (HID *hid)
{
hid->fill_pcb_polygon = common_fill_pcb_polygon;
hid->thindraw_pcb_polygon = common_thindraw_pcb_polygon;
+ hid->fill_pcb_pad = common_fill_pcb_pad;
+ hid->thindraw_pcb_pad = common_thindraw_pcb_pad;
}
diff --git a/src/hid/common/draw_helpers.h b/src/hid/common/draw_helpers.h
index 6710b24..4b1e827 100644
--- a/src/hid/common/draw_helpers.h
+++ b/src/hid/common/draw_helpers.h
@@ -2,4 +2,6 @@ void common_fill_pcb_polygon (hidGC gc, PolygonType *poly,
const BoxType *clip_box);
void common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly,
const BoxType *clip_box);
+void common_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask);
+void common_thindraw_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask);
void common_draw_helpers_init (HID *hid);
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index fd86b6a..b6d26f8 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -159,6 +159,18 @@ nogui_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
}
static void
+nogui_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
+{
+ CRASH;
+}
+
+static void
+nogui_thindraw_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask)
+{
+ CRASH;
+}
+
+static void
nogui_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
CRASH;
@@ -437,6 +449,8 @@ HID hid_nogui = {
nogui_fill_polygon,
nogui_fill_pcb_polygon,
0 /* nogui_thindraw_pcb_polygon */ ,
+ nogui_fill_pcb_pad,
+ nogui_thindraw_pcb_pad,
nogui_fill_rect,
nogui_calibrate,
nogui_shift_is_pressed,
@@ -492,6 +506,8 @@ apply_default_hid (HID * d, HID * s)
AD (fill_polygon);
AD (fill_pcb_polygon);
AD (thindraw_pcb_polygon);
+ AD (fill_pcb_pad);
+ AD (thindraw_pcb_pad);
AD (calibrate);
AD (shift_is_pressed);
AD (control_is_pressed);
|
|
From: <gi...@gp...> - 2011-04-20 16:54:28
|
The branch, master has been updated
via 1adeb2d51143b51033840e75d971c88d1e11c11d (commit)
from d8fef462f5c3608ab2c11f13ffc5135a312c10e0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/batch/batch.c | 14 ++------------
src/hid/common/draw_helpers.c | 7 +++++++
src/hid/common/draw_helpers.h | 1 +
src/hid/common/extents.c | 3 ++-
src/hid/gcode/gcode.c | 3 ++-
src/hid/gerber/gerber.c | 3 ++-
src/hid/gtk/gtkhid-main.c | 4 ++--
src/hid/lesstif/main.c | 4 ++--
src/hid/nelma/nelma.c | 3 ++-
src/hid/png/png.c | 3 ++-
src/hid/ps/eps.c | 3 ++-
src/hid/ps/ps.c | 2 ++
12 files changed, 28 insertions(+), 22 deletions(-)
=================
Commit Messages
=================
commit 1adeb2d51143b51033840e75d971c88d1e11c11d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 e6eaf52... 99c2220... M src/hid/batch/batch.c
:100644 100644 b9db654... a9835d0... M src/hid/common/draw_helpers.c
:100644 100644 3705317... 6710b24... M src/hid/common/draw_helpers.h
:100644 100644 2b0386c... 5ac46ea... M src/hid/common/extents.c
:100644 100644 3e49ed3... 6491afd... M src/hid/gcode/gcode.c
:100644 100644 d18cd2a... d5843ef... M src/hid/gerber/gerber.c
:100644 100644 84cca05... 5af6ed6... M src/hid/gtk/gtkhid-main.c
:100644 100644 4595b80... c1b12d3... M src/hid/lesstif/main.c
:100644 100644 217a546... 6e911ff... M src/hid/nelma/nelma.c
:100644 100644 7c2f461... 3919a6e... M src/hid/png/png.c
:100644 100644 17c7697... f94175f... M src/hid/ps/eps.c
:100644 100644 616f5d5... a417753... M src/hid/ps/ps.c
=========
Changes
=========
commit 1adeb2d51143b51033840e75d971c88d1e11c11d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index e6eaf52..99c2220 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -244,16 +244,6 @@ batch_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
}
static void
-batch_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
-{
-}
-
-static void
-batch_thindraw_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
-{
-}
-
-static void
batch_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
}
@@ -354,6 +344,8 @@ hid_batch_init ()
{
memset (&batch_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&batch_hid);
+
batch_hid.struct_size = sizeof (HID);
batch_hid.name = "batch";
batch_hid.description = "Batch-mode GUI for non-interactive use.";
@@ -379,8 +371,6 @@ hid_batch_init ()
batch_hid.draw_rect = batch_draw_rect;
batch_hid.fill_circle = batch_fill_circle;
batch_hid.fill_polygon = batch_fill_polygon;
- batch_hid.fill_pcb_polygon = batch_fill_pcb_polygon;
- batch_hid.thindraw_pcb_polygon = batch_thindraw_pcb_polygon;
batch_hid.fill_rect = batch_fill_rect;
batch_hid.calibrate = batch_calibrate;
batch_hid.shift_is_pressed = batch_shift_is_pressed;
diff --git a/src/hid/common/draw_helpers.c b/src/hid/common/draw_helpers.c
index b9db654..a9835d0 100644
--- a/src/hid/common/draw_helpers.c
+++ b/src/hid/common/draw_helpers.c
@@ -198,3 +198,10 @@ common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly,
thindraw_contour (gc, poly->Clipped->contours);
PolygonHoles (poly, clip_box, thindraw_hole_cb, gc);
}
+
+void
+common_draw_helpers_init (HID *hid)
+{
+ hid->fill_pcb_polygon = common_fill_pcb_polygon;
+ hid->thindraw_pcb_polygon = common_thindraw_pcb_polygon;
+}
diff --git a/src/hid/common/draw_helpers.h b/src/hid/common/draw_helpers.h
index 3705317..6710b24 100644
--- a/src/hid/common/draw_helpers.h
+++ b/src/hid/common/draw_helpers.h
@@ -2,3 +2,4 @@ void common_fill_pcb_polygon (hidGC gc, PolygonType *poly,
const BoxType *clip_box);
void common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly,
const BoxType *clip_box);
+void common_draw_helpers_init (HID *hid);
diff --git a/src/hid/common/extents.c b/src/hid/common/extents.c
index 2b0386c..5ac46ea 100644
--- a/src/hid/common/extents.c
+++ b/src/hid/common/extents.c
@@ -181,6 +181,8 @@ hid_extents_init (void)
memset (&extents_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&extents_hid);
+
extents_hid.struct_size = sizeof (HID);
extents_hid.name = "extents-extents";
extents_hid.description = "used to calculate extents";
@@ -201,7 +203,6 @@ hid_extents_init (void)
extents_hid.draw_rect = extents_draw_rect;
extents_hid.fill_circle = extents_fill_circle;
extents_hid.fill_polygon = extents_fill_polygon;
- extents_hid.fill_pcb_polygon = common_fill_pcb_polygon;
extents_hid.fill_rect = extents_fill_rect;
initialised = true;
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 3e49ed3..6491afd 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -1037,6 +1037,8 @@ hid_gcode_init ()
{
memset (&gcode_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&gcode_hid);
+
gcode_hid.struct_size = sizeof (HID);
gcode_hid.name = "gcode";
gcode_hid.description = "G-CODE export.";
@@ -1061,7 +1063,6 @@ hid_gcode_init ()
gcode_hid.draw_rect = gcode_draw_rect;
gcode_hid.fill_circle = gcode_fill_circle;
gcode_hid.fill_polygon = gcode_fill_polygon;
- gcode_hid.fill_pcb_polygon = common_fill_pcb_polygon;
gcode_hid.fill_rect = gcode_fill_rect;
gcode_hid.calibrate = gcode_calibrate;
gcode_hid.set_crosshair = gcode_set_crosshair;
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index d18cd2a..d5843ef 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -1174,6 +1174,8 @@ hid_gerber_init ()
{
memset (&gerber_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&gerber_hid);
+
gerber_hid.struct_size = sizeof (HID);
gerber_hid.name = "gerber";
gerber_hid.description = "RS-274X (Gerber) export.";
@@ -1198,7 +1200,6 @@ hid_gerber_init ()
gerber_hid.draw_rect = gerber_draw_rect;
gerber_hid.fill_circle = gerber_fill_circle;
gerber_hid.fill_polygon = gerber_fill_polygon;
- gerber_hid.fill_pcb_polygon = common_fill_pcb_polygon;
gerber_hid.fill_rect = gerber_fill_rect;
gerber_hid.calibrate = gerber_calibrate;
gerber_hid.set_crosshair = gerber_set_crosshair;
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 84cca05..5af6ed6 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2100,6 +2100,8 @@ hid_gtk_init ()
memset (&ghid_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&ghid_hid);
+
ghid_hid.struct_size = sizeof (HID);
ghid_hid.name = "gtk";
ghid_hid.description = "Gtk - The Gimp Toolkit";
@@ -2126,8 +2128,6 @@ hid_gtk_init ()
ghid_hid.draw_rect = ghid_draw_rect;
ghid_hid.fill_circle = ghid_fill_circle;
ghid_hid.fill_polygon = ghid_fill_polygon;
- ghid_hid.fill_pcb_polygon = common_fill_pcb_polygon;
- ghid_hid.thindraw_pcb_polygon = common_thindraw_pcb_polygon;
ghid_hid.fill_rect = ghid_fill_rect;
ghid_hid.calibrate = ghid_calibrate;
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 4595b80..c1b12d3 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -3802,6 +3802,8 @@ hid_lesstif_init ()
{
memset (&lesstif_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&lesstif_hid);
+
lesstif_hid.struct_size = sizeof (HID);
lesstif_hid.name = "lesstif";
lesstif_hid.description = "LessTif - a Motif clone for X/Unix";
@@ -3828,8 +3830,6 @@ hid_lesstif_init ()
lesstif_hid.draw_rect = lesstif_draw_rect;
lesstif_hid.fill_circle = lesstif_fill_circle;
lesstif_hid.fill_polygon = lesstif_fill_polygon;
- lesstif_hid.fill_pcb_polygon = common_fill_pcb_polygon;
- lesstif_hid.thindraw_pcb_polygon = common_thindraw_pcb_polygon;
lesstif_hid.fill_rect = lesstif_fill_rect;
lesstif_hid.calibrate = lesstif_calibrate;
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index 217a546..6e911ff 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -1052,6 +1052,8 @@ hid_nelma_init()
{
memset (&nelma_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&nelma_hid);
+
nelma_hid.struct_size = sizeof (HID);
nelma_hid.name = "nelma";
nelma_hid.description = "Numerical analysis package export.";
@@ -1076,7 +1078,6 @@ hid_nelma_init()
nelma_hid.draw_rect = nelma_draw_rect;
nelma_hid.fill_circle = nelma_fill_circle;
nelma_hid.fill_polygon = nelma_fill_polygon;
- nelma_hid.fill_pcb_polygon = common_fill_pcb_polygon;
nelma_hid.fill_rect = nelma_fill_rect;
nelma_hid.calibrate = nelma_calibrate;
nelma_hid.set_crosshair = nelma_set_crosshair;
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 7c2f461..3919a6e 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -1521,6 +1521,8 @@ hid_png_init ()
{
memset (&png_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&png_hid);
+
png_hid.struct_size = sizeof (HID);
png_hid.name = "png";
png_hid.description = "GIF/JPEG/PNG export.";
@@ -1546,7 +1548,6 @@ hid_png_init ()
png_hid.draw_rect = png_draw_rect;
png_hid.fill_circle = png_fill_circle;
png_hid.fill_polygon = png_fill_polygon;
- png_hid.fill_pcb_polygon = common_fill_pcb_polygon;
png_hid.fill_rect = png_fill_rect;
png_hid.calibrate = png_calibrate;
png_hid.set_crosshair = png_set_crosshair;
diff --git a/src/hid/ps/eps.c b/src/hid/ps/eps.c
index 17c7697..f94175f 100644
--- a/src/hid/ps/eps.c
+++ b/src/hid/ps/eps.c
@@ -642,6 +642,8 @@ hid_eps_init ()
{
memset (&eps_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&eps_hid);
+
eps_hid.struct_size = sizeof (HID);
eps_hid.name = "eps";
eps_hid.description = "Encapsulated Postscript";
@@ -666,7 +668,6 @@ hid_eps_init ()
eps_hid.draw_rect = eps_draw_rect;
eps_hid.fill_circle = eps_fill_circle;
eps_hid.fill_polygon = eps_fill_polygon;
- eps_hid.fill_pcb_polygon = common_fill_pcb_polygon;
eps_hid.fill_rect = eps_fill_rect;
eps_hid.calibrate = eps_calibrate;
eps_hid.set_crosshair = eps_set_crosshair;
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index 616f5d5..a417753 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -1349,6 +1349,8 @@ hid_ps_init ()
{
memset (&ps_hid, 0, sizeof (HID));
+ common_draw_helpers_init (&ps_hid);
+
ps_hid.struct_size = sizeof (HID);
ps_hid.name = "ps";
ps_hid.description = "Postscript export.";
|
|
From: <gi...@gp...> - 2011-04-20 16:28:21
|
The branch, master has been updated
via d8fef462f5c3608ab2c11f13ffc5135a312c10e0 (commit)
via 3ba0473b72c74a8d65f00078759f3340b01c1701 (commit)
from c0786a1526e34a23f8c1db4eafd25e8c2ed8de34 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/common/draw_helpers.c | 21 +++++++++++++--------
src/hid/gcode/gcode.c | 2 ++
src/hid/png/png.c | 2 ++
3 files changed, 17 insertions(+), 8 deletions(-)
=================
Commit Messages
=================
commit d8fef462f5c3608ab2c11f13ffc5135a312c10e0
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Some formatting changes in draw_helpers.c
:100644 100644 dc1f60f... b9db654... M src/hid/common/draw_helpers.c
commit 3ba0473b72c74a8d65f00078759f3340b01c1701
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 9360cb7... 3e49ed3... M src/hid/gcode/gcode.c
:100644 100644 ca87a84... 7c2f461... M src/hid/png/png.c
=========
Changes
=========
commit d8fef462f5c3608ab2c11f13ffc5135a312c10e0
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Some formatting changes in draw_helpers.c
diff --git a/src/hid/common/draw_helpers.c b/src/hid/common/draw_helpers.c
index dc1f60f..b9db654 100644
--- a/src/hid/common/draw_helpers.c
+++ b/src/hid/common/draw_helpers.c
@@ -2,7 +2,8 @@
#include "hid.h"
#include "polygon.h"
-static void fill_contour (hidGC gc, PLINE *pl)
+static void
+fill_contour (hidGC gc, PLINE *pl)
{
int *x, *y, n, i = 0;
VNODE *v;
@@ -23,7 +24,8 @@ static void fill_contour (hidGC gc, PLINE *pl)
free (y);
}
-static void thindraw_contour (hidGC gc, PLINE *pl)
+static void
+thindraw_contour (hidGC gc, PLINE *pl)
{
VNODE *v;
int last_x, last_y;
@@ -61,7 +63,8 @@ static void thindraw_contour (hidGC gc, PLINE *pl)
while ((v = v->next) != pl->head.next);
}
-static void fill_contour_cb (PLINE *pl, void *user_data)
+static void
+fill_contour_cb (PLINE *pl, void *user_data)
{
hidGC gc = (hidGC)user_data;
PLINE *local_pl = pl;
@@ -136,8 +139,8 @@ should_compute_no_holes (PolygonType *poly, const BoxType *clip_box)
}
#undef BOUNDS_INSIDE_CLIP_THRESHOLD
-void common_fill_pcb_polygon (hidGC gc, PolygonType *poly,
- const BoxType *clip_box)
+void
+common_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
{
/* FIXME: We aren't checking the gui's dicer flag..
we are dicing for every case. Some GUIs
@@ -180,15 +183,17 @@ void common_fill_pcb_polygon (hidGC gc, PolygonType *poly,
}
}
-static int thindraw_hole_cb (PLINE *pl, void *user_data)
+static int
+thindraw_hole_cb (PLINE *pl, void *user_data)
{
hidGC gc = (hidGC)user_data;
thindraw_contour (gc, pl);
return 0;
}
-void common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly,
- const BoxType *clip_box)
+void
+common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly,
+ const BoxType *clip_box)
{
thindraw_contour (gc, poly->Clipped->contours);
PolygonHoles (poly, clip_box, thindraw_hole_cb, gc);
commit 3ba0473b72c74a8d65f00078759f3340b01c1701
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 9360cb7..3e49ed3 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -1035,6 +1035,8 @@ HID gcode_hid;
void
hid_gcode_init ()
{
+ memset (&gcode_hid, 0, sizeof (HID));
+
gcode_hid.struct_size = sizeof (HID);
gcode_hid.name = "gcode";
gcode_hid.description = "G-CODE export.";
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index ca87a84..7c2f461 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -1519,6 +1519,8 @@ png_set_crosshair (int x, int y, int a)
void
hid_png_init ()
{
+ memset (&png_hid, 0, sizeof (HID));
+
png_hid.struct_size = sizeof (HID);
png_hid.name = "png";
png_hid.description = "GIF/JPEG/PNG export.";
|
|
From: <gi...@gp...> - 2011-04-18 23:20:50
|
The branch, master has been updated
discards d0cc2001c5bbf7b4b99010e8e56cb5011c0da4e5 (commit)
via c0786a1526e34a23f8c1db4eafd25e8c2ed8de34 (commit)
from d0cc2001c5bbf7b4b99010e8e56cb5011c0da4e5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
=================
Commit Messages
=================
commit c0786a1526e34a23f8c1db4eafd25e8c2ed8de34
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 bc00a7e... 707969a... M src/draw.c
=========
Changes
=========
commit c0786a1526e34a23f8c1db4eafd25e8c2ed8de34
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/draw.c b/src/draw.c
index bc00a7e..707969a 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -54,6 +54,10 @@
#include <dmalloc.h>
#endif
+#ifndef MAXINT
+#define MAXINT (((unsigned int)(~0))>>1)
+#endif
+
RCSID ("$Id$");
#define SMALL_SMALL_TEXT_SIZE 0
@@ -75,7 +79,7 @@ FloatPolyType, *FloatPolyTypePtr;
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static BoxType Block;
+static BoxType Block = {MAXINT, MAXINT, -MAXINT, -MAXINT};
static bool Gathering = true;
static int doing_pinout = 0;
@@ -190,12 +194,14 @@ Draw (void)
/* clear and create event if not drawing to a pixmap
*/
- gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
+ if (Block.X1 <= Block.X2 && Block.Y1 <= Block.Y2)
+ gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
RestoreCrosshair ();
/* shrink the update block */
- Block.X1 = Block.Y1 = Block.X2 = Block.Y2 = 0;
+ Block.X1 = Block.Y1 = MAXINT;
+ Block.X2 = Block.Y2 = -MAXINT;
}
/* ---------------------------------------------------------------------------
|
|
From: <gi...@gp...> - 2011-04-18 23:17:05
|
The branch, master has been updated
via d0cc2001c5bbf7b4b99010e8e56cb5011c0da4e5 (commit)
from 20dab2bdf553f86c43ead942e8c32a6356031af2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit d0cc2001c5bbf7b4b99010e8e56cb5011c0da4e5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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 gahering.
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.
:100644 100644 bc00a7e... 707969a... M src/draw.c
=========
Changes
=========
commit d0cc2001c5bbf7b4b99010e8e56cb5011c0da4e5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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 gahering.
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.
diff --git a/src/draw.c b/src/draw.c
index bc00a7e..707969a 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -54,6 +54,10 @@
#include <dmalloc.h>
#endif
+#ifndef MAXINT
+#define MAXINT (((unsigned int)(~0))>>1)
+#endif
+
RCSID ("$Id$");
#define SMALL_SMALL_TEXT_SIZE 0
@@ -75,7 +79,7 @@ FloatPolyType, *FloatPolyTypePtr;
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static BoxType Block;
+static BoxType Block = {MAXINT, MAXINT, -MAXINT, -MAXINT};
static bool Gathering = true;
static int doing_pinout = 0;
@@ -190,12 +194,14 @@ Draw (void)
/* clear and create event if not drawing to a pixmap
*/
- gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
+ if (Block.X1 <= Block.X2 && Block.Y1 <= Block.Y2)
+ gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
RestoreCrosshair ();
/* shrink the update block */
- Block.X1 = Block.Y1 = Block.X2 = Block.Y2 = 0;
+ Block.X1 = Block.Y1 = MAXINT;
+ Block.X2 = Block.Y2 = -MAXINT;
}
/* ---------------------------------------------------------------------------
|
|
From: <gi...@gp...> - 2011-04-18 22:58:03
|
The branch, master has been updated
via 20dab2bdf553f86c43ead942e8c32a6356031af2 (commit)
from eb3c0196c031b1be6b8f7393cf3e669328549758 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/crosshair.c | 50 ++++++++++++++++++++++++++---------------------
src/crosshair.h | 4 +-
src/hid/lesstif/main.c | 4 +-
3 files changed, 32 insertions(+), 26 deletions(-)
=================
Commit Messages
=================
commit 20dab2bdf553f86c43ead942e8c32a6356031af2
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 eb19257... 7d9fcb4... M src/crosshair.c
:100644 100644 4573e98... ff16b1e... M src/crosshair.h
:100644 100644 c5f3e3e... 4595b80... M src/hid/lesstif/main.c
=========
Changes
=========
commit 20dab2bdf553f86c43ead942e8c32a6356031af2
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/crosshair.c b/src/crosshair.c
index eb19257..7d9fcb4 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -565,10 +565,14 @@ XORDrawMoveOrCopyObject (void)
/* ---------------------------------------------------------------------------
* draws additional stuff that follows the crosshair
*/
-static void
+void
DrawAttached (void)
{
BDimension s;
+
+ if (!Crosshair.On)
+ return;
+
switch (Settings.Mode)
{
case VIA_MODE:
@@ -684,6 +688,28 @@ DrawAttached (void)
}
}
+
+/* --------------------------------------------------------------------------
+ * draw the marker position
+ */
+void
+DrawMark (void)
+{
+ /* Mark is not drawn when the crosshair is off, or when it is not set */
+ if (!Crosshair.On || !Marked.status)
+ return;
+
+ gui->draw_line (Crosshair.GC,
+ Marked.X - MARK_SIZE,
+ Marked.Y - MARK_SIZE,
+ Marked.X + MARK_SIZE, Marked.Y + MARK_SIZE);
+ gui->draw_line (Crosshair.GC,
+ Marked.X + MARK_SIZE,
+ Marked.Y - MARK_SIZE,
+ Marked.X - MARK_SIZE, Marked.Y + MARK_SIZE);
+}
+
+
/* ---------------------------------------------------------------------------
* switches crosshair on
*/
@@ -706,9 +732,9 @@ CrosshairOff (void)
{
if (Crosshair.On)
{
- Crosshair.On = false;
DrawAttached ();
DrawMark ();
+ Crosshair.On = false;
}
}
@@ -1086,26 +1112,6 @@ SetCrosshairRange (LocationType MinX, LocationType MinY, LocationType MaxX,
MoveCrosshairRelative (0, 0);
}
-/* --------------------------------------------------------------------------
- * draw the marker position
- * if argument is true, draw only if it is visible, otherwise draw it regardless
- */
-void
-DrawMark (void)
-{
- if (Marked.status)
- {
- gui->draw_line (Crosshair.GC,
- Marked.X - MARK_SIZE,
- Marked.Y - MARK_SIZE,
- Marked.X + MARK_SIZE, Marked.Y + MARK_SIZE);
- gui->draw_line (Crosshair.GC,
- Marked.X + MARK_SIZE,
- Marked.Y - MARK_SIZE,
- Marked.X - MARK_SIZE, Marked.Y + MARK_SIZE);
- }
-}
-
/* ---------------------------------------------------------------------------
* initializes crosshair stuff
* clears the struct, allocates to graphical contexts and
diff --git a/src/crosshair.h b/src/crosshair.h
index 4573e98..ff16b1e 100644
--- a/src/crosshair.h
+++ b/src/crosshair.h
@@ -46,18 +46,18 @@
#define STATE_SECOND 1
#define STATE_THIRD 2
-
void CrosshairOn (void);
void CrosshairOff (void);
void HideCrosshair (void);
void RestoreCrosshair (void);
+void DrawAttached (void);
+void DrawMark (void);
void MoveCrosshairRelative (LocationType, LocationType);
bool MoveCrosshairAbsolute (LocationType, LocationType);
void SetCrosshairRange (LocationType, LocationType, LocationType,
LocationType);
void InitCrosshair (void);
void DestroyCrosshair (void);
-void DrawMark (void);
void FitCrosshairIntoGrid (LocationType, LocationType);
#endif
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index c5f3e3e..4595b80 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -2433,7 +2433,6 @@ idle_proc (XtPointer dummy)
int mx, my;
BoxType region;
lesstif_use_mask (0);
- Crosshair.On = 0;
pixmap = main_pixmap;
mx = view_width;
my = view_height;
@@ -2519,7 +2518,8 @@ idle_proc (XtPointer dummy)
XCopyArea (display, main_pixmap, window, my_gc, 0, 0, view_width,
view_height, 0, 0);
pixmap = window;
- CrosshairOn ();
+ DrawAttached ();
+ DrawMark ();
need_redraw = 0;
}
|
|
From: <gi...@gp...> - 2011-04-18 22:37:44
|
The branch, master has been updated
via eb3c0196c031b1be6b8f7393cf3e669328549758 (commit)
from d67f4335b5d4f97330448b833ea1bf04377c3a57 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/crosshair.c | 2 +-
src/hid/gtk/gui-output-events.c | 1 -
2 files changed, 1 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit eb3c0196c031b1be6b8f7393cf3e669328549758
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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).
:100644 100644 7df5299... eb19257... M src/crosshair.c
:100644 100644 331f214... 268988d... M src/hid/gtk/gui-output-events.c
=========
Changes
=========
commit eb3c0196c031b1be6b8f7393cf3e669328549758
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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).
diff --git a/src/crosshair.c b/src/crosshair.c
index 7df5299..eb19257 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -1124,7 +1124,7 @@ InitCrosshair (void)
/* fake a crosshair off entry on stack */
CrosshairStackLocation = 0;
CrosshairStack[CrosshairStackLocation++] = true;
- Crosshair.On = false;
+ Crosshair.On = true;
/* set initial shape */
Crosshair.shape = Basic_Crosshair_Shape;
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 331f214..268988d 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -728,7 +728,6 @@ ghid_port_window_enter_cb (GtkWidget * widget,
{
ghid_screen_update ();
}
- CrosshairOn ();
return FALSE;
}
|
|
From: <gi...@gp...> - 2011-04-18 21:05:16
|
The branch, master has been updated
via d67f4335b5d4f97330448b833ea1bf04377c3a57 (commit)
from f6352da45e3942b381d1fe6b4305108ca48b173b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/Makefile.am | 3 +-
src/hid/batch/batch.c | 106 ++++++++++++++++-------------------
src/hid/bom/bom.c | 66 ++++------------------
src/hid/common/extents.c | 99 +++++++++++++-------------------
src/hid/gcode/gcode.c | 90 ++++++++++-------------------
src/hid/gerber/gerber.c | 87 +++++++++++------------------
src/hid/gtk/gtkhid-main.c | 130 +++++++++++++++++++++---------------------
src/hid/lesstif/main.c | 136 +++++++++++++++++++++-----------------------
src/hid/lpr/lpr.c | 68 +++++------------------
src/hid/nelma/nelma.c | 98 ++++++++++++---------------------
src/hid/nelma/nelma.h | 3 -
src/hid/png/png.c | 92 +++++++++++--------------------
src/hid/png/png.h | 1 -
src/hid/ps/eps.c | 88 +++++++++++------------------
src/hid/ps/ps.c | 88 +++++++++++------------------
15 files changed, 442 insertions(+), 713 deletions(-)
delete mode 100644 src/hid/nelma/nelma.h
=================
Commit Messages
=================
commit d67f4335b5d4f97330448b833ea1bf04377c3a57
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
:100644 100644 1e4cf58... 5abbfb2... M src/Makefile.am
:100644 100644 ea75d99... e6eaf52... M src/hid/batch/batch.c
:100644 100644 661b592... 6e5bc22... M src/hid/bom/bom.c
:100644 100644 0f51b47... 2b0386c... M src/hid/common/extents.c
:100644 100644 d2dd717... 9360cb7... M src/hid/gcode/gcode.c
:100644 100644 868c2b1... d18cd2a... M src/hid/gerber/gerber.c
:100644 100644 266cf06... 84cca05... M src/hid/gtk/gtkhid-main.c
:100644 100644 2f00577... c5f3e3e... M src/hid/lesstif/main.c
:100644 100644 a79af0a... f65c5a5... M src/hid/lpr/lpr.c
:100644 100644 0a1efef... 217a546... M src/hid/nelma/nelma.c
:100644 000000 0cbe0d7... 0000000... D src/hid/nelma/nelma.h
:100644 100644 9ef24da... ca87a84... M src/hid/png/png.c
:100644 100644 cb891be... e528753... M src/hid/png/png.h
:100644 100644 49a19c7... 17c7697... M src/hid/ps/eps.c
:100644 100644 86c3156... 616f5d5... M src/hid/ps/ps.c
=========
Changes
=========
commit d67f4335b5d4f97330448b833ea1bf04377c3a57
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
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.
diff --git a/src/Makefile.am b/src/Makefile.am
index 1e4cf58..5abbfb2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -406,8 +406,7 @@ libnelma_a_CPPFLAGS = -I./hid/nelma
LIBNELMA_SRCS = \
dolists.h \
hid/hidint.h \
- hid/nelma/nelma.c \
- hid/nelma/nelma.h
+ hid/nelma/nelma.c
libnelma_a_SOURCES = ${LIBNELMA_SRCS} hid/nelma/nelma_lists.h
hid/nelma/nelma_lists.h : ${LIBNELMA_SRCS} Makefile
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index ea75d99..e6eaf52 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -345,67 +345,59 @@ batch_show_item (void *item)
{
}
-HID batch_gui = {
- sizeof (HID),
- "batch",
- "Batch-mode GUI for non-interactive use.",
- 1, 0, 0, 0, 0, 0,
- batch_get_export_options,
- batch_do_export,
- batch_parse_arguments,
- batch_invalidate_lr,
- batch_invalidate_all,
- batch_set_layer,
- batch_make_gc,
- batch_destroy_gc,
- batch_use_mask,
- batch_set_color,
- batch_set_line_cap,
- batch_set_line_width,
- batch_set_draw_xor,
- batch_set_draw_faded,
- batch_set_line_cap_angle,
- batch_draw_line,
- batch_draw_arc,
- batch_draw_rect,
- batch_fill_circle,
- batch_fill_polygon,
- batch_fill_pcb_polygon,
- batch_thindraw_pcb_polygon,
- batch_fill_rect,
- batch_calibrate,
- batch_shift_is_pressed,
- batch_control_is_pressed,
- batch_mod1_is_pressed,
- batch_get_coords,
- batch_set_crosshair,
- batch_add_timer,
- batch_stop_timer,
- batch_watch_file,
- batch_unwatch_file,
- batch_add_block_hook,
- batch_stop_block_hook,
- 0 /* batch_log */,
- 0 /* batch_logv */,
- 0 /* batch_confirm_dialog */,
- 0 /* batch_close_confirm_dialog */,
- 0 /* batch_report_dialog */,
- 0 /* batch_prompt_for */,
- 0 /* batch_fileselect */,
- batch_attribute_dialog,
- batch_show_item,
- 0 /* batch_beep */,
- 0 /* batch_progress */,
- 0 /* batch_drc_gui */,
- 0 /* batch_edit_attributes */
-};
-
#include "dolists.h"
+static HID batch_hid;
+
void
hid_batch_init ()
{
- apply_default_hid (&batch_gui, 0);
- hid_register_hid (&batch_gui);
+ memset (&batch_hid, 0, sizeof (HID));
+
+ batch_hid.struct_size = sizeof (HID);
+ batch_hid.name = "batch";
+ batch_hid.description = "Batch-mode GUI for non-interactive use.";
+ batch_hid.gui = 1;
+
+ batch_hid.get_export_options = batch_get_export_options;
+ batch_hid.do_export = batch_do_export;
+ batch_hid.parse_arguments = batch_parse_arguments;
+ batch_hid.invalidate_lr = batch_invalidate_lr;
+ batch_hid.invalidate_all = batch_invalidate_all;
+ batch_hid.set_layer = batch_set_layer;
+ batch_hid.make_gc = batch_make_gc;
+ batch_hid.destroy_gc = batch_destroy_gc;
+ batch_hid.use_mask = batch_use_mask;
+ batch_hid.set_color = batch_set_color;
+ batch_hid.set_line_cap = batch_set_line_cap;
+ batch_hid.set_line_width = batch_set_line_width;
+ batch_hid.set_draw_xor = batch_set_draw_xor;
+ batch_hid.set_draw_faded = batch_set_draw_faded;
+ batch_hid.set_line_cap_angle = batch_set_line_cap_angle;
+ batch_hid.draw_line = batch_draw_line;
+ batch_hid.draw_arc = batch_draw_arc;
+ batch_hid.draw_rect = batch_draw_rect;
+ batch_hid.fill_circle = batch_fill_circle;
+ batch_hid.fill_polygon = batch_fill_polygon;
+ batch_hid.fill_pcb_polygon = batch_fill_pcb_polygon;
+ batch_hid.thindraw_pcb_polygon = batch_thindraw_pcb_polygon;
+ batch_hid.fill_rect = batch_fill_rect;
+ batch_hid.calibrate = batch_calibrate;
+ batch_hid.shift_is_pressed = batch_shift_is_pressed;
+ batch_hid.control_is_pressed = batch_control_is_pressed;
+ batch_hid.mod1_is_pressed = batch_mod1_is_pressed;
+ batch_hid.get_coords = batch_get_coords;
+ batch_hid.set_crosshair = batch_set_crosshair;
+ batch_hid.add_timer = batch_add_timer;
+ batch_hid.stop_timer = batch_stop_timer;
+ batch_hid.watch_file = batch_watch_file;
+ batch_hid.unwatch_file = batch_unwatch_file;
+ batch_hid.add_block_hook = batch_add_block_hook;
+ batch_hid.stop_block_hook = batch_stop_block_hook;
+ batch_hid.attribute_dialog = batch_attribute_dialog;
+ batch_hid.show_item = batch_show_item;
+
+ apply_default_hid (&batch_hid, 0);
+ hid_register_hid (&batch_hid);
#include "batch_lists.h"
}
diff --git a/src/hid/bom/bom.c b/src/hid/bom/bom.c
index 661b592..6e5bc22 100644
--- a/src/hid/bom/bom.c
+++ b/src/hid/bom/bom.c
@@ -536,64 +536,22 @@ bom_parse_arguments (int *argc, char ***argv)
hid_parse_command_line (argc, argv);
}
-HID bom_hid = {
- sizeof (HID),
- "bom",
- "Exports a Bill of Materials",
- 0, 0, 1, 0, 0, 0,
- bom_get_export_options,
- bom_do_export,
- bom_parse_arguments,
- 0, /* bom_invalidate_lr */
- 0, /* bom_invalidate_all */
- 0, /* bom_set_layer */
- 0, /* bom_make_gc */
- 0, /* bom_destroy_gc */
- 0, /* bom_use_mask */
- 0, /* bom_set_color */
- 0, /* bom_set_line_cap */
- 0, /* bom_set_line_width */
- 0, /* bom_set_draw_xor */
- 0, /* bom_set_draw_faded */
- 0, /* bom_set_line_cap_angle */
- 0, /* bom_draw_line */
- 0, /* bom_draw_arc */
- 0, /* bom_draw_rect */
- 0, /* bom_fill_circle */
- 0, /* bom_fill_polygon */
- 0, /* bom_fill_pcb_polygon */
- 0, /* bom_thindraw_pcb_polygon */
- 0, /* bom_fill_rect */
- 0, /* bom_calibrate */
- 0, /* bom_shift_is_pressed */
- 0, /* bom_control_is_pressed */
- 0, /* bom_mod1_is_pressed */
- 0, /* bom_get_coords */
- 0, /* bom_set_crosshair */
- 0, /* bom_add_timer */
- 0, /* bom_stop_timer */
- 0, /* bom_watch_file */
- 0, /* bom_unwatch_file */
- 0, /* bom_add_block_hook */
- 0, /* bom_stop_block_hook */
- 0, /* bom_log */
- 0, /* bom_logv */
- 0, /* bom_confirm_dialog */
- 0, /* bom_close_confirm_dialog */
- 0, /* bom_report_dialog */
- 0, /* bom_prompt_for */
- 0, /* bom_fileselect */
- 0, /* bom_attribute_dialog */
- 0, /* bom_show_item */
- 0, /* bom_beep */
- 0, /* bom_progress */
- 0, /* bom_drc_gui */
- 0, /* bom_edit_attributes */
-};
+HID bom_hid;
void
hid_bom_init ()
{
+ memset (&bom_hid, 0, sizeof (HID));
+
+ bom_hid.struct_size = sizeof (HID);
+ bom_hid.name = "bom";
+ bom_hid.description = "Exports a Bill of Materials";
+ bom_hid.exporter = 1;
+
+ bom_hid.get_export_options = bom_get_export_options;
+ bom_hid.do_export = bom_do_export;
+ bom_hid.parse_arguments = bom_parse_arguments;
+
apply_default_hid (&bom_hid, 0);
hid_register_hid (&bom_hid);
}
diff --git a/src/hid/common/extents.c b/src/hid/common/extents.c
index 0f51b47..2b0386c 100644
--- a/src/hid/common/extents.c
+++ b/src/hid/common/extents.c
@@ -28,7 +28,6 @@ RCSID ("$Id$");
static BoxType box;
-
typedef struct hid_gc_struct
{
int width;
@@ -170,70 +169,52 @@ extents_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
PEY (y2, 0);
}
-static HID extents_hid = {
- sizeof (HID),
- "extents-extents",
- "used to calculate extents",
- 0, /* gui */
- 0, /* printer */
- 0, /* exporter */
- 1, /* poly before */
- 0, /* poly after */
- 0, /* poly dicer */
-
- 0 /* extents_get_export_options */ ,
- 0 /* extents_do_export */ ,
- 0 /* extents_parse_arguments */ ,
- 0 /* extents_invalidate_lr */ ,
- 0 /* extents_invalidate_all */ ,
- extents_set_layer,
- extents_make_gc,
- extents_destroy_gc,
- extents_use_mask,
- extents_set_color,
- extents_set_line_cap,
- extents_set_line_width,
- extents_set_draw_xor,
- extents_set_draw_faded,
- extents_set_line_cap_angle,
- extents_draw_line,
- extents_draw_arc,
- extents_draw_rect,
- extents_fill_circle,
- extents_fill_polygon,
- common_fill_pcb_polygon,
- 0 /* extents_thindraw_pcb_polygon */,
- extents_fill_rect,
-
- 0 /* extents_calibrate */ ,
- 0 /* extents_shift_is_pressed */ ,
- 0 /* extents_control_is_pressed */ ,
- 0 /* extents_mod1_is_pressed */ ,
- 0 /* extents_get_coords */ ,
- 0 /* extents_set_crosshair */ ,
- 0 /* extents_add_timer */ ,
- 0 /* extents_stop_timer */ ,
- 0 /* extents_watch_file */ ,
- 0 /* extents_unwatch_file */ ,
- 0 /* extents_add_block_hook */ ,
- 0 /* extents_stop_block_hook */ ,
-
- 0 /* extents_log */ ,
- 0 /* extents_logv */ ,
- 0 /* extents_confirm_dialog */ ,
- 0 /* extents_close_confirm_dialog */ ,
- 0 /* extents_report_dialog */ ,
- 0 /* extents_prompt_for */ ,
- 0 /* extents_attribute_dialog */ ,
- 0 /* extents_show_item */ ,
- 0 /* extents_beep */
-};
+static HID extents_hid;
+
+void
+hid_extents_init (void)
+{
+ static bool initialised = false;
+
+ if (initialised)
+ return;
+
+ memset (&extents_hid, 0, sizeof (HID));
+
+ extents_hid.struct_size = sizeof (HID);
+ extents_hid.name = "extents-extents";
+ extents_hid.description = "used to calculate extents";
+ extents_hid.poly_before = 1;
+
+ extents_hid.set_layer = extents_set_layer;
+ extents_hid.make_gc = extents_make_gc;
+ extents_hid.destroy_gc = extents_destroy_gc;
+ extents_hid.use_mask = extents_use_mask;
+ extents_hid.set_color = extents_set_color;
+ extents_hid.set_line_cap = extents_set_line_cap;
+ extents_hid.set_line_width = extents_set_line_width;
+ extents_hid.set_draw_xor = extents_set_draw_xor;
+ extents_hid.set_draw_faded = extents_set_draw_faded;
+ extents_hid.set_line_cap_angle = extents_set_line_cap_angle;
+ extents_hid.draw_line = extents_draw_line;
+ extents_hid.draw_arc = extents_draw_arc;
+ extents_hid.draw_rect = extents_draw_rect;
+ extents_hid.fill_circle = extents_fill_circle;
+ extents_hid.fill_polygon = extents_fill_polygon;
+ extents_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ extents_hid.fill_rect = extents_fill_rect;
+
+ initialised = true;
+}
BoxType *
hid_get_extents (void *item)
{
BoxType region;
+ /* As this isn't a real "HID", we need to ensure we are initialised. */
+ hid_extents_init ();
+
box.X1 = MAXINT;
box.Y1 = MAXINT;
box.X2 = -MAXINT;
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index d2dd717..9360cb7 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -1028,70 +1028,42 @@ gcode_set_crosshair (int x, int y, int a)
/* *** Miscellaneous ******************************************************* */
-HID gcode_hid = {
- sizeof (HID),
- "gcode",
- "G-CODE export.",
- 0, /* gui */
- 0, /* printer */
- 1, /* exporter */
- 1, /* poly before */
- 0, /* poly after */
- 0, /* poly dicer */
- gcode_get_export_options,
- gcode_do_export,
- gcode_parse_arguments,
- 0 /* gcode_invalidate_lr */ ,
- 0 /* gcode_invalidate_all */ ,
- gcode_set_layer,
- gcode_make_gc,
- gcode_destroy_gc,
- gcode_use_mask,
- gcode_set_color,
- gcode_set_line_cap,
- gcode_set_line_width,
- gcode_set_draw_xor,
- gcode_set_draw_faded,
- gcode_set_line_cap_angle,
- gcode_draw_line,
- gcode_draw_arc,
- gcode_draw_rect,
- gcode_fill_circle,
- gcode_fill_polygon,
- common_fill_pcb_polygon,
- 0 /* nelma_thindraw_pcb_polygon */ ,
- gcode_fill_rect,
- gcode_calibrate,
- 0 /* gcode_shift_is_pressed */ ,
- 0 /* gcode_control_is_pressed */ ,
- 0 /* gcode_mod1_is_pressed */ ,
- 0 /* gcode_get_coords */ ,
- gcode_set_crosshair,
- 0 /* gcode_add_timer */ ,
- 0 /* gcode_stop_timer */ ,
- 0 /* gcode_watch_file */ ,
- 0 /* gcode_unwatch_file */ ,
- 0 /* gcode_add_block_hook */ ,
- 0 /* gcode_stop_block_hook */ ,
- 0 /* gcode_log */ ,
- 0 /* gcode_logv */ ,
- 0 /* gcode_confirm_dialog */ ,
- 0 /* gcode_close_confirm_dialog */ ,
- 0 /* gcode_report_dialog */ ,
- 0 /* gcode_prompt_for */ ,
- 0 /* gcode_fileselect */ ,
- 0 /* gcode_attribute_dialog */ ,
- 0 /* gcode_show_item */ ,
- 0 /* gcode_beep */ ,
- 0 /* gcode_progress */ ,
- 0 /* gcode_drc_gui */
-};
-
#include "dolists.h"
+HID gcode_hid;
+
void
hid_gcode_init ()
{
+ gcode_hid.struct_size = sizeof (HID);
+ gcode_hid.name = "gcode";
+ gcode_hid.description = "G-CODE export.";
+ gcode_hid.exporter = 1;
+ gcode_hid.poly_before = 1;
+
+ gcode_hid.get_export_options = gcode_get_export_options;
+ gcode_hid.do_export = gcode_do_export;
+ gcode_hid.parse_arguments = gcode_parse_arguments;
+ gcode_hid.set_layer = gcode_set_layer;
+ gcode_hid.make_gc = gcode_make_gc;
+ gcode_hid.destroy_gc = gcode_destroy_gc;
+ gcode_hid.use_mask = gcode_use_mask;
+ gcode_hid.set_color = gcode_set_color;
+ gcode_hid.set_line_cap = gcode_set_line_cap;
+ gcode_hid.set_line_width = gcode_set_line_width;
+ gcode_hid.set_draw_xor = gcode_set_draw_xor;
+ gcode_hid.set_draw_faded = gcode_set_draw_faded;
+ gcode_hid.set_line_cap_angle = gcode_set_line_cap_angle;
+ gcode_hid.draw_line = gcode_draw_line;
+ gcode_hid.draw_arc = gcode_draw_arc;
+ gcode_hid.draw_rect = gcode_draw_rect;
+ gcode_hid.fill_circle = gcode_fill_circle;
+ gcode_hid.fill_polygon = gcode_fill_polygon;
+ gcode_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ gcode_hid.fill_rect = gcode_fill_rect;
+ gcode_hid.calibrate = gcode_calibrate;
+ gcode_hid.set_crosshair = gcode_set_crosshair;
+
apply_default_hid (&gcode_hid, 0);
hid_register_hid (&gcode_hid);
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 868c2b1..d18cd2a 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -277,60 +277,7 @@ SetAppLayer (int l)
/* --------------------------------------------------------------------------- */
-static HID gerber_hid = {
- sizeof (HID),
- "gerber",
- "RS-274X (Gerber) export.",
- 0, 0, 1, 0, 0, 1,
- gerber_get_export_options,
- gerber_do_export,
- gerber_parse_arguments,
- 0 /* gerber_invalidate_lr */ ,
- 0 /* gerber_invalidate_all */ ,
- gerber_set_layer,
- gerber_make_gc,
- gerber_destroy_gc,
- gerber_use_mask,
- gerber_set_color,
- gerber_set_line_cap,
- gerber_set_line_width,
- gerber_set_draw_xor,
- gerber_set_draw_faded,
- gerber_set_line_cap_angle,
- gerber_draw_line,
- gerber_draw_arc,
- gerber_draw_rect,
- gerber_fill_circle,
- gerber_fill_polygon,
- common_fill_pcb_polygon,
- 0 /* gerber_thindraw_pcb_polygon */ ,
- gerber_fill_rect,
- gerber_calibrate,
- 0 /* gerber_shift_is_pressed */ ,
- 0 /* gerber_control_is_pressed */ ,
- 0 /* gerber_mod1_is_pressed */ ,
- 0 /* gerber_get_coords */ ,
- gerber_set_crosshair,
- 0 /* gerber_add_timer */ ,
- 0 /* gerber_stop_timer */ ,
- 0 /* gerber_watch_file */ ,
- 0 /* gerber_unwatch_file */ ,
- 0 /* gerber_add_block_hook */ ,
- 0 /* gerber_stop_block_hook */ ,
- 0 /* gerber_log */ ,
- 0 /* gerber_logv */ ,
- 0 /* gerber_confirm_dialog */ ,
- 0 /* gerber_close_confirm_dialog */ ,
- 0 /* gerber_report_dialog */ ,
- 0 /* gerber_prompt_for */ ,
- 0 /* gerber_fileselect */ ,
- 0 /* gerber_attribute_dialog */ ,
- 0 /* gerber_show_item */ ,
- 0 /* gerber_beep */ ,
- 0 /* gerber_progress */ ,
- 0 /* gerber_drc_gui */
-};
-
+static HID gerber_hid;
typedef struct hid_gc_struct
{
@@ -1222,10 +1169,40 @@ gerber_set_crosshair (int x, int y, int action)
{
}
-
void
hid_gerber_init ()
{
+ memset (&gerber_hid, 0, sizeof (HID));
+
+ gerber_hid.struct_size = sizeof (HID);
+ gerber_hid.name = "gerber";
+ gerber_hid.description = "RS-274X (Gerber) export.";
+ gerber_hid.exporter = 1;
+ gerber_hid.poly_dicer = 1;
+
+ gerber_hid.get_export_options = gerber_get_export_options;
+ gerber_hid.do_export = gerber_do_export;
+ gerber_hid.parse_arguments = gerber_parse_arguments;
+ gerber_hid.set_layer = gerber_set_layer;
+ gerber_hid.make_gc = gerber_make_gc;
+ gerber_hid.destroy_gc = gerber_destroy_gc;
+ gerber_hid.use_mask = gerber_use_mask;
+ gerber_hid.set_color = gerber_set_color;
+ gerber_hid.set_line_cap = gerber_set_line_cap;
+ gerber_hid.set_line_width = gerber_set_line_width;
+ gerber_hid.set_draw_xor = gerber_set_draw_xor;
+ gerber_hid.set_draw_faded = gerber_set_draw_faded;
+ gerber_hid.set_line_cap_angle = gerber_set_line_cap_angle;
+ gerber_hid.draw_line = gerber_draw_line;
+ gerber_hid.draw_arc = gerber_draw_arc;
+ gerber_hid.draw_rect = gerber_draw_rect;
+ gerber_hid.fill_circle = gerber_fill_circle;
+ gerber_hid.fill_polygon = gerber_fill_polygon;
+ gerber_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ gerber_hid.fill_rect = gerber_fill_rect;
+ gerber_hid.calibrate = gerber_calibrate;
+ gerber_hid.set_crosshair = gerber_set_crosshair;
+
apply_default_hid (&gerber_hid, 0);
hid_register_hid (&gerber_hid);
}
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 266cf06..84cca05 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -972,68 +972,6 @@ HID_DRC_GUI ghid_drc_gui = {
extern HID_Attribute *ghid_get_export_options (int *);
-HID ghid_hid = {
- sizeof (HID),
- "gtk",
- "Gtk - The Gimp Toolkit",
- 1, /* gui */
- 0, /* printer */
- 0, /* exporter */
- 0, /* poly before */
- 1, /* poly after */
- 0, /* poly dicer */
-
- ghid_get_export_options,
- ghid_do_export,
- ghid_parse_arguments,
- ghid_invalidate_lr,
- ghid_invalidate_all,
- ghid_set_layer,
- ghid_make_gc,
- ghid_destroy_gc,
- ghid_use_mask,
- ghid_set_color,
- ghid_set_line_cap,
- ghid_set_line_width,
- ghid_set_draw_xor,
- ghid_set_draw_faded,
- ghid_set_line_cap_angle,
- ghid_draw_line,
- ghid_draw_arc,
- ghid_draw_rect,
- ghid_fill_circle,
- ghid_fill_polygon,
- common_fill_pcb_polygon,
- common_thindraw_pcb_polygon,
- ghid_fill_rect,
-
- ghid_calibrate,
- ghid_shift_is_pressed,
- ghid_control_is_pressed,
- ghid_mod1_is_pressed,
- ghid_get_coords,
- ghid_set_crosshair,
- ghid_add_timer,
- ghid_stop_timer,
- ghid_watch_file,
- ghid_unwatch_file,
- ghid_add_block_hook,
- ghid_stop_block_hook,
-
- ghid_log,
- ghid_logv,
- ghid_confirm_dialog,
- ghid_close_confirm_dialog,
- ghid_report_dialog,
- ghid_prompt_for,
- ghid_fileselect,
- ghid_attribute_dialog,
- ghid_show_item,
- ghid_beep,
- ghid_progress,
- &ghid_drc_gui,
- ghid_attributes
-};
/* ------------------------------------------------------------
*
@@ -2138,14 +2076,17 @@ REGISTER_FLAGS (ghid_main_flag_list)
#include <winreg.h>
#endif
+HID ghid_hid;
+
void
hid_gtk_init ()
{
- #ifdef WIN32
-
+#ifdef WIN32
char * tmps;
char * share_dir;
+#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
share_dir = (char *) malloc(strlen(tmps) +
@@ -2155,7 +2096,66 @@ hid_gtk_init ()
free (tmps);
#undef REST_OF_PATH
printf ("\"Share\" installation path is \"%s\"\n", share_dir);
-#endif
+#endif
+
+ memset (&ghid_hid, 0, sizeof (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.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.set_draw_faded = ghid_set_draw_faded;
+ ghid_hid.set_line_cap_angle = ghid_set_line_cap_angle;
+ 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_pcb_polygon = common_fill_pcb_polygon;
+ ghid_hid.thindraw_pcb_polygon = common_thindraw_pcb_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;
hid_register_hid (&ghid_hid);
#include "gtk_lists.h"
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 2f00577..c5f3e3e 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -58,8 +58,7 @@ typedef struct hid_gc_struct
char erase;
} hid_gc_struct;
-extern HID lesstif_gui;
-extern HID lesstif_extents;
+static HID lesstif_hid;
#define CRASH fprintf(stderr, "HID error: pcb called unimplemented GUI function %s\n", __FUNCTION__), abort()
@@ -779,7 +778,7 @@ Benchmark (int argc, char **argv, int x, int y)
do
{
XFillRectangle (display, pixmap, bg_gc, 0, 0, view_width, view_height);
- hid_expose_callback (&lesstif_gui, ®ion, 0);
+ hid_expose_callback (&lesstif_hid, ®ion, 0);
XSync (display, 0);
time (&end);
i++;
@@ -2513,7 +2512,7 @@ idle_proc (XtPointer dummy)
}
}
DrawBackgroundImage();
- hid_expose_callback (&lesstif_gui, ®ion, 0);
+ hid_expose_callback (&lesstif_hid, ®ion, 0);
draw_grid ();
lesstif_use_mask (0);
XSetFunction (display, my_gc, GXcopy);
@@ -2940,7 +2939,7 @@ lesstif_make_gc (void)
{
hidGC rv = (hid_gc_struct *) malloc (sizeof (hid_gc_struct));
memset (rv, 0, sizeof (hid_gc_struct));
- rv->me_pointer = &lesstif_gui;
+ rv->me_pointer = &lesstif_hid;
return rv;
}
@@ -3085,7 +3084,7 @@ static void
set_gc (hidGC gc)
{
int cap, join, width;
- if (gc->me_pointer != &lesstif_gui)
+ if (gc->me_pointer != &lesstif_hid)
{
fprintf (stderr, "Fatal: GC from another HID passed to lesstif HID\n");
abort ();
@@ -3692,7 +3691,7 @@ pinout_callback (Widget da, PinoutData * pd,
region.Y2 = PCB->MaxHeight;
XFillRectangle (display, pixmap, bg_gc, 0, 0, pd->v_width, pd->v_height);
- hid_expose_callback (&lesstif_gui, ®ion, pd->item);
+ hid_expose_callback (&lesstif_hid, ®ion, pd->item);
pinout = 0;
view_left_x = save_vx;
@@ -3796,74 +3795,69 @@ lesstif_progress (int so_far, int total, const char *message)
return 0;
}
-HID lesstif_gui = {
- sizeof (HID),
- "lesstif",
- "LessTif - a Motif clone for X/Unix",
- 1, /* gui */
- 0, /* printer */
- 0, /* exporter */
- 1, /* poly before */
- 0, /* poly after */
- 0, /* poly dicer */
-
- lesstif_get_export_options,
- lesstif_do_export,
- lesstif_parse_arguments,
- lesstif_invalidate_lr,
- lesstif_invalidate_all,
- lesstif_set_layer,
- lesstif_make_gc,
- lesstif_destroy_gc,
- lesstif_use_mask,
- lesstif_set_color,
- lesstif_set_line_cap,
- lesstif_set_line_width,
- lesstif_set_draw_xor,
- lesstif_set_draw_faded,
- lesstif_set_line_cap_angle,
- lesstif_draw_line,
- lesstif_draw_arc,
- lesstif_draw_rect,
- lesstif_fill_circle,
- lesstif_fill_polygon,
- common_fill_pcb_polygon,
- common_thindraw_pcb_polygon,
- lesstif_fill_rect,
-
- lesstif_calibrate,
- lesstif_shift_is_pressed,
- lesstif_control_is_pressed,
- lesstif_mod1_is_pressed,
- lesstif_get_coords,
- lesstif_set_crosshair,
- lesstif_add_timer,
- lesstif_stop_timer,
- lesstif_watch_file,
- lesstif_unwatch_file,
- lesstif_add_block_hook,
- lesstif_stop_block_hook,
-
- lesstif_log,
- lesstif_logv,
- lesstif_confirm_dialog,
- lesstif_close_confirm_dialog,
- lesstif_report_dialog,
- lesstif_prompt_for,
- lesstif_fileselect,
- lesstif_attribute_dialog,
- lesstif_show_item,
- lesstif_beep,
- lesstif_progress,
- 0, /* lesstif_drc_gui */
- lesstif_attributes_dialog
-};
-
#include "dolists.h"
void
hid_lesstif_init ()
{
- hid_register_hid (&lesstif_gui);
+ memset (&lesstif_hid, 0, sizeof (HID));
+
+ lesstif_hid.struct_size = sizeof (HID);
+ lesstif_hid.name = "lesstif";
+ lesstif_hid.description = "LessTif - a Motif clone for X/Unix";
+ lesstif_hid.gui = 1;
+ lesstif_hid.poly_before = 1;
+
+ lesstif_hid.get_export_options = lesstif_get_export_options;
+ lesstif_hid.do_export = lesstif_do_export;
+ lesstif_hid.parse_arguments = lesstif_parse_arguments;
+ lesstif_hid.invalidate_lr = lesstif_invalidate_lr;
+ lesstif_hid.invalidate_all = lesstif_invalidate_all;
+ lesstif_hid.set_layer = lesstif_set_layer;
+ lesstif_hid.make_gc = lesstif_make_gc;
+ lesstif_hid.destroy_gc = lesstif_destroy_gc;
+ lesstif_hid.use_mask = lesstif_use_mask;
+ lesstif_hid.set_color = lesstif_set_color;
+ lesstif_hid.set_line_cap = lesstif_set_line_cap;
+ lesstif_hid.set_line_width = lesstif_set_line_width;
+ lesstif_hid.set_draw_xor = lesstif_set_draw_xor;
+ lesstif_hid.set_draw_faded = lesstif_set_draw_faded;
+ lesstif_hid.set_line_cap_angle = lesstif_set_line_cap_angle;
+ lesstif_hid.draw_line = lesstif_draw_line;
+ lesstif_hid.draw_arc = lesstif_draw_arc;
+ lesstif_hid.draw_rect = lesstif_draw_rect;
+ lesstif_hid.fill_circle = lesstif_fill_circle;
+ lesstif_hid.fill_polygon = lesstif_fill_polygon;
+ lesstif_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ lesstif_hid.thindraw_pcb_polygon = common_thindraw_pcb_polygon;
+ lesstif_hid.fill_rect = lesstif_fill_rect;
+
+ lesstif_hid.calibrate = lesstif_calibrate;
+ lesstif_hid.shift_is_pressed = lesstif_shift_is_pressed;
+ lesstif_hid.control_is_pressed = lesstif_control_is_pressed;
+ lesstif_hid.mod1_is_pressed = lesstif_mod1_is_pressed;
+ lesstif_hid.get_coords = lesstif_get_coords;
+ lesstif_hid.set_crosshair = lesstif_set_crosshair;
+ lesstif_hid.add_timer = lesstif_add_timer;
+ lesstif_hid.stop_timer = lesstif_stop_timer;
+ lesstif_hid.watch_file = lesstif_watch_file;
+ lesstif_hid.unwatch_file = lesstif_unwatch_file;
+ lesstif_hid.add_block_hook = lesstif_add_block_hook;
+ lesstif_hid.stop_block_hook = lesstif_stop_block_hook;
+
+ lesstif_hid.log = lesstif_log;
+ lesstif_hid.logv = lesstif_logv;
+ lesstif_hid.confirm_dialog = lesstif_confirm_dialog;
+ lesstif_hid.close_confirm_dialog = lesstif_close_confirm_dialog;
+ lesstif_hid.report_dialog = lesstif_report_dialog;
+ lesstif_hid.prompt_for = lesstif_prompt_for;
+ lesstif_hid.fileselect = lesstif_fileselect;
+ lesstif_hid.attribute_dialog = lesstif_attribute_dialog;
+ lesstif_hid.show_item = lesstif_show_item;
+ lesstif_hid.beep = lesstif_beep;
+ lesstif_hid.progress = lesstif_progress;
+ lesstif_hid.edit_attributes = lesstif_attributes_dialog;
+
+ hid_register_hid (&lesstif_hid);
#include "lesstif_lists.h"
}
diff --git a/src/hid/lpr/lpr.c b/src/hid/lpr/lpr.c
index a79af0a..f65c5a5 100644
--- a/src/hid/lpr/lpr.c
+++ b/src/hid/lpr/lpr.c
@@ -111,64 +111,24 @@ lpr_calibrate (double xval, double yval)
ps_calibrate_1 (xval, yval, 1);
}
-HID lpr_hid = {
- sizeof (HID),
- "lpr",
- "Postscript print.",
- 0, 1, 0, 1, 0, 0,
- lpr_get_export_options,
- lpr_do_export,
- lpr_parse_arguments,
- 0 /* lpr_invalidate_lr */ ,
- 0 /* lpr_invalidate_all */ ,
- 0 /* lpr_set_layer */ ,
- 0 /* lpr_make_gc */ ,
- 0 /* lpr_destroy_gc */ ,
- 0 /* lpr_use_mask */ ,
- 0 /* lpr_set_color */ ,
- 0 /* lpr_set_line_cap */ ,
- 0 /* lpr_set_line_width */ ,
- 0 /* lpr_set_draw_xor */ ,
- 0 /* lpr_set_draw_faded */ ,
- 0 /* lpr_set_line_cap_angle */ ,
- 0 /* lpr_draw_line */ ,
- 0 /* lpr_draw_arc */ ,
- 0 /* lpr_draw_rect */ ,
- 0 /* lpr_fill_circle */ ,
- 0 /* lpr_fill_polygon */ ,
- 0 /* lpr_fill_pcb_polygon */ ,
- 0 /* lpr_thindraw_pcb_polygon */ ,
- 0 /* lpr_fill_rect */ ,
- lpr_calibrate,
- 0 /* lpr_shift_is_pressed */ ,
- 0 /* lpr_control_is_pressed */ ,
- 0 /* lpr_mod1_is_pressed */ ,
- 0 /* lpr_get_coords */ ,
- 0 /* lpr_set_crosshair */ ,
- 0 /* lpr_add_timer */ ,
- 0 /* lpr_stop_timer */ ,
- 0 /* lpr_watch_file */ ,
- 0 /* lpr_unwatch_file */ ,
- 0 /* lpr_add_block_hook */ ,
- 0 /* lpr_stop_block_hook */ ,
- 0 /* lpr_log */ ,
- 0 /* lpr_logv */ ,
- 0 /* lpr_confirm_dialog */ ,
- 0 /* lpr_close_confirm_dialog */ ,
- 0 /* lpr_report_dialog */ ,
- 0 /* lpr_prompt_for */ ,
- 0 /* lpr_fileselect */ ,
- 0 /* lpr_attribute_dialog */ ,
- 0 /* lpr_show_item */ ,
- 0 /* lpr_beep */ ,
- 0 /* lpr_progress */ ,
- 0 /* lpr_drc_gui */ ,
- 0 /* lpr_edit_attributes */
-};
+static HID lpr_hid;
void
hid_lpr_init ()
{
+ memset (&lpr_hid, 0, sizeof (HID));
+
+ lpr_hid.struct_size = sizeof (HID);
+ lpr_hid.name = "lpr";
+ lpr_hid.description = "Postscript print.";
+ lpr_hid.printer = 1;
+ lpr_hid.poly_before = 1;
+
+ lpr_hid.get_export_options = lpr_get_export_options;
+ lpr_hid.do_export = lpr_do_export;
+ lpr_hid.parse_arguments = lpr_parse_arguments;
+ lpr_hid.calibrate = lpr_calibrate;
+
apply_default_hid (&lpr_hid, &ps_hid);
apply_default_hid (&lpr_hid, 0);
hid_register_hid (&lpr_hid);
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index 0a1efef..217a546 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -72,7 +72,6 @@
#include "hid.h"
#include "../hidint.h"
#include "hid/common/draw_helpers.h"
-#include "nelma.h"
#include <gd.h>
@@ -107,6 +106,8 @@ struct hid_gc_struct {
gdImagePtr brush;
};
+static HID nelma_hid;
+
static struct color_struct *black = NULL, *white = NULL;
static int linewidth = -1;
static int lastgroup = -1;
@@ -1044,73 +1045,44 @@ nelma_set_crosshair(int x, int y, int a)
/* *** Miscellaneous ******************************************************* */
-HID nelma_hid = {
- sizeof(HID),
- "nelma",
- "Numerical analysis package export.",
- 0, /* gui */
- 0, /* printer */
- 1, /* exporter */
- 1, /* poly before */
- 0, /* poly after */
- 0, /* poly dicer */
- nelma_get_export_options,
- nelma_do_export,
- nelma_parse_arguments,
- 0 /* nelma_invalidate_lr */ ,
- 0 /* nelma_invalidate_all */ ,
- nelma_set_layer,
- nelma_make_gc,
- nelma_destroy_gc,
- nelma_use_mask,
- nelma_set_color,
- nelma_set_line_cap,
- nelma_set_line_width,
- nelma_set_draw_xor,
- nelma_set_draw_faded,
- nelma_set_line_cap_angle,
- nelma_draw_line,
- nelma_draw_arc,
- nelma_draw_rect,
- nelma_fill_circle,
- nelma_fill_polygon,
- common_fill_pcb_polygon,
- 0 /* nelma_thindraw_pcb_polygon */ ,
- nelma_fill_rect,
- nelma_calibrate,
- 0 /* nelma_shift_is_pressed */ ,
- 0 /* nelma_control_is_pressed */ ,
- 0 /* nelma_mod1_is_pressed */ ,
- 0 /* nelma_get_coords */ ,
- nelma_set_crosshair,
- 0 /* nelma_add_timer */ ,
- 0 /* nelma_stop_timer */ ,
- 0 /* nelma_watch_file */ ,
- 0 /* nelma_unwatch_file */ ,
- 0 /* nelma_add_block_hook */ ,
- 0 /* nelma_stop_block_hook */ ,
- 0 /* nelma_log */ ,
- 0 /* nelma_logv */ ,
- 0 /* nelma_confirm_dialog */ ,
- 0 /* nelma_close_confirm_dialog */ ,
- 0 /* nelma_report_dialog */ ,
- 0 /* nelma_prompt_for */ ,
- 0 /* nelma_fileselect */ ,
- 0 /* nelma_attribute_dialog */ ,
- 0 /* nelma_show_item */ ,
- 0 /* nelma_beep */ ,
- 0 /* nelma_progress */ ,
- 0 /* nelma_drc_gui */ ,
- 0 /* nelma_edit_attributes */
-};
-
#include "dolists.h"
void
hid_nelma_init()
{
- apply_default_hid(&nelma_hid, 0);
- hid_register_hid(&nelma_hid);
+ memset (&nelma_hid, 0, sizeof (HID));
+
+ nelma_hid.struct_size = sizeof (HID);
+ nelma_hid.name = "nelma";
+ nelma_hid.description = "Numerical analysis package export.";
+ nelma_hid.exporter = 1;
+ nelma_hid.poly_before = 1;
+
+ nelma_hid.get_export_options = nelma_get_export_options;
+ nelma_hid.do_export = nelma_do_export;
+ nelma_hid.parse_arguments = nelma_parse_arguments;
+ nelma_hid.set_layer = nelma_set_layer;
+ nelma_hid.make_gc = nelma_make_gc;
+ nelma_hid.destroy_gc = nelma_destroy_gc;
+ nelma_hid.use_mask = nelma_use_mask;
+ nelma_hid.set_color = nelma_set_color;
+ nelma_hid.set_line_cap = nelma_set_line_cap;
+ nelma_hid.set_line_width = nelma_set_line_width;
+ nelma_hid.set_draw_xor = nelma_set_draw_xor;
+ nelma_hid.set_draw_faded = nelma_set_draw_faded;
+ nelma_hid.set_line_cap_angle = nelma_set_line_cap_angle;
+ nelma_hid.draw_line = nelma_draw_line;
+ nelma_hid.draw_arc = nelma_draw_arc;
+ nelma_hid.draw_rect = nelma_draw_rect;
+ nelma_hid.fill_circle = nelma_fill_circle;
+ nelma_hid.fill_polygon = nelma_fill_polygon;
+ nelma_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ nelma_hid.fill_rect = nelma_fill_rect;
+ nelma_hid.calibrate = nelma_calibrate;
+ nelma_hid.set_crosshair = nelma_set_crosshair;
+
+ apply_default_hid (&nelma_hid, 0);
+ hid_register_hid (&nelma_hid);
#include "nelma_lists.h"
}
diff --git a/src/hid/nelma/nelma.h b/src/hid/nelma/nelma.h
deleted file mode 100644
index 0cbe0d7..0000000
--- a/src/hid/nelma/nelma.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $Id$ */
-
-extern HID nelma_hid;
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 9ef24da..ca87a84 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -55,6 +55,8 @@
#define CRASH fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", __FUNCTION__); abort()
+static HID png_hid;
+
static void *color_cache = NULL;
static void *brush_cache = NULL;
@@ -1512,71 +1514,41 @@ png_set_crosshair (int x, int y, int a)
{
}
-HID png_hid = {
- sizeof (HID),
- "png",
- "GIF/JPEG/PNG export.",
- 0, /* gui */
- 0, /* printer */
- 1, /* exporter */
- 1, /* poly before */
- 0, /* poly after */
- 1, /* poly dicer */
- png_get_export_options,
- png_do_export,
- png_parse_arguments,
- 0 /* png_invalidate_lr */ ,
- 0 /* png_invalidate_all */ ,
- png_set_layer,
- png_make_gc,
- png_destroy_gc,
- png_use_mask,
- png_set_color,
- png_set_line_cap,
- png_set_line_width,
- png_set_draw_xor,
- png_set_draw_faded,
- png_set_line_cap_angle,
- png_draw_line,
- png_draw_arc,
- png_draw_rect,
- png_fill_circle,
- png_fill_polygon,
- common_fill_pcb_polygon,
- 0 /* png_thindraw_pcb_polygon */ ,
- png_fill_rect,
- png_calibrate,
- 0 /* png_shift_is_pressed */ ,
- 0 /* png_control_is_pressed */ ,
- 0 /* png_mod1_is_pressed */ ,
- 0 /* png_get_coords */ ,
- png_set_crosshair,
- 0 /* png_add_timer */ ,
- 0 /* png_stop_timer */ ,
- 0 /* png_watch_file */ ,
- 0 /* png_unwatch_file */ ,
- 0 /* png_add_block_hook */ ,
- 0 /* png_stop_block_hook */ ,
- 0 /* png_log */ ,
- 0 /* png_logv */ ,
- 0 /* png_confirm_dialog */ ,
- 0 /* png_close_confirm_dialog */ ,
- 0 /* png_report_dialog */ ,
- 0 /* png_prompt_for */ ,
- 0 /* png_fileselect */ ,
- 0 /* png_attribute_dialog */ ,
- 0 /* png_show_item */ ,
- 0 /* png_beep */ ,
- 0 /* png_progress */ ,
- 0 /* png_drc_gui */ ,
- 0 /* png_edit_attributes */
-};
-
#include "dolists.h"
void
hid_png_init ()
{
+ png_hid.struct_size = sizeof (HID);
+ png_hid.name = "png";
+ png_hid.description = "GIF/JPEG/PNG export.";
+ png_hid.exporter = 1;
+ png_hid.poly_before = 1;
+ png_hid.poly_dicer = 1;
+
+ png_hid.get_export_options = png_get_export_options;
+ png_hid.do_export = png_do_export;
+ png_hid.parse_arguments = png_parse_arguments;
+ png_hid.set_layer = png_set_layer;
+ png_hid.make_gc = png_make_gc;
+ png_hid.destroy_gc = png_destroy_gc;
+ png_hid.use_mask = png_use_mask;
+ png_hid.set_color = png_set_color;
+ png_hid.set_line_cap = png_set_line_cap;
+ png_hid.set_line_width = png_set_line_width;
+ png_hid.set_draw_xor = png_set_draw_xor;
+ png_hid.set_draw_faded = png_set_draw_faded;
+ png_hid.set_line_cap_angle = png_set_line_cap_angle;
+ png_hid.draw_line = png_draw_line;
+ png_hid.draw_arc = png_draw_arc;
+ png_hid.draw_rect = png_draw_rect;
+ png_hid.fill_circle = png_fill_circle;
+ png_hid.fill_polygon = png_fill_polygon;
+ png_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ png_hid.fill_rect = png_fill_rect;
+ png_hid.calibrate = png_calibrate;
+ png_hid.set_crosshair = png_set_crosshair;
+
apply_default_hid (&png_hid, 0);
hid_register_hid (&png_hid);
diff --git a/src/hid/png/png.h b/src/hid/png/png.h
index cb891be..e528753 100644
--- a/src/hid/png/png.h
+++ b/src/hid/png/png.h
@@ -1,4 +1,3 @@
/* $Id$ */
-extern HID png_hid;
extern void png_hid_export_to_file (FILE *, HID_Attr_Val *);
diff --git a/src/hid/ps/eps.c b/src/hid/ps/eps.c
index 49a19c7..17c7697 100644
--- a/src/hid/ps/eps.c
+++ b/src/hid/ps/eps.c
@@ -54,60 +54,6 @@ static void eps_calibrate (double xval, double yval);
static void eps_set_crosshair (int x, int y, int action);
/*----------------------------------------------------------------------------*/
-static HID eps_hid = {
- sizeof (HID),
- "eps",
- "Encapsulated Postscript",
- 0, 0, 1, 0, 1, 0,
- eps_get_export_options,
- eps_do_export,
- eps_parse_arguments,
- 0 /* eps_invalidate_lr */ ,
- 0 /* eps_invalidate_all */ ,
- eps_set_layer,
- eps_make_gc,
- eps_destroy_gc,
- eps_use_mask,
- eps_set_color,
- eps_set_line_cap,
- eps_set_line_width,
- eps_set_draw_xor,
- eps_set_draw_faded,
- eps_set_line_cap_angle,
- eps_draw_line,
- eps_draw_arc,
- eps_draw_rect,
- eps_fill_circle,
- eps_fill_polygon,
- common_fill_pcb_polygon,
- 0 /* eps_thindraw_pcb_polygon */ ,
- eps_fill_rect,
- eps_calibrate,
- 0 /* eps_shift_is_pressed */ ,
- 0 /* eps_control_is_pressed */ ,
- 0 /* eps_mod1_is_pressed */ ,
- 0 /* eps_get_coords */ ,
- eps_set_crosshair,
- 0 /* eps_add_timer */ ,
- 0 /* eps_stop_timer */ ,
- 0 /* eps_watch_file */ ,
- 0 /* eps_unwatch_file */ ,
- 0 /* eps_add_block_hook */ ,
- 0 /* eps_stop_block_hook */ ,
- 0 /* eps_log */ ,
- 0 /* eps_logv */ ,
- 0 /* eps_confirm_dialog */ ,
- 0 /* eps_close_confirm_dialog */ ,
- 0 /* eps_report_dialog */ ,
- 0 /* eps_prompt_for */ ,
- 0 /* eps_attribute_dialog */ ,
- 0 /* eps_show_item */ ,
- 0 /* eps_beep */ ,
- 0 /* eps_progress */ ,
- 0 /* eps_drc_gui */ ,
- 0 /* eps_edit_attributes */
-};
-
typedef struct hid_gc_struct
{
EndCapStyle cap;
@@ -116,6 +62,8 @@ typedef struct hid_gc_struct
int erase;
} hid_gc_struct;
+static HID eps_hid;
+
static FILE *f = 0;
static int linewidth = -1;
static int lastgroup = -1;
@@ -689,10 +637,40 @@ eps_set_crosshair (int x, int y, int action)
{
}
-
void
hid_eps_init ()
{
+ memset (&eps_hid, 0, sizeof (HID));
+
+ eps_hid.struct_size = sizeof (HID);
+ eps_hid.name = "eps";
+ eps_hid.description = "Encapsulated Postscript";
+ eps_hid.exporter = 1;
+ eps_hid.poly_after = 1;
+
+ eps_hid.get_export_options = eps_get_export_options;
+ eps_hid.do_export = eps_do_export;
+ eps_hid.parse_arguments = eps_parse_arguments;
+ eps_hid.set_layer = eps_set_layer;
+ eps_hid.make_gc = eps_make_gc;
+ eps_hid.destroy_gc = eps_destroy_gc;
+ eps_hid.use_mask = eps_use_mask;
+ eps_hid.set_color = eps_set_color;
+ eps_hid.set_line_cap = eps_set_line_cap;
+ eps_hid.set_line_width = eps_set_line_width;
+ eps_hid.set_draw_xor = eps_set_draw_xor;
+ eps_hid.set_draw_faded = eps_set_draw_faded;
+ eps_hid.set_line_cap_angle = eps_set_line_cap_angle;
+ eps_hid.draw_line = eps_draw_line;
+ eps_hid.draw_arc = eps_draw_arc;
+ eps_hid.draw_rect = eps_draw_rect;
+ eps_hid.fill_circle = eps_fill_circle;
+ eps_hid.fill_polygon = eps_fill_polygon;
+ eps_hid.fill_pcb_polygon = common_fill_pcb_polygon;
+ eps_hid.fill_rect = eps_fill_rect;
+ eps_hid.calibrate = eps_calibrate;
+ eps_hid.set_crosshair = eps_set_crosshair;
+
apply_default_hid (&eps_hid, 0);
hid_register_hid (&eps_hid);
}
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index 86c3156..616f5d5 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -1340,66 +1340,44 @@ ps_set_crosshair (int x, int y, int action)
{
}
-HID ps_hid = {
- sizeof (HID),
- "ps",
- "Postscript export.",
- 0, 0, 1, 1, 0, 0,
- ps_get_export_options,
- ps_do_export,
- ps_parse_arguments,
- 0 /* ps_invalidate_lr */ ,
- 0 /* ps_invalidate_all */ ,
- ps_set_layer,
- ps_make_gc,
- ps_destroy_gc,
- ps_use_mask,
- ps_set_color,
- ps_set_line_cap,
- ps_set_line_width,
- ps_set_draw_xor,
- ps_set_draw_faded,
- ps_set_line_cap_angle,
- ps_draw_line,
- ps_draw_arc,
- ps_draw_rect,
- ps_fill_circle,
- ps_fill_polygon,
- ps_fill_pcb_polygon,
- 0 /* ps_thindraw_pcb_polygon */,
- ps_fill_rect,
- ps_calibrate,
- 0 /* ps_shift_is_pressed */ ,
- 0 /* ps_control_is_pressed */ ,
- 0 /* ps_mod1_is_pressed */ ,
- 0 /* ps_get_coords */ ,
- ps_set_crosshair,
- 0 /* ps_add_timer */ ,
- 0 /* ps_stop_timer */ ,
- 0 /* ps_watch_file */ ,
- 0 /* ps_unwatch_file */ ,
- 0 /* ps_add_block_hook */ ,
- 0 /* ps_stop_block_hook */ ,
- 0 /* ps_log */ ,
- 0 /* ps_logv */ ,
- 0 /* ps_confirm_dialog */ ,
- 0 /* ps_close_confirm_dialog */ ,
- 0 /* ps_report_dialog */ ,
- 0 /* ps_prompt_for */ ,
- 0 /* ps_fileselect */ ,
- 0 /* ps_attribute_dialog */ ,
- 0 /* ps_show_item */ ,
- 0 /* ps_beep */ ,
- 0 /* ps_progress */ ,
- 0 /* ps_drc_gui */ ,
- 0 /* ps_edit_attributes */
-};
-
#include "dolists.h"
+HID ps_hid;
+
void
hid_ps_init ()
{
+ memset (&ps_hid, 0, sizeof (HID));
+
+ ps_hid.struct_size = sizeof (HID);
+ ps_hid.name = "ps";
+ ps_hid.description = "Postscript export.";
+ ps_hid.exporter = 1;
+ ps_hid.poly_before = 1;
+
+ ps_hid.get_export_options = ps_get_export_options;
+ ps_hid.do_export = ps_do_export;
+ ps_hid.parse_arguments = ps_parse_arguments;
+ ps_hid.set_layer = ps_set_layer;
+ ps_hid.make_gc = ps_make_gc;
+ ps_hid.destroy_gc = ps_destroy_gc;
+ ps_hid.use_mask = ps_use_mask;
+ ps_hid.set_color = ps_set_color;
+ ps_hid.set_line_cap = ps_set_line_cap;
+ ps_hid.set_line_width = ps_set_line_width;
+ ps_hid.set_draw_xor = ps_set_draw_xor;
+ ps_hid.set_draw_faded = ps_set_draw_faded;
+ ps_hid.set_line_cap_angle = ps_set_line_cap_angle;
+ ps_hid.draw_line = ps_draw_line;
+ ps_hid.draw_arc = ps_draw_arc;
+ ps_hid.draw_rect = ps_draw_rect;
+ ps_hid.fill_circle = ps_fill_circle;
+ ps_hid.fill_polygon = ps_fill_polygon;
+ ps_hid.fill_pcb_polygon = ps_fill_pcb_polygon;
+ ps_hid.fill_rect = ps_fill_rect;
+ ps_hid.calibrate = ps_calibrate;
+ ps_hid.set_crosshair = ps_set_crosshair;
+
apply_default_hid (&ps_hid, 0);
hid_register_hid (&ps_hid);
|
|
From: <gi...@gp...> - 2011-04-12 23:47:14
|
The branch, master has been updated
via f6352da45e3942b381d1fe6b4305108ca48b173b (commit)
from 2d2040e92d5ebb069af42567855055b096532e71 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/misc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit f6352da45e3942b381d1fe6b4305108ca48b173b
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add t/b synonyms for group list
Allow 't' as well as 'c', and 'b' as well as 's', in the groups
string.
:100644 100644 2391d26... 649208c... M src/misc.c
=========
Changes
=========
commit f6352da45e3942b381d1fe6b4305108ca48b173b
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add t/b synonyms for group list
Allow 't' as well as 'c', and 'b' as well as 's', in the groups
string.
diff --git a/src/misc.c b/src/misc.c
index 2391d26..649208c 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -882,12 +882,16 @@ ParseGroupString (char *s, LayerGroupTypePtr LayerGroup, int LayerN)
{
case 'c':
case 'C':
+ case 't':
+ case 'T':
layer = LayerN + COMPONENT_LAYER;
c_set = true;
break;
case 's':
case 'S':
+ case 'b':
+ case 'B':
layer = LayerN + SOLDER_LAYER;
s_set = true;
break;
|
|
From: <gi...@gp...> - 2011-04-12 15:14:39
|
The branch, master has been updated
via 2d2040e92d5ebb069af42567855055b096532e71 (commit)
from deb80ab342b56788e0c9d75d6119cc734e9eba60 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/png/png.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 2d2040e92d5ebb069af42567855055b096532e71
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
Fix potential segfault
Closes-bug: lp-699290 (sf-2669324)
:100644 100644 022da9c... 9ef24da... M src/hid/png/png.c
=========
Changes
=========
commit 2d2040e92d5ebb069af42567855055b096532e71
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
Fix potential segfault
Closes-bug: lp-699290 (sf-2669324)
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 022da9c..9ef24da 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -146,7 +146,7 @@ static const char *filetypes[] = {
FMT_jpg,
#endif
- NULL
+ ""
};
HID_Attribute png_attribute_list[] = {
|
|
From: <gi...@gp...> - 2011-04-11 08:18:19
|
The branch, master has been updated
via deb80ab342b56788e0c9d75d6119cc734e9eba60 (commit)
from 9f72cd4f9766f938cf7c44beab1929bef23ada5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/common/flags.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
=================
Commit Messages
=================
commit deb80ab342b56788e0c9d75d6119cc734e9eba60
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
:100644 100644 9b53328... 23c7c57... M src/hid/common/flags.c
=========
Changes
=========
commit deb80ab342b56788e0c9d75d6119cc734e9eba60
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
diff --git a/src/hid/common/flags.c b/src/hid/common/flags.c
index 9b53328..23c7c57 100644
--- a/src/hid/common/flags.c
+++ b/src/hid/common/flags.c
@@ -155,35 +155,35 @@ layer_type_to_file_name (int idx)
switch (idx)
{
case SL (SILK, TOP):
- return "frontsilk";
+ return "topsilk";
case SL (SILK, BOTTOM):
- return "backsilk";
+ return "bottomsilk";
case SL (MASK, TOP):
- return "frontmask";
+ return "topmask";
case SL (MASK, BOTTOM):
- return "backmask";
+ return "bottommask";
case SL (PDRILL, 0):
return "plated-drill";
case SL (UDRILL, 0):
return "unplated-drill";
case SL (PASTE, TOP):
- return "frontpaste";
+ return "toppaste";
case SL (PASTE, BOTTOM):
- return "backpaste";
+ return "bottompaste";
case SL (INVISIBLE, 0):
return "invisible";
case SL (FAB, 0):
return "fab";
case SL (ASSY, TOP):
- return "frontassembly";
+ return "topassembly";
case SL (ASSY, BOTTOM):
- return "backassembly";
+ return "bottomassembly";
default:
group = GetLayerGroupNumberByNumber(idx);
if (group == GetLayerGroupNumberByNumber(component_silk_layer))
- return "front";
+ return "top";
else if (group == GetLayerGroupNumberByNumber(solder_silk_layer))
- return "back";
+ return "bottom";
else if (PCB->LayerGroups.Number[group] == 1
&& (strcmp (PCB->Data->Layer[idx].Name, "route") == 0 ||
strcmp (PCB->Data->Layer[idx].Name, "outline") == 0))
|
|
From: <gi...@gp...> - 2011-04-11 08:05:43
|
The branch, master has been updated
via 9f72cd4f9766f938cf7c44beab1929bef23ada5e (commit)
via 308071436ff71da2a9df7ec88fae28175c87cf82 (commit)
via 294494e56695251e63c0da9f243d6f59447f1c9f (commit)
via f7d4910676be74e3aa2096d2807ba00090a6fa4e (commit)
via 94bf4a283f8b0561b14c6fdbe2b13e118430855f (commit)
from 9a20f7e1ecc6d8451347f5fdb6f3f32927811555 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 54 +++++++++++++++++++++++-----------------------
src/hid/gerber/gerber.c | 23 +++++++++----------
src/hid/ps/ps.c | 17 ++++++--------
src/misc.c | 25 +++++++++++++++++++++
src/misc.h | 3 ++
5 files changed, 73 insertions(+), 49 deletions(-)
=================
Commit Messages
=================
commit 9f72cd4f9766f938cf7c44beab1929bef23ada5e
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Remove (now) unused variable.
:100644 100644 b3e39c7... bc00a7e... M src/draw.c
commit 308071436ff71da2a9df7ec88fae28175c87cf82
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
:100644 100644 6091ef3... b3e39c7... M src/draw.c
commit 294494e56695251e63c0da9f243d6f59447f1c9f
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
:100644 100644 7c286cc... 86c3156... M src/hid/ps/ps.c
commit f7d4910676be74e3aa2096d2807ba00090a6fa4e
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
:100644 100644 a7704f4... 2391d26... M src/misc.c
:100644 100644 ac3d442... b46cad4... M src/misc.h
commit 94bf4a283f8b0561b14c6fdbe2b13e118430855f
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix gerber output
Use the correct DRC minimums for drawn outlines on silk and copper
layers.
Draw rectangles as unfilled, not filled.
:100644 100644 8f04180... 868c2b1... M src/hid/gerber/gerber.c
=========
Changes
=========
commit 9f72cd4f9766f938cf7c44beab1929bef23ada5e
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Remove (now) unused variable.
diff --git a/src/draw.c b/src/draw.c
index b3e39c7..bc00a7e 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -880,7 +880,6 @@ DrawLayerGroup (int group, const BoxType * screen)
{
int i, rv = 1;
int layernum;
- struct pin_info info;
LayerTypePtr Layer;
int n_entries = PCB->LayerGroups.Number[group];
Cardinal *layers = PCB->LayerGroups.Entries[group];
commit 308071436ff71da2a9df7ec88fae28175c87cf82
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
diff --git a/src/draw.c b/src/draw.c
index 6091ef3..b3e39c7 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -826,16 +826,19 @@ text_callback (const BoxType * b, void *cl)
* draws one non-copper layer
*/
void
-DrawLayer (LayerTypePtr Layer, const BoxType * screen)
+DrawLayerCommon (LayerTypePtr Layer, const BoxType * screen, bool clear_pins)
{
struct pin_info info;
/* print the non-clearing polys */
info.Layer = Layer;
- info.arg = false;
+ info.arg = clear_pins;
clip_box = screen;
r_search (Layer->polygon_tree, screen, NULL, poly_callback, &info);
+ if (clear_pins && TEST_FLAG (CHECKPLANESFLAG, PCB))
+ return;
+
/* draw all visible lines this layer */
r_search (Layer->line_tree, screen, NULL, line_callback, Layer);
@@ -844,9 +847,30 @@ DrawLayer (LayerTypePtr Layer, const BoxType * screen)
/* draw the layer text on screen */
r_search (Layer->text_tree, screen, NULL, text_callback, Layer);
+
+ /* We should check for gui->gui here, but it's kinda cool seeing the
+ auto-outline magically disappear when you first add something to
+ the "outline" layer. */
+ if (IsLayerEmpty (Layer)
+ && (strcmp (Layer->Name, "outline") == 0
+ || strcmp (Layer->Name, "route") == 0))
+ {
+ gui->set_color (Output.fgGC, Layer->Color);
+ gui->set_line_width (Output.fgGC, PCB->minWid);
+ gui->draw_rect (Output.fgGC,
+ 0, 0,
+ PCB->MaxWidth, PCB->MaxHeight);
+ }
+
clip_box = NULL;
}
+void
+DrawLayer (LayerTypePtr Layer, const BoxType * screen)
+{
+ DrawLayerCommon (Layer, screen, false);
+}
+
/* ---------------------------------------------------------------------------
* draws one layer group. Returns non-zero if pins and pads should be
* drawn with this group.
@@ -870,30 +894,7 @@ DrawLayerGroup (int group, const BoxType * screen)
strcmp (Layer->Name, "route") == 0)
rv = 0;
if (layernum < max_copper_layer && Layer->On)
- {
- /* draw all polygons on this layer */
- if (Layer->PolygonN)
- {
- info.Layer = Layer;
- info.arg = true;
- r_search (Layer->polygon_tree, screen, NULL, poly_callback,
- &info);
- info.arg = false;
- }
-
- if (TEST_FLAG (CHECKPLANESFLAG, PCB))
- continue;
-
- /* draw all visible lines this layer */
- r_search (Layer->line_tree, screen, NULL, line_callback, Layer);
-
- /* draw the layer arcs on screen */
- r_search (Layer->arc_tree, screen, NULL, arc_callback, Layer);
-
- /* draw the layer text on screen */
- r_search (Layer->text_tree, screen, NULL, text_callback, Layer);
-
- }
+ DrawLayerCommon (Layer, screen, true);
}
if (n_entries > 1)
rv = 1;
commit 294494e56695251e63c0da9f243d6f59447f1c9f
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index 7c286cc..86c3156 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -830,16 +830,14 @@ ps_set_layer (const char *name, int group, int empty)
lastcolor = -1;
fprintf (f, "/ts 10000 def\n");
- fprintf (f,
- "/ty ts neg def /tx 0 def /Helvetica findfont ts scalefont setfont\n");
+ fprintf (f, "/ty ts neg def /tx 0 def /Helvetica findfont ts scalefont setfont\n");
fprintf (f, "/t { moveto lineto stroke } bind def\n");
- fprintf (f,
- "/r { /y2 exch def /x2 exch def /y1 exch def /x1 exch def\n");
- fprintf (f,
- " x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto closepath fill } bind def\n");
+ fprintf (f, "/dr { /y2 exch def /x2 exch def /y1 exch def /x1 exch def\n");
+ fprintf (f, " x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto closepath stroke } bind def\n");
+ fprintf (f, "/r { /y2 exch def /x2 exch def /y1 exch def /x1 exch def\n");
+ fprintf (f, " x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto closepath fill } bind def\n");
fprintf (f, "/c { 0 360 arc fill } bind def\n");
- fprintf (f,
- "/a { gsave setlinewidth translate scale 0 0 1 5 3 roll arc stroke grestore} bind def\n");
+ fprintf (f, "/a { gsave setlinewidth translate scale 0 0 1 5 3 roll arc stroke grestore} bind def\n");
if (drill_helper)
fprintf (f,
"/dh { gsave %d setlinewidth 0 gray %d 0 360 arc stroke grestore} bind def\n",
@@ -862,7 +860,6 @@ ps_set_layer (const char *name, int group, int empty)
if (outline
&& outline_layer
&& outline_layer != PCB->Data->Layer+idx
- && SL_TYPE (idx) == 0 /* copper */
&& strcmp (name, "outline")
&& strcmp (name, "route"))
{
@@ -1011,7 +1008,7 @@ static void
ps_draw_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
use_gc (gc);
- fprintf (f, "%d %d %d %d r\n", x1, y1, x2, y2);
+ fprintf (f, "%d %d %d %d dr\n", x1, y1, x2, y2);
}
static void ps_fill_rect (hidGC gc, int x1, int y1, int x2, int y2);
commit f7d4910676be74e3aa2096d2807ba00090a6fa4e
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
diff --git a/src/misc.c b/src/misc.c
index a7704f4..2391d26 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -565,6 +565,31 @@ FlagIsDataEmpty (int parm)
/* FLAG(DataEmpty,FlagIsDataEmpty,0) */
/* FLAG(DataNonEmpty,FlagIsDataEmpty,1) */
+bool
+IsLayerEmpty (LayerTypePtr layer)
+{
+ return (layer->LineN == 0
+ && layer->TextN == 0
+ && layer->PolygonN == 0
+ && layer->ArcN == 0);
+}
+
+bool
+IsLayerNumEmpty (int num)
+{
+ return IsLayerEmpty (PCB->Data->Layer+num);
+}
+
+bool
+IsLayerGroupEmpty (int num)
+{
+ int i;
+ for (i=0; i<PCB->LayerGroups.Number[num]; i++)
+ if (!IsLayerNumEmpty (PCB->LayerGroups.Entries[num][i]))
+ return false;
+ return true;
+}
+
/* ---------------------------------------------------------------------------
* gets minimum and maximum coordinates
* returns NULL if layout is empty
diff --git a/src/misc.h b/src/misc.h
index ac3d442..b46cad4 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -44,6 +44,9 @@ void SetPadBoundingBox (PadTypePtr);
void SetPolygonBoundingBox (PolygonTypePtr);
void SetElementBoundingBox (DataTypePtr, ElementTypePtr, FontTypePtr);
bool IsDataEmpty (DataTypePtr);
+bool IsLayerEmpty (LayerTypePtr);
+bool IsLayerNumEmpty (int);
+bool IsLayerGroupEmpty (int);
BoxTypePtr GetDataBoundingBox (DataTypePtr);
void CenterDisplay (LocationType, LocationType, bool);
void SetFontInfo (FontTypePtr);
commit 94bf4a283f8b0561b14c6fdbe2b13e118430855f
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix gerber output
Use the correct DRC minimums for drawn outlines on silk and copper
layers.
Draw rectangles as unfilled, not filled.
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 8f04180..868c2b1 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -776,7 +776,13 @@ gerber_set_layer (const char *name, int group, int empty)
else if (!outline_layer)
{
hidGC gc = gui->make_gc ();
- gui->set_line_width (gc, AUTO_OUTLINE_WIDTH);
+ printf("name %s idx %d\n", name, idx);
+ if (SL_TYPE (idx) == SL_SILK)
+ gui->set_line_width (gc, PCB->minSlk);
+ else if (group >= 0)
+ gui->set_line_width (gc, PCB->minWid);
+ else
+ gui->set_line_width (gc, AUTO_OUTLINE_WIDTH);
gui->draw_line (gc, 0, 0, PCB->MaxWidth, 0);
gui->draw_line (gc, 0, 0, 0, PCB->MaxHeight);
gui->draw_line (gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
@@ -937,17 +943,10 @@ use_gc (hidGC gc, int radius)
static void
gerber_draw_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
- int x[5];
- int y[5];
- x[0] = x[4] = x1;
- y[0] = y[4] = y1;
- x[1] = x1;
- y[1] = y2;
- x[2] = x2;
- y[2] = y2;
- x[3] = x2;
- y[3] = y1;
- gerber_fill_polygon (gc, 5, x, y);
+ gerber_draw_line (gc, x1, y1, x1, y2);
+ gerber_draw_line (gc, x1, y1, x2, y1);
+ gerber_draw_line (gc, x1, y2, x2, y2);
+ gerber_draw_line (gc, x2, y1, x2, y2);
}
static void
|
|
From: <gi...@gp...> - 2011-04-11 05:43:21
|
The branch, master has been updated
via 9a20f7e1ecc6d8451347f5fdb6f3f32927811555 (commit)
from cf13ea770f86afd5db173912425701f2cfb6fb9b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/main.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit 9a20f7e1ecc6d8451347f5fdb6f3f32927811555
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
:100644 100644 a344596... 581c7cb... M src/main.c
=========
Changes
=========
commit 9a20f7e1ecc6d8451347f5fdb6f3f32927811555
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
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.
diff --git a/src/main.c b/src/main.c
index a344596..581c7cb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -513,14 +513,15 @@ HID_Attribute main_attribute_list[] = {
ISET (BackupInterval, 60, "backup-interval", 0),
- LAYERNAME (1, "component"),
- LAYERNAME (2, "solder"),
- LAYERNAME (3, "GND"),
- LAYERNAME (4, "power"),
- LAYERNAME (5, "signal1"),
- LAYERNAME (6, "signal2"),
- LAYERNAME (7, "signal3"),
- LAYERNAME (8, "signal4"),
+ LAYERNAME (1, "top"),
+ LAYERNAME (2, "ground"),
+ LAYERNAME (3, "signal2"),
+ LAYERNAME (4, "signal3"),
+ LAYERNAME (5, "power"),
+ LAYERNAME (6, "bottom"),
+ LAYERNAME (7, "outline"),
+ LAYERNAME (8, "spare"),
+ SSET (Groups, "1,c:2:3:4:5:6,s:7:8", "groups", 0),
SSET (FontCommand, "",
"font-command", 0),
@@ -540,7 +541,6 @@ HID_Attribute main_attribute_list[] = {
SSET (LibraryFilename, LIBRARYFILENAME, "lib-name", 0),
SSET (FontFile, "default_font", "default-font",
"File name of default font."),
- SSET (Groups, "1,c:2,s:3:4:5:6:7:8", "groups", 0),
SSET (Routes, "Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000"
":Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600", "route-styles",
0),
|
|
From: <gi...@gp...> - 2011-04-08 21:56:39
|
The branch, master has been updated
via cf13ea770f86afd5db173912425701f2cfb6fb9b (commit)
from 30609837d75111c2003a4f07fad88df09e666b00 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/gpcb-menu.res | 4 ++--
src/pcb-menu.res | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
=================
Commit Messages
=================
commit cf13ea770f86afd5db173912425701f2cfb6fb9b
Author: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
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
:100644 100644 dd1f27e... 9b6e612... M src/gpcb-menu.res
:100644 100644 e2fc4bb... aaf48c4... M src/pcb-menu.res
=========
Changes
=========
commit cf13ea770f86afd5db173912425701f2cfb6fb9b
Author: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
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
diff --git a/src/gpcb-menu.res b/src/gpcb-menu.res
index dd1f27e..9b6e612 100644
--- a/src/gpcb-menu.res
+++ b/src/gpcb-menu.res
@@ -105,8 +105,6 @@ MainMenu =
{"Element" Attributes(Element)}
}
-
- {"Move to current layer" MoveToCurrentLayer(Object) a={"M" "<Key>m"}}
- {"Move selected to current layer" MoveToCurrentLayer(Selected) a={"Shift-M" "Shift<Key>m"}}
{"Route Styles" @routestyles
-
{"Edit..." AdjustStyle(0)}
@@ -251,6 +249,7 @@ MainMenu =
{"Disperse selected elements" DisperseElements(Selected)}
-
{"Move selected elements to other side" Flip(SelectedElements) a={"Shift-B" "Shift<Key>b"}}
+ {"Move selected to current layer" MoveToCurrentLayer(Selected) a={"Shift-M" "Shift<Key>m"}}
{"Remove selected objects" RemoveSelected() a={"Shift-Delete" "Shift<Key>Delete"}}
{"Convert selection to element" Select(Convert)}
-
@@ -420,6 +419,7 @@ MainMenu =
{"Clear Selected -2 mil" a={"Shift-Ctrl-K" "Shift Ctrl<Key>k"} ChangeClearSize(SelectedObjects,-2,mil)}
{"Line Tool size +5 mil" a={"L" "<Key>l"} SetValue(LineSize,+5,mil)}
{"Line Tool size -5 mil" a={"Shift-L" "Shift<Key>l"} SetValue(LineSize,-5,mil)}
+ {"Move Object to current layer" a={"M" "<Key>m"} MoveToCurrentLayer(Object)}
{"MarkCrosshair" a={"Ctrl-M" "Ctrl<Key>m"} MarkCrosshair()}
{"Select shortest rat" a={"Shift-N" "Shift<Key>n"} AddRats(Close)}
{"AddRats to selected pins" a={"Shift-O" "Shift<Key>o"}
diff --git a/src/pcb-menu.res b/src/pcb-menu.res
index e2fc4bb..aaf48c4 100644
--- a/src/pcb-menu.res
+++ b/src/pcb-menu.res
@@ -147,9 +147,6 @@ MainMenu =
{"Unselect all" Unselect(All) a={"Shift-Alt-A" "Shift Alt<Key>a"}}
{"Select all visible" Select(All) a={"Alt-A" "Alt<Key>a"}}
-
- {"Move to current layer" MoveToCurrentLayer(Object) a={"M" "<Key>m"}}
- {"Move selected to current layer" MoveToCurrentLayer(Selected) a={"Shift-M" "Shift<Key>m"}}
- -
{"Edit Names..." foreground=grey50 sensitive=false}
{" Change text on layout" ChangeName(Object) a={"N" "<Key>n"}}
{" Edit name of layout" ChangeName(Layout)}
@@ -240,6 +237,7 @@ MainMenu =
{"Auto-place selected elements" AutoPlaceSelected() a={"Ctrl-P" "Ctrl<Key>p"}}
{"Disperse all elements" DisperseElements(All)}
{"Move selected elements to other side" Flip(SelectedElements) a={"Shift-B" "Shift<Key>b"}}
+ {"Move selected to current layer" MoveToCurrentLayer(Selected) a={"Shift-M" "Shift<Key>m"}}
{"Delete selected objects" Delete(Selected) a={"Delete" "<Key>Delete"}}
{"Convert selection to element" Select(Convert)}
-
@@ -391,6 +389,7 @@ MainMenu =
{"Clear Selected -2 mil" a={"Shift-Ctrl-K" "Shift Ctrl<Key>k"} ChangeClearSize(SelectedObjects,-2,mil)}
{"Line Tool size +5 mil" a={"L" "<Key>l"} SetValue(LineSize,+5,mil)}
{"Line Tool size -5 mil" a={"Shift-L" "Shift<Key>l"} SetValue(LineSize,-5,mil)}
+ {"Move Object to current layer" a={"M" "<Key>m"} MoveToCurrentLayer(Object)}
{"MarkCrosshair" a={"Ctrl-M" "Ctrl<Key>m"} MarkCrosshair()}
{"Select shortest rat" a={"Shift-N" "Shift<Key>n"} AddRats(Close)}
{"AddRats to selected pins" a={"Shift-O" "Shift<Key>o"}
|
|
From: <gi...@gp...> - 2011-04-08 16:35:01
|
The branch, master has been updated
via 30609837d75111c2003a4f07fad88df09e666b00 (commit)
from 6eba3ba08e503112e403626d84217b4704eeed46 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-dialog.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 30609837d75111c2003a4f07fad88df09e666b00
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
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.k...@gm...>
:100644 100644 bb934bd... b622439... M src/hid/gtk/gui-dialog.c
=========
Changes
=========
commit 30609837d75111c2003a4f07fad88df09e666b00
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
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.k...@gm...>
diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c
index bb934bd..b622439 100644
--- a/src/hid/gtk/gui-dialog.c
+++ b/src/hid/gtk/gui-dialog.c
@@ -381,7 +381,12 @@ ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file,
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), *path);
if (file && *file)
- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), file);
+ {
+ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog),
+ g_path_get_basename(file));
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
+ g_path_get_dirname (file));
+ }
if (shortcuts && *shortcuts)
{
|
|
From: <gi...@gp...> - 2011-04-07 19:32:30
|
The branch, master has been updated
via 6eba3ba08e503112e403626d84217b4704eeed46 (commit)
from 4ad9a1cdd78b91ea616edf2b5a295913f0f3d62e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-library-window.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 6eba3ba08e503112e403626d84217b4704eeed46
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
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.k...@gm...>
:100644 100644 b101576... 8c8ae17... M src/hid/gtk/gui-library-window.c
=========
Changes
=========
commit 6eba3ba08e503112e403626d84217b4704eeed46
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
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.k...@gm...>
diff --git a/src/hid/gtk/gui-library-window.c b/src/hid/gtk/gui-library-window.c
index b101576..8c8ae17 100644
--- a/src/hid/gtk/gui-library-window.c
+++ b/src/hid/gtk/gui-library-window.c
@@ -432,7 +432,16 @@ library_window_filter_timeout (gpointer data)
if (model != NULL)
{
+ const gchar *text = gtk_entry_get_text (library_window->entry_filter);
gtk_tree_model_filter_refilter ((GtkTreeModelFilter *) model);
+ if (strcmp (text, "") != 0)
+ {
+ /* filter text not-empty */
+ gtk_tree_view_expand_all (library_window->libtreeview);
+ } else {
+ /* filter text is empty, collapse expanded tree */
+ gtk_tree_view_collapse_all (library_window->libtreeview);
+ }
}
/* return FALSE to remove the source */
|
|
From: <gi...@gp...> - 2011-04-06 21:34:59
|
The branch, master has been updated
via 4ad9a1cdd78b91ea616edf2b5a295913f0f3d62e (commit)
from 8b94cc6abc473aca74e22d50ce945535a23a1e1a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-output-events.c | 22 ++++++++--------------
src/hid/gtk/gui.h | 2 +-
2 files changed, 9 insertions(+), 15 deletions(-)
=================
Commit Messages
=================
commit 4ad9a1cdd78b91ea616edf2b5a295913f0f3d62e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Consolidate the mechanisms used for holding off scrollbar updates
Don't duplicate mechanisms - it is confusing!
:100644 100644 a294777... 331f214... M src/hid/gtk/gui-output-events.c
:100644 100644 97ebb1c... f419530... M src/hid/gtk/gui.h
=========
Changes
=========
commit 4ad9a1cdd78b91ea616edf2b5a295913f0f3d62e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Consolidate the mechanisms used for holding off scrollbar updates
Don't duplicate mechanisms - it is confusing!
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index a294777..331f214 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -58,14 +58,7 @@ ghid_port_ranges_changed (void)
{
GtkAdjustment *h_adj, *v_adj;
- if (!ghidgui->combine_adjustments)
- HideCrosshair ();
- if (ghidgui->combine_adjustments)
- {
- ghidgui->combine_adjustments = FALSE;
- return;
- }
-
+ HideCrosshair ();
ghidgui->need_restore_crosshair = TRUE;
h_adj = gtk_range_get_adjustment (GTK_RANGE (ghidgui->h_range));
@@ -108,12 +101,13 @@ ghid_port_ranges_pan (gdouble x, gdouble y, gboolean relative)
if (y1 > v_adj->upper - v_adj->page_size)
y1 = v_adj->upper - v_adj->page_size;
- if (x0 != x1 && y0 != y1)
- ghidgui->combine_adjustments = TRUE;
- if (x0 != x1)
- gtk_range_set_value (GTK_RANGE (ghidgui->h_range), x1);
- if (y0 != y1)
- gtk_range_set_value (GTK_RANGE (ghidgui->v_range), y1);
+ ghidgui->adjustment_changed_holdoff = TRUE;
+ gtk_range_set_value (GTK_RANGE (ghidgui->h_range), x1);
+ gtk_range_set_value (GTK_RANGE (ghidgui->v_range), y1);
+ ghidgui->adjustment_changed_holdoff = FALSE;
+
+ if ((x0 != x1) || (y0 != y1))
+ ghid_port_ranges_changed();
ghid_note_event_location (NULL);
return ((x0 != x1) || (y0 != y1));
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 97ebb1c..f419530 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -126,7 +126,7 @@ typedef struct
gboolean adjustment_changed_holdoff,
toggle_holdoff,
command_entry_status_line_active,
- auto_pan_on, in_popup, combine_adjustments;
+ auto_pan_on, in_popup;
gboolean config_modified,
small_label_markup,
|
|
From: <gi...@gp...> - 2011-04-06 21:11:08
|
The branch, master has been updated
discards 80635801c9f1d10b67b0a1741f1bea5a0f7a4af8 (commit)
via 8b94cc6abc473aca74e22d50ce945535a23a1e1a (commit)
from 80635801c9f1d10b67b0a1741f1bea5a0f7a4af8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-top-window.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
=================
Commit Messages
=================
commit 8b94cc6abc473aca74e22d50ce945535a23a1e1a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove unused variables from {h,v}_adjument_changed_cb()
:100644 100644 074ef9b... f33678a... M src/hid/gtk/gui-top-window.c
=========
Changes
=========
commit 8b94cc6abc473aca74e22d50ce945535a23a1e1a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove unused variables from {h,v}_adjument_changed_cb()
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 074ef9b..f33678a 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -465,24 +465,18 @@ get_grid_value_index (gboolean allow_fail)
static void
h_adjustment_changed_cb (GtkAdjustment * adj, GhidGui * g)
{
- gdouble xval, yval;
-
if (g->adjustment_changed_holdoff)
return;
- xval = gtk_adjustment_get_value (adj);
- yval = gtk_adjustment_get_value (GTK_ADJUSTMENT (ghidgui->v_adjustment));
+
ghid_port_ranges_changed ();
}
static void
v_adjustment_changed_cb (GtkAdjustment * adj, GhidGui * g)
{
- gdouble xval, yval;
-
if (g->adjustment_changed_holdoff)
return;
- yval = gtk_adjustment_get_value (adj);
- xval = gtk_adjustment_get_value (GTK_ADJUSTMENT (ghidgui->h_adjustment));
+
ghid_port_ranges_changed ();
}
|