You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(4) |
Mar
(5) |
Apr
|
May
(5) |
Jun
(30) |
Jul
(2) |
Aug
(18) |
Sep
(14) |
Oct
(7) |
Nov
(21) |
Dec
(44) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(63) |
Feb
(94) |
Mar
(54) |
Apr
(39) |
May
(34) |
Jun
(25) |
Jul
(10) |
Aug
(33) |
Sep
(16) |
Oct
(62) |
Nov
(12) |
Dec
(2) |
| 2005 |
Jan
(71) |
Feb
(8) |
Mar
(50) |
Apr
|
May
(2) |
Jun
(12) |
Jul
(19) |
Aug
(8) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(8) |
| 2006 |
Jan
(10) |
Feb
(1) |
Mar
(301) |
Apr
(232) |
May
(26) |
Jun
(20) |
Jul
(26) |
Aug
(79) |
Sep
(92) |
Oct
(174) |
Nov
(17) |
Dec
(93) |
| 2007 |
Jan
(27) |
Feb
(179) |
Mar
(37) |
Apr
(81) |
May
(20) |
Jun
(5) |
Jul
|
Aug
(40) |
Sep
(68) |
Oct
(8) |
Nov
(47) |
Dec
(34) |
| 2008 |
Jan
(154) |
Feb
(15) |
Mar
(5) |
Apr
(21) |
May
(4) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(8) |
Oct
(9) |
Nov
(35) |
Dec
(50) |
| 2009 |
Jan
(8) |
Feb
(10) |
Mar
(6) |
Apr
(9) |
May
(7) |
Jun
(40) |
Jul
(7) |
Aug
(5) |
Sep
(2) |
Oct
(16) |
Nov
(42) |
Dec
(5) |
| 2010 |
Jan
(3) |
Feb
(15) |
Mar
(32) |
Apr
(18) |
May
(6) |
Jun
(9) |
Jul
|
Aug
(11) |
Sep
(16) |
Oct
|
Nov
(4) |
Dec
(35) |
| 2011 |
Jan
(24) |
Feb
(6) |
Mar
(27) |
Apr
(119) |
May
(72) |
Jun
(20) |
Jul
(31) |
Aug
(88) |
Sep
(86) |
Oct
(14) |
Nov
(11) |
Dec
(30) |
| 2012 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gi...@gp...> - 2011-04-06 21:09:26
|
The branch, master has been updated
via 80635801c9f1d10b67b0a1741f1bea5a0f7a4af8 (commit)
from 28983f2b5bdeb060916bd9956fed873b05855a40 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
=================
Commit Messages
=================
=========
Changes
=========
|
|
From: <gi...@gp...> - 2011-04-06 19:52:15
|
The branch, master has been updated
via 28983f2b5bdeb060916bd9956fed873b05855a40 (commit)
from a5afa86175f36898e3916fb9754184ccee71c7fb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gtkhid-gdk.c | 8 +++-----
src/hid/gtk/gui-output-events.c | 1 +
2 files changed, 4 insertions(+), 5 deletions(-)
=================
Commit Messages
=================
commit 28983f2b5bdeb060916bd9956fed873b05855a40
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Only redraw the crosshair when necessary
If we're about to repaint the screen from our backing pixmap,
there is no point un-XOR drawing our current crosshair first.
:100644 100644 2ebb1a2... ba58d5d... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 c71af06... a294777... M src/hid/gtk/gui-output-events.c
=========
Changes
=========
commit 28983f2b5bdeb060916bd9956fed873b05855a40
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Only redraw the crosshair when necessary
If we're about to repaint the screen from our backing pixmap,
there is no point un-XOR drawing our current crosshair first.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 2ebb1a2..ba58d5d 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -873,7 +873,7 @@ draw_crosshair (GdkGC *xor_gc, gint x, gint y)
#define VCD 8
void
-ghid_show_crosshair (gboolean show)
+ghid_show_crosshair (gboolean paint_new_location)
{
gint x, y;
static gint x_prev = -1, y_prev = -1;
@@ -897,7 +897,7 @@ ghid_show_crosshair (gboolean show)
gdk_gc_set_foreground (xor_gc, &cross_color);
- if (x_prev >= 0)
+ if (x_prev >= 0 && !paint_new_location)
{
draw_crosshair (xor_gc, x_prev, y_prev);
if (draw_markers_prev)
@@ -913,7 +913,7 @@ ghid_show_crosshair (gboolean show)
}
}
- if (x >= 0 && show)
+ if (x >= 0 && paint_new_location)
{
draw_crosshair (xor_gc, x, y);
draw_markers = ghidgui->auto_pan_on && have_crosshair_attachments ();
@@ -990,7 +990,6 @@ ghid_screen_update (void)
{
render_priv *priv = gport->render_priv;
- ghid_show_crosshair (FALSE);
gdk_draw_drawable (gport->drawing_area->window, priv->bg_gc, gport->pixmap,
0, 0, 0, 0, gport->width, gport->height);
ghid_show_crosshair (TRUE);
@@ -1003,7 +1002,6 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
{
render_priv *priv = port->render_priv;
- ghid_show_crosshair (FALSE);
gdk_draw_drawable (widget->window, priv->bg_gc, port->pixmap,
ev->area.x, ev->area.y, ev->area.x, ev->area.y,
ev->area.width, ev->area.height);
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index c71af06..a294777 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -695,6 +695,7 @@ ghid_port_window_motion_cb (GtkWidget * widget,
queue_tooltip_update (out);
#endif
+ ghid_show_crosshair (FALSE);
ghid_show_crosshair (TRUE);
if (moved && have_crosshair_attachments ())
ghid_draw_area_update (gport, NULL);
|
|
From: <gi...@gp...> - 2011-04-06 18:44:05
|
The branch, master has been updated
via a5afa86175f36898e3916fb9754184ccee71c7fb (commit)
from ca5fe01ec42fbbe5407bc0348fe2fd618caecd4c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/crosshair.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit a5afa86175f36898e3916fb9754184ccee71c7fb
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Don't issue CrosshairOff() from the DestroyCrosshair() function.
We shouldn't assume we can make call GUI calls at this point.
NB: The DestroyCrosshair() function is actually unused!
:100644 100644 a7942b6... 7df5299... M src/crosshair.c
=========
Changes
=========
commit a5afa86175f36898e3916fb9754184ccee71c7fb
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Don't issue CrosshairOff() from the DestroyCrosshair() function.
We shouldn't assume we can make call GUI calls at this point.
NB: The DestroyCrosshair() function is actually unused!
diff --git a/src/crosshair.c b/src/crosshair.c
index a7942b6..7df5299 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -1144,7 +1144,6 @@ InitCrosshair (void)
void
DestroyCrosshair (void)
{
- CrosshairOff ();
FreePolygonMemory (&Crosshair.AttachedPolygon);
gui->destroy_gc (Crosshair.GC);
}
|
|
From: <gi...@gp...> - 2011-03-31 15:21:42
|
The branch, master has been updated
via 35c8e14409571cc7bf1049d042ac743496b2b732 (commit)
via eafc3dad694f955f1a885e7d1b19ef547c0df9ee (commit)
via 0062d54c2fff54b676e457bbacd419a46d518f75 (commit)
from 0c78d1c688e44fdb67d76594d386140586911dba (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 41 ----------------------------------------
src/gpcb-menu.res | 6 ++--
src/hid/gtk/gui-dialog-print.c | 5 ++-
src/pcb-menu.res | 6 ++--
4 files changed, 9 insertions(+), 49 deletions(-)
=================
Commit Messages
=================
commit 35c8e14409571cc7bf1049d042ac743496b2b732
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Add shortcuts 'New' and 'Save (As)'
Adds shortcuts (accelerators) and mnemonics to for 'New', 'Save' and
'Save As...' as suggested int the GNOME Human Interface Guidelines.
Closes-bug: lp-710145
:100644 100644 593b737... dd1f27e... M src/gpcb-menu.res
:100644 100644 5e3682c... e2fc4bb... M src/pcb-menu.res
commit eafc3dad694f955f1a885e7d1b19ef547c0df9ee
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Remove unused function
DrawVText() used GDK;
it shouldn't have been implemented this way in any case.
Closes-bug: lp-717294
:100644 100644 36bf1b9... 6091ef3... M src/draw.c
commit 0062d54c2fff54b676e457bbacd419a46d518f75
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Fix warning at exporting png with GTK+ GUI
An 'Gtk-CRITICAL'-Error was thrown on opening the png-exporter dialog because
there is no default-string for the 'png-bloat' option.
Closes-bug: lp-740526
:100644 100644 9ced77b... 4a2fb85... M src/hid/gtk/gui-dialog-print.c
=========
Changes
=========
commit 35c8e14409571cc7bf1049d042ac743496b2b732
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Add shortcuts 'New' and 'Save (As)'
Adds shortcuts (accelerators) and mnemonics to for 'New', 'Save' and
'Save As...' as suggested int the GNOME Human Interface Guidelines.
Closes-bug: lp-710145
diff --git a/src/gpcb-menu.res b/src/gpcb-menu.res
index 593b737..dd1f27e 100644
--- a/src/gpcb-menu.res
+++ b/src/gpcb-menu.res
@@ -46,8 +46,8 @@ MainMenu =
# File Menu
#
{"File"
- {"Save layout" Save(Layout) tip="Saves current layout"}
- {"Save layout as..." Save(LayoutAs) tip="Saves current layout into a new file"}
+ {"Save Layout" Save(Layout) tip="Saves current layout" m=S a={"Ctrl-S" "Ctrl<Key>s"}}
+ {"Save Layout As..." Save(LayoutAs) tip="Saves current layout into a new file" m=A a={"Shift Ctrl-S" "Shift Ctrl<Key>s"}}
-
{"Revert" Load(Revert,none) tip="Revert to the layout stored on disk"}
-
@@ -68,7 +68,7 @@ MainMenu =
{"Export layout..." Export()}
{"Calibrate Printer..." PrintCalibrate()}
-
- {"Start new layout" New()}
+ {"Start New Layout" New() a={"Ctrl-N" "Ctrl<Key>n"}}
-
{"Preferences..." DoWindows(Preferences)}
-
diff --git a/src/pcb-menu.res b/src/pcb-menu.res
index 5e3682c..e2fc4bb 100644
--- a/src/pcb-menu.res
+++ b/src/pcb-menu.res
@@ -29,8 +29,8 @@ MainMenu =
{
{File
{"About..." About()}
- {"Save layout" Save(Layout)}
- {"Save layout as..." Save(LayoutAs)}
+ {"Save layout" Save(Layout) m=S a={"Ctrl-S" "Ctrl<Key>s"}}
+ {"Save layout as..." Save(LayoutAs) m=A a={"Shift Ctrl-S" "Shift Ctrl<Key>s"}}
{"Revert" Load(Revert,none)}
{"Import Schematics" Import() }
{"Load layout" Load(Layout)}
@@ -47,7 +47,7 @@ MainMenu =
{" all elements" Save(AllConnections)}
{" unused pins" Save(AllUnusedPins)}
-
- {"Start new layout" New()}
+ {"Start new layout" New() a={"Ctrl-N" "Ctrl<Key>n"}}
-
{"Quit Program" Quit() m=Q a={"Ctrl-Q" "Ctrl<Key>q"}}
}
commit eafc3dad694f955f1a885e7d1b19ef547c0df9ee
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Remove unused function
DrawVText() used GDK;
it shouldn't have been implemented this way in any case.
Closes-bug: lp-717294
diff --git a/src/draw.c b/src/draw.c
index 36bf1b9..6091ef3 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -1151,47 +1151,6 @@ ClearOnlyPin (PinTypePtr Pin, bool mask)
}
}
-
-#if VERTICAL_TEXT
-/* vertical text handling provided by Martin Devera with fixes by harry eaton */
-
-/* draw vertical text; xywh is bounding, de is text's descend used for
- positioning */
-static void
-DrawVText (int x, int y, int w, int h, char *str)
-{
- GdkPixmap *pm;
- GdkImage *im;
- GdkGCValues values;
- guint32 pixel;
- int i, j;
-
- if (!str || !*str)
- return;
-
- pm = gdk_pixmap_new (DrawingWindow, w, h, -1);
-
- /* draw into pixmap */
- gdk_draw_rectangle (pm, Output.bgGC, TRUE, 0, 0, w, h);
-
- gui_draw_string_markup (DrawingWindow, Output.font_desc, Output.fgGC,
- 0, 0, str);
-
- im = gdk_drawable_get_image (pm, 0, 0, w, h);
- gdk_gc_get_values (Output.fgGC, &values);
-
- /* draw Transpose(im). TODO: Pango should be doing vertical text soon */
- for (i = 0; i < w; i++)
- for (j = 0; j < h; j++)
- {
- pixel = gdk_image_get_pixel (im, i, j);
- if (pixel == values.foreground.pixel)
- gdk_draw_point (DrawingWindow, Output.fgGC, x + j, y + w - i - 1);
- }
- g_object_unref (G_OBJECT (pm));
-}
-#endif
-
/* ---------------------------------------------------------------------------
* lowlevel drawing routine for pin and via names
*/
commit 0062d54c2fff54b676e457bbacd419a46d518f75
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Fix warning at exporting png with GTK+ GUI
An 'Gtk-CRITICAL'-Error was thrown on opening the png-exporter dialog because
there is no default-string for the 'png-bloat' option.
Closes-bug: lp-740526
diff --git a/src/hid/gtk/gui-dialog-print.c b/src/hid/gtk/gui-dialog-print.c
index 9ced77b..4a2fb85 100644
--- a/src/hid/gtk/gui-dialog-print.c
+++ b/src/hid/gtk/gui-dialog-print.c
@@ -188,8 +188,9 @@ ghid_attribute_dialog (HID_Attribute * attrs,
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
- gtk_entry_set_text (GTK_ENTRY (entry),
- attrs[j].default_val.str_value);
+ if(attrs[j].default_val.str_value != NULL)
+ gtk_entry_set_text (GTK_ENTRY (entry),
+ attrs[j].default_val.str_value);
gtk_tooltips_set_tip (tips, entry, attrs[j].help_text, NULL);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (entry_changed_cb),
|
|
From: <gi...@gp...> - 2011-03-27 23:15:33
|
The branch, master has been updated
via 0c78d1c688e44fdb67d76594d386140586911dba (commit)
from 7fd9924afa6d1f3bbc6f969822ef62e8c3bf9ea6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/crosshair.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit 0c78d1c688e44fdb67d76594d386140586911dba
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
crosshair.c: Remove comment which is no longer relevant
:100644 100644 296f999... a7942b6... M src/crosshair.c
=========
Changes
=========
commit 0c78d1c688e44fdb67d76594d386140586911dba
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
crosshair.c: Remove comment which is no longer relevant
diff --git a/src/crosshair.c b/src/crosshair.c
index 296f999..a7942b6 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -712,15 +712,6 @@ CrosshairOff (void)
}
}
-/*
- * The parameter to HideCrosshair() and RestoreCrosshair() dictates whether
- * the object you're dragging should be drawn or not.
- *
- * This argument is _not_ saved in the stack, so whether you have drawings
- * following the cursor around or not is dependant on the parameter passed
- * LAST to either of these two functions.
- */
-
/* ---------------------------------------------------------------------------
* saves crosshair state (on/off) and hides him
*/
|
|
From: <gi...@gp...> - 2011-03-27 21:34:07
|
The branch, master has been updated
via 7fd9924afa6d1f3bbc6f969822ef62e8c3bf9ea6 (commit)
from ae2a8d395967ca92a4cfbc21d99ad26f5357ac26 (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 | 214 +++++++++++++++++++-------------------
src/buffer.c | 8 +-
src/crosshair.c | 35 +++----
src/crosshair.h | 8 +-
src/draw.c | 4 +-
src/hid/gtk/gtkhid-gdk.c | 2 +-
src/hid/gtk/gtkhid-main.c | 4 +-
src/hid/gtk/gui-command-window.c | 8 +-
src/hid/gtk/gui-misc.c | 8 +-
src/hid/gtk/gui-output-events.c | 22 ++--
src/hid/gtk/gui-top-window.c | 4 +-
src/hid/lesstif/main.c | 18 ++--
src/misc.c | 2 +-
src/report.c | 12 +-
src/set.c | 12 +-
15 files changed, 178 insertions(+), 183 deletions(-)
=================
Commit Messages
=================
commit 7fd9924afa6d1f3bbc6f969822ef62e8c3bf9ea6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove BlockToo argument from various crosshair hide / restore functions
Goodness knows what it is supposed to do, but everything appears to work
fine without it. For the majority of cases, the argument passed is true.
When passed as false, the effect is to surpress drawing an attached
selection / rubberband rectangle in the AttachedBox.state == STATE_THIRD
state.
Digging through the version control history, this code appears to have
been present since the project was initially placed under CVS control.
The 23 places this argument was previously false are:
ActionMovePointer
- HideCrosshair (false);
- RestoreCrosshair (false);
EventMoveCrosshair
- RestoreCrosshair (false);
ActionDisplay
- RestoreCrosshair (false);
ActionFreeRotateBuffer
- HideCrosshair(false);
- RestoreCrosshair(false);
MoveCrosshairAbsolute
- HideCrosshair (false);
ghid_invalidate_all
- RestoreCrosshair (FALSE);
ScrollAction (GTK HID)
- HideCrosshair (FALSE);
- RestoreCrosshair (FALSE);
ghid_port_ranges_changed
- HideCrosshair (FALSE);
ghid_note_event_location
- RestoreCrosshair (false);
idle_proc (Lesstif HID)
- CrosshairOn (0);
CenterDisplay
- RestoreCrosshair(false);
ReportDialog
- HideCrosshair (false);
- RestoreCrosshair (false);
ReportFoundPins
- HideCrosshair (false);
- RestoreCrosshair (false);
ReportNetLength
- HideCrosshair (false);
- RestoreCrosshair (false);
SetLocalRef
- RestoreCrosshair (false);
- HideCrosshair (false);
- RestoreCrosshair (false);
:100644 100644 ad99e7a... ea9a51f... M src/action.c
:100644 100644 110914c... 908b21e... M src/buffer.c
:100644 100644 0ab59a4... 296f999... M src/crosshair.c
:100644 100644 b07af6f... 4573e98... M src/crosshair.h
:100644 100644 e5a4d14... 36bf1b9... M src/draw.c
:100644 100644 76e7659... 2ebb1a2... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 28c10bc... 266cf06... M src/hid/gtk/gtkhid-main.c
:100644 100644 d865dee... 28877fd... M src/hid/gtk/gui-command-window.c
:100644 100644 b619dd0... 8bda96d... M src/hid/gtk/gui-misc.c
:100644 100644 3b543cb... c71af06... M src/hid/gtk/gui-output-events.c
:100644 100644 2098c27... 074ef9b... M src/hid/gtk/gui-top-window.c
:100644 100644 1f5b7b0... 2f00577... M src/hid/lesstif/main.c
:100644 100644 a8e08ea... a7704f4... M src/misc.c
:100644 100644 9135e0d... c0a4ab0... M src/report.c
:100644 100644 188203a... 17f7583... M src/set.c
=========
Changes
=========
commit 7fd9924afa6d1f3bbc6f969822ef62e8c3bf9ea6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove BlockToo argument from various crosshair hide / restore functions
Goodness knows what it is supposed to do, but everything appears to work
fine without it. For the majority of cases, the argument passed is true.
When passed as false, the effect is to surpress drawing an attached
selection / rubberband rectangle in the AttachedBox.state == STATE_THIRD
state.
Digging through the version control history, this code appears to have
been present since the project was initially placed under CVS control.
The 23 places this argument was previously false are:
ActionMovePointer
- HideCrosshair (false);
- RestoreCrosshair (false);
EventMoveCrosshair
- RestoreCrosshair (false);
ActionDisplay
- RestoreCrosshair (false);
ActionFreeRotateBuffer
- HideCrosshair(false);
- RestoreCrosshair(false);
MoveCrosshairAbsolute
- HideCrosshair (false);
ghid_invalidate_all
- RestoreCrosshair (FALSE);
ScrollAction (GTK HID)
- HideCrosshair (FALSE);
- RestoreCrosshair (FALSE);
ghid_port_ranges_changed
- HideCrosshair (FALSE);
ghid_note_event_location
- RestoreCrosshair (false);
idle_proc (Lesstif HID)
- CrosshairOn (0);
CenterDisplay
- RestoreCrosshair(false);
ReportDialog
- HideCrosshair (false);
- RestoreCrosshair (false);
ReportFoundPins
- HideCrosshair (false);
- RestoreCrosshair (false);
ReportNetLength
- HideCrosshair (false);
- RestoreCrosshair (false);
SetLocalRef
- RestoreCrosshair (false);
- HideCrosshair (false);
- RestoreCrosshair (false);
diff --git a/src/action.c b/src/action.c
index ad99e7a..ea9a51f 100644
--- a/src/action.c
+++ b/src/action.c
@@ -610,7 +610,7 @@ click_cb (hidval hv)
Note.Click = false;
if (Note.Moving && !gui->shift_is_pressed ())
{
- HideCrosshair (true);
+ HideCrosshair ();
Note.Buffer = Settings.BufferNumber;
SetBufferNumber (MAX_BUFFER - 1);
ClearBuffer (PASTEBUFFER);
@@ -620,11 +620,11 @@ click_cb (hidval hv)
SaveMode ();
saved_mode = true;
SetMode (PASTEBUFFER_MODE);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
else if (Note.Hit && !gui->shift_is_pressed ())
{
- HideCrosshair (true);
+ HideCrosshair ();
SaveMode ();
saved_mode = true;
SetMode (gui->control_is_pressed ()? COPY_MODE : MOVE_MODE);
@@ -633,7 +633,7 @@ click_cb (hidval hv)
Crosshair.AttachedObject.Ptr3 = Note.ptr3;
Crosshair.AttachedObject.Type = Note.Hit;
AttachForCopy (Note.X, Note.Y);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
else
{
@@ -641,7 +641,7 @@ click_cb (hidval hv)
Note.Hit = 0;
Note.Moving = false;
- HideCrosshair (true);
+ HideCrosshair ();
SaveUndoSerialNumber ();
box.X1 = -MAX_COORD;
box.Y1 = -MAX_COORD;
@@ -653,7 +653,7 @@ click_cb (hidval hv)
NotifyBlock ();
Crosshair.AttachedBox.Point1.X = Note.X;
Crosshair.AttachedBox.Point1.Y = Note.Y;
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
}
}
@@ -949,7 +949,7 @@ NotifyLine (void)
static void
NotifyBlock (void)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (Crosshair.AttachedBox.State)
{
case STATE_FIRST: /* setup first point */
@@ -964,7 +964,7 @@ NotifyBlock (void)
Crosshair.AttachedBox.State = STATE_THIRD;
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
@@ -1871,7 +1871,7 @@ ActionDRCheck (int argc, char **argv, int x, int y)
PCB->minDrill / 100, PCB->minDrill % 100,
PCB->minRing / 100, PCB->minRing % 100);
}
- HideCrosshair (true);
+ HideCrosshair ();
count = DRCAll ();
if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview)
{
@@ -1882,7 +1882,7 @@ ActionDRCheck (int argc, char **argv, int x, int y)
else
Message (_("Aborted DRC after %d design rule errors.\n"), -count);
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -1967,7 +1967,7 @@ ActionFlip (int argc, char **argv, int x, int y)
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Object:
@@ -1988,7 +1988,7 @@ ActionFlip (int argc, char **argv, int x, int y)
err = 1;
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
if (!err)
return 0;
}
@@ -2075,7 +2075,7 @@ ActionSetThermal (int argc, char **argv, int x, int y)
bool absolute;
kind = GetValue (style, NULL, &absolute);
- HideCrosshair (true);
+ HideCrosshair ();
if (absolute)
switch (GetFunctionID (function))
{
@@ -2105,7 +2105,7 @@ ActionSetThermal (int argc, char **argv, int x, int y)
}
else
err = 1;
- RestoreCrosshair (true);
+ RestoreCrosshair ();
if (!err)
return 0;
}
@@ -2132,11 +2132,11 @@ ActionMovePointer (char *deltax, char *deltay)
/* restore crosshair for erasure */
Crosshair.X = x;
Crosshair.Y = y;
- HideCrosshair (false);
+ HideCrosshair ();
MoveCrosshairRelative (TO_SCREEN_SIGN_X (dx), TO_SCREEN_SIGN_Y (dy));
/* update object position and cursor location */
AdjustAttachedObjects ();
- RestoreCrosshair (false);
+ RestoreCrosshair ();
}
/* ---------------------------------------------------------------------------
@@ -2165,7 +2165,7 @@ EventMoveCrosshair (int ev_x, int ev_y)
/* update object position and cursor location */
AdjustAttachedObjects ();
- RestoreCrosshair (false);
+ RestoreCrosshair ();
}
}
else
@@ -2218,7 +2218,7 @@ ActionSetValue (int argc, char **argv, int x, int y)
if (function && val)
{
- HideCrosshair (true);
+ HideCrosshair ();
value = GetValue (val, units, &absolute);
switch (GetFunctionID (function))
{
@@ -2277,7 +2277,7 @@ ActionSetValue (int argc, char **argv, int x, int y)
err = 1;
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
if (!err)
return 0;
}
@@ -2350,7 +2350,7 @@ ActionConnection (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Find:
@@ -2384,7 +2384,7 @@ ActionConnection (int argc, char **argv, int x, int y)
}
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -2689,7 +2689,7 @@ ActionDisplay (int argc, char **argv, int childX, int childY)
if (function && (!str_dir || !*str_dir))
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (id = GetFunctionID (function))
{
@@ -2868,7 +2868,7 @@ ActionDisplay (int argc, char **argv, int childX, int childY)
oldGrid = PCB->Grid;
PCB->Grid = 1.0;
if (MoveCrosshairAbsolute (Crosshair.X, Crosshair.Y))
- RestoreCrosshair (false); /* was hidden by MoveCrosshairAbs */
+ RestoreCrosshair (); /* was hidden by MoveCrosshairAbs */
SetGrid (oldGrid, true);
}
break;
@@ -2973,7 +2973,7 @@ ActionDisplay (int argc, char **argv, int childX, int childY)
default:
err = 1;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
else if (function && str_dir)
{
@@ -3073,7 +3073,7 @@ ActionMode (int argc, char **argv, int x, int y)
{
Note.X = Crosshair.X;
Note.Y = Crosshair.Y;
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Arc:
@@ -3269,7 +3269,7 @@ ActionMode (int argc, char **argv, int x, int y)
SaveMode ();
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -3289,10 +3289,10 @@ static const char removeselected_help[] = "Removes any selected objects.";
static int
ActionRemoveSelected (int argc, char **argv, int x, int y)
{
- HideCrosshair (true);
+ HideCrosshair ();
if (RemoveSelected ())
SetChangedFlag (true);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -3687,7 +3687,7 @@ ActionRipUp (int argc, char **argv, int x, int y)
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_All:
@@ -3770,7 +3770,7 @@ ActionRipUp (int argc, char **argv, int x, int y)
}
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -3811,7 +3811,7 @@ ActionAddRats (int argc, char **argv, int x, int y)
{
if (Settings.RatWarn)
ClearWarnings ();
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_AllRats:
@@ -3851,7 +3851,7 @@ ActionAddRats (int argc, char **argv, int x, int y)
}
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -3883,7 +3883,7 @@ ActionDelete (int argc, char **argv, int x, int y)
id = F_Object;
}
- HideCrosshair (true);
+ HideCrosshair ();
switch (id)
{
case F_Object:
@@ -3905,7 +3905,7 @@ ActionDelete (int argc, char **argv, int x, int y)
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -3928,7 +3928,7 @@ ActionDeleteRats (int argc, char **argv, int x, int y)
{
if (Settings.RatWarn)
ClearWarnings ();
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_AllRats:
@@ -3941,7 +3941,7 @@ ActionDeleteRats (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -3966,10 +3966,10 @@ ActionAutoPlaceSelected (int argc, char **argv, int x, int y)
if (gui->confirm_dialog (_("Auto-placement can NOT be undone.\n"
"Do you want to continue anyway?\n"), 0))
{
- HideCrosshair (true);
+ HideCrosshair ();
if (AutoPlaceSelected ())
SetChangedFlag (true);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4010,7 +4010,7 @@ ActionAutoRoute (int argc, char **argv, int x, int y)
hid_action("Busy");
if (function) /* one parameter */
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_AllRats:
@@ -4023,7 +4023,7 @@ ActionAutoRoute (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4113,7 +4113,7 @@ ActionChangeSize (int argc, char **argv, int x, int y)
if (function && delta)
{
value = GetValue (delta, units, &absolute);
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Object:
@@ -4177,7 +4177,7 @@ ActionChangeSize (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4207,7 +4207,7 @@ ActionChange2ndSize (int argc, char **argv, int x, int y)
if (function && delta)
{
value = GetValue (delta, units, &absolute);
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Object:
@@ -4240,7 +4240,7 @@ ActionChange2ndSize (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4276,7 +4276,7 @@ ActionChangeClearSize (int argc, char **argv, int x, int y)
if (function && delta)
{
value = 2 * GetValue (delta, units, &absolute);
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Object:
@@ -4319,7 +4319,7 @@ ActionChangeClearSize (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4363,7 +4363,7 @@ ActionMinMaskGap (int argc, char **argv, int x, int y)
}
value = 2 * GetValue (delta, units, &absolute);
- HideCrosshair (true);
+ HideCrosshair ();
SaveUndoSerialNumber ();
ELEMENT_LOOP (PCB->Data);
{
@@ -4448,7 +4448,7 @@ ActionMinClearGap (int argc, char **argv, int x, int y)
}
value = 2 * GetValue (delta, units, &absolute);
- HideCrosshair (true);
+ HideCrosshair ();
SaveUndoSerialNumber ();
ELEMENT_LOOP (PCB->Data);
{
@@ -4642,7 +4642,7 @@ ActionChangeName (int argc, char **argv, int x, int y)
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
/* change the name of an object */
@@ -4704,7 +4704,7 @@ ActionChangeName (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4733,7 +4733,7 @@ ActionMorphPolygon (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Object:
@@ -4788,7 +4788,7 @@ ActionToggleHideName (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function && PCB->ElementOn)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Object:
@@ -4836,7 +4836,7 @@ ActionToggleHideName (int argc, char **argv, int x, int y)
}
}
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4865,7 +4865,7 @@ ActionChangeJoin (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -4899,7 +4899,7 @@ ActionChangeJoin (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4928,7 +4928,7 @@ ActionChangeSquare (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -4962,7 +4962,7 @@ ActionChangeSquare (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -4988,7 +4988,7 @@ ActionSetSquare (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function && *function)
{
- /* HideCrosshair (true); */
+ /* HideCrosshair (); */
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -5022,7 +5022,7 @@ ActionSetSquare (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- /* RestoreCrosshair (true); */
+ /* RestoreCrosshair (); */
}
return 0;
}
@@ -5049,7 +5049,7 @@ ActionClearSquare (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function && *function)
{
- /* HideCrosshair (true); */
+ /* HideCrosshair (); */
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -5083,7 +5083,7 @@ ActionClearSquare (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- /* RestoreCrosshair (true); */
+ /* RestoreCrosshair (); */
}
return 0;
}
@@ -5109,7 +5109,7 @@ ActionChangeOctagon (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- /* HideCrosshair (true); */
+ /* HideCrosshair (); */
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -5148,7 +5148,7 @@ ActionChangeOctagon (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- /* RestoreCrosshair (true); */
+ /* RestoreCrosshair (); */
}
return 0;
}
@@ -5172,7 +5172,7 @@ ActionSetOctagon (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- /* HideCrosshair (true); */
+ /* HideCrosshair (); */
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -5211,7 +5211,7 @@ ActionSetOctagon (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- /* RestoreCrosshair (true); */
+ /* RestoreCrosshair (); */
}
return 0;
}
@@ -5237,7 +5237,7 @@ ActionClearOctagon (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- /* HideCrosshair (true); */
+ /* HideCrosshair (); */
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -5276,7 +5276,7 @@ ActionClearOctagon (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- /* RestoreCrosshair (true); */
+ /* RestoreCrosshair (); */
}
return 0;
}
@@ -5301,7 +5301,7 @@ ActionChangeHole (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- /* HideCrosshair (true); */
+ /* HideCrosshair (); */
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -5324,7 +5324,7 @@ ActionChangeHole (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- /* RestoreCrosshair (true); */
+ /* RestoreCrosshair (); */
}
return 0;
}
@@ -5351,7 +5351,7 @@ ActionChangePaste (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- /* HideCrosshair (true); */
+ /* HideCrosshair (); */
switch (GetFunctionID (function))
{
case F_ToggleObject:
@@ -5374,7 +5374,7 @@ ActionChangePaste (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- /* RestoreCrosshair (true); */
+ /* RestoreCrosshair (); */
}
return 0;
}
@@ -5436,7 +5436,7 @@ ActionSelect (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
#if defined(HAVE_REGCOMP) || defined(HAVE_RE_COMP)
@@ -5555,11 +5555,11 @@ ActionSelect (int argc, char **argv, int x, int y)
break;
default:
- RestoreCrosshair (true);
+ RestoreCrosshair ();
AFAIL (select);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -5623,7 +5623,7 @@ ActionUnselect (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
#if defined(HAVE_REGCOMP) || defined(HAVE_RE_COMP)
@@ -5716,12 +5716,12 @@ ActionUnselect (int argc, char **argv, int x, int y)
break;
default:
- RestoreCrosshair (true);
+ RestoreCrosshair ();
AFAIL (unselect);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -5918,7 +5918,7 @@ ActionLoadFrom (int argc, char **argv, int x, int y)
function = argv[0];
name = argv[1];
- HideCrosshair (true);
+ HideCrosshair ();
if (strcasecmp (function, "ElementToBuffer") == 0)
{
@@ -5956,7 +5956,7 @@ ActionLoadFrom (int argc, char **argv, int x, int y)
LoadPCB (fname);
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -5977,7 +5977,7 @@ ActionNew (int argc, char **argv, int x, int y)
{
char *name = ARG (0);
- HideCrosshair (true);
+ HideCrosshair ();
if (!PCB->Changed || gui->confirm_dialog (_("OK to clear layout data?"), 0))
{
if (name)
@@ -5987,7 +5987,7 @@ ActionNew (int argc, char **argv, int x, int y)
if (!name)
{
- RestoreCrosshair(true);
+ RestoreCrosshair ();
return 1;
}
@@ -6012,10 +6012,10 @@ ActionNew (int argc, char **argv, int x, int y)
ClearAndRedrawOutput ();
hid_action ("PCBChanged");
- RestoreCrosshair(true);
+ RestoreCrosshair ();
return 0;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 1;
}
@@ -6100,7 +6100,7 @@ ActionPasteBuffer (int argc, char **argv, int x, int y)
static char *default_file = NULL;
int free_name = 0;
- HideCrosshair (true);
+ HideCrosshair ();
if (function)
{
switch (GetFunctionID (function))
@@ -6207,7 +6207,7 @@ ActionPasteBuffer (int argc, char **argv, int x, int y)
}
else
{
- RestoreCrosshair (true);
+ RestoreCrosshair ();
AFAIL (pastebuffer);
}
@@ -6230,7 +6230,7 @@ ActionPasteBuffer (int argc, char **argv, int x, int y)
}
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -6271,13 +6271,13 @@ ActionUndo (int argc, char **argv, int x, int y)
return 1;
/* undo the last operation */
- HideCrosshair (true);
+ HideCrosshair ();
if ((Settings.Mode == POLYGON_MODE ||
Settings.Mode == POLYGONHOLE_MODE) &&
Crosshair.AttachedPolygon.PointN)
{
GoToPreviousPoint ();
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
/* move anchor point if undoing during line creation */
@@ -6289,7 +6289,7 @@ ActionUndo (int argc, char **argv, int x, int y)
Undo (true); /* undo the connection find */
Crosshair.AttachedLine.State = STATE_FIRST;
SetLocalRef (0, 0, false);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
if (Crosshair.AttachedLine.State == STATE_THIRD)
@@ -6317,7 +6317,7 @@ ActionUndo (int argc, char **argv, int x, int y)
Crosshair.AttachedLine.Point1.X;
Crosshair.AttachedLine.Point2.Y =
Crosshair.AttachedLine.Point1.Y;
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
/* move to new anchor */
@@ -6364,7 +6364,7 @@ ActionUndo (int argc, char **argv, int x, int y)
ptr2 = (LineTypePtr) ptrtmp;
lastLayer = (LayerTypePtr) ptr1;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
}
@@ -6373,7 +6373,7 @@ ActionUndo (int argc, char **argv, int x, int y)
if (Crosshair.AttachedBox.State == STATE_SECOND)
{
Crosshair.AttachedBox.State = STATE_FIRST;
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
if (Crosshair.AttachedBox.State == STATE_THIRD)
@@ -6408,7 +6408,7 @@ ActionUndo (int argc, char **argv, int x, int y)
break;
}
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -6441,7 +6441,7 @@ ActionRedo (int argc, char **argv, int x, int y)
Crosshair.AttachedPolygon.PointN) ||
Crosshair.AttachedLine.State == STATE_SECOND)
return 1;
- HideCrosshair (true);
+ HideCrosshair ();
if (Redo (true))
{
SetChangedFlag (true);
@@ -6456,7 +6456,7 @@ ActionRedo (int argc, char **argv, int x, int y)
addedLines++;
}
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
return 0;
}
@@ -6490,7 +6490,7 @@ ActionPolygon (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function && Settings.Mode == POLYGON_MODE)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
/* close open polygon if possible */
@@ -6503,7 +6503,7 @@ ActionPolygon (int argc, char **argv, int x, int y)
GoToPreviousPoint ();
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -6615,7 +6615,7 @@ ActionMoveToCurrentLayer (int argc, char **argv, int x, int y)
char *function = ARG (0);
if (function)
{
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (function))
{
case F_Object:
@@ -6638,7 +6638,7 @@ ActionMoveToCurrentLayer (int argc, char **argv, int x, int y)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
return 0;
}
@@ -6669,24 +6669,24 @@ ActionSetSame (int argc, char **argv, int x, int y)
switch (type)
{
case LINE_TYPE:
- HideCrosshair (true);
+ HideCrosshair ();
Settings.LineThickness = ((LineTypePtr) ptr2)->Thickness;
Settings.Keepaway = ((LineTypePtr) ptr2)->Clearance / 2;
layer = (LayerTypePtr) ptr1;
if (Settings.Mode != LINE_MODE)
SetMode (LINE_MODE);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
hid_action ("RouteStylesChanged");
break;
case ARC_TYPE:
- HideCrosshair (true);
+ HideCrosshair ();
Settings.LineThickness = ((ArcTypePtr) ptr2)->Thickness;
Settings.Keepaway = ((ArcTypePtr) ptr2)->Clearance / 2;
layer = (LayerTypePtr) ptr1;
if (Settings.Mode != ARC_MODE)
SetMode (ARC_MODE);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
hid_action ("RouteStylesChanged");
break;
@@ -6695,13 +6695,13 @@ ActionSetSame (int argc, char **argv, int x, int y)
break;
case VIA_TYPE:
- HideCrosshair (true);
+ HideCrosshair ();
Settings.ViaThickness = ((PinTypePtr) ptr2)->Thickness;
Settings.ViaDrillingHole = ((PinTypePtr) ptr2)->DrillingHole;
Settings.Keepaway = ((PinTypePtr) ptr2)->Clearance / 2;
if (Settings.Mode != VIA_MODE)
SetMode (VIA_MODE);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
hid_action ("RouteStylesChanged");
break;
@@ -6843,7 +6843,7 @@ ChangeFlag (char *what, char *flag_name, int value, char *cmd_name)
return;
}
- HideCrosshair (true);
+ HideCrosshair ();
switch (GetFunctionID (what))
{
case F_Object:
@@ -6902,7 +6902,7 @@ ChangeFlag (char *what, char *flag_name, int value, char *cmd_name)
SetChangedFlag (true);
break;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
diff --git a/src/buffer.c b/src/buffer.c
index 110914c..908b21e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -526,7 +526,7 @@ AddSelectedToBuffer (BufferTypePtr Buffer, LocationType X, LocationType Y,
*/
if (!LeaveSelected)
ExtraFlag = SELECTEDFLAG;
- HideCrosshair (true);
+ HideCrosshair ();
Source = PCB->Data;
Dest = Buffer->Data;
SelectedOperation (&AddBufferFunctions, false, ALL_TYPES);
@@ -542,7 +542,7 @@ AddSelectedToBuffer (BufferTypePtr Buffer, LocationType X, LocationType Y,
Buffer->X = Crosshair.X;
Buffer->Y = Crosshair.Y;
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
ExtraFlag = 0;
}
@@ -1452,7 +1452,7 @@ ActionFreeRotateBuffer(int argc, char **argv, int x, int y)
{
char *angle_s;
- HideCrosshair(false);
+ HideCrosshair ();
if (argc < 1)
angle_s = gui->prompt_for ("Enter Rotation (degrees, CCW):", "0");
@@ -1460,7 +1460,7 @@ ActionFreeRotateBuffer(int argc, char **argv, int x, int y)
angle_s = argv[0];
FreeRotateBuffer(PASTEBUFFER, strtod(angle_s, 0));
- RestoreCrosshair(false);
+ RestoreCrosshair ();
return 0;
}
diff --git a/src/crosshair.c b/src/crosshair.c
index 0ab59a4..296f999 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -85,7 +85,6 @@ static void XORDrawMoveOrCopyObject (void);
static void XORDrawAttachedLine (LocationType, LocationType, LocationType,
LocationType, BDimension);
static void XORDrawAttachedArc (BDimension);
-static void DrawAttached (bool);
/* ---------------------------------------------------------------------------
* creates a tmp polygon with coordinates converted to screen system
@@ -567,7 +566,7 @@ XORDrawMoveOrCopyObject (void)
* draws additional stuff that follows the crosshair
*/
static void
-DrawAttached (bool BlockToo)
+DrawAttached (void)
{
BDimension s;
switch (Settings.Mode)
@@ -673,7 +672,7 @@ DrawAttached (bool BlockToo)
/* an attached box does not depend on a special mode */
if (Crosshair.AttachedBox.State == STATE_SECOND ||
- (BlockToo && Crosshair.AttachedBox.State == STATE_THIRD))
+ Crosshair.AttachedBox.State == STATE_THIRD)
{
LocationType x1, y1, x2, y2;
@@ -689,12 +688,12 @@ DrawAttached (bool BlockToo)
* switches crosshair on
*/
void
-CrosshairOn (bool BlockToo)
+CrosshairOn (void)
{
if (!Crosshair.On)
{
Crosshair.On = true;
- DrawAttached (BlockToo);
+ DrawAttached ();
DrawMark ();
}
}
@@ -703,12 +702,12 @@ CrosshairOn (bool BlockToo)
* switches crosshair off
*/
void
-CrosshairOff (bool BlockToo)
+CrosshairOff (void)
{
if (Crosshair.On)
{
Crosshair.On = false;
- DrawAttached (BlockToo);
+ DrawAttached ();
DrawMark ();
}
}
@@ -726,9 +725,9 @@ CrosshairOff (bool BlockToo)
* saves crosshair state (on/off) and hides him
*/
void
-HideCrosshair (bool BlockToo)
+HideCrosshair ()
{
- /* fprintf(stderr, "HideCrosshair %d stack %d\n", BlockToo ? 1 : 0, CrosshairStackLocation); */
+ /* fprintf(stderr, "HideCrosshair stack %d\n", CrosshairStackLocation); */
if (CrosshairStackLocation >= MAX_CROSSHAIRSTACK_DEPTH)
{
fprintf(stderr, "Error: CrosshairStackLocation overflow\n");
@@ -738,16 +737,16 @@ HideCrosshair (bool BlockToo)
CrosshairStack[CrosshairStackLocation] = Crosshair.On;
CrosshairStackLocation++;
- CrosshairOff (BlockToo);
+ CrosshairOff ();
}
/* ---------------------------------------------------------------------------
* restores last crosshair state
*/
void
-RestoreCrosshair (bool BlockToo)
+RestoreCrosshair (void)
{
- /* fprintf(stderr, "RestoreCrosshair %d stack %d\n", BlockToo ? 1 : 0, CrosshairStackLocation); */
+ /* fprintf(stderr, "RestoreCrosshair stack %d\n", CrosshairStackLocation); */
if (CrosshairStackLocation <= 0)
{
fprintf(stderr, "Error: CrosshairStackLocation underflow\n");
@@ -757,13 +756,9 @@ RestoreCrosshair (bool BlockToo)
CrosshairStackLocation--;
if (CrosshairStack[CrosshairStackLocation])
- {
- CrosshairOn (BlockToo);
- }
+ CrosshairOn ();
else
- {
- CrosshairOff (BlockToo);
- }
+ CrosshairOff ();
}
static double
@@ -1075,7 +1070,7 @@ MoveCrosshairAbsolute (LocationType X, LocationType Y)
x = z;
z = Crosshair.Y;
Crosshair.Y = y;
- HideCrosshair (false);
+ HideCrosshair ();
/* now move forward again */
Crosshair.X = x;
Crosshair.Y = z;
@@ -1158,7 +1153,7 @@ InitCrosshair (void)
void
DestroyCrosshair (void)
{
- CrosshairOff (true);
+ CrosshairOff ();
FreePolygonMemory (&Crosshair.AttachedPolygon);
gui->destroy_gc (Crosshair.GC);
}
diff --git a/src/crosshair.h b/src/crosshair.h
index b07af6f..4573e98 100644
--- a/src/crosshair.h
+++ b/src/crosshair.h
@@ -47,10 +47,10 @@
#define STATE_THIRD 2
-void CrosshairOn (bool);
-void CrosshairOff (bool);
-void HideCrosshair (bool);
-void RestoreCrosshair (bool);
+void CrosshairOn (void);
+void CrosshairOff (void);
+void HideCrosshair (void);
+void RestoreCrosshair (void);
void MoveCrosshairRelative (LocationType, LocationType);
bool MoveCrosshairAbsolute (LocationType, LocationType);
void SetCrosshairRange (LocationType, LocationType, LocationType,
diff --git a/src/draw.c b/src/draw.c
index e5a4d14..36bf1b9 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -186,13 +186,13 @@ UpdateAll (void)
void
Draw (void)
{
- HideCrosshair (true);
+ HideCrosshair ();
/* clear and create event if not drawing to a pixmap
*/
gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
/* shrink the update block */
Block.X1 = Block.Y1 = Block.X2 = Block.Y2 = 0;
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 76e7659..2ebb1a2 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -771,7 +771,7 @@ ghid_invalidate_all ()
hid_expose_callback (&ghid_hid, ®ion, 0);
ghid_draw_grid ();
if (ghidgui->need_restore_crosshair)
- RestoreCrosshair (FALSE);
+ RestoreCrosshair ();
ghidgui->need_restore_crosshair = FALSE;
ghid_screen_update ();
}
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 28c10bc..266cf06 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -1900,11 +1900,11 @@ ScrollAction (int argc, char **argv, int x, int y)
else
AFAIL (scroll);
- HideCrosshair (FALSE);
+ HideCrosshair ();
ghid_port_ranges_pan (dx, dy, TRUE);
MoveCrosshairRelative (dx, dy);
AdjustAttachedObjects ();
- RestoreCrosshair (FALSE);
+ RestoreCrosshair ();
return 0;
}
diff --git a/src/hid/gtk/gui-command-window.c b/src/hid/gtk/gui-command-window.c
index d865dee..28877fd 100644
--- a/src/hid/gtk/gui-command-window.c
+++ b/src/hid/gtk/gui-command-window.c
@@ -211,9 +211,9 @@ command_entry_activate_cb (GtkWidget * widget, gpointer data)
if (ghidgui->use_command_window)
{
- HideCrosshair (true);
+ HideCrosshair ();
hid_parse_command (command);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
g_free (command);
}
else
@@ -462,7 +462,7 @@ ghid_handle_user_command (gboolean raise)
ghid_command_window_show (raise);
else
{
- HideCrosshair (true);
+ HideCrosshair ();
command = ghid_command_entry_get (_("Enter command:"),
(Settings.SaveLastCommand && previous) ? previous : (gchar *)"");
if (command != NULL)
@@ -479,7 +479,7 @@ ghid_handle_user_command (gboolean raise)
hid_parse_command (command);
g_free (command);
}
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
ghid_window_set_name_label (PCB->Name);
ghid_set_status_line_label ();
diff --git a/src/hid/gtk/gui-misc.c b/src/hid/gtk/gui-misc.c
index b619dd0..8bda96d 100644
--- a/src/hid/gtk/gui-misc.c
+++ b/src/hid/gtk/gui-misc.c
@@ -403,12 +403,12 @@ run_get_location_loop (const gchar * message)
oldObjState = Crosshair.AttachedObject.State;
oldLineState = Crosshair.AttachedLine.State;
oldBoxState = Crosshair.AttachedBox.State;
- HideCrosshair (true);
+ HideCrosshair ();
Crosshair.AttachedObject.State = STATE_FIRST;
Crosshair.AttachedLine.State = STATE_FIRST;
Crosshair.AttachedBox.State = STATE_FIRST;
ghid_hand_cursor ();
- RestoreCrosshair (true);
+ RestoreCrosshair ();
/* Stop the top level GMainLoop from getting user input from keyboard
| and mouse so we can install our own handlers here. Also set the
@@ -439,11 +439,11 @@ run_get_location_loop (const gchar * message)
ghid_interface_input_signals_connect (); /* return to normal */
ghid_interface_set_sensitive (TRUE);
- HideCrosshair (true);
+ HideCrosshair ();
Crosshair.AttachedObject.State = oldObjState;
Crosshair.AttachedLine.State = oldLineState;
Crosshair.AttachedBox.State = oldBoxState;
- RestoreCrosshair (true);
+ RestoreCrosshair ();
ghid_restore_cursor ();
ghid_set_status_line_label ();
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 3b543cb..c71af06 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -59,7 +59,7 @@ ghid_port_ranges_changed (void)
GtkAdjustment *h_adj, *v_adj;
if (!ghidgui->combine_adjustments)
- HideCrosshair (FALSE);
+ HideCrosshair ();
if (ghidgui->combine_adjustments)
{
ghidgui->combine_adjustments = FALSE;
@@ -241,7 +241,7 @@ ghid_note_event_location (GdkEventButton * ev)
if (moved)
{
AdjustAttachedObjects ();
- RestoreCrosshair (false);
+ RestoreCrosshair ();
}
ghid_set_cursor_position_labels ();
return moved;
@@ -311,10 +311,10 @@ ghid_port_key_release_cb (GtkWidget * drawing_area, GdkEventKey * kev,
if (ghid_is_modifier_key_sym (ksym))
ghid_note_event_location (NULL);
- HideCrosshair (TRUE);
+ HideCrosshair ();
AdjustAttachedObjects ();
ghid_invalidate_all ();
- RestoreCrosshair (TRUE);
+ RestoreCrosshair ();
ghid_screen_update ();
g_idle_add (ghid_idle_cb, NULL);
return FALSE;
@@ -453,12 +453,12 @@ ghid_port_button_press_cb (GtkWidget * drawing_area,
state = (GdkModifierType) (ev->state);
mk = ghid_modifier_keys_state (&state);
ghid_show_crosshair (FALSE);
- HideCrosshair (TRUE);
+ HideCrosshair ();
do_mouse_action(ev->button, mk);
ghid_invalidate_all ();
- RestoreCrosshair (TRUE);
+ RestoreCrosshair ();
ghid_window_set_name_label (PCB->Name);
ghid_set_status_line_label ();
ghid_show_crosshair (TRUE);
@@ -479,13 +479,13 @@ ghid_port_button_release_cb (GtkWidget * drawing_area,
state = (GdkModifierType) (ev->state);
mk = ghid_modifier_keys_state (&state);
- HideCrosshair (TRUE);
+ HideCrosshair ();
do_mouse_action(ev->button, mk + M_Release);
AdjustAttachedObjects ();
ghid_invalidate_all ();
- RestoreCrosshair (TRUE);
+ RestoreCrosshair ();
ghid_screen_update ();
ghid_window_set_name_label (PCB->Name);
@@ -502,7 +502,7 @@ ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
{
static gboolean first_time_done;
- HideCrosshair (TRUE);
+ HideCrosshair ();
gport->width = ev->width;
gport->height = ev->height;
@@ -536,7 +536,7 @@ ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
ghid_port_ranges_scale (FALSE);
ghid_invalidate_all ();
- RestoreCrosshair (TRUE);
+ RestoreCrosshair ();
return 0;
}
@@ -733,7 +733,7 @@ ghid_port_window_enter_cb (GtkWidget * widget,
{
ghid_screen_update ();
}
- CrosshairOn (TRUE);
+ CrosshairOn ();
return FALSE;
}
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 2098c27..074ef9b 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -656,10 +656,10 @@ ghid_menu_cb (GtkAction * action, gpointer data)
*/
if (ghidgui->toggle_holdoff == FALSE)
{
- HideCrosshair (TRUE);
+ HideCrosshair ();
AdjustAttachedObjects ();
ghid_invalidate_all ();
- RestoreCrosshair (TRUE);
+ RestoreCrosshair ();
ghid_screen_update ();
ghid_window_set_name_label (PCB->Name);
ghid_set_status_line_label ();
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 1f5b7b0..2f00577 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -1311,12 +1311,12 @@ mod_changed (XKeyEvent * e, int set)
return;
}
in_move_event = 1;
- HideCrosshair (1);
+ HideCrosshair ();
if (panning)
Pan (2, e->x, e->y);
EventMoveCrosshair (Px (e->x), Py (e->y));
AdjustAttachedObjects ();
- RestoreCrosshair (1);
+ RestoreCrosshair ();
in_move_event = 0;
}
@@ -1352,7 +1352,7 @@ work_area_input (Widget w, XtPointer v, XEvent * e, Boolean * ctd)
}
ignore_release = 0;
- HideCrosshair (true);
+ HideCrosshair ();
pressed_button = e->xbutton.button;
mods = ((e->xbutton.state & ShiftMask) ? M_Shift : 0)
+ ((e->xbutton.state & ControlMask) ? M_Ctrl : 0)
@@ -1362,7 +1362,7 @@ work_area_input (Widget w, XtPointer v, XEvent * e, Boolean * ctd)
+ ((e->xbutton.state & Mod1Mask) ? M_Alt : 0);
#endif
do_mouse_action(e->xbutton.button, mods);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
break;
}
@@ -1372,7 +1372,7 @@ work_area_input (Widget w, XtPointer v, XEvent * e, Boolean * ctd)
if (e->xbutton.button != pressed_button)
return;
lesstif_button_event (w, e);
- HideCrosshair (true);
+ HideCrosshair ();
pressed_button = 0;
mods = ((e->xbutton.state & ShiftMask) ? M_Shift : 0)
+ ((e->xbutton.state & ControlMask) ? M_Ctrl : 0)
@@ -1383,7 +1383,7 @@ work_area_input (Widget w, XtPointer v, XEvent * e, Boolean * ctd)
#endif
+ M_Release;
do_mouse_action (e->xbutton.button, mods);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
break;
}
@@ -1414,7 +1414,7 @@ work_area_input (Widget w, XtPointer v, XEvent * e, Boolean * ctd)
case LeaveNotify:
crosshair_in_window = 0;
- CrosshairOff (1);
+ CrosshairOff ();
need_idle_proc ();
break;
@@ -1422,7 +1422,7 @@ work_area_input (Widget w, XtPointer v, XEvent * e, Boolean * ctd)
crosshair_in_window = 1;
in_move_event = 1;
EventMoveCrosshair (Px (e->xcrossing.x), Py (e->xcrossing.y));
- CrosshairOn (1);
+ CrosshairOn ();
in_move_event = 0;
need_idle_proc ();
break;
@@ -2520,7 +2520,7 @@ idle_proc (XtPointer dummy)
XCopyArea (display, main_pixmap, window, my_gc, 0, 0, view_width,
view_height, 0, 0);
pixmap = window;
- CrosshairOn (0);
+ CrosshairOn ();
need_redraw = 0;
}
diff --git a/src/misc.c b/src/misc.c
index a8e08ea..a7704f4 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -661,7 +661,7 @@ CenterDisplay (LocationType X, LocationType Y, bool Delta)
{
if (MoveCrosshairAbsolute (X, Y))
{
- RestoreCrosshair(false);
+ RestoreCrosshair ();
}
}
gui->set_crosshair (Crosshair.X, Crosshair.Y, HID_SC_WARP_POINTER);
diff --git a/src/report.c b/src/report.c
index 9135e0d..c0a4ab0 100644
--- a/src/report.c
+++ b/src/report.c
@@ -515,11 +515,11 @@ ReportDialog (int argc, char **argv, int x, int y)
Message (_("Nothing found to report on\n"));
return 1;
}
- HideCrosshair (false);
+ HideCrosshair ();
/* create dialog box */
gui->report_dialog ("Report", &report[0]);
- RestoreCrosshair (false);
+ RestoreCrosshair ();
return 0;
}
@@ -560,9 +560,9 @@ ReportFoundPins (int argc, char **argv, int x, int y)
}
END_LOOP;
- HideCrosshair (false);
+ HideCrosshair ();
gui->report_dialog ("Report", list.Data);
- RestoreCrosshair (false);
+ RestoreCrosshair ();
return 0;
}
@@ -779,7 +779,7 @@ ReportNetLength (int argc, char **argv, int x, int y)
END_LOOP;
got_net_name:
- HideCrosshair (false);
+ HideCrosshair ();
{
int prec = Settings.grid_units_mm? 4: 2;
if (netname)
@@ -787,7 +787,7 @@ ReportNetLength (int argc, char **argv, int x, int y)
else
gui->log ("Net length: %.*f %s\n", prec, UNIT (length));
}
- RestoreCrosshair (false);
+ RestoreCrosshair ();
return 0;
}
/* ---------------------------------------------------------------------------
diff --git a/src/set.c b/src/set.c
index 188203a..17f7583 100644
--- a/src/set.c
+++ b/src/set.c
@@ -244,7 +244,7 @@ SetMode (int Mode)
if (recursing)
return;
recursing = true;
- HideCrosshair (true);
+ HideCrosshair ();
addedLines = 0;
Crosshair.AttachedObject.Type = NO_TYPE;
Crosshair.AttachedObject.State = STATE_FIRST;
@@ -314,7 +314,7 @@ SetMode (int Mode)
* may have changed
*/
MoveCrosshairRelative (0, 0);
- RestoreCrosshair (true);
+ RestoreCrosshair ();
}
void
@@ -342,20 +342,20 @@ SetLocalRef (LocationType X, LocationType Y, bool Showing)
if (Showing)
{
- HideCrosshair (true);
+ HideCrosshair ();
if (count == 0)
old = Marked;
Marked.X = X;
Marked.Y = Y;
Marked.status = true;
count++;
- RestoreCrosshair (false);
+ RestoreCrosshair ();
}
else if (count > 0)
{
- HideCrosshair (false);
+ HideCrosshair ();
count = 0;
Marked = old;
- RestoreCrosshair (false);
+ RestoreCrosshair ();
}
}
|
|
From: <gi...@gp...> - 2011-03-27 19:51:16
|
The branch, master has been updated
via ae2a8d395967ca92a4cfbc21d99ad26f5357ac26 (commit)
from 1b287d76e7c0ae608b243ab311049bd5210d9ad8 (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 | 8 ++++----
src/crosshair.c | 8 ++++----
src/crosshair.h | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit ae2a8d395967ca92a4cfbc21d99ad26f5357ac26
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove visibility overriding argument from DrawMark()
Because of the places it was used, we can gaurantee this doesn't
change any behaviour - the mark visibility status is always correct,
so doesn't need overriding.
:100644 100644 7493659... ad99e7a... M src/action.c
:100644 100644 77b372f... 0ab59a4... M src/crosshair.c
:100644 100644 8299778... b07af6f... M src/crosshair.h
=========
Changes
=========
commit ae2a8d395967ca92a4cfbc21d99ad26f5357ac26
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove visibility overriding argument from DrawMark()
Because of the places it was used, we can gaurantee this doesn't
change any behaviour - the mark visibility status is always correct,
so doesn't need overriding.
diff --git a/src/action.c b/src/action.c
index 7493659..ad99e7a 100644
--- a/src/action.c
+++ b/src/action.c
@@ -4058,7 +4058,7 @@ ActionMarkCrosshair (int argc, char **argv, int x, int y)
{
if (Marked.status)
{
- DrawMark (true);
+ DrawMark ();
Marked.status = false;
}
else
@@ -4066,16 +4066,16 @@ ActionMarkCrosshair (int argc, char **argv, int x, int y)
Marked.status = true;
Marked.X = Crosshair.X;
Marked.Y = Crosshair.Y;
- DrawMark (false);
+ DrawMark ();
}
}
else if (GetFunctionID (function) == F_Center)
{
- DrawMark (true);
+ DrawMark ();
Marked.status = true;
Marked.X = Crosshair.X;
Marked.Y = Crosshair.Y;
- DrawMark (false);
+ DrawMark ();
}
return 0;
}
diff --git a/src/crosshair.c b/src/crosshair.c
index 77b372f..0ab59a4 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -695,7 +695,7 @@ CrosshairOn (bool BlockToo)
{
Crosshair.On = true;
DrawAttached (BlockToo);
- DrawMark (true);
+ DrawMark ();
}
}
@@ -709,7 +709,7 @@ CrosshairOff (bool BlockToo)
{
Crosshair.On = false;
DrawAttached (BlockToo);
- DrawMark (true);
+ DrawMark ();
}
}
@@ -1105,9 +1105,9 @@ SetCrosshairRange (LocationType MinX, LocationType MinY, LocationType MaxX,
* if argument is true, draw only if it is visible, otherwise draw it regardless
*/
void
-DrawMark (bool ifvis)
+DrawMark (void)
{
- if (Marked.status || !ifvis)
+ if (Marked.status)
{
gui->draw_line (Crosshair.GC,
Marked.X - MARK_SIZE,
diff --git a/src/crosshair.h b/src/crosshair.h
index 8299778..b07af6f 100644
--- a/src/crosshair.h
+++ b/src/crosshair.h
@@ -57,7 +57,7 @@ void SetCrosshairRange (LocationType, LocationType, LocationType,
LocationType);
void InitCrosshair (void);
void DestroyCrosshair (void);
-void DrawMark (bool);
+void DrawMark (void);
void FitCrosshairIntoGrid (LocationType, LocationType);
#endif
|
|
From: <gi...@gp...> - 2011-03-27 16:50:26
|
The branch, master has been updated
via 1b287d76e7c0ae608b243ab311049bd5210d9ad8 (commit)
from 8bb43a767b7d743131e5db162eaf540c5628700c (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 | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 1b287d76e7c0ae608b243ab311049bd5210d9ad8
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: g_return_if_reached() for receipt of gui->use_mask(HID_MASK_BEFORE)
This means one less untranslated printf which is never hit. If for some
reason the core sends us one of these - logging a warning and continuing
is probably better than a hard abort()
:100644 100644 52d9990... 76e7659... M src/hid/gtk/gtkhid-gdk.c
=========
Changes
=========
commit 1b287d76e7c0ae608b243ab311049bd5210d9ad8
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: g_return_if_reached() for receipt of gui->use_mask(HID_MASK_BEFORE)
This means one less untranslated printf which is never hit. If for some
reason the core sends us one of these - logging a warning and continuing
is probably better than a hard abort()
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 52d9990..76e7659 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -270,8 +270,8 @@ ghid_use_mask (int use_it)
break;
case HID_MASK_BEFORE:
- printf ("gtk doesn't support mask_before!\n");
- abort ();
+ /* The HID asks not to receive this mask type, so warn if we get it */
+ g_return_if_reached ();
case HID_MASK_CLEAR:
if (!gport->mask)
|
|
From: <gi...@gp...> - 2011-03-27 15:10:24
|
The branch, master has been updated
via 8bb43a767b7d743131e5db162eaf540c5628700c (commit)
from b3a6c586ba01ac53b706717b0e024633831638ce (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
=================
Commit Messages
=================
commit 8bb43a767b7d743131e5db162eaf540c5628700c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Don't make GUI drawing calls to erase objects
Changing the colour here is unnecessary (as drawing is deferred).
Delete the gui->set_color() calls.
:100644 100644 c91a37e... e5a4d14... M src/draw.c
=========
Changes
=========
commit 8bb43a767b7d743131e5db162eaf540c5628700c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Don't make GUI drawing calls to erase objects
Changing the colour here is unnecessary (as drawing is deferred).
Delete the gui->set_color() calls.
diff --git a/src/draw.c b/src/draw.c
index c91a37e..e5a4d14 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -2086,7 +2086,6 @@ DrawElementPinsAndPads (ElementTypePtr Element, int unused)
void
EraseVia (PinTypePtr Via)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawPinOrViaLowLevel (Via, false);
if (TEST_FLAG (DISPLAYNAMEFLAG, Via))
DrawPinOrViaNameLowLevel (Via);
@@ -2098,7 +2097,6 @@ EraseVia (PinTypePtr Via)
void
EraseRat (RatTypePtr Rat)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
if (TEST_FLAG(VIAFLAG, Rat))
{
int w = Rat->Thickness;
@@ -2121,7 +2119,6 @@ EraseRat (RatTypePtr Rat)
void
EraseViaName (PinTypePtr Via)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawPinOrViaNameLowLevel (Via);
}
@@ -2131,7 +2128,6 @@ EraseViaName (PinTypePtr Via)
void
ErasePad (PadTypePtr Pad)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawPadLowLevel (Output.fgGC, Pad, false, false);
if (TEST_FLAG (DISPLAYNAMEFLAG, Pad))
DrawPadNameLowLevel (Pad);
@@ -2143,7 +2139,6 @@ ErasePad (PadTypePtr Pad)
void
ErasePadName (PadTypePtr Pad)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawPadNameLowLevel (Pad);
}
@@ -2153,7 +2148,6 @@ ErasePadName (PadTypePtr Pad)
void
ErasePin (PinTypePtr Pin)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawPinOrViaLowLevel (Pin, false);
if (TEST_FLAG (DISPLAYNAMEFLAG, Pin))
DrawPinOrViaNameLowLevel (Pin);
@@ -2165,7 +2159,6 @@ ErasePin (PinTypePtr Pin)
void
ErasePinName (PinTypePtr Pin)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawPinOrViaNameLowLevel (Pin);
}
@@ -2175,7 +2168,6 @@ ErasePinName (PinTypePtr Pin)
void
EraseLine (LineTypePtr Line)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawLineLowLevel (Line);
}
@@ -2187,7 +2179,6 @@ EraseArc (ArcTypePtr Arc)
{
if (!Arc->Thickness)
return;
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawArcLowLevel (Arc);
}
@@ -2198,7 +2189,6 @@ void
EraseText (LayerTypePtr Layer, TextTypePtr Text)
{
int min_silk_line;
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
if (Layer == & PCB->Data->SILKLAYER
|| Layer == & PCB->Data->BACKSILKLAYER)
min_silk_line = PCB->minSlk;
@@ -2213,7 +2203,6 @@ EraseText (LayerTypePtr Layer, TextTypePtr Text)
void
ErasePolygon (PolygonTypePtr Polygon)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawPolygonLowLevel (Polygon);
}
@@ -2223,8 +2212,6 @@ ErasePolygon (PolygonTypePtr Polygon)
void
EraseElement (ElementTypePtr Element)
{
- /* set color and draw lines, arcs, text and pins */
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
ELEMENTLINE_LOOP (Element);
{
DrawLineLowLevel (line);
@@ -2246,7 +2233,6 @@ EraseElement (ElementTypePtr Element)
void
EraseElementPinsAndPads (ElementTypePtr Element)
{
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
PIN_LOOP (Element);
{
DrawPinOrViaLowLevel (pin, false);
@@ -2271,7 +2257,6 @@ EraseElementName (ElementTypePtr Element)
{
if (TEST_FLAG (HIDENAMEFLAG, Element))
return;
- gui->set_color (Output.fgGC, Settings.BackgroundColor);
DrawTextLowLevel (&ELEMENT_TEXT (PCB, Element), PCB->minSlk);
}
|
|
From: <gi...@gp...> - 2011-03-27 01:31:09
|
The branch, master has been updated
via b3a6c586ba01ac53b706717b0e024633831638ce (commit)
from f691333a25c36913415006a4f668cc2af05b0090 (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 | 42 ++++++++++++++++++++++++++----------------
src/find.c | 4 ++--
2 files changed, 28 insertions(+), 18 deletions(-)
=================
Commit Messages
=================
commit b3a6c586ba01ac53b706717b0e024633831638ce
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Allow zero clearance pads and pins to touch polygons
This was already supported for vias, lets be consistent.
:100644 100644 95128d0... 21e2bd9... M src/change.c
:100644 100644 615659d... 5d2e92c... M src/find.c
=========
Changes
=========
commit b3a6c586ba01ac53b706717b0e024633831638ce
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Allow zero clearance pads and pins to touch polygons
This was already supported for vias, lets be consistent.
diff --git a/src/change.c b/src/change.c
index 95128d0..21e2bd9 100644
--- a/src/change.c
+++ b/src/change.c
@@ -531,7 +531,13 @@ ChangePinClearSize (ElementTypePtr Element, PinTypePtr Pin)
if (TEST_FLAG (LOCKFLAG, Pin))
return (NULL);
- value = MIN (MAX_LINESIZE, MAX (value, PCB->Bloat * 2 + 2));
+ value = MIN (MAX_LINESIZE, value);
+ if (value < 0)
+ value = 0;
+ if (Delta < 0 && value < PCB->Bloat * 2)
+ value = 0;
+ if ((Delta > 0 || Absolute) && value < PCB->Bloat * 2)
+ value = PCB->Bloat * 2 + 2;
if (Pin->Clearance == value)
return NULL;
RestoreToPolygon (PCB->Data, PIN_TYPE, Element, Pin);
@@ -586,21 +592,25 @@ ChangePadClearSize (ElementTypePtr Element, PadTypePtr Pad)
if (TEST_FLAG (LOCKFLAG, Pad))
return (NULL);
- value = MIN (MAX_LINESIZE, MAX (value, PCB->Bloat * 2 + 2));
- if (value <= MAX_PADSIZE && value >= MIN_PADSIZE && value != Pad->Clearance)
- {
- AddObjectToClearSizeUndoList (PAD_TYPE, Element, Pad, Pad);
- RestoreToPolygon (PCB->Data, PAD_TYPE, Element, Pad);
- ErasePad (Pad);
- r_delete_entry (PCB->Data->pad_tree, &Pad->BoundingBox);
- Pad->Clearance = value;
- /* SetElementBB updates all associated rtrees */
- SetElementBoundingBox (PCB->Data, Element, &PCB->Font);
- ClearFromPolygon (PCB->Data, PAD_TYPE, Element, Pad);
- DrawPad (Pad, 0);
- return (Pad);
- }
- return (NULL);
+ value = MIN (MAX_LINESIZE, value);
+ if (value < 0)
+ value = 0;
+ if (Delta < 0 && value < PCB->Bloat * 2)
+ value = 0;
+ if ((Delta > 0 || Absolute) && value < PCB->Bloat * 2)
+ value = PCB->Bloat * 2 + 2;
+ if (value == Pad->Clearance)
+ return NULL;
+ AddObjectToClearSizeUndoList (PAD_TYPE, Element, Pad, Pad);
+ RestoreToPolygon (PCB->Data, PAD_TYPE, Element, Pad);
+ ErasePad (Pad);
+ r_delete_entry (PCB->Data->pad_tree, &Pad->BoundingBox);
+ Pad->Clearance = value;
+ /* SetElementBB updates all associated rtrees */
+ SetElementBoundingBox (PCB->Data, Element, &PCB->Font);
+ ClearFromPolygon (PCB->Data, PAD_TYPE, Element, Pad);
+ DrawPad (Pad, 0);
+ return Pad;
}
/* ---------------------------------------------------------------------------
diff --git a/src/find.c b/src/find.c
index 615659d..5d2e92c 100644
--- a/src/find.c
+++ b/src/find.c
@@ -3823,7 +3823,7 @@ drc_callback (DataTypePtr data, LayerTypePtr layer, PolygonTypePtr polygon,
}
break;
case PAD_TYPE:
- if (pad->Clearance < 2 * PCB->Bloat)
+ if (pad->Clearance && pad->Clearance < 2 * PCB->Bloat)
if (IsPadInPolygon(pad,polygon))
{
AddObjectToFlagUndoList (type, ptr1, ptr2, ptr2);
@@ -3833,7 +3833,7 @@ drc_callback (DataTypePtr data, LayerTypePtr layer, PolygonTypePtr polygon,
}
break;
case PIN_TYPE:
- if (pin->Clearance < 2 * PCB->Bloat)
+ if (pin->Clearance && pin->Clearance < 2 * PCB->Bloat)
{
AddObjectToFlagUndoList (type, ptr1, ptr2, ptr2);
SET_FLAG (TheFlag, pin);
|
|
From: <gi...@gp...> - 2011-03-27 01:05:44
|
The branch, master has been updated
via f691333a25c36913415006a4f668cc2af05b0090 (commit)
via aa4931e9b2b2b9a217f47026a6d556d02d85ebb3 (commit)
from 55210469f88f6e070e67341fcfa7d9183223d721 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 50 ++++++++++++++++++++------------------------------
1 files changed, 20 insertions(+), 30 deletions(-)
=================
Commit Messages
=================
commit f691333a25c36913415006a4f668cc2af05b0090
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Fix mask drawing at high zooms (only draw the bit on-screen)
This probably papers over a bug in the GTK hid's fill_rect routine, as the
only reason this should fix anything is because it avoids coordinate overflow
at high zoom.
The GTK hid really ought to clip coords to the screen before transforming them
for rendering.
:100644 100644 252c157... c91a37e... M src/draw.c
commit aa4931e9b2b2b9a217f47026a6d556d02d85ebb3
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Tidy up mask drawing code
Since the gerber HID now supports putting the outline on various layers,
we can also safely remove the commented out code for doing that in draw.c
:100644 100644 18d0dce... 252c157... M src/draw.c
=========
Changes
=========
commit f691333a25c36913415006a4f668cc2af05b0090
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Fix mask drawing at high zooms (only draw the bit on-screen)
This probably papers over a bug in the GTK hid's fill_rect routine, as the
only reason this should fix anything is because it avoids coordinate overflow
at high zoom.
The GTK hid really ought to clip coords to the screen before transforming them
for rendering.
diff --git a/src/draw.c b/src/draw.c
index 252c157..c91a37e 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -735,7 +735,7 @@ DrawSilk (int new_swap, int layer, const BoxType * drawn_area)
static void
-DrawMaskBoardArea (int mask_type)
+DrawMaskBoardArea (int mask_type, BoxType *screen)
{
/* Skip the mask drawing if the GUI doesn't want this type */
if ((mask_type == HID_MASK_BEFORE && !gui->poly_before) ||
@@ -744,7 +744,11 @@ DrawMaskBoardArea (int mask_type)
gui->use_mask (mask_type);
gui->set_color (Output.fgGC, PCB->MaskColor);
- gui->fill_rect (Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ if (screen == NULL)
+ gui->fill_rect (Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ else
+ gui->fill_rect (Output.fgGC, screen->X1, screen->Y1,
+ screen->X2, screen->Y2);
}
/* ---------------------------------------------------------------------------
@@ -762,7 +766,7 @@ DrawMask (BoxType * screen)
gui->set_color (Output.pmGC, PCB->MaskColor);
else
{
- DrawMaskBoardArea (HID_MASK_BEFORE);
+ DrawMaskBoardArea (HID_MASK_BEFORE, screen);
gui->use_mask (HID_MASK_CLEAR);
}
@@ -774,7 +778,7 @@ DrawMask (BoxType * screen)
gui->set_color (Output.pmGC, "erase");
else
{
- DrawMaskBoardArea (HID_MASK_AFTER);
+ DrawMaskBoardArea (HID_MASK_AFTER, screen);
gui->use_mask (HID_MASK_OFF);
}
}
commit aa4931e9b2b2b9a217f47026a6d556d02d85ebb3
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
draw.c: Tidy up mask drawing code
Since the gerber HID now supports putting the outline on various layers,
we can also safely remove the commented out code for doing that in draw.c
diff --git a/src/draw.c b/src/draw.c
index 18d0dce..252c157 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -733,6 +733,20 @@ DrawSilk (int new_swap, int layer, const BoxType * drawn_area)
SWAP_IDENT = save_swap;
}
+
+static void
+DrawMaskBoardArea (int mask_type)
+{
+ /* Skip the mask drawing if the GUI doesn't want this type */
+ if ((mask_type == HID_MASK_BEFORE && !gui->poly_before) ||
+ (mask_type == HID_MASK_AFTER && !gui->poly_after))
+ return;
+
+ gui->use_mask (mask_type);
+ gui->set_color (Output.fgGC, PCB->MaskColor);
+ gui->fill_rect (Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+}
+
/* ---------------------------------------------------------------------------
* draws solder mask layer - this will cover nearly everything
*/
@@ -742,20 +756,13 @@ DrawMask (BoxType * screen)
struct pin_info info;
int thin = TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB);
- OutputType *out = &Output;
-
info.arg = true;
if (thin)
gui->set_color (Output.pmGC, PCB->MaskColor);
else
{
- if (gui->poly_before)
- {
- gui->use_mask (HID_MASK_BEFORE);
- gui->set_color (out->fgGC, PCB->MaskColor);
- gui->fill_rect (out->fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
- }
+ DrawMaskBoardArea (HID_MASK_BEFORE);
gui->use_mask (HID_MASK_CLEAR);
}
@@ -767,30 +774,9 @@ DrawMask (BoxType * screen)
gui->set_color (Output.pmGC, "erase");
else
{
- if (gui->poly_after)
- {
- gui->use_mask (HID_MASK_AFTER);
- gui->set_color (out->fgGC, PCB->MaskColor);
- gui->fill_rect (out->fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
- }
+ DrawMaskBoardArea (HID_MASK_AFTER);
gui->use_mask (HID_MASK_OFF);
}
-
-#if 0
- /* Some fabs want the board outline on the solder mask layer. If
- you need this, change the '0' above to '1', and the code below
- will copy the outline layer to the mask layers. */
- if (!gui->gui)
- {
- int i;
- for (i=PCB->Data->LayerN; i>=0; i--)
- {
- LayerTypePtr Layer = PCB->Data->Layer + i;
- if (strcmp (Layer->Name, "outline") == 0)
- DrawLayer (Layer, screen);
- }
- }
-#endif
}
static void
|
|
From: <gi...@gp...> - 2011-03-27 00:41:20
|
The branch, master has been updated
via 55210469f88f6e070e67341fcfa7d9183223d721 (commit)
from ea0558a0353948ea26bfb1eafd1b11db5d7fb2b0 (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 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 55210469f88f6e070e67341fcfa7d9183223d721
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Make benchmark() implementation suit multiple drawing models
Invalidate and process updates, rather than calling redraw directly.
This suits the coming GL renderer which will use an invalidate/expose
model.
:100644 100644 c77faaf... 28c10bc... M src/hid/gtk/gtkhid-main.c
=========
Changes
=========
commit 55210469f88f6e070e67341fcfa7d9183223d721
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Make benchmark() implementation suit multiple drawing models
Invalidate and process updates, rather than calling redraw directly.
This suits the coming GL renderer which will use an invalidate/expose
model.
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index c77faaf..28c10bc 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -1562,8 +1562,8 @@ Benchmark (int argc, char **argv, int x, int y)
time (&start);
do
{
- hid_expose_callback (&ghid_hid, ®ion, 0);
- gdk_display_sync (display);
+ ghid_invalidate_all ();
+ gdk_window_process_updates (gport->drawing_area->window, FALSE);
time (&end);
i++;
}
|
|
From: <gi...@gp...> - 2011-03-27 00:14:54
|
The branch, master has been updated
via ea0558a0353948ea26bfb1eafd1b11db5d7fb2b0 (commit)
via 332cb8ddc1cc032ac29c7d2b9a0051ccc228b6da (commit)
via 7accf3312d2a93162bbb4dbb6c7e972e8e8d2487 (commit)
from 30be45bbf73d23c6e274c2cad804fe5af076cbba (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 | 61 ++++++++++++++++++++++++++++++++++++++
src/hid/gtk/gtkhid-main.c | 45 ----------------------------
src/hid/gtk/gui-output-events.c | 7 ++++
src/hid/gtk/gui-pinout-preview.c | 21 +++++++++++++
src/hid/gtk/gui-top-window.c | 1 +
src/hid/gtk/gui.h | 4 ++
6 files changed, 94 insertions(+), 45 deletions(-)
=================
Commit Messages
=================
commit ea0558a0353948ea26bfb1eafd1b11db5d7fb2b0
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Move set_layer function into GDK specific code.
Not that this is particularly GDK specific, just that the GL
renderer hopefully coming soon needs to do some extra work.
:100644 100644 62e2333... 52d9990... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 169884e... c77faaf... M src/hid/gtk/gtkhid-main.c
:100644 100644 29c98f8... 97ebb1c... M src/hid/gtk/gui.h
commit 332cb8ddc1cc032ac29c7d2b9a0051ccc228b6da
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Add hooks to tell the render when we start/stop drawing
This is necessary if the renderer requires certain state to be configured
before its drawing calls can be operated.
:100644 100644 e8d3b73... 62e2333... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 10dd85b... 3b543cb... M src/hid/gtk/gui-output-events.c
:100644 100644 838b5fa... 29c98f8... M src/hid/gtk/gui.h
commit 7accf3312d2a93162bbb4dbb6c7e972e8e8d2487
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Add hooks for the renderer to initalise drawing widgets
:100644 100644 c8bac31... e8d3b73... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 5b8d20a... 6cd8069... M src/hid/gtk/gui-pinout-preview.c
:100644 100644 1808065... 2098c27... M src/hid/gtk/gui-top-window.c
:100644 100644 332239b... 838b5fa... M src/hid/gtk/gui.h
=========
Changes
=========
commit ea0558a0353948ea26bfb1eafd1b11db5d7fb2b0
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Move set_layer function into GDK specific code.
Not that this is particularly GDK specific, just that the GL
renderer hopefully coming soon needs to do some extra work.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 62e2333..52d9990 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -52,6 +52,51 @@ typedef struct hid_gc_struct
hid_gc_struct;
+int
+ghid_set_layer (const char *name, int group, int empty)
+{
+ int idx = group;
+ if (idx >= 0 && idx < max_group)
+ {
+ int n = PCB->LayerGroups.Number[group];
+ for (idx = 0; idx < n-1; idx ++)
+ {
+ int ni = PCB->LayerGroups.Entries[group][idx];
+ if (ni >= 0 && ni < max_copper_layer + 2
+ && PCB->Data->Layer[ni].On)
+ break;
+ }
+ idx = PCB->LayerGroups.Entries[group][idx];
+ }
+
+ if (idx >= 0 && idx < max_copper_layer + 2)
+ return /*pinout ? 1 : */ PCB->Data->Layer[idx].On;
+ if (idx < 0)
+ {
+ switch (SL_TYPE (idx))
+ {
+ case SL_INVISIBLE:
+ return /* pinout ? 0 : */ PCB->InvisibleObjectsOn;
+ case SL_MASK:
+ if (SL_MYSIDE (idx) /*&& !pinout */ )
+ return TEST_FLAG (SHOWMASKFLAG, PCB);
+ return 0;
+ case SL_SILK:
+ if (SL_MYSIDE (idx) /*|| pinout */ )
+ return PCB->ElementOn;
+ return 0;
+ case SL_ASSY:
+ return 0;
+ case SL_PDRILL:
+ case SL_UDRILL:
+ return 1;
+ case SL_RATS:
+ return PCB->RatOn;
+ }
+ }
+ return 0;
+}
+
void
ghid_destroy_gc (hidGC gc)
{
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 169884e..c77faaf 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -288,51 +288,6 @@ zoom_by (double factor, int x, int y)
/* ------------------------------------------------------------ */
-int
-ghid_set_layer (const char *name, int group, int empty)
-{
- int idx = group;
- if (idx >= 0 && idx < max_group)
- {
- int n = PCB->LayerGroups.Number[group];
- for (idx = 0; idx < n-1; idx ++)
- {
- int ni = PCB->LayerGroups.Entries[group][idx];
- if (ni >= 0 && ni < max_copper_layer + 2
- && PCB->Data->Layer[ni].On)
- break;
- }
- idx = PCB->LayerGroups.Entries[group][idx];
- }
-
- if (idx >= 0 && idx < max_copper_layer + 2)
- return /*pinout ? 1 : */ PCB->Data->Layer[idx].On;
- if (idx < 0)
- {
- switch (SL_TYPE (idx))
- {
- case SL_INVISIBLE:
- return /* pinout ? 0 : */ PCB->InvisibleObjectsOn;
- case SL_MASK:
- if (SL_MYSIDE (idx) /*&& !pinout */ )
- return TEST_FLAG (SHOWMASKFLAG, PCB);
- return 0;
- case SL_SILK:
- if (SL_MYSIDE (idx) /*|| pinout */ )
- return PCB->ElementOn;
- return 0;
- case SL_ASSY:
- return 0;
- case SL_PDRILL:
- case SL_UDRILL:
- return 1;
- case SL_RATS:
- return PCB->RatOn;
- }
- }
- return 0;
-}
-
void
ghid_calibrate (double xval, double yval)
{
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 29c98f8..97ebb1c 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -475,6 +475,7 @@ void ghid_logv (const char *fmt, va_list args);
void ghid_pinout_window_show (GHidPort * out, ElementTypePtr Element);
/* gtkhid-gdk.c */
+int ghid_set_layer (const char *name, int group, int empty);
hidGC ghid_make_gc (void);
void ghid_destroy_gc (hidGC);
void ghid_use_mask (int use_it);
commit 332cb8ddc1cc032ac29c7d2b9a0051ccc228b6da
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Add hooks to tell the render when we start/stop drawing
This is necessary if the renderer requires certain state to be configured
before its drawing calls can be operated.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index e8d3b73..62e2333 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -929,6 +929,17 @@ ghid_drawing_area_configure_hook (GHidPort *port)
}
}
+gboolean
+ghid_start_drawing (GHidPort *port)
+{
+ return TRUE;
+}
+
+void
+ghid_end_drawing (GHidPort *port)
+{
+}
+
void
ghid_screen_update (void)
{
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 10dd85b..3b543cb 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -671,8 +671,13 @@ ghid_port_window_motion_cb (GtkWidget * widget,
static gint x_prev = -1, y_prev = -1;
gboolean moved;
+
gdk_event_request_motions (ev);
+ if (!ghid_start_drawing (out))
+ return FALSE;
+
+
if (out->panning)
{
dx = gport->zoom * (x_prev - ev->x);
@@ -693,6 +698,8 @@ ghid_port_window_motion_cb (GtkWidget * widget,
ghid_show_crosshair (TRUE);
if (moved && have_crosshair_attachments ())
ghid_draw_area_update (gport, NULL);
+
+ ghid_end_drawing (out);
return FALSE;
}
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 838b5fa..29c98f8 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -497,6 +497,8 @@ void ghid_show_crosshair (gboolean show);
void ghid_init_renderer (int *, char ***, GHidPort *);
void ghid_init_drawing_widget (GtkWidget *widget, GHidPort *);
void ghid_drawing_area_configure_hook (GHidPort *port);
+gboolean ghid_start_drawing (GHidPort *port);
+void ghid_end_drawing (GHidPort *port);
void ghid_screen_update (void);
gboolean ghid_drawing_area_expose_cb (GtkWidget *, GdkEventExpose *,
GHidPort *);
commit 7accf3312d2a93162bbb4dbb6c7e972e8e8d2487
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Add hooks for the renderer to initalise drawing widgets
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index c8bac31..e8d3b73 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -902,6 +902,11 @@ ghid_init_renderer (int *argc, char ***argv, GHidPort *port)
}
void
+ghid_init_drawing_widget (GtkWidget *widget, GHidPort *port)
+{
+}
+
+void
ghid_drawing_area_configure_hook (GHidPort *port)
{
static int done_once = 0;
diff --git a/src/hid/gtk/gui-pinout-preview.c b/src/hid/gtk/gui-pinout-preview.c
index 5b8d20a..6cd8069 100644
--- a/src/hid/gtk/gui-pinout-preview.c
+++ b/src/hid/gtk/gui-pinout-preview.c
@@ -159,6 +159,26 @@ enum
static GObjectClass *ghid_pinout_preview_parent_class = NULL;
+/*! \brief GObject constructed
+ *
+ * \par Function Description
+ * Initialise the pinout preview object once it is constructed.
+ * Chain up in case the parent class wants to do anything too.
+ *
+ * \param [in] object The pinout preview object
+ */
+static void
+ghid_pinout_preview_constructed (GObject *object)
+{
+ /* chain up to the parent class */
+ if (G_OBJECT_CLASS (ghid_pinout_preview_parent_class)->constructed != NULL)
+ G_OBJECT_CLASS (ghid_pinout_preview_parent_class)->constructed (object);
+
+ ghid_init_drawing_widget (GTK_WIDGET (object), gport);
+}
+
+
+
/*! \brief GObject finalise handler
*
* \par Function Description
@@ -253,6 +273,7 @@ ghid_pinout_preview_class_init (GhidPinoutPreviewClass * klass)
gobject_class->finalize = ghid_pinout_preview_finalize;
gobject_class->set_property = ghid_pinout_preview_set_property;
gobject_class->get_property = ghid_pinout_preview_get_property;
+ gobject_class->constructed = ghid_pinout_preview_constructed;
gtk_widget_class->expose_event = ghid_pinout_preview_expose;
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 1808065..2098c27 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -2311,6 +2311,7 @@ ghid_build_pcb_top_window (void)
gtk_box_pack_start (GTK_BOX (hbox), viewport, TRUE, TRUE, 0);
gport->drawing_area = gtk_drawing_area_new ();
+ ghid_init_drawing_widget (gport->drawing_area, gport);
gtk_widget_add_events (gport->drawing_area, GDK_EXPOSURE_MASK
| GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 332239b..838b5fa 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -495,6 +495,7 @@ void ghid_invalidate_lr (int left, int right, int top, int bottom);
void ghid_invalidate_all ();
void ghid_show_crosshair (gboolean show);
void ghid_init_renderer (int *, char ***, GHidPort *);
+void ghid_init_drawing_widget (GtkWidget *widget, GHidPort *);
void ghid_drawing_area_configure_hook (GHidPort *port);
void ghid_screen_update (void);
gboolean ghid_drawing_area_expose_cb (GtkWidget *, GdkEventExpose *,
|
|
From: <gi...@gp...> - 2011-03-26 23:54:03
|
The branch, master has been updated
via 30be45bbf73d23c6e274c2cad804fe5af076cbba (commit)
from 7290072b18352863524554e1a826cd1ce1ad8804 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-top-window.c | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
=================
Commit Messages
=================
commit 30be45bbf73d23c6e274c2cad804fe5af076cbba
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove some unnecessary gtk_widget_realize() calls.
:100644 100644 dbc9808... 1808065... M src/hid/gtk/gui-top-window.c
=========
Changes
=========
commit 30be45bbf73d23c6e274c2cad804fe5af076cbba
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove some unnecessary gtk_widget_realize() calls.
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index dbc9808..1808065 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -2159,8 +2159,6 @@ destroy_chart_cb (GtkWidget * widget, GHidPort * port)
gtk_main_quit ();
}
-
-
/*
* Create the top_window contents. The config settings should be loaded
* before this is called.
@@ -2404,10 +2402,6 @@ ghid_build_pcb_top_window (void)
ghidgui->creating = FALSE;
gtk_widget_show_all (gport->top_window);
- gtk_widget_realize (vbox_main);
- gtk_widget_realize (hbox_middle);
- gtk_widget_realize (viewport);
- gtk_widget_realize (gport->drawing_area);
gdk_window_set_back_pixmap (gport->drawing_area->window, NULL, FALSE);
ghid_route_style_temp_buttons_hide ();
@@ -2723,7 +2717,6 @@ ghid_parse_arguments (int *argc, char ***argv)
if (Settings.AutoPlace)
gtk_widget_set_uposition (GTK_WIDGET (window), 10, 10);
- gtk_widget_realize (gport->top_window);
gtk_widget_show_all (gport->top_window);
ghidgui->creating = TRUE;
}
|
|
From: <gi...@gp...> - 2011-03-26 23:52:53
|
The branch, master has been updated
via 7290072b18352863524554e1a826cd1ce1ad8804 (commit)
from 94f89cd66dfe9057f1dd44f98ed85a9696c9bdb6 (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/gerber/gerber.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 7290072b18352863524554e1a826cd1ce1ad8804
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gerber: Remove unused variables outline_trace_size and absolute
Left over accidentally from commit 35b137c3e193471e07f0873dfb149cebd059dca2
:100644 100644 b7e99bb... 8f04180... M src/hid/gerber/gerber.c
=========
Changes
=========
commit 7290072b18352863524554e1a826cd1ce1ad8804
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gerber: Remove unused variables outline_trace_size and absolute
Left over accidentally from commit 35b137c3e193471e07f0873dfb149cebd059dca2
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index b7e99bb..8f04180 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -93,7 +93,6 @@ static int is_drill;
static int current_mask;
static int flash_drills;
static int copy_outline_mode;
-static int outline_trace_size;
static LayerTypePtr outline_layer;
enum ApertureShape
@@ -444,7 +443,6 @@ gerber_do_export (HID_Attr_Val * options)
static int saved_layer_stack[MAX_LAYER];
int save_ons[MAX_LAYER + 2];
FlagType save_thindraw;
- bool absolute;
save_thindraw = PCB->Flags;
CLEAR_FLAG(THINDRAWFLAG, PCB);
|
|
From: <gi...@gp...> - 2011-03-26 23:12:44
|
The branch, master has been updated
via 94f89cd66dfe9057f1dd44f98ed85a9696c9bdb6 (commit)
via 6f57d3afe66cffe900f547635ca8d332ff04d964 (commit)
from 35b137c3e193471e07f0873dfb149cebd059dca2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/Makefile.am | 1 -
src/hid/gtk/gtkhid-gdk.c | 300 ++++++++++++++++++++++++++++++++++----
src/hid/gtk/gui-output-events.c | 33 +----
src/hid/gtk/gui-pinout-preview.c | 60 --------
src/hid/gtk/gui-render-pixmap.c | 99 -------------
src/hid/gtk/gui-top-window.c | 4 +-
src/hid/gtk/gui.h | 23 ++--
7 files changed, 285 insertions(+), 235 deletions(-)
delete mode 100644 src/hid/gtk/gui-render-pixmap.c
=================
Commit Messages
=================
commit 94f89cd66dfe9057f1dd44f98ed85a9696c9bdb6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Create a private structure for the gdk render backend
This is in an effort to isolate some of its internals from the rest
of the GTK hid.
Also create a hook for configure events on the main drawing area to
allow the renderer to reconfigure its-self as necessary as the area
changes in size.
:100644 100644 5988a58... c8bac31... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 6929c8a... 10dd85b... M src/hid/gtk/gui-output-events.c
:100644 100644 36f8f43... dbc9808... M src/hid/gtk/gui-top-window.c
:100644 100644 cf45adf... 332239b... M src/hid/gtk/gui.h
commit 6f57d3afe66cffe900f547635ca8d332ff04d964
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Move more GDK specific routines to gtkhid-gdk.c
:100644 100644 34c672d... 1e4cf58... M src/Makefile.am
:100644 100644 6ea9f9b... 5988a58... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 349f91b... 6929c8a... M src/hid/gtk/gui-output-events.c
:100644 100644 fc69639... 5b8d20a... M src/hid/gtk/gui-pinout-preview.c
:100644 000000 b24e6c9... 0000000... D src/hid/gtk/gui-render-pixmap.c
:100644 100644 1fbba95... 36f8f43... M src/hid/gtk/gui-top-window.c
:100644 100644 df30955... cf45adf... M src/hid/gtk/gui.h
=========
Changes
=========
commit 94f89cd66dfe9057f1dd44f98ed85a9696c9bdb6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Create a private structure for the gdk render backend
This is in an effort to isolate some of its internals from the rest
of the GTK hid.
Also create a hook for configure events on the main drawing area to
allow the renderer to reconfigure its-self as necessary as the area
changes in size.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 5988a58..c8bac31 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -21,13 +21,21 @@ RCSID ("$Id$");
extern HID ghid_hid;
-/* Sets gport->u_gc to the "right" GC to use (wrt mask or window)
+/* Sets priv->u_gc to the "right" GC to use (wrt mask or window)
*/
#define USE_GC(gc) if (!use_gc(gc)) return
static int cur_mask = -1;
static int mask_seq = 0;
+typedef struct render_priv {
+ GdkGC *bg_gc;
+ GdkGC *offlimits_gc;
+ GdkGC *mask_gc;
+ GdkGC *u_gc;
+ GdkGC *grid_gc;
+} render_priv;
+
typedef struct hid_gc_struct
{
@@ -70,12 +78,13 @@ ghid_draw_grid (void)
static int npoints = 0;
int x1, y1, x2, y2, n, i;
double x, y;
+ render_priv *priv = gport->render_priv;
if (!Settings.DrawGrid)
return;
if (Vz (PCB->Grid) < MIN_GRID_DISTANCE)
return;
- if (!gport->grid_gc)
+ if (!priv->grid_gc)
{
if (gdk_color_parse (Settings.GridColor, &gport->grid_color))
{
@@ -84,9 +93,9 @@ ghid_draw_grid (void)
gport->grid_color.blue ^= gport->bg_color.blue;
gdk_color_alloc (gport->colormap, &gport->grid_color);
}
- gport->grid_gc = gdk_gc_new (gport->drawable);
- gdk_gc_set_function (gport->grid_gc, GDK_XOR);
- gdk_gc_set_foreground (gport->grid_gc, &gport->grid_color);
+ priv->grid_gc = gdk_gc_new (gport->drawable);
+ gdk_gc_set_function (priv->grid_gc, GDK_XOR);
+ gdk_gc_set_foreground (priv->grid_gc, &gport->grid_color);
}
x1 = GRIDFIT_X (SIDE_X (gport->view_x0), PCB->Grid);
y1 = GRIDFIT_Y (SIDE_Y (gport->view_y0), PCB->Grid);
@@ -132,7 +141,7 @@ ghid_draw_grid (void)
int vy = Vy (y);
for (i = 0; i < n; i++)
points[i].y = vy;
- gdk_draw_points (gport->drawable, gport->grid_gc, points, n);
+ gdk_draw_points (gport->drawable, priv->grid_gc, points, n);
}
}
@@ -144,6 +153,7 @@ ghid_draw_bg_image (void)
GdkInterpType interp_type;
gint x, y, w, h, w_src, h_src;
static gint w_scaled, h_scaled;
+ render_priv *priv = gport->render_priv;
if (!ghidgui->bg_pixbuf)
return;
@@ -171,12 +181,12 @@ ghid_draw_bg_image (void)
h_scaled = h;
}
if (pixbuf)
- gdk_pixbuf_render_to_drawable (pixbuf, gport->drawable, gport->bg_gc,
+ gdk_pixbuf_render_to_drawable (pixbuf, gport->drawable, priv->bg_gc,
x, y, 0, 0,
w - x, h - y, GDK_RGB_DITHER_NORMAL, 0, 0);
}
-#define WHICH_GC(gc) (cur_mask == HID_MASK_CLEAR ? gport->mask_gc : (gc)->gc)
+#define WHICH_GC(gc) (cur_mask == HID_MASK_CLEAR ? priv->mask_gc : (gc)->gc)
void
ghid_use_mask (int use_it)
@@ -184,6 +194,7 @@ ghid_use_mask (int use_it)
static int mask_seq_id = 0;
static GdkDrawable *old;
GdkColor color;
+ render_priv *priv = gport->render_priv;
if (use_it == HID_FLUSH_DRAW_Q)
{
@@ -222,16 +233,16 @@ ghid_use_mask (int use_it)
gport->mask = gdk_pixmap_new (0, gport->width, gport->height, 1);
gport->drawable = gport->mask;
mask_seq = 0;
- if (!gport->mask_gc)
+ if (!priv->mask_gc)
{
- gport->mask_gc = gdk_gc_new (gport->drawable);
+ priv->mask_gc = gdk_gc_new (gport->drawable);
}
color.pixel = 1;
- gdk_gc_set_foreground (gport->mask_gc, &color);
- gdk_draw_rectangle (gport->drawable, gport->mask_gc, TRUE, 0, 0,
+ gdk_gc_set_foreground (priv->mask_gc, &color);
+ gdk_draw_rectangle (gport->drawable, priv->mask_gc, TRUE, 0, 0,
gport->width, gport->height);
color.pixel = 0;
- gdk_gc_set_foreground (gport->mask_gc, &color);
+ gdk_gc_set_foreground (priv->mask_gc, &color);
break;
case HID_MASK_AFTER:
@@ -263,33 +274,37 @@ typedef struct
static void
set_special_grid_color (void)
{
+ render_priv *priv = gport->render_priv;
+
if (!gport->colormap)
return;
gport->grid_color.red ^= gport->bg_color.red;
gport->grid_color.green ^= gport->bg_color.green;
gport->grid_color.blue ^= gport->bg_color.blue;
gdk_color_alloc (gport->colormap, &gport->grid_color);
- if (gport->grid_gc)
- gdk_gc_set_foreground (gport->grid_gc, &gport->grid_color);
+ if (priv->grid_gc)
+ gdk_gc_set_foreground (priv->grid_gc, &gport->grid_color);
}
void
ghid_set_special_colors (HID_Attribute * ha)
{
+ render_priv *priv = gport->render_priv;
+
if (!ha->name || !ha->value)
return;
- if (!strcmp (ha->name, "background-color") && gport->bg_gc)
+ if (!strcmp (ha->name, "background-color") && priv->bg_gc)
{
ghid_map_color_string (*(char **) ha->value, &gport->bg_color);
- gdk_gc_set_foreground (gport->bg_gc, &gport->bg_color);
+ gdk_gc_set_foreground (priv->bg_gc, &gport->bg_color);
set_special_grid_color ();
}
- else if (!strcmp (ha->name, "off-limit-color") && gport->offlimits_gc)
+ else if (!strcmp (ha->name, "off-limit-color") && priv->offlimits_gc)
{
ghid_map_color_string (*(char **) ha->value, &gport->offlimits_color);
- gdk_gc_set_foreground (gport->offlimits_gc, &gport->offlimits_color);
+ gdk_gc_set_foreground (priv->offlimits_gc, &gport->offlimits_color);
}
- else if (!strcmp (ha->name, "grid-color") && gport->grid_gc)
+ else if (!strcmp (ha->name, "grid-color") && priv->grid_gc)
{
ghid_map_color_string (*(char **) ha->value, &gport->grid_color);
set_special_grid_color ();
@@ -370,6 +385,7 @@ ghid_set_color (hidGC gc, const char *name)
void
ghid_set_line_cap (hidGC gc, EndCapStyle style)
{
+ render_priv *priv = gport->render_priv;
switch (style)
{
@@ -393,6 +409,7 @@ ghid_set_line_cap (hidGC gc, EndCapStyle style)
void
ghid_set_line_width (hidGC gc, int width)
{
+ render_priv *priv = gport->render_priv;
gc->width = width;
if (gc->gc)
@@ -426,6 +443,7 @@ ghid_set_line_cap_angle (hidGC gc, int x1, int y1, int x2, int y2)
static int
use_gc (hidGC gc)
{
+ render_priv *priv = gport->render_priv;
if (gc->me_pointer != &ghid_hid)
{
@@ -451,7 +469,7 @@ use_gc (hidGC gc)
gdk_gc_set_clip_mask (gc->gc, NULL);
gc->mask_seq = mask_seq;
}
- gport->u_gc = WHICH_GC (gc);
+ priv->u_gc = WHICH_GC (gc);
return 1;
}
@@ -459,6 +477,7 @@ void
ghid_draw_line (hidGC gc, int x1, int y1, int x2, int y2)
{
double dx1, dy1, dx2, dy2;
+ render_priv *priv = gport->render_priv;
dx1 = Vx ((double) x1);
dy1 = Vy ((double) y1);
@@ -470,7 +489,7 @@ ghid_draw_line (hidGC gc, int x1, int y1, int x2, int y2)
return;
USE_GC (gc);
- gdk_draw_line (gport->drawable, gport->u_gc, dx1, dy1, dx2, dy2);
+ gdk_draw_line (gport->drawable, priv->u_gc, dx1, dy1, dx2, dy2);
}
void
@@ -479,6 +498,7 @@ ghid_draw_arc (hidGC gc, int cx, int cy,
{
gint vrx, vry;
gint w, h, radius;
+ render_priv *priv = gport->render_priv;
w = gport->width * gport->zoom;
h = gport->height * gport->zoom;
@@ -506,7 +526,7 @@ ghid_draw_arc (hidGC gc, int cx, int cy,
/* make sure we fall in the -180 to +180 range */
start_angle = (start_angle + 360 + 180) % 360 - 180;
- gdk_draw_arc (gport->drawable, gport->u_gc, 0,
+ gdk_draw_arc (gport->drawable, priv->u_gc, 0,
Vx (cx) - vrx, Vy (cy) - vry,
vrx * 2, vry * 2, (start_angle + 180) * 64, delta_angle * 64);
}
@@ -515,6 +535,7 @@ void
ghid_draw_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
gint w, h, lw;
+ render_priv *priv = gport->render_priv;
lw = gc->width;
w = gport->width * gport->zoom;
@@ -549,7 +570,7 @@ ghid_draw_rect (hidGC gc, int x1, int y1, int x2, int y2)
}
USE_GC (gc);
- gdk_draw_rectangle (gport->drawable, gport->u_gc, FALSE,
+ gdk_draw_rectangle (gport->drawable, priv->u_gc, FALSE,
x1, y1, x2 - x1 + 1, y2 - y1 + 1);
}
@@ -558,6 +579,7 @@ void
ghid_fill_circle (hidGC gc, int cx, int cy, int radius)
{
gint w, h, vr;
+ render_priv *priv = gport->render_priv;
w = gport->width * gport->zoom;
h = gport->height * gport->zoom;
@@ -569,7 +591,7 @@ ghid_fill_circle (hidGC gc, int cx, int cy, int radius)
USE_GC (gc);
vr = Vz (radius);
- gdk_draw_arc (gport->drawable, gport->u_gc, TRUE,
+ gdk_draw_arc (gport->drawable, priv->u_gc, TRUE,
Vx (cx) - vr, Vy (cy) - vr, vr * 2, vr * 2, 0, 360 * 64);
}
@@ -579,6 +601,7 @@ ghid_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
static GdkPoint *points = 0;
static int npoints = 0;
int i;
+ render_priv *priv = gport->render_priv;
USE_GC (gc);
if (npoints < n_coords)
@@ -591,13 +614,14 @@ ghid_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
points[i].x = Vx (x[i]);
points[i].y = Vy (y[i]);
}
- gdk_draw_polygon (gport->drawable, gport->u_gc, 1, points, n_coords);
+ gdk_draw_polygon (gport->drawable, priv->u_gc, 1, points, n_coords);
}
void
ghid_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
gint w, h, lw, xx, yy;
+ render_priv *priv = gport->render_priv;
lw = gc->width;
w = gport->width * gport->zoom;
@@ -630,7 +654,7 @@ ghid_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
y2 = yy;
}
USE_GC (gc);
- gdk_draw_rectangle (gport->drawable, gport->u_gc, TRUE,
+ gdk_draw_rectangle (gport->drawable, priv->u_gc, TRUE,
x1, y1, x2 - x1 + 1, y2 - y1 + 1);
}
@@ -645,6 +669,7 @@ ghid_invalidate_all ()
{
int eleft, eright, etop, ebottom;
BoxType region;
+ render_priv *priv = gport->render_priv;
if (!gport->pixmap)
return;
@@ -672,28 +697,28 @@ ghid_invalidate_all ()
}
if (eleft > 0)
- gdk_draw_rectangle (gport->drawable, gport->offlimits_gc,
+ gdk_draw_rectangle (gport->drawable, priv->offlimits_gc,
1, 0, 0, eleft, gport->height);
else
eleft = 0;
if (eright < gport->width)
- gdk_draw_rectangle (gport->drawable, gport->offlimits_gc,
+ gdk_draw_rectangle (gport->drawable, priv->offlimits_gc,
1, eright, 0, gport->width - eright, gport->height);
else
eright = gport->width;
if (etop > 0)
- gdk_draw_rectangle (gport->drawable, gport->offlimits_gc,
+ gdk_draw_rectangle (gport->drawable, priv->offlimits_gc,
1, eleft, 0, eright - eleft + 1, etop);
else
etop = 0;
if (ebottom < gport->height)
- gdk_draw_rectangle (gport->drawable, gport->offlimits_gc,
+ gdk_draw_rectangle (gport->drawable, priv->offlimits_gc,
1, eleft, ebottom, eright - eleft + 1,
gport->height - ebottom);
else
ebottom = gport->height;
- gdk_draw_rectangle (gport->drawable, gport->bg_gc, 1,
+ gdk_draw_rectangle (gport->drawable, priv->bg_gc, 1,
eleft, etop, eright - eleft + 1, ebottom - etop + 1);
ghid_draw_bg_image();
@@ -870,10 +895,42 @@ ghid_show_crosshair (gboolean show)
}
void
+ghid_init_renderer (int *argc, char ***argv, GHidPort *port)
+{
+ /* Init any GC's required */
+ port->render_priv = g_new0 (render_priv, 1);
+}
+
+void
+ghid_drawing_area_configure_hook (GHidPort *port)
+{
+ static int done_once = 0;
+ render_priv *priv = port->render_priv;
+
+ if (!done_once)
+ {
+ priv->bg_gc = gdk_gc_new (port->drawable);
+ gdk_gc_set_foreground (priv->bg_gc, &port->bg_color);
+
+ priv->offlimits_gc = gdk_gc_new (port->drawable);
+ gdk_gc_set_foreground (priv->offlimits_gc, &port->offlimits_color);
+ done_once = 1;
+ }
+
+ if (port->mask)
+ {
+ gdk_pixmap_unref (port->mask);
+ port->mask = gdk_pixmap_new (0, port->width, port->height, 1);
+ }
+}
+
+void
ghid_screen_update (void)
{
+ render_priv *priv = gport->render_priv;
+
ghid_show_crosshair (FALSE);
- gdk_draw_drawable (gport->drawing_area->window, gport->bg_gc, gport->pixmap,
+ gdk_draw_drawable (gport->drawing_area->window, priv->bg_gc, gport->pixmap,
0, 0, 0, 0, gport->width, gport->height);
ghid_show_crosshair (TRUE);
}
@@ -883,8 +940,10 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
GdkEventExpose *ev,
GHidPort *port)
{
+ render_priv *priv = port->render_priv;
+
ghid_show_crosshair (FALSE);
- gdk_draw_drawable (widget->window, port->bg_gc, port->pixmap,
+ gdk_draw_drawable (widget->window, priv->bg_gc, port->pixmap,
ev->area.x, ev->area.y, ev->area.x, ev->area.y,
ev->area.width, ev->area.height);
ghid_show_crosshair (TRUE);
@@ -903,6 +962,7 @@ ghid_pinout_preview_expose (GtkWidget *widget,
int save_width, save_height;
int save_view_width, save_view_height;
double xz, yz;
+ render_priv *priv = gport->render_priv;
save_zoom = gport->zoom;
save_width = gport->width;
@@ -933,7 +993,7 @@ ghid_pinout_preview_expose (GtkWidget *widget,
gport->view_y0 = (pinout->y_max - gport->view_height) / 2;
/* clear background */
- gdk_draw_rectangle (widget->window, gport->bg_gc, TRUE, 0, 0, da_w, da_h);
+ gdk_draw_rectangle (widget->window, priv->bg_gc, TRUE, 0, 0, da_w, da_h);
/* call the drawing routine */
hid_expose_callback (&ghid_hid, NULL, &pinout->element);
@@ -969,7 +1029,7 @@ ghid_pinout_preview_expose (GtkWidget *widget,
gport->view_y0 = (pinout->y_max - gport->view_height) / 2;
/* clear background */
- gdk_draw_rectangle (widget->window, gport->bg_gc, TRUE, 0, 0, da_w, da_h);
+ gdk_draw_rectangle (widget->window, priv->bg_gc, TRUE, 0, 0, da_w, da_h);
/* call the drawing routine */
hid_expose_callback (&ghid_hid, NULL, &pinout->element);
@@ -996,6 +1056,7 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
int save_width, save_height;
int save_view_width, save_view_height;
BoxType region;
+ render_priv *priv = gport->render_priv;
save_drawable = gport->drawable;
save_zoom = gport->zoom;
@@ -1023,7 +1084,7 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
gport->view_y0 -= gport->view_width / 2;
/* clear background */
- gdk_draw_rectangle (pixmap, gport->bg_gc, TRUE, 0, 0, width, height);
+ gdk_draw_rectangle (pixmap, priv->bg_gc, TRUE, 0, 0, width, height);
/* call the drawing routine */
region.X1 = MIN(Px(0), Px(gport->width + 1));
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 6929c8a..10dd85b 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -516,27 +516,24 @@ ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
if (!first_time_done)
{
gport->colormap = gtk_widget_get_colormap (gport->top_window);
- gport->bg_gc = gdk_gc_new (gport->drawable);
if (gdk_color_parse (Settings.BackgroundColor, &gport->bg_color))
gdk_color_alloc (gport->colormap, &gport->bg_color);
else
gdk_color_white (gport->colormap, &gport->bg_color);
- gdk_gc_set_foreground (gport->bg_gc, &gport->bg_color);
- gport->offlimits_gc = gdk_gc_new (gport->drawable);
if (gdk_color_parse (Settings.OffLimitColor, &gport->offlimits_color))
gdk_color_alloc (gport->colormap, &gport->offlimits_color);
else
gdk_color_white (gport->colormap, &gport->offlimits_color);
- gdk_gc_set_foreground (gport->offlimits_gc, &gport->offlimits_color);
first_time_done = TRUE;
+ ghid_drawing_area_configure_hook (out);
PCBChanged (0, NULL, 0, 0);
}
- if (gport->mask)
+ else
{
- gdk_pixmap_unref (gport->mask);
- gport->mask = gdk_pixmap_new (0, gport->width, gport->height, 1);
+ ghid_drawing_area_configure_hook (out);
}
+
ghid_port_ranges_scale (FALSE);
ghid_invalidate_all ();
RestoreCrosshair (TRUE);
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 36f8f43..dbc9808 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -2693,6 +2693,8 @@ ghid_parse_arguments (int *argc, char ***argv)
gport->zoom = 300.0;
pixel_slop = 300;
+ ghid_init_renderer (argc, argv, gport);
+
ghid_config_files_read (argc, argv);
Settings.AutoPlace = 0;
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index cf45adf..332239b 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -162,7 +162,7 @@ typedef struct
GdkDrawable *drawable; /* Current drawable for drawing routines */
gint width, height;
- GdkGC *bg_gc, *offlimits_gc, *mask_gc, *u_gc, *grid_gc;
+ struct render_priv *render_priv;
GdkColor bg_color, offlimits_color, grid_color;
@@ -494,6 +494,8 @@ void ghid_fill_rect (hidGC gc, int x1, int y1, int x2, int y2);
void ghid_invalidate_lr (int left, int right, int top, int bottom);
void ghid_invalidate_all ();
void ghid_show_crosshair (gboolean show);
+void ghid_init_renderer (int *, char ***, GHidPort *);
+void ghid_drawing_area_configure_hook (GHidPort *port);
void ghid_screen_update (void);
gboolean ghid_drawing_area_expose_cb (GtkWidget *, GdkEventExpose *,
GHidPort *);
commit 6f57d3afe66cffe900f547635ca8d332ff04d964
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Move more GDK specific routines to gtkhid-gdk.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 34c672d..1e4cf58 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -270,7 +270,6 @@ LIBGTK_SRCS = \
hid/gtk/gui-pinout-preview.c \
hid/gtk/gui-pinout-preview.h \
hid/gtk/gui-pinout-window.c \
- hid/gtk/gui-render-pixmap.c \
hid/gtk/gui-top-window.c \
hid/gtk/gui-utils.c
libgtk_a_SOURCES = ${LIBGTK_SRCS} hid/gtk/gtk_lists.h
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 6ea9f9b..5988a58 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -868,3 +868,178 @@ ghid_show_crosshair (gboolean show)
draw_markers_prev = FALSE;
}
}
+
+void
+ghid_screen_update (void)
+{
+ ghid_show_crosshair (FALSE);
+ gdk_draw_drawable (gport->drawing_area->window, gport->bg_gc, gport->pixmap,
+ 0, 0, 0, 0, gport->width, gport->height);
+ ghid_show_crosshair (TRUE);
+}
+
+gboolean
+ghid_drawing_area_expose_cb (GtkWidget *widget,
+ GdkEventExpose *ev,
+ GHidPort *port)
+{
+ ghid_show_crosshair (FALSE);
+ gdk_draw_drawable (widget->window, port->bg_gc, port->pixmap,
+ ev->area.x, ev->area.y, ev->area.x, ev->area.y,
+ ev->area.width, ev->area.height);
+ ghid_show_crosshair (TRUE);
+ return FALSE;
+}
+
+gboolean
+ghid_pinout_preview_expose (GtkWidget *widget,
+ GdkEventExpose *ev)
+{
+ GhidPinoutPreview *pinout = GHID_PINOUT_PREVIEW (widget);
+ GdkDrawable *save_drawable;
+ double save_zoom;
+ int da_w, da_h;
+ int save_left, save_top;
+ int save_width, save_height;
+ int save_view_width, save_view_height;
+ double xz, yz;
+
+ save_zoom = gport->zoom;
+ save_width = gport->width;
+ save_height = gport->height;
+ save_left = gport->view_x0;
+ save_top = gport->view_y0;
+ save_view_width = gport->view_width;
+ save_view_height = gport->view_height;
+
+ /* Setup drawable and zoom factor for drawing routines
+ */
+ save_drawable = gport->drawable;
+
+ gdk_window_get_geometry (widget->window, 0, 0, &da_w, &da_h, 0);
+ xz = (double) pinout->x_max / da_w;
+ yz = (double) pinout->y_max / da_h;
+ if (xz > yz)
+ gport->zoom = xz;
+ else
+ gport->zoom = yz;
+
+ gport->drawable = widget->window;
+ gport->width = da_w;
+ gport->height = da_h;
+ gport->view_width = da_w * gport->zoom;
+ gport->view_height = da_h * gport->zoom;
+ gport->view_x0 = (pinout->x_max - gport->view_width) / 2;
+ gport->view_y0 = (pinout->y_max - gport->view_height) / 2;
+
+ /* clear background */
+ gdk_draw_rectangle (widget->window, gport->bg_gc, TRUE, 0, 0, da_w, da_h);
+
+ /* call the drawing routine */
+ hid_expose_callback (&ghid_hid, NULL, &pinout->element);
+
+ gport->drawable = save_drawable;
+ gport->zoom = save_zoom;
+ gport->width = save_width;
+ gport->height = save_height;
+ gport->view_x0 = save_left;
+ gport->view_y0 = save_top;
+ save_top = gport->view_y0;
+ save_view_width = gport->view_width;
+ save_view_height = gport->view_height;
+
+ /* Setup drawable and zoom factor for drawing routines
+ */
+ save_drawable = gport->drawable;
+
+ gdk_window_get_geometry (widget->window, 0, 0, &da_w, &da_h, 0);
+ xz = (double) pinout->x_max / da_w;
+ yz = (double) pinout->y_max / da_h;
+ if (xz > yz)
+ gport->zoom = xz;
+ else
+ gport->zoom = yz;
+
+ gport->drawable = widget->window;
+ gport->width = da_w;
+ gport->height = da_h;
+ gport->view_width = da_w * gport->zoom;
+ gport->view_height = da_h * gport->zoom;
+ gport->view_x0 = (pinout->x_max - gport->view_width) / 2;
+ gport->view_y0 = (pinout->y_max - gport->view_height) / 2;
+
+ /* clear background */
+ gdk_draw_rectangle (widget->window, gport->bg_gc, TRUE, 0, 0, da_w, da_h);
+
+ /* call the drawing routine */
+ hid_expose_callback (&ghid_hid, NULL, &pinout->element);
+
+ gport->drawable = save_drawable;
+ gport->zoom = save_zoom;
+ gport->width = save_width;
+ gport->height = save_height;
+ gport->view_x0 = save_left;
+ gport->view_y0 = save_top;
+ gport->view_width = save_view_width;
+ gport->view_height = save_view_height;
+
+ return FALSE;
+}
+
+GdkPixmap *
+ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int depth)
+{
+ GdkPixmap *pixmap;
+ GdkDrawable *save_drawable;
+ double save_zoom;
+ int save_left, save_top;
+ int save_width, save_height;
+ int save_view_width, save_view_height;
+ BoxType region;
+
+ save_drawable = gport->drawable;
+ save_zoom = gport->zoom;
+ save_width = gport->width;
+ save_height = gport->height;
+ save_left = gport->view_x0;
+ save_top = gport->view_y0;
+ save_view_width = gport->view_width;
+ save_view_height = gport->view_height;
+
+ pixmap = gdk_pixmap_new (NULL, width, height, depth);
+
+ /* Setup drawable and zoom factor for drawing routines
+ */
+
+ gport->drawable = pixmap;
+ gport->zoom = zoom;
+ gport->width = width;
+ gport->height = height;
+ gport->view_width = width * gport->zoom;
+ gport->view_height = height * gport->zoom;
+ gport->view_x0 = ghid_flip_x ? PCB->MaxWidth - cx : cx;
+ gport->view_x0 -= gport->view_height / 2;
+ gport->view_y0 = ghid_flip_y ? PCB->MaxHeight - cy : cy;
+ gport->view_y0 -= gport->view_width / 2;
+
+ /* clear background */
+ gdk_draw_rectangle (pixmap, gport->bg_gc, TRUE, 0, 0, width, height);
+
+ /* call the drawing routine */
+ 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));
+ hid_expose_callback (&ghid_hid, ®ion, NULL);
+
+ gport->drawable = save_drawable;
+ gport->zoom = save_zoom;
+ gport->width = save_width;
+ gport->height = save_height;
+ gport->view_x0 = save_left;
+ gport->view_y0 = save_top;
+ gport->view_width = save_view_width;
+ gport->view_height = save_view_height;
+
+ return pixmap;
+}
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 349f91b..6929c8a 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -544,28 +544,6 @@ ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
}
-void
-ghid_screen_update (void)
-{
-
- ghid_show_crosshair (FALSE);
- gdk_draw_drawable (gport->drawing_area->window, gport->bg_gc, gport->pixmap,
- 0, 0, 0, 0, gport->width, gport->height);
- ghid_show_crosshair (TRUE);
-}
-
-gboolean
-ghid_port_drawing_area_expose_event_cb (GtkWidget * widget,
- GdkEventExpose * ev, GHidPort * port)
-{
- ghid_show_crosshair (FALSE);
- gdk_draw_drawable (widget->window, port->bg_gc, port->pixmap,
- ev->area.x, ev->area.y, ev->area.x, ev->area.y,
- ev->area.width, ev->area.height);
- ghid_show_crosshair (TRUE);
- return FALSE;
-}
-
#if GTK_CHECK_VERSION(2,12,0)
# define ENABLE_TOOLTIPS 1
#else
diff --git a/src/hid/gtk/gui-pinout-preview.c b/src/hid/gtk/gui-pinout-preview.c
index fc69639..5b8d20a 100644
--- a/src/hid/gtk/gui-pinout-preview.c
+++ b/src/hid/gtk/gui-pinout-preview.c
@@ -150,66 +150,6 @@ pinout_set_data (GhidPinoutPreview * pinout, ElementType * element)
}
-static gboolean
-ghid_pinout_preview_expose (GtkWidget * widget, GdkEventExpose * event)
-{
- extern HID ghid_hid;
- GhidPinoutPreview *pinout = GHID_PINOUT_PREVIEW (widget);
- GdkDrawable *save_drawable;
- double save_zoom;
- int da_w, da_h;
- int save_left, save_top;
- int save_width, save_height;
- int save_view_width, save_view_height;
- double xz, yz;
-
- save_zoom = gport->zoom;
- save_width = gport->width;
- save_height = gport->height;
- save_left = gport->view_x0;
- save_top = gport->view_y0;
- save_view_width = gport->view_width;
- save_view_height = gport->view_height;
-
- /* Setup drawable and zoom factor for drawing routines
- */
- save_drawable = gport->drawable;
-
- gdk_window_get_geometry (widget->window, 0, 0, &da_w, &da_h, 0);
- xz = (double) pinout->x_max / da_w;
- yz = (double) pinout->y_max / da_h;
- if (xz > yz)
- gport->zoom = xz;
- else
- gport->zoom = yz;
-
- gport->drawable = widget->window;
- gport->width = da_w;
- gport->height = da_h;
- gport->view_width = da_w * gport->zoom;
- gport->view_height = da_h * gport->zoom;
- gport->view_x0 = (pinout->x_max - gport->view_width) / 2;
- gport->view_y0 = (pinout->y_max - gport->view_height) / 2;
-
- /* clear background */
- gdk_draw_rectangle (widget->window, gport->bg_gc, TRUE, 0, 0, da_w, da_h);
-
- /* call the drawing routine */
- hid_expose_callback (&ghid_hid, NULL, &pinout->element);
-
- gport->drawable = save_drawable;
- gport->zoom = save_zoom;
- gport->width = save_width;
- gport->height = save_height;
- gport->view_x0 = save_left;
- gport->view_y0 = save_top;
- gport->view_width = save_view_width;
- gport->view_height = save_view_height;
-
- return FALSE;
-}
-
-
enum
{
PROP_ELEMENT_DATA = 1,
diff --git a/src/hid/gtk/gui-render-pixmap.c b/src/hid/gtk/gui-render-pixmap.c
deleted file mode 100644
index b24e6c9..0000000
--- a/src/hid/gtk/gui-render-pixmap.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* $Id$ */
-
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Tho...@rz...
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "gui.h"
-
-#ifdef HAVE_LIBDMALLOC
-#include <dmalloc.h>
-#endif
-
-RCSID ("$Id$");
-
-
-GdkPixmap *
-ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int depth)
-{
- extern HID ghid_hid;
- GdkPixmap *pixmap;
- GdkDrawable *save_drawable;
- double save_zoom;
- int save_left, save_top;
- int save_width, save_height;
- int save_view_width, save_view_height;
- BoxType region;
-
- save_drawable = gport->drawable;
- save_zoom = gport->zoom;
- save_width = gport->width;
- save_height = gport->height;
- save_left = gport->view_x0;
- save_top = gport->view_y0;
- save_view_width = gport->view_width;
- save_view_height = gport->view_height;
-
- pixmap = gdk_pixmap_new (NULL, width, height, depth);
-
- /* Setup drawable and zoom factor for drawing routines
- */
-
- gport->drawable = pixmap;
- gport->zoom = zoom;
- gport->width = width;
- gport->height = height;
- gport->view_width = width * gport->zoom;
- gport->view_height = height * gport->zoom;
- gport->view_x0 = ghid_flip_x ? PCB->MaxWidth - cx : cx;
- gport->view_x0 -= gport->view_height / 2;
- gport->view_y0 = ghid_flip_y ? PCB->MaxHeight - cy : cy;
- gport->view_y0 -= gport->view_width / 2;
-
- /* clear background */
- gdk_draw_rectangle (pixmap, gport->bg_gc, TRUE, 0, 0, width, height);
-
- /* call the drawing routine */
- 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));
- hid_expose_callback (&ghid_hid, ®ion, NULL);
-
- gport->drawable = save_drawable;
- gport->zoom = save_zoom;
- gport->width = save_width;
- gport->height = save_height;
- gport->view_x0 = save_left;
- gport->view_y0 = save_top;
- gport->view_width = save_view_width;
- gport->view_height = save_view_height;
-
- return pixmap;
-}
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 1fbba95..36f8f43 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -2370,7 +2370,7 @@ ghid_build_pcb_top_window (void)
*/
g_signal_connect (G_OBJECT (gport->drawing_area), "expose_event",
- G_CALLBACK (ghid_port_drawing_area_expose_event_cb),
+ G_CALLBACK (ghid_drawing_area_expose_cb),
port);
g_signal_connect (G_OBJECT (gport->top_window), "configure_event",
G_CALLBACK (top_window_configure_event_cb), port);
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index df30955..cf45adf 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -36,7 +36,7 @@
#include <sys/stat.h>
#include <gtk/gtk.h>
-
+#include "gui-pinout-preview.h"
/* Silk and rats lines are the two additional selectable to draw on.
@@ -306,9 +306,6 @@ gint ghid_port_window_mouse_scroll_cb (GtkWidget * widget,
GdkEventScroll * ev, GHidPort * out);
-gint ghid_port_drawing_area_expose_event_cb (GtkWidget * widget,
- GdkEventExpose * ev,
- GHidPort * out);
gint ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
GdkEventConfigure * ev,
GHidPort * out);
@@ -477,14 +474,6 @@ void ghid_logv (const char *fmt, va_list args);
/* gui-pinout-window.c */
void ghid_pinout_window_show (GHidPort * out, ElementTypePtr Element);
-/* gui-render-pixmap.c */
-GdkPixmap *ghid_render_pixmap (int cx,
- int cy,
- double zoom,
- int width,
- int height,
- int depth);
-
/* gtkhid-gdk.c */
hidGC ghid_make_gc (void);
void ghid_destroy_gc (hidGC);
@@ -505,6 +494,12 @@ void ghid_fill_rect (hidGC gc, int x1, int y1, int x2, int y2);
void ghid_invalidate_lr (int left, int right, int top, int bottom);
void ghid_invalidate_all ();
void ghid_show_crosshair (gboolean show);
+void ghid_screen_update (void);
+gboolean ghid_drawing_area_expose_cb (GtkWidget *, GdkEventExpose *,
+ GHidPort *);
+gboolean ghid_pinout_preview_expose (GtkWidget * widget, GdkEventExpose * ev);
+GdkPixmap *ghid_render_pixmap (int cx, int cy, double zoom,
+ int width, int height, int depth);
/* gtkhid-main.c */
void ghid_pan_fixup (void);
|
|
From: <gi...@gp...> - 2011-03-26 16:12:52
|
The branch, master has been updated
via 35b137c3e193471e07f0873dfb149cebd059dca2 (commit)
via 9ff7057cf73922fc82e0113ae2f7eb1409ca0dd5 (commit)
from f0943e66e88580e706aa7fdfa80a08d3f2b6f4d2 (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/gerber/gerber.c | 12 +++++++-----
src/print.c | 4 ++--
2 files changed, 9 insertions(+), 7 deletions(-)
=================
Commit Messages
=================
commit 35b137c3e193471e07f0873dfb149cebd059dca2
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gerber: Remove option for thickness of auto-generated outline layer
We don't mess with the thickness of the user's hand-drawn outline, and
this option implies that we do. I cannot think of a sensible way to
present the option without confusing the user, so lets remove it.
Whilst the previous default of 10 mil was fine, 8 mil matches the
width used on the fab drawing, so I have changed to that value.
:100644 100644 2e6b954... b7e99bb... M src/hid/gerber/gerber.c
commit 9ff7057cf73922fc82e0113ae2f7eb1409ca0dd5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
src/print.c: Fix fab drawing width text annotation.
The text hard-coded that the outline is 10mil, in fact it is not,
the current #define sets it at 8 mil. Report the actual value used.
:100644 100644 b5fec1c... cd19d31... M src/print.c
=========
Changes
=========
commit 35b137c3e193471e07f0873dfb149cebd059dca2
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gerber: Remove option for thickness of auto-generated outline layer
We don't mess with the thickness of the user's hand-drawn outline, and
this option implies that we do. I cannot think of a sensible way to
present the option without confusing the user, so lets remove it.
Whilst the previous default of 10 mil was fine, 8 mil matches the
width used on the fab drawing, so I have changed to that value.
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 2e6b954..b7e99bb 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -144,6 +144,12 @@ PendingDrills *pending_drills = 0;
int n_pending_drills = 0, max_pending_drills = 0;
/*----------------------------------------------------------------------------*/
+/* Defined Constants */
+/*----------------------------------------------------------------------------*/
+#define AUTO_OUTLINE_WIDTH 800 /* Auto-geneated outline width of 8 mils */
+
+
+/*----------------------------------------------------------------------------*/
/* Aperture Routines */
/*----------------------------------------------------------------------------*/
@@ -377,9 +383,6 @@ static HID_Attribute gerber_options[] = {
{"copy-outline", "Copy outline onto other layers",
HID_Enum, 0, 0, {0, 0, 0}, copy_outline_names, 0},
#define HA_copy_outline 3
- {"outline-thickness", "size, in mils/mm, of the trace used to draw the outline",
- HID_String, 0, 0, {0, "10mil", 0}, 0, 0},
-#define HA_copy_outline_size 4
};
#define NUM_OPTIONS (sizeof(gerber_options)/sizeof(gerber_options[0]))
@@ -463,7 +466,6 @@ gerber_do_export (HID_Attr_Val * options)
all_layers = options[HA_all_layers].int_value;
copy_outline_mode = options[HA_copy_outline].int_value;
- outline_trace_size = GetValue (options[HA_copy_outline_size].str_value, NULL, &absolute);
outline_layer = NULL;
@@ -776,7 +778,7 @@ gerber_set_layer (const char *name, int group, int empty)
else if (!outline_layer)
{
hidGC gc = gui->make_gc ();
- gui->set_line_width (gc, outline_trace_size);
+ gui->set_line_width (gc, AUTO_OUTLINE_WIDTH);
gui->draw_line (gc, 0, 0, PCB->MaxWidth, 0);
gui->draw_line (gc, 0, 0, 0, PCB->MaxHeight);
gui->draw_line (gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
commit 9ff7057cf73922fc82e0113ae2f7eb1409ca0dd5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
src/print.c: Fix fab drawing width text annotation.
The text hard-coded that the outline is 10mil, in fact it is not,
the current #define sets it at 8 mil. Report the actual value used.
diff --git a/src/print.c b/src/print.c
index b5fec1c..cd19d31 100644
--- a/src/print.c
+++ b/src/print.c
@@ -319,9 +319,9 @@ PrintFab (void)
"Maximum Dimensions: %d mils wide, %d mils high",
PCB->MaxWidth / 100, PCB->MaxHeight / 100);
text_at (PCB->MaxWidth / 2, PCB->MaxHeight + 2000, 1,
- "Board outline is the centerline of this 10 mil"
+ "Board outline is the centerline of this %d mil"
" rectangle - 0,0 to %d,%d mils",
- PCB->MaxWidth / 100, PCB->MaxHeight / 100);
+ FAB_LINE_W / 100, PCB->MaxWidth / 100, PCB->MaxHeight / 100);
}
else
{
|
|
From: <gi...@gp...> - 2011-03-23 13:30:57
|
The branch, master has been updated
via f0943e66e88580e706aa7fdfa80a08d3f2b6f4d2 (commit)
from f7ee676f22527b535f51d1506c56a36a8f2416ab (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-misc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit f0943e66e88580e706aa7fdfa80a08d3f2b6f4d2
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
suppress annoying decimals in relative coordinates
The threshold for non-aligned object is increased
because in case of relative coordinates the round-off
error may double.
Closes-bug: lp-699452 (sf-2117383)
Closes-bug: lp-699169 (sf-1741659)
:100644 100644 a8f4ed5... b619dd0... M src/hid/gtk/gui-misc.c
=========
Changes
=========
commit f0943e66e88580e706aa7fdfa80a08d3f2b6f4d2
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
suppress annoying decimals in relative coordinates
The threshold for non-aligned object is increased
because in case of relative coordinates the round-off
error may double.
Closes-bug: lp-699452 (sf-2117383)
Closes-bug: lp-699169 (sf-1741659)
diff --git a/src/hid/gtk/gui-misc.c b/src/hid/gtk/gui-misc.c
index a8f4ed5..b619dd0 100644
--- a/src/hid/gtk/gui-misc.c
+++ b/src/hid/gtk/gui-misc.c
@@ -595,7 +595,7 @@ ghid_grid_pcb_to_units (double x, double grid_factor)
nearest_gridpoint = floor (x / grid_factor + .5);
/* honour snapping to an unaligned object */
- if (fabs (nearest_gridpoint * grid_factor - x) > 0.55 * COOR_TO_MM)
+ if (fabs (nearest_gridpoint * grid_factor - x) > COOR_TO_MM)
return x_scaled;
/* without mm-adjusted grid_factor
(return floor (x / PCB->Grid + .5) * PCB->Grid * COOR_TO_MM),
|
|
From: <gi...@gp...> - 2011-03-22 22:50:55
|
The branch, master has been updated
via f7ee676f22527b535f51d1506c56a36a8f2416ab (commit)
from e2aee1a681638b45d90efbae458dd8568e0f1ae2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/file.c | 11 ++++++++++-
src/global.h | 2 ++
2 files changed, 12 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit f7ee676f22527b535f51d1506c56a36a8f2416ab
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Save footprints as footprints.
If the user loads a footprint as a PCB (i.e. File->Load) and tries
to save it, save only the elements in the pcb, not the whole pcb.
:100644 100644 e87aeea... 6363bf4... M src/file.c
:100644 100644 0420a18... e449a34... M src/global.h
=========
Changes
=========
commit f7ee676f22527b535f51d1506c56a36a8f2416ab
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Save footprints as footprints.
If the user loads a footprint as a PCB (i.e. File->Load) and tries
to save it, save only the elements in the pcb, not the whole pcb.
diff --git a/src/file.c b/src/file.c
index e87aeea..6363bf4 100644
--- a/src/file.c
+++ b/src/file.c
@@ -462,6 +462,7 @@ PostLoadElementPCB ()
PCB = pcb_save;
yyPCB->MaxWidth = e->BoundingBox.X2;
yyPCB->MaxHeight = e->BoundingBox.Y2;
+ yyPCB->is_footprint = 1;
}
/* ---------------------------------------------------------------------------
@@ -942,7 +943,15 @@ WritePipe (char *Filename, bool thePcb)
}
}
if (thePcb)
- result = WritePCB (fp);
+ {
+ if (PCB->is_footprint)
+ {
+ WriteElementData (fp, PCB->Data);
+ result = 0;
+ }
+ else
+ result = WritePCB (fp);
+ }
else
result = WriteBuffer (fp);
diff --git a/src/global.h b/src/global.h
index 0420a18..e449a34 100644
--- a/src/global.h
+++ b/src/global.h
@@ -510,6 +510,8 @@ typedef struct PCBType
LibraryType NetlistLib;
AttributeListType Attributes;
DataTypePtr Data; /* entire database */
+
+ bool is_footprint; /* If set, the user has loaded a footprint, not a pcb. */
}
PCBType, *PCBTypePtr;
|
|
From: <gi...@gp...> - 2011-03-22 20:44:32
|
The branch, master has been updated
via e2aee1a681638b45d90efbae458dd8568e0f1ae2 (commit)
from 0d9ba68b6cf49aa5a468b8196a7c6a5612df5914 (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 | 14 ++++++++++++++
src/misc.h | 5 ++++-
2 files changed, 18 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit e2aee1a681638b45d90efbae458dd8568e0f1ae2
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix mkdir() in plugins.
Plugins include misc.h without having a valid config.h, which
meant they'd get a build error. This patch moves the error
check into pcb's misc.c, which always has a config.h, and lets
plugins have a MKDIR() macro that uses pcb's detected values.
:100644 100644 ca42e97... a8e08ea... M src/misc.c
:100644 100644 affff00... ac3d442... M src/misc.h
=========
Changes
=========
commit e2aee1a681638b45d90efbae458dd8568e0f1ae2
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix mkdir() in plugins.
Plugins include misc.h without having a valid config.h, which
meant they'd get a build error. This patch moves the error
check into pcb's misc.c, which always has a config.h, and lets
plugins have a MKDIR() macro that uses pcb's detected values.
diff --git a/src/misc.c b/src/misc.c
index ca42e97..a8e08ea 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -2186,6 +2186,20 @@ GetInfoString (void)
}
/* ---------------------------------------------------------------------------
+ * mkdir() implentation, mostly for plugins, which don't have our config.h.
+ */
+
+#ifdef MKDIR_IS_PCBMKDIR
+#error "Don't know how to create a directory on this system."
+#endif
+
+int
+pcb_mkdir (const char *path, int mode)
+{
+ return MKDIR (path, mode);
+}
+
+/* ---------------------------------------------------------------------------
* Returns a best guess about the orientation of an element. The
* value corresponds to the rotation; a difference is the right value
* to pass to RotateElementLowLevel. However, the actual value is no
diff --git a/src/misc.h b/src/misc.h
index affff00..ac3d442 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -145,9 +145,12 @@ void NetlistChanged (int force_unfreeze);
/* plain Windows 32 */
#define MKDIR(a, b) _mkdir(a)
#else
- #error "Don't know how to create a directory on this system."
+ #define MKDIR(a, b) pcb_mkdir(a, b)
+ #define MKDIR_IS_PCBMKDIR 1
+ int pcb_mkdir (const char *path, int mode);
#endif
#endif
+
#endif /* __MISC_INCLUDED__ */
|
|
From: <gi...@gp...> - 2011-03-22 20:33:26
|
The branch, master has been updated
via 0d9ba68b6cf49aa5a468b8196a7c6a5612df5914 (commit)
via b969af590eadb880e7a1f16db73f456f76bc57ce (commit)
from 5a35337e35921dbc61dcc3980c7cb76ce1a3e85f (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/gerber/gerber.c | 82 +++++++++++++++++++++++++++++++++++++++++++++-
src/misc.c | 3 ++
2 files changed, 83 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 0d9ba68b6cf49aa5a468b8196a7c6a5612df5914
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add copy-outline mode
New gerber export options to copy the outline layer onto one
or more other layers. Some fabs want the outline separate; others
want it on a "working" layer.
:100644 100644 63344b3... 2e6b954... M src/hid/gerber/gerber.c
commit b969af590eadb880e7a1f16db73f456f76bc57ce
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Allow space between value and units in GetValue().
:100644 100644 9874861... ca42e97... M src/misc.c
=========
Changes
=========
commit 0d9ba68b6cf49aa5a468b8196a7c6a5612df5914
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add copy-outline mode
New gerber export options to copy the outline layer onto one
or more other layers. Some fabs want the outline separate; others
want it on a "working" layer.
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 63344b3..2e6b954 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -25,6 +25,7 @@
#include "data.h"
#include "misc.h"
#include "error.h"
+#include "draw.h"
#include "hid.h"
#include "../hidint.h"
@@ -91,6 +92,9 @@ static int is_mask, was_drill;
static int is_drill;
static int current_mask;
static int flash_drills;
+static int copy_outline_mode;
+static int outline_trace_size;
+static LayerTypePtr outline_layer;
enum ApertureShape
{
@@ -348,6 +352,18 @@ static int print_group[MAX_LAYER];
static int print_layer[MAX_LAYER];
static int lastX, lastY; /* the last X and Y coordinate */
+static const char *copy_outline_names[] = {
+#define COPY_OUTLINE_NONE 0
+ "none",
+#define COPY_OUTLINE_MASK 1
+ "mask",
+#define COPY_OUTLINE_SILK 2
+ "silk",
+#define COPY_OUTLINE_ALL 3
+ "all",
+ 0
+};
+
static HID_Attribute gerber_options[] = {
{"gerberfile", "Gerber output file base",
HID_String, 0, 0, {0, 0, 0}, 0, 0},
@@ -358,6 +374,12 @@ static HID_Attribute gerber_options[] = {
{"verbose", "print file names and aperture counts",
HID_Boolean, 0, 0, {0, 0, 0}, 0, 0},
#define HA_verbose 2
+ {"copy-outline", "Copy outline onto other layers",
+ HID_Enum, 0, 0, {0, 0, 0}, copy_outline_names, 0},
+#define HA_copy_outline 3
+ {"outline-thickness", "size, in mils/mm, of the trace used to draw the outline",
+ HID_String, 0, 0, {0, "10mil", 0}, 0, 0},
+#define HA_copy_outline_size 4
};
#define NUM_OPTIONS (sizeof(gerber_options)/sizeof(gerber_options[0]))
@@ -409,15 +431,17 @@ maybe_close_f ()
f = 0;
}
+static BoxType region;
+
static void
gerber_do_export (HID_Attr_Val * options)
{
char *fnbase;
int i;
static int saved_layer_stack[MAX_LAYER];
- BoxType region;
int save_ons[MAX_LAYER + 2];
FlagType save_thindraw;
+ bool absolute;
save_thindraw = PCB->Flags;
CLEAR_FLAG(THINDRAWFLAG, PCB);
@@ -438,6 +462,21 @@ gerber_do_export (HID_Attr_Val * options)
verbose = options[HA_verbose].int_value;
all_layers = options[HA_all_layers].int_value;
+ copy_outline_mode = options[HA_copy_outline].int_value;
+ outline_trace_size = GetValue (options[HA_copy_outline_size].str_value, NULL, &absolute);
+
+ outline_layer = NULL;
+
+ for (i = 0; i < max_copper_layer; i++)
+ {
+ LayerType *layer = PCB->Data->Layer + i;
+ if (strcmp (layer->Name, "outline") == 0 ||
+ strcmp (layer->Name, "route") == 0)
+ {
+ outline_layer = layer;
+ }
+ }
+
i = strlen (fnbase);
filename = (char *)realloc (filename, i + 40);
strcpy (filename, fnbase);
@@ -524,6 +563,7 @@ drill_sort (const void *va, const void *vb)
static int
gerber_set_layer (const char *name, int group, int empty)
{
+ int want_outline;
char *cp;
int idx = (group >= 0
&& group <
@@ -597,7 +637,7 @@ gerber_set_layer (const char *name, int group, int empty)
c_layerapps++;
if (finding_apertures)
- return 1;
+ goto emit_outline;
if (!curapp->some_apertures && !all_layers)
return 0;
@@ -707,6 +747,44 @@ gerber_set_layer (const char *name, int group, int empty)
fprintf (f, "%%ADD11C,0.0100*%%\r\n");
}
+ emit_outline:
+ /* If we're printing a copper layer other than the outline layer,
+ and we want to "print outlines", and we have an outline layer,
+ print the outline layer on this layer also. */
+ want_outline = 0;
+ if (copy_outline_mode == COPY_OUTLINE_MASK
+ && SL_TYPE (idx) == SL_MASK)
+ want_outline = 1;
+ if (copy_outline_mode == COPY_OUTLINE_SILK
+ && SL_TYPE (idx) == SL_SILK)
+ want_outline = 1;
+ if (copy_outline_mode == COPY_OUTLINE_ALL
+ && (SL_TYPE (idx) == SL_SILK
+ || SL_TYPE (idx) == SL_MASK
+ || SL_TYPE (idx) == SL_FAB
+ || SL_TYPE (idx) == SL_ASSY
+ || SL_TYPE (idx) == 0))
+ want_outline = 1;
+
+ if (want_outline
+ && strcmp (name, "outline")
+ && strcmp (name, "route"))
+ {
+ if (outline_layer
+ && outline_layer != PCB->Data->Layer+idx)
+ DrawLayer (outline_layer, ®ion);
+ else if (!outline_layer)
+ {
+ hidGC gc = gui->make_gc ();
+ gui->set_line_width (gc, outline_trace_size);
+ gui->draw_line (gc, 0, 0, PCB->MaxWidth, 0);
+ gui->draw_line (gc, 0, 0, 0, PCB->MaxHeight);
+ gui->draw_line (gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
+ gui->draw_line (gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight);
+ gui->destroy_gc (gc);
+ }
+ }
+
return 1;
}
commit b969af590eadb880e7a1f16db73f456f76bc57ce
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Allow space between value and units in GetValue().
diff --git a/src/misc.c b/src/misc.c
index 9874861..ca42e97 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -132,6 +132,9 @@ GetValue (const char *val, const char *units, bool * absolute)
}
if (!units && n > 0)
units = val + n;
+
+ while (units && *units == ' ')
+ units ++;
if (units && *units)
{
|
|
From: <gi...@gp...> - 2011-03-22 16:23:33
|
The branch, master has been updated
via 5a35337e35921dbc61dcc3980c7cb76ce1a3e85f (commit)
from b0d8e87b932030f1cbe791aba0ce6c529200f1a0 (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/polygon.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 5a35337e35921dbc61dcc3980c7cb76ce1a3e85f
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
simplify an expression
return to the form written in d5d894d977e610
(lost in 2d8dc8a3a3a551)
:100644 100644 0235495... 78cc3b2... M src/polygon.c
=========
Changes
=========
commit 5a35337e35921dbc61dcc3980c7cb76ce1a3e85f
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
simplify an expression
return to the form written in d5d894d977e610
(lost in 2d8dc8a3a3a551)
diff --git a/src/polygon.c b/src/polygon.c
index 0235495..78cc3b2 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -405,7 +405,7 @@ frac_circle (PLINE * c, LocationType X, LocationType Y, Vector v, int range)
e2 = (v[1] - Y) * (1 + radius_adjustment);
/* NB: the caller adds the last vertex, hence the -1 */
- range = range == 1 ? CIRC_SEGS-1 : (CIRC_SEGS / range) - 1;
+ range = CIRC_SEGS / range - 1;
for (i = 0; i < range; i++)
{
/* rotate the vector */
|
|
From: <gi...@gp...> - 2011-03-22 16:10:08
|
The branch, master has been updated
via b0d8e87b932030f1cbe791aba0ce6c529200f1a0 (commit)
from 5f67bca0c03796749c3d3377f301d679b9c20fb9 (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 +-
src/const.h | 4 +-
src/crosshair.c | 32 ++++++++++-------
src/gpcb-menu.res | 12 +++---
src/hid/gtk/gui-misc.c | 92 ++++++++++++++++++++++++++++++++++++++----------
src/misc.c | 2 +-
src/misc.h | 2 +-
src/pcb-menu.res | 12 +++---
src/set.c | 2 +-
src/set.h | 2 +-
10 files changed, 111 insertions(+), 51 deletions(-)
=================
Commit Messages
=================
commit b0d8e87b932030f1cbe791aba0ce6c529200f1a0
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
(GTK HID) fix annoying decimals
When in metric grid mode, the coordinates are displayed
with irregular tails of nines, e.g. "116.9998 43.9999"
when the grid is set to 1mm.
The fix includes using more precise metric-to-imperial
and crosshair calculations and fitting crosshair values
into metric grids.
To address the issue in a really reliable way we need at least
one more separate variable, to explicitly mark the grid
as metric (as opposed to the displayed units);
this flag should also be saved in PCB files.
First reported by Kai-Martin Knaak.
Closes-bug: lp-699452 (sf-2117383)
Closes-bug: lp-699169 (sf-1741659)
:100644 100644 f7dfd2b... 7493659... M src/action.c
:100644 100644 e4a1d31... 3b6cd30... M src/const.h
:100644 100644 4c94889... 77b372f... M src/crosshair.c
:100644 100644 bd9acac... 593b737... M src/gpcb-menu.res
:100644 100644 1c55a99... a8f4ed5... M src/hid/gtk/gui-misc.c
:100644 100644 13c7398... 9874861... M src/misc.c
:100644 100644 208ef88... affff00... M src/misc.h
:100644 100644 dcba346... 5e3682c... M src/pcb-menu.res
:100644 100644 25267d8... 188203a... M src/set.c
:100644 100644 e139766... f8f6a9a... M src/set.h
=========
Changes
=========
commit b0d8e87b932030f1cbe791aba0ce6c529200f1a0
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
(GTK HID) fix annoying decimals
When in metric grid mode, the coordinates are displayed
with irregular tails of nines, e.g. "116.9998 43.9999"
when the grid is set to 1mm.
The fix includes using more precise metric-to-imperial
and crosshair calculations and fitting crosshair values
into metric grids.
To address the issue in a really reliable way we need at least
one more separate variable, to explicitly mark the grid
as metric (as opposed to the displayed units);
this flag should also be saved in PCB files.
First reported by Kai-Martin Knaak.
Closes-bug: lp-699452 (sf-2117383)
Closes-bug: lp-699169 (sf-1741659)
diff --git a/src/action.c b/src/action.c
index f7dfd2b..7493659 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2213,7 +2213,7 @@ ActionSetValue (int argc, char **argv, int x, int y)
char *val = ARG (1);
char *units = ARG (2);
bool absolute; /* flag for 'absolute' value */
- float value;
+ double value;
int err = 0;
if (function && val)
diff --git a/src/const.h b/src/const.h
index e4a1d31..3b6cd30 100644
--- a/src/const.h
+++ b/src/const.h
@@ -66,9 +66,9 @@
#define TAN_30_DEGREE 0.577350269 /* tan(30) */
#define TAN_60_DEGREE 1.732050808 /* tan(60) */
#define MIL_TO_MM 0.025400000
-#define MM_TO_MIL 39.37007874
+#define MM_TO_MIL (1./MIL_TO_MM)
#define COOR_TO_MM 0.000254000
-#define MM_TO_COOR 3937.007874
+#define MM_TO_COOR (1./COOR_TO_MM)
#define LN_2_OVER_2 0.346573590
/* ---------------------------------------------------------------------------
diff --git a/src/crosshair.c b/src/crosshair.c
index 4c94889..77b372f 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -766,6 +766,12 @@ RestoreCrosshair (bool BlockToo)
}
}
+static double
+square (double x)
+{
+ return x * x;
+}
+
/* ---------------------------------------------------------------------------
* recalculates the passed coordinates to fit the current grid setting
*/
@@ -774,7 +780,7 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
{
LocationType x2, y2, x0, y0;
void *ptr1, *ptr2, *ptr3;
- float nearest, sq_dist;
+ double nearest, sq_dist;
int ans;
x0 = 0;
@@ -892,10 +898,10 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
px = (pad->Point1.X + pad->Point2.X) / 2;
py = (pad->Point1.Y + pad->Point2.Y) / 2;
- sq_dist = SQUARE (px - Crosshair.X) + SQUARE (py - Crosshair.Y);
+ sq_dist = square (px - Crosshair.X) + square (py - Crosshair.Y);
if (!gui->shift_is_pressed() ||
- SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist)
+ square (x0 - Crosshair.X) + square (y0 - Crosshair.Y) > sq_dist)
{
x0 = px;
y0 = py;
@@ -918,10 +924,10 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
if (ans)
{
PinTypePtr pin = (PinTypePtr) ptr2;
- sq_dist = SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y);
+ sq_dist = square (pin->X - Crosshair.X) + square (pin->Y - Crosshair.Y);
if ((nearest == -1 || sq_dist < nearest) &&
(!gui->shift_is_pressed() ||
- SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ square (x0 - Crosshair.X) + square (y0 - Crosshair.Y) > sq_dist))
{
x0 = pin->X;
y0 = pin->Y;
@@ -946,10 +952,10 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
if (ans)
{
PinTypePtr pin = (PinTypePtr) ptr2;
- sq_dist = SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y);
+ sq_dist = square (pin->X - Crosshair.X) + square (pin->Y - Crosshair.Y);
if ((nearest == -1 || sq_dist < nearest) &&
(!gui->shift_is_pressed() ||
- SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ square (x0 - Crosshair.X) + square (y0 - Crosshair.Y) > sq_dist))
{
x0 = pin->X;
y0 = pin->Y;
@@ -966,10 +972,10 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
if (ans)
{
PointTypePtr pnt = (PointTypePtr) ptr3;
- sq_dist = SQUARE (pnt->X - Crosshair.X) + SQUARE (pnt->Y - Crosshair.Y);
+ sq_dist = square (pnt->X - Crosshair.X) + square (pnt->Y - Crosshair.Y);
if ((nearest == -1 || sq_dist < nearest) &&
(!gui->shift_is_pressed() ||
- SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ square (x0 - Crosshair.X) + square (y0 - Crosshair.Y) > sq_dist))
{
x0 = pnt->X;
y0 = pnt->Y;
@@ -986,10 +992,10 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
if (ans)
{
PointTypePtr pnt = (PointTypePtr) ptr3;
- sq_dist = SQUARE (pnt->X - Crosshair.X) + SQUARE (pnt->Y - Crosshair.Y);
+ sq_dist = square (pnt->X - Crosshair.X) + square (pnt->Y - Crosshair.Y);
if ((nearest == -1 || sq_dist < nearest) &&
(!gui->shift_is_pressed() ||
- SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ square (x0 - Crosshair.X) + square (y0 - Crosshair.Y) > sq_dist))
{
x0 = pnt->X;
y0 = pnt->Y;
@@ -1007,9 +1013,9 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
if (ans & ELEMENT_TYPE)
{
ElementTypePtr el = (ElementTypePtr) ptr1;
- sq_dist = SQUARE (el->MarkX - Crosshair.X) + SQUARE (el->MarkY - Crosshair.Y);
+ sq_dist = square (el->MarkX - Crosshair.X) + square (el->MarkY - Crosshair.Y);
if ((nearest == -1 || sq_dist < nearest) &&
- SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist)
+ square (x0 - Crosshair.X) + square (y0 - Crosshair.Y) > sq_dist)
{
x0 = el->MarkX;
y0 = el->MarkY;
diff --git a/src/gpcb-menu.res b/src/gpcb-menu.res
index bd9acac..593b737 100644
--- a/src/gpcb-menu.res
+++ b/src/gpcb-menu.res
@@ -133,12 +133,12 @@ MainMenu =
{ "50 mil" checked=gridsize,5000 SetUnits(mil) SetValue(Grid,5000)}
{"100 mil" checked=gridsize,10000 SetUnits(mil) SetValue(Grid,10000)}
-
- {"0.01 mm" checked=gridsize,39 SetUnits(mm) SetValue(Grid,39.37007874)}
- {"0.05 mm" checked=gridsize,197 SetUnits(mm) SetValue(Grid,196.85039370)}
- {"0.1 mm" checked=gridsize,394 SetUnits(mm) SetValue(Grid,393.70078740)}
- {"0.25 mm" checked=gridsize,984 SetUnits(mm) SetValue(Grid,984.25197)}
- {"0.5 mm" checked=gridsize,1969 SetUnits(mm) SetValue(Grid,1968.503937)}
- {"1 mm" checked=gridsize,3937 SetUnits(mm) SetValue(Grid,3937.00787400)}
+ {"0.01 mm" checked=gridsize,39 SetUnits(mm) SetValue(Grid,0.01mm)}
+ {"0.05 mm" checked=gridsize,197 SetUnits(mm) SetValue(Grid,0.05mm)}
+ {"0.1 mm" checked=gridsize,394 SetUnits(mm) SetValue(Grid,0.1mm)}
+ {"0.25 mm" checked=gridsize,984 SetUnits(mm) SetValue(Grid,0.25mm)}
+ {"0.5 mm" checked=gridsize,1969 SetUnits(mm) SetValue(Grid,0.5mm)}
+ {"1 mm" checked=gridsize,3937 SetUnits(mm) SetValue(Grid,1mm)}
-
{"Grid -5mil" SetValue(Grid,-5,mil) a={"Shift-G" "Shift<Key>g"}}
{"Grid +5mil" SetValue(Grid,+5,mil) a={"G" "<Key>g"}}
diff --git a/src/hid/gtk/gui-misc.c b/src/hid/gtk/gui-misc.c
index 1c55a99..a8f4ed5 100644
--- a/src/hid/gtk/gui-misc.c
+++ b/src/hid/gtk/gui-misc.c
@@ -547,6 +547,65 @@ ghid_set_status_line_label (void)
ghid_status_line_set_text (text);
}
+/* returns an auxiliary value needed to adjust mm grid.
+ the adjustment is needed to prevent ..99 tails in position labels.
+
+ All these are a workaround to precision lost
+ because of double->integer transform
+ while fitting Crosshair to grid in crosshair.c
+
+ There is another workaround: report mm dimensions with %.2f, like
+ in the Lesstif hid; but this reduces the information */
+static double
+ghid_get_grid_factor(void)
+{
+ /* when grid units are mm, they shall be an integer of
+ 1 mm / grid_scale */
+ const int grid_scale = 10000; /* metric grid step is .1 um */
+ double factor, rounded_factor;
+
+ /* adjustment is not needed for inches
+ probably because x/100 is always 'integer' enough */
+ if (!Settings.grid_units_mm)
+ return -1;
+
+ factor = PCB->Grid * COOR_TO_MM * grid_scale;
+ rounded_factor = floor (factor + .5);
+
+ /* check whether the grid is actually metric
+ (as of Feb 2011, Settings.grid_units_mm may indicate just that
+ the _displayed_ units are mm) */
+ if (fabs (factor - rounded_factor) > 1e-3)
+ return -1;
+
+ return rounded_factor / grid_scale;
+}
+/* transforms a pcb coordinate to selected units
+ adjusted to the nearest grid point for mm grid */
+static double
+ghid_grid_pcb_to_units (double x, double grid_factor)
+{
+ double x_scaled = (Settings.grid_units_mm? COOR_TO_MM: 1./100) * x;
+ double nearest_gridpoint;
+
+ if (grid_factor < 0)
+ return x_scaled;
+
+ x *= COOR_TO_MM;
+
+ nearest_gridpoint = floor (x / grid_factor + .5);
+ /* honour snapping to an unaligned object */
+ if (fabs (nearest_gridpoint * grid_factor - x) > 0.55 * COOR_TO_MM)
+ return x_scaled;
+ /* without mm-adjusted grid_factor
+ (return floor (x / PCB->Grid + .5) * PCB->Grid * COOR_TO_MM),
+ the round-off errors redintroduce the bug for 0.1 or 0.05 mm grid
+ at coordinates more than 1500 mm.
+ grid_factor makes the stuff work at least up to 254 m,
+ which is 100 times more than default maximum board size as of Feb 2011. */
+ return nearest_gridpoint * grid_factor;
+}
+
/* ---------------------------------------------------------------------------
* output of cursor position
*/
@@ -554,32 +613,27 @@ void
ghid_set_cursor_position_labels (void)
{
gchar text[128];
+ int prec = Settings.grid_units_mm ? 4: 2;
+ double grid_factor = ghid_get_grid_factor();
if (Marked.status)
- {double scale, dx, dy, r, a;
- scale = Settings.grid_units_mm ? COOR_TO_MM: 1. / 100;
- dx = (Crosshair.X - Marked.X) * scale;
- dy = (Marked.Y - Crosshair.Y) * scale;
- r = sqrt( dx * dx + dy * dy);
- a = atan2(dy, dx) * 180 / M_PI;
- if (Settings.grid_units_mm)
- snprintf (text, sizeof (text), "r %-.4f; phi %-.1f; %-.4f %-.4f",
- r, a, dx, dy);
-
- else
- snprintf (text, sizeof (text), "r %-.2f; phi %-.1f; %-.2f %-.2f",
- r, a, dx, dy);
+ {
+ double dx, dy, r, a;
+
+ dx = ghid_grid_pcb_to_units (Crosshair.X - Marked.X, grid_factor);
+ dy = ghid_grid_pcb_to_units (Crosshair.Y - Marked.Y, grid_factor);
+ r = sqrt (dx * dx + dy * dy);
+ a = atan2 (dy, dx) * RAD_TO_DEG;
+ snprintf (text, sizeof (text), "r %-.*f; phi %-.1f; %-.*f %-.*f",
+ prec, r, a, prec, dx, prec, dy);
ghid_cursor_position_relative_label_set_text (text);
}
else
ghid_cursor_position_relative_label_set_text ("r __.__; phi __._; __.__ __.__");
- if (Settings.grid_units_mm)
- snprintf (text, sizeof (text), "%-.4f %-.4f",
- COOR_TO_MM * Crosshair.X, COOR_TO_MM * Crosshair.Y);
- else
- snprintf (text, sizeof (text), "%-.2f %-.2f",
- Crosshair.X / 100., Crosshair.Y / 100.);
+ snprintf (text, sizeof (text), "%-.*f %-.*f",
+ prec, ghid_grid_pcb_to_units (Crosshair.X, grid_factor),
+ prec, ghid_grid_pcb_to_units (Crosshair.Y, grid_factor));
ghid_cursor_position_label_set_text (text);
}
diff --git a/src/misc.c b/src/misc.c
index 13c7398..9874861 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -107,7 +107,7 @@ static struct
/* Get Value returns a numeric value passed from the string and sets the
* bool variable absolute to false if it leads with a +/- character
*/
-float
+double
GetValue (const char *val, const char *units, bool * absolute)
{
double value;
diff --git a/src/misc.h b/src/misc.h
index 208ef88..affff00 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -74,7 +74,7 @@ BoxTypePtr GetArcEnds (ArcTypePtr);
void ChangeArcAngles (LayerTypePtr, ArcTypePtr, long int, long int);
char *UniqueElementName (DataTypePtr, char *);
void AttachForCopy (LocationType, LocationType);
-float GetValue (const char *, const char *, bool *);
+double GetValue (const char *, const char *, bool *);
int FileExists (const char *);
char *Concat (const char *, ...); /* end with NULL */
diff --git a/src/pcb-menu.res b/src/pcb-menu.res
index dcba346..5e3682c 100644
--- a/src/pcb-menu.res
+++ b/src/pcb-menu.res
@@ -104,12 +104,12 @@ MainMenu =
{ "50 mil" checked=gridsize,5000 SetUnits(mil) SetValue(Grid,5000)}
{"100 mil" checked=gridsize,10000 SetUnits(mil) SetValue(Grid,10000)}
-
- {"0.01 mm" checked=gridsize,39 SetUnits(mm) SetValue(Grid,39.37007874)}
- {"0.05 mm" checked=gridsize,197 SetUnits(mm) SetValue(Grid,196.85039370)}
- {"0.1 mm" checked=gridsize,394 SetUnits(mm) SetValue(Grid,393.70078740)}
- {"0.25 mm" checked=gridsize,984 SetUnits(mm) SetValue(Grid,984.25197)}
- {"0.5 mm" checked=gridsize,1969 SetUnits(mm) SetValue(Grid,1968.503937)}
- {"1 mm" checked=gridsize,3937 SetUnits(mm) SetValue(Grid,3937.00787400)}
+ {"0.01 mm" checked=gridsize,39 SetUnits(mm) SetValue(Grid,0.01mm)}
+ {"0.05 mm" checked=gridsize,197 SetUnits(mm) SetValue(Grid,0.05mm)}
+ {"0.1 mm" checked=gridsize,394 SetUnits(mm) SetValue(Grid,0.1mm)}
+ {"0.25 mm" checked=gridsize,984 SetUnits(mm) SetValue(Grid,0.25mm)}
+ {"0.5 mm" checked=gridsize,1969 SetUnits(mm) SetValue(Grid,0.5mm)}
+ {"1 mm" checked=gridsize,3937 SetUnits(mm) SetValue(Grid,1mm)}
-
{"Grid -5mil" SetValue(Grid,-5,mil) a={"Shift-G" "Shift<Key>g"}}
{"Grid +5mil" SetValue(Grid,+5,mil) a={"G" "<Key>g"}}
diff --git a/src/set.c b/src/set.c
index 25267d8..188203a 100644
--- a/src/set.c
+++ b/src/set.c
@@ -69,7 +69,7 @@ static int mode_stack[MAX_MODESTACK_DEPTH];
* sets cursor grid with respect to grid offset values
*/
void
-SetGrid (float Grid, bool align)
+SetGrid (double Grid, bool align)
{
if (Grid >= 1 && Grid <= MAX_GRID)
{
diff --git a/src/set.h b/src/set.h
index e139766..f8f6a9a 100644
--- a/src/set.h
+++ b/src/set.h
@@ -34,7 +34,7 @@
#include "global.h"
void SetTextScale (Dimension);
-void SetGrid (float, bool);
+void SetGrid (double, bool);
void SetZoom (float);
void SetLineSize (BDimension);
void SetViaSize (BDimension, bool);
|
|
From: <gi...@gp...> - 2011-03-14 16:46:38
|
The branch, master has been updated
via 5f67bca0c03796749c3d3377f301d679b9c20fb9 (commit)
via c28c595920d267d11c8163cc34cb33d63a346dda (commit)
from 60f6fa16eda93c10dfc1ed8d030bebeeb0cb9693 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
doc/pcb.texi | 2 +-
src/action.c | 70 ++++++++++++++++++++++++------------------
src/buffer.c | 2 +-
src/djopt.c | 5 ++-
src/fontmode.c | 4 +-
src/hid/gtk/gui-top-window.c | 4 +-
src/move.c | 2 +-
7 files changed, 50 insertions(+), 39 deletions(-)
=================
Commit Messages
=================
commit 5f67bca0c03796749c3d3377f301d679b9c20fb9
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
fix sections hierarhy
:100644 100644 3c5b1e2... 78c99d2... M doc/pcb.texi
commit c28c595920d267d11c8163cc34cb33d63a346dda
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Cleanup action documentation
Add missing documentation
* Display(ToggleLockNames)
* Display(ToggleOnlyNames)
* Select(Object)
Remove invalid documentation
* Connection(Measure)
* Display(Scroll, Direction)
* Display(Step, direction, amount, units)
Cosmetic modifications:
* dots at end of sentences
* capital letter at start of sentences
* remove some curious signs at the beginning of some lines.
* fix a couple of typos
Closes-bug: lp-699506
:100644 100644 63ef37e... f7dfd2b... M src/action.c
:100644 100644 4442bbb... 110914c... M src/buffer.c
:100644 100644 b5d9c39... 4995c08... M src/djopt.c
:100644 100644 4f7f5b8... eae2545... M src/fontmode.c
:100644 100644 4186d85... 1fbba95... M src/hid/gtk/gui-top-window.c
:100644 100644 5e3913c... 3ded0d0... M src/move.c
=========
Changes
=========
commit 5f67bca0c03796749c3d3377f301d679b9c20fb9
Author: Ineiev <in...@us...>
Commit: Ineiev <in...@us...>
fix sections hierarhy
diff --git a/doc/pcb.texi b/doc/pcb.texi
index 3c5b1e2..78c99d2 100644
--- a/doc/pcb.texi
+++ b/doc/pcb.texi
@@ -5238,7 +5238,7 @@ rats-nest" command after moving parts around.
After the placement is complete, use the line tool to add traces to the
board. As traces are added, the corresponding rats line will disappear.
-@section Forward Annotation of Schematic Changes
+@subsection Forward Annotation of Schematic Changes
If schematic changes are made after the layout has started,
@code{gsch2pcb} can be used to forward annotate these changes to the
layout. To forward annotate schematic changes, run @samp{gsch2pcb
commit c28c595920d267d11c8163cc34cb33d63a346dda
Author: Felix Ruoff <Fe...@po...>
Commit: Ineiev <in...@us...>
Cleanup action documentation
Add missing documentation
* Display(ToggleLockNames)
* Display(ToggleOnlyNames)
* Select(Object)
Remove invalid documentation
* Connection(Measure)
* Display(Scroll, Direction)
* Display(Step, direction, amount, units)
Cosmetic modifications:
* dots at end of sentences
* capital letter at start of sentences
* remove some curious signs at the beginning of some lines.
* fix a couple of typos
Closes-bug: lp-699506
diff --git a/src/action.c b/src/action.c
index 63ef37e..f7dfd2b 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2340,10 +2340,6 @@ Any ``found'' pins and vias are marked ``not found''.
@item Reset
All ``found'' objects are marked ``not found''.
-@item Measure
-The net under the cursor is found and measured (the lengths of all
-line segments are added together)
-
@end table
%end-doc */
@@ -2533,7 +2529,7 @@ static const char display_syntax[] =
"Display(ToggleThindraw|ToggleThindrawPoly|ToggleOrthoMove|ToggleLocalRef)\n"
"Display(ToggleCheckPlanes|ToggleShowDRC|ToggleAutoDRC)\n"
"Display(ToggleLiveRoute|LockNames|OnlyNames)\n"
- "Display(Pinout|PinOrPadName)\n" "Display(Scroll, Direction)";
+ "Display(Pinout|PinOrPadName)";
static const char display_help[] = "Several display-related actions.";
@@ -2615,6 +2611,16 @@ left, or right, but not up+left or down+right.
@item ToggleName
Selects whether the pinouts show the pin names or the pin numbers.
+@item ToggleLockNames
+If set, text will ignore left mouse clicks and actions that work on
+objects under the mouse. You can still select text with a lasso (left
+mouse drag) and perform actions on the selection.
+
+@item ToggleOnlyNames
+If set, only text will be sensitive for mouse clicks and actions that
+work on objects under the mouse. You can still select other objects
+with a lasso (left mouse drag) and perform actions on the selection.
+
@item ToggleMask
Turns the solder mask on or off.
@@ -2646,11 +2652,6 @@ Toggles whether the names of pins, pads, or (yes) vias will be
displayed. If the cursor is over an element, all of its pins and pads
are affected.
-@item Step <direction> <amount> <units>
-Steps the crosshair in the given direction, with 1=down/left, 2=down,
-etc, according to the numeric keypad layout. If amount is not given,
-the crosshair steps along the grid.
-
@end table
%end-doc */
@@ -3006,7 +3007,8 @@ ActionDisplay (int argc, char **argv, int childX, int childY)
static const char mode_syntax[] =
"Mode(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer)\n"
"Mode(Polygon|Rectangle|Remove|Rotate|Text|Thermal|Via)\n"
- "Mode(Notify|Release|Cancel|Stroke)\n" "Mode(Save|Restore)";
+ "Mode(Notify|Release|Cancel|Stroke)\n"
+ "Mode(Save|Restore)";
static const char mode_help[] = "Change or use the tool mode.";
@@ -3296,7 +3298,8 @@ ActionRemoveSelected (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
-static const char renumber_syntax[] = "Renumber()\n" "Renumber(filename)";
+static const char renumber_syntax[] = "Renumber()\n"
+ "Renumber(filename)";
static const char renumber_help[] =
"Renumber all elements. The changes will be recorded to filename\n"
@@ -3857,8 +3860,7 @@ ActionAddRats (int argc, char **argv, int x, int y)
static const char delete_syntax[] =
"Delete(Object|Selected)\n"
- "Delete(AllRats|SelectedRats)"
- ;
+ "Delete(AllRats|SelectedRats)";
static const char delete_help[] = "Delete stuff.";
@@ -4029,9 +4031,10 @@ ActionAutoRoute (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
static const char markcrosshair_syntax[] =
- "MarkCrosshair()\n" "MarkCrosshair(Center)";
+ "MarkCrosshair()\n"
+ "MarkCrosshair(Center)";
-static const char markcrosshair_help[] = "Set/Reset the Crosshair mark";
+static const char markcrosshair_help[] = "Set/Reset the Crosshair mark.";
/* %start-doc actions MarkCrosshair
@@ -4324,7 +4327,8 @@ ActionChangeClearSize (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
static const char minmaskgap_syntax[] =
- "MinMaskGap(delta)\n" "MinMaskGap(Selected, delta)";
+ "MinMaskGap(delta)\n"
+ "MinMaskGap(Selected, delta)";
static const char minmaskgap_help[] =
"Ensures the mask is a minimum distance from pins and pads.";
@@ -4408,7 +4412,8 @@ ActionMinMaskGap (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
static const char mincleargap_syntax[] =
- "MinClearGap(delta)\n" "MinClearGap(Selected, delta)";
+ "MinClearGap(delta)\n"
+ "MinClearGap(Selected, delta)";
static const char mincleargap_help[] =
"Ensures that polygons are a minimum distance from objects.";
@@ -4607,7 +4612,8 @@ ActionChangePinName (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
static const char changename_syntax[] =
- "ChangeName(Object)\n" "ChangeName(Layout|Layer)";
+ "ChangeName(Object)\n"
+ "ChangeName(Layout|Layer)";
static const char changename_help[] = "Sets the name of objects.";
@@ -5376,7 +5382,7 @@ ActionChangePaste (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
static const char select_syntax[] =
- "Select(ToggleObject)\n"
+ "Select(Object|ToggleObject)\n"
"Select(All|Block|Connection)\n"
"Select(ElementByName|ObjectByName|PadByName|PinByName)\n"
"Select(ElementByName|ObjectByName|PadByName|PinByName, Name)\n"
@@ -5384,7 +5390,7 @@ static const char select_syntax[] =
"Select(TextByName|ViaByName|NetByName, Name)\n"
"Select(Convert)";
-static const char select_help[] = "Toggles or sets the selection";
+static const char select_help[] = "Toggles or sets the selection.";
/* %start-doc actions Select
@@ -5575,10 +5581,11 @@ static const char unselect_syntax[] =
"Unselect(All|Block|Connection)\n"
"Unselect(ElementByName|ObjectByName|PadByName|PinByName)\n"
"Unselect(ElementByName|ObjectByName|PadByName|PinByName, Name)\n"
- "Unselect(TextByName|ViaByName)\n" "Unselect(TextByName|ViaByName, Name)\n";
+ "Unselect(TextByName|ViaByName)\n"
+ "Unselect(TextByName|ViaByName, Name)\n";
static const char unselect_help[] =
- "unselects the object at the pointer location or the specified objects";
+ "Unselects the object at the pointer location or the specified objects.";
/* %start-doc actions Unselect
@@ -5839,7 +5846,8 @@ ActionSaveTo (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
static const char savesettings_syntax[] =
- "SaveSettings()\n" "SaveSettings(local)";
+ "SaveSettings()\n"
+ "SaveSettings(local)";
static const char savesettings_help[] = "Saves settings.";
@@ -6228,7 +6236,8 @@ ActionPasteBuffer (int argc, char **argv, int x, int y)
/* --------------------------------------------------------------------------- */
-static const char undo_syntax[] = "Undo()\n" "Undo(ClearList)";
+static const char undo_syntax[] = "Undo()\n"
+ "Undo(ClearList)";
static const char undo_help[] = "Undo recent changes.";
@@ -6777,7 +6786,8 @@ static const char changeflag_syntax[] =
"ChangeFlag(SelectedLines|SelectedPins|SelectedVias, flag, value)\n"
"ChangeFlag(SelectedPads|SelectedTexts|SelectedNames, flag, value)\n"
"ChangeFlag(SelectedElements, flag, value)\n"
- "flag = square | octagon | thermal | join\n" "value = 0 | 1";
+ "flag = square | octagon | thermal | join\n"
+ "value = 0 | 1";
static const char changeflag_help[] = "Sets or clears flags on objects.";
@@ -7236,7 +7246,7 @@ ActionElementList (int argc, char **argv, int x, int y)
/* ---------------------------------------------------------------- */
static const char elementsetattr_syntax[] = "ElementSetAttr(refdes,name[,value])";
-static const char elementsetattr_help[] = "Sets or clears an element-specific attribute";
+static const char elementsetattr_help[] = "Sets or clears an element-specific attribute.";
/* %start-doc actions elementsetattr
@@ -7300,7 +7310,7 @@ ActionElementSetAttr (int argc, char **argv, int x, int y)
/* ---------------------------------------------------------------- */
static const char execcommand_syntax[] = "ExecCommand(command)";
-static const char execcommand_help[] = "Runs a command";
+static const char execcommand_help[] = "Runs a command.";
/* %start-doc actions execcommand
@@ -7531,7 +7541,7 @@ static const char import_syntax[] =
"Import(setnewpoint[,(mark|center|X,Y)])\n"
"Import(setdisperse,D,units)\n";
-static const char import_help[] = "Import schematics";
+static const char import_help[] = "Import schematics.";
/* %start-doc actions Import
@@ -7602,7 +7612,7 @@ Note that Import() doesn't delete anything - after an Import, elements
which shouldn't be on the board are selected and may be removed once
it's determined that the deletion is appropriate.
-In @code{Import()} is called with @code{setnewpoint} then the location
+If @code{Import()} is called with @code{setnewpoint}, then the location
of new components can be specified. This is where parts show up when
they're added to the board. The default is the center of the board.
diff --git a/src/buffer.c b/src/buffer.c
index 4442bbb..110914c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -865,7 +865,7 @@ LoadFootprintByName (BufferTypePtr Buffer, char *Footprint)
static const char loadfootprint_syntax[] = "LoadFootprint(filename[,refdes,value])";
-static const char loadfootprint_help[] = "Loads a single footprint by name";
+static const char loadfootprint_help[] = "Loads a single footprint by name.";
/* %start-doc actions LoadFootprint
diff --git a/src/djopt.c b/src/djopt.c
index b5d9c39..4995c08 100644
--- a/src/djopt.c
+++ b/src/djopt.c
@@ -2923,10 +2923,11 @@ grok_layer_groups ()
static const char djopt_syntax[] =
"djopt(debumpify|unjaggy|simple|vianudge|viatrim|orthopull)\n"
- "djopt(auto) - all of the above\n" "djopt(miter)";
+ "djopt(auto) - all of the above\n"
+ "djopt(miter)";
static const char djopt_help[] =
- "Perform various optimizations on the current board";
+ "Perform various optimizations on the current board.";
/* %start-doc actions djopt
diff --git a/src/fontmode.c b/src/fontmode.c
index 4f7f5b8..eae2545 100644
--- a/src/fontmode.c
+++ b/src/fontmode.c
@@ -68,7 +68,7 @@ RCSID ("$Id$");
static const char fontedit_syntax[] = "FontEdit()";
static const char fontedit_help[] =
- "Convert the current font to a PCB for editing";
+ "Convert the current font to a PCB for editing.";
/* %start-doc actions FontEdit
@@ -161,7 +161,7 @@ FontEdit (int argc, char **argv, int Ux, int Uy)
static const char fontsave_syntax[] = "FontSave()";
-static const char fontsave_help[] = "Convert the current PCB back to a font";
+static const char fontsave_help[] = "Convert the current PCB back to a font.";
/* %start-doc actions FontSave
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 4186d85..1fbba95 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -3854,7 +3854,7 @@ static const char adjuststyle_syntax[] =
"AdjustStyle()\n";
static const char adjuststyle_help[] =
-"Open the window which allows editing of the route styles";
+"Open the window which allows editing of the route styles.";
/* %start-doc actions AdjustStyle
@@ -3883,7 +3883,7 @@ static const char editlayergroups_syntax[] =
"EditLayerGroups()\n";
static const char editlayergroups_help[] =
-"Open the preferences window which allows editing of the layer groups";
+"Open the preferences window which allows editing of the layer groups.";
/* %start-doc actions EditLayerGroups
diff --git a/src/move.c b/src/move.c
index 5e3913c..3ded0d0 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1057,7 +1057,7 @@ MoveLayer (int old_index, int new_index)
static const char movelayer_syntax[] = "MoveLayer(old,new)";
-static const char movelayer_help[] = "Moves/Creates/Deletes Layers";
+static const char movelayer_help[] = "Moves/Creates/Deletes Layers.";
/* %start-doc actions MoveLayer
|
|
From: <gi...@gp...> - 2011-03-13 04:14:34
|
The branch, master has been updated
via 60f6fa16eda93c10dfc1ed8d030bebeeb0cb9693 (commit)
via 9bf4aff635db035db91c601547b60de92db76abb (commit)
from 64bbe4248f8b194a6a8d620c477744f702d1781b (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 | 5 ++
m4/m4_ax_func_mkdir.m4 | 99 ++++++++++++++++++++++++++++++++++++++++++++++
src/hid/common/hidinit.c | 6 +--
src/hid/gtk/gui-config.c | 5 +-
src/misc.h | 23 +++++++++++
5 files changed, 131 insertions(+), 7 deletions(-)
create mode 100644 m4/m4_ax_func_mkdir.m4
=================
Commit Messages
=================
commit 60f6fa16eda93c10dfc1ed8d030bebeeb0cb9693
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Make io.h inclusion conditional on the mingw case.
:100644 100644 0ab8002... 208ef88... M src/misc.h
commit 9bf4aff635db035db91c601547b60de92db76abb
Author: Bob Paddock <bob...@gm...>
Commit: DJ Delorie <dj...@de...>
mkdir() takes only one argument under WIN32.
Add check whether mkdir() is mkdir or _mkdir, and whether it takes one
or two arguments. WIN32 mkdir takes one argument and POSIX takes
two.
Use MKDIR() macro from misc.h everyplace to get correct behavior
depending on platform.
:100644 100644 b139388... 87814cd... M configure.ac
:000000 100644 0000000... 6c213e5... A m4/m4_ax_func_mkdir.m4
:100644 100644 9c4f8ee... 554e592... M src/hid/common/hidinit.c
:100644 100644 516feb5... 79d543d... M src/hid/gtk/gui-config.c
:100644 100644 776e309... 0ab8002... M src/misc.h
=========
Changes
=========
commit 60f6fa16eda93c10dfc1ed8d030bebeeb0cb9693
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Make io.h inclusion conditional on the mingw case.
diff --git a/src/misc.h b/src/misc.h
index 0ab8002..208ef88 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -133,9 +133,9 @@ void NetlistChanged (int force_unfreeze);
* two.
*/
#if HAVE_MKDIR
-#include <io.h> /* mkdir under MinGW only takes one argument */
#if MKDIR_TAKES_ONE_ARG
/* MinGW32 */
+#include <io.h> /* mkdir under MinGW only takes one argument */
#define MKDIR(a, b) mkdir(a)
#else
#define MKDIR(a, b) mkdir(a, b)
commit 9bf4aff635db035db91c601547b60de92db76abb
Author: Bob Paddock <bob...@gm...>
Commit: DJ Delorie <dj...@de...>
mkdir() takes only one argument under WIN32.
Add check whether mkdir() is mkdir or _mkdir, and whether it takes one
or two arguments. WIN32 mkdir takes one argument and POSIX takes
two.
Use MKDIR() macro from misc.h everyplace to get correct behavior
depending on platform.
diff --git a/configure.ac b/configure.ac
index b139388..87814cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1007,6 +1007,11 @@ AC_ARG_ENABLE([debug],
AC_MSG_RESULT([$enable_debug])
AM_CONDITIONAL(DEBUG_BUILD, test x$enable_debug = xyes)
+# ------------- mkdir required for win32 compatibility ------------
+# WIN32 mkdir takes only one argument, POSIX takes two.
+# #include "misc.h" where mkdir is required.
+m4_include([m4/m4_ax_func_mkdir.m4])
+AX_FUNC_MKDIR
# ------------- Complete set of CFLAGS and LIBS -------------------
diff --git a/m4/m4_ax_func_mkdir.m4 b/m4/m4_ax_func_mkdir.m4
new file mode 100644
index 0000000..6c213e5
--- /dev/null
+++ b/m4/m4_ax_func_mkdir.m4
@@ -0,0 +1,99 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_func_mkdir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_FUNC_MKDIR
+#
+# DESCRIPTION
+#
+# Check whether mkdir() is mkdir or _mkdir, and whether it takes one or
+# two arguments.
+#
+# This macro can define HAVE_MKDIR, HAVE__MKDIR, and MKDIR_TAKES_ONE_ARG,
+# which are expected to be used as follows:
+#
+# #if HAVE_MKDIR
+# # if MKDIR_TAKES_ONE_ARG
+# /* MinGW32 */
+# # define mkdir(a, b) mkdir(a)
+# # endif
+# #else
+# # if HAVE__MKDIR
+# /* plain Windows 32 */
+# # define mkdir(a, b) _mkdir(a)
+# # else
+# # error "Don't know how to create a directory on this system."
+# # endif
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alexandre Duret-Lutz <ad...@gn...>
+#
+# 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/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AU_ALIAS([AC_FUNC_MKDIR], [AX_FUNC_MKDIR])
+AC_DEFUN([AX_FUNC_MKDIR],
+[AC_CHECK_FUNCS([mkdir _mkdir])
+AC_CACHE_CHECK([whether mkdir takes one argument],
+ [ac_cv_mkdir_takes_one_arg],
+[AC_TRY_COMPILE([
+#include <sys/stat.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+], [mkdir (".");],
+[ac_cv_mkdir_takes_one_arg=yes], [ac_cv_mkdir_takes_one_arg=no])])
+if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then
+ AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
+ [Define if mkdir takes only one argument.])
+fi
+])
+
+dnl Note:
+dnl =====
+dnl I have not implemented the following suggestion because I don't have
+dnl access to such a broken environment to test the macro. So I'm just
+dnl appending the comments here in case you have, and want to fix
+dnl AX_FUNC_MKDIR that way.
+dnl
+dnl |Thomas E. Dickey (di...@he...) said:
+dnl | it doesn't cover the problem areas (compilers that mistreat mkdir
+dnl | may prototype it in dir.h and dirent.h, for instance).
+dnl |
+dnl |Alexandre:
+dnl | Would it be sufficient to check for these headers and #include
+dnl | them in the AC_TRY_COMPILE block? (and is AC_HEADER_DIRENT
+dnl | suitable for this?)
+dnl |
+dnl |Thomas:
+dnl | I think that might be a good starting point (with the set of recommended
+dnl | ifdef's and includes for AC_HEADER_DIRENT, of course).
diff --git a/src/hid/common/hidinit.c b/src/hid/common/hidinit.c
index 9c4f8ee..554e592 100644
--- a/src/hid/common/hidinit.c
+++ b/src/hid/common/hidinit.c
@@ -431,11 +431,7 @@ hid_save_settings (int locally)
fname = Concat (homedir, PCB_DIR_SEPARATOR_S, ".pcb", NULL);
if (stat (fname, &st))
-#ifdef WIN32
- if (mkdir (fname))
-#else
- if (mkdir (fname, 0777))
-#endif
+ if (MKDIR (fname, 0777))
{
free (fname);
return;
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index 516feb5..79d543d 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -45,6 +45,7 @@
#include "file.h"
#include "error.h"
#include "draw.h"
+#include "misc.h" /* MKDIR() */
#include "set.h"
#if 0
@@ -196,7 +197,7 @@ config_file_open (gchar * mode)
config_dir =
g_build_path (G_DIR_SEPARATOR_S, homedir, PCB_CONFIG_DIR, NULL);
if (!g_file_test (config_dir, G_FILE_TEST_IS_DIR)
- && mkdir (config_dir, 0755) < 0)
+ && MKDIR (config_dir, 0755) < 0)
{
g_message ("config_file_open: Can't make \"%s\" directory!",
config_dir);
@@ -212,7 +213,7 @@ config_file_open (gchar * mode)
g_build_path (G_DIR_SEPARATOR_S, config_dir, PCB_COLORS_DIR, NULL);
if (!g_file_test (color_dir, G_FILE_TEST_IS_DIR))
{
- if (mkdir (color_dir, 0755) < 0)
+ if (MKDIR (color_dir, 0755) < 0)
{
g_message ("config_file_open: Can't make \"%s\" directory!",
color_dir);
diff --git a/src/misc.h b/src/misc.h
index 776e309..0ab8002 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -127,4 +127,27 @@ int ElementOrientation (ElementType *e);
void NetlistChanged (int force_unfreeze);
+/*
+ * Check whether mkdir() is mkdir or _mkdir, and whether it takes one
+ * or two arguments. WIN32 mkdir takes one argument and POSIX takes
+ * two.
+ */
+#if HAVE_MKDIR
+#include <io.h> /* mkdir under MinGW only takes one argument */
+ #if MKDIR_TAKES_ONE_ARG
+ /* MinGW32 */
+ #define MKDIR(a, b) mkdir(a)
+ #else
+ #define MKDIR(a, b) mkdir(a, b)
+ #endif
+#else
+ #if HAVE__MKDIR
+ /* plain Windows 32 */
+ #define MKDIR(a, b) _mkdir(a)
+ #else
+ #error "Don't know how to create a directory on this system."
+ #endif
#endif
+
+#endif /* __MISC_INCLUDED__ */
+
|