[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: sdb-playpen updated (0f395de81e170934f965efe1483e24aeb2010b4d)
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 <sdb@xxxxxxxxxx>
Commit: Stuart Brorson <sdb@xxxxxxxxxx>
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 <sdb@xxxxxxxxxx>
Commit: Stuart Brorson <sdb@xxxxxxxxxx>
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 */
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs