diff --git a/XSchemWin/XSchemWix/Product.wxs b/XSchemWin/XSchemWix/Product.wxs index 835c8e0e..214dad5b 100644 --- a/XSchemWin/XSchemWix/Product.wxs +++ b/XSchemWin/XSchemWix/Product.wxs @@ -1,6 +1,6 @@ - + diff --git a/XSchemWin/XSchemWix/heat_doc.wxs b/XSchemWin/XSchemWix/heat_doc.wxs index 40453ec2..cdf38bd5 100644 --- a/XSchemWin/XSchemWix/heat_doc.wxs +++ b/XSchemWin/XSchemWix/heat_doc.wxs @@ -3,796 +3,796 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/XSchemWin/XSchemWix/heat_xschem_library.wxs b/XSchemWin/XSchemWix/heat_xschem_library.wxs index 1bf7b924..17337d01 100644 --- a/XSchemWin/XSchemWix/heat_xschem_library.wxs +++ b/XSchemWin/XSchemWix/heat_xschem_library.wxs @@ -3,5177 +3,5204 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + + + + - + - + + + + - + - + - + + + + - + - + - + + + + + + + - + - + - + - + - + - + + + + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -6862,25 +6889,34 @@ + + + + + + + + + diff --git a/XSchemWin/XSchemWix/xschem_library.wxs b/XSchemWin/XSchemWix/xschem_library.wxs index 8e48f33c..ad38e0ec 100644 --- a/XSchemWin/XSchemWix/xschem_library.wxs +++ b/XSchemWin/XSchemWix/xschem_library.wxs @@ -5066,18 +5066,27 @@ + + + + + + + + + @@ -5087,6 +5096,9 @@ + + + @@ -5096,6 +5108,12 @@ + + + + + + @@ -5114,6 +5132,9 @@ + + + @@ -5123,6 +5144,12 @@ + + + + + + @@ -6862,25 +6889,34 @@ + + + + + + + + + diff --git a/scconfig/src/default/find_fscalls.c b/scconfig/src/default/find_fscalls.c index 4d68cd4a..7f43fec3 100644 --- a/scconfig/src/default/find_fscalls.c +++ b/scconfig/src/default/find_fscalls.c @@ -92,6 +92,7 @@ int find_fs_readdir(const char *name, int logdepth, int fatal) char *test_c = NL "#include " NL "#include " + NL "#include " NL "int main() {" NL " DIR *dirp;" NL " struct dirent *dp;" @@ -397,6 +398,7 @@ int find_fs_getcwd(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " char b[1024];" NL " if (getcwd(b, sizeof(b)) != NULL)" @@ -419,6 +421,7 @@ int find_fs__getcwd(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " char b[1024];" NL " if (_getcwd(b, sizeof(b)) != NULL)" @@ -442,6 +445,7 @@ int find_fs_getwd(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " char b[8192];" NL " if (getwd(b) != NULL)" diff --git a/scconfig/src/default/find_io.c b/scconfig/src/default/find_io.c index c39182b5..20aa2ad2 100644 --- a/scconfig/src/default/find_io.c +++ b/scconfig/src/default/find_io.c @@ -34,6 +34,7 @@ int find_io_pipe(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " int fd[2];" NL " if (pipe(fd) == 0)" @@ -56,6 +57,7 @@ int find_io_pipe2(const char *name, int logdepth, int fatal) { const char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " int fd[2];" NL " if (pipe2(fd, 0) == 0)" @@ -77,6 +79,7 @@ int find_io_pipe2(const char *name, int logdepth, int fatal) int find_io__pipe(const char *name, int logdepth, int fatal) { const char *test_c = + NL "#include " NL "int main() {" NL " int fd[2];" NL " if (_pipe(fd, 1024, _O_BINARY) == 0)" diff --git a/scconfig/src/default/find_libs.c b/scconfig/src/default/find_libs.c index 929690a4..41d87ca8 100644 --- a/scconfig/src/default/find_libs.c +++ b/scconfig/src/default/find_libs.c @@ -188,6 +188,7 @@ int find_lib_errno(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " errno = 0;" NL " puts(\"OK\");" diff --git a/scconfig/src/default/find_thread.c b/scconfig/src/default/find_thread.c index 4ab793b0..d10e5232 100644 --- a/scconfig/src/default/find_thread.c +++ b/scconfig/src/default/find_thread.c @@ -37,6 +37,7 @@ int find_lib_lpthread(const char *name, int logdepth, int fatal) char *test_c_recursive = NL "#define _GNU_SOURCE 1 /* Needed for recursive thread-locking */" NL "#include " + NL "#include " NL "pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;" NL "int main() {" NL " pthread_attr_t a;" @@ -48,6 +49,7 @@ int find_lib_lpthread(const char *name, int logdepth, int fatal) char *test_c_simple = NL "#include " + NL "#include " NL "int main() {" NL " pthread_attr_t a;" NL " if (pthread_attr_init(&a) == 0)" diff --git a/scconfig/src/default/find_time.c b/scconfig/src/default/find_time.c index 25a91a58..70765664 100644 --- a/scconfig/src/default/find_time.c +++ b/scconfig/src/default/find_time.c @@ -32,6 +32,7 @@ int find_time_usleep(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " if (usleep(1) == 0)" NL " puts(\"OK\");" @@ -53,6 +54,7 @@ int find_time_usleep(const char *name, int logdepth, int fatal) int find_time_Sleep(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "int main() {" NL " Sleep(1);" NL " puts(\"OK\");" @@ -75,6 +77,7 @@ int find_time_gettimeofday(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " struct timeval tv;" NL " if (gettimeofday(&tv, NULL) == 0)" @@ -98,6 +101,7 @@ int find_time_gettimeofday(const char *name, int logdepth, int fatal) int find_time_ftime(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "int main() {" NL " struct timeb tb;" NL " if (ftime(&tb) == 0)" diff --git a/scconfig/src/default/find_types.c b/scconfig/src/default/find_types.c index aee8d99d..38f0f2c5 100644 --- a/scconfig/src/default/find_types.c +++ b/scconfig/src/default/find_types.c @@ -93,6 +93,7 @@ int find_types_stdint(const char *name, int logdepth, int fatal) { char *test_c = NL "#include " + NL "#include " NL "int main() {" NL " if (sizeof(uint8_t) == 1)" NL " puts(\"OK\");" diff --git a/scconfig/src/gui/find_gd.c b/scconfig/src/gui/find_gd.c index 2c26a56f..6fee1248 100644 --- a/scconfig/src/gui/find_gd.c +++ b/scconfig/src/gui/find_gd.c @@ -30,6 +30,7 @@ int find_gd(const char *name, int logdepth, int fatal, const char *call, const char *arg) { const char *test_c = + NL "#include " NL "#include \"gd.h\"" NL "int main() {" NL " gdImagePtr imtype;" diff --git a/scconfig/src/gui/find_gl.c b/scconfig/src/gui/find_gl.c index 87568911..d33e19d1 100644 --- a/scconfig/src/gui/find_gl.c +++ b/scconfig/src/gui/find_gl.c @@ -45,7 +45,7 @@ int find_gl(const char *name, int logdepth, int fatal, const char *call, const c const char *node = "libs/gui/gl"; char **id, *incdirs[] = {"GL", "OpenGL", NULL}; char **cf, *cflgs[] = {"", "-I/usr/include/libdrm", NULL}; - const char **lf, *ldflgs[] = {"-lGL", "-lopengl32", NULL}; + const char **lf, *ldflgs[] = {"-lGL", "-lopengl32", "-framework OpenGL", NULL}; char *cflags = NULL; char *ldflags = NULL; (void) call; /* not used */ diff --git a/scconfig/src/gui/find_gtk2.c b/scconfig/src/gui/find_gtk2.c index 48cddb1e..9bfa2229 100644 --- a/scconfig/src/gui/find_gtk2.c +++ b/scconfig/src/gui/find_gtk2.c @@ -122,6 +122,7 @@ int find_gtk2_key_prefix(const char *name, int logdepth, int fatal) const char *test_c_ = NL "#include " NL "#include " + NL "#include " NL NL "int main(int argc, char *argv[])" NL "{" diff --git a/scconfig/src/scripts/find_duktape.c b/scconfig/src/scripts/find_duktape.c index 36ca55a0..c15e863a 100644 --- a/scconfig/src/scripts/find_duktape.c +++ b/scconfig/src/scripts/find_duktape.c @@ -26,6 +26,7 @@ int find_script_duktape(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " duk_context *ctx = duk_create_heap_default();" diff --git a/scconfig/src/scripts/find_fungw.c b/scconfig/src/scripts/find_fungw.c index a84d81f8..4da3e190 100644 --- a/scconfig/src/scripts/find_fungw.c +++ b/scconfig/src/scripts/find_fungw.c @@ -26,6 +26,7 @@ int find_script_fungw(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " fgw_ctx_t ctx;" diff --git a/scconfig/src/scripts/find_funlisp.c b/scconfig/src/scripts/find_funlisp.c index 803be3c6..b2f6cc3b 100644 --- a/scconfig/src/scripts/find_funlisp.c +++ b/scconfig/src/scripts/find_funlisp.c @@ -26,6 +26,7 @@ int find_script_funlisp(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " lisp_runtime *rt = lisp_runtime_new();" diff --git a/scconfig/src/scripts/find_guile.c b/scconfig/src/scripts/find_guile.c index 2fa898af..d661d373 100644 --- a/scconfig/src/scripts/find_guile.c +++ b/scconfig/src/scripts/find_guile.c @@ -30,6 +30,7 @@ int find_script_guile(const char *name, int logdepth, int fatal) /* temp hack: guile/gh makes sure we have the old, 1.8 version */ char *test_c = + NL "#include " NL "#include " NL "#include " NL "int main(int argc, char *argv[]) {" diff --git a/scconfig/src/scripts/find_lua.c b/scconfig/src/scripts/find_lua.c index 47277cde..796965e0 100644 --- a/scconfig/src/scripts/find_lua.c +++ b/scconfig/src/scripts/find_lua.c @@ -26,6 +26,7 @@ int find_script_lua(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "#include " NL "#include " NL "int main() {" diff --git a/scconfig/src/scripts/find_mruby.c b/scconfig/src/scripts/find_mruby.c index 06fa84f6..0f91b7e6 100644 --- a/scconfig/src/scripts/find_mruby.c +++ b/scconfig/src/scripts/find_mruby.c @@ -25,6 +25,7 @@ int find_script_mruby(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " mrb_state *ctx = mrb_open();" diff --git a/scconfig/src/scripts/find_perl.c b/scconfig/src/scripts/find_perl.c index b08ceb2a..87d4a32e 100644 --- a/scconfig/src/scripts/find_perl.c +++ b/scconfig/src/scripts/find_perl.c @@ -27,6 +27,7 @@ int find_script_perl(const char *name, int logdepth, int fatal) char *cflags, *ldflags, *s; int res; char *test_c = + NL "#include " NL "#include " NL "#include " NL "int main() {" diff --git a/scconfig/src/scripts/find_ruby.c b/scconfig/src/scripts/find_ruby.c index 20e75fa2..12e1156c 100644 --- a/scconfig/src/scripts/find_ruby.c +++ b/scconfig/src/scripts/find_ruby.c @@ -63,6 +63,7 @@ int find_script_ruby(const char *name, int logdepth, int fatal) const char *require18s; char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " ruby_init();" @@ -73,6 +74,7 @@ int find_script_ruby(const char *name, int logdepth, int fatal) NL; char *test_c18 = + NL "#include " NL "#include " NL "#include " NL "int main() {" diff --git a/scconfig/src/scripts/find_stutter.c b/scconfig/src/scripts/find_stutter.c index 8361e260..b5dffab7 100644 --- a/scconfig/src/scripts/find_stutter.c +++ b/scconfig/src/scripts/find_stutter.c @@ -27,6 +27,7 @@ int find_script_stutter(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " varctx *global;" @@ -57,6 +58,7 @@ int find_script_stutter(const char *name, int logdepth, int fatal) int find_script_estutter(const char *name, int logdepth, int fatal) { char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " stt_ctx_t stt;" diff --git a/scconfig/src/scripts/find_tcl.c b/scconfig/src/scripts/find_tcl.c index d2b921d4..bc834206 100644 --- a/scconfig/src/scripts/find_tcl.c +++ b/scconfig/src/scripts/find_tcl.c @@ -42,6 +42,7 @@ int find_script_tcl_(const char *name, int logdepth, int fatal, int *vers, int f }; char *test_c = + NL "#include " NL "#include " NL "int main() {" NL " Tcl_Obj *res;" diff --git a/src/draw.c b/src/draw.c index abe5f14e..584797ea 100644 --- a/src/draw.c +++ b/src/draw.c @@ -79,12 +79,19 @@ void print_image() draw(); #ifdef __unix__ XpmWriteFileFromPixmap(display, "plot.xpm", xctx->save_pixmap,0, NULL ); /* .gz ???? */ - #endif dbg(1, "print_image(): Window image saved\n"); if(plotfile[0]) { my_snprintf(cmd, S(cmd), "convert_to_png plot.xpm %s", plotfile); tcleval(cmd); } else tcleval( "convert_to_png plot.xpm plot.png"); + #else + char *psfile=NULL; + create_ps(&psfile); + if(plotfile[0]) { + my_snprintf(cmd, S(cmd), "convert_to_png %s %s", psfile, plotfile); + tcleval(cmd); + } else tcleval( "convert_to_png %s plot.png", psfile); + #endif my_strncpy(plotfile,"", S(plotfile)); draw_grid=save_draw_grid; draw_pixmap=1; diff --git a/src/psprint.c b/src/psprint.c index 14ab5532..f7487b7b 100644 --- a/src/psprint.c +++ b/src/psprint.c @@ -649,21 +649,221 @@ static void fill_ps_colors() } +void create_ps(char **psfile) +{ + double dx, dy, scale, scaley; + int landscape=1; + double margin=10; /* in postscript points, (1/72)". No need to add margin as xschem zoom full already has margins.*/ + + /* Legal: 612 792 */ + double pagex=842;/* a4, in postscript points, (1/72)" */ + double pagey=595;/* a4, in postscript points, (1/72)" */ + xRect boundbox; + int c,i, textlayer; + int old_grid; + const char *textfont; + + if(!(fd = open_tmpfile("psplot_", psfile)) ) { + fprintf(errfp, "ps_draw(): can not create tmpfile %s\n", *psfile); + return; + } + ps_colors=my_calloc(311, cadlayers, sizeof(Ps_color)); + if(ps_colors==NULL){ + fprintf(errfp, "create_ps(): calloc error\n");tcleval( "exit"); + } + + fill_ps_colors(); + old_grid=draw_grid; + draw_grid=0; + + boundbox.x1 = xctx->areax1; + boundbox.x2 = xctx->areax2; + boundbox.y1 = xctx->areay1; + boundbox.y2 = xctx->areay2; + dx=boundbox.x2-boundbox.x1; + dy=boundbox.y2-boundbox.y1; + + /* xschem window aspect ratio decides if portrait or landscape */ + if(dy > dx) landscape = 0; + else landscape = 1; + if(!landscape) { + double tmp; + tmp = pagex; + pagex = pagey; + pagey = tmp; + } + + dbg(1, "ps_draw(): bbox: x1=%g y1=%g x2=%g y2=%g\n", boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2); + fprintf(fd, "%%!PS-Adobe-3.0\n"); + /* fprintf(fd, "%%%%DocumentMedia: %s %g %g 80 () ()\n", landscape ? "a4land" : "a4", pagex, pagey); */ + fprintf(fd, "%%%%DocumentMedia: %s %g %g 80 () ()\n", "a4", pagex, pagey); + fprintf(fd, "%%%%PageOrientation: %s\n", landscape ? "Landscape" : "Portrait"); + fprintf(fd, "%%%%Title: xschem plot\n"); + fprintf(fd, "%%%%Creator: xschem\n"); + fprintf(fd, "%%%%Pages: 1\n"); + fprintf(fd, "%%%%EndComments\n"); + fprintf(fd, "%%%%BeginProlog\n\n"); + + for(i = 0; i < sizeof(utf8_enc)/sizeof(char *); i++) { + fprintf(fd, utf8_enc[i]); + } + for(i = 0; i < sizeof(utf8)/sizeof(char *); i++) { + fprintf(fd, utf8[i]); + } + + fprintf(fd, "/Times /Times chararr recode\n"); + fprintf(fd, "/Times-Bold /Times-Bold chararr recode\n"); + fprintf(fd, "/Times-Oblique /Times-Oblique chararr recode\n"); + fprintf(fd, "/Times-BoldOblique /Times-BoldOblique chararr recode\n"); + fprintf(fd, "/Helvetica /Helvetica chararr recode\n"); + fprintf(fd, "/Helvetica-Bold /Helvetica-Bold chararr recode\n"); + fprintf(fd, "/Helvetica-Oblique /Helvetica-Oblique chararr recode\n"); + fprintf(fd, "/Helvetica-BoldOblique /Helvetica-BoldOblique chararr recode\n"); + fprintf(fd, "/Courier /Courier chararr recode\n"); + fprintf(fd, "/Courier-Bold /Courier-Bold chararr recode\n"); + fprintf(fd, "/Courier-Oblique /Courier-Oblique chararr recode\n"); + fprintf(fd, "/Courier-BoldOblique /Courier-BoldOblique chararr recode\n"); + + fprintf(fd,"/cm {28.346457 mul} bind def\n"); + fprintf(fd,"/LT {lineto} bind def\n"); + fprintf(fd,"/MT {moveto} bind def\n"); + fprintf(fd,"/RMT {rmoveto} bind def\n"); + fprintf(fd,"/L {moveto lineto stroke} bind def\n"); + fprintf(fd,"/RGB {setrgbcolor} bind def\n"); + fprintf(fd,"/FF {findfont} bind def\n"); + fprintf(fd,"/SF {setfont} bind def\n"); + fprintf(fd,"/SCF {scalefont} bind def\n"); + fprintf(fd,"/SW {stringwidth} bind def\n"); + fprintf(fd,"/GS {gsave} bind def\n"); + fprintf(fd,"/GR {grestore} bind def\n"); + fprintf(fd,"/NP {newpath} bind def\n"); + fprintf(fd,"/A {arcn} bind def\n"); + fprintf(fd,"/R {rectstroke} bind def\n"); + fprintf(fd,"/S {stroke} bind def\n"); + fprintf(fd,"/C {closepath} bind def\n"); + fprintf(fd,"/F {fill} bind def\n"); + fprintf(fd,"/RF {rectfill} bind def\n"); + fprintf(fd, "%%%%EndProlog\n"); + fprintf(fd, "%%%%BeginSetup\n"); + fprintf(fd, "<< /PageSize [%g %g] /Orientation 0 >> setpagedevice\n", pagex, pagey); + fprintf(fd, "%%%%Page: 1 1\n\n"); + fprintf(fd, "%%%%BeginPageSetup\n"); + fprintf(fd, "%%%%EndPageSetup\n"); + + scaley = scale = (pagey-2 * margin) / dy; + dbg(1, "scale=%g pagex=%g pagey=%g dx=%g dy=%g\n", scale, pagex, pagey, dx, dy); + if(dx * scale > (pagex - 2 * margin)) { + scale = (pagex - 2 * margin) / dx; + dbg(1, "scale=%g\n", scale); + } + fprintf(fd, "%g %g translate\n", + -scale * boundbox.x1 + margin, pagey - (scaley - scale) * dy - margin + scale * boundbox.y1); + fprintf(fd, "%g %g scale\n", scale, -scale); + fprintf(fd, "1 setlinejoin 1 setlinecap\n"); + set_lw(); + ps_drawgrid(); + + for(i=0;itexts;i++) + { + textlayer = xctx->text[i].layer; + if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER; + + my_snprintf(ps_font_family, S(ps_font_name), "Helvetica"); + my_snprintf(ps_font_name, S(ps_font_name), "Helvetica"); + textfont = xctx->text[i].font; + if( (textfont && textfont[0])) { + my_snprintf(ps_font_family, S(ps_font_family), textfont); + my_snprintf(ps_font_name, S(ps_font_name), textfont); + } + if( xctx->text[i].flags & TEXT_BOLD) { + if( (xctx->text[i].flags & TEXT_ITALIC) || (xctx->text[i].flags & TEXT_OBLIQUE) ) { + my_snprintf(ps_font_family, S(ps_font_family), "%s-BoldOblique", ps_font_name); + } else { + my_snprintf(ps_font_family, S(ps_font_family), "%s-Bold", ps_font_name); + } + } + else if( xctx->text[i].flags & TEXT_ITALIC) + my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); + else if( xctx->text[i].flags & TEXT_OBLIQUE) + my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); + + if(text_ps) { + ps_draw_string(textlayer, xctx->text[i].txt_ptr, + xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter, + xctx->text[i].x0,xctx->text[i].y0, + xctx->text[i].xscale, xctx->text[i].yscale); + } else { + old_ps_draw_string(textlayer, xctx->text[i].txt_ptr, + xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter, + xctx->text[i].x0,xctx->text[i].y0, + xctx->text[i].xscale, xctx->text[i].yscale); + } + } + for(c=0;clines[c];i++) + ps_drawline(c, xctx->line[c][i].x1, xctx->line[c][i].y1, + xctx->line[c][i].x2, xctx->line[c][i].y2, xctx->line[c][i].dash); + for(i=0;irects[c];i++) + { + ps_filledrect(c, xctx->rect[c][i].x1, xctx->rect[c][i].y1, + xctx->rect[c][i].x2, xctx->rect[c][i].y2, xctx->rect[c][i].dash); + } + for(i=0;iarcs[c];i++) + { + ps_drawarc(c, xctx->arc[c][i].fill, xctx->arc[c][i].x, xctx->arc[c][i].y, + xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b, xctx->arc[c][i].dash); + } + for(i=0;ipolygons[c];i++) { + ps_drawpolygon(c, NOW, xctx->poly[c][i].x, xctx->poly[c][i].y, xctx->poly[c][i].points, + xctx->poly[c][i].fill, xctx->poly[c][i].dash); + } + for(i=0;iinstances;i++) + ps_draw_symbol(i,c,0,0,0.0,0.0); + } + set_ps_colors(WIRELAYER); + for(i=0;iwires;i++) + { + ps_drawline(WIRELAYER, xctx->wire[i].x1,xctx->wire[i].y1,xctx->wire[i].x2,xctx->wire[i].y2, 0); + } + + { + double x1, y1, x2, y2; + struct wireentry *wireptr; + int i; + struct iterator_ctx ctx; + update_conn_cues(0, 0); + /* draw connecting dots */ + x1 = X_TO_XSCHEM(xctx->areax1); + y1 = Y_TO_XSCHEM(xctx->areay1); + x2 = X_TO_XSCHEM(xctx->areax2); + y2 = Y_TO_XSCHEM(xctx->areay2); + for(init_wire_iterator(&ctx, x1, y1, x2, y2); ( wireptr = wire_iterator_next(&ctx) ) ;) { + i = wireptr->n; + if( xctx->wire[i].end1 >1 ) { /* 20150331 draw_dots */ + ps_drawarc(WIRELAYER, 1, xctx->wire[i].x1, xctx->wire[i].y1, cadhalfdotsize, 0, 360, 0); + } + if( xctx->wire[i].end2 >1 ) { /* 20150331 draw_dots */ + ps_drawarc(WIRELAYER, 1, xctx->wire[i].x2, xctx->wire[i].y2, cadhalfdotsize, 0, 360, 0); + } + } + } + + dbg(1, "ps_draw(): INT_WIDTH(lw)=%d plotfile=%s\n",INT_WIDTH(xctx->lw), plotfile); + fprintf(fd, "showpage\n\n"); + fprintf(fd, "%%%%trailer\n"); + fprintf(fd, "%%%%EOF\n"); + fclose(fd); + draw_grid=old_grid; + my_free(879, &ps_colors); +} + void ps_draw(void) { - double dx, dy, scale, scaley; - int landscape=1; - double margin=10; /* in postscript points, (1/72)". No need to add margin as xschem zoom full already has margins.*/ - - /* Legal: 612 792 */ - double pagex=842;/* a4, in postscript points, (1/72)" */ - double pagey=595;/* a4, in postscript points, (1/72)" */ - xRect boundbox; - int c,i, textlayer; char tmp[2*PATH_MAX+40]; static char lastdir[PATH_MAX] = ""; - int old_grid; - const char *r, *textfont; + const char *r; char *psfile; if(!lastdir[0]) my_strncpy(lastdir, pwd_dir, S(lastdir)); @@ -677,200 +877,7 @@ void ps_draw(void) } else return; } - if(!(fd = open_tmpfile("psplot_", &psfile)) ) { - fprintf(errfp, "ps_draw(): can not create tmpfile %s\n", psfile); - return; - } - ps_colors=my_calloc(311, cadlayers, sizeof(Ps_color)); - if(ps_colors==NULL){ - fprintf(errfp, "ps_draw(): calloc error\n");tcleval( "exit"); - } - - fill_ps_colors(); - old_grid=draw_grid; - draw_grid=0; - - boundbox.x1 = xctx->areax1; - boundbox.x2 = xctx->areax2; - boundbox.y1 = xctx->areay1; - boundbox.y2 = xctx->areay2; - dx=boundbox.x2-boundbox.x1; - dy=boundbox.y2-boundbox.y1; - - /* xschem window aspect ratio decides if portrait or landscape */ - if(dy > dx) landscape = 0; - else landscape = 1; - if(!landscape) { - double tmp; - tmp = pagex; - pagex = pagey; - pagey = tmp; - } - - dbg(1, "ps_draw(): bbox: x1=%g y1=%g x2=%g y2=%g\n", boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2); - fprintf(fd, "%%!PS-Adobe-3.0\n"); - /* fprintf(fd, "%%%%DocumentMedia: %s %g %g 80 () ()\n", landscape ? "a4land" : "a4", pagex, pagey); */ - fprintf(fd, "%%%%DocumentMedia: %s %g %g 80 () ()\n", "a4", pagex, pagey); - fprintf(fd, "%%%%PageOrientation: %s\n", landscape ? "Landscape" : "Portrait"); - fprintf(fd, "%%%%Title: xschem plot\n"); - fprintf(fd, "%%%%Creator: xschem\n"); - fprintf(fd, "%%%%Pages: 1\n"); - fprintf(fd, "%%%%EndComments\n"); - fprintf(fd, "%%%%BeginProlog\n\n"); - - for(i = 0; i < sizeof(utf8_enc)/sizeof(char *); i++) { - fprintf(fd, utf8_enc[i]); - } - for(i = 0; i < sizeof(utf8)/sizeof(char *); i++) { - fprintf(fd, utf8[i]); - } - - fprintf(fd, "/Times /Times chararr recode\n"); - fprintf(fd, "/Times-Bold /Times-Bold chararr recode\n"); - fprintf(fd, "/Times-Oblique /Times-Oblique chararr recode\n"); - fprintf(fd, "/Times-BoldOblique /Times-BoldOblique chararr recode\n"); - fprintf(fd, "/Helvetica /Helvetica chararr recode\n"); - fprintf(fd, "/Helvetica-Bold /Helvetica-Bold chararr recode\n"); - fprintf(fd, "/Helvetica-Oblique /Helvetica-Oblique chararr recode\n"); - fprintf(fd, "/Helvetica-BoldOblique /Helvetica-BoldOblique chararr recode\n"); - fprintf(fd, "/Courier /Courier chararr recode\n"); - fprintf(fd, "/Courier-Bold /Courier-Bold chararr recode\n"); - fprintf(fd, "/Courier-Oblique /Courier-Oblique chararr recode\n"); - fprintf(fd, "/Courier-BoldOblique /Courier-BoldOblique chararr recode\n"); - - fprintf(fd,"/cm {28.346457 mul} bind def\n"); - fprintf(fd,"/LT {lineto} bind def\n"); - fprintf(fd,"/MT {moveto} bind def\n"); - fprintf(fd,"/RMT {rmoveto} bind def\n"); - fprintf(fd,"/L {moveto lineto stroke} bind def\n"); - fprintf(fd,"/RGB {setrgbcolor} bind def\n"); - fprintf(fd,"/FF {findfont} bind def\n"); - fprintf(fd,"/SF {setfont} bind def\n"); - fprintf(fd,"/SCF {scalefont} bind def\n"); - fprintf(fd,"/SW {stringwidth} bind def\n"); - fprintf(fd,"/GS {gsave} bind def\n"); - fprintf(fd,"/GR {grestore} bind def\n"); - fprintf(fd,"/NP {newpath} bind def\n"); - fprintf(fd,"/A {arcn} bind def\n"); - fprintf(fd,"/R {rectstroke} bind def\n"); - fprintf(fd,"/S {stroke} bind def\n"); - fprintf(fd,"/C {closepath} bind def\n"); - fprintf(fd,"/F {fill} bind def\n"); - fprintf(fd,"/RF {rectfill} bind def\n"); - fprintf(fd, "%%%%EndProlog\n"); - fprintf(fd, "%%%%BeginSetup\n"); - fprintf(fd, "<< /PageSize [%g %g] /Orientation 0 >> setpagedevice\n", pagex, pagey); - fprintf(fd, "%%%%Page: 1 1\n\n"); - fprintf(fd, "%%%%BeginPageSetup\n"); - fprintf(fd, "%%%%EndPageSetup\n"); - - scaley = scale = (pagey-2 * margin) / dy; - dbg(1, "scale=%g pagex=%g pagey=%g dx=%g dy=%g\n", scale, pagex, pagey, dx, dy); - if(dx * scale > (pagex - 2 * margin)) { - scale = (pagex - 2 * margin) / dx; - dbg(1, "scale=%g\n", scale); - } - fprintf(fd, "%g %g translate\n", - -scale * boundbox.x1 + margin, pagey - (scaley - scale) * dy - margin + scale * boundbox.y1); - fprintf(fd, "%g %g scale\n", scale, -scale); - fprintf(fd, "1 setlinejoin 1 setlinecap\n"); - set_lw(); - ps_drawgrid(); - - for(i=0;itexts;i++) - { - textlayer = xctx->text[i].layer; - if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER; - - my_snprintf(ps_font_family, S(ps_font_name), "Helvetica"); - my_snprintf(ps_font_name, S(ps_font_name), "Helvetica"); - textfont = xctx->text[i].font; - if( (textfont && textfont[0])) { - my_snprintf(ps_font_family, S(ps_font_family), textfont); - my_snprintf(ps_font_name, S(ps_font_name), textfont); - } - if( xctx->text[i].flags & TEXT_BOLD) { - if( (xctx->text[i].flags & TEXT_ITALIC) || (xctx->text[i].flags & TEXT_OBLIQUE) ) { - my_snprintf(ps_font_family, S(ps_font_family), "%s-BoldOblique", ps_font_name); - } else { - my_snprintf(ps_font_family, S(ps_font_family), "%s-Bold", ps_font_name); - } - } - else if( xctx->text[i].flags & TEXT_ITALIC) - my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); - else if( xctx->text[i].flags & TEXT_OBLIQUE) - my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); - - if(text_ps) { - ps_draw_string(textlayer, xctx->text[i].txt_ptr, - xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter, - xctx->text[i].x0,xctx->text[i].y0, - xctx->text[i].xscale, xctx->text[i].yscale); - } else { - old_ps_draw_string(textlayer, xctx->text[i].txt_ptr, - xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter, - xctx->text[i].x0,xctx->text[i].y0, - xctx->text[i].xscale, xctx->text[i].yscale); - } - } - for(c=0;clines[c];i++) - ps_drawline(c, xctx->line[c][i].x1, xctx->line[c][i].y1, - xctx->line[c][i].x2, xctx->line[c][i].y2, xctx->line[c][i].dash); - for(i=0;irects[c];i++) - { - ps_filledrect(c, xctx->rect[c][i].x1, xctx->rect[c][i].y1, - xctx->rect[c][i].x2, xctx->rect[c][i].y2, xctx->rect[c][i].dash); - } - for(i=0;iarcs[c];i++) - { - ps_drawarc(c, xctx->arc[c][i].fill, xctx->arc[c][i].x, xctx->arc[c][i].y, - xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b, xctx->arc[c][i].dash); - } - for(i=0;ipolygons[c];i++) { - ps_drawpolygon(c, NOW, xctx->poly[c][i].x, xctx->poly[c][i].y, xctx->poly[c][i].points, - xctx->poly[c][i].fill, xctx->poly[c][i].dash); - } - for(i=0;iinstances;i++) - ps_draw_symbol(i,c,0,0,0.0,0.0); - } - set_ps_colors(WIRELAYER); - for(i=0;iwires;i++) - { - ps_drawline(WIRELAYER, xctx->wire[i].x1,xctx->wire[i].y1,xctx->wire[i].x2,xctx->wire[i].y2, 0); - } - - { - double x1, y1, x2, y2; - struct wireentry *wireptr; - int i; - struct iterator_ctx ctx; - update_conn_cues(0, 0); - /* draw connecting dots */ - x1 = X_TO_XSCHEM(xctx->areax1); - y1 = Y_TO_XSCHEM(xctx->areay1); - x2 = X_TO_XSCHEM(xctx->areax2); - y2 = Y_TO_XSCHEM(xctx->areay2); - for(init_wire_iterator(&ctx, x1, y1, x2, y2); ( wireptr = wire_iterator_next(&ctx) ) ;) { - i = wireptr->n; - if( xctx->wire[i].end1 >1 ) { /* 20150331 draw_dots */ - ps_drawarc(WIRELAYER, 1, xctx->wire[i].x1, xctx->wire[i].y1, cadhalfdotsize, 0, 360, 0); - } - if( xctx->wire[i].end2 >1 ) { /* 20150331 draw_dots */ - ps_drawarc(WIRELAYER, 1, xctx->wire[i].x2, xctx->wire[i].y2, cadhalfdotsize, 0, 360, 0); - } - } - } - - dbg(1, "ps_draw(): INT_WIDTH(lw)=%d plotfile=%s\n",INT_WIDTH(xctx->lw), plotfile); - fprintf(fd, "showpage\n\n"); - fprintf(fd, "%%%%trailer\n"); - fprintf(fd, "%%%%EOF\n"); - fclose(fd); - draw_grid=old_grid; - my_free(879, &ps_colors); + create_ps(&psfile); if(plotfile[0]) { my_snprintf(tmp, S(tmp), "convert_to_pdf %s %s", psfile, plotfile); } else { diff --git a/src/xschem.h b/src/xschem.h index e840ab2f..cc74378d 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -860,6 +860,7 @@ extern int name_strcmp(char *s, char *d) ; extern int search(const char *tok, const char *val, int sub, int sel); extern int process_options(int argc, char **argv); extern void calc_drawing_bbox(xRect *boundbox, int selected); +extern void create_ps(char **psfile); extern void ps_draw(void); extern void svg_draw(void); extern void set_viewport_size(int w, int h, double lw); diff --git a/src/xschem.tcl b/src/xschem.tcl index c0597115..bef3a795 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -186,8 +186,12 @@ proc convert_to_pdf {filename dest} { global to_pdf # puts "convert_to_pdf: $filename --> $dest" if { [regexp -nocase {\.pdf$} $dest] } { - set pdffile [file rootname $filename].pdf] - if { ![catch "exec $to_pdf $filename $pdffile" msg] } { + set pdffile [file rootname $filename].pdf + set cmd "exec $to_pdf $filename $pdffile" + if {$::OS == "Windows"} { + set cmd "exec $to_pdf $pdffile $filename" + } + if { ![catch $cmd msg] } { file rename -force $pdffile $dest # ps2pdf succeeded, so remove original .ps file if { ![xschem get debug_var] } { @@ -205,7 +209,11 @@ proc convert_to_pdf {filename dest} { proc convert_to_png {filename dest} { global to_png tcl_debug # puts "---> $to_png $filename $destfile" - if { ![catch "exec $to_png $filename png:$dest" msg] } { + set cmd "exec $to_png $filename png:$dest" + if {$::OS == "Windows"} { + set cmd "exec $to_png $dest $filename" + } + if { ![catch $cmd msg] } { # conversion succeeded, so remove original .xpm file if { ![xschem get debug_var] } { file delete $filename diff --git a/src/xschemrc b/src/xschemrc index e788bb54..7beaef6a 100644 --- a/src/xschemrc +++ b/src/xschemrc @@ -149,11 +149,15 @@ #### command to translate xpm to png; (assumes command takes source #### and dest file as arguments, example: gm convert plot.xpm plot.png) #### default: {gm convert} +#### Windows ghostscript uses gswin64c +# set to_png {gswin64c -sDEVICE=png16m -o} # set to_png {gm convert} #### command to translate ps to pdf; (assumes command takes source #### and dest file as arguments, example: ps2pdf plot.ps plot.pdf) #### default: ps2pdf +#### Windows ghostscript uses gswin64c +# set to_pdf {gswin64c -sDEVICE=pdfwrite -o} # set to_pdf ps2pdf ###########################################################################