[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb flip-sides



On 10/28/09, Kai-Martin Knaak <kmk@xxxxxxxxxxxxxxx> wrote:
> Unfortunately, the V parameter does not change anything. This is how I
> try to extract a print of the bottom view of the layout:
>
> pcb -x eps \
>   --action-string 'SwapSides(V)' \
>   --as-shown  \
>   --layer-stack "comment, outline, elements, bottom" \
>   --eps-file "/tmp/out.eps" \
>   $PCBFILE

On my machines, it segfaults because the SwapSides actions,
both the GTK and the Lesstif one, are written to use
with the GUI initialised, and this is not correct in your case:

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index cbdd104..893e36b 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2013,6 +2013,8 @@ SwapSides (int argc, char **argv, int x, int y)
 				 1);
 	}
     }
+  if (!ghidgui)
+    return 0;

   /* Update coordinates so that the current location stays where it was on the
      other side; we need to do this since the actual flip center is the
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 370d816..0ac98c1 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -573,21 +573,22 @@ SwapSides (int argc, char **argv, int x, int y)
       /* SwapSides will swap this */
       Settings.ShowSolderSide = (flip_x == flip_y);
     }
+  if (gui->gui)
+    {
+      n = 0;
+      if (flip_x)
+	stdarg (XmNprocessingDirection, XmMAX_ON_LEFT);
+      else
+	stdarg (XmNprocessingDirection, XmMAX_ON_RIGHT);
+      XtSetValues (hscroll, args, n);

-  n = 0;
-  if (flip_x)
-    stdarg (XmNprocessingDirection, XmMAX_ON_LEFT);
-  else
-    stdarg (XmNprocessingDirection, XmMAX_ON_RIGHT);
-  XtSetValues (hscroll, args, n);
-
-  n = 0;
-  if (flip_y)
-    stdarg (XmNprocessingDirection, XmMAX_ON_TOP);
-  else
-    stdarg (XmNprocessingDirection, XmMAX_ON_BOTTOM);
-  XtSetValues (vscroll, args, n);
-
+      n = 0;
+      if (flip_y)
+	stdarg (XmNprocessingDirection, XmMAX_ON_TOP);
+      else
+	stdarg (XmNprocessingDirection, XmMAX_ON_BOTTOM);
+      XtSetValues (vscroll, args, n);
+    }
   Settings.ShowSolderSide = !Settings.ShowSolderSide;

   /* The idea is that if we're looking at the front side and the front
@@ -620,7 +621,8 @@ SwapSides (int argc, char **argv, int x, int y)
 	    }
 	}
     }
-  lesstif_invalidate_all ();
+  if (gui->gui)
+    lesstif_invalidate_all ();
   return 0;
 }

This is just another quick workaround (the first I suggested was to
add a gui-ignorant SwapSides version).

Cheers,


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user