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-08-24 21:45:31
|
The branch, master has been updated
via 8ac8d6c6403bd8f322eb146ebe129718cc989a0d (commit)
from 7b590a617db3ca3ed69965b544f1468f82c39dfe (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 | 11 +++++++++++
src/hid/gtk/gtkhid-gl.c | 12 ++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 8ac8d6c6403bd8f322eb146ebe129718cc989a0d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Don't render of soldermask outside board area
:100644 100644 c04f975... bf05b6b... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 23fa8c6... 8c1e8a2... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit 8ac8d6c6403bd8f322eb146ebe129718cc989a0d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Don't render of soldermask outside board area
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index c04f975..bf05b6b 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -741,6 +741,11 @@ redraw_region (GdkRectangle *rect)
region.Y2 = MAX(Py(priv->clip_rect.y),
Py(priv->clip_rect.y + priv->clip_rect.height + 1));
+ region.X1 = MAX (0, MIN (PCB->MaxWidth, region.X1));
+ region.X2 = MAX (0, MIN (PCB->MaxWidth, region.X2));
+ region.Y1 = MAX (0, MIN (PCB->MaxHeight, region.Y1));
+ region.Y2 = MAX (0, MIN (PCB->MaxHeight, region.Y2));
+
eleft = Vx (0);
eright = Vx (PCB->MaxWidth);
etop = Vy (0);
@@ -1295,6 +1300,12 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
region.Y1 = MIN(Py(0), Py(gport->height + 1));
region.X2 = MAX(Px(0), Px(gport->width + 1));
region.Y2 = MAX(Py(0), Py(gport->height + 1));
+
+ region.X1 = MAX (0, MIN (PCB->MaxWidth, region.X1));
+ region.X2 = MAX (0, MIN (PCB->MaxWidth, region.X2));
+ region.Y1 = MAX (0, MIN (PCB->MaxHeight, region.Y1));
+ region.Y2 = MAX (0, MIN (PCB->MaxHeight, region.Y2));
+
hid_expose_callback (&ghid_hid, ®ion, NULL);
gport->drawable = save_drawable;
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 23fa8c6..8c1e8a2 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -961,6 +961,11 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
region.Y1 = MIN (Py (ev->area.y), Py (ev->area.y + ev->area.height + 1));
region.Y2 = MAX (Py (ev->area.y), Py (ev->area.y + ev->area.height + 1));
+ region.X1 = MAX (0, MIN (PCB->MaxWidth, region.X1));
+ region.X2 = MAX (0, MIN (PCB->MaxWidth, region.X2));
+ region.Y1 = MAX (0, MIN (PCB->MaxHeight, region.Y1));
+ region.Y2 = MAX (0, MIN (PCB->MaxHeight, region.Y2));
+
glColor3f (port->bg_color.red / 65535.,
port->bg_color.green / 65535.,
port->bg_color.blue / 65535.);
@@ -1209,10 +1214,17 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
-gport->view_x0,
ghid_flip_y ? gport->view_y0 - PCB->MaxHeight :
-gport->view_y0, 0);
+
region.X1 = MIN(Px(0), Px(gport->width + 1));
region.Y1 = MIN(Py(0), Py(gport->height + 1));
region.X2 = MAX(Px(0), Px(gport->width + 1));
region.Y2 = MAX(Py(0), Py(gport->height + 1));
+
+ region.X1 = MAX (0, MIN (PCB->MaxWidth, region.X1));
+ region.X2 = MAX (0, MIN (PCB->MaxWidth, region.X2));
+ region.Y1 = MAX (0, MIN (PCB->MaxHeight, region.Y1));
+ region.Y2 = MAX (0, MIN (PCB->MaxHeight, region.Y2));
+
hid_expose_callback (&ghid_hid, ®ion, NULL);
hidgl_flush_triangles (&buffer);
glPopMatrix ();
|
|
From: <gi...@gp...> - 2011-08-22 19:39:27
|
The branch, master has been updated
via 7b590a617db3ca3ed69965b544f1468f82c39dfe (commit)
from 87572b48e0d58b8f69d4aece6e22c4a5d89a16c5 (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/create.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 7b590a617db3ca3ed69965b544f1468f82c39dfe
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix negative-angle handling in create.c
This bug could be seen by taking a component with an
arc (say, a 3-pin TO transistor, with curved silk),
flipping it with 'b', and trying to move it. The arc
would be inverted.
:100644 100644 b57f4a5... c843582... M src/create.c
=========
Changes
=========
commit 7b590a617db3ca3ed69965b544f1468f82c39dfe
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix negative-angle handling in create.c
This bug could be seen by taking a component with an
arc (say, a 3-pin TO transistor, with curved silk),
flipping it with 'b', and trying to move it. The arc
would be inverted.
diff --git a/src/create.c b/src/create.c
index b57f4a5..c843582 100644
--- a/src/create.c
+++ b/src/create.c
@@ -721,6 +721,11 @@ CreateNewArcInElement (ElementTypePtr Element,
Element->ArcN ++;
/* set Delta (0,360], StartAngle in [0,360) */
+ if (delta < 0)
+ {
+ delta = -delta;
+ angle -= delta;
+ }
angle = NormalizeAngle (angle);
delta = NormalizeAngle (delta);
if (delta == 0)
|
|
From: <gi...@gp...> - 2011-08-22 16:52:57
|
The branch, master has been updated
via 87572b48e0d58b8f69d4aece6e22c4a5d89a16c5 (commit)
from 34c89fa606b512ce5f209c2829b5e769c0ea121c (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/report.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 87572b48e0d58b8f69d4aece6e22c4a5d89a16c5
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix segfault in report.c text report output
:100644 100644 56e1fa9... d63bb90... M src/report.c
=========
Changes
=========
commit 87572b48e0d58b8f69d4aece6e22c4a5d89a16c5
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix segfault in report.c text report output
diff --git a/src/report.c b/src/report.c
index 56e1fa9..d63bb90 100644
--- a/src/report.c
+++ b/src/report.c
@@ -446,13 +446,13 @@ ReportDialog (int argc, char **argv, Coord x, Coord y)
GetLayerNumber (PCB->Data, (LayerTypePtr) ptr1));
pcb_sprintf (&report[0], "%m+TEXT ID# %ld; Flags:%s\n"
"Located at (X,Y) = %$mD.\n"
- "Characters are %$mD tall.\n"
+ "Characters are %$mS tall.\n"
"Value is \"%s\".\n"
"Direction is %d.\n"
"The bounding box is %$mD %$mD.\n"
"%s\n"
"%s", USER_UNITMASK, text->ID, flags_to_string (text->Flags, TEXT_TYPE),
- text->X, text->Y, (Coord) (0.45 * text->Scale * 100),
+ text->X, text->Y, (Coord) (0.45 * MIL_TO_COORD (text->Scale)),
text->TextString, text->Direction,
text->BoundingBox.X1, text->BoundingBox.Y1,
text->BoundingBox.X2, text->BoundingBox.Y2,
|
|
From: <gi...@gp...> - 2011-08-21 23:11:41
|
The branch, master has been updated
via 34c89fa606b512ce5f209c2829b5e769c0ea121c (commit)
from 2c25ce33e7abfaa4f7710abebd620e70fa0e8cd1 (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 | 4 ++--
src/hid/gtk/gui-output-events.c | 8 ++------
src/hid/gtk/gui.h | 2 +-
3 files changed, 5 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit 34c89fa606b512ce5f209c2829b5e769c0ea121c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove emit_changed parameter from ghid_port_ranges_scale.
The one caller which passed TRUE, PCBChanged () also immediately
aftwewards calls ghid_port_ranges_pan(), which will take car of any
changes necessary.
:100644 100644 27ceeb9... 96ff923... M src/hid/gtk/gtkhid-main.c
:100644 100644 527945a... 0fc07f3... M src/hid/gtk/gui-output-events.c
:100644 100644 7c0ffb5... 9bed4d9... M src/hid/gtk/gui.h
=========
Changes
=========
commit 34c89fa606b512ce5f209c2829b5e769c0ea121c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove emit_changed parameter from ghid_port_ranges_scale.
The one caller which passed TRUE, PCBChanged () also immediately
aftwewards calls ghid_port_ranges_pan(), which will take car of any
changes necessary.
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 27ceeb9..96ff923 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -95,7 +95,7 @@ ghid_zoom_view_abs (Coord center_x, Coord center_y, double new_zoom)
gport->zoom = new_zoom;
pixel_slop = new_zoom;
- ghid_port_ranges_scale (FALSE);
+ ghid_port_ranges_scale ();
gport->view_x0 = MAX (0, SIDE_X (center_x) - xtmp * gport->view_width);
gport->view_y0 = MAX (0, SIDE_Y (center_y) - ytmp * gport->view_height);
@@ -1152,7 +1152,7 @@ PCBChanged (int argc, char **argv, Coord x, Coord y)
if (!gport->pixmap)
return 0;
RouteStylesChanged (0, NULL, 0, 0);
- ghid_port_ranges_scale (TRUE);
+ ghid_port_ranges_scale ();
ghid_port_ranges_pan (0, 0, FALSE);
ghid_zoom_view_fit ();
ghid_port_ranges_changed ();
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 527945a..0fc07f3 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -114,7 +114,7 @@ ghid_port_ranges_pan (gdouble x, gdouble y, gboolean relative)
| overall PCB board size.
*/
void
-ghid_port_ranges_scale (gboolean emit_changed)
+ghid_port_ranges_scale (void)
{
GtkAdjustment *adj;
@@ -135,16 +135,12 @@ ghid_port_ranges_scale (gboolean emit_changed)
adj->page_increment = adj->page_size/10.0;
adj->step_increment = adj->page_size/100.0;
adj->upper = PCB->MaxWidth;
- if (emit_changed)
- gtk_signal_emit_by_name (GTK_OBJECT (adj), "changed");
adj = gtk_range_get_adjustment (GTK_RANGE (ghidgui->v_range));
adj->page_size = gport->view_height;
adj->page_increment = adj->page_size/10.0;
adj->step_increment = adj->page_size/100.0;
adj->upper = PCB->MaxHeight;
- if (emit_changed)
- gtk_signal_emit_by_name (GTK_OBJECT (adj), "changed");
}
@@ -467,7 +463,7 @@ ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
ghid_drawing_area_configure_hook (out);
}
- ghid_port_ranges_scale (FALSE);
+ ghid_port_ranges_scale ();
ghid_invalidate_all ();
return 0;
}
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 7c0ffb5..9bed4d9 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -264,7 +264,7 @@ void ghid_get_pointer (gint *, gint *);
*/
void ghid_port_ranges_changed (void);
gboolean ghid_port_ranges_pan (gdouble x, gdouble y, gboolean relative);
-void ghid_port_ranges_scale (gboolean emit_changed);
+void ghid_port_ranges_scale (void);
void ghid_port_ranges_update_ranges (void);
gboolean ghid_note_event_location (GdkEventButton * ev);
|
|
From: <gi...@gp...> - 2011-08-20 15:01:11
|
The branch, master has been updated
via 2c25ce33e7abfaa4f7710abebd620e70fa0e8cd1 (commit)
via 2b803a8419fbeacc623cc51f4765b141033119de (commit)
via f903b4be6b85efc110852f7be40edf8245f0a513 (commit)
from db8eb1a6f73366ac920f19dc25f98c7196a97016 (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 | 261 ++++++++++++++++++++-------------------------
src/hid/gtk/gui.h | 3 +-
2 files changed, 116 insertions(+), 148 deletions(-)
=================
Commit Messages
=================
commit 2c25ce33e7abfaa4f7710abebd620e70fa0e8cd1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Rework view flip code
:100644 100644 2baf935... 27ceeb9... M src/hid/gtk/gtkhid-main.c
commit 2b803a8419fbeacc623cc51f4765b141033119de
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Rework zoom / pan API
:100644 100644 d7549ca... 2baf935... M src/hid/gtk/gtkhid-main.c
:100644 100644 752c184... 7c0ffb5... M src/hid/gtk/gui.h
commit f903b4be6b85efc110852f7be40edf8245f0a513
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Some NOOP and whitespace changes to the SwapSides() function
Split from of a later patch which reworks the view flipping APIs.
Hopefully this makes the function a little simpler.
:100644 100644 68775c1... d7549ca... M src/hid/gtk/gtkhid-main.c
=========
Changes
=========
commit 2c25ce33e7abfaa4f7710abebd620e70fa0e8cd1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Rework view flip code
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 2baf935..27ceeb9 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -122,6 +122,23 @@ ghid_zoom_view_fit (void)
PCB->MaxHeight / gport->height));
}
+static void
+ghid_flip_view (Coord center_x, Coord center_y, bool flip_x, bool flip_y)
+{
+ int widget_x, widget_y;
+
+ /* Work out where on the screen the flip point is */
+ ghid_pcb_to_event_coords (center_x, center_y, &widget_x, &widget_y);
+
+ ghid_flip_x = ghid_flip_x != flip_x;
+ ghid_flip_y = ghid_flip_y != flip_y;
+
+ /* Pan the board so the center location remains in the same place */
+ ghid_pan_view_abs (center_x, center_y, widget_x, widget_y);
+
+ ghid_invalidate_all ();
+}
+
/* ------------------------------------------------------------ */
static const char zoom_syntax[] =
@@ -1350,9 +1367,6 @@ side'' of the board.
static int
SwapSides (int argc, char **argv, Coord x, Coord y)
{
- gint flipd;
- int do_flip_x = 0;
- int do_flip_y = 0;
int active_group = GetLayerGroupNumberByNumber (LayerStack[0]);
int comp_group = GetLayerGroupNumberByNumber (component_silk_layer);
int solder_group = GetLayerGroupNumberByNumber (solder_silk_layer);
@@ -1364,26 +1378,20 @@ SwapSides (int argc, char **argv, Coord x, Coord y)
switch (argv[0][0]) {
case 'h':
case 'H':
- ghid_flip_x = ! ghid_flip_x;
- do_flip_x = 1;
+ ghid_flip_view (gport->pcb_x, gport->pcb_y, true, false);
break;
case 'v':
case 'V':
- ghid_flip_y = ! ghid_flip_y;
- do_flip_y = 1;
+ ghid_flip_view (gport->pcb_x, gport->pcb_y, false, true);
break;
case 'r':
case 'R':
- ghid_flip_x = ! ghid_flip_x;
- ghid_flip_y = ! ghid_flip_y;
- do_flip_x = 1;
- do_flip_y = 1;
+ ghid_flip_view (gport->pcb_x, gport->pcb_y, true, true);
+ Settings.ShowSolderSide = !Settings.ShowSolderSide; /* Swapped back below */
break;
default:
return 1;
}
- /* SwapSides will swap this */
- Settings.ShowSolderSide = (ghid_flip_x == ghid_flip_y);
}
Settings.ShowSolderSide = !Settings.ShowSolderSide;
@@ -1399,22 +1407,6 @@ SwapSides (int argc, char **argv, Coord x, Coord y)
!new_comp_vis, !new_comp_vis);
}
- /* Update coordinates so that the current location stays where it was on the
- other side; we need to do this since the actual flip center is the
- center of the board while the user expect the center would be the current
- location */
- if (do_flip_x)
- {
- flipd = PCB->MaxWidth / 2 - SIDE_X (gport->pcb_x);
- ghid_port_ranges_pan (-2 * flipd, 0, TRUE);
- }
- if (do_flip_y)
- {
- flipd = PCB->MaxHeight / 2 - SIDE_Y (gport->pcb_y);
- ghid_port_ranges_pan (0, -2 * flipd, TRUE);
- }
-
- ghid_invalidate_all ();
return 0;
}
commit 2b803a8419fbeacc623cc51f4765b141033119de
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Rework zoom / pan API
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index d7549ca..2baf935 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -30,16 +30,15 @@
RCSID ("$Id$");
-static void zoom_to (double factor, Coord x, Coord y);
-static void zoom_by (double factor, Coord x, Coord y);
-static void zoom_fit (void);
+bool ghid_flip_x = false, ghid_flip_y = false;
-int ghid_flip_x = 0, ghid_flip_y = 0;
+static void ghid_zoom_view_fit (void);
-
-void
-ghid_pan_fixup ()
+static void
+ghid_pan_view_abs (Coord pcb_x, Coord pcb_y, int widget_x, int widget_y)
{
+ gport->view_x0 = MAX (0, SIDE_X (pcb_x) - widget_x * gport->zoom);
+ gport->view_y0 = MAX (0, SIDE_Y (pcb_y) - widget_y * gport->zoom);
/* Don't pan so far to the right or bottom that we see past the board edge */
gport->view_x0 = MIN (gport->view_x0, PCB->MaxWidth - gport->view_width);
@@ -53,7 +52,7 @@ ghid_pan_fixup ()
if (gport->view_width > PCB->MaxWidth &&
gport->view_height > PCB->MaxHeight)
{
- zoom_fit ();
+ ghid_zoom_view_fit ();
return;
}
@@ -65,6 +64,64 @@ ghid_pan_fixup ()
ghid_port_ranges_changed();
}
+
+/* gport->zoom:
+ * zoom value is PCB units per screen pixel. Larger numbers mean zooming
+ * out - the largest value means you are looking at the whole board.
+ *
+ * gport->view_width and gport->view_height are in PCB coordinates
+ */
+
+static void
+ghid_zoom_view_abs (Coord center_x, Coord center_y, double new_zoom)
+{
+ double min_zoom, max_zoom;
+ double xtmp, ytmp;
+
+ /* Limit the "minimum" zoom constant (maximum zoom), at 1 pixel per PCB
+ * unit, and set the "maximum" zoom constant (minimum zoom), such that
+ * the entire board just fits inside the viewport
+ */
+ min_zoom = 1;
+ max_zoom = MAX (PCB->MaxWidth / gport->width,
+ PCB->MaxHeight / gport->height);
+ new_zoom = MIN (MAX (min_zoom, new_zoom), max_zoom);
+
+ if (gport->zoom == new_zoom)
+ return;
+
+ xtmp = (SIDE_X (center_x) - gport->view_x0) / (double)gport->view_width;
+ ytmp = (SIDE_Y (center_y) - gport->view_y0) / (double)gport->view_height;
+
+ gport->zoom = new_zoom;
+ pixel_slop = new_zoom;
+ ghid_port_ranges_scale (FALSE);
+
+ gport->view_x0 = MAX (0, SIDE_X (center_x) - xtmp * gport->view_width);
+ gport->view_y0 = MAX (0, SIDE_Y (center_y) - ytmp * gport->view_height);
+
+ ghidgui->adjustment_changed_holdoff = TRUE;
+ gtk_range_set_value (GTK_RANGE (ghidgui->h_range), gport->view_x0);
+ gtk_range_set_value (GTK_RANGE (ghidgui->v_range), gport->view_y0);
+ ghidgui->adjustment_changed_holdoff = FALSE;
+
+ ghid_port_ranges_changed ();
+ ghid_set_status_line_label ();
+}
+
+static void
+ghid_zoom_view_rel (Coord center_x, Coord center_y, double factor)
+{
+ ghid_zoom_view_abs (center_x, center_y, gport->zoom * factor);
+}
+
+static void
+ghid_zoom_view_fit (void)
+{
+ ghid_zoom_view_abs (0, 0, MAX (PCB->MaxWidth / gport->width,
+ PCB->MaxHeight / gport->height));
+}
+
/* ------------------------------------------------------------ */
static const char zoom_syntax[] =
@@ -124,7 +181,7 @@ Zoom (int argc, char **argv, Coord x, Coord y)
if (argc < 1)
{
- zoom_fit ();
+ ghid_zoom_view_fit ();
return 0;
}
@@ -137,81 +194,20 @@ Zoom (int argc, char **argv, Coord x, Coord y)
switch (argv[0][0])
{
case '-':
- zoom_by (1 / v, x, y);
+ ghid_zoom_view_rel (x, y, 1 / v);
break;
default:
case '+':
- zoom_by (v, x, y);
+ ghid_zoom_view_rel (x, y, v);
break;
case '=':
- /* this needs to set the scale factor absolutely*/
- zoom_to (v, x, y);
+ ghid_zoom_view_abs (x, y, v);
break;
}
return 0;
}
-
-static void
-zoom_to (double new_zoom, Coord x, Coord y)
-{
- double min_zoom, max_zoom;
- double xtmp, ytmp;
-
- /* gport->zoom:
- * zoom value is PCB units per screen pixel. Larger numbers mean zooming
- * out - the largest value means you are looking at the whole board.
- *
- * gport->view_width and gport->view_height are in PCB coordinates
- */
-
- /* Set the "minimum" zoom constant (maximum zoom),
- * at 1 pixel per PCB unit */
- min_zoom = 1;
-
- /* Set the "maximum" zoom constant (minimum zoom),
- * to make the entire board just fit inside the viewport */
- max_zoom = MAX (PCB->MaxWidth / gport->width,
- PCB->MaxHeight / gport->height);
-
- new_zoom = MIN (MAX (min_zoom, new_zoom), max_zoom);
-
- if (gport->zoom == new_zoom)
- return;
-
- xtmp = (SIDE_X (x) - gport->view_x0) / (double)gport->view_width;
- ytmp = (SIDE_Y (y) - gport->view_y0) / (double)gport->view_height;
-
- gport->zoom = new_zoom;
- pixel_slop = new_zoom;
- ghid_port_ranges_scale (FALSE);
-
- gport->view_x0 = MAX (0, SIDE_X (x) - xtmp * gport->view_width);
- gport->view_y0 = MAX (0, SIDE_Y (y) - ytmp * gport->view_height);
-
- ghidgui->adjustment_changed_holdoff = TRUE;
- gtk_range_set_value (GTK_RANGE (ghidgui->h_range), gport->view_x0);
- gtk_range_set_value (GTK_RANGE (ghidgui->v_range), gport->view_y0);
- ghidgui->adjustment_changed_holdoff = FALSE;
-
- ghid_port_ranges_changed ();
- ghid_set_status_line_label ();
-}
-
-static void
-zoom_by (double factor, Coord x, Coord y)
-{
- zoom_to (gport->zoom * factor, x, y);
-}
-
-static void
-zoom_fit (void)
-{
- zoom_to (MAX (PCB->MaxWidth / gport->width,
- PCB->MaxHeight / gport->height), 0, 0);
-}
-
/* ------------------------------------------------------------ */
void
@@ -320,11 +316,7 @@ ghid_set_crosshair (int x, int y, int action)
widget_y = pointer_y - offset_y;
ghid_event_to_pcb_coords (widget_x, widget_y, &pcb_x, &pcb_y);
-
- gport->view_x0 = MAX (0, SIDE_X (pcb_x) - widget_x * gport->zoom);
- gport->view_y0 = MAX (0, SIDE_Y (pcb_y) - widget_y * gport->zoom);
-
- ghid_pan_fixup ();
+ ghid_pan_view_abs (pcb_x, pcb_y, widget_x, widget_y);
/* Just in case we couldn't pan the board the whole way,
* we warp the pointer to where the crosshair DID land.
@@ -1145,7 +1137,7 @@ PCBChanged (int argc, char **argv, Coord x, Coord y)
RouteStylesChanged (0, NULL, 0, 0);
ghid_port_ranges_scale (TRUE);
ghid_port_ranges_pan (0, 0, FALSE);
- zoom_fit ();
+ ghid_zoom_view_fit ();
ghid_port_ranges_changed ();
ghid_sync_with_new_layout ();
return 0;
@@ -1590,10 +1582,7 @@ Center(int argc, char **argv, Coord pcb_x, Coord pcb_y)
widget_x = gport->width / 2;
widget_y = gport->height / 2;
- gport->view_x0 = MAX (0, SIDE_X (pcb_x) - widget_x * gport->zoom);
- gport->view_y0 = MAX (0, SIDE_Y (pcb_y) - widget_y * gport->zoom);
-
- ghid_pan_fixup ();
+ ghid_pan_view_abs (pcb_x, pcb_y, widget_x, widget_y);
/* Now move the mouse pointer to the place where the board location
* actually ended up.
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 752c184..7c0ffb5 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -62,7 +62,7 @@
#define FROM_PCB_UNITS(v) coord_to_unit (Settings.grid_unit, v)
#define TO_PCB_UNITS(v) unit_to_coord (Settings.grid_unit, v)
-extern int ghid_flip_x, ghid_flip_y;
+extern bool ghid_flip_x, ghid_flip_y;
#define SIDE_X(x) ((ghid_flip_x ? PCB->MaxWidth - (x) : (x)))
#define SIDE_Y(y) ((ghid_flip_y ? PCB->MaxHeight - (y) : (y)))
@@ -506,7 +506,6 @@ void ghid_lead_user_to_location (Coord x, Coord y);
void ghid_cancel_lead_user (void);
/* gtkhid-main.c */
-void ghid_pan_fixup (void);
void ghid_get_coords (const char *msg, Coord *x, Coord *y);
gint PCBChanged (int argc, char **argv, Coord x, Coord y);
commit f903b4be6b85efc110852f7be40edf8245f0a513
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Some NOOP and whitespace changes to the SwapSides() function
Split from of a later patch which reworks the view flipping APIs.
Hopefully this makes the function a little simpler.
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 68775c1..d7549ca 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -1361,62 +1361,50 @@ SwapSides (int argc, char **argv, Coord x, Coord y)
gint flipd;
int do_flip_x = 0;
int do_flip_y = 0;
+ int active_group = GetLayerGroupNumberByNumber (LayerStack[0]);
int comp_group = GetLayerGroupNumberByNumber (component_silk_layer);
int solder_group = GetLayerGroupNumberByNumber (solder_silk_layer);
- int active_group = GetLayerGroupNumberByNumber (LayerStack[0]);
- int comp_showing =
- PCB->Data->Layer[PCB->LayerGroups.Entries[comp_group][0]].On;
- int solder_showing =
- PCB->Data->Layer[PCB->LayerGroups.Entries[solder_group][0]].On;
-
+ bool comp_on = LAYER_PTR (PCB->LayerGroups.Entries[comp_group][0])->On;
+ bool solder_on = LAYER_PTR (PCB->LayerGroups.Entries[solder_group][0])->On;
if (argc > 0)
{
switch (argv[0][0]) {
- case 'h':
- case 'H':
- ghid_flip_x = ! ghid_flip_x;
- do_flip_x = 1;
- break;
- case 'v':
- case 'V':
- ghid_flip_y = ! ghid_flip_y;
- do_flip_y = 1;
- break;
- case 'r':
- case 'R':
- ghid_flip_x = ! ghid_flip_x;
- ghid_flip_y = ! ghid_flip_y;
- do_flip_x = 1;
- do_flip_y = 1;
- break;
- default:
- return 1;
+ case 'h':
+ case 'H':
+ ghid_flip_x = ! ghid_flip_x;
+ do_flip_x = 1;
+ break;
+ case 'v':
+ case 'V':
+ ghid_flip_y = ! ghid_flip_y;
+ do_flip_y = 1;
+ break;
+ case 'r':
+ case 'R':
+ ghid_flip_x = ! ghid_flip_x;
+ ghid_flip_y = ! ghid_flip_y;
+ do_flip_x = 1;
+ do_flip_y = 1;
+ break;
+ default:
+ return 1;
}
/* SwapSides will swap this */
Settings.ShowSolderSide = (ghid_flip_x == ghid_flip_y);
}
Settings.ShowSolderSide = !Settings.ShowSolderSide;
- if (Settings.ShowSolderSide)
- {
- if (active_group == comp_group && comp_showing && !solder_showing)
- {
- ChangeGroupVisibility (PCB->LayerGroups.Entries[comp_group][0], 0,
- 0);
- ChangeGroupVisibility (PCB->LayerGroups.Entries[solder_group][0], 1,
- 1);
- }
- }
- else
+
+ if ((active_group == comp_group && comp_on && !solder_on) ||
+ (active_group == solder_group && solder_on && !comp_on))
{
- if (active_group == solder_group && solder_showing && !comp_showing)
- {
- ChangeGroupVisibility (PCB->LayerGroups.Entries[solder_group][0], 0,
- 0);
- ChangeGroupVisibility (PCB->LayerGroups.Entries[comp_group][0], 1,
- 1);
- }
+ bool new_comp_vis = Settings.ShowSolderSide && active_group == comp_group;
+
+ ChangeGroupVisibility (PCB->LayerGroups.Entries[comp_group][0],
+ new_comp_vis, new_comp_vis);
+ ChangeGroupVisibility (PCB->LayerGroups.Entries[solder_group][0],
+ !new_comp_vis, !new_comp_vis);
}
/* Update coordinates so that the current location stays where it was on the
|
|
From: <gi...@gp...> - 2011-08-19 16:05:40
|
The branch, master has been updated
via db8eb1a6f73366ac920f19dc25f98c7196a97016 (commit)
from 53241f7333d8930f633322b8521aefb88ae689f6 (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 | 2 +-
src/hid/gtk/gtkhid-gl.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit db8eb1a6f73366ac920f19dc25f98c7196a97016
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Convert line width to Coord units in renderer GC structs.
:100644 100644 c38cbc5... c04f975... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 95ab93d... 23fa8c6... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit db8eb1a6f73366ac920f19dc25f98c7196a97016
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Convert line width to Coord units in renderer GC structs.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index c38cbc5..c04f975 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -57,7 +57,7 @@ typedef struct hid_gc_struct
GdkGC *gc;
gchar *colorname;
- gint width;
+ Coord width;
gint cap, join;
gchar xor_mask;
gint mask_seq;
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 95ab93d..23fa8c6 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -65,7 +65,7 @@ typedef struct hid_gc_struct
const char *colorname;
double alpha_mult;
- gint width;
+ Coord width;
gint cap, join;
gchar xor;
}
|
|
From: <gi...@gp...> - 2011-08-19 14:47:10
|
The branch, master has been updated
via 53241f7333d8930f633322b8521aefb88ae689f6 (commit)
from b16a6b9945ed53282bf5e87b741b9685417a5e3e (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/find.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit 53241f7333d8930f633322b8521aefb88ae689f6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
find.c: Remove unused variables in LineLineIntersect()
:100644 100644 2b47874... 1bbb1b5... M src/find.c
=========
Changes
=========
commit 53241f7333d8930f633322b8521aefb88ae689f6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
find.c: Remove unused variables in LineLineIntersect()
diff --git a/src/find.c b/src/find.c
index 2b47874..1bbb1b5 100644
--- a/src/find.c
+++ b/src/find.c
@@ -1583,7 +1583,7 @@ LineLineIntersect (LineTypePtr Line1, LineTypePtr Line2)
{
double s, r;
double line1_dx, line1_dy, line2_dx, line2_dy,
- point1_dx, point1_dy, point2_dx, point2_dy;
+ point1_dx, point1_dy;
if (TEST_FLAG (SQUAREFLAG, Line1))/* pretty reckless recursion */
{
PointType p[4];
@@ -1625,8 +1625,6 @@ LineLineIntersect (LineTypePtr Line1, LineTypePtr Line2)
line2_dy = Line2->Point2.Y - Line2->Point1.Y;
point1_dx = Line1->Point1.X - Line2->Point1.X;
point1_dy = Line1->Point1.Y - Line2->Point1.Y;
- point2_dx = Line1->Point2.X - Line2->Point2.X;
- point2_dy = Line1->Point2.Y - Line2->Point2.Y;
/* If either line is a point, we have failed already, since the
* endpoint check above will have caught an "intersection". */
|
|
From: <gi...@gp...> - 2011-08-15 20:50:23
|
The branch, master has been updated
via b16a6b9945ed53282bf5e87b741b9685417a5e3e (commit)
from b370258ec3fdf2edad8571ac34ae8c424b59dd8d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/main.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit b16a6b9945ed53282bf5e87b741b9685417a5e3e
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Add --help and -? to options that will dump usage() without loading GUI
Closes-bug: lp-826931
:100644 100644 5dc761d... 2f4322f... M src/main.c
=========
Changes
=========
commit b16a6b9945ed53282bf5e87b741b9685417a5e3e
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Add --help and -? to options that will dump usage() without loading GUI
Closes-bug: lp-826931
diff --git a/src/main.c b/src/main.c
index 5dc761d..2f4322f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -955,7 +955,10 @@ main (int argc, char *argv[])
Progname = program_basename;
/* Print usage or version if requested. Then exit. */
- if (argc > 1 && strcmp (argv[1], "-h") == 0)
+ if (argc > 1 &&
+ (strcmp (argv[1], "-h") == 0 ||
+ strcmp (argv[1], "-?") == 0 ||
+ strcmp (argv[1], "--help") == 0))
usage ();
if (argc > 1 && strcmp (argv[1], "-V") == 0)
print_version ();
|
|
From: <gi...@gp...> - 2011-08-15 20:39:51
|
The branch, master has been updated
via b370258ec3fdf2edad8571ac34ae8c424b59dd8d (commit)
from 32bb4df121badde66d50a6562051336da24762e9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/batch/batch.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
=================
Commit Messages
=================
commit b370258ec3fdf2edad8571ac34ae8c424b59dd8d
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix compilation warnings in hid/batch/batch.c
:100644 100644 f486ef3... ca8caf0... M src/hid/batch/batch.c
=========
Changes
=========
commit b370258ec3fdf2edad8571ac34ae8c424b59dd8d
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix compilation warnings in hid/batch/batch.c
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index f486ef3..ca8caf0 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -48,13 +48,13 @@ batch_get_export_options (int *n_ret)
static char *prompt = "pcb";
static int
-nop (int argc, char **argv, int x, int y)
+nop (int argc, char **argv, Coord x, Coord y)
{
return 0;
}
static int
-PCBChanged (int argc, char **argv, int x, int y)
+PCBChanged (int argc, char **argv, Coord x, Coord y)
{
if (PCB && PCB->Filename)
{
@@ -70,14 +70,14 @@ PCBChanged (int argc, char **argv, int x, int y)
}
static int
-help (int argc, char **argv, int x, int y)
+help (int argc, char **argv, Coord x, Coord y)
{
print_actions ();
return 0;
}
static int
-info (int argc, char **argv, int x, int y)
+info (int argc, char **argv, Coord x, Coord y)
{
int i, j;
int cg, sg;
@@ -87,7 +87,7 @@ info (int argc, char **argv, int x, int y)
return 0;
}
printf("Filename: %s\n", PCB->Filename);
- pcb_sprintf("Size: %ml x %ml mils, %mm x %mm mm\n",
+ pcb_printf("Size: %ml x %ml mils, %mm x %mm mm\n",
PCB->MaxWidth, PCB->MaxHeight,
PCB->MaxWidth, PCB->MaxHeight);
cg = GetLayerGroupNumberByNumber (component_silk_layer);
@@ -199,7 +199,7 @@ batch_set_line_cap (hidGC gc, EndCapStyle style)
}
static void
-batch_set_line_width (hidGC gc, int width)
+batch_set_line_width (hidGC gc, Coord width)
{
}
@@ -209,33 +209,33 @@ batch_set_draw_xor (hidGC gc, int xor_set)
}
static void
-batch_draw_line (hidGC gc, int x1, int y1, int x2, int y2)
+batch_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
{
}
static void
-batch_draw_arc (hidGC gc, int cx, int cy, int width, int height,
- int start_angle, int end_angle)
+batch_draw_arc (hidGC gc, Coord cx, Coord cy, Coord width, Coord height,
+ Angle start_angle, Angle end_angle)
{
}
static void
-batch_draw_rect (hidGC gc, int x1, int y1, int x2, int y2)
+batch_draw_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
{
}
static void
-batch_fill_circle (hidGC gc, int cx, int cy, int radius)
+batch_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius)
{
}
static void
-batch_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
+batch_fill_polygon (hidGC gc, int n_coords, Coord *x, Coord *y)
{
}
static void
-batch_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
+batch_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
{
}
|
|
From: <gi...@gp...> - 2011-08-15 20:26:14
|
The branch, master has been updated
via 32bb4df121badde66d50a6562051336da24762e9 (commit)
from eaae1aa2d4f4c7e5508597d0fc801a17caeff577 (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/gtk-pcb-coord-entry.c | 4 ++--
src/hid/gtk/gui-dialog-print.c | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit 32bb4df121badde66d50a6562051336da24762e9
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix: spin increments not working in GtkPcbCoordEntry after unit change
:100644 100644 b7037cd... 83dcaa0... M src/hid/gtk/gtk-pcb-coord-entry.c
:100644 100644 a0d28f3... 71b078f... M src/hid/gtk/gui-dialog-print.c
=========
Changes
=========
commit 32bb4df121badde66d50a6562051336da24762e9
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Fix: spin increments not working in GtkPcbCoordEntry after unit change
diff --git a/src/hid/gtk/gtk-pcb-coord-entry.c b/src/hid/gtk/gtk-pcb-coord-entry.c
index b7037cd..83dcaa0 100644
--- a/src/hid/gtk/gtk-pcb-coord-entry.c
+++ b/src/hid/gtk/gtk-pcb-coord-entry.c
@@ -137,8 +137,8 @@ gtk_pcb_coord_entry_change_unit (GtkPcbCoordEntry *ce, const Unit *new_unit)
gtk_adjustment_configure (adj, coord_to_unit (new_unit, ce->value),
coord_to_unit (new_unit, ce->min_value),
coord_to_unit (new_unit, ce->max_value),
- coord_to_unit (new_unit, ce->unit->step_small),
- coord_to_unit (new_unit, ce->unit->step_medium),
+ ce->unit->step_small,
+ ce->unit->step_medium,
0.0);
switch (ce->step_size)
diff --git a/src/hid/gtk/gui-dialog-print.c b/src/hid/gtk/gui-dialog-print.c
index a0d28f3..71b078f 100644
--- a/src/hid/gtk/gui-dialog-print.c
+++ b/src/hid/gtk/gui-dialog-print.c
@@ -174,7 +174,6 @@ ghid_attribute_dialog (HID_Attribute * attrs,
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- /* FIXME: need to write a coord-entry widget for this */
entry = gtk_pcb_coord_entry_new (attrs[j].min_val, attrs[j].max_val,
attrs[j].default_val.coord_value,
Settings.grid_unit, CE_SMALL);
|
|
From: <gi...@gp...> - 2011-08-15 19:52:51
|
The branch, master has been updated
via eaae1aa2d4f4c7e5508597d0fc801a17caeff577 (commit)
from 97b3260ecf977dcaa959e51fbd39c6b0d7b414b7 (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 | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit eaae1aa2d4f4c7e5508597d0fc801a17caeff577
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Parse options of type CONFIG_Coord in preferences file
:100644 100644 1505635... f44fa25... M src/hid/gtk/gui-config.c
=========
Changes
=========
commit eaae1aa2d4f4c7e5508597d0fc801a17caeff577
Author: Andrew Poelstra <as...@sf...>
Commit: Andrew Poelstra <as...@sf...>
Parse options of type CONFIG_Coord in preferences file
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index 1505635..f44fa25 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -126,6 +126,7 @@ static ConfigAttribute config_attributes[] = {
{"use-command-window", CONFIG_Boolean, &_ghidgui.use_command_window},
{"save-in-tmp", CONFIG_Unused, NULL},
{"grid-units", CONFIG_Unused, NULL},
+ {"grid", CONFIG_Unused, NULL},
{"history-size", CONFIG_Integer, &_ghidgui.history_size},
{"auto-pan-speed", CONFIG_Integer, &_ghidgui.auto_pan_speed},
@@ -418,6 +419,9 @@ set_config_attribute (gchar * option, gchar * arg)
case CONFIG_String:
dup_string ((gchar **) ca->value, arg ? arg : (gchar *)"");
break;
+ case CONFIG_Coord:
+ *(Coord *) ca->value = GetValue (arg, NULL, NULL);
+ break;
default:
break;
}
|
|
From: <gi...@gp...> - 2011-08-14 16:56:35
|
The branch, master has been updated
via 4932e8d78447c6e4d74c7c87865caf2fec7fe5b1 (commit)
from 1fe293d6e1c4c18e0be0f06c360276e017bc219d (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/global.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 4932e8d78447c6e4d74c7c87865caf2fec7fe5b1
Author: Felix Ruoff <Fe...@po...>
Commit: Felix Ruoff <Fe...@po...>
Remove unused variable
:100644 100644 7a09d46... 0ae5d22... M src/global.h
=========
Changes
=========
commit 4932e8d78447c6e4d74c7c87865caf2fec7fe5b1
Author: Felix Ruoff <Fe...@po...>
Commit: Felix Ruoff <Fe...@po...>
Remove unused variable
diff --git a/src/global.h b/src/global.h
index 7a09d46..0ae5d22 100644
--- a/src/global.h
+++ b/src/global.h
@@ -659,7 +659,6 @@ typedef struct /* some resources... */
*Groups, /* string with layergroups */
*Routes, /* string with route styles */
*FilePath, *RatPath, *RatCommand, *FontPath, *PinoutFont, *ElementPath, *LibraryPath, *Size, /* geometry string for size */
- *Media,
*BackgroundImage, /* PPM file for board background */
*ScriptFilename, /* PCB Actions script to execute on startup */
*ActionString, /* PCB Actions string to execute on startup */
|
|
From: <gi...@gp...> - 2011-08-14 16:55:30
|
The branch, master has been updated
via 1fe293d6e1c4c18e0be0f06c360276e017bc219d (commit)
from 0e75f8fd486242b3b30c7a7390c8080bfc650d35 (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/global.h | 2 +-
src/main.c | 1 -
2 files changed, 1 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 1fe293d6e1c4c18e0be0f06c360276e017bc219d
Author: Felix Ruoff <Fe...@po...>
Commit: Felix Ruoff <Fe...@po...>
Remove broken --menu-file option
The expected functionality is given by the option --pcb-menu for the GTK+ GUI
and lesstif GUI.
:100644 100644 2a5ae93... 7a09d46... M src/global.h
:100644 100644 04b7c2f... 8b51609... M src/main.c
=========
Changes
=========
commit 1fe293d6e1c4c18e0be0f06c360276e017bc219d
Author: Felix Ruoff <Fe...@po...>
Commit: Felix Ruoff <Fe...@po...>
Remove broken --menu-file option
The expected functionality is given by the option --pcb-menu for the GTK+ GUI
and lesstif GUI.
diff --git a/src/global.h b/src/global.h
index 2a5ae93..7a09d46 100644
--- a/src/global.h
+++ b/src/global.h
@@ -659,7 +659,7 @@ typedef struct /* some resources... */
*Groups, /* string with layergroups */
*Routes, /* string with route styles */
*FilePath, *RatPath, *RatCommand, *FontPath, *PinoutFont, *ElementPath, *LibraryPath, *Size, /* geometry string for size */
- *Media, *MenuFile, /* file containing menu definitions */
+ *Media,
*BackgroundImage, /* PPM file for board background */
*ScriptFilename, /* PCB Actions script to execute on startup */
*ActionString, /* PCB Actions string to execute on startup */
diff --git a/src/main.c b/src/main.c
index 04b7c2f..8b51609 100644
--- a/src/main.c
+++ b/src/main.c
@@ -550,7 +550,6 @@ HID_Attribute main_attribute_list[] = {
SSET (FontPath, PCBLIBPATH, "font-path", 0),
SSET (ElementPath, PCBLIBPATH, "element-path", 0),
SSET (LibraryPath, PCBLIBPATH, "lib-path", 0),
- SSET (MenuFile, "pcb-menu.res", "menu-file", 0),
SSET (ScriptFilename, 0, "action-script",
"If set, this file is executed at startup."),
SSET (ActionString, 0, "action-string",
|
|
From: <gi...@gp...> - 2011-08-14 03:56:51
|
The branch, master has been updated
via 0e75f8fd486242b3b30c7a7390c8080bfc650d35 (commit)
from b0ecb342f6602c037072b99a11250ccc162bf781 (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/change.c | 27 +++++++++++++++++++++------
src/find.c | 23 +++++++++++------------
src/global.h | 6 ++++++
src/hid/common/draw_helpers.c | 5 +++++
src/misc.c | 2 +-
src/polygon.c | 4 ++--
src/search.c | 4 ++--
7 files changed, 48 insertions(+), 23 deletions(-)
=================
Commit Messages
=================
commit 0e75f8fd486242b3b30c7a7390c8080bfc650d35
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Make toggling the HOLE flag reversible
Closes-bug: lp-699483
When toggling the HOLE flag, the Thickness is no longer changed.
Instead, use PIN_SIZE() to select from Thickness or DrillingHole
accordingly, and use that throughout.
Mask size is handled thusly: For tented vias, the mask is opened up to
just over the hole size. For untented vias, the mask gap is held
constant.
Also, various minor changes to ensure that untented holes are drawn
correctly.
:100644 100644 c65c534... 70e5470... M src/change.c
:100644 100644 2f9053d... 43dee33... M src/find.c
:100644 100644 3210d5f... 2a5ae93... M src/global.h
:100644 100644 543b99f... d7ef716... M src/hid/common/draw_helpers.c
:100644 100644 3dc87c6... 0188404... M src/misc.c
:100644 100644 0b5b2d0... 72a9299... M src/polygon.c
:100644 100644 60f6f46... ef9b9a7... M src/search.c
=========
Changes
=========
commit 0e75f8fd486242b3b30c7a7390c8080bfc650d35
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Make toggling the HOLE flag reversible
Closes-bug: lp-699483
When toggling the HOLE flag, the Thickness is no longer changed.
Instead, use PIN_SIZE() to select from Thickness or DrillingHole
accordingly, and use that throughout.
Mask size is handled thusly: For tented vias, the mask is opened up to
just over the hole size. For untented vias, the mask gap is held
constant.
Also, various minor changes to ensure that untented holes are drawn
correctly.
diff --git a/src/change.c b/src/change.c
index c65c534..70e5470 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1575,19 +1575,34 @@ ChangeHole (PinTypePtr Via)
return (false);
EraseVia (Via);
AddObjectToFlagUndoList (VIA_TYPE, Via, Via, Via);
+ AddObjectToMaskSizeUndoList (VIA_TYPE, Via, Via, Via);
+ r_delete_entry (PCB->Data->via_tree, (BoxType *) Via);
+ RestoreToPolygon (PCB->Data, VIA_TYPE, Via, Via);
TOGGLE_FLAG (HOLEFLAG, Via);
+
if (TEST_FLAG (HOLEFLAG, Via))
{
- RestoreToPolygon (PCB->Data, VIA_TYPE, Via, Via);
- AddObjectToSizeUndoList (VIA_TYPE, Via, Via, Via);
- Via->Thickness = Via->Mask = Via->DrillingHole;
- ClearFromPolygon (PCB->Data, VIA_TYPE, Via, Via);
+ /* A tented via becomes an minimally untented hole. An untented
+ via retains its mask clearance. */
+ if (Via->Mask > Via->Thickness)
+ {
+ Via->Mask = (Via->DrillingHole
+ + (Via->Mask - Via->Thickness));
+ }
+ else if (Via->Mask < Via->DrillingHole)
+ {
+ Via->Mask = Via->DrillingHole + 2 * MASKFRAME;
+ }
}
else
{
- AddObjectTo2ndSizeUndoList (VIA_TYPE, Via, Via, Via);
- Via->DrillingHole = Via->Thickness - MIN_PINORVIACOPPER;
+ Via->Mask = (Via->Thickness
+ + (Via->Mask - Via->DrillingHole));
}
+
+ SetPinBoundingBox (Via);
+ r_insert_entry (PCB->Data->via_tree, (BoxType *) Via, 0);
+ ClearFromPolygon (PCB->Data, VIA_TYPE, Via, Via);
DrawVia (Via);
Draw ();
return (true);
diff --git a/src/find.c b/src/find.c
index 2f9053d..43dee33 100644
--- a/src/find.c
+++ b/src/find.c
@@ -485,14 +485,13 @@ PinLineIntersect (PinTypePtr PV, LineTypePtr Line)
{
/* IsLineInRectangle already has Bloat factor */
return TEST_FLAG (SQUAREFLAG,
- PV) ? IsLineInRectangle (PV->X - (PV->Thickness + 1) / 2,
- PV->Y - (PV->Thickness + 1) / 2,
- PV->X + (PV->Thickness + 1) / 2,
- PV->Y + (PV->Thickness + 1) / 2,
+ PV) ? IsLineInRectangle (PV->X - (PIN_SIZE (PV) + 1) / 2,
+ PV->Y - (PIN_SIZE (PV) + 1) / 2,
+ PV->X + (PIN_SIZE (PV) + 1) / 2,
+ PV->Y + (PIN_SIZE (PV) + 1) / 2,
Line) : IsPointInPad (PV->X,
PV->Y,
- MAX (PV->
- Thickness
+ MAX (PIN_SIZE (PV)
/
2.0 +
fBloat,
@@ -1121,24 +1120,24 @@ pv_poly_callback (const BoxType * b, void *cl)
if (TEST_FLAG (SQUAREFLAG, pv))
{
LocationType x1, x2, y1, y2;
- x1 = pv->X - (pv->Thickness + 1 + Bloat) / 2;
- x2 = pv->X + (pv->Thickness + 1 + Bloat) / 2;
- y1 = pv->Y - (pv->Thickness + 1 + Bloat) / 2;
- y2 = pv->Y + (pv->Thickness + 1 + Bloat) / 2;
+ x1 = pv->X - (PIN_SIZE (pv) + 1 + Bloat) / 2;
+ x2 = pv->X + (PIN_SIZE (pv) + 1 + Bloat) / 2;
+ y1 = pv->Y - (PIN_SIZE (pv) + 1 + Bloat) / 2;
+ y2 = pv->Y + (PIN_SIZE (pv) + 1 + Bloat) / 2;
if (IsRectangleInPolygon (x1, y1, x2, y2, &i->polygon)
&& ADD_PV_TO_LIST (pv))
longjmp (i->env, 1);
}
else if (TEST_FLAG (OCTAGONFLAG, pv))
{
- POLYAREA *oct = OctagonPoly (pv->X, pv->Y, pv->Thickness / 2);
+ POLYAREA *oct = OctagonPoly (pv->X, pv->Y, PIN_SIZE (pv) / 2);
if (isects (oct, &i->polygon, true) && ADD_PV_TO_LIST (pv))
longjmp (i->env, 1);
}
else
{
if (IsPointInPolygon
- (pv->X, pv->Y, pv->Thickness * 0.5 + fBloat, &i->polygon)
+ (pv->X, pv->Y, PIN_SIZE (pv) * 0.5 + fBloat, &i->polygon)
&& ADD_PV_TO_LIST (pv))
longjmp (i->env, 1);
}
diff --git a/src/global.h b/src/global.h
index 3210d5f..2a5ae93 100644
--- a/src/global.h
+++ b/src/global.h
@@ -336,6 +336,12 @@ struct pin_st
void *Spare;
};
+/* This is the extents of a Pin or Via, depending on whether it's a
+ hole or not. */
+#define PIN_SIZE(pinptr) (TEST_FLAG(HOLEFLAG, (pinptr)) \
+ ? (pinptr)->DrillingHole \
+ : (pinptr)->Thickness)
+
typedef struct
{
ANYOBJECTFIELDS;
diff --git a/src/hid/common/draw_helpers.c b/src/hid/common/draw_helpers.c
index 543b99f..d7ef716 100644
--- a/src/hid/common/draw_helpers.c
+++ b/src/hid/common/draw_helpers.c
@@ -379,6 +379,8 @@ common_fill_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool m
if (TEST_FLAG (HOLEFLAG, pv))
{
+ if (mask)
+ gui->fill_circle (bg_gc, pv->X, pv->Y, r);
if (drawHole)
{
gui->fill_circle (bg_gc, pv->X, pv->Y, r);
@@ -416,8 +418,11 @@ common_thindraw_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bo
if (TEST_FLAG (HOLEFLAG, pv))
{
+ if (mask)
+ gui->draw_arc (fg_gc, pv->X, pv->Y, r, r, 0, 360);
if (drawHole)
{
+ r = pv->DrillingHole / 2;
gui->set_line_cap (bg_gc, Round_Cap);
gui->set_line_width (bg_gc, 0);
gui->draw_arc (bg_gc, pv->X, pv->Y, r, r, 0, 360);
diff --git a/src/misc.c b/src/misc.c
index 3dc87c6..0188404 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -240,7 +240,7 @@ SetPinBoundingBox (PinTypePtr Pin)
/* the bounding box covers the extent of influence
* so it must include the clearance values too
*/
- width = (Pin->Clearance + Pin->Thickness + 1) / 2;
+ width = (Pin->Clearance + PIN_SIZE (Pin) + 1) / 2;
width = MAX (width, (Pin->Mask + 1) / 2);
/* Adjust for our discrete polygon approximation */
diff --git a/src/polygon.c b/src/polygon.c
index 0b5b2d0..72a9299 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -799,7 +799,7 @@ SubtractPin (DataType * d, PinType * pin, LayerType * l, PolygonType * p)
}
else
{
- np = PinPoly (pin, pin->Thickness, pin->Clearance);
+ np = PinPoly (pin, PIN_SIZE (pin), pin->Clearance);
if (!np)
return -1;
}
@@ -914,7 +914,7 @@ pin_sub_callback (const BoxType * b, void *cl)
}
else
{
- np = PinPoly (pin, pin->Thickness, pin->Clearance);
+ np = PinPoly (pin, PIN_SIZE (pin), pin->Clearance);
if (!np)
longjmp (info->env, 1);
}
diff --git a/src/search.c b/src/search.c
index 60f6f46..ef9b9a7 100644
--- a/src/search.c
+++ b/src/search.c
@@ -653,7 +653,7 @@ IsPointOnPin (float X, float Y, float Radius, PinTypePtr pin)
if (TEST_FLAG (SQUAREFLAG, pin))
{
BoxType b;
- BDimension t = pin->Thickness / 2;
+ BDimension t = PIN_SIZE (pin) / 2;
b.X1 = pin->X - t;
b.X2 = pin->X + t;
@@ -663,7 +663,7 @@ IsPointOnPin (float X, float Y, float Radius, PinTypePtr pin)
return (true);
}
else if (SQUARE (pin->X - X) + SQUARE (pin->Y - Y) <=
- SQUARE (pin->Thickness / 2 + Radius))
+ SQUARE (PIN_SIZE (pin) / 2 + Radius))
return (true);
return (false);
}
|
|
From: <gi...@gp...> - 2011-08-14 00:21:22
|
The branch, master has been updated
via b0ecb342f6602c037072b99a11250ccc162bf781 (commit)
from 2c683cfb8bdc22ca9e16de39917a4f4dfc39b298 (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 | 8 +++++---
src/create.h | 2 +-
src/file.c | 7 +++++--
src/main.c | 1 -
src/parse_y.y | 3 ++-
6 files changed, 13 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit b0ecb342f6602c037072b99a11250ccc162bf781
Author: Jared Casper <jar...@gm...>
Commit: DJ Delorie <dj...@de...>
refdes labels in new layout can't be moved.
The .pcb file that gsch2pcb creates does not have a font in it. When
loading files, the bounding box for all the text is calculated as the
file is read. In the case that there is no font, this is before the
default font is installed, so the bounding box is way too small.
This patch remedies this by making all new PCB structures contain the
default font by calling CreateDefaultFont in CreateNewPCB
(CreateDefaultFont now takes in a PCBTypePtr instead of using the
global PCB). Previously, each time CreateNewPCB was called,
CreateDefaultFont was called soon thereafter.
In the case of loading a PCB from a file. The default font in the
newly created struct PCB is marked invalid but not removed. If the
.pcb file contains a font, the default font will be overwritten by the
file's font. If it does not, PCB->Font will still be invalid after
LoadPCB, a message is displayed that the default font is being used,
and PCB->Font.Valid is set to true.
Also fixes a related bug where the memory for a symbols lines wasn't
being cleared when a new file was brought into place. Previously,
this only happened if a new Font was loaded into an existing PCB. Now
the font will be replaced every time a file with symbol information is
loaded.
Rebased to actual git-head by Felix Ruoff
Closes-bug: lp-699478
:100644 100644 52157a0... 30d9745... M src/action.c
:100644 100644 e4eeb0b... cd31935... M src/create.c
:100644 100644 754a450... ec964fa... M src/create.h
:100644 100644 fef1046... abdb444... M src/file.c
:100644 100644 0e6852f... 04b7c2f... M src/main.c
:100644 100644 f35d9d0... 9c1bb6a... M src/parse_y.y
=========
Changes
=========
commit b0ecb342f6602c037072b99a11250ccc162bf781
Author: Jared Casper <jar...@gm...>
Commit: DJ Delorie <dj...@de...>
refdes labels in new layout can't be moved.
The .pcb file that gsch2pcb creates does not have a font in it. When
loading files, the bounding box for all the text is calculated as the
file is read. In the case that there is no font, this is before the
default font is installed, so the bounding box is way too small.
This patch remedies this by making all new PCB structures contain the
default font by calling CreateDefaultFont in CreateNewPCB
(CreateDefaultFont now takes in a PCBTypePtr instead of using the
global PCB). Previously, each time CreateNewPCB was called,
CreateDefaultFont was called soon thereafter.
In the case of loading a PCB from a file. The default font in the
newly created struct PCB is marked invalid but not removed. If the
.pcb file contains a font, the default font will be overwritten by the
file's font. If it does not, PCB->Font will still be invalid after
LoadPCB, a message is displayed that the default font is being used,
and PCB->Font.Valid is set to true.
Also fixes a related bug where the memory for a symbols lines wasn't
being cleared when a new file was brought into place. Previously,
this only happened if a new Font was loaded into an existing PCB. Now
the font will be replaced every time a file with symbol information is
loaded.
Rebased to actual git-head by Felix Ruoff
Closes-bug: lp-699478
diff --git a/src/action.c b/src/action.c
index 52157a0..30d9745 100644
--- a/src/action.c
+++ b/src/action.c
@@ -5924,7 +5924,6 @@ ActionNew (int argc, char **argv, int x, int y)
PCB->Name = name;
ResetStackAndVisibility ();
- CreateDefaultFont ();
SetCrosshairRange (0, 0, PCB->MaxWidth, PCB->MaxHeight);
CenterDisplay (PCB->MaxWidth / 2, PCB->MaxHeight / 2);
Redraw ();
diff --git a/src/create.c b/src/create.c
index e4eeb0b..cd31935 100644
--- a/src/create.c
+++ b/src/create.c
@@ -207,6 +207,8 @@ CreateNewPCB (bool SetDefaultNames)
for (i = 0; i < MAX_LAYER; i++)
ptr->Data->Layer[i].Name = strdup (Settings.DefaultLayerName[i]);
+ CreateDefaultFont (ptr);
+
return (ptr);
}
@@ -937,14 +939,14 @@ CreateNewLineInSymbol (SymbolTypePtr Symbol,
}
/* ---------------------------------------------------------------------------
- * parses a file with font information and installs it
+ * parses a file with font information and installs it into the provided PCB
* checks directories given as colon separated list by resource fontPath
* if the fonts filename doesn't contain a directory component
*/
void
-CreateDefaultFont (void)
+CreateDefaultFont (PCBTypePtr pcb)
{
- if (ParseFont (&PCB->Font, Settings.FontFile))
+ if (ParseFont (&pcb->Font, Settings.FontFile))
Message (_("Can't find font-symbol-file '%s'\n"), Settings.FontFile);
}
diff --git a/src/create.h b/src/create.h
index 754a450..ec964fa 100644
--- a/src/create.h
+++ b/src/create.h
@@ -86,7 +86,7 @@ PadTypePtr CreateNewPad (ElementTypePtr, LocationType, LocationType,
BDimension, char *, char *, FlagType);
LineTypePtr CreateNewLineInSymbol (SymbolTypePtr, LocationType, LocationType,
LocationType, LocationType, BDimension);
-void CreateDefaultFont (void);
+void CreateDefaultFont (PCBTypePtr);
RubberbandTypePtr CreateNewRubberbandEntry (LayerTypePtr,
LineTypePtr, PointTypePtr);
LibraryMenuTypePtr CreateNewNet (LibraryTypePtr, char *, char *);
diff --git a/src/file.c b/src/file.c
index fef1046..abdb444 100644
--- a/src/file.c
+++ b/src/file.c
@@ -405,6 +405,9 @@ LoadPCB (char *Filename)
oldPCB = PCB;
PCB = newPCB;
+ /* mark the default font invalid to know if the file has one */
+ newPCB->Font.Valid = false;
+
/* new data isn't added to the undo list */
if (!ParsePCB (PCB, Filename))
{
@@ -421,13 +424,13 @@ LoadPCB (char *Filename)
/* update cursor confinement and output area (scrollbars) */
ChangePCBSize (PCB->MaxWidth, PCB->MaxHeight);
- /* create default font if necessary */
+ /* enable default font if necessary */
if (!PCB->Font.Valid)
{
Message (_
("File '%s' has no font information, using default font\n"),
Filename);
- CreateDefaultFont ();
+ PCB->Font.Valid = true;
}
/* clear 'changed flag' */
diff --git a/src/main.c b/src/main.c
index 0e6852f..04b7c2f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1004,7 +1004,6 @@ main (int argc, char *argv[])
ResetStackAndVisibility ();
- CreateDefaultFont ();
if (gui->gui)
InitCrosshair ();
InitHandler ();
diff --git a/src/parse_y.y b/src/parse_y.y
index f35d9d0..9c1bb6a 100644
--- a/src/parse_y.y
+++ b/src/parse_y.y
@@ -263,7 +263,8 @@ parsefont
}
yyFont->Valid = false;
for (i = 0; i <= MAX_FONTPOSITION; i++)
- yyFont->Symbol[i].Valid = false;
+ free (yyFont->Symbol[i].Line);
+ bzero(yyFont->Symbol, sizeof(yyFont->Symbol));
}
symbols
{
|
|
From: <gi...@gp...> - 2011-08-13 21:44:22
|
The branch, master has been updated
via 2c683cfb8bdc22ca9e16de39917a4f4dfc39b298 (commit)
from ebcc08a6d4d8d3071e4fb31e7e010d0c095c7ad9 (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/lesstif/dialogs.c | 44 ++++++++++++++++++++++----------------------
src/hid/lesstif/lesstif.h | 1 +
src/hid/lesstif/library.c | 4 ++--
src/hid/lesstif/main.c | 18 +++++++++---------
src/hid/lesstif/menu.c | 16 ++++++++--------
src/hid/lesstif/netlist.c | 20 ++++++++++----------
src/hid/lesstif/styles.c | 14 +++++++-------
7 files changed, 59 insertions(+), 58 deletions(-)
=================
Commit Messages
=================
commit 2c683cfb8bdc22ca9e16de39917a4f4dfc39b298
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Centralize Lesstif XmStringCreate*
Closes-bug: lp-699472
To save time in the future, all XmString creation is done via
XmStringCreatePCB which is a macro in lesstif.h. Meanwhile, this macro
is defined to XmStringCreateLtoR instead of XmStringCreateLocalized.
:100644 100644 8d606ae... 2f956a9... M src/hid/lesstif/dialogs.c
:100644 100644 1bd368f... c4a2df4... M src/hid/lesstif/lesstif.h
:100644 100644 f818fe5... 5ce77f7... M src/hid/lesstif/library.c
:100644 100644 9335490... ff6d8cd... M src/hid/lesstif/main.c
:100644 100644 09bf74b... 4647fea... M src/hid/lesstif/menu.c
:100644 100644 42d1263... e5575d2... M src/hid/lesstif/netlist.c
:100644 100644 9e9b61c... 91e8c79... M src/hid/lesstif/styles.c
=========
Changes
=========
commit 2c683cfb8bdc22ca9e16de39917a4f4dfc39b298
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Centralize Lesstif XmStringCreate*
Closes-bug: lp-699472
To save time in the future, all XmString creation is done via
XmStringCreatePCB which is a macro in lesstif.h. Meanwhile, this macro
is defined to XmStringCreateLtoR instead of XmStringCreateLocalized.
diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c
index 8d606ae..2f956a9 100644
--- a/src/hid/lesstif/dialogs.c
+++ b/src/hid/lesstif/dialogs.c
@@ -74,14 +74,14 @@ setup_fsb_dialog ()
if (fsb)
return;
- xms_pcb = XmStringCreateLocalized ("*.pcb");
- xms_fp = XmStringCreateLocalized ("*.fp");
- xms_net = XmStringCreateLocalized ("*.net");
- xms_vend = XmStringCreateLocalized ("*.vend");
- xms_all = XmStringCreateLocalized ("*");
- xms_load = XmStringCreateLocalized ("Load From");
- xms_loadv = XmStringCreateLocalized ("Load Vendor");
- xms_save = XmStringCreateLocalized ("Save As");
+ xms_pcb = XmStringCreatePCB ("*.pcb");
+ xms_fp = XmStringCreatePCB ("*.fp");
+ xms_net = XmStringCreatePCB ("*.net");
+ xms_vend = XmStringCreatePCB ("*.vend");
+ xms_all = XmStringCreatePCB ("*");
+ xms_load = XmStringCreatePCB ("Load From");
+ xms_loadv = XmStringCreatePCB ("Load Vendor");
+ xms_save = XmStringCreatePCB ("Save As");
n = 0;
fsb = XmCreateFileSelectionDialog (mainwind, "file", args, n);
@@ -455,12 +455,12 @@ lesstif_confirm_dialog (char *msg, ...)
}
n = 0;
- xs = XmStringCreateLocalized (cancelmsg);
+ xs = XmStringCreatePCB (cancelmsg);
if (okmsg)
{
stdarg (XmNcancelLabelString, xs);
- xs = XmStringCreateLocalized (okmsg);
+ xs = XmStringCreatePCB (okmsg);
XtManageChild (confirm_cancel);
}
else
@@ -468,7 +468,7 @@ lesstif_confirm_dialog (char *msg, ...)
stdarg (XmNokLabelString, xs);
- xs = XmStringCreateLocalized (msg);
+ xs = XmStringCreatePCB (msg);
stdarg (XmNmessageString, xs);
XtSetValues (confirm_dialog, args, n);
@@ -590,7 +590,7 @@ lesstif_prompt_for (const char *msg, const char *default_string)
if (!msg)
msg = "Enter text:";
n = 0;
- xs = XmStringCreateLocalized ((char *)msg);
+ xs = XmStringCreatePCB ((char *)msg);
stdarg (XmNlabelString, xs);
XtSetValues (prompt_label, args, n);
XmTextSetString (prompt_text, (char *)default_string);
@@ -663,7 +663,7 @@ lesstif_attribute_dialog (HID_Attribute * attrs,
int attrcount = 0;
if (!empty)
- empty = XmStringCreateLocalized (" ");
+ empty = XmStringCreatePCB (" ");
for (i = 0; i < n_attrs; i++)
{
@@ -778,7 +778,7 @@ lesstif_attribute_dialog (HID_Attribute * attrs,
int sn = n;
if (empty == 0)
- empty = XmStringCreateLocalized ("");
+ empty = XmStringCreatePCB ("");
submenu = XmCreatePulldownMenu (form, attrs[i].name, args+sn, n-sn);
@@ -792,7 +792,7 @@ lesstif_attribute_dialog (HID_Attribute * attrs,
Widget btn;
XmString label;
n = 0;
- label = XmStringCreateLocalized ((char *)attrs[i].enumerations[sn]);
+ label = XmStringCreatePCB ((char *)attrs[i].enumerations[sn]);
stdarg (XmNuserData, & attrs[i].enumerations[sn]);
stdarg (XmNlabelString, label);
btn = XmCreatePushButton (submenu, "menubutton", args, n);
@@ -952,7 +952,7 @@ About (int argc, char **argv, int x, int y)
if (!about)
{
Cardinal n = 0;
- XmString xs = XmStringCreateLocalized (GetInfoString ());
+ XmString xs = XmStringCreatePCB (GetInfoString ());
stdarg (XmNmessageString, xs);
stdarg (XmNtitle, "About PCB");
about = XmCreateInformationDialog (mainwind, "about", args, n);
@@ -1207,7 +1207,7 @@ lesstif_sizes_reset ()
else
ls = "Units are Mils";
n = 0;
- stdarg (XmNlabelString, XmStringCreateLocalized (ls));
+ stdarg (XmNlabelString, XmStringCreatePCB (ls));
XtSetValues (sz_units, args, n);
}
@@ -1233,7 +1233,7 @@ size_field (Widget parent, char *label, int posn)
stdarg (XmNtopPosition, posn);
stdarg (XmNbottomAttachment, XmATTACH_POSITION);
stdarg (XmNbottomPosition, posn + 1);
- stdarg (XmNlabelString, XmStringCreateLocalized (label));
+ stdarg (XmNlabelString, XmStringCreatePCB (label));
stdarg (XmNalignment, XmALIGNMENT_END);
l = XmCreateLabel (parent, "label", args, n);
XtManageChild (l);
@@ -1525,7 +1525,7 @@ lesstif_update_layer_groups ()
name = SOLDER_SIDE_NAME;
else if (i == component_silk_layer)
name = COMPONENT_SIDE_NAME;
- stdarg (XmNlabelString, XmStringCreateLocalized (name));
+ stdarg (XmNlabelString, XmStringCreatePCB (name));
XtSetValues (lglabels[i], args, n);
for (j = 0; j < max_group; j++)
{
@@ -1637,7 +1637,7 @@ EditLayerGroups (int argc, char **argv, int x, int y)
stdarg (XmNtopPosition, i * MAX_LAYER);
stdarg (XmNbottomAttachment, XmATTACH_POSITION);
stdarg (XmNbottomPosition, (i + 1) * MAX_LAYER);
- stdarg (XmNlabelString, XmStringCreateLocalized (" "));
+ stdarg (XmNlabelString, XmStringCreatePCB (" "));
stdarg (XmNspacing, 0);
stdarg (XmNvisibleWhenOff, True);
stdarg (XmNfillOnSelect, True);
@@ -2036,9 +2036,9 @@ ImportGUI (int argc, char **argv, int x, int y)
return 1;
if (xms_sch == 0)
- xms_sch = XmStringCreateLocalized ("*.sch");
+ xms_sch = XmStringCreatePCB ("*.sch");
if (xms_import == 0)
- xms_import = XmStringCreateLocalized ("Import from");
+ xms_import = XmStringCreatePCB ("Import from");
setup_fsb_dialog ();
diff --git a/src/hid/lesstif/lesstif.h b/src/hid/lesstif/lesstif.h
index 1bd368f..c4a2df4 100644
--- a/src/hid/lesstif/lesstif.h
+++ b/src/hid/lesstif/lesstif.h
@@ -60,3 +60,4 @@ extern void lesstif_attributes_dialog (char *, AttributeListType *);
#define need_idle_proc lesstif_need_idle_proc
#define show_crosshair lesstif_show_crosshair
+#define XmStringCreatePCB(x) XmStringCreateLtoR((x), XmFONTLIST_DEFAULT_TAG)
diff --git a/src/hid/lesstif/library.c b/src/hid/lesstif/library.c
index f818fe5..5ce77f7 100644
--- a/src/hid/lesstif/library.c
+++ b/src/hid/lesstif/library.c
@@ -53,7 +53,7 @@ pick_net (int pick)
free (libnode_strings);
libnode_strings = (XmString *) malloc (menu->EntryN * sizeof (XmString));
for (i = 0; i < menu->EntryN; i++)
- libnode_strings[i] = XmStringCreateLocalized (menu->Entry[i].ListEntry);
+ libnode_strings[i] = XmStringCreatePCB (menu->Entry[i].ListEntry);
n = 0;
stdarg (XmNitems, libnode_strings);
stdarg (XmNitemCount, menu->EntryN);
@@ -135,7 +135,7 @@ LibraryChanged (int argc, char **argv, int x, int y)
free (library_strings);
library_strings = (XmString *) malloc (Library.MenuN * sizeof (XmString));
for (i = 0; i < Library.MenuN; i++)
- library_strings[i] = XmStringCreateLocalized (Library.Menu[i].Name);
+ library_strings[i] = XmStringCreatePCB (Library.Menu[i].Name);
n = 0;
stdarg (XmNitems, library_strings);
stdarg (XmNitemCount, Library.MenuN);
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 9335490..ff6d8cd 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -1871,7 +1871,7 @@ lesstif_do_export (HID_Attr_Val * options)
stdarg (XmNtopAttachment, XmATTACH_FORM);
stdarg (XmNbottomAttachment, XmATTACH_FORM);
stdarg (XmNleftAttachment, XmATTACH_FORM);
- stdarg (XmNlabelString, XmStringCreateLocalized ("Command: "));
+ stdarg (XmNlabelString, XmStringCreatePCB ("Command: "));
m_cmd_label = XmCreateLabel (messages, "command", args, n);
n = 0;
@@ -2333,7 +2333,7 @@ mark_delta_to_widget (BDimension dx, BDimension dy, Widget w)
prec, dx, prec, dy, prec, dist, angle);
}
- ms = XmStringCreateLocalized (buf);
+ ms = XmStringCreatePCB (buf);
n = 0;
stdarg (XmNlabelString, ms);
XtSetValues (w, args, n);
@@ -2372,7 +2372,7 @@ cursor_pos_to_widget (BDimension x, BDimension y, Widget w, int prev_state)
else
buf = pcb_g_strdup_printf ("%m+%.*mS, %.*mS", UUNIT, prec, x, prec, y);
- ms = XmStringCreateLocalized (buf);
+ ms = XmStringCreatePCB (buf);
n = 0;
stdarg (XmNlabelString, ms);
XtSetValues (w, args, n);
@@ -2425,7 +2425,7 @@ lesstif_update_status_line ()
break;
}
- xs = XmStringCreateLocalized (buf);
+ xs = XmStringCreatePCB (buf);
n = 0;
stdarg (XmNlabelString, xs);
XtSetValues (m_status, args, n);
@@ -2634,7 +2634,7 @@ idle_proc (XtPointer dummy)
else
pcb_sprintf (buf, "%m+%$mS", UUNIT, (BDimension) old_grid);
}
- ms = XmStringCreateLocalized (buf);
+ ms = XmStringCreatePCB (buf);
n = 0;
stdarg (XmNlabelString, ms);
XtSetValues (m_grid, args, n);
@@ -2668,7 +2668,7 @@ idle_proc (XtPointer dummy)
sprintf (buf, "%d %s/pix", (int) (g + 0.005), units);
else
sprintf (buf, "%.2f %s/pix", g, units);
- ms = XmStringCreateLocalized (buf);
+ ms = XmStringCreatePCB (buf);
n = 0;
stdarg (XmNlabelString, ms);
XtSetValues (m_zoom, args, n);
@@ -2762,7 +2762,7 @@ idle_proc (XtPointer dummy)
cursor = XC_hand2;
break;
}
- ms = XmStringCreateLocalized (s);
+ ms = XmStringCreatePCB (s);
n = 0;
stdarg (XmNlabelString, ms);
XtSetValues (m_mode, args, n);
@@ -2833,7 +2833,7 @@ idle_proc (XtPointer dummy)
}
n = 0;
- stdarg (XmNlabelString, XmStringCreateLocalized (buf));
+ stdarg (XmNlabelString, XmStringCreatePCB (buf));
XtSetValues (m_rats, args, n);
if (!PCB->Data->RatN)
@@ -3892,7 +3892,7 @@ lesstif_progress_dialog (int so_far, int total, const char *msg)
XtSetValues (progress_scale, args, n);
n = 0;
- xs = XmStringCreateLocalized ((char *)msg);
+ xs = XmStringCreatePCB ((char *)msg);
stdarg (XmNmessageString, xs);
XtSetValues (progress_dialog, args, n);
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index 09bf74b..4647fea 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -249,7 +249,7 @@ LayersChanged (int argc, char **argv, int x, int y)
n = 0;
if (i < MAX_LAYER && PCB->Data->Layer[i].Name)
{
- XmString s = XmStringCreateLocalized (PCB->Data->Layer[i].Name);
+ XmString s = XmStringCreatePCB (PCB->Data->Layer[i].Name);
stdarg (XmNlabelString, s);
}
if (!lb->is_pick)
@@ -297,7 +297,7 @@ LayersChanged (int argc, char **argv, int x, int y)
n = 0;
stdarg (XmNbackground, fg_colors[current_layer]);
stdarg (XmNforeground, bg_color);
- stdarg (XmNlabelString, XmStringCreateLocalized (name));
+ stdarg (XmNlabelString, XmStringCreatePCB (name));
XtSetValues (lesstif_m_layer, args, n);
}
@@ -414,7 +414,7 @@ layerpick_button_callback (Widget w, int layer,
n = 0;
stdarg (XmNbackground, fg_colors[layer]);
stdarg (XmNforeground, bg_color);
- stdarg (XmNlabelString, XmStringCreateLocalized (name));
+ stdarg (XmNlabelString, XmStringCreatePCB (name));
XtSetValues (lesstif_m_layer, args, n);
lesstif_invalidate_all ();
}
@@ -560,7 +560,7 @@ insert_layerview_buttons (Widget menu)
Resource *ar;
XmString as;
sprintf (buf, "Ctrl-%d", accel_idx + 1);
- as = XmStringCreateLocalized (buf);
+ as = XmStringCreatePCB (buf);
stdarg (XmNacceleratorText, as);
ar = resource_create (0);
sprintf (av, "ToggleView(%d)", i + 1);
@@ -632,7 +632,7 @@ insert_layerpick_buttons (Widget menu)
resource_add_val (ar, 0, strdup (av), 0);
ar->flags |= FLAG_V;
sprintf (buf, "%d", i + 1);
- as = XmStringCreateLocalized (buf);
+ as = XmStringCreatePCB (buf);
stdarg (XmNacceleratorText, as);
sprintf (av, "<Key>%d", accel_idx + 1);
note_accelerator (av, ar);
@@ -779,7 +779,7 @@ lesstif_button_event (Widget w, XEvent * e)
void
lesstif_get_xy (const char *message)
{
- XmString ls = XmStringCreateLocalized ((char *)message);
+ XmString ls = XmStringCreatePCB ((char *)message);
XtManageChild (m_click);
n = 0;
@@ -1265,7 +1265,7 @@ add_resource_to_menu (Widget menu, Resource * node, XtCallbackProc callback)
}
if ((r = resource_subres (node->v[i].subres, "a")))
{
- XmString as = XmStringCreateLocalized (r->v[0].value);
+ XmString as = XmStringCreatePCB (r->v[0].value);
stdarg (XmNacceleratorText, as);
//stdarg(XmNaccelerator, r->v[1].value);
note_accelerator (r->v[1].value, node->v[i].subres);
@@ -1277,7 +1277,7 @@ add_resource_to_menu (Widget menu, Resource * node, XtCallbackProc callback)
v = node->v[i].subres->v[j].value;
break;
}
- stdarg (XmNlabelString, XmStringCreateLocalized (v));
+ stdarg (XmNlabelString, XmStringCreatePCB (v));
if (node->v[i].subres->flags & FLAG_S)
{
int nn = n;
diff --git a/src/hid/lesstif/netlist.c b/src/hid/lesstif/netlist.c
index 42d1263..e5575d2 100644
--- a/src/hid/lesstif/netlist.c
+++ b/src/hid/lesstif/netlist.c
@@ -62,7 +62,7 @@ pick_net (int pick)
n_netnode_strings = menu->EntryN;
netnode_strings = (XmString *) malloc (menu->EntryN * sizeof (XmString));
for (i = 0; i < menu->EntryN; i++)
- netnode_strings[i] = XmStringCreateLocalized (menu->Entry[i].ListEntry);
+ netnode_strings[i] = XmStringCreatePCB (menu->Entry[i].ListEntry);
n = 0;
stdarg (XmNitems, netnode_strings);
stdarg (XmNitemCount, menu->EntryN);
@@ -87,7 +87,7 @@ netlist_select (Widget w, void *v, XmListCallbackStruct * cbs)
net->flag = 1;
}
- str = XmStringCreateLocalized (name);
+ str = XmStringCreatePCB (name);
XmListReplaceItemsPos (netlist_list, &str, 1, pos);
XmStringFree (str);
XmListSelectPos (netlist_list, pos, False);
@@ -109,7 +109,7 @@ nbcb_rat_on (LibraryMenuTypePtr net, int pos)
char *name = net->Name;
name[0] = ' ';
net->flag = 1;
- str = XmStringCreateLocalized (name);
+ str = XmStringCreatePCB (name);
XmListReplaceItemsPos (netlist_list, &str, 1, pos);
XmStringFree (str);
}
@@ -121,7 +121,7 @@ nbcb_rat_off (LibraryMenuTypePtr net, int pos)
char *name = net->Name;
name[0] = '*';
net->flag = 0;
- str = XmStringCreateLocalized (name);
+ str = XmStringCreatePCB (name);
XmListReplaceItemsPos (netlist_list, &str, 1, pos);
XmStringFree (str);
}
@@ -289,7 +289,7 @@ netlist_button (Widget parent, char *name, char *string,
NLB_W (bottom);
NLB_W (left);
NLB_W (right);
- str = XmStringCreateLocalized (string);
+ str = XmStringCreatePCB (string);
stdarg(XmNlabelString, str);
rv = XmCreatePushButton (parent, name, args, n);
XtManageChild (rv);
@@ -351,7 +351,7 @@ build_netlist_dialog ()
stdarg (XmNbottomAttachment, XmATTACH_WIDGET);
stdarg (XmNbottomWidget, b_sel);
stdarg (XmNleftAttachment, XmATTACH_FORM);
- ops_str = XmStringCreateLocalized ("Operations on selected net names:");
+ ops_str = XmStringCreatePCB ("Operations on selected net names:");
stdarg (XmNlabelString, ops_str);
l_ops = XmCreateLabel (netlist_dialog, "ops", args, n);
XtManageChild (l_ops);
@@ -399,7 +399,7 @@ LesstifNetlistChanged (int argc, char **argv, int x, int y)
(XmString *) malloc (PCB->NetlistLib.MenuN * sizeof (XmString));
for (i = 0; i < PCB->NetlistLib.MenuN; i++)
netlist_strings[i] =
- XmStringCreateLocalized (PCB->NetlistLib.Menu[i].Name);
+ XmStringCreatePCB (PCB->NetlistLib.Menu[i].Name);
n = 0;
stdarg (XmNitems, netlist_strings);
stdarg (XmNitemCount, PCB->NetlistLib.MenuN);
@@ -435,13 +435,13 @@ LesstifNetlistShow (int argc, char **argv, int x, int y)
int vis = 0;
/* Select net first, 'True' causes pick_net() to be invoked */
- item = XmStringCreateLocalized (net->Name);
+ item = XmStringCreatePCB (net->Name);
XmListSelectItem (netlist_list, item, True);
XmListSetItem (netlist_list, item);
XmStringFree (item);
/* Now the netnode_list has the right contents */
- item = XmStringCreateLocalized (argv[0]);
+ item = XmStringCreatePCB (argv[0]);
XmListSelectItem (netnode_list, item, False);
/*
@@ -467,7 +467,7 @@ LesstifNetlistShow (int argc, char **argv, int x, int y)
{
XmString item;
- item = XmStringCreateLocalized (net->Name);
+ item = XmStringCreatePCB (net->Name);
XmListSetItem (netlist_list, item);
XmListSelectItem (netlist_list, item, True);
XmStringFree (item);
diff --git a/src/hid/lesstif/styles.c b/src/hid/lesstif/styles.c
index 9e9b61c..91e8c79 100644
--- a/src/hid/lesstif/styles.c
+++ b/src/hid/lesstif/styles.c
@@ -308,7 +308,7 @@ style_button (int i)
stdarg (XmNtopAttachment, XmATTACH_WIDGET);
stdarg (XmNtopWidget, i ? style_pb[i - 1] : value_form);
stdarg (XmNleftAttachment, XmATTACH_FORM);
- stdarg (XmNlabelString, XmStringCreateLocalized ("Name"));
+ stdarg (XmNlabelString, XmStringCreatePCB ("Name"));
set = XmCreatePushButton (style_dialog, "style", args, n);
XtManageChild (set);
XtAddCallback (set, XmNactivateCallback,
@@ -319,7 +319,7 @@ style_button (int i)
stdarg (XmNtopWidget, i ? style_pb[i - 1] : value_form);
stdarg (XmNleftAttachment, XmATTACH_WIDGET);
stdarg (XmNleftWidget, set);
- stdarg (XmNlabelString, XmStringCreateLocalized ("Set"));
+ stdarg (XmNlabelString, XmStringCreatePCB ("Set"));
set = XmCreatePushButton (style_dialog, "style", args, n);
XtManageChild (set);
XtAddCallback (set, XmNactivateCallback,
@@ -331,7 +331,7 @@ style_button (int i)
stdarg (XmNrightAttachment, XmATTACH_FORM);
stdarg (XmNleftAttachment, XmATTACH_WIDGET);
stdarg (XmNleftWidget, set);
- stdarg (XmNlabelString, XmStringCreateLocalized (PCB->RouteStyle[i].Name));
+ stdarg (XmNlabelString, XmStringCreatePCB (PCB->RouteStyle[i].Name));
stdarg (XmNindicatorType, XmONE_OF_MANY);
stdarg (XmNalignment, XmALIGNMENT_BEGINNING);
pb = XmCreateToggleButton (style_dialog, "style", args, n);
@@ -360,8 +360,8 @@ AdjustStyle (int argc, char **argv, int x, int y)
{
int i;
- xms_mm = XmStringCreateLocalized ("mm");
- xms_mil = XmStringCreateLocalized ("mil");
+ xms_mm = XmStringCreatePCB ("mm");
+ xms_mil = XmStringCreatePCB ("mil");
n = 0;
stdarg (XmNautoUnmanage, False);
@@ -434,7 +434,7 @@ RouteStylesChanged (int argc, char **argv, int x, int y)
name_hashes[j] = h;
n = 0;
stdarg (XmNlabelString,
- XmStringCreateLocalized (PCB->RouteStyle[j].Name));
+ XmStringCreatePCB (PCB->RouteStyle[j].Name));
if (style_dialog)
XtSetValues (style_pb[j], args, n);
for (i = 0; i < num_style_buttons; i++)
@@ -461,7 +461,7 @@ lesstif_insert_style_buttons (Widget menu)
n = 0;
stdarg (XmNindicatorType, XmONE_OF_MANY);
stdarg (XmNlabelString,
- XmStringCreateLocalized (PCB->RouteStyle[i].Name));
+ XmStringCreatePCB (PCB->RouteStyle[i].Name));
btn = XmCreateToggleButton (menu, "style", args, n);
XtManageChild (btn);
XtAddCallback (btn, XmNvalueChangedCallback,
|
|
From: <gi...@gp...> - 2011-08-13 20:08:42
|
The branch, master has been updated
via ebcc08a6d4d8d3071e4fb31e7e010d0c095c7ad9 (commit)
via b257c10be738af0f256a3fe80132447eb2d18a4b (commit)
from f6c2d4907583614a10918a121f45670620f1946e (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
=========
Makefile.am | 4 +-
README.w32 | 22 ++
README.win32 | 64 ----
configure.ac | 6 +-
w32/.gitignore | 3 +
w32/Makefile.am | 18 +
w32/README | 50 +++
w32/build-all.sh | 50 +++
w32/minipack.conf | 40 +++
w32/mpk | 130 +++++++
...001-Export-sysbols-when-building-as-a-DLL.patch | 35 ++
...tool-requires-no-undefined-to-build-a-DLL.patch | 26 ++
...nflit-between-libjpeg-and-windows-headers.patch | 33 ++
w32/patches/gettext/01-revert-sed-string.patch | 21 ++
.../02-Avoid-missing-open-argument-error.patch | 15 +
w32/patches/gtk+/01-mousewheel.patch | 29 ++
w32/patches/zlib/01-shared-lib-support.patch | 249 +++++++++++++
w32/patches/zlib/02-cross-build.patch | 61 ++++
w32/recipes/atk.recipe | 4 +
w32/recipes/cairo.recipe | 8 +
w32/recipes/gd.recipe | 29 ++
w32/recipes/gettext.recipe | 8 +
w32/recipes/glib.recipe | 8 +
w32/recipes/gtk+.recipe | 14 +
w32/recipes/jpeg.recipe | 5 +
w32/recipes/libiconv.recipe | 4 +
w32/recipes/libpng.recipe | 13 +
w32/recipes/pango.recipe | 9 +
w32/recipes/pcb.recipe | 18 +
w32/recipes/pixman.recipe | 4 +
w32/recipes/tiff.recipe | 4 +
w32/recipes/zlib.recipe | 6 +
w32/tools/mpk-build | 123 +++++++
w32/tools/mpk-clean | 38 ++
config.guess => w32/tools/mpk-config.guess | 85 ++++-
w32/tools/mpk-help | 13 +
w32/tools/mpk-install | 61 ++++
w32/tools/mpk-remove | 61 ++++
w32/tools/mpk-shell | 69 ++++
w32/tools/mpk-source | 79 +++++
w32/tools/mpk-unpack | 100 ++++++
w32/tools/mpk-version | 5 +
w32/tools/tool.template | 4 +
win32/.cvsignore | 3 -
win32/Makefile.am | 13 -
win32/Readme.txt | 15 -
win32/build_pcb | 366 --------------------
win32/extract_gtk_win32 | 286 ---------------
win32/pcb.nsi.in | 189 ----------
win32/registerExtension.nsh | 69 ----
50 files changed, 1543 insertions(+), 1026 deletions(-)
create mode 100644 README.w32
delete mode 100644 README.win32
create mode 100644 w32/.gitignore
create mode 100644 w32/Makefile.am
create mode 100644 w32/README
create mode 100755 w32/build-all.sh
create mode 100644 w32/minipack.conf
create mode 100755 w32/mpk
create mode 100644 w32/patches/gd/0001-Export-sysbols-when-building-as-a-DLL.patch
create mode 100644 w32/patches/gd/0002-Libtool-requires-no-undefined-to-build-a-DLL.patch
create mode 100644 w32/patches/gd/0003-Avoid-conflit-between-libjpeg-and-windows-headers.patch
create mode 100644 w32/patches/gettext/01-revert-sed-string.patch
create mode 100644 w32/patches/gettext/02-Avoid-missing-open-argument-error.patch
create mode 100644 w32/patches/gtk+/01-mousewheel.patch
create mode 100644 w32/patches/zlib/01-shared-lib-support.patch
create mode 100644 w32/patches/zlib/02-cross-build.patch
create mode 100644 w32/recipes/atk.recipe
create mode 100644 w32/recipes/cairo.recipe
create mode 100644 w32/recipes/gd.recipe
create mode 100644 w32/recipes/gettext.recipe
create mode 100644 w32/recipes/glib.recipe
create mode 100644 w32/recipes/gtk+.recipe
create mode 100644 w32/recipes/jpeg.recipe
create mode 100644 w32/recipes/libiconv.recipe
create mode 100644 w32/recipes/libpng.recipe
create mode 100644 w32/recipes/pango.recipe
create mode 100644 w32/recipes/pcb.recipe
create mode 100644 w32/recipes/pixman.recipe
create mode 100644 w32/recipes/tiff.recipe
create mode 100644 w32/recipes/zlib.recipe
create mode 100644 w32/tools/mpk-build
create mode 100644 w32/tools/mpk-clean
copy config.guess => w32/tools/mpk-config.guess (95%)
create mode 100644 w32/tools/mpk-help
create mode 100644 w32/tools/mpk-install
create mode 100644 w32/tools/mpk-remove
create mode 100644 w32/tools/mpk-shell
create mode 100644 w32/tools/mpk-source
create mode 100644 w32/tools/mpk-unpack
create mode 100644 w32/tools/mpk-version
create mode 100755 w32/tools/tool.template
delete mode 100644 win32/.cvsignore
delete mode 100644 win32/Makefile.am
delete mode 100644 win32/Readme.txt
delete mode 100755 win32/build_pcb
delete mode 100755 win32/extract_gtk_win32
delete mode 100644 win32/pcb.nsi.in
delete mode 100644 win32/registerExtension.nsh
=================
Commit Messages
=================
commit ebcc08a6d4d8d3071e4fb31e7e010d0c095c7ad9
Author: Cesar Strauss <cst...@no...>
Commit: DJ Delorie <dj...@de...>
Add Windows cross-build script.
Closes-bug: lp-699494
:100644 100644 1cfe9b2... c6927f1... M Makefile.am
:000000 100644 0000000... 84f9ba1... A README.w32
:100644 100644 13c1bf7... 422347a... M configure.ac
:000000 100644 0000000... d4d22bb... A w32/.gitignore
:000000 100644 0000000... af86e32... A w32/Makefile.am
:000000 100644 0000000... f487d3c... A w32/README
:000000 100755 0000000... 36e45d9... A w32/build-all.sh
:000000 100644 0000000... 27c69ac... A w32/minipack.conf
:000000 100755 0000000... 1652bc0... A w32/mpk
:000000 100644 0000000... 34a25bc... A w32/patches/gd/0001-Export-sysbols-when-building-as-a-DLL.patch
:000000 100644 0000000... 7180dc2... A w32/patches/gd/0002-Libtool-requires-no-undefined-to-build-a-DLL.patch
:000000 100644 0000000... 2283db9... A w32/patches/gd/0003-Avoid-conflit-between-libjpeg-and-windows-headers.patch
:000000 100644 0000000... 701d24c... A w32/patches/gettext/01-revert-sed-string.patch
:000000 100644 0000000... af88a3a... A w32/patches/gettext/02-Avoid-missing-open-argument-error.patch
:000000 100644 0000000... 996f6de... A w32/patches/gtk+/01-mousewheel.patch
:000000 100644 0000000... 02eb2ff... A w32/patches/zlib/01-shared-lib-support.patch
:000000 100644 0000000... 9e8ae86... A w32/patches/zlib/02-cross-build.patch
:000000 100644 0000000... ea4e91d... A w32/recipes/atk.recipe
:000000 100644 0000000... 8654d5c... A w32/recipes/cairo.recipe
:000000 100644 0000000... c9588a3... A w32/recipes/gd.recipe
:000000 100644 0000000... 49b35f7... A w32/recipes/gettext.recipe
:000000 100644 0000000... a73ae9e... A w32/recipes/glib.recipe
:000000 100644 0000000... 254aca1... A w32/recipes/gtk+.recipe
:000000 100644 0000000... b305399... A w32/recipes/jpeg.recipe
:000000 100644 0000000... 747de81... A w32/recipes/libiconv.recipe
:000000 100644 0000000... a621866... A w32/recipes/libpng.recipe
:000000 100644 0000000... 5cd9212... A w32/recipes/pango.recipe
:000000 100644 0000000... 629883e... A w32/recipes/pcb.recipe
:000000 100644 0000000... 73fa26c... A w32/recipes/pixman.recipe
:000000 100644 0000000... db2baaa... A w32/recipes/tiff.recipe
:000000 100644 0000000... c143197... A w32/recipes/zlib.recipe
:000000 100644 0000000... d90f658... A w32/tools/mpk-build
:000000 100644 0000000... 08cc285... A w32/tools/mpk-clean
:000000 100755 0000000... 278f9e9... A w32/tools/mpk-config.guess
:000000 100644 0000000... e74236a... A w32/tools/mpk-help
:000000 100644 0000000... 04f32be... A w32/tools/mpk-install
:000000 100644 0000000... 008cc35... A w32/tools/mpk-remove
:000000 100644 0000000... 207884a... A w32/tools/mpk-shell
:000000 100644 0000000... 8004b23... A w32/tools/mpk-source
:000000 100644 0000000... 021adf6... A w32/tools/mpk-unpack
:000000 100644 0000000... 0a7ff61... A w32/tools/mpk-version
:000000 100755 0000000... 60bec87... A w32/tools/tool.template
commit b257c10be738af0f256a3fe80132447eb2d18a4b
Author: Cesar Strauss <cst...@no...>
Commit: DJ Delorie <dj...@de...>
Remove previous Windows build script.
Affects-bug: lp-699494
:100644 100644 41ca65a... 1cfe9b2... M Makefile.am
:100644 000000 6598a06... 0000000... D README.win32
:100644 100644 1c4ee58... 13c1bf7... M configure.ac
:100644 000000 0615b48... 0000000... D win32/.cvsignore
:100644 000000 cdef81c... 0000000... D win32/Makefile.am
:100644 000000 93273a4... 0000000... D win32/Readme.txt
:100755 000000 7e12ae9... 0000000... D win32/build_pcb
:100755 000000 14f831f... 0000000... D win32/extract_gtk_win32
:100644 000000 04cd086... 0000000... D win32/pcb.nsi.in
:100644 000000 46e8779... 0000000... D win32/registerExtension.nsh
=========
Changes
=========
commit ebcc08a6d4d8d3071e4fb31e7e010d0c095c7ad9
Author: Cesar Strauss <cst...@no...>
Commit: DJ Delorie <dj...@de...>
Add Windows cross-build script.
Closes-bug: lp-699494
diff --git a/Makefile.am b/Makefile.am
index 1cfe9b2..c6927f1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,13 +3,13 @@
##
## Top level automake file for PCB
-DIRS= intl gts src data lib newlib example tools tutorial README_FILES po tests
+DIRS= w32 intl gts src data lib newlib example tools tutorial README_FILES po tests
SUBDIRS= ${DIRS} @DOC@
DIST_SUBDIRS= ${DIRS} doc
INTLTOOL_FILES = intltool-extract.in intltool-merge.in intltool-update.in
-EXTRA_DIST= config.rpath globalconst.h README.git icon-theme-installer $(INTLTOOL_FILES)
+EXTRA_DIST= config.rpath globalconst.h README.git README.w32 icon-theme-installer $(INTLTOOL_FILES)
DISTCLEANFILES= configure.lineno intltool-extract intltool-merge intltool-update po/.intltool-merge-cache
diff --git a/README.w32 b/README.w32
new file mode 100644
index 0000000..84f9ba1
--- /dev/null
+++ b/README.w32
@@ -0,0 +1,22 @@
+Building PCB for Windows with a MinGW cross-compiler
+
+1) Install a MinGW cross-compiler.
+On Debian and derivatives, you can type 'sudo apt-get install mingw32.'.
+You can also build your own by using the build script provided by the
+MinGW project.
+
+2) Install native (non-cross) dependencies.
+
+* autoconf, automake, libtool, gettext, intltool.
+* glib and gtk+.
+
+3) Edit the w32/minipack.conf file to suit your compiler setup.
+
+4) Enter the w32 directory and run ./build_all.
+
+5) Wait while the script fetches and compiles the PCB dependencies and PCB itself.
+
+6) Run the result with wine: wine result/bin/pcb.exe
+
+7) Copy the result directory to a Windows installation (packaging script is not supplied).
+
diff --git a/configure.ac b/configure.ac
index 13c1bf7..422347a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1288,6 +1288,9 @@ AC_CONFIG_FILES(tests/Makefile)
dnl GTS 0.7.6 - http://gts.sourceforge.net/
AC_CONFIG_FILES(gts/Makefile)
+dnl win32 build scripts
+AC_CONFIG_FILES(w32/Makefile)
+
AC_OUTPUT
with_gui=`echo $with_gui`
diff --git a/w32/.gitignore b/w32/.gitignore
new file mode 100644
index 0000000..d4d22bb
--- /dev/null
+++ b/w32/.gitignore
@@ -0,0 +1,3 @@
+build
+result
+sources
diff --git a/w32/Makefile.am b/w32/Makefile.am
new file mode 100644
index 0000000..af86e32
--- /dev/null
+++ b/w32/Makefile.am
@@ -0,0 +1,18 @@
+EXTRA_DIST= build-all.sh minipack.conf mpk README \
+ patches/gd patches/gd/0001-Export-sysbols-when-building-as-a-DLL.patch \
+ patches/gd/0002-Libtool-requires-no-undefined-to-build-a-DLL.patch \
+ patches/gd/0003-Avoid-conflit-between-libjpeg-and-windows-headers.patch \
+ patches/gettext/01-revert-sed-string.patch \
+ patches/gettext/02-Avoid-missing-open-argument-error.patch \
+ patches/gtk+ patches/gtk+/01-mousewheel.patch \
+ patches/zlib patches/zlib/01-shared-lib-support.patch \
+ patches/zlib/02-cross-build.patch \
+ recipes/atk.recipe recipes/cairo.recipe recipes/gd.recipe \
+ recipes/gettext.recipe recipes/glib.recipe recipes/gtk+.recipe \
+ recipes/jpeg.recipe recipes/libiconv.recipe recipes/libpng.recipe \
+ recipes/pango.recipe recipes/pcb.recipe recipes/pixman.recipe \
+ recipes/tiff.recipe recipes/zlib.recipe \
+ tools/mpk-build tools/mpk-clean tools/mpk-config.guess \
+ tools/mpk-help tools/mpk-install tools/mpk-remove tools/mpk-shell \
+ tools/mpk-source tools/mpk-unpack tools/mpk-version \
+ tools/tool.template
diff --git a/w32/README b/w32/README
new file mode 100644
index 0000000..f487d3c
--- /dev/null
+++ b/w32/README
@@ -0,0 +1,50 @@
+========
+Minipack
+========
+
+Homepage: http://code.google.com/p/minipack
+This minipack distribution was customized for the PCB project.
+
+Minipack is an automated build tool. Given a set of recipes and patches, it
+downloads the sources, unpacks them, applies local patches, builds them and
+installs them. Its primary use is for cross-compiling free software to
+Windows, but minipack is more general-purpose than that.
+
+To install, unpack it in any directory, and optionally set the PATH to it.
+
+The tool can be run from anywhere, but it looks for a minipack.conf file
+in the current directory or in a parent directory.
+
+Some recipes for cross-compiling to Windows are included in the distribution:
+* libraries: gtk+, guile, gd, freetype, libpng, jpeg, zlib, gettext.
+* applications: gEDA/gaf, PCB.
+See the 'recipes' directory for a full list.
+
+When cross-compiling, you need a suitable cross-compiler for the host you are
+targeting. On Debian and derivatives, you can type 'sudo apt-get install mingw32'
+to get a MinGW cross-compiler. You can also build your own by using the build
+script provided by the MinGW project.
+
+Modify the host setting in the minipack.conf file to reflect the cross-compiler
+being used. It can be found as the prefix of the compiler, eg. i586-mingw32msvc.
+
+The build-all.sh script can be used to build all packages in one run. Edit the
+BUILD list to select only a subset. Beware, some recipes require a native
+version of pkg-config, others need the autotools and/or intltool as well.
+
+=======
+ mpk
+=======
+
+The main (and only) tool of minipack is called mpk:
+* mpk build <package> - download, unpack, and build a package.
+* mpk unpack <package> - download and unpack a package
+* mpk source <package> - download a source package
+* mpk shell [package] - enter a shell with a pre-defined build environment
+
+A cache of downloaded sources is kept in the 'sources' directory.
+
+To add more recipes to minipack, place the recipe in the 'recipes' directory
+and place the patches in a subdirectory of the 'patches' directory.
+
+Have fun!
diff --git a/w32/build-all.sh b/w32/build-all.sh
new file mode 100755
index 0000000..36e45d9
--- /dev/null
+++ b/w32/build-all.sh
@@ -0,0 +1,50 @@
+NEVERBUILD="
+"
+
+NOBUILD="
+"
+
+BUILD="
+jpeg
+zlib
+libpng
+tiff
+pixman
+libiconv
+gettext
+glib
+atk
+cairo
+pango
+gtk+
+gd
+pcb
+"
+
+fail()
+{
+ echo
+ echo "=================="
+ echo "Build failed."
+ echo "=================="
+ exit 1
+}
+
+succeed()
+{
+ echo
+ echo "====================="
+ echo "Build succeeded."
+ echo "====================="
+}
+
+for D in $BUILD; do
+ ./mpk source $D || fail
+done
+
+for D in $BUILD; do
+ ./mpk build $D || fail
+done
+
+succeed
+
diff --git a/w32/minipack.conf b/w32/minipack.conf
new file mode 100644
index 0000000..27c69ac
--- /dev/null
+++ b/w32/minipack.conf
@@ -0,0 +1,40 @@
+# Change the host for your toolchain.
+# Or comment to use native building.
+host=i586-mingw32msvc
+
+# Guess the build platform.
+build=`mpk-config.guess`
+
+# Some useful mingw 32-bit flags.
+CFLAGS='-O3 -s -mms-bitfields -march=i686'
+CXXFLAGS=$CFLAGS
+
+# Useful for multi-core CPUs
+default_make_opts=-j3
+
+# Needed (at least on Ubuntu 9.10) so mingw-runtime include files
+# can override certain ones provided by mingw-gcc.
+CPPFLAGS=-B/usr/i586-mingw32msvc
+
+# Place your favorite GNU mirror here.
+gnu_mirror=http://ftp.unicamp.br/pub/gnu
+
+# Full path to the source cache.
+# Default: $topdir/sources
+# sourcedir=
+
+# Full path to the directory to place the results.
+# Default: $topdir/result
+# resultdir=
+
+# Full path to the build directory.
+# Default: $topdir/build
+# builddir=
+
+# Full path to the build recipes directory.
+# Default: $prefix/recipes
+# recipedir=
+
+# Full path to the patches directory.
+# Default: $prefix/patches
+# patchdir=
diff --git a/w32/mpk b/w32/mpk
new file mode 100755
index 0000000..1652bc0
--- /dev/null
+++ b/w32/mpk
@@ -0,0 +1,130 @@
+#! /bin/sh
+
+# mpk - top level, user visible script.
+# Copyright (C) 2008,2010 Cesar Strauss
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Minipack. If not, see <http://www.gnu.org/licenses/>.
+
+bindir=$(dirname $0)
+prog=$(basename $0)
+case $bindir in
+/*) ;;
+*) bindir=$PWD/$bindir;;
+esac
+mpk=$bindir/$prog
+prefix=$(cd $bindir && pwd)
+tooldir=$prefix/tools
+recipedir=$prefix/recipes
+patchdir=$prefix/patches
+
+MPK_VERSION=1.1.0
+
+export PATH=$tooldir:$PATH
+
+test -f ~/minipack.conf && . ~/minipack.conf
+
+cwd=$PWD
+topdir=$cwd
+until [ "$topdir" = "/" ]; do
+ if [ -f $topdir/minipack.conf ]; then
+ break;
+ fi
+ cd ..
+ topdir=$PWD
+done
+cd $cwd
+
+if [ "$topdir" = "/" ]; then
+ echo Warning: no minipack.conf found.
+ topdir=$cwd
+fi
+
+builddir=$topdir/build
+resultdir=$topdir/result
+sourcedir=$topdir/sources
+local_tooldir=$resultdir/lib/mpk/tools
+
+# Export resultdir in case we need to call our newly built tools.
+export resultdir
+
+test -f $topdir/minipack.conf && . $topdir/minipack.conf
+
+# Setup environment variables
+export PATH=$local_tooldir:$PATH
+export ACLOCAL="aclocal -I $resultdir/share/aclocal"
+export ACLOCAL_FLAGS="-I $resultdir/share/aclocal"
+export PKG_CONFIG_LIBDIR=$resultdir/lib/pkgconfig
+
+get_recipe_name()
+{
+ name=$recipedir/$1.recipe
+ if [ ! -f $name ]; then
+ echo >&2 "Recipe for \"$1\" not found."
+ exit 1
+ fi
+ echo $name
+}
+
+setup_configure_options()
+{
+ pkg_configure_opt="$def_configure_opt $configure_opt"
+ pkg_configure_opt="$pkg_configure_opt --prefix=$resultdir"
+
+ if [ -n "$host" ]; then
+ pkg_configure_opt="$pkg_configure_opt --host=$host"
+ fi
+ if [ -n "$build" ]; then
+ pkg_configure_opt="$pkg_configure_opt --build=$build"
+ fi
+
+ # Local compiler/linker search path
+ CPPFLAGS="$CPPFLAGS -I$resultdir/include"
+ LDFLAGS="$LDFLAGS -L$resultdir/lib"
+
+ test -n "$configure_no_more_flags" && return
+
+ # Add search paths to the configure line.
+ pkg_configure_opt="$pkg_configure_opt CPPFLAGS=\"$CPPFLAGS\""
+ pkg_configure_opt="$pkg_configure_opt LDFLAGS=\"$LDFLAGS\""
+
+ # Add extra flags to the configure line, if present.
+ if [ -n "$CFLAGS" ]; then
+ pkg_configure_opt="$pkg_configure_opt CFLAGS=\"$CFLAGS\""
+ fi
+ if [ -n "$CXXFLAGS" ]; then
+ pkg_configure_opt="$pkg_configure_opt CXXFLAGS=\"$CXXFLAGS\""
+ fi
+}
+
+if [ -n "$1" ]; then
+ cmd=$1
+ shift
+else
+ echo "$prog: missing argument."
+ cmd=help
+fi
+
+case $cmd in
+ --version)
+ cmd=version ;;
+ --help)
+ cmd=help ;;
+esac
+tool=$tooldir/mpk-$cmd
+if [ -f $tool ]; then
+ . $tool "$@"
+else
+ echo $prog: Invalid command: $cmd
+fi
+
diff --git a/w32/patches/gd/0001-Export-sysbols-when-building-as-a-DLL.patch b/w32/patches/gd/0001-Export-sysbols-when-building-as-a-DLL.patch
new file mode 100644
index 0000000..34a25bc
--- /dev/null
+++ b/w32/patches/gd/0001-Export-sysbols-when-building-as-a-DLL.patch
@@ -0,0 +1,35 @@
+From 1173eecef02205a48e4d70535fca91bfdcee3dd9 Mon Sep 17 00:00:00 2001
+From: Cesar Strauss <ces...@gm...>
+Date: Fri, 24 Oct 2008 20:07:43 -0200
+Subject: [PATCH] Export symbols when building as a DLL.
+
+libtool defines DLL_EXPORT when building a DLL,
+so we use dllexport in that case.
+---
+ gd.h | 8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/gd.h b/gd.h
+index f136ea6..4916373 100644
+--- a/gd.h
++++ b/gd.h
+@@ -26,8 +26,16 @@ extern "C" {
+ wish to build gd as a static library or by directly including
+ the gd sources in a project. */
+
++/* libtool defines DLL_EXPORT when building a DLL, so we use dllexport
++ in that case.
++*/
++
+ #ifndef WIN32
+ #define NONDLL 1
++#else
++#ifdef DLL_EXPORT
++#define BGDWIN32 1
++#endif
+ #endif /* WIN32 */
+
+ #ifdef NONDLL
+--
+1.5.4.3
+
diff --git a/w32/patches/gd/0002-Libtool-requires-no-undefined-to-build-a-DLL.patch b/w32/patches/gd/0002-Libtool-requires-no-undefined-to-build-a-DLL.patch
new file mode 100644
index 0000000..7180dc2
--- /dev/null
+++ b/w32/patches/gd/0002-Libtool-requires-no-undefined-to-build-a-DLL.patch
@@ -0,0 +1,26 @@
+From 59069ae7191d091fae75bb57d12651281d6bdee6 Mon Sep 17 00:00:00 2001
+From: Cesar Strauss <ces...@gm...>
+Date: Fri, 24 Oct 2008 20:09:39 -0200
+Subject: [PATCH] Libtool requires -no-undefined to build a DLL.
+
+---
+ configure.ac | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bc7b83c..ed9b052 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,6 +33,9 @@ case "$target" in
+ *-*-cygwin*) XTRA_LDFLAGS="-no-undefined"
+ os_cygwin=yes
+ ;;
++ *-*-mingw*) XTRA_LDFLAGS="-no-undefined"
++ os_cygwin=no
++ ;;
+ *) XTRA_LDFLAGS=
+ os_cygwin=no
+ ;;
+--
+1.5.4.3
+
diff --git a/w32/patches/gd/0003-Avoid-conflit-between-libjpeg-and-windows-headers.patch b/w32/patches/gd/0003-Avoid-conflit-between-libjpeg-and-windows-headers.patch
new file mode 100644
index 0000000..2283db9
--- /dev/null
+++ b/w32/patches/gd/0003-Avoid-conflit-between-libjpeg-and-windows-headers.patch
@@ -0,0 +1,33 @@
+From 600059ab3efa924b0a8f3753dce3da2ed0ab89b1 Mon Sep 17 00:00:00 2001
+From: Cesar Strauss <ces...@gm...>
+Date: Fri, 24 Oct 2008 20:12:22 -0200
+Subject: [PATCH] Avoid conflit between libjpeg and windows headers.
+
+---
+ gdhelpers.h | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/gdhelpers.h b/gdhelpers.h
+index 0c45ad3..6c4b52f 100644
+--- a/gdhelpers.h
++++ b/gdhelpers.h
+@@ -31,12 +31,16 @@ int overflow2(int a, int b);
+
+ #ifdef WIN32
+ /* 2.0.18: must include windows.h to get CRITICAL_SECTION. */
++#define INT32 INT32_W32
++#define boolean boolean_W32
+ #include <windows.h>
+ #define gdMutexDeclare(x) CRITICAL_SECTION x
+ #define gdMutexSetup(x) InitializeCriticalSection(&x)
+ #define gdMutexShutdown(x) DeleteCriticalSection(&x)
+ #define gdMutexLock(x) EnterCriticalSection(&x)
+ #define gdMutexUnlock(x) LeaveCriticalSection(&x)
++#undef INT32
++#undef boolean
+ #else
+ #ifdef HAVE_PTHREAD
+ #include <pthread.h>
+--
+1.5.4.3
+
diff --git a/w32/patches/gettext/01-revert-sed-string.patch b/w32/patches/gettext/01-revert-sed-string.patch
new file mode 100644
index 0000000..701d24c
--- /dev/null
+++ b/w32/patches/gettext/01-revert-sed-string.patch
@@ -0,0 +1,21 @@
+diff -Nraup gettext-0.17/gettext-runtime/intl/Makefile.in gettext-0.17-1/gettext-runtime/intl/Makefile.in
+--- gettext-0.17/gettext-runtime/intl/Makefile.in 2007-11-04 19:21:12.000000000 -0200
++++ gettext-0.17-1/gettext-runtime/intl/Makefile.in 2008-04-20 23:40:22.000000000 -0300
+@@ -280,10 +280,12 @@ intl-compat.lo: $(srcdir)/intl-compat.c
+ # so that they work with the sed-3.02 that is shipped with MSYS. We can use
+ # GNU bash's $'\n' syntax to obtain such a newline.
+ libintl.res: $(srcdir)/libintl.rc
+- nl=$$'\n'; \
+- sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+- sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+- sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
++ sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q};a\
++ 0'; \
++ sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q};a\
++ 0'; \
++ sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q};a\
++ 0'; \
+ $(WINDRES) \
+ "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \
+ "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
+
diff --git a/w32/patches/gettext/02-Avoid-missing-open-argument-error.patch b/w32/patches/gettext/02-Avoid-missing-open-argument-error.patch
new file mode 100644
index 0000000..af88a3a
--- /dev/null
+++ b/w32/patches/gettext/02-Avoid-missing-open-argument-error.patch
@@ -0,0 +1,15 @@
+diff --git a/gettext-tools/src/write-catalog.c b/gettext-tools/src/write-catalog.c
+index 0447744..ea4f9cf 100644
+--- a/gettext-tools/src/write-catalog.c
++++ b/gettext-tools/src/write-catalog.c
+@@ -220,7 +220,9 @@ message catalog has plural form translations, but the output format does not sup
+ /* Open the output file. */
+ if (!to_stdout)
+ {
+- fd = open (filename, O_WRONLY | O_CREAT);
++ fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC,
++ /* 0666 in portable POSIX notation: */
++ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+ if (fd < 0)
+ {
+ const char *errno_description = strerror (errno);
diff --git a/w32/patches/gtk+/01-mousewheel.patch b/w32/patches/gtk+/01-mousewheel.patch
new file mode 100644
index 0000000..996f6de
--- /dev/null
+++ b/w32/patches/gtk+/01-mousewheel.patch
@@ -0,0 +1,29 @@
+--- a/gdk/win32/gdkevents-win32.c 2008-10-17 05:06:36.000000000 +0100
++++ b/gdk/win32/gdkevents-win32.c 2008-11-23 14:56:17.000000000 +0000
+@@ -2243,7 +2243,7 @@
+ RECT rect, *drag, orig_drag;
+ POINT point;
+ MINMAXINFO *mmi;
+- HWND hwnd;
++ HWND hwnd, hwndc;
+ HCURSOR hcursor;
+ BYTE key_state[256];
+ HIMC himc;
+@@ -2855,8 +2855,15 @@
+ point.x = GET_X_LPARAM (msg->lParam);
+ point.y = GET_Y_LPARAM (msg->lParam);
+
+- if ((hwnd = WindowFromPoint (point)) == NULL)
+- break;
++ /* Find our toplevel window */
++ hwnd = GetAncestor (msg->hwnd, GA_ROOT);
++
++ /* Walk back up to the outermost child at the desired point */
++ do {
++ ScreenToClient (hwnd, &point);
++ hwndc = ChildWindowFromPoint (hwnd, point);
++ ClientToScreen (hwnd, &point);
++ } while (hwndc != hwnd && (hwnd = hwndc, 1));
+
+ msg->hwnd = hwnd;
+ if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL)
diff --git a/w32/patches/zlib/01-shared-lib-support.patch b/w32/patches/zlib/01-shared-lib-support.patch
new file mode 100644
index 0000000..02eb2ff
--- /dev/null
+++ b/w32/patches/zlib/01-shared-lib-support.patch
@@ -0,0 +1,249 @@
+diff --git a/Makefile.in b/Makefile.in
+index 2fd6e45..eb980dc 100755
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -28,10 +28,14 @@ LDFLAGS=libz.a
+ LDSHARED=$(CC)
+ CPP=$(CC) -E
+
+-LIBS=libz.a
++STATICLIB=libz.a
+ SHAREDLIB=libz.so
+ SHAREDLIBV=libz.so.1.2.3
+ SHAREDLIBM=libz.so.1
++IMPORTLIB=
++SHAREDLIBPOST='(rm -f $(SHAREDLIB) $(SHAREDLIBM); ln -s $@ $(SHAREDLIB) ; ln -s $@ $(SHAREDLIBM) )'
++SHAREDTARGET=$(SHAREDLIBV)
++LIBS=$(STATICLIB)
+
+ AR=ar rc
+ RANLIB=ranlib
+@@ -42,6 +46,7 @@ EXE=
+ prefix = /usr/local
+ exec_prefix = ${prefix}
+ libdir = ${exec_prefix}/lib
++bindir = ${exec_prefix}/bin
+ includedir = ${prefix}/include
+ mandir = ${prefix}/share/man
+ man3dir = ${mandir}/man3
+@@ -67,7 +72,7 @@ test: all
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+-libz.a: $(OBJS) $(OBJA)
++$(STATICLIB): $(OBJS) $(OBJA)
+ $(AR) $@ $(OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+@@ -77,11 +82,9 @@ match.o: match.S
+ mv _match.o match.o
+ rm -f _match.s
+
+-$(SHAREDLIBV): $(OBJS)
++$(SHAREDTARGET): $(OBJS)
+ $(LDSHARED) -o $@ $(OBJS)
+- rm -f $(SHAREDLIB) $(SHAREDLIBM)
+- ln -s $@ $(SHAREDLIB)
+- ln -s $@ $(SHAREDLIBM)
++ $(SHAREDLIBPOST)
+
+ example$(EXE): example.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
+@@ -90,37 +93,58 @@ minigzip$(EXE): minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+ install: $(LIBS)
+- -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
+- -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
+- -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
+- -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
+- cp zlib.h zconf.h $(includedir)
+- chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+- cp $(LIBS) $(libdir)
+- cd $(libdir); chmod 755 $(LIBS)
+- -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+- cd $(libdir); if test -f $(SHAREDLIBV); then \
+- rm -f $(SHAREDLIB) $(SHAREDLIBM); \
+- ln -s $(SHAREDLIBV) $(SHAREDLIB); \
+- ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
+- (ldconfig || true) >/dev/null 2>&1; \
+- fi
+- cp zlib.3 $(man3dir)
+- chmod 644 $(man3dir)/zlib.3
++ -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
++ -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
++ -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
++ -@if [ ! -d $(DESTDIR)$(bindir) ]; then mkdir -p $(DESTDIR)$(bindir); fi
++ -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
++ cp zlib.h zconf.h $(DESTDIR)$(includedir)
++ chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
++ cp zlib.3 $(DESTDIR)$(man3dir)
++ chmod 644 $(DESTDIR)$(man3dir)/zlib.3
++# Install static lib (and import lib, if set) into libdir
+ # The ranlib in install is needed on NeXTSTEP which checks file times
++ -cp $(STATICLIB) $(IMPORTLIB) $(DESTDIR)$(libdir)
++ -@(cd $(DESTDIR)$(libdir); \
++ $(RANLIB) libz.a || true; \
++ chmod 755 $(STATICLIB) $(IMPORTLIB)) >/dev/null 2>&1
++# Install shared lib -- if IMPORTLIB is set, then sharedlib goes into bindir
+ # ldconfig is for Linux
++ if test -z "$(IMPORTLIB)" ; then \
++ if test -n "$(SHAREDTARGET)" ; then \
++ if test -f "$(SHAREDTARGET)" ; then \
++ cp $(SHAREDTARGET) $(DESTDIR)$(libdir); \
++ fi; \
++ fi; \
++ cd $(DESTDIR)$(libdir); \
++ if test -n "$(SHAREDLIBV)" ; then \
++ if test -f "$(SHAREDLIBV)" ; then \
++ rm -f $(SHAREDLIB) $(SHAREDLIBM); \
++ ln -s $(SHAREDLIBV) $(SHAREDLIB); \
++ ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
++ (ldconfig || true) >/dev/null 2>&1; \
++ fi; \
++ fi; \
++ else \
++ cp $(SHAREDTARGET) $(DESTDIR)$(bindir); \
++ (cd $(DESTDIR)$(bindir); chmod 755 $(SHAREDTARGET)); \
++ fi
+
+ uninstall:
+- cd $(includedir); \
+- cd $(libdir); rm -f libz.a; \
+- if test -f $(SHAREDLIBV); then \
+- rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
++ cd $(DESTDIR)$(includedir); \
++ cd $(DESTDIR)$(libdir); rm -f $(STATICLIB) $(IMPORTLIB); \
++ if test -f "$(SHAREDLIBV)"; then \
++ if test -f "$(SHAREDLIBV)"; then \
++ rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
++ fi \
+ fi
+- cd $(man3dir); rm -f zlib.3
++ cd $(DESTDIR)$(man3dir); rm -f zlib.3
++ cd $(DESTDIR)$(bindir); (rm -f $(SHAREDLIB) || true) > /dev/null 2>&1
+
+ mostlyclean: clean
+ clean:
+ rm -f *.o *~ example$(EXE) minigzip$(EXE) \
++ $(STATICLIB) $(IMPORTLIB) $(SHAREDLIBV) $(SHAREDLIBV) $(SHAREDLIBM) \
+ libz.* foo.gz so_locations \
+ _match.s maketree contrib/infback9/*.o
+
+diff --git a/configure b/configure
+index d7ffdc3..b81ed63 100755
+--- a/configure
++++ b/configure
+@@ -18,8 +18,9 @@
+ # If you have problems, try without defining CC and CFLAGS before reporting
+ # an error.
+
+-LIBS=libz.a
+-LDFLAGS="-L. ${LIBS}"
++STATICLIB=libz.a
++old_ldflags="$LDFLAGS"
++LDFLAGS="-L. ${STATICLIB}"
+ VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
+ VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
+ VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
+@@ -28,6 +29,7 @@ RANLIB=${RANLIB-"ranlib"}
+ prefix=${prefix-/usr/local}
+ exec_prefix=${exec_prefix-'${prefix}'}
+ libdir=${libdir-'${exec_prefix}/lib'}
++bindir=${bindir-'${exec_prefix}/bin'}
+ includedir=${includedir-'${prefix}/include'}
+ mandir=${mandir-'${prefix}/share/man'}
+ shared_ext='.so'
+@@ -71,13 +73,32 @@ case "$cc" in
+ *gcc*) gcc=1;;
+ esac
+
++BUILDPLATFORM=`(uname -s || echo unknown) 2>/dev/null`;
++TARGETPLATFORM=${target-${BUILDPLATFORM}}
++
+ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+ CC="$cc"
+ SFLAGS=${CFLAGS-"-fPIC -O3"}
+ CFLAGS="$cflags"
+- case `(uname -s || echo unknown) 2>/dev/null` in
++ case ${TARGETPLATFORM} in
+ Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
+- CYGWIN* | Cygwin* | cygwin* | OS/2* )
++ OS/2* )
++ EXE='.exe';;
++ *CYGWIN* | *Cygwin* | *cygwin* )
++ SFLAGS=${CFLAGS}
++ LDFLAGS="-L. -lz ${old_ldflags}"
++ shared_ext='.dll'
++ SHAREDLIB='cygz.dll'
++ IMPORTLIB='libz.dll.a'
++ LDSHARED=${LDSHARED-"${CC} -shared -Wl,-export-all -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"}
++ EXE='.exe';;
++ *MINGW* | *Mingw* | *mingw* )
++ SFLAGS=${CFLAGS}
++ LDFLAGS="-L. -lz ${old_ldflags}"
++ shared_ext='.dll'
++ SHAREDLIB='libz.dll'
++ IMPORTLIB='libz.dll.a'
++ LDSHARED=${LDSHARED-"${CC} -shared -Wl,-export-all -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"}
+ EXE='.exe';;
+ QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
+ # (ala...@ic...)
+@@ -163,6 +184,20 @@ else
+ LDSHARED=${LDSHARED-"cc -shared"};;
+ esac
+ fi
++case ${TARGETPLATFORM} in
++ *CYGWIN* | *Cygwin* | *cygwin* )
++ # On cygwin, we always build both shared and static libs
++ LIBS="${SHAREDLIB} ${STATICLIB}"
++ SHAREDLIBPOST='/bin/true'
++ SHAREDTARGET=${SHAREDLIB}
++ ;;
++ *MINGW* | *Mingw* | *mingw* )
++ # On Mingw-cygwin-special, we always build both shared and static libs
++ LIBS="${SHAREDLIB} ${STATICLIB}"
++ SHAREDLIBPOST='/bin/true'
++ SHAREDTARGET=${SHAREDLIB}
++ ;;
++ *)
+
+ SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
+ SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
+@@ -186,10 +221,14 @@ if test $shared -eq 1; then
+ fi
+ if test $shared -eq 0; then
+ LDSHARED="$CC"
+- echo Building static library $LIBS version $VER with $CC.
++ LIBS="$STATICLIB"
++ LDFLAGS="-L. ${STATICLIB}"
++ echo Building static library $STATICLIB version $VER with $CC.
+ else
+ LDFLAGS="-L. ${SHAREDLIBV}"
+ fi
++ ;;
++esac
+
+ cat > $test.c <<EOF
+ #include <unistd.h>
+@@ -444,15 +483,20 @@ sed < Makefile.in "
+ /^CPP *=/s#=.*#=$CPP#
+ /^LDSHARED *=/s#=.*#=$LDSHARED#
+ /^LIBS *=/s#=.*#=$LIBS#
++/^STATICLIB *=/s#=.*#=$STATICLIB#
+ /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
+ /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
+ /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
++/^IMPORTLIB *=/s#=.*#=$IMPORTLIB#
++/^SHAREDLIBPOST *=/s#=.*#=$SHAREDLIBPOST#
++/^SHAREDTARGET *=/s#=.*#=$SHAREDTARGET#
+ /^AR *=/s#=.*#=$AR#
+ /^RANLIB *=/s#=.*#=$RANLIB#
+ /^EXE *=/s#=.*#=$EXE#
+ /^prefix *=/s#=.*#=$prefix#
+ /^exec_prefix *=/s#=.*#=$exec_prefix#
+ /^libdir *=/s#=.*#=$libdir#
++/^bindir *=/s#=.*#=$bindir#
+ /^includedir *=/s#=.*#=$includedir#
+ /^mandir *=/s#=.*#=$mandir#
+ /^LDFLAGS *=/s#=.*#=$LDFLAGS#
diff --git a/w32/patches/zlib/02-cross-build.patch b/w32/patches/zlib/02-cross-build.patch
new file mode 100644
index 0000000..9e8ae86
--- /dev/null
+++ b/w32/patches/zlib/02-cross-build.patch
@@ -0,0 +1,61 @@
+diff --git a/configure b/configure
+index b81ed63..864bba2 100755
+--- a/configure
++++ b/configure
+@@ -41,10 +41,10 @@ old_cflags="$CFLAGS"
+ while test $# -ge 1
+ do
+ case "$1" in
+- -h* | --h*)
++ -h | -help | --help)
+ echo 'usage:'
+ echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]'
+- echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
++ echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR] [--host=HOST]'
+ exit 0;;
+ -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+ -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+@@ -55,6 +55,8 @@ case "$1" in
+ -l* | --l*) libdir="$2"; shift; shift;;
+ -i* | --i*) includedir="$2"; shift; shift;;
+ -s* | --s*) shared=1; shift;;
++ -host=* | --host=*) host=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
++ -host | --host) host="$2"; shift; shift;;
+ *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1;;
+ esac
+ done
+@@ -66,7 +68,8 @@ int hello() {return getchar();}
+ EOF
+
+ test -z "$CC" && echo Checking for gcc...
+-cc=${CC-gcc}
++test -n "$host" && cross_gcc=$host-gcc
++cc=${CC-${cross_gcc-gcc}}
+ cflags=${CFLAGS-"-O3"}
+ # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+ case "$cc" in
+@@ -74,13 +77,13 @@ case "$cc" in
+ esac
+
+ BUILDPLATFORM=`(uname -s || echo unknown) 2>/dev/null`;
+-TARGETPLATFORM=${target-${BUILDPLATFORM}}
++HOSTPLATFORM=${host-${BUILDPLATFORM}}
+
+ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+ CC="$cc"
+ SFLAGS=${CFLAGS-"-fPIC -O3"}
+ CFLAGS="$cflags"
+- case ${TARGETPLATFORM} in
++ case ${HOSTPLATFORM} in
+ Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
+ OS/2* )
+ EXE='.exe';;
+@@ -184,7 +187,7 @@ else
+ LDSHARED=${LDSHARED-"cc -shared"};;
+ esac
+ fi
+-case ${TARGETPLATFORM} in
++case ${HOSTPLATFORM} in
+ *CYGWIN* | *Cygwin* | *cygwin* )
+ # On cygwin, we always build both shared and static libs
+ LIBS="${SHAREDLIB} ${STATICLIB}"
diff --git a/w32/recipes/atk.recipe b/w32/recipes/atk.recipe
new file mode 100644
index 0000000..ea4e91d
--- /dev/null
+++ b/w32/recipes/atk.recipe
@@ -0,0 +1,4 @@
+name=atk
+version=1.28.0
+release=1
+download=http://ftp.gnome.org/pub/gnome/sources/atk/1.28
diff --git a/w32/recipes/cairo.recipe b/w32/recipes/cairo.recipe
new file mode 100644
index 0000000..8654d5c
--- /dev/null
+++ b/w32/recipes/cairo.recipe
@@ -0,0 +1,8 @@
+name=cairo
+version=1.8.8
+release=1
+download=http://www.cairographics.org/releases
+
+case "$host" in
+ *mingw*) configure_opt=--without-x ;;
+esac
diff --git a/w32/recipes/gd.recipe b/w32/recipes/gd.recipe
new file mode 100644
index 0000000..c9588a3
--- /dev/null
+++ b/w32/recipes/gd.recipe
@@ -0,0 +1,29 @@
+name=gd
+version=2.0.35
+release=1
+download=http://www.libgd.org/releases
+
+configure_opt="
+ --disable-static
+ --enable-shared
+ --without-x
+"
+
+src_prep()
+{
+ autoreconf -ivf
+}
+
+# Compatibility with existing binary package
+src_install()
+{
+ do_install
+
+ case "$host" in
+ *mingw*) ln -f $resultdir/lib/libgd.dll.a $resultdir/lib/bgd.lib ;;
+ esac
+
+ mkdir -p $local_tooldir
+ cp $tooldir/tool.template $local_tooldir/gdlib-config
+}
+
diff --git a/w32/recipes/gettext.recipe b/w32/recipes/gettext.recipe
new file mode 100644
index 0000000..49b35f7
--- /dev/null
+++ b/w32/recipes/gettext.recipe
@@ -0,0 +1,8 @@
+name=gettext
+version=0.17
+release=1
+origin=gnu
+configure_opt=--enable-relocatable
+
+# Solve an incompatibility with newer MinGW runtimes
+export ac_cv_func_getopt_long_only=no
diff --git a/w32/recipes/glib.recipe b/w32/recipes/glib.recipe
new file mode 100644
index 0000000..a73ae9e
--- /dev/null
+++ b/w32/recipes/glib.recipe
@@ -0,0 +1,8 @@
+name=glib
+version=2.22.2
+release=1
+download=http://ftp.gnome.org/pub/gnome/sources/glib/2.22
+
+configure_opt="
+ CXX=${host:+$host-g++}
+"
diff --git a/w32/recipes/gtk+.recipe b/w32/recipes/gtk+.recipe
new file mode 100644
index 0000000..254aca1
--- /dev/null
+++ b/w32/recipes/gtk+.recipe
@@ -0,0 +1,14 @@
+name=gtk+
+version=2.16.6
+release=1
+download=http://ftp.gnome.org/pub/gnome/sources/gtk+/2.16
+
+configure_opt="
+ --without-libjasper
+ --disable-cups
+ --disable-gdiplus
+ --with-included-loaders
+ --with-included-immodules
+ --disable-rebuilds
+ CXX=${host:+$host-g++}
+"
diff --git a/w32/recipes/jpeg.recipe b/w32/recipes/jpeg.recipe
new file mode 100644
index 0000000..b305399
--- /dev/null
+++ b/w32/recipes/jpeg.recipe
@@ -0,0 +1,5 @@
+name=jpeg
+version=7
+release=1
+download=http://www.ijg.org/files
+source=jpegsrc.v7.tar.gz
diff --git a/w32/recipes/libiconv.recipe b/w32/recipes/libiconv.recipe
new file mode 100644
index 0000000..747de81
--- /dev/null
+++ b/w32/recipes/libiconv.recipe
@@ -0,0 +1,4 @@
+name=libiconv
+version=1.13.1
+release=1
+origin=gnu
diff --git a/w32/recipes/libpng.recipe b/w32/recipes/libpng.recipe
new file mode 100644
index 0000000..a621866
--- /dev/null
+++ b/w32/recipes/libpng.recipe
@@ -0,0 +1,13 @@
+name=libpng
+version=1.2.40
+release=1
+origin=sf
+make_opts="SYMBOL_PREFIX="
+
+src_install()
+{
+ do_install
+ mkdir -p $local_tooldir
+ cp $tooldir/tool.template $local_tooldir/libpng-config
+ cp $tooldir/tool.template $local_tooldir/libpng12-config
+}
diff --git a/w32/recipes/pango.recipe b/w32/recipes/pango.recipe
new file mode 100644
index 0000000..5cd9212
--- /dev/null
+++ b/w32/recipes/pango.recipe
@@ -0,0 +1,9 @@
+name=pango
+version=1.26.0
+release=1
+download=http://ftp.gnome.org/pub/gnome/sources/pango/1.26
+
+configure_opt="
+ --with-included-modules
+ CXX=${host:+$host-g++}
+"
diff --git a/w32/recipes/pcb.recipe b/w32/recipes/pcb.recipe
new file mode 100644
index 0000000..629883e
--- /dev/null
+++ b/w32/recipes/pcb.recipe
@@ -0,0 +1,18 @@
+name=pcb
+
+pkg_builddir=$(cd $bindir/.. && pwd)
+
+configure_opt="--disable-update-desktop-database --disable-update-mime-database --disable-dbus"
+
+# configure-time test fails because of stdcall signature
+export ac_cv_func_gdImageGif=yes
+export ac_cv_func_gdImageJpeg=yes
+export ac_cv_func_gdImagePng=yes
+
+src_configure()
+{
+ if [ ! -f configure ]; then
+ ./autogen.sh || return 1
+ fi
+ do_configure
+}
diff --git a/w32/recipes/pixman.recipe b/w32/recipes/pixman.recipe
new file mode 100644
index 0000000..73fa26c
--- /dev/null
+++ b/w32/recipes/pixman.recipe
@@ -0,0 +1,4 @@
+name=pixman
+version=0.16.2
+release=1
+download=http://www.cairographics.org/releases
diff --git a/w32/recipes/tiff.recipe b/w32/recipes/tiff.recipe
new file mode 100644
index 0000000..db2baaa
--- /dev/null
+++ b/w32/recipes/tiff.recipe
@@ -0,0 +1,4 @@
+name=tiff
+version=3.9.1
+release=1
+download=ftp://ftp.remotesensing.org/pub/libtiff
diff --git a/w32/recipes/zlib.recipe b/w32/recipes/zlib.recipe
new file mode 100644
index 0000000..c143197
--- /dev/null
+++ b/w32/recipes/zlib.recipe
@@ -0,0 +1,6 @@
+name=zlib
+version=1.2.3
+release=1
+pkg_download=http://prdownloads.sourceforge.net/libpng/zlib-1.2.3.tar.gz?download
+unset build
+configure_no_more_flags=true
diff --git a/w32/tools/mpk-build b/w32/tools/mpk-build
new file mode 100644
index 0000000..d90f658
--- /dev/null
+++ b/w32/tools/mpk-build
@@ -0,0 +1,123 @@
+# mpk-build - Build packages.
+# Copyright (C) 2008,2010 Cesar Strauss
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+build_source()
+{
+ : ${top_srcdir:=$name-$version}
+
+ : ${pkg_builddir:=$builddir/$name-$version-$release/$top_srcdir}
+
+ if [ ! -d $pkg_builddir ]; then
+ $mpk unpack $pkg
+ if [ $? != 0 -o ! -d $pkg_builddir ]; then
+ echo >&2 "$(basename $0) build: Could not unpack $pkg"
+ exit 1
+ fi
+ fi
+
+ cd $pkg_builddir
+
+ src_build && success
+}
+
+src_build()
+{
+ do_build
+}
+
+src_configure()
+{
+ do_configure
+}
+
+src_compile()
+{
+ do_compile
+}
+
+src_install()
+{
+ do_install
+}
+
+do_build()
+{
+ src_configure || fail
+ src_compile || fail
+ src_install || fail
+}
+
+do_configure()
+{
+ setup_configure_options
+
+ echo "Configuring $pkg..."
+ mkdir -p ../logs
+ echo "$pkg_configure_opt" | xargs ./configure > ../logs/configure.log
+}
+
+do_compile()
+{
+ echo "Compiling $pkg..."
+ mkdir -p ../logs
+ make $default_make_opts $make_opts > ../logs/make.log
+}
+
+do_install()
+{
+ echo "Installing $pkg..."
+ mkdir -p ../logs
+ make install > ../logs/install.log
+}
+
+fail()
+{
+ echo
+ echo "================="
+ echo "$pkg:"
+ echo " Build failed."
+ echo "================="
+ echo
+ exit 1
+}
+
+success()
+{
+ echo
+ echo "===================="
+ echo "$pkg:"
+ echo " Build succeeded."
+ echo "===================="
+ echo
+}
+
+if [ -z "$1" ]; then
+ echo "Usage: $(basename $0) build package-name"
+ exit 1
+fi
+pkg=$1
+
+if [ -z "$pkg" ]; then
+ echo "Usage: $(basename $0) build package-name ..."
+ exit 1
+fi
+
+recipe=$(get_recipe_name $pkg) || exit 1
+
+. $recipe
+
+build_source
+
diff --git a/w32/tools/mpk-clean b/w32/tools/mpk-clean
new file mode 100644
index 0000000..08cc285
--- /dev/null
+++ b/w32/tools/mpk-clean
@@ -0,0 +1,38 @@
+# mpk-clean - Clean build directory.
+# Copyright (C) 2009,2010 Cesar Strauss
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+clean()
+{
+ buildroot=$builddir/$name-$version-$release
+ rm -rf "$buildroot"
+}
+
+if [ -z "$1" ]; then
+ echo "Usage: $(basename $0) clean package-name"
+ exit 1
+fi
+pkg=$1
+
+if [ -z "$pkg" ]; then
+ echo "Usage: $(basename $0) clean package-name ..."
+ exit 1
+fi
+
+recipe=$(get_recipe_name $pkg) || exit 1
+
+. $recipe
+
+clean
diff --git a/w32/tools/mpk-config.guess b/w32/tools/mpk-config.guess
new file mode 100755
index 0000000..278f9e9
--- /dev/null
+++ b/w32/tools/mpk-config.guess
@@ -0,0 +1,1516 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+# Inc.
+
+timestamp='2007-07-22'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <pe...@bo...>.
+# Please send patches to <con...@gn...>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <con...@gn...>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (gh...@no... 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # ak...@wp... (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denot...
[truncated message content] |
|
From: <gi...@gp...> - 2011-08-10 23:21:16
|
The branch, master has been updated
via e2c8f6f4878b68e4e0c1d4e15ffac00db12d968a (commit)
via aa7196dc29a761ecddda1a40d68fedf39ab78c31 (commit)
from eaf012c425a5adc9a31d857d3aa9e906d844c97f (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 | 16 ++++++++++++++++
src/action.c | 11 ++++++++---
src/hid/lesstif/main.c | 6 ++++++
src/hid/lesstif/xincludes.h | 4 ++++
4 files changed, 34 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit e2c8f6f4878b68e4e0c1d4e15ffac00db12d968a
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Detect XRender + Xinerama to avoid BadMatch
Closes-bug: lp-699251
This seems to happen when your X server is using both Xinerama and
XRender, and only affects the XRenderChangePicture() call with a
clip_mask. So, I added code to detect Xinerama+XRender and disable
XRender if they're found.
:100644 100644 fd14c98... 1c4ee58... M configure.ac
:100644 100644 be9a330... 9335490... M src/hid/lesstif/main.c
:100644 100644 7245a77... af1314c... M src/hid/lesstif/xincludes.h
commit aa7196dc29a761ecddda1a40d68fedf39ab78c31
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Don't set FOUND flag on silk lines.
Closes-bug: lp-699291
:100644 100644 cb2a7bf... 52157a0... M src/action.c
=========
Changes
=========
commit e2c8f6f4878b68e4e0c1d4e15ffac00db12d968a
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Detect XRender + Xinerama to avoid BadMatch
Closes-bug: lp-699251
This seems to happen when your X server is using both Xinerama and
XRender, and only affects the XRenderChangePicture() call with a
clip_mask. So, I added code to detect Xinerama+XRender and disable
XRender if they're found.
diff --git a/configure.ac b/configure.ac
index fd14c98..1c4ee58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1000,6 +1000,22 @@ case "$have_xrender:$enable_xrender" in
;;
esac
+# ------------- Xinerama -------------------
+have_xinerama=no
+AC_CHECK_LIB(Xinerama,XineramaQueryExtension,have_xinerama=yes,have_xinerama=no,$X_LIBS)
+
+AC_ARG_ENABLE([xinerama],
+[ --disable-xinerama Compile and link with Xinerama [default=yes]])
+case "$have_xinerama:$enable_xinerama" in
+ no:* ) ;;
+ *:no ) ;;
+ * )
+ X_LIBS="-lXinerama $X_LIBS"
+ AC_DEFINE([HAVE_XINERAMA], 1,
+ [Define to 1 if Xinerama is available])
+ ;;
+esac
+
# ------------- dmalloc -------------------
dnl dmalloc checks
with_dmalloc=no
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index be9a330..9335490 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -2158,6 +2158,12 @@ lesstif_parse_arguments (int *argc, char ***argv)
#ifdef HAVE_XRENDER
use_xrender = XRenderQueryExtension (display, &render_event, &render_error) &&
XRenderFindVisualFormat (display, DefaultVisual(display, screen));
+#ifdef HAVE_XINERAMA
+ /* Xinerama and XRender don't get along well */
+ if (XineramaQueryExtension (display, &render_event, &render_error)
+ && XineramaIsActive (display))
+ use_xrender = 0;
+#endif /* HAVE_XINERAMA */
#endif /* HAVE_XRENDER */
rcount = 0;
diff --git a/src/hid/lesstif/xincludes.h b/src/hid/lesstif/xincludes.h
index 7245a77..af1314c 100644
--- a/src/hid/lesstif/xincludes.h
+++ b/src/hid/lesstif/xincludes.h
@@ -41,5 +41,9 @@
#include <X11/extensions/Xrender.h>
#endif /* HAVE_XRENDER */
+#ifdef HAVE_XINERAMA
+#include <X11/extensions/Xinerama.h>
+#endif /* HAVE_XINERAMA */
+
#undef Mask
commit aa7196dc29a761ecddda1a40d68fedf39ab78c31
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Don't set FOUND flag on silk lines.
Closes-bug: lp-699291
diff --git a/src/action.c b/src/action.c
index cb2a7bf..52157a0 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1237,6 +1237,7 @@ NotifyMode (void)
/* create line if both ends are determined && length != 0 */
{
LineTypePtr line;
+ int maybe_found_flag;
if (PCB->Clipping
&& Crosshair.AttachedLine.Point1.X ==
@@ -1253,6 +1254,12 @@ NotifyMode (void)
Crosshair.AttachedLine.Point2.Y = Note.Y;
}
+ if (TEST_FLAG (AUTODRCFLAG, PCB)
+ && ! TEST_SILK_LAYER (CURRENT))
+ maybe_found_flag = FOUNDFLAG;
+ else
+ maybe_found_flag = 0;
+
if ((Crosshair.AttachedLine.Point1.X !=
Crosshair.AttachedLine.Point2.X
|| Crosshair.AttachedLine.Point1.Y !=
@@ -1265,9 +1272,7 @@ NotifyMode (void)
Crosshair.AttachedLine.Point2.Y,
Settings.LineThickness,
2 * Settings.Keepaway,
- MakeFlags ((TEST_FLAG
- (AUTODRCFLAG,
- PCB) ? FOUNDFLAG : 0) |
+ MakeFlags (maybe_found_flag |
(TEST_FLAG
(CLEARNEWFLAG,
PCB) ? CLEARLINEFLAG :
|
|
From: <gi...@gp...> - 2011-08-10 23:17:05
|
The branch, master has been updated
via f6c2d4907583614a10918a121f45670620f1946e (commit)
from e2c8f6f4878b68e4e0c1d4e15ffac00db12d968a (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.h | 5 +++--
src/autoplace.h | 4 ++--
src/autoroute.h | 4 ++--
src/box.h | 4 ++--
src/buffer.h | 4 ++--
src/change.h | 4 ++--
src/clip.h | 4 ++--
src/command.h | 4 ++--
src/compat.h | 6 +++---
src/const.h | 4 ++--
src/copy.h | 4 ++--
src/create.h | 4 ++--
src/crosshair.h | 4 ++--
src/data.h | 4 ++--
src/dbus-pcbmain.h | 6 +++---
src/dbus.h | 6 +++---
src/djopt.h | 4 ++--
src/draw.h | 4 ++--
src/edif_parse.h | 6 +++---
src/error.h | 4 ++--
src/file.h | 4 ++--
src/find.h | 4 ++--
src/global.h | 14 +++++++-------
src/heap.h | 6 +++---
src/hid.h | 4 ++--
src/hid/common/actions.h | 4 ++--
src/hid/common/hid_resource.h | 4 ++--
src/hid/common/hidgl.h | 6 +++---
src/hid/common/hidinit.h | 4 ++--
src/hid/common/hidnogui.h | 4 ++--
src/hid/gcode/lists.h | 6 +++---
src/hid/gtk/gtkhid.h | 6 +++---
src/hid/gtk/gui-drc-window.h | 6 +++---
src/hid/gtk/gui-library-window.h | 6 +++---
src/hid/gtk/gui-pinout-preview.h | 6 +++---
src/hid/gtk/gui.h | 6 +++---
src/insert.h | 4 ++--
src/intersect.h | 4 ++--
src/line.h | 4 ++--
src/lrealpath.h | 6 +++---
src/macro.h | 4 ++--
src/mirror.h | 4 ++--
src/misc.h | 6 +++---
src/move.h | 4 ++--
src/mtspace.h | 8 +++++---
src/mymem.h | 4 ++--
src/parse_l.h | 4 ++--
src/pcb-printf.h | 4 ++--
src/polyarea.h | 6 +++---
src/polygon.h | 5 +++--
src/print.h | 4 ++--
src/rats.h | 5 +++--
src/remove.h | 4 ++--
src/report.h | 4 ++--
src/resource.h | 4 ++--
src/rotate.h | 4 ++--
src/rtree.h | 5 +++--
src/rubberband.h | 4 ++--
src/search.h | 4 ++--
src/select.h | 4 ++--
src/set.h | 4 ++--
src/strflags.h | 4 ++--
src/thermal.h | 4 ++--
src/toporouter.h | 6 +++---
src/undo.h | 4 ++--
src/vector.h | 6 +++---
src/vendor.h | 4 ++--
67 files changed, 163 insertions(+), 157 deletions(-)
=================
Commit Messages
=================
commit f6c2d4907583614a10918a121f45670620f1946e
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix header guard macro names
Closes-bug: lp-699161
Make all headers use standard-compliant guard macro names.
:100644 100644 e92c578... 83089f3... M src/action.h
:100644 100644 ffb15df... 5133cf0... M src/autoplace.h
:100644 100644 59f75ad... d659349... M src/autoroute.h
:100644 100644 bedb6ab... 3dc779e... M src/box.h
:100644 100644 98da959... 7182a9d... M src/buffer.h
:100644 100644 7bae706... 94a0e21... M src/change.h
:100644 100644 fcc5f2e... c06d64f... M src/clip.h
:100644 100644 2bc057c... 5517993... M src/command.h
:100644 100644 7f0b080... 9afa02c... M src/compat.h
:100644 100644 724b3be... 1575b09... M src/const.h
:100644 100644 ac50e2c... bd2ea80... M src/copy.h
:100644 100644 521f60e... 754a450... M src/create.h
:100644 100644 6e9656e... 15b3470... M src/crosshair.h
:100644 100644 bf8e421... 502acdd... M src/data.h
:100644 100644 2caa006... 118f4e3... M src/dbus-pcbmain.h
:100644 100644 3d4177e... 1babb17... M src/dbus.h
:100644 100644 03de80a... 76ee3b6... M src/djopt.h
:100644 100644 adfee36... bda02f8... M src/draw.h
:100644 100644 a39e57b... 7def326... M src/edif_parse.h
:100644 100644 8363d48... 8409767... M src/error.h
:100644 100644 a2f7859... 6cf7a99... M src/file.h
:100644 100644 892c7ef... 9560bd9... M src/find.h
:100644 100644 94f4fae... 3210d5f... M src/global.h
:100644 100644 6ee973d... 381c7b2... M src/heap.h
:100644 100644 eeb09ab... b2725ac... M src/hid.h
:100644 100644 1cc6f24... f5743f2... M src/hid/common/actions.h
:100644 100644 ab382fc... d011b31... M src/hid/common/hid_resource.h
:100644 100644 37d35b9... 3af338d... M src/hid/common/hidgl.h
:100644 100644 bd1174f... 1744189... M src/hid/common/hidinit.h
:100644 100644 244c8c2... 518ff06... M src/hid/common/hidnogui.h
:100644 100644 2a2353f... 3513184... M src/hid/gcode/lists.h
:100644 100644 b3e7ca1... f55845b... M src/hid/gtk/gtkhid.h
:100644 100644 f48a944... 9bd26cf... M src/hid/gtk/gui-drc-window.h
:100644 100644 4be1cf4... 5ff6a7b... M src/hid/gtk/gui-library-window.h
:100644 100644 0e12c54... 978bb25... M src/hid/gtk/gui-pinout-preview.h
:100644 100644 c52fb65... c4da30f... M src/hid/gtk/gui.h
:100644 100644 350a0de... 51c75e4... M src/insert.h
:100644 100644 de626e8... 2c1e7f5... M src/intersect.h
:100644 100644 1a651fb... a59f1bb... M src/line.h
:100644 100644 a4f7081... dba14ac... M src/lrealpath.h
:100644 100644 695d3b6... 025351f... M src/macro.h
:100644 100644 589391b... 94d17c1... M src/mirror.h
:100644 100644 7926460... f904e19... M src/misc.h
:100644 100644 0547686... 2b41bce... M src/move.h
:100644 100644 4bbbbbf... b2872cd... M src/mtspace.h
:100644 100644 6b572d8... cbfd47e... M src/mymem.h
:100644 100644 f0b20ff... eb01528... M src/parse_l.h
:100644 100644 bcf319e... 31346f4... M src/pcb-printf.h
:100644 100644 ce427ad... 413f519... M src/polyarea.h
:100644 100644 315e69b... e3b31c0... M src/polygon.h
:100644 100644 cf8689f... 2215aea... M src/print.h
:100644 100644 3d70f27... 9479fe0... M src/rats.h
:100644 100644 9fd4625... 1fc8890... M src/remove.h
:100644 100644 7abbb79... 6d0184e... M src/report.h
:100644 100644 5a11601... 614aace... M src/resource.h
:100644 100644 f032fcb... c9c78b8... M src/rotate.h
:100644 100644 862bbe9... cb23307... M src/rtree.h
:100644 100644 3698786... 9e671bf... M src/rubberband.h
:100644 100644 add5661... b6ddaa2... M src/search.h
:100644 100644 0e12cc2... f3edde6... M src/select.h
:100644 100644 f8f6a9a... 4985f9d... M src/set.h
:100644 100644 241ba1b... da16b64... M src/strflags.h
:100644 100644 a2958d1... 67c04e0... M src/thermal.h
:100644 100644 0e98115... fcd0053... M src/toporouter.h
:100644 100644 0a4601f... 9b088ff... M src/undo.h
:100644 100644 3eabef5... 344118d... M src/vector.h
:100644 100644 3b4d2d4... aba4148... M src/vendor.h
=========
Changes
=========
commit f6c2d4907583614a10918a121f45670620f1946e
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix header guard macro names
Closes-bug: lp-699161
Make all headers use standard-compliant guard macro names.
diff --git a/src/action.h b/src/action.h
index e92c578..83089f3 100644
--- a/src/action.h
+++ b/src/action.h
@@ -28,8 +28,8 @@
/* prototypes for action routines
*/
-#ifndef __ACTION_INCLUDED__
-#define __ACTION_INCLUDED__
+#ifndef PCB_ACTION_H
+#define PCH_ACTION_H
#include "global.h"
@@ -45,4 +45,5 @@ void warpNoWhere (void);
/* In gui-misc.c */
bool ActionGetLocation (char *);
void ActionGetXY (char *);
+
#endif
diff --git a/src/autoplace.h b/src/autoplace.h
index ffb15df..5133cf0 100644
--- a/src/autoplace.h
+++ b/src/autoplace.h
@@ -35,8 +35,8 @@
/* prototypes for autoplace routines
*/
-#ifndef __AUTOPLACE_INCLUDED__
-#define __AUTOPLACE_INCLUDED__
+#ifndef PCB_AUTOPLACE_H
+#define PCB_AUTOPLACE_H
#include "global.h"
diff --git a/src/autoroute.h b/src/autoroute.h
index 59f75ad..d659349 100644
--- a/src/autoroute.h
+++ b/src/autoroute.h
@@ -34,8 +34,8 @@
/* prototypes for autoroute routines
*/
-#ifndef __AUTOROUTE_INCLUDED__
-#define __AUTOROUTE_INCLUDED__
+#ifndef PCB_AUTOROUTE_H
+#define PCB_AUTOROUTE_H
#include "global.h"
diff --git a/src/box.h b/src/box.h
index bedb6ab..3dc779e 100644
--- a/src/box.h
+++ b/src/box.h
@@ -34,8 +34,8 @@
/* random box-related utilities.
*/
-#ifndef __BOX_H_INCLUDED__
-#define __BOX_H_INCLUDED__
+#ifndef PCB_BOX_H
+#define PCB_BOX_H
#include <assert.h>
#include "global.h"
diff --git a/src/buffer.h b/src/buffer.h
index 98da959..7182a9d 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -28,8 +28,8 @@
/* prototypes for buffer handling routines
*/
-#ifndef __BUFFER_INCLUDED__
-#define __BUFFER_INCLUDED__
+#ifndef PCB_BUFFER_H
+#define PCB_BUFFER_H
#include "global.h"
diff --git a/src/change.h b/src/change.h
index 7bae706..94a0e21 100644
--- a/src/change.h
+++ b/src/change.h
@@ -28,8 +28,8 @@
/* prototypes to change object properties
*/
-#ifndef __CHANGE_INCLUDED__
-#define __CHANGE_INCLUDED__
+#ifndef PCB_CHANGE_H
+#define PCB_CHANGE_H
#include "global.h"
diff --git a/src/clip.h b/src/clip.h
index fcc5f2e..c06d64f 100644
--- a/src/clip.h
+++ b/src/clip.h
@@ -29,8 +29,8 @@
/* prototypes for inserting points into objects
*/
-#ifndef __CLIP_INCLUDED__
-#define __CLIP_INCLUDED__
+#ifndef PCB_CLIP_H
+#define PCB_CLIP_H
#include "global.h"
diff --git a/src/command.h b/src/command.h
index 2bc057c..5517993 100644
--- a/src/command.h
+++ b/src/command.h
@@ -28,8 +28,8 @@
/* prototypes for command execution
*/
-#ifndef __COMMAND_INCLUDED__
-#define __COMMAND_INCLUDED__
+#ifndef PCB_COMMAND_H
+#define PCB_COMMAND_H
#include "global.h"
diff --git a/src/compat.h b/src/compat.h
index 7f0b080..9afa02c 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef __COMPAT_H__
-#define __COMPAT_H__
+#ifndef PCB_COMPAT_H
+#define PCH_COMPAT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -57,5 +57,5 @@ void * dlsym(void *, const char *);
#endif
-#endif /* __COMPAT_H__ */
+#endif /* PCB_COMPAT_H */
diff --git a/src/const.h b/src/const.h
index 724b3be..1575b09 100644
--- a/src/const.h
+++ b/src/const.h
@@ -28,8 +28,8 @@
/* global source constants
*/
-#ifndef __CONST_INCLUDED__
-#define __CONST_INCLUDED__
+#ifndef PCB_CONST_H
+#define PCB_CONST_H
#include <limits.h>
#include <math.h>
diff --git a/src/copy.h b/src/copy.h
index ac50e2c..bd2ea80 100644
--- a/src/copy.h
+++ b/src/copy.h
@@ -28,8 +28,8 @@
/* prototypes for copy routines
*/
-#ifndef __COPY_INCLUDED__
-#define __COPY_INCLUDED__
+#ifndef PCB_COPY_H
+#define PCB_COPY_H
#include "global.h"
diff --git a/src/create.h b/src/create.h
index 521f60e..754a450 100644
--- a/src/create.h
+++ b/src/create.h
@@ -28,8 +28,8 @@
/* prototypes for create routines
*/
-#ifndef __CREATE_INCLUDED__
-#define __CREATE_INCLUDED__
+#ifndef PCB_CREATE_H
+#define PCB_CREATE_H
#include "global.h"
diff --git a/src/crosshair.h b/src/crosshair.h
index 6e9656e..15b3470 100644
--- a/src/crosshair.h
+++ b/src/crosshair.h
@@ -28,8 +28,8 @@
/* prototypes for crosshair routines
*/
-#ifndef __CROSSHAIR_INCLUDED__
-#define __CROSSHAIR_INCLUDED__
+#ifndef PCB_CROSSHAIR_H
+#define PCB_CROSSHAIR_H
#include "global.h"
diff --git a/src/data.h b/src/data.h
index bf8e421..502acdd 100644
--- a/src/data.h
+++ b/src/data.h
@@ -28,8 +28,8 @@
/* common identifiers
*/
-#ifndef __DATA_INCLUDED__
-#define __DATA_INCLUDED__
+#ifndef PCB_DATA_H
+#define PCB_DATA_H
#include "global.h"
diff --git a/src/dbus-pcbmain.h b/src/dbus-pcbmain.h
index 2caa006..118f4e3 100644
--- a/src/dbus-pcbmain.h
+++ b/src/dbus-pcbmain.h
@@ -17,8 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _DBUS_PCBMAIN_H_
-#define _DBUS_PCBMAIN_H_
+#ifndef PCB_DBUS_PCBMAIN_H
+#define PCB_DBUS_PCBMAIN_H
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus.h>
@@ -26,4 +26,4 @@
void pcb_dbus_connection_setup_with_mainloop (DBusConnection * connection);
void pcb_dbus_connection_finish_with_mainloop (DBusConnection * connection);
-#endif /* !_DBUS_PCBMAIN_H */
+#endif /* !PCB_DBUS_PCBMAIN_H */
diff --git a/src/dbus.h b/src/dbus.h
index 3d4177e..1babb17 100644
--- a/src/dbus.h
+++ b/src/dbus.h
@@ -17,8 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _DBUS_H_
-#define _DBUS_H_
+#ifndef PCB_DBUS_H
+#define PCB_DBUS_H
/* Carry out all actions to setup the D-Bus and register appropriate callbacks */
void pcb_dbus_setup ();
@@ -27,4 +27,4 @@ void pcb_dbus_setup ();
void pcb_dbus_finish ();
-#endif /* !_DBUS_H */
+#endif /* !PCB_DBUS_H */
diff --git a/src/djopt.h b/src/djopt.h
index 03de80a..76ee3b6 100644
--- a/src/djopt.h
+++ b/src/djopt.h
@@ -26,8 +26,8 @@
*
*/
-#ifndef __DJOPT_INCLUDED__
-#define __DJOPT_INCLUDED__
+#ifndef PCB_DJOPT_H
+#define PCB_DJOPT_H
#include "global.h"
diff --git a/src/draw.h b/src/draw.h
index adfee36..bda02f8 100644
--- a/src/draw.h
+++ b/src/draw.h
@@ -28,8 +28,8 @@
/* prototypes for drawing routines
*/
-#ifndef __DRAW_INCLUDED__
-#define __DRAW_INCLUDED__
+#ifndef PCB_DRAW_H
+#define PCB_DRAW_H
#include "global.h"
diff --git a/src/edif_parse.h b/src/edif_parse.h
index a39e57b..7def326 100644
--- a/src/edif_parse.h
+++ b/src/edif_parse.h
@@ -20,11 +20,11 @@
*/
-#ifndef __EDIF_PARSE_H__
-#define __EDIF_PARSE_H__
+#ifndef PCB_EDIF_PARSE_H
+#define PCB_EDIF_PARSE_H
void ParseEDIF(char* filename,FILE* err);
-#endif /* __EDIF_PARSE_H__ */
+#endif /* PCB_EDIF_PARSE_H */
diff --git a/src/error.h b/src/error.h
index 8363d48..8409767 100644
--- a/src/error.h
+++ b/src/error.h
@@ -28,8 +28,8 @@
/* prototypes for error and debug functions
*/
-#ifndef __ERROR_INCLUDED__
-#define __ERROR_INCLUDED__
+#ifndef PCB_ERROR_H
+#define PCB_ERROR_H
#define STATUS_OK 0
diff --git a/src/file.h b/src/file.h
index a2f7859..6cf7a99 100644
--- a/src/file.h
+++ b/src/file.h
@@ -27,8 +27,8 @@
/* prototypes for file routines
*/
-#ifndef __FILE_INCLUDED__
-#define __FILE_INCLUDED__
+#ifndef PCB_FILE_H
+#define PCB_FILE_H
#include <stdio.h> /* needed to define 'FILE *' */
#include "global.h"
diff --git a/src/find.h b/src/find.h
index 892c7ef..9560bd9 100644
--- a/src/find.h
+++ b/src/find.h
@@ -28,8 +28,8 @@
/* prototypes connection search routines
*/
-#ifndef __FIND_INCLUDED__
-#define __FIND_INCLUDED__
+#ifndef PCB_FIND_H
+#define PCB_FIND_H
#include <stdio.h> /* needed to define 'FILE *' */
#include "global.h"
diff --git a/src/global.h b/src/global.h
index 94f4fae..3210d5f 100644
--- a/src/global.h
+++ b/src/global.h
@@ -35,8 +35,8 @@
* silkscreen layer. Perhaps the design is not the best.
*/
-#ifndef __GLOBAL_INCLUDED__
-#define __GLOBAL_INCLUDED__
+#ifndef PCB_GLOBAL_H
+#define PCB_GLOBAL_H
#include "const.h"
#include "macro.h"
@@ -135,11 +135,11 @@ typedef struct
* the compiler about the expected result of an expression. Some compilers
* can use this information for optimizations.
*
- * The _BOOLEAN_EXPR macro is intended to trigger a gcc warning when
+ * The PCB_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
* putting assignments inside the test.
*/
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
-#define _BOOLEAN_EXPR(expr) \
+#define PCB_BOOLEAN_EXPR(expr) \
__extension__ ({ \
int _boolean_var_; \
if (expr) \
@@ -148,8 +148,8 @@ typedef struct
_boolean_var_ = 0; \
_boolean_var_; \
})
-#define LIKELY(expr) (__builtin_expect (_BOOLEAN_EXPR(expr), 1))
-#define UNLIKELY(expr) (__builtin_expect (_BOOLEAN_EXPR(expr), 0))
+#define LIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 1))
+#define UNLIKELY(expr) (__builtin_expect (PCB_BOOLEAN_EXPR(expr), 0))
#else
#define LIKELY(expr) (expr)
#define UNLIKELY(expr) (expr)
@@ -840,4 +840,4 @@ extern char *pcbtreepath; /* The search path for newlib fps */
extern char *exec_prefix;
extern char *homedir;
-#endif /* __GLOBAL_INCLUDED__ */
+#endif /* PCB_GLOBAL_H */
diff --git a/src/heap.h b/src/heap.h
index 6ee973d..381c7b2 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -34,8 +34,8 @@
/* prototypes for heap routines.
*/
-#ifndef __HEAP_INCLUDED__
-#define __HEAP_INCLUDED__
+#ifndef PCB_HEAP_H
+#define PCB_HEAP_H
#include "global.h"
@@ -62,4 +62,4 @@ void *heap_replace (heap_t * heap, cost_t cost, void *data);
int heap_is_empty (heap_t * heap);
int heap_size (heap_t * heap);
-#endif /* __HEAP_INCLUDED__ */
+#endif /* PCB_HEAP_H */
diff --git a/src/hid.h b/src/hid.h
index eeb09ab..b2725ac 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -1,5 +1,5 @@
-#ifndef _HID_H_
-#define _HID_H_
+#ifndef PCB_HID_H
+#define PCB_HID_H
#include <stdarg.h>
diff --git a/src/hid/common/actions.h b/src/hid/common/actions.h
index 1cc6f24..f5743f2 100644
--- a/src/hid/common/actions.h
+++ b/src/hid/common/actions.h
@@ -1,6 +1,6 @@
-#ifndef __HID_ACTIONS_INCLUDED__
-#define __HID_ACTIONS_INCLUDED__
+#ifndef PCB_HID_COMMON_ACTIONS_H
+#define PCB_HID_COMMON_ACTIONS_H
void print_actions (void);
diff --git a/src/hid/common/hid_resource.h b/src/hid/common/hid_resource.h
index ab382fc..d011b31 100644
--- a/src/hid/common/hid_resource.h
+++ b/src/hid/common/hid_resource.h
@@ -1,6 +1,6 @@
-#ifndef __HID_RESOURCE_INCLUDED__
-#define __HID_RESOURCE_INCLUDED__
+#ifndef PCB_HID_COMMON_HID_RESOURCE_H
+#define PCH_HID_COMMON_HID_RESOURCE_H
#include "resource.h"
diff --git a/src/hid/common/hidgl.h b/src/hid/common/hidgl.h
index 37d35b9..3af338d 100644
--- a/src/hid/common/hidgl.h
+++ b/src/hid/common/hidgl.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef __HIDGL_INCLUDED__
-#define __HIDGL_INCLUDED__
+#ifndef PCB_HID_COMMON_HIDGL_H
+#define PCB_HID_COMMON_HIDGL_H
#define TRIANGLE_ARRAY_SIZE 5461
typedef struct {
@@ -82,4 +82,4 @@ int hidgl_assign_clear_stencil_bit (void);
void hidgl_return_stencil_bit (int bit);
void hidgl_reset_stencil_usage (void);
-#endif /* __HIDGL_INCLUDED__ */
+#endif /* PCB_HID_COMMON_HIDGL_H */
diff --git a/src/hid/common/hidinit.h b/src/hid/common/hidinit.h
index bd1174f..1744189 100644
--- a/src/hid/common/hidinit.h
+++ b/src/hid/common/hidinit.h
@@ -1,5 +1,5 @@
-#ifndef __HID_INIT_INCLUDED__
-#define __HID_INIT_INCLUDED__
+#ifndef PCB_HID_COMMON_HIDINIT_H
+#define PCB_HID_COMMON_HIDINIT_H
void hid_parse_command_line (int *argc, char ***argv);
diff --git a/src/hid/common/hidnogui.h b/src/hid/common/hidnogui.h
index 244c8c2..518ff06 100644
--- a/src/hid/common/hidnogui.h
+++ b/src/hid/common/hidnogui.h
@@ -1,5 +1,5 @@
-#ifndef __HID_NOGUI_INCLUDED__
-#define __HID_NOGUI_INCLUDED__
+#ifndef PCB_HID_COMMON_HIDNOGUI_H
+#define PCB_HID_COMMON_HIDNOGUI_H
void common_nogui_init (HID *hid);
HID *hid_nogui_get_hid (void);
diff --git a/src/hid/gcode/lists.h b/src/hid/gcode/lists.h
index 2a2353f..3513184 100644
--- a/src/hid/gcode/lists.h
+++ b/src/hid/gcode/lists.h
@@ -4,8 +4,8 @@
/* $Id: lists.h 147 2007-04-09 00:44:09Z selinger $ */
-#ifndef _PS_LISTS_H
-#define _PS_LISTS_H
+#ifndef PCB_HID_GCODE_LISTS_H
+#define PCB_HID_GCODE_LISTS_H
/* here we define some general list macros. Because they are macros,
they should work on any datatype with a "->next" component. Some of
@@ -282,4 +282,4 @@
} \
MACRO_END
-#endif /* _PS_LISTS_H */
+#endif /* PCB_HID_GCODE_LISTS_H */
diff --git a/src/hid/gtk/gtkhid.h b/src/hid/gtk/gtkhid.h
index b3e7ca1..f55845b 100644
--- a/src/hid/gtk/gtkhid.h
+++ b/src/hid/gtk/gtkhid.h
@@ -1,8 +1,8 @@
/* $Id$ */
-#ifndef __GTKHID_H__
-#define __GTKHID_H__
+#ifndef PCB_HID_GTK_GTKHID_H
+#define PCB_HID_GTK_GTKHID_H
void ghid_notify_gui_is_up(void);
-#endif /* __GTKHID_H__ */
+#endif /* PCB_HID_GTK_GTKHID_H */
diff --git a/src/hid/gtk/gui-drc-window.h b/src/hid/gtk/gui-drc-window.h
index f48a944..9bd26cf 100644
--- a/src/hid/gtk/gui-drc-window.h
+++ b/src/hid/gtk/gui-drc-window.h
@@ -26,8 +26,8 @@
*
*/
-#ifndef __GUI_DRC_WINDOW_H__
-#define __GUI_DRC_WINDOW_H__
+#ifndef PCB_HID_GTK_GUI_DRC_WINDOW_H
+#define PCB_HID_GTK_GUI_DRC_WINDOW_H
#define GHID_TYPE_DRC_VIOLATION (ghid_drc_violation_get_type())
@@ -99,4 +99,4 @@ GType ghid_violation_renderer_get_type (void);
GtkCellRenderer *ghid_violation_renderer_new (void);
-#endif /* __GUI_DRC_WINDOW_H__ */
+#endif /* PCB_HID_GTK_GUI_DRC_WINDOW_H */
diff --git a/src/hid/gtk/gui-library-window.h b/src/hid/gtk/gui-library-window.h
index 4be1cf4..5ff6a7b 100644
--- a/src/hid/gtk/gui-library-window.h
+++ b/src/hid/gtk/gui-library-window.h
@@ -18,8 +18,8 @@
*/
-#ifndef __GUI_LIBRARY_WINDOW_H__
-#define __GUI_LIBRARY_WINDOW_H__
+#ifndef PCB_HID_GTK_GUI_LIBRARY_WINDOW_H
+#define PCB_HID_GTK_GUI_LIBRARY_WINDOW_H
/*
@@ -57,4 +57,4 @@ struct _GhidLibraryWindow
GType ghid_library_window_get_type (void);
-#endif /* __GUI_LIBRARY_WINDOW_H__ */
+#endif /* PCB_HID_GTK_GUI_LIBRARY_WINDOW_H */
diff --git a/src/hid/gtk/gui-pinout-preview.h b/src/hid/gtk/gui-pinout-preview.h
index 0e12c54..978bb25 100644
--- a/src/hid/gtk/gui-pinout-preview.h
+++ b/src/hid/gtk/gui-pinout-preview.h
@@ -28,8 +28,8 @@
/* This file written by Peter Clifton */
-#ifndef __GHID_PINOUT_PREVIEW_H__
-#define __GHID_PINOUT_PREVIEW_H__
+#ifndef PCB_HID_GTK_GUI_PINOUT_PREVIEW_H
+#define PCB_HID_GTK_GUI_PINOUT_PREVIEW_H
#define GHID_TYPE_PINOUT_PREVIEW (ghid_pinout_preview_get_type())
@@ -65,4 +65,4 @@ GtkWidget *ghid_pinout_preview_new (ElementType * element);
void ghid_pinout_preview_get_natural_size (GhidPinoutPreview * pinout,
int *width, int *height);
-#endif /* __GHID_PINOUT_PREVIEW_H__ */
+#endif /* PCB_HID_GTK_GUI_PINOUT_PREVIEW_H */
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index c52fb65..c4da30f 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -24,8 +24,8 @@
/* FIXME - rename this file to ghid.h */
-#ifndef __GHID_INCLUDED__
-#define __GHID_INCLUDED__
+#ifndef PCB_HID_GTK_GHID_H
+#define PCB_HID_GTK_GHID_H
#include "global.h"
#include "hid.h"
@@ -576,4 +576,4 @@ Pz (int z)
return (z * gport->zoom);
}
-#endif /* __GHID_INCLUDED__ */
+#endif /* PCB_HID_GTK_GHID_H */
diff --git a/src/insert.h b/src/insert.h
index 350a0de..51c75e4 100644
--- a/src/insert.h
+++ b/src/insert.h
@@ -28,8 +28,8 @@
/* prototypes for inserting points into objects
*/
-#ifndef __INSERT_INCLUDED__
-#define __INSERT_INCLUDED__
+#ifndef PCB_INSERT_H
+#define PCB_INSERT_H
#include "global.h"
diff --git a/src/intersect.h b/src/intersect.h
index de626e8..2c1e7f5 100644
--- a/src/intersect.h
+++ b/src/intersect.h
@@ -34,8 +34,8 @@
/* prototypes for rectangle intersection/union routines.
*/
-#ifndef __INTERSECT_INCLUDED__
-#define __INTERSECT_INCLUDED__
+#ifndef PCB_INTERSECT_H
+#define PCB_INTERSECT_H
#include "global.h"
diff --git a/src/line.h b/src/line.h
index 1a651fb..a59f1bb 100644
--- a/src/line.h
+++ b/src/line.h
@@ -29,8 +29,8 @@
/* prototypes for inserting points into objects
*/
-#ifndef __LINE_INCLUDED__
-#define __LINE_INCLUDED__
+#ifndef PCB_LINE_H
+#define PCB_LINE_H
#include "global.h"
diff --git a/src/lrealpath.h b/src/lrealpath.h
index a4f7081..dba14ac 100644
--- a/src/lrealpath.h
+++ b/src/lrealpath.h
@@ -1,9 +1,9 @@
-#ifndef __LREALPATH_H__
-#define __LREALPATH_H__
+#ifndef PCB_LREALPATH_H
+#define PCH_LREALPATH_H
/* A well-defined realpath () that is always compiled in. */
char *lrealpath (const char *);
-#endif /* __LREALPATH_H__ */
+#endif /* PCB_LREALPATH_H */
diff --git a/src/macro.h b/src/macro.h
index 695d3b6..025351f 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -29,8 +29,8 @@
* the file is included by global.h after const.h
*/
-#ifndef __MACRO_INCLUDED__
-#define __MACRO_INCLUDED__
+#ifndef PCB_MACRO_H
+#define PCB_MACRO_H
/* ---------------------------------------------------------------------------
* macros to transform coord systems
diff --git a/src/mirror.h b/src/mirror.h
index 589391b..94d17c1 100644
--- a/src/mirror.h
+++ b/src/mirror.h
@@ -28,8 +28,8 @@
/* prototypes to change objects mirror flag
*/
-#ifndef __MIRROR_INCLUDED__
-#define __MIRROR_INCLUDED__
+#ifndef PCB_MIRROR_H
+#define PCB_MIRROR_H
#include "global.h"
diff --git a/src/misc.h b/src/misc.h
index 7926460..f904e19 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -28,8 +28,8 @@
/* prototypes for misc routines
*/
-#ifndef __MISC_INCLUDED__
-#define __MISC_INCLUDED__
+#ifndef PCB_MISC_H
+#define PCB_MISC_H
#include <stdlib.h>
#include "global.h"
@@ -167,5 +167,5 @@ void NetlistChanged (int force_unfreeze);
#endif
-#endif /* __MISC_INCLUDED__ */
+#endif /* PCB_MISC_H */
diff --git a/src/move.h b/src/move.h
index 0547686..2b41bce 100644
--- a/src/move.h
+++ b/src/move.h
@@ -28,8 +28,8 @@
/* prototypes for move routines
*/
-#ifndef __MOVE_INCLUDED__
-#define __MOVE_INCLUDED__
+#ifndef PCB_MOVE_H
+#define PCB_MOVE_H
#include "global.h"
diff --git a/src/mtspace.h b/src/mtspace.h
index 4bbbbbf..b2872cd 100644
--- a/src/mtspace.h
+++ b/src/mtspace.h
@@ -35,8 +35,9 @@
* in the auto-router.
*/
-#ifndef __MTSPACE_INCLUDED__
-#define __MTSPACE_INCLUDED__
+#ifndef PCB_MTSPACE_H
+#define PCB_MTSPACE_H
+
/* mtspace data structures are built on r-trees. */
#include "global.h"
@@ -81,4 +82,5 @@ vetting_t *mtspace_query_rect (mtspace_t * mtspace, const BoxType * region,
void mtsFreeWork (vetting_t **);
int mtsBoxCount (vetting_t *);
-#endif /* ! __MTSPACE_INCLUDED__ */
+
+#endif /* ! PCB_MTSPACE_H */
diff --git a/src/mymem.h b/src/mymem.h
index 6b572d8..cbfd47e 100644
--- a/src/mymem.h
+++ b/src/mymem.h
@@ -28,8 +28,8 @@
/* prototypes for memory routines
*/
-#ifndef __MYMEM_INCLUDED__
-#define __MYMEM_INCLUDED__
+#ifndef PCB_MYMEM_H
+#define PCB_MYMEM_H
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/src/parse_l.h b/src/parse_l.h
index f0b20ff..eb01528 100644
--- a/src/parse_l.h
+++ b/src/parse_l.h
@@ -28,8 +28,8 @@
/* just defines common parser identifiers
*/
-#ifndef __LEX_INCLUDED__
-#define __LEX_INCLUDED__
+#ifndef PCB_LEX_H
+#define PCB_LEX_H
#include "global.h"
diff --git a/src/pcb-printf.h b/src/pcb-printf.h
index bcf319e..31346f4 100644
--- a/src/pcb-printf.h
+++ b/src/pcb-printf.h
@@ -63,8 +63,8 @@
* No support for %zu size_t printf spec
*/
-#ifndef __PCB_PRINTF_INCLUDED__
-#define __PCB_PRINTF_INCLUDED__
+#ifndef PCB_PCB_PRINTF_H
+#define PCB_PCB_PRINTF_H
enum e_allow {
ALLOW_NM = 1,
diff --git a/src/polyarea.h b/src/polyarea.h
index ce427ad..413f519 100644
--- a/src/polyarea.h
+++ b/src/polyarea.h
@@ -22,8 +22,8 @@
(C) 1997 Klamer Schutte (minor patches)
*/
-#ifndef _POLYBOOL_H
-#define _POLYBOOL_H
+#ifndef PCB_POLYAREA_H
+#define PCB_POLYAREA_H
#ifdef __cplusplus
extern "C" {
@@ -188,4 +188,4 @@ int SavePOLYAREA( POLYAREA *PA, char * fname);
}
#endif
-#endif /* POLY_H */
+#endif /* PCB_POLYAREA_H */
diff --git a/src/polygon.h b/src/polygon.h
index 315e69b..e3b31c0 100644
--- a/src/polygon.h
+++ b/src/polygon.h
@@ -28,8 +28,8 @@
/* prototypes for polygon editing routines
*/
-#ifndef __POLYGON_INCLUDED__
-#define __POLYGON_INCLUDED__
+#ifndef PCB_POLYGON_H
+#define PCH_POLYGON_H
#include "global.h"
@@ -89,4 +89,5 @@ bool MorphPolygon (LayerTypePtr, PolygonTypePtr);
void NoHolesPolygonDicer (PolygonType *p, const BoxType *clip,
void (*emit) (PLINE *, void *), void *user_data);
void PolyToPolygonsOnLayer (DataType *, LayerType *, POLYAREA *, FlagType);
+
#endif
diff --git a/src/print.h b/src/print.h
index cf8689f..2215aea 100644
--- a/src/print.h
+++ b/src/print.h
@@ -28,8 +28,8 @@
/* prototypes for printing routines
*/
-#ifndef __PRINT_INCLUDED__
-#define __PRINT_INCLUDED__
+#ifndef PCB_PRINT_H
+#define PCB_PRINT_H
#include <stdio.h>
diff --git a/src/rats.h b/src/rats.h
index 3d70f27..9479fe0 100644
--- a/src/rats.h
+++ b/src/rats.h
@@ -30,8 +30,8 @@
/* prototypes for rats routines
*/
-#ifndef __RATS_INCLUDED__
-#define __RATS_INCLUDED__
+#ifndef PCB_RATS_H
+#define PCB_RATS_H
#include "global.h"
@@ -47,4 +47,5 @@ bool SeekPad (LibraryEntryTypePtr, ConnectionTypePtr, bool);
NetListTypePtr ProcNetlist (LibraryTypePtr);
NetListListType CollectSubnets (bool);
+
#endif
diff --git a/src/remove.h b/src/remove.h
index 9fd4625..1fc8890 100644
--- a/src/remove.h
+++ b/src/remove.h
@@ -28,8 +28,8 @@
/* prototypes for remove routines
*/
-#ifndef __REMOVE_INCLUDED__
-#define __REMOVE_INCLUDED__
+#ifndef PCB_REMOVE_H
+#define PCB_REMOVE_H
#include "global.h"
diff --git a/src/report.h b/src/report.h
index 7abbb79..6d0184e 100644
--- a/src/report.h
+++ b/src/report.h
@@ -25,8 +25,8 @@
* RCS: $Id$
*/
-#ifndef __REPORT_INCLUDED__
-#define __REPORT_INCLUDED__
+#ifndef PCB_REPORT_H
+#define PCB_REPORT_H
#include "global.h"
diff --git a/src/resource.h b/src/resource.h
index 5a11601..614aace 100644
--- a/src/resource.h
+++ b/src/resource.h
@@ -1,7 +1,7 @@
/* $Id$ */
-#ifndef __RESOURCE_INCLUDED__
-#define __RESOURCE_INCLUDED__ 1
+#ifndef PCB_RESOURCE_H
+#define PCB_RESOURCE_H
#include <stdio.h>
diff --git a/src/rotate.h b/src/rotate.h
index f032fcb..c9c78b8 100644
--- a/src/rotate.h
+++ b/src/rotate.h
@@ -28,8 +28,8 @@
/* prototypes for transform routines
*/
-#ifndef __ROTATE_INCLUDED__
-#define __ROTATE_INCLUDED__
+#ifndef PCB_ROTATE_H
+#define PCB_ROTATE_H
#include "global.h"
diff --git a/src/rtree.h b/src/rtree.h
index 862bbe9..cb23307 100644
--- a/src/rtree.h
+++ b/src/rtree.h
@@ -34,8 +34,8 @@
/* prototypes for r-tree routines.
*/
-#ifndef __RTREE_INCLUDED__
-#define __RTREE_INCLUDED__
+#ifndef PCB_RTREE_H
+#define PCB_RTREE_H
#include "global.h"
@@ -89,4 +89,5 @@ static inline int r_search_pt (rtree_t * rtree, const PointType * pt,
int r_region_is_empty (rtree_t * rtree, const BoxType * region);
void __r_dump_tree (struct rtree_node *, int);
+
#endif
diff --git a/src/rubberband.h b/src/rubberband.h
index 3698786..9e671bf 100644
--- a/src/rubberband.h
+++ b/src/rubberband.h
@@ -28,8 +28,8 @@
/* prototypes for rubberband routines
*/
-#ifndef __RUBBERBAND_INCLUDED__
-#define __RUBBERBAND_INCLUDED__
+#ifndef PCB_RUBBERBAND_H
+#define PCB_RUBBERBAND_H
#include "global.h"
diff --git a/src/search.h b/src/search.h
index add5661..b6ddaa2 100644
--- a/src/search.h
+++ b/src/search.h
@@ -28,8 +28,8 @@
/* prototypes for search routines
*/
-#ifndef __SEARCH_INCLUDED__
-#define __SEARCH_INCLUDED__
+#ifndef PCB_SEARCH_H
+#define PCB_SEARCH_H
#include "global.h"
diff --git a/src/select.h b/src/select.h
index 0e12cc2..f3edde6 100644
--- a/src/select.h
+++ b/src/select.h
@@ -28,8 +28,8 @@
/* prototypes for select routines
*/
-#ifndef __SELECT_INCLUDED__
-#define __SELECT_INCLUDED__
+#ifndef PCB_SELECT_H
+#define PCB_SELECT_H
#include "global.h"
diff --git a/src/set.h b/src/set.h
index f8f6a9a..4985f9d 100644
--- a/src/set.h
+++ b/src/set.h
@@ -28,8 +28,8 @@
/* prototypes for update routines
*/
-#ifndef __UPDATE_INCLUDED__
-#define __UPDATE_INCLUDED__
+#ifndef PCB_SET_H
+#define PCB_SET_H
#include "global.h"
diff --git a/src/strflags.h b/src/strflags.h
index 241ba1b..da16b64 100644
--- a/src/strflags.h
+++ b/src/strflags.h
@@ -25,8 +25,8 @@
*
*/
-#ifndef _FLAGS_H_
-#define _FLAGS_H_
+#ifndef PCB_STRFLAGS_H
+#define PCB_STRFLAGS_H
/* The purpose of this interface is to make the file format able to
handle more than 32 flags, and to hide the internal details of
diff --git a/src/thermal.h b/src/thermal.h
index a2958d1..67c04e0 100644
--- a/src/thermal.h
+++ b/src/thermal.h
@@ -34,8 +34,8 @@
* operations, and the functions in thermal.h help implement that.
*/
-#ifndef __THERMAL_INCLUDED__
-#define __THERMAL_INCLUDED__
+#ifndef PCB_THERMAL_H
+#define PCH_THERMAL_H
#include <stdlib.h>
#include "global.h"
diff --git a/src/toporouter.h b/src/toporouter.h
index 0e98115..fcd0053 100644
--- a/src/toporouter.h
+++ b/src/toporouter.h
@@ -24,8 +24,8 @@
*
*/
-#ifndef __TOPOROUTER_INCLUDED__
-#define __TOPOROUTER_INCLUDED__
+#ifndef PCB_TOPOROUTER_H
+#define PCH_TOPOROUTER_H
#include <assert.h>
#include "data.h"
@@ -483,4 +483,4 @@ typedef struct {
#define FOREACH_END }} while(0)
-#endif /* __TOPOROUTER_INCLUDED__ */
+#endif /* PCB_TOPOROUTER_H */
diff --git a/src/undo.h b/src/undo.h
index 0a4601f..9b088ff 100644
--- a/src/undo.h
+++ b/src/undo.h
@@ -28,8 +28,8 @@
/* prototypes for undo routines
*/
-#ifndef __UNDO_INCLUDED__
-#define __UNDO_INCLUDED__
+#ifndef PCB_UNDO_H
+#define PCB_UNDO_H
#include "global.h"
diff --git a/src/vector.h b/src/vector.h
index 3eabef5..344118d 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -34,8 +34,8 @@
/* prototypes for vector routines.
*/
-#ifndef __VECTOR_INCLUDED__
-#define __VECTOR_INCLUDED__
+#ifndef PCB_VECTOR_H
+#define PCB_VECTOR_H
/* what a vector looks like */
typedef struct vector_struct vector_t;
@@ -78,4 +78,4 @@ vector_element_t vector_remove (vector_t * vector, int N);
vector_element_t vector_replace (vector_t * vector,
vector_element_t data, int N);
-#endif /* __VECTOR_INCLUDED__ */
+#endif /* PCB_VECTOR_H */
diff --git a/src/vendor.h b/src/vendor.h
index 3b4d2d4..aba4148 100644
--- a/src/vendor.h
+++ b/src/vendor.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef __VENDOR_H__
-#define __VENDOR_H__
+#ifndef PCB_VENDOR_H
+#define PCB_VENDOR_H
int vendorDrillMap (int);
bool vendorIsElementMappable (ElementTypePtr);
|
|
From: <gi...@gp...> - 2011-08-08 22:22:30
|
The branch, master has been updated
via eaf012c425a5adc9a31d857d3aa9e906d844c97f (commit)
from 43060601683a1f87396981db9444fdc29b020f01 (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 | 33 ++++++++++-----------------------
1 files changed, 10 insertions(+), 23 deletions(-)
=================
Commit Messages
=================
commit eaf012c425a5adc9a31d857d3aa9e906d844c97f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Clean up ghid_pan_fixup ()
:100644 100644 ed28ca1... a4cd443... M src/hid/gtk/gtkhid-main.c
=========
Changes
=========
commit eaf012c425a5adc9a31d857d3aa9e906d844c97f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Clean up ghid_pan_fixup ()
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index ed28ca1..a4cd443 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -40,29 +40,16 @@ void
ghid_pan_fixup ()
{
- /*
- * don't pan so far to the right that we see way past the right
- * edge of the board.
- */
- if (gport->view_x0 > PCB->MaxWidth - gport->view_width)
- gport->view_x0 = PCB->MaxWidth - gport->view_width;
-
- /*
- * don't pan so far down that we see way past the bottom edge of
- * the board.
- */
- if (gport->view_y0 > PCB->MaxHeight - gport->view_height)
- gport->view_y0 = PCB->MaxHeight - gport->view_height;
-
- /* don't view above or to the left of the board... ever */
- if (gport->view_x0 < 0)
- gport->view_x0 = 0;
+ /* Don't pan so far to the right or bottom that we see past the board edge */
+ gport->view_x0 = MIN (gport->view_x0, PCB->MaxWidth - gport->view_width);
+ gport->view_y0 = MIN (gport->view_y0, PCB->MaxHeight - gport->view_height);
- if (gport->view_y0 < 0)
- gport->view_y0 = 0;
+ /* Don't view above or to the left of the board... ever */
+ gport->view_x0 = MAX (0, gport->view_x0);
+ gport->view_y0 = MAX (0, gport->view_y0);
- /* if we can see the entire board and some, then zoom to fit */
- if (gport->view_width > PCB->MaxWidth &&
+ /* If we can see the entire board and some, then zoom to fit */
+ if (gport->view_width > PCB->MaxWidth &&
gport->view_height > PCB->MaxHeight)
{
zoom_fit ();
|
|
From: <gi...@gp...> - 2011-08-08 22:12:32
|
The branch, master has been updated
via 43060601683a1f87396981db9444fdc29b020f01 (commit)
via 58a94b5d9a8c76415bf16b6498d408de72a3871c (commit)
from 8821800c59ee77797ecadbc89ea90f2dd521a437 (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 | 10 +++
src/hid/gtk/gtkhid-gl.c | 10 +++
src/hid/gtk/gtkhid-main.c | 166 ++++++++++++++++++---------------------------
src/hid/gtk/gui.h | 1 +
4 files changed, 87 insertions(+), 100 deletions(-)
=================
Commit Messages
=================
commit 43060601683a1f87396981db9444fdc29b020f01
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Re-write some routines with the new ghid_pcb_to_event_coords API.
Cleans up ghid_set_crosshair() and Center() in gtkhid-main.c
:100644 100644 83df23f... ed28ca1... M src/hid/gtk/gtkhid-main.c
commit 58a94b5d9a8c76415bf16b6498d408de72a3871c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Add API to convert pcb units into drawing widget coordinates.
:100644 100644 5118612... e9b5b3e... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 a910946... 5c554fa... M src/hid/gtk/gtkhid-gl.c
:100644 100644 d17cca2... c52fb65... M src/hid/gtk/gui.h
=========
Changes
=========
commit 43060601683a1f87396981db9444fdc29b020f01
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Re-write some routines with the new ghid_pcb_to_event_coords API.
Cleans up ghid_set_crosshair() and Center() in gtkhid-main.c
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 83df23f..ed28ca1 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -286,95 +286,75 @@ ghid_mod1_is_pressed ()
void
ghid_set_crosshair (int x, int y, int action)
{
+ GdkDisplay *display;
+ GdkScreen *screen;
+ int offset_x, offset_y;
+ int widget_x, widget_y;
+ int pointer_x, pointer_y;
+ Coord pcb_x, pcb_y;
+
if (gport->crosshair_x != x || gport->crosshair_y != y)
{
ghid_set_cursor_position_labels ();
gport->crosshair_x = x;
gport->crosshair_y = y;
- /*
- * FIXME - does this trigger the idle_proc stuff? It is in the
+ /* FIXME - does this trigger the idle_proc stuff? It is in the
* lesstif HID. Maybe something is needed here?
*
* need_idle_proc ();
*/
-
}
- /*
- * Pan the viewport so that the crosshair (which is in a fixed
- * location relative to the board) lands where the pointer
- * is. What happens is the crosshair is moved on the board
- * (see above) and then we move the board here to line it up
- * again. We do this by figuring out where the pointer is
- * in board coordinates and we know where the crosshair is
- * in board coordinates. Then we know how far to pan.
+ if (action != HID_SC_PAN_VIEWPORT &&
+ action != HID_SC_WARP_POINTER)
+ return;
+
+ /* Find out where the drawing area is on the screen. gdk_display_get_pointer
+ * and gdk_display_warp_pointer work relative to the whole display, whilst
+ * our coordinates are relative to the drawing area origin.
*/
- if (action == HID_SC_PAN_VIEWPORT)
- {
- GdkDisplay *display;
- gint pos_x, pos_y, xofs, yofs;
-
- display = gdk_display_get_default ();
-
- /* figure out where the pointer is relative to the display */
- gdk_display_get_pointer (display, NULL, &pos_x, &pos_y, NULL);
-
- /*
- * Figure out where the drawing area is on the screen so we can
- * figure out where the pointer is relative to the viewport.
- */
- gdk_window_get_origin (gport->drawing_area->window, &xofs, &yofs);
-
- pos_x -= xofs;
- pos_y -= yofs;
+ gdk_window_get_origin (gport->drawing_area->window, &offset_x, &offset_y);
+ display = gdk_display_get_default ();
- /*
- * pointer is at
- * px = gport->view_x0 + pos_x * gport->zoom
- * py = gport->view_y0 + pos_y * gport->zoom
- *
- * cross hair is at
- * x
- * y
- *
- * we need to shift x0 by (x - px) and y0 by (y - py)
- * x0 = x0 + x - (x0 + pos_x * zoom)
- * = x - pos_x*zoom
+ switch (action) {
+ case HID_SC_PAN_VIEWPORT:
+ /* Pan the board in the viewport so that the crosshair (who's location
+ * relative on the board was set above) lands where the pointer is.
+ * We pass the request to pan a particular point on the board to a
+ * given widget coordinate of the viewport into the rendering code
*/
- if (ghid_flip_x)
- gport->view_x0 = x - (gport->view_width - pos_x * gport->zoom);
- else
- gport->view_x0 = x - pos_x * gport->zoom;
+ /* Find out where the pointer is relative to the display */
+ gdk_display_get_pointer (display, NULL, &pointer_x, &pointer_y, NULL);
- if (ghid_flip_y)
- gport->view_y0 = y - (gport->view_height - pos_y * gport->zoom);
- else
- gport->view_y0 = y - pos_y * gport->zoom;
+ widget_x = pointer_x - offset_x;
+ widget_y = pointer_y - offset_y;
- ghid_pan_fixup();
+ ghid_event_to_pcb_coords (widget_x, widget_y, &pcb_x, &pcb_y);
- action = HID_SC_WARP_POINTER;
- }
+ gport->view_x0 = MAX (0, SIDE_X (pcb_x) - widget_x * gport->zoom);
+ gport->view_y0 = MAX (0, SIDE_Y (pcb_y) - widget_y * gport->zoom);
- if (action == HID_SC_WARP_POINTER)
- {
- gint xofs, yofs;
- GdkDisplay *display;
- GdkScreen *screen;
+ ghid_pan_fixup ();
+
+ /* Just in case we couldn't pan the board the whole way,
+ * we warp the pointer to where the crosshair DID land.
+ */
+ /* Fall through */
- display = gdk_display_get_default ();
+ case HID_SC_WARP_POINTER:
screen = gdk_display_get_default_screen (display);
- /*
- * Figure out where the drawing area is on the screen because
- * gdk_display_warp_pointer will warp relative to the whole display
- * but the value we've been given is relative to your drawing area
- */
- gdk_window_get_origin (gport->drawing_area->window, &xofs, &yofs);
- gdk_display_warp_pointer (display, screen, xofs + Vx (x), yofs + Vy (y));
- }
+ ghid_pcb_to_event_coords (x, y, &widget_x, &widget_y);
+
+ pointer_x = offset_x + widget_x;
+ pointer_y = offset_y + widget_y;
+
+ gdk_display_warp_pointer (display, screen, pointer_x, pointer_y);
+
+ break;
+ }
}
typedef struct
@@ -1619,55 +1599,41 @@ currently within the window already.
%end-doc */
static int
-Center(int argc, char **argv, int x, int y)
+Center(int argc, char **argv, int pcb_x, int pcb_y)
{
- int x0, y0, w2, h2;
GdkDisplay *display;
GdkScreen *screen;
- int xofs, yofs;
+ int offset_x, offset_y;
+ int widget_x, widget_y;
+ int pointer_x, pointer_y;
if (argc != 0)
AFAIL (center);
- x = GRIDFIT_X (SIDE_X (x), PCB->Grid);
- y = GRIDFIT_Y (SIDE_Y (y), PCB->Grid);
+ /* Aim to put the given x, y PCB coordinates in the center of the widget */
+ widget_x = gport->width / 2;
+ widget_y = gport->height / 2;
- w2 = gport->view_width / 2;
- h2 = gport->view_height / 2;
- x0 = x - w2;
- y0 = y - h2;
-
- if (x0 < 0)
- {
- x0 = 0;
- x = x0 + w2;
- }
+ gport->view_x0 = MAX (0, SIDE_X (pcb_x) - widget_x * gport->zoom);
+ gport->view_y0 = MAX (0, SIDE_Y (pcb_y) - widget_y * gport->zoom);
- if (y0 < 0)
- {
- y0 = 0;
- y = y0 + h2;
- }
+ ghid_pan_fixup ();
- gport->view_x0 = x0;
- gport->view_y0 = y0;
+ /* Now move the mouse pointer to the place where the board location
+ * actually ended up.
+ *
+ * XXX: Should only do this if we confirm we are inside our window?
+ */
- ghid_pan_fixup ();
+ ghid_pcb_to_event_coords (pcb_x, pcb_y, &widget_x, &widget_y);
+ gdk_window_get_origin (gport->drawing_area->window, &offset_x, &offset_y);
- /* Move the pointer to the center of the window, but only if it's
- currently within the window already. Watch out for edges,
- though. */
+ pointer_x = offset_x + widget_x;
+ pointer_y = offset_y + widget_y;
display = gdk_display_get_default ();
screen = gdk_display_get_default_screen (display);
-
- /*
- * Figure out where the drawing area is on the screen because
- * gdk_display_warp_pointer will warp relative to the whole display
- * but the value we've been given is relative to your drawing area
- */
- gdk_window_get_origin (gport->drawing_area->window, &xofs, &yofs);
- gdk_display_warp_pointer (display, screen, xofs + Vx (x), yofs + Vy (y));
+ gdk_display_warp_pointer (display, screen, pointer_x, pointer_y);
return 0;
}
commit 58a94b5d9a8c76415bf16b6498d408de72a3871c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Add API to convert pcb units into drawing widget coordinates.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 5118612..e9b5b3e 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -1340,6 +1340,16 @@ ghid_event_to_pcb_coords (int event_x, int event_y, Coord *pcb_x, Coord *pcb_y)
return true;
}
+bool
+ghid_pcb_to_event_coords (Coord pcb_x, Coord pcb_y, int *event_x, int *event_y)
+{
+ *event_x = DRAW_X (pcb_x);
+ *event_y = DRAW_Y (pcb_y);
+
+ return true;
+}
+
+
#define LEAD_USER_WIDTH 0.2 /* millimeters */
#define LEAD_USER_PERIOD (1000 / 5) /* 5fps (in ms) */
#define LEAD_USER_VELOCITY 3. /* millimeters per second */
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index a910946..5c554fa 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -1306,6 +1306,16 @@ ghid_event_to_pcb_coords (int event_x, int event_y, Coord *pcb_x, Coord *pcb_y)
return true;
}
+bool
+ghid_pcb_to_event_coords (Coord pcb_x, Coord pcb_y, int *event_x, int *event_y)
+{
+ *event_x = DRAW_X (pcb_x);
+ *event_y = DRAW_Y (pcb_y);
+
+ return true;
+}
+
+
#define LEAD_USER_WIDTH 0.2 /* millimeters */
#define LEAD_USER_PERIOD (1000 / 20) /* 20fps (in ms) */
#define LEAD_USER_VELOCITY 3. /* millimeters per second */
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index d17cca2..c52fb65 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -504,6 +504,7 @@ HID *ghid_request_debug_draw (void);
void ghid_flush_debug_draw (void);
void ghid_finish_debug_draw (void);
bool ghid_event_to_pcb_coords (int event_x, int event_y, Coord *pcb_x, Coord *pcb_y);
+bool ghid_pcb_to_event_coords (Coord pcb_x, Coord pcb_y, int *event_x, int *event_y);
void ghid_lead_user_to_location (Coord x, Coord y);
void ghid_cancel_lead_user (void);
|
|
From: <gi...@gp...> - 2011-08-07 22:56:17
|
The branch, master has been updated
via 8821800c59ee77797ecadbc89ea90f2dd521a437 (commit)
from 30ebc68a90ce9b33a9bbe91b9bc1d52fed011eeb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/misc.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit 8821800c59ee77797ecadbc89ea90f2dd521a437
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
misc.c: Remove comment missed from commit e82ad9b
:100644 100644 befeeed... 3dc87c6... M src/misc.c
=========
Changes
=========
commit 8821800c59ee77797ecadbc89ea90f2dd521a437
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
misc.c: Remove comment missed from commit e82ad9b
diff --git a/src/misc.c b/src/misc.c
index befeeed..3dc87c6 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -764,9 +764,6 @@ GetDataBoundingBox (DataTypePtr Data)
/* ---------------------------------------------------------------------------
* centers the displayed PCB around the specified point (X,Y)
- * if Delta is false, X,Y are in absolute PCB coordinates
- * if Delta is true, simply move the center by an amount X, Y in screen
- * coordinates
*/
void
CenterDisplay (LocationType X, LocationType Y)
|
|
From: <gi...@gp...> - 2011-08-07 22:51:19
|
The branch, master has been updated
via 30ebc68a90ce9b33a9bbe91b9bc1d52fed011eeb (commit)
via dd33a61c8e919f0e4a33afa4491ca03fd7adfed5 (commit)
from 42b463193c8d4f5e000713920e5d9b207ac37031 (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 | 129 ++++++++++++++++++++++++++++++++++++++
src/hid/gtk/gtkhid-gl.c | 117 ++++++++++++++++++++++++++++++++++
src/hid/gtk/gui-netlist-window.c | 63 ++++++++++---------
src/hid/gtk/gui.h | 3 +
src/macro.h | 3 -
5 files changed, 282 insertions(+), 33 deletions(-)
=================
Commit Messages
=================
commit 30ebc68a90ce9b33a9bbe91b9bc1d52fed011eeb
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
macro.h: Remove now unused SCREEN_SIGN_{X,Y} macros
:100644 100644 7fa0927... 695d3b6... M src/macro.h
commit dd33a61c8e919f0e4a33afa4491ca03fd7adfed5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Implement an API to draw the user into a particular location
This is renderer-specific, but the general idea is to help the user find
a particular location on the board.
:100644 100644 25d38fd... 5118612... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 2d7fec0... a910946... M src/hid/gtk/gtkhid-gl.c
:100644 100644 ea7cef5... bc3fc69... M src/hid/gtk/gui-netlist-window.c
:100644 100644 b0bbe0a... d17cca2... M src/hid/gtk/gui.h
=========
Changes
=========
commit 30ebc68a90ce9b33a9bbe91b9bc1d52fed011eeb
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
macro.h: Remove now unused SCREEN_SIGN_{X,Y} macros
diff --git a/src/macro.h b/src/macro.h
index 7fa0927..695d3b6 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -47,9 +47,6 @@
#define SWAP_X(x) (SWAP_SIGN_X(x))
#define SWAP_Y(y) (PCB->MaxHeight +SWAP_SIGN_Y(y))
-#define TO_SCREEN_SIGN_X(x) (SWAP_IDENT ? SWAP_SIGN_X(x) : (x))
-#define TO_SCREEN_SIGN_Y(y) (SWAP_IDENT ? SWAP_SIGN_Y(y) : (y))
-
/* ---------------------------------------------------------------------------
* misc macros, some might already be defined by <limits.h>
*/
commit dd33a61c8e919f0e4a33afa4491ca03fd7adfed5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Implement an API to draw the user into a particular location
This is renderer-specific, but the general idea is to help the user find
a particular location on the board.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 25d38fd..5118612 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -39,6 +39,15 @@ typedef struct render_priv {
GdkRectangle clip_rect;
int attached_invalidate_depth;
int mark_invalidate_depth;
+
+ /* Feature for leading the user to a particular location */
+ guint lead_user_timeout;
+ GTimer *lead_user_timer;
+ bool lead_user;
+ Coord lead_user_radius;
+ Coord lead_user_x;
+ Coord lead_user_y;
+
} render_priv;
@@ -56,6 +65,9 @@ typedef struct hid_gc_struct
hid_gc_struct;
+static void draw_lead_user (render_priv *priv);
+
+
int
ghid_set_layer (const char *name, int group, int empty)
{
@@ -783,6 +795,8 @@ redraw_region (GdkRectangle *rect)
if (priv->mark_invalidate_depth == 0)
DrawMark ();
+ draw_lead_user (priv);
+
priv->clip = false;
/* Rest the clip for bg_gc, as it is used outside this function */
@@ -1075,6 +1089,7 @@ ghid_init_renderer (int *argc, char ***argv, GHidPort *port)
void
ghid_shutdown_renderer (GHidPort *port)
{
+ ghid_cancel_lead_user ();
g_free (port->render_priv);
port->render_priv = NULL;
}
@@ -1324,3 +1339,117 @@ ghid_event_to_pcb_coords (int event_x, int event_y, Coord *pcb_x, Coord *pcb_y)
return true;
}
+
+#define LEAD_USER_WIDTH 0.2 /* millimeters */
+#define LEAD_USER_PERIOD (1000 / 5) /* 5fps (in ms) */
+#define LEAD_USER_VELOCITY 3. /* millimeters per second */
+#define LEAD_USER_ARC_COUNT 3
+#define LEAD_USER_ARC_SEPARATION 3. /* millimeters */
+#define LEAD_USER_INITIAL_RADIUS 10. /* millimetres */
+#define LEAD_USER_COLOR_R 1.
+#define LEAD_USER_COLOR_G 1.
+#define LEAD_USER_COLOR_B 0.
+
+static void
+draw_lead_user (render_priv *priv)
+{
+ int i;
+ Coord radius = priv->lead_user_radius;
+ Coord width = MM_TO_COORD (LEAD_USER_WIDTH);
+ Coord separation = MM_TO_COORD (LEAD_USER_ARC_SEPARATION);
+ static GdkGC *lead_gc = NULL;
+ GdkColor lead_color;
+
+ if (!priv->lead_user)
+ return;
+
+ if (lead_gc == NULL)
+ {
+ lead_gc = gdk_gc_new (ghid_port.drawing_area->window);
+ gdk_gc_copy (lead_gc, ghid_port.drawing_area->style->white_gc);
+ gdk_gc_set_function (lead_gc, GDK_XOR);
+ gdk_gc_set_clip_origin (lead_gc, 0, 0);
+ lead_color.pixel = 0;
+ lead_color.red = (int)(65535. * LEAD_USER_COLOR_R);
+ lead_color.green = (int)(65535. * LEAD_USER_COLOR_G);
+ lead_color.blue = (int)(65535. * LEAD_USER_COLOR_B);
+ gdk_color_alloc (gport->colormap, &lead_color);
+ gdk_gc_set_foreground (lead_gc, &lead_color);
+ }
+
+ set_clip (priv, lead_gc);
+ gdk_gc_set_line_attributes (lead_gc, Vz (width),
+ GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
+
+ /* arcs at the approrpriate radii */
+
+ for (i = 0; i < LEAD_USER_ARC_COUNT; i++, radius -= separation)
+ {
+ if (radius < width)
+ radius += MM_TO_COORD (LEAD_USER_INITIAL_RADIUS);
+
+ /* Draw an arc at radius */
+ gdk_draw_arc (gport->drawable, lead_gc, FALSE,
+ Vx (priv->lead_user_x - radius),
+ Vy (priv->lead_user_y - radius),
+ Vz (2. * radius), Vz (2. * radius),
+ 0, 360 * 64);
+ }
+}
+
+gboolean
+lead_user_cb (gpointer data)
+{
+ render_priv *priv = data;
+ Coord step;
+ double elapsed_time;
+
+ /* Queue a redraw */
+ ghid_invalidate_all ();
+
+ /* Update radius */
+ elapsed_time = g_timer_elapsed (priv->lead_user_timer, NULL);
+ g_timer_start (priv->lead_user_timer);
+
+ step = MM_TO_COORD (LEAD_USER_VELOCITY * elapsed_time);
+ if (priv->lead_user_radius > step)
+ priv->lead_user_radius -= step;
+ else
+ priv->lead_user_radius = MM_TO_COORD (LEAD_USER_INITIAL_RADIUS);
+
+ return TRUE;
+}
+
+void
+ghid_lead_user_to_location (Coord x, Coord y)
+{
+ render_priv *priv = gport->render_priv;
+
+ ghid_cancel_lead_user ();
+
+ priv->lead_user = true;
+ priv->lead_user_x = x;
+ priv->lead_user_y = y;
+ priv->lead_user_radius = MM_TO_COORD (LEAD_USER_INITIAL_RADIUS);
+ priv->lead_user_timeout = g_timeout_add (LEAD_USER_PERIOD, lead_user_cb, priv);
+ priv->lead_user_timer = g_timer_new ();
+}
+
+void
+ghid_cancel_lead_user (void)
+{
+ render_priv *priv = gport->render_priv;
+
+ if (priv->lead_user_timeout)
+ g_source_remove (priv->lead_user_timeout);
+
+ if (priv->lead_user_timer)
+ g_timer_destroy (priv->lead_user_timer);
+
+ if (priv->lead_user)
+ ghid_invalidate_all ();
+
+ priv->lead_user_timeout = 0;
+ priv->lead_user_timer = NULL;
+ priv->lead_user = false;
+}
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 2d7fec0..a910946 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -47,6 +47,15 @@ typedef struct render_priv {
int subcomposite_stencil_bit;
char *current_colorname;
double current_alpha_mult;
+
+ /* Feature for leading the user to a particular location */
+ guint lead_user_timeout;
+ GTimer *lead_user_timer;
+ bool lead_user;
+ Coord lead_user_radius;
+ Coord lead_user_x;
+ Coord lead_user_y;
+
} render_priv;
@@ -62,6 +71,10 @@ typedef struct hid_gc_struct
}
hid_gc_struct;
+
+static void draw_lead_user (render_priv *priv);
+
+
static void
start_subcomposite (void)
{
@@ -824,6 +837,7 @@ ghid_init_renderer (int *argc, char ***argv, GHidPort *port)
void
ghid_shutdown_renderer (GHidPort *port)
{
+ ghid_cancel_lead_user ();
g_free (port->render_priv);
port->render_priv = NULL;
}
@@ -889,6 +903,7 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
GdkEventExpose *ev,
GHidPort *port)
{
+ render_priv *priv = port->render_priv;
BoxType region;
ghid_start_drawing (port);
@@ -976,6 +991,8 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
hidgl_flush_triangles (&buffer);
+ draw_lead_user (priv);
+
ghid_end_drawing (port);
return FALSE;
@@ -1288,3 +1305,103 @@ ghid_event_to_pcb_coords (int event_x, int event_y, Coord *pcb_x, Coord *pcb_y)
return true;
}
+
+#define LEAD_USER_WIDTH 0.2 /* millimeters */
+#define LEAD_USER_PERIOD (1000 / 20) /* 20fps (in ms) */
+#define LEAD_USER_VELOCITY 3. /* millimeters per second */
+#define LEAD_USER_ARC_COUNT 3
+#define LEAD_USER_ARC_SEPARATION 3. /* millimeters */
+#define LEAD_USER_INITIAL_RADIUS 10. /* millimetres */
+#define LEAD_USER_COLOR_R 1.
+#define LEAD_USER_COLOR_G 1.
+#define LEAD_USER_COLOR_B 0.
+
+static void
+draw_lead_user (render_priv *priv)
+{
+ int i;
+ double radius = priv->lead_user_radius;
+ double width = MM_TO_COORD (LEAD_USER_WIDTH);
+ double separation = MM_TO_COORD (LEAD_USER_ARC_SEPARATION);
+
+ if (!priv->lead_user)
+ return;
+
+ glPushAttrib (GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT);
+ glEnable (GL_COLOR_LOGIC_OP);
+ glLogicOp (GL_XOR);
+ glColor3f (LEAD_USER_COLOR_R, LEAD_USER_COLOR_G,LEAD_USER_COLOR_B);
+
+
+ /* arcs at the approrpriate radii */
+
+ for (i = 0; i < LEAD_USER_ARC_COUNT; i++, radius -= separation)
+ {
+ if (radius < width)
+ radius += MM_TO_COORD (LEAD_USER_INITIAL_RADIUS);
+
+ /* Draw an arc at radius */
+ hidgl_draw_arc (width, priv->lead_user_x, priv->lead_user_y,
+ radius, radius, 0, 360, gport->zoom);
+ }
+
+ hidgl_flush_triangles (&buffer);
+ glPopAttrib ();
+}
+
+gboolean
+lead_user_cb (gpointer data)
+{
+ render_priv *priv = data;
+ Coord step;
+ double elapsed_time;
+
+ /* Queue a redraw */
+ ghid_invalidate_all ();
+
+ /* Update radius */
+ elapsed_time = g_timer_elapsed (priv->lead_user_timer, NULL);
+ g_timer_start (priv->lead_user_timer);
+
+ step = MM_TO_COORD (LEAD_USER_VELOCITY * elapsed_time);
+ if (priv->lead_user_radius > step)
+ priv->lead_user_radius -= step;
+ else
+ priv->lead_user_radius = MM_TO_COORD (LEAD_USER_INITIAL_RADIUS);
+
+ return TRUE;
+}
+
+void
+ghid_lead_user_to_location (Coord x, Coord y)
+{
+ render_priv *priv = gport->render_priv;
+
+ ghid_cancel_lead_user ();
+
+ priv->lead_user = true;
+ priv->lead_user_x = x;
+ priv->lead_user_y = y;
+ priv->lead_user_radius = MM_TO_COORD (LEAD_USER_INITIAL_RADIUS);
+ priv->lead_user_timeout = g_timeout_add (LEAD_USER_PERIOD, lead_user_cb, priv);
+ priv->lead_user_timer = g_timer_new ();
+}
+
+void
+ghid_cancel_lead_user (void)
+{
+ render_priv *priv = gport->render_priv;
+
+ if (priv->lead_user_timeout)
+ g_source_remove (priv->lead_user_timeout);
+
+ if (priv->lead_user_timer)
+ g_timer_destroy (priv->lead_user_timer);
+
+ if (priv->lead_user)
+ ghid_invalidate_all ();
+
+ priv->lead_user_timeout = 0;
+ priv->lead_user_timer = NULL;
+ priv->lead_user = false;
+}
diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index ea7cef5..bc3fc69 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -218,17 +218,6 @@ toggle_pin_selected (LibraryEntryType *entry)
AddObjectToFlagUndoList (conn.type, conn.ptr1, conn.ptr2, conn.ptr2);
TOGGLE_FLAG (SELECTEDFLAG, (AnyObjectType *)conn.ptr2);
DrawObject (conn.type, conn.ptr1, conn.ptr2);
-
- if (conn.type == PIN_TYPE)
- {
- PinTypePtr pin = (PinTypePtr) conn.ptr2;
- CenterDisplay (pin->X, pin->Y);
- }
- else if (conn.type == PAD_TYPE)
- {
- PadTypePtr pad = (PadTypePtr) conn.ptr2;
- CenterDisplay (pad->Point1.X, pad->Point1.Y);
- }
}
@@ -241,8 +230,9 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
GtkTreeModel *model;
LibraryMenuType *node_net;
LibraryEntryType *node;
+ ConnectionType conn;
+ Coord x, y;
static gchar *node_name;
- gint x0, y0, margin;
if (selection_holdoff) /* PCB is highlighting, user is not selecting */
return;
@@ -258,7 +248,10 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
| if off here will get our on/off toggling out of sync.
*/
if (node_net == node_selected_net)
- toggle_pin_selected (node);
+ {
+ toggle_pin_selected (node);
+ ghid_cancel_lead_user ();
+ }
g_free (node_name);
node_name = NULL;
}
@@ -281,26 +274,33 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
dup_string (&node_name, node->ListEntry);
node_selected_net = selected_net;
- /* Now just toggle a select of the node on the layout and pan.
+ /* Now just toggle a select of the node on the layout
*/
toggle_pin_selected (node);
IncrementUndoSerialNumber ();
- margin = gport->view_width / 20;
- if ( Crosshair.X < gport->view_x0 + margin
- || Crosshair.X > gport->view_x0 + gport->view_width - margin
- || Crosshair.Y < gport->view_y0 + margin
- || Crosshair.Y > gport->view_y0 + gport->view_height - margin
- )
- {
-
- x0 = SIDE_X (Crosshair.X) - gport->view_width / 2;
- y0 = SIDE_Y (Crosshair.Y) - gport->view_height / 2;
- gport->view_x0 = x0;
- gport->view_y0 = y0;
- ghid_pan_fixup ();
- gui->set_crosshair (Crosshair.X, Crosshair.Y, HID_SC_WARP_POINTER);
- }
- ghid_screen_update();
+
+ /* And lead the user to the location */
+ if (SeekPad (node, &conn, false))
+ switch (conn.type) {
+ case PIN_TYPE:
+ {
+ PinTypePtr pin = (PinTypePtr) conn.ptr2;
+ x = pin->X;
+ y = pin->Y;
+ gui->set_crosshair (x, y, 0);
+ ghid_lead_user_to_location (x, y);
+ break;
+ }
+ case PAD_TYPE:
+ {
+ PadTypePtr pad = (PadTypePtr) conn.ptr2;
+ x = pad->Point1.X + (pad->Point2.X - pad->Point1.X) / 2;
+ y = pad->Point1.Y + (pad->Point2.Y - pad->Point2.Y) / 2;
+ gui->set_crosshair (x, y, 0);
+ ghid_lead_user_to_location (x, y);
+ break;
+ }
+ }
}
@@ -679,6 +679,9 @@ netlist_close_cb (GtkWidget * widget, gpointer data)
gtk_widget_destroy (netlist_window);
selected_net = NULL;
netlist_window = NULL;
+
+ /* For now, we are the only consumer of this API, so we can just do this */
+ ghid_cancel_lead_user ();
}
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index b0bbe0a..d17cca2 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -505,6 +505,9 @@ void ghid_flush_debug_draw (void);
void ghid_finish_debug_draw (void);
bool ghid_event_to_pcb_coords (int event_x, int event_y, Coord *pcb_x, Coord *pcb_y);
+void ghid_lead_user_to_location (Coord x, Coord y);
+void ghid_cancel_lead_user (void);
+
/* gtkhid-main.c */
void ghid_pan_fixup (void);
void ghid_get_coords (const char *msg, int *x, int *y);
|
|
From: <gi...@gp...> - 2011-08-07 22:32:17
|
The branch, master has been updated
via 42b463193c8d4f5e000713920e5d9b207ac37031 (commit)
from d9271d3d92b5513c7cec40c4bf1ae6d98f352a9b (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-netlist-window.c | 28 ++++++++++++++++++-
src/select.c | 54 --------------------------------------
src/select.h | 1 -
3 files changed, 26 insertions(+), 57 deletions(-)
=================
Commit Messages
=================
commit 42b463193c8d4f5e000713920e5d9b207ac37031
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Move the SelectPin() function into the file of its only caller.
The new function is in hid/gtk/gui-netlist-window.c, and is called
toggle_pin_selected ().
Whilst we're at it, simplify the function, removing its always-
constant argument and condense the redrawing calls.
:100644 100644 31caa2e... ea7cef5... M src/hid/gtk/gui-netlist-window.c
:100644 100644 8dfe270... 96db234... M src/select.c
:100644 100644 e24ab82... 0e12cc2... M src/select.h
=========
Changes
=========
commit 42b463193c8d4f5e000713920e5d9b207ac37031
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Move the SelectPin() function into the file of its only caller.
The new function is in hid/gtk/gui-netlist-window.c, and is called
toggle_pin_selected ().
Whilst we're at it, simplify the function, removing its always-
constant argument and condense the redrawing calls.
diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 31caa2e..ea7cef5 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -207,6 +207,30 @@ node_model_update (LibraryMenuType * menu)
g_object_unref (G_OBJECT (model));
}
+static void
+toggle_pin_selected (LibraryEntryType *entry)
+{
+ ConnectionType conn;
+
+ if (!SeekPad (entry, &conn, false))
+ return;
+
+ AddObjectToFlagUndoList (conn.type, conn.ptr1, conn.ptr2, conn.ptr2);
+ TOGGLE_FLAG (SELECTEDFLAG, (AnyObjectType *)conn.ptr2);
+ DrawObject (conn.type, conn.ptr1, conn.ptr2);
+
+ if (conn.type == PIN_TYPE)
+ {
+ PinTypePtr pin = (PinTypePtr) conn.ptr2;
+ CenterDisplay (pin->X, pin->Y);
+ }
+ else if (conn.type == PAD_TYPE)
+ {
+ PadTypePtr pad = (PadTypePtr) conn.ptr2;
+ CenterDisplay (pad->Point1.X, pad->Point1.Y);
+ }
+}
+
/* Callback when the user clicks on a PCB node in the right node treeview.
*/
@@ -234,7 +258,7 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
| if off here will get our on/off toggling out of sync.
*/
if (node_net == node_selected_net)
- SelectPin (node, TRUE);
+ toggle_pin_selected (node);
g_free (node_name);
node_name = NULL;
}
@@ -259,7 +283,7 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
/* Now just toggle a select of the node on the layout and pan.
*/
- SelectPin (node, TRUE);
+ toggle_pin_selected (node);
IncrementUndoSerialNumber ();
margin = gport->view_width / 20;
if ( Crosshair.X < gport->view_x0 + margin
diff --git a/src/select.c b/src/select.c
index 8dfe270..96db234 100644
--- a/src/select.c
+++ b/src/select.c
@@ -61,60 +61,6 @@
RCSID ("$Id$");
-
-
-/* ---------------------------------------------------------------------------
- * toggle selection of pin
- * This SelectPin function was moved to here from the original netlist.c
- * as part of the gui code separation for the Gtk port. SelectPin() is
- * written by and is Copyright (C) 1998, 1999, 2000, 2001 harry eaton
- */
-void
-SelectPin (LibraryEntryTypePtr entry, bool toggle)
-{
- ConnectionType conn;
-
- if (SeekPad (entry, &conn, false))
- {
- switch (conn.type)
- {
- case PIN_TYPE:
- {
- PinTypePtr pin = (PinTypePtr) conn.ptr2;
-
- AddObjectToFlagUndoList (PIN_TYPE, conn.ptr1, conn.ptr2,
- conn.ptr2);
- if (toggle)
- {
- TOGGLE_FLAG (SELECTEDFLAG, pin);
- CenterDisplay (pin->X, pin->Y);
- }
- else
- SET_FLAG (SELECTEDFLAG, pin);
- DrawPin (pin);
- break;
- }
- case PAD_TYPE:
- {
- PadTypePtr pad = (PadTypePtr) conn.ptr2;
-
- AddObjectToFlagUndoList (PAD_TYPE, conn.ptr1, conn.ptr2,
- conn.ptr2);
- if (toggle)
- {
- TOGGLE_FLAG (SELECTEDFLAG, pad);
- CenterDisplay (pad->Point1.X, pad->Point1.Y);
- }
- else
- SET_FLAG (SELECTEDFLAG, pad);
- DrawPad (pad);
- break;
- }
- }
- }
-}
-
-
/* ---------------------------------------------------------------------------
* toggles the selection of any kind of object
* the different types are defined by search.h
diff --git a/src/select.h b/src/select.h
index e24ab82..0e12cc2 100644
--- a/src/select.h
+++ b/src/select.h
@@ -37,7 +37,6 @@
(VIA_TYPE | LINE_TYPE | TEXT_TYPE | POLYGON_TYPE | ELEMENT_TYPE | \
PIN_TYPE | PAD_TYPE | ELEMENTNAME_TYPE | RATLINE_TYPE | ARC_TYPE)
-void SelectPin (LibraryEntryTypePtr entry, bool toggle);
bool SelectObject (void);
bool SelectBlock (BoxTypePtr, bool);
bool SelectedOperation (ObjectFunctionTypePtr, bool, int);
|
|
From: <gi...@gp...> - 2011-08-07 22:01:20
|
The branch, master has been updated
via d9271d3d92b5513c7cec40c4bf1ae6d98f352a9b (commit)
from 16ee2f61be15288605074bb8ab5cd13870c54596 (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 | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit d9271d3d92b5513c7cec40c4bf1ae6d98f352a9b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Remove unused parser token F_Scroll ("Scroll")
:100644 100644 704b98f... cb2a7bf... M src/action.c
=========
Changes
=========
commit d9271d3d92b5513c7cec40c4bf1ae6d98f352a9b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Remove unused parser token F_Scroll ("Scroll")
diff --git a/src/action.c b/src/action.c
index 704b98f..cb2a7bf 100644
--- a/src/action.c
+++ b/src/action.c
@@ -164,7 +164,6 @@ typedef enum
F_Restore,
F_Rotate,
F_Save,
- F_Scroll,
F_Selected,
F_SelectedArcs,
F_SelectedElements,
@@ -400,7 +399,6 @@ static FunctionType Functions[] = {
{"Revert", F_Revert},
{"Rotate", F_Rotate},
{"Save", F_Save},
- {"Scroll", F_Scroll},
{"Selected", F_Selected},
{"SelectedArcs", F_SelectedArcs},
{"SelectedElements", F_SelectedElements},
|