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-05-22 22:00:45
|
The branch, master has been updated
via 1305b9c187237a3726cdb525445ba2debd8ddbd4 (commit)
from 416ccb60d759cd0e4e27d230a2af01bcc9f3ccdc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/gpcb-menu.res | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
=================
Commit Messages
=================
commit 1305b9c187237a3726cdb525445ba2debd8ddbd4
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
Fix warning for gtk describing menuitems
With GTK+ there are no 'describing menuitems' avaiable (the out-grayed items
in lesstif-GUI). For this reason, the items in gpcb-menu.res are ignored and
a warning is displayed at the message-log.
This patch fixes this by removing these describing menuitems for the gtk-GUI
and renamed the described items to a more explaining label.
It also added mnemonics for these menu-items.
Closes-bug: lp-769815
:100644 100644 9b6e612... e9469e9... M src/gpcb-menu.res
=========
Changes
=========
commit 1305b9c187237a3726cdb525445ba2debd8ddbd4
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
Fix warning for gtk describing menuitems
With GTK+ there are no 'describing menuitems' avaiable (the out-grayed items
in lesstif-GUI). For this reason, the items in gpcb-menu.res are ignored and
a warning is displayed at the message-log.
This patch fixes this by removing these describing menuitems for the gtk-GUI
and renamed the described items to a more explaining label.
It also added mnemonics for these menu-items.
Closes-bug: lp-769815
diff --git a/src/gpcb-menu.res b/src/gpcb-menu.res
index 9b6e612..e9469e9 100644
--- a/src/gpcb-menu.res
+++ b/src/gpcb-menu.res
@@ -215,13 +215,12 @@ MainMenu =
{"Check polygons" checked=checkplanes Display(ToggleCheckPlanes)}
-
{"Vendor drill mapping" ToggleVendor() checked=VendorMapOn}
- {"Import Settings"
- {"New elements added at..." foreground=grey50 sensitive=false}
- {" Center" Import(setnewpoint,center)}
- {" Mark" Import(setnewpoint,mark)}
- {" Crosshair" Import(setnewpoint)}
+ {"Import New Elements at" m=I
+ {" Center" Import(setnewpoint,center) m=C}
+ {" Mark" Import(setnewpoint,mark) m=M}
+ {" Crosshair" Import(setnewpoint) m=h}
-
- {"Set Dispersion" Import(setdisperse)}
+ {"Set Dispersion" Import(setdisperse) m=D}
}
}
@@ -304,12 +303,11 @@ MainMenu =
{"Break buffer elements to pieces" PasteBuffer(Restore)}
{"Save buffer elements to file" Save(PasteBuffer)}
-
- {"Select current buffer" foreground=grey50 sensitive=false}
- {"#1" checked=buffer,1 PasteBuffer(1) a={"Shift-1" "Shift<Key>1"}}
- {"#2" checked=buffer,2 PasteBuffer(2) a={"Shift-2" "Shift<Key>2"}}
- {"#3" checked=buffer,3 PasteBuffer(3) a={"Shift-3" "Shift<Key>3"}}
- {"#4" checked=buffer,4 PasteBuffer(4) a={"Shift-4" "Shift<Key>4"}}
- {"#5" checked=buffer,5 PasteBuffer(5) a={"Shift-5" "Shift<Key>5"}}
+ {"Select Buffer #1" checked=buffer,1 PasteBuffer(1) m=1 a={"Shift-1" "Shift<Key>1"}}
+ {"Select Buffer #2" checked=buffer,2 PasteBuffer(2) m=2 a={"Shift-2" "Shift<Key>2"}}
+ {"Select Buffer #3" checked=buffer,3 PasteBuffer(3) m=3 a={"Shift-3" "Shift<Key>3"}}
+ {"Select Buffer #4" checked=buffer,4 PasteBuffer(4) m=4 a={"Shift-4" "Shift<Key>4"}}
+ {"Select Buffer #5" checked=buffer,5 PasteBuffer(5) m=5 a={"Shift-5" "Shift<Key>5"}}
}
#
|
|
From: <gi...@gp...> - 2011-05-22 21:45:49
|
The branch, master has been updated
via 416ccb60d759cd0e4e27d230a2af01bcc9f3ccdc (commit)
from 1bdbe76f428d1c536ce460c34290e639f7a95746 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-output-events.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
=================
Commit Messages
=================
commit 416ccb60d759cd0e4e27d230a2af01bcc9f3ccdc
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
hid/gtk: Cleanup conditional code because GTK 2.12 is required now
Closes-bug: lp-699510
:100644 100644 5f5f16e... c275d7b... M src/hid/gtk/gui-output-events.c
=========
Changes
=========
commit 416ccb60d759cd0e4e27d230a2af01bcc9f3ccdc
Author: Felix Ruoff <Fe...@po...>
Commit: Krzysztof KoÅciuszkiewicz <k.k...@gm...>
hid/gtk: Cleanup conditional code because GTK 2.12 is required now
Closes-bug: lp-699510
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 5f5f16e..c275d7b 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -518,13 +518,6 @@ ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
}
-#if GTK_CHECK_VERSION(2,12,0)
-# define ENABLE_TOOLTIPS 1
-#else
-# define ENABLE_TOOLTIPS 0
-#endif
-
-#if ENABLE_TOOLTIPS
static char *
describe_location (LocationType X, LocationType Y)
{
@@ -638,7 +631,6 @@ queue_tooltip_update (GHidPort *out)
(GSourceFunc) check_object_tooltips,
out);
}
-#endif
gint
ghid_port_window_motion_cb (GtkWidget * widget,
|
|
From: <gi...@gp...> - 2011-05-20 15:32:15
|
The branch, master has been updated
via 1bdbe76f428d1c536ce460c34290e639f7a95746 (commit)
from 8eac3630132ca958a1cd56ebf491cb7863b23bdf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 1bdbe76f428d1c536ce460c34290e639f7a95746
Author: Colin D Bennett <co...@gi...>
Commit: DJ Delorie <dj...@de...>
Fix typo exporting plated vs unplated drills.
Closes-bug: lp-785463
:100644 100644 da848a7... ef465cb... M src/draw.c
=========
Changes
=========
commit 1bdbe76f428d1c536ce460c34290e639f7a95746
Author: Colin D Bennett <co...@gi...>
Commit: DJ Delorie <dj...@de...>
Fix typo exporting plated vs unplated drills.
Closes-bug: lp-785463
diff --git a/src/draw.c b/src/draw.c
index da848a7..ef465cb 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -725,7 +725,7 @@ DrawEverything (BoxTypePtr drawn_area)
gui->end_layer ();
}
- if (unplated && gui->set_layer ("unplated-drill", SL (PDRILL, 0), 0))
+ if (unplated && gui->set_layer ("unplated-drill", SL (UDRILL, 0), 0))
{
DrawHoles (false, true, drawn_area);
gui->end_layer ();
|
|
From: <gi...@gp...> - 2011-05-20 05:07:23
|
The branch, master has been updated
via 8eac3630132ca958a1cd56ebf491cb7863b23bdf (commit)
from cb9f0505f8342be5034d624c88f013d11c229b6a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/png/png.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 8eac3630132ca958a1cd56ebf491cb7863b23bdf
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Don't register the PNG hid if there are no file formats to use.
In some cases, the GD library may not have any usable image formats for
us to use, resulting in an empty filetypes[] table. Rather than trying
to accomodate an empty table during export, it's easier (and perhaps
better) to simply not register the PNG hid in that case. Thus, the
exporter is simply not available when the table is empty.
:100644 100644 279e39c... 06d4296... M src/hid/png/png.c
=========
Changes
=========
commit 8eac3630132ca958a1cd56ebf491cb7863b23bdf
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Don't register the PNG hid if there are no file formats to use.
In some cases, the GD library may not have any usable image formats for
us to use, resulting in an empty filetypes[] table. Rather than trying
to accomodate an empty table during export, it's easier (and perhaps
better) to simply not register the PNG hid in that case. Thus, the
exporter is simply not available when the table is empty.
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 279e39c..06d4296 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -135,17 +135,26 @@ static int doing_outline, have_outline;
#define FMT_jpg "JPEG"
#define FMT_png "PNG"
+/* If this table has no elements in it, then we have no reason to
+ register this HID and will refrain from doing so at the end of this
+ file. */
+
+#undef HAVE_SOME_FORMAT
+
static const char *filetypes[] = {
#ifdef HAVE_GDIMAGEPNG
FMT_png,
+#define HAVE_SOME_FORMAT 1
#endif
#ifdef HAVE_GDIMAGEGIF
FMT_gif,
+#define HAVE_SOME_FORMAT 1
#endif
#ifdef HAVE_GDIMAGEJPEG
FMT_jpg,
+#define HAVE_SOME_FORMAT 1
#endif
NULL
@@ -1545,7 +1554,9 @@ hid_png_init ()
png_hid.calibrate = png_calibrate;
png_hid.set_crosshair = png_set_crosshair;
+#ifdef HAVE_SOME_FORMAT
hid_register_hid (&png_hid);
#include "png_lists.h"
+#endif
}
|
|
From: <gi...@gp...> - 2011-05-20 04:53:32
|
The branch, master has been updated
via cb9f0505f8342be5034d624c88f013d11c229b6a (commit)
from 0adead1b4f810e066d547e7f603060348e45eef1 (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 | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit cb9f0505f8342be5034d624c88f013d11c229b6a
Author: Felix Ruoff <Fe...@po...>
Commit: DJ Delorie <dj...@de...>
Ignore *.pcb files on generating library
Closes-bug: lp-699261
:100644 100644 b1c8182... 682aa02... M src/file.c
=========
Changes
=========
commit cb9f0505f8342be5034d624c88f013d11c229b6a
Author: Felix Ruoff <Fe...@po...>
Commit: DJ Delorie <dj...@de...>
Ignore *.pcb files on generating library
Closes-bug: lp-699261
diff --git a/src/file.c b/src/file.c
index b1c8182..682aa02 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1239,7 +1239,8 @@ LoadNewlibFootprintsFromDir(char *libpath, char *toppath)
&& NSTRCMP (subdirentry->d_name, "Makefile.am") != 0
&& NSTRCMP (subdirentry->d_name, "Makefile.in") != 0
&& (l < 4 || NSTRCMP(subdirentry->d_name + (l - 4), ".png") != 0)
- && (l < 5 || NSTRCMP(subdirentry->d_name + (l - 5), ".html") != 0) )
+ && (l < 5 || NSTRCMP(subdirentry->d_name + (l - 5), ".html") != 0)
+ && (l < 4 || NSTRCMP(subdirentry->d_name + (l - 4), ".pcb") != 0) )
{
#ifdef DEBUG
/* printf("... Found a footprint %s ... \n", subdirentry->d_name); */
|
|
From: <gi...@gp...> - 2011-05-20 04:43:39
|
The branch, master has been updated
via 0adead1b4f810e066d547e7f603060348e45eef1 (commit)
from c2f52c71e6b199ae2196924b0d1cfd4fa8f23446 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/common/flags.c | 32 +++++++++++--
src/hid/gcode/gcode.c | 6 +-
src/hid/gerber/gerber.c | 118 +++++++++++++++++++++++++++++++++++++++++-----
src/hid/hidint.h | 12 ++++-
src/hid/nelma/nelma.c | 10 ++--
src/hid/ps/ps.c | 8 ++--
6 files changed, 155 insertions(+), 31 deletions(-)
=================
Commit Messages
=================
commit 0adead1b4f810e066d547e7f603060348e45eef1
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add option to specify gerber output file style.
--name-style <fixed|single|first|eagle>
Naming style for individual gerber files
Default is "fixed" which uses a fixed name (foo.top.gbr) for each layer.
"single" uses the layer's name if there's exactly one layer in that
group, else the fixed name. "first" always uses the layer name,
choosing the first layer in each group for the name. "eagle" mode adds
a three-character suffix instead of a separate type and extension.
Affects-bug: lp-700877
:100644 100644 15e77ad... 669b2ab... M src/hid/common/flags.c
:100644 100644 2f26c8e... 8c545ea... M src/hid/gcode/gcode.c
:100644 100644 7737444... 1e5b7f5... M src/hid/gerber/gerber.c
:100644 100644 8302745... b986f78... M src/hid/hidint.h
:100644 100644 8c78a53... 4f5f748... M src/hid/nelma/nelma.c
:100644 100644 7f2c3d7... c1a62ab... M src/hid/ps/ps.c
=========
Changes
=========
commit 0adead1b4f810e066d547e7f603060348e45eef1
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add option to specify gerber output file style.
--name-style <fixed|single|first|eagle>
Naming style for individual gerber files
Default is "fixed" which uses a fixed name (foo.top.gbr) for each layer.
"single" uses the layer's name if there's exactly one layer in that
group, else the fixed name. "first" always uses the layer name,
choosing the first layer in each group for the name. "eagle" mode adds
a three-character suffix instead of a separate type and extension.
Affects-bug: lp-700877
diff --git a/src/hid/common/flags.c b/src/hid/common/flags.c
index 15e77ad..669b2ab 100644
--- a/src/hid/common/flags.c
+++ b/src/hid/common/flags.c
@@ -148,9 +148,11 @@ hid_restore_layer_ons (int *save_array)
}
const char *
-layer_type_to_file_name (int idx)
+layer_type_to_file_name (int idx, int style)
{
int group;
+ int nlayers;
+ const char *single_name;
switch (idx)
{
@@ -180,17 +182,37 @@ layer_type_to_file_name (int idx)
return "bottomassembly";
default:
group = GetLayerGroupNumberByNumber(idx);
+ nlayers = PCB->LayerGroups.Number[group];
+ single_name = PCB->Data->Layer[idx].Name;
if (group == GetLayerGroupNumberByNumber(component_silk_layer))
- return "top";
+ {
+ if (style == FNS_first
+ || (style == FNS_single
+ && nlayers == 2))
+ return single_name;
+ return "top";
+ }
else if (group == GetLayerGroupNumberByNumber(solder_silk_layer))
- return "bottom";
- else if (PCB->LayerGroups.Number[group] == 1
+ {
+ if (style == FNS_first
+ || (style == FNS_single
+ && nlayers == 2))
+ return single_name;
+ return "bottom";
+ }
+ else if (nlayers == 1
&& (strcmp (PCB->Data->Layer[idx].Name, "route") == 0 ||
strcmp (PCB->Data->Layer[idx].Name, "outline") == 0))
- return "outline";
+ {
+ return "outline";
+ }
else
{
static char buf[20];
+ if (style == FNS_first
+ || (style == FNS_single
+ && nlayers == 1))
+ return single_name;
sprintf (buf, "group%d", group);
return buf;
}
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 2f26c8e..8c545ea 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -462,12 +462,12 @@ gcode_do_export (HID_Attr_Val * options)
/* magic */
idx = (i >= 0 && i < max_group) ?
PCB->LayerGroups.Entries[i][0] : i;
- printf ("idx=%d %s\n", idx, layer_type_to_file_name (idx));
+ printf ("idx=%d %s\n", idx, layer_type_to_file_name (idx, FNS_fixed));
is_solder =
(GetLayerGroupNumberByNumber (idx) ==
GetLayerGroupNumberByNumber (solder_silk_layer)) ? 1 : 0;
save_drill = is_solder; /* save drills for one layer only */
- gcode_start_png (gcode_basename, layer_type_to_file_name (idx));
+ gcode_start_png (gcode_basename, layer_type_to_file_name (idx, FNS_fixed));
hid_save_and_show_layer_ons (save_ons);
gcode_start_png_export ();
hid_restore_layer_ons (save_ons);
@@ -496,7 +496,7 @@ gcode_do_export (HID_Attr_Val * options)
gdImageDestroy (temp_im);
}
sprintf (filename, "%s.%s.cnc", gcode_basename,
- layer_type_to_file_name (idx));
+ layer_type_to_file_name (idx, FNS_fixed));
for (r = 0; r < gdImageSX (gcode_im); r++)
{
for (c = 0; c < gdImageSY (gcode_im); c++)
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 7737444..1e5b7f5 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -92,6 +92,7 @@ static int is_drill;
static int current_mask;
static int flash_drills;
static int copy_outline_mode;
+static int name_style;
static LayerTypePtr outline_layer;
enum ApertureShape
@@ -315,6 +316,18 @@ static const char *copy_outline_names[] = {
0
};
+static const char *name_style_names[] = {
+#define NAME_STYLE_FIXED 0
+ "fixed",
+#define NAME_STYLE_SINGLE 1
+ "single",
+#define NAME_STYLE_FIRST 2
+ "first",
+#define NAME_STYLE_EAGLE 3
+ "eagle",
+ 0
+};
+
static HID_Attribute gerber_options[] = {
{"gerberfile", "Gerber output file base",
HID_String, 0, 0, {0, 0, 0}, 0, 0},
@@ -328,6 +341,9 @@ 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
+ {"name-style", "Naming style for individual gerber files",
+ HID_Enum, 0, 0, {0, 0, 0}, name_style_names, 0},
+#define HA_name_style 4
};
#define NUM_OPTIONS (sizeof(gerber_options)/sizeof(gerber_options[0]))
@@ -381,6 +397,90 @@ maybe_close_f ()
static BoxType region;
+/* Very similar to layer_type_to_file_name() but appends only a
+ three-character suffix compatible with Eagle's defaults. */
+static void
+assign_eagle_file_suffix (int idx)
+{
+ int group;
+ int nlayers;
+ char *suff = "out";
+
+ switch (idx)
+ {
+ case SL (SILK, TOP): suff = "plc"; break;
+ case SL (SILK, BOTTOM): suff = "pls"; break;
+ case SL (MASK, TOP): suff = "stc"; break;
+ case SL (MASK, BOTTOM): suff = "sts"; break;
+ case SL (PDRILL, 0): suff = "drd"; break;
+ case SL (UDRILL, 0): suff = "dru"; break;
+ case SL (PASTE, TOP): suff = "crc"; break;
+ case SL (PASTE, BOTTOM): suff = "crs"; break;
+ case SL (INVISIBLE, 0): suff = "inv"; break;
+ case SL (FAB, 0): suff = "fab"; break;
+ case SL (ASSY, TOP): suff = "ast"; break;
+ case SL (ASSY, BOTTOM): suff = "asb"; break;
+
+ default:
+ group = GetLayerGroupNumberByNumber(idx);
+ nlayers = PCB->LayerGroups.Number[group];
+ if (group == GetLayerGroupNumberByNumber(component_silk_layer))
+ {
+ suff = "cmp";
+ }
+ else if (group == GetLayerGroupNumberByNumber(solder_silk_layer))
+ {
+ suff = "sol";
+ }
+ else if (nlayers == 1
+ && (strcmp (PCB->Data->Layer[idx].Name, "route") == 0 ||
+ strcmp (PCB->Data->Layer[idx].Name, "outline") == 0))
+ {
+ suff = "oln";
+ }
+ else
+ {
+ static char buf[20];
+ sprintf (buf, "ly%d", group);
+ suff = buf;
+ }
+ break;
+ }
+
+ strcpy (filesuff, suff);
+}
+
+static void
+assign_file_suffix (int idx)
+{
+ int fns_style;
+ const char *sext = ".gbr";
+
+ switch (name_style)
+ {
+ default:
+ case NAME_STYLE_FIXED: fns_style = FNS_fixed; break;
+ case NAME_STYLE_SINGLE: fns_style = FNS_single; break;
+ case NAME_STYLE_FIRST: fns_style = FNS_first; break;
+ case NAME_STYLE_EAGLE:
+ assign_eagle_file_suffix (idx);
+ return;
+ }
+
+ switch (idx)
+ {
+ case SL (PDRILL, 0):
+ sext = ".cnc";
+ break;
+ case SL (UDRILL, 0):
+ sext = ".cnc";
+ break;
+ }
+
+ strcpy (filesuff, layer_type_to_file_name (idx, fns_style));
+ strcat (filesuff, sext);
+}
+
static void
gerber_do_export (HID_Attr_Val * options)
{
@@ -410,6 +510,7 @@ gerber_do_export (HID_Attr_Val * options)
all_layers = options[HA_all_layers].int_value;
copy_outline_mode = options[HA_copy_outline].int_value;
+ name_style = options[HA_name_style].int_value;
outline_layer = NULL;
@@ -568,7 +669,6 @@ gerber_set_layer (const char *name, int group, int empty)
#ifdef HAVE_GETPWUID
struct passwd *pwentry;
#endif
- char *sext=".gbr";
int i;
int some_apertures = 0;
@@ -591,17 +691,7 @@ gerber_set_layer (const char *name, int group, int empty)
maybe_close_f ();
pagecount++;
- switch (idx)
- {
- case SL (PDRILL, 0):
- sext = ".cnc";
- break;
- case SL (UDRILL, 0):
- sext = ".cnc";
- break;
- }
- strcpy (filesuff, layer_type_to_file_name (idx));
- strcat (filesuff, sext);
+ assign_file_suffix (idx);
f = fopen (filename, "w");
if (f == NULL)
{
@@ -670,7 +760,9 @@ gerber_set_layer (const char *name, int group, int empty)
if (layername)
free (layername);
layername = strdup (filesuff);
- layername[strlen(layername) - strlen(sext)] = 0;
+ if (strrchr (layername, '.'))
+ * strrchr (layername, '.') = 0;
+
for (cp=layername; *cp; cp++)
{
if (isalnum((int) *cp))
diff --git a/src/hid/hidint.h b/src/hid/hidint.h
index 8302745..b986f78 100644
--- a/src/hid/hidint.h
+++ b/src/hid/hidint.h
@@ -51,8 +51,18 @@ void hid_save_and_show_layer_ons (int *save_array);
/* Use this to restore them. */
void hid_restore_layer_ons (int *save_array);
+enum File_Name_Style {
+ /* Files for copper layers are named top, groupN, bottom. */
+ FNS_fixed,
+ /* Groups with multiple layers are named as above, else the single
+ layer name is used. */
+ FNS_single,
+ /* The name of the first layer in each group is used. */
+ FNS_first,
+};
+
/* Returns a filename base that can be used to output the layer. */
-const char *layer_type_to_file_name (int idx);
+const char *layer_type_to_file_name (int idx, int style);
#ifdef __GLOBAL_INCLUDED__
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index 8c78a53..4f5f748 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -256,7 +256,7 @@ nelma_write_space(FILE * out)
if (nelma_export_group[i]) {
idx = (i >= 0 && i < max_group) ?
PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx);
+ ext = layer_type_to_file_name(idx, FNS_fixed);
if (z != 10) {
fprintf(out, ",\n");
@@ -326,7 +326,7 @@ nelma_write_nets(FILE * out)
if (nelma_export_group[i]) {
idx = (i >= 0 && i < max_group) ?
PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx);
+ ext = layer_type_to_file_name(idx, FNS_fixed);
if (m != 0 || i != 0)
fprintf(out, ",\n");
@@ -404,7 +404,7 @@ nelma_write_layers(FILE * out)
if (nelma_export_group[i]) {
idx = (i >= 0 && i < max_group) ?
PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx);
+ ext = layer_type_to_file_name(idx, FNS_fixed);
if (z != 10) {
sprintf(buf, "substrate-%d", z);
@@ -444,7 +444,7 @@ nelma_write_object(FILE * out, LibraryEntryTypePtr pin)
if (nelma_export_group[i]) {
idx = (i >= 0 && i < max_group) ?
PCB->LayerGroups.Entries[i][0] : i;
- ext = layer_type_to_file_name(idx);
+ ext = layer_type_to_file_name(idx, FNS_fixed);
fprintf(out, "object %s-%s {\n", pin->ListEntry, ext);
fprintf(out, "\tposition = { 0, 0 }\n");
@@ -668,7 +668,7 @@ nelma_do_export(HID_Attr_Val * options)
PCB->LayerGroups.Entries[i][0] : i;
nelma_start_png(nelma_basename,
- layer_type_to_file_name(idx));
+ layer_type_to_file_name(idx, FNS_fixed));
hid_save_and_show_layer_ons(save_ons);
nelma_start_png_export();
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index 7f2c3d7..c1a62ab 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -716,7 +716,7 @@ ps_set_layer (const char *name, int group, int empty)
ps_end_file (f);
fclose (f);
}
- f = psopen (filename, layer_type_to_file_name (idx));
+ f = psopen (filename, layer_type_to_file_name (idx, FNS_fixed));
if (!f)
{
perror(filename);
@@ -734,7 +734,7 @@ ps_set_layer (const char *name, int group, int empty)
* ordinal page number must reflect the position of that page in
* the body of the PostScript file and must start with 1, not 0.
*/
- fprintf (f, "%%%%Page: %s %d\n", layer_type_to_file_name(idx), pagecount);
+ fprintf (f, "%%%%Page: %s %d\n", layer_type_to_file_name(idx, FNS_fixed), pagecount);
if (mirror)
mirror_this = 1 - mirror_this;
@@ -750,10 +750,10 @@ ps_set_layer (const char *name, int group, int empty)
fprintf (f, "30 30 moveto (%s) show\n", PCB->Filename);
if (PCB->Name)
fprintf (f, "30 41 moveto (%s, %s) show\n",
- PCB->Name, layer_type_to_file_name (idx));
+ PCB->Name, layer_type_to_file_name (idx, FNS_fixed));
else
fprintf (f, "30 41 moveto (%s) show\n",
- layer_type_to_file_name (idx));
+ layer_type_to_file_name (idx, FNS_fixed));
if (mirror_this)
fprintf (f, "( \\(mirrored\\)) show\n");
|
|
From: <gi...@gp...> - 2011-05-20 01:27:44
|
The branch, master has been updated
via c2f52c71e6b199ae2196924b0d1cfd4fa8f23446 (commit)
from bc21ef592fc14e7ca9d483892473a522ff645368 (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/move.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 43 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit c2f52c71e6b199ae2196924b0d1cfd4fa8f23446
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Avoid top/bottom issues with layer deletion.
PCB does not currently support boards without a top or bottom, so
prevent the user from deleting them (they'd need to reassign the
top/bottom groups first).
:100644 100644 de1e2e7... 3f902b8... M src/move.c
=========
Changes
=========
commit c2f52c71e6b199ae2196924b0d1cfd4fa8f23446
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Avoid top/bottom issues with layer deletion.
PCB does not currently support boards without a top or bottom, so
prevent the user from deleting them (they'd need to reassign the
top/bottom groups first).
diff --git a/src/move.c b/src/move.c
index de1e2e7..3f902b8 100644
--- a/src/move.c
+++ b/src/move.c
@@ -912,6 +912,27 @@ move_all_thermals (int old_index, int new_index)
ENDALL_LOOP;
}
+static int
+LastLayerInComponentGroup (int layer)
+{
+ int cgroup = GetLayerGroupNumberByNumber(max_group + COMPONENT_LAYER);
+ int lgroup = GetLayerGroupNumberByNumber(layer);
+ if (cgroup == lgroup
+ && PCB->LayerGroups.Number[lgroup] == 2)
+ return 1;
+ return 0;
+}
+
+static int
+LastLayerInSolderGroup (int layer)
+{
+ int sgroup = GetLayerGroupNumberByNumber(max_group + SOLDER_LAYER);
+ int lgroup = GetLayerGroupNumberByNumber(layer);
+ if (sgroup == lgroup
+ && PCB->LayerGroups.Number[lgroup] == 2)
+ return 1;
+ return 0;
+}
int
MoveLayer (int old_index, int new_index)
@@ -938,6 +959,23 @@ MoveLayer (int old_index, int new_index)
if (old_index == new_index)
return 0;
+ if (new_index == -1
+ && LastLayerInComponentGroup (old_index))
+ {
+ gui->confirm_dialog ("You can't delete the last top-side layer\n", "Ok", NULL);
+ return 1;
+ }
+
+ if (new_index == -1
+ && LastLayerInSolderGroup (old_index))
+ {
+ gui->confirm_dialog ("You can't delete the last bottom-side layer\n", "Ok", NULL);
+ return 1;
+ }
+
+ for (g = 0; g < MAX_LAYER+2; g++)
+ groups[g] = -1;
+
for (g = 0; g < MAX_LAYER; g++)
for (l = 0; l < PCB->LayerGroups.Number[g]; l++)
groups[PCB->LayerGroups.Entries[g][l]] = g;
@@ -1024,8 +1062,11 @@ MoveLayer (int old_index, int new_index)
{
int i;
g = groups[l];
- i = PCB->LayerGroups.Number[g]++;
- PCB->LayerGroups.Entries[g][i] = l;
+ if (g >= 0)
+ {
+ i = PCB->LayerGroups.Number[g]++;
+ PCB->LayerGroups.Entries[g][i] = l;
+ }
}
for (g = 0; g < MAX_LAYER; g++)
|
|
From: <gi...@gp...> - 2011-05-19 22:16:45
|
The branch, master has been updated
via bc21ef592fc14e7ca9d483892473a522ff645368 (commit)
from c12cc6f769b5ccc603a75361fae3adc930934506 (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 | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit bc21ef592fc14e7ca9d483892473a522ff645368
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix Mark size math wrt unplated holes.
When computing the Mark size, check for the first pin being a hole
and use the drill size rather than the copper size.
:100644 100644 6c3d709... da848a7... M src/draw.c
=========
Changes
=========
commit bc21ef592fc14e7ca9d483892473a522ff645368
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix Mark size math wrt unplated holes.
When computing the Mark size, check for the first pin being a hole
and use the drill size rather than the copper size.
diff --git a/src/draw.c b/src/draw.c
index 6c3d709..da848a7 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -819,7 +819,10 @@ DrawEMark (ElementTypePtr e, LocationType X, LocationType Y,
if (e->Pin != NULL)
{
PinType *pin0 = e->Pin->data;
- mark_size = MIN (mark_size, pin0->Thickness / 2);
+ if (TEST_FLAG (HOLEFLAG, pin0))
+ mark_size = MIN (mark_size, pin0->DrillingHole / 2);
+ else
+ mark_size = MIN (mark_size, pin0->Thickness / 2);
}
if (e->Pad != NULL)
|
|
From: <gi...@gp...> - 2011-05-19 17:18:11
|
The branch, master has been updated
via c12cc6f769b5ccc603a75361fae3adc930934506 (commit)
from 498e5dd36d279a16f2eff27b69967c6aa9f7c31f (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/buffer.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit c12cc6f769b5ccc603a75361fae3adc930934506
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
buffer.c: Update polygon r-tree when adding a polygon to the buffer.
This resulted in a crash when rotating a buffer containing a polygon,
as the polygon r-tree associated with the buffer was NULL despite the
polygon count being non-zero.
Reported-by: Gabriel Paubert <pa...@ir...>
:100644 100644 b396918... 2e63af5... M src/buffer.c
=========
Changes
=========
commit c12cc6f769b5ccc603a75361fae3adc930934506
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
buffer.c: Update polygon r-tree when adding a polygon to the buffer.
This resulted in a crash when rotating a buffer containing a polygon,
as the polygon r-tree associated with the buffer was NULL despite the
polygon count being non-zero.
Reported-by: Gabriel Paubert <pa...@ir...>
diff --git a/src/buffer.c b/src/buffer.c
index b396918..2e63af5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -196,6 +196,15 @@ AddPolygonToBuffer (LayerTypePtr Layer, PolygonTypePtr Polygon)
polygon = CreateNewPolygon (layer, Polygon->Flags);
CopyPolygonLowLevel (polygon, Polygon);
+
+ /* Update the polygon r-tree. Unlike similarly named functions for
+ * other objects, CreateNewPolygon does not do this as it creates a
+ * skeleton polygon object, which won't have correct bounds.
+ */
+ if (!layer->polygon_tree)
+ layer->polygon_tree = r_create_tree (NULL, 0, 0);
+ r_insert_entry (layer->polygon_tree, (BoxType *)polygon, 0);
+
CLEAR_FLAG (FOUNDFLAG | ExtraFlag, polygon);
return (polygon);
}
|
|
From: <gi...@gp...> - 2011-05-17 23:55:50
|
The branch, master has been updated
via 498e5dd36d279a16f2eff27b69967c6aa9f7c31f (commit)
from ccb2e68847996fb65fac0041be6b2b91501e62cb (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/move.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 498e5dd36d279a16f2eff27b69967c6aa9f7c31f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
move.c: Adjust the object counters when moving objects between layers
This fixes a crash introduced by
commit 2ce35292b9e96da38cb56878005aba20891689eb,
"Convert board objects to GLists of g_slice allocated memory"
It doesn't fix entirity of the defect reported in that bug, but
it restores the prior behaviour where PCB would hang, not segfault.
Reported-by: Colin Bennett <co...@gi...>
Affects-bug: lp-783640
:100644 100644 6ce043a... de1e2e7... M src/move.c
=========
Changes
=========
commit 498e5dd36d279a16f2eff27b69967c6aa9f7c31f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
move.c: Adjust the object counters when moving objects between layers
This fixes a crash introduced by
commit 2ce35292b9e96da38cb56878005aba20891689eb,
"Convert board objects to GLists of g_slice allocated memory"
It doesn't fix entirity of the defect reported in that bug, but
it restores the prior behaviour where PCB would hang, not segfault.
Reported-by: Colin Bennett <co...@gi...>
Affects-bug: lp-783640
diff --git a/src/move.c b/src/move.c
index 6ce043a..de1e2e7 100644
--- a/src/move.c
+++ b/src/move.c
@@ -442,7 +442,9 @@ MoveLineToLayerLowLevel (LayerType *Source, LineType *line,
r_delete_entry (Source->line_tree, (BoxType *)line);
Source->Line = g_list_remove (Source->Line, line);
+ Source->LineN --;
Destination->Line = g_list_append (Destination->Line, line);
+ Destination->LineN ++;
if (!Destination->line_tree)
Destination->line_tree = r_create_tree (NULL, 0, 0);
@@ -460,7 +462,9 @@ MoveArcToLayerLowLevel (LayerType *Source, ArcType *arc,
r_delete_entry (Source->arc_tree, (BoxType *)arc);
Source->Arc = g_list_remove (Source->Arc, arc);
+ Source->ArcN --;
Destination->Arc = g_list_append (Destination->Arc, arc);
+ Destination->ArcN ++;
if (!Destination->arc_tree)
Destination->arc_tree = r_create_tree (NULL, 0, 0);
@@ -640,7 +644,9 @@ MoveTextToLayerLowLevel (LayerType *Source, TextType *text,
r_delete_entry (Source->text_tree, (BoxType *)text);
Source->Text = g_list_remove (Source->Text, text);
+ Source->TextN --;
Destination->Text = g_list_append (Destination->Text, text);
+ Destination->TextN ++;
if (GetLayerGroupNumberByNumber (solder_silk_layer) ==
GetLayerGroupNumberByPointer (Destination))
@@ -693,7 +699,9 @@ MovePolygonToLayerLowLevel (LayerType *Source, PolygonType *polygon,
r_delete_entry (Source->polygon_tree, (BoxType *)polygon);
Source->Polygon = g_list_remove (Source->Polygon, polygon);
+ Source->PolygonN --;
Destination->Polygon = g_list_append (Destination->Polygon, polygon);
+ Destination->Polygon ++;
if (!Destination->polygon_tree)
Destination->polygon_tree = r_create_tree (NULL, 0, 0);
|
|
From: <gi...@gp...> - 2011-05-17 10:46:41
|
The branch, master has been updated
via ccb2e68847996fb65fac0041be6b2b91501e62cb (commit)
from 7a09bb3ab5c20ba1e3f687145000c5f142ed2fa6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-output-events.c | 1 +
src/hid/lesstif/menu.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit ccb2e68847996fb65fac0041be6b2b91501e62cb
Author: Gabriel Paubert <pa...@ir...>
Commit: Peter Clifton <pc...@ca...>
Lesstif + GTK HIDs: Ignore ISO Level3 shift modifier key
This key press is found on some international keyboards (e.g. Spanish).
If we don't ignore it, PCB complains about the key not being tied to
an action when it is pressed.
From the committer, Peter Clifton <pc...@ca...>
...
Thanks to Gabriel for reporting this and providing the patch for
Lesstif. I have updated the patch to make the equivalent change to
the GTK HID as well.
Signed-off-By: Peter Clifton <pc...@ca...>
:100644 100644 d969dd2... 5f5f16e... M src/hid/gtk/gui-output-events.c
:100644 100644 297768b... 8de2952... M src/hid/lesstif/menu.c
=========
Changes
=========
commit ccb2e68847996fb65fac0041be6b2b91501e62cb
Author: Gabriel Paubert <pa...@ir...>
Commit: Peter Clifton <pc...@ca...>
Lesstif + GTK HIDs: Ignore ISO Level3 shift modifier key
This key press is found on some international keyboards (e.g. Spanish).
If we don't ignore it, PCB complains about the key not being tied to
an action when it is pressed.
From the committer, Peter Clifton <pc...@ca...>
...
Thanks to Gabriel for reporting this and providing the patch for
Lesstif. I have updated the patch to make the equivalent change to
the GTK HID as well.
Signed-off-By: Peter Clifton <pc...@ca...>
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index d969dd2..5f5f16e 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -345,6 +345,7 @@ ghid_port_key_press_cb (GtkWidget * drawing_area,
case GDK_Shift_L:
case GDK_Shift_R:
case GDK_Shift_Lock:
+ case GDK_ISO_Level3_Shift:
break;
case GDK_Up:
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index 297768b..8de2952 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -1140,6 +1140,7 @@ lesstif_key_event (XKeyEvent * e)
case XK_Super_R:
case XK_Hyper_L:
case XK_Hyper_R:
+ case XK_ISO_Level3_Shift:
return 1;
}
|
|
From: <gi...@gp...> - 2011-05-17 00:10:35
|
The branch, master has been updated
via 7a09bb3ab5c20ba1e3f687145000c5f142ed2fa6 (commit)
from 39dd5f6cd91ec9032c6d2e3ca543e3f8f6cf0e4a (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/buffer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 7a09bb3ab5c20ba1e3f687145000c5f142ed2fa6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
buffer.c: Fix crash in SmashBufferElement
The element is allocated with g_slice_new, so must be free'd with
g_slice_free.
Broken since commit 2ce35292b9e96da38cb56878005aba20891689eb:
Convert board objects to GLists of g_slice allocated memory
:100644 100644 8793f50... b396918... M src/buffer.c
=========
Changes
=========
commit 7a09bb3ab5c20ba1e3f687145000c5f142ed2fa6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
buffer.c: Fix crash in SmashBufferElement
The element is allocated with g_slice_new, so must be free'd with
g_slice_free.
Broken since commit 2ce35292b9e96da38cb56878005aba20891689eb:
Convert board objects to GLists of g_slice allocated memory
diff --git a/src/buffer.c b/src/buffer.c
index 8793f50..b396918 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -926,7 +926,7 @@ SmashBufferElement (BufferTypePtr Buffer)
}
END_LOOP;
FreeElementMemory (element);
- free (element);
+ g_slice_free (ElementType, element);
return (true);
}
|
|
From: <gi...@gp...> - 2011-05-16 00:43:53
|
The branch, master has been updated
via 39dd5f6cd91ec9032c6d2e3ca543e3f8f6cf0e4a (commit)
from 10d0e70387511945f58e7c4a1635b59528dc216c (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/rtree.c | 38 --------------------------------------
src/rtree.h | 2 --
2 files changed, 0 insertions(+), 40 deletions(-)
=================
Commit Messages
=================
commit 39dd5f6cd91ec9032c6d2e3ca543e3f8f6cf0e4a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
rtree.c: Remove unused r_substitute() function
This function was used to update r-trees when they contained objects
changed memory location. Since we no longer shuffle objects around when
we delete them, this function is no longer required.
:100644 100644 83ec41c... 526d2b7... M src/rtree.c
:100644 100644 3e91297... 862bbe9... M src/rtree.h
=========
Changes
=========
commit 39dd5f6cd91ec9032c6d2e3ca543e3f8f6cf0e4a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
rtree.c: Remove unused r_substitute() function
This function was used to update r-trees when they contained objects
changed memory location. Since we no longer shuffle objects around when
we delete them, this function is no longer required.
diff --git a/src/rtree.c b/src/rtree.c
index 83ec41c..526d2b7 100644
--- a/src/rtree.c
+++ b/src/rtree.c
@@ -1106,41 +1106,3 @@ r_delete_entry (rtree_t * rtree, const BoxType * box)
#endif
return r;
}
-
-int
-__r_sub (struct rtree_node *node, const BoxType * b, const BoxType * a,
- jmp_buf * e)
-{
- int i;
-
- if (node->flags.is_leaf)
- {
- for (i = 0; i < M_SIZE; i++)
- if (node->u.rects[i].bptr == b)
- {
- node->u.rects[i].bptr = a;
- assert (a->X1 == node->u.rects[i].bounds.X1);
- assert (a->X2 == node->u.rects[i].bounds.X2);
- assert (a->Y1 == node->u.rects[i].bounds.Y1);
- assert (a->Y2 == node->u.rects[i].bounds.Y2);
- longjmp (*e, 1);
- }
- return 0;
- }
- for (i = 0; i < M_SIZE; i++)
- if (node->u.kids[i] && __r_sub (node->u.kids[i], b, a, e))
- return 1;
- return 0;
-}
-
-
-void
-r_substitute (rtree_t * rtree, const BoxType * before, const BoxType * after)
-{
- jmp_buf env;
-
- if (before == after)
- return;
- if (setjmp (env) == 0)
- __r_sub (rtree->root, before, after, &env);
-}
diff --git a/src/rtree.h b/src/rtree.h
index 3e91297..862bbe9 100644
--- a/src/rtree.h
+++ b/src/rtree.h
@@ -49,8 +49,6 @@ void r_destroy_tree (rtree_t ** rtree);
bool r_delete_entry (rtree_t * rtree, const BoxType * which);
void r_insert_entry (rtree_t * rtree, const BoxType * which, int manage);
-void r_substitute (rtree_t * rtree, const BoxType * before,
- const BoxType * after);
/* generic search routine */
/* region_in_search should return true if "what you're looking for" is
|
|
From: <gi...@gp...> - 2011-05-14 00:39:24
|
The branch, master has been updated
via 10d0e70387511945f58e7c4a1635b59528dc216c (commit)
from 9bad11053dbc145b468fb11d1a605112b40b719a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gtkhid-gl.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 10d0e70387511945f58e7c4a1635b59528dc216c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Draw pretty translucent polygons in thindraw-poly mode
Eventually we need some way to configure this.. it might be nice in
non-thindraw mode too. If people want thin-draw to gain extra speed,
rather than have it actually slower (due to fill + outline), then a
way to turn it off would also be useful.
:100644 100644 a93c607... 4999005... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit 10d0e70387511945f58e7c4a1635b59528dc216c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Draw pretty translucent polygons in thindraw-poly mode
Eventually we need some way to configure this.. it might be nice in
non-thindraw mode too. If people want thin-draw to gain extra speed,
rather than have it actually slower (due to fill + outline), then a
way to turn it off would also be useful.
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index a93c607..4999005 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -573,6 +573,15 @@ ghid_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
}
void
+ghid_thindraw_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
+{
+ common_thindraw_pcb_polygon (gc, poly, clip_box);
+ ghid_set_alpha_mult (gc, 0.25);
+ ghid_fill_pcb_polygon (gc, poly, clip_box);
+ ghid_set_alpha_mult (gc, 1.0);
+}
+
+void
ghid_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
USE_GC (gc);
@@ -802,6 +811,7 @@ ghid_init_renderer (int *argc, char ***argv, GHidPort *port)
/* Setup HID function pointers specific to the GL renderer*/
ghid_hid.end_layer = ghid_end_layer;
ghid_hid.fill_pcb_polygon = ghid_fill_pcb_polygon;
+ ghid_hid.thindraw_pcb_polygon = ghid_thindraw_pcb_polygon;
}
void
|
|
From: <gi...@gp...> - 2011-05-14 00:38:50
|
The branch, master has been updated
via 9bad11053dbc145b468fb11d1a605112b40b719a (commit)
via c53998333ce3542e1029f5a2c1c216e227be339b (commit)
via 5e8e118c05be8585dceda8a30987065b99ce530f (commit)
from e199787705a37b9704eb8f6458b25907e7123e4c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gtkhid-gl.c | 68 ++++++++++++++++++++++++++++------------------
1 files changed, 41 insertions(+), 27 deletions(-)
=================
Commit Messages
=================
commit 9bad11053dbc145b468fb11d1a605112b40b719a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Add facility to set an alpha multiplier for the current rendering
:100644 100644 2a50cd1... a93c607... M src/hid/gtk/gtkhid-gl.c
commit c53998333ce3542e1029f5a2c1c216e227be339b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Refactor alpha handling
Replace "alpha_mult" in set_gl_color_for_gc () with just explicitly calling
this the "a" (alpha) value of the colour in question.
:100644 100644 cfd41ff... 2a50cd1... M src/hid/gtk/gtkhid-gl.c
commit 5e8e118c05be8585dceda8a30987065b99ce530f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Refactor GL colour setup handling
:100644 100644 95e0f11... cfd41ff... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit 9bad11053dbc145b468fb11d1a605112b40b719a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Add facility to set an alpha multiplier for the current rendering
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 2a50cd1..a93c607 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -46,6 +46,7 @@ typedef struct render_priv {
bool in_context;
int subcomposite_stencil_bit;
char *current_colorname;
+ double current_alpha_mult;
} render_priv;
@@ -54,6 +55,7 @@ typedef struct hid_gc_struct
HID *me_pointer;
const char *colorname;
+ double alpha_mult;
gint width;
gint cap, join;
gchar xor;
@@ -172,6 +174,7 @@ ghid_make_gc (void)
rv = g_new0 (hid_gc_struct, 1);
rv->me_pointer = &ghid_hid;
rv->colorname = Settings.BackgroundColor;
+ rv->alpha_mult = 1.0;
return rv;
}
@@ -356,11 +359,13 @@ set_gl_color_for_gc (hidGC gc)
double r, g, b, a;
if (priv->current_colorname != NULL &&
- strcmp (priv->current_colorname, gc->colorname) == 0)
+ strcmp (priv->current_colorname, gc->colorname) == 0 &&
+ priv->current_alpha_mult == gc->alpha_mult)
return;
free (priv->current_colorname);
priv->current_colorname = strdup (gc->colorname);
+ priv->current_alpha_mult = gc->alpha_mult;
if (gport->colormap == NULL)
gport->colormap = gtk_widget_get_colormap (gport->top_window);
@@ -422,6 +427,7 @@ set_gl_color_for_gc (hidGC gc)
}
if (1) {
double maxi, mult;
+ a *= gc->alpha_mult;
if (!priv->trans_lines)
a = 1.0;
maxi = r;
@@ -450,6 +456,13 @@ ghid_set_color (hidGC gc, const char *name)
}
void
+ghid_set_alpha_mult (hidGC gc, double alpha_mult)
+{
+ gc->alpha_mult = alpha_mult;
+ set_gl_color_for_gc (gc);
+}
+
+void
ghid_set_line_cap (hidGC gc, EndCapStyle style)
{
gc->cap = style;
commit c53998333ce3542e1029f5a2c1c216e227be339b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Refactor alpha handling
Replace "alpha_mult" in set_gl_color_for_gc () with just explicitly calling
this the "a" (alpha) value of the colour in question.
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index cfd41ff..2a50cd1 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -353,9 +353,7 @@ set_gl_color_for_gc (hidGC gc)
static void *cache = NULL;
hidval cval;
ColorCache *cc;
- double alpha_mult = 1.0;
double r, g, b, a;
- a = 1.0;
if (priv->current_colorname != NULL &&
strcmp (priv->current_colorname, gc->colorname) == 0)
@@ -371,17 +369,17 @@ set_gl_color_for_gc (hidGC gc)
r = gport->bg_color.red / 65535.;
g = gport->bg_color.green / 65535.;
b = gport->bg_color.blue / 65535.;
+ a = 1.0;
}
else if (strcmp (gc->colorname, "drill") == 0)
{
- alpha_mult = 0.85;
r = gport->offlimits_color.red / 65535.;
g = gport->offlimits_color.green / 65535.;
b = gport->offlimits_color.blue / 65535.;
+ a = 0.85;
}
else
{
- alpha_mult = 0.7;
if (hid_cache_color (0, gc->colorname, &cval, &cache))
cc = (ColorCache *) cval.ptr;
else
@@ -420,15 +418,16 @@ set_gl_color_for_gc (hidGC gc)
r = cc->red;
g = cc->green;
b = cc->blue;
+ a = 0.7;
}
if (1) {
double maxi, mult;
- if (priv->trans_lines)
- a = a * alpha_mult;
+ if (!priv->trans_lines)
+ a = 1.0;
maxi = r;
if (g > maxi) maxi = g;
if (b > maxi) maxi = b;
- mult = MIN (1 / alpha_mult, 1 / maxi);
+ mult = MIN (1 / a, 1 / maxi);
#if 1
r = r * mult;
g = g * mult;
commit 5e8e118c05be8585dceda8a30987065b99ce530f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
GTK/GL: Refactor GL colour setup handling
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 95e0f11..cfd41ff 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -45,6 +45,7 @@ typedef struct render_priv {
bool trans_lines;
bool in_context;
int subcomposite_stencil_bit;
+ char *current_colorname;
} render_priv;
@@ -52,7 +53,7 @@ typedef struct hid_gc_struct
{
HID *me_pointer;
- gchar *colorname;
+ const char *colorname;
gint width;
gint cap, join;
gchar xor;
@@ -345,39 +346,33 @@ typedef struct
double blue;
} ColorCache;
-void
-ghid_set_color (hidGC gc, const char *name)
+static void
+set_gl_color_for_gc (hidGC gc)
{
render_priv *priv = gport->render_priv;
static void *cache = NULL;
- static char *old_name = NULL;
hidval cval;
ColorCache *cc;
double alpha_mult = 1.0;
double r, g, b, a;
a = 1.0;
- current_gc = gc;
-
- if (old_name != NULL)
- {
- if (strcmp (name, old_name) == 0)
- return;
- free (old_name);
- }
+ if (priv->current_colorname != NULL &&
+ strcmp (priv->current_colorname, gc->colorname) == 0)
+ return;
- old_name = strdup (name);
- gc->colorname = (char *) name;
+ free (priv->current_colorname);
+ priv->current_colorname = strdup (gc->colorname);
if (gport->colormap == NULL)
gport->colormap = gtk_widget_get_colormap (gport->top_window);
- if (strcmp (name, "erase") == 0)
+ if (strcmp (gc->colorname, "erase") == 0)
{
r = gport->bg_color.red / 65535.;
g = gport->bg_color.green / 65535.;
b = gport->bg_color.blue / 65535.;
}
- else if (strcmp (name, "drill") == 0)
+ else if (strcmp (gc->colorname, "drill") == 0)
{
alpha_mult = 0.85;
r = gport->offlimits_color.red / 65535.;
@@ -387,19 +382,19 @@ ghid_set_color (hidGC gc, const char *name)
else
{
alpha_mult = 0.7;
- if (hid_cache_color (0, name, &cval, &cache))
+ if (hid_cache_color (0, gc->colorname, &cval, &cache))
cc = (ColorCache *) cval.ptr;
else
{
cc = (ColorCache *) malloc (sizeof (ColorCache));
memset (cc, 0, sizeof (*cc));
cval.ptr = cc;
- hid_cache_color (1, name, &cval, &cache);
+ hid_cache_color (1, gc->colorname, &cval, &cache);
}
if (!cc->color_set)
{
- if (gdk_color_parse (name, &cc->color))
+ if (gdk_color_parse (gc->colorname, &cc->color))
gdk_color_alloc (gport->colormap, &cc->color);
else
gdk_color_white (gport->colormap, &cc->color);
@@ -449,6 +444,13 @@ ghid_set_color (hidGC gc, const char *name)
}
void
+ghid_set_color (hidGC gc, const char *name)
+{
+ gc->colorname = name;
+ set_gl_color_for_gc (gc);
+}
+
+void
ghid_set_line_cap (hidGC gc, EndCapStyle style)
{
gc->cap = style;
@@ -502,7 +504,7 @@ use_gc (hidGC gc)
current_gc = gc;
- ghid_set_color (gc, gc->colorname);
+ set_gl_color_for_gc (gc);
return 1;
}
|
|
From: <gi...@gp...> - 2011-05-14 00:29:14
|
The branch, master has been updated
via e199787705a37b9704eb8f6458b25907e7123e4c (commit)
from 02a82b5cb9dbf81be5421754583e0609f3d2afdd (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 | 5 -----
src/hid/gtk/gtkhid-gl.c | 5 -----
2 files changed, 0 insertions(+), 10 deletions(-)
=================
Commit Messages
=================
commit e199787705a37b9704eb8f6458b25907e7123e4c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove unused gc->erase parameter from GDK and GL renderers
:100644 100644 8130f15... 48d9fc2... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 2d80bb2... 95e0f11... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit e199787705a37b9704eb8f6458b25907e7123e4c
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Remove unused gc->erase parameter from GDK and GL renderers
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 8130f15..48d9fc2 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -51,7 +51,6 @@ typedef struct hid_gc_struct
gint width;
gint cap, join;
gchar xor_mask;
- gchar erase;
gint mask_seq;
}
hid_gc_struct;
@@ -381,12 +380,10 @@ ghid_set_color (hidGC gc, const char *name)
if (strcmp (name, "erase") == 0)
{
gdk_gc_set_foreground (gc->gc, &gport->bg_color);
- gc->erase = 1;
}
else if (strcmp (name, "drill") == 0)
{
gdk_gc_set_foreground (gc->gc, &gport->offlimits_color);
- gc->erase = 0;
}
else
{
@@ -425,8 +422,6 @@ ghid_set_color (hidGC gc, const char *name)
{
gdk_gc_set_foreground (gc->gc, &cc->color);
}
-
- gc->erase = 0;
}
}
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 2d80bb2..95e0f11 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -56,7 +56,6 @@ typedef struct hid_gc_struct
gint width;
gint cap, join;
gchar xor;
- gchar erase;
}
hid_gc_struct;
@@ -374,14 +373,12 @@ ghid_set_color (hidGC gc, const char *name)
gport->colormap = gtk_widget_get_colormap (gport->top_window);
if (strcmp (name, "erase") == 0)
{
- gc->erase = 1;
r = gport->bg_color.red / 65535.;
g = gport->bg_color.green / 65535.;
b = gport->bg_color.blue / 65535.;
}
else if (strcmp (name, "drill") == 0)
{
- gc->erase = 0;
alpha_mult = 0.85;
r = gport->offlimits_color.red / 65535.;
g = gport->offlimits_color.green / 65535.;
@@ -428,8 +425,6 @@ ghid_set_color (hidGC gc, const char *name)
r = cc->red;
g = cc->green;
b = cc->blue;
-
- gc->erase = 0;
}
if (1) {
double maxi, mult;
|
|
From: <gi...@gp...> - 2011-05-14 00:04:23
|
The branch, master has been updated
via 02a82b5cb9dbf81be5421754583e0609f3d2afdd (commit)
from d4008636d791302464c176b8127a8a5e66a954ec (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 | 6 ------
src/hid/gtk/gtkhid-gl.c | 1 +
src/hid/gtk/gtkhid-main.c | 1 -
src/hid/gtk/gui.h | 2 --
4 files changed, 1 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit 02a82b5cb9dbf81be5421754583e0609f3d2afdd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Setup custom polygon renderer for the GL HID only
:100644 100644 4cb9a02... 8130f15... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 71889d8... 2d80bb2... M src/hid/gtk/gtkhid-gl.c
:100644 100644 847da1b... 688527a... M src/hid/gtk/gtkhid-main.c
:100644 100644 00856da... 31ee636... M src/hid/gtk/gui.h
=========
Changes
=========
commit 02a82b5cb9dbf81be5421754583e0609f3d2afdd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/gtk: Setup custom polygon renderer for the GL HID only
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 4cb9a02..8130f15 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -655,12 +655,6 @@ ghid_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
}
void
-ghid_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
-{
- common_fill_pcb_polygon (gc, poly, clip_box);
-}
-
-void
ghid_fill_rect (hidGC gc, int x1, int y1, int x2, int y2)
{
gint w, h, lw, xx, yy;
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 71889d8..2d80bb2 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -792,6 +792,7 @@ ghid_init_renderer (int *argc, char ***argv, GHidPort *port)
/* Setup HID function pointers specific to the GL renderer*/
ghid_hid.end_layer = ghid_end_layer;
+ ghid_hid.fill_pcb_polygon = ghid_fill_pcb_polygon;
}
void
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 847da1b..688527a 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2298,7 +2298,6 @@ hid_gtk_init ()
ghid_hid.draw_rect = ghid_draw_rect;
ghid_hid.fill_circle = ghid_fill_circle;
ghid_hid.fill_polygon = ghid_fill_polygon;
- ghid_hid.fill_pcb_polygon = ghid_fill_pcb_polygon;
ghid_hid.fill_rect = ghid_fill_rect;
ghid_hid.calibrate = ghid_calibrate;
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 00856da..31ee636 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -485,8 +485,6 @@ void ghid_draw_arc (hidGC gc, int cx, int cy, int xradius, int yradius,
void ghid_draw_rect (hidGC gc, int x1, int y1, int x2, int y2);
void ghid_fill_circle (hidGC gc, int cx, int cy, int radius);
void ghid_fill_polygon (hidGC gc, int n_coords, int *x, int *y);
-void ghid_fill_pcb_polygon (hidGC gc, PolygonType *poly,
- const BoxType *clip_box); /* GL ONLY */
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 ();
|
|
From: <gi...@gp...> - 2011-05-13 23:32:40
|
The branch, master has been updated
via d4008636d791302464c176b8127a8a5e66a954ec (commit)
from 8ce572e8c1cfded6459e43d61c776df859e11f55 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gtkhid-gl.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
=================
Commit Messages
=================
commit d4008636d791302464c176b8127a8a5e66a954ec
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
gtk/gl: Don't set "magenta" for a NULL color passed to ghid_set_color
The code has a strdup (name), followed by a test for name == NULL. If
name _were_ ever NULL, the strdup would crash, so we can remove this
test.
:100644 100644 8af8a03... 71889d8... M src/hid/gtk/gtkhid-gl.c
=========
Changes
=========
commit d4008636d791302464c176b8127a8a5e66a954ec
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
gtk/gl: Don't set "magenta" for a NULL color passed to ghid_set_color
The code has a strdup (name), followed by a test for name == NULL. If
name _were_ ever NULL, the strdup would crash, so we can remove this
test.
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 8af8a03..71889d8 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -368,14 +368,6 @@ ghid_set_color (hidGC gc, const char *name)
}
old_name = strdup (name);
-
- if (name == NULL)
- {
- fprintf (stderr, "%s(): name = NULL, setting to magenta\n",
- __FUNCTION__);
- name = "magenta";
- }
-
gc->colorname = (char *) name;
if (gport->colormap == NULL)
|
|
From: <gi...@gp...> - 2011-05-13 23:30:33
|
The branch, master has been updated
via 8ce572e8c1cfded6459e43d61c776df859e11f55 (commit)
from 8478d4d8e661801d31cbc0c9bef1c13aab2403c6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/common/hidgl.c | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit 8ce572e8c1cfded6459e43d61c776df859e11f55
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Use tags on circular contours to render them faster
This lets us avoid the polygon tesselator for circular contours, and lets
us render a different number of vertices in our appoximation depending
upon zoom level.
:100644 100644 00efdce... bbba217... M src/hid/common/hidgl.c
=========
Changes
=========
commit 8ce572e8c1cfded6459e43d61c776df859e11f55
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Use tags on circular contours to render them faster
This lets us avoid the polygon tesselator for circular contours, and lets
us render a different number of vertices in our appoximation depending
upon zoom level.
diff --git a/src/hid/common/hidgl.c b/src/hid/common/hidgl.c
index 00efdce..bbba217 100644
--- a/src/hid/common/hidgl.c
+++ b/src/hid/common/hidgl.c
@@ -554,11 +554,24 @@ hidgl_fill_polygon (int n_coords, int *x, int *y)
}
void
-tesselate_contour (GLUtesselator *tobj, PLINE *contour, GLdouble *vertices)
+tesselate_contour (GLUtesselator *tobj, PLINE *contour, GLdouble *vertices,
+ double scale)
{
VNODE *vn = &contour->head;
int offset = 0;
+ /* If the contour is round, and hidgl_fill_circle would use
+ * less slices than we have vertices to draw it, then call
+ * hidgl_fill_circle to draw this contour.
+ */
+ if (contour->is_round) {
+ double slices = calc_slices (contour->radius / scale, 2 * M_PI);
+ if (slices < contour->Count) {
+ hidgl_fill_circle (contour->cx, contour->cy, contour->radius, scale);
+ return;
+ }
+ }
+
gluTessBeginPolygon (tobj, NULL);
gluTessBeginContour (tobj);
do {
@@ -575,6 +588,7 @@ tesselate_contour (GLUtesselator *tobj, PLINE *contour, GLdouble *vertices)
struct do_hole_info {
GLUtesselator *tobj;
GLdouble *vertices;
+ double scale;
};
static int
@@ -588,7 +602,7 @@ do_hole (const BoxType *b, void *cl)
return 0;
}
- tesselate_contour (info->tobj, curc, info->vertices);
+ tesselate_contour (info->tobj, curc, info->vertices, info->scale);
return 1;
}
@@ -605,6 +619,7 @@ hidgl_fill_pcb_polygon (PolygonType *poly, const BoxType *clip_box, double scale
struct do_hole_info info;
int stencil_bit;
+ info.scale = scale;
global_scale = scale;
if (poly->Clipped == NULL)
@@ -664,7 +679,7 @@ hidgl_fill_pcb_polygon (PolygonType *poly, const BoxType *clip_box, double scale
/* Drawing operations as masked to areas where the stencil buffer is '0' */
/* Draw the polygon outer */
- tesselate_contour (info.tobj, poly->Clipped->contours, info.vertices);
+ tesselate_contour (info.tobj, poly->Clipped->contours, info.vertices, scale);
hidgl_flush_triangles (&buffer);
/* Unassign our stencil buffer bit */
|
|
From: <gi...@gp...> - 2011-05-13 10:56:16
|
The branch, master has been updated
discards 7dc021e852b535d71b31bdffd5f54368617f7527 (commit)
discards 20ae1d4661d491279ba97d01fc90c16099ae8b48 (commit)
via 8478d4d8e661801d31cbc0c9bef1c13aab2403c6 (commit)
via c67172a7f0070dc310b2c77404c083788392de32 (commit)
from 7dc021e852b535d71b31bdffd5f54368617f7527 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/common/hidnogui.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
create mode 100644 src/hid/common/hidnogui.h
=================
Commit Messages
=================
commit 8478d4d8e661801d31cbc0c9bef1c13aab2403c6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Fix vertex array state preservation
Fixes a bug with crosshair attached objects not being visible
when the grid was rendered.
Reported-by: Colin D Bennett <co...@gi...>
Closes-bug: lp-780958
:100644 100644 fb6b118... 00efdce... M src/hid/common/hidgl.c
commit c67172a7f0070dc310b2c77404c083788392de32
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Refactor application of the default hidnogui HID handlers.
Replace usage of apply_default_hid() just prior to registering a HID
with an early call to the new common_nogui_init() function which pre-
applies the defaults, rather than post-replacing NULL handlers.
As this was the last user of the apply_default_hid() function,
remove it. Good riddance to yet another place which had to be updated
every time a new HID member was added.
The default nogui HID is now constructed explicitly by a call to
nogui_hid_get_hid (), which is called from hid_init(). This is
different to the other HIDs, as the nogui "hid" is never explicitly
registered.
:100644 100644 0de23aa... 18fe5c1... M src/Makefile.am
:100644 100644 1b5ca10... 0208a1e... M src/hid/batch/batch.c
:100644 100644 6e5bc22... 3319491... M src/hid/bom/bom.c
:100644 100644 4233b4c... 58d1880... M src/hid/common/hidinit.c
:100644 100644 08061fe... aef38b8... M src/hid/common/hidnogui.c
:000000 100644 0000000... 244c8c2... A src/hid/common/hidnogui.h
:100644 100644 6514fe9... 2f26c8e... M src/hid/gcode/gcode.c
:100644 100644 47e6124... 7737444... M src/hid/gerber/gerber.c
:100644 100644 091f472... 847da1b... M src/hid/gtk/gtkhid-main.c
:100644 100644 a2148a0... 8302745... M src/hid/hidint.h
:100644 100644 c2513bf... 90979c0... M src/hid/lesstif/main.c
:100644 100644 2f34833... 3d46fec... M src/hid/lpr/lpr.c
:100644 100644 9dbf24c... 8c78a53... M src/hid/nelma/nelma.c
:100644 100644 9890364... 279e39c... M src/hid/png/png.c
:100644 100644 e17f8a3... 69430d8... M src/hid/ps/eps.c
:100644 100644 c2e5b26... 7f2c3d7... M src/hid/ps/ps.c
=========
Changes
=========
commit 8478d4d8e661801d31cbc0c9bef1c13aab2403c6
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Fix vertex array state preservation
Fixes a bug with crosshair attached objects not being visible
when the grid was rendered.
Reported-by: Colin D Bennett <co...@gi...>
Closes-bug: lp-780958
diff --git a/src/hid/common/hidgl.c b/src/hid/common/hidgl.c
index fb6b118..00efdce 100644
--- a/src/hid/common/hidgl.c
+++ b/src/hid/common/hidgl.c
@@ -66,8 +66,6 @@ float global_depth = 0;
void
hidgl_init_triangle_array (triangle_buffer *buffer)
{
- glEnableClientState (GL_VERTEX_ARRAY);
- glVertexPointer (3, GL_FLOAT, 0, buffer->triangle_array);
buffer->triangle_count = 0;
buffer->coord_comp_count = 0;
}
@@ -78,7 +76,11 @@ hidgl_flush_triangles (triangle_buffer *buffer)
if (buffer->triangle_count == 0)
return;
+ glEnableClientState (GL_VERTEX_ARRAY);
+ glVertexPointer (3, GL_FLOAT, 0, buffer->triangle_array);
glDrawArrays (GL_TRIANGLES, 0, buffer->triangle_count * 3);
+ glDisableClientState (GL_VERTEX_ARRAY);
+
buffer->triangle_count = 0;
buffer->coord_comp_count = 0;
}
commit c67172a7f0070dc310b2c77404c083788392de32
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Refactor application of the default hidnogui HID handlers.
Replace usage of apply_default_hid() just prior to registering a HID
with an early call to the new common_nogui_init() function which pre-
applies the defaults, rather than post-replacing NULL handlers.
As this was the last user of the apply_default_hid() function,
remove it. Good riddance to yet another place which had to be updated
every time a new HID member was added.
The default nogui HID is now constructed explicitly by a call to
nogui_hid_get_hid (), which is called from hid_init(). This is
different to the other HIDs, as the nogui "hid" is never explicitly
registered.
diff --git a/src/Makefile.am b/src/Makefile.am
index 0de23aa..18fe5c1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -150,6 +150,7 @@ PCB_SRCS = \
hid/common/hidinit.c \
hid/common/hidinit.h \
hid/common/hidnogui.c \
+ hid/common/hidnogui.h \
hid/common/extents.c \
hid/common/draw_helpers.c \
hid/common/draw_helpers.h \
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index 1b5ca10..0208a1e 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -18,6 +18,7 @@
#include "../hidint.h"
#include "hid/common/draw_helpers.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/actions.h"
#include "hid/common/hidinit.h"
@@ -335,6 +336,7 @@ hid_batch_init ()
{
memset (&batch_hid, 0, sizeof (HID));
+ common_nogui_init (&batch_hid);
common_draw_helpers_init (&batch_hid);
batch_hid.struct_size = sizeof (HID);
@@ -376,7 +378,6 @@ hid_batch_init ()
batch_hid.attribute_dialog = batch_attribute_dialog;
batch_hid.show_item = batch_show_item;
- apply_default_hid (&batch_hid, 0);
hid_register_hid (&batch_hid);
#include "batch_lists.h"
}
diff --git a/src/hid/bom/bom.c b/src/hid/bom/bom.c
index 6e5bc22..3319491 100644
--- a/src/hid/bom/bom.c
+++ b/src/hid/bom/bom.c
@@ -16,6 +16,7 @@
#include "misc.h"
#include "hid.h"
+#include "hid/common/hidnogui.h"
#include "../hidint.h"
#ifdef HAVE_LIBDMALLOC
@@ -543,6 +544,8 @@ hid_bom_init ()
{
memset (&bom_hid, 0, sizeof (HID));
+ common_nogui_init (&bom_hid);
+
bom_hid.struct_size = sizeof (HID);
bom_hid.name = "bom";
bom_hid.description = "Exports a Bill of Materials";
@@ -552,6 +555,5 @@ hid_bom_init ()
bom_hid.do_export = bom_do_export;
bom_hid.parse_arguments = bom_parse_arguments;
- apply_default_hid (&bom_hid, 0);
hid_register_hid (&bom_hid);
}
diff --git a/src/hid/common/hidinit.c b/src/hid/common/hidinit.c
index 4233b4c..58d1880 100644
--- a/src/hid/common/hidinit.c
+++ b/src/hid/common/hidinit.c
@@ -23,6 +23,7 @@
#include "global.h"
#include "hid.h"
+#include "hidnogui.h"
#include "../hidint.h"
/* for dlopen() and friends on windows */
@@ -45,9 +46,7 @@ RCSID ("$Id$");
HID **hid_list = 0;
int hid_num_hids = 0;
-extern HID hid_nogui;
-
-HID *gui = &hid_nogui;
+HID *gui = NULL;
HID *exporter = NULL;
int pixel_slop = 1;
@@ -122,8 +121,9 @@ hid_load_dir (char *dirname)
void
hid_init ()
{
+ /* Setup a "nogui" default HID */
+ gui = hid_nogui_get_hid ();
- gui = &hid_nogui;
#define HID_DEF(x) hid_ ## x ## _init();
#include "hid/common/hidlist.h"
#undef HID_DEF
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index 08061fe..aef38b8 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -448,130 +448,76 @@ nogui_finish_debug_draw (void)
{
}
-HID hid_nogui = {
- sizeof (HID),
- "nogui",
- "Default GUI when no other GUI is present. Does nothing.",
- 0, 0, 0, 0, 0,
- nogui_get_export_options,
- nogui_do_export,
- nogui_parse_arguments,
- nogui_invalidate_lr,
- nogui_invalidate_all,
- 0 /* nogui_notify_crosshair_change */ ,
- 0 /* nogui_notify_mark_change */ ,
- nogui_set_layer,
- nogui_end_layer,
- nogui_make_gc,
- nogui_destroy_gc,
- nogui_use_mask,
- nogui_set_color,
- nogui_set_line_cap,
- nogui_set_line_width,
- nogui_set_draw_xor,
- nogui_set_draw_faded,
- nogui_draw_line,
- nogui_draw_arc,
- nogui_draw_rect,
- nogui_fill_circle,
- nogui_fill_polygon,
- nogui_fill_pcb_polygon,
- 0 /* nogui_thindraw_pcb_polygon */ ,
- nogui_fill_pcb_pad,
- nogui_thindraw_pcb_pad,
- nogui_fill_pcb_pv,
- nogui_thindraw_pcb_pv,
- nogui_fill_rect,
- nogui_calibrate,
- nogui_shift_is_pressed,
- nogui_control_is_pressed,
- nogui_mod1_is_pressed,
- nogui_get_coords,
- nogui_set_crosshair,
- nogui_add_timer,
- nogui_stop_timer,
- nogui_watch_file,
- nogui_unwatch_file,
- nogui_add_block_hook,
- nogui_stop_block_hook,
- nogui_log,
- nogui_logv,
- nogui_confirm_dialog,
- nogui_close_confirm_dialog,
- nogui_report_dialog,
- nogui_prompt_for,
- nogui_fileselect,
- nogui_attribute_dialog,
- nogui_show_item,
- nogui_beep,
- nogui_progress,
- 0 /* nogui_drc_gui */ ,
- 0 /* edit_attributes */,
- nogui_request_debug_draw,
- nogui_flush_debug_draw,
- nogui_finish_debug_draw,
-};
-
-#define AD(x) if (!d->x) d->x = s->x
-
void
-apply_default_hid (HID * d, HID * s)
-{
- if (s == 0)
- s = &hid_nogui;
- AD (get_export_options);
- AD (do_export);
- AD (parse_arguments);
- AD (invalidate_lr);
- AD (invalidate_all);
- AD (notify_crosshair_change);
- AD (notify_mark_change);
- AD (set_layer);
- AD (end_layer);
- AD (make_gc);
- AD (destroy_gc);
- AD (use_mask);
- AD (set_color);
- AD (set_line_cap);
- AD (set_line_width);
- AD (set_draw_xor);
- AD (set_draw_faded);
- AD (draw_line);
- AD (draw_arc);
- AD (fill_circle);
- AD (fill_polygon);
- AD (fill_pcb_polygon);
- AD (thindraw_pcb_polygon);
- AD (fill_pcb_pad);
- AD (thindraw_pcb_pad);
- AD (fill_pcb_pv);
- AD (thindraw_pcb_pv);
- AD (calibrate);
- AD (shift_is_pressed);
- AD (control_is_pressed);
- AD (mod1_is_pressed);
- AD (get_coords);
- AD (set_crosshair);
- AD (add_timer);
- AD (stop_timer);
- AD (watch_file);
- AD (unwatch_file);
- AD (add_block_hook);
- AD (stop_block_hook);
- AD (log);
- AD (logv);
- AD (confirm_dialog);
- AD (close_confirm_dialog);
- AD (report_dialog);
- AD (prompt_for);
- AD (fileselect);
- AD (attribute_dialog);
- AD (show_item);
- AD (beep);
- AD (progress);
- AD (drc_gui);
- AD (edit_attributes);
- AD (request_debug_draw);
- AD (flush_debug_draw);
- AD (finish_debug_draw);
+common_nogui_init (HID *hid)
+{
+ hid->get_export_options = nogui_get_export_options;
+ hid->do_export = nogui_do_export;
+ hid->parse_arguments = nogui_parse_arguments;
+ hid->invalidate_lr = nogui_invalidate_lr;
+ hid->invalidate_all = nogui_invalidate_all;
+ hid->set_layer = nogui_set_layer;
+ hid->end_layer = nogui_end_layer;
+ hid->make_gc = nogui_make_gc;
+ hid->destroy_gc = nogui_destroy_gc;
+ hid->use_mask = nogui_use_mask;
+ hid->set_color = nogui_set_color;
+ hid->set_line_cap = nogui_set_line_cap;
+ hid->set_line_width = nogui_set_line_width;
+ hid->set_draw_xor = nogui_set_draw_xor;
+ hid->set_draw_faded = nogui_set_draw_faded;
+ hid->draw_line = nogui_draw_line;
+ hid->draw_arc = nogui_draw_arc;
+ hid->draw_rect = nogui_draw_rect;
+ hid->fill_circle = nogui_fill_circle;
+ hid->fill_polygon = nogui_fill_polygon;
+ hid->fill_pcb_polygon = nogui_fill_pcb_polygon;
+ hid->fill_pcb_pad = nogui_fill_pcb_pad;
+ hid->thindraw_pcb_pad = nogui_thindraw_pcb_pad;
+ hid->fill_pcb_pv = nogui_fill_pcb_pv;
+ hid->thindraw_pcb_pv = nogui_thindraw_pcb_pv;
+ hid->fill_rect = nogui_fill_rect;
+ hid->calibrate = nogui_calibrate;
+ hid->shift_is_pressed = nogui_shift_is_pressed;
+ hid->control_is_pressed = nogui_control_is_pressed;
+ hid->mod1_is_pressed = nogui_mod1_is_pressed;
+ hid->get_coords = nogui_get_coords;
+ hid->set_crosshair = nogui_set_crosshair;
+ hid->add_timer = nogui_add_timer;
+ hid->stop_timer = nogui_stop_timer;
+ hid->watch_file = nogui_watch_file;
+ hid->unwatch_file = nogui_unwatch_file;
+ hid->add_block_hook = nogui_add_block_hook;
+ hid->stop_block_hook = nogui_stop_block_hook;
+ hid->log = nogui_log;
+ hid->logv = nogui_logv;
+ hid->confirm_dialog = nogui_confirm_dialog;
+ hid->close_confirm_dialog = nogui_close_confirm_dialog;
+ hid->report_dialog = nogui_report_dialog;
+ hid->prompt_for = nogui_prompt_for;
+ hid->fileselect = nogui_fileselect;
+ hid->attribute_dialog = nogui_attribute_dialog;
+ hid->show_item = nogui_show_item;
+ hid->beep = nogui_beep;
+ hid->progress = nogui_progress;
+ hid->request_debug_draw = nogui_request_debug_draw;
+ hid->flush_debug_draw = nogui_flush_debug_draw;
+ hid->finish_debug_draw = nogui_finish_debug_draw;
+}
+
+static HID nogui_hid;
+
+HID *
+hid_nogui_get_hid (void)
+{
+ memset (&nogui_hid, 0, sizeof (HID));
+
+ nogui_hid.struct_size = sizeof (HID);
+ nogui_hid.name = "nogui";
+ nogui_hid.description = "Default GUI when no other GUI is present. "
+ "Does nothing.";
+
+ common_nogui_init (&nogui_hid);
+
+ return &nogui_hid;
}
diff --git a/src/hid/common/hidnogui.h b/src/hid/common/hidnogui.h
new file mode 100644
index 0000000..244c8c2
--- /dev/null
+++ b/src/hid/common/hidnogui.h
@@ -0,0 +1,7 @@
+#ifndef __HID_NOGUI_INCLUDED__
+#define __HID_NOGUI_INCLUDED__
+
+void common_nogui_init (HID *hid);
+HID *hid_nogui_get_hid (void);
+
+#endif
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 6514fe9..2f26c8e 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -53,6 +53,7 @@
#include "hid.h"
#include "../hidint.h"
#include <gd.h>
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "gcode.h"
#include "bitmap.h"
@@ -1031,6 +1032,7 @@ hid_gcode_init ()
{
memset (&gcode_hid, 0, sizeof (HID));
+ common_nogui_init (&gcode_hid);
common_draw_helpers_init (&gcode_hid);
gcode_hid.struct_size = sizeof (HID);
@@ -1060,7 +1062,6 @@ hid_gcode_init ()
gcode_hid.calibrate = gcode_calibrate;
gcode_hid.set_crosshair = gcode_set_crosshair;
- apply_default_hid (&gcode_hid, 0);
hid_register_hid (&gcode_hid);
#include "gcode_lists.h"
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 47e6124..7737444 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -29,6 +29,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "hid/common/hidinit.h"
@@ -1160,6 +1161,7 @@ hid_gerber_init ()
{
memset (&gerber_hid, 0, sizeof (HID));
+ common_nogui_init (&gerber_hid);
common_draw_helpers_init (&gerber_hid);
gerber_hid.struct_size = sizeof (HID);
@@ -1187,6 +1189,5 @@ hid_gerber_init ()
gerber_hid.calibrate = gerber_calibrate;
gerber_hid.set_crosshair = gerber_set_crosshair;
- apply_default_hid (&gerber_hid, 0);
hid_register_hid (&gerber_hid);
}
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 091f472..847da1b 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -18,6 +18,7 @@
#include "error.h"
#include "../hidint.h"
#include "gui.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#ifdef HAVE_LIBDMALLOC
@@ -2268,6 +2269,7 @@ hid_gtk_init ()
memset (&ghid_hid, 0, sizeof (HID));
+ common_nogui_init (&ghid_hid);
common_draw_helpers_init (&ghid_hid);
ghid_hid.struct_size = sizeof (HID);
@@ -2330,7 +2332,6 @@ hid_gtk_init ()
ghid_hid.flush_debug_draw = ghid_flush_debug_draw;
ghid_hid.finish_debug_draw = ghid_finish_debug_draw;
- apply_default_hid (&ghid_hid, 0);
hid_register_hid (&ghid_hid);
#include "gtk_lists.h"
}
diff --git a/src/hid/hidint.h b/src/hid/hidint.h
index a2148a0..8302745 100644
--- a/src/hid/hidint.h
+++ b/src/hid/hidint.h
@@ -39,10 +39,6 @@ HID_Action *hid_find_action (const char *name);
HID_Flag *hid_find_flag (const char *name);
-/* Any field that is NULL in "d" is copied from the matching field in
- "s". If "s" is NULL, the nogui HID is used. */
-void apply_default_hid (HID * d, HID * s);
-
/* A HID may use this if it does not need command line arguments in
any special format; for example, the Lesstif HID needs to use the
Xt parser, but the Postscript HID can use this function. */
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index c2513bf..90979c0 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -28,6 +28,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "hid/common/hid_resource.h"
#include "lesstif.h"
@@ -4005,6 +4006,7 @@ hid_lesstif_init ()
{
memset (&lesstif_hid, 0, sizeof (HID));
+ common_nogui_init (&lesstif_hid);
common_draw_helpers_init (&lesstif_hid);
lesstif_hid.struct_size = sizeof (HID);
@@ -4065,7 +4067,6 @@ hid_lesstif_init ()
lesstif_hid.flush_debug_draw = lesstif_flush_debug_draw;
lesstif_hid.finish_debug_draw = lesstif_finish_debug_draw;
- apply_default_hid (&lesstif_hid, 0);
hid_register_hid (&lesstif_hid);
#include "lesstif_lists.h"
}
diff --git a/src/hid/lpr/lpr.c b/src/hid/lpr/lpr.c
index 2f34833..3d46fec 100644
--- a/src/hid/lpr/lpr.c
+++ b/src/hid/lpr/lpr.c
@@ -17,6 +17,7 @@
#include "hid.h"
#include "../hidint.h"
#include "../ps/ps.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/hidinit.h"
#ifdef HAVE_LIBDMALLOC
@@ -118,6 +119,7 @@ hid_lpr_init ()
{
memset (&lpr_hid, 0, sizeof (HID));
+ common_nogui_init (&lpr_hid);
ps_ps_init (&lpr_hid);
lpr_hid.struct_size = sizeof (HID);
@@ -131,6 +133,5 @@ hid_lpr_init ()
lpr_hid.parse_arguments = lpr_parse_arguments;
lpr_hid.calibrate = lpr_calibrate;
- apply_default_hid (&lpr_hid, 0);
hid_register_hid (&lpr_hid);
}
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index 9dbf24c..8c78a53 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -71,6 +71,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include <gd.h>
@@ -1046,6 +1047,7 @@ hid_nelma_init()
{
memset (&nelma_hid, 0, sizeof (HID));
+ common_nogui_init (&nelma_hid);
common_draw_helpers_init (&nelma_hid);
nelma_hid.struct_size = sizeof (HID);
@@ -1075,7 +1077,6 @@ hid_nelma_init()
nelma_hid.calibrate = nelma_calibrate;
nelma_hid.set_crosshair = nelma_set_crosshair;
- apply_default_hid (&nelma_hid, 0);
hid_register_hid (&nelma_hid);
#include "nelma_lists.h"
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 9890364..279e39c 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -41,6 +41,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "png.h"
@@ -1515,6 +1516,7 @@ hid_png_init ()
{
memset (&png_hid, 0, sizeof (HID));
+ common_nogui_init (&png_hid);
common_draw_helpers_init (&png_hid);
png_hid.struct_size = sizeof (HID);
@@ -1543,7 +1545,6 @@ hid_png_init ()
png_hid.calibrate = png_calibrate;
png_hid.set_crosshair = png_set_crosshair;
- apply_default_hid (&png_hid, 0);
hid_register_hid (&png_hid);
#include "png_lists.h"
diff --git a/src/hid/ps/eps.c b/src/hid/ps/eps.c
index e17f8a3..69430d8 100644
--- a/src/hid/ps/eps.c
+++ b/src/hid/ps/eps.c
@@ -16,6 +16,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "../ps/ps.h"
#include "hid/common/hidinit.h"
@@ -628,6 +629,7 @@ hid_eps_init ()
{
memset (&eps_hid, 0, sizeof (HID));
+ common_nogui_init (&eps_hid);
common_draw_helpers_init (&eps_hid);
eps_hid.struct_size = sizeof (HID);
@@ -656,6 +658,5 @@ hid_eps_init ()
eps_hid.calibrate = eps_calibrate;
eps_hid.set_crosshair = eps_set_crosshair;
- apply_default_hid (&eps_hid, 0);
hid_register_hid (&eps_hid);
}
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index c2e5b26..7f2c3d7 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -19,6 +19,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "../ps/ps.h"
#include "../../print.h"
@@ -1368,6 +1369,7 @@ hid_ps_init ()
{
memset (&ps_hid, 0, sizeof (HID));
+ common_nogui_init (&ps_hid);
common_draw_helpers_init (&ps_hid);
ps_ps_init (&ps_hid);
@@ -1377,7 +1379,6 @@ hid_ps_init ()
ps_hid.exporter = 1;
ps_hid.poly_before = 1;
- apply_default_hid (&ps_hid, 0);
hid_register_hid (&ps_hid);
hid_eps_init ();
|
|
From: <gi...@gp...> - 2011-05-13 01:22:37
|
The branch, master has been updated
discards db0e9058620182d20fe9afc3831c739ff7c90693 (commit)
via 7dc021e852b535d71b31bdffd5f54368617f7527 (commit)
from db0e9058620182d20fe9afc3831c739ff7c90693 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/common/hidgl.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 7dc021e852b535d71b31bdffd5f54368617f7527
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Fix vertex array state preservation
Fixes a bug with crosshair attached objects not being visible
when the grid was rendered.
Reported-by: Colin D Bennett <co...@gi...>
Closes-bug: lp-780958
:100644 100644 fb6b118... 00efdce... M src/hid/common/hidgl.c
=========
Changes
=========
commit 7dc021e852b535d71b31bdffd5f54368617f7527
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Fix vertex array state preservation
Fixes a bug with crosshair attached objects not being visible
when the grid was rendered.
Reported-by: Colin D Bennett <co...@gi...>
Closes-bug: lp-780958
diff --git a/src/hid/common/hidgl.c b/src/hid/common/hidgl.c
index fb6b118..00efdce 100644
--- a/src/hid/common/hidgl.c
+++ b/src/hid/common/hidgl.c
@@ -66,8 +66,6 @@ float global_depth = 0;
void
hidgl_init_triangle_array (triangle_buffer *buffer)
{
- glEnableClientState (GL_VERTEX_ARRAY);
- glVertexPointer (3, GL_FLOAT, 0, buffer->triangle_array);
buffer->triangle_count = 0;
buffer->coord_comp_count = 0;
}
@@ -78,7 +76,11 @@ hidgl_flush_triangles (triangle_buffer *buffer)
if (buffer->triangle_count == 0)
return;
+ glEnableClientState (GL_VERTEX_ARRAY);
+ glVertexPointer (3, GL_FLOAT, 0, buffer->triangle_array);
glDrawArrays (GL_TRIANGLES, 0, buffer->triangle_count * 3);
+ glDisableClientState (GL_VERTEX_ARRAY);
+
buffer->triangle_count = 0;
buffer->coord_comp_count = 0;
}
|
|
From: <gi...@gp...> - 2011-05-13 01:21:58
|
The branch, master has been updated
via db0e9058620182d20fe9afc3831c739ff7c90693 (commit)
from 20ae1d4661d491279ba97d01fc90c16099ae8b48 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/common/hidgl.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit db0e9058620182d20fe9afc3831c739ff7c90693
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Fix vertex array state preservation
Fixes a bug with crosshair attached objects not being visible
when the grid was rendered.
Reported-by: Colin D Bennett <co...@gi...>
Closes-bug: lp-780958
:100644 100644 fb6b118... 21322f7... M src/hid/common/hidgl.c
=========
Changes
=========
commit db0e9058620182d20fe9afc3831c739ff7c90693
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common/hidgl.c: Fix vertex array state preservation
Fixes a bug with crosshair attached objects not being visible
when the grid was rendered.
Reported-by: Colin D Bennett <co...@gi...>
Closes-bug: lp-780958
diff --git a/src/hid/common/hidgl.c b/src/hid/common/hidgl.c
index fb6b118..21322f7 100644
--- a/src/hid/common/hidgl.c
+++ b/src/hid/common/hidgl.c
@@ -66,8 +66,6 @@ float global_depth = 0;
void
hidgl_init_triangle_array (triangle_buffer *buffer)
{
- glEnableClientState (GL_VERTEX_ARRAY);
- glVertexPointer (3, GL_FLOAT, 0, buffer->triangle_array);
buffer->triangle_count = 0;
buffer->coord_comp_count = 0;
}
@@ -78,7 +76,11 @@ hidgl_flush_triangles (triangle_buffer *buffer)
if (buffer->triangle_count == 0)
return;
+ glEnableClientState (GL_VERTEX_ARRAY);
+ glVertexPointer (3, GL_FLOAT, 0, buffer->triangle_array);
glDrawArrays (GL_TRIANGLES, 0, buffer->triangle_count * 3);
+ glDisableClientState (GL_VERTEX_ARRAY);
+
buffer->triangle_count = 0;
buffer->coord_comp_count = 0;
}
@@ -140,6 +142,7 @@ hidgl_draw_grid (BoxType *drawn_area)
points = realloc (points, npoints * 3 * sizeof (GLfloat));
}
+ glPushAttrib ();
glEnableClientState (GL_VERTEX_ARRAY);
glVertexPointer (3, GL_FLOAT, 0, points);
|
|
From: <gi...@gp...> - 2011-05-13 00:51:45
|
The branch, master has been updated
via 20ae1d4661d491279ba97d01fc90c16099ae8b48 (commit)
from f1353c0b245d4fad16add67bf8e63a2f57d9f427 (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/batch/batch.c | 3 +-
src/hid/bom/bom.c | 4 +-
src/hid/common/hidinit.c | 8 +-
src/hid/common/hidnogui.c | 196 ++++++++++++++++----------------------------
src/hid/gcode/gcode.c | 3 +-
src/hid/gerber/gerber.c | 3 +-
src/hid/gtk/gtkhid-main.c | 3 +-
src/hid/hidint.h | 4 -
src/hid/lesstif/main.c | 3 +-
src/hid/lpr/lpr.c | 3 +-
src/hid/nelma/nelma.c | 3 +-
src/hid/png/png.c | 3 +-
src/hid/ps/eps.c | 3 +-
src/hid/ps/ps.c | 3 +-
15 files changed, 99 insertions(+), 144 deletions(-)
=================
Commit Messages
=================
commit 20ae1d4661d491279ba97d01fc90c16099ae8b48
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Refactor application of the default hidnogui HID handlers.
Replace usage of apply_default_hid() just prior to registering a HID
with an early call to the new common_nogui_init() function which pre-
applies the defaults, rather than post-replacing NULL handlers.
As this was the last user of the apply_default_hid() function,
remove it. Good riddance to yet another place which had to be updated
every time a new HID member was added.
The default nogui HID is now constructed explicitly by a call to
nogui_hid_get_hid (), which is called from hid_init(). This is
different to the other HIDs, as the nogui "hid" is never explicitly
registered.
:100644 100644 0de23aa... 18fe5c1... M src/Makefile.am
:100644 100644 1b5ca10... 0208a1e... M src/hid/batch/batch.c
:100644 100644 6e5bc22... 3319491... M src/hid/bom/bom.c
:100644 100644 4233b4c... 58d1880... M src/hid/common/hidinit.c
:100644 100644 08061fe... aef38b8... M src/hid/common/hidnogui.c
:100644 100644 6514fe9... 2f26c8e... M src/hid/gcode/gcode.c
:100644 100644 47e6124... 7737444... M src/hid/gerber/gerber.c
:100644 100644 091f472... 847da1b... M src/hid/gtk/gtkhid-main.c
:100644 100644 a2148a0... 8302745... M src/hid/hidint.h
:100644 100644 c2513bf... 90979c0... M src/hid/lesstif/main.c
:100644 100644 2f34833... 3d46fec... M src/hid/lpr/lpr.c
:100644 100644 9dbf24c... 8c78a53... M src/hid/nelma/nelma.c
:100644 100644 9890364... 279e39c... M src/hid/png/png.c
:100644 100644 e17f8a3... 69430d8... M src/hid/ps/eps.c
:100644 100644 c2e5b26... 7f2c3d7... M src/hid/ps/ps.c
=========
Changes
=========
commit 20ae1d4661d491279ba97d01fc90c16099ae8b48
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Refactor application of the default hidnogui HID handlers.
Replace usage of apply_default_hid() just prior to registering a HID
with an early call to the new common_nogui_init() function which pre-
applies the defaults, rather than post-replacing NULL handlers.
As this was the last user of the apply_default_hid() function,
remove it. Good riddance to yet another place which had to be updated
every time a new HID member was added.
The default nogui HID is now constructed explicitly by a call to
nogui_hid_get_hid (), which is called from hid_init(). This is
different to the other HIDs, as the nogui "hid" is never explicitly
registered.
diff --git a/src/Makefile.am b/src/Makefile.am
index 0de23aa..18fe5c1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -150,6 +150,7 @@ PCB_SRCS = \
hid/common/hidinit.c \
hid/common/hidinit.h \
hid/common/hidnogui.c \
+ hid/common/hidnogui.h \
hid/common/extents.c \
hid/common/draw_helpers.c \
hid/common/draw_helpers.h \
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index 1b5ca10..0208a1e 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -18,6 +18,7 @@
#include "../hidint.h"
#include "hid/common/draw_helpers.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/actions.h"
#include "hid/common/hidinit.h"
@@ -335,6 +336,7 @@ hid_batch_init ()
{
memset (&batch_hid, 0, sizeof (HID));
+ common_nogui_init (&batch_hid);
common_draw_helpers_init (&batch_hid);
batch_hid.struct_size = sizeof (HID);
@@ -376,7 +378,6 @@ hid_batch_init ()
batch_hid.attribute_dialog = batch_attribute_dialog;
batch_hid.show_item = batch_show_item;
- apply_default_hid (&batch_hid, 0);
hid_register_hid (&batch_hid);
#include "batch_lists.h"
}
diff --git a/src/hid/bom/bom.c b/src/hid/bom/bom.c
index 6e5bc22..3319491 100644
--- a/src/hid/bom/bom.c
+++ b/src/hid/bom/bom.c
@@ -16,6 +16,7 @@
#include "misc.h"
#include "hid.h"
+#include "hid/common/hidnogui.h"
#include "../hidint.h"
#ifdef HAVE_LIBDMALLOC
@@ -543,6 +544,8 @@ hid_bom_init ()
{
memset (&bom_hid, 0, sizeof (HID));
+ common_nogui_init (&bom_hid);
+
bom_hid.struct_size = sizeof (HID);
bom_hid.name = "bom";
bom_hid.description = "Exports a Bill of Materials";
@@ -552,6 +555,5 @@ hid_bom_init ()
bom_hid.do_export = bom_do_export;
bom_hid.parse_arguments = bom_parse_arguments;
- apply_default_hid (&bom_hid, 0);
hid_register_hid (&bom_hid);
}
diff --git a/src/hid/common/hidinit.c b/src/hid/common/hidinit.c
index 4233b4c..58d1880 100644
--- a/src/hid/common/hidinit.c
+++ b/src/hid/common/hidinit.c
@@ -23,6 +23,7 @@
#include "global.h"
#include "hid.h"
+#include "hidnogui.h"
#include "../hidint.h"
/* for dlopen() and friends on windows */
@@ -45,9 +46,7 @@ RCSID ("$Id$");
HID **hid_list = 0;
int hid_num_hids = 0;
-extern HID hid_nogui;
-
-HID *gui = &hid_nogui;
+HID *gui = NULL;
HID *exporter = NULL;
int pixel_slop = 1;
@@ -122,8 +121,9 @@ hid_load_dir (char *dirname)
void
hid_init ()
{
+ /* Setup a "nogui" default HID */
+ gui = hid_nogui_get_hid ();
- gui = &hid_nogui;
#define HID_DEF(x) hid_ ## x ## _init();
#include "hid/common/hidlist.h"
#undef HID_DEF
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index 08061fe..aef38b8 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -448,130 +448,76 @@ nogui_finish_debug_draw (void)
{
}
-HID hid_nogui = {
- sizeof (HID),
- "nogui",
- "Default GUI when no other GUI is present. Does nothing.",
- 0, 0, 0, 0, 0,
- nogui_get_export_options,
- nogui_do_export,
- nogui_parse_arguments,
- nogui_invalidate_lr,
- nogui_invalidate_all,
- 0 /* nogui_notify_crosshair_change */ ,
- 0 /* nogui_notify_mark_change */ ,
- nogui_set_layer,
- nogui_end_layer,
- nogui_make_gc,
- nogui_destroy_gc,
- nogui_use_mask,
- nogui_set_color,
- nogui_set_line_cap,
- nogui_set_line_width,
- nogui_set_draw_xor,
- nogui_set_draw_faded,
- nogui_draw_line,
- nogui_draw_arc,
- nogui_draw_rect,
- nogui_fill_circle,
- nogui_fill_polygon,
- nogui_fill_pcb_polygon,
- 0 /* nogui_thindraw_pcb_polygon */ ,
- nogui_fill_pcb_pad,
- nogui_thindraw_pcb_pad,
- nogui_fill_pcb_pv,
- nogui_thindraw_pcb_pv,
- nogui_fill_rect,
- nogui_calibrate,
- nogui_shift_is_pressed,
- nogui_control_is_pressed,
- nogui_mod1_is_pressed,
- nogui_get_coords,
- nogui_set_crosshair,
- nogui_add_timer,
- nogui_stop_timer,
- nogui_watch_file,
- nogui_unwatch_file,
- nogui_add_block_hook,
- nogui_stop_block_hook,
- nogui_log,
- nogui_logv,
- nogui_confirm_dialog,
- nogui_close_confirm_dialog,
- nogui_report_dialog,
- nogui_prompt_for,
- nogui_fileselect,
- nogui_attribute_dialog,
- nogui_show_item,
- nogui_beep,
- nogui_progress,
- 0 /* nogui_drc_gui */ ,
- 0 /* edit_attributes */,
- nogui_request_debug_draw,
- nogui_flush_debug_draw,
- nogui_finish_debug_draw,
-};
-
-#define AD(x) if (!d->x) d->x = s->x
-
void
-apply_default_hid (HID * d, HID * s)
-{
- if (s == 0)
- s = &hid_nogui;
- AD (get_export_options);
- AD (do_export);
- AD (parse_arguments);
- AD (invalidate_lr);
- AD (invalidate_all);
- AD (notify_crosshair_change);
- AD (notify_mark_change);
- AD (set_layer);
- AD (end_layer);
- AD (make_gc);
- AD (destroy_gc);
- AD (use_mask);
- AD (set_color);
- AD (set_line_cap);
- AD (set_line_width);
- AD (set_draw_xor);
- AD (set_draw_faded);
- AD (draw_line);
- AD (draw_arc);
- AD (fill_circle);
- AD (fill_polygon);
- AD (fill_pcb_polygon);
- AD (thindraw_pcb_polygon);
- AD (fill_pcb_pad);
- AD (thindraw_pcb_pad);
- AD (fill_pcb_pv);
- AD (thindraw_pcb_pv);
- AD (calibrate);
- AD (shift_is_pressed);
- AD (control_is_pressed);
- AD (mod1_is_pressed);
- AD (get_coords);
- AD (set_crosshair);
- AD (add_timer);
- AD (stop_timer);
- AD (watch_file);
- AD (unwatch_file);
- AD (add_block_hook);
- AD (stop_block_hook);
- AD (log);
- AD (logv);
- AD (confirm_dialog);
- AD (close_confirm_dialog);
- AD (report_dialog);
- AD (prompt_for);
- AD (fileselect);
- AD (attribute_dialog);
- AD (show_item);
- AD (beep);
- AD (progress);
- AD (drc_gui);
- AD (edit_attributes);
- AD (request_debug_draw);
- AD (flush_debug_draw);
- AD (finish_debug_draw);
+common_nogui_init (HID *hid)
+{
+ hid->get_export_options = nogui_get_export_options;
+ hid->do_export = nogui_do_export;
+ hid->parse_arguments = nogui_parse_arguments;
+ hid->invalidate_lr = nogui_invalidate_lr;
+ hid->invalidate_all = nogui_invalidate_all;
+ hid->set_layer = nogui_set_layer;
+ hid->end_layer = nogui_end_layer;
+ hid->make_gc = nogui_make_gc;
+ hid->destroy_gc = nogui_destroy_gc;
+ hid->use_mask = nogui_use_mask;
+ hid->set_color = nogui_set_color;
+ hid->set_line_cap = nogui_set_line_cap;
+ hid->set_line_width = nogui_set_line_width;
+ hid->set_draw_xor = nogui_set_draw_xor;
+ hid->set_draw_faded = nogui_set_draw_faded;
+ hid->draw_line = nogui_draw_line;
+ hid->draw_arc = nogui_draw_arc;
+ hid->draw_rect = nogui_draw_rect;
+ hid->fill_circle = nogui_fill_circle;
+ hid->fill_polygon = nogui_fill_polygon;
+ hid->fill_pcb_polygon = nogui_fill_pcb_polygon;
+ hid->fill_pcb_pad = nogui_fill_pcb_pad;
+ hid->thindraw_pcb_pad = nogui_thindraw_pcb_pad;
+ hid->fill_pcb_pv = nogui_fill_pcb_pv;
+ hid->thindraw_pcb_pv = nogui_thindraw_pcb_pv;
+ hid->fill_rect = nogui_fill_rect;
+ hid->calibrate = nogui_calibrate;
+ hid->shift_is_pressed = nogui_shift_is_pressed;
+ hid->control_is_pressed = nogui_control_is_pressed;
+ hid->mod1_is_pressed = nogui_mod1_is_pressed;
+ hid->get_coords = nogui_get_coords;
+ hid->set_crosshair = nogui_set_crosshair;
+ hid->add_timer = nogui_add_timer;
+ hid->stop_timer = nogui_stop_timer;
+ hid->watch_file = nogui_watch_file;
+ hid->unwatch_file = nogui_unwatch_file;
+ hid->add_block_hook = nogui_add_block_hook;
+ hid->stop_block_hook = nogui_stop_block_hook;
+ hid->log = nogui_log;
+ hid->logv = nogui_logv;
+ hid->confirm_dialog = nogui_confirm_dialog;
+ hid->close_confirm_dialog = nogui_close_confirm_dialog;
+ hid->report_dialog = nogui_report_dialog;
+ hid->prompt_for = nogui_prompt_for;
+ hid->fileselect = nogui_fileselect;
+ hid->attribute_dialog = nogui_attribute_dialog;
+ hid->show_item = nogui_show_item;
+ hid->beep = nogui_beep;
+ hid->progress = nogui_progress;
+ hid->request_debug_draw = nogui_request_debug_draw;
+ hid->flush_debug_draw = nogui_flush_debug_draw;
+ hid->finish_debug_draw = nogui_finish_debug_draw;
+}
+
+static HID nogui_hid;
+
+HID *
+hid_nogui_get_hid (void)
+{
+ memset (&nogui_hid, 0, sizeof (HID));
+
+ nogui_hid.struct_size = sizeof (HID);
+ nogui_hid.name = "nogui";
+ nogui_hid.description = "Default GUI when no other GUI is present. "
+ "Does nothing.";
+
+ common_nogui_init (&nogui_hid);
+
+ return &nogui_hid;
}
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 6514fe9..2f26c8e 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -53,6 +53,7 @@
#include "hid.h"
#include "../hidint.h"
#include <gd.h>
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "gcode.h"
#include "bitmap.h"
@@ -1031,6 +1032,7 @@ hid_gcode_init ()
{
memset (&gcode_hid, 0, sizeof (HID));
+ common_nogui_init (&gcode_hid);
common_draw_helpers_init (&gcode_hid);
gcode_hid.struct_size = sizeof (HID);
@@ -1060,7 +1062,6 @@ hid_gcode_init ()
gcode_hid.calibrate = gcode_calibrate;
gcode_hid.set_crosshair = gcode_set_crosshair;
- apply_default_hid (&gcode_hid, 0);
hid_register_hid (&gcode_hid);
#include "gcode_lists.h"
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 47e6124..7737444 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -29,6 +29,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "hid/common/hidinit.h"
@@ -1160,6 +1161,7 @@ hid_gerber_init ()
{
memset (&gerber_hid, 0, sizeof (HID));
+ common_nogui_init (&gerber_hid);
common_draw_helpers_init (&gerber_hid);
gerber_hid.struct_size = sizeof (HID);
@@ -1187,6 +1189,5 @@ hid_gerber_init ()
gerber_hid.calibrate = gerber_calibrate;
gerber_hid.set_crosshair = gerber_set_crosshair;
- apply_default_hid (&gerber_hid, 0);
hid_register_hid (&gerber_hid);
}
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 091f472..847da1b 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -18,6 +18,7 @@
#include "error.h"
#include "../hidint.h"
#include "gui.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#ifdef HAVE_LIBDMALLOC
@@ -2268,6 +2269,7 @@ hid_gtk_init ()
memset (&ghid_hid, 0, sizeof (HID));
+ common_nogui_init (&ghid_hid);
common_draw_helpers_init (&ghid_hid);
ghid_hid.struct_size = sizeof (HID);
@@ -2330,7 +2332,6 @@ hid_gtk_init ()
ghid_hid.flush_debug_draw = ghid_flush_debug_draw;
ghid_hid.finish_debug_draw = ghid_finish_debug_draw;
- apply_default_hid (&ghid_hid, 0);
hid_register_hid (&ghid_hid);
#include "gtk_lists.h"
}
diff --git a/src/hid/hidint.h b/src/hid/hidint.h
index a2148a0..8302745 100644
--- a/src/hid/hidint.h
+++ b/src/hid/hidint.h
@@ -39,10 +39,6 @@ HID_Action *hid_find_action (const char *name);
HID_Flag *hid_find_flag (const char *name);
-/* Any field that is NULL in "d" is copied from the matching field in
- "s". If "s" is NULL, the nogui HID is used. */
-void apply_default_hid (HID * d, HID * s);
-
/* A HID may use this if it does not need command line arguments in
any special format; for example, the Lesstif HID needs to use the
Xt parser, but the Postscript HID can use this function. */
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index c2513bf..90979c0 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -28,6 +28,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "hid/common/hid_resource.h"
#include "lesstif.h"
@@ -4005,6 +4006,7 @@ hid_lesstif_init ()
{
memset (&lesstif_hid, 0, sizeof (HID));
+ common_nogui_init (&lesstif_hid);
common_draw_helpers_init (&lesstif_hid);
lesstif_hid.struct_size = sizeof (HID);
@@ -4065,7 +4067,6 @@ hid_lesstif_init ()
lesstif_hid.flush_debug_draw = lesstif_flush_debug_draw;
lesstif_hid.finish_debug_draw = lesstif_finish_debug_draw;
- apply_default_hid (&lesstif_hid, 0);
hid_register_hid (&lesstif_hid);
#include "lesstif_lists.h"
}
diff --git a/src/hid/lpr/lpr.c b/src/hid/lpr/lpr.c
index 2f34833..3d46fec 100644
--- a/src/hid/lpr/lpr.c
+++ b/src/hid/lpr/lpr.c
@@ -17,6 +17,7 @@
#include "hid.h"
#include "../hidint.h"
#include "../ps/ps.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/hidinit.h"
#ifdef HAVE_LIBDMALLOC
@@ -118,6 +119,7 @@ hid_lpr_init ()
{
memset (&lpr_hid, 0, sizeof (HID));
+ common_nogui_init (&lpr_hid);
ps_ps_init (&lpr_hid);
lpr_hid.struct_size = sizeof (HID);
@@ -131,6 +133,5 @@ hid_lpr_init ()
lpr_hid.parse_arguments = lpr_parse_arguments;
lpr_hid.calibrate = lpr_calibrate;
- apply_default_hid (&lpr_hid, 0);
hid_register_hid (&lpr_hid);
}
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index 9dbf24c..8c78a53 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -71,6 +71,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include <gd.h>
@@ -1046,6 +1047,7 @@ hid_nelma_init()
{
memset (&nelma_hid, 0, sizeof (HID));
+ common_nogui_init (&nelma_hid);
common_draw_helpers_init (&nelma_hid);
nelma_hid.struct_size = sizeof (HID);
@@ -1075,7 +1077,6 @@ hid_nelma_init()
nelma_hid.calibrate = nelma_calibrate;
nelma_hid.set_crosshair = nelma_set_crosshair;
- apply_default_hid (&nelma_hid, 0);
hid_register_hid (&nelma_hid);
#include "nelma_lists.h"
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 9890364..279e39c 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -41,6 +41,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "png.h"
@@ -1515,6 +1516,7 @@ hid_png_init ()
{
memset (&png_hid, 0, sizeof (HID));
+ common_nogui_init (&png_hid);
common_draw_helpers_init (&png_hid);
png_hid.struct_size = sizeof (HID);
@@ -1543,7 +1545,6 @@ hid_png_init ()
png_hid.calibrate = png_calibrate;
png_hid.set_crosshair = png_set_crosshair;
- apply_default_hid (&png_hid, 0);
hid_register_hid (&png_hid);
#include "png_lists.h"
diff --git a/src/hid/ps/eps.c b/src/hid/ps/eps.c
index e17f8a3..69430d8 100644
--- a/src/hid/ps/eps.c
+++ b/src/hid/ps/eps.c
@@ -16,6 +16,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "../ps/ps.h"
#include "hid/common/hidinit.h"
@@ -628,6 +629,7 @@ hid_eps_init ()
{
memset (&eps_hid, 0, sizeof (HID));
+ common_nogui_init (&eps_hid);
common_draw_helpers_init (&eps_hid);
eps_hid.struct_size = sizeof (HID);
@@ -656,6 +658,5 @@ hid_eps_init ()
eps_hid.calibrate = eps_calibrate;
eps_hid.set_crosshair = eps_set_crosshair;
- apply_default_hid (&eps_hid, 0);
hid_register_hid (&eps_hid);
}
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index c2e5b26..7f2c3d7 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -19,6 +19,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "../ps/ps.h"
#include "../../print.h"
@@ -1368,6 +1369,7 @@ hid_ps_init ()
{
memset (&ps_hid, 0, sizeof (HID));
+ common_nogui_init (&ps_hid);
common_draw_helpers_init (&ps_hid);
ps_ps_init (&ps_hid);
@@ -1377,7 +1379,6 @@ hid_ps_init ()
ps_hid.exporter = 1;
ps_hid.poly_before = 1;
- apply_default_hid (&ps_hid, 0);
hid_register_hid (&ps_hid);
hid_eps_init ();
|
|
From: <gi...@gp...> - 2011-05-13 00:50:59
|
The branch, master has been updated
via f1353c0b245d4fad16add67bf8e63a2f57d9f427 (commit)
from 8fbd6b89053bd39eaf76f20ad62c570c2d50c705 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/batch/batch.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit f1353c0b245d4fad16add67bf8e63a2f57d9f427
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/batch: #include "hid/common/draw_helpers.h" which was missing
Fixes a compiler warning about an implicitly declared function.
:100644 100644 a51d058... 1b5ca10... M src/hid/batch/batch.c
=========
Changes
=========
commit f1353c0b245d4fad16add67bf8e63a2f57d9f427
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/batch: #include "hid/common/draw_helpers.h" which was missing
Fixes a compiler warning about an implicitly declared function.
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index a51d058..1b5ca10 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -17,6 +17,7 @@
#include "hid.h"
#include "../hidint.h"
+#include "hid/common/draw_helpers.h"
#include "hid/common/actions.h"
#include "hid/common/hidinit.h"
|
|
From: <gi...@gp...> - 2011-05-13 00:37:53
|
The branch, master has been updated
via 8fbd6b89053bd39eaf76f20ad62c570c2d50c705 (commit)
from e2a5c0ee399d55799cce9ea62b1adc9494bb505f (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/lpr/lpr.c | 3 ++-
src/hid/ps/ps.c | 48 ++++++++++++++++++++++++++----------------------
src/hid/ps/ps.h | 1 +
3 files changed, 29 insertions(+), 23 deletions(-)
=================
Commit Messages
=================
commit 8fbd6b89053bd39eaf76f20ad62c570c2d50c705
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/ps: Provide helper function to fill in HID members useful to other HIDs
This avoids setting up the drawing routines of the lpr HID with
apply_default_hid, which is a little opaque.
:100644 100644 f65c5a5... 2f34833... M src/hid/lpr/lpr.c
:100644 100644 92f03fd... c2e5b26... M src/hid/ps/ps.c
:100644 100644 749ad18... 661eaa8... M src/hid/ps/ps.h
=========
Changes
=========
commit 8fbd6b89053bd39eaf76f20ad62c570c2d50c705
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/ps: Provide helper function to fill in HID members useful to other HIDs
This avoids setting up the drawing routines of the lpr HID with
apply_default_hid, which is a little opaque.
diff --git a/src/hid/lpr/lpr.c b/src/hid/lpr/lpr.c
index f65c5a5..2f34833 100644
--- a/src/hid/lpr/lpr.c
+++ b/src/hid/lpr/lpr.c
@@ -118,6 +118,8 @@ hid_lpr_init ()
{
memset (&lpr_hid, 0, sizeof (HID));
+ ps_ps_init (&lpr_hid);
+
lpr_hid.struct_size = sizeof (HID);
lpr_hid.name = "lpr";
lpr_hid.description = "Postscript print.";
@@ -129,7 +131,6 @@ hid_lpr_init ()
lpr_hid.parse_arguments = lpr_parse_arguments;
lpr_hid.calibrate = lpr_calibrate;
- apply_default_hid (&lpr_hid, &ps_hid);
apply_default_hid (&lpr_hid, 0);
hid_register_hid (&lpr_hid);
}
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index 92f03fd..c2e5b26 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -1338,12 +1338,38 @@ ps_set_crosshair (int x, int y, int action)
HID ps_hid;
+void ps_ps_init (HID *hid)
+{
+ hid->get_export_options = ps_get_export_options;
+ hid->do_export = ps_do_export;
+ hid->parse_arguments = ps_parse_arguments;
+ hid->set_layer = ps_set_layer;
+ hid->make_gc = ps_make_gc;
+ hid->destroy_gc = ps_destroy_gc;
+ hid->use_mask = ps_use_mask;
+ hid->set_color = ps_set_color;
+ hid->set_line_cap = ps_set_line_cap;
+ hid->set_line_width = ps_set_line_width;
+ hid->set_draw_xor = ps_set_draw_xor;
+ hid->set_draw_faded = ps_set_draw_faded;
+ hid->draw_line = ps_draw_line;
+ hid->draw_arc = ps_draw_arc;
+ hid->draw_rect = ps_draw_rect;
+ hid->fill_circle = ps_fill_circle;
+ hid->fill_polygon = ps_fill_polygon;
+ hid->fill_pcb_polygon = ps_fill_pcb_polygon;
+ hid->fill_rect = ps_fill_rect;
+ hid->calibrate = ps_calibrate;
+ hid->set_crosshair = ps_set_crosshair;
+}
+
void
hid_ps_init ()
{
memset (&ps_hid, 0, sizeof (HID));
common_draw_helpers_init (&ps_hid);
+ ps_ps_init (&ps_hid);
ps_hid.struct_size = sizeof (HID);
ps_hid.name = "ps";
@@ -1351,28 +1377,6 @@ hid_ps_init ()
ps_hid.exporter = 1;
ps_hid.poly_before = 1;
- ps_hid.get_export_options = ps_get_export_options;
- ps_hid.do_export = ps_do_export;
- ps_hid.parse_arguments = ps_parse_arguments;
- ps_hid.set_layer = ps_set_layer;
- ps_hid.make_gc = ps_make_gc;
- ps_hid.destroy_gc = ps_destroy_gc;
- ps_hid.use_mask = ps_use_mask;
- ps_hid.set_color = ps_set_color;
- ps_hid.set_line_cap = ps_set_line_cap;
- ps_hid.set_line_width = ps_set_line_width;
- ps_hid.set_draw_xor = ps_set_draw_xor;
- ps_hid.set_draw_faded = ps_set_draw_faded;
- ps_hid.draw_line = ps_draw_line;
- ps_hid.draw_arc = ps_draw_arc;
- ps_hid.draw_rect = ps_draw_rect;
- ps_hid.fill_circle = ps_fill_circle;
- ps_hid.fill_polygon = ps_fill_polygon;
- ps_hid.fill_pcb_polygon = ps_fill_pcb_polygon;
- ps_hid.fill_rect = ps_fill_rect;
- ps_hid.calibrate = ps_calibrate;
- ps_hid.set_crosshair = ps_set_crosshair;
-
apply_default_hid (&ps_hid, 0);
hid_register_hid (&ps_hid);
diff --git a/src/hid/ps/ps.h b/src/hid/ps/ps.h
index 749ad18..661eaa8 100644
--- a/src/hid/ps/ps.h
+++ b/src/hid/ps/ps.h
@@ -5,3 +5,4 @@ extern void ps_hid_export_to_file (FILE *, HID_Attr_Val *);
extern void ps_start_file (FILE *);
extern void ps_calibrate_1 (double , double , int);
extern void hid_eps_init ();
+void ps_ps_init (HID *hid);
|