gEDA-dev: [pcb] multiple hids in one .so
Igor2
igor2 at inno.bme.hu
Thu Oct 5 14:00:20 EDT 2006
On Thu, 5 Oct 2006, DJ Delorie wrote:
>
>So far so good, but could you also patch src/main.c to set it for
>command-line printing and exporting?
Sorry, didn't know about that part. It's a bit harder to follow than the
hid systems, I hope my new patch is correct on the main.c side.
-------------- next part --------------
Index: hid.h
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid.h,v
retrieving revision 1.12
diff -u -r1.12 hid.h
--- hid.h 2 Oct 2006 04:51:35 -0000 1.12
+++ hid.h 5 Oct 2006 17:55:33 -0000
@@ -455,6 +455,10 @@
hid_start_gui. */
extern HID *gui;
+/* This is either NULL or points to the current HID that is being called to
+ do the exporting. The gui HIDs set and unset this var.*/
+ extern HID *exporter;
+
/* 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. */
Index: main.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/main.c,v
retrieving revision 1.57
diff -u -r1.57 main.c
--- main.c 2 Oct 2006 04:51:35 -0000 1.57
+++ main.c 5 Oct 2006 17:55:33 -0000
@@ -206,11 +206,13 @@
return;
}
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;
}
static void
@@ -640,7 +642,7 @@
}
else if (argc > 2 && strcmp (argv[1], "-x") == 0)
{
- gui = hid_find_exporter (argv[2]);
+ exporter = gui = hid_find_exporter (argv[2]);
argc -= 2;
argv += 2;
}
Index: hid/common/hidinit.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/common/hidinit.c,v
retrieving revision 1.9
diff -u -r1.9 hidinit.c
--- hid/common/hidinit.c 2 Oct 2006 04:51:36 -0000 1.9
+++ hid/common/hidinit.c 5 Oct 2006 17:55:33 -0000
@@ -35,6 +35,7 @@
extern HID hid_nogui;
HID *gui = &hid_nogui;
+HID *exporter = NULL;
int pixel_slop = 1;
Index: hid/gtk/gui-dialog-print.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/gtk/gui-dialog-print.c,v
retrieving revision 1.3
diff -u -r1.3 gui-dialog-print.c
--- hid/gtk/gui-dialog-print.c 5 Apr 2006 04:22:15 -0000 1.3
+++ hid/gtk/gui-dialog-print.c 5 Oct 2006 17:55:33 -0000
@@ -326,7 +326,6 @@
GHidPort *out = &ghid_port;
int i;
HID **hids;
- HID *exporter = NULL;
GtkTooltips *tips;
tips = gtk_tooltips_new ();
@@ -376,4 +375,6 @@
if (export_dialog != NULL)
gtk_widget_destroy (export_dialog);
export_dialog = NULL;
+
+ exporter = NULL;
}
Index: hid/lesstif/dialogs.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/lesstif/dialogs.c,v
retrieving revision 1.18
diff -u -r1.18 dialogs.c
--- hid/lesstif/dialogs.c 25 Sep 2006 23:02:36 -0000 1.18
+++ hid/lesstif/dialogs.c 5 Oct 2006 17:55:34 -0000
@@ -968,6 +968,8 @@
return 1;
printer = hids[i - 1];
+ exporter = printer;
+
opts = printer->get_export_options (&n);
vals = (HID_Attr_Val *) calloc (n, sizeof (HID_Attr_Val));
if (lesstif_attribute_dialog (opts, n, vals))
@@ -977,6 +979,7 @@
}
printer->do_export (vals);
free (vals);
+ exporter = NULL;
return 0;
}
More information about the geda-dev
mailing list