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...> - 2010-04-03 22:16:15
|
The branch, master has been updated
via 57573ccab81b7125526bd4b311bbc61569e7ea35 (commit)
from 17ae6c24c0ac2cd49b104496e3e650866d7ff29b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gtkhid-main.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
src/hid/gtk/gui-dialog.c | 11 ++++++++++-
2 files changed, 55 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 57573ccab81b7125526bd4b311bbc61569e7ea35
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Open schematic file chooser dialog if PCB name is not set.
(cherry picked from commit 209e1031656f58ffe40189d93893457975c4042f)
:100644 100644 b8fdc75... fb2aff1... M src/hid/gtk/gtkhid-main.c
:100644 100644 7fcbf6d... 1697324... M src/hid/gtk/gui-dialog.c
=========
Changes
=========
commit 57573ccab81b7125526bd4b311bbc61569e7ea35
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Open schematic file chooser dialog if PCB name is not set.
(cherry picked from commit 209e1031656f58ffe40189d93893457975c4042f)
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index b8fdc75..fb2aff1 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2196,7 +2196,51 @@ Popup (int argc, char **argv, int x, int y)
}
return 0;
}
+/* ------------------------------------------------------------ */
+static const char importgui_syntax[] =
+"Popup(MenuName, [Button])";
+
+static const char importgui_help[] =
+"Asks user which schematics to import into PCB.\n";
+
+/* %start-doc actions ImportGUI
+
+Asks user which schematics to import into PCB.
+
+%end-doc */
+
+
+static int
+ImportGUI (int argc, char **argv, int x, int y)
+{
+ char *name = NULL;
+ static gchar *current_layout_dir = NULL;
+ static int I_am_recursing = 0;
+ int rv;
+ if (I_am_recursing)
+ return 1;
+
+
+ name = ghid_dialog_file_select_open (_("Load schematics"),
+ ¤t_layout_dir,
+ Settings.FilePath);
+
+#ifdef DEBUG
+ printf("File selected = %s\n", name);
+#endif
+
+ AttributePut (PCB, "import::src0", name);
+ free (name);
+
+ I_am_recursing = 1;
+ rv = hid_action ("Import");
+ I_am_recursing = 0;
+
+ return rv;
+}
+
+/* ------------------------------------------------------------ */
static int
Busy (int argc, char **argv, int x, int y)
{
@@ -2214,6 +2258,7 @@ HID_Action ghid_main_action_list[] = {
{"DoWindows", 0, DoWindows, dowindows_help, dowindows_syntax},
{"Export", 0, Export},
{"GetXY", "", GetXY, getxy_help, getxy_syntax},
+ {"ImportGUI", 0, ImportGUI, importgui_help, importgui_syntax},
{"LayerGroupsChanged", 0, LayerGroupsChanged},
{"LibraryChanged", 0, LibraryChanged},
{"Load", 0, Load},
diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c
index 7fcbf6d..1697324 100644
--- a/src/hid/gtk/gui-dialog.c
+++ b/src/hid/gtk/gui-dialog.c
@@ -44,6 +44,7 @@
RCSID ("$Id$");
+/* ---------------------------------------------- */
gchar *
ghid_dialog_input (gchar * prompt, gchar * initial)
{
@@ -87,6 +88,7 @@ ghid_dialog_input (gchar * prompt, gchar * initial)
return string;
}
+/* ---------------------------------------------- */
void
ghid_dialog_about (void)
{
@@ -103,6 +105,7 @@ ghid_dialog_about (void)
gtk_widget_destroy (dialog);
}
+/* ---------------------------------------------- */
gint
ghid_dialog_confirm_all (gchar * all_message)
{
@@ -131,6 +134,7 @@ ghid_dialog_confirm_all (gchar * all_message)
return response;
}
+/* ---------------------------------------------- */
void
ghid_dialog_message (gchar * message)
{
@@ -147,6 +151,7 @@ ghid_dialog_message (gchar * message)
gtk_widget_destroy (dialog);
}
+/* ---------------------------------------------- */
gboolean
ghid_dialog_confirm (gchar * message, gchar * cancelmsg, gchar * okmsg)
{
@@ -188,6 +193,7 @@ ghid_dialog_confirm (gchar * message, gchar * cancelmsg, gchar * okmsg)
return confirm;
}
+/* ---------------------------------------------- */
gint
ghid_dialog_close_confirm ()
{
@@ -255,6 +261,7 @@ ghid_dialog_close_confirm ()
return rv;
}
+/* ---------------------------------------------- */
/* Caller must g_free() the returned filename.*/
gchar *
ghid_dialog_file_select_open (gchar * title, gchar ** path, gchar * shortcuts)
@@ -353,7 +360,7 @@ ghid_dialog_file_select_open (gchar * title, gchar ** path, gchar * shortcuts)
return result;
}
-
+/* ---------------------------------------------- */
/* Caller must g_free() the returned filename. */
gchar *
ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file,
@@ -408,6 +415,7 @@ ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file,
}
+/* ---------------------------------------------- */
/* how many files and directories to keep for the shortcuts */
#define NHIST 8
typedef struct ghid_file_history_struct
@@ -427,6 +435,7 @@ typedef struct ghid_file_history_struct
static int n_recent_dirs = 0;
static ghid_file_history * recent_dirs = NULL;
+/* ---------------------------------------------- */
/* Caller must g_free() the returned filename. */
gchar *
ghid_fileselect (const char *title, const char *descr,
|
|
From: <gi...@gp...> - 2010-04-03 22:06:39
|
The branch, sdb-playpen has been updated
via 209e1031656f58ffe40189d93893457975c4042f (commit)
via fde396b99032150688e75819ff778a40237904d2 (commit)
via 17ae6c24c0ac2cd49b104496e3e650866d7ff29b (commit)
via a2c8d70fddc6f1fcecce33452b717c4b5c9c4e57 (commit)
via 4118a4bdcdaae5cb9ddf206744d693db4688a215 (commit)
via c874798634ea44e0384b48b18730b80d592b5377 (commit)
from 282f7216dec565223415f16d5dc7517917aed776 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/action.c | 2 +-
src/hid/gtk/gtkhid-main.c | 45 +++++++++++++++++++++++
src/hid/gtk/gui-dialog.c | 11 +++++-
src/hid/lesstif/dialogs.c | 89 +++++++++++++++++++++++++++++++++++++++++++++
src/misc.c | 32 +++++++++++++++-
src/misc.h | 2 +-
6 files changed, 176 insertions(+), 5 deletions(-)
=================
Commit Messages
=================
commit 209e1031656f58ffe40189d93893457975c4042f
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Open schematic file chooser dialog if PCB name is not set.
:100644 100644 9f184a2... 5f2755d... M src/hid/gtk/gtkhid-main.c
:100644 100644 7fcbf6d... 1697324... M src/hid/gtk/gui-dialog.c
commit 17ae6c24c0ac2cd49b104496e3e650866d7ff29b
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Implement lesstif ImportGUI()
:100644 100644 213c5f2... 72b41ee... M src/hid/lesstif/dialogs.c
commit a2c8d70fddc6f1fcecce33452b717c4b5c9c4e57
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add missing newline.
:100644 100644 5ace046... a81c142... M src/action.c
commit 4118a4bdcdaae5cb9ddf206744d693db4688a215
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Let the GUI deal with choosing schematics.
If the PCB is as yet unnamed, or if the pcb name doesn't
correspond to a schematic file, have Import() call ImportGUI()
to let the user tell PCB what to do.
Note: corresponding HID changes are separate commits.
:100644 100644 c15c7c0... 5ace046... M src/action.c
commit c874798634ea44e0384b48b18730b80d592b5377
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add AttributePut functionality.
Add the logic to put arbitrary attributes into a PCB.
:100644 100644 cca9e1b... d19970b... M src/misc.c
:100644 100644 7f06804... 3634f9b... M src/misc.h
=========
Changes
=========
commit 209e1031656f58ffe40189d93893457975c4042f
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Open schematic file chooser dialog if PCB name is not set.
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 9f184a2..5f2755d 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2205,7 +2205,51 @@ Popup (int argc, char **argv, int x, int y)
}
return 0;
}
+/* ------------------------------------------------------------ */
+static const char importgui_syntax[] =
+"Popup(MenuName, [Button])";
+
+static const char importgui_help[] =
+"Asks user which schematics to import into PCB.\n";
+
+/* %start-doc actions ImportGUI
+
+Asks user which schematics to import into PCB.
+
+%end-doc */
+
+
+static int
+ImportGUI (int argc, char **argv, int x, int y)
+{
+ char *name = NULL;
+ static gchar *current_layout_dir = NULL;
+ static int I_am_recursing = 0;
+ int rv;
+ if (I_am_recursing)
+ return 1;
+
+
+ name = ghid_dialog_file_select_open (_("Load schematics"),
+ ¤t_layout_dir,
+ Settings.FilePath);
+
+#ifdef DEBUG
+ printf("File selected = %s\n", name);
+#endif
+
+ AttributePut (PCB, "import::src0", name);
+ free (name);
+
+ I_am_recursing = 1;
+ rv = hid_action ("Import");
+ I_am_recursing = 0;
+
+ return rv;
+}
+
+/* ------------------------------------------------------------ */
static int
Busy (int argc, char **argv, int x, int y)
{
@@ -2223,6 +2267,7 @@ HID_Action ghid_main_action_list[] = {
{"DoWindows", 0, DoWindows, dowindows_help, dowindows_syntax},
{"Export", 0, Export},
{"GetXY", "", GetXY, getxy_help, getxy_syntax},
+ {"ImportGUI", 0, ImportGUI, importgui_help, importgui_syntax},
{"LayerGroupsChanged", 0, LayerGroupsChanged},
{"LibraryChanged", 0, LibraryChanged},
{"Load", 0, Load},
diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c
index 7fcbf6d..1697324 100644
--- a/src/hid/gtk/gui-dialog.c
+++ b/src/hid/gtk/gui-dialog.c
@@ -44,6 +44,7 @@
RCSID ("$Id$");
+/* ---------------------------------------------- */
gchar *
ghid_dialog_input (gchar * prompt, gchar * initial)
{
@@ -87,6 +88,7 @@ ghid_dialog_input (gchar * prompt, gchar * initial)
return string;
}
+/* ---------------------------------------------- */
void
ghid_dialog_about (void)
{
@@ -103,6 +105,7 @@ ghid_dialog_about (void)
gtk_widget_destroy (dialog);
}
+/* ---------------------------------------------- */
gint
ghid_dialog_confirm_all (gchar * all_message)
{
@@ -131,6 +134,7 @@ ghid_dialog_confirm_all (gchar * all_message)
return response;
}
+/* ---------------------------------------------- */
void
ghid_dialog_message (gchar * message)
{
@@ -147,6 +151,7 @@ ghid_dialog_message (gchar * message)
gtk_widget_destroy (dialog);
}
+/* ---------------------------------------------- */
gboolean
ghid_dialog_confirm (gchar * message, gchar * cancelmsg, gchar * okmsg)
{
@@ -188,6 +193,7 @@ ghid_dialog_confirm (gchar * message, gchar * cancelmsg, gchar * okmsg)
return confirm;
}
+/* ---------------------------------------------- */
gint
ghid_dialog_close_confirm ()
{
@@ -255,6 +261,7 @@ ghid_dialog_close_confirm ()
return rv;
}
+/* ---------------------------------------------- */
/* Caller must g_free() the returned filename.*/
gchar *
ghid_dialog_file_select_open (gchar * title, gchar ** path, gchar * shortcuts)
@@ -353,7 +360,7 @@ ghid_dialog_file_select_open (gchar * title, gchar ** path, gchar * shortcuts)
return result;
}
-
+/* ---------------------------------------------- */
/* Caller must g_free() the returned filename. */
gchar *
ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file,
@@ -408,6 +415,7 @@ ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file,
}
+/* ---------------------------------------------- */
/* how many files and directories to keep for the shortcuts */
#define NHIST 8
typedef struct ghid_file_history_struct
@@ -427,6 +435,7 @@ typedef struct ghid_file_history_struct
static int n_recent_dirs = 0;
static ghid_file_history * recent_dirs = NULL;
+/* ---------------------------------------------- */
/* Caller must g_free() the returned filename. */
gchar *
ghid_fileselect (const char *title, const char *descr,
commit 17ae6c24c0ac2cd49b104496e3e650866d7ff29b
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Implement lesstif ImportGUI()
diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c
index 213c5f2..72b41ee 100644
--- a/src/hid/lesstif/dialogs.c
+++ b/src/hid/lesstif/dialogs.c
@@ -2007,6 +2007,93 @@ lesstif_attributes_dialog (char *owner, AttributeListType *attrs_list)
return;
}
+/* ------------------------------------------------------------ */
+
+static const char importgui_syntax[] =
+"ImportGUI()";
+
+static const char importgui_help[] =
+"Lets the user choose the schematics to import from";
+
+/* %start-doc actions ImportGUI
+
+Displays a dialog that lets the user select the schematic(s) to import
+from, then saves that information in the layout's attributes for
+future imports.
+
+*/
+
+static int
+ImportGUI (int argc, char **argv, int x, int y)
+{
+ static int I_am_recursing = 0;
+ static XmString xms_sch = 0, xms_import = 0;
+ int rv;
+ XmString xmname;
+ char *name, *bname;
+ char *original_dir, *target_dir, *last_slash;
+
+ if (I_am_recursing)
+ return 1;
+
+ if (xms_sch == 0)
+ xms_sch = XmStringCreateLocalized ("*.sch");
+ if (xms_import == 0)
+ xms_import = XmStringCreateLocalized ("Import from");
+
+ setup_fsb_dialog ();
+
+ n = 0;
+ stdarg (XmNtitle, "Import From");
+ XtSetValues (XtParent (fsb), args, n);
+
+ n = 0;
+ stdarg (XmNpattern, xms_sch);
+ stdarg (XmNmustMatch, True);
+ stdarg (XmNselectionLabelString, xms_import);
+ XtSetValues (fsb, args, n);
+
+ n = 0;
+ stdarg (XmNdirectory, &xmname);
+ XtGetValues (fsb, args, n);
+ XmStringGetLtoR (xmname, XmFONTLIST_DEFAULT_TAG, &original_dir);
+
+ if (!wait_for_dialog (fsb))
+ return 1;
+
+ n = 0;
+ stdarg (XmNdirectory, &xmname);
+ XtGetValues (fsb, args, n);
+ XmStringGetLtoR (xmname, XmFONTLIST_DEFAULT_TAG, &target_dir);
+
+ n = 0;
+ stdarg (XmNdirSpec, &xmname);
+ XtGetValues (fsb, args, n);
+
+ XmStringGetLtoR (xmname, XmFONTLIST_DEFAULT_TAG, &name);
+
+ /* If the user didn't change directories, use just the base name.
+ This is the common case and means we don't have to get clever
+ about converting absolute paths into relative paths. */
+ bname = name;
+ if (strcmp (original_dir, target_dir) == 0)
+ {
+ last_slash = strrchr (name, '/');
+ if (last_slash)
+ bname = last_slash + 1;
+ }
+
+ AttributePut (PCB, "import::src0", bname);
+
+ XtFree (name);
+
+
+ I_am_recursing = 1;
+ rv = hid_action ("Import");
+ I_am_recursing = 0;
+
+ return rv;
+}
/* ------------------------------------------------------------ */
@@ -2034,6 +2121,8 @@ HID_Action lesstif_dialog_action_list[] = {
adjustsizes_help, adjustsizes_syntax},
{"EditLayerGroups", 0, EditLayerGroups,
editlayergroups_help, editlayergroups_syntax},
+ {"ImportGUI", 0, ImportGUI,
+ importgui_help, importgui_syntax},
};
REGISTER_ACTIONS (lesstif_dialog_action_list)
commit a2c8d70fddc6f1fcecce33452b717c4b5c9c4e57
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add missing newline.
diff --git a/src/action.c b/src/action.c
index 5ace046..a81c142 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7070,7 +7070,7 @@ ActionElementSetAttr (int argc, char **argv, int x, int y)
if (!e)
{
- Message("Cannot change attribute of %s - element not found", refdes);
+ Message("Cannot change attribute of %s - element not found\n", refdes);
return 1;
}
commit 4118a4bdcdaae5cb9ddf206744d693db4688a215
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Let the GUI deal with choosing schematics.
If the PCB is as yet unnamed, or if the pcb name doesn't
correspond to a schematic file, have Import() call ImportGUI()
to let the user tell PCB what to do.
Note: corresponding HID changes are separate commits.
diff --git a/src/action.c b/src/action.c
index c15c7c0..5ace046 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7190,6 +7190,9 @@ overridden by the user via the @code{make-program} and @code{gnetlist}
@code{pcb} settings (i.e. in @code{~/.pcb/settings} or on the command
line).
+If @pcb{} cannot determine which schematic(s) to import from, the GUI
+is called to let user choose (see @code{ImportGUI()}).
+
%end-doc */
static int
@@ -7438,12 +7441,7 @@ ActionImport (int argc, char **argv, int x, int y)
char *dot, *slash, *bslash;
if (!pcbname)
- {
- Message ("Please save your PCB first, so that it has a\n"
- "file name, or manually add an import::src0 attribute with\n"
- "the name of the schematic to import from.");
- return 1;
- }
+ return hid_action("ImportGUI");
schname = (char *) malloc (strlen(pcbname) + 5);
strcpy (schname, pcbname);
@@ -7458,6 +7456,9 @@ ActionImport (int argc, char **argv, int x, int y)
*dot = 0;
strcat (schname, ".sch");
+ if (access (schname, F_OK))
+ return hid_action("ImportGUI");
+
sources = (char **) malloc (2 * sizeof (char *));
sources[0] = schname;
sources[1] = NULL;
commit c874798634ea44e0384b48b18730b80d592b5377
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add AttributePut functionality.
Add the logic to put arbitrary attributes into a PCB.
diff --git a/src/misc.c b/src/misc.c
index cca9e1b..d19970b 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1886,8 +1886,36 @@ AttributeGetFromList (AttributeListType *list, char *name)
int
AttributePutToList (AttributeListType *list, char *name, char *value, int replace)
{
- /* Not implemented yet. */
- abort ();
+ int i;
+
+ /* If we're allowed to replace an existing attribute, see if we
+ can. */
+ if (replace)
+ {
+ for (i=0; i<list->Number; i++)
+ if (strcmp (name, list->List[i].name) == 0)
+ {
+ free (list->List[i].value);
+ list->List[i].value = MyStrdup (value, "AttributePutToList");
+ return 1;
+ }
+ }
+
+ /* At this point, we're going to need to add a new attribute to the
+ list. See if there's room. */
+ if (list->Number >= list->Max)
+ {
+ list->Max += 10;
+ list->List = (AttributeType *) realloc (list->List,
+ list->Max * sizeof (AttributeType));
+ }
+
+ /* Now add the new attribute. */
+ i = list->Number;
+ list->List[i].name = MyStrdup (name, "AttributePutToList");
+ list->List[i].value = MyStrdup (value, "AttributePutToList");
+ list->Number ++;
+ return 0;
}
diff --git a/src/misc.h b/src/misc.h
index 7f06804..3634f9b 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -85,7 +85,7 @@ char *pcb_author ();
char *AttributeGetFromList (AttributeListType *list, char *name);
/* Adds an attribute to the list. If the attribute already exists,
whether it's replaced or a second copy added depends on
- REPLACE. */
+ REPLACE. Returns non-zero if an existing attribute was replaced. */
int AttributePutToList (AttributeListType *list, char *name, char *value, int replace);
/* Simplistic version: Takes a pointer to an object, looks up attributes in it. */
#define AttributeGet(OBJ,name) AttributeGetFromList (&(OBJ->Attributes), name)
|
|
From: <gi...@gp...> - 2010-04-03 21:53:56
|
The branch, master has been updated
via 17ae6c24c0ac2cd49b104496e3e650866d7ff29b (commit)
via a2c8d70fddc6f1fcecce33452b717c4b5c9c4e57 (commit)
via 4118a4bdcdaae5cb9ddf206744d693db4688a215 (commit)
via c874798634ea44e0384b48b18730b80d592b5377 (commit)
from 7e95250675a70d8fec2bc9ed7ffb8ab067f4390b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/action.c | 15 ++++----
src/hid/lesstif/dialogs.c | 89 +++++++++++++++++++++++++++++++++++++++++++++
src/misc.c | 32 +++++++++++++++-
src/misc.h | 2 +-
4 files changed, 128 insertions(+), 10 deletions(-)
=================
Commit Messages
=================
commit 17ae6c24c0ac2cd49b104496e3e650866d7ff29b
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Implement lesstif ImportGUI()
:100644 100644 213c5f2... 72b41ee... M src/hid/lesstif/dialogs.c
commit a2c8d70fddc6f1fcecce33452b717c4b5c9c4e57
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add missing newline.
:100644 100644 5ace046... a81c142... M src/action.c
commit 4118a4bdcdaae5cb9ddf206744d693db4688a215
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Let the GUI deal with choosing schematics.
If the PCB is as yet unnamed, or if the pcb name doesn't
correspond to a schematic file, have Import() call ImportGUI()
to let the user tell PCB what to do.
Note: corresponding HID changes are separate commits.
:100644 100644 c15c7c0... 5ace046... M src/action.c
commit c874798634ea44e0384b48b18730b80d592b5377
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add AttributePut functionality.
Add the logic to put arbitrary attributes into a PCB.
:100644 100644 cca9e1b... d19970b... M src/misc.c
:100644 100644 7f06804... 3634f9b... M src/misc.h
=========
Changes
=========
commit 17ae6c24c0ac2cd49b104496e3e650866d7ff29b
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Implement lesstif ImportGUI()
diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c
index 213c5f2..72b41ee 100644
--- a/src/hid/lesstif/dialogs.c
+++ b/src/hid/lesstif/dialogs.c
@@ -2007,6 +2007,93 @@ lesstif_attributes_dialog (char *owner, AttributeListType *attrs_list)
return;
}
+/* ------------------------------------------------------------ */
+
+static const char importgui_syntax[] =
+"ImportGUI()";
+
+static const char importgui_help[] =
+"Lets the user choose the schematics to import from";
+
+/* %start-doc actions ImportGUI
+
+Displays a dialog that lets the user select the schematic(s) to import
+from, then saves that information in the layout's attributes for
+future imports.
+
+*/
+
+static int
+ImportGUI (int argc, char **argv, int x, int y)
+{
+ static int I_am_recursing = 0;
+ static XmString xms_sch = 0, xms_import = 0;
+ int rv;
+ XmString xmname;
+ char *name, *bname;
+ char *original_dir, *target_dir, *last_slash;
+
+ if (I_am_recursing)
+ return 1;
+
+ if (xms_sch == 0)
+ xms_sch = XmStringCreateLocalized ("*.sch");
+ if (xms_import == 0)
+ xms_import = XmStringCreateLocalized ("Import from");
+
+ setup_fsb_dialog ();
+
+ n = 0;
+ stdarg (XmNtitle, "Import From");
+ XtSetValues (XtParent (fsb), args, n);
+
+ n = 0;
+ stdarg (XmNpattern, xms_sch);
+ stdarg (XmNmustMatch, True);
+ stdarg (XmNselectionLabelString, xms_import);
+ XtSetValues (fsb, args, n);
+
+ n = 0;
+ stdarg (XmNdirectory, &xmname);
+ XtGetValues (fsb, args, n);
+ XmStringGetLtoR (xmname, XmFONTLIST_DEFAULT_TAG, &original_dir);
+
+ if (!wait_for_dialog (fsb))
+ return 1;
+
+ n = 0;
+ stdarg (XmNdirectory, &xmname);
+ XtGetValues (fsb, args, n);
+ XmStringGetLtoR (xmname, XmFONTLIST_DEFAULT_TAG, &target_dir);
+
+ n = 0;
+ stdarg (XmNdirSpec, &xmname);
+ XtGetValues (fsb, args, n);
+
+ XmStringGetLtoR (xmname, XmFONTLIST_DEFAULT_TAG, &name);
+
+ /* If the user didn't change directories, use just the base name.
+ This is the common case and means we don't have to get clever
+ about converting absolute paths into relative paths. */
+ bname = name;
+ if (strcmp (original_dir, target_dir) == 0)
+ {
+ last_slash = strrchr (name, '/');
+ if (last_slash)
+ bname = last_slash + 1;
+ }
+
+ AttributePut (PCB, "import::src0", bname);
+
+ XtFree (name);
+
+
+ I_am_recursing = 1;
+ rv = hid_action ("Import");
+ I_am_recursing = 0;
+
+ return rv;
+}
/* ------------------------------------------------------------ */
@@ -2034,6 +2121,8 @@ HID_Action lesstif_dialog_action_list[] = {
adjustsizes_help, adjustsizes_syntax},
{"EditLayerGroups", 0, EditLayerGroups,
editlayergroups_help, editlayergroups_syntax},
+ {"ImportGUI", 0, ImportGUI,
+ importgui_help, importgui_syntax},
};
REGISTER_ACTIONS (lesstif_dialog_action_list)
commit a2c8d70fddc6f1fcecce33452b717c4b5c9c4e57
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add missing newline.
diff --git a/src/action.c b/src/action.c
index 5ace046..a81c142 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7070,7 +7070,7 @@ ActionElementSetAttr (int argc, char **argv, int x, int y)
if (!e)
{
- Message("Cannot change attribute of %s - element not found", refdes);
+ Message("Cannot change attribute of %s - element not found\n", refdes);
return 1;
}
commit 4118a4bdcdaae5cb9ddf206744d693db4688a215
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Let the GUI deal with choosing schematics.
If the PCB is as yet unnamed, or if the pcb name doesn't
correspond to a schematic file, have Import() call ImportGUI()
to let the user tell PCB what to do.
Note: corresponding HID changes are separate commits.
diff --git a/src/action.c b/src/action.c
index c15c7c0..5ace046 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7190,6 +7190,9 @@ overridden by the user via the @code{make-program} and @code{gnetlist}
@code{pcb} settings (i.e. in @code{~/.pcb/settings} or on the command
line).
+If @pcb{} cannot determine which schematic(s) to import from, the GUI
+is called to let user choose (see @code{ImportGUI()}).
+
%end-doc */
static int
@@ -7438,12 +7441,7 @@ ActionImport (int argc, char **argv, int x, int y)
char *dot, *slash, *bslash;
if (!pcbname)
- {
- Message ("Please save your PCB first, so that it has a\n"
- "file name, or manually add an import::src0 attribute with\n"
- "the name of the schematic to import from.");
- return 1;
- }
+ return hid_action("ImportGUI");
schname = (char *) malloc (strlen(pcbname) + 5);
strcpy (schname, pcbname);
@@ -7458,6 +7456,9 @@ ActionImport (int argc, char **argv, int x, int y)
*dot = 0;
strcat (schname, ".sch");
+ if (access (schname, F_OK))
+ return hid_action("ImportGUI");
+
sources = (char **) malloc (2 * sizeof (char *));
sources[0] = schname;
sources[1] = NULL;
commit c874798634ea44e0384b48b18730b80d592b5377
Author: DJ Delorie <dj...@du...>
Commit: DJ Delorie <dj...@du...>
Add AttributePut functionality.
Add the logic to put arbitrary attributes into a PCB.
diff --git a/src/misc.c b/src/misc.c
index cca9e1b..d19970b 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1886,8 +1886,36 @@ AttributeGetFromList (AttributeListType *list, char *name)
int
AttributePutToList (AttributeListType *list, char *name, char *value, int replace)
{
- /* Not implemented yet. */
- abort ();
+ int i;
+
+ /* If we're allowed to replace an existing attribute, see if we
+ can. */
+ if (replace)
+ {
+ for (i=0; i<list->Number; i++)
+ if (strcmp (name, list->List[i].name) == 0)
+ {
+ free (list->List[i].value);
+ list->List[i].value = MyStrdup (value, "AttributePutToList");
+ return 1;
+ }
+ }
+
+ /* At this point, we're going to need to add a new attribute to the
+ list. See if there's room. */
+ if (list->Number >= list->Max)
+ {
+ list->Max += 10;
+ list->List = (AttributeType *) realloc (list->List,
+ list->Max * sizeof (AttributeType));
+ }
+
+ /* Now add the new attribute. */
+ i = list->Number;
+ list->List[i].name = MyStrdup (name, "AttributePutToList");
+ list->List[i].value = MyStrdup (value, "AttributePutToList");
+ list->Number ++;
+ return 0;
}
diff --git a/src/misc.h b/src/misc.h
index 7f06804..3634f9b 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -85,7 +85,7 @@ char *pcb_author ();
char *AttributeGetFromList (AttributeListType *list, char *name);
/* Adds an attribute to the list. If the attribute already exists,
whether it's replaced or a second copy added depends on
- REPLACE. */
+ REPLACE. Returns non-zero if an existing attribute was replaced. */
int AttributePutToList (AttributeListType *list, char *name, char *value, int replace);
/* Simplistic version: Takes a pointer to an object, looks up attributes in it. */
#define AttributeGet(OBJ,name) AttributeGetFromList (&(OBJ->Attributes), name)
|
|
From: <gi...@gp...> - 2010-04-03 20:20:31
|
The branch, sdb-playpen has been updated
via 282f7216dec565223415f16d5dc7517917aed776 (commit)
from df0e28d9f58bf5d3278fcddf0459fd93f7f08aa8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/action.c | 13 +++++++------
src/copy.c | 12 ------------
src/create.c | 4 ----
3 files changed, 7 insertions(+), 22 deletions(-)
=================
Commit Messages
=================
commit 282f7216dec565223415f16d5dc7517917aed776
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Fix some conflicts, add DJ's stub for sch file import.
:100644 100644 15f90e4... ccf6847... M src/action.c
:100644 100644 9823cdc... c7d212c... M src/copy.c
:100644 100644 84bdf1e... 459f1ae... M src/create.c
=========
Changes
=========
commit 282f7216dec565223415f16d5dc7517917aed776
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Fix some conflicts, add DJ's stub for sch file import.
diff --git a/src/action.c b/src/action.c
index 15f90e4..ccf6847 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7193,6 +7193,9 @@ overridden by the user via the @code{make-program} and @code{gnetlist}
@code{pcb} settings (i.e. in @code{~/.pcb/settings} or on the command
line).
+If @pcb{} cannot determine which schematic(s) to import from, the GUI
+is called to let user choose (see @code{ImportGUI()}).
+
%end-doc */
static int
@@ -7441,12 +7444,7 @@ ActionImport (int argc, char **argv, int x, int y)
char *dot, *slash, *bslash;
if (!pcbname)
- {
- Message ("Please save your PCB first, so that it has a\n"
- "file name, or manually add an import::src0 attribute with\n"
- "the name of the schematic to import from.");
- return 1;
- }
+ return hid_action("ImportGUI");
schname = (char *) malloc (strlen(pcbname) + 5);
strcpy (schname, pcbname);
@@ -7461,6 +7459,9 @@ ActionImport (int argc, char **argv, int x, int y)
*dot = 0;
strcat (schname, ".sch");
+ if (access (schname, F_OK))
+ return hid_action("ImportGUI");
+
sources = (char **) malloc (2 * sizeof (char *));
sources[0] = schname;
sources[1] = NULL;
diff --git a/src/copy.c b/src/copy.c
index 9823cdc..c7d212c 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -309,11 +309,7 @@ CopyElement (ElementTypePtr Element)
didDraw = True;
}
#ifdef DEBUG
-<<<<<<< HEAD
/* printf(" ... Leaving CopyElement.\n"); */
-=======
- printf(" ... Leaving CopyElement.\n");
->>>>>>> master
#endif
return (element);
}
@@ -330,10 +326,6 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
#ifdef DEBUG
printf("Entering CopyPastebufferToLayout.....\n");
-<<<<<<< HEAD
- printf(" BufferNumber = %d\n", Settings.BufferNumber);
-=======
->>>>>>> master
#endif
/* set movement vector */
@@ -386,11 +378,7 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
ELEMENT_LOOP (PASTEBUFFER->Data);
{
#ifdef DEBUG
-<<<<<<< HEAD
printf(" .... In CopyPastebufferToLayout, pasting element %s ...\n",
-=======
- printf("In CopyPastebufferToLayout, pasting element %s\n",
->>>>>>> master
element->Name[1].TextString);
#endif
if (FRONT (element) || PCB->InvisibleObjectsOn)
diff --git a/src/create.c b/src/create.c
index 84bdf1e..459f1ae 100644
--- a/src/create.c
+++ b/src/create.c
@@ -670,11 +670,7 @@ CreateNewElement (DataTypePtr Data, ElementTypePtr Element,
Element->ID = ID++;
#ifdef DEBUG
-<<<<<<< HEAD
printf("<--- .... Leaving CreateNewElement.\n");
-=======
- printf(" .... Leaving CreateNewElement.\n");
->>>>>>> master
#endif
return (Element);
|
|
From: <gi...@gp...> - 2010-04-03 19:17:55
|
The branch, master has been updated
via 7e95250675a70d8fec2bc9ed7ffb8ab067f4390b (commit)
from 8e622b2c0aa88e2fe131c45438429d3524dc4da6 (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.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 7e95250675a70d8fec2bc9ed7ffb8ab067f4390b
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Remove conflicting declaration of ParseLibraryTree.
This is a static function declared in file.c. Therefore I
took it out of file.h.
:100644 100644 2822525... 64eba23... M src/file.h
=========
Changes
=========
commit 7e95250675a70d8fec2bc9ed7ffb8ab067f4390b
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Remove conflicting declaration of ParseLibraryTree.
This is a static function declared in file.c. Therefore I
took it out of file.h.
diff --git a/src/file.h b/src/file.h
index 2822525..64eba23 100644
--- a/src/file.h
+++ b/src/file.h
@@ -48,7 +48,6 @@ int SaveBufferElements (char *);
void PreLoadElementPCB (void);
void PostLoadElementPCB (void);
void sort_netlist (void);
-int ParseLibraryTree (void);
/*
* Whenever the pcb file format is modified, this version number
|
|
From: <gi...@gp...> - 2010-04-03 18:50:48
|
The branch, master has been updated
via 8e622b2c0aa88e2fe131c45438429d3524dc4da6 (commit)
via 542c19ff457755ce9d26ec1883650c125fcfe576 (commit)
from 480e81559af88dacbfb6bd94cd5fb705ec4f7cb4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/action.c | 54 +++++++++++-
src/buffer.c | 32 ++++++--
src/change.c | 4 +
src/copy.c | 25 +++++-
src/create.c | 12 +++
src/file.c | 280 ++++++++++++++++++++++++++++++++++++++--------------------
src/file.h | 1 +
src/global.h | 17 ++--
src/main.c | 9 ++-
9 files changed, 321 insertions(+), 113 deletions(-)
=================
Commit Messages
=================
commit 8e622b2c0aa88e2fe131c45438429d3524dc4da6
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Place components in middle of board instead of at 0,0.
:100644 100644 94bf07e... c15c7c0... M src/action.c
commit 542c19ff457755ce9d26ec1883650c125fcfe576
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Support for footprints not in subdirectories
Added tons of debug spew to various files to aid in program tracing
Also, modify library loading stuff in file.c to allow footprints to live
directly in library directory (rather than only one level down).
:100644 100644 d7c754b... 94bf07e... M src/action.c
:100644 100644 7daecf5... fbd1735... M src/buffer.c
:100644 100644 db13d5e... 8cbd384... M src/change.c
:100644 100644 5a030c9... 583feb8... M src/copy.c
:100644 100644 518a35b... eced68d... M src/create.c
:100644 100644 fd18340... 639c971... M src/file.c
:100644 100644 64eba23... 2822525... M src/file.h
:100644 100644 80bea72... 1082dd1... M src/global.h
:100644 100644 e5d93eb... 3026f8d... M src/main.c
=========
Changes
=========
commit 8e622b2c0aa88e2fe131c45438429d3524dc4da6
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Place components in middle of board instead of at 0,0.
diff --git a/src/action.c b/src/action.c
index 94bf07e..c15c7c0 100644
--- a/src/action.c
+++ b/src/action.c
@@ -6968,7 +6968,8 @@ ActionElementList (int argc, char **argv, int x, int y)
/* Not on board, need to add it. */
if (LoadFootprint(argc, args, x, y))
return 1;
- if (CopyPastebufferToLayout (0, 0))
+ /* Place components onto center of board. */
+ if (CopyPastebufferToLayout (PCB->MaxWidth/2, PCB->MaxHeight/2))
SetChangedFlag (True);
}
commit 542c19ff457755ce9d26ec1883650c125fcfe576
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Support for footprints not in subdirectories
Added tons of debug spew to various files to aid in program tracing
Also, modify library loading stuff in file.c to allow footprints to live
directly in library directory (rather than only one level down).
diff --git a/src/action.c b/src/action.c
index d7c754b..94bf07e 100644
--- a/src/action.c
+++ b/src/action.c
@@ -6864,6 +6864,7 @@ delete_attr (AttributeListTypePtr list, AttributeType *attr)
list->Number --;
}
+/* ---------------------------------------------------------------- */
static const char elementlist_syntax[] = "ElementList(Start|Done|Need,<refdes>,<footprint>,<value>)";
static const char elementlist_help[] = "Adds the given element if it doesn't already exist.";
@@ -6901,6 +6902,10 @@ ActionElementList (int argc, char **argv, int x, int y)
char *args[3];
char *function = argv[0];
+#ifdef DEBUG
+ printf("Entered ActionElementList, executing function %s\n", function);
+#endif
+
if (strcasecmp (function, "start") == 0)
{
ELEMENT_LOOP (PCB->Data);
@@ -6947,10 +6952,19 @@ ActionElementList (int argc, char **argv, int x, int y)
args[1] = refdes;
args[2] = value;
+#ifdef DEBUG
+ printf(" ... footprint = %s\n", footprint);
+ printf(" ... refdes = %s\n", refdes);
+ printf(" ... value = %s\n", value);
+#endif
+
e = find_element_by_refdes (refdes);
if (!e)
{
+#ifdef DEBUG
+ printf(" ... Footprint not on board, need to add it.\n");
+#endif
/* Not on board, need to add it. */
if (LoadFootprint(argc, args, x, y))
return 1;
@@ -6960,6 +6974,9 @@ ActionElementList (int argc, char **argv, int x, int y)
else if (e && strcmp (DESCRIPTION_NAME(e), footprint) != 0)
{
+#ifdef DEBUG
+ printf(" ... Footprint on board, but different from footprint loaded.\n");
+#endif
int er, pr, i;
LocationType mx, my;
ElementType *pe;
@@ -6992,6 +7009,7 @@ ActionElementList (int argc, char **argv, int x, int y)
SetChangedFlag (True);
}
+ /* Now reload footprint */
e = find_element_by_refdes (refdes);
old = ChangeElementText (PCB, PCB->Data, e, NAMEONPCB_INDEX, strdup (refdes));
@@ -7003,9 +7021,14 @@ ActionElementList (int argc, char **argv, int x, int y)
SET_FLAG (FOUNDFLAG, e);
+#ifdef DEBUG
+ printf(" ... Leaving ActionElementList.\n");
+#endif
+
return 0;
}
+/* ---------------------------------------------------------------- */
static const char elementsetattr_syntax[] = "ElementSetAttr(refdes,name[,value])";
static const char elementsetattr_help[] = "Sets or clears an element-specific attribute";
@@ -7069,6 +7092,7 @@ ActionElementSetAttr (int argc, char **argv, int x, int y)
return 0;
}
+/* ---------------------------------------------------------------- */
static const char execcommand_syntax[] = "ExecCommand(command)";
static const char execcommand_help[] = "Runs a command";
@@ -7096,6 +7120,7 @@ ActionExecCommand (int argc, char **argv, int x, int y)
return 0;
}
+/* ---------------------------------------------------------------- */
static const char import_syntax[] =
"Import()\n"
"Import([gnetlist|make[,source,source,...]])\n";
@@ -7192,6 +7217,7 @@ pcb_spawnvp (char **argv)
return 0;
}
+/* ---------------------------------------------------------------- */
/*
* Creates a new temporary file name. Hopefully the operating system
* provides a mkdtemp() function to securily create a temporary
@@ -7278,6 +7304,7 @@ tempfile_name_new (char * name)
return tmpfile;
}
+/* ---------------------------------------------------------------- */
/*
* Unlink a temporary file. If we have mkdtemp() then our temp file
* lives in a temporary directory and we need to remove that directory
@@ -7288,6 +7315,11 @@ tempfile_unlink (char * name)
{
int rc;
+#ifdef DEBUG
+ /* SDB says: Want to keep old temp files for examiniation when debugging */
+ return 0;
+#endif
+
#ifdef HAVE_MKDTEMP
int e, rc2 = 0;
char *dname;
@@ -7348,6 +7380,7 @@ tempfile_unlink (char * name)
return 0;
}
+/* ---------------------------------------------------------------- */
static int
ActionImport (int argc, char **argv, int x, int y)
{
@@ -7355,6 +7388,10 @@ ActionImport (int argc, char **argv, int x, int y)
char **sources = NULL;
int nsources = 0;
+#ifdef DEBUG
+ printf("ActionImport: =========== Entering ActionImport ============\n");
+#endif
+
mode = ARG (0);
if (! mode)
mode = AttributeGet (PCB, "import::mode");
@@ -7447,12 +7484,22 @@ ActionImport (int argc, char **argv, int x, int y)
cmd[5+i] = sources[i];
cmd[5+nsources] = NULL;
+#ifdef DEBUG
+ printf("ActionImport: =========== About to run gnetlist ============\n");
+ printf("%s %s %s %s %s %s ...\n",
+ cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5]);
+#endif
+
if (pcb_spawnvp (cmd))
{
unlink (tmpfile);
return 1;
}
+#ifdef DEBUG
+ printf("ActionImport: =========== About to run ActionExecuteFile, file = %s ============\n", tmpfile);
+#endif
+
cmd[0] = tmpfile;
cmd[1] = NULL;
ActionExecuteFile (1, cmd, 0, 0);
@@ -7546,6 +7593,10 @@ ActionImport (int argc, char **argv, int x, int y)
DeleteRats (False);
AddAllRats (False, NULL);
+#ifdef DEBUG
+ printf("ActionImport: =========== Leaving ActionImport ============\n");
+#endif
+
return 0;
}
diff --git a/src/buffer.c b/src/buffer.c
index 7daecf5..fbd1735 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -683,23 +683,40 @@ make_footprint_hash ()
in brackets in the description. */
for (i=0; i<Library.MenuN; i++)
{
- for (j=0; j<Library.Menu[i].EntryN; j++)
+#ifdef DEBUG
+ printf("In make_footprint_hash, looking for footprints in %s\n",
+ Library.Menu[i].directory);
+#endif
+
+ for (j=0; j<Library.Menu[i].EntryN; j++)
{
footprint_hash[num_entries].menu_idx = i;
footprint_hash[num_entries].entry_idx = j;
- if (Library.Menu[i].Entry[j].Template == (char *) -1)
+ if (Library.Menu[i].Entry[j].Template == (char *) -1)
+ /* file */
{
+#ifdef DEBUG
+/* printf(" ... Examining file %s\n", Library.Menu[i].Entry[j].AllocatedMemory); */
+#endif
fp = strrchr (Library.Menu[i].Entry[j].AllocatedMemory, '/');
+
if (!fp)
fp = strrchr (Library.Menu[i].Entry[j].AllocatedMemory, '\\');
+
if (fp)
fp ++;
- else
+ else
fp = Library.Menu[i].Entry[j].AllocatedMemory;
+
+#ifdef DEBUG
+/* printf(" ... found file footprint %s\n", fp); */
+#endif
+
footprint_hash[num_entries].footprint = fp;
footprint_hash[num_entries].footprint_allocated = 0;
}
- else
+ else
+ /* m4 */
{
fp = strrchr (Library.Menu[i].Entry[j].Description, '[');
if (fp)
@@ -723,10 +740,13 @@ make_footprint_hash ()
footprint_hash_size = num_entries;
qsort (footprint_hash, num_entries, sizeof(footprint_hash[0]), footprint_hash_cmp);
-#if 0
+/*
+#ifdef DEBUG
+ printf(" found footprints: \n");
for (i=0; i<num_entries; i++)
printf("[%s]\n", footprint_hash[i].footprint);
#endif
+*/
}
FootprintHashEntry *
@@ -810,7 +830,7 @@ LoadFootprintByName (BufferTypePtr Buffer, char *Footprint)
return i ? 0 : 1;
}
-#if 1
+#ifdef DEBUG
{
int j;
printf("Library path: %s\n", Settings.LibraryPath);
diff --git a/src/change.c b/src/change.c
index db13d5e..8cbd384 100644
--- a/src/change.c
+++ b/src/change.c
@@ -988,6 +988,10 @@ ChangeElementText (PCBType *pcb, DataType *data, ElementTypePtr Element, int whi
{
char *old = Element->Name[which].TextString;
+#ifdef DEBUG
+ printf("In ChangeElementText, updating old TextString %s to %s\n", old, new_name);
+#endif
+
if (pcb && which == NAME_INDEX (pcb))
EraseElementName (Element);
diff --git a/src/copy.c b/src/copy.c
index 5a030c9..583feb8 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -277,11 +277,17 @@ CopyPolygon (LayerTypePtr Layer, PolygonTypePtr Polygon)
}
/* ---------------------------------------------------------------------------
- * copies a element
+ * copies an element onto the PCB. Then does a draw.
*/
static void *
CopyElement (ElementTypePtr Element)
{
+
+#ifdef DEBUG
+ printf("Entered CopyElement, trying to copy element %s\n",
+ Element->Name[1].TextString);
+#endif
+
Boolean didDraw = False;
ElementTypePtr element = CopyElementLowLevel (PCB->Data,
NULL, Element,
@@ -302,6 +308,9 @@ CopyElement (ElementTypePtr Element)
DrawElementPinsAndPads (element, 0);
didDraw = True;
}
+#ifdef DEBUG
+ printf(" ... Leaving CopyElement.\n");
+#endif
return (element);
}
@@ -315,6 +324,10 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
Cardinal i;
Boolean changed = False;
+#ifdef DEBUG
+ printf("Entering CopyPastebufferToLayout.....\n");
+#endif
+
/* set movement vector */
DeltaX = X - PASTEBUFFER->X, DeltaY = Y - PASTEBUFFER->Y;
@@ -358,6 +371,10 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
{
ELEMENT_LOOP (PASTEBUFFER->Data);
{
+#ifdef DEBUG
+ printf("In CopyPastebufferToLayout, pasting element %s\n",
+ element->Name[1].TextString);
+#endif
if (FRONT (element) || PCB->InvisibleObjectsOn)
{
CopyElement (element);
@@ -377,11 +394,17 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
}
END_LOOP;
}
+
if (changed)
{
Draw ();
IncrementUndoSerialNumber ();
}
+
+#ifdef DEBUG
+ printf(" .... Leaving CopyPastebufferToLayout.\n");
+#endif
+
return (changed);
}
diff --git a/src/create.c b/src/create.c
index 518a35b..eced68d 100644
--- a/src/create.c
+++ b/src/create.c
@@ -199,6 +199,9 @@ CreateNewPCB (Boolean SetDefaultNames)
return (ptr);
}
+/* This post-processing step adds the top and bottom silk layers to a
+ * pre-existing PCB.
+ */
int
CreateNewPCBPost (PCBTypePtr pcb, int use_defaults)
{
@@ -643,6 +646,10 @@ CreateNewElement (DataTypePtr Data, ElementTypePtr Element,
LocationType TextX, LocationType TextY, BYTE Direction,
int TextScale, FlagType TextFlags, Boolean uniqueName)
{
+#ifdef DEBUG
+ printf("Entered CreateNewElement.....\n");
+#endif
+
if (!Element)
Element = GetElementMemory (Data);
@@ -661,6 +668,11 @@ CreateNewElement (DataTypePtr Data, ElementTypePtr Element,
VALUE_TEXT (Element).Element = Element;
Element->Flags = Flags;
Element->ID = ID++;
+
+#ifdef DEBUG
+ printf(" .... Leaving CreateNewElement.\n");
+#endif
+
return (Element);
}
diff --git a/src/file.c b/src/file.c
index fd18340..639c971 100644
--- a/src/file.c
+++ b/src/file.c
@@ -124,6 +124,8 @@ static int WritePCB (FILE *);
static int WritePCBFile (char *);
static int WritePipe (char *, Boolean);
static int ParseLibraryTree (void);
+static int LoadNewlibFootprintsFromDir(char *path, char *toppath);
+static char *pcb_basename (char *p);
/* ---------------------------------------------------------------------------
* Flag helper functions
@@ -1093,9 +1095,10 @@ RemoveTMPData (void)
#endif
/* ---------------------------------------------------------------------------
- * parse the directory tree where additional library elements are found
+ * Parse the directory tree where newlib footprints are found
*/
+/* Helper function for ParseLibraryTree */
static char *
pcb_basename (char *p)
{
@@ -1105,132 +1108,205 @@ pcb_basename (char *p)
return p;
}
-int
-ParseLibraryTree (void)
+/* This is a helper function for ParseLibrary Tree. Given a char *path,
+ * it finds all newlib footprints in that dir and sticks them into the
+ * library menu structure named entry.
+ */
+static int
+LoadNewlibFootprintsFromDir(char *libpath, char *toppath)
{
- char path[MAXPATHLEN + 1];
- char working[MAXPATHLEN + 1];
- char *libpaths, *p;
- DIR *dir, *subdir;
- struct stat buffer;
- struct dirent *direntry, *e2;
- LibraryMenuTypePtr menu = NULL;
- LibraryEntryTypePtr entry;
+ char olddir[MAXPATHLEN + 1]; /* The directory we start out in (cwd) */
+ char subdir[MAXPATHLEN + 1]; /* The directory holding footprints to load */
+ DIR *subdirobj; /* Interable object holding all subdir entries */
+ struct dirent *subdirentry; /* Individual subdir entry */
+ struct stat buffer; /* Buffer used in stat */
+ LibraryMenuTypePtr menu = NULL; /* Pointer to PCB's library menu structure */
+ LibraryEntryTypePtr entry; /* Pointer to individual menu entry */
size_t l;
- int n_footprints = 0;
+ size_t len;
+ int n_footprints = 0; /* Running count of footprints found in this subdir */
+
+ /* Cache old dir, then cd into subdir because stat is given relative file names. */
+ memset (subdir, 0, sizeof subdir);
+ memset (olddir, 0, sizeof olddir);
+ GetWorkingDirectory(olddir);
+ strcpy (subdir, libpath);
+ chdir(subdir);
+ GetWorkingDirectory(subdir); /* subdir is abs path */
+
+ /* First try opening the directory specified by path */
+ if ( (subdirobj = opendir (subdir)) == NULL )
+ {
+ OpendirErrorMessage (subdir);
+ return 0;
+ }
+
+ /* Get pointer to memory holding menu */
+ menu = GetLibraryMenuMemory (&Library);
+ /* Populate menuname and path vars */
+ menu->Name = MyStrdup (pcb_basename(subdir), "Newlib");
+ menu->directory = strdup (pcb_basename(toppath));
+
+ /* Now loop over files in this directory looking for files.
+ * We ignore certain files which are not footprints.
+ */
+ while ((subdirentry = readdir (subdirobj)) != NULL)
+ {
+#ifdef DEBUG
+/* printf("... Examining file %s ... \n", subdirentry->d_name); */
+#endif
+
+ /* Ignore non-footprint files found in this directory
+ * We're skipping .png and .html because those
+ * may exist in a library tree to provide an html browsable
+ * index of the library.
+ */
+ l = strlen (subdirentry->d_name);
+ if (!stat (subdirentry->d_name, &buffer) && S_ISREG (buffer.st_mode)
+ && subdirentry->d_name[0] != '.'
+ && NSTRCMP (subdirentry->d_name, "CVS") != 0
+ && NSTRCMP (subdirentry->d_name, "Makefile") != 0
+ && 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) )
+ {
+#ifdef DEBUG
+/* printf("... Found a footprint %s ... \n", subdirentry->d_name); */
+#endif
+ n_footprints++;
+ entry = GetLibraryEntryMemory (menu);
+
+ /*
+ * entry->AllocatedMemory points to abs path to the footprint.
+ * entry->ListEntry points to fp name itself.
+ */
+ len = strlen(subdir) + strlen("/") + strlen(subdirentry->d_name) + 1;
+ entry->AllocatedMemory = MyCalloc (1, len, "ParseLibraryTree()");
+ strcat (entry->AllocatedMemory, subdir);
+ strcat (entry->AllocatedMemory, PCB_DIR_SEPARATOR_S);
+
+ /* store pointer to start of footprint name */
+ entry->ListEntry = entry->AllocatedMemory
+ + strlen (entry->AllocatedMemory);
+
+ /* Now place footprint name into AllocatedMemory */
+ strcat (entry->AllocatedMemory, subdirentry->d_name);
+
+ /* mark as directory tree (newlib) library */
+ entry->Template = (char *) -1;
+ }
+ }
+ /* Done. Clean up, cd back into old dir, and return */
+ closedir (subdirobj);
+ chdir(olddir);
+ return n_footprints;
+}
- memset (path, 0, sizeof path);
+
+/* This function loads the newlib footprints into the Library.
+ * It examines all directories pointed to by Settings.LibraryTree.
+ * In each directory specified there, it looks both in that directory,
+ * as well as *one* level down. It calls the subfunction
+ * LoadNewlibFootprintsFromDir to put the footprints into PCB's internal
+ * datastructures.
+ */
+static int
+ParseLibraryTree (void)
+{
+ char toppath[MAXPATHLEN + 1]; /* String holding abs path to top level library dir */
+ char working[MAXPATHLEN + 1]; /* String holding abs path to working dir */
+ char *libpaths; /* String holding list of library paths to search */
+ char *p; /* Helper string used in iteration */
+ DIR *dirobj; /* Iterable directory object */
+ struct dirent *direntry = NULL; /* Object holding individual directory entries */
+ struct stat buffer; /* buffer used in stat */
+ int n_footprints = 0; /* Running count of footprints found */
+
+ /* Initialize path, working by writing 0 into every byte. */
+ memset (toppath, 0, sizeof toppath);
memset (working, 0, sizeof working);
- /* save the current working directory */
+ /* Save the current working directory as an absolute path.
+ * This fcn writes the abs path into the memory pointed to by the input arg.
+ */
GetWorkingDirectory (working);
- /* Additional loop to allow for multiple 'newlib' style library directories */
+ /* Additional loop to allow for multiple 'newlib' style library directories
+ * called out in Settings.LibraryTree
+ */
libpaths = MyStrdup (Settings.LibraryTree, "ParseLibraryTree");
for (p = strtok (libpaths, PCB_PATH_DELIMETER); p && *p; p = strtok (NULL, PCB_PATH_DELIMETER))
{
- strncpy (path, p, sizeof (path) - 1);
+ /* remove trailing path delimeter */
+ strncpy (toppath, p, sizeof (toppath) - 1);
- /*
- * start out in the working directory in case the path is a
+ /* start out in the working directory in case the path is a
* relative path
*/
chdir (working);
- if ((dir = opendir (path)) == NULL)
+ /*
+ * Next change to the directory which is the top of the library tree
+ * and extract its abs path.
+ */
+ chdir (toppath);
+ GetWorkingDirectory (toppath);
+
+#ifdef DEBUG
+ printf("In ParseLibraryTree, looking for newlib footprints inside top level directory %s ... \n",
+ toppath);
+#endif
+
+ /* Next read in any footprints in the top level dir */
+ n_footprints += LoadNewlibFootprintsFromDir("(local)", toppath);
+
+ /* Then open this dir so we can loop over its contents. */
+ if ((dirobj = opendir (toppath)) == NULL)
{
- OpendirErrorMessage (path);
+ OpendirErrorMessage (toppath);
continue;
}
- /*
- * change to the directory which is the top of the library tree
- * and then extract that directory to ensure we have a full path
- * name, not a relative path name.
+ /* Now loop over files in this directory looking for subdirs.
+ * For each direntry which is a valid subdirectory,
+ * try to load newlib footprints inside it.
*/
- chdir (path);
- GetWorkingDirectory (path);
-
- /* read all entries */
- while ((direntry = readdir (dir)) != NULL)
+ while ((direntry = readdir (dirobj)) != NULL)
{
- chdir (path);
- /* find directories
- * ignore entries beginning with "." and CVS
- * directories as well as a few other specific
- * files. We're skipping .png and .html because those
- * may exist in a library tree to provide an html browsable
- * index of the library.
+#ifdef DEBUG
+ printf("In ParseLibraryTree loop examining 2nd level direntry %s ... \n", direntry->d_name);
+#endif
+ /* Find subdirectories. Ignore entries beginning with "." and CVS
+ * directories.
*/
if (!stat (direntry->d_name, &buffer)
- && S_ISDIR (buffer.st_mode) && direntry->d_name[0] != '.'
+ && S_ISDIR (buffer.st_mode)
+ && direntry->d_name[0] != '.'
&& NSTRCMP (direntry->d_name, "CVS") != 0)
{
- /* add directory name into menu */
- menu = GetLibraryMenuMemory (&Library);
- menu->Name = MyStrdup (direntry->d_name, "ParseLibraryTree()");
- /* FIXME ? */
- menu->directory = strdup (pcb_basename (path));
- subdir = opendir (direntry->d_name);
- chdir (direntry->d_name);
- while (subdir && (e2 = readdir (subdir)))
- {
- l = strlen (e2->d_name);
- if (!stat (e2->d_name, &buffer) && S_ISREG (buffer.st_mode)
- && e2->d_name[0] != '.'
- && NSTRCMP (e2->d_name, "CVS") != 0
- && NSTRCMP (e2->d_name, "Makefile") != 0
- && NSTRCMP (e2->d_name, "Makefile.am") != 0
- && NSTRCMP (e2->d_name, "Makefile.in") != 0
- && (l < 4 || NSTRCMP(e2->d_name + (l - 4), ".png") != 0)
- && (l < 5 || NSTRCMP(e2->d_name + (l - 5), ".html") != 0) )
- {
-
- /*
- * Besides the length for the 3 strings listed,
- * we have two "/" added in below, and also we
- * have 2 '\0' characters since
- * entry->AllocatedMemory actually will contain
- * 2 null terminated strings. Thats why we
- * add 4
- */
- long len = strlen (path) + strlen (e2->d_name) +
- strlen (direntry->d_name) + 4;
-#if 0
- if (NSTRCMP
- (e2->d_name + strlen (e2->d_name) - 4, ".lel") != 0)
- break;
-#endif
- n_footprints++;
- entry = GetLibraryEntryMemory (menu);
- entry->AllocatedMemory = MyCalloc (1, len,
- "ParseLibraryTree()");
- strcat (entry->AllocatedMemory, path);
- strcat (entry->AllocatedMemory, PCB_DIR_SEPARATOR_S);
- strcat (entry->AllocatedMemory, direntry->d_name);
- strcat (entry->AllocatedMemory, PCB_DIR_SEPARATOR_S);
- entry->ListEntry = entry->AllocatedMemory
- + strlen (entry->AllocatedMemory);
- strcat (entry->AllocatedMemory, e2->d_name);
- /* mark as directory tree library */
- entry->Template = (char *) -1;
- }
- }
- closedir (subdir);
+ /* Found a valid subdirectory. Try to load footprints from it.
+ */
+ n_footprints += LoadNewlibFootprintsFromDir(direntry->d_name, toppath);
}
}
- closedir (dir);
+ closedir (dirobj);
}
- free (libpaths);
/* restore the original working directory */
chdir (working);
+
+#ifdef DEBUG
+ printf("Leaving ParseLibraryTree, found %d footprints.\n", n_footprints);
+#endif
+
return n_footprints;
}
/* ---------------------------------------------------------------------------
- * read contents of the library description file
- * also parse a special library directory tree
+ * Read contents of the library description file (for M4)
+ * and then read in M4 libs. Then call a fcn to read the newlib
+ * footprints.
*/
int
ReadLibraryContents (void)
@@ -1241,18 +1317,28 @@ ReadLibraryContents (void)
LibraryMenuTypePtr menu = NULL;
LibraryEntryTypePtr entry;
+
+ /* First load the M4 stuff. The variable Settings.LibraryPath
+ * points to it.
+ */
MYFREE (command);
command = EvaluateFilename (Settings.LibraryContentsCommand,
Settings.LibraryPath, Settings.LibraryFilename,
NULL);
- /* open a pipe to the output of the command */
+#ifdef DEBUG
+ printf("In ReadLibraryContents, about to execute command %s\n", command);
+#endif
+
+ /* This uses a pipe to execute a shell script which provides the names of
+ * all M4 libs and footprints. The results are placed in resultFP.
+ */
if (command && *command && (resultFP = popen (command, "r")) == NULL)
{
PopenErrorMessage (command);
}
- /* the library contents are separated by colons;
+ /* the M4 library contents are separated by colons;
* template : package : name : description
*/
while (resultFP != NULL && fgets (inputline, MAX_LIBRARY_LINE_LENGTH, resultFP))
@@ -1312,7 +1398,11 @@ ReadLibraryContents (void)
}
if (resultFP != NULL)
pclose (resultFP);
-
+
+ /* Now after reading in the M4 libs, call a function to
+ * read the newlib footprint libraries. Then sort the whole
+ * library.
+ */
if (ParseLibraryTree () > 0 || resultFP != NULL)
{
sort_library (&Library);
diff --git a/src/file.h b/src/file.h
index 64eba23..2822525 100644
--- a/src/file.h
+++ b/src/file.h
@@ -48,6 +48,7 @@ int SaveBufferElements (char *);
void PreLoadElementPCB (void);
void PostLoadElementPCB (void);
void sort_netlist (void);
+int ParseLibraryTree (void);
/*
* Whenever the pcb file format is modified, this version number
diff --git a/src/global.h b/src/global.h
index 80bea72..1082dd1 100644
--- a/src/global.h
+++ b/src/global.h
@@ -178,8 +178,8 @@ typedef struct
struct BoxType /* a bounding box */
{
- LocationType X1, Y1, /* upper left */
- X2, Y2; /* and lower right corner */
+ LocationType X1, Y1; /* upper left */
+ LocationType X2, Y2; /* and lower right corner */
};
typedef struct
@@ -231,8 +231,7 @@ typedef struct
{
ANYOBJECTFIELDS;
BDimension Scale; /* text scaling in percent */
- LocationType X, /* origin */
- Y;
+ LocationType X, Y; /* origin */
BYTE Direction;
char *TextString; /* string */
void *Element;
@@ -809,11 +808,11 @@ struct drc_violation_st
* Variables with absolute paths to various directories. These are deduced
* at runtime to allow pcb to be relocatable
*/
-extern char *bindir;
-extern char *pcblibdir;
-extern char *pcblibpath;
-extern char *pcbtreedir;
-extern char *pcbtreepath;
+extern char *bindir; /* The dir in which PCB installation was found */
+extern char *pcblibdir; /* The system M4 fp directory */
+extern char *pcblibpath; /* The search path for M4 fps */
+extern char *pcbtreedir; /* The system newlib fp directory */
+extern char *pcbtreepath; /* The search path for newlib fps */
extern char *exec_prefix;
extern char *homedir;
diff --git a/src/main.c b/src/main.c
index e5d93eb..3026f8d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -896,11 +896,13 @@ main (int argc, char *argv[])
program_basename = program_name;
}
Progname = program_basename;
-
+
+ /* Print usage or version if requested. Then exit. */
if (argc > 1 && strcmp (argv[1], "-h") == 0)
usage ();
if (argc > 1 && strcmp (argv[1], "-V") == 0)
print_version ();
+ /* Export pcb from command line if requested. */
if (argc > 1 && strcmp (argv[1], "-p") == 0)
{
exporter = gui = hid_find_printer ();
@@ -913,12 +915,15 @@ main (int argc, char *argv[])
argc -= 2;
argv += 2;
}
+ /* Otherwise start GUI. */
else
gui = hid_find_gui ();
+ /* Exit with error if GUI failed to start. */
if (!gui)
exit (1);
+ /* Set up layers. */
for (i = 0; i < MAX_LAYER; i++)
{
char buf[20];
@@ -960,9 +965,11 @@ main (int argc, char *argv[])
exit (0);
}
+ /* Create a new PCB object in memory */
PCB = CreateNewPCB (True);
PCB->Data->LayerN = DEF_LAYER;
ParseGroupString (Settings.Groups, &PCB->LayerGroups, DEF_LAYER);
+ /* Add silk layers to newly created PCB */
CreateNewPCBPost (PCB, 1);
if (argc > 1)
command_line_pcb = argv[1];
|
|
From: <gi...@gp...> - 2010-04-02 23:08:38
|
The branch, master has been updated
via 480e81559af88dacbfb6bd94cd5fb705ec4f7cb4 (commit)
via e85f5eea45e6db6245dd960916cd544e844e5cab (commit)
from 050e6e6fea127f611ee0db11ef162c2dd27fb3d6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gui-top-window.c | 10 ++++++++--
src/hid/png/png.c | 11 +++++------
2 files changed, 13 insertions(+), 8 deletions(-)
=================
Commit Messages
=================
commit 480e81559af88dacbfb6bd94cd5fb705ec4f7cb4
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
When built with less than all of the graphic formats that
the png exporter supports, don't segfault anymore. The problem
is an array is defined differently at compile time but the
default value for the format was constant and a ways into the
array. Problem reported by jean on irc.
:100644 100644 404eb53... ba7e763... M src/hid/png/png.c
commit e85f5eea45e6db6245dd960916cd544e844e5cab
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Inform the user where (what file or compiled in defaults) the
menu config came from. Should help with some of the gpcb-menu.res
versus pcb-menu.res and the ./gpcb-menu.res versus ~/.pcb/gpcb-menu.res
confusion which comes up from time to time.
:100644 100644 eb8ba18... a594330... M src/hid/gtk/gui-top-window.c
=========
Changes
=========
commit 480e81559af88dacbfb6bd94cd5fb705ec4f7cb4
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
When built with less than all of the graphic formats that
the png exporter supports, don't segfault anymore. The problem
is an array is defined differently at compile time but the
default value for the format was constant and a ways into the
array. Problem reported by jean on irc.
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 404eb53..ba7e763 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -124,6 +124,10 @@ static int photo_groups[MAX_LAYER+2], photo_ngroups;
#define FMT_png "PNG"
static const char *filetypes[] = {
+#ifdef HAVE_GDIMAGEPNG
+ FMT_png,
+#endif
+
#ifdef HAVE_GDIMAGEGIF
FMT_gif,
#endif
@@ -132,10 +136,6 @@ static const char *filetypes[] = {
FMT_jpg,
#endif
-#ifdef HAVE_GDIMAGEPNG
- FMT_png,
-#endif
-
NULL
};
@@ -178,7 +178,7 @@ HID_Attribute png_attribute_list[] = {
#define HA_use_alpha 8
{"format", "Graphics file format",
- HID_Enum, 0, 0, {2, 0, 0}, filetypes, 0},
+ HID_Enum, 0, 0, {0, 0, 0}, filetypes, 0},
#define HA_filetype 9
{"png-bloat", "Amount (in/mm/mil/pix) to add to trace/pad/pin edges (1 = 1/100 mil)",
@@ -221,7 +221,6 @@ static const char *get_file_suffix(void)
const char *fmt;
const char *result;
fmt = filetypes[png_attribute_list[HA_filetype].default_val.int_value];
- /* or is it filetypes[png_attribute_list[HA_filetype].default_val.int_value]; ? */
if (strcmp (fmt, FMT_gif) == 0) result=".gif";
else if (strcmp (fmt, FMT_jpg) == 0) result=".jpg";
else if (strcmp (fmt, FMT_png) == 0) result=".png";
commit e85f5eea45e6db6245dd960916cd544e844e5cab
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Inform the user where (what file or compiled in defaults) the
menu config came from. Should help with some of the gpcb-menu.res
versus pcb-menu.res and the ./gpcb-menu.res versus ~/.pcb/gpcb-menu.res
confusion which comes up from time to time.
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index eb8ba18..a594330 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -3756,7 +3756,10 @@ ghid_load_menus (void)
}
if (filename)
- r = resource_parse (filename, 0);
+ {
+ Message ("Loading menus from %s\n", filename);
+ r = resource_parse (filename, 0);
+ }
if (home_pcbmenu != NULL)
{
@@ -3764,7 +3767,10 @@ ghid_load_menus (void)
}
if (!r)
- r = bir;
+ {
+ Message ("Using default menus\n");
+ r = bir;
+ }
mr = resource_subres (r, "MainMenu");
if (!mr)
|
|
From: <gi...@gp...> - 2010-04-01 17:18:11
|
The branch, master has been updated
via 050e6e6fea127f611ee0db11ef162c2dd27fb3d6 (commit)
from ed9779ba20a26180b1e30a2f37c5ba1a5039c673 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/report.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 050e6e6fea127f611ee0db11ef162c2dd27fb3d6
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Return non-fail for ReportAllNetLengths()
:100644 100644 08613dd... 2e80e66... M src/report.c
=========
Changes
=========
commit 050e6e6fea127f611ee0db11ef162c2dd27fb3d6
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Return non-fail for ReportAllNetLengths()
diff --git a/src/report.c b/src/report.c
index 08613dd..2e80e66 100644
--- a/src/report.c
+++ b/src/report.c
@@ -677,6 +677,7 @@ ReportAllNetLengths (int argc, char **argv, int x, int y)
break;
}
}
+ return 0;
}
static int
|
|
From: <gi...@gp...> - 2010-04-01 16:53:07
|
The branch, master has been updated
via ed9779ba20a26180b1e30a2f37c5ba1a5039c673 (commit)
from 3f65efa13e373fc05e96dab360086271cdcd8759 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/report.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit ed9779ba20a26180b1e30a2f37c5ba1a5039c673
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Record the calculated length in Report(NetLength)
:100644 100644 974c0be... 08613dd... M src/report.c
=========
Changes
=========
commit ed9779ba20a26180b1e30a2f37c5ba1a5039c673
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Record the calculated length in Report(NetLength)
diff --git a/src/report.c b/src/report.c
index 974c0be..08613dd 100644
--- a/src/report.c
+++ b/src/report.c
@@ -693,7 +693,7 @@ ReportNetLength (int argc, char **argv, int x, int y)
RestoreUndoSerialNumber ();
gui->get_coords ("Click on a connection", &x, &y);
- XYtoNetLength (x, y, &found);
+ length = XYtoNetLength (x, y, &found);
if (!found)
{
|
|
From: <gi...@gp...> - 2010-03-24 21:40:34
|
The branch, master has been updated
via 3f65efa13e373fc05e96dab360086271cdcd8759 (commit)
via d9e4279e4c0af142bc776bdd4a3b905388ce6b5a (commit)
from 340d9546656b529c12fe8fecc4be950f5ff9bff8 (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
=========
README.snapshots | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit d9e4279e4c0af142bc776bdd4a3b905388ce6b5a
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Add checklist item to update the web site for a new release news
item.
:100644 100644 9a4582e... ca516e8... M README.snapshots
=========
Changes
=========
commit d9e4279e4c0af142bc776bdd4a3b905388ce6b5a
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Add checklist item to update the web site for a new release news
item.
diff --git a/README.snapshots b/README.snapshots
index 9a4582e..ca516e8 100644
--- a/README.snapshots
+++ b/README.snapshots
@@ -162,3 +162,5 @@ To make a pcb release do the following:
=) gmake distclean ; ./autogen.sh &&./configure && gmake distcheck
+=) Update the web pages. In particular, update news.shtml and index.shtml
+ and then rebuild the corresponding .html files.
|
|
From: <gi...@gp...> - 2010-03-21 23:38:36
|
The branch, master has been updated
via 340d9546656b529c12fe8fecc4be950f5ff9bff8 (commit)
via 6081daa8966c8c83bb734789c38dd5c42dd97443 (commit)
from 2a406dec9df0eecf9923a19971363fa39b481e04 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/toporouter.c | 386 +++++++++++++++++++++++++++++++-----------------------
1 files changed, 220 insertions(+), 166 deletions(-)
=================
Commit Messages
=================
commit 6081daa8966c8c83bb734789c38dd5c42dd97443
Author: anthonix <anthonix@anthonix-desktop.(none)>
Commit: anthonix <anthonix@anthonix-desktop.(none)>
Toporouter: line constraints
:100644 100644 f749d22... 50195d3... M src/toporouter.c
=========
Changes
=========
commit 6081daa8966c8c83bb734789c38dd5c42dd97443
Author: anthonix <anthonix@anthonix-desktop.(none)>
Commit: anthonix <anthonix@anthonix-desktop.(none)>
Toporouter: line constraints
diff --git a/src/toporouter.c b/src/toporouter.c
index f749d22..50195d3 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -2195,11 +2195,13 @@ read_lines(toporouter_t *r, toporouter_layer_t *l, LayerType *layer, int ln)
if(!(xs[0] == xs[1] && ys[0] == ys[1])) {
vlist = g_list_prepend(NULL, gts_vertex_new (vertex_class, xs[0], ys[0], l - r->layers));
vlist = g_list_prepend(vlist, gts_vertex_new (vertex_class, xs[1], ys[1], l - r->layers));
+ // TODO: replace this with surface version
bbox = toporouter_bbox_create_from_points(GetLayerGroupNumberByNumber(ln), vlist, LINE, line);
r->bboxes = g_slist_prepend(r->bboxes, bbox);
//new;;
//insert_constraints_from_list(r, l, vlist, bbox);
g_list_free(vlist);
+// bbox->point = GTS_POINT( insert_vertex(r, l, (xs[0]+xs[1])/2., (ys[0]+ys[1])/2., bbox) );
bbox->constraints = g_list_concat(bbox->constraints, insert_constraint_edge(r, l, xs[0], ys[0], 0, xs[1], ys[1], 0, bbox));
}
@@ -2296,7 +2298,26 @@ print_edge(toporouter_edge_t *e)
print_vertex(tedge_v2(e));
}
+static void pick_first_face (GtsFace * f, GtsFace ** first)
+{
+ if (*first == NULL)
+ *first = f;
+}
+
+void
+unconstrain(toporouter_layer_t *l, toporouter_constraint_t *c)
+{
+ toporouter_edge_t *e;
+ gts_allow_floating_vertices = TRUE;
+ e = TOPOROUTER_EDGE(gts_edge_new (GTS_EDGE_CLASS (toporouter_edge_class ()), GTS_SEGMENT(c)->v1, GTS_SEGMENT(c)->v2));
+ gts_edge_replace(GTS_EDGE(c), GTS_EDGE(e));
+ l->constraints = g_list_remove(l->constraints, c);
+ c->box->constraints = g_list_remove(c->box->constraints, c);
+ c->box = NULL;
+ gts_object_destroy (GTS_OBJECT (c));
+ gts_allow_floating_vertices = FALSE;
+}
void
build_cdt(toporouter_t *r, toporouter_layer_t *l)
@@ -2307,16 +2328,14 @@ build_cdt(toporouter_t *r, toporouter_layer_t *l)
//GtsVertex *v;
GtsTriangle *t;
GtsVertex *v1, *v2, *v3;
- GtsFace *topface = NULL;
GSList *vertices_slist;
- guint rerun;
-build_cdt_continuation:
vertices_slist = list_to_slist(l->vertices);
- rerun =0;
- if(l->surface && topface) {
- gts_surface_traverse_destroy (gts_surface_traverse_new (l->surface, topface));
+ if(l->surface) {
+ GtsFace * first = NULL;
+ gts_surface_foreach_face (l->surface, (GtsFunc) pick_first_face, &first);
+ gts_surface_traverse_destroy(gts_surface_traverse_new (l->surface, first));
}
t = gts_triangle_enclosing (gts_triangle_class (), vertices_slist, 1000.0f);
@@ -2327,21 +2346,8 @@ build_cdt_continuation:
l->surface = gts_surface_new (gts_surface_class (), gts_face_class (),
GTS_EDGE_CLASS(toporouter_edge_class ()), GTS_VERTEX_CLASS(toporouter_vertex_class ()) );
- topface = gts_face_new (gts_face_class (), t->e1, t->e2, t->e3);
- gts_surface_add_face (l->surface, topface);
-
- i = l->vertices;
- while (i) {
- //v = i->data;
- //if(r->flags & TOPOROUTER_FLAG_DEBUG_CDTS)
- // fprintf(stderr, "\tadding vertex %f,%f\n", v->p.x, v->p.y);
- toporouter_vertex_t *v = TOPOROUTER_VERTEX(gts_delaunay_add_vertex (l->surface, i->data, NULL));
- if(v) {
- printf("conflict: "); print_vertex(v);
- }
+ gts_surface_add_face (l->surface, gts_face_new (gts_face_class (), t->e1, t->e2, t->e3));
- i = i->next;
- }
// fprintf(stderr, "ADDED VERTICES\n");
/*
@@ -2380,180 +2386,209 @@ build_cdt_continuation:
}
*/
+check_cons_continuation:
i = l->constraints;
- while (i) {
-
+ while (i) {
toporouter_constraint_t *c1 = TOPOROUTER_CONSTRAINT(i->data);
- //if(r->flags & TOPOROUTER_FLAG_DEBUG_CDTS)
-/* fprintf(r->debug, "edge p1=%f,%f p2=%f,%f\n",
- temp->segment.v1->p.x,
- temp->segment.v1->p.y,
- temp->segment.v2->p.x,
- temp->segment.v2->p.y);
-*/
- GSList *conflicts = gts_delaunay_add_constraint (l->surface, i->data);
- GSList *j = conflicts;
+ GList *j = i->next;
+ // printf("adding cons: "); print_constraint(c1);
+
while(j) {
- if(TOPOROUTER_IS_CONSTRAINT(j->data)) {
- toporouter_constraint_t *c2 = TOPOROUTER_CONSTRAINT(j->data);
- GList *temp, *newcons = NULL;
-
- printf("conflict: "); print_constraint(c2);
- printf("with: "); print_constraint(c1);
-
- gts_allow_floating_vertices = TRUE;
- l->constraints = g_list_remove(l->constraints, c1);
- l->constraints = g_list_remove(l->constraints, c2);
- c1->box->constraints = g_list_remove(c1->box->constraints, c1);
- c2->box->constraints = g_list_remove(c2->box->constraints, c2);
-
- if(gts_segments_are_intersecting(GTS_SEGMENT(c1), GTS_SEGMENT(c2)) == GTS_IN) {
- // proper intersection
- toporouter_vertex_t *v = TOPOROUTER_VERTEX(vertex_intersect(edge_v1(c1), edge_v2(c1), edge_v1(c2), edge_v2(c2)));
- // remove both constraints
- // replace with 4x constraints
- // insert new intersection vertex
- GTS_POINT(v)->z = vz(edge_v1(c1));
-
- l->vertices = g_list_prepend(l->vertices, v);
-
- v->bbox = c1->box;
-
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(v), vy(v), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
-
- temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(v), vy(v), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
-
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(v), vy(v), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
-
- temp = insert_constraint_edge(r, l, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, vx(v), vy(v), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
- }else if(!vertex_wind(edge_v1(c1), edge_v2(c1), edge_v1(c2)) && !vertex_wind(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
- printf("all colinear\n");
- exit(1);
- }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v1(c1)) && vertex_between(edge_v1(c2), edge_v2(c2), edge_v2(c1))) {
+ toporouter_constraint_t *c2 = TOPOROUTER_CONSTRAINT(j->data);
+ guint rem = 0;
+ GList *temp;
+
+ // printf("\tconflict: "); print_constraint(c2);
+ toporouter_bbox_t *c1box = c1->box, *c2box = c2->box;
+ toporouter_vertex_t *c1v1 = tedge_v1(c1);
+ toporouter_vertex_t *c1v2 = tedge_v2(c1);
+ toporouter_vertex_t *c2v1 = tedge_v1(c2);
+ toporouter_vertex_t *c2v2 = tedge_v2(c2);
+
+ if(gts_segments_are_intersecting(GTS_SEGMENT(c1), GTS_SEGMENT(c2)) == GTS_IN) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
+ // proper intersection
+ toporouter_vertex_t *v = TOPOROUTER_VERTEX(vertex_intersect(
+ GTS_VERTEX(c1v1),
+ GTS_VERTEX(c1v2),
+ GTS_VERTEX(c2v1),
+ GTS_VERTEX(c2v2)));
+
+ // remove both constraints
+ // replace with 4x constraints
+ // insert new intersection vertex
+ GTS_POINT(v)->z = vz(c1v1);
+
+ l->vertices = g_list_prepend(l->vertices, v);
+// gts_delaunay_add_vertex (l->surface, GTS_VERTEX(v), NULL);
+
+ v->bbox = c1box;
+
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(v), vy(v), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(c1v2), vy(c1v2), 0, vx(v), vy(v), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(c2v1), vy(c2v1), 0, vx(v), vy(v), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(c2v2), vy(c2v2), 0, vx(v), vy(v), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+
+ }else if(gts_segments_are_intersecting(GTS_SEGMENT(c1), GTS_SEGMENT(c2)) == GTS_ON ||
+ gts_segments_are_intersecting(GTS_SEGMENT(c2), GTS_SEGMENT(c1)) == GTS_ON) {
+
+ if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v1(c1)) && vertex_between(edge_v1(c2), edge_v2(c2), edge_v2(c1))) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
// remove c1
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c2v1), vy(c2v1), 0, vx(c2v2), vy(c2v2), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
}else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v1(c2)) && vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
// remove c2
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
- /*
-
- }else {
- exit(1);
- if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
- toporouter_constraint_t *tempc = c1;
- c1 = c2;
- c2 = tempc;
- }
-
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
-
- if(tvdistance2(edge_v1(c1), edge_v2(c2)) < tvdistance2(edge_v2(c1), edge_v2(c2))) {
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
- }else{
- temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
- }
- */
- }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v1(c1))) {
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c1v2), vy(c1v2), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+
+ //}else if(!vertex_wind(edge_v1(c1), edge_v2(c1), edge_v1(c2)) && !vertex_wind(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ /* }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v1(c2)) || vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
+ printf("all colinear\n");
+ // exit(1);
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c1v2), vy(c1v2), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+
+ if(vertex_between(GTS_VERTEX(c1v1), GTS_VERTEX(c1v2), GTS_VERTEX(c2v2))) {
+ // v2 of c2 is inner
+ if(vertex_between(GTS_VERTEX(c2v1), GTS_VERTEX(c2v2), GTS_VERTEX(c1v2))) {
+ // v2 of c1 is inner
+ // c2 = c1.v2 -> c2.v1
+ temp = insert_constraint_edge(r, l, vx(c1v2), vy(c1v2), 0, vx(c2v1), vy(c2v1), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+ }else{
+ // v1 of c1 is inner
+ // c2 = c1.v1 -> c2.v1
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c2v1), vy(c2v1), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+ }
+ }else{
+ // v1 of c2 is inner
+ if(vertex_between(GTS_VERTEX(c2v1), GTS_VERTEX(c2v2), GTS_VERTEX(c1v2))) {
+ // v2 of c1 is inner
+ // c2 = c1.v2 -> c2.v2
+ temp = insert_constraint_edge(r, l, vx(c1v2), vy(c1v2), 0, vx(c2v2), vy(c2v2), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+ }else{
+ // v1 of c1 is inner
+ // c2 = c1.v1 -> c2.v2
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c2v2), vy(c2v2), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+ }
+ }*/
+ }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v1(c1)) && c1v1 != c2v1 && c1v1 != c2v2) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
//v1 of c1 is on c2
printf("v1 of c1 on c2\n");
// replace with 2x constraints
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
- temp = insert_constraint_edge(r, l, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c2v1), vy(c2v1), 0, vx(c1v1), vy(c1v1), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c2v2), vy(c2v2), 0, vx(c1v1), vy(c1v1), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c1v2), vy(c1v2), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
// restore c1
//temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, c1->box);
//c2->box->constraints = g_list_concat(c2->box->constraints, temp);
- }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v2(c1))) {
+ }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v2(c1)) && c1v2 != c2v1 && c1v2 != c2v2) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
//v2 of c1 is on c2
printf("v2 of c1 on c2\n");
// replace with 2x constraints
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
- temp = insert_constraint_edge(r, l, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
-
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
- }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v1(c2))) {
+ temp = insert_constraint_edge(r, l, vx(c2v1), vy(c2v1), 0, vx(c1v2), vy(c1v2), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c2v2), vy(c2v2), 0, vx(c1v2), vy(c1v2), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c1v2), vy(c1v2), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+
+ }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v1(c2)) && c2v1 != c1v1 && c2v1 != c1v2) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
//v1 of c2 is on c1
printf("v1 of c2 on c1\n");
// replace with 2x constraints
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
- temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
-
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
- }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c2v1), vy(c2v1), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c1v2), vy(c1v2), 0, vx(c2v1), vy(c2v1), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(c2v1), vy(c2v1), 0, vx(c2v2), vy(c2v2), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
+ }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2)) && c2v2 != c1v1 && c2v2 != c1v2) {
+ unconstrain(l, c1); unconstrain(l, c2);
+ rem = 1;
//v2 of c2 is on c1
printf("v2 of c2 on c1\n");
// replace with 2x constraints
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
- temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c1->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c1->box->constraints = g_list_concat(c1->box->constraints, temp);
-
- temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
- newcons = g_list_concat(newcons, g_list_copy(temp));
- c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c1v1), vy(c1v1), 0, vx(c2v2), vy(c2v2), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(c1v2), vy(c1v2), 0, vx(c2v2), vy(c2v2), 0, c1box);
+ c1box->constraints = g_list_concat(c1box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(c2v1), vy(c2v1), 0, vx(c2v2), vy(c2v2), 0, c2box);
+ c2box->constraints = g_list_concat(c2box->constraints, temp);
}
- gts_object_destroy (GTS_OBJECT (c1));
- gts_object_destroy (GTS_OBJECT (c2));
+ }
+ if(rem) goto check_cons_continuation;
- gts_allow_floating_vertices = FALSE;
-/*
- {
- GList *k = newcons;
+ j = j->next;
+ }
- while(k) {
- if(gts_delaunay_add_constraint (l->surface, k->data) || gts_delaunay_add_constraint (l->surface, k->data)) {
- printf("ERROR INSERTING NEWCONS\n");
- }
- k = k->next;
- }
- g_list_free(newcons);
- }
-*/
- goto build_cdt_continuation;
- // rerun = 1;
+ i = i->next;
+ }
+
+ i = l->vertices;
+ while (i) {
+ //v = i->data;
+ //if(r->flags & TOPOROUTER_FLAG_DEBUG_CDTS)
+ // fprintf(stderr, "\tadding vertex %f,%f\n", v->p.x, v->p.y);
+ toporouter_vertex_t *v = TOPOROUTER_VERTEX(gts_delaunay_add_vertex (l->surface, i->data, NULL));
+ if(v) {
+ printf("conflict: "); print_vertex(v);
+ }
+
+ i = i->next;
+ }
+ i = l->constraints;
+ while (i) {
+
+ toporouter_constraint_t *c1 = TOPOROUTER_CONSTRAINT(i->data);
+
+ // printf("adding cons: "); print_constraint(c1);
+
+ GSList *conflicts = gts_delaunay_add_constraint (l->surface, i->data);
+ GSList *j = conflicts;
+ while(j) {
+ if(TOPOROUTER_IS_CONSTRAINT(j->data)) {
+ toporouter_constraint_t *c2 = TOPOROUTER_CONSTRAINT(j->data);
+
+ printf("\tconflict: "); print_constraint(c2);
+
}
j = j->next;
}
@@ -2587,6 +2622,14 @@ build_cdt_continuation:
#ifdef DEBUG_IMPORT
gts_surface_print_stats(l->surface, stderr);
#endif
+
+ {
+ char buffer[64];
+ sprintf(buffer, "surface%d.gts", l - r->layers);
+ FILE *fout2 = fopen(buffer, "w");
+ gts_surface_write(l->surface, fout2);
+ }
+
}
gint
@@ -2940,7 +2983,7 @@ compare_segments(gconstpointer a, gconstpointer b)
if(a < b) return -1;
return 1;
}
-
+#define DEBUG_CLUSTER_FIND 1
toporouter_cluster_t *
cluster_find(toporouter_t *r, gdouble x, gdouble y, gdouble z)
{
@@ -2965,9 +3008,19 @@ cluster_find(toporouter_t *r, gdouble x, gdouble y, gdouble z)
LineType *line = (LineType *)box->data;
gint linewind = coord_wind(line->Point1.X, line->Point1.Y, x, y, line->Point2.X, line->Point2.Y);
+ if(line->Point1.X > x - EPSILON && line->Point1.X < x + EPSILON &&
+ line->Point1.Y > y - EPSILON && line->Point1.Y < y + EPSILON) {
+ rval = box->cluster;
+ // break;
+ }
+ if(line->Point2.X > x - EPSILON && line->Point2.X < x + EPSILON &&
+ line->Point2.Y > y - EPSILON && line->Point2.Y < y + EPSILON) {
+ rval = box->cluster;
+ // break;
+ }
if(!linewind) {
rval = box->cluster;
- //break;
+ // break;
}
}else if(box->surface) {
@@ -7008,7 +7061,7 @@ netscore_create(toporouter_t *r, toporouter_route_t *routedata, guint n, guint i
printf("WARNING: !finite(detourscore)\n");
print_cluster(routedata->src);
print_cluster(routedata->dest);
-
+ return NULL;
}
netscore->pairwise_nodetour = malloc(n * sizeof(guint));
@@ -7141,7 +7194,8 @@ order_nets_preroute_greedy(toporouter_t *r, GList *nets, GList **rnets)
guint failcount = 0;
while(nets) {
- g_ptr_array_add(netscores, netscore_create(r, TOPOROUTER_ROUTE(nets->data), len, failcount++));
+ toporouter_netscore_t *ns = netscore_create(r, TOPOROUTER_ROUTE(nets->data), len, failcount++);
+ if(ns) g_ptr_array_add(netscores, ns);
nets = nets->next;
}
|
|
From: <gi...@gp...> - 2010-03-21 04:25:50
|
The branch, master has been updated
via 2a406dec9df0eecf9923a19971363fa39b481e04 (commit)
from 607c3056963b68654bac3fae70ac3d02eee60eaf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/lesstif/menu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 2a406dec9df0eecf9923a19971363fa39b481e04
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix Typo
:100644 100644 9869483... 44edaba... M src/hid/lesstif/menu.c
=========
Changes
=========
commit 2a406dec9df0eecf9923a19971363fa39b481e04
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix Typo
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index 9869483..44edaba 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -853,7 +853,7 @@ lesstif_call_action (const char *aname, int argc, char **argv)
old_action = current_action;
current_action = a;
- ret = current_action->trigger_cb (argc, argv, x, y);
+ ret = current_action->trigger_cb (argc, argv, px, py);
current_action = old_action;
return ret;
|
|
From: <gi...@gp...> - 2010-03-20 08:04:02
|
The branch, master has been updated
via 607c3056963b68654bac3fae70ac3d02eee60eaf (commit)
from 5672c37af126b75f687e693602c393f16aca46c7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/toporouter.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
=================
Commit Messages
=================
commit 607c3056963b68654bac3fae70ac3d02eee60eaf
Author: anthonix <anthonix@anthonix-desktop.(none)>
Commit: anthonix <anthonix@anthonix-desktop.(none)>
Toporouter: Speccut bug fix
:100644 100644 7a40005... f749d22... M src/toporouter.c
=========
Changes
=========
commit 607c3056963b68654bac3fae70ac3d02eee60eaf
Author: anthonix <anthonix@anthonix-desktop.(none)>
Commit: anthonix <anthonix@anthonix-desktop.(none)>
Toporouter: Speccut bug fix
diff --git a/src/toporouter.c b/src/toporouter.c
index 7a40005..f749d22 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -6463,6 +6463,7 @@ opposite_triangle(GtsTriangle *t, toporouter_edge_t *e)
void
speccut_edge_routing_from_edge(GList *i, toporouter_edge_t *e)
{
+ g_assert(TOPOROUTER_IS_EDGE(e));
while(i) {
toporouter_vertex_t *curv = TOPOROUTER_VERTEX(i->data);
@@ -6545,6 +6546,7 @@ void
speccut_edge_patch_links(toporouter_edge_t *e)
{
GList *i = e->routing;
+ g_assert(TOPOROUTER_IS_EDGE(e));
while(i) {
toporouter_vertex_t *v = TOPOROUTER_VERTEX(i->data);
v->parent->child = v;
@@ -6563,14 +6565,13 @@ check_speccut(toporouter_oproute_t *oproute, toporouter_vertex_t *v1, toporouter
if(TOPOROUTER_IS_CONSTRAINT(e)) return 0;
-
if(!(t = gts_triangle_use_edges(GTS_EDGE(e), GTS_EDGE(e1), GTS_EDGE(e2)))) {
printf("check_speccut: NULL t\n");
return 0;
}
if(!(opt = opposite_triangle(t, e))) {
- printf("check_speccut: NULL opt\n");
+// printf("check_speccut: NULL opt\n");
return 0;
}
@@ -6598,6 +6599,10 @@ check_speccut(toporouter_oproute_t *oproute, toporouter_vertex_t *v1, toporouter
ope1 = tedge(opv2, tedge_v1(e));
ope2 = tedge(opv2, tedge_v2(e));
+ //this fixes the weird pad exits in r8c board
+// if(TOPOROUTER_IS_CONSTRAINT(ope1)) return 0;
+ if(TOPOROUTER_IS_CONSTRAINT(ope2)) return 0;
+
if(!tvertex_wind(opv2, tedge_v1(e), opv)) return 0;
if(!tvertex_wind(opv2, tedge_v2(e), opv)) return 0;
@@ -7883,9 +7888,9 @@ toporouter (int argc, char **argv, int x, int y)
hybrid_router(r);
/*
-// for(gint i=0;i<groupcount();i++) {
-// gts_surface_foreach_edge(r->layers[i].surface, space_edge, NULL);
-// }
+ for(gint i=0;i<groupcount();i++) {
+ gts_surface_foreach_edge(r->layers[i].surface, space_edge, NULL);
+ }
{
int i;
for(i=0;i<groupcount();i++) {
|
|
From: <gi...@gp...> - 2010-03-20 06:45:32
|
The branch, master has been updated
via 5672c37af126b75f687e693602c393f16aca46c7 (commit)
via 1ee723379413c20973bdad27b1e1cf1d722cf3d1 (commit)
from 9ef73a58992bcc5c2eb3a550bc9910bc20bd1778 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/toporouter.c | 285 +++++++++++++++++++++++++++++++++++++++++++++++-------
src/toporouter.h | 2 +
2 files changed, 250 insertions(+), 37 deletions(-)
=================
Commit Messages
=================
commit 1ee723379413c20973bdad27b1e1cf1d722cf3d1
Author: anthonix <anthonix@anthonix-desktop.(none)>
Commit: anthonix <anthonix@anthonix-desktop.(none)>
Toporouter: line constraints
:100644 100644 a02f628... 83eb65e... M src/toporouter.c
:100644 100644 37c9ac7... 0e98115... M src/toporouter.h
=========
Changes
=========
commit 1ee723379413c20973bdad27b1e1cf1d722cf3d1
Author: anthonix <anthonix@anthonix-desktop.(none)>
Commit: anthonix <anthonix@anthonix-desktop.(none)>
Toporouter: line constraints
diff --git a/src/toporouter.c b/src/toporouter.c
index a02f628..83eb65e 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1753,7 +1753,8 @@ insert_vertex(toporouter_t *r, toporouter_layer_t *l, gdouble x, gdouble y, topo
}
GList *
-insert_constraint_edge(toporouter_t *r, toporouter_layer_t *l, gdouble x1, gdouble y1, guint flags1, gdouble x2, gdouble y2, guint flags2, toporouter_bbox_t *box)
+insert_constraint_edge(toporouter_t *r, toporouter_layer_t *l, gdouble x1, gdouble y1, guint flags1,
+ gdouble x2, gdouble y2, guint flags2, toporouter_bbox_t *box)
{
GtsVertexClass *vertex_class = GTS_VERTEX_CLASS (toporouter_vertex_class ());
GtsEdgeClass *edge_class = GTS_EDGE_CLASS (toporouter_constraint_class ());
@@ -2196,6 +2197,8 @@ read_lines(toporouter_t *r, toporouter_layer_t *l, LayerType *layer, int ln)
vlist = g_list_prepend(vlist, gts_vertex_new (vertex_class, xs[1], ys[1], l - r->layers));
bbox = toporouter_bbox_create_from_points(GetLayerGroupNumberByNumber(ln), vlist, LINE, line);
r->bboxes = g_slist_prepend(r->bboxes, bbox);
+ //new;;
+ //insert_constraints_from_list(r, l, vlist, bbox);
g_list_free(vlist);
bbox->constraints = g_list_concat(bbox->constraints, insert_constraint_edge(r, l, xs[0], ys[0], 0, xs[1], ys[1], 0, bbox));
@@ -2206,8 +2209,6 @@ read_lines(toporouter_t *r, toporouter_layer_t *l, LayerType *layer, int ln)
return 0;
}
-
-
void
create_board_edge(gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble max, gint layer, GList **vlist)
{
@@ -2270,6 +2271,31 @@ triangle_cost(GtsTriangle *t, gpointer *data){
}
+void
+print_constraint(toporouter_constraint_t *e)
+{
+ printf("CONSTRAINT:\n");
+ print_vertex(tedge_v1(e));
+ print_vertex(tedge_v2(e));
+}
+
+void
+print_edge(toporouter_edge_t *e)
+{
+ GList *i = edge_routing(e);
+
+ printf("EDGE:\n");
+
+ print_vertex(tedge_v1(e));
+
+ while(i) {
+ toporouter_vertex_t *v = TOPOROUTER_VERTEX(i->data);
+ print_vertex(v);
+ i = i->next;
+ }
+
+ print_vertex(tedge_v2(e));
+}
void
@@ -2277,34 +2303,50 @@ build_cdt(toporouter_t *r, toporouter_layer_t *l)
{
/* TODO: generalize into surface *cdt_create(vertices, constraints) */
GList *i;
- GtsEdge *temp;
- GtsVertex *v;
+ //GtsEdge *temp;
+ //GtsVertex *v;
GtsTriangle *t;
GtsVertex *v1, *v2, *v3;
- GSList *vertices_slist = list_to_slist(l->vertices);
+ GtsFace *topface = NULL;
+ GSList *vertices_slist;
+ guint rerun;
+build_cdt_continuation:
+ vertices_slist = list_to_slist(l->vertices);
+ rerun =0;
+ if(l->surface && topface) {
+ gts_surface_traverse_destroy (gts_surface_traverse_new (l->surface, topface));
+ }
+
t = gts_triangle_enclosing (gts_triangle_class (), vertices_slist, 1000.0f);
gts_triangle_vertices (t, &v1, &v2, &v3);
g_slist_free(vertices_slist);
-
+
l->surface = gts_surface_new (gts_surface_class (), gts_face_class (),
GTS_EDGE_CLASS(toporouter_edge_class ()), GTS_VERTEX_CLASS(toporouter_vertex_class ()) );
- gts_surface_add_face (l->surface, gts_face_new (gts_face_class (), t->e1, t->e2, t->e3));
+ topface = gts_face_new (gts_face_class (), t->e1, t->e2, t->e3);
+ gts_surface_add_face (l->surface, topface);
i = l->vertices;
while (i) {
- v = i->data;
+ //v = i->data;
//if(r->flags & TOPOROUTER_FLAG_DEBUG_CDTS)
// fprintf(stderr, "\tadding vertex %f,%f\n", v->p.x, v->p.y);
- g_assert (gts_delaunay_add_vertex (l->surface, i->data, NULL) == NULL);
+ toporouter_vertex_t *v = TOPOROUTER_VERTEX(gts_delaunay_add_vertex (l->surface, i->data, NULL));
+ if(v) {
+ printf("conflict: "); print_vertex(v);
+ }
+
i = i->next;
}
// fprintf(stderr, "ADDED VERTICES\n");
/*
+ GtsFace *debugface;
+
if((debugface = gts_delaunay_check(l->surface))) {
fprintf(stderr, "WARNING: Delaunay check failed\n");
fprintf(stderr, "\tViolating triangle:\n");
@@ -2326,19 +2368,22 @@ build_cdt(toporouter_t *r, toporouter_layer_t *l)
debugface->triangle.e3->segment.v2->p.x,
debugface->triangle.e3->segment.v2->p.y
);
- if((f=fopen("fail.oogl", "w")) == NULL) {
- fprintf(stderr, "Error opening file fail.oogl for output\n");
- }else{
- gts_surface_write_oogl(l->surface, f);
- fclose(f);
+// toporouter_draw_surface(r, l->surface, "debug.png", 4096, 4096);
+ {
+ int i;
+ for(i=0;i<groupcount();i++) {
+ char buffer[256];
+ sprintf(buffer, "debug-%d.png", i);
+ toporouter_draw_surface(r, r->layers[i].surface, buffer, 2048, 2048, 2, NULL, i, NULL);
}
- toporouter_draw_surface(l->surface, "debug.png", 4096, 4096);
+ }
}
*/
i = l->constraints;
while (i) {
- temp = i->data;
+
+ toporouter_constraint_t *c1 = TOPOROUTER_CONSTRAINT(i->data);
//if(r->flags & TOPOROUTER_FLAG_DEBUG_CDTS)
/* fprintf(r->debug, "edge p1=%f,%f p2=%f,%f\n",
temp->segment.v1->p.x,
@@ -2346,15 +2391,186 @@ build_cdt(toporouter_t *r, toporouter_layer_t *l)
temp->segment.v2->p.x,
temp->segment.v2->p.y);
*/
- g_assert (gts_delaunay_add_constraint (l->surface, i->data) == NULL);
+ GSList *conflicts = gts_delaunay_add_constraint (l->surface, i->data);
+ GSList *j = conflicts;
+ while(j) {
+ if(TOPOROUTER_IS_CONSTRAINT(j->data)) {
+ toporouter_constraint_t *c2 = TOPOROUTER_CONSTRAINT(j->data);
+ GList *temp, *newcons = NULL;
+
+ printf("conflict: "); print_constraint(c2);
+ printf("with: "); print_constraint(c1);
+
+ gts_allow_floating_vertices = TRUE;
+ l->constraints = g_list_remove(l->constraints, c1);
+ l->constraints = g_list_remove(l->constraints, c2);
+ c1->box->constraints = g_list_remove(c1->box->constraints, c1);
+ c2->box->constraints = g_list_remove(c2->box->constraints, c2);
+
+ if(gts_segments_are_intersecting(GTS_SEGMENT(c1), GTS_SEGMENT(c2)) == GTS_IN) {
+ // proper intersection
+ toporouter_vertex_t *v = TOPOROUTER_VERTEX(vertex_intersect(edge_v1(c1), edge_v2(c1), edge_v1(c2), edge_v2(c2)));
+ // remove both constraints
+ // replace with 4x constraints
+ // insert new intersection vertex
+ GTS_POINT(v)->z = vz(edge_v1(c1));
+
+ l->vertices = g_list_prepend(l->vertices, v);
+
+ v->bbox = c1->box;
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(v), vy(v), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(v), vy(v), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(v), vy(v), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, vx(v), vy(v), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ }else if(!vertex_wind(edge_v1(c1), edge_v2(c1), edge_v1(c2)) && !vertex_wind(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ printf("all colinear\n");
+ exit(1);
+ }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v1(c1)) && vertex_between(edge_v1(c2), edge_v2(c2), edge_v2(c1))) {
+ // remove c1
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+
+ }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v1(c2)) && vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ // remove c2
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+ /*
+
+ }else {
+ exit(1);
+ if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ toporouter_constraint_t *tempc = c1;
+ c1 = c2;
+ c2 = tempc;
+ }
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+
+ if(tvdistance2(edge_v1(c1), edge_v2(c2)) < tvdistance2(edge_v2(c1), edge_v2(c2))) {
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ }else{
+ temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ }
+ */
+ }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v1(c1))) {
+ //v1 of c1 is on c2
+ printf("v1 of c1 on c2\n");
+
+ // replace with 2x constraints
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+
+ // restore c1
+ //temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, c1->box);
+ //c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+
+ }else if(vertex_between(edge_v1(c2), edge_v2(c2), edge_v2(c1))) {
+ //v2 of c1 is on c2
+ printf("v2 of c1 on c2\n");
+
+ // replace with 2x constraints
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+ }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v1(c2))) {
+ //v1 of c2 is on c1
+ printf("v1 of c2 on c1\n");
+
+ // replace with 2x constraints
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ }else if(vertex_between(edge_v1(c1), edge_v2(c1), edge_v2(c2))) {
+ //v2 of c2 is on c1
+ printf("v2 of c2 on c1\n");
+
+ // replace with 2x constraints
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c1)), vy(tedge_v1(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+ temp = insert_constraint_edge(r, l, vx(tedge_v2(c1)), vy(tedge_v2(c1)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c1->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c1->box->constraints = g_list_concat(c1->box->constraints, temp);
+
+ temp = insert_constraint_edge(r, l, vx(tedge_v1(c2)), vy(tedge_v1(c2)), 0, vx(tedge_v2(c2)), vy(tedge_v2(c2)), 0, c2->box);
+ newcons = g_list_concat(newcons, g_list_copy(temp));
+ c2->box->constraints = g_list_concat(c2->box->constraints, temp);
+ }
+ gts_object_destroy (GTS_OBJECT (c1));
+ gts_object_destroy (GTS_OBJECT (c2));
+
+ gts_allow_floating_vertices = FALSE;
+/*
+ {
+ GList *k = newcons;
+
+ while(k) {
+ if(gts_delaunay_add_constraint (l->surface, k->data) || gts_delaunay_add_constraint (l->surface, k->data)) {
+ printf("ERROR INSERTING NEWCONS\n");
+ }
+ k = k->next;
+ }
+ g_list_free(newcons);
+ }
+*/
+ goto build_cdt_continuation;
+ // rerun = 1;
+ }
+ j = j->next;
+ }
+ g_slist_free(conflicts);
+
i = i->next;
}
+
+// if(rerun)
+// goto build_cdt_continuation;
// fprintf(stderr, "ADDED CONSTRAINTS\n");
gts_allow_floating_vertices = TRUE;
gts_object_destroy (GTS_OBJECT (v1));
gts_object_destroy (GTS_OBJECT (v2));
gts_object_destroy (GTS_OBJECT (v3));
gts_allow_floating_vertices = FALSE;
+
/*
{
gpointer data[2];
@@ -2676,6 +2892,15 @@ import_geometry(toporouter_t *r)
printf("building CDT\n");
#endif
build_cdt(r, cur_layer);
+ printf("finished\n");
+/* {
+ int i;
+ for(i=0;i<groupcount();i++) {
+ char buffer[256];
+ sprintf(buffer, "build%d.png", i);
+ toporouter_draw_surface(r, r->layers[i].surface, buffer, 2048, 2048, 2, NULL, i, NULL);
+ }
+ }*/
#ifdef DEBUG_IMPORT
printf("finished building CDT\n");
#endif
@@ -2978,23 +3203,6 @@ routing_edge_insert(gconstpointer a, gconstpointer b, gpointer user_data)
return 0;
}
-void
-print_edge(toporouter_edge_t *e)
-{
- GList *i = edge_routing(e);
-
- printf("EDGE:\n");
-
- print_vertex(tedge_v1(e));
-
- while(i) {
- toporouter_vertex_t *v = TOPOROUTER_VERTEX(i->data);
- print_vertex(v);
- i = i->next;
- }
-
- print_vertex(tedge_v2(e));
-}
toporouter_vertex_t *
new_temp_toporoutervertex(gdouble x, gdouble y, toporouter_edge_t *e)
@@ -4210,7 +4418,7 @@ compute_candidate_points(toporouter_t *tr, toporouter_layer_t *l, toporouter_ver
compute_candidate_points_finish:
- if(vertex_bbox(curpoint)) {
+ if(vertex_bbox(curpoint) && vertex_bbox(curpoint)->cluster) {
if(vertex_bbox(curpoint)->cluster->c == data->src->c) {
r = g_list_concat(r, g_list_copy(data->srcvertices));
}
@@ -4246,15 +4454,18 @@ path_score(toporouter_t *r, GList *path)
{
gdouble score = 0.;
toporouter_vertex_t *pv = NULL;
+ toporouter_vertex_t *v0 = NULL;
if(!path) return INFINITY;
+ v0 = TOPOROUTER_VERTEX(path->data);
+
while(path) {
toporouter_vertex_t *v = TOPOROUTER_VERTEX(path->data);
if(pv) {
score += gts_point_distance(GTS_POINT(pv), GTS_POINT(v));
- if(vz(pv) != vz(v))
+ if(pv != v0 && vz(pv) != vz(v))
if(path->next)
score += r->viacost;
diff --git a/src/toporouter.h b/src/toporouter.h
index 37c9ac7..0e98115 100644
--- a/src/toporouter.h
+++ b/src/toporouter.h
@@ -100,8 +100,10 @@
#define tev1x(e) (vx(tedge_v1(e))
#define tev1y(e) (vy(tedge_v1(e))
+#define tev1z(e) (vz(tedge_v1(e))
#define tev2x(e) (vx(tedge_v2(e))
#define tev2y(e) (vy(tedge_v2(e))
+#define tev2z(e) (vz(tedge_v2(e))
#define tvertex_intersect(a,b,c,d) (TOPOROUTER_VERTEX(vertex_intersect(GTS_VERTEX(a),GTS_VERTEX(b),GTS_VERTEX(c),GTS_VERTEX(d))))
|
|
From: <gi...@gp...> - 2010-03-19 03:26:03
|
The branch, master has been updated
via 9ef73a58992bcc5c2eb3a550bc9910bc20bd1778 (commit)
via e45f4e8d15f2c30f8ccb37de5b0bfa801fca572c (commit)
from b89fa5b38ebf2c7d59a2bdd3385878fffe117f26 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/toporouter.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
=================
Commit Messages
=================
commit e45f4e8d15f2c30f8ccb37de5b0bfa801fca572c
Author: Anthony M. Blake <ant...@an...>
Commit: Anthony M. Blake <ant...@an...>
Toporouter: fixed a few AMD64 warnings
:100644 100644 a02f628... ff6d804... M src/toporouter.c
=========
Changes
=========
commit e45f4e8d15f2c30f8ccb37de5b0bfa801fca572c
Author: Anthony M. Blake <ant...@an...>
Commit: Anthony M. Blake <ant...@an...>
Toporouter: fixed a few AMD64 warnings
diff --git a/src/toporouter.c b/src/toporouter.c
index a02f628..ff6d804 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -2798,14 +2798,14 @@ toporouter_heap_search(gpointer data, gpointer user_data)
toporouter_heap_search_data_t *heap_search_data = (toporouter_heap_search_data_t *)user_data;
if(v == heap_search_data->key) heap_search_data->result = v;
}
-
+/*
void
toporouter_heap_color(gpointer data, gpointer user_data)
{
toporouter_vertex_t *v = TOPOROUTER_VERTEX(data);
- v->flags |= (unsigned int) user_data;
+ v->flags |= (guint) user_data;
}
-
+*/
inline gdouble
angle_span(gdouble a1, gdouble a2)
{
@@ -6095,7 +6095,7 @@ oproute_rubberband_segment(toporouter_t *r, toporouter_oproute_t *oproute, GList
}
arcs = g_list_sort(arcs, (GCompareFunc) compare_rubberband_arcs);
-rubberband_insert_maxarc:
+//rubberband_insert_maxarc:
if(!arcs) return NULL;
max = TOPOROUTER_RUBBERBAND_ARC(arcs->data);
@@ -6828,8 +6828,11 @@ print_netscores(GPtrArray* netscores)
printf(" %15s %15s %15s\n----------------------------------------------------\n", "Score", "Detour Sum", "Pairwise Fails");
for(toporouter_netscore_t **i = (toporouter_netscore_t **) netscores->pdata; i < (toporouter_netscore_t **) netscores->pdata + netscores->len; i++) {
- printf("%4d %15f %15f %15d %15x\n", (*i)->id, (*i)->score, (*i)->pairwise_detour_sum, (*i)->pairwise_fails, (unsigned int)*i);
+#ifdef DEBUG_NETSCORES
+ printf("%4d %15f %15f %15d %15x\n", (*i)->id, (*i)->score, (*i)->pairwise_detour_sum, (*i)->pairwise_fails, (guint)*i);
+#endif
}
+
printf("\n");
}
|
|
From: <gi...@gp...> - 2010-03-19 02:44:42
|
The branch, master has been updated
via b89fa5b38ebf2c7d59a2bdd3385878fffe117f26 (commit)
via 86055f4273cae0c00d55b30f4bd610052ca350a4 (commit)
from ee8c65db8257eee155071ec7beab6dabb1a77c86 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
configure.ac | 2 ++
tests/golden/Makefile.am | 4 +++-
tests/golden/{hid_png1 => hid_png2}/Makefile.am | 2 +-
.../gerber_oneline.png => hid_png2/myfile.png} | Bin 218 -> 218 bytes
tests/golden/{hid_png1 => hid_png3}/Makefile.am | 0
tests/golden/hid_png3/gerber_oneline.png | Bin 0 -> 844 bytes
tests/run_tests.sh | 2 +-
tests/tests.list | 4 +++-
8 files changed, 10 insertions(+), 4 deletions(-)
copy tests/golden/{hid_png1 => hid_png2}/Makefile.am (64%)
copy tests/golden/{hid_png1/gerber_oneline.png => hid_png2/myfile.png} (100%)
copy tests/golden/{hid_png1 => hid_png3}/Makefile.am (100%)
create mode 100644 tests/golden/hid_png3/gerber_oneline.png
=================
Commit Messages
=================
commit b89fa5b38ebf2c7d59a2bdd3385878fffe117f26
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Missed the copyright bump when adding the gcode compare routines a
few weeks back.
:100755 100755 44bdcc7... e9a4ac2... M tests/run_tests.sh
commit 86055f4273cae0c00d55b30f4bd610052ca350a4
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Add tests for --outfile and --dpi arguments to the PNG exporter
:100644 100644 f0e19bd... 4e9476d... M configure.ac
:100644 100644 de5bb08... 515419e... M tests/golden/Makefile.am
:000000 100644 0000000... f0387c4... A tests/golden/hid_png2/Makefile.am
:000000 100644 0000000... be346ad... A tests/golden/hid_png2/myfile.png
:000000 100644 0000000... 8ef143b... A tests/golden/hid_png3/Makefile.am
:000000 100644 0000000... 3b30ed3... A tests/golden/hid_png3/gerber_oneline.png
:100644 100644 95af71d... ac1a11a... M tests/tests.list
=========
Changes
=========
commit b89fa5b38ebf2c7d59a2bdd3385878fffe117f26
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Missed the copyright bump when adding the gcode compare routines a
few weeks back.
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 44bdcc7..e9a4ac2 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -2,7 +2,7 @@
#
# $Id: run_tests.sh,v 1.8 2009/02/17 00:42:31 danmc Exp $
#
-# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2009 Dan McMahill
+# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2009, 2010 Dan McMahill
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
commit 86055f4273cae0c00d55b30f4bd610052ca350a4
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Add tests for --outfile and --dpi arguments to the PNG exporter
diff --git a/configure.ac b/configure.ac
index f0e19bd..4e9476d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1167,6 +1167,8 @@ AC_CONFIG_FILES(tests/golden/hid_gcode11/Makefile)
AC_CONFIG_FILES(tests/golden/hid_gerber1/Makefile)
AC_CONFIG_FILES(tests/golden/hid_gerber2/Makefile)
AC_CONFIG_FILES(tests/golden/hid_png1/Makefile)
+AC_CONFIG_FILES(tests/golden/hid_png2/Makefile)
+AC_CONFIG_FILES(tests/golden/hid_png3/Makefile)
AC_CONFIG_FILES(tests/Makefile)
dnl win32 build scripts
diff --git a/tests/golden/Makefile.am b/tests/golden/Makefile.am
index de5bb08..515419e 100644
--- a/tests/golden/Makefile.am
+++ b/tests/golden/Makefile.am
@@ -18,4 +18,6 @@ SUBDIRS= \
hid_gcode11 \
hid_gerber1 \
hid_gerber2 \
- hid_png1
+ hid_png1 \
+ hid_png2 \
+ hid_png3
diff --git a/tests/golden/hid_png2/Makefile.am b/tests/golden/hid_png2/Makefile.am
new file mode 100644
index 0000000..f0387c4
--- /dev/null
+++ b/tests/golden/hid_png2/Makefile.am
@@ -0,0 +1,4 @@
+## -*- makefile -*-
+
+EXTRA_DIST= \
+ myfile.png
diff --git a/tests/golden/hid_png2/myfile.png b/tests/golden/hid_png2/myfile.png
new file mode 100644
index 0000000..be346ad
Binary files /dev/null and b/tests/golden/hid_png2/myfile.png differ
diff --git a/tests/golden/hid_png3/Makefile.am b/tests/golden/hid_png3/Makefile.am
new file mode 100644
index 0000000..8ef143b
--- /dev/null
+++ b/tests/golden/hid_png3/Makefile.am
@@ -0,0 +1,4 @@
+## -*- makefile -*-
+
+EXTRA_DIST= \
+ gerber_oneline.png
diff --git a/tests/golden/hid_png3/gerber_oneline.png b/tests/golden/hid_png3/gerber_oneline.png
new file mode 100644
index 0000000..3b30ed3
Binary files /dev/null and b/tests/golden/hid_png3/gerber_oneline.png differ
diff --git a/tests/tests.list b/tests/tests.list
index 95af71d..ac1a11a 100644
--- a/tests/tests.list
+++ b/tests/tests.list
@@ -1,4 +1,4 @@
-# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2009 Dan McMahill
+# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2009, 2010 Dan McMahill
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
@@ -159,5 +159,7 @@ hid_gerber2 | gerber_oneline.pcb | gerber | --gerberfile out | | gbx:out.back.gb
# Produces GIF/JPEG/PNG (image) files
#
hid_png1 | gerber_oneline.pcb | png | | | png:gerber_oneline.png
+hid_png2 | gerber_oneline.pcb | png | --outfile myfile.png | | png:myfile.png
+hid_png3 | gerber_oneline.pcb | png | --dpi 300 | | png:gerber_oneline.png
#
|
|
From: <gi...@gp...> - 2010-03-16 15:54:27
|
The branch, master has been updated
via ee8c65db8257eee155071ec7beab6dabb1a77c86 (commit)
from 2185dc1f86f7ffc830d950ca821080bc7238e7d6 (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
=========
README | 5 ++---
doc/pcb.texi | 5 ++---
src/main.c | 2 +-
win32/Readme.txt | 3 +--
4 files changed, 6 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit ee8c65db8257eee155071ec7beab6dabb1a77c86
Author: Kai-Martin Knaak <km...@li...>
Commit: DJ Delorie <dj...@de...>
replaces "pcb.sourceforge.net" with "pcb.gpleda.org"
:100644 100644 be006fd... 9b9da9a... M README
:100644 100644 526ad9a... 2f4c374... M doc/pcb.texi
:100644 100644 2fe588c... e5d93eb... M src/main.c
:100644 100644 7d73a68... 93273a4... M win32/Readme.txt
=========
Changes
=========
commit ee8c65db8257eee155071ec7beab6dabb1a77c86
Author: Kai-Martin Knaak <km...@li...>
Commit: DJ Delorie <dj...@de...>
replaces "pcb.sourceforge.net" with "pcb.gpleda.org"
diff --git a/README b/README
index be006fd..9b9da9a 100644
--- a/README
+++ b/README
@@ -6,9 +6,8 @@ For additional information read the manual (doc/pcb.pdf)
If you are updating you may wish to read the ChangeLog
-There is also a bug tracking system and user forum available
-on the sourceforge project page which can be found from
-http://pcb.sourceforge.net.
+There is also a bug tracking system available which can
+be found from http://pcb.gpleda.org.
-------------------------------------------------------------------------
diff --git a/doc/pcb.texi b/doc/pcb.texi
index 526ad9a..2f4c374 100644
--- a/doc/pcb.texi
+++ b/doc/pcb.texi
@@ -5280,9 +5280,8 @@ Centroid (X-Y) data for driving automated assembly equipment.
@cindex xcircuit, how to interface with
If anyone cares to contribute this section, it will get added. Please
-submit changes to the bug tracking system at the sourceforge project
-page for PCB which can be found from the PCB homepage at
-@url{http://pcb.sourceforge.net}.
+submit changes to the bug tracking system for PCB which can be found from
+the PCB homepage at @url{http://pcb.gpleda.org}.
@c --------------------------- Appendix A -------------------------------
diff --git a/src/main.c b/src/main.c
index 2fe588c..e5d93eb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -237,7 +237,7 @@ usage (void)
n_exporter++;
}
- u ("PCB Printed Circuit Board editing program, http://pcb.sourceforge.net");
+ u ("PCB Printed Circuit Board editing program, http://pcb.gpleda.org");
u ("%s [-h|-V|--copyright]\t\t\tHelp, version, copyright", Progname);
u ("%s [gui options] <pcb file>\t\tto edit", Progname);
u ("Available GUI hid%s:", n_gui == 1 ? "" : "s");
diff --git a/win32/Readme.txt b/win32/Readme.txt
index 7d73a68..93273a4 100644
--- a/win32/Readme.txt
+++ b/win32/Readme.txt
@@ -4,8 +4,7 @@
This is the windows port of the pcb printed circuit board
layout editor.
-Please visit http://pcb.sourceforge.net for more information
-about PCB.
+Please visit http://pcb.gpleda.org for more information about PCB.
The windows port makes use of GTK+ for windows. Please visit
http://www.gtk.org for more information about GTK. Without all the hard
|
|
From: <gi...@gp...> - 2010-03-14 16:20:23
|
The branch, master has been updated
via 2185dc1f86f7ffc830d950ca821080bc7238e7d6 (commit)
via 46dab7d5d39aa9f45c59b50862c41c39e51d6f8c (commit)
via 886348e148fdd2951983910c1f39b260831605c3 (commit)
via d0062d735ba2194a64cc78726c9867e3ffa39460 (commit)
via 8e8fbf053f12bbd741d4842258e7f7f62f6e1799 (commit)
via da4b3b720d55aa5cfe9868f56d54cde7d5a02e5f (commit)
via b1a35c9c9afc64ebfcf2208bc13968a641da4b1a (commit)
via 28f6cd1f67b6c3a7a9639ceea67b29474d5a649b (commit)
via 880affd3b2680782e923c421136b4286c1e94c74 (commit)
via 8d881c4fcaa2faddb2b4e47a8f6309c80d147632 (commit)
via 2d7de84dd42cb9e2eccd8f41f878b4cacad3c895 (commit)
via 7c0af9f92a78cafc9d81ca77937b26f18f0b5531 (commit)
via 7ef3aa04772b11db6afd14c626a6c49882c5850b (commit)
via a86548a6c26429e0b420602f98152d881f84cc2a (commit)
from 128ac62fe7270950eafb1c59c408bae974972e8d (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 | 14 ++--
src/hid.h | 26 ++----
src/hid/common/actions.c | 224 ++++++++++++----------------------------
src/hid/common/hidinit.c | 18 +++-
src/hid/gtk/gui-config.c | 3 +-
src/hid/gtk/gui-dialog-print.c | 30 +++++-
src/hid/hidint.h | 2 +-
src/hid/lesstif/menu.c | 15 ++--
src/main.c | 51 ++++-----
9 files changed, 149 insertions(+), 234 deletions(-)
=================
Commit Messages
=================
commit 2185dc1f86f7ffc830d950ca821080bc7238e7d6
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Add function to register single action.
The possibility to register a single action has been introduced with
commit 337fa8ba8094cee1ed291cec7bf29895ac7c9d72 but then reverted later
when changing way of passing context to action callback.
:100644 100644 823e4e3... 7b30022... M src/hid.h
:100644 100644 7bc336a... a2ad612... M src/hid/common/actions.c
commit 46dab7d5d39aa9f45c59b50862c41c39e51d6f8c
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Modify HID actions storage.
It removes the HID_ActionNode structure and directly store registered
actions in an array of HID_Action*.
It also provides a nicer way of making sure the array is sorted and
the code for binary search within the array has been removed in favor of
a call to bsearch().
:100644 100644 04270f1... 7bc336a... M src/hid/common/actions.c
commit 886348e148fdd2951983910c1f39b260831605c3
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Set 'exporter' global variable before
printing defaults.
In print_defaults(), when the HID to print defaults is not a gui, set
'exporter' global variable prior to calling HID's get_export_options()
callback.
:100644 100644 3c5ecae... 2fe588c... M src/main.c
commit d0062d735ba2194a64cc78726c9867e3ffa39460
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Rewrite function that print HID options.
The previous version of usage_hid() had a strange search for gui HID
attributes through 'hid_attr_node' rather than requesting them directly
from the HID.
As a result it was calling the get_export_options() callback on exporter
without prior setting of the exporter global variable.
:100644 100644 99dcba1... 3c5ecae... M src/main.c
commit 8e8fbf053f12bbd741d4842258e7f7f62f6e1799
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: gtkhid: Avoid use of 'exporter' when testing
for exporter availability.
:100644 100644 1d4fbda... 0c50aed... M src/hid/gtk/gui-dialog-print.c
commit da4b3b720d55aa5cfe9868f56d54cde7d5a02e5f
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: gtkhid: Set and unset global variable
'exporter' when printing.
The GTK hid was not setting the global variable 'exporter' before
exporting the layout in ghid_dialog_print(): exporter HID relying on
this variable being set were lost.
:100644 100644 c5c2fff... 1d4fbda... M src/hid/gtk/gui-dialog-print.c
commit b1a35c9c9afc64ebfcf2208bc13968a641da4b1a
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Provide context to callbacks of actions
through global variable.
Providing a context to action is necessary for scripting languages (for
example). To do so, a global variable ('current_action') is being
defined: it is saved, set and restored when running the callback of an
action in a way similar to what PCB already does with HIDs.
The callback function may access the action it belongs to and cast it
the way it wants to extract information from a potentially extended
HID_Action structure.
:100644 100644 067beb0... 823e4e3... M src/hid.h
:100644 100644 123a2f4... 04270f1... M src/hid/common/actions.c
:100644 100644 f391778... 9869483... M src/hid/lesstif/menu.c
commit 28f6cd1f67b6c3a7a9639ceea67b29474d5a649b
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Sort actions by references in 'all_actions'.
Previously, when building 'all_actions', a copy of every HID_Action
was performed for each action. Now it builds 'all_actions' with pointers
to the actual HID_Action structures (without reallocating).
:100644 100644 e172d51... 123a2f4... M src/hid/common/actions.c
commit 880affd3b2680782e923c421136b4286c1e94c74
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Revert "single-action register/deregister".
This reverts commits 337fa8ba8094cee1ed291cec7bf29895ac7c9d72 and
b274cf8fe9c8caf5bcd4edc28935c88cf5bab7f4 before the introduction of a
new context passing scheme for actions.
:100644 100644 9b26ef8... 067beb0... M src/hid.h
:100644 100644 8678ad9... e172d51... M src/hid/common/actions.c
:100644 100644 5840e20... a2148a0... M src/hid/hidint.h
:100644 100644 d3e421d... f391778... M src/hid/lesstif/menu.c
commit 8d881c4fcaa2faddb2b4e47a8f6309c80d147632
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Fix comment for global variable 'gui' in
hid.h.
hid_start_gui() does not exist. The variable is instead set in main()
and hid_expose_callback().
:100644 100644 7409bbf... 9b26ef8... M src/hid.h
commit 2d7de84dd42cb9e2eccd8f41f878b4cacad3c895
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Modify DrawSpecialPolygon() prototype to not
take a pointer on HID.
DrawSpecialPolygon() was the only function to take a HID as parameter.
Every other draw function works on the current HID through global
variable 'gui'.
:100644 100644 9571b29... d06813d... M src/draw.c
commit 7c0af9f92a78cafc9d81ca77937b26f18f0b5531
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Support HID_Mixed options in attribute dialog
Since an HID_Mixed attribute is the combination of a real and an enum,
reuse the code for HID_Enum to provide a combo box next to the spin button
for the real part.
:100644 100644 922b719... c5c2fff... M src/hid/gtk/gui-dialog-print.c
commit 7ef3aa04772b11db6afd14c626a6c49882c5850b
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud.
Modified code to not abort on HID_Mixed attributes. Th gtk HID is
modified to understand such an attribute (though the attribute dialog
has still no support for them), the lesstif HID is unchanged.
:100644 100644 9581d32... bb1a66b... M src/hid/common/hidinit.c
:100644 100644 490befc... c9bf82b... M src/hid/gtk/gui-config.c
:100644 100644 5f68465... 99dcba1... M src/main.c
commit a86548a6c26429e0b420602f98152d881f84cc2a
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Applying patch from Patrick Bernaud.
HIDs with a name too long were breaking alignement in usage() as the
code requested insertion of a tab after the name even for HID names
already exceeding the length of the tabulation.
This is similar to how usage_attr() already does alignment of
name and help text.
:100644 100644 162a0e0... 5f68465... M src/main.c
=========
Changes
=========
commit 2185dc1f86f7ffc830d950ca821080bc7238e7d6
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Add function to register single action.
The possibility to register a single action has been introduced with
commit 337fa8ba8094cee1ed291cec7bf29895ac7c9d72 but then reverted later
when changing way of passing context to action callback.
diff --git a/src/hid.h b/src/hid.h
index 823e4e3..7b30022 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -86,6 +86,8 @@ extern "C"
const char *syntax;
} HID_Action;
+ extern void hid_register_action (HID_Action *);
+
extern void hid_register_actions (HID_Action *, int);
#define REGISTER_ACTIONS(a) HIDCONCAT(void register_,a) ()\
{ hid_register_actions(a, sizeof(a)/sizeof(a[0])); }
diff --git a/src/hid/common/actions.c b/src/hid/common/actions.c
index 7bc336a..a2ad612 100644
--- a/src/hid/common/actions.c
+++ b/src/hid/common/actions.c
@@ -40,6 +40,12 @@ hid_register_actions (HID_Action * a, int n)
all_actions_sorted = 0;
}
+void
+hid_register_action (HID_Action * a)
+{
+ hid_register_actions (a, 1);
+}
+
static int
action_sort_compar (const void *va, const void *vb)
{
commit 46dab7d5d39aa9f45c59b50862c41c39e51d6f8c
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Modify HID actions storage.
It removes the HID_ActionNode structure and directly store registered
actions in an array of HID_Action*.
It also provides a nicer way of making sure the array is sorted and
the code for binary search within the array has been removed in favor of
a call to bsearch().
diff --git a/src/hid/common/actions.c b/src/hid/common/actions.c
index 04270f1..7bc336a 100644
--- a/src/hid/common/actions.c
+++ b/src/hid/common/actions.c
@@ -21,81 +21,64 @@
RCSID ("$Id$");
-typedef struct HID_ActionNode
-{
- struct HID_ActionNode *next;
- HID_Action *actions;
- int n;
-} HID_ActionNode;
-
-HID_ActionNode *hid_action_nodes = 0;
-static int n_actions = 0;
static HID_Action **all_actions = 0;
+static int all_actions_sorted = 0;
+static int n_actions = 0;
HID_Action *current_action = NULL;
void
hid_register_actions (HID_Action * a, int n)
{
- HID_ActionNode *ha;
-
- /*printf("%d actions registered\n", n); */
- ha = (HID_ActionNode *) malloc (sizeof (HID_ActionNode));
- ha->next = hid_action_nodes;
- hid_action_nodes = ha;
- ha->actions = a;
- ha->n = n;
+ int i;
+
+ all_actions = realloc (all_actions,
+ (n_actions + n) * sizeof (HID_Action*));
+ for (i = 0; i < n; i++)
+ all_actions[n_actions + i] = a + i;
n_actions += n;
- if (all_actions)
- {
- free (all_actions);
- all_actions = 0;
- }
+ all_actions_sorted = 0;
}
static int
-action_sort (const void *va, const void *vb)
+action_sort_compar (const void *va, const void *vb)
{
HID_Action *a = *(HID_Action **) va;
HID_Action *b = *(HID_Action **) vb;
return strcmp (a->name, b->name);
}
+static void
+sort_actions ()
+{
+ qsort (all_actions, n_actions, sizeof (HID_Action*), action_sort_compar);
+ all_actions_sorted = 1;
+}
+
+static int
+action_search_compar (const void *va, const void *vb)
+{
+ char *name = (char*)va;
+ HID_Action *action = *(HID_Action**)vb;
+ return strcmp (name, action->name);
+}
+
HID_Action *
hid_find_action (const char *name)
{
- HID_ActionNode *ha;
- int i, n, lower, upper;
-
+ HID_Action **action;
+ int i;
+
if (name == NULL)
return 0;
- if (all_actions == 0)
- {
- n = 0;
- all_actions = malloc (n_actions * sizeof (HID_Action*));
- for (ha = hid_action_nodes; ha; ha = ha->next)
- for (i = 0; i < ha->n; i++)
- all_actions[n++] = &(ha->actions[i]);
- qsort (all_actions, n_actions, sizeof (HID_Action*), action_sort);
- }
-
+ if (!all_actions_sorted)
+ sort_actions ();
- lower = -1;
- upper = n_actions;
- /*printf("search action %s\n", name); */
- while (lower < upper - 1)
- {
- i = (lower + upper) / 2;
- n = strcmp (all_actions[i]->name, name);
- /*printf("try [%d].%s, cmp %d\n", i, all_actions[i].name, n); */
- if (n == 0)
- return all_actions[i];
- if (n > 0)
- upper = i;
- else
- lower = i;
- }
+ action = bsearch (name, all_actions, n_actions, sizeof (HID_Action*),
+ action_search_compar);
+ if (action)
+ return *action;
for (i = 0; i < n_actions; i++)
if (strcasecmp (all_actions[i]->name, name) == 0)
@@ -109,8 +92,10 @@ void
print_actions ()
{
int i;
- /* Forces them to be sorted in all_actions */
- hid_find_action (hid_action_nodes->actions[0].name);
+
+ if (!all_actions_sorted)
+ sort_actions ();
+
fprintf (stderr, "Registered Actions:\n");
for (i = 0; i < n_actions; i++)
{
@@ -162,8 +147,10 @@ void
dump_actions ()
{
int i;
- /* Forces them to be sorted in all_actions */
- hid_find_action (hid_action_nodes->actions[0].name);
+
+ if (!all_actions_sorted)
+ sort_actions ();
+
for (i = 0; i < n_actions; i++)
{
const char *desc = all_actions[i]->description;
commit 886348e148fdd2951983910c1f39b260831605c3
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Set 'exporter' global variable before
printing defaults.
In print_defaults(), when the HID to print defaults is not a gui, set
'exporter' global variable prior to calling HID's get_export_options()
callback.
diff --git a/src/main.c b/src/main.c
index 3c5ecae..2fe588c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -332,7 +332,9 @@ print_defaults ()
else
{
fprintf (stderr, "\n%s defaults:\n", h->name);
- e = h->get_export_options (&n);
+ exporter = h;
+ e = exporter->get_export_options (&n);
+ exporter = NULL;
if (e)
for (i = 0; i < n; i++)
print_defaults_1 (e + i, 0);
commit d0062d735ba2194a64cc78726c9867e3ffa39460
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Rewrite function that print HID options.
The previous version of usage_hid() had a strange search for gui HID
attributes through 'hid_attr_node' rather than requesting them directly
from the HID.
As a result it was calling the get_export_options() callback on exporter
without prior setting of the exporter global variable.
diff --git a/src/main.c b/src/main.c
index 99dcba1..3c5ecae 100644
--- a/src/main.c
+++ b/src/main.c
@@ -200,33 +200,24 @@ usage_attr (HID_Attribute * a)
static void
usage_hid (HID * h)
{
- HID_Attribute *e;
- int i, n;
+ HID_Attribute *attributes;
+ int i, n_attributes = 0;
if (h->gui)
{
- HID **hl = hid_enumerate ();
- HID_AttrNode *ha;
fprintf (stderr, "\n%s gui options:\n", h->name);
- for (ha = hid_attr_nodes; ha; ha = ha->next)
- {
- for (i = 0; hl[i]; i++)
- if (ha->attributes == hl[i]->get_export_options (0))
- goto skip_this_one;
- for (i = 0; i < ha->n; i++)
- usage_attr (ha->attributes + i);
- skip_this_one:;
- }
- return;
+ attributes = h->get_export_options (&n_attributes);
}
- fprintf (stderr, "\n%s options:\n", h->name);
- exporter = h;
- e = h->get_export_options (&n);
- if (!e)
- return;
- for (i = 0; i < n; i++)
- usage_attr (e + i);
- exporter = NULL;
+ else
+ {
+ fprintf (stderr, "\n%s options:\n", h->name);
+ exporter = h;
+ attributes = exporter->get_export_options (&n_attributes);
+ exporter = NULL;
+ }
+
+ for (i = 0; i < n_attributes; i++)
+ usage_attr (attributes + i);
}
static void
commit 8e8fbf053f12bbd741d4842258e7f7f62f6e1799
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: gtkhid: Avoid use of 'exporter' when testing
for exporter availability.
diff --git a/src/hid/gtk/gui-dialog-print.c b/src/hid/gtk/gui-dialog-print.c
index 1d4fbda..0c50aed 100644
--- a/src/hid/gtk/gui-dialog-print.c
+++ b/src/hid/gtk/gui-dialog-print.c
@@ -367,6 +367,7 @@ ghid_dialog_export (void)
int i;
HID **hids;
GtkTooltips *tips;
+ gboolean no_exporter = TRUE;
tips = gtk_tooltips_new ();
@@ -395,7 +396,7 @@ ghid_dialog_export (void)
{
if (hids[i]->exporter)
{
- exporter = hids[i];
+ no_exporter = FALSE;
button = gtk_button_new_with_label (hids[i]->name);
gtk_tooltips_set_tip (tips, button, hids[i]->description, NULL);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
@@ -404,7 +405,7 @@ ghid_dialog_export (void)
}
}
- if (exporter == NULL)
+ if (no_exporter)
{
gui->log (_("Can't find a suitable exporter HID"));
}
@@ -415,6 +416,4 @@ ghid_dialog_export (void)
if (export_dialog != NULL)
gtk_widget_destroy (export_dialog);
export_dialog = NULL;
-
- exporter = NULL;
}
commit da4b3b720d55aa5cfe9868f56d54cde7d5a02e5f
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: gtkhid: Set and unset global variable
'exporter' when printing.
The GTK hid was not setting the global variable 'exporter' before
exporting the layout in ghid_dialog_print(): exporter HID relying on
this variable being set were lost.
diff --git a/src/hid/gtk/gui-dialog-print.c b/src/hid/gtk/gui-dialog-print.c
index c5c2fff..1d4fbda 100644
--- a/src/hid/gtk/gui-dialog-print.c
+++ b/src/hid/gtk/gui-dialog-print.c
@@ -315,7 +315,7 @@ exporter_clicked_cb (GtkButton * button, HID * exporter)
}
void
-ghid_dialog_print (HID *exporter)
+ghid_dialog_print (HID *hid)
{
HID_Attribute *attr;
int n = 0;
@@ -326,6 +326,8 @@ ghid_dialog_print (HID *exporter)
if (export_dialog)
gtk_dialog_response (GTK_DIALOG (export_dialog), GTK_RESPONSE_CANCEL);
+ exporter = hid;
+
attr = exporter->get_export_options (&n);
if (n > 0)
{
@@ -354,6 +356,7 @@ ghid_dialog_print (HID *exporter)
if (results)
free (results);
+ exporter = NULL;
}
void
commit b1a35c9c9afc64ebfcf2208bc13968a641da4b1a
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Provide context to callbacks of actions
through global variable.
Providing a context to action is necessary for scripting languages (for
example). To do so, a global variable ('current_action') is being
defined: it is saved, set and restored when running the callback of an
action in a way similar to what PCB already does with HIDs.
The callback function may access the action it belongs to and cast it
the way it wants to extract information from a potentially extended
HID_Action structure.
diff --git a/src/hid.h b/src/hid.h
index 067beb0..823e4e3 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -579,6 +579,10 @@ typedef enum
do the exporting. The gui HIDs set and unset this var.*/
extern HID *exporter;
+/* This is either NULL or points to the current HID_Action that is being
+ called. The action launcher sets and unsets this variable. */
+ extern HID_Action *current_action;
+
/* The GUI may set this to be approximately the PCB size of a pixel,
to allow for near-misses in selection and changes in drawing items
smaller than a screen pixel. */
diff --git a/src/hid/common/actions.c b/src/hid/common/actions.c
index 123a2f4..04270f1 100644
--- a/src/hid/common/actions.c
+++ b/src/hid/common/actions.c
@@ -32,6 +32,8 @@ HID_ActionNode *hid_action_nodes = 0;
static int n_actions = 0;
static HID_Action **all_actions = 0;
+HID_Action *current_action = NULL;
+
void
hid_register_actions (HID_Action * a, int n)
{
@@ -200,8 +202,8 @@ hid_actionl (const char *name, ...)
int
hid_actionv (const char *name, int argc, char **argv)
{
- int x = 0, y = 0, i;
- HID_Action *a;
+ int x = 0, y = 0, i, ret;
+ HID_Action *a, *old_action;
if (Settings.verbose && name)
{
@@ -216,7 +218,13 @@ hid_actionv (const char *name, int argc, char **argv)
return 1;
if (a->need_coord_msg)
gui->get_coords (a->need_coord_msg, &x, &y);
- return a->trigger_cb (argc, argv, x, y);
+
+ old_action = current_action;
+ current_action = a;
+ ret = current_action->trigger_cb (argc, argv, x, y);
+ current_action = old_action;
+
+ return ret;
}
int
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index f391778..9869483 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -815,8 +815,8 @@ lesstif_get_coords (const char *msg, int *px, int *py)
int
lesstif_call_action (const char *aname, int argc, char **argv)
{
- int px, py;
- HID_Action *a;
+ int px, py, ret;
+ HID_Action *a, *old_action;
if (!aname)
return 1;
@@ -850,7 +850,13 @@ lesstif_call_action (const char *aname, int argc, char **argv)
printf ("%s%s", i ? "," : "", argv[i]);
printf (")\033[0m\n");
}
- return a->trigger_cb (argc, argv, px, py);
+
+ old_action = current_action;
+ current_action = a;
+ ret = current_action->trigger_cb (argc, argv, x, y);
+ current_action = old_action;
+
+ return ret;
}
static void
commit 28f6cd1f67b6c3a7a9639ceea67b29474d5a649b
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Sort actions by references in 'all_actions'.
Previously, when building 'all_actions', a copy of every HID_Action
was performed for each action. Now it builds 'all_actions' with pointers
to the actual HID_Action structures (without reallocating).
diff --git a/src/hid/common/actions.c b/src/hid/common/actions.c
index e172d51..123a2f4 100644
--- a/src/hid/common/actions.c
+++ b/src/hid/common/actions.c
@@ -30,7 +30,7 @@ typedef struct HID_ActionNode
HID_ActionNode *hid_action_nodes = 0;
static int n_actions = 0;
-static HID_Action *all_actions = 0;
+static HID_Action **all_actions = 0;
void
hid_register_actions (HID_Action * a, int n)
@@ -54,8 +54,8 @@ hid_register_actions (HID_Action * a, int n)
static int
action_sort (const void *va, const void *vb)
{
- HID_Action *a = (HID_Action *) va;
- HID_Action *b = (HID_Action *) vb;
+ HID_Action *a = *(HID_Action **) va;
+ HID_Action *b = *(HID_Action **) vb;
return strcmp (a->name, b->name);
}
@@ -71,11 +71,11 @@ hid_find_action (const char *name)
if (all_actions == 0)
{
n = 0;
- all_actions = malloc (n_actions * sizeof (HID_Action));
+ all_actions = malloc (n_actions * sizeof (HID_Action*));
for (ha = hid_action_nodes; ha; ha = ha->next)
for (i = 0; i < ha->n; i++)
- all_actions[n++] = ha->actions[i];
- qsort (all_actions, n_actions, sizeof (HID_Action), action_sort);
+ all_actions[n++] = &(ha->actions[i]);
+ qsort (all_actions, n_actions, sizeof (HID_Action*), action_sort);
}
@@ -85,10 +85,10 @@ hid_find_action (const char *name)
while (lower < upper - 1)
{
i = (lower + upper) / 2;
- n = strcmp (all_actions[i].name, name);
+ n = strcmp (all_actions[i]->name, name);
/*printf("try [%d].%s, cmp %d\n", i, all_actions[i].name, n); */
if (n == 0)
- return all_actions + i;
+ return all_actions[i];
if (n > 0)
upper = i;
else
@@ -96,8 +96,8 @@ hid_find_action (const char *name)
}
for (i = 0; i < n_actions; i++)
- if (strcasecmp (all_actions[i].name, name) == 0)
- return all_actions + i;
+ if (strcasecmp (all_actions[i]->name, name) == 0)
+ return all_actions[i];
printf ("unknown action `%s'\n", name);
return 0;
@@ -112,15 +112,15 @@ print_actions ()
fprintf (stderr, "Registered Actions:\n");
for (i = 0; i < n_actions; i++)
{
- if (all_actions[i].description)
- fprintf (stderr, " %s - %s\n", all_actions[i].name,
- all_actions[i].description);
+ if (all_actions[i]->description)
+ fprintf (stderr, " %s - %s\n", all_actions[i]->name,
+ all_actions[i]->description);
else
- fprintf (stderr, " %s\n", all_actions[i].name);
- if (all_actions[i].syntax)
+ fprintf (stderr, " %s\n", all_actions[i]->name);
+ if (all_actions[i]->syntax)
{
const char *bb, *eb;
- bb = eb = all_actions[i].syntax;
+ bb = eb = all_actions[i]->syntax;
while (1)
{
for (eb = bb; *eb && *eb != '\n'; eb++)
@@ -164,13 +164,13 @@ dump_actions ()
hid_find_action (hid_action_nodes->actions[0].name);
for (i = 0; i < n_actions; i++)
{
- const char *desc = all_actions[i].description;
- const char *synt = all_actions[i].syntax;
+ const char *desc = all_actions[i]->description;
+ const char *synt = all_actions[i]->syntax;
desc = desc ? desc : "";
synt = synt ? synt : "";
- printf ("A%s\n", all_actions[i].name);
+ printf ("A%s\n", all_actions[i]->name);
dump_string ('D', desc);
dump_string ('S', synt);
}
commit 880affd3b2680782e923c421136b4286c1e94c74
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Revert "single-action register/deregister".
This reverts commits 337fa8ba8094cee1ed291cec7bf29895ac7c9d72 and
b274cf8fe9c8caf5bcd4edc28935c88cf5bab7f4 before the introduction of a
new context passing scheme for actions.
diff --git a/src/hid.h b/src/hid.h
index 9b26ef8..067beb0 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -86,25 +86,7 @@ extern "C"
const char *syntax;
} HID_Action;
- /* This global variable is always set to the action context, before
- an action callback is called. Action context can be specified
- when registering an action with hid_register_action() Intended
- for plugins with hub action callbacks. */
- extern void *hid_action_context;
-
- /* Register a singe action associated with an action context. Makes
- a copy of HID_Action. Intended for plugins to register actions
- with a hub callback. */
- extern void hid_register_action(const HID_Action *, void *);
-
- /* Deregister an action registered using hid_register_action().
- Action context pointer is copied in the 2nd argument if it's not
- NULL. Intended for plugins to deregister custom actions. */
- extern void hid_deregister_action(const char *, void **);
-
- /* Register a list of static actions without action context */
extern void hid_register_actions (HID_Action *, int);
-
#define REGISTER_ACTIONS(a) HIDCONCAT(void register_,a) ()\
{ hid_register_actions(a, sizeof(a)/sizeof(a[0])); }
diff --git a/src/hid/common/actions.c b/src/hid/common/actions.c
index 8678ad9..e172d51 100644
--- a/src/hid/common/actions.c
+++ b/src/hid/common/actions.c
@@ -8,7 +8,6 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#include <assert.h>
#include "global.h"
#include "data.h"
@@ -27,29 +26,14 @@ typedef struct HID_ActionNode
struct HID_ActionNode *next;
HID_Action *actions;
int n;
- /* The registrar the callback function may use this pointer to
- remember context; the action infrastructure will just pass it
- along. */
- void *context;
- /* is this ActionNode registered runtime? (can be deregistered) */
- int dynamic;
} HID_ActionNode;
-/* The master list of all actions registered */
-typedef struct HID_ActionContext
-{
- HID_Action action;
- void *context;
-} HID_ActionContext;
+HID_ActionNode *hid_action_nodes = 0;
static int n_actions = 0;
-static HID_ActionContext *all_actions = NULL;
-
-HID_ActionNode *hid_action_nodes = NULL;
+static HID_Action *all_actions = 0;
-void *hid_action_context = NULL;
-
-static void
-hid_register_actions_context (HID_Action * a, int n, void *context, int dynamic)
+void
+hid_register_actions (HID_Action * a, int n)
{
HID_ActionNode *ha;
@@ -57,87 +41,26 @@ hid_register_actions_context (HID_Action * a, int n, void *context, int dynamic)
ha = (HID_ActionNode *) malloc (sizeof (HID_ActionNode));
ha->next = hid_action_nodes;
hid_action_nodes = ha;
- if (dynamic) {
- assert(n == 1); /* we register dynamic actions one by one */
- ha->actions = malloc(sizeof(HID_Action));
- memcpy(ha->actions, a, sizeof(HID_Action));
- }
- else
- ha->actions = a;
-
+ ha->actions = a;
ha->n = n;
- ha->context = context;
- ha->dynamic = dynamic;
n_actions += n;
if (all_actions)
{
free (all_actions);
- all_actions = NULL;
+ all_actions = 0;
}
}
-void
-hid_register_actions (HID_Action * a, int n)
-{
- hid_register_actions_context (a, n, NULL, 0);
-}
-
-void
-hid_register_action (const HID_Action * a, void *context)
-{
- hid_register_actions_context (a, 1, context, 1);
-}
-
-void
-hid_deregister_action (const char *name, void **context)
-{
- HID_ActionNode *prev, *ha;
-
- if (context != NULL)
- *context = NULL;
-
- /* find the action in hid_action_nodes */
- for(prev = NULL, ha = hid_action_nodes; ha != NULL; prev = ha, ha = ha->next) {
- if (ha->dynamic) {
- if (strcmp(ha->actions->name, name) == 0) {
- /* found the action in the tree, save context */
- if (context != NULL)
- *context = ha->context;
-
- /* remove ha */
- if (prev == NULL)
- hid_action_nodes = ha->next;
- else
- prev->next = ha->next;
-
- free(ha->actions);
- free(ha);
-
- /* to make sure the rebuild of the sorted list next time */
- if (all_actions != NULL) {
- free (all_actions);
- all_actions = NULL;
- }
-
- n_actions--;
- return;
- }
- }
- }
-
- /* action not found - nothing to do */
-}
-
static int
action_sort (const void *va, const void *vb)
{
- HID_ActionContext *a = (HID_ActionContext *) va;
- HID_ActionContext *b = (HID_ActionContext *) vb;
- return strcmp (a->action.name, b->action.name);
+ HID_Action *a = (HID_Action *) va;
+ HID_Action *b = (HID_Action *) vb;
+ return strcmp (a->name, b->name);
}
HID_Action *
-hid_find_action (const char *name, void **context)
+hid_find_action (const char *name)
{
HID_ActionNode *ha;
int i, n, lower, upper;
@@ -145,17 +68,14 @@ hid_find_action (const char *name, void **context)
if (name == NULL)
return 0;
- if (all_actions == NULL)
+ if (all_actions == 0)
{
n = 0;
- all_actions = malloc (n_actions * sizeof (HID_ActionContext));
+ all_actions = malloc (n_actions * sizeof (HID_Action));
for (ha = hid_action_nodes; ha; ha = ha->next)
- for (i = 0; i < ha->n; i++) {
- all_actions[n].action = ha->actions[i];
- all_actions[n].context = ha->context;
- n++;
- }
- qsort (all_actions, n_actions, sizeof (HID_ActionContext), action_sort);
+ for (i = 0; i < ha->n; i++)
+ all_actions[n++] = ha->actions[i];
+ qsort (all_actions, n_actions, sizeof (HID_Action), action_sort);
}
@@ -165,13 +85,10 @@ hid_find_action (const char *name, void **context)
while (lower < upper - 1)
{
i = (lower + upper) / 2;
- n = strcmp (all_actions[i].action.name, name);
+ n = strcmp (all_actions[i].name, name);
/*printf("try [%d].%s, cmp %d\n", i, all_actions[i].name, n); */
- if (n == 0) {
- if (context != NULL)
- *context = all_actions[i].context;
- return &(all_actions[i].action);
- }
+ if (n == 0)
+ return all_actions + i;
if (n > 0)
upper = i;
else
@@ -179,11 +96,8 @@ hid_find_action (const char *name, void **context)
}
for (i = 0; i < n_actions; i++)
- if (strcasecmp (all_actions[i].action.name, name) == 0) {
- if (context != NULL)
- *context = all_actions[i].context;
- return &(all_actions[i].action);
- }
+ if (strcasecmp (all_actions[i].name, name) == 0)
+ return all_actions + i;
printf ("unknown action `%s'\n", name);
return 0;
@@ -194,19 +108,19 @@ print_actions ()
{
int i;
/* Forces them to be sorted in all_actions */
- hid_find_action (hid_action_nodes->actions[0].name, NULL);
+ hid_find_action (hid_action_nodes->actions[0].name);
fprintf (stderr, "Registered Actions:\n");
for (i = 0; i < n_actions; i++)
{
- if (all_actions[i].action.description)
- fprintf (stderr, " %s - %s\n", all_actions[i].action.name,
- all_actions[i].action.description);
+ if (all_actions[i].description)
+ fprintf (stderr, " %s - %s\n", all_actions[i].name,
+ all_actions[i].description);
else
- fprintf (stderr, " %s\n", all_actions[i].action.name);
- if (all_actions[i].action.syntax)
+ fprintf (stderr, " %s\n", all_actions[i].name);
+ if (all_actions[i].syntax)
{
const char *bb, *eb;
- bb = eb = all_actions[i].action.syntax;
+ bb = eb = all_actions[i].syntax;
while (1)
{
for (eb = bb; *eb && *eb != '\n'; eb++)
@@ -247,16 +161,16 @@ dump_actions ()
{
int i;
/* Forces them to be sorted in all_actions */
- hid_find_action (hid_action_nodes->actions[0].name, NULL);
+ hid_find_action (hid_action_nodes->actions[0].name);
for (i = 0; i < n_actions; i++)
{
- const char *desc = all_actions[i].action.description;
- const char *synt = all_actions[i].action.syntax;
+ const char *desc = all_actions[i].description;
+ const char *synt = all_actions[i].syntax;
desc = desc ? desc : "";
synt = synt ? synt : "";
- printf ("A%s\n", all_actions[i].action.name);
+ printf ("A%s\n", all_actions[i].name);
dump_string ('D', desc);
dump_string ('S', synt);
}
@@ -286,10 +200,8 @@ hid_actionl (const char *name, ...)
int
hid_actionv (const char *name, int argc, char **argv)
{
- int x = 0, y = 0, i, ret;
+ int x = 0, y = 0, i;
HID_Action *a;
- void *old_context;
- void *context;
if (Settings.verbose && name)
{
@@ -299,21 +211,12 @@ hid_actionv (const char *name, int argc, char **argv)
printf (")\033[0m\n");
}
- a = hid_find_action (name, &context);
+ a = hid_find_action (name);
if (!a)
return 1;
if (a->need_coord_msg)
gui->get_coords (a->need_coord_msg, &x, &y);
-
- /* save old action context and set it to the context associated with the action */
- old_context = hid_action_context;
- hid_action_context = context;
-
- ret = a->trigger_cb (argc, argv, x, y);
-
- /* restore old context and return */
- hid_action_context = old_context;
- return ret;
+ return a->trigger_cb (argc, argv, x, y);
}
int
diff --git a/src/hid/hidint.h b/src/hid/hidint.h
index 5840e20..a2148a0 100644
--- a/src/hid/hidint.h
+++ b/src/hid/hidint.h
@@ -35,7 +35,7 @@ typedef struct HID_AttrNode
extern HID_AttrNode *hid_attr_nodes;
-HID_Action *hid_find_action (const char *name, void **context);
+HID_Action *hid_find_action (const char *name);
HID_Flag *hid_find_flag (const char *name);
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index d3e421d..f391778 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -815,13 +815,12 @@ lesstif_get_coords (const char *msg, int *px, int *py)
int
lesstif_call_action (const char *aname, int argc, char **argv)
{
- int px, py, ret;
+ int px, py;
HID_Action *a;
- void *context, *old_context;
if (!aname)
return 1;
- a = hid_find_action (aname, &context);
+ a = hid_find_action (aname);
if (!a)
{
int i;
@@ -851,11 +850,7 @@ lesstif_call_action (const char *aname, int argc, char **argv)
printf ("%s%s", i ? "," : "", argv[i]);
printf (")\033[0m\n");
}
- old_context = hid_action_context;
- hid_action_context = context;
- ret = a->trigger_cb (argc, argv, px, py);
- hid_action_context = old_context;
- return ret;
+ return a->trigger_cb (argc, argv, px, py);
}
static void
commit 8d881c4fcaa2faddb2b4e47a8f6309c80d147632
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Fix comment for global variable 'gui' in
hid.h.
hid_start_gui() does not exist. The variable is instead set in main()
and hid_expose_callback().
diff --git a/src/hid.h b/src/hid.h
index 7409bbf..9b26ef8 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -590,7 +590,7 @@ typedef enum
void hid_expose_callback (HID * hid_, struct BoxType *region_, void *item_);
/* This is initially set to a "no-gui" gui, and later reset by
- hid_start_gui. */
+ main. hid_expose_callback also temporarily set it for drawing. */
extern HID *gui;
/* This is either NULL or points to the current HID that is being called to
commit 2d7de84dd42cb9e2eccd8f41f878b4cacad3c895
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Modify DrawSpecialPolygon() prototype to not
take a pointer on HID.
DrawSpecialPolygon() was the only function to take a HID as parameter.
Every other draw function works on the current HID through global
variable 'gui'.
diff --git a/src/draw.c b/src/draw.c
index 9571b29..d06813d 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -925,7 +925,7 @@ DrawLayerGroup (int group, const BoxType * screen)
* 2 --- 1
*/
static void
-DrawSpecialPolygon (HID * hid, hidGC DrawGC,
+DrawSpecialPolygon (hidGC DrawGC,
LocationType X, LocationType Y, int Thickness,
int thin_draw)
{
@@ -973,16 +973,16 @@ DrawSpecialPolygon (HID * hid, hidGC DrawGC,
if (thin_draw)
{
int i;
- hid->set_line_cap (DrawGC, Round_Cap);
- hid->set_line_width (DrawGC, 0);
+ gui->set_line_cap (DrawGC, Round_Cap);
+ gui->set_line_width (DrawGC, 0);
polygon_x[8] = X + scaled_x[0];
polygon_y[8] = Y + scaled_y[0];
for (i = 0; i < 8; i++)
- hid->draw_line (DrawGC, polygon_x[i], polygon_y[i],
+ gui->draw_line (DrawGC, polygon_x[i], polygon_y[i],
polygon_x[i + 1], polygon_y[i + 1]);
}
else
- hid->fill_polygon (DrawGC, 8, polygon_x, polygon_y);
+ gui->fill_polygon (DrawGC, 8, polygon_x, polygon_y);
}
/* ---------------------------------------------------------------------------
@@ -1032,7 +1032,7 @@ DrawPinOrViaLowLevel (PinTypePtr Ptr, Boolean drawHole)
}
else if (TEST_FLAG (OCTAGONFLAG, Ptr))
{
- DrawSpecialPolygon (gui, Output.fgGC, Ptr->X, Ptr->Y, Ptr->Thickness,
+ DrawSpecialPolygon (Output.fgGC, Ptr->X, Ptr->Y, Ptr->Thickness,
TEST_FLAG (THINDRAWFLAG, PCB));
}
else
@@ -1145,7 +1145,7 @@ ClearOnlyPin (PinTypePtr Pin, Boolean mask)
}
else if (TEST_FLAG (OCTAGONFLAG, Pin))
{
- DrawSpecialPolygon (gui, Output.pmGC, Pin->X, Pin->Y, half * 2,
+ DrawSpecialPolygon (Output.pmGC, Pin->X, Pin->Y, half * 2,
TEST_FLAG (THINDRAWFLAG, PCB) ||
TEST_FLAG (THINDRAWPOLYFLAG, PCB));
}
commit 7c0af9f92a78cafc9d81ca77937b26f18f0b5531
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud: Support HID_Mixed options in attribute dialog
Since an HID_Mixed attribute is the combination of a real and an enum,
reuse the code for HID_Enum to provide a combo box next to the spin button
for the real part.
diff --git a/src/hid/gtk/gui-dialog-print.c b/src/hid/gtk/gui-dialog-print.c
index 922b719..c5c2fff 100644
--- a/src/hid/gtk/gui-dialog-print.c
+++ b/src/hid/gtk/gui-dialog-print.c
@@ -213,6 +213,7 @@ ghid_attribute_dialog (HID_Attribute * attrs,
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ do_enum:
/*
* We have to put the combo_box inside of an event_box in
* order for tooltips to work.
@@ -246,7 +247,22 @@ ghid_attribute_dialog (HID_Attribute * attrs,
break;
case HID_Mixed:
- printf ("HID_Mixed\n");
+ hbox = gtk_hbox_new (FALSE, 4);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+
+ /*
+ * FIXME
+ * need to pick the "digits" and step size argument more
+ * intelligently
+ */
+ ghid_spin_button (hbox, &widget, attrs[j].default_val.real_value,
+ attrs[j].min_val, attrs[j].max_val, 0.01, 0.01, 3,
+ 0,
+ dblspinner_changed_cb,
+ &(attrs[j].default_val.real_value), FALSE, NULL);
+ gtk_tooltips_set_tip (tips, widget, attrs[j].help_text, NULL);
+
+ goto do_enum;
break;
case HID_Path:
commit 7ef3aa04772b11db6afd14c626a6c49882c5850b
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Apply patch from Patrick Bernaud.
Modified code to not abort on HID_Mixed attributes. Th gtk HID is
modified to understand such an attribute (though the attribute dialog
has still no support for them), the lesstif HID is unchanged.
diff --git a/src/hid/common/hidinit.c b/src/hid/common/hidinit.c
index 9581d32..bb1a66b 100644
--- a/src/hid/common/hidinit.c
+++ b/src/hid/common/hidinit.c
@@ -291,6 +291,11 @@ hid_parse_command_line (int *argc, char ***argv)
if (a->value)
*(int *) a->value = a->default_val.int_value;
break;
+ case HID_Mixed:
+ if (a->value) {
+ *(HID_Attr_Val *) a->value = a->default_val;
+ }
+ break;
default:
abort ();
}
@@ -345,7 +350,6 @@ hid_parse_command_line (int *argc, char ***argv)
a->default_val.int_value = bool_val;
break;
case HID_Mixed:
- abort ();
a->default_val.real_value = strtod ((*argv)[1], &ep);
goto do_enum;
case HID_Enum:
@@ -353,7 +357,7 @@ hid_parse_command_line (int *argc, char ***argv)
do_enum:
ok = 0;
for (e = 0; a->enumerations[e]; e++)
- if (strcmp (a->enumerations[e], (*argv)[1]) == 0)
+ if (strcmp (a->enumerations[e], ep) == 0)
{
ok = 1;
a->default_val.int_value = e;
@@ -491,7 +495,14 @@ hid_save_settings (int locally)
a->enumerations[a->value ? *(int *)a->value : a->default_val.int_value]);
break;
case HID_Mixed:
- abort ();
+ {
+ HID_Attr_Val *value =
+ a->value ? (HID_Attr_Val*) a->value : &(a->default_val);
+ fprintf (f, "%s = %g%s\n",
+ a->name,
+ value->real_value,
+ a->enumerations[value->int_value]);
+ }
break;
}
}
@@ -529,7 +540,6 @@ hid_set_attribute (char *name, char *value)
a->default_val.int_value = 1;
break;
case HID_Mixed:
- abort ();
a->default_val.real_value = strtod (value, &value);
/* fall through */
case HID_Enum:
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index 490befc..c9bf82b 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -588,7 +588,6 @@ parse_optionv (gint * argc, gchar *** argv, gboolean from_cmd_line)
a->default_val.int_value = 1;
break;
case HID_Mixed:
- abort ();
a->default_val.real_value = strtod ((*argv)[1], &ep);
goto do_enum;
case HID_Enum:
@@ -596,7 +595,7 @@ parse_optionv (gint * argc, gchar *** argv, gboolean from_cmd_line)
do_enum:
ok = 0;
for (e = 0; a->enumerations[e]; e++)
- if (strcmp (a->enumerations[e], (*argv)[1]) == 0)
+ if (strcmp (a->enumerations[e], ep) == 0)
{
ok = 1;
a->default_val.int_value = e;
diff --git a/src/main.c b/src/main.c
index 5f68465..99dcba1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -309,8 +309,10 @@ print_defaults_1 (HID_Attribute * a, void *value)
fprintf (stderr, "%s %s\n", a->name, a->enumerations[i]);
break;
case HID_Mixed:
- i = value ? *(int *) value : a->default_val.int_value;
- d = value ? *(double *) value : a->default_val.real_value;
+ i = value ?
+ ((HID_Attr_Val*)value)->int_value : a->default_val.int_value;
+ d = value ?
+ ((HID_Attr_Val*)value)->real_value : a->default_val.real_value;
fprintf (stderr, "%s %g%s\n", a->name, d, a->enumerations[i]);
break;
case HID_Label:
commit a86548a6c26429e0b420602f98152d881f84cc2a
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
Applying patch from Patrick Bernaud.
HIDs with a name too long were breaking alignement in usage() as the
code requested insertion of a tab after the name even for HID names
already exceeding the length of the tabulation.
This is similar to how usage_attr() already does alignment of
name and help text.
diff --git a/src/main.c b/src/main.c
index 162a0e0..5f68465 100644
--- a/src/main.c
+++ b/src/main.c
@@ -252,17 +252,17 @@ usage (void)
u ("Available GUI hid%s:", n_gui == 1 ? "" : "s");
for (i = 0; hl[i]; i++)
if (hl[i]->gui)
- fprintf (stderr, "\t%s\t%s\n", hl[i]->name, hl[i]->description);
+ fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description);
u ("%s -p [printing options] <pcb file>\tto print", Progname);
u ("Available printing hid%s:", n_printer == 1 ? "" : "s");
for (i = 0; hl[i]; i++)
if (hl[i]->printer)
- fprintf (stderr, "\t%s\t%s\n", hl[i]->name, hl[i]->description);
+ fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description);
u ("%s -x hid [export options] <pcb file>\tto export", Progname);
u ("Available export hid%s:", n_exporter == 1 ? "" : "s");
for (i = 0; hl[i]; i++)
if (hl[i]->exporter)
- fprintf (stderr, "\t%s\t%s\n", hl[i]->name, hl[i]->description);
+ fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description);
for (i = 0; hl[i]; i++)
if (hl[i]->gui)
|
|
From: <gi...@gp...> - 2010-03-14 02:15:28
|
The branch, sdb-playpen has been updated
via 0f395de81e170934f965efe1483e24aeb2010b4d (commit)
from dad36270bfac1ac1de2a9dd73accfa040c34a4f5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/action.c | 3 ++-
src/buffer.c | 30 +++++++++++++++++++++++++++++-
src/change.c | 6 +++---
src/copy.c | 19 +++++++++++++++----
src/create.c | 4 ++--
src/draw.c | 35 +++++++++++++++++++++++++++++++++++
src/file.c | 2 +-
src/hid/gtk/gtkhid-main.c | 9 +++++++++
src/set.c | 3 +++
9 files changed, 99 insertions(+), 12 deletions(-)
=================
Commit Messages
=================
commit 0f395de81e170934f965efe1483e24aeb2010b4d
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
More DEBUG printfs and a small change to the drawing
stuff to make the imported design appear after readin.
:100644 100644 06c51c0... e385af5... M src/action.c
:100644 100644 fbd1735... f5813c5... M src/buffer.c
:100644 100644 2d0b04e... ad9be89... M src/change.c
:100644 100644 583feb8... 7e9f797... M src/copy.c
:100644 100644 eced68d... 459f1ae... M src/create.c
:100644 100644 b843da6... 9439f6e... M src/draw.c
:100644 100644 639c971... 2f6b56d... M src/file.c
:100644 100644 81f0d77... 2c9c42e... M src/hid/gtk/gtkhid-main.c
:100644 100644 912db04... 6cdd008... M src/set.c
=========
Changes
=========
commit 0f395de81e170934f965efe1483e24aeb2010b4d
Author: Stuart Brorson <sd...@cl...>
Commit: Stuart Brorson <sd...@cl...>
More DEBUG printfs and a small change to the drawing
stuff to make the imported design appear after readin.
diff --git a/src/action.c b/src/action.c
index 06c51c0..e385af5 100644
--- a/src/action.c
+++ b/src/action.c
@@ -6770,7 +6770,7 @@ ActionExecuteFile (int argc, char **argv, int x, int y)
}
defer_updates = 1;
- defer_needs_update = 0;
+ defer_needs_update = 1;
while (fgets (line, sizeof (line), fp) != NULL)
{
n++;
@@ -6969,6 +6969,7 @@ ActionElementList (int argc, char **argv, int x, int y)
#endif
/* Not on board, need to add it. */
if (LoadFootprint(argc, args, x, y))
+ /* LoadFootprint returns 0 on success, non-zero on error */
return 1;
if (CopyPastebufferToLayout (0, 0))
SetChangedFlag (True);
diff --git a/src/buffer.c b/src/buffer.c
index fbd1735..f5813c5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -789,6 +789,10 @@ LoadFootprintByName (BufferTypePtr Buffer, char *Footprint)
LibraryEntryType *entry;
char *with_fp = NULL;
+#ifdef DEBUG
+ printf(" ---> Entered LoadFootprintByName\n");
+#endif
+
if (!footprint_hash)
make_footprint_hash ();
@@ -814,6 +818,11 @@ LoadFootprintByName (BufferTypePtr Buffer, char *Footprint)
i = LoadElementToBuffer (Buffer, entry->AllocatedMemory, True);
if (with_fp)
free (with_fp);
+#ifdef DEBUG
+ printf(" <--- Leaving LoadFootprintByName, loaded a newlib footprint to buffer\n");
+#endif
+ /* Must invert sense of return from LoadElementToBuffer.
+ * Return is 0 for success. */
return i ? 0 : 1;
}
else
@@ -827,6 +836,11 @@ LoadFootprintByName (BufferTypePtr Buffer, char *Footprint)
free (args);
if (with_fp)
free (with_fp);
+#ifdef DEBUG
+ printf(" <--- Leaving LoadFootprintByName, loaded an M4 footprint to buffer\n");
+#endif
+ /* Must invert sense of return from LoadElementToBuffer.
+ * Return is 0 for success. */
return i ? 0 : 1;
}
@@ -883,37 +897,51 @@ LoadFootprint (int argc, char **argv, int x, int y)
char *value = ARG(2);
ElementTypePtr e;
+#ifdef DEBUG
+ printf(" ---> Entering LoadFootprint, trying to load %s\n", name);
+#endif
+
if (!name)
AFAIL (loadfootprint);
if (LoadFootprintByName (PASTEBUFFER, name))
- return 1;
+ /* Return 1 if error */
+ return 1;
if (PASTEBUFFER->Data->ElementN == 0)
{
Message("Footprint %s contains no elements", name);
+ /* Return 1 if error */
return 1;
}
if (PASTEBUFFER->Data->ElementN > 1)
{
Message("Footprint %s contains multiple elements", name);
+ /* Return 1 if error */
return 1;
}
e = & PASTEBUFFER->Data->Element[0];
+ /* Name[0] = description */
if (e->Name[0].TextString)
free (e->Name[0].TextString);
e->Name[0].TextString = strdup (name);
+ /* Name[0] = name (i.e. refdes) */
if (e->Name[1].TextString)
free (e->Name[1].TextString);
e->Name[1].TextString = refdes ? strdup (refdes) : 0;
+ /* Name[0] = value */
if (e->Name[2].TextString)
free (e->Name[2].TextString);
e->Name[2].TextString = value ? strdup (value) : 0;
+#ifdef DEBUG
+ printf(" <--- Leaving LoadFootprint, successfully loaded footprint\n");
+#endif
+
return 0;
}
diff --git a/src/change.c b/src/change.c
index 2d0b04e..ad9be89 100644
--- a/src/change.c
+++ b/src/change.c
@@ -989,14 +989,14 @@ ChangeElementText (PCBType *pcb, DataType *data, ElementTypePtr Element, int whi
char *old = Element->Name[which].TextString;
#ifdef DEBUG
- printf("In ChangeElementText, updating old TextString %s to %s\n", old, new_name);
+/* printf("In ChangeElementText, updating old TextString %s to %s\n", old, new_name); */
#endif
if (pcb && which == NAME_INDEX (pcb))
EraseElementName (Element);
#ifdef DEBUG
- printf(" ... now delete entry %s\n", Element->Name[which].TextString);
+/* printf(" ... now delete entry %s\n", Element->Name[which].TextString); */
#endif
r_delete_entry (data->name_tree[which],
& Element->Name[which].BoundingBox);
@@ -1005,7 +1005,7 @@ ChangeElementText (PCBType *pcb, DataType *data, ElementTypePtr Element, int whi
SetTextBoundingBox (&PCB->Font, &Element->Name[which]);
#ifdef DEBUG
- printf(" ... now insert entry %s\n", Element->Name[which].TextString);
+/* printf(" ... now insert entry %s\n", Element->Name[which].TextString); */
#endif
r_insert_entry (data->name_tree[which],
& Element->Name[which].BoundingBox, 0);
diff --git a/src/copy.c b/src/copy.c
index 583feb8..7e9f797 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -284,8 +284,8 @@ CopyElement (ElementTypePtr Element)
{
#ifdef DEBUG
- printf("Entered CopyElement, trying to copy element %s\n",
- Element->Name[1].TextString);
+/* printf("Entered CopyElement, trying to copy element %s\n",
+ Element->Name[1].TextString); */
#endif
Boolean didDraw = False;
@@ -309,7 +309,7 @@ CopyElement (ElementTypePtr Element)
didDraw = True;
}
#ifdef DEBUG
- printf(" ... Leaving CopyElement.\n");
+/* printf(" ... Leaving CopyElement.\n"); */
#endif
return (element);
}
@@ -326,6 +326,7 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
#ifdef DEBUG
printf("Entering CopyPastebufferToLayout.....\n");
+ printf(" BufferNumber = %d\n", Settings.BufferNumber);
#endif
/* set movement vector */
@@ -339,6 +340,9 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
if (destlayer->On)
{
+#ifdef DEBUG
+ printf(" .... In CopyPastebufferToLayout, Copying layers ...\n");
+#endif
changed = changed ||
(sourcelayer->LineN != 0) ||
(sourcelayer->ArcN != 0) ||
@@ -369,10 +373,13 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
/* paste elements */
if (PCB->PinOn && PCB->ElementOn)
{
+#ifdef DEBUG
+ printf(" .... In CopyPastebufferToLayout, Copying elements ...\n");
+#endif
ELEMENT_LOOP (PASTEBUFFER->Data);
{
#ifdef DEBUG
- printf("In CopyPastebufferToLayout, pasting element %s\n",
+ printf(" .... In CopyPastebufferToLayout, pasting element %s ...\n",
element->Name[1].TextString);
#endif
if (FRONT (element) || PCB->InvisibleObjectsOn)
@@ -387,6 +394,9 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
/* finally the vias */
if (PCB->ViaOn)
{
+#ifdef DEBUG
+ printf(" .... In CopyPastebufferToLayout, Copying vias ...\n");
+#endif
changed |= (PASTEBUFFER->Data->ViaN != 0);
VIA_LOOP (PASTEBUFFER->Data);
{
@@ -398,6 +408,7 @@ CopyPastebufferToLayout (LocationType X, LocationType Y)
if (changed)
{
Draw ();
+ gui->invalidate_all() ;
IncrementUndoSerialNumber ();
}
diff --git a/src/create.c b/src/create.c
index eced68d..459f1ae 100644
--- a/src/create.c
+++ b/src/create.c
@@ -647,7 +647,7 @@ CreateNewElement (DataTypePtr Data, ElementTypePtr Element,
int TextScale, FlagType TextFlags, Boolean uniqueName)
{
#ifdef DEBUG
- printf("Entered CreateNewElement.....\n");
+ printf("---> Entered CreateNewElement.....\n");
#endif
if (!Element)
@@ -670,7 +670,7 @@ CreateNewElement (DataTypePtr Data, ElementTypePtr Element,
Element->ID = ID++;
#ifdef DEBUG
- printf(" .... Leaving CreateNewElement.\n");
+ printf("<--- .... Leaving CreateNewElement.\n");
#endif
return (Element);
diff --git a/src/draw.c b/src/draw.c
index b843da6..9439f6e 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -386,6 +386,10 @@ DrawEverything (BoxTypePtr drawn_area)
/* This is the reverse of the order in which we draw them. */
int drawn_groups[MAX_LAYER];
+#ifdef DEBUG
+ printf(" -----> Entered DrawEverything\n");
+#endif
+
PCB->Data->SILKLAYER.Color = PCB->ElementColor;
PCB->Data->BACKSILKLAYER.Color = PCB->InvisibleObjectsColor;
@@ -566,6 +570,11 @@ DrawEverything (BoxTypePtr drawn_area)
if (gui->set_layer ("fab", SL (FAB, 0), 0))
PrintFab ();
+
+#ifdef DEBUG
+ printf(" <----- Leaving DrawEverything\n");
+#endif
+
}
static void
@@ -1504,6 +1513,9 @@ ClearPad (PadTypePtr Pad, Boolean mask)
static void
DrawLineLowLevel (LineTypePtr Line, Boolean HaveGathered)
{
+#ifdef DEBUG
+ printf(" --> Entered DrawLineLowLevel, Gathering = %d\n", Gathering);
+#endif
if (Gathering && !HaveGathered)
{
AddPart (Line);
@@ -1519,6 +1531,10 @@ DrawLineLowLevel (LineTypePtr Line, Boolean HaveGathered)
gui->draw_line (Output.fgGC,
Line->Point1.X, Line->Point1.Y,
Line->Point2.X, Line->Point2.Y);
+#ifdef DEBUG
+ printf(" <-- Leaving DrawLineLowLevel\n");
+#endif
+
}
/* ---------------------------------------------------------------------------
@@ -1658,6 +1674,9 @@ DrawArcLowLevel (ArcTypePtr Arc)
static void
DrawElementPackageLowLevel (ElementTypePtr Element, int unused)
{
+#ifdef DEBUG
+ printf(" ---> Entered DrawElementPackageLowLevel\n");
+#endif
/* draw lines, arcs, text and pins */
ELEMENTLINE_LOOP (Element);
{
@@ -1669,6 +1688,9 @@ DrawElementPackageLowLevel (ElementTypePtr Element, int unused)
DrawArcLowLevel (arc);
}
END_LOOP;
+#ifdef DEBUG
+ printf(" <--- Leaving DrawElementPackageLowLevel\n");
+#endif
}
/* ---------------------------------------------------------------------------
@@ -2028,9 +2050,15 @@ DrawPlainPolygon (LayerTypePtr Layer, PolygonTypePtr Polygon)
void
DrawElement (ElementTypePtr Element, int unused)
{
+#ifdef DEBUG
+ printf(" ---> Entered DrawElement\n");
+#endif
DrawElementPackage (Element, unused);
DrawElementName (Element, unused);
DrawElementPinsAndPads (Element, unused);
+#ifdef DEBUG
+ printf(" <--- Leaving DrawElement\n");
+#endif
}
/* ---------------------------------------------------------------------------
@@ -2410,6 +2438,9 @@ DrawObject (int type, void *ptr1, void *ptr2, int unused)
void
hid_expose_callback (HID * hid, BoxType * region, void *item)
{
+#ifdef DEBUG
+ printf(" ---> Entered hid_expose_callback\n");
+#endif
HID *old_gui = gui;
hidGC savebg = Output.bgGC;
hidGC savefg = Output.fgGC;
@@ -2446,4 +2477,8 @@ hid_expose_callback (HID * hid, BoxType * region, void *item)
Output.pmGC = savepm;
Gathering = True;
+#ifdef DEBUG
+ printf(" <--- Leaving hid_expose_callback\n");
+#endif
+
}
diff --git a/src/file.c b/src/file.c
index 639c971..2f6b56d 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1275,7 +1275,7 @@ ParseLibraryTree (void)
while ((direntry = readdir (dirobj)) != NULL)
{
#ifdef DEBUG
- printf("In ParseLibraryTree loop examining 2nd level direntry %s ... \n", direntry->d_name);
+ printf("In ParseLibraryTree loop examining 2nd level direntry %s ... \n", direntry->d_name);
#endif
/* Find subdirectories. Ignore entries beginning with "." and CVS
* directories.
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 81f0d77..2c9c42e 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -336,6 +336,10 @@ ghid_invalidate_all ()
int eleft, eright, etop, ebottom;
BoxType region;
+#ifdef DEBUG
+ printf("==> Entered ghid_invalidate_all\n");
+#endif
+
if (!gport->pixmap)
return;
@@ -394,6 +398,11 @@ ghid_invalidate_all ()
RestoreCrosshair (FALSE);
ghidgui->need_restore_crosshair = FALSE;
ghid_screen_update ();
+
+#ifdef DEBUG
+ printf("<== Leaving ghid_invalidate_all\n");
+#endif
+
}
diff --git a/src/set.c b/src/set.c
index 912db04..6cdd008 100644
--- a/src/set.c
+++ b/src/set.c
@@ -200,6 +200,9 @@ SetBufferNumber (int Number)
{
if (Number >= 0 && Number < MAX_BUFFER)
{
+#ifdef DEBUG
+ printf("SetBufferNumber, setting buf to %d\n"< Number);
+#endif
Settings.BufferNumber = Number;
/* do an update on the crosshair range */
|
|
From: <gi...@gp...> - 2010-03-13 14:11:11
|
The branch, master has been updated
via 128ac62fe7270950eafb1c59c408bae974972e8d (commit)
via b75d1fe8d42c138ae499898db5b926948b73f767 (commit)
from 5a22f98ca0d0c064d4d40af7785c81d434ce92ec (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 | 27 ---------------------------
1 files changed, 0 insertions(+), 27 deletions(-)
=================
Commit Messages
=================
commit b75d1fe8d42c138ae499898db5b926948b73f767
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Remove an out of date comment about mouse resources not being
understood. Also remove an old and unused popup section that
had been used for testing.
:100644 100644 11251b2... 17a0fbf... M src/gpcb-menu.res
=========
Changes
=========
commit b75d1fe8d42c138ae499898db5b926948b73f767
Author: Dan McMahill <da...@mc...>
Commit: Dan McMahill <da...@mc...>
Remove an out of date comment about mouse resources not being
understood. Also remove an old and unused popup section that
had been used for testing.
diff --git a/src/gpcb-menu.res b/src/gpcb-menu.res
index 11251b2..17a0fbf 100644
--- a/src/gpcb-menu.res
+++ b/src/gpcb-menu.res
@@ -2,12 +2,6 @@
# Note - gpcb-menu.res is used to build gpcb-menu.h
# Note - parameters are sensitive to extra spaces around the commas
-#
-# NOTE: I have not figured out what to do with this
-# section yet. The Mouse section is currently ignored until
-# I figure out how to handle it.
-#
-
Mouse =
{
Left = {
@@ -528,26 +522,5 @@ PopupMenus =
{"Cancel" Mode(Escape) a={"Esc" "<Key>Escape"}}
}
}
-
-#
-# A dummy popup menu to help test out the parser and also
-# it will be used to help test the Popup() action when
-# I get around to writing it.
-#
- Popup2 =
- {
- {"Submenu1"
- {"Choice1a"}
- {"Choice1b"}
- {"Choice1c"}
- {"Choice1d"}
- }
- {"Submenu2"
- {"Choice2a"}
- {"Choice2b"}
- }
- {"Choice1"}
- {"Choice2"}
- }
}
|
|
From: <gi...@gp...> - 2010-03-12 01:21:28
|
The branch, master has been updated
via 5a22f98ca0d0c064d4d40af7785c81d434ce92ec (commit)
from 897640d7b920b4d593d2b0a6644a061698610b69 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gcode/gcode.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 5a22f98ca0d0c064d4d40af7785c81d434ce92ec
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove invalidate_wh from the new gcode HID too.
:100644 100644 bbc1d53... c3c2e4e... M src/hid/gcode/gcode.c
=========
Changes
=========
commit 5a22f98ca0d0c064d4d40af7785c81d434ce92ec
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove invalidate_wh from the new gcode HID too.
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index bbc1d53..c3c2e4e 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -1040,7 +1040,6 @@ HID gcode_hid = {
gcode_get_export_options,
gcode_do_export,
gcode_parse_arguments,
- 0 /* gcode_invalidate_wh */ ,
0 /* gcode_invalidate_lr */ ,
0 /* gcode_invalidate_all */ ,
gcode_set_layer,
|
|
From: <gi...@gp...> - 2010-03-12 01:19:22
|
The branch, master has been updated
via 897640d7b920b4d593d2b0a6644a061698610b69 (commit)
from af5b9b3a96e9f42089ecfbe878807b68044dbdfd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/global.h | 1 -
src/main.c | 46 ++++++++++++++++++----------------------------
src/misc.c | 11 +----------
3 files changed, 19 insertions(+), 39 deletions(-)
=================
Commit Messages
=================
commit 897640d7b920b4d593d2b0a6644a061698610b69
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove Settings.init_done variable and its usage
This variable was previously used to allow action scripts run prior to
loading the GUI to avoid GUI startup if they executed a "Quit" action.
The requirement dates back prior to the HID split, where the "Quit"
action would cause PCB to call gtk_main_quit(), an operation which is
illegal if the GUI main loop was not yet started. The init_done flag
was used in QuitApplication(), both to determine whether the GUI had
started, and if not - to note that the GUI should not be initialised
later. (Instead of calling gtk_main_quit()).
With the HID split, the QuitApplication() function was changed to call
exit(0) rather than gtk_main_quit(), so this dance isn't necessary at
all now.. in either case, we can just exit the application immediately.
:100644 100644 19f4454... 80bea72... M src/global.h
:100644 100644 bb79991... 162a0e0... M src/main.c
:100644 100644 b675090... cca9e1b... M src/misc.c
=========
Changes
=========
commit 897640d7b920b4d593d2b0a6644a061698610b69
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove Settings.init_done variable and its usage
This variable was previously used to allow action scripts run prior to
loading the GUI to avoid GUI startup if they executed a "Quit" action.
The requirement dates back prior to the HID split, where the "Quit"
action would cause PCB to call gtk_main_quit(), an operation which is
illegal if the GUI main loop was not yet started. The init_done flag
was used in QuitApplication(), both to determine whether the GUI had
started, and if not - to note that the GUI should not be initialised
later. (Instead of calling gtk_main_quit()).
With the HID split, the QuitApplication() function was changed to call
exit(0) rather than gtk_main_quit(), so this dance isn't necessary at
all now.. in either case, we can just exit the application immediately.
diff --git a/src/global.h b/src/global.h
index 19f4454..80bea72 100644
--- a/src/global.h
+++ b/src/global.h
@@ -668,7 +668,6 @@ typedef struct /* some resources... */
/* connections is done */
AutoPlace; /* flag which says we should force placement of the
windows on startup */
- int init_done;
}
SettingType, *SettingTypePtr;
diff --git a/src/main.c b/src/main.c
index bb79991..162a0e0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1021,12 +1021,6 @@ main (int argc, char *argv[])
#ifdef HAVE_LIBSTROKE
stroke_init ();
#endif
- /*
- * Set this flag to zero. Then if we have a startup
- * action which includes Quit(), the flag will be set
- * to -1 and we can avoid ever calling gtk_main();
- */
- Settings.init_done = 0;
if (Settings.ScriptFilename)
{
@@ -1040,37 +1034,33 @@ main (int argc, char *argv[])
hid_parse_actions (Settings.ActionString, 0);
}
- if (Settings.init_done == 0)
- {
- Settings.init_done = 1;
#if HAVE_DBUS
- pcb_dbus_setup();
+ pcb_dbus_setup();
#endif
- EnableAutosave ();
+ EnableAutosave ();
#ifdef DEBUG
- printf ("Settings.LibraryCommandDir = \"%s\"\n",
- Settings.LibraryCommandDir);
- printf ("Settings.FontPath = \"%s\"\n",
- Settings.FontPath);
- printf ("Settings.ElementPath = \"%s\"\n",
- Settings.ElementPath);
- printf ("Settings.LibraryPath = \"%s\"\n",
- Settings.LibraryPath);
- printf ("Settings.LibraryTree = \"%s\"\n",
- Settings.LibraryTree);
- printf ("Settings.MakeProgram = \"%s\"\n",
- UNKNOWN (Settings.MakeProgram));
- printf ("Settings.GnetlistProgram = \"%s\"\n",
- UNKNOWN (Settings.GnetlistProgram));
+ printf ("Settings.LibraryCommandDir = \"%s\"\n",
+ Settings.LibraryCommandDir);
+ printf ("Settings.FontPath = \"%s\"\n",
+ Settings.FontPath);
+ printf ("Settings.ElementPath = \"%s\"\n",
+ Settings.ElementPath);
+ printf ("Settings.LibraryPath = \"%s\"\n",
+ Settings.LibraryPath);
+ printf ("Settings.LibraryTree = \"%s\"\n",
+ Settings.LibraryTree);
+ printf ("Settings.MakeProgram = \"%s\"\n",
+ UNKNOWN (Settings.MakeProgram));
+ printf ("Settings.GnetlistProgram = \"%s\"\n",
+ UNKNOWN (Settings.GnetlistProgram));
#endif
- gui->do_export (0);
+ gui->do_export (0);
#if HAVE_DBUS
- pcb_dbus_finish();
+ pcb_dbus_finish();
#endif
- }
return (0);
}
diff --git a/src/misc.c b/src/misc.c
index b675090..cca9e1b 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -879,16 +879,7 @@ QuitApplication (void)
else
DisableEmergencySave ();
- /*
- * if Settings.init_done is not > 0 then we haven't even called
- * gtk_main() yet so gtk_main_quit() will give an error. In
- * this case just set the flag to -1 and we will exit instead
- * of calling gtk_main()
- */
- if (Settings.init_done > 0)
- exit (0);
- else
- Settings.init_done = -1;
+ exit (0);
}
/* ---------------------------------------------------------------------------
|
|
From: <gi...@gp...> - 2010-03-11 23:55:14
|
The branch, master has been updated
via af5b9b3a96e9f42089ecfbe878807b68044dbdfd (commit)
from 3352f8b5a2cf99d55f360d9c319e32a3ca092553 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/global.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit af5b9b3a96e9f42089ecfbe878807b68044dbdfd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove unused HistorySize field from the settings structure
:100644 100644 3794448... 19f4454... M src/global.h
=========
Changes
=========
commit af5b9b3a96e9f42089ecfbe878807b68044dbdfd
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove unused HistorySize field from the settings structure
diff --git a/src/global.h b/src/global.h
index 3794448..19f4454 100644
--- a/src/global.h
+++ b/src/global.h
@@ -668,8 +668,7 @@ typedef struct /* some resources... */
/* connections is done */
AutoPlace; /* flag which says we should force placement of the
windows on startup */
- int HistorySize, /* FIXME? Used in hid/xaw code only. */
- init_done;
+ int init_done;
}
SettingType, *SettingTypePtr;
|
|
From: <gi...@gp...> - 2010-03-11 23:51:46
|
The branch, master has been updated
via 3352f8b5a2cf99d55f360d9c319e32a3ca092553 (commit)
from 832f7928fd3828c4d0588fc73fd9db8858e3d968 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 2 +-
src/hid.h | 3 +--
src/hid/batch/batch.c | 2 +-
src/hid/common/hidnogui.c | 2 +-
src/hid/gtk/gtkhid-main.c | 2 +-
src/hid/lesstif/main.c | 6 +++---
6 files changed, 8 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit 3352f8b5a2cf99d55f360d9c319e32a3ca092553
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove unused "last" parameter from HID "invalidate_lr" method
:100644 100644 b843da6... 9571b29... M src/draw.c
:100644 100644 0e0c479... 7409bbf... M src/hid.h
:100644 100644 1baa2d8... f26321d... M src/hid/batch/batch.c
:100644 100644 3e5e9db... d5dc9e1... M src/hid/common/hidnogui.c
:100644 100644 330e716... b8fdc75... M src/hid/gtk/gtkhid-main.c
:100644 100644 2fec418... 51c52fe... M src/hid/lesstif/main.c
=========
Changes
=========
commit 3352f8b5a2cf99d55f360d9c319e32a3ca092553
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove unused "last" parameter from HID "invalidate_lr" method
diff --git a/src/draw.c b/src/draw.c
index b843da6..9571b29 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -194,7 +194,7 @@ Draw (void)
/* clear and create event if not drawing to a pixmap
*/
- gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2, 1);
+ gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
RestoreCrosshair (True);
diff --git a/src/hid.h b/src/hid.h
index 0e0c479..7409bbf 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -304,8 +304,7 @@ typedef enum
void (*parse_arguments) (int *argc_, char ***argv_);
/* This may be called to ask the GUI to force a redraw of a given area */
- void (*invalidate_lr) (int left_, int right_, int top_, int bottom_,
- int last_);
+ void (*invalidate_lr) (int left_, int right_, int top_, int bottom_);
void (*invalidate_all) (void);
/* During redraw or print/export cycles, this is called once per
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index 1baa2d8..f26321d 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -191,7 +191,7 @@ batch_parse_arguments (int *argc, char ***argv)
}
static void
-batch_invalidate_lr (int l, int r, int t, int b, int last)
+batch_invalidate_lr (int l, int r, int t, int b)
{
}
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index 3e5e9db..d5dc9e1 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -50,7 +50,7 @@ nogui_parse_arguments (int *argc, char ***argv)
}
static void
-nogui_invalidate_lr (int l, int r, int t, int b, int last)
+nogui_invalidate_lr (int l, int r, int t, int b)
{
CRASH;
}
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 330e716..b8fdc75 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -318,7 +318,7 @@ ghid_get_export_options (int *n_ret)
}
void
-ghid_invalidate_lr (int left, int right, int top, int bottom, int last)
+ghid_invalidate_lr (int left, int right, int top, int bottom)
{
ghid_invalidate_all ();
}
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 2fec418..51c52fe 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -2828,9 +2828,9 @@ lesstif_need_idle_proc ()
}
static void
-lesstif_invalidate_lr (int l, int r, int t, int b, int last)
+lesstif_invalidate_lr (int l, int r, int t, int b)
{
- if (!last || !window)
+ if (!window)
return;
need_redraw = 1;
@@ -2840,7 +2840,7 @@ lesstif_invalidate_lr (int l, int r, int t, int b, int last)
void
lesstif_invalidate_all (void)
{
- lesstif_invalidate_lr (0, PCB->MaxWidth, 0, PCB->MaxHeight, 1);
+ lesstif_invalidate_lr (0, PCB->MaxWidth, 0, PCB->MaxHeight);
}
static int
|
|
From: <gi...@gp...> - 2010-03-11 23:51:22
|
The branch, master has been updated
via 832f7928fd3828c4d0588fc73fd9db8858e3d968 (commit)
from be80f0c5771c91dc2795f5832af8fb2013cb3992 (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.h | 7 +------
src/hid/batch/batch.c | 6 ------
src/hid/bom/bom.c | 1 -
src/hid/common/extents.c | 2 --
src/hid/common/hidnogui.c | 8 --------
src/hid/gerber/gerber.c | 1 -
src/hid/gtk/gtkhid-main.c | 9 ---------
src/hid/lesstif/main.c | 12 ++----------
src/hid/lpr/lpr.c | 1 -
src/hid/nelma/nelma.c | 1 -
src/hid/png/png.c | 1 -
src/hid/ps/eps.c | 1 -
src/hid/ps/ps.c | 1 -
13 files changed, 3 insertions(+), 48 deletions(-)
=================
Commit Messages
=================
commit 832f7928fd3828c4d0588fc73fd9db8858e3d968
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove unused HID method invalidate_wh()
invalidate_lr and invalidate_all are sufficient APIs for our needs.
:100644 100644 3c23338... 0e0c479... M src/hid.h
:100644 100644 c10b280... 1baa2d8... M src/hid/batch/batch.c
:100644 100644 e593bdd... 04ad123... M src/hid/bom/bom.c
:100644 100644 bf53c14... a0dbf6b... M src/hid/common/extents.c
:100644 100644 51c95cb... 3e5e9db... M src/hid/common/hidnogui.c
:100644 100644 afa6a08... dee7d06... M src/hid/gerber/gerber.c
:100644 100644 81f0d77... 330e716... M src/hid/gtk/gtkhid-main.c
:100644 100644 84e095a... 2fec418... M src/hid/lesstif/main.c
:100644 100644 e47c40f... aa696be... M src/hid/lpr/lpr.c
:100644 100644 dc1cee5... 8e5ff0c... M src/hid/nelma/nelma.c
:100644 100644 2e8e40c... 404eb53... M src/hid/png/png.c
:100644 100644 b0e7a7d... 0c9345b... M src/hid/ps/eps.c
:100644 100644 f21ce84... 810ceba... M src/hid/ps/ps.c
=========
Changes
=========
commit 832f7928fd3828c4d0588fc73fd9db8858e3d968
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove unused HID method invalidate_wh()
invalidate_lr and invalidate_all are sufficient APIs for our needs.
diff --git a/src/hid.h b/src/hid.h
index 3c23338..0e0c479 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -303,12 +303,7 @@ typedef enum
names behind. */
void (*parse_arguments) (int *argc_, char ***argv_);
- /* This may be called outside of redraw to force a redraw. Pass
- zero for "last" for all but the last call before control returns
- to the user (pass nonzero the last time). If determining the
- last call is difficult, call *_wh at the end with width and
- height zero. */
- void (*invalidate_wh) (int x_, int y_, int width_, int height_, int last_);
+ /* This may be called to ask the GUI to force a redraw of a given area */
void (*invalidate_lr) (int left_, int right_, int top_, int bottom_,
int last_);
void (*invalidate_all) (void);
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index c10b280..1baa2d8 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -191,11 +191,6 @@ batch_parse_arguments (int *argc, char ***argv)
}
static void
-batch_invalidate_wh (int x, int y, int width, int height, int last)
-{
-}
-
-static void
batch_invalidate_lr (int l, int r, int t, int b, int last)
{
}
@@ -471,7 +466,6 @@ HID batch_gui = {
batch_get_export_options,
batch_do_export,
batch_parse_arguments,
- batch_invalidate_wh,
batch_invalidate_lr,
batch_invalidate_all,
batch_set_layer,
diff --git a/src/hid/bom/bom.c b/src/hid/bom/bom.c
index e593bdd..04ad123 100644
--- a/src/hid/bom/bom.c
+++ b/src/hid/bom/bom.c
@@ -544,7 +544,6 @@ HID bom_hid = {
bom_get_export_options,
bom_do_export,
bom_parse_arguments,
- 0, /* bom_invalidate_wh */
0, /* bom_invalidate_lr */
0, /* bom_invalidate_all */
0, /* bom_set_layer */
diff --git a/src/hid/common/extents.c b/src/hid/common/extents.c
index bf53c14..a0dbf6b 100644
--- a/src/hid/common/extents.c
+++ b/src/hid/common/extents.c
@@ -184,8 +184,6 @@ static HID extents_hid = {
0 /* extents_get_export_options */ ,
0 /* extents_do_export */ ,
0 /* extents_parse_arguments */ ,
-
- 0 /* extents_invalidate_wh */ ,
0 /* extents_invalidate_lr */ ,
0 /* extents_invalidate_all */ ,
extents_set_layer,
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index 51c95cb..3e5e9db 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -50,12 +50,6 @@ nogui_parse_arguments (int *argc, char ***argv)
}
static void
-nogui_invalidate_wh (int x, int y, int width, int height, int last)
-{
- CRASH;
-}
-
-static void
nogui_invalidate_lr (int l, int r, int t, int b, int last)
{
CRASH;
@@ -359,7 +353,6 @@ HID hid_nogui = {
nogui_get_export_options,
nogui_do_export,
nogui_parse_arguments,
- nogui_invalidate_wh,
nogui_invalidate_lr,
nogui_invalidate_all,
nogui_set_layer,
@@ -417,7 +410,6 @@ apply_default_hid (HID * d, HID * s)
AD (get_export_options);
AD (do_export);
AD (parse_arguments);
- AD (invalidate_wh);
AD (invalidate_lr);
AD (invalidate_all);
AD (set_layer);
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index afa6a08..dee7d06 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -1079,7 +1079,6 @@ static HID gerber_hid = {
gerber_get_export_options,
gerber_do_export,
gerber_parse_arguments,
- 0 /* gerber_invalidate_wh */ ,
0 /* gerber_invalidate_lr */ ,
0 /* gerber_invalidate_all */ ,
gerber_set_layer,
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 81f0d77..330e716 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -317,13 +317,6 @@ ghid_get_export_options (int *n_ret)
return NULL;
}
-
-void
-ghid_invalidate_wh (int x, int y, int width, int height, int last)
-{
- ghid_invalidate_all ();
-}
-
void
ghid_invalidate_lr (int left, int right, int top, int bottom, int last)
{
@@ -1128,8 +1121,6 @@ HID ghid_hid = {
ghid_get_export_options,
ghid_do_export,
ghid_parse_arguments,
-
- ghid_invalidate_wh,
ghid_invalidate_lr,
ghid_invalidate_all,
ghid_set_layer,
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 84e095a..2fec418 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -2828,7 +2828,7 @@ lesstif_need_idle_proc ()
}
static void
-lesstif_invalidate_wh (int x, int y, int width, int height, int last)
+lesstif_invalidate_lr (int l, int r, int t, int b, int last)
{
if (!last || !window)
return;
@@ -2837,16 +2837,10 @@ lesstif_invalidate_wh (int x, int y, int width, int height, int last)
need_idle_proc ();
}
-static void
-lesstif_invalidate_lr (int l, int r, int t, int b, int last)
-{
- lesstif_invalidate_wh (l, t, r - l + 1, b - t + 1, last);
-}
-
void
lesstif_invalidate_all (void)
{
- lesstif_invalidate_wh (0, 0, PCB->MaxWidth, PCB->MaxHeight, 1);
+ lesstif_invalidate_lr (0, PCB->MaxWidth, 0, PCB->MaxHeight, 1);
}
static int
@@ -3772,8 +3766,6 @@ HID lesstif_gui = {
lesstif_get_export_options,
lesstif_do_export,
lesstif_parse_arguments,
-
- lesstif_invalidate_wh,
lesstif_invalidate_lr,
lesstif_invalidate_all,
lesstif_set_layer,
diff --git a/src/hid/lpr/lpr.c b/src/hid/lpr/lpr.c
index e47c40f..aa696be 100644
--- a/src/hid/lpr/lpr.c
+++ b/src/hid/lpr/lpr.c
@@ -121,7 +121,6 @@ HID lpr_hid = {
lpr_get_export_options,
lpr_do_export,
lpr_parse_arguments,
- 0 /* lpr_invalidate_wh */ ,
0 /* lpr_invalidate_lr */ ,
0 /* lpr_invalidate_all */ ,
0 /* lpr_set_layer */ ,
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index dc1cee5..8e5ff0c 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -1056,7 +1056,6 @@ HID nelma_hid = {
nelma_get_export_options,
nelma_do_export,
nelma_parse_arguments,
- 0 /* nelma_invalidate_wh */ ,
0 /* nelma_invalidate_lr */ ,
0 /* nelma_invalidate_all */ ,
nelma_set_layer,
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 2e8e40c..404eb53 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -1475,7 +1475,6 @@ HID png_hid = {
png_get_export_options,
png_do_export,
png_parse_arguments,
- 0 /* png_invalidate_wh */ ,
0 /* png_invalidate_lr */ ,
0 /* png_invalidate_all */ ,
png_set_layer,
diff --git a/src/hid/ps/eps.c b/src/hid/ps/eps.c
index b0e7a7d..0c9345b 100644
--- a/src/hid/ps/eps.c
+++ b/src/hid/ps/eps.c
@@ -619,7 +619,6 @@ static HID eps_hid = {
eps_get_export_options,
eps_do_export,
eps_parse_arguments,
- 0 /* eps_invalidate_wh */ ,
0 /* eps_invalidate_lr */ ,
0 /* eps_invalidate_all */ ,
eps_set_layer,
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index f21ce84..810ceba 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -1337,7 +1337,6 @@ HID ps_hid = {
ps_get_export_options,
ps_do_export,
ps_parse_arguments,
- 0 /* ps_invalidate_wh */ ,
0 /* ps_invalidate_lr */ ,
0 /* ps_invalidate_all */ ,
ps_set_layer,
|