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-10-23 20:12:00
|
The branch, master has been updated
via 4b37816d8a624fdac5dafa20aaf3d3188c555215 (commit)
via 23120603bd4385e8fedfc5ee84e76ebf8ffe5ccf (commit)
via 4ce9c6e97a67697b5738311c0c2e5ed81ea5f265 (commit)
via 1121e999a2d094d45a8fe11d0c21e0f4d1572bc5 (commit)
from 1ca5edbb19136e62131eee0192b48dc33cc73895 (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/gcode/gcode.c | 683 +++++++++++++++++++++++++++----------------------
src/hid/gcode/trace.c | 12 +-
src/hid/gcode/trace.h | 3 +-
3 files changed, 386 insertions(+), 312 deletions(-)
=================
Commit Messages
=================
commit 4b37816d8a624fdac5dafa20aaf3d3188c555215
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: Avoid more than one G or M code per line for advanced G-code.
Some primitive G-code interpreters can't deal with multiple
G or M codes in one line, so avoid them at no cost. Alberto Maccioni
asked on geda-user make this optional.
Affects-bug: lp-699497
:100644 100644 1bf0fd9... a5a6dcb... M src/hid/gcode/gcode.c
commit 23120603bd4385e8fedfc5ee84e76ebf8ffe5ccf
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: add a flag wether to produce advanced G-code.
Some primitive machine controllers don't understand what a variable
is, while those understanding variables can work without as well.
After all, using variables is just a convenience for later hand-editing
of the G-code programs. More changes for primitive controllers are
to come.
Affects-bug: lp-699497
:100644 100644 f2e37bd... 1bf0fd9... M src/hid/gcode/gcode.c
:100644 100644 7fb9012... 5d7c62e... M src/hid/gcode/trace.c
:100644 100644 2a07e61... d55fd3e... M src/hid/gcode/trace.h
commit 4ce9c6e97a67697b5738311c0c2e5ed81ea5f265
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: create better file names.
If the user adds a suffix to a file name in the dialog, he expects
the resulting files to have these suffixes as well.
This patch is a combination of the following two patches by Markus Hitter.
0001-HID-gcode-let-the-system-library-allocate-the-tempor.patch
0004-HID-gcode-create-better-file-names.patch
The original patches are avaiable at the bug-report on
launchpad lp-699497. The combination and modifications where done by Felix
Ruoff.
Affects-bug: lp-699497
:100644 100644 676ea94... f2e37bd... M src/hid/gcode/gcode.c
commit 1121e999a2d094d45a8fe11d0c21e0f4d1572bc5
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: get rid of tabulators in gcode.c. Pure whitespace change.
Developers should decide wether to use tabs or not, but not mix both.
Rebased to git head by Felix Ruoff
Affects-bug: lp-699497
:100644 100644 44a71fe... 676ea94... M src/hid/gcode/gcode.c
=========
Changes
=========
commit 4b37816d8a624fdac5dafa20aaf3d3188c555215
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: Avoid more than one G or M code per line for advanced G-code.
Some primitive G-code interpreters can't deal with multiple
G or M codes in one line, so avoid them at no cost. Alberto Maccioni
asked on geda-user make this optional.
Affects-bug: lp-699497
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 1bf0fd9..a5a6dcb 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -553,10 +553,16 @@ gcode_do_export (HID_Attr_Val * options)
variable_safeZ, gcode_safeZ);
fprintf (gcode_f2, "%s=%f (cutting depth)\n",
variable_cutdepth, gcode_cutdepth);
+ fprintf (gcode_f2, "(---------------------------------)\n");
+ fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
+ metric ? 21 : 20, metric ? 25 : 1);
+ }
+ else
+ {
+ fprintf (gcode_f2, "(---------------------------------)\n");
+ fprintf (gcode_f2, "G17\nG%d\nG90\nG64 P0.003\nM3 S3000\nM7\nF%d\n",
+ metric ? 21 : 20, metric ? 25 : 1);
}
- fprintf (gcode_f2, "(---------------------------------)\n");
- fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
- metric ? 21 : 20, metric ? 25 : 1);
fprintf (gcode_f2, "G0 Z%s\n", variable_safeZ);
/* extract contour points from image */
r = bm_to_pathlist (bm, &plist, ¶m_default);
@@ -580,7 +586,10 @@ gcode_do_export (HID_Attr_Val * options)
else
fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n",
25.4 * d, d);
- fprintf (gcode_f2, "M5 M9 M2\n");
+ if (gcode_advanced)
+ fprintf (gcode_f2, "M5 M9 M2\n");
+ else
+ fprintf (gcode_f2, "M5\nM9\nM2\n");
pathlist_free (plist);
bm_free (bm);
fclose (gcode_f2);
@@ -611,10 +620,16 @@ gcode_do_export (HID_Attr_Val * options)
variable_safeZ, gcode_safeZ);
fprintf (gcode_f2, "%s=%f (drill depth)\n",
variable_drilldepth, gcode_drilldepth);
+ fprintf (gcode_f2, "(---------------------------------)\n");
+ fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
+ metric ? 21 : 20, metric ? 25 : 1);
+ }
+ else
+ {
+ fprintf (gcode_f2, "(---------------------------------)\n");
+ fprintf (gcode_f2, "G17\nG%d\nG90\nG64 P0.003\nM3 S3000\nM7\nF%d\n",
+ metric ? 21 : 20, metric ? 25 : 1);
}
- fprintf (gcode_f2, "(---------------------------------)\n");
- fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
- metric ? 21 : 20, metric ? 25 : 1);
/* fprintf(gcode_f2,"G0 Z%s\n",variable_safeZ); */
for (r = 0; r < n_drill; r++)
{
@@ -637,7 +652,10 @@ gcode_do_export (HID_Attr_Val * options)
(drill[r].y - drill[r - 1].y) * (drill[r].y -
drill[r - 1].y));
}
- fprintf (gcode_f2, "M5 M9 M2\n");
+ if (gcode_advanced)
+ fprintf (gcode_f2, "M5 M9 M2\n");
+ else
+ fprintf (gcode_f2, "M5\nM9\nM2\n");
fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n",
25.4 * d, d);
fclose (gcode_f2);
commit 23120603bd4385e8fedfc5ee84e76ebf8ffe5ccf
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: add a flag wether to produce advanced G-code.
Some primitive machine controllers don't understand what a variable
is, while those understanding variables can work without as well.
After all, using variables is just a convenience for later hand-editing
of the G-code programs. More changes for primitive controllers are
to come.
Affects-bug: lp-699497
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index f2e37bd..1bf0fd9 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -123,6 +123,7 @@ static double gcode_cutdepth = 0; /* milling depth (inch) */
static double gcode_drilldepth = 0; /* drilling depth (inch) */
static double gcode_safeZ = 100; /* safe Z (inch) */
static double gcode_toolradius = 0; /* tool radius(inch) */
+static char gcode_advanced = 0;
static int save_drill = 0;
static int n_drill = 0;
static int nmax_drill = 0;
@@ -173,6 +174,12 @@ HID_Attribute gcode_attribute_list[] = {
HID_Unit, 0, 0, {-1, 0, 0}, units, 0},
#define HA_unit 6
+ {"advanced-gcode", "wether to produce G-code for advanced interpreters,\n"
+ "like using variables for often used values. Not all\n"
+ "machine controllers understand this, but it allows\n"
+ "better hand-editing of the resulting files",
+ HID_Boolean, 0, 0, {-1, 0, 0}, 0, 0},
+#define HA_advanced 7
};
#define NUM_OPTIONS (sizeof(gcode_attribute_list)/sizeof(gcode_attribute_list[0]))
@@ -419,6 +426,8 @@ gcode_do_export (HID_Attr_Val * options)
0.0, /* granularity */
},
};
+ char variable_safeZ[20], variable_cutdepth[20];
+ char variable_drilldepth[20];
if (!options)
{
@@ -451,13 +460,25 @@ gcode_do_export (HID_Attr_Val * options)
gcode_toolradius = metric
? MM_TO_COORD(options[HA_toolradius].real_value * scale)
: INCH_TO_COORD(options[HA_toolradius].real_value * scale);
+ gcode_advanced = options[HA_advanced].int_value;
gcode_choose_groups ();
+ if (gcode_advanced)
+ {
+ strcpy (variable_safeZ, "#100");
+ strcpy (variable_cutdepth, "#101");
+ strcpy (variable_drilldepth, "#102");
+ }
+ else
+ {
+ snprintf (variable_safeZ, 20, "%f", gcode_safeZ);
+ snprintf (variable_cutdepth, 20, "%f", gcode_cutdepth);
+ snprintf (variable_drilldepth, 20, "%f", gcode_drilldepth);
+ }
for (i = 0; i < MAX_LAYER; i++)
{
if (gcode_export_group[i])
{
-
gcode_cur_group = i;
/* magic */
@@ -526,12 +547,17 @@ gcode_do_export (HID_Attr_Val * options)
pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight);
else
pcb_fprintf (gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight);
- fprintf (gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ);
- fprintf (gcode_f2, "#101=%f (cutting depth)\n", gcode_cutdepth);
+ if (gcode_advanced)
+ {
+ fprintf (gcode_f2, "%s=%f (safe Z)\n",
+ variable_safeZ, gcode_safeZ);
+ fprintf (gcode_f2, "%s=%f (cutting depth)\n",
+ variable_cutdepth, gcode_cutdepth);
+ }
fprintf (gcode_f2, "(---------------------------------)\n");
fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
metric ? 21 : 20, metric ? 25 : 1);
- fprintf (gcode_f2, "G0 Z#100\n");
+ fprintf (gcode_f2, "G0 Z%s\n", variable_safeZ);
/* extract contour points from image */
r = bm_to_pathlist (bm, &plist, ¶m_default);
if (r)
@@ -540,9 +566,9 @@ gcode_do_export (HID_Attr_Val * options)
return;
}
/* generate best polygon and write vertices in g-code format */
- d =
- process_path (plist, ¶m_default, bm, gcode_f2,
- metric ? 25.4 / gcode_dpi : 1.0 / gcode_dpi);
+ d = process_path (plist, ¶m_default, bm, gcode_f2,
+ metric ? 25.4 / gcode_dpi : 1.0 / gcode_dpi,
+ variable_cutdepth, variable_safeZ);
if (d < 0)
{
fprintf (stderr, "ERROR: path process function failed\n");
@@ -579,25 +605,31 @@ gcode_do_export (HID_Attr_Val * options)
pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight);
else
pcb_fprintf (gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight);
- fprintf (gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ);
- fprintf (gcode_f2, "#101=%f (drill depth)\n",
- gcode_drilldepth);
+ if (gcode_advanced)
+ {
+ fprintf (gcode_f2, "%s=%f (safe Z)\n",
+ variable_safeZ, gcode_safeZ);
+ fprintf (gcode_f2, "%s=%f (drill depth)\n",
+ variable_drilldepth, gcode_drilldepth);
+ }
fprintf (gcode_f2, "(---------------------------------)\n");
fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
metric ? 21 : 20, metric ? 25 : 1);
-/* fprintf(gcode_f2,"G0 Z#100\n"); */
+/* fprintf(gcode_f2,"G0 Z%s\n",variable_safeZ); */
for (r = 0; r < n_drill; r++)
{
/* if(metric) fprintf(gcode_f2,"G0 X%f Y%f\n",drill[r].x*25.4,drill[r].y*25.4); */
/* else fprintf(gcode_f2,"G0 X%f Y%f\n",drill[r].x,drill[r].y); */
if (metric)
- fprintf (gcode_f2, "G81 X%f Y%f Z#101 R#100\n",
- drill[r].x * 25.4, drill[r].y * 25.4);
+ fprintf (gcode_f2, "G81 X%f Y%f Z%s R%s\n",
+ drill[r].x * 25.4, drill[r].y * 25.4,
+ variable_drilldepth, variable_safeZ);
else
- fprintf (gcode_f2, "G81 X%f Y%f Z#101 R#100\n",
- drill[r].x, drill[r].y);
-/* fprintf(gcode_f2,"G1 Z#101\n"); */
-/* fprintf(gcode_f2,"G0 Z#100\n"); */
+ fprintf (gcode_f2, "G81 X%f Y%f Z%s R%s\n",
+ drill[r].x, drill[r].y,
+ variable_drilldepth, variable_safeZ);
+/* fprintf(gcode_f2,"G1 Z%s\n",variable_depth); */
+/* fprintf(gcode_f2,"G0 Z%s\n",variable_safeZ); */
if (r > 0)
d +=
sqrt ((drill[r].x - drill[r - 1].x) * (drill[r].x -
diff --git a/src/hid/gcode/trace.c b/src/hid/gcode/trace.c
index 7fb9012..5d7c62e 100644
--- a/src/hid/gcode/trace.c
+++ b/src/hid/gcode/trace.c
@@ -1401,7 +1401,8 @@ malloc_error:
/* ---------------------------------------------------------------------- */
double
-plotpolygon (privpath_t * pp, FILE * f, double scale)
+plotpolygon (privpath_t * pp, FILE * f, double scale, const char *var_cutdepth,
+ const char *var_safeZ)
{
int i;
int m = pp->m;
@@ -1418,7 +1419,7 @@ plotpolygon (privpath_t * pp, FILE * f, double scale)
fprintf (f, "G0 X%f Y%f (start point)\n", pt[po[0]].x * scale,
pt[po[0]].y * scale);
- fprintf (f, "G1 Z#101\n");
+ fprintf (f, "G1 Z%s\n", var_cutdepth);
for (i = 1; i < m; i++)
{
fprintf (f, "G1 X%f Y%f\n", pt[po[i]].x * scale, pt[po[i]].y * scale);
@@ -1432,7 +1433,7 @@ plotpolygon (privpath_t * pp, FILE * f, double scale)
scale);
}
fprintf (f, "G1 X%f Y%f\n", pt[po[0]].x * scale, pt[po[0]].y * scale);
- fprintf (f, "G0 Z#100\n");
+ fprintf (f, "G0 Z%s\n", var_safeZ);
dm +=
sqrt ((pt[po[m - 1]].x - pt[po[0]].x) * scale * (pt[po[m - 1]].x -
pt[po[0]].x) * scale +
@@ -1447,7 +1448,8 @@ plotpolygon (privpath_t * pp, FILE * f, double scale)
/* return distance on success, -1 on error with errno set. */
double
process_path (path_t * plist, const potrace_param_t * param,
- const potrace_bitmap_t * bm, FILE * f, double scale)
+ const potrace_bitmap_t * bm, FILE * f, double scale,
+ const char *var_cutdepth, const char *var_safeZ)
{
path_t *p;
double dm = 0;
@@ -1460,7 +1462,7 @@ process_path (path_t * plist, const potrace_param_t * param,
TRY (bestpolygon (p->priv));
TRY (adjust_vertices (p->priv));
fprintf (f, "(polygon %d)\n", ++n);
- dm += plotpolygon (p->priv, f, scale);
+ dm += plotpolygon (p->priv, f, scale, var_cutdepth, var_safeZ);
/* No need to extract curves
TRY(smooth(&p->priv->curve, p->sign, param->alphamax));
if (param->opticurve) {
diff --git a/src/hid/gcode/trace.h b/src/hid/gcode/trace.h
index 2a07e61..d55fd3e 100644
--- a/src/hid/gcode/trace.h
+++ b/src/hid/gcode/trace.h
@@ -10,6 +10,7 @@
#include "potracelib.h"
double process_path (path_t * plist, const potrace_param_t * param,
- const potrace_bitmap_t * bm, FILE * f, double scale);
+ const potrace_bitmap_t * bm, FILE * f, double scale,
+ const char *var_cutdepth, const char *var_safeZ);
#endif /* TRACE_H */
commit 4ce9c6e97a67697b5738311c0c2e5ed81ea5f265
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: create better file names.
If the user adds a suffix to a file name in the dialog, he expects
the resulting files to have these suffixes as well.
This patch is a combination of the following two patches by Markus Hitter.
0001-HID-gcode-let-the-system-library-allocate-the-tempor.patch
0004-HID-gcode-create-better-file-names.patch
The original patches are avaiable at the bug-report on
launchpad lp-699497. The combination and modifications where done by Felix
Ruoff.
Affects-bug: lp-699497
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 676ea94..f2e37bd 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -113,7 +113,7 @@ static int gcode_export_group[MAX_LAYER];
/* Group that is currently exported. */
static int gcode_cur_group;
-/* Filename prefix that will be used when saving files. */
+/* Filename prefix and suffix that will be used when saving files. */
static const char *gcode_basename = NULL;
/* Horizontal DPI (grid points per inch) */
@@ -144,7 +144,8 @@ static const char *units[] = {
HID_Attribute gcode_attribute_list[] = {
/* other HIDs expect this to be first. */
- {"basename", "File name prefix",
+ {"basename", "File name prefix and suffix,\n"
+ "layer names will be inserted before the suffix",
HID_String, 0, 0, {0, 0, 0}, 0, 0},
#define HA_basename 0
@@ -187,10 +188,28 @@ static int pcb_to_gcode (int pcb)
return round(COORD_TO_INCH(pcb) * gcode_dpi);
}
-static char *
-gcode_get_png_name (const char *basename, const char *suffix)
+/* Fits the given layer name into basename, just before the suffix */
+static void
+gcode_get_filename (char *filename, const char *layername)
{
- return g_strdup_printf ("%s.%s.png", basename, suffix);
+ char *pt;
+ char suffix[MAXPATHLEN];
+
+ suffix[0] = '\0';
+ pt = strrchr (gcode_basename, '.');
+ if (pt && pt > strrchr (gcode_basename, '/'))
+ strcpy (suffix, pt);
+ else
+ pt = NULL;
+
+ strcpy (filename, gcode_basename);
+ if (pt)
+ *(filename + (pt - gcode_basename)) = '\0';
+ strcat (filename, "-");
+ strcat (filename, layername);
+ strcat (filename, suffix);
+
+ // result is in char *filename
}
/* Sorts drills in order of distance from the origin */
@@ -318,12 +337,15 @@ gcode_alloc_colors ()
}
static void
-gcode_start_png (const char *basename, const char *suffix)
+gcode_start_png (const char *layername)
{
int h, w;
- char *buf;
+ char *png_filename, *buf;
- buf = gcode_get_png_name (basename, suffix);
+ png_filename = (char *)malloc (MAXPATHLEN);
+ gcode_get_filename (png_filename, layername);
+ buf = g_strdup_printf ("%s.png", png_filename);
+ free(png_filename);
h = pcb_to_gcode (PCB->MaxHeight);
w = pcb_to_gcode (PCB->MaxWidth);
@@ -410,7 +432,7 @@ gcode_do_export (HID_Attr_Val * options)
gcode_basename = options[HA_basename].str_value;
if (!gcode_basename)
{
- gcode_basename = "pcb-out";
+ gcode_basename = "pcb-out.gcode";
}
gcode_dpi = options[HA_dpi].int_value;
if (gcode_dpi < 0)
@@ -446,7 +468,7 @@ gcode_do_export (HID_Attr_Val * options)
(GetLayerGroupNumberByNumber (idx) ==
GetLayerGroupNumberByNumber (solder_silk_layer)) ? 1 : 0;
save_drill = is_solder; /* save drills for one layer only */
- gcode_start_png (gcode_basename, layer_type_to_file_name (idx, FNS_fixed));
+ gcode_start_png (layer_type_to_file_name (idx, FNS_fixed));
hid_save_and_show_layer_ons (save_ons);
gcode_start_png_export ();
hid_restore_layer_ons (save_ons);
@@ -474,8 +496,7 @@ gcode_do_export (HID_Attr_Val * options)
}
gdImageDestroy (temp_im);
}
- sprintf (filename, "%s.%s.cnc", gcode_basename,
- layer_type_to_file_name (idx, FNS_fixed));
+ gcode_get_filename (filename, layer_type_to_file_name (idx, FNS_fixed));
for (r = 0; r < gdImageSX (gcode_im); r++)
{
for (c = 0; c < gdImageSY (gcode_im); c++)
@@ -541,7 +562,7 @@ gcode_do_export (HID_Attr_Val * options)
{
d = 0;
drill = sort_drill (drill, n_drill);
- sprintf (filename, "%s.drill.cnc", gcode_basename);
+ gcode_get_filename (filename, "drill");
gcode_f2 = fopen (filename, "wb");
if (!gcode_f2)
{
commit 1121e999a2d094d45a8fe11d0c21e0f4d1572bc5
Author: Markus Hitter <ma...@ju...>
Commit: Felix Ruoff <Fe...@po...>
HID-gcode: get rid of tabulators in gcode.c. Pure whitespace change.
Developers should decide wether to use tabs or not, but not mix both.
Rebased to git head by Felix Ruoff
Affects-bug: lp-699497
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 44a71fe..676ea94 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -119,10 +119,10 @@ static const char *gcode_basename = NULL;
/* Horizontal DPI (grid points per inch) */
static int gcode_dpi = -1;
-static double gcode_cutdepth = 0; /* milling depth (inch) */
-static double gcode_drilldepth = 0; /* drilling depth (inch) */
-static double gcode_safeZ = 100; /* safe Z (inch) */
-static double gcode_toolradius = 0; /* tool radius(inch) */
+static double gcode_cutdepth = 0; /* milling depth (inch) */
+static double gcode_drilldepth = 0; /* drilling depth (inch) */
+static double gcode_safeZ = 100; /* safe Z (inch) */
+static double gcode_toolradius = 0; /* tool radius(inch) */
static int save_drill = 0;
static int n_drill = 0;
static int nmax_drill = 0;
@@ -206,17 +206,17 @@ sort_drill (struct drill_struct *drill, int n_drill)
dmin = 1e20;
imin = 0;
for (i = 0; i < n_drill - j; i++)
- {
- d =
- (drill[i].x - p.x) * (drill[i].x - p.x) + (drill[i].y -
- p.y) * (drill[i].y -
- p.y);
- if (d < dmin)
- {
- imin = i;
- dmin = d;
- }
- }
+ {
+ d =
+ (drill[i].x - p.x) * (drill[i].x - p.x) + (drill[i].y -
+ p.y) * (drill[i].y -
+ p.y);
+ if (d < dmin)
+ {
+ imin = i;
+ dmin = d;
+ }
+ }
/* printf("j=%d imin=%d dmin=%f p=(%f,%f)\n",j,imin,dmin,p.x,p.y); */
temp[j] = drill[imin];
drill[imin] = drill[n_drill - j - 1];
@@ -232,8 +232,8 @@ static void
gcode_parse_arguments (int *argc, char ***argv)
{
hid_register_attributes (gcode_attribute_list,
- sizeof (gcode_attribute_list) /
- sizeof (gcode_attribute_list[0]));
+ sizeof (gcode_attribute_list) /
+ sizeof (gcode_attribute_list[0]));
hid_parse_command_line (argc, argv);
}
@@ -255,8 +255,8 @@ gcode_get_export_options (int *n)
if (PCB)
{
derive_default_filename (PCB->Filename,
- &gcode_attribute_list[HA_basename],
- ".gcode", &last_made_filename);
+ &gcode_attribute_list[HA_basename],
+ ".gcode", &last_made_filename);
}
if (n)
{
@@ -280,23 +280,23 @@ gcode_choose_groups ()
layer = &PCB->Data->Layer[n];
if (layer->LineN || layer->TextN || layer->ArcN || layer->PolygonN)
- {
- /* layer isn't empty */
-
- /*
- * is this check necessary? It seems that special
- * layers have negative indexes?
- */
-
- if (SL_TYPE (n) == 0)
- {
- /* layer is a copper layer */
- m = GetLayerGroupNumberByNumber (n);
-
- /* the export layer */
- gcode_export_group[m] = 1;
- }
- }
+ {
+ /* layer isn't empty */
+
+ /*
+ * is this check necessary? It seems that special
+ * layers have negative indexes?
+ */
+
+ if (SL_TYPE (n) == 0)
+ {
+ /* layer is a copper layer */
+ m = GetLayerGroupNumberByNumber (n);
+
+ /* the export layer */
+ gcode_export_group[m] = 1;
+ }
+ }
}
}
@@ -385,16 +385,16 @@ gcode_do_export (HID_Attr_Val * options)
path_t *plist = NULL;
potrace_bitmap_t *bm = NULL;
potrace_param_t param_default = {
- 2, /* turnsize */
- POTRACE_TURNPOLICY_MINORITY, /* turnpolicy */
- 1.0, /* alphamax */
- 1, /* opticurve */
- 0.2, /* opttolerance */
+ 2, /* turnsize */
+ POTRACE_TURNPOLICY_MINORITY, /* turnpolicy */
+ 1.0, /* alphamax */
+ 1, /* opticurve */
+ 0.2, /* opttolerance */
{
- NULL, /* callback function */
- NULL, /* callback data */
- 0.0, 1.0, /* progress range */
- 0.0, /* granularity */
+ NULL, /* callback function */
+ NULL, /* callback data */
+ 0.0, 1.0, /* progress range */
+ 0.0, /* granularity */
},
};
@@ -402,9 +402,9 @@ gcode_do_export (HID_Attr_Val * options)
{
gcode_get_export_options (0);
for (i = 0; i < NUM_OPTIONS; i++)
- {
- gcode_values[i] = gcode_attribute_list[i].default_val;
- }
+ {
+ gcode_values[i] = gcode_attribute_list[i].default_val;
+ }
options = gcode_values;
}
gcode_basename = options[HA_basename].str_value;
@@ -434,169 +434,169 @@ gcode_do_export (HID_Attr_Val * options)
for (i = 0; i < MAX_LAYER; i++)
{
if (gcode_export_group[i])
- {
-
- gcode_cur_group = i;
-
- /* magic */
- idx = (i >= 0 && i < max_group) ?
- PCB->LayerGroups.Entries[i][0] : i;
- printf ("idx=%d %s\n", idx, layer_type_to_file_name (idx, FNS_fixed));
- is_solder =
- (GetLayerGroupNumberByNumber (idx) ==
- GetLayerGroupNumberByNumber (solder_silk_layer)) ? 1 : 0;
- save_drill = is_solder; /* save drills for one layer only */
- gcode_start_png (gcode_basename, layer_type_to_file_name (idx, FNS_fixed));
- hid_save_and_show_layer_ons (save_ons);
- gcode_start_png_export ();
- hid_restore_layer_ons (save_ons);
+ {
+
+ gcode_cur_group = i;
+
+ /* magic */
+ idx = (i >= 0 && i < max_group) ?
+ PCB->LayerGroups.Entries[i][0] : i;
+ printf ("idx=%d %s\n", idx, layer_type_to_file_name (idx, FNS_fixed));
+ is_solder =
+ (GetLayerGroupNumberByNumber (idx) ==
+ GetLayerGroupNumberByNumber (solder_silk_layer)) ? 1 : 0;
+ save_drill = is_solder; /* save drills for one layer only */
+ gcode_start_png (gcode_basename, layer_type_to_file_name (idx, FNS_fixed));
+ hid_save_and_show_layer_ons (save_ons);
+ gcode_start_png_export ();
+ hid_restore_layer_ons (save_ons);
/* ***************** gcode conversion *************************** */
/* potrace uses a different kind of bitmap; for simplicity gcode_im is copied to this format */
- bm = bm_new (gdImageSX (gcode_im), gdImageSY (gcode_im));
- filename = (char *)malloc (MAXPATHLEN);
- plist = NULL;
- if (is_solder)
- { /* only for back layer */
- gdImagePtr temp_im =
- gdImageCreate (gdImageSX (gcode_im), gdImageSY (gcode_im));
- gdImageCopy (temp_im, gcode_im, 0, 0, 0, 0,
- gdImageSX (gcode_im), gdImageSY (gcode_im));
- for (r = 0; r < gdImageSX (gcode_im); r++)
- {
- for (c = 0; c < gdImageSY (gcode_im); c++)
- {
- gdImageSetPixel (gcode_im, r, c,
- gdImageGetPixel (temp_im,
- gdImageSX (gcode_im) -
- 1 - r, c));
- }
- }
- gdImageDestroy (temp_im);
- }
- sprintf (filename, "%s.%s.cnc", gcode_basename,
- layer_type_to_file_name (idx, FNS_fixed));
- for (r = 0; r < gdImageSX (gcode_im); r++)
- {
- for (c = 0; c < gdImageSY (gcode_im); c++)
- {
- v =
- gdImageGetPixel (gcode_im, r,
- gdImageSY (gcode_im) - 1 - c);
- p = (gcode_im->red[v] || gcode_im->green[v]
- || gcode_im->blue[v]) ? 0 : 0xFFFFFF;
- BM_PUT (bm, r, c, p);
- }
- }
- gcode_f2 = fopen (filename, "wb");
- if (!gcode_f2)
- {
- perror (filename);
- return;
- }
- fprintf (gcode_f2, "(Created by G-code exporter)\n");
- t = time (NULL);
- sprintf (filename, "%s", ctime (&t));
- filename[strlen (filename) - 1] = 0;
- fprintf (gcode_f2, "( %s )\n", filename);
- fprintf (gcode_f2, "(%d dpi)\n", gcode_dpi);
- fprintf (gcode_f2, "(Unit: %s)\n", metric ? "mm" : "inch");
- if (metric)
- pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight);
- else
- pcb_fprintf (gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight);
- fprintf (gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ);
- fprintf (gcode_f2, "#101=%f (cutting depth)\n", gcode_cutdepth);
- fprintf (gcode_f2, "(---------------------------------)\n");
- fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
- metric ? 21 : 20, metric ? 25 : 1);
- fprintf (gcode_f2, "G0 Z#100\n");
- /* extract contour points from image */
- r = bm_to_pathlist (bm, &plist, ¶m_default);
- if (r)
- {
- fprintf (stderr, "ERROR: pathlist function failed\n");
- return;
- }
- /* generate best polygon and write vertices in g-code format */
- d =
- process_path (plist, ¶m_default, bm, gcode_f2,
- metric ? 25.4 / gcode_dpi : 1.0 / gcode_dpi);
- if (d < 0)
- {
- fprintf (stderr, "ERROR: path process function failed\n");
- return;
- }
- if (metric)
- fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n", d,
- d * 1 / 25.4);
- else
- fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n",
- 25.4 * d, d);
- fprintf (gcode_f2, "M5 M9 M2\n");
- pathlist_free (plist);
- bm_free (bm);
- fclose (gcode_f2);
- if (save_drill)
- {
- d = 0;
- drill = sort_drill (drill, n_drill);
- sprintf (filename, "%s.drill.cnc", gcode_basename);
- gcode_f2 = fopen (filename, "wb");
- if (!gcode_f2)
- {
- perror (filename);
- return;
- }
- fprintf (gcode_f2, "(Created by G-code exporter)\n");
- fprintf (gcode_f2, "(drill file: %d drills)\n", n_drill);
- sprintf (filename, "%s", ctime (&t));
- filename[strlen (filename) - 1] = 0;
- fprintf (gcode_f2, "( %s )\n", filename);
- fprintf (gcode_f2, "(Unit: %s)\n", metric ? "mm" : "inch");
- if (metric)
- pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight);
- else
- pcb_fprintf (gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight);
- fprintf (gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ);
- fprintf (gcode_f2, "#101=%f (drill depth)\n",
- gcode_drilldepth);
- fprintf (gcode_f2, "(---------------------------------)\n");
- fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
- metric ? 21 : 20, metric ? 25 : 1);
+ bm = bm_new (gdImageSX (gcode_im), gdImageSY (gcode_im));
+ filename = (char *)malloc (MAXPATHLEN);
+ plist = NULL;
+ if (is_solder)
+ { /* only for back layer */
+ gdImagePtr temp_im =
+ gdImageCreate (gdImageSX (gcode_im), gdImageSY (gcode_im));
+ gdImageCopy (temp_im, gcode_im, 0, 0, 0, 0,
+ gdImageSX (gcode_im), gdImageSY (gcode_im));
+ for (r = 0; r < gdImageSX (gcode_im); r++)
+ {
+ for (c = 0; c < gdImageSY (gcode_im); c++)
+ {
+ gdImageSetPixel (gcode_im, r, c,
+ gdImageGetPixel (temp_im,
+ gdImageSX (gcode_im) -
+ 1 - r, c));
+ }
+ }
+ gdImageDestroy (temp_im);
+ }
+ sprintf (filename, "%s.%s.cnc", gcode_basename,
+ layer_type_to_file_name (idx, FNS_fixed));
+ for (r = 0; r < gdImageSX (gcode_im); r++)
+ {
+ for (c = 0; c < gdImageSY (gcode_im); c++)
+ {
+ v =
+ gdImageGetPixel (gcode_im, r,
+ gdImageSY (gcode_im) - 1 - c);
+ p = (gcode_im->red[v] || gcode_im->green[v]
+ || gcode_im->blue[v]) ? 0 : 0xFFFFFF;
+ BM_PUT (bm, r, c, p);
+ }
+ }
+ gcode_f2 = fopen (filename, "wb");
+ if (!gcode_f2)
+ {
+ perror (filename);
+ return;
+ }
+ fprintf (gcode_f2, "(Created by G-code exporter)\n");
+ t = time (NULL);
+ sprintf (filename, "%s", ctime (&t));
+ filename[strlen (filename) - 1] = 0;
+ fprintf (gcode_f2, "( %s )\n", filename);
+ fprintf (gcode_f2, "(%d dpi)\n", gcode_dpi);
+ fprintf (gcode_f2, "(Unit: %s)\n", metric ? "mm" : "inch");
+ if (metric)
+ pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight);
+ else
+ pcb_fprintf (gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight);
+ fprintf (gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ);
+ fprintf (gcode_f2, "#101=%f (cutting depth)\n", gcode_cutdepth);
+ fprintf (gcode_f2, "(---------------------------------)\n");
+ fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
+ metric ? 21 : 20, metric ? 25 : 1);
+ fprintf (gcode_f2, "G0 Z#100\n");
+ /* extract contour points from image */
+ r = bm_to_pathlist (bm, &plist, ¶m_default);
+ if (r)
+ {
+ fprintf (stderr, "ERROR: pathlist function failed\n");
+ return;
+ }
+ /* generate best polygon and write vertices in g-code format */
+ d =
+ process_path (plist, ¶m_default, bm, gcode_f2,
+ metric ? 25.4 / gcode_dpi : 1.0 / gcode_dpi);
+ if (d < 0)
+ {
+ fprintf (stderr, "ERROR: path process function failed\n");
+ return;
+ }
+ if (metric)
+ fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n", d,
+ d * 1 / 25.4);
+ else
+ fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n",
+ 25.4 * d, d);
+ fprintf (gcode_f2, "M5 M9 M2\n");
+ pathlist_free (plist);
+ bm_free (bm);
+ fclose (gcode_f2);
+ if (save_drill)
+ {
+ d = 0;
+ drill = sort_drill (drill, n_drill);
+ sprintf (filename, "%s.drill.cnc", gcode_basename);
+ gcode_f2 = fopen (filename, "wb");
+ if (!gcode_f2)
+ {
+ perror (filename);
+ return;
+ }
+ fprintf (gcode_f2, "(Created by G-code exporter)\n");
+ fprintf (gcode_f2, "(drill file: %d drills)\n", n_drill);
+ sprintf (filename, "%s", ctime (&t));
+ filename[strlen (filename) - 1] = 0;
+ fprintf (gcode_f2, "( %s )\n", filename);
+ fprintf (gcode_f2, "(Unit: %s)\n", metric ? "mm" : "inch");
+ if (metric)
+ pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight);
+ else
+ pcb_fprintf (gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight);
+ fprintf (gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ);
+ fprintf (gcode_f2, "#101=%f (drill depth)\n",
+ gcode_drilldepth);
+ fprintf (gcode_f2, "(---------------------------------)\n");
+ fprintf (gcode_f2, "G17 G%d G90 G64 P0.003 M3 S3000 M7 F%d\n",
+ metric ? 21 : 20, metric ? 25 : 1);
/* fprintf(gcode_f2,"G0 Z#100\n"); */
- for (r = 0; r < n_drill; r++)
- {
+ for (r = 0; r < n_drill; r++)
+ {
/* if(metric) fprintf(gcode_f2,"G0 X%f Y%f\n",drill[r].x*25.4,drill[r].y*25.4); */
/* else fprintf(gcode_f2,"G0 X%f Y%f\n",drill[r].x,drill[r].y); */
- if (metric)
- fprintf (gcode_f2, "G81 X%f Y%f Z#101 R#100\n",
- drill[r].x * 25.4, drill[r].y * 25.4);
- else
- fprintf (gcode_f2, "G81 X%f Y%f Z#101 R#100\n",
- drill[r].x, drill[r].y);
+ if (metric)
+ fprintf (gcode_f2, "G81 X%f Y%f Z#101 R#100\n",
+ drill[r].x * 25.4, drill[r].y * 25.4);
+ else
+ fprintf (gcode_f2, "G81 X%f Y%f Z#101 R#100\n",
+ drill[r].x, drill[r].y);
/* fprintf(gcode_f2,"G1 Z#101\n"); */
/* fprintf(gcode_f2,"G0 Z#100\n"); */
- if (r > 0)
- d +=
- sqrt ((drill[r].x - drill[r - 1].x) * (drill[r].x -
- drill[r - 1].x) +
- (drill[r].y - drill[r - 1].y) * (drill[r].y -
- drill[r - 1].y));
- }
- fprintf (gcode_f2, "M5 M9 M2\n");
- fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n",
- 25.4 * d, d);
- fclose (gcode_f2);
- free (drill);
- drill = NULL;
- n_drill = nmax_drill = 0;
- }
- free (filename);
+ if (r > 0)
+ d +=
+ sqrt ((drill[r].x - drill[r - 1].x) * (drill[r].x -
+ drill[r - 1].x) +
+ (drill[r].y - drill[r - 1].y) * (drill[r].y -
+ drill[r - 1].y));
+ }
+ fprintf (gcode_f2, "M5 M9 M2\n");
+ fprintf (gcode_f2, "(end, total distance %.2fmm = %.2fin)\n",
+ 25.4 * d, d);
+ fclose (gcode_f2);
+ free (drill);
+ drill = NULL;
+ n_drill = nmax_drill = 0;
+ }
+ free (filename);
/* ******************* end gcode conversion **************************** */
- gcode_finish_png ();
- }
+ gcode_finish_png ();
+ }
}
}
@@ -736,7 +736,7 @@ use_gc (hidGC gc)
else
*/
gdImageSetThickness (gcode_im,
- pcb_to_gcode (gc->width + 2 * gcode_toolradius));
+ pcb_to_gcode (gc->width + 2 * gcode_toolradius));
linewidth = gc->width;
need_brush = 1;
}
@@ -749,54 +749,54 @@ use_gc (hidGC gc)
int r;
switch (gc->cap)
- {
- case Round_Cap:
- case Trace_Cap:
- type = 'C';
- r = pcb_to_gcode (gc->width / 2 + gcode_toolradius);
- break;
- default:
- case Square_Cap:
- r = pcb_to_gcode (gc->width + gcode_toolradius * 2);
- type = 'S';
- break;
- }
+ {
+ case Round_Cap:
+ case Trace_Cap:
+ type = 'C';
+ r = pcb_to_gcode (gc->width / 2 + gcode_toolradius);
+ break;
+ default:
+ case Square_Cap:
+ r = pcb_to_gcode (gc->width + gcode_toolradius * 2);
+ type = 'S';
+ break;
+ }
sprintf (name, "#%.2x%.2x%.2x_%c_%d", gc->color->r, gc->color->g,
- gc->color->b, type, r);
+ gc->color->b, type, r);
if (hid_cache_color (0, name, &bval, &bcache))
- {
- gc->brush = (gdImagePtr)bval.ptr;
- }
+ {
+ gc->brush = (gdImagePtr)bval.ptr;
+ }
else
- {
- int bg, fg;
- if (type == 'C')
- gc->brush = gdImageCreate (2 * r + 1, 2 * r + 1);
- else
- gc->brush = gdImageCreate (r + 1, r + 1);
- bg = gdImageColorAllocate (gc->brush, 255, 255, 255);
- fg =
- gdImageColorAllocate (gc->brush, gc->color->r, gc->color->g,
- gc->color->b);
- gdImageColorTransparent (gc->brush, bg);
-
- /*
- * if we shrunk to a radius/box width of zero, then just use
- * a single pixel to draw with.
- */
- if (r == 0)
- gdImageFilledRectangle (gc->brush, 0, 0, 0, 0, fg);
- else
- {
- if (type == 'C')
- gdImageFilledEllipse (gc->brush, r, r, 2 * r, 2 * r, fg);
- else
- gdImageFilledRectangle (gc->brush, 0, 0, r, r, fg);
- }
- bval.ptr = gc->brush;
- hid_cache_color (1, name, &bval, &bcache);
- }
+ {
+ int bg, fg;
+ if (type == 'C')
+ gc->brush = gdImageCreate (2 * r + 1, 2 * r + 1);
+ else
+ gc->brush = gdImageCreate (r + 1, r + 1);
+ bg = gdImageColorAllocate (gc->brush, 255, 255, 255);
+ fg =
+ gdImageColorAllocate (gc->brush, gc->color->r, gc->color->g,
+ gc->color->b);
+ gdImageColorTransparent (gc->brush, bg);
+
+ /*
+ * if we shrunk to a radius/box width of zero, then just use
+ * a single pixel to draw with.
+ */
+ if (r == 0)
+ gdImageFilledRectangle (gc->brush, 0, 0, 0, 0, fg);
+ else
+ {
+ if (type == 'C')
+ gdImageFilledEllipse (gc->brush, r, r, 2 * r, 2 * r, fg);
+ else
+ gdImageFilledRectangle (gc->brush, 0, 0, r, r, fg);
+ }
+ bval.ptr = gc->brush;
+ hid_cache_color (1, name, &bval, &bcache);
+ }
gdImageSetBrush (gcode_im, gc->brush);
lastbrush = gc->brush;
@@ -806,32 +806,32 @@ use_gc (hidGC gc)
if (lastcolor != CBLEND (gc))
{
if (is_drill || is_mask)
- {
+ {
#ifdef FIXME
- fprintf (f, "%d gray\n", gc->erase ? 0 : 1);
+ fprintf (f, "%d gray\n", gc->erase ? 0 : 1);
#endif
- lastcolor = 0;
- }
+ lastcolor = 0;
+ }
else
- {
- double r, g, b;
- r = gc->r;
- g = gc->g;
- b = gc->b;
- if (gc->faded)
- {
- r = 0.8 * 255 + 0.2 * r;
- g = 0.8 * 255 + 0.2 * g;
- b = 0.8 * 255 + 0.2 * b;
- }
+ {
+ double r, g, b;
+ r = gc->r;
+ g = gc->g;
+ b = gc->b;
+ if (gc->faded)
+ {
+ r = 0.8 * 255 + 0.2 * r;
+ g = 0.8 * 255 + 0.2 * g;
+ b = 0.8 * 255 + 0.2 * b;
+ }
#ifdef FIXME
- if (gc->r == gc->g && gc->g == gc->b)
- fprintf (f, "%g gray\n", r / 255.0);
- else
- fprintf (f, "%g %g %g rgb\n", r / 255.0, g / 255.0, b / 255.0);
+ if (gc->r == gc->g && gc->g == gc->b)
+ fprintf (f, "%g gray\n", r / 255.0);
+ else
+ fprintf (f, "%g %g %g rgb\n", r / 255.0, g / 255.0, b / 255.0);
#endif
- lastcolor = CBLEND (gc);
- }
+ lastcolor = CBLEND (gc);
+ }
}
}
@@ -840,10 +840,10 @@ gcode_draw_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
{
use_gc (gc);
gdImageRectangle (gcode_im,
- pcb_to_gcode (x1 - gcode_toolradius),
- pcb_to_gcode (y1 - gcode_toolradius),
- pcb_to_gcode (x2 + gcode_toolradius),
- pcb_to_gcode (y2 + gcode_toolradius), gc->color->c);
+ pcb_to_gcode (x1 - gcode_toolradius),
+ pcb_to_gcode (y1 - gcode_toolradius),
+ pcb_to_gcode (x2 + gcode_toolradius),
+ pcb_to_gcode (y2 + gcode_toolradius), gc->color->c);
/* printf("Rect %d %d %d %d\n",x1,y1,x2,y2); */
}
@@ -854,10 +854,10 @@ gcode_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
gdImageSetThickness (gcode_im, 0);
linewidth = 0;
gdImageFilledRectangle (gcode_im,
- pcb_to_gcode (x1 - gcode_toolradius),
- pcb_to_gcode (y1 - gcode_toolradius),
- pcb_to_gcode (x2 + gcode_toolradius),
- pcb_to_gcode (y2 + gcode_toolradius), gc->color->c);
+ pcb_to_gcode (x1 - gcode_toolradius),
+ pcb_to_gcode (y1 - gcode_toolradius),
+ pcb_to_gcode (x2 + gcode_toolradius),
+ pcb_to_gcode (y2 + gcode_toolradius), gc->color->c);
/* printf("FillRect %d %d %d %d\n",x1,y1,x2,y2); */
}
@@ -875,12 +875,12 @@ gcode_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
gdImageSetThickness (gcode_im, 0);
linewidth = 0;
gdImageLine (gcode_im, pcb_to_gcode (x1), pcb_to_gcode (y1),
- pcb_to_gcode (x2), pcb_to_gcode (y2), gdBrushed);
+ pcb_to_gcode (x2), pcb_to_gcode (y2), gdBrushed);
}
static void
gcode_draw_arc (hidGC gc, Coord cx, Coord cy, Coord width, Coord height,
- Angle start_angle, Angle delta_angle)
+ Angle start_angle, Angle delta_angle)
{
Angle sa, ea;
@@ -910,18 +910,18 @@ gcode_draw_arc (hidGC gc, Coord cx, Coord cy, Coord width, Coord height,
#if 0
printf ("draw_arc %d,%d %dx%d %d..%d %d..%d\n",
- cx, cy, width, height, start_angle, delta_angle, sa, ea);
+ cx, cy, width, height, start_angle, delta_angle, sa, ea);
printf ("gdImageArc (%p, %d, %d, %d, %d, %d, %d, %d)\n",
- im, SCALE_X (cx), SCALE_Y (cy),
- SCALE (width), SCALE (height), sa, ea, gc->color->c);
+ im, SCALE_X (cx), SCALE_Y (cy),
+ SCALE (width), SCALE (height), sa, ea, gc->color->c);
#endif
use_gc (gc);
gdImageSetThickness (gcode_im, 0);
linewidth = 0;
gdImageArc (gcode_im, pcb_to_gcode (cx), pcb_to_gcode (cy),
- pcb_to_gcode (2 * width + gcode_toolradius * 2),
- pcb_to_gcode (2 * height + gcode_toolradius * 2), sa, ea,
- gdBrushed);
+ pcb_to_gcode (2 * width + gcode_toolradius * 2),
+ pcb_to_gcode (2 * height + gcode_toolradius * 2), sa, ea,
+ gdBrushed);
}
static void
@@ -932,20 +932,20 @@ gcode_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius)
gdImageSetThickness (gcode_im, 0);
linewidth = 0;
gdImageFilledEllipse (gcode_im, pcb_to_gcode (cx), pcb_to_gcode (cy),
- pcb_to_gcode (2 * radius + gcode_toolradius * 2),
- pcb_to_gcode (2 * radius + gcode_toolradius * 2),
- gc->color->c);
+ pcb_to_gcode (2 * radius + gcode_toolradius * 2),
+ pcb_to_gcode (2 * radius + gcode_toolradius * 2),
+ gc->color->c);
if (save_drill && is_drill)
{
if (n_drill == nmax_drill)
- {
- drill =
- (struct drill_struct *) realloc (drill,
- (nmax_drill +
- 100) *
- sizeof (struct drill_struct));
- nmax_drill += 100;
- }
+ {
+ drill =
+ (struct drill_struct *) realloc (drill,
+ (nmax_drill +
+ 100) *
+ sizeof (struct drill_struct));
+ nmax_drill += 100;
+ }
drill[n_drill].x = COORD_TO_INCH(PCB->MaxWidth - cx); /* convert to inch, flip: will drill from bottom side */
drill[n_drill].y = COORD_TO_INCH(PCB->MaxHeight - cy); /* PCB reverses y axis */
n_drill++;
|
|
From: <gi...@gp...> - 2011-10-23 20:02:14
|
The branch, master has been updated
via 1ca5edbb19136e62131eee0192b48dc33cc73895 (commit)
via d106620ada2a592e484d92648c274a44852be5ad (commit)
via 2ef38a6d4c9b710d7c32acd30766e3957a836853 (commit)
from 2fb3523ddbb232ea378e55d51a463414b9f4a11d (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
=========
doc/.gitignore | 7 +++++++
src/.gitignore | 2 ++
2 files changed, 9 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 1ca5edbb19136e62131eee0192b48dc33cc73895
Author: Kai-Martin Knaak <kn...@iq...>
Commit: Felix Ruoff <Fe...@po...>
add gpcb-menu.res and pcb-menu.res to gitignore
The files src/gpcb-menu.res and src/pcb-menu.res are generated during
the build. So git should not care for them.
Closes-bug: lp-879086
:100644 100644 c7f149e... 0966282... M src/.gitignore
commit d106620ada2a592e484d92648c274a44852be5ad
Author: Kai-Martin Knaak <kn...@iq...>
Commit: Felix Ruoff <Fe...@po...>
add options.texi to gitignore
The file doc/options.texi is produced by a script at compile time.
So git should not take care for it.
Affects-bug: lp-879086
:100644 100644 b209eb4... 577aeac... M doc/.gitignore
commit 2ef38a6d4c9b710d7c32acd30766e3957a836853
Author: Kai-Martin Knaak <kn...@iq...>
Commit: Felix Ruoff <Fe...@po...>
add gcode related files to gitignore
The files
doc/gcode.pdf
doc/gcode.png
doc/gcode_control_img.pdf
doc/gcode_control_img.png
doc/gcode_tool_path.pdf
doc/gcode_tool_path.png
are produced at compile time. So git should not care for them.
Affects-bug: lp-879086
:100644 100644 74eaad7... b209eb4... M doc/.gitignore
=========
Changes
=========
commit 1ca5edbb19136e62131eee0192b48dc33cc73895
Author: Kai-Martin Knaak <kn...@iq...>
Commit: Felix Ruoff <Fe...@po...>
add gpcb-menu.res and pcb-menu.res to gitignore
The files src/gpcb-menu.res and src/pcb-menu.res are generated during
the build. So git should not care for them.
Closes-bug: lp-879086
diff --git a/src/.gitignore b/src/.gitignore
index c7f149e..0966282 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -12,3 +12,5 @@ pcbtest.sh
pcb
pcb.exe
pcb_icon.ico
+gpcb-menu.res
+pcb-menu.res
commit d106620ada2a592e484d92648c274a44852be5ad
Author: Kai-Martin Knaak <kn...@iq...>
Commit: Felix Ruoff <Fe...@po...>
add options.texi to gitignore
The file doc/options.texi is produced by a script at compile time.
So git should not take care for it.
Affects-bug: lp-879086
diff --git a/doc/.gitignore b/doc/.gitignore
index b209eb4..577aeac 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -47,3 +47,4 @@ gcode_control_img.pdf
gcode_control_img.png
gcode_tool_path.pdf
gcode_tool_path.png
+options.texi
commit 2ef38a6d4c9b710d7c32acd30766e3957a836853
Author: Kai-Martin Knaak <kn...@iq...>
Commit: Felix Ruoff <Fe...@po...>
add gcode related files to gitignore
The files
doc/gcode.pdf
doc/gcode.png
doc/gcode_control_img.pdf
doc/gcode_control_img.png
doc/gcode_tool_path.pdf
doc/gcode_tool_path.png
are produced at compile time. So git should not care for them.
Affects-bug: lp-879086
diff --git a/doc/.gitignore b/doc/.gitignore
index 74eaad7..b209eb4 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -41,3 +41,9 @@ fractional_size.texi
letter_size.texi
metric_size.texi
wire_size.texi
+gcode.pdf
+gcode.png
+gcode_control_img.pdf
+gcode_control_img.png
+gcode_tool_path.pdf
+gcode_tool_path.png
|
|
From: <gi...@gp...> - 2011-10-23 19:22:55
|
The branch, master has been updated
via 2fb3523ddbb232ea378e55d51a463414b9f4a11d (commit)
via 12f31f0da3cc1e00a5b8f86938ffcb8274deb77d (commit)
from b90b5b507fc9624b217908003548131396cfba86 (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/file.c | 2 +-
src/pcb-printf.c | 2 --
src/pcb-printf.h | 2 +-
3 files changed, 2 insertions(+), 4 deletions(-)
=================
Commit Messages
=================
commit 2fb3523ddbb232ea378e55d51a463414b9f4a11d
Author: Andrew Poelstra (local) <apo...@wp...>
Commit: Andrew Poelstra (local) <apo...@wp...>
Bump PCB_FILE_VERSION_BASELINE up to 20091103.
The unit-parsing support that we now require from the pcb parser
was added by DJ in December 2008. So I am bumping up the output
version in file.c to the next release, 20091103.
:100644 100644 c22f5c5... 99ba274... M src/file.c
commit 12f31f0da3cc1e00a5b8f86938ffcb8274deb77d
Author: Andrew Poelstra (local) <apo...@wp...>
Commit: Andrew Poelstra (local) <apo...@wp...>
Make pcb-printf output unit suffixes with %mr spec
This marks a change in the file format, but as we only use
the mm and mil suffixes (for now, anyway), it should not be
a breaking one.
I did not update the file format version that is output.
:100644 100644 20d5c9e... c57a570... M src/pcb-printf.c
:100644 100644 453b6ef... cbd9bbd... M src/pcb-printf.h
=========
Changes
=========
commit 2fb3523ddbb232ea378e55d51a463414b9f4a11d
Author: Andrew Poelstra (local) <apo...@wp...>
Commit: Andrew Poelstra (local) <apo...@wp...>
Bump PCB_FILE_VERSION_BASELINE up to 20091103.
The unit-parsing support that we now require from the pcb parser
was added by DJ in December 2008. So I am bumping up the output
version in file.c to the next release, 20091103.
diff --git a/src/file.c b/src/file.c
index c22f5c5..99ba274 100644
--- a/src/file.c
+++ b/src/file.c
@@ -160,7 +160,7 @@ static char *pcb_basename (char *p);
/* Hole[] in Polygon. */
#define PCB_FILE_VERSION_HOLES 20100606
/* First version ever saved. */
-#define PCB_FILE_VERSION_BASELINE 20070407
+#define PCB_FILE_VERSION_BASELINE 20091103
int
PCBFileVersionNeeded (void)
commit 12f31f0da3cc1e00a5b8f86938ffcb8274deb77d
Author: Andrew Poelstra (local) <apo...@wp...>
Commit: Andrew Poelstra (local) <apo...@wp...>
Make pcb-printf output unit suffixes with %mr spec
This marks a change in the file format, but as we only use
the mm and mil suffixes (for now, anyway), it should not be
a breaking one.
I did not update the file format version that is output.
diff --git a/src/pcb-printf.c b/src/pcb-printf.c
index 20d5c9e..c57a570 100644
--- a/src/pcb-printf.c
+++ b/src/pcb-printf.c
@@ -412,9 +412,7 @@ static gchar *CoordsToString(Coord coord[], int n_coords, const char *printf_spe
g_string_append_printf (buff, " %s", suffix);
break;
case FILE_MODE:
-#if 0
g_string_append_printf (buff, "%s", suffix);
-#endif
break;
}
}
diff --git a/src/pcb-printf.h b/src/pcb-printf.h
index 453b6ef..cbd9bbd 100644
--- a/src/pcb-printf.h
+++ b/src/pcb-printf.h
@@ -89,7 +89,7 @@ enum e_allow {
ALLOW_M | ALLOW_KM | ALLOW_CMIL |
ALLOW_MIL | ALLOW_IN,
#else
- ALLOW_READABLE = ALLOW_CMIL,
+ ALLOW_READABLE = ALLOW_MIL | ALLOW_MM,
#endif
ALLOW_ALL = ~0
|
|
From: <gi...@gp...> - 2011-10-16 19:48:19
|
The branch, master has been updated
via b90b5b507fc9624b217908003548131396cfba86 (commit)
from 5b3495f138e8866941dd334d57710d043e9e19ba (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.in | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)
=================
Commit Messages
=================
commit b90b5b507fc9624b217908003548131396cfba86
Author: Felix Ruoff <Fe...@po...>
Commit: Felix Ruoff <Fe...@po...>
hid/gtk: Remove double 'Remove Connected' menu-item
:100644 100644 7dee9b9... 6e00440... M src/gpcb-menu.res.in
=========
Changes
=========
commit b90b5b507fc9624b217908003548131396cfba86
Author: Felix Ruoff <Fe...@po...>
Commit: Felix Ruoff <Fe...@po...>
hid/gtk: Remove double 'Remove Connected' menu-item
diff --git a/src/gpcb-menu.res.in b/src/gpcb-menu.res.in
index 7dee9b9..6e00440 100644
--- a/src/gpcb-menu.res.in
+++ b/src/gpcb-menu.res.in
@@ -393,23 +393,6 @@ MainMenu =
Unselect(All)
Atomic(Block)
}
- {"Remove Connected"
- Atomic(Save)
- Connection(Reset)
- Atomic(Restore)
- Unselect(All)
- Atomic(Restore)
- Connection(Find)
- Atomic(Restore)
- Select(Connection)
- Atomic(Restore)
- RemoveSelected()
- Atomic(Restore)
- Connection(Reset)
- Atomic(Restore)
- Unselect(All)
- Atomic(Block)
- }
{"Set Same" a={"A" "<Key>a"} SetSame()}
{"Flip Object" a={"B" "<Key>b"} Flip(Object)}
{"Find Connections" a={"F" "<Key>f"} Connection(Reset) Connection(Find)}
|
|
From: <gi...@gp...> - 2011-10-16 19:41:51
|
The branch, master has been updated
via 5b3495f138e8866941dd334d57710d043e9e19ba (commit)
via 4619ad788b84039721553a974e4032ff6b850f4a (commit)
from f896e7ab766bc8754c8a2f9c28da7d78944b26b6 (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-config.c | 32 ++++++++++++++++----------------
src/hid/gtk/gui-misc.c | 2 +-
2 files changed, 17 insertions(+), 17 deletions(-)
=================
Commit Messages
=================
commit 5b3495f138e8866941dd334d57710d043e9e19ba
Author: Kai-Martin Knaak <km...@li...>
Commit: Felix Ruoff <Fe...@po...>
top-bottom-in-preference-dialog-of-GTK-HID
This patch replaces "component" and "solder" in the preference dialog of
GTK HID with "top" and "bottom". Incindences were in the layer group
tab and in the text of the info tab.
:100644 100644 7b2751a... 2a4fcd8... M src/hid/gtk/gui-config.c
commit 4619ad788b84039721553a974e4032ff6b850f4a
Author: Kai-Martin Knaak <km...@li...>
Commit: Felix Ruoff <Fe...@po...>
top/bottom in status line of GTK-HID
This patch replaces "component" and "solder" in the leftmost item of the
status line of the GTK HID with "top" and "bottom".
:100644 100644 0f8daf7... e84b276... M src/hid/gtk/gui-misc.c
=========
Changes
=========
commit 5b3495f138e8866941dd334d57710d043e9e19ba
Author: Kai-Martin Knaak <km...@li...>
Commit: Felix Ruoff <Fe...@po...>
top-bottom-in-preference-dialog-of-GTK-HID
This patch replaces "component" and "solder" in the preference dialog of
GTK HID with "top" and "bottom". Incindences were in the layer group
tab and in the text of the info tab.
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index 7b2751a..2a4fcd8 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -1257,7 +1257,7 @@ static gboolean groups_modified, groups_holdoff, layers_applying;
static gchar *layer_info_text[] = {
N_("<h>Layer Names\n"),
N_("You may enter layer names for the layers drawn on the screen.\n"
- "The special 'component side' and 'solder side' are layers which\n"
+ "The special 'top side' and 'bottom side' are layers which\n"
"will be printed out, so they must have in their group at least one\n"
"of the other layers that are drawn on the screen.\n"),
"\n",
@@ -1271,7 +1271,7 @@ static gchar *layer_info_text[] = {
"\n",
N_("For example, for a 4 layer board a useful layer group arrangement\n"
"can be to have 3 screen displayed layers grouped into the same group\n"
- "as the 'component side' and 'solder side' printout layers. Then\n"
+ "as the 'top side' and 'bottom side' printout layers. Then\n"
"groups such as signals, ground, and supply traces can be color\n"
"coded on the screen while printing as a single layer. For this\n"
"you would select buttons and enter names on the Setup page to\n"
@@ -1279,23 +1279,23 @@ static gchar *layer_info_text[] = {
"\n",
N_("<b>Group 1:"),
"\n\t",
- N_("solder"),
+ N_("top"),
"\n\t",
- N_("GND-solder"),
+ N_("GND-top"),
"\n\t",
- N_("Vcc-solder"),
+ N_("Vcc-top"),
"\n\t",
- N_("solder side"),
+ N_("top side"),
"\n",
N_("<b>Group 2:"),
"\n\t",
- N_("component"),
+ N_("bottom"),
"\n\t",
- N_("GND-component"),
+ N_("GND-bottom"),
"\n\t",
- N_("Vcc-component"),
+ N_("Vcc-bottom"),
"\n\t",
- N_("component side"),
+ N_("bottom side"),
"\n",
N_("<b>Group 3:"),
"\n\t",
@@ -1410,21 +1410,21 @@ config_layers_apply (void)
}
/* do some cross-checking
- | solder-side and component-side must be in different groups
- | solder-side and component-side must not be the only one in the group
+ | top-side and bottom-side must be in different groups
+ | top-side and bottom-side must not be the only one in the group
*/
if (layer_groups.Number[soldergroup] <= 1
|| layer_groups.Number[componentgroup] <= 1)
{
Message (_
- ("Both 'solder side' or 'component side' layers must have at least\n"
+ ("Both, 'top side' and 'bottom side' layer must have at least\n"
"\tone other layer in their group.\n"));
return;
}
else if (soldergroup == componentgroup)
{
Message (_
- ("The 'solder side' and 'component side' layers are not allowed\n"
+ ("The 'top side' and 'bottom side' layers are not allowed\n"
"\tto be in the same layer group #\n"));
return;
}
@@ -1535,9 +1535,9 @@ ghid_config_groups_changed(void)
for (layer = 0; layer < max_copper_layer + 2; ++layer)
{
if (layer == component_silk_layer)
- name = _("component side");
+ name = _("top side");
else if (layer == solder_silk_layer)
- name = _("solder side");
+ name = _("bottom side");
else
name = (gchar *) UNKNOWN (PCB->Data->Layer[layer].Name);
commit 4619ad788b84039721553a974e4032ff6b850f4a
Author: Kai-Martin Knaak <km...@li...>
Commit: Felix Ruoff <Fe...@po...>
top/bottom in status line of GTK-HID
This patch replaces "component" and "solder" in the leftmost item of the
status line of the GTK HID with "top" and "bottom".
diff --git a/src/hid/gtk/gui-misc.c b/src/hid/gtk/gui-misc.c
index 0f8daf7..e84b276 100644
--- a/src/hid/gtk/gui-misc.c
+++ b/src/hid/gtk/gui-misc.c
@@ -413,7 +413,7 @@ ghid_set_status_line_label (void)
"<b>text</b>=%i%% "
"<b>buffer</b>=#%i"),
Settings.grid_unit->allow,
- Settings.ShowSolderSide ? _("solder") : _("component"),
+ Settings.ShowSolderSide ? _("bottom") : _("top"),
PCB->Grid,
flag, TEST_FLAG (RUBBERBANDFLAG, PCB) ? ",R " : " ",
Settings.LineThickness,
|
|
From: <gi...@gp...> - 2011-10-11 21:33:45
|
The branch, master has been updated
via f896e7ab766bc8754c8a2f9c28da7d78944b26b6 (commit)
from 3108a3ffe3dad4cc50372b672ed668a739bbddf5 (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.in | 7 +++++++
src/hid/common/hid_resource.c | 4 ++++
2 files changed, 11 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit f896e7ab766bc8754c8a2f9c28da7d78944b26b6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Add support for mice / touchpads with a left/right scroll-wheel
Tested-by: Dave McGuire <mc...@ne...>
:100644 100644 7e63811... 7dee9b9... M src/gpcb-menu.res.in
:100644 100644 842a058... a98dc46... M src/hid/common/hid_resource.c
=========
Changes
=========
commit f896e7ab766bc8754c8a2f9c28da7d78944b26b6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Add support for mice / touchpads with a left/right scroll-wheel
Tested-by: Dave McGuire <mc...@ne...>
diff --git a/src/gpcb-menu.res.in b/src/gpcb-menu.res.in
index 7e63811..7dee9b9 100644
--- a/src/gpcb-menu.res.in
+++ b/src/gpcb-menu.res.in
@@ -37,6 +37,13 @@ Mouse =
# If you want zoom to center, do this instead.
#Up = { {Zoom(0.8) Center()} }
#Down = { {Zoom(1.25) Center()} }
+
+ scroll-left = {
+ Scroll(left)
+ }
+ scroll-right = {
+ Scroll(right)
+ }
}
MainMenu =
diff --git a/src/hid/common/hid_resource.c b/src/hid/common/hid_resource.c
index 842a058..a98dc46 100644
--- a/src/hid/common/hid_resource.c
+++ b/src/hid/common/hid_resource.c
@@ -71,6 +71,10 @@ button_name_to_num (const char *name)
return 4;
else if (strcasecmp (name, "down") == 0)
return 5;
+ else if (strcasecmp (name, "scroll-left") == 0)
+ return 6;
+ else if (strcasecmp (name, "scroll-right") == 0)
+ return 7;
else
return atoi (name);
}
|
|
From: <gi...@gp...> - 2011-10-05 22:08:54
|
The branch, master has been updated
via 3108a3ffe3dad4cc50372b672ed668a739bbddf5 (commit)
from 8301b4dbd5fec500c7e4ec59eba1a8a397e1d8e1 (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
=========
globalconst.h | 2 +
src/const.h | 1 +
src/crosshair.c | 6 +++-
src/global.h | 2 +
src/misc.c | 6 +++++
src/move.h | 2 +
src/rotate.c | 2 +
src/search.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 79 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 3108a3ffe3dad4cc50372b672ed668a739bbddf5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Add snapping to arc end-points
:100755 100755 e8966ff... afba0d4... M globalconst.h
:100644 100644 f029821... 078f83f... M src/const.h
:100644 100644 d927cf8... b7bebec... M src/crosshair.c
:100644 100644 96c9cc9... 9f0390b... M src/global.h
:100644 100644 a2a678e... 3cc04a0... M src/misc.c
:100644 100644 e617eca... 3daec3d... M src/move.h
:100644 100644 11b8fd9... 1763406... M src/rotate.c
:100644 100644 60e8dde... 5d02a53... M src/search.c
=========
Changes
=========
commit 3108a3ffe3dad4cc50372b672ed668a739bbddf5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Add snapping to arc end-points
diff --git a/globalconst.h b/globalconst.h
index e8966ff..afba0d4 100755
--- a/globalconst.h
+++ b/globalconst.h
@@ -123,6 +123,8 @@
/* line points */
#define MAX_POLYGON_POINT_DISTANCE 0 /* maximum distance when searching */
/* polygon points */
+#define MAX_ARC_POINT_DISTANCE 0 /* maximum distance when searching */
+ /* arc points */
#define MAX_ELEMENTNAMES 3 /* number of supported names of */
/* an element */
#define MAX_LIBRARY_LINE_LENGTH 255 /* maximum line length in the */
diff --git a/src/const.h b/src/const.h
index f029821..078f83f 100644
--- a/src/const.h
+++ b/src/const.h
@@ -320,6 +320,7 @@ When set, element names are not drawn.
#define LOCKED_TYPE 0x10000 /* used to tell search to include locked items. */
#define NET_TYPE 0x20000 /* used to select whole net. */
+#define ARCPOINT_TYPE 0x40000
#define PIN_TYPES (VIA_TYPE | PIN_TYPE)
#define LOCK_TYPES (VIA_TYPE | LINE_TYPE | ARC_TYPE | POLYGON_TYPE | ELEMENT_TYPE \
diff --git a/src/crosshair.c b/src/crosshair.c
index d927cf8..b7bebec 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -1069,7 +1069,8 @@ FitCrosshairIntoGrid (Coord X, Coord Y)
ans = NO_TYPE;
if (TEST_FLAG (SNAPPINFLAG, PCB))
ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
- LINEPOINT_TYPE, &ptr1, &ptr2, &ptr3);
+ LINEPOINT_TYPE | ARCPOINT_TYPE,
+ &ptr1, &ptr2, &ptr3);
if (ans != NO_TYPE)
{
@@ -1099,7 +1100,8 @@ FitCrosshairIntoGrid (Coord X, Coord Y)
if (Settings.Mode == ARROW_MODE)
{
ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
- LINEPOINT_TYPE, &ptr1, &ptr2, &ptr3);
+ LINEPOINT_TYPE | ARCPOINT_TYPE,
+ &ptr1, &ptr2, &ptr3);
if (ans == NO_TYPE)
hid_action("PointCursor");
else if (!TEST_FLAG(SELECTEDFLAG, (LineType *)ptr2))
diff --git a/src/global.h b/src/global.h
index 96c9cc9..9f0390b 100644
--- a/src/global.h
+++ b/src/global.h
@@ -284,6 +284,8 @@ typedef struct /* holds information about arcs */
{
ANYOBJECTFIELDS;
Coord Thickness, Clearance;
+ PointType Point1;
+ PointType Point2;
Coord Width, Height, /* length of axis */
X, Y; /* center coordinates */
Angle StartAngle, Delta; /* the two limiting angles in degrees */
diff --git a/src/misc.c b/src/misc.c
index a2a678e..3cc04a0 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1529,6 +1529,12 @@ SetArcBoundingBox (ArcTypePtr Arc)
Arc->BoundingBox.Y1 -= width;
Arc->BoundingBox.Y2 += width;
close_box(&Arc->BoundingBox);
+
+ /* Update the arc end-points */
+ Arc->Point1.X = Arc->X - (double)Arc->Width * ca1;
+ Arc->Point1.Y = Arc->Y + (double)Arc->Height * sa1;
+ Arc->Point2.X = Arc->X - (double)Arc->Width * ca2;
+ Arc->Point2.Y = Arc->Y + (double)Arc->Height * sa2;
}
/* ---------------------------------------------------------------------------
diff --git a/src/move.h b/src/move.h
index e617eca..3daec3d 100644
--- a/src/move.h
+++ b/src/move.h
@@ -61,6 +61,8 @@
{ \
MOVE((a)->X,(a)->Y,(dx),(dy)) \
MOVE_BOX_LOWLEVEL(&((a)->BoundingBox),(dx),(dy)); \
+ MOVE((a)->Point1.X,(a)->Point1.Y,(dx),(dy)) \
+ MOVE((a)->Point2.X,(a)->Point2.Y,(dx),(dy)) \
}
/* Rather than mode the line bounding box, we set it so the point bounding
* boxes are updated too.
diff --git a/src/rotate.c b/src/rotate.c
index 11b8fd9..1763406 100644
--- a/src/rotate.c
+++ b/src/rotate.c
@@ -204,6 +204,8 @@ RotateArcLowLevel (ArcTypePtr Arc, Coord X, Coord Y, unsigned Number)
Arc->Height = save;
}
RotateBoxLowLevel (&Arc->BoundingBox, X, Y, Number);
+ ROTATE (Arc->Point1.X, Arc->Point1.Y, X, Y, Number);
+ ROTATE (Arc->Point2.X, Arc->Point2.Y, X, Y, Number);
}
/* ---------------------------------------------------------------------------
diff --git a/src/search.c b/src/search.c
index 60e8dde..5d02a53 100644
--- a/src/search.c
+++ b/src/search.c
@@ -322,6 +322,8 @@ SearchRatLineByLocation (int locked, RatTypePtr * Line, RatTypePtr * Dummy1,
struct arc_info
{
ArcTypePtr *Arc, *Dummy;
+ PointTypePtr *Point;
+ double least;
jmp_buf env;
int locked;
};
@@ -496,6 +498,56 @@ SearchLinePointByLocation (int locked, LayerTypePtr * Layer,
return false;
}
+static int
+arcpoint_callback (const BoxType * b, void *cl)
+{
+ ArcTypePtr arc = (ArcTypePtr) b;
+ struct arc_info *i = (struct arc_info *) cl;
+ int ret_val = 0;
+ double d;
+
+ if (TEST_FLAG (i->locked, arc))
+ return 0;
+
+ d = Distance (PosX, PosY, arc->Point1.X, arc->Point1.Y);
+ if (d < i->least)
+ {
+ i->least = d;
+ *i->Arc = arc;
+ *i->Point = &arc->Point1;
+ ret_val = 1;
+ }
+
+ d = Distance (PosX, PosY, arc->Point2.X, arc->Point2.Y);
+ if (d < i->least)
+ {
+ i->least = d;
+ *i->Arc = arc;
+ *i->Point = &arc->Point2;
+ ret_val = 1;
+ }
+ return ret_val;
+}
+
+/* ---------------------------------------------------------------------------
+ * searches an arc-point on all the search layer
+ */
+static bool
+SearchArcPointByLocation (int locked, LayerType **Layer,
+ ArcType **arc, PointType **Point)
+{
+ struct arc_info info;
+ *Layer = SearchLayer;
+ info.Arc = arc;
+ info.Point = Point;
+ *Point = NULL;
+ info.least = MAX_ARC_POINT_DISTANCE + SearchRadius;
+ info.locked = (locked & LOCKED_TYPE) ? 0 : LOCKFLAG;
+ if (r_search
+ (SearchLayer->arc_tree, &SearchBox, NULL, arcpoint_callback, &info))
+ return true;
+ return false;
+}
/* ---------------------------------------------------------------------------
* searches a polygon-point on all layers that are switched on
* in layerstack order
@@ -1215,6 +1267,14 @@ SearchObjectByLocation (unsigned Type,
(LineTypePtr *) Result3))
return (LINE_TYPE);
+ if ((HigherAvail & (PIN_TYPE | PAD_TYPE)) == 0 &&
+ Type & ARCPOINT_TYPE &&
+ SearchArcPointByLocation (locked,
+ (LayerTypePtr *) Result1,
+ (ArcTypePtr *) Result2,
+ (PointTypePtr *) Result3))
+ return (ARCPOINT_TYPE);
+
if ((HigherAvail & (PIN_TYPE | PAD_TYPE)) == 0 && Type & ARC_TYPE &&
SearchArcByLocation (locked,
(LayerTypePtr *) Result1,
|
|
From: <gi...@gp...> - 2011-10-03 22:12:39
|
The branch, master has been updated
via 8301b4dbd5fec500c7e4ec59eba1a8a397e1d8e1 (commit)
from d2288a4491f5f6b592cd5a57835e178c08e72e10 (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/gtkhid-gdk.c | 8 ++++++++
src/hid/gtk/gtkhid-gl.c | 8 ++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 8301b4dbd5fec500c7e4ec59eba1a8a397e1d8e1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix pinout preview rendering for back-side elements
NB: There are still some bugs, in that when the board view is flipped,
this doesn't currently trigger a repaint of any preview widgets which
are open. They will refresh with the updated coordinate system when
they are next repainted. (Which might requre a resize of the window on
a compositing window manager).
Ideally we would track the correct view with the preview widget, but for
now this is a simple fix.
:100644 100644 963b5d4... 9f4250d... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 069380e... d372f8a... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit 8301b4dbd5fec500c7e4ec59eba1a8a397e1d8e1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix pinout preview rendering for back-side elements
NB: There are still some bugs, in that when the board view is flipped,
this doesn't currently trigger a repaint of any preview widgets which
are open. They will refresh with the updated coordinate system when
they are next repainted. (Which might requre a resize of the window on
a compositing window manager).
Ideally we would track the correct view with the preview widget, but for
now this is a simple fix.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 963b5d4..9f4250d 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -1128,6 +1128,8 @@ ghid_pinout_preview_expose (GtkWidget *widget,
GtkAllocation allocation;
view_data save_view;
int save_width, save_height;
+ Coord save_max_width;
+ Coord save_max_height;
double xz, yz;
render_priv *priv = gport->render_priv;
@@ -1137,6 +1139,8 @@ ghid_pinout_preview_expose (GtkWidget *widget,
save_view = gport->view;
save_width = gport->width;
save_height = gport->height;
+ save_max_width = PCB->MaxWidth;
+ save_max_height = PCB->MaxHeight;
gtk_widget_get_allocation (widget, &allocation);
xz = (double) pinout->x_max / allocation.width;
@@ -1153,6 +1157,8 @@ ghid_pinout_preview_expose (GtkWidget *widget,
gport->view.height = allocation.height * gport->view.coord_per_px;
gport->view.x0 = (pinout->x_max - gport->view.width) / 2;
gport->view.y0 = (pinout->y_max - gport->view.height) / 2;
+ PCB->MaxWidth = pinout->x_max;
+ PCB->MaxHeight = pinout->y_max;
/* clear background */
gdk_draw_rectangle (window, priv->bg_gc, TRUE,
@@ -1165,6 +1171,8 @@ ghid_pinout_preview_expose (GtkWidget *widget,
gport->view = save_view;
gport->width = save_width;
gport->height = save_height;
+ PCB->MaxWidth = save_max_width;
+ PCB->MaxHeight = save_max_height;
return FALSE;
}
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 069380e..d372f8a 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -992,11 +992,15 @@ ghid_pinout_preview_expose (GtkWidget *widget,
GtkAllocation allocation;
view_data save_view;
int save_width, save_height;
+ Coord save_max_width;
+ Coord save_max_height;
double xz, yz;
save_view = gport->view;
save_width = gport->width;
save_height = gport->height;
+ save_max_width = PCB->MaxWidth;
+ save_max_height = PCB->MaxHeight;
/* Setup zoom factor for drawing routines */
@@ -1014,6 +1018,8 @@ ghid_pinout_preview_expose (GtkWidget *widget,
gport->view.height = allocation.height * gport->view.coord_per_px;
gport->view.x0 = (pinout->x_max - gport->view.width) / 2;
gport->view.y0 = (pinout->y_max - gport->view.height) / 2;
+ PCB->MaxWidth = pinout->x_max;
+ PCB->MaxHeight = pinout->y_max;
/* make GL-context "current" */
if (!gdk_gl_drawable_gl_begin (pGlDrawable, pGlContext)) {
@@ -1076,6 +1082,8 @@ ghid_pinout_preview_expose (GtkWidget *widget,
gport->view = save_view;
gport->width = save_width;
gport->height = save_height;
+ PCB->MaxWidth = save_max_width;
+ PCB->MaxHeight = save_max_height;
return FALSE;
}
|
|
From: <gi...@gp...> - 2011-10-01 18:22:07
|
The branch, master has been updated
via d2288a4491f5f6b592cd5a57835e178c08e72e10 (commit)
via 445c76b23bbe3c04c5eea6801169862803ff01c7 (commit)
via 05686e3bdb2d81d414386a1a97cc566d5c66a8de (commit)
via f231ddf4ebb4709c7e911f85bb9242f780e313d4 (commit)
via f10bed446e6052a4876ed11619bd4860f71c2aeb (commit)
via 570bb6cb0017ed5fbe4068ce2037568b06857265 (commit)
via 9aa2725edcc0ceb6c1c3a602cc4e0adfc83f3737 (commit)
via f4afb96a8b3fba437164c70855d635226ff8fd58 (commit)
via 657e9a7fe077a659f4017984bb7a63184382b229 (commit)
via dcfd8bd1b26d91ef3a001f00faa0ff915a3e18c6 (commit)
via cf69668a784b2ed11d033a0accc96403cf1a01b0 (commit)
via cb4bd2d1a21c042aaa89343acf96b52290bc2cd3 (commit)
via 1a6a473a21f150139a383b6fa39e8865ceb5f02d (commit)
via 421c487a1adc5f93a5d1ef2b7a0085750b161b0a (commit)
via e873882e2465a74ef2c1b9cab54ed12dc170856e (commit)
via 592a836a66f7ebdef6d72b1f79c21ddb5289a26e (commit)
via c4ffceda456e150f036c05c28ddf15d9782eacdd (commit)
via 6027180567c13bb4d3ad1000ed8c966c5d8c7a55 (commit)
via ccc611da9065af30552e0774709584f49a4eba6c (commit)
via e0c189a781e127c750243dbb4172d4778a6850fd (commit)
via 296506b9a68ec4fcf01e455cd1734772adcf154e (commit)
via 02f0d48542c2d322c377ab3f353667cbcb81928c (commit)
from ade3ba088e79f52dc9e44fb529276e14b3f08d62 (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/toporouter.c | 679 +++++++++++++++---------------------------------------
src/toporouter.h | 6 +-
2 files changed, 185 insertions(+), 500 deletions(-)
=================
Commit Messages
=================
commit d2288a4491f5f6b592cd5a57835e178c08e72e10
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Convert some debugging constants to COORD units properly
(Broken since we switched to nanometers)
:100644 100644 7e58cae... d31c788... M src/toporouter.c
commit 445c76b23bbe3c04c5eea6801169862803ff01c7
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Fix print of time taken by the toporouter
The old code conflated microseconds, milliseconds and was generally nuts.
:100644 100644 226a70b... 7e58cae... M src/toporouter.c
commit 05686e3bdb2d81d414386a1a97cc566d5c66a8de
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused, commented print_trace() function
:100644 100644 80fe5e2... 226a70b... M src/toporouter.c
commit f231ddf4ebb4709c7e911f85bb9242f780e313d4
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused (toporouter_t *)->stublength
:100644 100644 d3ebd4e... 80fe5e2... M src/toporouter.c
:100644 100644 667aeeb... f014332... M src/toporouter.h
commit f10bed446e6052a4876ed11619bd4860f71c2aeb
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused (toporouter_t *)->viamax
:100644 100644 a440fa1... d3ebd4e... M src/toporouter.c
:100644 100644 43b2824... 667aeeb... M src/toporouter.h
commit 570bb6cb0017ed5fbe4068ce2037568b06857265
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused (toporouter_t *)->serpintine_half_amplitude
:100644 100644 9627562... a440fa1... M src/toporouter.c
:100644 100644 9e8a67d... 43b2824... M src/toporouter.h
commit 9aa2725edcc0ceb6c1c3a602cc4e0adfc83f3737
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Re-write {coord,point}_intersect_prop() to increase clariry.
Since the wind_* values computed in this function can be -1, 0 or 1,
it is clearer to test them using equality relations, not perform XOR
operations on their bit-patterns.
I believe the old code worked, but it would return an strange constant
for "true". To ram the point home, I've changed the function to return
bool.
:100644 100644 ac9d2e7... 9627562... M src/toporouter.c
commit f4afb96a8b3fba437164c70855d635226ff8fd58
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove commented tvertex_intersect() function
The implementation being used is a macro in toporouter.h
:100644 100644 bc2025e... ac9d2e7... M src/toporouter.c
commit 657e9a7fe077a659f4017984bb7a63184382b229
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused function tvertex_intersect_prop()
:100644 100644 9b3d548... bc2025e... M src/toporouter.c
commit dcfd8bd1b26d91ef3a001f00faa0ff915a3e18c6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Re-arrange the maths in {vertices,coords}_on_line()
Should given an identical result, but with a couple fewer operations.
:100644 100644 dd028d5... 9b3d548... M src/toporouter.c
commit cf69668a784b2ed11d033a0accc96403cf1a01b0
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused function points_on_line()
:100644 100644 2ce5175... dd028d5... M src/toporouter.c
commit cb4bd2d1a21c042aaa89343acf96b52290bc2cd3
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused wind_double() function
:100644 100644 000da7b... 2ce5175... M src/toporouter.c
commit 1a6a473a21f150139a383b6fa39e8865ceb5f02d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused sloppy_.*wind() functions
:100644 100644 609a53d... 000da7b... M src/toporouter.c
commit 421c487a1adc5f93a5d1ef2b7a0085750b161b0a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter: Re-implement functions using atan with atan2
Simplifies and condenses the code a lot.
:100644 100644 c186d4a... 609a53d... M src/toporouter.c
commit e873882e2465a74ef2c1b9cab54ed12dc170856e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Replace coord_xangle() with coord_angle()
The new function returning the "normal" coordinate system angle one would
expect. Replace usage of coord_xangle() in export_pcb_drawarc() with the
new function.
PCB's arc angles are a bit nutty, so lets try to contain that strangeness
to the arc exporting routine!
:100644 100644 ab1338c... c186d4a... M src/toporouter.c
commit 592a836a66f7ebdef6d72b1f79c21ddb5289a26e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused point_xangle() function
(Unused since the previous commit)
:100644 100644 51c8de6... ab1338c... M src/toporouter.c
commit c4ffceda456e150f036c05c28ddf15d9782eacdd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused region_span() function
:100644 100644 7fdd79d... 51c8de6... M src/toporouter.c
commit 6027180567c13bb4d3ad1000ed8c966c5d8c7a55
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter: Remove unused vertex_move_towards_point[_values]() functions
:100644 100644 fecc4d5... 7fdd79d... M src/toporouter.c
commit ccc611da9065af30552e0774709584f49a4eba6c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Fix constants which assumed CMIL for PCB's internal units
This should make the toporouter work again.
:100644 100644 73e3990... fecc4d5... M src/toporouter.c
commit e0c189a781e127c750243dbb4172d4778a6850fd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Fixup and clean read_board_constraints() and create_board_edge()
Introduce a #defined constant which expresses how fine to break the board
edges into (the old hard-coded constant was broken since we changed to
nanometers).
:100644 100644 734c733... 73e3990... M src/toporouter.c
commit 296506b9a68ec4fcf01e455cd1734772adcf154e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporoute.c: Remove runtime Copyright message from toporouter
Not only is Anthony now not the only author of this code, we don't do
this for anything else.. why should we for this. It could potentially act
to discorage others from working on this code, and we don't want that.
:100644 100644 bff1e7a... 734c733... M src/toporouter.c
commit 02f0d48542c2d322c377ab3f353667cbcb81928c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.[ch]: Add generic "contributors" copyright notice
"Copyright (C) 2009-2011 PCB Contibrutors (See ChangeLog for details)"
:100644 100644 e5310b0... bff1e7a... M src/toporouter.c
:100644 100644 fcd0053... 9e8a67d... M src/toporouter.h
=========
Changes
=========
commit d2288a4491f5f6b592cd5a57835e178c08e72e10
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Convert some debugging constants to COORD units properly
(Broken since we switched to nanometers)
diff --git a/src/toporouter.c b/src/toporouter.c
index 7e58cae..d31c788 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -6462,8 +6462,11 @@ oproute_rubberband(toporouter_t *r, GList *path)
oproute_path_speccut(oproute);
#ifdef DEBUG_RUBBERBAND
- if(!strcmp(oproute->netlist, " VCC3V3") && vx(oproute->term1) == 95700. && vy(oproute->term1) == 70800. &&
- vx(oproute->term2) == 196700. && vy(oproute->term2) == 67300.)
+ if(strcmp(oproute->netlist, " VCC3V3" == 0) &&
+ vx(oproute->term1) == MIL_TO_COORD (957.) &&
+ vy(oproute->term1) == MIL_TO_COORD (708.) &&
+ vx(oproute->term2) == MIL_TO_COORD (1967.) &&
+ vy(oproute->term2) == MIL_TO_COORD (673.))
{
// printf("OPROUTE %s - %f,%f %f,%f\n", oproute->netlist, vx(oproute->term1), vy(oproute->term1), vx(oproute->term2), vy(oproute->term2));
// print_path(path);
commit 445c76b23bbe3c04c5eea6801169862803ff01c7
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Fix print of time taken by the toporouter
The old code conflated microseconds, milliseconds and was generally nuts.
diff --git a/src/toporouter.c b/src/toporouter.c
index 226a70b..7e58cae 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1106,26 +1106,19 @@ groupcount(void)
void
toporouter_free(toporouter_t *r)
{
- struct timeval endtime;
- int secs, usecs;
+ struct timeval endtime;
+ double time_delta;
int i;
for(i=0;i<groupcount();i++) {
toporouter_layer_free(&r->layers[i]);
}
+ gettimeofday (&endtime, NULL);
+ time_delta = endtime.tv_sec - r->starttime.tv_sec +
+ (endtime.tv_usec - r->starttime.tv_usec) / 1000000.;
- gettimeofday(&endtime, NULL);
-
- secs = (int)(endtime.tv_sec - r->starttime.tv_sec);
- usecs = (int)((endtime.tv_usec - r->starttime.tv_usec) / 1000);
-
- if(usecs < 0) {
- secs -= 1;
- usecs += 1000;
- }
-
- Message(_("Elapsed time: %d.%02d seconds\n"), secs, usecs);
+ Message(_("Elapsed time: %.2f seconds\n"), time_delta);
free(r->layers);
free(r);
commit 05686e3bdb2d81d414386a1a97cc566d5c66a8de
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused, commented print_trace() function
diff --git a/src/toporouter.c b/src/toporouter.c
index 80fe5e2..226a70b 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -703,26 +703,6 @@ vertex_net_keepaway(toporouter_vertex_t *v)
if(!box || !box->cluster) return Settings.Keepaway;
return cluster_keepaway(box->cluster);
}
-/*
-void
-print_trace (void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- printf ("Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- printf ("%s\n", strings[i]);
-
- free (strings);
-}
-*/
/* fills in x and y with coordinates of point from a towards b of distance d */
static void
commit f231ddf4ebb4709c7e911f85bb9242f780e313d4
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused (toporouter_t *)->stublength
diff --git a/src/toporouter.c b/src/toporouter.c
index d3ebd4e..80fe5e2 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -7577,7 +7577,6 @@ toporouter_new(void)
r->layers = NULL;
r->flags = 0;
r->viacost = VIA_COST_AS_DISTANCE;
- r->stublength = 300.;
r->wiring_score = 0.;
diff --git a/src/toporouter.h b/src/toporouter.h
index 667aeeb..f014332 100644
--- a/src/toporouter.h
+++ b/src/toporouter.h
@@ -420,7 +420,6 @@ struct _toporouter_t {
/* settings: */
gdouble viacost;
- gdouble stublength;
gdouble wiring_score;
commit f10bed446e6052a4876ed11619bd4860f71c2aeb
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused (toporouter_t *)->viamax
diff --git a/src/toporouter.c b/src/toporouter.c
index a440fa1..d3ebd4e 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -7576,7 +7576,6 @@ toporouter_new(void)
r->layers = NULL;
r->flags = 0;
- r->viamax = 3;
r->viacost = VIA_COST_AS_DISTANCE;
r->stublength = 300.;
diff --git a/src/toporouter.h b/src/toporouter.h
index 43b2824..667aeeb 100644
--- a/src/toporouter.h
+++ b/src/toporouter.h
@@ -419,7 +419,6 @@ struct _toporouter_t {
GList *destboxes, *consumeddestboxes;
/* settings: */
- guint viamax;
gdouble viacost;
gdouble stublength;
commit 570bb6cb0017ed5fbe4068ce2037568b06857265
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused (toporouter_t *)->serpintine_half_amplitude
diff --git a/src/toporouter.c b/src/toporouter.c
index 9627562..a440fa1 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -7579,7 +7579,6 @@ toporouter_new(void)
r->viamax = 3;
r->viacost = VIA_COST_AS_DISTANCE;
r->stublength = 300.;
- r->serpintine_half_amplitude = 1500.;
r->wiring_score = 0.;
diff --git a/src/toporouter.h b/src/toporouter.h
index 9e8a67d..43b2824 100644
--- a/src/toporouter.h
+++ b/src/toporouter.h
@@ -422,7 +422,6 @@ struct _toporouter_t {
guint viamax;
gdouble viacost;
gdouble stublength;
- gdouble serpintine_half_amplitude;
gdouble wiring_score;
commit 9aa2725edcc0ceb6c1c3a602cc4e0adfc83f3737
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Re-write {coord,point}_intersect_prop() to increase clariry.
Since the wind_* values computed in this function can be -1, 0 or 1,
it is clearer to test them using equality relations, not perform XOR
operations on their bit-patterns.
I believe the old code worked, but it would return an strange constant
for "true". To ram the point home, I've changed the function to return
bool.
diff --git a/src/toporouter.c b/src/toporouter.c
index ac9d2e7..9627562 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1338,34 +1338,41 @@ vertex_outside_segment(toporouter_spoint_t *a, toporouter_spoint_t *b, gdouble r
* AB and CD must share a point interior to both segments.
* returns TRUE if AB properly intersects CD.
*/
-gint
-coord_intersect_prop(gdouble ax, gdouble ay, gdouble bx, gdouble by, gdouble cx, gdouble cy, gdouble dx, gdouble dy)
+static bool
+coord_intersect_prop (double ax, double ay,
+ double bx, double by,
+ double cx, double cy,
+ double dx, double dy)
{
- gint wind_abc = coord_wind(ax, ay, bx, by, cx, cy);
- gint wind_abd = coord_wind(ax, ay, bx, by, dx, dy);
- gint wind_cda = coord_wind(cx, cy, dx, dy, ax, ay);
- gint wind_cdb = coord_wind(cx, cy, dx, dy, bx, by);
+ int wind_abc = coord_wind (ax, ay, bx, by, cx, cy);
+ int wind_abd = coord_wind (ax, ay, bx, by, dx, dy);
+ int wind_cda = coord_wind (cx, cy, dx, dy, ax, ay);
+ int wind_cdb = coord_wind (cx, cy, dx, dy, bx, by);
- if( !wind_abc || !wind_abd || !wind_cda || !wind_cdb ) return 0;
+ /* If any of the line end-points are colinear with the other line, return false */
+ if (wind_abc == 0 || wind_abd == 0 || wind_cda == 0 || wind_cdb == 0)
+ return false;
- return ( wind_abc ^ wind_abd ) && ( wind_cda ^ wind_cdb );
+ return (wind_abc != wind_abd) && (wind_cda != wind_cdb);
}
/* proper intersection:
* AB and CD must share a point interior to both segments.
* returns TRUE if AB properly intersects CD.
*/
-int
-point_intersect_prop(GtsPoint *a, GtsPoint *b, GtsPoint *c, GtsPoint *d)
+static bool
+point_intersect_prop (GtsPoint *a, GtsPoint *b, GtsPoint *c, GtsPoint *d)
{
+ int wind_abc = point_wind (a, b, c);
+ int wind_abd = point_wind (a, b, d);
+ int wind_cda = point_wind (c, d, a);
+ int wind_cdb = point_wind (c, d, b);
- if( point_wind(a, b, c) == 0 ||
- point_wind(a, b, d) == 0 ||
- point_wind(c, d, a) == 0 ||
- point_wind(c, d, b) == 0 ) return 0;
+ /* If any of the line end-points are colinear with the other line, return false */
+ if (wind_abc == 0 || wind_abd == 0 || wind_cda == 0 || wind_cdb == 0)
+ return false;
- return ( point_wind(a, b, c) ^ point_wind(a, b, d) ) &&
- ( point_wind(c, d, a) ^ point_wind(c, d, b) );
+ return (wind_abc != wind_abd) && (wind_cda != wind_cdb);
}
static inline int
commit f4afb96a8b3fba437164c70855d635226ff8fd58
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove commented tvertex_intersect() function
The implementation being used is a macro in toporouter.h
diff --git a/src/toporouter.c b/src/toporouter.c
index bc2025e..ac9d2e7 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1374,18 +1374,6 @@ vertex_intersect_prop(GtsVertex *a, GtsVertex *b, GtsVertex *c, GtsVertex *d)
return point_intersect_prop(GTS_POINT(a), GTS_POINT(b), GTS_POINT(c), GTS_POINT(d));
}
-/*
-static inline int
-tvertex_intersect(toporouter_vertex_t *a, toporouter_vertex_t *b, toporouter_vertex_t *c, toporouter_vertex_t *d)
-{
- if( !point_wind(GTS_POINT(a), GTS_POINT(d), GTS_POINT(b)) || !point_wind(GTS_POINT(a), GTS_POINT(c), GTS_POINT(b)) ) return 1;
-
- return
- ( point_wind(GTS_POINT(a), GTS_POINT(b), GTS_POINT(c)) ^ point_wind(GTS_POINT(a), GTS_POINT(b), GTS_POINT(d)) ) &&
- ( point_wind(GTS_POINT(c), GTS_POINT(d), GTS_POINT(a)) ^ point_wind(GTS_POINT(c), GTS_POINT(d), GTS_POINT(b)) );
-}
-*/
-
/* intersection vertex:
* AB and CD must share a point interior to both segments.
* returns vertex at intersection of AB and CD.
commit 657e9a7fe077a659f4017984bb7a63184382b229
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused function tvertex_intersect_prop()
diff --git a/src/toporouter.c b/src/toporouter.c
index 9b3d548..bc2025e 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1374,11 +1374,6 @@ vertex_intersect_prop(GtsVertex *a, GtsVertex *b, GtsVertex *c, GtsVertex *d)
return point_intersect_prop(GTS_POINT(a), GTS_POINT(b), GTS_POINT(c), GTS_POINT(d));
}
-static inline int
-tvertex_intersect_prop(toporouter_vertex_t *a, toporouter_vertex_t *b, toporouter_vertex_t *c, toporouter_vertex_t *d)
-{
- return point_intersect_prop(GTS_POINT(a), GTS_POINT(b), GTS_POINT(c), GTS_POINT(d));
-}
/*
static inline int
tvertex_intersect(toporouter_vertex_t *a, toporouter_vertex_t *b, toporouter_vertex_t *c, toporouter_vertex_t *d)
commit dcfd8bd1b26d91ef3a001f00faa0ff915a3e18c6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Re-arrange the maths in {vertices,coords}_on_line()
Should given an identical result, but with a couple fewer operations.
diff --git a/src/toporouter.c b/src/toporouter.c
index dd028d5..9b3d548 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1183,70 +1183,75 @@ print_toporouter_vertex(toporouter_vertex_t *tv)
/**
* vertices_on_line:
- * Given vertex a, gradient m, and radius r:
+ * Given vertex a, gradient m, and radius r:
*
* Return vertices on line of a & m at r from a
*/
-void
-vertices_on_line(toporouter_spoint_t *a, gdouble m, gdouble r, toporouter_spoint_t *b0, toporouter_spoint_t *b1)
+static void
+vertices_on_line (toporouter_spoint_t *a,
+ double m,
+ double r,
+ toporouter_spoint_t *b0,
+ toporouter_spoint_t *b1)
{
- gdouble c, temp;
-
- if(m == INFINITY || m == -INFINITY) {
- b0->y = a->y + r;
- b1->y = a->y - r;
+ double c, dx;
+
+ if (m == INFINITY || m == -INFINITY) {
b0->x = a->x;
+ b0->y = a->y + r;
+
b1->x = a->x;
-
+ b1->y = a->y - r;
+
return;
}
- c = a->y - (m * a->x);
+ c = a->y - m * a->x;
+ dx = r / sqrt (1 + pow (m, 2));
- temp = sqrt( pow(r, 2) / ( 1 + pow(m, 2) ) );
-
- b0->x = a->x + temp;
- b1->x = a->x - temp;
-
- b0->y = b0->x * m + c;
- b1->y = b1->x * m + c;
+ b0->x = a->x + dx;
+ b0->y = m * b0->x + c;
+ b1->x = a->x - dx;
+ b1->y = m * b1->x + c;
}
/**
- * vertices_on_line:
- * Given vertex a, gradient m, and radius r:
+ * coords_on_line:
+ * Given coordinates ax, ay, gradient m, and radius r:
*
- * Return vertices on line of a & m at r from a
- */
-void
-coords_on_line(gdouble ax, gdouble ay, gdouble m, gdouble r, gdouble *b0x, gdouble *b0y, gdouble *b1x, gdouble *b1y)
+ * Return coordinates on line of a & m at r from a
+ */
+static void
+coords_on_line (double ax, gdouble ay,
+ double m,
+ double r,
+ double *b0x, double *b0y,
+ double *b1x, double *b1y)
{
+ double c, dx;
- gdouble c, temp;
-
- if(m == INFINITY || m == -INFINITY) {
- *b0y = ay + r;
- *b1y = ay - r;
+ if (m == INFINITY || m == -INFINITY) {
*b0x = ax;
+ *b0y = ay + r;
+
*b1x = ax;
-
+ *b1y = ay - r;
+
return;
}
- c = ay - (m * ax);
-
- temp = sqrt( pow(r, 2) / ( 1 + pow(m, 2) ) );
+ c = ay - m * ax;
+ dx = r / sqrt (1 + pow (m, 2));
- *b0x = ax + temp;
- *b1x = ax - temp;
-
- *b0y = *b0x * m + c;
- *b1y = *b1x * m + c;
+ *b0x = ax + dx;
+ *b0y = m * *b0x + c;
+ *b1x = ax - dx;
+ *b1y = m * *b1x + c;
}
/*
commit cf69668a784b2ed11d033a0accc96403cf1a01b0
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused function points_on_line()
diff --git a/src/toporouter.c b/src/toporouter.c
index 2ce5175..dd028d5 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1249,40 +1249,6 @@ coords_on_line(gdouble ax, gdouble ay, gdouble m, gdouble r, gdouble *b0x, gdoub
}
-/**
- * vertices_on_line:
- * Given vertex a, gradient m, and radius r:
- *
- * Return vertices on line of a & m at r from a
- */
-void
-points_on_line(GtsPoint *a, gdouble m, gdouble r, GtsPoint *b0, GtsPoint *b1)
-{
-
- gdouble c, temp;
-
- if(m == INFINITY || m == -INFINITY) {
- b0->y = a->y + r;
- b1->y = a->y - r;
-
- b0->x = a->x;
- b1->x = a->x;
-
- return;
- }
-
- c = a->y - (m * a->x);
-
- temp = sqrt( pow(r, 2) / ( 1 + pow(m, 2) ) );
-
- b0->x = a->x + temp;
- b1->x = a->x - temp;
-
- b0->y = b0->x * m + c;
- b1->y = b1->x * m + c;
-
-}
-
/*
* Returns gradient of segment given by a & b
*/
commit cb4bd2d1a21c042aaa89343acf96b52290bc2cd3
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused wind_double() function
diff --git a/src/toporouter.c b/src/toporouter.c
index 000da7b..2ce5175 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1164,19 +1164,6 @@ wind(toporouter_spoint_t *p1, toporouter_spoint_t *p2, toporouter_spoint_t *p3)
return (rval > 0.0001) ? 1 : ((rval < -0.0001) ? -1 : 0); /* XXX: Depends on PCB coordinate scaling */
}
-/* wind_double:
- * returns 1,0,-1 for counterclockwise, collinear or clockwise, respectively.
- */
-int
-wind_double(gdouble p1_x, gdouble p1_y, gdouble p2_x, gdouble p2_y, gdouble p3_x, gdouble p3_y)
-{
- double rval, dx1, dx2, dy1, dy2;
- dx1 = p2_x - p1_x; dy1 = p2_y - p1_y;
- dx2 = p3_x - p2_x; dy2 = p3_y - p2_y;
- rval = (dx1*dy2)-(dy1*dx2);
- return (rval > 0.0001) ? 1 : ((rval < -0.0001) ? -1 : 0);
-}
-
static inline void
print_toporouter_constraint(toporouter_constraint_t *tc)
{
commit 1a6a473a21f150139a383b6fa39e8865ceb5f02d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused sloppy_.*wind() functions
diff --git a/src/toporouter.c b/src/toporouter.c
index 609a53d..000da7b 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -772,22 +772,6 @@ tvertex_wind(toporouter_vertex_t *a, toporouter_vertex_t *b, toporouter_vertex
return point_wind(GTS_POINT(a), GTS_POINT(b), GTS_POINT(c));
}
-int
-sloppy_point_wind(GtsPoint *a, GtsPoint *b, GtsPoint *c)
-{
- gdouble rval, dx1, dx2, dy1, dy2;
- dx1 = b->x - a->x; dy1 = b->y - a->y;
- dx2 = c->x - b->x; dy2 = c->y - b->y;
- rval = (dx1*dy2)-(dy1*dx2);
- return (rval > 10.) ? 1 : ((rval < -10.) ? -1 : 0);
-}
-
-static inline int
-sloppy_vertex_wind(GtsVertex *a, GtsVertex *b, GtsVertex *c)
-{
- return point_wind(GTS_POINT(a), GTS_POINT(b), GTS_POINT(c));
-}
-
/* moves vertex v d units in the direction of vertex p */
static void
coord_move_towards_coord_values (double ax, double ay,
commit 421c487a1adc5f93a5d1ef2b7a0085750b161b0a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter: Re-implement functions using atan with atan2
Simplifies and condenses the code a lot.
diff --git a/src/toporouter.c b/src/toporouter.c
index c186d4a..609a53d 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -723,53 +723,20 @@ print_trace (void)
free (strings);
}
*/
-/* fills in x and y with coordinates of point from a towards b of distance d */
-void
-point_from_point_to_point(toporouter_vertex_t *a, toporouter_vertex_t *b, gdouble d, gdouble *x, gdouble *y)
-{
- gdouble dx = vx(b) - vx(a);
- gdouble dy = vy(b) - vy(a);
- gdouble theta = atan(fabs(dy/dx));
-
-//#ifdef DEBUG_EXPORT
- if(!finite(theta)) {
-// printf("!finte(theta): a = %f,%f b = %f,%f d = %f\n", vx(a), vy(a), vx(b), vy(b), d);
-// print_trace();
- //TODO: this shouldn't happen, fix the hack
- *x = vx(a);
- *y = vy(a);
- return;
- }
-//#endif
-
- g_assert(finite(theta));
-
- *x = vx(a); *y = vy(a);
-
- if( dx >= 0. ) {
- if( dy >= 0. ) {
- *x += d * cos(theta);
- *y += d * sin(theta);
- }else{
- *x += d * cos(theta);
- *y -= d * sin(theta);
- }
-
- }else{
-
- if( dy >= 0. ) {
- *x -= d * cos(theta);
- *y += d * sin(theta);
- }else{
- *x -= d * cos(theta);
- *y -= d * sin(theta);
- }
+/* fills in x and y with coordinates of point from a towards b of distance d */
+static void
+point_from_point_to_point (toporouter_vertex_t *a,
+ toporouter_vertex_t *b,
+ double d,
+ double *x, double *y)
+{
+ double theta = atan2 (vy(b) - vy(a), vx(b) - vx(a));
- }
+ *x = vx(a) + d * cos (theta);
+ *y = vy(a) + d * sin (theta);
}
-
static inline gint
coord_wind(gdouble ax, gdouble ay, gdouble bx, gdouble by, gdouble cx, gdouble cy)
{
@@ -822,78 +789,30 @@ sloppy_vertex_wind(GtsVertex *a, GtsVertex *b, GtsVertex *c)
}
/* moves vertex v d units in the direction of vertex p */
-void
-coord_move_towards_coord_values(gdouble ax, gdouble ay, gdouble px, gdouble py, gdouble d, gdouble *x, gdouble *y)
+static void
+coord_move_towards_coord_values (double ax, double ay,
+ double px, double py,
+ double d,
+ double *x, double *y)
{
- gdouble dx = px - ax;
- gdouble dy = py - ay;
- gdouble theta = atan(fabs(dy/dx));
-
-
- if(!finite(theta)) {
- printf("!finite(theta) a = %f,%f p = %f,%f d = %f\n",
- ax, ay, px, py, d);
-
- }
-
- g_assert(finite(theta));
-
- if( dx >= 0. ) {
-
- if( dy >= 0. ) {
- *x = ax + (d * cos(theta));
- *y = ay + (d * sin(theta));
- }else{
- *x = ax + (d * cos(theta));
- *y = ay - (d * sin(theta));
- }
-
- }else{
-
- if( dy >= 0. ) {
- *x = ax - (d * cos(theta));
- *y = ay + (d * sin(theta));
- }else{
- *x = ax - (d * cos(theta));
- *y = ay - (d * sin(theta));
- }
-
- }
+ double theta = atan2 (py - ay, px - ax);
+ *x = ax + d * cos (theta);
+ *y = ay + d * sin (theta);
}
/* moves vertex v d units in the direction of vertex p */
-void
-vertex_move_towards_vertex_values(GtsVertex *v, GtsVertex *p, gdouble d, gdouble *x, gdouble *y)
+static void
+vertex_move_towards_vertex_values (GtsVertex *v,
+ GtsVertex *p,
+ double d,
+ double *x, double *y)
{
- gdouble dx = GTS_POINT(p)->x - GTS_POINT(v)->x;
- gdouble dy = GTS_POINT(p)->y - GTS_POINT(v)->y;
- gdouble theta = atan(fabs(dy/dx));
-
- g_assert(finite(theta));
-
- if( dx >= 0. ) {
-
- if( dy >= 0. ) {
- *x = GTS_POINT(v)->x + (d * cos(theta));
- *y = GTS_POINT(v)->y + (d * sin(theta));
- }else{
- *x = GTS_POINT(v)->x + (d * cos(theta));
- *y = GTS_POINT(v)->y - (d * sin(theta));
- }
-
- }else{
-
- if( dy >= 0. ) {
- *x = GTS_POINT(v)->x - (d * cos(theta));
- *y = GTS_POINT(v)->y + (d * sin(theta));
- }else{
- *x = GTS_POINT(v)->x - (d * cos(theta));
- *y = GTS_POINT(v)->y - (d * sin(theta));
- }
-
- }
+ double theta = atan2 (GTS_POINT(p)->y - GTS_POINT(v)->y,
+ GTS_POINT(p)->x - GTS_POINT(v)->x);
+ *x = GTS_POINT(v)->x + d * cos (theta);
+ *y = GTS_POINT(v)->y + d * sin (theta);
}
#define tv_on_layer(v,l) (l == TOPOROUTER_BBOX(TOPOROUTER_VERTEX(v)->boxes->data)->layer)
@@ -5107,36 +5026,15 @@ routing_return:
/* moves vertex v d units in the direction of vertex p */
void
-vertex_move_towards_vertex(GtsVertex *v, GtsVertex *p, gdouble d)
+vertex_move_towards_vertex (GtsVertex *v,
+ GtsVertex *p,
+ double d)
{
- gdouble dx = GTS_POINT(p)->x - GTS_POINT(v)->x;
- gdouble dy = GTS_POINT(p)->y - GTS_POINT(v)->y;
- gdouble theta = atan(fabs(dy/dx));
-
- g_assert(finite(theta));
-
- if( dx >= 0. ) {
-
- if( dy >= 0. ) {
- GTS_POINT(v)->x += d * cos(theta);
- GTS_POINT(v)->y += d * sin(theta);
- }else{
- GTS_POINT(v)->x += d * cos(theta);
- GTS_POINT(v)->y -= d * sin(theta);
- }
-
- }else{
-
- if( dy >= 0. ) {
- GTS_POINT(v)->x -= d * cos(theta);
- GTS_POINT(v)->y += d * sin(theta);
- }else{
- GTS_POINT(v)->x -= d * cos(theta);
- GTS_POINT(v)->y -= d * sin(theta);
- }
-
- }
+ double theta = atan2 (GTS_POINT(p)->y - GTS_POINT(v)->y,
+ GTS_POINT(p)->x - GTS_POINT(v)->x);
+ GTS_POINT(v)->x += d * cos (theta);
+ GTS_POINT(v)->y += d * sin (theta);
}
commit e873882e2465a74ef2c1b9cab54ed12dc170856e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Replace coord_xangle() with coord_angle()
The new function returning the "normal" coordinate system angle one would
expect. Replace usage of coord_xangle() in export_pcb_drawarc() with the
new function.
PCB's arc angles are a bit nutty, so lets try to contain that strangeness
to the arc exporting routine!
diff --git a/src/toporouter.c b/src/toporouter.c
index ab1338c..c186d4a 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -2602,26 +2602,10 @@ visited_cmp(gconstpointer a, gconstpointer b)
return 0;
}
-gdouble
-coord_xangle(gdouble ax, gdouble ay, gdouble bx, gdouble by)
+static double
+coord_angle (double ax, double ay, double bx, double by)
{
- gdouble dx, dy, theta;
-
- dx = fabs(ax - bx);
- dy = fabs(ay - by);
-
- if(dx < EPSILON) {
- theta = M_PI / 2.;
- } else theta = atan(dy/dx);
-
- if(by <= ay) {
- if(bx < ax) theta = M_PI - theta;
- }else{
- if(bx < ax) theta += M_PI;
- else theta = (2 * M_PI) - theta;
- }
-
- return theta;
+ return atan2 (by - ay, bx - ax);
}
GList *
@@ -5416,7 +5400,11 @@ export_pcb_drawarc(guint layer, toporouter_arc_t *a, guint thickness, guint keep
wind = coord_wind(a->x0, a->y0, a->x1, a->y1, vx(a->centre), vy(a->centre));
- sa = coord_xangle(a->x0, a->y0, vx(a->centre), vy(a->centre)) * 180. / M_PI;
+ /* NB: PCB's arcs have a funny coorindate system, with 0 degrees as the -ve X axis (left),
+ * continuing clockwise, with +90 degrees being along the +ve Y axis (bottom). Because
+ * Y+ points down, our internal angles increase clockwise from the +ve X axis.
+ */
+ sa = (M_PI - coord_angle (vx (a->centre), vy (a->centre), a->x0, a->y0)) * 180. / M_PI;
theta = arc_angle(a);
commit 592a836a66f7ebdef6d72b1f79c21ddb5289a26e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused point_xangle() function
(Unused since the previous commit)
diff --git a/src/toporouter.c b/src/toporouter.c
index 51c8de6..ab1338c 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -2624,29 +2624,6 @@ coord_xangle(gdouble ax, gdouble ay, gdouble bx, gdouble by)
return theta;
}
-gdouble
-point_xangle(GtsPoint *a, GtsPoint *b)
-{
- gdouble dx, dy, theta;
-
- dx = fabs(a->x - b->x);
- dy = fabs(a->y - b->y);
-
- if(dx < EPSILON) {
- theta = M_PI / 2.;
- } else theta = atan(dy/dx);
-
- if(b->y >= a->y) {
- if(b->x < a->x) theta = M_PI - theta;
- }else{
- if(b->x < a->x) theta += M_PI;
- else theta = (2 * M_PI) - theta;
- }
-
- return theta;
-}
-
-
GList *
cluster_vertices(toporouter_t *r, toporouter_cluster_t *c)
{
commit c4ffceda456e150f036c05c28ddf15d9782eacdd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Remove unused region_span() function
diff --git a/src/toporouter.c b/src/toporouter.c
index 7fdd79d..51c8de6 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -3054,21 +3054,6 @@ angle_span(gdouble a1, gdouble a2)
}
gdouble
-region_span(toporouter_vertex_region_t *region)
-{
- gdouble a1,a2;
-
- g_assert(region->v1 != NULL);
- g_assert(region->v2 != NULL);
- g_assert(region->origin != NULL);
-
- a1 = point_xangle(GTS_POINT(region->origin), GTS_POINT(region->v1));
- a2 = point_xangle(GTS_POINT(region->origin), GTS_POINT(region->v2));
-
- return angle_span(a1, a2);
-}
-
-gdouble
edge_capacity(toporouter_edge_t *e)
{
return gts_point_distance(GTS_POINT(edge_v1(e)), GTS_POINT(edge_v2(e)));
commit 6027180567c13bb4d3ad1000ed8c966c5d8c7a55
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter: Remove unused vertex_move_towards_point[_values]() functions
diff --git a/src/toporouter.c b/src/toporouter.c
index fecc4d5..7fdd79d 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -864,40 +864,6 @@ coord_move_towards_coord_values(gdouble ax, gdouble ay, gdouble px, gdouble py,
/* moves vertex v d units in the direction of vertex p */
void
-vertex_move_towards_point_values(GtsVertex *v, gdouble px, gdouble py, gdouble d, gdouble *x, gdouble *y)
-{
- gdouble dx = px - GTS_POINT(v)->x;
- gdouble dy = py - GTS_POINT(v)->y;
- gdouble theta = atan(fabs(dy/dx));
-
- g_assert(finite(theta));
-
- if( dx >= 0. ) {
-
- if( dy >= 0. ) {
- *x = GTS_POINT(v)->x + (d * cos(theta));
- *y = GTS_POINT(v)->y + (d * sin(theta));
- }else{
- *x = GTS_POINT(v)->x + (d * cos(theta));
- *y = GTS_POINT(v)->y - (d * sin(theta));
- }
-
- }else{
-
- if( dy >= 0. ) {
- *x = GTS_POINT(v)->x - (d * cos(theta));
- *y = GTS_POINT(v)->y + (d * sin(theta));
- }else{
- *x = GTS_POINT(v)->x - (d * cos(theta));
- *y = GTS_POINT(v)->y - (d * sin(theta));
- }
-
- }
-
-}
-
-/* moves vertex v d units in the direction of vertex p */
-void
vertex_move_towards_vertex_values(GtsVertex *v, GtsVertex *p, gdouble d, gdouble *x, gdouble *y)
{
gdouble dx = GTS_POINT(p)->x - GTS_POINT(v)->x;
@@ -5195,40 +5161,6 @@ routing_return:
/* moves vertex v d units in the direction of vertex p */
void
-vertex_move_towards_point(GtsVertex *v, gdouble px, gdouble py, gdouble d)
-{
- gdouble dx = px - GTS_POINT(v)->x;
- gdouble dy = py - GTS_POINT(v)->y;
- gdouble theta = atan(fabs(dy/dx));
-
- g_assert(finite(theta));
-
- if( dx >= 0. ) {
-
- if( dy >= 0. ) {
- GTS_POINT(v)->x += d * cos(theta);
- GTS_POINT(v)->y += d * sin(theta);
- }else{
- GTS_POINT(v)->x += d * cos(theta);
- GTS_POINT(v)->y -= d * sin(theta);
- }
-
- }else{
-
- if( dy >= 0. ) {
- GTS_POINT(v)->x -= d * cos(theta);
- GTS_POINT(v)->y += d * sin(theta);
- }else{
- GTS_POINT(v)->x -= d * cos(theta);
- GTS_POINT(v)->y -= d * sin(theta);
- }
-
- }
-
-}
-
-/* moves vertex v d units in the direction of vertex p */
-void
vertex_move_towards_vertex(GtsVertex *v, GtsVertex *p, gdouble d)
{
gdouble dx = GTS_POINT(p)->x - GTS_POINT(v)->x;
commit ccc611da9065af30552e0774709584f49a4eba6c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Fix constants which assumed CMIL for PCB's internal units
This should make the toporouter work again.
diff --git a/src/toporouter.c b/src/toporouter.c
index 73e3990..fecc4d5 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -59,6 +59,9 @@
#include "pcb-printf.h"
#define BOARD_EDGE_RESOLUTION MIL_TO_COORD (100.)
+#define VIA_COST_AS_DISTANCE MIL_TO_COORD (100.)
+#define ROAR_DETOUR_THRESHOLD MIL_TO_COORD (10.)
+
static void
toporouter_edge_init (toporouter_edge_t *edge)
@@ -339,7 +342,7 @@ toporouter_draw_vertex(gpointer item, gpointer data)
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_GREEN) {
@@ -347,7 +350,7 @@ toporouter_draw_vertex(gpointer item, gpointer data)
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_BLUE) {
@@ -355,7 +358,7 @@ toporouter_draw_vertex(gpointer item, gpointer data)
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
@@ -407,7 +410,7 @@ toporouter_draw_vertex(gpointer item, gpointer data)
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 400. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (4.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
break;
@@ -421,14 +424,14 @@ toporouter_draw_vertex(gpointer item, gpointer data)
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_RED) {
cairo_set_source_rgba(dc->cr, 1., 0., 0., 0.8f);
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_GREEN) {
@@ -436,7 +439,7 @@ toporouter_draw_vertex(gpointer item, gpointer data)
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}
@@ -1032,7 +1035,7 @@ toporouter_draw_cluster(toporouter_t *r, drawing_context_t *dc, toporouter_clust
// if(box->point && vz(box->point) == layer) {
// cairo_set_source_rgba(dc->cr, red, green, blue, 0.8f);
-// cairo_arc(dc->cr, vx(box->point) * dc->s + MARGIN, vy(box->point) * dc->s + MARGIN, 500. * dc->s, 0, 2 * M_PI);
+// cairo_arc(dc->cr, vx(box->point) * dc->s + MARGIN, vy(box->point) * dc->s + MARGIN, MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
// cairo_fill(dc->cr);
// }
@@ -1079,7 +1082,7 @@ toporouter_draw_surface(toporouter_t *r, GtsSurface *s, char *filename, int w, i
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_GREEN) {
@@ -1087,7 +1090,7 @@ toporouter_draw_surface(toporouter_t *r, GtsSurface *s, char *filename, int w, i
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_BLUE) {
@@ -1095,7 +1098,7 @@ toporouter_draw_surface(toporouter_t *r, GtsSurface *s, char *filename, int w, i
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}
@@ -1105,7 +1108,7 @@ toporouter_draw_surface(toporouter_t *r, GtsSurface *s, char *filename, int w, i
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
@@ -1194,14 +1197,14 @@ toporouter_draw_surface(toporouter_t *r, GtsSurface *s, char *filename, int w, i
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_RED) {
cairo_set_source_rgba(dc->cr, 1., 0., 0., 0.8f);
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else if(tv->flags & VERTEX_FLAG_GREEN) {
@@ -1209,14 +1212,14 @@ toporouter_draw_surface(toporouter_t *r, GtsSurface *s, char *filename, int w, i
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}else{
cairo_set_source_rgba(dc->cr, 1., 1., 1., 0.8f);
cairo_arc(dc->cr,
tv->v.p.x * dc->s + MARGIN,
tv->v.p.y * dc->s + MARGIN,
- 500. * dc->s, 0, 2 * M_PI);
+ MIL_TO_COORD (5.) * dc->s, 0, 2 * M_PI);
cairo_fill(dc->cr);
}
i = i->next;
@@ -1289,7 +1292,7 @@ wind(toporouter_spoint_t *p1, toporouter_spoint_t *p2, toporouter_spoint_t *p3)
dx1 = p2->x - p1->x; dy1 = p2->y - p1->y;
dx2 = p3->x - p2->x; dy2 = p3->y - p2->y;
rval = (dx1*dy2)-(dy1*dx2);
- return (rval > 0.0001) ? 1 : ((rval < -0.0001) ? -1 : 0);
+ return (rval > 0.0001) ? 1 : ((rval < -0.0001) ? -1 : 0); /* XXX: Depends on PCB coordinate scaling */
}
/* wind_double:
@@ -5491,7 +5494,7 @@ export_pcb_drawline(guint layer, guint x0, guint y0, guint x1, guint y1, guint t
if(line) {
AddObjectToCreateUndoList (LINE_TYPE, LAYER_PTR(layer), line, line);
- d = coord_distance((double)x0, (double)y0, (double)x1, (double)y1) / 100.;
+ d = coord_distance((double)x0, (double)y0, (double)x1, (double)y1);
}
return d;
}
@@ -5538,7 +5541,7 @@ export_pcb_drawarc(guint layer, toporouter_arc_t *a, guint thickness, guint keep
if(arc) {
AddObjectToCreateUndoList( ARC_TYPE, LAYER_PTR(layer), arc, arc);
- d = a->r * theta / 100.;
+ d = a->r * theta;
}
return d;
@@ -6020,8 +6023,8 @@ check_non_intersect_vertex(gdouble x0, gdouble y0, gdouble x1, gdouble y1, topor
}else{
m = cartesian_gradient(x0, y0, x1, y1);
}
-
- coords_on_line(vx(arcv), vy(arcv), m, 100., &tx0, &ty0, &tx1, &ty1);
+
+ coords_on_line(vx(arcv), vy(arcv), m, MIL_TO_COORD (1.), &tx0, &ty0, &tx1, &ty1);
wind1 = coord_wind(tx0, ty0, tx1, ty1, line_int_x, line_int_y);
wind2 = coord_wind(tx0, ty0, tx1, ty1, vx(opv), vy(opv));
@@ -6810,9 +6813,13 @@ toporouter_export(toporouter_t *r)
i = i->next;
}
- Message(_("Reticulating splines... successful\n\n"));
- Message(_("Wiring cost: %f inches\n"), r->wiring_score / 1000.);
- printf("Wiring cost: %f inches\n", r->wiring_score / 1000.);
+ Message (_("Reticulating splines... successful\n\n"));
+ /* NB: We could use the %$mS specifier to print these distances, but we would
+ * have to cast to Coord, which might overflow for complex routing when
+ * PCB is built with Coord as a 32-bit integer.
+ */
+ Message (_("Wiring cost: %f inches\n"), COORD_TO_INCH (r->wiring_score));
+ printf ("Wiring cost: %f inches\n", COORD_TO_INCH (r->wiring_score));
g_list_free(oproutes);
@@ -7746,7 +7753,7 @@ detour_router(toporouter_t *r)
// vx(curroute->mergebox1->point), vy(curroute->mergebox1->point),
// vx(curroute->mergebox2->point), vy(curroute->mergebox2->point));
- if(curroute->score - curroute->detourscore > 1000.) {
+ if(curroute->score - curroute->detourscore > ROAR_DETOUR_THRESHOLD) {
roar_detour_route(r, curroute);
}else break;
@@ -7821,6 +7828,7 @@ parse_arguments(toporouter_t *r, int argc, char **argv)
int i, tempint;
for(i=0;i<argc;i++) {
if(sscanf(argv[i], "viacost=%d", &tempint)) {
+ /* XXX: We should be using PCB's generic value with unit parsing here */
r->viacost = (double)tempint;
}else if(sscanf(argv[i], "l%d", &tempint)) {
gdouble *layer = (gdouble *)malloc(sizeof(gdouble));
@@ -7857,7 +7865,7 @@ toporouter_new(void)
r->layers = NULL;
r->flags = 0;
r->viamax = 3;
- r->viacost = 10000.;
+ r->viacost = VIA_COST_AS_DISTANCE;
r->stublength = 300.;
r->serpintine_half_amplitude = 1500.;
commit e0c189a781e127c750243dbb4172d4778a6850fd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.c: Fixup and clean read_board_constraints() and create_board_edge()
Introduce a #defined constant which expresses how fine to break the board
edges into (the old hard-coded constant was broken since we changed to
nanometers).
diff --git a/src/toporouter.c b/src/toporouter.c
index 734c733..73e3990 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -58,6 +58,8 @@
#include "toporouter.h"
#include "pcb-printf.h"
+#define BOARD_EDGE_RESOLUTION MIL_TO_COORD (100.)
+
static void
toporouter_edge_init (toporouter_edge_t *edge)
{
@@ -2207,52 +2209,44 @@ read_lines(toporouter_t *r, toporouter_layer_t *l, LayerType *layer, int ln)
return 0;
}
-void
-create_board_edge(gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble max, gint layer, GList **vlist)
+static void
+create_board_edge (double x0, double y0,
+ double x1, double y1,
+ int layer,
+ GList **vlist)
{
GtsVertexClass *vertex_class = GTS_VERTEX_CLASS (toporouter_vertex_class ());
- gdouble d = sqrt(pow(x0-x1,2) + pow(y0-y1,2));
- guint n = d / max, count = 1;
- gdouble inc = n ? d / n : d;
- gdouble x = x0, y = y0;
+ double edge_length = sqrt (pow (x0 - x1, 2) + pow (y0 - y1, 2));
+ unsigned int vertices_per_edge = MIN (1, edge_length / BOARD_EDGE_RESOLUTION);
+ unsigned int count;
+ double inc = edge_length / vertices_per_edge;
+ double x = x0, y = y0;
- *vlist = g_list_prepend(*vlist, gts_vertex_new (vertex_class, x0, y0, layer));
-
- while(count < n) {
- coord_move_towards_coord_values(x0, y0, x1, y1, inc, &x, &y);
- *vlist = g_list_prepend(*vlist, gts_vertex_new (vertex_class, x, y, layer));
+ *vlist = g_list_prepend (*vlist, gts_vertex_new (vertex_class, x, y, layer));
- x0 = x; y0 = y;
- count++;
+ for (count = 1; count < vertices_per_edge; count ++) {
+ coord_move_towards_coord_values (x, y, x1, y1, inc, &x, &y);
+ *vlist = g_list_prepend (*vlist, gts_vertex_new (vertex_class, x, y, layer));
}
-
}
-int
-read_board_constraints(toporouter_t *r, toporouter_layer_t *l, int layer)
+static void
+read_board_constraints (toporouter_t *r, toporouter_layer_t *l, int layer)
{
-// GtsVertexClass *vertex_class = GTS_VERTEX_CLASS (toporouter_vertex_class ());
GList *vlist = NULL;
- toporouter_bbox_t *bbox = NULL;
-
- /* Add points for corners of board, and constrain those edges */
-// vlist = g_list_prepend(NULL, gts_vertex_new (vertex_class, 0., 0., layer));
-// vlist = g_list_prepend(vlist, gts_vertex_new (vertex_class, PCB->MaxWidth, 0., layer));
-// vlist = g_list_prepend(vlist, gts_vertex_new (vertex_class, PCB->MaxWidth, PCB->MaxHeight, layer));
-// vlist = g_list_prepend(vlist, gts_vertex_new (vertex_class, 0., PCB->MaxHeight, layer));
-
- create_board_edge(0., 0., PCB->MaxWidth, 0., 10000., layer, &vlist);
- create_board_edge(PCB->MaxWidth, 0., PCB->MaxWidth, PCB->MaxHeight, 10000., layer, &vlist);
- create_board_edge(PCB->MaxWidth, PCB->MaxHeight, 0., PCB->MaxHeight, 10000., layer, &vlist);
- create_board_edge(0., PCB->MaxHeight, 0., 0., 10000., layer, &vlist);
-
- bbox = toporouter_bbox_create(layer, vlist, BOARD, NULL);
- r->bboxes = g_slist_prepend(r->bboxes, bbox);
- insert_constraints_from_list(r, l, vlist, bbox);
- g_list_free(vlist);
+ toporouter_bbox_t *bbox;
- return 0;
+ /* Create points for the board edges and constrain those edges */
+ create_board_edge (0., 0., PCB->MaxWidth, 0., layer, &vlist);
+ create_board_edge (PCB->MaxWidth, 0., PCB->MaxWidth, PCB->MaxHeight, layer, &vlist);
+ create_board_edge (PCB->MaxWidth, PCB->MaxHeight, 0., PCB->MaxHeight, layer, &vlist);
+ create_board_edge (0., PCB->MaxHeight, 0., 0., layer, &vlist);
+
+ bbox = toporouter_bbox_create (layer, vlist, BOARD, NULL);
+ r->bboxes = g_slist_prepend (r->bboxes, bbox);
+ insert_constraints_from_list (r, l, vlist, bbox);
+ g_list_free (vlist);
}
gdouble
commit 296506b9a68ec4fcf01e455cd1734772adcf154e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporoute.c: Remove runtime Copyright message from toporouter
Not only is Anthony now not the only author of this code, we don't do
this for anything else.. why should we for this. It could potentially act
to discorage others from working on this code, and we don't want that.
diff --git a/src/toporouter.c b/src/toporouter.c
index bff1e7a..734c733 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -7887,7 +7887,6 @@ toporouter_new(void)
Message(_("Topological Autorouter\n"));
Message(_("Started %s"),asctime(localtime(<ime)));
Message(_("-------------------------------------\n"));
- Message(_("Copyright 2009 Anthony Blake (to...@gm...)\n\n"));
return r;
}
commit 02f0d48542c2d322c377ab3f353667cbcb81928c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
toporouter.[ch]: Add generic "contributors" copyright notice
"Copyright (C) 2009-2011 PCB Contibrutors (See ChangeLog for details)"
diff --git a/src/toporouter.c b/src/toporouter.c
index e5310b0..bff1e7a 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1,9 +1,10 @@
/*
* COPYRIGHT
*
- * Topological Autorouter for
+ * Topological Autorouter for
* PCB, interactive printed circuit board design
* Copyright (C) 2009 Anthony Blake
+ * Copyright (C) 2009-2011 PCB Contributors (see ChangeLog for details)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,9 +28,9 @@
* This is *EXPERIMENTAL* code.
*
* As the code is experimental, the algorithms and code
- * are likely to change. Which means it isn't documented
+ * are likely to change. Which means it isn't documented
* or optimized. If you would like to learn about Topological
- * Autorouters, the following papers are good starting points:
+ * Autorouters, the following papers are good starting points:
*
* This file implements a topological autorouter, and uses techniques from the
* following publications:
diff --git a/src/toporouter.h b/src/toporouter.h
index fcd0053..9e8a67d 100644
--- a/src/toporouter.h
+++ b/src/toporouter.h
@@ -1,9 +1,10 @@
/*
* COPYRIGHT
*
- * Topological Autorouter for
+ * Topological Autorouter for
* PCB, interactive printed circuit board design
* Copyright (C) 2009 Anthony Blake
+ * Copyright (C) 2009-2011 PCB Contributors (see ChangeLog for details)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
|
|
From: <gi...@gp...> - 2011-10-01 11:58:01
|
The branch, master has been updated
discards bc9cd3b5ecf2b51931baef22e730bf69d898eb15 (commit)
via ade3ba088e79f52dc9e44fb529276e14b3f08d62 (commit)
from bc9cd3b5ecf2b51931baef22e730bf69d898eb15 (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 ade3ba088e79f52dc9e44fb529276e14b3f08d62
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Revert "Change change.c to treat text scale as mils" and fix harder..
This reverts commit 9396377717f7c49cf38d753a35e32d004294b09e and
fixes what was probably the underlying issue... I made a mistake in
commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e such that it added
the existing text scale when setting an "absolute" text size, but
ignored it when setting a relative change. (Clearly backwards).
Additionally, I've switched to computing the new value in double
arithmetic to avoid a potential overflow when the input value is
large and we are using a 32-bit Coord type.
See commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e for a description
of how text scale is defined and used. If we want to change how our
text is sized / scaled in the future, we would need to change usage
in many more places than the reverted commit touched.
:100644 100644 eca110e... 61cb335... M src/change.c
=========
Changes
=========
commit ade3ba088e79f52dc9e44fb529276e14b3f08d62
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Revert "Change change.c to treat text scale as mils" and fix harder..
This reverts commit 9396377717f7c49cf38d753a35e32d004294b09e and
fixes what was probably the underlying issue... I made a mistake in
commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e such that it added
the existing text scale when setting an "absolute" text size, but
ignored it when setting a relative change. (Clearly backwards).
Additionally, I've switched to computing the new value in double
arithmetic to avoid a potential overflow when the input value is
large and we are using a 32-bit Coord type.
See commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e for a description
of how text scale is defined and used. If we want to change how our
text is sized / scaled in the future, we would need to change usage
in many more places than the reverted commit touched.
diff --git a/src/change.c b/src/change.c
index eca110e..61cb335 100644
--- a/src/change.c
+++ b/src/change.c
@@ -128,8 +128,8 @@ static void *ChangePolyClear (LayerTypePtr, PolygonTypePtr);
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static Coord Delta; /* change of size */
-static Coord Absolute; /* Absolute size */
+static int Delta; /* change of size */
+static int Absolute; /* Absolute size */
static char *NewName; /* new name */
static ObjectFunctionType ChangeSizeFunctions = {
ChangeLineSize,
@@ -838,8 +838,9 @@ ChangeArcClearSize (LayerTypePtr Layer, ArcTypePtr Arc)
static void *
ChangeTextSize (LayerTypePtr Layer, TextTypePtr Text)
{
- int value = Absolute ? COORD_TO_MIL (Absolute)
- : Text->Scale + COORD_TO_MIL (Delta);
+ int value = (Absolute != 0 ? 0 : Text->Scale) +
+ (double)(Absolute != 0 ? Absolute : Delta)
+ / (double)FONT_CAPHEIGHT * 100.;
if (TEST_FLAG (LOCKFLAG, Text))
return (NULL);
@@ -914,8 +915,9 @@ ChangeElementSize (ElementTypePtr Element)
static void *
ChangeElementNameSize (ElementTypePtr Element)
{
- int value = Absolute ? COORD_TO_MIL (Absolute)
- : DESCRIPTION_TEXT (Element).Scale + COORD_TO_MIL (Delta);
+ int value = (Absolute != 0 ? 0 : DESCRIPTION_TEXT (Element).Scale) +
+ (double)(Absolute != 0 ? Absolute : Delta)
+ / (double)FONT_CAPHEIGHT * 100.;
if (TEST_FLAG (LOCKFLAG, &Element->Name[0]))
return (NULL);
|
|
From: <gi...@gp...> - 2011-10-01 11:55:12
|
The branch, master has been updated
via bc9cd3b5ecf2b51931baef22e730bf69d898eb15 (commit)
via 99ab6b67549dfa144619fcce2a237d78048064a6 (commit)
from bcd0c2cf79bbf3902c6f9c44dd7585fbdb0aa1f7 (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/action.c | 7 +++++--
src/change.c | 14 ++++++++------
2 files changed, 13 insertions(+), 8 deletions(-)
=================
Commit Messages
=================
commit bc9cd3b5ecf2b51931baef22e730bf69d898eb15
Author: Andrew Poelstra <as...@sf...>
Commit: Peter Clifton <pc...@ca...>
Revert "Change change.c to treat text scale as mils" and fix harder..
This reverts commit 9396377717f7c49cf38d753a35e32d004294b09e and
fixes what was probably the underlying issue... I made a mistake in
commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e such that it added
the existing text scale when setting an "absolute" text size, but
ignored it when setting a relative change. (Clearly backwards).
Additionally, I've switched to computing the new value in double
arithmetic to avoid a potential overflow when the input value is
large and we are using a 32-bit Coord type.
See commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e for a description
of how text scale is defined and used. If we want to change how our
text is sized / scaled in the future, we would need to change usage
in many more places than the reverted commit touched.
:100644 100644 eca110e... 61cb335... M src/change.c
commit 99ab6b67549dfa144619fcce2a237d78048064a6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Fix the SetValue(TextScale, ...) action after nanometer conversion
:100644 100644 62c53e3... 2a0be9e... M src/action.c
=========
Changes
=========
commit bc9cd3b5ecf2b51931baef22e730bf69d898eb15
Author: Andrew Poelstra <as...@sf...>
Commit: Peter Clifton <pc...@ca...>
Revert "Change change.c to treat text scale as mils" and fix harder..
This reverts commit 9396377717f7c49cf38d753a35e32d004294b09e and
fixes what was probably the underlying issue... I made a mistake in
commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e such that it added
the existing text scale when setting an "absolute" text size, but
ignored it when setting a relative change. (Clearly backwards).
Additionally, I've switched to computing the new value in double
arithmetic to avoid a potential overflow when the input value is
large and we are using a 32-bit Coord type.
See commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e for a description
of how text scale is defined and used. If we want to change how our
text is sized / scaled in the future, we would need to change usage
in many more places than the reverted commit touched.
diff --git a/src/change.c b/src/change.c
index eca110e..61cb335 100644
--- a/src/change.c
+++ b/src/change.c
@@ -128,8 +128,8 @@ static void *ChangePolyClear (LayerTypePtr, PolygonTypePtr);
/* ---------------------------------------------------------------------------
* some local identifiers
*/
-static Coord Delta; /* change of size */
-static Coord Absolute; /* Absolute size */
+static int Delta; /* change of size */
+static int Absolute; /* Absolute size */
static char *NewName; /* new name */
static ObjectFunctionType ChangeSizeFunctions = {
ChangeLineSize,
@@ -838,8 +838,9 @@ ChangeArcClearSize (LayerTypePtr Layer, ArcTypePtr Arc)
static void *
ChangeTextSize (LayerTypePtr Layer, TextTypePtr Text)
{
- int value = Absolute ? COORD_TO_MIL (Absolute)
- : Text->Scale + COORD_TO_MIL (Delta);
+ int value = (Absolute != 0 ? 0 : Text->Scale) +
+ (double)(Absolute != 0 ? Absolute : Delta)
+ / (double)FONT_CAPHEIGHT * 100.;
if (TEST_FLAG (LOCKFLAG, Text))
return (NULL);
@@ -914,8 +915,9 @@ ChangeElementSize (ElementTypePtr Element)
static void *
ChangeElementNameSize (ElementTypePtr Element)
{
- int value = Absolute ? COORD_TO_MIL (Absolute)
- : DESCRIPTION_TEXT (Element).Scale + COORD_TO_MIL (Delta);
+ int value = (Absolute != 0 ? 0 : DESCRIPTION_TEXT (Element).Scale) +
+ (double)(Absolute != 0 ? Absolute : Delta)
+ / (double)FONT_CAPHEIGHT * 100.;
if (TEST_FLAG (LOCKFLAG, &Element->Name[0]))
return (NULL);
commit 99ab6b67549dfa144619fcce2a237d78048064a6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Fix the SetValue(TextScale, ...) action after nanometer conversion
diff --git a/src/action.c b/src/action.c
index 62c53e3..2a0be9e 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2173,6 +2173,7 @@ ActionSetValue (int argc, char **argv, Coord x, Coord y)
char *units = ARG (2);
bool absolute; /* flag for 'absolute' value */
double value;
+ int text_scale;
int err = 0;
if (function && val)
@@ -2217,8 +2218,10 @@ ActionSetValue (int argc, char **argv, Coord x, Coord y)
case F_Text:
case F_TextScale:
- value /= 45;
- SetTextScale (absolute ? value : value + Settings.TextScale);
+ text_scale = value / (double)FONT_CAPHEIGHT * 100.;
+ if (!absolute)
+ text_scale += Settings.TextScale;
+ SetTextScale (text_scale);
break;
default:
err = 1;
|
|
From: <gi...@gp...> - 2011-10-01 10:22:52
|
The branch, master has been updated
via bcd0c2cf79bbf3902c6f9c44dd7585fbdb0aa1f7 (commit)
from 6aea7bc11cabdf89cedbc59fca18d4c276c27233 (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/gtkhid-gl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit bcd0c2cf79bbf3902c6f9c44dd7585fbdb0aa1f7
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: (GL Renderer) Use direct rendering for off-screen pixmaps
We use direct rendering for the rest (where possible), so why slow down
pixmap rendering. Also fixes a bug on my pcb+gl_experimental branch
where pixel shaders can't be shared between the direct rendered widgets
and the pixmap rendering code.
:100644 100644 b9a569f... 069380e... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit bcd0c2cf79bbf3902c6f9c44dd7585fbdb0aa1f7
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: (GL Renderer) Use direct rendering for off-screen pixmaps
We use direct rendering for the rest (where possible), so why slow down
pixmap rendering. Also fixes a bug on my pcb+gl_experimental branch
where pixel shaders can't be shared between the direct rendered widgets
and the pixmap rendering code.
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index b9a569f..069380e 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -1107,7 +1107,7 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
pixmap = gdk_pixmap_new (NULL, width, height, depth);
glpixmap = gdk_pixmap_set_gl_capability (pixmap, glconfig, NULL);
gldrawable = GDK_GL_DRAWABLE (glpixmap);
- glcontext = gdk_gl_context_new (gldrawable, NULL, FALSE, GDK_GL_RGBA_TYPE);
+ glcontext = gdk_gl_context_new (gldrawable, NULL, TRUE, GDK_GL_RGBA_TYPE);
/* Setup zoom factor for drawing routines */
|
|
From: <gi...@gp...> - 2011-09-29 22:13:48
|
The branch, master has been updated
discards f010e6bfec24967534ca82bc047f82b6ed0b9f16 (commit)
via 6aea7bc11cabdf89cedbc59fca18d4c276c27233 (commit)
from f010e6bfec24967534ca82bc047f82b6ed0b9f16 (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/ghid-layer-selector.c | 5 +++--
src/hid/gtk/ghid-layer-selector.h | 2 +-
src/hid/gtk/gui-top-window.c | 14 +++++++-------
3 files changed, 11 insertions(+), 10 deletions(-)
=================
Commit Messages
=================
commit 6aea7bc11cabdf89cedbc59fca18d4c276c27233
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Extend layer selector to allow editing layer names in situ
Contains an unfortunate abstraciton break in the layer selector in
order to temporarily disable PCB's accelerators whilst the layer is
being renamed. It would be lovely to fix this and make things cleaner
in the future.
:100644 100644 43b0fa3... 432e57e... M src/hid/gtk/ghid-layer-selector.c
:100644 100644 ff67800... c89112d... M src/hid/gtk/ghid-layer-selector.h
:100644 100644 98bfcfe... ee79f1a... M src/hid/gtk/gui-top-window.c
=========
Changes
=========
commit 6aea7bc11cabdf89cedbc59fca18d4c276c27233
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Extend layer selector to allow editing layer names in situ
Contains an unfortunate abstraciton break in the layer selector in
order to temporarily disable PCB's accelerators whilst the layer is
being renamed. It would be lovely to fix this and make things cleaner
in the future.
diff --git a/src/hid/gtk/ghid-layer-selector.c b/src/hid/gtk/ghid-layer-selector.c
index 43b0fa3..432e57e 100644
--- a/src/hid/gtk/ghid-layer-selector.c
+++ b/src/hid/gtk/ghid-layer-selector.c
@@ -29,6 +29,7 @@ static void menu_pick_cb (GtkRadioAction *action, struct _layer *ldata);
enum {
SELECT_LAYER_SIGNAL,
TOGGLE_LAYER_SIGNAL,
+ RENAME_LAYER_SIGNAL,
LAST_SIGNAL
};
@@ -40,6 +41,7 @@ enum {
COLOR_COL,
TEXT_COL,
FONT_COL,
+ EDITABLE_COL,
SELECTABLE_COL,
SEPARATOR_COL,
N_COLS
@@ -73,6 +75,7 @@ struct _GHidLayerSelectorClass
void (* select_layer) (GHidLayerSelector *, gint);
void (* toggle_layer) (GHidLayerSelector *, gint);
+ void (* rename_layer) (GHidLayerSelector *, gint, gchar *);
};
struct _layer
@@ -85,6 +88,42 @@ struct _layer
GtkTreeRowReference *rref;
};
+static void
+g_cclosure_user_marshal_VOID__INT_STRING (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef void (*GMarshalFunc_VOID__INT_STRING) (gpointer data1,
+ gint arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_VOID__INT_STRING callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__INT_STRING) (marshal_data ? marshal_data : cc->callback);
+
+ callback (data1,
+ g_value_get_int (param_values + 1),
+ (char *)g_value_get_string (param_values + 2),
+ data2);
+}
+
/*! \brief Deletes the action and accelerator from a layer */
static void
free_ldata (GHidLayerSelector *ls, struct _layer *ldata)
@@ -243,6 +282,70 @@ selection_changed_cb (GtkTreeSelection *selection, GHidLayerSelector *ls)
}
}
+/*! \brief Callback for when a layer name has been edited */
+static void
+layer_name_editing_started_cb (GtkCellRenderer *renderer,
+ GtkCellEditable *editable,
+ gchar *path,
+ gpointer user_data)
+{
+ /* When editing begins, we need to detach PCB's accelerators
+ * so they don't steal all the user's keystrokes.
+ *
+ * XXX: We should not have to do this within a simple widget,
+ *
+ * and this quick hack workaround breaks the widget's
+ * abstraction from the rest of the application :(
+ */
+ ghid_remove_accel_groups (GTK_WINDOW (gport->top_window), ghidgui);
+}
+
+/*! \brief Callback for when layer name editing has been canceled */
+static void
+layer_name_editing_canceled_cb (GtkCellRenderer *renderer,
+ gpointer user_data)
+{
+ /* Put PCB's accelerators back.
+ *
+ * XXX: We should not have to do this within a simple widget,
+ * and this quick hack workaround breaks the widget's
+ * abstraction from the rest of the application :(
+ */
+ ghid_install_accel_groups (GTK_WINDOW (gport->top_window), ghidgui);
+}
+
+/*! \brief Callback for when a layer name has been edited */
+static void
+layer_name_edited_cb (GtkCellRendererText *renderer,
+ gchar *path,
+ gchar *new_text,
+ gpointer user_data)
+{
+ GHidLayerSelector *ls = user_data;
+ GtkTreeIter iter;
+ int user_id;
+
+ /* Put PCB's accelerators back.
+ *
+ * XXX: We should not have to do this within a simple widget,
+ * and this quick hack workaround breaks the widget's
+ * abstraction from the rest of the application :(
+ */
+ ghid_install_accel_groups (GTK_WINDOW (gport->top_window), ghidgui);
+
+ if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ls->list_store), &iter, path))
+ return;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (ls->list_store),
+ &iter,
+ USER_ID_COL, &user_id,
+ -1);
+
+ g_signal_emit (ls, ghid_layer_selector_signals[RENAME_LAYER_SIGNAL],
+ 0, user_id, new_text);
+}
+
+
/*! \brief Callback for menu actions: sync layer selection list, emit signal */
static void
menu_view_cb (GtkToggleAction *action, struct _layer *ldata)
@@ -300,20 +403,37 @@ ghid_layer_selector_init (GHidLayerSelector *ls)
renderer1 = ghid_cell_renderer_visibility_new ();
renderer2 = gtk_cell_renderer_text_new ();
-
- opacity_col = gtk_tree_view_column_new_with_attributes ("", renderer1,
+ g_object_set (renderer2, "editable-set", TRUE, NULL);
+ g_signal_connect (renderer2, "editing-started",
+ G_CALLBACK (layer_name_editing_started_cb), ls);
+ g_signal_connect (renderer2, "editing-canceled",
+ G_CALLBACK (layer_name_editing_canceled_cb), ls);
+ g_signal_connect (renderer2, "edited",
+ G_CALLBACK (layer_name_edited_cb), ls);
+
+ opacity_col = gtk_tree_view_column_new_with_attributes ("",
+ renderer1,
"active", VISIBLE_COL,
- "color", COLOR_COL, NULL);
- name_col = gtk_tree_view_column_new_with_attributes ("", renderer2,
+ "color", COLOR_COL,
+ NULL);
+ name_col = gtk_tree_view_column_new_with_attributes ("",
+ renderer2,
"text", TEXT_COL,
"font", FONT_COL,
+ "editable", EDITABLE_COL,
NULL);
- /* action index, active, color, text, font, is_separator */
- ls->list_store = gtk_list_store_new (N_COLS, G_TYPE_POINTER, G_TYPE_INT,
- G_TYPE_BOOLEAN, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
+ ls->list_store = gtk_list_store_new (N_COLS,
+ /* STRUCT_COL */ G_TYPE_POINTER,
+ /* USER_ID_COL */ G_TYPE_INT,
+ /* VISIBLE_COL */ G_TYPE_BOOLEAN,
+ /* COLOR_COL */ G_TYPE_STRING,
+ /* TEXT_COL */ G_TYPE_STRING,
+ /* FONT_COL */ G_TYPE_STRING,
+ /* EDITABLE_COL */ G_TYPE_BOOLEAN,
+ /* ACTIVATABLE_COL */ G_TYPE_BOOLEAN,
+ /* SEPARATOR_COL */ G_TYPE_BOOLEAN);
+
gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), opacity_col, -1);
gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), name_col, -1);
gtk_tree_view_set_model (GTK_TREE_VIEW (ls), GTK_TREE_MODEL (ls->list_store));
@@ -364,6 +484,14 @@ ghid_layer_selector_class_init (GHidLayerSelectorClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__INT, G_TYPE_NONE,
1, G_TYPE_INT);
+ ghid_layer_selector_signals[RENAME_LAYER_SIGNAL] =
+ g_signal_new ("rename-layer",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GHidLayerSelectorClass, rename_layer),
+ NULL, NULL,
+ g_cclosure_user_marshal_VOID__INT_STRING, G_TYPE_NONE,
+ 2, G_TYPE_INT, G_TYPE_STRING);
object_class->finalize = ghid_layer_selector_finalize;
}
@@ -448,6 +576,7 @@ ghid_layer_selector_new (void)
* \param [in] color_string The color of the layer on selector
* \param [in] visibile Whether the layer is visible
* \param [in] selectable Whether the layer appears in menus and can be selected
+ * \param [in] renameable Whether the layer is renameable
*/
void
ghid_layer_selector_add_layer (GHidLayerSelector *ls,
@@ -455,7 +584,8 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
const gchar *name,
const gchar *color_string,
gboolean visible,
- gboolean selectable)
+ gboolean selectable,
+ gboolean renameable)
{
struct _layer *new_layer = NULL;
gchar *pname, *vname;
@@ -523,6 +653,7 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
COLOR_COL, color_string,
TEXT_COL, name,
FONT_COL, selectable ? NULL : "Italic",
+ EDITABLE_COL, renameable,
SELECTABLE_COL, selectable,
SEPARATOR_COL, FALSE,
-1);
diff --git a/src/hid/gtk/ghid-layer-selector.h b/src/hid/gtk/ghid-layer-selector.h
index ff67800..c89112d 100644
--- a/src/hid/gtk/ghid-layer-selector.h
+++ b/src/hid/gtk/ghid-layer-selector.h
@@ -24,7 +24,8 @@ void ghid_layer_selector_add_layer (GHidLayerSelector *ls,
const gchar *name,
const gchar *color_string,
gboolean visible,
- gboolean selectable);
+ gboolean selectable,
+ gboolean renameable);
gint ghid_layer_selector_install_pick_items (GHidLayerSelector *ls,
GtkMenuShell *shell, gint pos);
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 98bfcfe..ee79f1a 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -553,6 +553,33 @@ layer_selector_select_callback (GHidLayerSelector *ls, int layer, gpointer d)
ghid_invalidate_all ();
}
+/*! \brief Callback for GHidLayerSelector layer renaming */
+static void
+layer_selector_rename_callback (GHidLayerSelector *ls,
+ int layer_id,
+ char *new_name,
+ void *userdata)
+{
+ LayerType *layer = LAYER_PTR (layer_id);
+
+ /* Check for a legal layer name - for now, allow anything non-empty */
+ if (new_name[0] == '\0')
+ return;
+
+ /* Don't bother if the name is identical to the current one */
+ if (strcmp (layer->Name, new_name) == 0)
+ return;
+
+ free (layer->Name);
+ layer->Name = strdup (new_name);
+ ghid_layer_buttons_update ();
+ if (!PCB->Changed)
+ {
+ SetChangedFlag (true);
+ ghid_window_set_name_label (PCB->Name);
+ }
+}
+
/*! \brief Callback for GHidLayerSelector layer toggling */
static void
layer_selector_toggle_callback (GHidLayerSelector *ls, int layer, gpointer d)
@@ -772,22 +799,22 @@ make_virtual_layer_buttons (GtkWidget *layer_selector)
layer_process (&color_string, &text, &active, LAYER_BUTTON_SILK);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_SILK,
- text, color_string, active, TRUE);
+ text, color_string, active, TRUE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_RATS);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_RATS,
- text, color_string, active, TRUE);
+ text, color_string, active, TRUE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_PINS);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_PINS,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_VIAS);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_VIAS,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_FARSIDE);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_FARSIDE,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_MASK);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_MASK,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, FALSE);
}
/*! \brief callback for ghid_layer_selector_update_colors */
@@ -821,7 +848,7 @@ make_layer_buttons (GtkWidget *layersel)
{
layer_process (&color_string, &text, &active, i);
ghid_layer_selector_add_layer (GHID_LAYER_SELECTOR (layersel), i,
- text, color_string, active, TRUE);
+ text, color_string, active, TRUE, TRUE);
}
}
@@ -1248,12 +1275,15 @@ ghid_build_pcb_top_window (void)
ghidgui->layer_selector = ghid_layer_selector_new ();
make_layer_buttons (ghidgui->layer_selector);
make_virtual_layer_buttons (ghidgui->layer_selector);
- g_signal_connect (G_OBJECT (ghidgui->layer_selector), "select_layer",
+ g_signal_connect (G_OBJECT (ghidgui->layer_selector), "select-layer",
G_CALLBACK (layer_selector_select_callback),
NULL);
- g_signal_connect (G_OBJECT (ghidgui->layer_selector), "toggle_layer",
+ g_signal_connect (G_OBJECT (ghidgui->layer_selector), "toggle-layer",
G_CALLBACK (layer_selector_toggle_callback),
NULL);
+ g_signal_connect (G_OBJECT (ghidgui->layer_selector), "rename-layer",
+ G_CALLBACK (layer_selector_rename_callback),
+ NULL);
/* Build main menu */
ghidgui->menu_bar = ghid_load_menus ();
gtk_box_pack_start (GTK_BOX (ghidgui->menubar_toolbar_vbox),
|
|
From: <gi...@gp...> - 2011-09-29 22:06:02
|
The branch, master has been updated
via f010e6bfec24967534ca82bc047f82b6ed0b9f16 (commit)
via 1f264644a8e39505b028159459d78b2020c3fb60 (commit)
via b23b65887e9874270677189765c960e2fcc8985b (commit)
via 347f55ffb64a16d90c3753d9f398a31a86ec7310 (commit)
via 1cc1a36b2d9348a820be0306f4232be1d79e9c9b (commit)
via 758950bce677f9bda6cc069ea68c9ca1d06725ad (commit)
via 31f3ad1fe78cacbb210044cfa2bdb27d8ad2524a (commit)
via 53a53695310aa9b7af7278ac93f5026d2bf59067 (commit)
from 29c65d98352be5be38b2746ebfd9cc650a0ee04c (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/ghid-layer-selector.c | 338 +++++++++++++++++++++++++------------
src/hid/gtk/ghid-layer-selector.h | 3 +-
src/hid/gtk/gui-config.c | 24 ++-
src/hid/gtk/gui-top-window.c | 48 +++++-
src/hid/gtk/gui-utils.c | 31 ----
src/hid/gtk/gui.h | 1 -
6 files changed, 292 insertions(+), 153 deletions(-)
=================
Commit Messages
=================
commit f010e6bfec24967534ca82bc047f82b6ed0b9f16
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Extend layer selector to allow editing layer names in situ
:100644 100644 43b0fa3... 1afd211... M src/hid/gtk/ghid-layer-selector.c
:100644 100644 ff67800... 1ed5e01... M src/hid/gtk/ghid-layer-selector.h
:100644 100644 98bfcfe... 4f25e72... M src/hid/gtk/gui-top-window.c
commit 1f264644a8e39505b028159459d78b2020c3fb60
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Layer selector - Rename "activatable" to "selectable"
GTK has a special meaning for the word "activatable", meaning that the item
can be double-clicked, or "activated" by hitting enter on it. We use it to
mean selectable - so change the code to make this clear.
:100644 100644 ca5abe9... 43b0fa3... M src/hid/gtk/ghid-layer-selector.c
:100644 100644 09fa182... ff67800... M src/hid/gtk/ghid-layer-selector.h
commit b23b65887e9874270677189765c960e2fcc8985b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Layer selector - remove unused variable
:100644 100644 7648261... ca5abe9... M src/hid/gtk/ghid-layer-selector.c
commit 347f55ffb64a16d90c3753d9f398a31a86ec7310
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Refactor to remove some duplicated code in the layer selector
:100644 100644 72ec44d... 7648261... M src/hid/gtk/ghid-layer-selector.c
commit 1cc1a36b2d9348a820be0306f4232be1d79e9c9b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Better encapsulate some of the layer selector initialisation
The work we do within ghid_layer_selector_new() is better placed in the
appropriate class initialiser functions, otherwise we needn't go to the
trouble of subclassing a widget in the first place.
:100644 100644 840cd98... 72ec44d... M src/hid/gtk/ghid-layer-selector.c
commit 758950bce677f9bda6cc069ea68c9ca1d06725ad
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Don't refleak the accel group created by the layer selector
When the accel group is created, we have a reference to it - we don't need
another.
:100644 100644 639e2be... 840cd98... M src/hid/gtk/ghid-layer-selector.c
commit 31f3ad1fe78cacbb210044cfa2bdb27d8ad2524a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove the unused function utf8_dup_string
:100644 100644 7136fbb... 0fcb5d2... M src/hid/gtk/gui-utils.c
:100644 100644 5ba5aeb... ea49bee... M src/hid/gtk/gui.h
commit 53a53695310aa9b7af7278ac93f5026d2bf59067
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Don't use dup_string where doing so would mix g_free() and free()
The core uses malloc(), strdup(), free() etc..
The GTK HID primarily uses g_malloc(), g_strdup(), g_free() etc..
Mixing them can lead to bad behaviour and hard to debug crashes. This
commit is not aimed at fixing any known bugs, but is "by inspection", as
I spotted some of these when working on a layer selector patch.
:100644 100644 dba0635... 7b2751a... M src/hid/gtk/gui-config.c
=========
Changes
=========
commit f010e6bfec24967534ca82bc047f82b6ed0b9f16
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Extend layer selector to allow editing layer names in situ
diff --git a/src/hid/gtk/ghid-layer-selector.c b/src/hid/gtk/ghid-layer-selector.c
index 43b0fa3..1afd211 100644
--- a/src/hid/gtk/ghid-layer-selector.c
+++ b/src/hid/gtk/ghid-layer-selector.c
@@ -29,6 +29,7 @@ static void menu_pick_cb (GtkRadioAction *action, struct _layer *ldata);
enum {
SELECT_LAYER_SIGNAL,
TOGGLE_LAYER_SIGNAL,
+ RENAME_LAYER_SIGNAL,
LAST_SIGNAL
};
@@ -40,6 +41,7 @@ enum {
COLOR_COL,
TEXT_COL,
FONT_COL,
+ EDITABLE_COL,
SELECTABLE_COL,
SEPARATOR_COL,
N_COLS
@@ -73,6 +75,7 @@ struct _GHidLayerSelectorClass
void (* select_layer) (GHidLayerSelector *, gint);
void (* toggle_layer) (GHidLayerSelector *, gint);
+ void (* rename_layer) (GHidLayerSelector *, gint, gchar *);
};
struct _layer
@@ -85,6 +88,42 @@ struct _layer
GtkTreeRowReference *rref;
};
+static void
+g_cclosure_user_marshal_VOID__INT_STRING (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef void (*GMarshalFunc_VOID__INT_STRING) (gpointer data1,
+ gint arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_VOID__INT_STRING callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__INT_STRING) (marshal_data ? marshal_data : cc->callback);
+
+ callback (data1,
+ g_value_get_int (param_values + 1),
+ (char *)g_value_get_string (param_values + 2),
+ data2);
+}
+
/*! \brief Deletes the action and accelerator from a layer */
static void
free_ldata (GHidLayerSelector *ls, struct _layer *ldata)
@@ -243,6 +282,70 @@ selection_changed_cb (GtkTreeSelection *selection, GHidLayerSelector *ls)
}
}
+/*! \brief Callback for when a layer name has been edited */
+static void
+layer_name_editing_started_cb (GtkCellRenderer *renderer,
+ GtkCellEditable *editable,
+ gchar *path,
+ gpointer user_data)
+{
+ /* When editing begins, we need to detach PCB's accelerators
+ * so they don't steal all the user's keystrokes.
+ *
+ * XXX: We should not have to do this within a simple widget,
+ *
+ * and this quick hack workaround breaks the widget's
+ * abstraction from the rest of the application :(
+ */
+ ghid_remove_accel_groups (GTK_WINDOW (gport->top_window), ghidgui);
+}
+
+/*! \brief Callback for when layer name editing has been canceled */
+static void
+layer_name_editing_canceled_cb (GtkCellRenderer *renderer,
+ gpointer user_data)
+{
+ /* Put PCB's accelerators back.
+ *
+ * XXX: We should not have to do this within a simple widget,
+ * and this quick hack workaround breaks the widget's
+ * abstraction from the rest of the application :(
+ */
+ ghid_install_accel_groups (GTK_WINDOW (gport->top_window), ghidgui);
+}
+
+/*! \brief Callback for when a layer name has been edited */
+static void
+layer_name_edited_cb (GtkCellRendererText *renderer,
+ gchar *path,
+ gchar *new_text,
+ gpointer user_data)
+{
+ GHidLayerSelector *ls = user_data;
+ GtkTreeIter iter;
+ int user_id;
+
+ /* Put PCB's accelerators back.
+ *
+ * XXX: We should not have to do this within a simple widget,
+ * and this quick hack workaround breaks the widget's
+ * abstraction from the rest of the application :(
+ */
+ ghid_install_accel_groups (GTK_WINDOW (gport->top_window), ghidgui);
+
+ if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ls->list_store), &iter, path))
+ return;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (ls->list_store),
+ &iter,
+ USER_ID_COL, &user_id,
+ -1);
+
+ g_signal_emit (ls, ghid_layer_selector_signals[RENAME_LAYER_SIGNAL],
+ 0, user_id, new_text);
+}
+
+
/*! \brief Callback for menu actions: sync layer selection list, emit signal */
static void
menu_view_cb (GtkToggleAction *action, struct _layer *ldata)
@@ -300,20 +403,37 @@ ghid_layer_selector_init (GHidLayerSelector *ls)
renderer1 = ghid_cell_renderer_visibility_new ();
renderer2 = gtk_cell_renderer_text_new ();
-
- opacity_col = gtk_tree_view_column_new_with_attributes ("", renderer1,
+ g_object_set (renderer2, "editable-set", TRUE, NULL);
+ g_signal_connect (renderer2, "editing-started",
+ G_CALLBACK (layer_name_editing_started_cb), ls);
+ g_signal_connect (renderer2, "editing-canceled",
+ G_CALLBACK (layer_name_editing_canceled_cb), ls);
+ g_signal_connect (renderer2, "edited",
+ G_CALLBACK (layer_name_edited_cb), ls);
+
+ opacity_col = gtk_tree_view_column_new_with_attributes ("",
+ renderer1,
"active", VISIBLE_COL,
- "color", COLOR_COL, NULL);
- name_col = gtk_tree_view_column_new_with_attributes ("", renderer2,
+ "color", COLOR_COL,
+ NULL);
+ name_col = gtk_tree_view_column_new_with_attributes ("",
+ renderer2,
"text", TEXT_COL,
"font", FONT_COL,
+ "editable", EDITABLE_COL,
NULL);
- /* action index, active, color, text, font, is_separator */
- ls->list_store = gtk_list_store_new (N_COLS, G_TYPE_POINTER, G_TYPE_INT,
- G_TYPE_BOOLEAN, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
+ ls->list_store = gtk_list_store_new (N_COLS,
+ /* STRUCT_COL */ G_TYPE_POINTER,
+ /* USER_ID_COL */ G_TYPE_INT,
+ /* VISIBLE_COL */ G_TYPE_BOOLEAN,
+ /* COLOR_COL */ G_TYPE_STRING,
+ /* TEXT_COL */ G_TYPE_STRING,
+ /* FONT_COL */ G_TYPE_STRING,
+ /* EDITABLE_COL */ G_TYPE_BOOLEAN,
+ /* ACTIVATABLE_COL */ G_TYPE_BOOLEAN,
+ /* SEPARATOR_COL */ G_TYPE_BOOLEAN);
+
gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), opacity_col, -1);
gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), name_col, -1);
gtk_tree_view_set_model (GTK_TREE_VIEW (ls), GTK_TREE_MODEL (ls->list_store));
@@ -364,6 +484,14 @@ ghid_layer_selector_class_init (GHidLayerSelectorClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__INT, G_TYPE_NONE,
1, G_TYPE_INT);
+ ghid_layer_selector_signals[RENAME_LAYER_SIGNAL] =
+ g_signal_new ("rename-layer",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GHidLayerSelectorClass, rename_layer),
+ NULL, NULL,
+ g_cclosure_user_marshal_VOID__INT_STRING, G_TYPE_NONE,
+ 2, G_TYPE_INT, G_TYPE_STRING);
object_class->finalize = ghid_layer_selector_finalize;
}
@@ -455,7 +583,8 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
const gchar *name,
const gchar *color_string,
gboolean visible,
- gboolean selectable)
+ gboolean selectable,
+ gboolean builtin)
{
struct _layer *new_layer = NULL;
gchar *pname, *vname;
@@ -523,6 +652,7 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
COLOR_COL, color_string,
TEXT_COL, name,
FONT_COL, selectable ? NULL : "Italic",
+ EDITABLE_COL, !builtin,
SELECTABLE_COL, selectable,
SEPARATOR_COL, FALSE,
-1);
diff --git a/src/hid/gtk/ghid-layer-selector.h b/src/hid/gtk/ghid-layer-selector.h
index ff67800..1ed5e01 100644
--- a/src/hid/gtk/ghid-layer-selector.h
+++ b/src/hid/gtk/ghid-layer-selector.h
@@ -24,7 +24,8 @@ void ghid_layer_selector_add_layer (GHidLayerSelector *ls,
const gchar *name,
const gchar *color_string,
gboolean visible,
- gboolean selectable);
+ gboolean selectable,
+ gboolean builtin);
gint ghid_layer_selector_install_pick_items (GHidLayerSelector *ls,
GtkMenuShell *shell, gint pos);
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 98bfcfe..4f25e72 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -553,6 +553,33 @@ layer_selector_select_callback (GHidLayerSelector *ls, int layer, gpointer d)
ghid_invalidate_all ();
}
+/*! \brief Callback for GHidLayerSelector layer renaming */
+static void
+layer_selector_rename_callback (GHidLayerSelector *ls,
+ int layer_id,
+ char *new_name,
+ void *userdata)
+{
+ LayerType *layer = LAYER_PTR (layer_id);
+
+ /* Check for a legal layer name - for now, allow anything non-empty */
+ if (new_name[0] == '\0')
+ return;
+
+ /* Don't bother if the name is identical to the current one */
+ if (strcmp (layer->Name, new_name) == 0)
+ return;
+
+ free (layer->Name);
+ layer->Name = strdup (new_name);
+ ghid_layer_buttons_update ();
+ if (!PCB->Changed)
+ {
+ SetChangedFlag (true);
+ ghid_window_set_name_label (PCB->Name);
+ }
+}
+
/*! \brief Callback for GHidLayerSelector layer toggling */
static void
layer_selector_toggle_callback (GHidLayerSelector *ls, int layer, gpointer d)
@@ -772,22 +799,22 @@ make_virtual_layer_buttons (GtkWidget *layer_selector)
layer_process (&color_string, &text, &active, LAYER_BUTTON_SILK);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_SILK,
- text, color_string, active, TRUE);
+ text, color_string, active, TRUE, TRUE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_RATS);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_RATS,
- text, color_string, active, TRUE);
+ text, color_string, active, TRUE, TRUE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_PINS);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_PINS,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, TRUE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_VIAS);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_VIAS,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, TRUE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_FARSIDE);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_FARSIDE,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, TRUE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_MASK);
ghid_layer_selector_add_layer (layersel, LAYER_BUTTON_MASK,
- text, color_string, active, FALSE);
+ text, color_string, active, FALSE, TRUE);
}
/*! \brief callback for ghid_layer_selector_update_colors */
@@ -821,7 +848,7 @@ make_layer_buttons (GtkWidget *layersel)
{
layer_process (&color_string, &text, &active, i);
ghid_layer_selector_add_layer (GHID_LAYER_SELECTOR (layersel), i,
- text, color_string, active, TRUE);
+ text, color_string, active, TRUE, FALSE);
}
}
@@ -1248,12 +1275,15 @@ ghid_build_pcb_top_window (void)
ghidgui->layer_selector = ghid_layer_selector_new ();
make_layer_buttons (ghidgui->layer_selector);
make_virtual_layer_buttons (ghidgui->layer_selector);
- g_signal_connect (G_OBJECT (ghidgui->layer_selector), "select_layer",
+ g_signal_connect (G_OBJECT (ghidgui->layer_selector), "select-layer",
G_CALLBACK (layer_selector_select_callback),
NULL);
- g_signal_connect (G_OBJECT (ghidgui->layer_selector), "toggle_layer",
+ g_signal_connect (G_OBJECT (ghidgui->layer_selector), "toggle-layer",
G_CALLBACK (layer_selector_toggle_callback),
NULL);
+ g_signal_connect (G_OBJECT (ghidgui->layer_selector), "rename-layer",
+ G_CALLBACK (layer_selector_rename_callback),
+ NULL);
/* Build main menu */
ghidgui->menu_bar = ghid_load_menus ();
gtk_box_pack_start (GTK_BOX (ghidgui->menubar_toolbar_vbox),
commit 1f264644a8e39505b028159459d78b2020c3fb60
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Layer selector - Rename "activatable" to "selectable"
GTK has a special meaning for the word "activatable", meaning that the item
can be double-clicked, or "activated" by hitting enter on it. We use it to
mean selectable - so change the code to make this clear.
diff --git a/src/hid/gtk/ghid-layer-selector.c b/src/hid/gtk/ghid-layer-selector.c
index ca5abe9..43b0fa3 100644
--- a/src/hid/gtk/ghid-layer-selector.c
+++ b/src/hid/gtk/ghid-layer-selector.c
@@ -40,7 +40,7 @@ enum {
COLOR_COL,
TEXT_COL,
FONT_COL,
- ACTIVATABLE_COL,
+ SELECTABLE_COL,
SEPARATOR_COL,
N_COLS
};
@@ -173,9 +173,9 @@ tree_selection_func (GtkTreeSelection *selection, GtkTreeModel *model,
if (gtk_tree_model_get_iter (model, &iter, path))
{
- gboolean activatable;
- gtk_tree_model_get (model, &iter, ACTIVATABLE_COL, &activatable, -1);
- return activatable;
+ gboolean selectable;
+ gtk_tree_model_get (model, &iter, SELECTABLE_COL, &selectable, -1);
+ return selectable;
}
return FALSE;
@@ -203,14 +203,15 @@ button_press_cb (GHidLayerSelector *ls, GdkEventButton *event)
&path, &column, NULL, NULL))
{
GtkTreeIter iter;
- gboolean activatable, separator;
+ gboolean selectable;
+ gboolean separator;
gtk_tree_model_get_iter (GTK_TREE_MODEL (ls->list_store), &iter, path);
gtk_tree_model_get (GTK_TREE_MODEL (ls->list_store), &iter,
- ACTIVATABLE_COL, &activatable,
+ SELECTABLE_COL, &selectable,
SEPARATOR_COL, &separator, -1);
- /* Toggle visibility for non-activatable layers no matter
+ /* Toggle visibility for non-selectable layers no matter
* where you click. */
- if (!separator && (column == ls->visibility_column || !activatable))
+ if (!separator && (column == ls->visibility_column || !selectable))
{
toggle_visibility (ls, &iter, TRUE);
return TRUE;
@@ -446,7 +447,7 @@ ghid_layer_selector_new (void)
* \param [in] name The name of the layer; will be used on selector and menus
* \param [in] color_string The color of the layer on selector
* \param [in] visibile Whether the layer is visible
- * \param [in] activatable Whether the layer appears in menus and can be selected
+ * \param [in] selectable Whether the layer appears in menus and can be selected
*/
void
ghid_layer_selector_add_layer (GHidLayerSelector *ls,
@@ -454,12 +455,12 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
const gchar *name,
const gchar *color_string,
gboolean visible,
- gboolean activatable)
+ gboolean selectable)
{
struct _layer *new_layer = NULL;
gchar *pname, *vname;
gboolean new_iter = TRUE;
- gboolean last_activatable = TRUE;
+ gboolean last_selectable = TRUE;
GtkTreePath *path;
GtkTreeIter iter;
int i;
@@ -468,17 +469,19 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ls->list_store), &iter))
do
{
- gboolean is_sep, active;
+ gboolean is_sep;
+ gboolean this_selectable;
gint read_id;
+
gtk_tree_model_get (GTK_TREE_MODEL (ls->list_store),
&iter, USER_ID_COL, &read_id,
SEPARATOR_COL, &is_sep,
- ACTIVATABLE_COL, &active, -1);
+ SELECTABLE_COL, &this_selectable, -1);
if (is_sep)
continue;
- last_activatable = active;
+ last_selectable = this_selectable;
if (read_id == user_id)
{
new_iter = FALSE;
@@ -490,9 +493,9 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
/* Handle separator addition */
if (new_iter)
{
- if (activatable != last_activatable)
+ if (selectable != last_selectable)
{
- /* Add separator between activatable/non-activatable boundaries */
+ /* Add separator between selectable / non-selectable boundaries */
gtk_list_store_append (ls->list_store, &iter);
gtk_list_store_set (ls->list_store, &iter,
STRUCT_COL, NULL,
@@ -519,8 +522,8 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
VISIBLE_COL, visible,
COLOR_COL, color_string,
TEXT_COL, name,
- FONT_COL, activatable ? NULL : "Italic",
- ACTIVATABLE_COL, activatable,
+ FONT_COL, selectable ? NULL : "Italic",
+ SELECTABLE_COL, selectable,
SEPARATOR_COL, FALSE,
-1);
@@ -535,7 +538,7 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
gtk_tree_path_free (path);
/* Create selection action */
- if (activatable)
+ if (selectable)
{
new_layer->pick_action
= gtk_radio_action_new (pname, name, NULL, NULL, user_id);
@@ -563,7 +566,7 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
i < 10 ? "" : "<Alt>",
(i + 1) % 10);
- if (activatable)
+ if (selectable)
{
GtkAction *action = GTK_ACTION (new_layer->pick_action);
gtk_action_set_accel_group (action, ls->accel_group);
@@ -772,11 +775,13 @@ ghid_layer_selector_select_next_visible (GHidLayerSelector *ls)
/* Scan forward, looking for selectable iter */
do
{
- gboolean visible, activatable;
+ gboolean visible;
+ gboolean selectable;
+
gtk_tree_model_get (GTK_TREE_MODEL (ls->list_store),
&iter, VISIBLE_COL, &visible,
- ACTIVATABLE_COL, &activatable, -1);
- if (visible && activatable)
+ SELECTABLE_COL, &selectable, -1);
+ if (visible && selectable)
{
gtk_tree_selection_select_iter (ls->selection, &iter);
return TRUE;
@@ -787,11 +792,13 @@ ghid_layer_selector_select_next_visible (GHidLayerSelector *ls)
gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ls->list_store), &iter);
do
{
- gboolean visible, activatable;
+ gboolean visible;
+ gboolean selectable;
+
gtk_tree_model_get (GTK_TREE_MODEL (ls->list_store),
&iter, VISIBLE_COL, &visible,
- ACTIVATABLE_COL, &activatable, -1);
- if (visible && activatable)
+ SELECTABLE_COL, &selectable, -1);
+ if (visible && selectable)
{
gtk_tree_selection_select_iter (ls->selection, &iter);
return TRUE;
diff --git a/src/hid/gtk/ghid-layer-selector.h b/src/hid/gtk/ghid-layer-selector.h
index 09fa182..ff67800 100644
--- a/src/hid/gtk/ghid-layer-selector.h
+++ b/src/hid/gtk/ghid-layer-selector.h
@@ -24,7 +24,7 @@ void ghid_layer_selector_add_layer (GHidLayerSelector *ls,
const gchar *name,
const gchar *color_string,
gboolean visible,
- gboolean activatable);
+ gboolean selectable);
gint ghid_layer_selector_install_pick_items (GHidLayerSelector *ls,
GtkMenuShell *shell, gint pos);
commit b23b65887e9874270677189765c960e2fcc8985b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Layer selector - remove unused variable
diff --git a/src/hid/gtk/ghid-layer-selector.c b/src/hid/gtk/ghid-layer-selector.c
index 7648261..ca5abe9 100644
--- a/src/hid/gtk/ghid-layer-selector.c
+++ b/src/hid/gtk/ghid-layer-selector.c
@@ -64,8 +64,6 @@ struct _GHidLayerSelector
gboolean accel_available[20];
- gboolean last_activatable;
-
gulong selection_changed_sig_id;
};
@@ -320,7 +318,6 @@ ghid_layer_selector_init (GHidLayerSelector *ls)
gtk_tree_view_set_model (GTK_TREE_VIEW (ls), GTK_TREE_MODEL (ls->list_store));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ls), FALSE);
- ls->last_activatable = TRUE;
ls->visibility_column = opacity_col;
ls->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ls));
ls->accel_group = gtk_accel_group_new ();
commit 347f55ffb64a16d90c3753d9f398a31a86ec7310
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Refactor to remove some duplicated code in the layer selector
diff --git a/src/hid/gtk/ghid-layer-selector.c b/src/hid/gtk/ghid-layer-selector.c
index 72ec44d..7648261 100644
--- a/src/hid/gtk/ghid-layer-selector.c
+++ b/src/hid/gtk/ghid-layer-selector.c
@@ -477,14 +477,15 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
&iter, USER_ID_COL, &read_id,
SEPARATOR_COL, &is_sep,
ACTIVATABLE_COL, &active, -1);
- if (!is_sep)
+
+ if (is_sep)
+ continue;
+
+ last_activatable = active;
+ if (read_id == user_id)
{
- last_activatable = active;
- if(read_id == user_id)
- {
- new_iter = FALSE;
- break;
- }
+ new_iter = FALSE;
+ break;
}
}
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (ls->list_store), &iter));
@@ -501,18 +502,7 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
SEPARATOR_COL, TRUE, -1);
}
/* Create new layer */
- new_layer = malloc (sizeof (*new_layer));
gtk_list_store_append (ls->list_store, &iter);
- gtk_list_store_set (ls->list_store, &iter,
- STRUCT_COL, new_layer,
- USER_ID_COL, user_id,
- VISIBLE_COL, visible,
- COLOR_COL, color_string,
- TEXT_COL, name,
- FONT_COL, activatable ? NULL : "Italic",
- ACTIVATABLE_COL, activatable,
- SEPARATOR_COL, FALSE,
- -1);
}
else
{
@@ -521,18 +511,22 @@ ghid_layer_selector_add_layer (GHidLayerSelector *ls,
gtk_tree_model_get (GTK_TREE_MODEL (ls->list_store), &iter,
STRUCT_COL, &new_layer, -1);
free_ldata (ls, new_layer);
- new_layer = malloc (sizeof (*new_layer));
-
- gtk_list_store_set (ls->list_store, &iter,
- STRUCT_COL, new_layer,
- VISIBLE_COL, visible,
- COLOR_COL, color_string,
- TEXT_COL, name,
- FONT_COL, activatable ? NULL : "Italic",
- ACTIVATABLE_COL, activatable,
- -1);
}
+ new_layer = malloc (sizeof (*new_layer));
+
+ gtk_list_store_set (ls->list_store,
+ &iter,
+ STRUCT_COL, new_layer,
+ USER_ID_COL, user_id,
+ VISIBLE_COL, visible,
+ COLOR_COL, color_string,
+ TEXT_COL, name,
+ FONT_COL, activatable ? NULL : "Italic",
+ ACTIVATABLE_COL, activatable,
+ SEPARATOR_COL, FALSE,
+ -1);
+
/* -- Setup new actions -- */
vname = g_strdup_printf ("LayerView%d", ls->n_actions);
pname = g_strdup_printf ("LayerPick%d", ls->n_actions);
commit 1cc1a36b2d9348a820be0306f4232be1d79e9c9b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Better encapsulate some of the layer selector initialisation
The work we do within ghid_layer_selector_new() is better placed in the
appropriate class initialiser functions, otherwise we needn't go to the
trouble of subclassing a widget in the first place.
diff --git a/src/hid/gtk/ghid-layer-selector.c b/src/hid/gtk/ghid-layer-selector.c
index 840cd98..72ec44d 100644
--- a/src/hid/gtk/ghid-layer-selector.c
+++ b/src/hid/gtk/ghid-layer-selector.c
@@ -290,11 +290,59 @@ menu_pick_cb (GtkRadioAction *action, struct _layer *ldata)
}
}
-/* CONSTRUCTOR */
static void
ghid_layer_selector_init (GHidLayerSelector *ls)
{
- /* Hookup signal handlers */
+ int i;
+ GtkCellRenderer *renderer1;
+ GtkCellRenderer *renderer2;
+ GtkTreeViewColumn *opacity_col;
+ GtkTreeViewColumn *name_col;
+
+ renderer1 = ghid_cell_renderer_visibility_new ();
+ renderer2 = gtk_cell_renderer_text_new ();
+
+ opacity_col = gtk_tree_view_column_new_with_attributes ("", renderer1,
+ "active", VISIBLE_COL,
+ "color", COLOR_COL, NULL);
+ name_col = gtk_tree_view_column_new_with_attributes ("", renderer2,
+ "text", TEXT_COL,
+ "font", FONT_COL,
+ NULL);
+
+ /* action index, active, color, text, font, is_separator */
+ ls->list_store = gtk_list_store_new (N_COLS, G_TYPE_POINTER, G_TYPE_INT,
+ G_TYPE_BOOLEAN, G_TYPE_STRING,
+ G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
+ gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), opacity_col, -1);
+ gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), name_col, -1);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (ls), GTK_TREE_MODEL (ls->list_store));
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ls), FALSE);
+
+ ls->last_activatable = TRUE;
+ ls->visibility_column = opacity_col;
+ ls->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ls));
+ ls->accel_group = gtk_accel_group_new ();
+ ls->action_group = gtk_action_group_new ("LayerSelector");
+ ls->n_actions = 0;
+
+ for (i = 0; i < 20; ++i)
+ ls->accel_available[i] = TRUE;
+
+ gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (ls),
+ tree_view_separator_func,
+ NULL, NULL);
+ gtk_tree_selection_set_select_function (ls->selection, tree_selection_func,
+ NULL, NULL);
+ gtk_tree_selection_set_mode (ls->selection, GTK_SELECTION_BROWSE);
+
+ g_object_set_data (G_OBJECT (ls->list_store), "layer-selector", ls);
+ g_signal_connect (ls, "button_press_event",
+ G_CALLBACK (button_press_cb), NULL);
+ ls->selection_changed_sig_id =
+ g_signal_connect (ls->selection, "changed",
+ G_CALLBACK (selection_changed_cb), ls);
}
static void
@@ -383,55 +431,7 @@ ghid_layer_selector_get_type (void)
GtkWidget *
ghid_layer_selector_new (void)
{
- int i;
- GtkCellRenderer *renderer1 = ghid_cell_renderer_visibility_new ();
- GtkCellRenderer *renderer2 = gtk_cell_renderer_text_new ();
- GtkTreeViewColumn *opacity_col =
- gtk_tree_view_column_new_with_attributes ("", renderer1,
- "active", VISIBLE_COL,
- "color", COLOR_COL, NULL);
- GtkTreeViewColumn *name_col =
- gtk_tree_view_column_new_with_attributes ("", renderer2,
- "text", TEXT_COL,
- "font", FONT_COL,
- NULL);
-
- GHidLayerSelector *ls = g_object_new (GHID_LAYER_SELECTOR_TYPE, NULL);
-
- /* action index, active, color, text, font, is_separator */
- ls->list_store = gtk_list_store_new (N_COLS, G_TYPE_POINTER, G_TYPE_INT,
- G_TYPE_BOOLEAN, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), opacity_col, -1);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (ls), name_col, -1);
- gtk_tree_view_set_model (GTK_TREE_VIEW (ls), GTK_TREE_MODEL (ls->list_store));
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ls), FALSE);
-
- ls->last_activatable = TRUE;
- ls->visibility_column = opacity_col;
- ls->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ls));
- ls->accel_group = gtk_accel_group_new ();
- ls->action_group = gtk_action_group_new ("LayerSelector");
- ls->n_actions = 0;
- for (i = 0; i < 20; ++i)
- ls->accel_available[i] = TRUE;
-
- gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (ls),
- tree_view_separator_func,
- NULL, NULL);
- gtk_tree_selection_set_select_function (ls->selection, tree_selection_func,
- NULL, NULL);
- gtk_tree_selection_set_mode (ls->selection, GTK_SELECTION_BROWSE);
-
- g_object_set_data (G_OBJECT (ls->list_store), "layer-selector", ls);
- g_signal_connect (ls, "button_press_event",
- G_CALLBACK (button_press_cb), NULL);
- ls->selection_changed_sig_id =
- g_signal_connect (ls->selection, "changed",
- G_CALLBACK (selection_changed_cb), ls);
-
- return GTK_WIDGET (ls);
+ return GTK_WIDGET (g_object_new (GHID_LAYER_SELECTOR_TYPE, NULL));
}
/*! \brief Add a layer to a GHidLayerSelector.
commit 758950bce677f9bda6cc069ea68c9ca1d06725ad
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Don't refleak the accel group created by the layer selector
When the accel group is created, we have a reference to it - we don't need
another.
diff --git a/src/hid/gtk/ghid-layer-selector.c b/src/hid/gtk/ghid-layer-selector.c
index 639e2be..840cd98 100644
--- a/src/hid/gtk/ghid-layer-selector.c
+++ b/src/hid/gtk/ghid-layer-selector.c
@@ -431,8 +431,6 @@ ghid_layer_selector_new (void)
g_signal_connect (ls->selection, "changed",
G_CALLBACK (selection_changed_cb), ls);
- g_object_ref (ls->accel_group);
-
return GTK_WIDGET (ls);
}
commit 31f3ad1fe78cacbb210044cfa2bdb27d8ad2524a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove the unused function utf8_dup_string
diff --git a/src/hid/gtk/gui-utils.c b/src/hid/gtk/gui-utils.c
index 7136fbb..0fcb5d2 100644
--- a/src/hid/gtk/gui-utils.c
+++ b/src/hid/gtk/gui-utils.c
@@ -838,34 +838,3 @@ ghid_scrolled_text_view (GtkWidget * box,
*scr = scrolled;
return view;
}
-
-
-/* If src is not utf8, *dst is converted to utf8.
- */
-gboolean
-utf8_dup_string (gchar ** dst_utf8, const gchar * src)
-{
- if (!dst_utf8 || (!*dst_utf8 && !src))
- return FALSE;
- if (*dst_utf8)
- {
- if (src && !strcmp (*dst_utf8, src))
- return FALSE;
- g_free (*dst_utf8);
- }
- if (src)
- {
- if (g_utf8_validate (src, -1, NULL))
- *dst_utf8 = g_strdup (src);
- else
- {
- *dst_utf8 = g_locale_to_utf8 (src, -1, NULL, NULL, NULL);
- if (!*dst_utf8)
- *dst_utf8 = g_strdup (src);
- }
- }
- else
- *dst_utf8 = NULL;
-
- return TRUE;
-}
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 5ba5aeb..ea49bee 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -347,7 +347,6 @@ void make_route_style_buttons (GHidRouteStyleSelector *rss);
/* gui-utils.c
*/
gboolean dup_string (gchar ** dst, const gchar * src);
-gboolean utf8_dup_string (gchar ** dst_utf8, const gchar * src);
void free_glist_and_data (GList ** list_head);
ModifierKeysState ghid_modifier_keys_state (GdkModifierType * state);
commit 53a53695310aa9b7af7278ac93f5026d2bf59067
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Don't use dup_string where doing so would mix g_free() and free()
The core uses malloc(), strdup(), free() etc..
The GTK HID primarily uses g_malloc(), g_strdup(), g_free() etc..
Mixing them can lead to bad behaviour and hard to debug crashes. This
commit is not aimed at fixing any known bugs, but is "by inspection", as
I spotted some of these when working on a layer selector patch.
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index dba0635..7b2751a 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -169,6 +169,20 @@ static ConfigAttribute config_attributes[] = {
{"layer-name-8", CONFIG_Unused, NULL},
};
+static gboolean
+dup_core_string (gchar ** dst, const gchar * src)
+{
+ if (dst == NULL || (*dst == NULL && src == NULL))
+ return FALSE;
+
+ if (*dst != NULL && src != NULL && strcmp (*dst, src) == 0)
+ return FALSE;
+
+ free (*dst);
+ *dst = (src == NULL) ? NULL : strdup (src);
+
+ return TRUE;
+}
static FILE *
config_file_open (gchar * mode)
@@ -1362,10 +1376,10 @@ config_layers_apply (void)
{
layer = &PCB->Data->Layer[i];
s = ghid_entry_get_text (layer_entry[i]);
- if (dup_string (&layer->Name, s))
+ if (dup_core_string (&layer->Name, s))
layers_modified = TRUE;
/* FIXME */
- if (use_as_default && dup_string (&Settings.DefaultLayerName[i], s))
+ if (use_as_default && dup_core_string (&Settings.DefaultLayerName[i], s))
ghidgui->config_modified = TRUE;
}
@@ -1421,7 +1435,7 @@ config_layers_apply (void)
if (use_as_default)
{
s = make_layer_group_string (&PCB->LayerGroups);
- if (dup_string (&Settings.Groups, s))
+ if (dup_core_string (&Settings.Groups, s))
{
ParseGroupString (Settings.Groups, &Settings.LayerGroups, max_copper_layer);
ghidgui->config_modified = TRUE;
@@ -1460,7 +1474,7 @@ layer_name_entry_cb(GtkWidget *entry, gpointer data)
layer = &PCB->Data->Layer[i];
name = ghid_entry_get_text(entry);
- if (dup_string (&layer->Name, name))
+ if (dup_core_string (&layer->Name, name))
ghid_layer_buttons_update();
}
@@ -1712,7 +1726,7 @@ config_color_defaults_cb (gpointer data)
{
cc = (ConfigColor *) list->data;
ha = cc->attributes;
- dup_string ((char **) ha->value, ha->default_val.str_value);
+ dup_core_string ((char **) ha->value, ha->default_val.str_value);
cc->color_is_mapped = FALSE;
ghid_set_special_colors (ha);
}
|
|
From: <gi...@gp...> - 2011-09-29 17:25:26
|
The branch, master has been updated
via 29c65d98352be5be38b2746ebfd9cc650a0ee04c (commit)
from 789c632f69c093da731c2194f74ae5aa701697c4 (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 | 16 ++++++----------
src/draw.h | 7 +++++++
src/hid/gtk/gtkhid-main.c | 3 ++-
3 files changed, 15 insertions(+), 11 deletions(-)
=================
Commit Messages
=================
commit 29c65d98352be5be38b2746ebfd9cc650a0ee04c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Expose some drawing APIs for the HIDs to use directly...
Exposes:
DrawLayerGroup
DrawPaste
DrawSilk
DrawMask
DrawHoles
PrintAssembly
:100644 100644 deb9e65... a06dde1... M src/draw.c
:100644 100644 ef32ebb... d92dee5... M src/draw.h
:100644 100644 a83ee2e... 544b6a2... M src/hid/gtk/gtkhid-main.c
=========
Changes
=========
commit 29c65d98352be5be38b2746ebfd9cc650a0ee04c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Expose some drawing APIs for the HIDs to use directly...
Exposes:
DrawLayerGroup
DrawPaste
DrawSilk
DrawMask
DrawHoles
PrintAssembly
diff --git a/src/draw.c b/src/draw.c
index deb9e65..a06dde1 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -83,14 +83,10 @@ static bool doing_assy = false;
*/
static void DrawEverything (const BoxType *);
static void DrawPPV (int group, const BoxType *);
-static void DrawLayerGroup (int, const BoxType *);
static void AddPart (void *);
static void SetPVColor (PinTypePtr, int);
static void DrawEMark (ElementTypePtr, Coord, Coord, bool);
-static void DrawMask (int side, const BoxType *);
-static void DrawPaste (int side, const BoxType *);
static void DrawRats (const BoxType *);
-static void DrawSilk (int side, const BoxType *);
/*--------------------------------------------------------------------------------------
* setup color for pin or via
@@ -442,7 +438,7 @@ hole_callback (const BoxType * b, void *cl)
return 1;
}
-static void
+void
DrawHoles (bool draw_plated, bool draw_unplated, const BoxType *drawn_area)
{
int plated = -1;
@@ -604,7 +600,7 @@ element_callback (const BoxType * b, void *cl)
* prints assembly drawing.
*/
-static void
+void
PrintAssembly (int side, const BoxType * drawn_area)
{
int side_group = GetLayerGroupNumberByNumber (max_copper_layer + side);
@@ -930,7 +926,7 @@ clearPad_callback (const BoxType * b, void *cl)
* Draws silk layer.
*/
-static void
+void
DrawSilk (int side, const BoxType * drawn_area)
{
#if 0
@@ -989,7 +985,7 @@ DrawMaskBoardArea (int mask_type, const BoxType *drawn_area)
/* ---------------------------------------------------------------------------
* draws solder mask layer - this will cover nearly everything
*/
-static void
+void
DrawMask (int side, const BoxType *screen)
{
int thin = TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB);
@@ -1018,7 +1014,7 @@ DrawMask (int side, const BoxType *screen)
/* ---------------------------------------------------------------------------
* draws solder paste layer for a given side of the board
*/
-static void
+void
DrawPaste (int side, const BoxType *drawn_area)
{
gui->set_color (Output.fgGC, PCB->ElementColor);
@@ -1111,7 +1107,7 @@ DrawLayer (LayerTypePtr Layer, const BoxType * screen)
* draws one layer group. If the exporter is not a GUI,
* also draws the pins / pads / vias in this layer group.
*/
-static void
+void
DrawLayerGroup (int group, const BoxType *drawn_area)
{
int i, rv = 1;
diff --git a/src/draw.h b/src/draw.h
index ef32ebb..d92dee5 100644
--- a/src/draw.h
+++ b/src/draw.h
@@ -71,4 +71,11 @@ void EraseElementPinsAndPads (ElementTypePtr);
void EraseElementName (ElementTypePtr);
void EraseObject (int, void *, void *);
+void DrawLayerGroup (int side, const BoxType *drawn_area);
+void DrawPaste (int side, const BoxType *drawn_area);
+void DrawSilk (int side, const BoxType *drawn_area);
+void DrawMask (int side, const BoxType *drawn_area);
+void DrawHoles (bool draw_plated, bool draw_unplated, const BoxType *drawn_area);
+void PrintAssembly (int side, const BoxType *drawn_area);
+
#endif
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index a83ee2e..544b6a2 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -1936,7 +1936,8 @@ N_("Bring up the popup menu specified by @code{MenuName}.\n"
This just pops up the specified menu. The menu must have been defined
as a named subresource of the Popups resource in the menu resource
-file.
+file. The second, optional (and ignored) argument represents the mouse
+button number which is triggering the popup.
%end-doc */
|
|
From: <gi...@gp...> - 2011-09-29 16:26:32
|
The branch, master has been updated
via 789c632f69c093da731c2194f74ae5aa701697c4 (commit)
via 30aaf303f5435d1305abede1766f36ed8dca41d9 (commit)
from 51beb7e187b8ee6be6377619f1ea8363c6e82d0c (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/gtkhid-gdk.c | 40 ++++++++++------------------------------
src/hid/gtk/gtkhid-gl.c | 37 ++++++++++++-------------------------
2 files changed, 22 insertions(+), 55 deletions(-)
=================
Commit Messages
=================
commit 789c632f69c093da731c2194f74ae5aa701697c4
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Simplify and correct ghid_show_crosshair() logic for the GL renderer
Drop the always-true parameter we were passed, and combine the code from
ghid_show_crosshair() and draw_crosshair() into one function.
:100644 100644 e559c4f... b9a569f... M src/hid/gtk/gtkhid-gl.c
commit 30aaf303f5435d1305abede1766f36ed8dca41d9
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove always-true parameter from show_crosshair() in GDK renderer
Pass the render_priv pointer instead - this is vaguely useful. Also
tidy the function a little to make it clearer, rolling the code from
show_crosshair() and draw_crosshair() together into a combined
"draw_crosshair()" function.
The function no longer rejects negative x drawing coordinates, but we
aren't passed those anyway.
:100644 100644 2d2d4c7... 963b5d4... M src/hid/gtk/gtkhid-gdk.c
=========
Changes
=========
commit 789c632f69c093da731c2194f74ae5aa701697c4
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Simplify and correct ghid_show_crosshair() logic for the GL renderer
Drop the always-true parameter we were passed, and combine the code from
ghid_show_crosshair() and draw_crosshair() into one function.
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index e559c4f..b9a569f 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -731,34 +731,19 @@ draw_dozen_cross (gint x, gint y, gint z)
}
static void
-draw_crosshair (gint x, gint y, gint z)
-{
- static enum crosshair_shape prev = Basic_Crosshair_Shape;
-
- draw_right_cross (x, y, z);
- if (prev == Union_Jack_Crosshair_Shape)
- draw_slanted_cross (x, y, z);
- if (prev == Dozen_Crosshair_Shape)
- draw_dozen_cross (x, y, z);
- prev = Crosshair.shape;
-}
-
-void
-ghid_show_crosshair (gboolean paint_new_location)
+draw_crosshair (render_priv *priv)
{
gint x, y, z;
static int done_once = 0;
static GdkColor cross_color;
- if (!paint_new_location)
- return;
-
if (!done_once)
{
done_once = 1;
/* FIXME: when CrossColor changed from config */
ghid_map_color_string (Settings.CrossColor, &cross_color);
}
+
x = gport->crosshair_x;
y = gport->crosshair_y;
z = 0;
@@ -770,12 +755,15 @@ ghid_show_crosshair (gboolean paint_new_location)
cross_color.green / 65535.,
cross_color.blue / 65535.);
- if (x >= 0 && paint_new_location)
- {
- glBegin (GL_LINES);
- draw_crosshair (x, y, z);
- glEnd ();
- }
+ glBegin (GL_LINES);
+
+ draw_right_cross (x, y, z);
+ if (Crosshair.shape == Union_Jack_Crosshair_Shape)
+ draw_slanted_cross (x, y, z);
+ if (Crosshair.shape == Dozen_Crosshair_Shape)
+ draw_dozen_cross (x, y, z);
+
+ glEnd ();
glDisable (GL_COLOR_LOGIC_OP);
}
@@ -966,8 +954,7 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
DrawMark ();
hidgl_flush_triangles (&buffer);
- ghid_show_crosshair (TRUE);
-
+ draw_crosshair (priv);
hidgl_flush_triangles (&buffer);
draw_lead_user (priv);
commit 30aaf303f5435d1305abede1766f36ed8dca41d9
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove always-true parameter from show_crosshair() in GDK renderer
Pass the render_priv pointer instead - this is vaguely useful. Also
tidy the function a little to make it clearer, rolling the code from
show_crosshair() and draw_crosshair() together into a combined
"draw_crosshair()" function.
The function no longer rejects negative x drawing coordinates, but we
aren't passed those anyway.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 2d2d4c7..963b5d4 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -1005,26 +1005,11 @@ draw_dozen_cross (GdkGC *xor_gc, gint x, gint y)
}
static void
-draw_crosshair (GdkGC *xor_gc, gint x, gint y)
+draw_crosshair (render_priv *priv)
{
- static enum crosshair_shape prev = Basic_Crosshair_Shape;
-
- draw_right_cross (xor_gc, x, y);
- if (prev == Union_Jack_Crosshair_Shape)
- draw_slanted_cross (xor_gc, x, y);
- if (prev == Dozen_Crosshair_Shape)
- draw_dozen_cross (xor_gc, x, y);
- prev = Crosshair.shape;
-}
-
-static void
-show_crosshair (gboolean paint_new_location)
-{
- render_priv *priv = gport->render_priv;
GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
GtkStyle *style = gtk_widget_get_style (gport->drawing_area);
gint x, y;
- static gint x_prev = -1, y_prev = -1;
static GdkGC *xor_gc;
static GdkColor cross_color;
@@ -1041,22 +1026,17 @@ show_crosshair (gboolean paint_new_location)
/* FIXME: when CrossColor changed from config */
ghid_map_color_string (Settings.CrossColor, &cross_color);
}
- x = DRAW_X (gport->crosshair_x);
- y = DRAW_Y (gport->crosshair_y);
gdk_gc_set_foreground (xor_gc, &cross_color);
- if (x_prev >= 0 && !paint_new_location)
- draw_crosshair (xor_gc, x_prev, y_prev);
+ x = DRAW_X (gport->crosshair_x);
+ y = DRAW_Y (gport->crosshair_y);
- if (x >= 0 && paint_new_location)
- {
- draw_crosshair (xor_gc, x, y);
- x_prev = x;
- y_prev = y;
- }
- else
- x_prev = y_prev = -1;
+ draw_right_cross (xor_gc, x, y);
+ if (Crosshair.shape == Union_Jack_Crosshair_Shape)
+ draw_slanted_cross (xor_gc, x, y);
+ if (Crosshair.shape == Dozen_Crosshair_Shape)
+ draw_dozen_cross (xor_gc, x, y);
}
void
@@ -1115,7 +1095,7 @@ ghid_screen_update (void)
gdk_draw_drawable (window, priv->bg_gc, gport->pixmap,
0, 0, 0, 0, gport->width, gport->height);
- show_crosshair (TRUE);
+ draw_crosshair (priv);
}
gboolean
@@ -1129,7 +1109,7 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
gdk_draw_drawable (window, priv->bg_gc, port->pixmap,
ev->area.x, ev->area.y, ev->area.x, ev->area.y,
ev->area.width, ev->area.height);
- show_crosshair (TRUE);
+ draw_crosshair (priv);
return FALSE;
}
|
|
From: <gi...@gp...> - 2011-09-29 15:18:39
|
The branch, master has been updated
via 51beb7e187b8ee6be6377619f1ea8363c6e82d0c (commit)
from 520177fc69554ce68c0b242e3c0fec5945c10ed9 (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/gtkhid-gl.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit 51beb7e187b8ee6be6377619f1ea8363c6e82d0c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix z-coordinate scaling for GL views.
(Fixes a 3D rendering bug in my PCB+GL branches, no visible effect
for git HEAD builds).
:100644 100644 15c9468... e559c4f... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit 51beb7e187b8ee6be6377619f1ea8363c6e82d0c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix z-coordinate scaling for GL views.
(Fixes a 3D rendering bug in my PCB+GL branches, no visible effect
for git HEAD builds).
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 15c9468..e559c4f 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -1066,11 +1066,13 @@ ghid_pinout_preview_expose (GtkWidget *widget,
ghid_invalidate_current_gc ();
glPushMatrix ();
glScalef ((gport->view.flip_x ? -1. : 1.) / gport->view.coord_per_px,
- (gport->view.flip_y ? -1. : 1.) / gport->view.coord_per_px, 1);
+ (gport->view.flip_y ? -1. : 1.) / gport->view.coord_per_px,
+ ((gport->view.flip_x == gport->view.flip_y) ? 1. : -1.) / gport->view.coord_per_px);
glTranslatef (gport->view.flip_x ? gport->view.x0 - PCB->MaxWidth :
-gport->view.x0,
gport->view.flip_y ? gport->view.y0 - PCB->MaxHeight :
-gport->view.y0, 0);
+
hid_expose_callback (&ghid_hid, NULL, &pinout->element);
hidgl_flush_triangles (&buffer);
glPopMatrix ();
@@ -1167,7 +1169,8 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
ghid_invalidate_current_gc ();
glPushMatrix ();
glScalef ((gport->view.flip_x ? -1. : 1.) / gport->view.coord_per_px,
- (gport->view.flip_y ? -1. : 1.) / gport->view.coord_per_px, 1);
+ (gport->view.flip_y ? -1. : 1.) / gport->view.coord_per_px,
+ ((gport->view.flip_x == gport->view.flip_y) ? 1. : -1.) / gport->view.coord_per_px);
glTranslatef (gport->view.flip_x ? gport->view.x0 - PCB->MaxWidth :
-gport->view.x0,
gport->view.flip_y ? gport->view.y0 - PCB->MaxHeight :
@@ -1234,7 +1237,7 @@ ghid_request_debug_draw (void)
glPushMatrix ();
glScalef ((port->view.flip_x ? -1. : 1.) / port->view.coord_per_px,
(port->view.flip_y ? -1. : 1.) / port->view.coord_per_px,
- (port->view.flip_x == port->view.flip_y) ? 1. : -1.);
+ ((gport->view.flip_x == port->view.flip_y) ? 1. : -1.) / gport->view.coord_per_px);
glTranslatef (port->view.flip_x ? port->view.x0 - PCB->MaxWidth :
-port->view.x0,
port->view.flip_y ? port->view.y0 - PCB->MaxHeight :
|
|
From: <gi...@gp...> - 2011-09-23 18:50:22
|
The branch, master has been updated
via 520177fc69554ce68c0b242e3c0fec5945c10ed9 (commit)
from bf9aa530be0cd35dcf12e64f5bad6315652bff11 (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/pcb-printf.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
=================
Commit Messages
=================
commit 520177fc69554ce68c0b242e3c0fec5945c10ed9
Author: Andrew Poelstra (local) <apo...@wp...>
Commit: Andrew Poelstra (local) <apo...@wp...>
Move pcb-printf #if 0 guards for %mr specifier to fix internationalization
Since the previous version of pcb cannot read files with suffixes
on its measures, right now the %mr specifier outputs measures in
cmils, no suffix.
The future behavior would be to select appropriate units and use
those, but for now this is disabled by an #if 0 block around the
relevant call to CoordToString.
This patch moves the #if 0 block to the suffix-specific part of
the code, since we DO want the other behavior of the %mr spec,
specifically, the forcing of '.' as a decimal separator.
:100644 100644 88c98ee... 20d5c9e... M src/pcb-printf.c
=========
Changes
=========
commit 520177fc69554ce68c0b242e3c0fec5945c10ed9
Author: Andrew Poelstra (local) <apo...@wp...>
Commit: Andrew Poelstra (local) <apo...@wp...>
Move pcb-printf #if 0 guards for %mr specifier to fix internationalization
Since the previous version of pcb cannot read files with suffixes
on its measures, right now the %mr specifier outputs measures in
cmils, no suffix.
The future behavior would be to select appropriate units and use
those, but for now this is disabled by an #if 0 block around the
relevant call to CoordToString.
This patch moves the #if 0 block to the suffix-specific part of
the code, since we DO want the other behavior of the %mr spec,
specifically, the forcing of '.' as a decimal separator.
diff --git a/src/pcb-printf.c b/src/pcb-printf.c
index 88c98ee..20d5c9e 100644
--- a/src/pcb-printf.c
+++ b/src/pcb-printf.c
@@ -412,7 +412,9 @@ static gchar *CoordsToString(Coord coord[], int n_coords, const char *printf_spe
g_string_append_printf (buff, " %s", suffix);
break;
case FILE_MODE:
+#if 0
g_string_append_printf (buff, "%s", suffix);
+#endif
break;
}
}
@@ -549,11 +551,7 @@ gchar *pcb_vprintf(const char *fmt, va_list args)
case 'S': unit_str = CoordsToString(value, 1, spec->str, mask & ALLOW_ALL, suffix); break;
case 'M': unit_str = CoordsToString(value, 1, spec->str, mask & ALLOW_METRIC, suffix); break;
case 'L': unit_str = CoordsToString(value, 1, spec->str, mask & ALLOW_IMPERIAL, suffix); break;
-#if 0
case 'r': unit_str = CoordsToString(value, 1, spec->str, ALLOW_READABLE, FILE_MODE); break;
-#else
- case 'r': unit_str = CoordsToString(value, 1, spec->str, ALLOW_READABLE, NO_SUFFIX); break;
-#endif
/* All these fallthroughs are deliberate */
case '9': value[count++] = va_arg(args, Coord);
case '8': value[count++] = va_arg(args, Coord);
|
|
From: <gi...@gp...> - 2011-09-23 00:03:07
|
The branch, master has been updated
via bf9aa530be0cd35dcf12e64f5bad6315652bff11 (commit)
via cf2586a52565f3306c5c7ca6f54bad0b26f84888 (commit)
from ed9a9d0cd9d054e6fc4a075ec1b8d9a12f1cb376 (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/action.c | 1 +
src/create.c | 1 -
2 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit bf9aa530be0cd35dcf12e64f5bad6315652bff11
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
create.c: Don't emit RouteStylesChanged from within CreateNewPCB()
The route style selector is hanging onto pointers of the
current PCB's route styles. When the action "RouteStylesChanged"
is called, these are compared against the current route style
to identify which one the GUI should show as selected.
When this call comes from within CreateNewPCB, and the OLD
PCB has already been free'd, this causes free'd memory to be read,
resulting in valgrind output such as:
==22404== Invalid read of size 8
==22404== at 0x4D82B3: ghid_route_style_selector_sync (ghid-route-style-selector.c:594)
==22404== by 0x4BAB28: RouteStylesChanged (gtkhid-main.c:1157)
==22404== by 0x49E0D3: hid_actionv (actions.c:247)
==22404== by 0x447B7B: CreateNewPCB (create.c:194)
==22404== by 0x4273E8: ActionNew (action.c:5902)
==22404== Address 0xd3c4458 is 13,880 bytes inside a block of size 14,120 free'd
==22404== at 0x4C282E0: free (vg_replace_malloc.c:366)
==22404== by 0x4273DE: ActionNew (action.c:5901)
Strictly speaking though - since CreateNewPCB does not directly
assign to the current PCB variable - it has no business in calling
the "RouteStylesChanged" action anyway.
Suitable update is taken care of later on in ActionNew(), as it
calls the "PCBChanged" action - the GTK implementation of which
in turn updates the route selector correctly.
Closes-bug: lp-856909
:100644 100644 c843582... a199acc... M src/create.c
commit cf2586a52565f3306c5c7ca6f54bad0b26f84888
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Set PCB = NULL; after freeing it in ActionNew()
When we call CreateNewPCB(), it trips over some code which wants
to access the current PCB in order to determine whether to
auto-save at exit. The code in question does check if PCB is
NULL first, so this is a sufficient fix for this case.
Fixes valgrind output such as:
==22404== Invalid read of size 8
==22404== at 0x470944: Parse (parse_l.l:282)
==22404== by 0x471913: ParseFont (parse_l.l:356)
==22404== by 0x447973: CreateDefaultFont (create.c:941)
==22404== by 0x447C58: CreateNewPCB (create.c:211)
==22404== by 0x4273E8: ActionNew (action.c:5902)
==22404== Address 0xd3c4538 is 14,104 bytes inside a block of size 14,120 free'd
==22404== at 0x4C282E0: free (vg_replace_malloc.c:366)
==22404== by 0x4273DE: ActionNew (action.c:5901)
Which is seen when starting an new layout from within PCB.
Affects-bug: lp-856909
:100644 100644 2edb9a9... 62c53e3... M src/action.c
=========
Changes
=========
commit bf9aa530be0cd35dcf12e64f5bad6315652bff11
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
create.c: Don't emit RouteStylesChanged from within CreateNewPCB()
The route style selector is hanging onto pointers of the
current PCB's route styles. When the action "RouteStylesChanged"
is called, these are compared against the current route style
to identify which one the GUI should show as selected.
When this call comes from within CreateNewPCB, and the OLD
PCB has already been free'd, this causes free'd memory to be read,
resulting in valgrind output such as:
==22404== Invalid read of size 8
==22404== at 0x4D82B3: ghid_route_style_selector_sync (ghid-route-style-selector.c:594)
==22404== by 0x4BAB28: RouteStylesChanged (gtkhid-main.c:1157)
==22404== by 0x49E0D3: hid_actionv (actions.c:247)
==22404== by 0x447B7B: CreateNewPCB (create.c:194)
==22404== by 0x4273E8: ActionNew (action.c:5902)
==22404== Address 0xd3c4458 is 13,880 bytes inside a block of size 14,120 free'd
==22404== at 0x4C282E0: free (vg_replace_malloc.c:366)
==22404== by 0x4273DE: ActionNew (action.c:5901)
Strictly speaking though - since CreateNewPCB does not directly
assign to the current PCB variable - it has no business in calling
the "RouteStylesChanged" action anyway.
Suitable update is taken care of later on in ActionNew(), as it
calls the "PCBChanged" action - the GTK implementation of which
in turn updates the route selector correctly.
Closes-bug: lp-856909
diff --git a/src/create.c b/src/create.c
index c843582..a199acc 100644
--- a/src/create.c
+++ b/src/create.c
@@ -191,7 +191,6 @@ CreateNewPCB (bool SetDefaultNames)
style->index = n;
}
END_LOOP;
- hid_action ("RouteStylesChanged");
ptr->Zoom = Settings.Zoom;
ptr->MaxWidth = Settings.MaxWidth;
ptr->MaxHeight = Settings.MaxHeight;
commit cf2586a52565f3306c5c7ca6f54bad0b26f84888
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Set PCB = NULL; after freeing it in ActionNew()
When we call CreateNewPCB(), it trips over some code which wants
to access the current PCB in order to determine whether to
auto-save at exit. The code in question does check if PCB is
NULL first, so this is a sufficient fix for this case.
Fixes valgrind output such as:
==22404== Invalid read of size 8
==22404== at 0x470944: Parse (parse_l.l:282)
==22404== by 0x471913: ParseFont (parse_l.l:356)
==22404== by 0x447973: CreateDefaultFont (create.c:941)
==22404== by 0x447C58: CreateNewPCB (create.c:211)
==22404== by 0x4273E8: ActionNew (action.c:5902)
==22404== Address 0xd3c4538 is 14,104 bytes inside a block of size 14,120 free'd
==22404== at 0x4C282E0: free (vg_replace_malloc.c:366)
==22404== by 0x4273DE: ActionNew (action.c:5901)
Which is seen when starting an new layout from within PCB.
Affects-bug: lp-856909
diff --git a/src/action.c b/src/action.c
index 2edb9a9..62c53e3 100644
--- a/src/action.c
+++ b/src/action.c
@@ -5899,6 +5899,7 @@ ActionNew (int argc, char **argv, Coord x, Coord y)
if (PCB->Changed && Settings.SaveInTMP)
SaveInTMP ();
RemovePCB (PCB);
+ PCB = NULL;
PCB = CreateNewPCB (true);
PCB->Data->LayerN = DEF_LAYER;
CreateNewPCBPost (PCB, 1);
|
|
From: <gi...@gp...> - 2011-09-19 10:25:18
|
The branch, master has been updated
discards 305d49a106a868fbbbecbbfd787e9005b4d38212 (commit)
via ed9a9d0cd9d054e6fc4a075ec1b8d9a12f1cb376 (commit)
from 305d49a106a868fbbbecbbfd787e9005b4d38212 (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 ed9a9d0cd9d054e6fc4a075ec1b8d9a12f1cb376
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix Pan action to stop after button release outside window
Previously, we required in-view coordinates to stop and start the
pan-action, and when the button was released outside the viewport,
the code was querying the user to click at a particular location.
Since the pan action doesn't even use the passed in coordinates,
simply remove the requirement for the x-y coordinates from this
action.
Closes-bug: lp-699307
:100644 100644 9b239e1... a83ee2e... M src/hid/gtk/gtkhid-main.c
=========
Changes
=========
commit ed9a9d0cd9d054e6fc4a075ec1b8d9a12f1cb376
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix Pan action to stop after button release outside window
Previously, we required in-view coordinates to stop and start the
pan-action, and when the button was released outside the viewport,
the code was querying the user to click at a particular location.
Since the pan action doesn't even use the passed in coordinates,
simply remove the requirement for the x-y coordinates from this
action.
Closes-bug: lp-699307
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 9b239e1..a83ee2e 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2030,7 +2030,7 @@ HID_Action ghid_main_action_list[] = {
{"LayerGroupsChanged", 0, LayerGroupsChanged},
{"LibraryChanged", 0, LibraryChanged},
{"Load", 0, Load},
- {"Pan", N_("Click on a place to pan"), PanAction, pan_help, pan_syntax},
+ {"Pan", 0, PanAction, pan_help, pan_syntax},
{"PCBChanged", 0, PCBChanged},
{"PointCursor", 0, PointCursor},
{"Popup", 0, Popup, popup_help, popup_syntax},
|
|
From: <gi...@gp...> - 2011-09-19 10:17:13
|
The branch, master has been updated
via 305d49a106a868fbbbecbbfd787e9005b4d38212 (commit)
from cd3bd7f15384402983e71c6673678ce614a3898f (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/gtkhid-main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 305d49a106a868fbbbecbbfd787e9005b4d38212
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix Pan action to stop after button release outside window
Previously, we required in-view coordinates to stop and start the
pan-action, and when the button was released outside the viewport,
the code was querying the user to click at a particular loacation.
Since the pan action doesn't even use the passed in coordinates,
simply remove the requirement for the x-y coordinates from this
action.
Closes-bug: lp-699307
:100644 100644 9b239e1... a83ee2e... M src/hid/gtk/gtkhid-main.c
=========
Changes
=========
commit 305d49a106a868fbbbecbbfd787e9005b4d38212
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Fix Pan action to stop after button release outside window
Previously, we required in-view coordinates to stop and start the
pan-action, and when the button was released outside the viewport,
the code was querying the user to click at a particular loacation.
Since the pan action doesn't even use the passed in coordinates,
simply remove the requirement for the x-y coordinates from this
action.
Closes-bug: lp-699307
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 9b239e1..a83ee2e 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2030,7 +2030,7 @@ HID_Action ghid_main_action_list[] = {
{"LayerGroupsChanged", 0, LayerGroupsChanged},
{"LibraryChanged", 0, LibraryChanged},
{"Load", 0, Load},
- {"Pan", N_("Click on a place to pan"), PanAction, pan_help, pan_syntax},
+ {"Pan", 0, PanAction, pan_help, pan_syntax},
{"PCBChanged", 0, PCBChanged},
{"PointCursor", 0, PointCursor},
{"Popup", 0, Popup, popup_help, popup_syntax},
|
|
From: <gi...@gp...> - 2011-09-18 21:10:45
|
The branch, pcb-20110918 has been updated
via bd56b7522660fe695e5ca2ffaae1d793db7d035d (commit)
from e002dc98b75b75477bcebe9eb090cdc9d95f70d3 (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
=========
doc/Makefile.am | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit bd56b7522660fe695e5ca2ffaae1d793db7d035d
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add options.texi to dist files
:100644 100644 e6e7593... cf36627... M doc/Makefile.am
=========
Changes
=========
commit bd56b7522660fe695e5ca2ffaae1d793db7d035d
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add options.texi to dist files
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e6e7593..cf36627 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -84,6 +84,7 @@ BUILT_SOURCES=
endif
inline_texi= \
+ options.texi \
actions.texi \
pcbfile.texi
|
|
From: <gi...@gp...> - 2011-09-18 20:12:25
|
The annotated tag, pcb-20110918-RELEASE has been created
at 76d0ed7c984343a0626a9142d6e7512a6b121d95 (tag)
tagging bd56b7522660fe695e5ca2ffaae1d793db7d035d (commit)
tagged by DJ Delorie
on Sun Sep 18 16:11:20 2011 -0400
pcb-20110918 release
Alberto Maccioni (1):
Add documentation for G-Code export GUI
Andrew Poelstra (166):
hid/png: Fix incorrect um unit conversion in bloat parser.
PCB / Physical unit macros patch
Subject: PCB / Physical unit macros patch 2: print.c
Add case-sensitivity to all unit-reading code
Universal use of GetValue
gEDA-dev: Gerber hid code cleanup
gEDA-dev: gerber-cleanup-0001-Remove-unused-Aperture-structure.patch
gEDA-dev: gerber-cleanup-0002-Remove-global-variable-dependence-from-maybe_close-a.patch
gEDA-dev: gerber-cleanup-0003-Add-new-aperture-functions-but-don-t-use-them.patch
gEDA-dev: gerber-cleanup-0004-Use-new-aperture-functions-output-100-equal-to-origi.patch
gEDA-dev: gerber-cleanup-0005-Remove-old-now-unused-aperture-structures-functions.patch
gEDA-dev: gerber-cleanup-0006-Change-a-couple-more-0-s-to-NULL-s.patch
Add support for reading unit suffixes in parser
Remove memory allocation from src/macro.h
Add pcb-printf.c to allow custom specifiers for unit output
Convert batch HID to use pcb-printf
Correct handling of %.*f in pcb-printf, remove from known issues
Convert BOM hid to use pcb-printf
Convert gcode hid to use pcb-printf
Convert gerber hid to use pcb-printf
Re-insert casts to unit conversion macros in gerber.c
Add hid_gerber3 test to check arc rendering
Set file pointer to NULL after closing in gerber.c
Fix typo (Polygon++ ==> PolygonN++) in src/move.c
Add Distance() function to avoid overflow with sqrt(x*x + y*y)
Add %m+ specifier to pcb-printf
Change report.c to use pcb-printf
Allow 1..9 accelerator keys to be applied to non-copper layers in gtk
Allow 1...9 and Ctrl+1...9 accellerators for silk/rats in lesstif
Add pcb_printf to pcb_*printf family of functions
Convert puller.c to use Distance() intead of its own function
Add # subspecifier to pcb-printf to prevent scaling for debug output
Convert file.c to use pcb-printf for cmil output
Change action.c *WARN* lines to use pcb-printf
Convert autoroute.c debug code to use pcb-printf
Convert djopt.c to use pcb-printf
Convert puller.c trace code to use pcb-printf
Convert polygon and polygon1.c debug code to use pcb-printf
Convert toporouter trace code to use pcb-printf
Fix typo in unplated hole output in report.c
Make sure scale/direction are not output as measures in file.c
Make pcb_fprintf ignore NULL file handle
Convert ps/eps/lpr HID's to use pcb-printf
Convert gtk gui to use pcb-printf
Clean up coords_to_widget() in lesstif/main.c
Add support for + and .* subspecifiers in pcb-printf
Convert lesstif hid to use pcb-printf
Remove special grid-change handling from Gtk
Fix crash in netlist window caused by heirarchical netlists
Introduce Coord/Angle types, convert global.h and pcb-printf to use it
Fix %ma specifier
Convert grid/increments from double to Coord
Add scale factor lookups to pcb_printf.c, tell GetValue to use them
Introduce new structures (unit, increment) to pcb-printf
Cleanup default values in main.c
Remove mm/mil dichotomy, support arbitrary user units
Update hid/gtk/gui-config.c with new grid preferences
Make file.c use %mr pcb-printf spec
Use suffixed units in gpcb-menu.res and pcb-menu.res
Add alias support, get_unit_list() to pcb-printf
Modify get_unit_struct()'s bad-unit forgiveness
Introduce PCB::grid::unit attribute
Change get_coord and action signatures to use Coord
Audit undo.[ch], thermal.c, set.[ch], rubberband.c, introduce Coord
Audit search.[ch], implement Coord unit
Audit rotate.[ch], implement Coord
Audit polygon*, polyarea.h, implement Coord
Audit move.[ch], implement Coord
Audit misc.[ch], implement Coord
Audit copy.[ch], insert.[ch], mirror.[ch], implement Coord
Audit change.[ch], box.h, implement Coord
Audit draw.[ch], implement Coord
Use pcb-printf in DRC code in find.c
Audit file.c, implement Coord
Remove coord suffix/precision from DRC error struct
Fix g_string_free (NULL) error
Remove fBloat from find.c
Audit find.[ch], implement Coord
Audit line.[ch], intersect.c, implement Coord
Audit create.[ch], implement Coord
Audit autoplace.c, implement Coord
Audit autoroute.[ch], implement Coord
Audit report.c, implement Coord
Audit mtspace.[ch], implement Coord
Audit parse_y.y, implement Coord
Audit crosshair.[ch], implement Coord
Change drawing function coords in hid.h to Coord from int
Introduce HID_Unit option type
Implement new unit selector in BOM HID, audit bom.c
Audit gerber HID
Audit eps.c
Audit ps.c
Audit gcode HID
Audit png HID
Audit nelma HID
Audit HID nogui/common code
Audit Gtk HID
Audit lesstif HID
Change lesstif_logv to use pcb-printf [rebase-after: audit lesstif]
Introduce HID_Coord type and related changes
Audit hidgl stuff, implement Coord
Introduce GtkPcbCoordEntry widget, use it in gui-config.c
Use GtkPcbCoordEntry in gui-dialog-size.c
Use GtkPcbCoordEntry in gui-dialog-print.c
Implement "change unit" submenu of GtkPcbCoordEntry context menu
Make MARK_SIZE base-unit-agnostic
*** CONVERT PCB'S BASE UNITS TO NANOMETERS ***
Parse options of type CONFIG_Coord in preferences file
Fix: spin increments not working in GtkPcbCoordEntry after unit change
Fix compilation warnings in hid/batch/batch.c
Add --help and -? to options that will dump usage() without loading GUI
Fix segfault in report.c text report output
Fix negative-angle handling in create.c
Change Gtk layer_process() to use colors from Settings, not PCB
Introduce GtkPcbLayerSelector widget -- not used yet
Use GtkPcbLayerSelector in gtk GUI
Make EMARK_SIZE unit-agnostic
Fix const-correctness warning in flags.c
Add doxygen comments to pcb-printf.c
Add doxygen comments to gtk-pcb-cell-renderer-visibility.c
Add doxygen comments to gtk-pcb-coord-entry.c
gtk: remove call to ghid_layer_buttons_color_update
Support adding/deletion of layers in GtkPcbLayerSelector
gtk: Sync selection with pcb state in ghid_layer_buttons_update
Delete GtkAction along with layer in gtk-pcb-layer-selector.c
gtk: Const-correct add_resource_to_menu and related functions
Add mnemonics to menus in default gpcb-menu.res.in
Rename GtkPcbCellRendererVisibility to GHidCellRendererVisibility
Rename GtkPcbLayerSelector to GHidLayerSelector
Rename GtkPcbCoordEntry to GHidCoordEntry
Prevent recursion in layer selector events
Fix select-hidden-layer behavior
Created ghid-main-menu.[ch]
Replace gtk UI manager with GHidMainMenu widget
Give GHidLayerSelector an internal layer structure
Clean up layer data handling in ghid-layer-selector.c
Link GHidLayerSelector and GHidMainMenu
Disable layer selector's GtkAccelGroup while in command mode
Add missing free_ldata() in ghid-layer-selector.c
Use g_signal_handler_block instead of flags in ghid-layer-selector.c
Remove default layer selection from ghid-layer-selector.c
minor: fix comment and forward declaration in ghid-layer-selector
Fix invalid free of ~/.pcb/filename path in gui-top-window.c
Configure layer selector to only accept left-clicks
Change change.c to treat text scale as mils
Add call to ghid_layer_buttons_color_update() when loading new colors
Use signal blocking for visibility toggling in GHidLayerSelector
gtk: sync visiibility of layer selector with core state in LayersChanged
Block signals in ghid_main_menu_update_toggle_state()
gtk: remove in_toggle_view recursion-prevention flag
gtk: fix typo preventing layer selector menu items from working
Const-correct StripWhiteSpaceAndDup in mymem.c
Move make_route_string() from gtk into misc.c
gtk: toggle non-activatable layers on click, without checking for swatch
gtk: Don't gray out invisible layers' text in the selector
gtk: Prelight toggle swatches in layer selector
Introduce GHidRouteStyleSelector widget, don't use it yet
Introduce functions for GHidRouteStyleSelector handling to menu
Replace old route style selector with GHidRouteStyleSelector
Remove the last of ghidgui->toggle_holdoff
Add Ctrl+F1,F2,F3,... accelerators to route style selector
Implement RouteStylesChanged action
gtk: Force silk and rat layers visible when they are selected.
gtk: fix behavior when hiding the last visible layer
gtk: Fix "clicking on layer selector separator bug"
gtk: use gtk_action_block_activate() in layer selector
Andrew Poelstra (local) (3):
Add finalize function to GHidRouteStyleSelector
Add ghid_route_style_selector_empty to GHidRouteStyleSelector
Repopulate route style selector on PCBChanged action
Anthony Blake (3):
Added topological autorouter
GTS build script changes
gts.h fix
Anthony M. Blake (2):
Toporouter: fixed a few AMD64 warnings
Merge branch 'master' of ssh://amb33@git.gpleda.org/home/git/pcb
Bdale Garbee (1):
Invoke eps2png in $(srcdir), no .
Ben Jackson (48):
Fix [ 1751578 ] 'move to current layer' doesn't re-plow polygon correctly
Fix bugs 1751572 and 1743534 by allowing a remove on an endpoint to delete
Fix the crash from [ 1724453 ] PCB Crashes with bad footprint (in its library)
Apply [ 1751580 ] polys should not be selectable/considered when thin-drawn
Fix [ 1751566 ] When 'far side' hidden, hidden elements don't deselect
Search for rat-end connections using 3x3 "fat" ends to avoid having
Fix [ 1751574 ] undoing rotation that put an elt inside a poly didn't fix plow
Fix [ 1751568 ] shorted nets stay orange after fixing and re-opt netlist
Fix bugs with undoing "group" moves of objects over a polygon. The group
Add (under ifdef) code I used to debug a report of
Change rendering of rounded corners used when clearing polygons. This
The correct point on a line now moves with a polygon (fix cut'n'paste typo)
Make DRC dialog next/continue to clarify its function.
Ratlist generation is changed to favor connecting to polygons when they
Fix printf format warnings.
Treat VIAFLAG rats (displayed as donuts) as round targets, not as the
Plumb the NetlistShow() hid action in lesstif. Takes a pin name or
Shift-click with the via tool to connect it to the current layer as you
Add support for clearing text from polygons. Text with the clearline
Fix bugs intoduced by revision 1.41 while preserving the fixes in 1.41.
LIST_LOOP works on circular lists, but at least some code will produce
Apply patch [ 1835365 ] Fix for [ 1820385 ] Can't close the preference dialog
Change all the GetXY prompts for greater clarity.
Remove obsolete (generated, even!) file
Apply [ 1726201 ] SaveTo(PasteBuffer.file) for footprint creation
Add some prototypes for global functions returning double that will
Fix two bugs in my via-rats patch:
In case 'biggest()' polygon is 0 area, init size = -1 instead of 0.
Fix a typo.
Missed a spot when adding 'clearlineflag' support to Text.
Fix [ 1836172 ] shift-create two vias, undo twice, internal error
Fix [ 1836169 ] undo of shift-paste element replacement broken
Fix [ 1820398 ] Inconsistant vias with move-to-layer
Partial fix? [ 1775101 ] Undo with the line tool sometimes switches to wrong node
Data->LayerN should generally be avoided. It's not initialized for buffers.
Don't create empty text objects.
Avoid moving elements snapping to their own pins or pads.
ignore paste layers
Rebuild with 2.61
Add XRENDER support to the Lesstif HID. Rat lines and soldermasks are now
Add gross hack to avoid using mask in DrawRats() for othet than lesstif
Make 'outline' layer test case-insensitive to match other instances.
Add Zoom(Toggle) and bind it to ` (backtick).
Temporarily change PCB=yyPCB while InitClip after load
Fix crash with 'ben-mode' if your layer stack is the reverse of DJ's.
Add initial gitignore files covering autogen files and GTK HID build
GTK HID: Background color can be set live from config dialog
Add *.backup to gitignore (in case you test run PCB in the tree)
Bert Timmerman (9):
Apply filters to load filechooser dialogs. [1988982] [2686963]
Correction of the pcb homepage url in the about dialog window.
gEDA-dev: pcb [PATCH] Correction of the geda homepage url and wiki url in the about dialog window.
gEDA-dev: [pcb patch] Correction of the pcb homepage url in the batch HID
First issue of the Dutch translation.
Added an entry for the Dutch translation in LINGUAS.
This patch adds support for doing Report(netlength,net_name)
Remove the src/hid/gtk/gui-dialog-size.c entry from the translatable files list.
Updated the Dutch translation.
Bill Wilson (21):
Fix a zoom glitch.
ghid_invalidate_all() when colors change.
Fix gtk magenta color messages -> initialize all new hidGC colornames to
Fix draw arc when flipped.
Set netlist nodes enabled by default when NetlistChanged.
Turn of Disable all nets button when NetlistChanged.
Pan to a netlist window selected node if it's not visible.
I wrapped too much into the verbose option so the file
Fix netlist window to scroll to net/node when user lookups connection.
mode_button_toggled_cb() didn't sync ghidgui->settings_mode
Support --bg-image in the Gtk HID. Images can be jpg, png, gif, etc. as
Make ghid_get_coords() x value account for side viewed (when using TAB).
Fix soldermask draw while TAB view from solder side.
For the Gtk HID, add an alternate vertical window layout mode to help
Fix route style "Save as default" bug.
Remove Gtk HID specific build_route_string() function.
Clean out FIXMEs specific to the Gtk HID.
Clean out Gtk HID related FIXMEs. Also old background image code which
Clean out Gtk HID related FIXMEs
Couple of small typo bugs: a missing "break" and needed -1 arg to size request.
Update status line after menu Save layout and Save layout as.
Bob Paddock (5):
Initialize min_dist to zero before using in if().
Add missing Message() prototype to remove warning about same.
Compiling with MinGW requires cast to const for _spawnvp to compile without warning.
Use rand() in place of random().
mkdir() takes only one argument under WIN32.
Cesar Strauss (4):
Ignore generated files on Windows.
Check for the _spawnvp function and use it if present.
Remove previous Windows build script.
Add Windows cross-build script.
Chitlesh GOORAH (1):
Update the quick reference
Colin D Bennett (1):
Fix typo exporting plated vs unplated drills.
DJ Delorie (502):
Add trace optimizer.
Add Thindraw
Add orthogonal move feature
Regenerate with djopt.c
Automatically set CLEARLINEFLAG if the user modifies the clearance.
The minimum size of a board should never be more than the current
Fix off-by-one bug in handling bloat.
Sort drill report by hole size, list total hole count.
Properly scale outline and alignment. Add segment to alignment
Solder mask layers are reliefs and normally are positive prints.
polygon fills must have a defined aperture also
Dummy commit to test log messages
second dummy commit
Support however many layers are configured.
Add FAB drawing page.
Use the layer groups to determine which layers are solder and
Don't assume that an all-ones pixel is white.
* Detect re_comp(), regcomp(), and <regex.h> (select.c doesn't use the
* Detect re_comp(), regcomp(), and <regex.h> (select.c doesn't use the
Regenerate.
Provide our own yywrap(), just in case.
add ylwrap
add file-driven menus
add version.texi for non-maintainers
Remove gcc-isms
Fix bug wrt intersecting layer groups in miter
Don't use local var for widget name.
Add flag to default to optimizing only autorouted nets, plus menu option to
Be even more picky about which line is chosen as an example.
Run gather-actions only if maintainer-mode
Add support for menu accelerators. Replace hotkey translations with menu
Cut and Copy from the popup menu now wait for a click before acting (bug 978406)
Change size of selected objects, fix enlarge options to actually enlarge
Add limited support for a behind-the-board background image.
Add command history to : widget.
Avoid checking pin numbers for unnumbered pins.
Print plated and unplated hole counts on separate lines.
Check for numberless pins.
add non-gcc definition of ATTRIBUTE_UNUSED
Oops, overzealous patching ;-)
Add FlagHaveRegex (have_regex) so that the SelectByName menu entries work.
Regenerated
Sort actions by modifier so that both Ctrl<Key>x and <Key>x work.
Document resource file comments
Add support for comments. Comments begin with '#' and extend
Add -action command line, to execute one action string at startup
Quote "$@" to keep args whole
Support multiple actions per line for -action and -script
Move right-click popup menu to pcb-menu.res also.
Oops, take out test entry
Allow FAB author name to be set by .Xdefaults
Put parens around computed macros. Use ~0 instead of -1 for "all bits".
When saving files, convert flags to symbolic format instead of
Minor bugfixes related to error handling
Fix the "all pads are ovals" bug.
Avoid name conflict with abs/min/max
Update sources to support more than 8 layers.
Fab author fixes from Karel.
Add "join" to SetFlag, ClrFlag, and ChangeFlag actions.
Inline documentation.
New file, for extracting inline documentation.
Document ElementArc, ElementLine, and Mark.
HID merge.
regenerate everything with FC4.
Update to automake 1.9 files.
New file, from automake 1.9.
Remove UpdateSettingsOnScreen. Call InitCrosshair only for GUIs.
Remove a debug printf.
Call lpr, don't just save the file.
Don't try to run the idle proc until the GUI is created.
MyCalloc, MyRealloc, MyStrdup: make final parameter (tag string) const,
Misc bugfixes and changes, to silence compiler warnings.
Use explicit void** pointers to avoid aliasing problems.
Use void * pointers to avoid aliasing problems.
Avoid aliasing problems.
Round drill sizes to nearest mil for fab drawings and gerber drill file.
Change the way we handle built include files.
Also look for ~/.pcb/pcb-menu.res. Actually use the path we found ;-)
Add File->Revert.
hid actions: remove needs_coords, use need_coord_msg to determine when
hid_actionl must be terminated with NULL, not a plain 0, in case integers
Fix eps->pdf rule to set size and resolution right. Limit pcb->* to visible areas.
Initial chunk of inline action docs.
Document the rest of the registered actions in action.c.
Print correct symbol counts for drills on fab drawing.
Document actions in command.c.
Document actions in netlist.c
Determine when we need to use the complex erase logic, and when we can just
Add --bg-image option to lesstif hid to load a background image.
Make sure the Message and return are in the same scope.
Document the puller action.
Document actions in report.c.
Include sys/types.h so that regex compiles on more hosts.
Remove all the prev-next-up links, reformat all the texi files to allow
Add --psfade option.
Document lesstif hid actions.
Define on-board objects in terms of base types.
Comment tweak.
Use locale-independent strtod and dtostr functions.
Add support for drawing/exporting paste layers.
Fix drawing of box around text items in buffer.
Add batch-mode HID.
Fix test for interactiveness.
Fig typo in ChangeDrillSize menu.
Ignore locked objects unless LOCKED_TYPE is passed (lock tool).
Change gerber names to be compatible with pre-hid.
Name internal gerber layers sanely.
Split plated and unplated drills in gerber output.
Reset layer value cache before we shortcut for counting apertures.
Report on locked objects if there are no unlocked objects under the cursor.
Adjust endpoints of lines that don't quite reach adjoining lines.
Add Flip action, both vertical and horizontal.
Remove lesstif board flipping item.
Syntax fix for DisperseElements()
Fix logic a bit, don't try to move pins.
Fix rounding bug when collecting drill sizes.
Compensate for board flipping in the panning code.
flexible max_layers
Print actions called when verbose.
Merge lesstif's Flip() action into SwapSides to avoid conflict with core Flip().
Remove obsolete ActionSwapSides()
Account for board flipping when zooming.
MoveLayers cleanup tasks - thermals, pips, undo
Don't delete vias with thermals. Try to split diagonal lines at pins and vias.
Fix layer group parsing code. Avoid trailing colon in group string.
Fix minor rounding bug in c_dtostr().
Minor patches from Larry.
Fix draw_rect vs board flipping bug.
use "top" and "bottom" to describe the side flags, instead of using
Add support for multi-key hotkeys, via <Keys>abc syntax for a/b/c sequence.
Add the ability to user-configure mouse actions.
Enable loaded netlists by default.
Allow extended selections.
When the drill list fits "naturally", no offset is added, which makes
spelling fixes from Larry.
When deleting a layer, make sure to zero out the now-unused slot at the end.
Allow New() to take a name, so that the user need not be prompted during
Use the old style (mil) syntax when saving font info, if the values permit it,
Add font editing mode (FontEdit() and FontSave())
Add X_CFLAGS to CFLAGS so that Xm/Xm.h can be found.
Draw via annulii on assembly drawings.
Don't let search find backsilk if invisible objects are off.
Let right-mouse do "rotate" for now.
post-initialize PCBs loaded from files.
Add default colors for layers 9..16
If a pad/via's clearance is zero, don't attempt to draw a zero-width clear.
Allow via clearance to be reduced to zero.
fill_rect needs the same point-ordering as draw_rect
Special case: allow vias with exactly zero clearance.
Don't print invisible silk.
Don't consider off layers for fast mask. Don't print paste.
When printing as-shown, mirror the image if we're viewing the solder side.
Fix rats enable/disable code.
Constrain arc start angles to -180..180 degrees.
Remove obsolete comment.
Add arbitrary attributes to PCB and Element types. Ignore optional flags
Copy attributes when copying element data.
Doc typo.
Regenerate to add attributes
Shift-click replaces element on pcb with element in buffer.
[pc...@ca...] Patch to fix bug #1553558, Stack corruption PCB bug in
Draw the elements' marks.
Break out layer->filename code. Fix bug in top/bottom detection.
Add multi-file output option.
Add MinMaskGap() action.
Fix undo for MinMaskGap()
Avoid attempts to realloc to zero bytes.
Allow rectangular polygons when converting a buffer to an element.
Fix bug in poly point sorting for element conversion.
Note pixel slop in gtk hid. Increase slop to 10 pixels.
Display remaining rats in status bar.
If Settings.RatThickness is less than 20, it's a pixel size, not a pcb size.
Add a --verbose option to list gerber files as they're printed.
A layer group containing only an "outline" or "route" layer will be named
A layer group that only contains a layer named "outline" or "route"
I did the one about separate ps files.
Add -rdynamic when it's available.
Fix off-by-one error.
Dynamically load plug-ins (hids, actions, etc) at runtime.
Fix plugin init function logic.
Remove debugging printf.
Load settings from ./pcb.settings and ~/.pcb/settings. Add :savesettings
Add global "exporter" option.
Minor bug fix for exporter.
Add RTLD_GLOBAL.
Keep ElemenOn and *SILK->On in sync.
If we're converting a buffer to an element and the buffer has no associated
Report units in mm or mils as selected by user.
Move layer ID text outside of the "board" area. Print board name,
Move thermals when we move layers.
Handle edge conditions when adding/removing layers wrt thermals.
Allow attributes in old-style elements too.
Add SDIP20. Fix comment.
Add automatic busy cursor. Add (disabled) debug code for arc thindraw.
Add progress() hook to HID structure. No actual implementation yet.
Fix progress prototypes.
... and return 0 for progress hooks.
Remove completed projects, add some new ones.
Increase default size of main window.
Add support for HID_Enum in attribute dialogs.
Take "enums" off the lesstif list.
Cast away const-ness.
Don't draw plated holes on outline gerber.
From: Hans Nieuwenhuis <vz...@xs...>
Keep canonicalizing lines until they're all canonicalized.
Update from ../src
Don't call popen() if we don't need to.
Use a global aperture list instead of per-layer lists.
Make sure we have a current mark when we convert selection to an element.
Add more functionality to netlist dialog.
Draw plated holes when exporting.
Fix gtk grid when board flipped.
Fix logic for adding new rat lines to the netlist.
Round drill sizes before reporting them.
Add command line option for setting DrawGrid
Always initialize default layer names.
Add "C" for Center() action. Provide examples for zooming-with-centering
Change the way the busy cursor is done. Called for autoplace, autoroute,
Call busy before applying the vendor map.
Properly deal with quoted characters in both string reading and string writing.
Cache vendor lookups. Use binary search instead of linear.
Add printer calibration code for lesstif HID.
Compensate for rotated boards. Allow the print step to be skipped.
Keep track of the minimum line size for text depending on which layer
Move declarations before statements (patch by Ben Jackson <be...@be...>)
Don't use the crosshair's position to keep track of whether it's in the window
Attach status bar widgets to the correct siblings.
Don't print the scale if we're filling the page. Don't print (null)
Silence some compiler warnings.
Report on pads as rectangles, not lines, so we get width and height for
Allow the user to load a footprint as a pcb; create a suitably-sized pcb
Add calibration values to the attribute list so they can be stored
Avoid segfaults when loading elements, fixes bug in load-element-as-pcb patch.
Made flags type big enough to hold PCB flags.
Add basic line clipping to both GUIs.
Allow :s without filename to use current filename.
Use polygons to draw square ended diagonal lines.
Permit the existence of diagonal pads.
Use ".fp" when loading element data.
Allow for diagonal pads.
Add FreeRotatebuffer(Angle) (angle can be any angle)
Preserve width *and* height when manipulating arcs.
Draw non-circular arcs manually.
Add Delete() action. No arguments: delete selected ELSE object, but options
Don't free home_pcbmenu until after it's used.
Gerber, PS, and EPS ignore the thindraw settings. Fix bug in PS
Swap the direction of scroll bars when the board is swapped.
When swapping board sides, swap top/bot layers even if both layers
When the layer stack is reset, bring the component layer to the front
Add missing variable.
When a board is loaded, the first route style is automatically
Fix references to RouteStyleChanged (should be RouteStylesChanged).
Fixed a bug in flags_to_string where the LOCALREF pcb flag would
Protect against empty :command string.
Don't allow LayersChanged if there's no GUI yet.
More paranoid check for "gui is up"
Tracker 1753084 - fixes 1751589, merged soldermask has larger than expected
Apply bloat to drawn rectangles.
Don't limit keepaway size to minimum *line* size.
Adds an export in mm to the BOM export dialog [1742399]
patch 1738364: flag for non-clipped polygons.
Ben: Avoid duplicate passes through pad clearances.
More empty :command checks [1751582]
Fix the have_regex flag in pcb-menu.res [1751564]
Match whole names with regex's, when possible. [1741650]
[ 1751567 ] with thin-draw-poly on, soldermask display is messed up
Make sure loaded buffers have a proper pcb backpointer.
Give data->pcb a real type.
Add missing else.
Make sure the leftmost end of the line is visible in the log window.
Don't draw pins/holes on the outline layer. Include commented-out code
Fixes for DRC of slanted pads. Tracker bug 1791388 and patch 1791392.
Properly thin-draw slanted pads.
Move silk away from pads. Fix notch in SO footprints.
Reduce silk width of connector/header/jumpers (some fabs clip it to the pads)
Don't complain about checking the shift key when exporting pngs from
Snap to pin/pads whenever we're within the pin/pad copper, unless shift is
Fix pin bound calculations based on new thermal calculations.
Expand min/max values.
Add annulus and mask gap to pin/via report.
Update the status line even when we don't have a styles dialog.
Additional slanted-pad patch for missed DRC
lesstif_show_library: Don't reset the dialog when we're just re-displaying it.
Don't crash if a scanned element has no text.
Don't just clean out RemoveList, free it, so it's created properly later.
Draw outline layer on all other copper layers when "draw outline" is
Export DrawLayer() for the ps exporter.
Draw arc start/end radii in separate colors, and dotted, if enabled.
Add global puller.
Attach the show soldermask layer button to its flag.
Add 50 mil grid setting. Add global puller submenu.
Fix printer calibration.
Check for Xrender library.
Fix enter/leave logic to avoid leaving obsolete crosshair-attached
Various changes from Kai; cut-copy swap for lesstif.
Add TSSOP14 and TSSOP16
Resolve some const-cast issues.
Cast parameters to right type.
Fix some off-by-one bugs.
Re-initialize num so that multiple actions will be parsed properly.
Strict aliasing patch from Larry Doolittle.
Allow negative bloats
Ignore zero-radius filled circles.
If a layer selected through --layer-stack isn't found, let the user know
When drawing zero-length lines, draw a square or circle according to the
Fix off-by-one bug drawing pads.
Don't say ,TZ as we're not omitting trailing zeros.
Add ELEMENTARC_LOOP
Allow outline layers that have nothing but arcs.
Do not require a second paramter for SaveTo(Layout)
Oops, fix bug from previous patch.
Add "Ben Mode". Fix export of thindrawn polygons.
Add --ben-flip-x and --ben-flip-y options to produce "ben mode" images
Bump up font size and aperture count.
Add missing parameter name
Fix lesstif crosshair color - joel silvestre
Fix poly clearance around rotated pads - Robert Fitzsimons and Ineiev
Put exploded pads on the correct layer
Don't merge two lines if the join flag differs.
Move splitlines even earlier, to avoid unwanted changes.
Fix the foo.ps.type.ps bug
Test the two lines, not the line vs the current pcb, for compatible
Merge thermals from old flags, not overwrite them.
Add MinClearGap() action.
Add flags for whether various layers are shown.
Add support for suffixes on numbers, like "mm", "um", "in", or "mil". No suffix
Increase resolution of gerbers to 0.01 mil; drills remain at 0.1 mil
append '-' on all parameter names to prevent mis-interpretation of such.
Add initial "getting started" guide.
add texi2dvi check and doc/gs subdir
missed files
More missing files
Set home from homedir.
Fix via annulus calculations, from Jasper
Avoid checking memory before short-named files.
Make sure we clean up if dlopen fails.
Typo.
Add an option for undocumented attributes.
Rename ben-mode to photo-mode.
Add "empty layer" hint to HID. Add option --all-layers to gerber export
sf patch 2162834 from d.ineiev - count apertures for diagonal pads
Add min-drill and min-ring to the saved config list, and save the config
Make sure the user has specified an element for the pinout window.
Include explicit text/lines/etc on silk layers in assembly drawings.
fix parsing of old-syntax arcs.
Fix flipping of arcs.
Add "hide names" option to hide all refdes on the board temporarily.
Add description of how polygon data works from Ben, and debug routines
Handle wrap-around when searching the string hash table.
Add outline mode for photo-mode, from Mark Rages
Add only-visible support to photo-mode, check for more outline fill spots.
Don't show undocumented options.
Skip undocumented options.
bugfix: avoid NULL pin names with Report(NetLength)
single-action register/deregister
Add "report all net lengths" option
Oops, re-comment-out a debug statement.
Add bloat to PNG hid
Fix "Design Rule Checker moves elements and traces off grid"
Handle NULL strings when replacing elements.
Add support for specifying soldermask and solderside from the command line
Fix photo-mode mask layer.
Check for empty layers.
Work-in-progress for LF: netlist importing
Undo an accidental change.
Add Import() action
Add attribute editor GUI to gtk and lesstif.
Add the new netlister.
Add import to gtk menu, change lesstif menu to match.
Changed element/netlist syntax as follows:
Fix drawn circles
swap png bloat too
Rename NetlistChanged() to avoid conflicts
Fix pcb forward annotation bugs
Revert an unintended change.
Check for NULL names.
Check both FOO and FOO.fp for footprints.
Add more flexibility to the import::make option.
Fix bogus cast to BoxType
Allow empty attribute values.
Fix Typo
Record the calculated length in Report(NetLength)
Return non-fail for ReportAllNetLengths()
Add AttributePut functionality.
Let the GUI deal with choosing schematics.
Add missing newline.
Implement lesstif ImportGUI()
Fix doc typo
Handle attempts to change clearance on polygons.
Add hint about :MinClearGap(Selected,=10,mil)
Allow for only one confirm button.
Fix PNG bloat for drills.
Clarify the meaning of keys bound to SetValue()
Don't select silk on the far side if the far side is not shown
Quote strings
Add FreeRotateBuffer to the Menu
Update Import() docs
Check for NULL element name when adding attributes.
Export lesstif attributes.
Export GTK attributes.
Print all command line options with help.
Merge lesstif attributes.
Merge GTK attributes.
Add AttributeRemove functions
Add new-part-location to import
Enhance GetValue
Store units for import::disperse
Add import settings to menus
Fix layer visibility logic for some boards.
Fix typo in parse_y.y
Fix arc bounding box math.
Fix lesstif SwapSides magic layer option.
Avoid divide-by-zero
Fix bug tracker # 3064887
If we don't use the outline to clip, don't draw it either.
Wrap more messages in debug
Don't print "can't open ./default_font for reading" all the time
Make new text clear polygons
Fix for distcheck errors.
Update ChangeLog from git logs.
Update NEWS from ChangeLog
Comment out code to dump toporouter surfaces.
Add more ACY, ACPY, ALF, RCY, RCYP, JUMPER, and HEADER macros to fill
Store is_pad flag for each line rather than trying to deduce
Check for special name "(local)" to mean "."
Fix rats bug (SF 3137324)
Further work on rats patch.
Allow via copper to overlap; preserve illegal vias from file.
Add 80-pin headers.
Fix lesstif segfault in key handling.
ResetConncetions -> ResetConnections
Allow zoom-out-past-board for Lesstif
Fix "select pads on hidden far side"
Fix command-injection bug in Import()
Support far-side polygons when converting buffer to element.
Add top-level build changes to enable C++ compilation
Make new PCB active during parsing
Calculate text bounding boxes based on that actual drawn glyphs.
Fix postscript page scaling
FindContext() takes an int, not a pointer.
Add header for Draw() prototype.
C++ compatibility for the lesstif HID.
C++ compatibility for the batch HID.
Conditionally use "class" or "c_class" depending on the compiler
Use onsolder for text, not auto.
Make io.h inclusion conditional on the mingw case.
Allow space between value and units in GetValue().
Add copy-outline mode
Fix mkdir() in plugins.
Save footprints as footprints.
Tweak default layer stack.
Fix gerber output
Add IsEmpty functions
Fix PS rect/outline logic
Don't draw an empty outline layer.
Remove (now) unused variable.
Update file names to top/bottom convention
Add t/b synonyms for group list
Make file version smarter.
Fix polygon clears on insert.
Fix typo in new ELEMENTARC_LOOP macro.
Improve lesstif progress dialog.
Don't prematurely dismiss the progress dialog.
Fix Mark size math wrt unplated holes.
Avoid top/bottom issues with layer deletion.
Add option to specify gerber output file style.
Don't register the PNG hid if there are no file formats to use.
Fix shift/reduce conflicts
Check for empty layers in photo mode
Lesstif: ignore crosshair changes before window exists.
Tweak default font.
Don't set FOUND flag on silk lines.
Detect XRender + Xinerama to avoid BadMatch
Fix header guard macro names
Centralize Lesstif XmStringCreate*
Make toggling the HOLE flag reversible
Fix unitless menu flags.
Lesstif: force widget update on grid unit change
Fix texinfo bug in report.c patch
Fix File->Import for elements on back side.
Avoid segfault tmp-saving partial board.
Use correct units when setting up the Sizes dialog.
Fix FontEdit()
Add configure selection of 32/64 Coord type
Fix text scaling exceeding Coord max.
Fix math error in IsPointOnLine()
Warn user if footprints can't be found on import
[windows] set GDK_PIXBUF_MODULE_FILE
[lesstif] set units for styles dialog in more places
Add locale functions
Wrap all XmStrings in gettext()
Fix m4-to-newlib converter filenames
Add DIL footprint names and R025.
De-localize zoom parsing
Skip the M4 library on Windows
[windows] use unix-style path separators when calling gnetlist
Update golden files for nanometers
Remove src/hid/common/hidgl_package_vrml_y.c from POTFILES.in
Update Changelog and NEWS for 20110918
Today is the 18th :-)
branch version 20110918
Add options.texi to dist files
Dan McMahill (1054):
Initial revision
remove unneeded output files
remove obsolete files
remove obsolete files
remove obsolete file (the contents live in pcb/newlib/ now
these don't really belong in CVS. The sources are in the doc/ directory
remove obsolete files
- add section on checking out via anoncvs and updating via anoncvs.
coding style fixes to allow this to be compiled with the SunPRO c compiler.
change c++ style comments to c style and remove the use of non-static
bump to 1.99o since a 1.99n version was posted to the geda list.
when checking for a NULL pointer compare to NULL rather than 0 for
add check for strerror()
move the strerror test up in the configure process so we don't need to
if strerror() is present on our system then use it instead of trying
remove spurious file which should not have been imported.
remove spurious file which should not have been imported. Noted by
add missing bga.inc and resistor_adjust.inc included. The latter addresses
change yy_current_buffer to YY_CURRENT_BUFFER. This addresses the build \
add 2 more levels of zooming to the menu. Inspired by an email from
add missing rules.inc
Fix a bug in the way the current working directory is found. This caused
Allow '=' at the beginning of the zoom exponent to indicate an absolute
remove unused varargs.h header which breaks gcc-3.3 compilation
only declare sys_nerr if we're using the sys_errlist interface. This
add the automake/conf generated files to make building from CVS sources
add automake/conf output to make it easier for users to build
note that autoconf 2.13 is not new enough and mention how to get the version
fix parse errors on DS1225 and DS1230. Patch provided in bug report
fix parse errors in TL083 and ua747. Patch provided in bug report
fix parse error on uA7952C. Patch provided in bug report
Remove extra space in one of the pin names in AT90S2313_dil
add DJ and myself
add a note on creating snapshots
Makefile.am is not a library component so do not install it as one
regen
add info-dir entry
Add 20,28,32 pin PLCC footprints, both unsocketed and socketed (through hole).
add scripts which autogenerate geda.m4 and geda.list from geda.inc.
when given a -I flag, look both there and the current directory for .list
add qfpdj.inc to the include list
rework the QFP packages fixing several bugs and greatly expanding the
these files are autogenerated now
remove the lines which tried to copy the source file RCS Id to the generated
change 'Square' to 'Rectangular' to the comment for the rectangular QFP
add brief section about the trace optimizer.
add a --with-xaw= option that lets you select an alternative to Xaw. For
regen
don't hardcode -lXaw in the FUNCPROTO and related tests.
regen
Add two new chapters to the manual. The first attempts to provide some
add example/libraries/Makefile
regen after example/libraries addition
update copyright for last changes
add a figure to help with describing the pads. Also add an Xresources file needed to convert the tgif drawing to png
add 60 members of the Quad Flat No-lead (QFN) package family. Based on
regen after qfn.inc additions
remove some output files which should have never been in CVS.
show pad names in object report. patch supplied in bug report 787711 by
correct the reporting of soldermask relief for pads and via's. Patch
fix two bugs related to gerber file generation. The first bug is triggered
add a few more variants of wish (wish83, cygwish80, etc) to search for
search for libXpm which is needed on cygwin libXaw
move the pcb script to a subdirectory to avoid name conflicts with the Pcb
regen after moving the pcb script to a subdirectory.
use AC_PATH_PROGS to search through a list of candidates for wish
Change how the polarity of the soldermask relief layer is handled. The
regen after adding Xpm check
add rules for creating postscript and png from a tgif drawing. Needed for improved docs.
regen
When trying out the various -R, --rpath, etc. compiler flags, actually
regen after -R fix
add footprints for Johnstech Evaluation Socket for QFN packages
add -*- m4 -*-
add MTA100 connectors
Add amphenol connectors. Start out with the ARFX1229 SMA connector.
regen after adding amphenol library
remove extra whitespace at end of ARFX1229 line
correct capitalization for amphenol_ARFX1229
add note about the dangers of whitespace in .list files
add bourns 3224G, 3224J, 3224W, and 3224X trim pots
add some more SMA connectors
include the bourns library
add through hole test point footprint.
- add a handful of 3 pin SMT EMI filter footprints
regen after adding bourns library
add several minicircuits packages
regen after adding minicircuits
add an extra argument to COMMON_SMT_DIL_MIL and COMMON_SMT_DIL_MM to
deal with SMT DIL packages with an odd number of pads per side
Add the panasonic EXB series of chip resistor arrays.
regen after adding panasonic library
rename the SOT23 and SOT323 footprints here to SOT23_CEL and SOT323_CEL
add SC70_3, SC70_4, SC70_5, and SC70_6 footprints (the 3,4,5, and 6 pin
fix typo in a comment
with reverse order numbering in COMMON_SMT_DIL_MIL and COMMON_SMT_DIL_MM,
add Amp connector library. Currently its populated with the 767054 series
regen after adding amp library
add a features wish list. not sure if this is the best place for such
add element versioning and database of good elements
properly pass down the arguments to the underlying macro for the PKG_AMPHENOL_ARFX123{0,1,2} packages
bump copyright date
fix some quoting
- modify the 2 pad smt base definition to put the origin of the footprint
add missing RCS Id
add missing RCS Id
correct the aperture definition output lines and the drill tool definition
Convert to a high resolution footprint. Pads are a little more accurate
fix a couple of other bugs related to the high res changes. In particular,
fix generation of fab drawing with the high resolution changes
partially undo the last change with respect to quoting. Only
One more hi-res buglet. Correct parsing of 'Arc'. Thanks to Bill Wilson
note harry's hi-res changes.
#/bin/sh -> #!/bin/sh to make these execute correctly.
add Merge_dimPCBPS
regen after adding Merge_dimPCBPS
correct the drill diameter in the drill report after the hi-res changes
add a way to control the scale factor associated with thermals. This is
add checks for logf and expf
regen after adding logf and expf checks
install MergePCBPS and Merge_dimPBPS
add a place for putting our own implementation of missing/broken functions.
regen after adding compat.c/h
remove extra whitespace in generic208_lqfp
add a PKG_CONNECTOR_DIL for 2 column headers with DIL pin numbering.
whitespace fix
clarify the pad creation a little
a HEADER60_2 should have 60 pins not 50 as noted in bug report 900231
enable the regex select stuff. A trial of a regex select of some components
Added a new action which will toggle the visibility of
document the ToggleVisibility action
one more regex bug fix noted by Matt Ettus
100 pin QFP packages have 100 pins not 72
revert last change. Some compilers including gcc-2.95.3 do not like it.
increase soldermask relief on mounting pads
test commit
test commit #2
test commit #3
hires-ify the COMMON_SMT_DIL_MIL macro. The macro already took input
Correct the spacing between the rows of pads. Also fix one of the pad
Fix SDIP (shrink DIP) footprints. Patch from Wojciech Kazubski in
fix refdes silk size
add cts library containing CTS series 742/3/4/5/6 resistor packs
fix the EXTRACT_END flag
put variable declarations at the beginning of functions. Avoids syntax
RCS Id police
RCS Id police
fix some 64-bit bugs to get this working on my alpha. Of prime importance,
When printing to RS-274-X also generate a centroid data file (X-Y data)
RCS Id and config.h police
add a note about the centroid and bill of materials output. While here
minor fixes to get the distcheck target working again.
regen
RCS Id police
put a string which is repeated several times into a #define and use that
Add some DRC checking of silkscreen layers. Currently this check looks for
clarify a comment
adjust spacing between the 2 rows of pins to better match the datasheet
protect the inclusion of string.h with HAVE_STRING_H
fix typo
fix typo in comment
correct the pin/pad bounding box calculation. Bug noted by David Koski.
add a comment
unset XUSERFILESEARCHPATH which causes a conflict with XAPPLRESDIR
add missing string.h (for strcmp). Noted by Dave McGuire
fix a hi-res bug in the polarity arc silk for some SMT DIL pkgs
add SOJ packages (lots of them)
make sure we get the preamble in all EPS output files. Bug noted by David Koski
update the COMMON_SMT_2PAD_MIL macro to the newer element format. With this
add INFO-DIR-SECTION Miscellaneous per bug #957369 submitted by Mike Frysinger
bump date
add test for rint()
regen after adding rint() test
Fix the segfault bug noted in bug report #959073 by Bob Paddock. While
Add SetFlag, ClrFlag, and ChangeFlag actions. These currently let you
For the pcb wrapper script, if the first argument is "-gdb", pick off that
correct location for Pcb appdefaults file
document the SetFlag(), ClrFlag(), and ChangeFlag() actions
set MASKFRAME to be 3 (mils) instead of 0. This way the soldermask
add missing prototype
add some release notes for the upcoming 20040530 snapshot
bump updated date to match snapshot date
update changelog with cvs2cl.pl. This file previously was empty.
remove duplicated line
add a note to remember to do something better with versions on the next snapshot
fail configuration if Xaw is not found
regen (fail configuration if Xaw is not found)
add a GetXY() to the 'copy selection to buffer' menu. Needed to have
add @ character. Absence noted by Dave McGuire.
Add usage output if the input arguments are not quite right for several
add usage output for several more actions
If --enable-dmalloc is given but dmalloc is not found then error out instead of disabling dmalloc
regen (If --enable-dmalloc is given but dmalloc is not found then error out instead of disabling dmalloc
change the order in the list of rpath flags which are tried out. This
regen after rpath flag order change
Save layerstack settings prior to running DRC and restore them afterwards
Add 0.5 and 0.1 mil grid selections. Requested in RFE #876549 by
Do not arbitrarily change the zoom setting whenever running DRC. Especially
fix the function name strings passed to MyCalloc().
make sure we define all aperture codes used by arcs. Fixes the bug reported
add a few more 400mil width DIP packages (DIPxM)
make 'str' static so that the memory allocated by MyStrdup() can
when running under gdb set XAPPLRESDIR and unset XUSERFILESEARCHPATH
fix some errors where the diameter was used where the radius should
Fix a bug related to checking for the intersection of a circular region
improve the decision on adding or not adding a silk arc on the COMMON_SMT_DIL_MIL macro
update the 150 and 300 mil width SOIC packages per the IPC recommendations
use foo?foo:bar instead of foo?:bar as the latter is a gcc extension.
avoid 'inline' unless we're using gcc.
add a man page which says where to look for the manual
regen after adding pcb.1
In the Usage() function be sure to restore stderr at the beginning since
allow --version, --help, and --copyright to also work since those are
add one more Usage message. this time for the RemoveSelected() action
add a brief comment about what M4 is and where to find more info
exclude Makefile, Makefile.am, and Makefile.in as valid element names as these may reside in a lib directory
use "Reference Designator" instead of "Name on PCB" as the former is more standard
update the table of the output files generated by PCB
Fix a minor memory leak bug which allocated space for 10 more pointers
add an ExecuteFile(file) action which executes the actions contained
document the ExecuteFile() action and the -script command line option
add pcb.1 to EXTRA_DIST
regen (add pcb.1 to EXTRA_DIST)
bump updated date
remove an unused variable
add a missing header
remove some unused variables
use long int in some places to avoid assigning a long int to an int
add missing header (for isdigit)
if we are using gcc then add -Wall
regen (if we are using gcc then add -Wall)
add actionlist.c for non-maintainers
update this to more closely match the current reality
fix a "=" instead of "==" bug
rework the lines which have
get rid of a bunch of format string compiler warnings along with some unused variable warnings
clean up a few more compiler warnings
add missing prototype
remove unused variable
add missing prototype
add missing headers
add more detailed snapshot instructions
update to get ready for next snapshot
update with pcb-20040903 news items
mention the background image in 20040903
add an extra digit to the display of metric measurements.
minor tweaks to instructions
add missing #else clause in defining ATTRIBUTE_UNUSED on non-gcc or older
Apply several improvements from Bob Paddock including:
minor fixup in the newlib element creation guide.
improve the quoting so that aclocal-1.9.2 is happier
check for ps2pdf which is used for building the refcard
regen
- override the mostlyclean-aminfo target to avoid deleting the .dvi, .html,
regen
update to texinfoversion 2004-09-06.16
minor fixups to make this happy again with the new texinfo.tex
update date on manual since there have been additions
regen so that all Makefile.in files came from the same version of automake
Fix one more (last one maybe?) hires bug where when converting a selection
Add date and compile time to the About dialog. Patch provided as
remove unused variable, make sure return returns a value on a non-void fn
Add support for a loadable vendor resource. The primary purpose is to import
regen after adding vendor resource/mapping code
document vendor drill mapping
add missing vendor.h
Quote "$@" to keep args whole
Modify the LoadVendor() action so if the file name is not give, the user
Allow the use of regular expressions in the resources which specify
clarify the units used by PCB a bit
add support for ElectricFence debugging. --enable-efence
regen [add support for ElectricFence debugging. --enable-efence]
Fix the <Key>. binding to toggle 45 degree mode. Addresses bug #1022800
Restore translation table for the mode buttons. This seems to fix
add <Key>. as the hotkey for toggling 45 degree line mode.
revert previous. Seems to have snuck in by mistake in the strcmp()
adjust Pcb.masterForm*cursorPosition.width to match the app-defaults file value
add metric output to the location display. Based on patches provided
remove a compiler warning
move the regfree() call _before_ the return from the function that calls it
change "Location" to "LocationType". Avoids some confusion with some
cast some pointers to (void *) when printing debug output. reduces the # of compiler warnings
remove duplicated files and fix some out of date info
add a DisperseElements() action which will disperse all elemnents in
remove some more compiler warnings
add DisperseElements() to menu
udate data
regen
increase quoting of $2 in PKG_CRYSTAL to avoid the refdes from
add docs for ChangeClearSize() action. Also apply some other fixes
Increase Pcb.masterForm*cursorPosition.width to make room for metric display.
in the message log produced when a via size has to be increased to
use LAYOUT_BOTTOM to always put the status line at the bottom of the
add a --disable-rpath flag to disable hardcoding of the X11
regen
avoid having text overlaying text in the fab drawing when a very
Add "Selected" and "All" arguments to DisperseElements so you have
for the .test/Pcb apps-default file (the one used when running before
regen
- break the status line into 2 lines as it was getting rather long
do not complain about MIN_PINORVIACOPPER on a mounting hole
bump date
increase the padsize and drill size for through-hole PLCC sockets
fix the LED3 and LED5 footprints for T-1 and T-1 3/4 (3mm and 5mm)
change pcb to Pcb in a commented out resource
update to latest automake
update to get ready for next snapshot
add news for snapshot 20050127
add an appendix with a big list of drill sizes. Included are American
regen
fix typo in target for creating texi files from the ascii list of drills
regen
add flag to keep building the html manual as a single page.
regen
add TQFP packages provided by Walter Fetter Lages in patch #1108881.
fix drill size for PKG_BNC_LAY. Provided by Walter Fetter Lages in patch #1108881
fix drill size for ZIP packages. Noted by Walter Fetter Lages in patch #1108881
Add DIP44. Provided by Walter Fetter Lages in patch #1108881
change units to 1/100 mil for pinout window offset
fix a segfault bug on the pinout window (no null pointer dereference)
fix a segfault bug when using <Key>Up and <Key>Down to try and adjust
add --enable-gtk and --disable-xaw configure flags which will turn
regen after adding --enable-gtk and --disable-xaw
regen
add a few missing prototypes
add MULTIWATT and friends. Fix drill size for several versions
use ACLOCAL_FLAGS if set
regen after adding gtk configure.ac stuff
update with latest changes
add a few missing files to EXTRA_DIST
regen
Import Bill Wilson's port of pcb to gtk. Things seem to compile and
add some config file patches from Bill Wilson
add some files missed in the gtk-pcb checkin
error out if m4 is not found
regen [error out if m4 not found]
convert several c++ style comments to c co...
[truncated message content] |
|
From: <gi...@gp...> - 2011-09-18 19:52:52
|
The branch, master has been updated
via cd3bd7f15384402983e71c6673678ce614a3898f (commit)
from 2a05dd78fb05c967845933591ad21183c259445a (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
=========
doc/Makefile.am | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit cd3bd7f15384402983e71c6673678ce614a3898f
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add options.texi to dist files
:100644 100644 e6e7593... cf36627... M doc/Makefile.am
=========
Changes
=========
commit cd3bd7f15384402983e71c6673678ce614a3898f
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add options.texi to dist files
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e6e7593..cf36627 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -84,6 +84,7 @@ BUILT_SOURCES=
endif
inline_texi= \
+ options.texi \
actions.texi \
pcbfile.texi
|
|
From: <gi...@gp...> - 2011-09-18 19:22:42
|
The branch, pcb-20110918 has been updated
via e002dc98b75b75477bcebe9eb090cdc9d95f70d3 (commit)
from 2a05dd78fb05c967845933591ad21183c259445a (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
=========
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit e002dc98b75b75477bcebe9eb090cdc9d95f70d3
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
branch version 20110918
:100644 100644 a802790... b416dff... M configure.ac
=========
Changes
=========
commit e002dc98b75b75477bcebe9eb090cdc9d95f70d3
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
branch version 20110918
diff --git a/configure.ac b/configure.ac
index a802790..b416dff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([pcb], [1.99z])
+AC_INIT([pcb], [20110918])
AC_CONFIG_SRCDIR([src/draw.c])
AC_PREREQ([2.60])
AM_INIT_AUTOMAKE([1.9])
|