1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2025-04-21 12:27:27 +03:00

- postscript.c: added some code for frame display, but I'm not happy with it

- postscript.c: moved tedious "... maxfont maxfont ..." into new function
  "boxfont"
- postscript.c: "hcenter" was way off for diagonal text
- postscript.c: "realsize" didn't take into account the effect of rotation and
  returned only the x component in the original coordinate system
- fped.c: feed a dummy argv to gui_init, so that we can parse the arguments
  before deciding whether to bring up the GUI
- fped.c: don't bring up Gtk+ if we're not going to use it



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5578 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner
2009-08-30 06:04:00 +00:00
parent 5b9918ced0
commit 276ada710f
4 changed files with 202 additions and 31 deletions

25
fped.c
View File

@@ -52,15 +52,14 @@ static void usage(const char *name)
int main(int argc, char **argv)
{
const char *name = *argv;
int error;
char *name = *argv;
char **fake_argv;
char *args[2];
int fake_argc;
int error, batch;
int batch_write_kicad = 0, batch_write_ps = 0;
int c;
error = gui_init(&argc, &argv);
if (error)
return error;
while ((c = getopt(argc, argv, "kp")) != EOF)
switch (c) {
case 'k':
@@ -73,6 +72,18 @@ int main(int argc, char **argv)
usage(name);
}
batch = batch_write_kicad || batch_write_ps;
if (!batch) {
args[0] = name;
args[1] = NULL;
fake_argc = 1;
fake_argv = args;
error = gui_init(&fake_argc, &fake_argv);
if (error)
return error;
}
switch (argc-optind) {
case 0:
scan_empty();
@@ -103,7 +114,7 @@ int main(int argc, char **argv)
write_kicad();
if (batch_write_ps)
write_ps();
if (!batch_write_kicad && !batch_write_ps) {
if (!batch) {
error = gui_main();
if (error)
return error;