From ca2442640f4394296d9d6b0c42d41d399dbf9667 Mon Sep 17 00:00:00 2001 From: Ruben Undheim Date: Sat, 20 Oct 2018 17:54:32 +0200 Subject: New upstream version 3.9.73+dfsg.1 --- Makefile | 1007 ++++++++++++++++++++ Makefile.am | 100 +- Makefile.in | 433 +++++---- Makefile.mingw64 | 19 +- README | 15 +- README.CharEncoding | 126 +++ README.ISOLatin2 | 108 --- VERSION | 2 +- Xw/Makefile | 686 ++++++++++++++ Xw/Makefile.in | 323 ++++--- aclocal.m4 | 905 +++++++++++++----- cairo.c | 1415 ++++++++++++++++++++++++++++ cairo.c.orig | 991 ++++++++++++++++++++ colordefs.h | 34 +- compile | 347 +++++++ config.status | 1113 ++++++++++++++++++++++ configure | 1780 +++++++++++++++++++---------------- configure.in | 803 ++++++---------- elements.c | 634 +++++++++++-- events.c | 997 ++++++++++---------- filelist.c | 44 +- files.c | 372 ++++++-- fontfile.c | 64 +- formats.c | 16 +- functions.c | 365 +++++--- graphic.c | 149 +-- help.c | 17 +- keybindings.c | 41 +- lib/analoglib3.lps | 229 +++-- lib/cyrillic.enc | 39 + lib/digitaltcl.lps | 14 +- lib/fonts/courier_cyrillic.xfe | 50 + lib/fonts/helvetica_cyrillic.xfe | 50 + lib/fonts/testtest.ps | 206 +++++ lib/fonts/times_roman_cyrillic.xfe | 51 + lib/isolatin2.enc | 39 + lib/isolatin5.enc | 40 + lib/tcl/bparams.tcl | 2 +- lib/tcl/edif.tcl | 38 +- lib/tcl/files.tcl | 1 + lib/tcl/mousehint.tcl | 23 +- lib/tcl/resource.tcl | 166 ++-- lib/tcl/symbol.tcl | 126 ++- lib/tcl/text.tcl | 1 + lib/tcl/tkcon.tcl | 6 +- lib/tcl/wrapper.tcl | 488 ++++++---- lib/tcl/xcircuit.tcl.in | 2 +- lib/tcl/xcstartup.tcl | 20 +- lib/xcircps2.pro | 43 +- lib/xspice.lps | 591 ++++++++++++ libraries.c | 11 +- log_text.html | 0 menucalls.c | 140 +-- menus.h | 33 +- netlist.c | 108 ++- ngspice.c | 21 +- opengl.c | 445 --------- parameter.c | 149 ++- prototypes.h | 103 ++- python.c | 13 +- rcfile.c | 1 - render.c | 154 ++-- schema.c | 43 +- selection.c | 104 ++- spiceparser/Makefile | 688 ++++++++++++++ spiceparser/Makefile.in | 323 ++++--- spiceparser/example | Bin 0 -> 131275 bytes svg.c | 100 +- tclxcircuit.c | 475 ++++++---- text.c | 482 +++++++--- tutorial/footnote.html | 27 - tutorial/giffiles/aggregate.gif | Bin 5614 -> 0 bytes tutorial/giffiles/alib.gif | Bin 3730 -> 0 bytes tutorial/giffiles/amp1.gif | Bin 7855 -> 0 bytes tutorial/giffiles/amp2.gif | Bin 7628 -> 0 bytes tutorial/giffiles/amp3.gif | Bin 8405 -> 0 bytes tutorial/giffiles/arcs1.gif | Bin 4993 -> 0 bytes tutorial/giffiles/bridge.gif | Bin 14903 -> 0 bytes tutorial/giffiles/bridge1.gif | Bin 4576 -> 0 bytes tutorial/giffiles/bridge2.gif | Bin 3455 -> 0 bytes tutorial/giffiles/bridge3.gif | Bin 3988 -> 0 bytes tutorial/giffiles/bridge4.gif | Bin 8685 -> 0 bytes tutorial/giffiles/bridge5.gif | Bin 14752 -> 0 bytes tutorial/giffiles/bridge6.gif | Bin 13742 -> 0 bytes tutorial/giffiles/dff.gif | Bin 14834 -> 0 bytes tutorial/giffiles/filter1.gif | Bin 4844 -> 0 bytes tutorial/giffiles/filter2.gif | Bin 4901 -> 0 bytes tutorial/giffiles/fullamp.gif | Bin 15951 -> 0 bytes tutorial/giffiles/fullamp_anno.gif | Bin 24174 -> 0 bytes tutorial/giffiles/halfamp.gif | Bin 10330 -> 0 bytes tutorial/giffiles/integrate1.gif | Bin 4826 -> 0 bytes tutorial/giffiles/lib1.gif | Bin 1936 -> 0 bytes tutorial/giffiles/load1.gif | Bin 4431 -> 0 bytes tutorial/giffiles/nand4.gif | Bin 3934 -> 0 bytes tutorial/giffiles/object.gif | Bin 2378 -> 0 bytes tutorial/giffiles/objedit.gif | Bin 5098 -> 0 bytes tutorial/giffiles/overunder.gif | Bin 1932 -> 0 bytes tutorial/giffiles/path1.gif | Bin 3039 -> 0 bytes tutorial/giffiles/path2.gif | Bin 4081 -> 0 bytes tutorial/giffiles/path3.gif | Bin 5723 -> 0 bytes tutorial/giffiles/path4.gif | Bin 5181 -> 0 bytes tutorial/giffiles/path5.gif | Bin 3989 -> 0 bytes tutorial/giffiles/pcbcap.gif | Bin 14607 -> 0 bytes tutorial/giffiles/pcbdiode.gif | Bin 3802 -> 0 bytes tutorial/giffiles/poly1.gif | Bin 2023 -> 0 bytes tutorial/giffiles/poly2.gif | Bin 7834 -> 0 bytes tutorial/giffiles/powersup.gif | Bin 5191 -> 0 bytes tutorial/giffiles/powersup2.gif | Bin 6193 -> 0 bytes tutorial/giffiles/quadparts.gif | Bin 3461 -> 0 bytes tutorial/giffiles/save1.gif | Bin 5436 -> 0 bytes tutorial/giffiles/save2.gif | Bin 4492 -> 0 bytes tutorial/giffiles/select1.gif | Bin 1280 -> 0 bytes tutorial/giffiles/select2.gif | Bin 697 -> 0 bytes tutorial/giffiles/spline1.gif | Bin 915 -> 0 bytes tutorial/giffiles/spline2.gif | Bin 1747 -> 0 bytes tutorial/giffiles/spline3.gif | Bin 3888 -> 0 bytes tutorial/giffiles/symbol_enc.gif | Bin 17439 -> 0 bytes tutorial/giffiles/text.gif | Bin 1725 -> 0 bytes tutorial/giffiles/text2.gif | Bin 3437 -> 0 bytes tutorial/giffiles/tut1.gif | Bin 14286 -> 0 bytes tutorial/giffiles/wramp1.gif | Bin 7342 -> 0 bytes tutorial/index.html | 1 - tutorial/netfiles/filter.spc | 6 - tutorial/netfiles/integrator.spc | 17 - tutorial/pcb/FlareLED.ps | 720 --------------- tutorial/pcb/LED | 1794 ------------------------------------ tutorial/pcb/LED.NET | 47 - tutorial/pcb/bridge.pcb | 6 - tutorial/pcb/flare_objects.gif | Bin 15281 -> 0 bytes tutorial/pcb/pic_instance.gif | Bin 18944 -> 0 bytes tutorial/pcb/pic_object.gif | Bin 19324 -> 0 bytes tutorial/pcb/powersup.pcb | 10 - tutorial/psfiles/analoglib1.lps | 238 ----- tutorial/psfiles/analoglib2.lps | 235 ----- tutorial/psfiles/bridge.ps | 370 -------- tutorial/psfiles/buses.ps | 245 ----- tutorial/psfiles/dff.ps | 228 ----- tutorial/psfiles/filter.ps | 260 ------ tutorial/psfiles/integrator.ps | 327 ------- tutorial/psfiles/powersup.ps | 429 --------- tutorial/psfiles/test1.ps | 154 ---- tutorial/tutorial.html | 803 ---------------- tutorial/tutorial2.html | 1455 ----------------------------- undo.c | 96 +- utf8encodings.c | 588 ++++++++++++ xcircuit-tcl.nsi | 2 + xcircuit.c | 104 ++- xcircuit.h | 189 ++-- xcwin32.c | 6 +- xtfuncs.c | 174 ++-- xtgui.c | 30 +- 151 files changed, 14768 insertions(+), 12317 deletions(-) create mode 100644 Makefile create mode 100644 README.CharEncoding delete mode 100644 README.ISOLatin2 create mode 100644 Xw/Makefile create mode 100644 cairo.c create mode 100644 cairo.c.orig create mode 100755 compile create mode 100755 config.status create mode 100644 lib/cyrillic.enc create mode 100644 lib/fonts/courier_cyrillic.xfe create mode 100644 lib/fonts/helvetica_cyrillic.xfe create mode 100644 lib/fonts/testtest.ps create mode 100644 lib/fonts/times_roman_cyrillic.xfe create mode 100644 lib/isolatin2.enc create mode 100644 lib/isolatin5.enc create mode 100644 lib/xspice.lps delete mode 100644 log_text.html delete mode 100644 opengl.c create mode 100644 spiceparser/Makefile create mode 100755 spiceparser/example delete mode 100644 tutorial/footnote.html delete mode 100644 tutorial/giffiles/aggregate.gif delete mode 100644 tutorial/giffiles/alib.gif delete mode 100644 tutorial/giffiles/amp1.gif delete mode 100644 tutorial/giffiles/amp2.gif delete mode 100644 tutorial/giffiles/amp3.gif delete mode 100644 tutorial/giffiles/arcs1.gif delete mode 100644 tutorial/giffiles/bridge.gif delete mode 100644 tutorial/giffiles/bridge1.gif delete mode 100644 tutorial/giffiles/bridge2.gif delete mode 100644 tutorial/giffiles/bridge3.gif delete mode 100644 tutorial/giffiles/bridge4.gif delete mode 100644 tutorial/giffiles/bridge5.gif delete mode 100644 tutorial/giffiles/bridge6.gif delete mode 100644 tutorial/giffiles/dff.gif delete mode 100644 tutorial/giffiles/filter1.gif delete mode 100644 tutorial/giffiles/filter2.gif delete mode 100644 tutorial/giffiles/fullamp.gif delete mode 100644 tutorial/giffiles/fullamp_anno.gif delete mode 100644 tutorial/giffiles/halfamp.gif delete mode 100644 tutorial/giffiles/integrate1.gif delete mode 100644 tutorial/giffiles/lib1.gif delete mode 100644 tutorial/giffiles/load1.gif delete mode 100644 tutorial/giffiles/nand4.gif delete mode 100644 tutorial/giffiles/object.gif delete mode 100644 tutorial/giffiles/objedit.gif delete mode 100644 tutorial/giffiles/overunder.gif delete mode 100644 tutorial/giffiles/path1.gif delete mode 100644 tutorial/giffiles/path2.gif delete mode 100644 tutorial/giffiles/path3.gif delete mode 100644 tutorial/giffiles/path4.gif delete mode 100644 tutorial/giffiles/path5.gif delete mode 100644 tutorial/giffiles/pcbcap.gif delete mode 100644 tutorial/giffiles/pcbdiode.gif delete mode 100644 tutorial/giffiles/poly1.gif delete mode 100644 tutorial/giffiles/poly2.gif delete mode 100644 tutorial/giffiles/powersup.gif delete mode 100644 tutorial/giffiles/powersup2.gif delete mode 100644 tutorial/giffiles/quadparts.gif delete mode 100644 tutorial/giffiles/save1.gif delete mode 100644 tutorial/giffiles/save2.gif delete mode 100644 tutorial/giffiles/select1.gif delete mode 100644 tutorial/giffiles/select2.gif delete mode 100644 tutorial/giffiles/spline1.gif delete mode 100644 tutorial/giffiles/spline2.gif delete mode 100644 tutorial/giffiles/spline3.gif delete mode 100644 tutorial/giffiles/symbol_enc.gif delete mode 100644 tutorial/giffiles/text.gif delete mode 100644 tutorial/giffiles/text2.gif delete mode 100644 tutorial/giffiles/tut1.gif delete mode 100644 tutorial/giffiles/wramp1.gif delete mode 120000 tutorial/index.html delete mode 100644 tutorial/netfiles/filter.spc delete mode 100644 tutorial/netfiles/integrator.spc delete mode 100644 tutorial/pcb/FlareLED.ps delete mode 100755 tutorial/pcb/LED delete mode 100755 tutorial/pcb/LED.NET delete mode 100644 tutorial/pcb/bridge.pcb delete mode 100644 tutorial/pcb/flare_objects.gif delete mode 100644 tutorial/pcb/pic_instance.gif delete mode 100644 tutorial/pcb/pic_object.gif delete mode 100644 tutorial/pcb/powersup.pcb delete mode 100644 tutorial/psfiles/analoglib1.lps delete mode 100644 tutorial/psfiles/analoglib2.lps delete mode 100644 tutorial/psfiles/bridge.ps delete mode 100644 tutorial/psfiles/buses.ps delete mode 100644 tutorial/psfiles/dff.ps delete mode 100644 tutorial/psfiles/filter.ps delete mode 100644 tutorial/psfiles/integrator.ps delete mode 100644 tutorial/psfiles/powersup.ps delete mode 100644 tutorial/psfiles/test1.ps delete mode 100644 tutorial/tutorial.html delete mode 100644 tutorial/tutorial2.html create mode 100644 utf8encodings.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0725858 --- /dev/null +++ b/Makefile @@ -0,0 +1,1007 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/xcircuit +pkgincludedir = $(includedir)/xcircuit +pkglibdir = $(libdir)/xcircuit +pkglibexecdir = $(libexecdir)/xcircuit +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +target_triplet = x86_64-unknown-linux-gnu +bin_PROGRAMS = xcircuit$(EXEEXT) +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +menudep_SOURCES = menudep.c +menudep_OBJECTS = menudep.$(OBJEXT) +menudep_LDADD = $(LDADD) +am_xcircuit_OBJECTS = elements.$(OBJEXT) events.$(OBJEXT) \ + filelist.$(OBJEXT) files.$(OBJEXT) flate.$(OBJEXT) \ + fontfile.$(OBJEXT) formats.$(OBJEXT) functions.$(OBJEXT) \ + graphic.$(OBJEXT) help.$(OBJEXT) keybindings.$(OBJEXT) \ + libraries.$(OBJEXT) menucalls.$(OBJEXT) netlist.$(OBJEXT) \ + ngspice.$(OBJEXT) parameter.$(OBJEXT) python.$(OBJEXT) \ + rcfile.$(OBJEXT) render.$(OBJEXT) schema.$(OBJEXT) \ + selection.$(OBJEXT) svg.$(OBJEXT) text.$(OBJEXT) \ + undo.$(OBJEXT) tclxcircuit.$(OBJEXT) tkSimple.$(OBJEXT) \ + xcircuit.$(OBJEXT) xtfuncs.$(OBJEXT) xtgui.$(OBJEXT) \ + cairo.$(OBJEXT) utf8encodings.$(OBJEXT) +xcircuit_OBJECTS = $(am_xcircuit_OBJECTS) +xcircuit_DEPENDENCIES = +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = menudep.c $(xcircuit_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +ACLOCAL = aclocal-1.14 + +# Override standard "make" target when compiling under TCL +ALL_TARGET = all-recursive +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AUTOCONF = autoconf +AUTOHEADER = autoheader +AUTOMAKE = automake-1.14 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=none +CFLAGS = -g -Wno-pointer-sign -fPIC +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo + +# Main compiler arguments +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"xcircuit\" -DVERSION=\"3.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DSPICE_EXEC=\"ngspice\" -DTCL_WRAPPER=1 $(PATHNAMES) +DEPDIR = .deps +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +EXTRA_LIB_SPECS = -lm +GREP = /bin/grep +GS_EXEC = gs +GS_LIBS = +HAVE_LGF = LGF +INC_SPECS = -I/usr/include -I/usr/include +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INSTALL_TARGET = install-recursive +INTERPRETER = TCL +INTERP_PATH = tcl +LD = /bin/ld +LDDL_FLAGS = -Wl,-z,relro -Wl,--export-dynamic -Wl,--version-script=symbol.map +LDFLAGS = +LD_RUN_PATH = -Wl,-rpath,/usr/lib64 +LIBOBJS = +LIBS = -ldl -lz -lpthread -lieee -lm -lz -lXt -lSM -lICE -lm -lX11 -lXpm $(cairo_LIBS) $(fontconfig_LIBS) ${GS_LIBS} +LIB_SPECS = -L/usr/lib64 -ltcl8.6 -L/usr/lib64 -ltk8.6 +LTLIBOBJS = +M4 = /bin/m4 +MAKEINFO = makeinfo +MKDIR_P = /bin/mkdir -p +OBJEXT = o +PACKAGE = xcircuit +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_CONFIG = /bin/pkg-config +PKG_CONFIG_LIBDIR = +PKG_CONFIG_PATH = +PYTHON = +RANLIB = ranlib +REVISION = 71 +SET_MAKE = +SHDLIB_EXT = .so +SHELL = /bin/sh +SHLIB_LD = ${CC} -shared ${CFLAGS} ${LDFLAGS} -fPIC -Wl,-soname,${@} +SHLIB_LIB_SPECS = +SPICE_EXEC = ngspice +STARTUP_FILE = xcstartup.tcl +STDLIBS = +STRIP = +SUBDIRS = +SUBLIB = +TCL_LIB_DIR = /usr/lib64 +VERSION = 3.9 +WISH_EXE = /usr/bin/wish +WRAPPER_SCRIPT = wrapper.tcl +XCIRCUIT_TARGET = tcl +XMKMF = +X_CFLAGS = +X_EXTRA_LIBS = +X_LIBS = +X_PRE_LIBS = -lSM -lICE +abs_builddir = /home/tim/gitsrc/xcircuit-3.9 +abs_srcdir = /home/tim/gitsrc/xcircuit-3.9 +abs_top_builddir = /home/tim/gitsrc/xcircuit-3.9 +abs_top_srcdir = /home/tim/gitsrc/xcircuit-3.9 +ac_ct_CC = gcc +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +cairo_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 +cairo_LIBS = -lcairo +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +fontconfig_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 +fontconfig_LIBS = -lfontconfig -lfreetype +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/tim/gitsrc/xcircuit-3.9/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = x86_64-unknown-linux-gnu +target_alias = +target_cpu = x86_64 +target_os = linux-gnu +target_vendor = unknown +top_build_prefix = +top_builddir = . +top_srcdir = . +AUTOMAKE_OPTIONS = foreign no-dependencies no-dist +AM_CFLAGS = $(cairo_CFLAGS) $(fontconfig_CFLAGS) ${GS_CFLAGS} + +# Additional files to distribute +EXTRA_DIST = COPYRIGHT README README.ISOLatin2 README.notes +FULL_VERSION = 3.9.71 + +# Menudep program generates menudep.h needed by some of the +# source files for Xcircuit +noinst_PROGRAMS = menudep$(EXEEXT) + +# Automake files +ac_aux_dir = dist + +# Temporary directory (if not overridden by environment variable TMPDIR) +tmpdir = /tmp + +# Directories for app-defaults file and manual page +appdefaultsdir = $(libdir)/$(PACKAGE)-$(VERSION)/app-defaults +appmandir = $(libdir)/$(PACKAGE)-$(VERSION)/man +PATHNAMES = -DPROG_VERSION=$(VERSION) \ + -DPROG_REVISION=$(REVISION) \ + -DCAD_DIR=\"$(libdir)\" \ + -DTEMP_DIR=\"$(tmpdir)\" \ + -DRESOURCES_DIR=\"$(appdefaultsdir)\" \ + -DSCRIPTS_DIR=\"$(scriptsdir)\" \ + -DBUILTINS_DIR=\"$(librarydir)\" \ + -DBUILTINS_FILE=\"$(BUILTINS_FILE)\" \ + -DUSER_RC_FILE=\"$(USER_RC_FILE)\" \ + -DPROLOGUE_DIR=\"$(librarydir)\" \ + -DPROLOGUE_FILE=\"$(PROLOGUE_FILE)\" \ + -DCYRILLIC_ENC_FILE=\"$(CYRILLIC_ENC_FILE)\" \ + -DISOLATIN2_ENC_FILE=\"$(ISOLATIN2_ENC_FILE)\" \ + -DISOLATIN5_ENC_FILE=\"$(ISOLATIN5_ENC_FILE)\" \ + -DSTARTUP_FILE=\"$(STARTUP_FILE)\" \ + -DLGF_LIB=\"$(LGF_LIB)\" \ + -DASG_SPICE_LIB=\"$(ASG_SPICE_LIB)\" + +xcircuit_SOURCES = elements.c events.c filelist.c files.c \ + flate.c fontfile.c formats.c functions.c graphic.c \ + help.c keybindings.c libraries.c menucalls.c \ + netlist.c ngspice.c parameter.c python.c \ + rcfile.c render.c schema.c selection.c svg.c text.c undo.c \ + tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c \ + cairo.c utf8encodings.c + +xcircuit_DEPEND = +xcircuit_LDADD = + +# Man page +M4_DEFS = @M4_DEFS@ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"xcircuit\" -DVERSION=\"3.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DSPICE_EXEC=\"ngspice\" -DTCL_WRAPPER=1 +man_MANS = lib/xcircuit.1 +INCLUDES = -IXw ${INC_SPECS} + +# Library directory and files +librarydir = $(libdir)/$(PACKAGE)-$(VERSION) +scriptsdir = $(libdir)/$(PACKAGE)-$(VERSION) +USER_RC_FILE = .xcircuitrc +PROLOGUE_FILE = xcircps2.pro +CYRILLIC_ENC_FILE = cyrillic.enc +ISOLATIN2_ENC_FILE = isolatin2.enc +ISOLATIN5_ENC_FILE = isolatin5.enc +ENCODING_FILES = ${CYRILLIC_ENC_FILE} ${ISOLATIN2_ENC_FILE} ${ISOLATIN5_ENC_FILE} +LGF_LIB = lgf.lps +ASG_SPICE_LIB = asg_spice.lps +SIGNAL_LIB = signal.lps +MUSIC_LIB = musiclib.lps +FONTS_LPS = courier courieriso2 courieriso5 helvetica helveticaiso2 \ + helveticaiso5 myfont symbol times_roman times_romaniso2 \ + times_romaniso5 + +FONTS_XFE = courier courieriso courieriso2 courieriso5 courier_cyrillic \ + helvetica helveticaiso helveticaiso2 helveticaiso5 helvetica_cyrillic \ + times_roman times_romaniso times_romaniso2 times_romaniso5 \ + times_roman_cyrillic myfont symbol + +SCRIPTS_PY = spice gettext pagebbox +WRAPPER_INIT = xcircuit.tcl +WRAPPER_OBJ = xcircuit${SHDLIB_EXT} +WRAPPER_SO = xcircuit.so +WRAPPER_SH = xcircuit.sh +CONSOLE = tkcon.tcl +CONSOLE_SCRIPT = console.tcl +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) + +xcircuit$(EXEEXT): $(xcircuit_OBJECTS) $(xcircuit_DEPENDENCIES) $(EXTRA_xcircuit_DEPENDENCIES) + @rm -f xcircuit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xcircuit_OBJECTS) $(xcircuit_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(AM_V_CC)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ + mostlyclean-am + +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-data-local install-man + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-binPROGRAMS \ + clean-cscope clean-generic clean-noinstPROGRAMS cscope \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags dvi dvi-am html html-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-data-local install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-man uninstall-man1 + +cairo.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +elements.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +events.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +fontfile.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +text.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +utf8encodings.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra + +help.c: menudep.h +menucalls.c: menudep.h +rcfile.c: menudep.h +schema.c: menudep.h +xcircuit.c: menudep.h +parameter.c: menudep.h +python.c: menudep.h +tclxcircuit.c: menudep.h +xtgui.c: menudep.h +xtfuncs.c: menudep.h + +menudep$(EXEEXT): menudep.o + $(CC) -o $@ menudep.o + +menudep.h: menudep$(EXEEXT) + ./menudep$(EXEEXT) + +xcwrap.o: xcwrap.c menudep.h + $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} \ + $(PATHNAMES) $(INCLUDES) \ + xcwrap.c -c -o xcwrap.o + +lib/$(INTERP_PATH)/$(WRAPPER_OBJ): xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND} + $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) + $(SHLIB_LD) ${CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \ + ${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \ + ${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \ + ${LIB_SPECS} ${EXTRA_LIB_SPECS} + +xcircexec$(EXEEXT): xcircexec.o + $(RM) ./xcircexec$(EXEEXT) + $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \ + xcircexec.c -o xcircexec$(EXEEXT) ${LIB_SPECS} \ + ${LD_RUN_PATH} ${LDFLAGS} ${LIBS} ${EXTRA_LIB_SPECS} + +tcl: + @echo Making tcl library object + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (echo "Making tcl in $$subdir"; \ + cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \ + done + $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) + $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH) + $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT) + $(MAKE) xcircexec$(EXEEXT) + +lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in + sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \ + -e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \ + -e '/CONSOLE_SCRIPT/s/CONSOLE_SCRIPT/$(CONSOLE_SCRIPT)/' \ + -e '/CONSOLE/s/CONSOLE/$(CONSOLE)/' \ + -e '/PROG_VERSION/s/PROG_VERSION/$(VERSION)/' \ + -e '/PROG_REVISION/s/PROG_REVISION/$(REVISION)/' \ + -e '/TCLLIBDIR/s#TCLLIBDIR#$(TCL_LIB_DIR)#' \ + -e '/WISH_EXE/s#WISH_EXE#$(WISH_EXE)#' \ + lib/$(INTERP_PATH)/$(WRAPPER_SH).in > $@ + chmod 0755 $@ + +lib/$(INTERP_PATH)/$(WRAPPER_INIT): lib/$(INTERP_PATH)/$(WRAPPER_INIT).in + sed -e '/LIBDIR/s#LIBDIR#$(librarydir)#' \ + -e '/SCRIPTSDIR/s#SCRIPTSDIR#$(scriptsdir)#' \ + lib/$(INTERP_PATH)/$(WRAPPER_INIT).in > $@ + chmod 0755 $@ + +lib/xcircuit.1: lib/xcircuit.1.in + sed -e '/LIBDIR/s#LIBDIR#$(libdir)#' \ + -e "/^${HAVE_LGF}/s/^${HAVE_LGF} //" \ + -e "/^${INTERPRETER}/s/^${INTERPRETER} //" \ + -e '/^PYTHON /d' \ + -e '/^TCL /d' \ + -e '/^LGF /d' \ + -e '/^NOINTERP /d' \ + lib/xcircuit.1.in > $@ + +install-data-local: lib/xcircuit.1 + @echo "Installing app-defaults file" + $(mkinstalldirs) $(DESTDIR)$(appdefaultsdir) + $(mkinstalldirs) $(DESTDIR)$(appmandir) + $(INSTALL_DATA) lib/XCircuit.ad $(DESTDIR)$(appdefaultsdir)/XCircuit + $(INSTALL_DATA) lib/xcircuit.1 $(DESTDIR)$(appmandir)/xcircuit.1 + @echo "Installing library and netlist files" + $(mkinstalldirs) $(DESTDIR)$(librarydir) + ( cd lib ; for i in $(PROLOGUE_FILE) $(ENCODING_FILES) *.lps *.cir; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \ + done ) + ( cd lib/$(INTERP_PATH) ; for i in $(STARTUP_FILE); do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \ + done ) + @echo "Installing .lps font files" + $(mkinstalldirs) $(DESTDIR)$(librarydir)/fonts + for i in $(FONTS_LPS); do \ + $(INSTALL_DATA) lib/fonts/$$i.lps $(DESTDIR)$(librarydir)/fonts; \ + done + @echo "Installing .xfe font files" + for i in $(FONTS_XFE); do \ + $(INSTALL_DATA) lib/fonts/$$i.xfe $(DESTDIR)$(librarydir)/fonts; \ + done + @echo "Installing scripts (if option enabled)" + if test "$(PYTHON)" != ""; then \ + $(mkinstalldirs) $(DESTDIR)$(scriptsdir)/python; \ + for i in $(SCRIPTS_PY); do \ + $(INSTALL_DATA) lib/python/$$i.py \ + $(DESTDIR)$(scriptsdir)/python; \ + done; \ + fi + +# Note that MacOS/Fink uses SHDLIB_EXT = .dylib but Tcl expects .so anyway. +# So we make a symbolic link if SHDLIB_EXT != .so + +install-tcl: xcircexec$(EXEEXT) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH) lib/$(INTERP_PATH)/$(WRAPPER_INIT) + @echo "Installing standard XCircuit library files" + $(MAKE) $(AM_MAKEFLAGS) install-data-local + @echo "Installing Tcl files" + $(mkinstalldirs) $(DESTDIR)$(librarydir) + $(mkinstalldirs) $(DESTDIR)$(scriptsdir) + ( cd lib/$(INTERP_PATH) ; for i in $(WRAPPER_OBJ) *.tcl ; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(scriptsdir); \ + done ) + $(INSTALL_DATA) xcircexec$(EXEEXT) $(DESTDIR)$(librarydir) + chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE) + chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE_SCRIPT) + chmod 0755 $(DESTDIR)$(librarydir)/$(WRAPPER_OBJ) + chmod 0755 $(DESTDIR)$(librarydir)/xcircexec$(EXEEXT) + + if test "${SHDLIB_EXT}" != ".so"; then \ + ( cd $(DESTDIR)$(librarydir); \ + $(RM) $(WRAPPER_SO) ; \ + ln -s $(WRAPPER_OBJ) $(WRAPPER_SO) ) ; \ + fi + + @echo "Installing GIF images" + $(mkinstalldirs) $(DESTDIR)$(librarydir)/pixmaps + ( cd lib/pixmaps ; for i in `ls *.gif *.xbm *.ico` ; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir)/pixmaps; \ + done ) + @echo "Installing shell script as xcircuit executable" + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_DATA) lib/$(INTERP_PATH)/$(WRAPPER_SH) $(DESTDIR)$(bindir)/xcircuit + chmod 0755 $(DESTDIR)$(bindir)/xcircuit + +clean: + (cd ./Xw; $(RM) *.o *.a *.bak core) + (cd ./asg; $(MAKE) clean) + (cd ./spiceparser; $(MAKE) clean) + $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH) + $(RM) lib/$(INTERP_PATH)/$(WRAPPER_INIT) + $(RM) xcircuit *.o *.bak lib/xcircuit.1 core xcircexec$(EXEEXT) + $(RM) menudep$(EXEEXT) menudep.h + $(RM) config.cache config.log + +distclean: + (cd ./Xw; $(RM) *.o *.a *.bak Makefile core) + (cd ./asg; $(MAKE) clean ; $(RM) Makefile) + (cd ./spiceparser; $(MAKE) clean ; $(RM) Makefile) + $(RM) xcircuit *.o *.bak core + $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH) + $(RM) menudep$(EXEEXT) menudep.h lib/xcircuit.1 xcircexec$(EXEEXT) + $(RM) Makefile config.cache config.log config.status + $(RM) xcircuit-$(FULL_VERSION) xcircuit.spec xcircuit-$(FULL_VERSION).tgz + +dist: + $(RM) xcircuit.spec xcircuit-$(FULL_VERSION) xcircuit-$(FULL_VERSION).tgz + sed -e /%VERSION%/s/%VERSION%/$(FULL_VERSION)/ \ + xcircuit.spec.in > xcircuit.spec + ln -nsf . xcircuit-$(FULL_VERSION) + tar zchvf xcircuit-$(FULL_VERSION).tgz --exclude CVS \ + --exclude xcircuit-$(FULL_VERSION)/xcircuit-$(FULL_VERSION) \ + --exclude xcircuit-$(FULL_VERSION)/xcircuit-$(FULL_VERSION).tgz \ + xcircuit-$(FULL_VERSION) + +quiteclean: + (cd ./Xw; $(RM) *.o *.a *.bak Makefile.in Makefile core) + (cd ./asg; $(MAKE) clean ; $(RM) Makefile.in Makefile) + (cd ./spiceparser; $(MAKE) clean ; $(RM) Makefile.in Makefile) + $(RM) xcircuit *.o *.bak core + $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH) + $(RM) menudep$(EXEEXT) menudep.h lib/xcircuit.1 xcircexec$(EXEEXT) + $(RM) install-sh missing mkinstalldirs Makefile.in Makefile + $(RM) config.* aclocal.m4 + +$(ALL_TARGET): + $(MAKE) tcl + +$(INSTALL_TARGET): + $(MAKE) install-tcl + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Makefile.am b/Makefile.am index 0dd2053..f29e863 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,9 @@ AUTOMAKE_OPTIONS = foreign no-dependencies no-dist +AM_CFLAGS = $(cairo_CFLAGS) $(fontconfig_CFLAGS) ${GS_CFLAGS} +LIBS += $(cairo_LIBS) $(fontconfig_LIBS) ${GS_LIBS} + # Additional files to distribute EXTRA_DIST = COPYRIGHT README README.ISOLatin2 README.notes @@ -18,40 +21,6 @@ INSTALL_TARGET = @INSTALL_TARGET@ # source files for Xcircuit noinst_PROGRAMS = menudep$(EXEEXT) -menudep$(EXEEXT): menudep.o - $(CC) -o $@ menudep.o - -menudep.h: menudep$(EXEEXT) - ./menudep$(EXEEXT) - -xcwrap.o: xcwrap.c menudep.h - $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \ - xcwrap.c -c -o xcwrap.o - -lib/tcl/xcircuit${SHDLIB_EXT}: xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND} - $(RM) lib/xcircuit${SHDLIB_EXT} - $(CC) ${CFLAGS} ${SHLIB_CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \ - ${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \ - ${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \ - ${LIB_SPECS} ${EXTRA_LIB_SPECS} - -xcircexec$(EXEEXT): xcircexec.o - $(RM) ./xcircexec$(EXEEXT) - $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \ - xcircexec.c -o xcircexec$(EXEEXT) ${LIB_SPECS} \ - ${LD_RUN_PATH} ${LDFLAGS} ${LIBS} ${EXTRA_LIB_SPECS} - -tcl: - @echo Making tcl library object - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (echo "Making tcl in $$subdir"; \ - cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \ - done - $(MAKE) lib/tcl/xcircuit${SHDLIB_EXT} - $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH) - $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT) - $(MAKE) xcircexec$(EXEEXT) - # Automake files ac_aux_dir = dist @@ -76,6 +45,9 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \ -DUSER_RC_FILE=\"$(USER_RC_FILE)\" \ -DPROLOGUE_DIR=\"$(librarydir)\" \ -DPROLOGUE_FILE=\"$(PROLOGUE_FILE)\" \ + -DCYRILLIC_ENC_FILE=\"$(CYRILLIC_ENC_FILE)\" \ + -DISOLATIN2_ENC_FILE=\"$(ISOLATIN2_ENC_FILE)\" \ + -DISOLATIN5_ENC_FILE=\"$(ISOLATIN5_ENC_FILE)\" \ -DSTARTUP_FILE=\"$(STARTUP_FILE)\" \ -DLGF_LIB=\"$(LGF_LIB)\" \ -DASG_SPICE_LIB=\"$(ASG_SPICE_LIB)\" @@ -83,9 +55,16 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \ xcircuit_SOURCES = elements.c events.c filelist.c files.c \ flate.c fontfile.c formats.c functions.c graphic.c \ help.c keybindings.c libraries.c menucalls.c \ - netlist.c ngspice.c opengl.c parameter.c python.c \ + netlist.c ngspice.c parameter.c python.c \ rcfile.c render.c schema.c selection.c svg.c text.c undo.c \ - tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c + tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c \ + cairo.c utf8encodings.c +cairo.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +elements.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +events.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +fontfile.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +text.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +utf8encodings.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra xcircuit_DEPEND = @SUBLIB@ xcircuit_LDADD = @SUBLIB@ @STDLIBS@ @@ -110,7 +89,6 @@ DEFS = @DEFS@ $(PATHNAMES) INCLUDES = -IXw ${INC_SPECS} SHDLIB_EXT = @SHDLIB_EXT@ LDDL_FLAGS = @LDDL_FLAGS@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ LDFLAGS = @LDFLAGS@ EXTRA_LIB_SPECS = @EXTRA_LIB_SPECS@ TCL_LIB_DIR = @TCL_LIB_DIR@ @@ -122,6 +100,10 @@ librarydir = $(libdir)/$(PACKAGE)-$(VERSION) scriptsdir = $(libdir)/$(PACKAGE)-$(VERSION) USER_RC_FILE = .xcircuitrc PROLOGUE_FILE = xcircps2.pro +CYRILLIC_ENC_FILE = cyrillic.enc +ISOLATIN2_ENC_FILE = isolatin2.enc +ISOLATIN5_ENC_FILE = isolatin5.enc +ENCODING_FILES = ${CYRILLIC_ENC_FILE} ${ISOLATIN2_ENC_FILE} ${ISOLATIN5_ENC_FILE} LGF_LIB = lgf.lps ASG_SPICE_LIB = asg_spice.lps SIGNAL_LIB = signal.lps @@ -132,9 +114,10 @@ INTERP_PATH = @INTERP_PATH@ FONTS_LPS = courier courieriso2 courieriso5 helvetica helveticaiso2 \ helveticaiso5 myfont symbol times_roman times_romaniso2 \ times_romaniso5 -FONTS_XFE = courier courieriso courieriso2 courieriso5 helvetica \ - helveticaiso helveticaiso2 helveticaiso5 myfont symbol \ - times_roman times_romaniso times_romaniso2 times_romaniso5 +FONTS_XFE = courier courieriso courieriso2 courieriso5 courier_cyrillic \ + helvetica helveticaiso helveticaiso2 helveticaiso5 helvetica_cyrillic \ + times_roman times_romaniso times_romaniso2 times_romaniso5 \ + times_roman_cyrillic myfont symbol SCRIPTS_PY = spice gettext pagebbox WRAPPER_INIT = xcircuit.tcl @@ -144,6 +127,41 @@ WRAPPER_SH = xcircuit.sh CONSOLE = tkcon.tcl CONSOLE_SCRIPT = console.tcl +menudep$(EXEEXT): menudep.o + $(CC) -o $@ menudep.o + +menudep.h: menudep$(EXEEXT) + ./menudep$(EXEEXT) + +xcwrap.o: xcwrap.c menudep.h + $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} \ + $(PATHNAMES) $(INCLUDES) \ + xcwrap.c -c -o xcwrap.o + +lib/$(INTERP_PATH)/$(WRAPPER_OBJ): xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND} + $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) + $(SHLIB_LD) ${CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \ + ${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \ + ${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \ + ${LIB_SPECS} ${EXTRA_LIB_SPECS} + +xcircexec$(EXEEXT): xcircexec.o + $(RM) ./xcircexec$(EXEEXT) + $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \ + xcircexec.c -o xcircexec$(EXEEXT) ${LIB_SPECS} \ + ${LD_RUN_PATH} ${LDFLAGS} ${LIBS} ${EXTRA_LIB_SPECS} + +tcl: + @echo Making tcl library object + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (echo "Making tcl in $$subdir"; \ + cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \ + done + $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) + $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH) + $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT) + $(MAKE) xcircexec$(EXEEXT) + lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \ -e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \ @@ -180,7 +198,7 @@ install-data-local: lib/xcircuit.1 $(INSTALL_DATA) lib/xcircuit.1 $(DESTDIR)$(appmandir)/xcircuit.1 @echo "Installing library and netlist files" $(mkinstalldirs) $(DESTDIR)$(librarydir) - ( cd lib ; for i in $(PROLOGUE_FILE) *.lps *.cir; do \ + ( cd lib ; for i in $(PROLOGUE_FILE) $(ENCODING_FILES) *.lps *.cir; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \ done ) ( cd lib/$(INTERP_PATH) ; for i in $(STARTUP_FILE); do \ diff --git a/Makefile.in b/Makefile.in index edd0ae0..f8eef88 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -37,7 +81,7 @@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = xcircuit$(EXEEXT) subdir = . -DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in @@ -58,29 +102,55 @@ am_xcircuit_OBJECTS = elements.$(OBJEXT) events.$(OBJEXT) \ fontfile.$(OBJEXT) formats.$(OBJEXT) functions.$(OBJEXT) \ graphic.$(OBJEXT) help.$(OBJEXT) keybindings.$(OBJEXT) \ libraries.$(OBJEXT) menucalls.$(OBJEXT) netlist.$(OBJEXT) \ - ngspice.$(OBJEXT) opengl.$(OBJEXT) parameter.$(OBJEXT) \ - python.$(OBJEXT) rcfile.$(OBJEXT) render.$(OBJEXT) \ - schema.$(OBJEXT) selection.$(OBJEXT) svg.$(OBJEXT) \ - text.$(OBJEXT) undo.$(OBJEXT) tclxcircuit.$(OBJEXT) \ - tkSimple.$(OBJEXT) xcircuit.$(OBJEXT) xtfuncs.$(OBJEXT) \ - xtgui.$(OBJEXT) + ngspice.$(OBJEXT) parameter.$(OBJEXT) python.$(OBJEXT) \ + rcfile.$(OBJEXT) render.$(OBJEXT) schema.$(OBJEXT) \ + selection.$(OBJEXT) svg.$(OBJEXT) text.$(OBJEXT) \ + undo.$(OBJEXT) tclxcircuit.$(OBJEXT) tkSimple.$(OBJEXT) \ + xcircuit.$(OBJEXT) xtfuncs.$(OBJEXT) xtgui.$(OBJEXT) \ + cairo.$(OBJEXT) utf8encodings.$(OBJEXT) xcircuit_OBJECTS = $(am_xcircuit_OBJECTS) xcircuit_DEPENDENCIES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = menudep.c $(xcircuit_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -102,21 +172,50 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) ACLOCAL = @ACLOCAL@ # Override standard "make" target when compiling under TCL ALL_TARGET = @ALL_TARGET@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -139,6 +238,7 @@ EXEEXT = @EXEEXT@ EXTRA_LIB_SPECS = @EXTRA_LIB_SPECS@ GREP = @GREP@ GS_EXEC = @GS_EXEC@ +GS_LIBS = @GS_LIBS@ HAVE_LGF = @HAVE_LGF@ INC_SPECS = @INC_SPECS@ INSTALL = @INSTALL@ @@ -154,7 +254,7 @@ LDDL_FLAGS = @LDDL_FLAGS@ LDFLAGS = @LDFLAGS@ LD_RUN_PATH = @LD_RUN_PATH@ LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ +LIBS = @LIBS@ $(cairo_LIBS) $(fontconfig_LIBS) ${GS_LIBS} LIB_SPECS = @LIB_SPECS@ LTLIBOBJS = @LTLIBOBJS@ M4 = @M4@ @@ -169,13 +269,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ REVISION = @REVISION@ SET_MAKE = @SET_MAKE@ SHDLIB_EXT = @SHDLIB_EXT@ SHELL = @SHELL@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LIB_SPECS = @SHLIB_LIB_SPECS@ SPICE_EXEC = @SPICE_EXEC@ @@ -211,11 +313,15 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +cairo_CFLAGS = @cairo_CFLAGS@ +cairo_LIBS = @cairo_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +fontconfig_CFLAGS = @fontconfig_CFLAGS@ +fontconfig_LIBS = @fontconfig_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -249,6 +355,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies no-dist +AM_CFLAGS = $(cairo_CFLAGS) $(fontconfig_CFLAGS) ${GS_CFLAGS} # Additional files to distribute EXTRA_DIST = COPYRIGHT README README.ISOLatin2 README.notes @@ -278,6 +385,9 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \ -DUSER_RC_FILE=\"$(USER_RC_FILE)\" \ -DPROLOGUE_DIR=\"$(librarydir)\" \ -DPROLOGUE_FILE=\"$(PROLOGUE_FILE)\" \ + -DCYRILLIC_ENC_FILE=\"$(CYRILLIC_ENC_FILE)\" \ + -DISOLATIN2_ENC_FILE=\"$(ISOLATIN2_ENC_FILE)\" \ + -DISOLATIN5_ENC_FILE=\"$(ISOLATIN5_ENC_FILE)\" \ -DSTARTUP_FILE=\"$(STARTUP_FILE)\" \ -DLGF_LIB=\"$(LGF_LIB)\" \ -DASG_SPICE_LIB=\"$(ASG_SPICE_LIB)\" @@ -285,9 +395,10 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \ xcircuit_SOURCES = elements.c events.c filelist.c files.c \ flate.c fontfile.c formats.c functions.c graphic.c \ help.c keybindings.c libraries.c menucalls.c \ - netlist.c ngspice.c opengl.c parameter.c python.c \ + netlist.c ngspice.c parameter.c python.c \ rcfile.c render.c schema.c selection.c svg.c text.c undo.c \ - tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c + tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c \ + cairo.c utf8encodings.c xcircuit_DEPEND = @SUBLIB@ xcircuit_LDADD = @SUBLIB@ @STDLIBS@ @@ -302,6 +413,10 @@ librarydir = $(libdir)/$(PACKAGE)-$(VERSION) scriptsdir = $(libdir)/$(PACKAGE)-$(VERSION) USER_RC_FILE = .xcircuitrc PROLOGUE_FILE = xcircps2.pro +CYRILLIC_ENC_FILE = cyrillic.enc +ISOLATIN2_ENC_FILE = isolatin2.enc +ISOLATIN5_ENC_FILE = isolatin5.enc +ENCODING_FILES = ${CYRILLIC_ENC_FILE} ${ISOLATIN2_ENC_FILE} ${ISOLATIN5_ENC_FILE} LGF_LIB = lgf.lps ASG_SPICE_LIB = asg_spice.lps SIGNAL_LIB = signal.lps @@ -310,9 +425,10 @@ FONTS_LPS = courier courieriso2 courieriso5 helvetica helveticaiso2 \ helveticaiso5 myfont symbol times_roman times_romaniso2 \ times_romaniso5 -FONTS_XFE = courier courieriso courieriso2 courieriso5 helvetica \ - helveticaiso helveticaiso2 helveticaiso5 myfont symbol \ - times_roman times_romaniso times_romaniso2 times_romaniso5 +FONTS_XFE = courier courieriso courieriso2 courieriso5 courier_cyrillic \ + helvetica helveticaiso helveticaiso2 helveticaiso5 helvetica_cyrillic \ + times_roman times_romaniso times_romaniso2 times_romaniso5 \ + times_roman_cyrillic myfont symbol SCRIPTS_PY = spice gettext pagebbox WRAPPER_INIT = xcircuit.tcl @@ -325,7 +441,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -361,14 +477,18 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -389,7 +509,8 @@ uninstall-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -399,9 +520,10 @@ clean-binPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -xcircuit$(EXEEXT): $(xcircuit_OBJECTS) $(xcircuit_DEPENDENCIES) + +xcircuit$(EXEEXT): $(xcircuit_OBJECTS) $(xcircuit_DEPENDENCIES) $(EXTRA_xcircuit_DEPENDENCIES) @rm -f xcircuit$(EXEEXT) - $(LINK) $(xcircuit_OBJECTS) $(xcircuit_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(xcircuit_OBJECTS) $(xcircuit_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -410,17 +532,24 @@ distclean-compile: -rm -f *.tab.c .c.o: - $(COMPILE) -c $< + $(AM_V_CC)$(COMPILE) -c -o $@ $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list=''; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ @@ -449,27 +578,28 @@ uninstall-man1: sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -484,57 +614,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -550,12 +635,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -567,15 +647,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -584,9 +660,31 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) @@ -605,10 +703,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -688,25 +791,41 @@ uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-binPROGRAMS \ - clean-generic clean-noinstPROGRAMS ctags ctags-recursive \ - distclean distclean-compile distclean-generic distclean-tags \ - dvi dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am \ - install-data-local install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-binPROGRAMS \ + clean-cscope clean-generic clean-noinstPROGRAMS cscope \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags dvi dvi-am html html-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-data-local install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 +cairo.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +elements.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +events.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +fontfile.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +text.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra +utf8encodings.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra + +help.c: menudep.h +menucalls.c: menudep.h +rcfile.c: menudep.h +schema.c: menudep.h +xcircuit.c: menudep.h +parameter.c: menudep.h +python.c: menudep.h +tclxcircuit.c: menudep.h +xtgui.c: menudep.h +xtfuncs.c: menudep.h menudep$(EXEEXT): menudep.o $(CC) -o $@ menudep.o @@ -715,12 +834,13 @@ menudep.h: menudep$(EXEEXT) ./menudep$(EXEEXT) xcwrap.o: xcwrap.c menudep.h - $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \ + $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} \ + $(PATHNAMES) $(INCLUDES) \ xcwrap.c -c -o xcwrap.o -lib/tcl/xcircuit${SHDLIB_EXT}: xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND} - $(RM) lib/xcircuit${SHDLIB_EXT} - $(CC) ${CFLAGS} ${SHLIB_CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \ +lib/$(INTERP_PATH)/$(WRAPPER_OBJ): xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND} + $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) + $(SHLIB_LD) ${CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \ ${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \ ${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \ ${LIB_SPECS} ${EXTRA_LIB_SPECS} @@ -737,22 +857,11 @@ tcl: test "$$subdir" = . || (echo "Making tcl in $$subdir"; \ cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \ done - $(MAKE) lib/tcl/xcircuit${SHDLIB_EXT} + $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH) $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT) $(MAKE) xcircexec$(EXEEXT) -help.c: menudep.h -menucalls.c: menudep.h -rcfile.c: menudep.h -schema.c: menudep.h -xcircuit.c: menudep.h -parameter.c: menudep.h -python.c: menudep.h -tclxcircuit.c: menudep.h -xtgui.c: menudep.h -xtfuncs.c: menudep.h - lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \ -e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \ @@ -789,7 +898,7 @@ install-data-local: lib/xcircuit.1 $(INSTALL_DATA) lib/xcircuit.1 $(DESTDIR)$(appmandir)/xcircuit.1 @echo "Installing library and netlist files" $(mkinstalldirs) $(DESTDIR)$(librarydir) - ( cd lib ; for i in $(PROLOGUE_FILE) *.lps *.cir; do \ + ( cd lib ; for i in $(PROLOGUE_FILE) $(ENCODING_FILES) *.lps *.cir; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \ done ) ( cd lib/$(INTERP_PATH) ; for i in $(STARTUP_FILE); do \ diff --git a/Makefile.mingw64 b/Makefile.mingw64 index a060520..6f01eff 100644 --- a/Makefile.mingw64 +++ b/Makefile.mingw64 @@ -24,7 +24,7 @@ ########################### # INSTALLDIR = C:\app\xcircuit-tcl # INSTALLDIR = C:/MinGW/msys/1.0/home/TEdwards/xcircuit-tcl -INSTALLDIR = C:/OpenCircuitDesign/XCircuit-3.8 +INSTALLDIR = C:/OpenCircuitDesign/XCircuit-3.9 # TEMPDIR = D:\Temp # TEMPDIR = C:/Temp TEMPDIR = C:/OpenCircuitDesign/Temp @@ -78,9 +78,8 @@ xcircuit_OBJECTS = elements.$(OBJEXT) events.$(OBJEXT) \ fontfile.$(OBJEXT) formats.$(OBJEXT) functions.$(OBJEXT) \ graphic.$(OBJEXT) help.$(OBJEXT) keybindings.$(OBJEXT) \ libraries.$(OBJEXT) menucalls.$(OBJEXT) netlist.$(OBJEXT) \ - ngspice.$(OBJEXT) opengl.$(OBJEXT) parameter.$(OBJEXT) \ - python.$(OBJEXT) rcfile.$(OBJEXT) render.$(OBJEXT) \ - svg.$(OBJEXT) \ + ngspice.$(OBJEXT) parameter.$(OBJEXT) python.$(OBJEXT) \ + rcfile.$(OBJEXT) render.$(OBJEXT) svg.$(OBJEXT) \ schema.$(OBJEXT) selection.$(OBJEXT) text.$(OBJEXT) \ undo.$(OBJEXT) xcircuit.$(OBJEXT) $(WIN32_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) @@ -172,8 +171,8 @@ OBJEXT = o PACKAGE = xcircuit PACKAGE_NAME = xcircuit PATH_SEPARATOR = \\ -VERSION = 3.8 -REVISION = 17 +VERSION = 3.9 +REVISION = 44 SHDLIB_EXT = .dll SHLIB_CFLAGS = -shared SHLIB_LIB_SPECS = @@ -214,9 +213,8 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \ xcircuit_SOURCES = elements.c events.c filelist.c files.c \ flate.c fontfile.c formats.c functions.c graphic.c \ help.c keybindings.c libraries.c menucalls.c \ - netlist.c ngspice.c opengl.c parameter.c python.c \ - rcfile.c render.c schema.c selection.c \ - svg.c \ + netlist.c ngspice.c parameter.c python.c rcfile.c \ + render.c schema.c selection.c svg.c \ text.c undo.c \ tclxcircuit.c tkSimple.c xcircuit.c w32x11.c @@ -337,12 +335,14 @@ lib/$(INTERP_PATH)/$(WRAPPER_SH): $(PP) lib/$(INTERP_PATH)/$(WRAPPER_SH).in $(PP) $(PATHNAMES) -DXCLIBDIR=\"$(subst \,/,$(librarydir))\" \ -DWRAPPER_INIT=\"$(WRAPPER_INIT)\" -DCONSOLE=\"$(CONSOLE)\" \ -DCONSOLE_SCRIPT=\"$(CONSOLE_SCRIPT)\" \ + -DSCRIPTSDIR=\"$(scriptsdir)\" \ -DTCLLIBDIR=\"$(subst \,/,$(TCL_LIB_DIR))\" \ -DWISH_EXE=\"$(subst \,/,$(WISH_EXE))\" \ lib/$(INTERP_PATH)/$(WRAPPER_SH).in > $@ lib/$(INTERP_PATH)/$(WRAPPER_INIT): $(PP) lib/$(INTERP_PATH)/$(WRAPPER_INIT).in $(PP) $(PATHNAMES) -DLIBDIR=\"$(subst \,/,$(librarydir))\" \ + -DSCRIPTSDIR=\"$(scriptsdir)\" \ lib/$(INTERP_PATH)/$(WRAPPER_INIT).in > $@ lib/xcircuit.1: $(PP) lib/xcircuit.1.in @@ -444,7 +444,6 @@ libraries.c: xcircuit.h menucalls.c: xcircuit.h netlist.c: xcircuit.h ngspice.c: xcircuit.h -opengl.c: xcircuit.h parameter.c: xcircuit.h python.c: xcircuit.h rcfile.c: xcircuit.h diff --git a/README b/README index d2d3c55..9012a2e 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ -XCircuit v3.8 +XCircuit v3.9 ----------------------------------------------------------------------------- An X11 drawing program [especially for circuit schematics] -(c) 2013 Tim Edwards (see copyright notice in ./COPYRIGHT) -August 1993 -- January 2013 +(c) 2014 Tim Edwards (see copyright notice in ./COPYRIGHT) +August 1993 -- May 2014 ----------------------------------------------------------------------------- Compilation/Installation notes: @@ -13,6 +13,8 @@ Compilation/Installation notes: Run "./configure --help" for a list of configure options. For most users, the relevant options are the following: + --with-cairo Enable cairo graphics + --with-tcl Configure xcircuit as an extension to Tcl/Tk. Tcl becomes the default interpreter. Option is mutually exclusive with "--with-python". A feature of this @@ -166,6 +168,13 @@ Compilation/Installation notes: This has been fixed for the AMD Opteron under Fedora Core; other 64-bit systems are untested. +7) aclocal problems: In case during the make process the system complains + about a missing or out of date aclocal, rebuild the configure file with: + + autoreconf -fi + + And restart the ./configure command + ----------------------------------------------------------------------------- Shared Python Library: diff --git a/README.CharEncoding b/README.CharEncoding new file mode 100644 index 0000000..6c7a379 --- /dev/null +++ b/README.CharEncoding @@ -0,0 +1,126 @@ +------------------------------------------------------------------- +Charater font encoding in xcircuit +------------------------------------------------------------------- + +Xcircuit supports ISO-Latin2 encoding (Eastern Europe) since +version 2.0a9. This support was extended to ISO-Latin5 +(Turkish) in version 2.0a10 (6/14/1999), and Cyrillic (ISO-8859-5) +in version 3.9.64 (3/29/2017). Between 1999 and 2017, projects +like fontforge made it much easier to obtain and use Type1 +PostScript fonts. While the fonts are not generally available +on printers, generally files are converted to PDF for printing, +and ps2pdf takes care of inserting the proper font glyphs, and +most Linux systems have URW fonts installed, or at least they +are easy to obtain. + +In the latest version the above encodings can be reached simply +by selecting Text->Encoding->(name of encoding). As of this +writing, Cyrillic fonts are not available in xcircuit drawn +vector form, but are available from the font rendering engine +if xcircuit is compiled with Cairo graphics. Font encodings +using standard glyph names (e.g., from URW fonts and others) +are kept in text files in the runtime directories and are +inserted into the output so that no further manipulation is +needed to view the proper text characters. + +The instructions below are generally deprecated; use of +"ogonkify" works only on ISO-Latin-X encodings (not, for +example, Cyrillic). It is needed to generate the correct +glyphs for sending PostScript output directly to a printer. +However, as noted above, modern usage is generally to first +convert to PDF format, for which ogonkify is not needed. + +Version 3.6.36 corrects a long-existing mistake in which only X11 +keysyms 0-255 are accepted as keyboard-entry. By converting the +X11 keysyms to keycodes, non-ASCII-encoded characters can be typed +directly into XCircuit from the keyboard. It would be nice, +though, if XCircuit would auto-detect the expected encoding from +the keysym and insert the proper font encoding switch, loading +fonts if necessary. + +When creating text in an encoding other than PostScript "standard", +be sure to select "Text->Encoding->(encoding name)" from the menu. +This can be enabled by default simply by having a .xcircuitrc file +in your home directory containing a line such as: + + label encoding ISOLatin2 + +------------------------------------------------------------------- + +1) The best practice is to convert all xcircuit output to PDF + using, typically, ps2pdf, and then ignore all the instruction + below, since the PDF file contains all font information needed + for printing. + +2) To get proper PostScript output on a printer (when sending + PostScript directly---this does not apply to PDF files!), you + will need to have the (separate) program "ogonkify", found at: + + http://www.dcs.ed.ac.uk/home/jec/ogonkify/ + ftp://ftp.dcs.ed.ac.uk/pub/jec/programs + + "ogonkify" is necessary because PostScript does not contain + ISO-Latin2 encoding by default. The accents such as the caron + and ogonek exist in the font definition, but the correct + alignments for putting them together need to be provided. + Ogonkify does this best. + +3) Every file containing ISO-Latin2 text must be postprocessed + through "ogonkify" using the following command, before it will + print correctly on a PostScript printer: + + ogonkify -e L2 -ATH file.ps | perl -ne \ + 's/StandardEncoding/ISOLatin2Encoding/g;\ + s/ exch defi/ISO2 exch defi/g;print' > file.out.ps + + Switches: -A does Courier, -T does Times-Roman, and -H does + Helvetica; use only what's necessary to keep the output file + smaller. "-e L2" signifies Latin2 encoding; this is not + strictly necessary as ogonkify defaults to L2. All other + Latin encodings require the -e switch. + + Note that the output is piped through a couple of perl + commands. This may seem overly complicated; the first + substitution corrects a bug in ogonkify output (which may + disappear from releases of ogonkify in the future). The + second substitution allows xcircuit to specify the ISO-Latin2 + encodings separately from ISO-Latin1 and Adobe Standard + encodings, so that any and all encodings can be "mixed and + matched" in the same file and even the same label. + +4) In a nutshell: xcircuit defines each ISO-Latin2 font name as + the original name followed by the string "ISO2". Xcircuit + can then load the file and interpret the font encodings + unambiguously. However, the new ISO-Latin2 font names are not + defined by PostScript. Running "ogonkify" in the manner shown + above will add a true PostScript definition for each of the + ISO-Latin2 fonts. Without "ogonkify", a PostScript printer + or interpreter will either produce an error or else substitute + a default font for the unrecognized one. + +5) The "ogonkification" of the file will not affect xcircuit's + ability to read it back into the program. xcircuit will + continue to display the ISO-Latin2 text correctly regardless of + whether or not the file has been run through "ogonkify". + However, the header material inserted by "ogonkify" will be + lost every time xcircuit writes the file back out. + +6) Other ISO-LatinX encodings: Currently ISO-Latin5 is supported, + and additional encodings will be created as I get requests for + them. Follow the instructions above for ISO-Latin2, but replace + all occurences of "2" with "5". + + e.g., + + ogonkify -e L5 -ATH file.ps | perl -ne \ + 's/StandardEncoding/ISOLatin5Encoding/g;\ + s/ exch defi/ISO5 exch defi/g;print' > file.out.ps + + and add lines + + % times_romaniso5.xfe loadfontencoding + % courieriso5.xfe loadfontencoding + % helveticaiso5.xfe loadfontencoding + + to psfiles/builtins.lps (or /usr/local/lib/xcircuit-2.0/builtins.lps, if + already installed). diff --git a/README.ISOLatin2 b/README.ISOLatin2 deleted file mode 100644 index 6b17aa0..0000000 --- a/README.ISOLatin2 +++ /dev/null @@ -1,108 +0,0 @@ -------------------------------------------------------------------- -ISO-Latin2 through ISO-Latin6 encoded fonts in xcircuit -------------------------------------------------------------------- - -Xcircuit supports ISO-Latin2 encoding (Eastern Europe) since -version 2.0a9. This feature is not set up by default because -PostScript output is not (yet) possible without the use of the -program "ogonkify". This support has been extended to other -Latin encodings: ISO-Latin5 (Turkish) version 2.0a10 (6/14/99). - -Here's how to get ISO-Latin2 and other Latin encodings in -xcircuit: - -------------------------------------------------------------------- - -1) Edit file lib/startup.script. Uncomment (remove the leading - '%' from) lines 15-17 (the ISO-Latin2 font encoding files). Do - this before "make install"; otherwise, the file will be in - (depending on the definition of XCIRCUIT_LIB_DIR in the - Makefile) /usr/local/lib/xcircuit-3.6/startup.script. - In the Tcl/Tk version, this file is lib/tcl/xcstartup.tcl, - or, after installation, /usr/local/lib/xcircuit-3.6/xcstartup.tcl. - -2) When creating text, be sure to select "Text->Encoding-> - ISO-Latin2" from the menu. This can be enabled by default - simply by having a .xcircuitrc file in your home directory - containing a line such as: - - set default font Times-RomanISO2 - -3) To get proper PostScript output on a printer, you will need to - have the (separate) program "ogonkify", found at: - - http://www.dcs.ed.ac.uk/home/jec/ogonkify/ - ftp://ftp.dcs.ed.ac.uk/pub/jec/programs - - "ogonkify" is necessary because PostScript does not contain - ISO-Latin2 encoding by default. The accents such as the caron - and ogonek exist in the font definition, but the correct - alignments for putting them together need to be provided. - Ogonkify does this best. - -4) Every file containing ISO-Latin2 text must be postprocessed - through "ogonkify" using the following command, before it will - print correctly on a PostScript printer: - - ogonkify -e L2 -ATH file.ps | perl -ne \ - 's/StandardEncoding/ISOLatin2Encoding/g;\ - s/ exch defi/ISO2 exch defi/g;print' > file.out.ps - - Switches: -A does Courier, -T does Times-Roman, and -H does - Helvetica; use only what's necessary to keep the output file - smaller. "-e L2" signifies Latin2 encoding; this is not - strictly necessary as ogonkify defaults to L2. All other - Latin encodings require the -e switch. - - Note that the output is piped through a couple of perl - commands. This may seem overly complicated; the first - substitution corrects a bug in ogonkify output (which may - disappear from releases of ogonkify in the future). The - second substitution allows xcircuit to specify the ISO-Latin2 - encodings separately from ISO-Latin1 and Adobe Standard - encodings, so that any and all encodings can be "mixed and - matched" in the same file and even the same label. - -5) In a nutshell: xcircuit defines each ISO-Latin2 font name as - the original name followed by the string "ISO2". Xcircuit - can then load the file and interpret the font encodings - unambiguously. However, the new ISO-Latin2 font names are not - defined by PostScript. Running "ogonkify" in the manner shown - above will add a true PostScript definition for each of the - ISO-Latin2 fonts. Without "ogonkify", a PostScript printer - or interpreter will either produce an error or else substitute - a default font for the unrecognized one. - -6) The "ogonkification" of the file will not affect xcircuit's - ability to read it back into the program. xcircuit will - continue to display the ISO-Latin2 text correctly regardless of - whether or not the file has been run through "ogonkify". - However, the header material inserted by "ogonkify" will be - lost every time xcircuit writes the file back out. - -7) Other ISO-LatinX encodings: Currently ISO-Latin5 is supported, - and additional encodings will be created as I get requests for - them. Follow the instructions above for ISO-Latin2, but replace - all occurences of "2" with "5". - - e.g., - - ogonkify -e L5 -ATH file.ps | perl -ne \ - 's/StandardEncoding/ISOLatin5Encoding/g;\ - s/ exch defi/ISO5 exch defi/g;print' > file.out.ps - - and add lines - - % times_romaniso5.xfe loadfontencoding - % courieriso5.xfe loadfontencoding - % helveticaiso5.xfe loadfontencoding - - to psfiles/builtins.lps (or /usr/local/lib/xcircuit-2.0/builtins.lps, if - already installed). - -8) Version 3.6.36 corrects a long-existing mistake in which only X11 keysyms - 0-255 are accepted as keyboard-entry. By converting the X11 keysyms to - keycodes, ISO-Latin2 characters can be typed directly into XCircuit from - the keyboard. It would be nice, though, if XCircuit would auto-detect - the expected encoding from the keysym and insert the proper font switch, - loading fonts if necessary. diff --git a/VERSION b/VERSION index 9722aed..de353ad 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.8.78 +3.9.73 diff --git a/Xw/Makefile b/Xw/Makefile new file mode 100644 index 0000000..3308da7 --- /dev/null +++ b/Xw/Makefile @@ -0,0 +1,686 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Xw/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/xcircuit +pkgincludedir = $(includedir)/xcircuit +pkglibdir = $(libdir)/xcircuit +pkglibexecdir = $(libexecdir)/xcircuit +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +target_triplet = x86_64-unknown-linux-gnu +subdir = Xw +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_$(V)) +am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY)) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libxcXw_a_AR = $(AR) $(ARFLAGS) +libxcXw_a_LIBADD = +am_libxcXw_a_OBJECTS = BBoard.$(OBJEXT) Button.$(OBJEXT) \ + Cascade.$(OBJEXT) Display.$(OBJEXT) Form.$(OBJEXT) \ + Manager.$(OBJEXT) MapEvents.$(OBJEXT) MenuBtn.$(OBJEXT) \ + MenuMgr.$(OBJEXT) MenuPane.$(OBJEXT) PButton.$(OBJEXT) \ + PopupMgr.$(OBJEXT) Primitive.$(OBJEXT) ResConvert.$(OBJEXT) \ + SText.$(OBJEXT) SourceStr.$(OBJEXT) TextEdit.$(OBJEXT) \ + Toggle.$(OBJEXT) Traversal.$(OBJEXT) WorkSpace.$(OBJEXT) +libxcXw_a_OBJECTS = $(am_libxcXw_a_OBJECTS) +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libxcXw_a_SOURCES) +DIST_SOURCES = $(libxcXw_a_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = aclocal-1.14 +ALL_TARGET = all-recursive +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AUTOCONF = autoconf +AUTOHEADER = autoheader +AUTOMAKE = automake-1.14 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=none +CFLAGS = -g -Wno-pointer-sign -fPIC +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"xcircuit\" -DVERSION=\"3.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DSPICE_EXEC=\"ngspice\" -DTCL_WRAPPER=1 +DEPDIR = .deps +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +EXTRA_LIB_SPECS = -lm +GREP = /bin/grep +GS_EXEC = gs +GS_LIBS = +HAVE_LGF = LGF +INC_SPECS = -I/usr/include -I/usr/include +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INSTALL_TARGET = install-recursive +INTERPRETER = TCL +INTERP_PATH = tcl +LD = /bin/ld +LDDL_FLAGS = -Wl,-z,relro -Wl,--export-dynamic -Wl,--version-script=symbol.map +LDFLAGS = +LD_RUN_PATH = -Wl,-rpath,/usr/lib64 +LIBOBJS = +LIBS = -ldl -lz -lpthread -lieee -lm -lz -lXt -lSM -lICE -lm -lX11 -lXpm +LIB_SPECS = -L/usr/lib64 -ltcl8.6 -L/usr/lib64 -ltk8.6 +LTLIBOBJS = +M4 = /bin/m4 +MAKEINFO = makeinfo +MKDIR_P = /bin/mkdir -p +OBJEXT = o +PACKAGE = xcircuit +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_CONFIG = /bin/pkg-config +PKG_CONFIG_LIBDIR = +PKG_CONFIG_PATH = +PYTHON = +RANLIB = ranlib +REVISION = 71 +SET_MAKE = +SHDLIB_EXT = .so +SHELL = /bin/sh +SHLIB_LD = ${CC} -shared ${CFLAGS} ${LDFLAGS} -fPIC -Wl,-soname,${@} +SHLIB_LIB_SPECS = +SPICE_EXEC = ngspice +STARTUP_FILE = xcstartup.tcl +STDLIBS = +STRIP = +SUBDIRS = +SUBLIB = +TCL_LIB_DIR = /usr/lib64 +VERSION = 3.9 +WISH_EXE = /usr/bin/wish +WRAPPER_SCRIPT = wrapper.tcl +XCIRCUIT_TARGET = tcl +XMKMF = +X_CFLAGS = +X_EXTRA_LIBS = +X_LIBS = +X_PRE_LIBS = -lSM -lICE +abs_builddir = /home/tim/gitsrc/xcircuit-3.9/Xw +abs_srcdir = /home/tim/gitsrc/xcircuit-3.9/Xw +abs_top_builddir = /home/tim/gitsrc/xcircuit-3.9 +abs_top_srcdir = /home/tim/gitsrc/xcircuit-3.9 +ac_ct_CC = gcc +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +cairo_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 +cairo_LIBS = -lcairo +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +fontconfig_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 +fontconfig_LIBS = -lfontconfig -lfreetype +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/tim/gitsrc/xcircuit-3.9/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = x86_64-unknown-linux-gnu +target_alias = +target_cpu = x86_64 +target_os = linux-gnu +target_vendor = unknown +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +AUTOMAKE_OPTIONS = foreign no-dependencies +EXTRA_DIST = sub.c +INCLUDES = -I.. + +# Requirements for Xw library +noinst_LIBRARIES = libxcXw.a +libxcXw_a_SOURCES = BBoard.c Button.c Cascade.c Display.c Form.c \ + Manager.c MapEvents.c MenuBtn.c MenuMgr.c MenuPane.c \ + PButton.c PopupMgr.c Primitive.c ResConvert.c SText.c \ + SourceStr.c TextEdit.c Toggle.c Traversal.c WorkSpace.c + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Xw/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Xw/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +libxcXw.a: $(libxcXw_a_OBJECTS) $(libxcXw_a_DEPENDENCIES) $(EXTRA_libxcXw_a_DEPENDENCIES) + $(AM_V_at)-rm -f libxcXw.a + $(AM_V_AR)$(libxcXw_a_AR) libxcXw.a $(libxcXw_a_OBJECTS) $(libxcXw_a_LIBADD) + $(AM_V_at)$(RANLIB) libxcXw.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(AM_V_CC)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LIBRARIES) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Xw/Makefile.in b/Xw/Makefile.in index 2c586b8..d9d360d 100644 --- a/Xw/Makefile.in +++ b/Xw/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -36,7 +80,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = Xw -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -47,6 +92,10 @@ CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = libxcXw_a_AR = $(AR) $(ARFLAGS) libxcXw_a_LIBADD = am_libxcXw_a_OBJECTS = BBoard.$(OBJEXT) Button.$(OBJEXT) \ @@ -57,27 +106,73 @@ am_libxcXw_a_OBJECTS = BBoard.$(OBJEXT) Button.$(OBJEXT) \ SText.$(OBJEXT) SourceStr.$(OBJEXT) TextEdit.$(OBJEXT) \ Toggle.$(OBJEXT) Traversal.$(OBJEXT) WorkSpace.$(OBJEXT) libxcXw_a_OBJECTS = $(am_libxcXw_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libxcXw_a_SOURCES) DIST_SOURCES = $(libxcXw_a_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -110,6 +205,7 @@ am__relativize = \ ACLOCAL = @ACLOCAL@ ALL_TARGET = @ALL_TARGET@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -130,6 +226,7 @@ EXEEXT = @EXEEXT@ EXTRA_LIB_SPECS = @EXTRA_LIB_SPECS@ GREP = @GREP@ GS_EXEC = @GS_EXEC@ +GS_LIBS = @GS_LIBS@ HAVE_LGF = @HAVE_LGF@ INC_SPECS = @INC_SPECS@ INSTALL = @INSTALL@ @@ -160,13 +257,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ REVISION = @REVISION@ SET_MAKE = @SET_MAKE@ SHDLIB_EXT = @SHDLIB_EXT@ SHELL = @SHELL@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LIB_SPECS = @SHLIB_LIB_SPECS@ SPICE_EXEC = @SPICE_EXEC@ @@ -202,11 +301,15 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +cairo_CFLAGS = @cairo_CFLAGS@ +cairo_LIBS = @cairo_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +fontconfig_CFLAGS = @fontconfig_CFLAGS@ +fontconfig_LIBS = @fontconfig_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -287,10 +390,11 @@ $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libxcXw.a: $(libxcXw_a_OBJECTS) $(libxcXw_a_DEPENDENCIES) - -rm -f libxcXw.a - $(libxcXw_a_AR) libxcXw.a $(libxcXw_a_OBJECTS) $(libxcXw_a_LIBADD) - $(RANLIB) libxcXw.a + +libxcXw.a: $(libxcXw_a_OBJECTS) $(libxcXw_a_DEPENDENCIES) $(EXTRA_libxcXw_a_DEPENDENCIES) + $(AM_V_at)-rm -f libxcXw.a + $(AM_V_AR)$(libxcXw_a_AR) libxcXw.a $(libxcXw_a_OBJECTS) $(libxcXw_a_LIBADD) + $(AM_V_at)$(RANLIB) libxcXw.a mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -299,28 +403,31 @@ distclean-compile: -rm -f *.tab.c .c.o: - $(COMPILE) -c $< + $(AM_V_CC)$(COMPILE) -c -o $@ $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -335,57 +442,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -401,12 +463,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -418,15 +475,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -435,6 +488,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -471,13 +539,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -512,10 +577,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -594,22 +664,21 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic \ - clean-noinstLIBRARIES ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/aclocal.m4 b/aclocal.m4 index 1bc55f4..1f91f85 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,15 +11,231 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -31,10 +247,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,22 +266,22 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -84,7 +300,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -110,22 +326,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -144,16 +357,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -163,7 +374,7 @@ fi])]) # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -176,12 +387,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -189,8 +401,9 @@ AC_CACHE_CHECK([dependency style of $depcc], # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -229,16 +442,16 @@ AC_CACHE_CHECK([dependency style of $depcc], : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -247,16 +460,16 @@ AC_CACHE_CHECK([dependency style of $depcc], test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -304,7 +517,7 @@ AM_CONDITIONAL([am__fastdep$1], [ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -314,34 +527,39 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -354,7 +572,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -366,21 +584,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -398,7 +614,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -408,18 +624,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -432,7 +651,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -461,31 +680,40 @@ AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -496,34 +724,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -545,7 +817,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -564,16 +836,14 @@ if test x"${install_sh}" != xset; then install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -589,14 +859,12 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -614,7 +882,7 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -641,15 +909,12 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -657,11 +922,10 @@ AC_DEFUN([AM_MISSING_PROG], $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -674,63 +938,35 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -741,24 +977,82 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Check to make sure that the build environment is sane. -*- Autoconf -*- +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -769,32 +1063,40 @@ case `pwd` in esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -804,9 +1106,85 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -814,34 +1192,32 @@ AC_MSG_RESULT(yes)]) # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -849,24 +1225,22 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -876,75 +1250,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR diff --git a/cairo.c b/cairo.c new file mode 100644 index 0000000..828e122 --- /dev/null +++ b/cairo.c @@ -0,0 +1,1415 @@ +/*-------------------------------------------------------------------------*/ +/* cairo.c --- mainly cairo versions of the UDraw... stuff in functions.c */ +/* Copyright (c) 2002 Tim Edwards, Johns Hopkins University */ +/*-------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------*/ +/* originally written by Tim Edwards, 8/13/93 */ +/* All cairo graphics library modifications by Erik van der Wal, May 2014 */ +/*-------------------------------------------------------------------------*/ + +#ifdef HAVE_CAIRO + +#include +#include +#include +#include +#include +#include + +#ifndef XC_WIN32 +#include +#endif + +#ifdef TCL_WRAPPER +#include +#endif /* TCL_WRAPPER */ + +#include "xcircuit.h" +#include "colordefs.h" +#include "prototypes.h" + +#ifdef CAIRO_HAS_FC_FONT +#include +#endif /* CAIRO_HAS_FC_FONT */ + +#ifdef HAVE_GS +#include +#include +#include +#endif /* HAVE_GS */ + +extern XCWindowData *areawin; +extern Globaldata xobjs; +extern int number_colors; +extern colorindex *colorlist; +extern short fontcount; +extern fontinfo *fonts; +extern Cursor appcursors[NUM_CURSORS]; +extern Display *dpy; +extern gs_state_t gs_state; +extern cairo_surface_t *bbuf; + +static cairo_user_data_key_t fontinfo_key; + +static void xc_cairo_strokepath(short style, float width); + +/*----------------------------------------------------------------------------*/ + +void xc_cairo_set_matrix(const Matrix *xcm) +{ + cairo_matrix_t m; + m.xx = xcm->a; m.xy = xcm->b; m.x0 = xcm->c; + m.yx = xcm->d; m.yy = xcm->e; m.y0 = xcm->f; + cairo_set_matrix(areawin->cr, &m); +} + +/*----------------------------------------------------------------------*/ +/* Set the color, based on the given color index */ +/*----------------------------------------------------------------------*/ + +void xc_cairo_set_color(int coloridx) +{ + colorindex *xcc; + + if (coloridx >= number_colors) return; + + xcc = &colorlist[coloridx]; + cairo_set_source_rgb(areawin->cr, + (double)xcc->color.red / 65535., + (double)xcc->color.green / 65535., + (double)xcc->color.blue / 65535.); +} + +/*----------------------------------------------------------------------------*/ + +void UDrawLine(XPoint *pt1, XPoint *pt2) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + + cairo_set_line_width(areawin->cr, xobjs.pagelist[areawin->page]->wirewidth); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL); + + cairo_move_to(areawin->cr, pt1->x, pt1->y); + cairo_line_to(areawin->cr, pt2->x, pt2->y); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Add circle at given point to indicate that the point is a parameter. */ +/* The circle is divided into quarters. For parameterized y-coordinate */ +/* the top and bottom quarters are drawn. For parameterized x- */ +/* coordinate, the left and right quarters are drawn. A full circle */ +/* indicates either both x- and y-coordinates are parameterized, or */ +/* else any other kind of parameterization (presently, not used). */ +/* */ +/* (note that the two angles in XDrawArc() are 1) the start angle, */ +/* measured in absolute 64th degrees from 0 (3 o'clock), and 2) the */ +/* path length, in relative 64th degrees (positive = counterclockwise, */ +/* negative = clockwise)). */ +/*----------------------------------------------------------------------*/ + +void UDrawCircle(XPoint *upt, u_char which) +{ + XPoint wpt; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + user_to_window(*upt, &wpt); + cairo_set_line_width(areawin->cr, .75); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER); + + /* TODO: angles might be mirrored or turning the wrong way */ + switch(which) { + case P_POSITION_X: + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * -.25, M_PI * .25); + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .75, M_PI * 1.25); + break; + case P_POSITION_Y: + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .25, M_PI * .75); + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * 1.25, M_PI * 1.75); + break; + default: + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., 0., M_PI * 2.); + break; + } + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Add "X" at string origin */ +/*----------------------------------------------------------------------*/ + +void UDrawXAt(XPoint *wpt) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_width(areawin->cr, .75); + + cairo_move_to(areawin->cr, wpt->x - 3., wpt->y - 3.); + cairo_line_to(areawin->cr, wpt->x + 3., wpt->y + 3.); + cairo_move_to(areawin->cr, wpt->x + 3., wpt->y - 3.); + cairo_line_to(areawin->cr, wpt->x - 3., wpt->y + 3.); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +void UDrawXLine(XPoint opt, XPoint cpt) +{ + XPoint upt, vpt; + double dashes[] = {4., 4.}; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + xc_cairo_set_color(AUXCOLOR); + cairo_set_dash(areawin->cr, dashes, sizeof(dashes) / sizeof(double), 0.); + cairo_set_line_width(areawin->cr, .75); + + user_to_window(cpt, &upt); + user_to_window(opt, &vpt); + cairo_move_to(areawin->cr, vpt.x, vpt.y); + cairo_line_to(areawin->cr, upt.x, upt.y); + cairo_stroke(areawin->cr); + + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_move_to(areawin->cr, upt.x - 3., upt.y - 3.); + cairo_line_to(areawin->cr, upt.x + 3., upt.y + 3.); + cairo_move_to(areawin->cr, upt.x + 3., upt.y - 3.); + cairo_line_to(areawin->cr, upt.x - 3., upt.y + 3.); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*-------------------------------------------------------------------------*/ + +void UDrawBox(XPoint origin, XPoint corner) +{ + XPoint worig, wcorn; + double r, g, b, a; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + user_to_window(origin, &worig); + user_to_window(corner, &wcorn); + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + cairo_set_line_width(areawin->cr, 1.0); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER); + + cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5); + cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5); + cairo_close_path(areawin->cr); + + xc_cairo_set_color(AUXCOLOR); + cairo_pattern_get_rgba(cairo_get_source(areawin->cr), &r, &g, &b, &a); + cairo_set_source_rgba(areawin->cr, r, g, b, .1 * a); + cairo_fill_preserve(areawin->cr); + cairo_set_source_rgba(areawin->cr, r, g, b, a); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Draw a box indicating the dimensions of the edit element that most */ +/* closely reach the position "corner". */ +/*----------------------------------------------------------------------*/ + +void UDrawRescaleBox(XPoint *corner) +{ + XPoint newpoints[5]; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + /* No return here, since the return value might be needed? */ + } + + if (areawin->selects == 0) + return; + + if (areawin->redraw_ongoing) { + int i; + UGetRescaleBox(corner, newpoints); + + cairo_save(areawin->cr); + xc_cairo_set_color(AUXCOLOR); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL); + cairo_move_to(areawin->cr, newpoints[0].x, newpoints[0].y); + for (i = 1; i < 4; i++) + cairo_line_to(areawin->cr, newpoints[i].x, newpoints[i].y); + xc_cairo_strokepath(0, 1); + cairo_restore(areawin->cr); + } +} + +/*-------------------------------------------------------------------------*/ + +void UDrawBBox() +{ + XPoint origin; + XPoint worig, wcorn, corner; + objinstptr bbinst = areawin->topinstance; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + if ((!areawin->bboxon) || (checkforbbox(topobject) != NULL)) return; + + origin = bbinst->bbox.lowerleft; + corner.x = origin.x + bbinst->bbox.width; + corner.y = origin.y + bbinst->bbox.height; + + /* Include any schematic labels in the bounding box. */ + extendschembbox(bbinst, &origin, &corner); + + user_to_window(origin, &worig); + user_to_window(corner, &wcorn); + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + xc_cairo_set_color(BBOXCOLOR); + cairo_set_line_width(areawin->cr, 1.0); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER); + + cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5); + cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5); + cairo_close_path(areawin->cr); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Main recursive object instance drawing routine. */ +/* context is the instance information passed down from above */ +/* theinstance is the object instance to be drawn */ +/* level is the level of recursion */ +/* passcolor is the inherited color value passed to object */ +/* passwidth is the inherited linewidth value passed to the object */ +/* stack contains graphics context information */ +/*----------------------------------------------------------------------*/ + +void UDrawObject(objinstptr theinstance, short level, int passcolor, + float passwidth, pushlistptr *stack) +{ + genericptr *areagen; + float tmpwidth; + int defaultcolor = passcolor; + int curcolor = passcolor; + int thispart; + short savesel; + XPoint bboxin[2], bboxout[2]; + u_char xm, ym; + objectptr theobject = theinstance->thisobject; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + /* Save the number of selections and set it to zero while we do the */ + /* object drawing. */ + + savesel = areawin->selects; + areawin->selects = 0; + + /* All parts are given in the coordinate system of the object, unless */ + /* this is the top-level object, in which they will be interpreted as */ + /* relative to the screen. */ + + UPushCTM(); + + /* Stack is not used by cairo but *is* used by expression evaluators */ + if (stack) push_stack((pushlistptr *)stack, theinstance, (char *)NULL); + + if (level != 0) + UPreMultCTM(DCTM, theinstance->position, theinstance->scale, + theinstance->rotation); + + if (theinstance->style & LINE_INVARIANT) + passwidth /= fabs(theinstance->scale); + + /* do a quick test for intersection with the display window */ + + bboxin[0].x = theobject->bbox.lowerleft.x; + bboxin[0].y = theobject->bbox.lowerleft.y; + bboxin[1].x = theobject->bbox.lowerleft.x + theobject->bbox.width; + bboxin[1].y = theobject->bbox.lowerleft.y + theobject->bbox.height; + if (level == 0) + extendschembbox(theinstance, &(bboxin[0]), &(bboxin[1])); + UTransformbyCTM(DCTM, bboxin, bboxout, 2); + + xm = (bboxout[0].x < bboxout[1].x) ? 0 : 1; + ym = (bboxout[0].y < bboxout[1].y) ? 0 : 1; + + if (bboxout[xm].x < areawin->width && bboxout[ym].y < areawin->height && + bboxout[1 - xm].x > 0 && bboxout[1 - ym].y > 0) { + + /* make parameter substitutions */ + psubstitute(theinstance); + + /* draw all of the elements */ + + tmpwidth = UTopTransScale(passwidth); + cairo_set_line_width(areawin->cr, tmpwidth); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL); + + /* guard against plist being regenerated during a redraw by the */ + /* expression parameter mechanism (should that be prohibited?) */ + + for (thispart = 0; thispart < theobject->parts; thispart++) { + areagen = theobject->plist + thispart; + if ((*areagen)->type & DRAW_HIDE) continue; + + if (defaultcolor != DOFORALL) { + if ((*areagen)->color != curcolor) { + if ((*areagen)->color == DEFAULTCOLOR) + curcolor = defaultcolor; + else + curcolor = (*areagen)->color; + + XcTopSetForeground(curcolor); + } + } + + switch(ELEMENTTYPE(*areagen)) { + case(POLYGON): + if (level == 0 || !((TOPOLY(areagen))->style & BBOX)) + UDrawPolygon(TOPOLY(areagen), passwidth); + break; + + case(SPLINE): + UDrawSpline(TOSPLINE(areagen), passwidth); + break; + + case(ARC): + UDrawArc(TOARC(areagen), passwidth); + break; + + case(PATH): + UDrawPath(TOPATH(areagen), passwidth); + break; + + case(GRAPHIC): + UDrawGraphic(TOGRAPHIC(areagen)); + break; + + case(OBJINST): + UDrawObject(TOOBJINST(areagen), level + 1, curcolor, passwidth, stack); + break; + + case(LABEL): + if (level == 0 || TOLABEL(areagen)->pin == False) + UDrawString(TOLABEL(areagen), curcolor, theinstance); + else if ((TOLABEL(areagen)->anchor & PINVISIBLE) && areawin->pinpointon) + UDrawString(TOLABEL(areagen), curcolor, theinstance); + else if (TOLABEL(areagen)->anchor & PINVISIBLE) + UDrawStringNoX(TOLABEL(areagen), curcolor, theinstance); + else if (level == 1 && TOLABEL(areagen)->pin && + TOLABEL(areagen)->pin != INFO && areawin->pinpointon) + UDrawXDown(TOLABEL(areagen)); + break; + } + } + + /* restore the color passed to the object, if different from current color */ + + if ((defaultcolor != DOFORALL) && (passcolor != curcolor)) { + XTopSetForeground(passcolor); + } + } + + /* restore the selection list (if any) */ + areawin->selects = savesel; + UPopCTM(); + + /* Stack is not used by cairo but *is* used by expression evaluators */ + if (stack) pop_stack(stack); +} + +/*-------------------------------------------------------------------------*/ + +static void xc_cairo_strokepath(short style, float width) +{ + if (!(style & CLIPMASK) || (areawin->showclipmasks == TRUE)) { + if (style & FILLED || (!(style & FILLED) && style & OPAQUE)) { + if ((style & FILLSOLID) == FILLSOLID) + cairo_fill_preserve(areawin->cr); + else { + double red, green, blue, alpha; + cairo_pattern_get_rgba(cairo_get_source(areawin->cr), + &red, &green, &blue, &alpha); + if (!(style & FILLED)) + cairo_set_source_rgba(areawin->cr, 1., 1., 1., alpha); + else { + double m = (1 + ((style & FILLSOLID) >> 5)) / 8.; + if (style & OPAQUE) { + double n = (1. - m); + cairo_set_source_rgba(areawin->cr, m * red + n, + m * green + n, m * blue + n, alpha); + } + else + cairo_set_source_rgba(areawin->cr, red, green, blue, + m * alpha); + } + cairo_fill_preserve(areawin->cr); + cairo_set_source_rgba(areawin->cr, red, green, blue, alpha); + } + } + if (!(style & NOBORDER)) { + cairo_set_line_width(areawin->cr, width); + cairo_set_line_join(areawin->cr, (style & SQUARECAP) ? + CAIRO_LINE_JOIN_MITER : CAIRO_LINE_JOIN_BEVEL); + if (style & (DASHED | DOTTED)) { + double dashes[2]; + dashes[0] = dashes[1] = 4.0 * width; + if (style & DOTTED) + dashes[0] = width; + cairo_set_dash(areawin->cr, dashes, 2, 0.0); + cairo_set_line_width(areawin->cr, width); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT); + } + else { + cairo_set_dash(areawin->cr, NULL, 0, 0.0); + cairo_set_line_cap(areawin->cr, (style & SQUARECAP) ? + CAIRO_LINE_CAP_SQUARE : CAIRO_LINE_CAP_ROUND); + } + + /* draw the spline and close off if so specified */ + if (!(style & UNCLOSED)) + cairo_close_path(areawin->cr); + cairo_stroke_preserve(areawin->cr); + } + } + if (style & CLIPMASK) + cairo_clip_preserve(areawin->cr); + cairo_new_path(areawin->cr); /* clear preserved paths */ +} + +/*-------------------------------------------------------------------------*/ + +void UDrawPolygon(polyptr thepoly, float passwidth) +{ + int i; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + if (thepoly->number) { + cairo_move_to(areawin->cr, thepoly->points[0].x, thepoly->points[0].y); + for (i = 1; i < thepoly->number; i++) + cairo_line_to(areawin->cr, thepoly->points[i].x, thepoly->points[i].y); + xc_cairo_strokepath(thepoly->style, thepoly->width * passwidth); + } +} + +/*-------------------------------------------------------------------------*/ + +void UDrawArc(arcptr thearc, float passwidth) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + if (abs(thearc->radius) == thearc->yaxis) + cairo_arc(areawin->cr, thearc->position.x, thearc->position.y, + abs(thearc->radius), thearc->angle1 * M_PI / 180.0, + thearc->angle2 * M_PI / 180.0); + else if (thearc->yaxis) { + /* perform elliptical arc, as described in cairo manual */ + cairo_save(areawin->cr); + cairo_translate(areawin->cr, thearc->position.x, thearc->position.y); + cairo_scale(areawin->cr, abs(thearc->radius), thearc->yaxis); + cairo_arc(areawin->cr, 0.0, 0.0, 1.0, thearc->angle1 * M_PI / 180.0, + thearc->angle2 * M_PI / 180.0); + cairo_restore(areawin->cr); + } + else { /* no y-axis dimension: draw a line */ + /* can we do this in a more elegant manner? */ + double theta; + double theta_start = thearc->angle1 * RADFAC; + double theta_stop = thearc->angle2 * RADFAC; + cairo_move_to(areawin->cr, thearc->position.x + fabs(thearc->radius) + * cos(theta_start), thearc->position.y); + for (theta = -M_PI; theta < theta_stop; theta += M_PI) { + if (theta <= theta_start) continue; + cairo_line_to(areawin->cr, thearc->position.x + + fabs(thearc->radius) * cos(theta), thearc->position.y); + } + cairo_line_to(areawin->cr, thearc->position.x + fabs(thearc->radius) + * cos(theta_stop), thearc->position.y); + } + xc_cairo_strokepath(thearc->style, thearc->width * passwidth); +} + +/*-------------------------------------------------------------------------*/ + +void UDrawPath(pathptr thepath, float passwidth) +{ + genericptr *genpath; + polyptr thepoly; + splineptr thespline; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + /* Draw first point */ + if (thepath->parts) { + genpath = thepath->plist; + switch(ELEMENTTYPE(*genpath)) { + case POLYGON: + thepoly = TOPOLY(genpath); + cairo_move_to(areawin->cr, thepoly->points[0].x, + thepoly->points[0].y); + break; + case SPLINE: + thespline = TOSPLINE(genpath); + cairo_move_to(areawin->cr, thespline->ctrl[0].x, + thespline->ctrl[0].y); + break; + } + } + /* Draw all other points */ + for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts; + genpath++) { + int i; + switch(ELEMENTTYPE(*genpath)) { + case POLYGON: + thepoly = TOPOLY(genpath); + for (i = 1; i < thepoly->number; i++) + cairo_line_to(areawin->cr, thepoly->points[i].x, + thepoly->points[i].y); + break; + case SPLINE: + thespline = TOSPLINE(genpath); + cairo_curve_to(areawin->cr, thespline->ctrl[1].x, + thespline->ctrl[1].y, thespline->ctrl[2].x, + thespline->ctrl[2].y, thespline->ctrl[3].x, + thespline->ctrl[3].y); + break; + } + } + xc_cairo_strokepath(thepath->style, thepath->width * passwidth); +} + +/*-------------------------------------------------------------------------*/ + +void UDrawSpline(splineptr thespline, float passwidth) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_move_to(areawin->cr, thespline->ctrl[0].x, thespline->ctrl[0].y); + cairo_curve_to(areawin->cr, thespline->ctrl[1].x, thespline->ctrl[1].y, + thespline->ctrl[2].x, thespline->ctrl[2].y, + thespline->ctrl[3].x, thespline->ctrl[3].y); + xc_cairo_strokepath(thespline->style, thespline->width * passwidth); +} + +/*-------------------------------------------------------------------------*/ + +void UDrawGraphic(graphicptr gp) +{ + double w, h; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_translate(areawin->cr, + gp->position.x, + gp->position.y); + cairo_rotate(areawin->cr, -gp->rotation * RADFAC); + cairo_scale(areawin->cr, gp->scale, -gp->scale); + w = cairo_image_surface_get_width(gp->source); + h = cairo_image_surface_get_height(gp->source); + cairo_set_source_surface(areawin->cr, gp->source, + -w / 2., -h / 2.); + cairo_rectangle(areawin->cr, -w / 2, -h / 2, w, h); + cairo_clip(areawin->cr); + cairo_paint(areawin->cr); + cairo_restore(areawin->cr); +} + +/*----------------------------*/ +/* Draw the grids, axis, etc. */ +/*----------------------------*/ + +void draw_grids(void) +{ + double spc, spc2, spc3; + cairo_matrix_t m = {1., 0., 0., -1., 0., 0.}; + m.x0 = -areawin->pcorner.x * areawin->vscale; + m.y0 = areawin->height + areawin->pcorner.y * areawin->vscale; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + + /* draw lines for grid */ + spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale; + if (areawin->gridon && spc > 8) { + double x, y; + int ix, iy; + /* find bottom-right point on the grid */ + double xbegin = areawin->width; + double ybegin = areawin->height; + cairo_set_matrix(areawin->cr, &m); + cairo_scale(areawin->cr, spc, spc); + cairo_device_to_user(areawin->cr, &xbegin, &ybegin); + xbegin = floor(xbegin); + ybegin = ceil(ybegin); + ix = xbegin; + iy = ybegin; + cairo_user_to_device(areawin->cr, &xbegin, &ybegin); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(GRIDCOLOR); + cairo_set_line_width(areawin->cr, 1.); + for (x = xbegin; x >= 0.; x -= spc, ix--) { + if (!ix && areawin->axeson) continue; /* do not draw main axis */ + cairo_move_to(areawin->cr, floor(x) + .5, .5); + cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5); + } + for (y = ybegin; y >= 0.; y -= spc, iy++) { + if (!iy && areawin->axeson) continue; /* do not draw main axis */ + cairo_move_to(areawin->cr, .5, floor(y) + .5); + cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5); + } + cairo_stroke(areawin->cr); + } + + + if (areawin->axeson) { + /* find main axis */ + double x = 0, y = 0; + cairo_set_matrix(areawin->cr, &m); + cairo_user_to_device(areawin->cr, &x, &y); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(AXESCOLOR); + cairo_set_line_width(areawin->cr, 1.); + cairo_move_to(areawin->cr, floor(x) + .5, .5); + cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5); + cairo_move_to(areawin->cr, .5, floor(y) + .5); + cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5); + cairo_stroke(areawin->cr); + } + + /* bounding box goes beneath everything except grid/axis lines */ + UDrawBBox(); + + /* draw a little red dot at each snap-to point */ + spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale; + if (areawin->snapto && spc2 > 8) { + double x, y; + /* find bottom-right point on the grid */ + double xbegin = areawin->width; + double ybegin = areawin->height; + cairo_set_matrix(areawin->cr, &m); + cairo_scale(areawin->cr, spc2, spc2); + cairo_device_to_user(areawin->cr, &xbegin, &ybegin); + xbegin = floor(xbegin); + ybegin = ceil(ybegin); + cairo_user_to_device(areawin->cr, &xbegin, &ybegin); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(SNAPCOLOR); + cairo_set_line_width(areawin->cr, 1.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + for (x = xbegin; x >= 0.; x -= spc2) { + for (y = ybegin; y >= 0.; y -= spc2) { + cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5); + cairo_close_path(areawin->cr); + } + } + cairo_stroke(areawin->cr); + } + + /* Draw major snap points */ + spc3 = spc * 20.; + if (spc > 4.) { + double x, y; + /* find bottom-right point on the grid */ + double xbegin = areawin->width; + double ybegin = areawin->height; + cairo_set_matrix(areawin->cr, &m); + cairo_scale(areawin->cr, spc3, spc3); + cairo_device_to_user(areawin->cr, &xbegin, &ybegin); + xbegin = floor(xbegin); + ybegin = ceil(ybegin); + cairo_user_to_device(areawin->cr, &xbegin, &ybegin); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(GRIDCOLOR); + cairo_set_line_width(areawin->cr, 3.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + for (x = xbegin; x >= 0.; x -= spc3) { + for (y = ybegin; y >= 0.; y -= spc3) { + cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5); + cairo_close_path(areawin->cr); + } + } + cairo_stroke(areawin->cr); + } + cairo_restore(areawin->cr); +} + +/*---------------------------------------------------------------------*/ +/* Draw a string at position offset, starting at the start index and */ +/* ending before the end index. The offset is updated on return. */ +/*---------------------------------------------------------------------*/ + +void UDrawCharString(u_char *text, int start, int end, XfPoint *offset, + short styles, short ffont, int groupheight, int passcolor, float tmpscale) +{ + int idx, nglyphs = 0; + cairo_matrix_t oldm; + double x, y; + cairo_glyph_t *glyphs; + UNUSED(passcolor); + + cairo_get_matrix(areawin->cr, &oldm); + cairo_scale(areawin->cr, tmpscale, fabs(tmpscale)); + + /* under- and overlines */ + if (styles & 8) + y = offset->y / tmpscale - 6.; + else if (styles & 16) + y = offset->y / tmpscale + groupheight + 4; + if (styles & 24) { + /* under/overline thickness scales if bold */ + float tmpthick = ((fonts[ffont].flags & 0x21) == 0x21) ? 4.0 : 2.0; + cairo_set_line_width(areawin->cr, tmpthick); + + x = offset->x / tmpscale; + } + + glyphs = cairo_glyph_allocate(end - start); + for (idx = start; idx < end; idx++) + { + /* Add glyphs */ + glyphs[nglyphs].index = fonts[ffont].glyph_index[text[idx]]; + glyphs[nglyphs].x = offset->x / tmpscale; + glyphs[nglyphs].y = offset->y / fabs(tmpscale); + nglyphs++; + /* Determine character width */ + offset->x += fonts[ffont].glyph_advance[text[idx]] * tmpscale; + } + if (nglyphs) { + cairo_show_glyphs(areawin->cr, glyphs, nglyphs); + cairo_new_path(areawin->cr); + } + cairo_glyph_free(glyphs); + + if (styles & 24) { + cairo_move_to(areawin->cr, x, y); + cairo_line_to(areawin->cr, offset->x / tmpscale, y); + cairo_stroke(areawin->cr); + } + cairo_set_matrix(areawin->cr, &oldm); +} + +/*----------------------------------------------------------------------*/ +/* A completely stripped down version of UDrawObject, used for stroke */ +/* font drawing in xc_user_font_render */ +/*----------------------------------------------------------------------*/ + +static void xc_draw_glyph_object(objinstptr inst, float passwidth) +{ + int thispart; + genericptr *areagen; + objectptr obj = inst->thisobject; + objinstptr ptr; + + for (thispart = 0; thispart < obj->parts; thispart++) { + areagen = obj->plist + thispart; + switch(ELEMENTTYPE(*areagen)) { + case(POLYGON): + UDrawPolygon(TOPOLY(areagen), passwidth); + break; + case(SPLINE): + UDrawSpline(TOSPLINE(areagen), passwidth); + break; + case(ARC): + UDrawArc(TOARC(areagen), passwidth); + break; + case(PATH): + UDrawPath(TOPATH(areagen), passwidth); + break; + case(OBJINST): + ptr = TOOBJINST(areagen); + cairo_save(areawin->cr); + cairo_translate(areawin->cr, ptr->position.x, ptr->position.y); + cairo_rotate(areawin->cr, -ptr->rotation * RADFAC); + cairo_scale(areawin->cr, ptr->scale, fabs(ptr->scale)); + xc_draw_glyph_object(ptr, passwidth); + cairo_restore(areawin->cr); + break; + } + } +} + +/*----------------------------------------------------------------------*/ +/* Rendering function for a cairo_user_font_face, to draw the stroke */ +/* fonts of xcircuit */ +/* TODO: always this factor 40 to match with cairo. Is it BASELINE? */ +/*----------------------------------------------------------------------*/ + +static cairo_status_t xc_user_font_render(cairo_scaled_font_t *scaled_font, + unsigned long glyph, cairo_t *cr, cairo_text_extents_t *extents) +{ + objectptr chr; + objinst charinst; + objinstptr theinstance; + cairo_t *old_cr; + float passwidth; + double llx, lly, trx, try; + + cairo_font_face_t *ff = cairo_scaled_font_get_font_face(scaled_font); + size_t fontidx = (size_t) cairo_font_face_get_user_data(ff, &fontinfo_key); + fontinfo *fi = &fonts[fontidx]; + + chr = fi->encoding[glyph]; + theinstance = &charinst; + charinst.thisobject = chr; + + llx = chr->bbox.lowerleft.x / 40.; + lly = chr->bbox.lowerleft.y / 40.; + trx = (chr->bbox.lowerleft.x + chr->bbox.width) / 40.; + try = (chr->bbox.lowerleft.y + chr->bbox.height) / 40.; + + /* temporary override areawin->cr with the font context */ + old_cr = areawin->cr; + areawin->cr = cr; + + cairo_scale(cr, 1. / 40., -1. / 40.); + cairo_set_line_width(cr, 1); + + /* if font is derived and italic, premultiply by slanting matrix */ + if ((fi->flags & 0x22) == 0x22) { + cairo_matrix_t m = {1., 0., .25, 1., 0., 0.}; + cairo_transform(areawin->cr, &m); + llx += .25 * lly; + trx += .25 * try; + } + /* simple boldface technique for derived fonts */ + passwidth = ((fi->flags & 0x21) == 0x21) ? 4. : 2.; + + /* Correct extentswith line width */ + llx -= passwidth / 40.; + lly -= passwidth / 40.; + trx += passwidth / 40.; + try += passwidth / 40.; + + xc_draw_glyph_object(theinstance, passwidth); + + extents->x_bearing = llx; + extents->y_bearing = -try; + extents->width = trx - llx; + extents->height = try - lly; + extents->x_advance = (chr->bbox.lowerleft.x + chr->bbox.width) / 40.; + extents->y_advance = 0.; + + areawin->cr = old_cr; + return CAIRO_STATUS_SUCCESS; +} + +/*----------------------------------------------------------------------*/ +/* Function to translate unicode into a glyph index for the stroke font */ +/*----------------------------------------------------------------------*/ + +static cairo_status_t xc_user_font_glyph(cairo_scaled_font_t *scaled_font, + unsigned long unicode, unsigned long *glyph_index) +{ + cairo_font_face_t *ff = cairo_scaled_font_get_font_face(scaled_font); + size_t fontidx = (size_t) cairo_font_face_get_user_data(ff, &fontinfo_key); + fontinfo *fi = &fonts[fontidx]; + unsigned long idx; + + /* search all glyphs in the utf8encoding. This is allowed to be slow, */ + /* as the glyph list will be buffered anyway */ + for (idx = 1; idx < 255; idx++) { + const char *s = fi->utf8encoding[idx]; + int cidx = 0; + + /* Convert utf-8 to unicode */ + unsigned long uc = s[0]; + if (uc & 0x80) { + unsigned long mask = 0x3f; + while ((s[++cidx] & 0xc0) == 0x80) { + uc = (uc << 6) | (s[cidx] & 0x3f); + mask = (mask << 5) | 0x1f; + } + uc &= mask; + } + + if (unicode == uc) { + *glyph_index = idx; + return CAIRO_STATUS_SUCCESS; + } + } + /* This should not happen: replace unknown glyph with question mark */ + *glyph_index = '?'; + return CAIRO_STATUS_SUCCESS; +} + +/*---------------------------------------------------------------------*/ +/* find the corresponing cairo fontface for a given fontinfo structure */ +/*---------------------------------------------------------------------*/ + +typedef struct { + const char* postscript_name; + const char* replacement_name; + const char* foundry_name; +} xc_font_replacement; + +static const xc_font_replacement replacement_fonts[] = +{ + /* First try to see if 'real' postscript fonts have been installed */ + {"ITC Avant Garde Gothic", "ITC Avant Garde Gothic", "adobe"}, + {"ITC Bookman", "ITC Bookman", "adobe"}, + {"Courier", "Courier", "adobe"}, + {"Helvetica", "Helvetica", "adobe"}, + {"Helvetica Narrow", "Helvetica Narrow", "adobe"}, + {"New Century Schoolbook", "New Century Schoolbook", "adobe"}, + {"Palatino", "Palatino", "adobe"}, + {"Symbol", "Symbol", "adobe"}, + {"Times", "Times", "adobe"}, + {"Times-Roman", "Times-Roman", "adobe"}, + {"ITC ZapfChangery", "ITC ZapfChangery", "adobe"}, + {"ITC ZapfDingbats", "ITC ZapfDingbats", "adobe"}, + /* Next try the URW postscript fonts (guaranteed to have same extents) */ + {"ITC Avant Garde Gothic", "URW Gothic L", "urw"}, + {"ITC Bookman", "URW Bookman L", "urw"}, + {"Courier", "Nimbus Mono L", "urw"}, + {"Helvetica", "Nimbus Sans L", "urw"}, + {"Helvetica Narrow", "Nimbus Sans L Condensed", "urw"}, + {"New Century Schoolbook", "Century Schoolbook L", "urw"}, + {"Palatino", "URW Palladio L", "urw"}, + {"Symbol", "Standard Symbols L", "urw"}, + {"Times", "Nimbus Roman No9 L", "urw"}, + {"Times-Roman", "Nimbus Roman No9 L", "urw"}, + {"ITC ZapfChangery", "URW Changery L", "urw"}, + {"ITC ZapfDingbats", "Dingbats", "urw"}, + /* No success, use the 'old' stroke fonts */ + {NULL, NULL, NULL} +}; + +void xc_cairo_set_fontinfo(size_t fontidx) +{ + /* TODO: memory leak. font_face is created here. It should also be */ + /* destroyed again somewhere */ + fontinfo *fi = &fonts[fontidx]; + const char *family = fi->family; + const xc_font_replacement *replace; + int c; + +#ifdef CAIRO_HAS_FC_FONT + int weight = FC_WEIGHT_NORMAL; + int slant = FC_SLANT_ROMAN; + + fi->font_face = NULL; + + if (fi->flags & 1) + weight = FC_WEIGHT_BOLD; + + if (fi->flags & 2) { + if (!strcmp(family, "Helvetica")) + slant = FC_SLANT_OBLIQUE; + else + slant = FC_SLANT_ITALIC; + } + /* Try to find a proper postscript font */ + for (replace = replacement_fonts; replace->postscript_name; replace++) { + if (!strcmp(replace->postscript_name, fi->family)) { + FcPattern *matched; + FcChar8 *matched_family, *matched_foundry; + FcResult result; + FcPattern *pattern = FcPatternBuild(NULL, + FC_FAMILY, FcTypeString, replace->replacement_name, + FC_WEIGHT, FcTypeInteger, weight, + FC_SLANT, FcTypeInteger, slant, + FC_FOUNDRY, FcTypeString, replace->foundry_name, + NULL); + FcConfigSubstitute(0, pattern, FcMatchPattern); + FcDefaultSubstitute(pattern); + matched = FcFontMatch(0, pattern, &result); + /* Check if the matched font is actually the replacement font */ + FcPatternGetString(matched, FC_FAMILY, 0, &matched_family); + FcPatternGetString(matched, FC_FOUNDRY, 0, &matched_foundry); + if (!strcmp(matched_family, replace->replacement_name) + && !strcmp(matched_foundry, replace->foundry_name)) + fi->font_face = cairo_ft_font_face_create_for_pattern(matched); + FcPatternDestroy(matched); + FcPatternDestroy(pattern); + if (fi->font_face) + break; + } + } +#else /* CAIRO_HAS_FC_FONT */ + fi->font_face = NULL; +#endif /* CAIRO_HAS_FC_FONT */ + + /* Cache the dimensions and all glyphs of the font */ + if (fi->font_face) { + int num_glyphs; + cairo_glyph_t *glyphs = NULL; + cairo_scaled_font_t *scaled_font; + cairo_text_extents_t extents; + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + cairo_set_font_face(areawin->cr, fi->font_face); + cairo_set_font_size(areawin->cr, 100.); + scaled_font = cairo_get_scaled_font(areawin->cr); + for (c = 1; c < 256; c++) { /* skip encoding at index 0 */ + cairo_scaled_font_text_to_glyphs(scaled_font, 0., 0., + fi->utf8encoding[c], -1, &glyphs, &num_glyphs, + NULL, NULL, NULL); + fi->glyph_index[c] = glyphs[0].index; + cairo_scaled_font_glyph_extents(scaled_font, glyphs, 1, &extents); + fi->glyph_top[c] = -extents.y_bearing * 40. / 100.; + /* fi->glyph_bottom[c] = extents.height * 40. / 100. + fi->glyph_top[c]; */ + fi->glyph_bottom[c] = fi->glyph_top[c] - extents.height * 40. / 100.; + fi->glyph_advance[c] = extents.x_advance * 40. / 100.; + } + cairo_glyph_free(glyphs); + cairo_restore(areawin->cr); + } + else { + /* No decent postscript font found. Backup using stroke fonts */ + fi->font_face = cairo_user_font_face_create(); + cairo_font_face_set_user_data(fi->font_face, &fontinfo_key, + (void*) fontidx, (cairo_destroy_func_t) cairo_font_face_destroy); + cairo_user_font_face_set_render_glyph_func(fi->font_face, + xc_user_font_render); + cairo_user_font_face_set_unicode_to_glyph_func(fi->font_face, + xc_user_font_glyph); + for (c = 0; c < 256; c++) { + objectptr chr = fi->encoding[c]; + fi->glyph_index[c] = c; + fi->glyph_top[c] = chr->bbox.lowerleft.y + chr->bbox.height; + fi->glyph_bottom[c] = chr->bbox.lowerleft.y; + fi->glyph_advance[c] = chr->bbox.lowerleft.x + chr->bbox.width; + } + } +} + +/*----------------------------------------------------------------------*/ +/* A light wrapper around cairo_surface_t, to a generalized xcImage */ +/*----------------------------------------------------------------------*/ + +/* caching for cairo_surface_t */ +static xcImage *xcImagePixel_oldimg = NULL; +static uint32_t *xcImagePixel_data; +static int xcImagePixel_width; +static int xcImagePixel_height; + +static inline void xcImageCheckCache(xcImage *img) +{ + if (img != xcImagePixel_oldimg) { + xcImagePixel_oldimg = img; + xcImagePixel_data = (uint32_t*) cairo_image_surface_get_data(img); + xcImagePixel_width = cairo_image_surface_get_width(img); + xcImagePixel_height = cairo_image_surface_get_height(img); + } +} + +xcImage *xcImageCreate(int width, int height) +{ + return cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height); +} + +void xcImageDestroy(xcImage *img) +{ + cairo_surface_destroy(img); +} + +int xcImageGetWidth(xcImage *img) +{ + xcImageCheckCache(img); + return xcImagePixel_width; +} + +int xcImageGetHeight(xcImage *img) +{ + xcImageCheckCache(img); + return xcImagePixel_height; +} + +void xcImagePutPixel(xcImage *img, int x, int y, u_char r, u_char g, u_char b) +{ + xcImageCheckCache(img); + xcImagePixel_data[y * xcImagePixel_width + x] = (r << 16) | (g << 8) | b; +} + +void xcImageGetPixel(xcImage *img, int x, int y, u_char *r, u_char *g, + u_char *b) +{ + uint32_t argb; + xcImageCheckCache(img); + argb = xcImagePixel_data[y * xcImagePixel_width + x]; + *r = argb >> 16; + *g = argb >> 8; + *b = argb; +} + + +/*------------------------------------------------------------------------*/ +/* Ghostscript rendering function. In contrast to X11, direct calls to */ +/* ghostscriptapi are made */ +/*------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------*/ +/* gsapi I/O redirection functions */ +/*------------------------------------------------------------------------*/ + +#ifdef HAVE_GS +static int GSDLLCALL gs_stdin_fn(void *caller_handle, char *buf, int len) +{ + UNUSED(caller_handle); UNUSED(buf); UNUSED(len); + + return 0; /* EOF */ +} + +static int GSDLLCALL gs_stdout_fn(void *caller_handle, const char *str, int len) +{ +#ifndef GS_DEBUG + UNUSED(caller_handle); UNUSED(str); +#else + fwrite(str, 1, len, stdout); + fflush(stdout); +#endif + return len; +} + +static int GSDLLCALL gs_stderr_fn(void *caller_handle, const char *str, int len) +{ +#ifndef GS_DEBUG + UNUSED(caller_handle); UNUSED(str); +#else + fwrite(str, 1, len, stderr); + fflush(stderr); +#endif + return len; +} +#endif /* HAVE_GS */ + +/*------------------------------------------------------------------------*/ +/* gsapi displaycallback functions */ +/*------------------------------------------------------------------------*/ + +#ifdef HAVE_GS +static unsigned char *gs_pimage; +static int gs_width, gs_height, gs_raster; + +static int gs_display_dummy(void) +{ + return 0; +} +#endif /* HAVE_GS */ + +#ifdef HAVE_GS +static int gs_display_size(void *handle, void *device, int width, int height, + int raster, unsigned int format, unsigned char *pimage) +{ + UNUSED(handle); UNUSED(device); UNUSED(format); + + gs_pimage = pimage; + gs_width = width; + gs_height = height; + gs_raster = raster; + return 0; +} +#endif /* HAVE_GS */ + +#ifdef HAVE_GS +int gs_display_page(void *handle, void *device, int copies, int flush) +{ + cairo_surface_t *tbuf; + cairo_t *bbuf_cr; + UNUSED(handle); UNUSED(device); UNUSED(copies); UNUSED(flush); + + if (bbuf) + cairo_surface_destroy(bbuf); + /* Since cairo_image_surface_create_for_data assumes the buffer to be */ + /* valid until destruction, and ghostscript frees it immediately, */ + /* first use a temporary buffer. Then immediately copy the buffer */ + /* To the final location */ + tbuf = cairo_image_surface_create_for_data(gs_pimage, CAIRO_FORMAT_RGB24, + gs_width, gs_height, gs_raster); + bbuf = cairo_image_surface_create(CAIRO_FORMAT_RGB24, gs_width, gs_height); + bbuf_cr = cairo_create(bbuf); + cairo_set_source_surface(bbuf_cr, tbuf, 0., 0.); + cairo_paint(bbuf_cr); + cairo_destroy(bbuf_cr); + cairo_surface_destroy(tbuf); + return 0; +} +#endif /* HAVE_GS */ + +#ifdef HAVE_GS +display_callback gs_display = { + sizeof(display_callback), + DISPLAY_VERSION_MAJOR, + DISPLAY_VERSION_MINOR, + (int (*)(void*, void*)) gs_display_dummy, /* display_open */ + (int (*)(void*, void*)) gs_display_dummy, /* display_preclose */ + (int (*)(void*, void*)) gs_display_dummy, /* display_close */ + (int (*)(void*, void*, int, int, int, unsigned int)) gs_display_dummy, + /* display_presize */ + gs_display_size, + (int (*)(void*, void*)) gs_display_dummy, /* display_sync */ + gs_display_page, + NULL, /* display_update */ + NULL, /* display_memalloc */ + NULL, /* display_memfree */ + NULL /* display_separation */ +}; +#endif /* HAVE_GS */ + +/*------------------------------------------------------*/ +/* write scale and position to ghostscript */ +/* and tell ghostscript to run the requested file */ +/*------------------------------------------------------*/ + +#ifdef HAVE_GS +const char *gs_argv[] = { + "-dQUIET", /* Suppress startup messages */ + "-dNOPAUSE", /* Disable pause at end of page */ + "-dBATCH", /* Exit when all files done */ + "-sDEVICE=display", + "-sDisplayHandle=0", + "-r75", /* Display resolution */ + "-dGraphicsAlphaBits=4", /* Graphics anti-aliasing */ + "-dTextAlphaBits=4" /* Text anti-aliasing */ +}; +#endif /* HAVE_GS */ + +void write_scale_position_and_run_gs(float norm, float xpos, float ypos, + const char *bgfile) +{ +#ifndef HAVE_GS + UNUSED(norm); UNUSED(xpos); UNUSED(ypos); UNUSED(bgfile); +#endif +#ifdef HAVE_GS + int i, code, exit_code; + void *instance; + char gs_cmd[256]; + char display_format[] = "-dDisplayFormat=........"; + char pixmap_size[] = "-g........x........"; + int argc = sizeof(gs_argv) / sizeof(gs_argv[0]); + const char **argv = (const char**) malloc((argc + 2) * sizeof(const char*)); + + for (i = 0; i < argc; i++) + argv[i] = gs_argv[i]; + argv[argc++] = display_format; + argv[argc++] = pixmap_size; + + sprintf(gs_cmd, + " /GSobj save def" + " /setpagedevice {pop} def" + " gsave" + " %3.2f %3.2f translate" + " %3.2f %3.2f scale" + " (%s) run" + " GSobj restore" + " grestore", + xpos, ypos, norm, norm, bgfile); + + sprintf(display_format, "-dDisplayFormat=%d", DISPLAY_COLORS_RGB + | DISPLAY_UNUSED_LAST | DISPLAY_DEPTH_8 | DISPLAY_LITTLEENDIAN + | DISPLAY_TOPFIRST | DISPLAY_ROW_ALIGN_DEFAULT); + sprintf(pixmap_size, "-g%dx%d", areawin->width, areawin->height); + + XDefineCursor(dpy, areawin->window, WAITFOR); + + if ((code = gsapi_new_instance(&instance, NULL)) == 0) { + gsapi_set_stdio(instance, gs_stdin_fn, gs_stdout_fn, gs_stderr_fn); + gsapi_set_display_callback(instance, &gs_display); + if (!(code = gsapi_init_with_args(instance, argc, (char**) argv))) + gsapi_run_string(instance, gs_cmd, 0, &exit_code); + gsapi_exit(instance); + gsapi_delete_instance(instance); + } + free(argv); +#ifdef GS_DEBUG + fprintf(stdout, "Xcircuit: ghostscript done\n"); +#endif + + XDefineCursor(dpy, areawin->window, DEFAULTCURSOR); + areawin->lastbackground = xobjs.pagelist[areawin->page]->background.name; + drawarea(areawin->area, NULL, NULL); +#endif /* HAVE_GS */ + gs_state = GS_READY; +} + +#else /* HAVE_CAIRO */ +typedef int no_empty_translation_unit_warning; +#endif /* HAVE_CAIRO */ + diff --git a/cairo.c.orig b/cairo.c.orig new file mode 100644 index 0000000..04a8fcb --- /dev/null +++ b/cairo.c.orig @@ -0,0 +1,991 @@ +/*-------------------------------------------------------------------------*/ +/* cairo.c --- mainly cairo versions of the UDraw... stuff in functions.c */ +/* Copyright (c) 2002 Tim Edwards, Johns Hopkins University */ +/*-------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------*/ +/* originally written by Tim Edwards, 8/13/93 */ +/* All cairo graphics library modifications by Erik van der Wal, May 2014 */ +/*-------------------------------------------------------------------------*/ + +#ifdef HAVE_CAIRO + +#include +#include +#include +#include +#include +#include + +#ifndef XC_WIN32 +#include +#endif + +#ifdef TCL_WRAPPER +#include +#endif /* TCL_WRAPPER */ + +#include "xcircuit.h" +#include "colordefs.h" +#include "prototypes.h" + +extern XCWindowData *areawin; +extern int *appcolors; +extern Globaldata xobjs; +extern short fontcount; +extern fontinfo *fonts; +extern Display *dpy; + +static void xc_cairo_strokepath(short style, float width); + +/*----------------------------------------------------------------------------*/ + +void xc_cairo_set_matrix(const Matrix *xcm) +{ + cairo_matrix_t m = { + .xx = xcm->a, .xy = xcm->b, .x0 = xcm->c, + .yx = xcm->d, .yy = xcm->e, .y0 = xcm->f + }; + cairo_set_matrix(areawin->cr, &m); +}; + +/*----------------------------------------------------------------------*/ +/* Set the color, based on the given color index */ +/*----------------------------------------------------------------------*/ + +void xc_cairo_set_color(unsigned long coloridx) +{ + unsigned short r, g, b; + double red, green, blue; + xc_get_color_rgb(coloridx, &r, &g, &b); + cairo_set_source_rgb(areawin->cr, r / 65535., g / 65535., b / 65535.); +} + +/*----------------------------------------------------------------------------*/ + +void UDrawLine(XPoint *pt1, XPoint *pt2) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + + cairo_set_line_width(areawin->cr, xobjs.pagelist[areawin->page]->wirewidth); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL); + + cairo_move_to(areawin->cr, pt1->x, pt1->y); + cairo_line_to(areawin->cr, pt2->x, pt2->y); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Add circle at given point to indicate that the point is a parameter. */ +/* The circle is divided into quarters. For parameterized y-coordinate */ +/* the top and bottom quarters are drawn. For parameterized x- */ +/* coordinate, the left and right quarters are drawn. A full circle */ +/* indicates either both x- and y-coordinates are parameterized, or */ +/* else any other kind of parameterization (presently, not used). */ +/* */ +/* (note that the two angles in XDrawArc() are 1) the start angle, */ +/* measured in absolute 64th degrees from 0 (3 o'clock), and 2) the */ +/* path length, in relative 64th degrees (positive = counterclockwise, */ +/* negative = clockwise)). */ +/*----------------------------------------------------------------------*/ + +void UDrawCircle(XPoint *upt, u_char which) +{ + XPoint wpt; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + user_to_window(*upt, &wpt); + cairo_set_line_width(areawin->cr, .75); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER); + + /* TODO: angles might be mirrored or turning the wrong way */ + switch(which) { + case P_POSITION_X: + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * -.25, M_PI * .25); + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .75, M_PI * 1.25); + break; + case P_POSITION_Y: + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .25, M_PI * .75); + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * 1.25, M_PI * 1.75); + break; + default: + cairo_arc(areawin->cr, wpt.x, wpt.y, 4., 0., M_PI * 2.); + break; + } + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Add "X" at string origin */ +/*----------------------------------------------------------------------*/ + +void UDrawXAt(XPoint *wpt) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_width(areawin->cr, .75); + + cairo_move_to(areawin->cr, wpt->x - 3., wpt->y - 3.); + cairo_line_to(areawin->cr, wpt->x + 3., wpt->y + 3.); + cairo_move_to(areawin->cr, wpt->x + 3., wpt->y - 3.); + cairo_line_to(areawin->cr, wpt->x - 3., wpt->y + 3.); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +void UDrawXLine(XPoint opt, XPoint cpt) +{ + XPoint upt, vpt; + double dashes[] = {4., 4.}; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + xc_cairo_set_color(AUXCOLOR); + cairo_set_dash(areawin->cr, dashes, sizeof(dashes) / sizeof(double), 0.); + cairo_set_line_width(areawin->cr, .75); + + user_to_window(cpt, &upt); + user_to_window(opt, &vpt); + cairo_move_to(areawin->cr, vpt.x, vpt.y); + cairo_line_to(areawin->cr, upt.x, upt.y); + cairo_stroke(areawin->cr); + + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_move_to(areawin->cr, upt.x - 3., upt.y - 3.); + cairo_line_to(areawin->cr, upt.x + 3., upt.y + 3.); + cairo_move_to(areawin->cr, upt.x + 3., upt.y - 3.); + cairo_line_to(areawin->cr, upt.x - 3., upt.y + 3.); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*-------------------------------------------------------------------------*/ + +void UDrawBox(XPoint origin, XPoint corner) +{ + XPoint worig, wcorn; + double r, g, b, a; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + user_to_window(origin, &worig); + user_to_window(corner, &wcorn); + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + cairo_set_line_width(areawin->cr, 1.0); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER); + + cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5); + cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5); + cairo_close_path(areawin->cr); + + xc_cairo_set_color(AUXCOLOR); + cairo_pattern_get_rgba(cairo_get_source(areawin->cr), &r, &g, &b, &a); + cairo_set_source_rgba(areawin->cr, r, g, b, .1 * a); + cairo_fill_preserve(areawin->cr); + cairo_set_source_rgba(areawin->cr, r, g, b, a); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Draw a box indicating the dimensions of the edit element that most */ +/* closely reach the position "corner". */ +/*----------------------------------------------------------------------*/ + +float UDrawRescaleBox(XPoint *corner) +{ + XPoint newpoints[5]; + float newscale; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + /* No return here, since the return value might be needed? */ + } + + if (areawin->selects == 0) + return 0.; + + newscale = UGetRescaleBox(corner, newpoints); + + if (areawin->redraw_ongoing) { + int i; + cairo_save(areawin->cr); + xc_cairo_set_color(AUXCOLOR); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL); + cairo_move_to(areawin->cr, newpoints[0].x, newpoints[0].y); + for (i = 1; i < 4; i++) + cairo_line_to(areawin->cr, newpoints[i].x, newpoints[i].y); + xc_cairo_strokepath(0, 1); + cairo_restore(areawin->cr); + } + + return newscale; +} + +/*-------------------------------------------------------------------------*/ + +void UDrawBBox() +{ + XPoint origin; + XPoint worig, wcorn, corner; + objinstptr bbinst = areawin->topinstance; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + if ((!areawin->bboxon) || (checkforbbox(topobject) != NULL)) return; + + origin = bbinst->bbox.lowerleft; + corner.x = origin.x + bbinst->bbox.width; + corner.y = origin.y + bbinst->bbox.height; + + /* Include any schematic labels in the bounding box. */ + extendschembbox(bbinst, &origin, &corner); + + user_to_window(origin, &worig); + user_to_window(corner, &wcorn); + + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + + xc_cairo_set_color(BBOXCOLOR); + cairo_set_line_width(areawin->cr, 1.0); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER); + + cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5); + cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5); + cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5); + cairo_close_path(areawin->cr); + cairo_stroke(areawin->cr); + + cairo_restore(areawin->cr); +} + +/*----------------------------------------------------------------------*/ +/* Main recursive object instance drawing routine. */ +/* context is the instance information passed down from above */ +/* theinstance is the object instance to be drawn */ +/* level is the level of recursion */ +/* passcolor is the inherited color value passed to object */ +/* passwidth is the inherited linewidth value passed to the object */ +/* stack contains graphics context information */ +/*----------------------------------------------------------------------*/ + +void UDrawObject(objinstptr theinstance, short level, int passcolor, + float passwidth, pushlistptr *stack) +{ + genericptr *areagen; + float tmpwidth; + int defaultcolor = passcolor; + int curcolor = passcolor; + int thispart; + short savesel; + XPoint bboxin[2], bboxout[2]; + u_char xm, ym; + objectptr theobject = theinstance->thisobject; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + /* Save the number of selections and set it to zero while we do the */ + /* object drawing. */ + + savesel = areawin->selects; + areawin->selects = 0; + + /* All parts are given in the coordinate system of the object, unless */ + /* this is the top-level object, in which they will be interpreted as */ + /* relative to the screen. */ + + UPushCTM(); + + if (level != 0) + UPreMultCTM(DCTM, theinstance->position, theinstance->scale, + theinstance->rotation); + + if (theinstance->style & LINE_INVARIANT) + passwidth /= fabs(theinstance->scale); + + /* do a quick test for intersection with the display window */ + + bboxin[0].x = theobject->bbox.lowerleft.x; + bboxin[0].y = theobject->bbox.lowerleft.y; + bboxin[1].x = theobject->bbox.lowerleft.x + theobject->bbox.width; + bboxin[1].y = theobject->bbox.lowerleft.y + theobject->bbox.height; + if (level == 0) + extendschembbox(theinstance, &(bboxin[0]), &(bboxin[1])); + UTransformbyCTM(DCTM, bboxin, bboxout, 2); + + xm = (bboxout[0].x < bboxout[1].x) ? 0 : 1; + ym = (bboxout[0].y < bboxout[1].y) ? 0 : 1; + + if (bboxout[xm].x < areawin->width && bboxout[ym].y < areawin->height && + bboxout[1 - xm].x > 0 && bboxout[1 - ym].y > 0) { + + /* make parameter substitutions */ + psubstitute(theinstance); + + /* draw all of the elements */ + + tmpwidth = UTopTransScale(passwidth); + cairo_set_line_width(areawin->cr, tmpwidth); + cairo_set_dash(areawin->cr, NULL, 0, 0.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL); + + /* guard against plist being regenerated during a redraw by the */ + /* expression parameter mechanism (should that be prohibited?) */ + + for (thispart = 0; thispart < theobject->parts; thispart++) { + areagen = theobject->plist + thispart; + if ((*areagen)->type & DRAW_HIDE) continue; + + if (defaultcolor != DOFORALL) { + if ((*areagen)->color != curcolor) { + if ((*areagen)->color == DEFAULTCOLOR) + curcolor = defaultcolor; + else + curcolor = (*areagen)->color; + + XcTopSetForeground(curcolor); + } + } + + switch(ELEMENTTYPE(*areagen)) { + case(POLYGON): + if (level == 0 || !((TOPOLY(areagen))->style & BBOX)) + UDrawPolygon(TOPOLY(areagen), passwidth); + break; + + case(SPLINE): + UDrawSpline(TOSPLINE(areagen), passwidth); + break; + + case(ARC): + UDrawArc(TOARC(areagen), passwidth); + break; + + case(PATH): + UDrawPath(TOPATH(areagen), passwidth); + break; + + case(GRAPHIC): + UDrawGraphic(TOGRAPHIC(areagen)); + break; + + case(OBJINST): + UDrawObject(TOOBJINST(areagen), level + 1, curcolor, passwidth, stack); + break; + + case(LABEL): + if (level == 0 || TOLABEL(areagen)->pin == False) + UDrawString(TOLABEL(areagen), curcolor, theinstance); + else if ((TOLABEL(areagen)->justify & PINVISIBLE) && areawin->pinpointon) + UDrawString(TOLABEL(areagen), curcolor, theinstance); + else if (TOLABEL(areagen)->justify & PINVISIBLE) + UDrawStringNoX(TOLABEL(areagen), curcolor, theinstance); + else if (level == 1 && TOLABEL(areagen)->pin && + TOLABEL(areagen)->pin != INFO && areawin->pinpointon) + UDrawXDown(TOLABEL(areagen)); + break; + } + } + + /* restore the color passed to the object, if different from current color */ + + if ((defaultcolor != DOFORALL) && (passcolor != curcolor)) + XTopSetForeground(passcolor); + } + + /* restore the selection list (if any) */ + areawin->selects = savesel; + UPopCTM(); +} + +/*-------------------------------------------------------------------------*/ + +static void xc_cairo_strokepath(short style, float width) +{ + float tmpwidth; + + if (!(style & CLIPMASK) || (areawin->showclipmasks == TRUE)) { + if (style & FILLED || (!(style & FILLED) && style & OPAQUE)) { + if ((style & FILLSOLID) == FILLSOLID) + cairo_fill_preserve(areawin->cr); + else { + double red, green, blue, alpha; + cairo_pattern_get_rgba(cairo_get_source(areawin->cr), + &red, &green, &blue, &alpha); + if (!(style & FILLED)) + cairo_set_source_rgba(areawin->cr, 1., 1., 1., alpha); + else { + double m = (1 + ((style & FILLSOLID) >> 5)) / 8.; + if (style & OPAQUE) { + double n = (1. - m); + cairo_set_source_rgba(areawin->cr, m * red + n, + m * green + n, m * blue + n, alpha); + } + else + cairo_set_source_rgba(areawin->cr, red, green, blue, + m * alpha); + } + cairo_fill_preserve(areawin->cr); + cairo_set_source_rgba(areawin->cr, red, green, blue, alpha); + } + } + if (!(style & NOBORDER)) { + cairo_set_line_width(areawin->cr, width); + cairo_set_line_join(areawin->cr, (style & SQUARECAP) ? + CAIRO_LINE_JOIN_MITER : CAIRO_LINE_JOIN_BEVEL); + if (style & (DASHED | DOTTED)) { + double dashes[2] = {4.0 * width, 4.0 * width}; + if (style & DOTTED) + dashes[0] = width; + cairo_set_dash(areawin->cr, dashes, 2, 0.0); + cairo_set_line_width(areawin->cr, width); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT); + } + else { + cairo_set_dash(areawin->cr, NULL, 0, 0.0); + cairo_set_line_cap(areawin->cr, (style & SQUARECAP) ? + CAIRO_LINE_CAP_SQUARE : CAIRO_LINE_CAP_ROUND); + } + + /* draw the spline and close off if so specified */ + if (!(style & UNCLOSED)) + cairo_close_path(areawin->cr); + cairo_stroke_preserve(areawin->cr); + } + } + if (style & CLIPMASK) + cairo_clip_preserve(areawin->cr); + cairo_new_path(areawin->cr); // clear preserved paths +} + +/*-------------------------------------------------------------------------*/ + +void UDrawPolygon(polyptr thepoly, float passwidth) +{ + int i; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + if (thepoly->number) { + cairo_move_to(areawin->cr, thepoly->points[0].x, thepoly->points[0].y); + for (i = 1; i < thepoly->number; i++) + cairo_line_to(areawin->cr, thepoly->points[i].x, thepoly->points[i].y); + xc_cairo_strokepath(thepoly->style, thepoly->width * passwidth); + } +} + +/*-------------------------------------------------------------------------*/ + +void UDrawArc(arcptr thearc, float passwidth) +{ + XPoint tmppoints[RSTEPS + 2]; + float scaledwidth; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + scaledwidth = thearc->width * passwidth; + + if (abs(thearc->radius) == thearc->yaxis) + cairo_arc(areawin->cr, thearc->position.x, thearc->position.y, + abs(thearc->radius), thearc->angle1 * M_PI / 180.0, + thearc->angle2 * M_PI / 180.0); + else { + // perform elliptical arc, as described in cairo manual + cairo_save(areawin->cr); + cairo_translate(areawin->cr, thearc->position.x, thearc->position.y); + cairo_scale(areawin->cr, abs(thearc->radius), thearc->yaxis); + cairo_arc(areawin->cr, 0.0, 0.0, 1.0, thearc->angle1 * M_PI / 180.0, + thearc->angle2 * M_PI / 180.0); + cairo_restore(areawin->cr); + } + xc_cairo_strokepath(thearc->style, thearc->width * passwidth); + if (thearc->cycle != NULL) { + UDrawXLine(thearc->position, areawin->save); + } +} + +/*-------------------------------------------------------------------------*/ + +void UDrawPath(pathptr thepath, float passwidth) +{ + genericptr *genpath; + polyptr thepoly; + splineptr thespline; + Boolean draweditlines = FALSE; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + /* First pass---check for any splines that are being edited. If */ + /* any one is, then draw all control points for all splines in the */ + /* path. */ + + for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts; + genpath++) { + if (ELEMENTTYPE(*genpath) == SPLINE) { + thespline = TOSPLINE(genpath); + if (thespline->cycle != NULL) { + draweditlines = TRUE; + break; + } + } + } + + /* Draw first point */ + if (thepath->parts) { + genpath = thepath->plist; + switch(ELEMENTTYPE(*genpath)) { + case POLYGON: + thepoly = TOPOLY(genpath); + cairo_move_to(areawin->cr, thepoly->points[0].x, + thepoly->points[0].y); + break; + case SPLINE: + thespline = TOSPLINE(genpath); + cairo_move_to(areawin->cr, thespline->ctrl[0].x, + thespline->ctrl[0].y); + break; + } + } + /* Draw all other points */ + for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts; + genpath++) { + int i; + switch(ELEMENTTYPE(*genpath)) { + case POLYGON: + thepoly = TOPOLY(genpath); + for (i = 1; i < thepoly->number; i++) + cairo_line_to(areawin->cr, thepoly->points[i].x, + thepoly->points[i].y); + break; + case SPLINE: + thespline = TOSPLINE(genpath); + cairo_curve_to(areawin->cr, thespline->ctrl[1].x, + thespline->ctrl[1].y, thespline->ctrl[2].x, + thespline->ctrl[2].y, thespline->ctrl[3].x, + thespline->ctrl[3].y); + break; + } + } + xc_cairo_strokepath(thepath->style, thepath->width * passwidth); + /* Finally draw the edit lines */ + if (draweditlines) { + for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts; + genpath++) { + if (ELEMENTTYPE(*genpath) == SPLINE) { + thespline = TOSPLINE(genpath); + UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]); + UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]); + } + } + } +} + +/*-------------------------------------------------------------------------*/ + +void UDrawSpline(splineptr thespline, float passwidth) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_move_to(areawin->cr, thespline->ctrl[0].x, thespline->ctrl[0].y); + cairo_curve_to(areawin->cr, thespline->ctrl[1].x, thespline->ctrl[1].y, + thespline->ctrl[2].x, thespline->ctrl[2].y, + thespline->ctrl[3].x, thespline->ctrl[3].y); + xc_cairo_strokepath(thespline->style, thespline->width * passwidth); + if (thespline->cycle != NULL) { + UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]); + UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]); + } +} + +/*-------------------------------------------------------------------------*/ + +void UDrawGraphic(graphicptr gp) +{ + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + cairo_translate(areawin->cr, + gp->position.x, + gp->position.y); + cairo_rotate(areawin->cr, gp->rotation * M_PI / -180.); + cairo_scale(areawin->cr, gp->scale, -gp->scale); + cairo_set_source_surface(areawin->cr, gp->source, + - cairo_image_surface_get_width(gp->source) / 2., + - cairo_image_surface_get_height(gp->source) / 2.); + cairo_paint(areawin->cr); + cairo_restore(areawin->cr); +} + +/*----------------------------*/ +/* Draw the grids, axis, etc. */ +/*----------------------------*/ + +void draw_grids(void) +{ + double spc, spc2, spc3; + cairo_matrix_t m = { + .xx = 1., .yx = 0., .xy = 0., .yy = -1., + .x0 = -areawin->pcorner.x * areawin->vscale, + .y0 = areawin->height + areawin->pcorner.y * areawin->vscale + }; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + cairo_save(areawin->cr); + + /* draw lines for grid */ + spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale; + if (areawin->gridon && spc > 8) { + double x, y; + int ix, iy; + /* find bottom-right point on the grid */ + double xbegin = areawin->width; + double ybegin = areawin->height; + cairo_set_matrix(areawin->cr, &m); + cairo_scale(areawin->cr, spc, spc); + cairo_device_to_user(areawin->cr, &xbegin, &ybegin); + xbegin = floor(xbegin); + ybegin = ceil(ybegin); + ix = xbegin; + iy = ybegin; + cairo_user_to_device(areawin->cr, &xbegin, &ybegin); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(GRIDCOLOR); + cairo_set_line_width(areawin->cr, 1.); + for (x = xbegin; x >= 0.; x -= spc, ix--) { + if (!ix && areawin->axeson) continue; /* do not draw main axis */ + cairo_move_to(areawin->cr, floor(x) + .5, .5); + cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5); + } + for (y = ybegin; y >= 0.; y -= spc, iy++) { + if (!iy && areawin->axeson) continue; /* do not draw main axis */ + cairo_move_to(areawin->cr, .5, floor(y) + .5); + cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5); + } + cairo_stroke(areawin->cr); + } + + + if (areawin->axeson) { + /* find main axis */ + double x = 0, y = 0; + cairo_set_matrix(areawin->cr, &m); + cairo_user_to_device(areawin->cr, &x, &y); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(AXESCOLOR); + cairo_set_line_width(areawin->cr, 1.); + cairo_move_to(areawin->cr, floor(x) + .5, .5); + cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5); + cairo_move_to(areawin->cr, .5, floor(y) + .5); + cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5); + cairo_stroke(areawin->cr); + } + + /* bounding box goes beneath everything except grid/axis lines */ + UDrawBBox(); + + /* draw a little red dot at each snap-to point */ + spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale; + if (areawin->snapto && spc2 > 8) { + double x, y; + /* find bottom-right point on the grid */ + double xbegin = areawin->width; + double ybegin = areawin->height; + cairo_set_matrix(areawin->cr, &m); + cairo_scale(areawin->cr, spc2, spc2); + cairo_device_to_user(areawin->cr, &xbegin, &ybegin); + xbegin = floor(xbegin); + ybegin = ceil(ybegin); + cairo_user_to_device(areawin->cr, &xbegin, &ybegin); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(SNAPCOLOR); + cairo_set_line_width(areawin->cr, 1.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + for (x = xbegin; x >= 0.; x -= spc2) { + for (y = ybegin; y >= 0.; y -= spc2) { + cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5); + cairo_close_path(areawin->cr); + } + } + cairo_stroke(areawin->cr); + } + + /* Draw major snap points */ + spc3 = spc * 20.; + if (spc > 4.) { + double x, y; + /* find bottom-right point on the grid */ + double xbegin = areawin->width; + double ybegin = areawin->height; + cairo_set_matrix(areawin->cr, &m); + cairo_scale(areawin->cr, spc3, spc3); + cairo_device_to_user(areawin->cr, &xbegin, &ybegin); + xbegin = floor(xbegin); + ybegin = ceil(ybegin); + cairo_user_to_device(areawin->cr, &xbegin, &ybegin); + cairo_identity_matrix(areawin->cr); + /* draw the grid */ + xc_cairo_set_color(GRIDCOLOR); + cairo_set_line_width(areawin->cr, 3.); + cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND); + for (x = xbegin; x >= 0.; x -= spc3) { + for (y = ybegin; y >= 0.; y -= spc3) { + cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5); + cairo_close_path(areawin->cr); + } + } + cairo_stroke(areawin->cr); + } + cairo_restore(areawin->cr); +} + +/*---------------------------------------------------------------------*/ +/* draw a single character at 0, 0 using current transformation matrix */ +/*---------------------------------------------------------------------*/ + +float UDrawChar(u_char code, short styles, short ffont, int groupheight, + int passcolor, float passwidth) +{ + objectptr drawchar; + XPoint alphapts[2]; + float localwidth; + objinst charinst; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + /* No return here, since the return value might be needed? */ + } + + if ((ffont >= fontcount) || (fonts[ffont].encoding == NULL)) + return 0; + + alphapts[0].x = 0; + alphapts[0].y = 0; + charinst.type = OBJINST; + charinst.color = DEFAULTCOLOR; + charinst.rotation = 0; + charinst.scale = fonts[ffont].scale; + charinst.position = alphapts[0]; + charinst.params = NULL; + + /* get proper font and character */ + + drawchar = fonts[ffont].encoding[(u_char)code]; + charinst.thisobject = drawchar; + + if (fonts[ffont].cairo_family) { + cairo_save(areawin->cr); + cairo_text_extents_t extents; + cairo_select_font_face(areawin->cr, fonts[ffont].cairo_family, + fonts[ffont].slant, fonts[ffont].weight); + } + + if (!fonts[ffont].cairo_family && (fonts[ffont].flags & 0x22) == 0x22) { + /* font is not a cairo font and it is derived and italic */ + USlantCTM(DCTM, 0.25); /* premultiply by slanting function */ + } + + /* Draw glyph */ + if (!(styles & 64) && areawin->redraw_ongoing) { + if (fonts[ffont].cairo_family) { + cairo_set_font_size (areawin->cr, 40.); /* TODO: Why 40? */ + cairo_scale(areawin->cr, 1., -1.); + cairo_move_to (areawin->cr, 0., 0.); + cairo_show_text(areawin->cr, fonts[ffont].utf8encoding[code]); + cairo_new_path(areawin->cr); + } + else + UDrawObject(&charinst, SINGLE, passcolor, passwidth, NULL); + } + + /* Determine character width */ + if (fonts[ffont].cairo_family) { + /* Determine localwidth on a fixed font size of 100, to prevent hinting */ + /* from destroying scale independance */ + cairo_text_extents_t extents; + cairo_identity_matrix(areawin->cr); + cairo_set_font_size(areawin->cr, 100.); + cairo_text_extents(areawin->cr, fonts[ffont].utf8encoding[code], + &extents); + localwidth = extents.x_advance * fonts[ffont].scale / 100. * 40.; /* TODO: Why 40? */ + cairo_restore(areawin->cr); + } + else + localwidth = (drawchar->bbox.lowerleft.x + drawchar->bbox.width) + * fonts[ffont].scale; + + /* under- and overlines */ + if (!(styles & 64)) { + if (styles & 8) + alphapts[0].y = alphapts[1].y = -6; + else if (styles & 16) + alphapts[0].y = alphapts[1].y = groupheight + 4; + if (styles & 24 && areawin->redraw_ongoing) { + alphapts[0].x = 0; alphapts[1].x = localwidth; + cairo_set_line_width(areawin->cr, passwidth); + cairo_move_to(areawin->cr, alphapts[0].x, alphapts[0].y); + cairo_line_to(areawin->cr, alphapts[1].x, alphapts[1].y); + cairo_stroke(areawin->cr); + } + } + return localwidth; +} + +float xc_cairo_get_char_extents(const fontinfo *font, unsigned char c, + float *top, float *bottom) +{ + /* Determine localwidth on a fixed font size of 100, to */ + /* prevent hinting from destroying scale independance */ + cairo_text_extents_t extents; + cairo_save(areawin->cr); + cairo_identity_matrix(areawin->cr); + cairo_select_font_face(areawin->cr, font->cairo_family, font->slant, + fonts->weight); + cairo_set_font_size(areawin->cr, 100.); + cairo_text_extents(areawin->cr, font->utf8encoding[c], &extents); + cairo_restore(areawin->cr); + + if (top) + *top = -extents.y_bearing * 40. / 100.; + if (bottom) + *bottom = (extents.height - extents.y_bearing) * 40. / 100.; + return extents.x_advance * 40. / 100.; /* TODO: Why 40? */ +} + +/*----------------------------------------------------------------------*/ +/* A light wrapper around cairo_surface_t, to a generalized xcImage */ +/*----------------------------------------------------------------------*/ + +/* caching for cairo_surface_t */ +static xcImage *xcImagePixel_oldimg = NULL; +static uint32_t *xcImagePixel_data; +static int xcImagePixel_width; +static int xcImagePixel_height; + +static inline void xcImageCheckCache(xcImage *img) +{ + if (img != xcImagePixel_oldimg) { + xcImagePixel_oldimg = img; + xcImagePixel_data = (uint32_t*) cairo_image_surface_get_data(img); + xcImagePixel_width = cairo_image_surface_get_width(img); + xcImagePixel_height = cairo_image_surface_get_height(img); + } +} + +xcImage *xcImageCreate(int width, int height) +{ + return cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height); +} + +void xcImageDestroy(xcImage *img) +{ + cairo_surface_destroy(img); +} + +int xcImageGetWidth(xcImage *img) +{ + xcImageCheckCache(img); + return xcImagePixel_width; +} + +int xcImageGetHeight(xcImage *img) +{ + xcImageCheckCache(img); + return xcImagePixel_height; +} + +void xcImagePutPixel(xcImage *img, int x, int y, u_char r, u_char g, u_char b) +{ + xcImageCheckCache(img); + xcImagePixel_data[y * xcImagePixel_width + x] = (r << 16) | (g << 8) | b; +} + +void xcImageGetPixel(xcImage *img, int x, int y, u_char *r, u_char *g, + u_char *b) +{ + xcImageCheckCache(img); + uint32_t argb = xcImagePixel_data[y * xcImagePixel_width + x]; + *r = argb >> 16; + *g = argb >> 8; + *b = argb; +} + +#endif /* HAVE_CAIRO */ diff --git a/colordefs.h b/colordefs.h index c726855..1dd1a57 100644 --- a/colordefs.h +++ b/colordefs.h @@ -11,26 +11,26 @@ #define NUMBER_OF_COLORS 17 -#define BACKGROUND appcolors[0] -#define FOREGROUND appcolors[1] -#define SELECTCOLOR appcolors[2] -#define FILTERCOLOR appcolors[3] -#define GRIDCOLOR appcolors[4] -#define SNAPCOLOR appcolors[5] -#define AXESCOLOR appcolors[6] -#define OFFBUTTONCOLOR appcolors[7] -#define AUXCOLOR appcolors[8] -#define BARCOLOR appcolors[9] -#define PARAMCOLOR appcolors[10] +#define BACKGROUND 0 +#define FOREGROUND 1 +#define SELECTCOLOR 2 +#define FILTERCOLOR 3 +#define GRIDCOLOR 4 +#define SNAPCOLOR 5 +#define AXESCOLOR 6 +#define OFFBUTTONCOLOR 7 +#define AUXCOLOR 8 +#define BARCOLOR 9 +#define PARAMCOLOR 10 /* The rest of the colors are layout colors, not GUI colors */ -#define BBOXCOLOR appcolors[11] -#define LOCALPINCOLOR appcolors[12] -#define GLOBALPINCOLOR appcolors[13] -#define INFOLABELCOLOR appcolors[14] -#define RATSNESTCOLOR appcolors[15] -#define CLIPMASKCOLOR appcolors[15] +#define BBOXCOLOR 11 +#define LOCALPINCOLOR 12 +#define GLOBALPINCOLOR 13 +#define INFOLABELCOLOR 14 +#define RATSNESTCOLOR 15 +#define CLIPMASKCOLOR 16 #define DEFAULTCOLOR -1 /* Inherits color of parent */ #define DOFORALL -2 /* All elements inherit same color */ diff --git a/compile b/compile new file mode 100755 index 0000000..531136b --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.status b/config.status new file mode 100755 index 0000000..50bedac --- /dev/null +++ b/config.status @@ -0,0 +1,1113 @@ +#! /bin/sh +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile Xw/Makefile asg/Makefile spiceparser/Makefile" +config_commands=" depfiles" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +ac_cs_config="" +ac_cs_version="\ +config.status +configured by ./configure, generated by GNU Autoconf 2.69, + with options \"$ac_cs_config\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/tim/gitsrc/xcircuit-3.9' +srcdir='.' +INSTALL='/bin/install -c' +MKDIR_P='/bin/mkdir -p' +AWK='gawk' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X /bin/sh './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 + CONFIG_SHELL='/bin/sh' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +# +# INIT-COMMANDS +# +AMDEP_TRUE="" ac_aux_dir="." + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "Xw/Makefile") CONFIG_FILES="$CONFIG_FILES Xw/Makefile" ;; + "asg/Makefile") CONFIG_FILES="$CONFIG_FILES asg/Makefile" ;; + "spiceparser/Makefile") CONFIG_FILES="$CONFIG_FILES spiceparser/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && +S["am__EXEEXT_FALSE"]="" +S["am__EXEEXT_TRUE"]="#" +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["INSTALL_TARGET"]="install-recursive" +S["ALL_TARGET"]="all-recursive" +S["HAVE_LGF"]="LGF" +S["INTERPRETER"]="TCL" +S["LD"]="/bin/ld" +S["XCIRCUIT_TARGET"]="tcl" +S["WRAPPER_SCRIPT"]="wrapper.tcl" +S["INTERP_PATH"]="tcl" +S["STARTUP_FILE"]="xcstartup.tcl" +S["GS_LIBS"]="" +S["STDLIBS"]="" +S["SUBLIB"]="" +S["SUBDIRS"]="" +S["PYTHON"]="" +S["SPICE_EXEC"]="ngspice" +S["GS_EXEC"]="gs" +S["WISH_EXE"]="/usr/bin/wish" +S["TCL_LIB_DIR"]="/usr/lib64 " +S["LIB_SPECS"]=" -L/usr/lib64 -ltcl8.6 -L/usr/lib64 -ltk8.6" +S["INC_SPECS"]=" -I/usr/include -I/usr/include" +S["LD_RUN_PATH"]="-Wl,-rpath,/usr/lib64 " +S["EXTRA_LIB_SPECS"]=" -lm" +S["SHLIB_LIB_SPECS"]="" +S["LDDL_FLAGS"]="-Wl,-z,relro -Wl,--export-dynamic -Wl,--version-script=symbol.map" +S["SHLIB_LD"]="${CC} -shared ${CFLAGS} ${LDFLAGS} -fPIC -Wl,-soname,${@}" +S["SHDLIB_EXT"]=".so" +S["fontconfig_LIBS"]="-lfontconfig -lfreetype " +S["fontconfig_CFLAGS"]="-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 " +S["cairo_LIBS"]="-lcairo " +S["cairo_CFLAGS"]="-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 "\ +"-I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 " +S["PKG_CONFIG_LIBDIR"]="" +S["PKG_CONFIG_PATH"]="" +S["PKG_CONFIG"]="/bin/pkg-config" +S["X_EXTRA_LIBS"]="" +S["X_LIBS"]="" +S["X_PRE_LIBS"]=" -lSM -lICE" +S["X_CFLAGS"]="" +S["XMKMF"]="" +S["EGREP"]="/bin/grep -E" +S["GREP"]="/bin/grep" +S["CPP"]="gcc -E" +S["M4"]="/bin/m4" +S["RANLIB"]="ranlib" +S["am__fastdepCC_FALSE"]="" +S["am__fastdepCC_TRUE"]="#" +S["CCDEPMODE"]="depmode=none" +S["am__nodep"]="_no" +S["AMDEPBACKSLASH"]="\\" +S["AMDEP_FALSE"]="#" +S["AMDEP_TRUE"]="" +S["am__quote"]="" +S["am__include"]="include" +S["DEPDIR"]=".deps" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CC"]="gcc" +S["CPPFLAGS"]=" " +S["LDFLAGS"]=" " +S["CFLAGS"]="-g -Wno-pointer-sign -fPIC " +S["CC"]="gcc" +S["REVISION"]="71" +S["AM_BACKSLASH"]="\\" +S["AM_DEFAULT_VERBOSITY"]="1" +S["AM_DEFAULT_V"]="$(AM_DEFAULT_VERBOSITY)" +S["AM_V"]="$(V)" +S["am__untar"]="$${TAR-tar} xf -" +S["am__tar"]="$${TAR-tar} chof - \"$$tardir\"" +S["AMTAR"]="$${TAR-tar}" +S["am__leading_dot"]="." +S["SET_MAKE"]="" +S["AWK"]="gawk" +S["mkdir_p"]="$(MKDIR_P)" +S["MKDIR_P"]="/bin/mkdir -p" +S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" +S["STRIP"]="" +S["install_sh"]="${SHELL} /home/tim/gitsrc/xcircuit-3.9/install-sh" +S["MAKEINFO"]="makeinfo" +S["AUTOHEADER"]="autoheader" +S["AUTOMAKE"]="automake-1.14" +S["AUTOCONF"]="autoconf" +S["ACLOCAL"]="aclocal-1.14" +S["VERSION"]="3.9" +S["PACKAGE"]="xcircuit" +S["CYGPATH_W"]="echo" +S["am__isrc"]="" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["target_os"]="linux-gnu" +S["target_vendor"]="unknown" +S["target_cpu"]="x86_64" +S["target"]="x86_64-unknown-linux-gnu" +S["host_os"]="linux-gnu" +S["host_vendor"]="unknown" +S["host_cpu"]="x86_64" +S["host"]="x86_64-unknown-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="unknown" +S["build_cpu"]="x86_64" +S["build"]="x86_64-unknown-linux-gnu" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="-ldl -lz -lpthread -lieee -lm -lz -lXt -lSM -lICE -lm -lX11 -lXpm" +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DPACKAGE_NAME=\\\"\\\" -DPACKAGE_TARNAME=\\\"\\\" -DPACKAGE_VERSION=\\\"\\\" -DPACKAGE_STRING=\\\"\\\" -DPACKAGE_BUGREPORT=\\\"\\\" -DPACKAGE_URL=\\\"\\\" -DPACKAGE=\\\"xcir"\ +"cuit\\\" -DVERSION=\\\"3.9\\\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H"\ +"=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DS"\ +"IZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE__"\ +"_VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\\\"gs\\\" -DSPICE_EXEC=\\\"ngspice\\\" -DTCL_WR"\ +"APPER=1" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="" +S["PACKAGE_STRING"]="" +S["PACKAGE_VERSION"]="" +S["PACKAGE_TARNAME"]="" +S["PACKAGE_NAME"]="" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/sh" +_ACAWK +cat >>"$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 diff --git a/configure b/configure index c740413..a672b55 100755 --- a/configure +++ b/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -212,21 +236,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -328,6 +356,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -449,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -483,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -504,28 +544,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -609,11 +629,11 @@ ALL_TARGET HAVE_LGF INTERPRETER LD -SHLIB_CFLAGS XCIRCUIT_TARGET WRAPPER_SCRIPT INTERP_PATH STARTUP_FILE +GS_LIBS STDLIBS SUBLIB SUBDIRS @@ -630,6 +650,13 @@ SHLIB_LIB_SPECS LDDL_FLAGS SHLIB_LD SHDLIB_EXT +fontconfig_LIBS +fontconfig_CFLAGS +cairo_LIBS +cairo_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG X_EXTRA_LIBS X_LIBS X_PRE_LIBS @@ -643,6 +670,7 @@ RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -657,6 +685,10 @@ LDFLAGS CFLAGS CC REVISION +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -733,13 +765,13 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_dependency_tracking with_x -with_opengl -enable_double_buffer enable_optimize with_xpm with_gnu_ld +with_cairo with_tcl with_tk with_tclincls @@ -763,7 +795,14 @@ LDFLAGS LIBS CPPFLAGS CPP -XMKMF' +XMKMF +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +cairo_CFLAGS +cairo_LIBS +fontconfig_CFLAGS +fontconfig_LIBS' # Initialize some variables set by options. @@ -1219,8 +1258,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1387,9 +1424,12 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --disable-double-buffer disable graphics double-buffering + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-optimize enable compile-time optimizer flag -O2 --enable-asg enable support for Automatic Schematic Generation --disable-lgf disable support for reading Caltech tools @@ -1401,9 +1441,9 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System - --with-opengl=DIR use OpenGL include files in DIR --with-xpm=DIR use Xpm include/library files in DIR --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-cairo Use cairo graphics library [default=yes] --with-tcl=DIR Find tclConfig.sh in DIR --with-tk=DIR Find tkConfig.sh in DIR --with-tclincls=DIR Find tcl.h in DIR @@ -1424,6 +1464,18 @@ Some influential environment variables: you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + cairo_CFLAGS + C compiler flags for cairo, overriding pkg-config + cairo_LIBS linker flags for cairo, overriding pkg-config + fontconfig_CFLAGS + C compiler flags for fontconfig, overriding pkg-config + fontconfig_LIBS + linker flags for fontconfig, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1492,9 +1544,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1570,7 +1622,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1648,7 +1700,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1664,7 +1717,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1690,7 +1744,8 @@ int main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1706,7 +1761,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1740,7 +1796,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2035,7 +2092,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2529,7 +2586,7 @@ test -n "$target_alias" && PACKAGE=xcircuit VERSION=`cat ./VERSION | cut -d. -f1-2` -am__api_version='1.11' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2568,7 +2625,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2626,9 +2683,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2639,32 +2693,40 @@ case `pwd` in esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2676,6 +2738,16 @@ Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2698,12 +2770,12 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2715,10 +2787,10 @@ if test x"${install_sh}" != xset; then esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -2737,7 +2809,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2777,7 +2849,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2828,7 +2900,7 @@ do test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2857,12 +2929,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2881,7 +2947,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2945,6 +3011,45 @@ else fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2966,6 +3071,7 @@ fi # Define the identity of the package. + PACKAGE=${PACKAGE} VERSION=${VERSION} @@ -2995,18 +3101,70 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + -AMTAR=${AMTAR-"${am_missing_run}tar"} +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi SUBDIRS= SUBLIB= @@ -3017,11 +3175,10 @@ INSTALL_TARGET="undefined-install-target" REVISION=`cat ./VERSION | cut -d. -f3` INTERPRETER=NOINTERP HAVE_LGF=NOFORMATS -xc_with_GL= -SHLIB_CFLAGS="" LIB_SPECS="" WISH_EXE="" +SHLIB_CFLAGS="" @@ -3082,7 +3239,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3122,7 +3279,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3175,7 +3332,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3216,7 +3373,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3274,7 +3431,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3318,7 +3475,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3764,8 +3921,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3849,6 +4005,65 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -3868,7 +4083,7 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -3901,6 +4116,7 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3923,8 +4139,9 @@ else # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3958,16 +4175,16 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -3976,16 +4193,16 @@ else test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -4117,7 +4334,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4157,7 +4374,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4213,7 +4430,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_M4="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4445,7 +4662,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4511,7 +4728,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -5946,38 +6163,6 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -# Check whether --with-opengl was given. -if test "${with_opengl+set}" = set; then : - withval=$with_opengl; - if test "$withval" = "no" -o "$withval" = "NO" ; then - xc_with_GL= - else - xc_with_GL=1 - if test "$withval" != "no" -a "$withval" != "yes"; then - OGL_INCLUDE_DIR=${withval} - fi - fi - -fi - - -# Check whether --enable-double-buffer was given. -if test "${enable_double_buffer+set}" = set; then : - enableval=$enable_double_buffer; -else - - if test "x$xc_with_GL" == "x" ; then - $as_echo "#define DOUBLEBUFFER 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Double-buffering option not applicable to OpenGL version." >&5 -$as_echo "$as_me: WARNING: Double-buffering option not applicable to OpenGL version." >&2;} - fi - -fi - - # Check whether --enable-optimize was given. if test "${enable_optimize+set}" = set; then : enableval=$enable_optimize; @@ -6178,169 +6363,380 @@ xc_with_tcl_includes="" xc_with_tk_includes="" xc_with_tcl_libraries="" xc_with_tk_libraries="" +xc_with_cairo="yes" -# Check whether --with-tcl was given. -if test "${with_tcl+set}" = set; then : - withval=$with_tcl; - xc_with_tcl=$withval - if test "$withval" == "no" -o "$withval" == "NO"; then - xc_with_tcl="" - fi + +# Check whether --with-cairo was given. +if test "${with_cairo+set}" = set; then : + withval=$with_cairo; + xc_with_cairo=$withval + if test "$withval" == "no" -o "$withval" == "NO"; then + xc_with_cairo="" + fi fi +if test "x$xc_with_cairo" != "x" ; then + $as_echo "#define HAVE_CAIRO 1" >>confdefs.h + -if test $xc_with_GL ; then - ac_save_CPPFLAGS="$CPPFLAGS" - if test $OGL_INCLUDE_DIR ; then - CPPFLAGS="$CPPFLAGS -I$OGL_INCLUDE_DIR" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - ac_fn_c_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = xyes; then : -else - echo "GL header files not found; disabling OpenGL" - xc_with_GL= -fi - CPPFLAGS="$ac_save_CPPFLAGS" -fi -if test $xc_with_GL ; then - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXCreateContext in -lGL" >&5 -$as_echo_n "checking for glXCreateContext in -lGL... " >&6; } -if ${ac_cv_lib_GL_glXCreateContext+:} false; then : +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lGL $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char glXCreateContext (); -int -main () -{ -return glXCreateContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_GL_glXCreateContext=yes -else - ac_cv_lib_GL_glXCreateContext=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glXCreateContext" >&5 -$as_echo "$ac_cv_lib_GL_glXCreateContext" >&6; } -if test "x$ac_cv_lib_GL_glXCreateContext" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGL 1 -_ACEOF - LIBS="-lGL $LIBS" +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - echo "GL library files not found; disabling OpenGL" - xc_with_GL= - + ;; +esac fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluNewTess in -lGLU" >&5 -$as_echo_n "checking for gluNewTess in -lGLU... " >&6; } -if ${ac_cv_lib_GLU_gluNewTess+:} false; then : - $as_echo_n "(cached) " >&6 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lGLU $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gluNewTess (); -int -main () -{ -return gluNewTess (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_GLU_gluNewTess=yes + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi else - ac_cv_lib_GLU_gluNewTess=no + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluNewTess" >&5 -$as_echo "$ac_cv_lib_GLU_gluNewTess" >&6; } -if test "x$ac_cv_lib_GLU_gluNewTess" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGLU 1 -_ACEOF - LIBS="-lGLU $LIBS" +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo" >&5 +$as_echo_n "checking for cairo... " >&6; } +if test -n "$cairo_CFLAGS"; then + pkg_cv_cairo_CFLAGS="$cairo_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_cairo_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$cairo_LIBS"; then + pkg_cv_cairo_LIBS="$cairo_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_cairo_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else + pkg_failed=yes +fi + else + pkg_failed=untried +fi - echo "GLU library files not found; disabling OpenGL" - xc_with_GL= -fi - CPPFLAGS="$ac_save_CPPFLAGS" - LDFLAGS="$ac_save_LDFLAGS" +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + cairo_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo" 2>&1` + else + cairo_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$cairo_PKG_ERRORS" >&5 -if test $xc_with_GL ; then - $as_echo "#define OPENGL 1" >>confdefs.h + as_fn_error $? "Package requirements (cairo) were not met: - LIB_SPECS="${LIB_SPECS} -lGLU -lGL -lXi -lXmu -lXext" -fi +$cairo_PKG_ERRORS +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. +Alternatively, you may set the environment variables cairo_CFLAGS +and cairo_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. -# Check whether --with-tk was given. -if test "${with_tk+set}" = set; then : - withval=$with_tk; xc_with_tk=$withval -fi +Alternatively, you may set the environment variables cairo_CFLAGS +and cairo_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + cairo_CFLAGS=$pkg_cv_cairo_CFLAGS + cairo_LIBS=$pkg_cv_cairo_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -# Check whether --with-tclincls was given. -if test "${with_tclincls+set}" = set; then : - withval=$with_tclincls; xc_with_tcl_includes=$withval fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig" >&5 +$as_echo_n "checking for fontconfig... " >&6; } -# Check whether --with-tkincls was given. +if test -n "$fontconfig_CFLAGS"; then + pkg_cv_fontconfig_CFLAGS="$fontconfig_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_fontconfig_CFLAGS=`$PKG_CONFIG --cflags "fontconfig" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$fontconfig_LIBS"; then + pkg_cv_fontconfig_LIBS="$fontconfig_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_fontconfig_LIBS=`$PKG_CONFIG --libs "fontconfig" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + fontconfig_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fontconfig" 2>&1` + else + fontconfig_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fontconfig" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$fontconfig_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (fontconfig) were not met: + +$fontconfig_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables fontconfig_CFLAGS +and fontconfig_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables fontconfig_CFLAGS +and fontconfig_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + fontconfig_CFLAGS=$pkg_cv_fontconfig_CFLAGS + fontconfig_LIBS=$pkg_cv_fontconfig_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + for ac_header in ghostscript/gdevdsp.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ghostscript/gdevdsp.h" "ac_cv_header_ghostscript_gdevdsp_h" "$ac_includes_default" +if test "x$ac_cv_header_ghostscript_gdevdsp_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GHOSTSCRIPT_GDEVDSP_H 1 +_ACEOF + + GS_LIBS=-lgs + $as_echo "#define HAVE_GS 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building xcircuit without ghostscript rendering" >&5 +$as_echo "$as_me: WARNING: Building xcircuit without ghostscript rendering" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Install the ghostscript-devel package to solve this" >&5 +$as_echo "$as_me: WARNING: Install the ghostscript-devel package to solve this" >&2;} + + +fi + +done + +fi + + + +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then : + withval=$with_tcl; + xc_with_tcl=$withval + if test "$withval" == "no" -o "$withval" == "NO"; then + xc_with_tcl="" + fi + +fi + + + + +# Check whether --with-tk was given. +if test "${with_tk+set}" = set; then : + withval=$with_tk; xc_with_tk=$withval +fi + + +# Check whether --with-tclincls was given. +if test "${with_tclincls+set}" = set; then : + withval=$with_tclincls; xc_with_tcl_includes=$withval +fi + + +# Check whether --with-tkincls was given. if test "${with_tkincls+set}" = set; then : withval=$with_tkincls; xc_with_tk_includes=$withval fi @@ -6369,7 +6765,6 @@ if test "x$xc_with_tcl" != "x" ; then TCL_INC_DIR="." TK_INC_DIR="." - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5 $as_echo_n "checking for tclConfig.sh... " >&6; } tcl_config_sh="" @@ -6390,9 +6785,6 @@ $as_echo_n "checking for tclConfig.sh... " >&6; } elif test -r "$dir/lib/tclConfig.sh" ; then tcl_config_sh="$dir/lib/tclConfig.sh" break - elif test -r "$dir/unix/tclConfig.sh" ; then - tcl_config_sh="$dir/unix/tclConfig.sh" - break fi done else @@ -6412,9 +6804,6 @@ $as_echo_n "checking for tclConfig.sh... " >&6; } elif test -r "$dir/lib/tclConfig.sh" ; then tcl_config_sh="$dir/lib/tclConfig.sh" break - elif test -r "$dir/unix/tclConfig.sh" ; then - tcl_config_sh="$dir/unix/tclConfig.sh" - break fi done @@ -6478,9 +6867,6 @@ $as_echo_n "checking for tkConfig.sh... " >&6; } elif test -r "$dir/lib/tkConfig.sh" ; then tk_config_sh="$dir/lib/tkConfig.sh" break - elif test -r "$dir/unix/tkConfig.sh" ; then - tk_config_sh="$dir/unix/tkConfig.sh" - break fi done else @@ -6501,9 +6887,6 @@ $as_echo_n "checking for tkConfig.sh... " >&6; } elif test -r "$dir/lib/tkConfig.sh" ; then tk_config_sh="$dir/lib/tkConfig.sh" break - elif test -r "$dir/unix/tkConfig.sh" ; then - tk_config_sh="$dir/unix/tkConfig.sh" - break fi done # @@ -6551,29 +6934,37 @@ fi # # Source in the Tcl/Tk configuration scripts. # -# BTW: Does anyone actually use the tclConfig.sh and tkConfig.sh -# scripts? They seem to be always missing something. For example, -# why don't they say where to find the Tcl and Tk header files? -# -# For example, give me the library directory paths separately -# (I can't easily parse "-Ldir", but I can always paste a -L -# on the front). If I want to specify equivalent of the -R flag, -# I need the build a path of the library directories. Such as -# -# "-R $(BLTLIB):$(TKLIB):$(TCLLIB):($XLIB):$(JPEGLIB)" +# This didn't work so well in the pre-8.5 days, but +# seems to be okay now. # # ----------------------------------------------------------------------- if test "x$xc_with_tcl" != "x" ; then . $tcl_config_sh . $tk_config_sh + + # Should probably trust the config file contents, but this configure + # file checks the Tcl and Tk include and lib directories. Since + # the config file doesn't separate out the libraries from the strings + # passed to the compiler/linker, do it manually here. + # + # Extract TCL_LIB_DIR from TCL_LIB_SPEC + # Extract TK_LIB_DIR from TK_LIB_SPEC + # Extract TCL_INC_DIR from TCL_INCLUDE_SPEC + # Extract TK_INC_DIR from TK_INCLUDE_SPEC + # + # These will be the defaults unless overridden by configure command line + + tmpstr=${TCL_LIB_SPEC#*-L} + TCL_LIB_DIR=${tmpstr% -l*} + tmpstr=${TK_LIB_SPEC#*-L} + TK_LIB_DIR=${tmpstr% -l*} + TCL_INC_DIR=${TCL_INCLUDE_SPEC#*-I} + TK_INC_DIR=${TK_INCLUDE_SPEC#*-I} + LIBS="${TCL_LIBS} ${LIBS}" - if test "$TCL_VERSION" = "7.6" -a "$TK_VERSION" = "4.2" ; then - : - elif test "$TCL_VERSION" = "7.5" -a "$TK_VERSION" = "4.1" ; then - : - elif test "$TCL_VERSION" = "$TK_VERSION" ; then + if test "$TCL_VERSION" = "$TK_VERSION" ; then : else echo "Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)" @@ -6582,6 +6973,11 @@ if test "x$xc_with_tcl" != "x" ; then fi fi +# ----------------------------------------------------------------------- +# Rely on TCL_INCLUDE_SPEC from tclConfig.sh unless "--with-tclincls" +# overrides. With TCL_INCLUDE_SPEC, pull out TCL_INC_DIR +# ----------------------------------------------------------------------- + if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tcl_includes}" != "x" ; then if test -r "${xc_with_tcl_includes}/tcl.h" ; then @@ -6600,6 +6996,7 @@ if test "x$xc_with_tcl" != "x" ; then do if test -r "$dir/tcl.h" ; then TCL_INC_DIR=$dir + TCL_INCLUDE_SPEC="-I${TCL_INC_DIR}" break fi done @@ -6613,25 +7010,31 @@ if test "x$xc_with_tcl" != "x" ; then fi fi +# ----------------------------------------------------------------------- +# Rely on TK_INCLUDE_SPEC from tkConfig.sh unless "--with-tkincls" +# overrides. With TK_INCLUDE_SPEC, pull out TK_INC_DIR +# ----------------------------------------------------------------------- + if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tk_includes}" != "x" ; then if test -r "${xc_with_tk_includes}/tk.h" ; then TK_INC_DIR=${xc_with_tk_includes} - else + elif test "x${TK_INCLUDE_SPEC}" == "x" ; then echo "Can't find tk.h in \"${xc_with_tk_includes}\"" echo "Reverting to non-Tcl compilation" xc_with_tcl="" fi - else + elif test "x${TK_INCLUDE_SPEC}" == "x" ; then for dir in \ + ${TK_PREFIX}/include/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} \ ${TK_PREFIX}/include/tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION} \ ${TK_PREFIX}/include \ ${TK_SRC_DIR}/generic \ - ${TK_INC_DIR} \ - ${TCL_INC_DIR} + ${TK_INC_DIR} do if test -r "$dir/tk.h" ; then TK_INC_DIR=$dir + TK_INCLUDE_SPEC="-I${TK_INC_DIR}" break fi done @@ -6640,79 +7043,21 @@ if test "x$xc_with_tcl" != "x" ; then echo "Reverting to non-Tcl compilation" xc_with_tcl="" fi + else + TK_INC_DIR=`echo ${TK_INCLUDE_SPEC} | sed -e '/-I/s/-I//'` fi fi -if test "x$xc_with_tcl" != "x" ; then - case $target in - *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*) - TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}" - TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}" - ;; - *) - TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" - TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}" - ;; - esac - - TCL_LIB_SPEC="-l${TCL_LIB_NAME}" - TK_LIB_SPEC="-l${TK_LIB_NAME}" - -# Find the version of "wish" that corresponds to TCL_EXEC_PREFIX -# We really ought to run "ldd" to confirm that the linked libraries match. - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wish executable" >&5 -$as_echo_n "checking for wish executable... " >&6; } - for dir in \ - ${TK_EXEC_PREFIX}/bin \ - ${TK_EXEC_PREFIX} - do - for wishexe in \ - wish \ - wish${TK_VERSION} \ - wish.exe \ - wish${TK_VERSION}.exe - do - if test -r "$dir/$wishexe" ; then - WISH_EXE=$dir/$wishexe - break - fi - done - if test "x${WISH_EXE}" != "x" ; then - break - fi - done - if test "x${WISH_EXE}" = "x" ; then - echo "Warning: Can't find executable for \"wish\". You may have to" - echo "manually set the value for WISH_EXE in the xcircuit startup script." - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WISH_EXE}" >&5 -$as_echo "${WISH_EXE}" >&6; } - fi - -# Have to define SHDLIB_EXT here even though we have to do it below, too. - case $target in - *-hpux*) - SHDLIB_EXT=".sl" - ;; - *cygwin*) - SHDLIB_EXT=".dll" - ;; - *-darwin*) - SHDLIB_EXT=".dylib" - ;; - *-openbsd*) - SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}" - ;; - *) - SHDLIB_EXT=".so" - ;; - esac +# -------------------------------------------------------------- +# Rely on TCL_LIB_SPEC from tclConfig.sh unless "--with-tcllibs" +# overrides. With TCL_LIB_SPEC, pull out TCL_LIB_DIR +# -------------------------------------------------------------- +if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tcl_libraries}" != "x" ; then + TCL_LIB_SPEC="" for libname in \ + "${xc_with_tcl_libraries}/${TCL_LIB_FILE}" \ "${xc_with_tcl_libraries}/lib${TCL_LIB_NAME}${SHDLIB_EXT}" do if test -r "$libname" ; then @@ -6720,13 +7065,12 @@ $as_echo "${WISH_EXE}" >&6; } break fi done - - if test "x${TCL_LIB_DIR}" = "x" ; then + if test "x${TCL_LIB_DIR}" == "x" ; then echo "Can't find tcl library in \"${xc_with_tcl_libraries}\"" echo "Reverting to non-Tcl compile" xc_with_tcl="" fi - else + elif test "x${TCL_LIB_SPEC}" == "x" ; then for libpfix in "lib64" "lib" do libname="${TCL_EXEC_PREFIX}/${libpfix}/lib${TCL_LIB_NAME}${SHDLIB_EXT}" @@ -6740,12 +7084,21 @@ $as_echo "${WISH_EXE}" >&6; } echo "Reverting to non-Tcl compile" xc_with_tcl="" fi + else + TCL_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'` fi fi +# -------------------------------------------------------------- +# Rely on TK_LIB_SPEC from tkConfig.sh unless "--with-tklibs" +# overrides. With TK_LIB_SPEC, pull out TK_LIB_DIR +# -------------------------------------------------------------- + if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tk_libraries}" != "x" ; then + TK_LIB_SPEC="" for libname in \ + "${xc_with_tk_libraries}/${TK_LIB_FILE}" \ "${xc_with_tk_libraries}/lib${TK_LIB_NAME}${SHDLIB_EXT}" do if test -r "$libname" ; then @@ -6753,12 +7106,12 @@ if test "x$xc_with_tcl" != "x" ; then break fi done - if test "x${TK_LIB_DIR}" = "x" ; then + if test "x${TK_LIB_DIR}" == "x" ; then echo "Can't find tk library in \"${xc_with_tk_libraries}\"" echo "Reverting to non-Tcl compile" xc_with_tcl="" fi - else + elif test "x${TK_LIB_SPEC}" == "x" ; then for libpfix in "lib64" "lib" do libname="${TK_EXEC_PREFIX}/${libpfix}/lib${TK_LIB_NAME}${SHDLIB_EXT}" @@ -6772,306 +7125,179 @@ if test "x$xc_with_tcl" != "x" ; then echo "Reverting to non-Tcl compile" xc_with_tcl="" fi + else + TK_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'` fi fi - -# ----------------------------------------------------------------------- -# -# Tk libraries and header files -# -# ----------------------------------------------------------------------- +#-------------------------------------------------------------------- +# If TCL_LIB_SPEC and/or TK_LIB_SPEC do not exist, construct them +#-------------------------------------------------------------------- if test "x$xc_with_tcl" != "x" ; then - if test "${TK_INC_DIR}" != "/usr/include" -a \ - "${TK_INC_DIR}" != "${TCL_INC_DIR}"; then - INC_SPECS="${INC_SPECS} -I${TK_INC_DIR}" - fi - if test "${TK_LIB_DIR}" = "/usr/lib" -o \ - "${TK_LIB_DIR}" = "/usr/lib64" ; then - LIB_SPECS="${TK_LIB_SPEC}" - else - LIB_SPECS="-L${TK_LIB_DIR} ${TK_LIB_SPEC}" - if test "x${loader_run_path}" = "x" ; then - loader_run_path="${TK_LIB_DIR}" - else - loader_run_path="${TK_LIB_DIR}:${loader_run_path}" - fi + if test "x${TCL_LIB_SPEC}" == "x" ; then + case $target in + *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*) + TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}" + ;; + *) + TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" + ;; + esac + TCL_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_LIB_NAME}" fi -# ----------------------------------------------------------------------- -# -# Tcl libraries and header files -# -# Add a header file directory specification only if the Tcl headers reside -# in a different directory from Tk's. -# -# -# ----------------------------------------------------------------------- - if test "x${TCL_INCLUDE_SPEC}" != "x" ; then - INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC}" - elif test "${TCL_INC_DIR}" != "/usr/include" ; then - INC_SPECS="${INC_SPECS} -I${TCL_INC_DIR}" + if test "x${TK_LIB_SPEC}" == "x" ; then + case $target in + *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*) + TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}" + ;; + *) + TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}" + ;; + esac + TK_LIB_SPEC="-L${TK_LIB_DIR} -l${TK_LIB_NAME}" fi - if test "${TCL_LIB_DIR}" = "/usr/lib" -o \ - "${TCL_LIB_DIR}" = "/usr/lib64" -o \ - "${TCL_LIB_DIR}" = "${TK_LIB_DIR}" ; then - LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC}" - else - LIB_SPECS="${LIB_SPECS} -L${TCL_LIB_DIR} ${TCL_LIB_SPEC}" - if test "x${loader_run_path}" = "x" ; then - loader_run_path="${TCL_LIB_DIR}" - else - loader_run_path="${TCL_LIB_DIR}:${loader_run_path}" + # Find the version of "wish" that corresponds to TCL_EXEC_PREFIX + # We really ought to run "ldd" to confirm that the linked libraries match. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wish executable" >&5 +$as_echo_n "checking for wish executable... " >&6; } + for dir in \ + ${TK_EXEC_PREFIX}/bin \ + ${TK_EXEC_PREFIX} + do + for wishexe in \ + wish \ + wish${TK_VERSION} \ + wish.exe \ + wish${TK_VERSION}.exe + do + if test -r "$dir/$wishexe" ; then + WISH_EXE=$dir/$wishexe + break + fi + done + if test "x${WISH_EXE}" != "x" ; then + break fi + done + if test "x${WISH_EXE}" = "x" ; then + echo "Warning: Can't find executable for \"wish\". You may have to" + echo "manually set the value for WISH_EXE in the xcircuit startup script." + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WISH_EXE}" >&5 +$as_echo "${WISH_EXE}" >&6; } fi -#-------------------------------------------------------------------- -# -# Check if we can generate shared libraries on this system. Set flags -# to generate shared libraries for systems that we know about. Start -# with the values found in tclConfig.sh, make changes as we know about -# the different systems. -# -#-------------------------------------------------------------------- - -# Initialize shared library build variables - - LDDL_FLAGS="-shared" - SHDLIB_EXT=".so" - LD_RUN_PATH="" - EXTRA_LIB_SPECS="" - - build_shared="yes" - + # Have to define SHDLIB_EXT here even though we have to do it below, too. case $target in - *-aix4.[2-9]*) - # No Position-Independent flags needed - - # Use the installed export file or the one found in the source directory. - - if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then - tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" - else - tcl_exp="${TCL_SRC_DIR}/unix/lib.exp" - fi - if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then - tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" - else - tk_exp="${TK_SRC_DIR}/unix/lib.exp" - fi - - full_src_path=`cd ${srcdir}; pwd` - - # Use shell-script to link shared library - SHLIB_LD="${full_src_path}/cf/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}" - - SHLIB_LIB_SPEC="${aix_lib_specs} -lc" - - LDFLAGS="-L${loader_run_path}" - EXTRA_LIB_SPECS="-ldl" - ;; - - *-aix*) - # No Position-Independent flags needed - - # Use the installed export file or the one found in the source directory. - - if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then - tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" - else - tcl_exp="${TCL_SRC_DIR}/unix/lib.exp" - fi - if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then - tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" - else - tk_exp="${TK_SRC_DIR}/unix/lib.exp" - fi - - full_src_path=`cd ${srcdir}/cf; pwd` - - # Use shell-script to link shared library - - SHLIB_LD="${full_src_path}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}" - - SHLIB_LIB_SPECS="${aix_lib_specs} -lc" - - LDFLAGS="-L${loader_run_path}" - EXTRA_LIB_SPECS="-lld" - ;; - - *-bsdi2*|*-bsdi3*) - SHLIB_LD="shlicc" - LDDL_FLAGS="-r" - - EXTRA_LIB_SPECS="-ldl" - ;; - - *-darwin*) - SHDLIB_EXT=".dylib" - SHLIB_LIB_SPECS="${LIB_SPECS}" - if test "${xc_with_gnu_ld}" = "yes" ; then - LDDL_FLAGS="-dynamiclib -bind_at_load" - else - LDDL_FLAGS="-single_module -dynamiclib -flat_namespace" - LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind" - SHLIB_CFLAGS="-I/sw/include -fno-common" - fi - ;; - - *cygwin*) - $as_echo "#define CYGWIN 1" >>confdefs.h - - SHDLIB_EXT=".dll" - LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}" - SHLIB_LIB_SPECS="${LIB_SPECS}" - ;; - - *-bsdi4*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="${CC}" - LDDL_FLAGS='-shared -Wl,-E -Wl,-soname,$@' - ;; - - *-dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" - - EXTRA_LIB_SPECS="-ldl" - ;; - - *-hpux*) - if test "$GCC" = "no" ; then - DEFINES="$DEFINES -D_HPUX_SOURCE" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - found=yes -else - found=no + *-hpux*) + SHDLIB_EXT=".sl" + ;; + *cygwin*) + SHDLIB_EXT=".dll.a" + ;; + *-darwin*) + SHDLIB_EXT=".dylib" + ;; + *-openbsd*) + SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}" + ;; + *) + SHDLIB_EXT=".so" + ;; + esac fi - if test "${found}" = "yes" ; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld" - LDDL_FLAGS="-b -E -n +s +b,${loader_run_path}:." - SHDLIB_EXT=".sl" - # The run path is included in both LDFLAGS and LDDL_FLAGS - # because SHLIB_LD is ld and LD is cc/gcc. - - LDFLAGS="-Wl,-E -Wl,+s,+b,${loader_run_path}:." - EXTRA_LIB_SPECS="-ldld" - fi - ;; +# ----------------------------------------------------------------------- +# +# Tk libraries and header files +# +# ----------------------------------------------------------------------- - *-irix64-6.5*) - SHLIB_LD="ld" - LDDL_FLAGS="-32 -shared -rdata_shared" - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - ;; +if test "x$xc_with_tcl" != "x" ; then + INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC} ${TK_INCLUDE_SPEC}" + LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC} ${TK_LIB_SPEC}" - *-irix-56.*|*-irix64-*) - SHLIB_LD="ld" - LDDL_FLAGS="-shared -rdata_shared" - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - LDFLAGS="" - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-mabi=n32 $SHLIB_CFLAGS" - LDDL_FLAGS="-mabi=n32 $LDDL_FLAGS" - LDFLAGS="-mabi=n32 $LDFLAGS" - else - CFLAGS="-n32 $CFLAGS" - LDFLAGS="-n32 $LDFLAGS" - fi - ;; + if test "x${loader_run_path}" = "x" ; then + loader_run_path="${TCL_LIB_DIR}" + else + loader_run_path="${TCL_LIB_DIR}:${loader_run_path}" + fi - *-linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC}" - LDDL_FLAGS='-shared -Wl,-soname,$@' - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" + #-------------------------------------------------------------------- + # + # Check if we can generate shared libraries on this system. Set flags + # to generate shared libraries for systems that we know about. Start + # with the values found in tclConfig.sh, make changes as we know about + # the different systems. + # + #-------------------------------------------------------------------- - EXTRA_LIB_SPECS="-ldl" + # Initialize shared library build variables - case $target in - x86_64-*) - # AMD 64-bit archictecture - # Add -fPIC to standard compile switch - CFLAGS="${CFLAGS} -fPIC" - ;; - esac - ;; + if test "x${TCL_SHLIB_SUFFIX}" == "x" ; then + SHDLIB_EXT=".so" + else + SHDLIB_EXT="${TCL_SHLIB_SUFFIX}" + fi - *-mp-ras-02*) - SHLIB_CFLAGS="-G -K PIC" - SHLIB_LD="${CC}" - LDDL_FLAGS="" - ;; + if test "x${TCL_SHLIB_LD}" == "x" ; then + + # Construct shared library build arguments the painful way + # This is not expected to be necessary, so the number of + # supported systems has been pared down to a minimum. + + LDDL_FLAGS="-shared" + LD_RUN_PATH="" + SHLIB_LD="${CC}" + EXTRA_LIB_SPECS="" + + case $target in + *-darwin*) + SHDLIB_EXT=".dylib" + SHLIB_LIB_SPECS="${LIB_SPECS}" + if test "${xc_with_gnu_ld}" = "yes" ; then + LDDL_FLAGS="-dynamiclib -bind_at_load" + else + LDDL_FLAGS="-single_module -dynamiclib -flat_namespace" + LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind" + SHLIB_CFLAGS="-I/sw/include -fno-common" + fi + ;; - *-mp-ras-*) - SHLIB_CFLAGS="-G -K PIC" - SHLIB_LD="${CC}" - LDDL_FLAGS="-Wl,-Bexport" - ;; + *cygwin*) + $as_echo "#define CYGWIN 1" >>confdefs.h - *-ncr-sysv4-*2*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" + SHDLIB_EXT=".dll.a" + LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}" + SHLIB_LIB_SPECS="${LIB_SPECS}" + ;; - EXTRA_LIB_SPECS="-ldl" - ;; + *-linux*) + SHLIB_CFLAGS="-fPIC" + LDDL_FLAGS='-shared -Wl,-soname,$@' + LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - *-ncr-sysv4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G -Wl,-Bexport" + EXTRA_LIB_SPECS="-ldl" - LDFLAGS="-Wl,-Bexport" - EXTRA_LIB_SPECS="-ldl" - ;; + case $target in + x86_64-*) + # AMD 64-bit archictecture + # Add -fPIC to standard compile switch + CFLAGS="${CFLAGS} -fPIC" + ;; + esac + ;; - *-netbsd*|*-freebsd*|*-openbsd*) - # Not available on all versions: check for include file. - ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" + *-netbsd*|*-freebsd*|*-openbsd*) + # Not available on all versions: check for include file. + ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes; then : test_ok=yes else @@ -7079,110 +7305,47 @@ else fi - if test "$test_ok" = yes; then - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld" - LDDL_FLAGS="-shared" - fi - ;; - - *-nextstep*) - SHLIB_LD="cc" - LDDL_FLAGS="-nostdlib -r" - ;; - - *-osf1-1.012*) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - - # Warning: Ugly Makefile Hack - # Make package name same as library name - - SHLIB_LD='ld -R -export $@:' - ;; - - *-osf1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -shared" - ;; - - *-osf1V*) - # Digital OSF/1 - - SHLIB_LD='ld' - LDDL_FLAGS='-shared -expect_unresolved "*"' - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - LDFLAGS="" - ;; - - *-sco*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - - SHLIB_CFLAGS="-Kpic -belf" - SHLIB_LD="ld" - LDDL_FLAGS="-G" - LDFLAGS="-belf -Wl,-Bexport" - ;; - - *-sni-sysv*) - - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" + if test "$test_ok" = yes; then + SHLIB_CFLAGS="-fpic" + SHLIB_LD="ld" + LDDL_FLAGS="-shared" + fi + ;; + esac - EXTRA_LIB_SPECS="-ldl" - ;; + if test "$GCC" = "yes" ; then + CFLAGS="-fPIC ${CFLAGS}" + fi - *-sunos4*) + else - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - LDDL_FLAGS="-assert pure-text" + # Rely on shared lib arguments in tclConfig.sh - EXTRA_LIB_SPECS="-ldl" - ;; + SHLIB_LD="${TCL_SHLIB_LD}" + EXTRA_LIB_FLAGS="" + LDDL_FLAGS="${TCL_LD_FLAGS}" + LD_RUN_PATH="" - *-solaris2*) - - if test "${xc_with_gnu_ld}" = "yes" ; then - LDDL_FLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@' + case $target in + *-linux*) LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - else - LDDL_FLAGS="-shared -mimpure-text" - LD_RUN_PATH="-R ${loader_run_path}" - fi - EXTRA_LIB_SPECS="-ldl" - SHLIB_LIB_SPECS="${LIB_SPECS}" - ;; - - *-mips-dde-sysv*) - - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" - - EXTRA_LIB_SPECS="-ldl" - ;; - - *-pc-sysv4* | *-unixware-5*) - SHLIB_CFLAGS="-G -KPIC" - SHLIB_LD="${CC}" - LDDL_FLAGS=" -Wl,-Bexport" - ;; - - esac + ;; + esac + fi -# If we're running gcc, then set SHLIB_CFLAGS flags for compiling -# shared libraries for gcc, instead of those of the vendor's -# compiler. + # If we're running gcc, then set SHLIB_CFLAGS flags for compiling + # shared libraries for gcc, instead of those of the vendor's + # compiler. if test "$GCC" = "yes" ; then -# SHLIB_CFLAGS="${SHLIB_CFLAGS} -fPIC" - CFLAGS="-fPIC ${CFLAGS}" + if test "x${TCL_SHLIB_CFLAGS}" = "x" ; then + SHLIB_CFLAGS="-fPIC ${SHLIB_CFLAGS}" + else + SHLIB_CFLAGS="${TCL_SHLIB_CFLAGS} ${SHLIB_CFLAGS}" + fi fi + CFLAGS="${CFLAGS} ${SHLIB_CFLAGS}" + if test "${xc_with_gnu_ld}" = "yes" ; then LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=symbol.map" fi @@ -7265,7 +7428,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GS_EXEC="" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7322,7 +7485,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_SPICE_EXEC="" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7385,7 +7548,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7718,6 +7881,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -8032,16 +8203,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -8101,28 +8272,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -8144,7 +8303,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8201,10 +8360,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -8284,7 +8443,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -8753,7 +8912,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -8766,7 +8925,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -8800,21 +8959,19 @@ $as_echo X"$mf" | continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || @@ -8885,3 +9042,32 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + +echo "" +echo "Configuration results:" +echo "----------------------------------------------------" +echo "" + +if test "x$xc_with_tcl" == "x" ; then + if test "x$PYTHON" != x; then + echo "Using Python interface (not recommended)" + else + echo "No Tcl/Tk, using standard Xlib/Xt interface." + echo "If that is not what you wanted, then make sure" + echo "you have Tcl/Tk development packages installed?" + fi +else + echo "Using Tcl/Tk interface" +fi +echo "" + +if test "x$xc_with_cairo" == "x" ; then + echo "No Cairo graphics." + echo "If that is not what you wanted, then make sure" + echo "you have libcairo and fontconfig installed." + echo "Try installing package cairo-devel." +else + echo "Using Cairo graphics" +fi +echo "" +echo "CFLAGS=${CFLAGS}" diff --git a/configure.in b/configure.in index 34d0f4b..a11d817 100644 --- a/configure.in +++ b/configure.in @@ -23,11 +23,10 @@ INSTALL_TARGET="undefined-install-target" REVISION=`cat ./VERSION | cut -d. -f3` INTERPRETER=NOINTERP HAVE_LGF=NOFORMATS -xc_with_GL= -SHLIB_CFLAGS="" LIB_SPECS="" WISH_EXE="" +SHLIB_CFLAGS="" dnl Default is to use Tcl; if it can't be found, then flag a warning dnl and revert to the non-Tcl version. @@ -148,29 +147,6 @@ foo = 0],[ AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) -dnl OpenGL Graphics -AC_ARG_WITH(opengl, -[ --with-opengl=DIR use OpenGL include files in DIR], [ - if test "$withval" = "no" -o "$withval" = "NO" ; then - xc_with_GL= - else - xc_with_GL=1 - if test "$withval" != "no" -a "$withval" != "yes"; then - OGL_INCLUDE_DIR=${withval} - fi - fi -]) - -dnl Graphics double-buffering? Enabled by default unless OpenGL used. -AC_ARG_ENABLE(double-buffer, -[ --disable-double-buffer disable graphics double-buffering], , [ - if test "x$xc_with_GL" == "x" ; then - AC_DEFINE(DOUBLEBUFFER) - else - AC_MSG_WARN(Double-buffering option not applicable to OpenGL version.) - fi -]) - dnl Enable compile-time Optimization? Disable by default for debugging AC_ARG_ENABLE(optimize, [ --enable-optimize enable compile-time optimizer flag -O2], , [ @@ -299,7 +275,42 @@ xc_with_tcl_includes="" xc_with_tk_includes="" xc_with_tcl_libraries="" xc_with_tk_libraries="" +xc_with_cairo="yes" +dnl ----------------------------------------------------------------------- +dnl --- Cairo library +dnl ----------------------------------------------------------------------- + +AC_ARG_WITH([cairo], + [AS_HELP_STRING([--with-cairo], + [Use cairo graphics library @<:@default=yes@:>@])], + [ + xc_with_cairo=$withval + if test "$withval" == "no" -o "$withval" == "NO"; then + xc_with_cairo="" + fi + ], ) + +if test "x$xc_with_cairo" != "x" ; then + AC_DEFINE([HAVE_CAIRO]) + PKG_CHECK_MODULES([cairo], [cairo]) + PKG_CHECK_MODULES([fontconfig], [fontconfig]) + AC_CHECK_HEADERS([ghostscript/gdevdsp.h], + [ + GS_LIBS=-lgs + AC_DEFINE([HAVE_GS]) + ], + [ + AC_MSG_WARN([Building xcircuit without ghostscript rendering]) + AC_MSG_WARN([Install the ghostscript-devel package to solve this]) + ] + ) +fi + +dnl ----------------------------------------------------------------------- +dnl --- Tcl/Tk support +dnl ----------------------------------------------------------------------- + AC_ARG_WITH(tcl, [ --with-tcl=DIR Find tclConfig.sh in DIR], [ xc_with_tcl=$withval @@ -308,44 +319,6 @@ AC_ARG_WITH(tcl, fi ], ) -dnl ----------------------------------------------------------------------- -dnl Find OpenGL, if selected -dnl ----------------------------------------------------------------------- - -if test $xc_with_GL ; then - ac_save_CPPFLAGS="$CPPFLAGS" - if test $OGL_INCLUDE_DIR ; then - CPPFLAGS="$CPPFLAGS -I$OGL_INCLUDE_DIR" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - AC_CHECK_HEADER(GL/gl.h, , [ - echo "GL header files not found; disabling OpenGL" - xc_with_GL= - ],) - CPPFLAGS="$ac_save_CPPFLAGS" -fi - -if test $xc_with_GL ; then - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - AC_CHECK_LIB(GL, glXCreateContext, , [ - echo "GL library files not found; disabling OpenGL" - xc_with_GL= - ],) - AC_CHECK_LIB(GLU, gluNewTess, , [ - echo "GLU library files not found; disabling OpenGL" - xc_with_GL= - ],) - CPPFLAGS="$ac_save_CPPFLAGS" - LDFLAGS="$ac_save_LDFLAGS" -fi - -if test $xc_with_GL ; then - AC_DEFINE(OPENGL) - LIB_SPECS="${LIB_SPECS} -lGLU -lGL -lXi -lXmu -lXext" -fi - dnl ----------------------------------------------------------------------- dnl If TCL is not disabled, do our best to find it dnl ----------------------------------------------------------------------- @@ -372,7 +345,6 @@ if test "x$xc_with_tcl" != "x" ; then TCL_INC_DIR="." TK_INC_DIR="." - AC_MSG_CHECKING([for tclConfig.sh]) tcl_config_sh="" @@ -392,9 +364,6 @@ if test "x$xc_with_tcl" != "x" ; then elif test -r "$dir/lib/tclConfig.sh" ; then tcl_config_sh="$dir/lib/tclConfig.sh" break - elif test -r "$dir/unix/tclConfig.sh" ; then - tcl_config_sh="$dir/unix/tclConfig.sh" - break fi done else @@ -414,9 +383,6 @@ if test "x$xc_with_tcl" != "x" ; then elif test -r "$dir/lib/tclConfig.sh" ; then tcl_config_sh="$dir/lib/tclConfig.sh" break - elif test -r "$dir/unix/tclConfig.sh" ; then - tcl_config_sh="$dir/unix/tclConfig.sh" - break fi done @@ -478,9 +444,6 @@ if test "x$xc_with_tcl" != "x" ; then elif test -r "$dir/lib/tkConfig.sh" ; then tk_config_sh="$dir/lib/tkConfig.sh" break - elif test -r "$dir/unix/tkConfig.sh" ; then - tk_config_sh="$dir/unix/tkConfig.sh" - break fi done else @@ -501,9 +464,6 @@ if test "x$xc_with_tcl" != "x" ; then elif test -r "$dir/lib/tkConfig.sh" ; then tk_config_sh="$dir/lib/tkConfig.sh" break - elif test -r "$dir/unix/tkConfig.sh" ; then - tk_config_sh="$dir/unix/tkConfig.sh" - break fi done # @@ -550,29 +510,37 @@ fi # # Source in the Tcl/Tk configuration scripts. # -# BTW: Does anyone actually use the tclConfig.sh and tkConfig.sh -# scripts? They seem to be always missing something. For example, -# why don't they say where to find the Tcl and Tk header files? -# -# For example, give me the library directory paths separately -# (I can't easily parse "-Ldir", but I can always paste a -L -# on the front). If I want to specify equivalent of the -R flag, -# I need the build a path of the library directories. Such as -# -# "-R $(BLTLIB):$(TKLIB):$(TCLLIB):($XLIB):$(JPEGLIB)" +# This didn't work so well in the pre-8.5 days, but +# seems to be okay now. # # ----------------------------------------------------------------------- if test "x$xc_with_tcl" != "x" ; then . $tcl_config_sh . $tk_config_sh + + # Should probably trust the config file contents, but this configure + # file checks the Tcl and Tk include and lib directories. Since + # the config file doesn't separate out the libraries from the strings + # passed to the compiler/linker, do it manually here. + # + # Extract TCL_LIB_DIR from TCL_LIB_SPEC + # Extract TK_LIB_DIR from TK_LIB_SPEC + # Extract TCL_INC_DIR from TCL_INCLUDE_SPEC + # Extract TK_INC_DIR from TK_INCLUDE_SPEC + # + # These will be the defaults unless overridden by configure command line + + tmpstr=${TCL_LIB_SPEC#*-L} + TCL_LIB_DIR=${tmpstr% -l*} + tmpstr=${TK_LIB_SPEC#*-L} + TK_LIB_DIR=${tmpstr% -l*} + TCL_INC_DIR=${TCL_INCLUDE_SPEC#*-I} + TK_INC_DIR=${TK_INCLUDE_SPEC#*-I} + LIBS="${TCL_LIBS} ${LIBS}" - if test "$TCL_VERSION" = "7.6" -a "$TK_VERSION" = "4.2" ; then - : - elif test "$TCL_VERSION" = "7.5" -a "$TK_VERSION" = "4.1" ; then - : - elif test "$TCL_VERSION" = "$TK_VERSION" ; then + if test "$TCL_VERSION" = "$TK_VERSION" ; then : else echo "Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)" @@ -581,6 +549,11 @@ if test "x$xc_with_tcl" != "x" ; then fi fi +# ----------------------------------------------------------------------- +# Rely on TCL_INCLUDE_SPEC from tclConfig.sh unless "--with-tclincls" +# overrides. With TCL_INCLUDE_SPEC, pull out TCL_INC_DIR +# ----------------------------------------------------------------------- + if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tcl_includes}" != "x" ; then if test -r "${xc_with_tcl_includes}/tcl.h" ; then @@ -599,6 +572,7 @@ if test "x$xc_with_tcl" != "x" ; then do if test -r "$dir/tcl.h" ; then TCL_INC_DIR=$dir + TCL_INCLUDE_SPEC="-I${TCL_INC_DIR}" break fi done @@ -612,25 +586,31 @@ if test "x$xc_with_tcl" != "x" ; then fi fi +# ----------------------------------------------------------------------- +# Rely on TK_INCLUDE_SPEC from tkConfig.sh unless "--with-tkincls" +# overrides. With TK_INCLUDE_SPEC, pull out TK_INC_DIR +# ----------------------------------------------------------------------- + if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tk_includes}" != "x" ; then if test -r "${xc_with_tk_includes}/tk.h" ; then TK_INC_DIR=${xc_with_tk_includes} - else + elif test "x${TK_INCLUDE_SPEC}" == "x" ; then echo "Can't find tk.h in \"${xc_with_tk_includes}\"" echo "Reverting to non-Tcl compilation" xc_with_tcl="" fi - else + elif test "x${TK_INCLUDE_SPEC}" == "x" ; then for dir in \ + ${TK_PREFIX}/include/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} \ ${TK_PREFIX}/include/tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION} \ ${TK_PREFIX}/include \ ${TK_SRC_DIR}/generic \ - ${TK_INC_DIR} \ - ${TCL_INC_DIR} + ${TK_INC_DIR} do if test -r "$dir/tk.h" ; then TK_INC_DIR=$dir + TK_INCLUDE_SPEC="-I${TK_INC_DIR}" break fi done @@ -639,76 +619,21 @@ if test "x$xc_with_tcl" != "x" ; then echo "Reverting to non-Tcl compilation" xc_with_tcl="" fi - fi -fi - -if test "x$xc_with_tcl" != "x" ; then - case $target in - *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*) - TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}" - TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}" - ;; - *) - TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" - TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}" - ;; - esac - - TCL_LIB_SPEC="-l${TCL_LIB_NAME}" - TK_LIB_SPEC="-l${TK_LIB_NAME}" - -# Find the version of "wish" that corresponds to TCL_EXEC_PREFIX -# We really ought to run "ldd" to confirm that the linked libraries match. - - AC_MSG_CHECKING([for wish executable]) - for dir in \ - ${TK_EXEC_PREFIX}/bin \ - ${TK_EXEC_PREFIX} - do - for wishexe in \ - wish \ - wish${TK_VERSION} \ - wish.exe \ - wish${TK_VERSION}.exe - do - if test -r "$dir/$wishexe" ; then - WISH_EXE=$dir/$wishexe - break - fi - done - if test "x${WISH_EXE}" != "x" ; then - break - fi - done - if test "x${WISH_EXE}" = "x" ; then - echo "Warning: Can't find executable for \"wish\". You may have to" - echo "manually set the value for WISH_EXE in the xcircuit startup script." - AC_MSG_RESULT(no) else - AC_MSG_RESULT([${WISH_EXE}]) + TK_INC_DIR=`echo ${TK_INCLUDE_SPEC} | sed -e '/-I/s/-I//'` fi +fi -# Have to define SHDLIB_EXT here even though we have to do it below, too. - case $target in - *-hpux*) - SHDLIB_EXT=".sl" - ;; - *cygwin*) - SHDLIB_EXT=".dll" - ;; - *-darwin*) - SHDLIB_EXT=".dylib" - ;; - *-openbsd*) - SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}" - ;; - *) - SHDLIB_EXT=".so" - ;; - esac +# -------------------------------------------------------------- +# Rely on TCL_LIB_SPEC from tclConfig.sh unless "--with-tcllibs" +# overrides. With TCL_LIB_SPEC, pull out TCL_LIB_DIR +# -------------------------------------------------------------- +if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tcl_libraries}" != "x" ; then + TCL_LIB_SPEC="" for libname in \ + "${xc_with_tcl_libraries}/${TCL_LIB_FILE}" \ "${xc_with_tcl_libraries}/lib${TCL_LIB_NAME}${SHDLIB_EXT}" do if test -r "$libname" ; then @@ -716,13 +641,12 @@ if test "x$xc_with_tcl" != "x" ; then break fi done - - if test "x${TCL_LIB_DIR}" = "x" ; then + if test "x${TCL_LIB_DIR}" == "x" ; then echo "Can't find tcl library in \"${xc_with_tcl_libraries}\"" echo "Reverting to non-Tcl compile" xc_with_tcl="" fi - else + elif test "x${TCL_LIB_SPEC}" == "x" ; then for libpfix in "lib64" "lib" do libname="${TCL_EXEC_PREFIX}/${libpfix}/lib${TCL_LIB_NAME}${SHDLIB_EXT}" @@ -736,12 +660,21 @@ if test "x$xc_with_tcl" != "x" ; then echo "Reverting to non-Tcl compile" xc_with_tcl="" fi + else + TCL_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'` fi fi +# -------------------------------------------------------------- +# Rely on TK_LIB_SPEC from tkConfig.sh unless "--with-tklibs" +# overrides. With TK_LIB_SPEC, pull out TK_LIB_DIR +# -------------------------------------------------------------- + if test "x$xc_with_tcl" != "x" ; then if test "x${xc_with_tk_libraries}" != "x" ; then + TK_LIB_SPEC="" for libname in \ + "${xc_with_tk_libraries}/${TK_LIB_FILE}" \ "${xc_with_tk_libraries}/lib${TK_LIB_NAME}${SHDLIB_EXT}" do if test -r "$libname" ; then @@ -749,12 +682,12 @@ if test "x$xc_with_tcl" != "x" ; then break fi done - if test "x${TK_LIB_DIR}" = "x" ; then + if test "x${TK_LIB_DIR}" == "x" ; then echo "Can't find tk library in \"${xc_with_tk_libraries}\"" echo "Reverting to non-Tcl compile" xc_with_tcl="" fi - else + elif test "x${TK_LIB_SPEC}" == "x" ; then for libpfix in "lib64" "lib" do libname="${TK_EXEC_PREFIX}/${libpfix}/lib${TK_LIB_NAME}${SHDLIB_EXT}" @@ -768,371 +701,218 @@ if test "x$xc_with_tcl" != "x" ; then echo "Reverting to non-Tcl compile" xc_with_tcl="" fi + else + TK_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'` fi fi -dnl -------------------------------- -dnl End of Tcl/Tk search -dnl -------------------------------- - -# ----------------------------------------------------------------------- -# -# Tk libraries and header files -# -# ----------------------------------------------------------------------- +#-------------------------------------------------------------------- +# If TCL_LIB_SPEC and/or TK_LIB_SPEC do not exist, construct them +#-------------------------------------------------------------------- if test "x$xc_with_tcl" != "x" ; then - if test "${TK_INC_DIR}" != "/usr/include" -a \ - "${TK_INC_DIR}" != "${TCL_INC_DIR}"; then - INC_SPECS="${INC_SPECS} -I${TK_INC_DIR}" - fi - if test "${TK_LIB_DIR}" = "/usr/lib" -o \ - "${TK_LIB_DIR}" = "/usr/lib64" ; then - LIB_SPECS="${TK_LIB_SPEC}" - else - LIB_SPECS="-L${TK_LIB_DIR} ${TK_LIB_SPEC}" - if test "x${loader_run_path}" = "x" ; then - loader_run_path="${TK_LIB_DIR}" - else - loader_run_path="${TK_LIB_DIR}:${loader_run_path}" - fi + if test "x${TCL_LIB_SPEC}" == "x" ; then + case $target in + *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*) + TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}" + ;; + *) + TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" + ;; + esac + TCL_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_LIB_NAME}" fi -# ----------------------------------------------------------------------- -# -# Tcl libraries and header files -# -# Add a header file directory specification only if the Tcl headers reside -# in a different directory from Tk's. -# -# -# ----------------------------------------------------------------------- - if test "x${TCL_INCLUDE_SPEC}" != "x" ; then - INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC}" - elif test "${TCL_INC_DIR}" != "/usr/include" ; then - INC_SPECS="${INC_SPECS} -I${TCL_INC_DIR}" + if test "x${TK_LIB_SPEC}" == "x" ; then + case $target in + *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*) + TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}" + ;; + *) + TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}" + ;; + esac + TK_LIB_SPEC="-L${TK_LIB_DIR} -l${TK_LIB_NAME}" fi - if test "${TCL_LIB_DIR}" = "/usr/lib" -o \ - "${TCL_LIB_DIR}" = "/usr/lib64" -o \ - "${TCL_LIB_DIR}" = "${TK_LIB_DIR}" ; then - LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC}" - else - LIB_SPECS="${LIB_SPECS} -L${TCL_LIB_DIR} ${TCL_LIB_SPEC}" - if test "x${loader_run_path}" = "x" ; then - loader_run_path="${TCL_LIB_DIR}" - else - loader_run_path="${TCL_LIB_DIR}:${loader_run_path}" + # Find the version of "wish" that corresponds to TCL_EXEC_PREFIX + # We really ought to run "ldd" to confirm that the linked libraries match. + + AC_MSG_CHECKING([for wish executable]) + for dir in \ + ${TK_EXEC_PREFIX}/bin \ + ${TK_EXEC_PREFIX} + do + for wishexe in \ + wish \ + wish${TK_VERSION} \ + wish.exe \ + wish${TK_VERSION}.exe + do + if test -r "$dir/$wishexe" ; then + WISH_EXE=$dir/$wishexe + break + fi + done + if test "x${WISH_EXE}" != "x" ; then + break fi + done + if test "x${WISH_EXE}" = "x" ; then + echo "Warning: Can't find executable for \"wish\". You may have to" + echo "manually set the value for WISH_EXE in the xcircuit startup script." + AC_MSG_RESULT(no) + else + AC_MSG_RESULT([${WISH_EXE}]) fi -#-------------------------------------------------------------------- -# -# Check if we can generate shared libraries on this system. Set flags -# to generate shared libraries for systems that we know about. Start -# with the values found in tclConfig.sh, make changes as we know about -# the different systems. -# -#-------------------------------------------------------------------- - -# Initialize shared library build variables - - LDDL_FLAGS="-shared" - SHDLIB_EXT=".so" - LD_RUN_PATH="" - EXTRA_LIB_SPECS="" - - build_shared="yes" - + # Have to define SHDLIB_EXT here even though we have to do it below, too. case $target in - *-aix4.[[2-9]]*) - # No Position-Independent flags needed - - # Use the installed export file or the one found in the source directory. - - if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then - tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" - else - tcl_exp="${TCL_SRC_DIR}/unix/lib.exp" - fi - if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then - tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" - else - tk_exp="${TK_SRC_DIR}/unix/lib.exp" - fi - - full_src_path=`cd ${srcdir}; pwd` - - # Use shell-script to link shared library - SHLIB_LD="${full_src_path}/cf/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}" - - SHLIB_LIB_SPEC="${aix_lib_specs} -lc" - - LDFLAGS="-L${loader_run_path}" - EXTRA_LIB_SPECS="-ldl" - ;; - - *-aix*) - # No Position-Independent flags needed - - # Use the installed export file or the one found in the source directory. - - if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then - tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" - else - tcl_exp="${TCL_SRC_DIR}/unix/lib.exp" - fi - if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then - tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" - else - tk_exp="${TK_SRC_DIR}/unix/lib.exp" - fi - - full_src_path=`cd ${srcdir}/cf; pwd` - - # Use shell-script to link shared library + *-hpux*) + SHDLIB_EXT=".sl" + ;; + *cygwin*) + SHDLIB_EXT=".dll.a" + ;; + *-darwin*) + SHDLIB_EXT=".dylib" + ;; + *-openbsd*) + SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}" + ;; + *) + SHDLIB_EXT=".so" + ;; + esac +fi - SHLIB_LD="${full_src_path}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}" +dnl End of Tcl/Tk search +dnl -------------------------------- - SHLIB_LIB_SPECS="${aix_lib_specs} -lc" - - LDFLAGS="-L${loader_run_path}" - EXTRA_LIB_SPECS="-lld" - ;; - - *-bsdi2*|*-bsdi3*) - SHLIB_LD="shlicc" - LDDL_FLAGS="-r" +# ----------------------------------------------------------------------- +# +# Tk libraries and header files +# +# ----------------------------------------------------------------------- - EXTRA_LIB_SPECS="-ldl" - ;; +if test "x$xc_with_tcl" != "x" ; then + INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC} ${TK_INCLUDE_SPEC}" + LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC} ${TK_LIB_SPEC}" - *-darwin*) - SHDLIB_EXT=".dylib" - SHLIB_LIB_SPECS="${LIB_SPECS}" - if test "${xc_with_gnu_ld}" = "yes" ; then - LDDL_FLAGS="-dynamiclib -bind_at_load" - else - LDDL_FLAGS="-single_module -dynamiclib -flat_namespace" - LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind" - SHLIB_CFLAGS="-I/sw/include -fno-common" - fi - ;; + if test "x${loader_run_path}" = "x" ; then + loader_run_path="${TCL_LIB_DIR}" + else + loader_run_path="${TCL_LIB_DIR}:${loader_run_path}" + fi - *cygwin*) - AC_DEFINE(CYGWIN) - SHDLIB_EXT=".dll" - LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}" - SHLIB_LIB_SPECS="${LIB_SPECS}" - ;; + #-------------------------------------------------------------------- + # + # Check if we can generate shared libraries on this system. Set flags + # to generate shared libraries for systems that we know about. Start + # with the values found in tclConfig.sh, make changes as we know about + # the different systems. + # + #-------------------------------------------------------------------- - *-bsdi4*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="${CC}" - LDDL_FLAGS='-shared -Wl,-E -Wl,-soname,$@' - ;; + # Initialize shared library build variables - *-dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" - - EXTRA_LIB_SPECS="-ldl" - ;; - - *-hpux*) - if test "$GCC" = "no" ; then - DEFINES="$DEFINES -D_HPUX_SOURCE" - fi - AC_CHECK_LIB(dld, shl_load, [found=yes], [found=no]) - if test "${found}" = "yes" ; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld" - LDDL_FLAGS="-b -E -n +s +b,${loader_run_path}:." - SHDLIB_EXT=".sl" - - # The run path is included in both LDFLAGS and LDDL_FLAGS - # because SHLIB_LD is ld and LD is cc/gcc. - - LDFLAGS="-Wl,-E -Wl,+s,+b,${loader_run_path}:." - EXTRA_LIB_SPECS="-ldld" - fi - ;; - - *-irix64-6.5*) - SHLIB_LD="ld" - LDDL_FLAGS="-32 -shared -rdata_shared" - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - ;; + if test "x${TCL_SHLIB_SUFFIX}" == "x" ; then + SHDLIB_EXT=".so" + else + SHDLIB_EXT="${TCL_SHLIB_SUFFIX}" + fi - *-irix-[56].*|*-irix64-*) - SHLIB_LD="ld" - LDDL_FLAGS="-shared -rdata_shared" - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - LDFLAGS="" - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-mabi=n32 $SHLIB_CFLAGS" - LDDL_FLAGS="-mabi=n32 $LDDL_FLAGS" - LDFLAGS="-mabi=n32 $LDFLAGS" - else - CFLAGS="-n32 $CFLAGS" - LDFLAGS="-n32 $LDFLAGS" - fi - ;; - - *-linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC}" - LDDL_FLAGS='-shared -Wl,-soname,$@' - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" + if test "x${TCL_SHLIB_LD}" == "x" ; then + + # Construct shared library build arguments the painful way + # This is not expected to be necessary, so the number of + # supported systems has been pared down to a minimum. + + LDDL_FLAGS="-shared" + LD_RUN_PATH="" + SHLIB_LD="${CC}" + EXTRA_LIB_SPECS="" + + case $target in + *-darwin*) + SHDLIB_EXT=".dylib" + SHLIB_LIB_SPECS="${LIB_SPECS}" + if test "${xc_with_gnu_ld}" = "yes" ; then + LDDL_FLAGS="-dynamiclib -bind_at_load" + else + LDDL_FLAGS="-single_module -dynamiclib -flat_namespace" + LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind" + SHLIB_CFLAGS="-I/sw/include -fno-common" + fi + ;; + + *cygwin*) + AC_DEFINE(CYGWIN) + SHDLIB_EXT=".dll.a" + LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}" + SHLIB_LIB_SPECS="${LIB_SPECS}" + ;; + + *-linux*) + SHLIB_CFLAGS="-fPIC" + LDDL_FLAGS='-shared -Wl,-soname,$@' + LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - EXTRA_LIB_SPECS="-ldl" - - case $target in - x86_64-*) - # AMD 64-bit archictecture - # Add -fPIC to standard compile switch - CFLAGS="${CFLAGS} -fPIC" - ;; - esac - ;; + EXTRA_LIB_SPECS="-ldl" + + case $target in + x86_64-*) + # AMD 64-bit archictecture + # Add -fPIC to standard compile switch + CFLAGS="${CFLAGS} -fPIC" + ;; + esac + ;; - *-mp-ras-02*) - SHLIB_CFLAGS="-G -K PIC" - SHLIB_LD="${CC}" - LDDL_FLAGS="" - ;; - - *-mp-ras-*) - SHLIB_CFLAGS="-G -K PIC" - SHLIB_LD="${CC}" - LDDL_FLAGS="-Wl,-Bexport" - ;; - - *-ncr-sysv4-*2*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" - - EXTRA_LIB_SPECS="-ldl" - ;; - - *-ncr-sysv4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G -Wl,-Bexport" - - LDFLAGS="-Wl,-Bexport" - EXTRA_LIB_SPECS="-ldl" - ;; - - *-netbsd*|*-freebsd*|*-openbsd*) - # Not available on all versions: check for include file. - AC_CHECK_HEADER(dlfcn.h, test_ok=yes, test_ok=no) - if test "$test_ok" = yes; then - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld" - LDDL_FLAGS="-shared" - fi - ;; - - *-nextstep*) - SHLIB_LD="cc" - LDDL_FLAGS="-nostdlib -r" - ;; - - *-osf1-1.[012]*) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - - # Warning: Ugly Makefile Hack - # Make package name same as library name - - SHLIB_LD='ld -R -export $@:' - ;; - - *-osf1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -shared" - ;; - - *-osf1V*) - # Digital OSF/1 - - SHLIB_LD='ld' - LDDL_FLAGS='-shared -expect_unresolved "*"' - LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - LDFLAGS="" - ;; - - *-sco*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - - SHLIB_CFLAGS="-Kpic -belf" - SHLIB_LD="ld" - LDDL_FLAGS="-G" - LDFLAGS="-belf -Wl,-Bexport" - ;; - - *-sni-sysv*) - - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" - - EXTRA_LIB_SPECS="-ldl" - ;; + *-netbsd*|*-freebsd*|*-openbsd*) + # Not available on all versions: check for include file. + AC_CHECK_HEADER(dlfcn.h, test_ok=yes, test_ok=no) + if test "$test_ok" = yes; then + SHLIB_CFLAGS="-fpic" + SHLIB_LD="ld" + LDDL_FLAGS="-shared" + fi + ;; + esac - *-sunos4*) + if test "$GCC" = "yes" ; then + CFLAGS="-fPIC ${CFLAGS}" + fi - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - LDDL_FLAGS="-assert pure-text" + else - EXTRA_LIB_SPECS="-ldl" - ;; + # Rely on shared lib arguments in tclConfig.sh - *-solaris2*) + SHLIB_LD="${TCL_SHLIB_LD}" + EXTRA_LIB_FLAGS="" + LDDL_FLAGS="${TCL_LD_FLAGS}" + LD_RUN_PATH="" - if test "${xc_with_gnu_ld}" = "yes" ; then - LDDL_FLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@' + case $target in + *-linux*) LD_RUN_PATH="-Wl,-rpath,${loader_run_path}" - else - LDDL_FLAGS="-shared -mimpure-text" - LD_RUN_PATH="-R ${loader_run_path}" - fi - EXTRA_LIB_SPECS="-ldl" - SHLIB_LIB_SPECS="${LIB_SPECS}" - ;; - - *-mips-dde-sysv*) - - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc" - LDDL_FLAGS="-G" - - EXTRA_LIB_SPECS="-ldl" - ;; - - *-pc-sysv4* | *-unixware-5*) - SHLIB_CFLAGS="-G -KPIC" - SHLIB_LD="${CC}" - LDDL_FLAGS=" -Wl,-Bexport" - ;; - - esac + ;; + esac + fi -# If we're running gcc, then set SHLIB_CFLAGS flags for compiling -# shared libraries for gcc, instead of those of the vendor's -# compiler. + # If we're running gcc, then set SHLIB_CFLAGS flags for compiling + # shared libraries for gcc, instead of those of the vendor's + # compiler. if test "$GCC" = "yes" ; then -# SHLIB_CFLAGS="${SHLIB_CFLAGS} -fPIC" - CFLAGS="-fPIC ${CFLAGS}" + if test "x${TCL_SHLIB_CFLAGS}" = "x" ; then + SHLIB_CFLAGS="-fPIC ${SHLIB_CFLAGS}" + else + SHLIB_CFLAGS="${TCL_SHLIB_CFLAGS} ${SHLIB_CFLAGS}" + fi fi + CFLAGS="${CFLAGS} ${SHLIB_CFLAGS}" + if test "${xc_with_gnu_ld}" = "yes" ; then LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=symbol.map" fi @@ -1335,11 +1115,11 @@ AC_ARG_ENABLE(memdebug, AC_SUBST(SUBDIRS) AC_SUBST(SUBLIB) AC_SUBST(STDLIBS) +AC_SUBST(GS_LIBS) AC_SUBST(STARTUP_FILE) AC_SUBST(INTERP_PATH) AC_SUBST(WRAPPER_SCRIPT) AC_SUBST(XCIRCUIT_TARGET) -AC_SUBST(SHLIB_CFLAGS) AC_SUBST(CFLAGS) AC_SUBST(LD) AC_SUBST(LDFLAGS) @@ -1357,3 +1137,32 @@ AC_SUBST(AUTOMAKE) AC_SUBST(AUTOHEADER) AC_OUTPUT(Makefile Xw/Makefile asg/Makefile spiceparser/Makefile) + +echo "" +echo "Configuration results:" +echo "----------------------------------------------------" +echo "" + +if test "x$xc_with_tcl" == "x" ; then + if test "x$PYTHON" != x; then + echo "Using Python interface (not recommended)" + else + echo "No Tcl/Tk, using standard Xlib/Xt interface." + echo "If that is not what you wanted, then make sure" + echo "you have Tcl/Tk development packages installed?" + fi +else + echo "Using Tcl/Tk interface" +fi +echo "" + +if test "x$xc_with_cairo" == "x" ; then + echo "No Cairo graphics." + echo "If that is not what you wanted, then make sure" + echo "you have libcairo and fontconfig installed." + echo "Try installing package cairo-devel." +else + echo "Using Cairo graphics" +fi +echo "" +echo "CFLAGS=${CFLAGS}" diff --git a/elements.c b/elements.c index 7187691..ec50433 100644 --- a/elements.c +++ b/elements.c @@ -41,7 +41,6 @@ /*----------------------------------------------------------------------*/ extern Display *dpy; /* Works well to make this globally accessible */ -extern int *appcolors; extern Cursor appcursors[NUM_CURSORS]; extern XCWindowData *areawin; extern Globaldata xobjs; @@ -50,6 +49,10 @@ extern fontinfo *fonts; extern short fontcount; extern char _STR[150], _STR2[250]; extern int number_colors; +extern colorindex *colorlist; +#if !defined(HAVE_CAIRO) +extern Pixmap dbuf; +#endif extern double atan2(); @@ -76,6 +79,9 @@ u_char texttype; /* calling routine. */ /* "pintype" is NORMAL, LOCAL, GLOBAL, or INFO */ /* "x" and "y" are the label coordinates. */ +/* if "dochange" is FALSE, then this label is being drawn */ +/* as part of a font or library and should not cause */ +/* changes count to increment. */ /* */ /* Other properties must be set individually by the calling */ /* routine. */ @@ -84,7 +90,7 @@ u_char texttype; /*--------------------------------------------------------------*/ labelptr new_label(objinstptr destinst, stringpart *strptr, int pintype, - int x, int y) + int x, int y, u_char dochange) { labelptr *newlab; objectptr destobject; @@ -105,7 +111,7 @@ labelptr new_label(objinstptr destinst, stringpart *strptr, int pintype, calcbboxvalues(locdestinst, (genericptr *)newlab); updatepagebounds(destobject); - incr_changes(destobject); + if (dochange != (u_char)0) incr_changes(destobject); return *newlab; } @@ -126,7 +132,7 @@ labelptr new_simple_label(objinstptr destinst, char *cstr, strptr->nextpart = NULL; strptr->data.string = cstr; - return new_label(destinst, strptr, pintype, x, y); + return new_label(destinst, strptr, pintype, x, y, (u_char)0); } /*--------------------------------------------------------------*/ @@ -328,6 +334,9 @@ void remove_element(objinstptr destinst, genericptr genelem) void pathdefaults(pathptr newpath, int x, int y) { + UNUSED(x); + UNUSED(y); + newpath->style = NORMAL; newpath->width = areawin->linewidth; newpath->style = areawin->style; @@ -345,7 +354,7 @@ void instancedefaults(objinstptr newinst, objectptr thisobj, int x, int y) { newinst->position.x = x; newinst->position.y = y; - newinst->rotation = 0; + newinst->rotation = 0.0; newinst->scale = 1.0; newinst->style = LINE_INVARIANT; newinst->thisobject = thisobj; @@ -399,7 +408,7 @@ void drawdot(int xpos, int ypos) void labeldefaults(labelptr newlabel, u_char dopin, int x, int y) { - newlabel->rotation = 0; + newlabel->rotation = 0.0; newlabel->color = areawin->color; newlabel->scale = areawin->textscale; newlabel->string = (stringpart *)malloc(sizeof(stringpart)); @@ -416,7 +425,7 @@ void labeldefaults(labelptr newlabel, u_char dopin, int x, int y) else if (dopin == GLOBAL) newlabel->color = GLOBALPINCOLOR; else if (dopin == INFO) newlabel->color = INFOLABELCOLOR; - newlabel->justify = areawin->justify; + newlabel->anchor = areawin->anchor; newlabel->position.x = x; newlabel->position.y = y; } @@ -445,12 +454,13 @@ void textbutton(u_char dopin, int x, int y) labeldefaults(*newlabel, dopin, userpt.x, userpt.y); tmpheight = (short)(TEXTHEIGHT * (*newlabel)->scale); - userpt.y -= ((*newlabel)->justify & NOTBOTTOM) ? - (((*newlabel)->justify & TOP) ? tmpheight : tmpheight / 2) : 0; - UDrawTLine(*newlabel); + userpt.y -= ((*newlabel)->anchor & NOTBOTTOM) ? + (((*newlabel)->anchor & TOP) ? tmpheight : tmpheight / 2) : 0; areawin->origin.x = userpt.x; areawin->origin.y = userpt.y; areawin->textpos = 1; /* Text position is *after* the font declaration */ + + text_mode_draw(xcDRAW_EDIT, *newlabel); } /*----------------------------------------------------------------------*/ @@ -519,7 +529,7 @@ Boolean labeltext(int keypressed, char *clientdata) stringpart *curpos, *labelbuf; int locpos; Boolean r = True, do_redraw = False; - short tmplength, tmpheight, cfont; + short cfont; TextExtents tmpext; TechPtr oldtech, newtech; @@ -527,6 +537,7 @@ Boolean labeltext(int keypressed, char *clientdata) if (curlabel == NULL || curlabel->type != LABEL) { Wprintf("Error: Bad label string"); + text_mode_draw(xcDRAW_EMPTY, curlabel); eventmode = NORMAL_MODE; return FALSE; } @@ -535,8 +546,6 @@ Boolean labeltext(int keypressed, char *clientdata) curpos = findstringpart(areawin->textpos, &locpos, curlabel->string, areawin->topinstance); - UDrawTLine(curlabel); - if (clientdata != NULL && keypressed == TEXT_DELETE) { if (areawin->textpos > 1) { int curloc, strpos; @@ -578,15 +587,21 @@ Boolean labeltext(int keypressed, char *clientdata) int curloc, strpos; stringpart *strptr; - strptr = findstringpart(areawin->textpos - 1, &curloc, curlabel->string, + strpos = areawin->textpos - 1; + strptr = findstringpart(strpos, &curloc, curlabel->string, areawin->topinstance); - if ((curloc < 0) && (strptr != NULL) && (strptr->type == PARAM_END)) { - undrawtext(curlabel); - while (strptr->type != PARAM_START) - strptr = findstringpart(--strpos, &curloc, curlabel->string, + if (curloc > 0) strpos -= curloc; /* move to beginning of string */ + if ((strptr != NULL) && (strptr->type != PARAM_START) && (strpos > 0)) { + strpos--; + strptr = findstringpart(strpos--, &curloc, curlabel->string, areawin->topinstance); - unmakeparam(curlabel, strptr); - do_redraw = True; + } + if ((strptr != NULL) && (strptr->type == PARAM_START)) { + if (strpos >= 0) { + undrawtext(curlabel); + unmakeparam(curlabel, areawin->topinstance, strptr); + do_redraw = True; + } } } } @@ -629,14 +644,17 @@ Boolean labeltext(int keypressed, char *clientdata) } if ((!hasstuff) && (eventmode == CATTEXT_MODE)) { /* can't have null labels! */ - undo_action(); - XcSetFunction(GXcopy); - redrawtext(curlabel); - Wprintf("Object must have a name!"); - eventmode = CATALOG_MODE; + undo_action(); + redrawtext(curlabel); + areawin->redraw_needed = False; /* ignore previous redraw requests */ + text_mode_draw(xcDRAW_FINAL, curlabel); + Wprintf("Object must have a name!"); + eventmode = CATALOG_MODE; } else if (!hasstuff) { - eventmode = NORMAL_MODE; + areawin->redraw_needed = False; /* ignore previous redraw requests */ + text_mode_draw(xcDRAW_FINAL, curlabel); + eventmode = NORMAL_MODE; } else if (eventmode == CATTEXT_MODE) { objectptr libobj; @@ -673,7 +691,6 @@ Boolean labeltext(int keypressed, char *clientdata) curlabel->string->nextpart->data.string, (strlen(libobj->name) + 1) * sizeof(char)); strcpy(curlabel->string->nextpart->data.string, libobj->name); - XcSetFunction(GXcopy); redrawtext(curlabel); } AddObjectTechnology(libobj); @@ -706,10 +723,14 @@ Boolean labeltext(int keypressed, char *clientdata) Wprintf("Error: Cannot match name to any object, page, or library!"); refresh(NULL, NULL, NULL); } + areawin->redraw_needed = False; /* ignore previous redraw requests */ + text_mode_draw(xcDRAW_FINAL, curlabel); eventmode = CATALOG_MODE; } else { /* (hasstuff && eventmode != CATTEXT_MODE) */ + areawin->redraw_needed = False; /* ignore previous redraw requests */ + text_mode_draw(xcDRAW_FINAL, curlabel); eventmode = NORMAL_MODE; incr_changes(topobject); if (curlabel->pin != False) invalidate_netlist(topobject); @@ -824,7 +845,6 @@ Boolean labeltext(int keypressed, char *clientdata) (*newlabel)->position.x += (points[3].x - points2[3].x); (*newlabel)->position.y += (points[3].y - points2[3].y); - XcSetFunction(GXcopy); redrawtext(*newlabel); do_redraw = True; } @@ -836,6 +856,7 @@ Boolean labeltext(int keypressed, char *clientdata) oparamptr ops; stringpart *newpart; Boolean errcond = False; + TextLinesInfo tlinfo; /* erase first before redrawing unless the string is empty */ undrawtext(curlabel); @@ -843,8 +864,13 @@ Boolean labeltext(int keypressed, char *clientdata) /* Get text width first. Don't back up over spaces; this */ /* allows the margin width to be padded out with spaces. */ - if (keypressed == MARGINSTOP) - tmpext = ULength(curlabel, areawin->topinstance, areawin->textpos, NULL); + if (keypressed == MARGINSTOP) { + tlinfo.dostop = areawin->textpos; + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; + tmpext = ULength(curlabel, areawin->topinstance, &tlinfo); + if (tlinfo.padding != NULL) free(tlinfo.padding); + } if (locpos > 0) { if (keypressed == MARGINSTOP) { @@ -864,7 +890,7 @@ Boolean labeltext(int keypressed, char *clientdata) newpart->type = keypressed; switch (keypressed) { case RETURN: - // Identify this as an explicitly placed line break + /* Identify this as an explicitly placed line break */ newpart->data.flags = 0; break; case FONT_SCALE: @@ -969,11 +995,11 @@ Boolean labeltext(int keypressed, char *clientdata) /* Generate automatic line breaks if there is a MARGINSTOP directive */ CheckMarginStop(curlabel, areawin->topinstance, TRUE); - XcSetFunction(GXcopy); redrawtext(curlabel); } - UDrawTLine(curlabel); + areawin->redraw_needed = False; /* ignore previous full redraw requests */ + text_mode_draw(xcDRAW_EDIT, curlabel); if (r || do_redraw) { @@ -1005,34 +1031,34 @@ void textreturn() labeltext(TEXT_RETURN, (char *)1); } -/*-------------------------------------*/ -/* Change the justification of a label */ -/*-------------------------------------*/ +/*--------------------------------------*/ +/* Change the anchoring of a label */ +/*--------------------------------------*/ -void rejustify(short mode) +void reanchor(short mode) { labelptr curlabel = NULL; short *tsel; short jsave; Boolean preselected = False, changed = False; - static short transjust[] = {15, 13, 12, 7, 5, 4, 3, 1, 0}; + static short transanchor[] = {15, 13, 12, 7, 5, 4, 3, 1, 0}; if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { curlabel = TOLABEL(EDITPART); UDrawTLine(curlabel); undrawtext(curlabel); - jsave = curlabel->justify; - curlabel->justify = transjust[mode] | - (curlabel->justify & NONJUSTFIELD); - if (jsave != curlabel->justify) { - register_for_undo(XCF_Justify, UNDO_MORE, areawin->topinstance, + jsave = curlabel->anchor; + curlabel->anchor = transanchor[mode] | + (curlabel->anchor & NONANCHORFIELD); + if (jsave != curlabel->anchor) { + register_for_undo(XCF_Anchor, UNDO_MORE, areawin->topinstance, (genericptr)curlabel, (int)jsave); changed = True; } redrawtext(curlabel); UDrawTLine(curlabel); - setfontmarks(-1, curlabel->justify); + setfontmarks(-1, curlabel->anchor); } else { if (areawin->selects == 0) { @@ -1045,12 +1071,12 @@ void rejustify(short mode) areawin->selects; tsel++) { if (SELECTTYPE(tsel) == LABEL) { curlabel = SELTOLABEL(tsel); - jsave = curlabel->justify; + jsave = curlabel->anchor; undrawtext(curlabel); - curlabel->justify = transjust[mode] | - (curlabel->justify & NONJUSTFIELD); - if (jsave != curlabel->justify) { - register_for_undo(XCF_Justify, UNDO_MORE, areawin->topinstance, + curlabel->anchor = transanchor[mode] | + (curlabel->anchor & NONANCHORFIELD); + if (jsave != curlabel->anchor) { + register_for_undo(XCF_Anchor, UNDO_MORE, areawin->topinstance, (genericptr)curlabel, (int)jsave); changed = True; } @@ -1062,7 +1088,7 @@ void rejustify(short mode) draw_all_selected(); } if (curlabel == NULL) - Wprintf("No labels chosen to rejustify"); + Wprintf("No labels chosen to reanchor"); else if (changed) { pwriteback(areawin->topinstance); calcbbox(areawin->topinstance); @@ -1112,9 +1138,7 @@ void splinebutton(int x, int y) addcycle((genericptr *)newspline, 3, 0); makerefcycle((*newspline)->cycle, 3); - XcSetXORFg(areawin->color, BACKGROUND); - XcSetFunction(GXxor); - UDrawSpline(*newspline, xobjs.pagelist[areawin->page]->wirewidth); + spline_mode_draw(xcDRAW_EDIT, *newspline); xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackelement, NULL); @@ -1137,7 +1161,7 @@ void splinebutton(int x, int y) void updatepath(pathptr thepath) { genericptr *ggen, *ngen; - short locparts, cycle, ncycle; + short locparts, cycle; pointselect *cptr; polyptr thispoly; splineptr thisspline; @@ -1262,9 +1286,7 @@ void arcbutton(int x, int y) arcdefaults(*newarc, userpt.x, userpt.y); addcycle((genericptr *)newarc, 0, 0); - XcSetXORFg((*newarc)->color, BACKGROUND); - XcSetFunction(GXxor); - UDrawArc(*newarc, xobjs.pagelist[areawin->page]->wirewidth); + arc_mode_draw(xcDRAW_EDIT, *newarc); xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackarc, NULL); @@ -1282,6 +1304,7 @@ void trackarc(xcWidget w, caddr_t clientdata, caddr_t calldata) arcptr newarc; double adjrat; short cycle; + UNUSED(w); UNUSED(clientdata); UNUSED(calldata); newarc = TOARC(EDITPART); @@ -1289,9 +1312,6 @@ void trackarc(xcWidget w, caddr_t clientdata, caddr_t calldata) u2u_snap(&newpos); if (areawin->save.x == newpos.x && areawin->save.y == newpos.y) return; - UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth); - UDrawXLine(areawin->save, newarc->position); - cycle = (newarc->cycle == NULL) ? -1 : newarc->cycle->number; if (cycle == 1 || cycle == 2) { float *angleptr, tmpang; @@ -1331,14 +1351,12 @@ void trackarc(xcWidget w, caddr_t clientdata, caddr_t calldata) calcarc(newarc); - XcSetXORFg(newarc->color, BACKGROUND); - UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth); - UDrawXLine(newpos, newarc->position); - printpos(newpos.x, newpos.y); - areawin->save.x = newpos.x; areawin->save.y = newpos.y; + arc_mode_draw(xcDRAW_EDIT, newarc); + printpos(newpos.x, newpos.y); + flusharea(); } @@ -1386,9 +1404,7 @@ void boxbutton(int x, int y) snap(x, y, &userpt); polydefaults(*newbox, 4, userpt.x, userpt.y); - XcSetXORFg((*newbox)->color, BACKGROUND); - XcSetFunction(GXxor); - UDrawPolygon(*newbox, xobjs.pagelist[areawin->page]->wirewidth); + poly_mode_draw(xcDRAW_EDIT, *newbox); xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackbox, NULL); @@ -1405,6 +1421,7 @@ void trackbox(xcWidget w, caddr_t clientdata, caddr_t calldata) XPoint newpos; polyptr newbox; pointlist pointptr; + UNUSED(w); UNUSED(clientdata); UNUSED(calldata); newbox = TOPOLY(EDITPART); newpos = UGetCursorPos(); @@ -1412,14 +1429,11 @@ void trackbox(xcWidget w, caddr_t clientdata, caddr_t calldata) if (areawin->save.x == newpos.x && areawin->save.y == newpos.y) return; - UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth); - pointptr = newbox->points + 1; pointptr->y = newpos.y; pointptr++; pointptr->y = newpos.y; pointptr->x = newpos.x; pointptr++; pointptr->x = newpos.x; - XcSetXORFg(newbox->color, BACKGROUND); - UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth); + poly_mode_draw(xcDRAW_EDIT, newbox); printpos(newpos.x, newpos.y); areawin->save.x = newpos.x; @@ -1441,6 +1455,7 @@ void trackwire(xcWidget w, caddr_t clientdata, caddr_t calldata) { XPoint newpos, upos, *tpoint; polyptr newwire; + UNUSED(w); UNUSED(clientdata); UNUSED(calldata); newwire = TOPOLY(EDITPART); @@ -1457,13 +1472,12 @@ void trackwire(xcWidget w, caddr_t clientdata, caddr_t calldata) if (areawin->save.x != newpos.x || areawin->save.y != newpos.y) { tpoint = newwire->points + newwire->number - 1; - UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth); if (areawin->manhatn && (newwire->number > 2)) manhattanize(&newpos, newwire, -1, TRUE); tpoint->x = newpos.x; tpoint->y = newpos.y; - XcSetXORFg(newwire->color, BACKGROUND); - UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth); + XcTopSetForeground(newwire->color); + poly_mode_draw(xcDRAW_EDIT, newwire); areawin->save.x = newpos.x; areawin->save.y = newpos.y; printpos(newpos.x, newpos.y); @@ -1500,9 +1514,7 @@ void startwire(XPoint *userpt) pointptr->x = (pointptr + 1)->x = areawin->save.x = userpt->x; pointptr->y = (pointptr + 1)->y = areawin->save.y = userpt->y; - XcSetXORFg((*newwire)->color, BACKGROUND); - XcSetFunction(GXxor); - UDrawPolygon(*newwire, xobjs.pagelist[areawin->page]->wirewidth); + poly_mode_draw(xcDRAW_EDIT, *newwire); xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackwire, NULL); @@ -1632,12 +1644,11 @@ void findconstrained(polyptr lastpoly) void trackelement(xcWidget w, caddr_t clientdata, caddr_t calldata) { - XPoint newpos, origpt, *curpt; - polyptr editpoly; - genericptr *ggen; - short cycle, *selobj; + XPoint newpos, *curpt; + short *selobj; pointselect *cptr; int deltax, deltay; + UNUSED(w); UNUSED(clientdata); UNUSED(calldata); newpos = UGetCursorPos(); u2u_snap(&newpos); @@ -1673,20 +1684,32 @@ void trackelement(xcWidget w, caddr_t clientdata, caddr_t calldata) curpt = &(TOGRAPHIC(EDITPART)->position); break; } - origpt = *curpt; deltax = newpos.x - curpt->x; deltay = newpos.y - curpt->y; /* Now adjust all edited elements relative to the reference point */ - for (selobj = areawin->selectlist; selobj < areawin->selectlist + - areawin->selects; selobj++) - { - easydraw(*selobj, DOFORALL); - editpoints(SELTOGENERICPTR(selobj), deltax, deltay); - XcSetXORFg(topobject->plist[*selobj]->color, BACKGROUND); - easydraw(*selobj, DOFORALL); - } + areawin->selects; selobj++) { + if (eventmode == ARC_MODE || eventmode == EARC_MODE) + editpoints(SELTOGENERICPTR(selobj), deltax, deltay); + else if (eventmode == SPLINE_MODE || eventmode == ESPLINE_MODE) + editpoints(SELTOGENERICPTR(selobj), deltax, deltay); + else if (eventmode == BOX_MODE || eventmode == EPOLY_MODE + || eventmode == WIRE_MODE) + editpoints(SELTOGENERICPTR(selobj), deltax, deltay); + else if (eventmode == EPATH_MODE) + editpoints(SELTOGENERICPTR(selobj), deltax, deltay); + } + + if (eventmode == ARC_MODE || eventmode == EARC_MODE) + arc_mode_draw(xcDRAW_EDIT, TOARC(EDITPART)); + else if (eventmode == SPLINE_MODE || eventmode == ESPLINE_MODE) + spline_mode_draw(xcDRAW_EDIT, TOSPLINE(EDITPART)); + else if (eventmode == BOX_MODE || eventmode == EPOLY_MODE + || eventmode == WIRE_MODE) + poly_mode_draw(xcDRAW_EDIT, TOPOLY(EDITPART)); + else if (eventmode == EPATH_MODE) + path_mode_draw(xcDRAW_EDIT, TOPATH(EDITPART)); printpos(newpos.x, newpos.y); areawin->save.x = newpos.x; @@ -1830,11 +1853,9 @@ void unjoin() /* for each selected path or polygon */ - XcSetFunction(GXcopy); - for (selectobj = areawin->selectlist; selectobj < areawin->selectlist + areawin->selects; selectobj++) { - XSetForeground(dpy, areawin->gc, BACKGROUND); + SetForeground(dpy, areawin->gc, BACKGROUND); if (SELECTTYPE(selectobj) == PATH) { oldpath = SELTOPATH(selectobj); @@ -2226,9 +2247,6 @@ void wire_op(int op, int x, int y) newwire = TOPOLY(EDITPART); - /* This undraws the wire */ - UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth); - if (areawin->attachto >= 0) { XPoint apos; findattach(&apos, NULL, &userpt); @@ -2295,13 +2313,13 @@ void wire_op(int op, int x, int y) newwire->number--; } - XcSetFunction(GXcopy); - XcTopSetForeground(newwire->color); incr_changes(topobject); if (!nonnetwork(newwire)) invalidate_netlist(topobject); register_for_undo(XCF_Wire, UNDO_MORE, areawin->topinstance, newwire); + poly_mode_draw(xcDRAW_FINAL, newwire); } - UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth); + else + poly_mode_draw(xcDRAW_EDIT, newwire); if (op == XCF_Cancel_Last) checkwarp(newwire->points + newwire->number - 1); } @@ -2313,3 +2331,419 @@ void wire_op(int op, int x, int y) } /*-------------------------------------------------------------------------*/ +/* Helper functions for the xxx_mode_draw functions */ +/* Functions to be used around the drawing of the edited element */ +/* begin_event_mode_drawing starts double buffering and copies the */ +/* fixed pixmap. end_event_mode stops the double buffering and displays */ +/* everything on screen. */ +/*-------------------------------------------------------------------------*/ + +#ifndef HAVE_CAIRO +static Window old_win; +#endif /* !HAVE_CAIRO */ + +static void begin_event_mode_drawing(void) +{ + /* Start double buffering */ +#ifdef HAVE_CAIRO + cairo_identity_matrix(areawin->cr); + cairo_translate(areawin->cr, areawin->panx, areawin->pany); + cairo_push_group(areawin->cr); +#else /* HAVE_CAIRO */ + old_win = areawin->window; + areawin->window = (Window) dbuf; +#endif /* HAVE_CAIRO */ + + /* Copy background pixmap with the element(s) not currently being edited */ +#ifdef HAVE_CAIRO + if (areawin->panx || areawin->pany) { + SetForeground(dpy, areawin->gc, BACKGROUND); + cairo_paint(areawin->cr); + } + cairo_set_source(areawin->cr, areawin->fixed_pixmap); + cairo_paint(areawin->cr); +#else /* HAVE_CAIRO */ + if (areawin->panx || areawin->pany) { + int x = max(0, -areawin->panx); + int y = max(0, -areawin->pany); + unsigned int w = areawin->width - x; + unsigned int h = areawin->height - y; + SetForeground(dpy, areawin->gc, BACKGROUND); + XSetFillStyle(dpy, areawin->gc, FillSolid); + XFillRectangle(dpy, areawin->window, areawin->gc, 0, 0, areawin->width, + areawin->height); + XCopyArea(dpy, areawin->fixed_pixmap, areawin->window, areawin->gc, + x, y, w, h, max(0, areawin->panx), max(0, areawin->pany)); + } + else + XCopyArea(dpy, areawin->fixed_pixmap, areawin->window, areawin->gc, 0, 0, + areawin->width, areawin->height, 0, 0); +#endif /* HAVE_CAIRO */ + + areawin->redraw_ongoing = True; + newmatrix(); +} + +static void end_event_mode_drawing(void) +{ + /* End double buffering */ +#ifdef HAVE_CAIRO + cairo_pop_group_to_source(areawin->cr); + cairo_paint(areawin->cr); +#else /* HAVE_CAIRO */ + areawin->window = old_win; + XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0, areawin->width, + areawin->height, 0, 0); +#endif /* HAVE_CAIRO */ + + areawin->redraw_ongoing = False; +} + +/*-------------------------------------------------------------------------*/ +/* Helper functions for the xxx_mode_draw functions */ +/* Functions to be used when finishing the element. The final state is */ +/* drawn into the fixed pixmap, which is show when the */ +/* end_event_mode_drawing_final is called */ +/* (Sorry about the name :-) ) */ +/*-------------------------------------------------------------------------*/ + +static void begin_event_mode_drawing_final(void) +{ +#ifdef HAVE_CAIRO + cairo_identity_matrix(areawin->cr); + cairo_push_group(areawin->cr); + cairo_set_source(areawin->cr, areawin->fixed_pixmap); + cairo_paint(areawin->cr); +#else /* HAVE_CAIRO */ + old_win = areawin->window; + areawin->window = (Window) areawin->fixed_pixmap; +#endif /* HAVE_CAIRO */ + + areawin->redraw_ongoing = True; + newmatrix(); +} + +static void end_event_mode_drawing_final(void) +{ +#ifdef HAVE_CAIRO + cairo_pattern_destroy(areawin->fixed_pixmap); + areawin->fixed_pixmap = cairo_pop_group(areawin->cr); +#else /* HAVE_CAIRO */ + areawin->window = old_win; +#endif /* HAVE_CAIRO */ + + /* Show fixed pixmap */ +#ifdef HAVE_CAIRO + cairo_identity_matrix(areawin->cr); + cairo_set_source(areawin->cr, areawin->fixed_pixmap); + cairo_paint(areawin->cr); +#else /* HAVE_CAIRO */ + XCopyArea(dpy, areawin->fixed_pixmap, areawin->window, areawin->gc, 0, 0, + areawin->width, areawin->height, 0, 0); +#endif /* HAVE_CAIRO */ + + areawin->redraw_ongoing = False; +} + +/*-------------------------------------------------------------------------*/ +/* Helper function for the xxx_mode_draw functions */ +/* Hide all the selected elements and draw all the element not currently */ +/* being edited to fixed_pixmap */ +/*-------------------------------------------------------------------------*/ + +static void draw_fixed_without_selection(void) +{ + int idx; + for (idx = 0; idx < areawin->selects; idx++) + SELTOGENERIC(&areawin->selectlist[idx])->type |= DRAW_HIDE; + draw_fixed(); + for (idx = 0; idx < areawin->selects; idx++) + SELTOGENERIC(&areawin->selectlist[idx])->type &= ~DRAW_HIDE; +} + +/*-------------------------------------------------------------------------*/ +/* generic xxx_mode_draw function, that handles most of the thing needed */ +/* for arcs, splines and paths. */ +/*-------------------------------------------------------------------------*/ + +static void generic_mode_draw(xcDrawType type, generic *newgen, + void (*decorations)(generic *newgen)) +{ + int idx; + + switch (type) { + case xcDRAW_INIT: + case xcREDRAW_FORCED: + draw_fixed_without_selection(); + /* fallthrough */ + + case xcDRAW_EDIT: + begin_event_mode_drawing(); + for (idx = 0; idx < areawin->selects; idx++) { + int scolor = SELTOCOLOR(&areawin->selectlist[idx]); + XcTopSetForeground(scolor); + easydraw(areawin->selectlist[idx], scolor); + } + if (decorations) + (*decorations)(newgen); + end_event_mode_drawing(); + break; + + case xcDRAW_FINAL: + begin_event_mode_drawing_final(); + for (idx = 0; idx < areawin->selects; idx++) { + int scolor = SELTOCOLOR(&areawin->selectlist[idx]); + XcTopSetForeground(scolor); + easydraw(areawin->selectlist[idx], scolor); + } + end_event_mode_drawing_final(); + if (areawin->selects > 1) /* FIXME: Temp. fix for multiple selects */ + areawin->redraw_needed = True; /* Will be removed later on */ + break; + + case xcDRAW_EMPTY: + /* Do not remove the empty begin/end. For cairo, this renders the */ + /* background with the fixed elements */ + begin_event_mode_drawing_final(); + end_event_mode_drawing_final(); + break; + } +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for ARC_MODE and EARC_MODE */ +/*-------------------------------------------------------------------------*/ + +static void arc_mode_decorations(generic *newgen) +{ + UDrawXLine(((arc*) newgen)->position, areawin->save); +} + +void arc_mode_draw(xcDrawType type, arc *newarc) +{ + generic_mode_draw(type, (generic*) newarc, arc_mode_decorations); +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for SPLINE_MODE and ESPLINE_MODE */ +/*-------------------------------------------------------------------------*/ + +static void spline_mode_decorations(generic *newgen) +{ + spline *newspline = (spline*) newgen; + UDrawXLine(newspline->ctrl[0], newspline->ctrl[1]); + UDrawXLine(newspline->ctrl[3], newspline->ctrl[2]); +} + +void spline_mode_draw(xcDrawType type, spline *newspline) +{ + generic_mode_draw(type, (generic*) newspline, spline_mode_decorations); +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for WIRE_MODE, BOX_MODE and EPOLY_MODE */ +/*-------------------------------------------------------------------------*/ + +void poly_mode_draw(xcDrawType type, polygon *newpoly) +{ + generic_mode_draw(type, (generic*) newpoly, NULL); +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for EPATH_MODE */ +/*-------------------------------------------------------------------------*/ + +static void path_mode_decorations(generic *newgen) +{ + genericptr *ggen; + path *newpath = (path*) newgen; + for (ggen = newpath->plist; ggen < newpath->plist + newpath->parts; ggen++) { + if (ELEMENTTYPE(*ggen) == SPLINE) { + spline *lastspline = TOSPLINE(ggen); + UDrawXLine(lastspline->ctrl[0], lastspline->ctrl[1]); + UDrawXLine(lastspline->ctrl[3], lastspline->ctrl[2]); + } + } +} + +void path_mode_draw(xcDrawType type, path *newpath) +{ + generic_mode_draw(type, (generic*) newpath, path_mode_decorations); +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for TEXT_MODE, CATTEXT_MODE and ETEXT_MODE */ +/*-------------------------------------------------------------------------*/ + +static void text_mode_decorations(generic *newgen) +{ + UDrawTLine((label*) newgen); +} + +void text_mode_draw(xcDrawType type, label *newlabel) +{ + generic_mode_draw(type, (generic*) newlabel, text_mode_decorations); +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for SELAREA_MODE */ +/*-------------------------------------------------------------------------*/ + +void selarea_mode_draw(xcDrawType type, void *unused) +{ + UNUSED(unused); + + switch (type) { + case xcREDRAW_FORCED: + draw_fixed(); + /* fallthrough */ + + case xcDRAW_INIT: + case xcDRAW_EDIT: + begin_event_mode_drawing(); + draw_all_selected(); + UDrawBox(areawin->origin, areawin->save); + end_event_mode_drawing(); + break; + + case xcDRAW_FINAL: + case xcDRAW_EMPTY: + /* No need for rendering the background, since it will be */ + /* overwritten by the select_area() function anyway */ + break; + } +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for RESCALE_MODE */ +/*-------------------------------------------------------------------------*/ + +void rescale_mode_draw(xcDrawType type, void *unused) +{ + UNUSED(unused); + + switch (type) { + case xcREDRAW_FORCED: + draw_fixed(); + /* fallthrough */ + + case xcDRAW_INIT: + case xcDRAW_EDIT: + begin_event_mode_drawing(); + UDrawRescaleBox(&areawin->save); + end_event_mode_drawing(); + break; + + case xcDRAW_FINAL: + case xcDRAW_EMPTY: + /* No need for rendering the background, since it will be */ + /* overwritten by the select_area() function anyway */ + break; + } +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for CATMOVE_MODE, MOVE_MODE and COPY_MODE */ +/*-------------------------------------------------------------------------*/ + +void move_mode_draw(xcDrawType type, void *unused) +{ + float wirewidth = xobjs.pagelist[areawin->page]->wirewidth; + short *selectobj; + genericptr *pgen; + int idx; + UNUSED(unused); + + switch (type) { + case xcREDRAW_FORCED: + case xcDRAW_INIT: + draw_fixed_without_selection(); + /* fallthrough */ + + case xcDRAW_EDIT: + begin_event_mode_drawing(); + XTopSetForeground(SELECTCOLOR); + for (idx = 0; idx < areawin->selects; idx++) + easydraw(areawin->selectlist[idx], DOFORALL); + for (selectobj = areawin->selectlist; selectobj < areawin->selectlist + + areawin->selects; selectobj++) { + if (SELECTTYPE(selectobj) == LABEL) { + label *labelobj = SELTOLABEL(selectobj); + if (labelobj->pin == False) + UDrawX(labelobj); + } + } + if (areawin->pinattach) { + for (pgen = topobject->plist; pgen < topobject->plist + + topobject->parts; pgen++) { + if (ELEMENTTYPE(*pgen) == POLYGON) { + polygon *cpoly = TOPOLY(pgen); + if (cpoly->cycle != NULL) + UDrawPolygon(cpoly, wirewidth); + } + } + } + end_event_mode_drawing(); + break; + + case xcDRAW_FINAL: + begin_event_mode_drawing_final(); + for (selectobj = areawin->selectlist; selectobj + < areawin->selectlist + areawin->selects; selectobj++) { + XTopSetForeground(SELTOCOLOR(selectobj)); + easydraw(*selectobj, DOFORALL); + } + end_event_mode_drawing_final(); + break; + + case xcDRAW_EMPTY: + /* Do not remove the empty begin/end. For cairo, this renders the */ + /* background with the fixed elements */ + begin_event_mode_drawing_final(); + end_event_mode_drawing_final(); + break; + } +} + +/*-------------------------------------------------------------------------*/ +/* Drawing function for ASSOC_MODE, EINST_MODE, (E)FONTCAT_MODE, PAN_MODE, */ +/* NORMAL_MODE, UNDO_MODE and CATALOG_MODE */ +/*-------------------------------------------------------------------------*/ + +void normal_mode_draw(xcDrawType type, void *unused) +{ + UNUSED(unused); + + switch (type) { + case xcDRAW_INIT: + case xcREDRAW_FORCED: + draw_fixed_without_selection(); + /* fallthrough */ + + case xcDRAW_EDIT: + begin_event_mode_drawing(); + + /* draw the highlighted netlist, if any */ + if (checkvalid(topobject) != -1) + if (topobject->highlight.netlist != NULL) + highlightnetlist(topobject, areawin->topinstance, 1); + + if ((areawin->selects == 1) && SELECTTYPE(areawin->selectlist) == LABEL + && areawin->textend > 0 && areawin->textpos > areawin->textend) { + labelptr drawlabel = SELTOLABEL(areawin->selectlist); + UDrawString(drawlabel, DOSUBSTRING, areawin->topinstance); + } + else if (eventmode == NORMAL_MODE || eventmode == CATALOG_MODE) + draw_all_selected(); + end_event_mode_drawing(); + break; + + case xcDRAW_FINAL: + break; + + case xcDRAW_EMPTY: + break; + } +} + + diff --git a/events.c b/events.c index 75edfd7..2154640 100644 --- a/events.c +++ b/events.c @@ -27,10 +27,9 @@ #endif #endif -#ifdef OPENGL -#include -#include -#endif /* OPENGL */ +#ifdef HAVE_CAIRO +#include +#endif /*-------------------------------------------------------------------------*/ /* Local includes */ @@ -56,11 +55,11 @@ extern XtAppContext app; extern Display *dpy; -extern int *appcolors; extern Cursor appcursors[NUM_CURSORS]; extern Globaldata xobjs; extern XCWindowData *areawin; extern ApplicationData appdata; +extern colorindex *colorlist; extern short popups; extern int pressmode; extern xcWidget message2, top; @@ -77,14 +76,10 @@ extern short help_up; #endif /* double buffer */ -#ifdef DOUBLEBUFFER +#if !defined(HAVE_CAIRO) Pixmap dbuf = (Pixmap)NULL; #endif -#ifdef OPENGL -extern GLXContext grXcontext; -#endif - Boolean was_preselected; /*----------------------------------------------------------------------------*/ @@ -213,7 +208,7 @@ int changepage(short pagenumber) xobjs.pagelist[pagenumber]->background.name = NULL; xobjs.pagelist[pagenumber]->pageinst = NULL; - // If we skipped ahead to pagenumber, fill in the pages in between + /* If we skipped ahead to pagenumber, fill in the pages in between */ for (npage = xobjs.pages; npage < pagenumber; npage++) { xobjs.pagelist[npage] = (Pagedata *)malloc(sizeof(Pagedata)); xobjs.pagelist[npage]->pageinst = NULL; @@ -408,6 +403,7 @@ void pushobject(objinstptr thisinst) void popobject(xcWidget w, pointertype no_undo, caddr_t calldata) { u_char undo_type = UNDO_DONE; + UNUSED(w); UNUSED(calldata); if (areawin->stack == NULL || (eventmode != NORMAL_MODE && eventmode != MOVE_MODE && eventmode != COPY_MODE && eventmode != FONTCAT_MODE && @@ -464,6 +460,7 @@ void resetbutton(xcWidget button, pointertype pageno, caddr_t calldata) short page; objectptr pageobj; objinstptr pageinst; + UNUSED(button); UNUSED(calldata); if (eventmode != NORMAL_MODE) return; @@ -508,6 +505,7 @@ void resetbutton(xcWidget button, pointertype pageno, caddr_t calldata) flush_undo_stack(); if (page == areawin->page) { + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); printname(pageobj); renamepage(page); @@ -524,6 +522,7 @@ void drawhbar(xcWidget bar, caddr_t clientdata, caddr_t calldata) Window bwin; float frac; long rleft, rright, rmid; + UNUSED(clientdata); UNUSED(calldata); if (!xcIsRealized(bar)) return; if (xobjs.suspend >= 0) return; @@ -546,7 +545,7 @@ void drawhbar(xcWidget bar, caddr_t clientdata, caddr_t calldata) if (rright > areawin->width) rright = areawin->width; XSetFunction(dpy, areawin->gc, GXcopy); - XSetForeground(dpy, areawin->gc, BARCOLOR); + XSetForeground(dpy, areawin->gc, colorlist[BARCOLOR].color.pixel); if (rmid > 0 && rleft > 0) XClearArea(dpy, bwin, 0, 0, (int)rleft, SBARSIZE, FALSE); XFillRectangle(dpy, bwin, areawin->gc, (int)rleft + 1, 1, @@ -556,8 +555,7 @@ void drawhbar(xcWidget bar, caddr_t clientdata, caddr_t calldata) - (int)rright, SBARSIZE, FALSE); XClearArea(dpy, bwin, (int)rmid - 1, 1, 3, SBARSIZE, FALSE); - XSetFunction(dpy, areawin->gc, areawin->gctype); - XSetForeground(dpy, areawin->gc, areawin->gccolor); + XSetForeground(dpy, areawin->gc, colorlist[areawin->gccolor].color.pixel); } /*------------------------------------------------------*/ @@ -569,6 +567,7 @@ void drawvbar(xcWidget bar, caddr_t clientdata, caddr_t calldata) Window bwin = xcWindow(bar); float frac; long rtop, rbot, rmid; + UNUSED(clientdata); UNUSED(calldata); if (!xcIsRealized(bar)) return; if (xobjs.suspend >= 0) return; @@ -589,7 +588,7 @@ void drawvbar(xcWidget bar, caddr_t clientdata, caddr_t calldata) if (rbot > areawin->height) rbot = areawin->height; XSetFunction(dpy, areawin->gc, GXcopy); - XSetForeground(dpy, areawin->gc, BARCOLOR); + XSetForeground(dpy, areawin->gc, colorlist[BARCOLOR].color.pixel); if (rmid > 0 && rtop > 0) XClearArea(dpy, bwin, 0, 0, SBARSIZE, (int)rtop, FALSE); XFillRectangle(dpy, bwin, areawin->gc, 0, (int)rtop + 2, SBARSIZE, @@ -599,8 +598,7 @@ void drawvbar(xcWidget bar, caddr_t clientdata, caddr_t calldata) - (int)rbot, FALSE); XClearArea(dpy, bwin, 0, (int)rmid - 1, SBARSIZE, 3, FALSE); - XSetFunction(dpy, areawin->gc, areawin->gctype); - XSetForeground(dpy, areawin->gc, areawin->gccolor); + XSetForeground(dpy, areawin->gc, colorlist[areawin->gccolor].color.pixel); } /*------------------------------------------------------*/ @@ -612,6 +610,7 @@ void panhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) { long newx, newpx; short savex = areawin->pcorner.x; + UNUSED(clientdata); if (eventmode == SELAREA_MODE) return; @@ -621,22 +620,12 @@ void panhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) areawin->pcorner.x = (short)newx; drawhbar(bar, NULL, NULL); areawin->pcorner.x = savex; + + if ((newpx = (long)(newx - savex) * areawin->vscale) == 0) + return; -#ifdef DOUBLEBUFFER - if ((newpx = (long)(newx - savex) * areawin->vscale) == 0) return; - SetFunction(dpy, areawin->gc, GXcopy); - if (newpx > 0) { - XCopyArea(dpy, dbuf, areawin->window, areawin->gc, newpx, 0, - areawin->width - newpx, areawin->height, 0, 0); - XClearArea(dpy, areawin->window, areawin->width - newpx, 0, newpx, - areawin->height, FALSE); - } - else { - XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0, - areawin->width + newpx, areawin->height, -newpx, 0); - XClearArea(dpy, areawin->window, 0, 0, -newpx, areawin->height, FALSE); - } -#endif + areawin->panx = -newpx; + drawarea(NULL, NULL, NULL); } /*------------------------------------------------------*/ @@ -647,6 +636,9 @@ void endhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) { long newx; short savex = areawin->pcorner.x; + UNUSED(clientdata); + + areawin->panx = 0; newx = (long)(event->x * ((float)topobject->bbox.width / areawin->width) + topobject->bbox.lowerleft.x - 0.5 * @@ -661,6 +653,7 @@ void endhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) else W3printf(" "); + areawin->redraw_needed = True; areawin->lastbackground = NULL; renderbackground(); drawhbar(bar, NULL, NULL); @@ -676,6 +669,7 @@ void panvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) { long newy, newpy; short savey = areawin->pcorner.y; + UNUSED(clientdata); if (eventmode == SELAREA_MODE) return; @@ -686,23 +680,12 @@ void panvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) areawin->pcorner.y = (short)newy; drawvbar(bar, NULL, NULL); areawin->pcorner.y = savey; - -#ifdef DOUBLEBUFFER - if ((newpy = (long)(newy - savey) * areawin->vscale) == 0) return; - SetFunction(dpy, areawin->gc, GXcopy); - if (newpy > 0) { - XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0, - areawin->width, areawin->height - newpy, 0, newpy); - XClearArea(dpy, areawin->window, 0, 0, areawin->width, newpy, FALSE); - } - else { - XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, -newpy, - areawin->width, areawin->height + newpy, 0, 0); - XClearArea(dpy, areawin->window, 0, areawin->height + newpy, - areawin->width, -newpy, FALSE); - } -#endif - + + if ((newpy = (long)(newy - savey) * areawin->vscale) == 0) + return; + + areawin->pany = newpy; + drawarea(NULL, NULL, NULL); } /*------------------------------------------------------*/ @@ -711,7 +694,6 @@ void panvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) void trackpan(int x, int y) { - long newpx, newpy; XPoint newpos; short savey = areawin->pcorner.y; short savex = areawin->pcorner.x; @@ -725,20 +707,10 @@ void trackpan(int x, int y) drawhbar(areawin->scrollbarh, NULL, NULL); drawvbar(areawin->scrollbarv, NULL, NULL); -#ifdef DOUBLEBUFFER - newpx = (long)areawin->pcorner.x * areawin->vscale; - newpy = (long)areawin->pcorner.y * areawin->vscale; - - SetFunction(dpy, areawin->gc, GXcopy); - /* To-do: Clear or repaint areas not in copy region */ + areawin->panx = -newpos.x; + areawin->pany = newpos.y; -/* - XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0, - areawin->width, areawin->height, newpx, - areawin->height - newpy); -*/ drawarea(NULL, NULL, NULL); -#endif areawin->pcorner.x = savex; areawin->pcorner.y = savey; @@ -753,6 +725,9 @@ void endvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) { long newy; short savey = areawin->pcorner.y; + UNUSED(clientdata); + + areawin->pany = 0; newy = (int)((areawin->height - event->y) * ((float)topobject->bbox.height / areawin->height) + @@ -768,6 +743,7 @@ void endvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event) else W3printf(" "); + areawin->redraw_needed = True; areawin->lastbackground = NULL; renderbackground(); drawvbar(bar, NULL, NULL); @@ -793,6 +769,7 @@ void zoominbox(int x, int y) float savescale; float delxscale, delyscale; XPoint savell; /* ucenter, ncenter, (jdk)*/ + UNUSED(x); UNUSED(y); savescale = areawin->vscale; savell.x = areawin->pcorner.x; @@ -901,6 +878,7 @@ void zoomoutbox(int x, int y) float delxscale, delyscale, scalefac; XPoint savell; /* ucenter, ncenter, (jdk)*/ XlPoint newll; + UNUSED(x); UNUSED(y); savescale = areawin->vscale; savell.x = areawin->pcorner.x; @@ -1507,6 +1485,9 @@ void makepress(XtPointer clientdata, xcIntervalId *id) #endif { int keywstate = (int)((pointertype)clientdata); +#ifndef TCL_WRAPPER + UNUSED(id); +#endif /* Button/Key was pressed long enough to make a "press", not a "tap" */ @@ -1569,7 +1550,6 @@ void poly_edit_op(int op) /* Remove a point from the polygon */ if (op == XCF_Edit_Delete) { if (lwire->number < 3) return; - UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth); if (lwire->number == 3 && !(lwire->style & UNCLOSED)) lwire->style |= UNCLOSED; cycle = checkcycle((genericptr)lwire, 0); @@ -1577,13 +1557,15 @@ void poly_edit_op(int op) for (lpoint = lwire->points + cycle; lpoint < lwire->points + lwire->number; lpoint++) *lpoint = *(lpoint + 1); - UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth); + if (eventmode == EPOLY_MODE) + poly_mode_draw(xcDRAW_EDIT, TOPOLY(EDITPART)); + else + path_mode_draw(xcDRAW_EDIT, TOPATH(EDITPART)); nextpolycycle(&lwire, -1); } /* Add a point to the polygon */ else if (op == XCF_Edit_Insert || op == XCF_Edit_Append) { - UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth); lwire->number++; lwire->points = (XPoint *)realloc(lwire->points, lwire->number * sizeof(XPoint)); @@ -1591,7 +1573,10 @@ void poly_edit_op(int op) for (lpoint = lwire->points + lwire->number - 1; lpoint > lwire-> points + cycle; lpoint--) *lpoint = *(lpoint - 1); - UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth); + if (eventmode == EPOLY_MODE) + poly_mode_draw(xcDRAW_EDIT, TOPOLY(EDITPART)); + else + path_mode_draw(xcDRAW_EDIT, TOPATH(EDITPART)); if (op == XCF_Edit_Append) nextpolycycle(&lwire, 1); } @@ -1635,12 +1620,10 @@ void attach_to() areawin->attachto = *(refsel + areawin->selects - 1); areawin->selects--; if (areawin->selects == 0) freeselects(); - SetFunction(dpy, areawin->gc, GXcopy); XTopSetForeground(SELTOCOLOR(refsel)); easydraw(areawin->attachto, DEFAULTCOLOR); /* restore graphics state */ - SetFunction(dpy, areawin->gc, areawin->gctype); SetForeground(dpy, areawin->gc, areawin->gccolor); Wprintf("Constrained attach"); @@ -1682,6 +1665,7 @@ Boolean compatible_function(int function) case XCF_Text_Left: case XCF_Text_Right: case XCF_Text_Home: case XCF_Text_End: case XCF_Text_Return: case XCF_Text_Delete: + case XCF_Text_Delete_Param: r = (eventmode == CATTEXT_MODE || eventmode == TEXT_MODE || eventmode == ETEXT_MODE) ? TRUE : FALSE; @@ -1702,7 +1686,7 @@ Boolean compatible_function(int function) TRUE : FALSE; break; - case XCF_Justify: + case XCF_Anchor: r = (eventmode == TEXT_MODE || eventmode == ETEXT_MODE || eventmode == MOVE_MODE || eventmode == COPY_MODE || eventmode == NORMAL_MODE) ? @@ -1883,6 +1867,7 @@ int eventdispatch(int keywstate, int x, int y) { short value; /* For return values from boundfunction() */ int function; /* What function should be invoked */ + int handled = -1; /* event was handled */ /* Invalid key state returned from getkeysignature(); usually this */ /* means a modifier key pressed by itself. */ @@ -1899,26 +1884,32 @@ int eventdispatch(int keywstate, int x, int y) if (eventmode == CATTEXT_MODE || eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { if (function != XCF_Special) - return labeltext(keywstate, NULL); + handled = labeltext(keywstate, NULL); else if (eventmode != CATTEXT_MODE) { labelptr elabel = TOLABEL(EDITPART); - if (elabel->justify & LATEXLABEL) - return labeltext(keywstate, NULL); + if (elabel->anchor & LATEXLABEL) + handled = labeltext(keywstate, NULL); } } } - if (function > -1) - return functiondispatch(function, value, x, y); - else { - char *keystring = key_to_string(keywstate); + if (handled == -1) { + if (function > -1) + handled = functiondispatch(function, value, x, y); + else { + char *keystring = key_to_string(keywstate); #ifdef HAVE_PYTHON - if (python_key_command(keywstate) < 0) + if (python_key_command(keywstate) < 0) #endif - Wprintf("Key \'%s\' is not bound to a macro", keystring); - free(keystring); + Wprintf("Key \'%s\' is not bound to a macro", keystring); + free(keystring); + } } - return -1; + + if (areawin->redraw_needed) + drawarea(NULL, NULL, NULL); + + return handled; } /*----------------------------------------------------------------------*/ @@ -1938,6 +1929,8 @@ int functiondispatch(int function, short value, int x, int y) case NORMAL_MODE: window_to_user(x, y, &areawin->save); break; + default: + break; } switch(function) { @@ -1947,8 +1940,8 @@ int functiondispatch(int function, short value, int x, int y) else newpage(value - 1); break; - case XCF_Justify: - rejustify(value); + case XCF_Anchor: + reanchor(value); break; case XCF_Superscript: labeltext(SUPERSCRIPT, (char *)1); @@ -2009,6 +2002,9 @@ int functiondispatch(int function, short value, int x, int y) case XCF_Text_Delete: labeltext(TEXT_DELETE, (char *)1); break; + case XCF_Text_Delete_Param: + labeltext(TEXT_DEL_PARAM, (char *)1); + break; case XCF_Text_Right: labeltext(TEXT_RIGHT, (char *)1); break; @@ -2088,7 +2084,7 @@ int functiondispatch(int function, short value, int x, int y) starthelp(NULL, NULL, NULL); break; case XCF_Redraw: - drawarea(NULL, NULL, NULL); + areawin->redraw_needed = True; break; case XCF_View: zoomview(NULL, NULL, NULL); @@ -2200,6 +2196,7 @@ int functiondispatch(int function, short value, int x, int y) reset_cycles(); select_connected_pins(); XDefineCursor(dpy, areawin->window, ARROW); + move_mode_draw(xcDRAW_INIT, NULL); #ifdef TCL_WRAPPER Tk_CreateEventHandler(areawin->area, ButtonMotionMask | PointerMotionMask, (Tk_EventProc *)xctk_drag, @@ -2250,6 +2247,7 @@ int functiondispatch(int function, short value, int x, int y) case XCF_Dot: snap(x, y, &areawin->save); drawdot(areawin->save.x, areawin->save.y); + areawin->redraw_needed = True; drawarea(NULL, NULL, NULL); break; case XCF_Wire: @@ -2284,7 +2282,7 @@ int functiondispatch(int function, short value, int x, int y) case XCF_Rescale: if (checkselect(LABEL | OBJINST | GRAPHIC) == TRUE) { eventmode = RESCALE_MODE; - UDrawRescaleBox(&areawin->save); + rescale_mode_draw(xcDRAW_INIT, NULL); #ifdef TCL_WRAPPER Tk_CreateEventHandler(areawin->area, PointerMotionMask | ButtonMotionMask, (Tk_EventProc *)xctk_drag, NULL); @@ -2340,10 +2338,6 @@ int functiondispatch(int function, short value, int x, int y) Wprintf("Action not handled"); result = -1; break; - case XCF_Text_Delete_Param: - Wprintf("Action not handled"); - result = -1; - break; case XCF_ChangeStyle: Wprintf("Action not handled"); result = -1; @@ -2425,7 +2419,8 @@ int getkeysignature(XKeyEvent *event) void keyhandler(xcWidget w, caddr_t clientdata, XKeyEvent *event) { int keywstate; /* KeySym with prepended state information */ - int j, func; + int func; + UNUSED(w); UNUSED(clientdata); #ifdef TCL_WRAPPER if (popups > 0) return; @@ -2453,6 +2448,8 @@ void keyhandler(xcWidget w, caddr_t clientdata, XKeyEvent *event) finish_op(XCF_Finish, event->x, event->y); pressmode = 0; + if (areawin->redraw_needed) + drawarea(NULL, NULL, NULL); } return; /* Ignore all other release events */ } @@ -2468,7 +2465,6 @@ void keyhandler(xcWidget w, caddr_t clientdata, XKeyEvent *event) /* Establish whether a HOLD modifier binding would apply in */ /* the current eventmode. If so, set the HOLD timer. */ - j = 0; func = boundfunction(areawin->area, keywstate | HOLD_MASK, NULL); if (func != -1) { areawin->save.x = event->x; @@ -2504,6 +2500,7 @@ void setsnap(short direction) if (xobjs.pagelist[areawin->page]->snapspace != oldsnap) { measurestr(xobjs.pagelist[areawin->page]->snapspace, buffer); Wprintf("Snap spacing set to %s", buffer); + areawin->redraw_needed = True; drawarea(NULL, NULL, NULL); } } @@ -2519,7 +2516,6 @@ void snapelement() preselected = (areawin->selects > 0) ? TRUE : FALSE; if (!checkselect(ALL_TYPES)) return; - SetFunction(dpy, areawin->gc, GXcopy); SetForeground(dpy, areawin->gc, BACKGROUND); for (selectobj = areawin->selectlist; selectobj < areawin->selectlist + areawin->selects; selectobj++) { @@ -2705,7 +2701,7 @@ void printpos(short xval, short yval) polyptr lwire = (eventmode == BOX_MODE) ? TOPOLY(ENDPART) : TOPOLY(EDITPART); if ((eventmode == EPOLY_MODE) && (lwire->number > 2)) { /* sanity check on edit cycle */ - cycle = lwire->cycle->number; + cycle = (lwire->cycle) ? lwire->cycle->number : -1; if (cycle < 0 || cycle >= lwire->number) { advancecycle((genericptr *)(&lwire), 0); cycle = 0; @@ -2831,7 +2827,7 @@ void printpos(short xval, short yval) /*---------------------------------------------------*/ void findwirex(XPoint *endpt1, XPoint *endpt2, XPoint *userpt, - XPoint *newpos, int *rot) + XPoint *newpos, float *rot) { long xsq, ysq, zsq; float frac; @@ -2845,16 +2841,8 @@ void findwirex(XPoint *endpt1, XPoint *endpt2, XPoint *userpt, newpos->x = endpt1->x + (int)((endpt2->x - endpt1->x) * frac); newpos->y = endpt1->y + (int)((endpt2->y - endpt1->y) * frac); - *rot = 180 + (int)(INVRFAC * atan2((double)(endpt1->x - - endpt2->x), (double)(endpt1->y - endpt2->y))); - - /* make adjustment for nearest-integer calculation */ - /* ((*rot)++, (*rot)-- works if (360 / RSTEPS >= 2)) */ /* ? */ - - if (*rot > 0) - (*rot)++; - else if (*rot < 0) - (*rot)--; + *rot = 180.0 + INVRFAC * atan2((double)(endpt1->x - + endpt2->x), (double)(endpt1->y - endpt2->y)); } /*----------------------------------------------------------------*/ @@ -2862,12 +2850,12 @@ void findwirex(XPoint *endpt1, XPoint *endpt2, XPoint *userpt, /* to the "attachto" element. */ /*----------------------------------------------------------------*/ -void findattach(XPoint *newpos, int *rot, XPoint *userpt) +void findattach(XPoint *newpos, float *rot, XPoint *userpt) { XPoint *endpt1, *endpt2; float frac; double tmpang; - int locrot = 0; + float locrot = 0.0; if (rot) locrot = *rot; @@ -2922,8 +2910,8 @@ void findattach(XPoint *newpos, int *rot, XPoint *userpt) /* rotation of object is normal to the curve of the ellipse */ if (rot) { - *rot = 90 - (int)(INVRFAC * tmpang); - if (*rot < 0) *rot += 360; + *rot = 90.0 - INVRFAC * tmpang; + if (*rot < 0.0) *rot += 360.0; } } else if (SELECTTYPE(&areawin->attachto) == SPLINE) { @@ -3097,15 +3085,13 @@ void drag(int x, int y) /* set up the graphics state for moving a selected object */ - XSetXORFg(SELECTCOLOR, BACKGROUND); - SetFunction(dpy, areawin->gc, GXxor); + XTopSetForeground(SELECTCOLOR); placeselects(deltax, deltay, &userpt); /* restore graphics state */ SetForeground(dpy, areawin->gc, areawin->gccolor); - SetFunction(dpy, areawin->gc, areawin->gctype); /* print the position and other useful measurements */ @@ -3119,14 +3105,18 @@ void drag(int x, int y) void xlib_drag(xcWidget w, caddr_t clientdata, XEvent *event) { XButtonEvent *bevent = (XButtonEvent *)event; + UNUSED(w); UNUSED(clientdata); + drag(bevent->x, bevent->y); + if (areawin->redraw_needed) + drawarea(NULL, NULL, NULL); } /*----------------------------------------------*/ /* Rotate an element of a path */ /*----------------------------------------------*/ -void elemrotate(genericptr *genobj, short direction, XPoint *position) +void elemrotate(genericptr *genobj, float direction, XPoint *position) { XPoint negpt, *newpts = (XPoint *)NULL; @@ -3136,8 +3126,8 @@ void elemrotate(genericptr *genobj, short direction, XPoint *position) switch(ELEMENTTYPE(*genobj)) { case(ARC):{ arcptr rotatearc = TOARC(genobj); - rotatearc->angle1 -= (float)(direction); - rotatearc->angle2 -= (float)(direction); + rotatearc->angle1 -= direction; + rotatearc->angle2 -= direction; if (rotatearc->angle1 >= 360) { rotatearc->angle1 -= 360; rotatearc->angle2 -= 360; @@ -3181,7 +3171,7 @@ void elemrotate(genericptr *genobj, short direction, XPoint *position) /* and groups, rotate about the cursor point. */ /*------------------------------------------------------*/ -void elementrotate(short direction, XPoint *position) +void elementrotate(float direction, XPoint *position) { short *selectobj; /* , ld; (jdk) */ Boolean single = False; @@ -3201,7 +3191,6 @@ void elementrotate(short direction, XPoint *position) /* erase the element */ if (!need_refresh) { - SetFunction(dpy, areawin->gc, GXcopy); SetForeground(dpy, areawin->gc, BACKGROUND); easydraw(*selectobj, DOFORALL); } @@ -3241,7 +3230,9 @@ void elementrotate(short direction, XPoint *position) rotateg->rotation += direction; while (rotateg->rotation >= 360) rotateg->rotation -= 360; while (rotateg->rotation <= 0) rotateg->rotation += 360; +#ifndef HAVE_CAIRO rotateg->valid = FALSE; +#endif /* !HAVE_CAIRO */ if (!single) { UTransformPoints(&rotateg->position, &newpt, 1, negpt, 1.0, 0); UTransformPoints(&newpt, &rotateg->position, 1, *position, @@ -3282,7 +3273,7 @@ void elementrotate(short direction, XPoint *position) if (eventmode != COPY_MODE) register_for_undo(XCF_Rotate, UNDO_MORE, areawin->topinstance, (eventmode == MOVE_MODE) ? &areawin->origin : position, - (int)direction); + (double)direction); /* New rule (6/15/07) to be applied generally: If objects were */ /* selected prior to calling elementrotate() and similar functions, */ @@ -3351,24 +3342,21 @@ void elementrescale(float newscale) void edit(int x, int y) { - short *selectobj, saveselects; - Boolean preselected = False; + short *selectobj; if (areawin->selects == 0) { - short savemode = eventmode; - eventmode = PENDING_MODE; + Boolean saveredraw = areawin->redraw_needed; selectobj = select_element(ALL_TYPES); - eventmode = savemode; + areawin->redraw_needed = saveredraw; } - else { - preselected = True; + else selectobj = areawin->selectlist; - } if (areawin->selects == 0) return; else if (areawin->selects != 1) { /* Multiple object edit */ - int seltype, selnum; + int selnum; short *selectlist, selrefno; + Boolean save_redraw = areawin->redraw_needed; /* Find the closest part to use as a reference */ selnum = areawin->selects; @@ -3383,6 +3371,7 @@ void edit(int x, int y) freeselects(); areawin->selects = selnum; areawin->selectlist = selectlist; + areawin->redraw_needed = save_redraw; for (selectobj = areawin->selectlist; selectobj < areawin->selectlist + areawin->selects; selectobj++) { if (*selectobj == selrefno) break; @@ -3416,23 +3405,31 @@ void edit(int x, int y) /* unless textend is set. . . */ if (areawin->textend == 0) { + TextLinesInfo tlinfo; + tlinfo.dostop = 0; + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; + window_to_user(x, y, &areawin->save); InvTransformPoints(&areawin->save, &tmppt, 1, (*lastlabel)->position, (*lastlabel)->scale, (*lastlabel)->rotation); - tmpext = ULength(*lastlabel, areawin->topinstance, 0, NULL); - tmppt.x += ((*lastlabel)->justify & NOTLEFT ? - ((*lastlabel)->justify & RIGHT ? tmpext.maxwidth + tmpext = ULength(*lastlabel, areawin->topinstance, &tlinfo); + tmppt.x += ((*lastlabel)->anchor & NOTLEFT ? + ((*lastlabel)->anchor & RIGHT ? tmpext.maxwidth : tmpext.maxwidth >> 1) : 0); - tmppt.y += ((*lastlabel)->justify & NOTBOTTOM ? - ((*lastlabel)->justify & TOP ? tmpext.ascent : + tmppt.y += ((*lastlabel)->anchor & NOTBOTTOM ? + ((*lastlabel)->anchor & TOP ? tmpext.ascent : (tmpext.ascent + tmpext.base) >> 1) : tmpext.base); if ((*lastlabel)->pin) - pinadjust((*lastlabel)->justify, &tmppt.x, NULL, -1); + pinadjust((*lastlabel)->anchor, &tmppt.x, NULL, -1); + + /* Where tbreak is passed to ULength, the character position */ + /* is returned in the TextLinesInfo dostop field. */ + tlinfo.tbreak = &tmppt; + tmpext = ULength(*lastlabel, areawin->topinstance, &tlinfo); + areawin->textpos = tlinfo.dostop; - // Where tbreak is passed to ULength, the character position, - // not the dimension, is held in tmpext.width field. - tmpext = ULength(*lastlabel, areawin->topinstance, 0, &tmppt); - areawin->textpos = tmpext.width; + if (tlinfo.padding != NULL) free(tlinfo.padding); } /* find current font */ @@ -3442,17 +3439,21 @@ void edit(int x, int y) /* change menu buttons accordingly */ - setfontmarks(curfont, (*lastlabel)->justify); + setfontmarks(curfont, (*lastlabel)->anchor); if (eventmode == CATALOG_MODE) { /* CATTEXT_MODE may show an otherwise hidden library namespace */ undrawtext(*lastlabel); eventmode = CATTEXT_MODE; redrawtext(*lastlabel); + areawin->redraw_needed = False; /* ignore prev. redraw requests */ + text_mode_draw(xcDRAW_INIT, *lastlabel); + } + else { + eventmode = ETEXT_MODE; + text_mode_draw(xcDRAW_INIT, *lastlabel); } - else eventmode = ETEXT_MODE; - UDrawTLine(*lastlabel); XDefineCursor(dpy, areawin->window, TEXTPTR); /* write the text at the bottom */ @@ -3463,15 +3464,6 @@ void edit(int x, int y) case POLYGON: case ARC: case SPLINE: case PATH: window_to_user(x, y, &areawin->save); - /* Redraw without drawing selections */ - saveselects = areawin->selects; - selectobj = areawin->selectlist; - areawin->selects = 0; - areawin->selectlist = NULL; - drawarea(NULL, NULL, NULL); - areawin->selectlist = selectobj; - areawin->selects = saveselects; - pathedit(*(EDITPART)); break; @@ -3570,18 +3562,8 @@ void pathedit(genericptr editpart) areawin->origin = areawin->save; checkwarp(savept); - /* Draw edit lines on all splines in the path */ - for (ggen = lastpath->plist; ggen < lastpath->plist + lastpath->parts; - ggen++) { - if (ELEMENTTYPE(*ggen) == SPLINE) { - lastspline = TOSPLINE(ggen); - UDrawXLine(lastspline->ctrl[0], lastspline->ctrl[1]); - UDrawXLine(lastspline->ctrl[3], lastspline->ctrl[2]); - } - } - XcSetXORFg((lastpoly) ? lastpoly->color : lastspline->color, BACKGROUND); - XcSetFunction(GXxor); - + path_mode_draw(xcDRAW_INIT, lastpath); + xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackelement, NULL); eventmode = EPATH_MODE; @@ -3612,8 +3594,7 @@ void pathedit(genericptr editpart) checkwarp(savept); - XcSetXORFg(lastpoly->color, BACKGROUND); - XcSetFunction(GXxor); + poly_mode_draw(xcDRAW_INIT, lastpoly); xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackelement, NULL); @@ -3647,10 +3628,7 @@ void pathedit(genericptr editpart) checkwarp(curpt); - UDrawXLine(lastspline->ctrl[0], lastspline->ctrl[1]); - UDrawXLine(lastspline->ctrl[3], lastspline->ctrl[2]); - XcSetXORFg(lastspline->color, BACKGROUND); - XcSetFunction(GXxor); + spline_mode_draw(xcDRAW_INIT, lastspline); xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackelement, NULL); eventmode = ESPLINE_MODE; @@ -3679,11 +3657,9 @@ void pathedit(genericptr editpart) checkwarp(&curpt); - UDrawXLine(curpt, lastarc->position); areawin->save.x = curpt.x; /* for redrawing dotted edit line */ areawin->save.y = curpt.y; - XcSetXORFg(lastarc->color, BACKGROUND); - XcSetFunction(GXxor); + arc_mode_draw(xcDRAW_INIT, lastarc); xcAddEventHandler(areawin->area, PointerMotionMask, False, (xcEventHandler)trackarc, NULL); eventmode = EARC_MODE; @@ -3719,7 +3695,6 @@ void xc_top(short *selectno, short *orderlist) /* Lower an element to the bottom of the list */ /*------------------------------------------------------*/ - void xc_bottom(short *selectno, short *orderlist) { short i; @@ -4043,22 +4018,23 @@ void elementflip(XPoint *position) + areawin->selects; selectobj++) { /* erase the object */ - SetFunction(dpy, areawin->gc, GXcopy); SetForeground(dpy, areawin->gc, BACKGROUND); easydraw(*selectobj, DOFORALL); switch(SELECTTYPE(selectobj)) { case LABEL:{ labelptr fliplab = SELTOLABEL(selectobj); - if ((fliplab->justify & (RIGHT | NOTLEFT)) != NOTLEFT) - fliplab->justify ^= (RIGHT | NOTLEFT); + if ((fliplab->anchor & (RIGHT | NOTLEFT)) != NOTLEFT) + fliplab->anchor ^= (RIGHT | NOTLEFT); if (!single) fliplab->position.x = (position->x << 1) - fliplab->position.x; }break; case GRAPHIC:{ graphicptr flipg = SELTOGRAPHIC(selectobj); flipg->scale = -flipg->scale; +#ifndef HAVE_CAIRO flipg->valid = FALSE; +#endif /* !HAVE_CAIRO */ if (!single) flipg->position.x = (position->x << 1) - flipg->position.x; }break; @@ -4130,15 +4106,14 @@ void elementvflip(XPoint *position) + areawin->selects; selectobj++) { /* erase the object */ - SetFunction(dpy, areawin->gc, GXcopy); SetForeground(dpy, areawin->gc, BACKGROUND); easydraw(*selectobj, DOFORALL); switch(SELECTTYPE(selectobj)) { case(LABEL):{ labelptr fliplab = SELTOLABEL(selectobj); - if ((fliplab->justify & (TOP | NOTBOTTOM)) != NOTBOTTOM) - fliplab->justify ^= (TOP | NOTBOTTOM); + if ((fliplab->anchor & (TOP | NOTBOTTOM)) != NOTBOTTOM) + fliplab->anchor ^= (TOP | NOTBOTTOM); if (!single) fliplab->position.y = (position->y << 1) - fliplab->position.y; } break; @@ -4204,6 +4179,8 @@ void elementvflip(XPoint *position) void deletebutton(int x, int y) { + UNUSED(x); UNUSED(y); + if (checkselect(ALL_TYPES)) { standard_element_delete(ERASE); calcbbox(areawin->topinstance); @@ -4273,7 +4250,6 @@ objectptr delete_element(objinstptr thisinstance, short *slist, int selects, initmem(delobj); if (drawmode) { - SetFunction(dpy, areawin->gc, GXcopy); SetForeground(dpy, areawin->gc, BACKGROUND); } @@ -4317,8 +4293,8 @@ void standard_element_delete(short drawmode) { objectptr delobj; -// register_for_undo(XCF_Select, UNDO_MORE, areawin->topinstance, -// areawin->selectlist, areawin->selects); +/* register_for_undo(XCF_Select, UNDO_MORE, areawin->topinstance, */ +/* areawin->selectlist, areawin->selects); */ select_invalidate_netlist(); delobj = delete_element(areawin->topinstance, areawin->selectlist, areawin->selects, drawmode); @@ -4381,10 +4357,6 @@ short *xc_undelete(objinstptr thisinstance, objectptr delobj, short mode, slist = (short *)malloc(delobj->parts * sizeof(short)); count = 0; - if (mode) { - SetFunction(dpy, areawin->gc, GXcopy); - } - for (regen = delobj->plist; regen < delobj->plist + delobj->parts; regen++) { PLIST_INCR(thisobject); if (olist == NULL) { @@ -4779,6 +4751,8 @@ void editpoints(genericptr *ssgen, short deltax, short deltay) void xlib_makeobject(xcWidget w, caddr_t nulldata) { + UNUSED(w); UNUSED(nulldata); + domakeobject(-1, (char *)_STR2, FALSE); } @@ -4930,7 +4904,6 @@ objinstptr domakeobject(int libnum, char *name, Boolean forceempty) /* (netlist invalidation was taken care of by delete_element() */ /* Also, incr_changes(topobject) was done by delete_element()) */ - SetFunction(dpy, areawin->gc, GXcopy); XTopSetForeground((*newinst)->color); UDrawObject(*newinst, SINGLE, (*newinst)->color, xobjs.pagelist[areawin->page]->wirewidth, NULL); @@ -4966,6 +4939,7 @@ objinstptr domakeobject(int libnum, char *name, Boolean forceempty) void selectsave(xcWidget w, caddr_t clientdata, caddr_t calldata) { buttonsave *popdata = (buttonsave *)malloc(sizeof(buttonsave)); + UNUSED(clientdata); UNUSED(calldata); if (areawin->selects == 0) return; /* nothing was selected */ @@ -5055,9 +5029,11 @@ void graphiccopy(graphicptr newg, graphicptr copyg) newg->color = copyg->color; newg->passed = NULL; copyalleparams((genericptr)newg, (genericptr)copyg); +#ifndef HAVE_CAIRO newg->valid = FALSE; newg->target = NULL; newg->clipmask = (Pixmap)NULL; +#endif /* HAVE_CAIRO */ /* Update the refcount of the source image */ for (i = 0; i < xobjs.images; i++) { @@ -5078,7 +5054,7 @@ void labelcopy(labelptr newtext, labelptr copytext) newtext->position.y = copytext->position.y; newtext->rotation = copytext->rotation; newtext->scale = copytext->scale; - newtext->justify = copytext->justify; + newtext->anchor = copytext->anchor; newtext->color = copytext->color; newtext->passed = NULL; newtext->cycle = NULL; @@ -5314,12 +5290,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt) { short *dragselect; XPoint newpos, *ppt; - int rot; - short closest, cycle; + float rot; + short closest; Boolean doattach; genericptr *pgen; polyptr cpoly; - pointselect *cptr; doattach = ((userpt == NULL) || (areawin->attachto < 0)) ? FALSE : TRUE; @@ -5328,7 +5303,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt) if (doattach) findattach(&newpos, &rot, userpt); +#ifdef HAVE_CAIRO +#else areawin->clipped = -1; /* Prevent clipping */ +#endif /* HAVE_CAIRO */ + for (dragselect = areawin->selectlist; dragselect < areawin->selectlist + areawin->selects; dragselect++) { @@ -5336,35 +5315,26 @@ void placeselects(short deltax, short deltay, XPoint *userpt) case OBJINST: { objinstptr draginst = SELTOOBJINST(dragselect); - UDrawObject(draginst, SINGLE, DOFORALL, - xobjs.pagelist[areawin->page]->wirewidth, NULL); if (doattach) { draginst->position.x = newpos.x; draginst->position.y = newpos.y; - while (rot >= 360) rot -= 360; - while (rot < 0) rot += 360; + while (rot >= 360.0) rot -= 360.0; + while (rot < 0.0) rot += 360.0; draginst->rotation = rot; } else { draginst->position.x += deltax; draginst->position.y += deltay; } - UDrawObject(draginst, SINGLE, DOFORALL, - xobjs.pagelist[areawin->page]->wirewidth, NULL); } break; case GRAPHIC: { graphicptr dragg = SELTOGRAPHIC(dragselect); - UDrawGraphic(dragg); dragg->position.x += deltax; dragg->position.y += deltay; - UDrawGraphic(dragg); } break; case LABEL: { labelptr draglabel = SELTOLABEL(dragselect); - UDrawString(draglabel, DOFORALL, areawin->topinstance); - if (draglabel->pin == False) - UDrawX(draglabel); if (doattach) { draglabel->position.x = newpos.x; draglabel->position.y = newpos.y; @@ -5374,15 +5344,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt) draglabel->position.x += deltax; draglabel->position.y += deltay; } - UDrawString(draglabel, DOFORALL, areawin->topinstance); - if (draglabel->pin == False) - UDrawX(draglabel); } break; case PATH: { pathptr dragpath = SELTOPATH(dragselect); genericptr *pathlist; - UDrawPath(dragpath, xobjs.pagelist[areawin->page]->wirewidth); if (doattach) { XPoint *pdelta = pathclosepoint(dragpath, &newpos); deltax = newpos.x - pdelta->x; @@ -5392,14 +5358,12 @@ void placeselects(short deltax, short deltay, XPoint *userpt) + dragpath->parts; pathlist++) { movepoints(pathlist, deltax, deltay); } - UDrawPath(dragpath, xobjs.pagelist[areawin->page]->wirewidth); } break; case POLYGON: { polyptr dragpoly = SELTOPOLY(dragselect); pointlist dragpoints; - // if (dragpoly->cycle != NULL) continue; - UDrawPolygon(dragpoly, xobjs.pagelist[areawin->page]->wirewidth); + /* if (dragpoly->cycle != NULL) continue; */ if (doattach) { closest = closepoint(dragpoly, &newpos); deltax = newpos.x - dragpoly->points[closest].x; @@ -5410,15 +5374,13 @@ void placeselects(short deltax, short deltay, XPoint *userpt) dragpoints->x += deltax; dragpoints->y += deltay; } - UDrawPolygon(dragpoly, xobjs.pagelist[areawin->page]->wirewidth); } break; case SPLINE: { splineptr dragspline = SELTOSPLINE(dragselect); short j; fpointlist dragpoints; - // if (dragspline->cycle != NULL) continue; - UDrawSpline(dragspline, xobjs.pagelist[areawin->page]->wirewidth); + /* if (dragspline->cycle != NULL) continue; */ if (doattach) { closest = (wirelength(&dragspline->ctrl[0], &newpos) > wirelength(&dragspline->ctrl[3], &newpos)) ? 3 : 0; @@ -5434,13 +5396,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt) dragspline->ctrl[j].x += deltax; dragspline->ctrl[j].y += deltay; } - UDrawSpline(dragspline, xobjs.pagelist[areawin->page]->wirewidth); } break; case ARC: { arcptr dragarc = SELTOARC(dragselect); fpointlist dragpoints; - UDrawArc(dragarc, xobjs.pagelist[areawin->page]->wirewidth); if (doattach) { deltax = newpos.x - dragarc->position.x; deltay = newpos.y - dragarc->position.y; @@ -5452,7 +5412,6 @@ void placeselects(short deltax, short deltay, XPoint *userpt) dragpoints->x += deltax; dragpoints->y += deltay; } - UDrawArc(dragarc, xobjs.pagelist[areawin->page]->wirewidth); } break; } } @@ -5464,19 +5423,22 @@ void placeselects(short deltax, short deltay, XPoint *userpt) cpoly = TOPOLY(pgen); if (cpoly->cycle != NULL) { ppt = cpoly->points + cpoly->cycle->number; - UDrawPolygon(cpoly, xobjs.pagelist[areawin->page]->wirewidth); newpos.x = ppt->x + deltax; newpos.y = ppt->y + deltay; if (areawin->manhatn) manhattanize(&newpos, cpoly, cpoly->cycle->number, FALSE); ppt->x = newpos.x; ppt->y = newpos.y; - UDrawPolygon(cpoly, xobjs.pagelist[areawin->page]->wirewidth); } } } } + + move_mode_draw(xcDRAW_EDIT, NULL); +#ifdef HAVE_CAIRO +#else areawin->clipped = 0; +#endif /* HAVE_CAIRO */ } /*----------------------------------------------------------------------*/ @@ -5556,18 +5518,8 @@ void createcopies() void copydrag() { - short *selectobj; - if (areawin->selects > 0) { - /* Put all selected objects into the "select" color */ - - SetFunction(dpy, areawin->gc, GXxor); - for (selectobj = areawin->selectlist; selectobj < areawin->selectlist - + areawin->selects; selectobj++) { - XSetXORFg(SELTOCOLOR(selectobj), BACKGROUND); - easydraw(*selectobj, DOFORALL); - } - + move_mode_draw(xcDRAW_INIT, NULL); if (eventmode == NORMAL_MODE) { XDefineCursor(dpy, areawin->window, COPYCURSOR); eventmode = COPY_MODE; @@ -5590,8 +5542,6 @@ void copydrag() void copy_op(int op, int x, int y) { - short *csel; - if (op == XCF_Copy) { window_to_user(x, y, &areawin->save); createcopies(); /* This function does all the hard work */ @@ -5613,14 +5563,11 @@ void copy_op(int op, int x, int y) XDefineCursor(dpy, areawin->window, DEFAULTCURSOR); u2u_snap(&areawin->save); if (op == XCF_Cancel) { + move_mode_draw(xcDRAW_EMPTY, NULL); delete_noundo(NORMAL); - - /* Redraw the screen so that an object directly under */ - /* the delete object won't get painted black */ - - drawarea(NULL, NULL, NULL); } else if (op == XCF_Finish_Copy) { + move_mode_draw(xcDRAW_FINAL, NULL); /* If selected objects are the only ones on the page, */ /* then do a full bbox calculation. */ if (topobject->parts == areawin->selects) @@ -5634,11 +5581,7 @@ void copy_op(int op, int x, int y) incr_changes(topobject); } else { /* XCF_Continue_Copy */ - SetFunction(dpy, areawin->gc, GXcopy); - SetForeground(dpy, areawin->gc, SELECTCOLOR); - for (csel = areawin->selectlist; csel < areawin->selectlist + - areawin->selects; csel++) - easydraw(*csel, DOFORALL); + move_mode_draw(xcDRAW_FINAL, NULL); if (topobject->parts == areawin->selects) calcbbox(areawin->topinstance); else @@ -5700,6 +5643,8 @@ void continue_op(int op, int x, int y) case(BOX_MODE): finish_op(XCF_Finish_Element, x, y); break; + default: + break; } } @@ -5733,6 +5678,7 @@ void finish_op(int op, int x, int y) case (EFONTCAT_MODE): fontcat_op(op, x, y); eventmode = (eventmode == FONTCAT_MODE) ? TEXT_MODE : ETEXT_MODE; + text_mode_draw(xcDRAW_INIT, TOLABEL(EDITPART)); XDefineCursor (dpy, areawin->window, TEXTPTR); break; @@ -5751,9 +5697,10 @@ void finish_op(int op, int x, int y) case(TEXT_MODE): curlabel = TOLABEL(EDITPART); - UDrawTLine(curlabel); if (op == XCF_Cancel) { redrawtext(curlabel); + areawin->redraw_needed = False; /* ignore previous requests */ + text_mode_draw(xcDRAW_EMPTY, curlabel); freelabel(curlabel->string); free(curlabel); topobject->parts--; @@ -5763,6 +5710,7 @@ void finish_op(int op, int x, int y) singlebbox(EDITPART); incr_changes(topobject); select_invalidate_netlist(); + text_mode_draw(xcDRAW_FINAL, curlabel); } setdefaultfontmarks(); eventmode = NORMAL_MODE; @@ -5770,14 +5718,15 @@ void finish_op(int op, int x, int y) case(ETEXT_MODE): case(CATTEXT_MODE): curlabel = TOLABEL(EDITPART); - UDrawTLine(curlabel); if (op == XCF_Cancel) { /* restore the original text */ undrawtext(curlabel); undo_finish_series(); undo_action(); - if (eventmode == CATTEXT_MODE) eventmode = CATALOG_MODE; redrawtext(curlabel); + areawin->redraw_needed = False; /* ignore previous requests */ + text_mode_draw(xcDRAW_EMPTY, curlabel); + if (eventmode == CATTEXT_MODE) eventmode = CATALOG_MODE; W3printf(""); setdefaultfontmarks(); } @@ -5840,7 +5789,7 @@ void finish_op(int op, int x, int y) else { if (areawin->selects > 0) { register_for_undo(XCF_Move, - // (was_preselected) ? UNDO_DONE : UNDO_MORE, + /* (was_preselected) ? UNDO_DONE : UNDO_MORE, */ UNDO_MORE, areawin->topinstance, (int)(areawin->save.x - areawin->origin.x), @@ -5848,13 +5797,13 @@ void finish_op(int op, int x, int y) pwriteback(areawin->topinstance); incr_changes(topobject); select_invalidate_netlist(); - unselect_all(); // The way it used to be. . . + unselect_all(); /* The way it used to be. . . */ } W3printf(""); /* full calc needed: move may shrink bbox */ calcbbox(areawin->topinstance); checkoverlap(); - // if (!was_preselected) clearselects(); + /* if (!was_preselected) clearselects(); */ } areawin->attachto = -1; break; @@ -5869,15 +5818,20 @@ void finish_op(int op, int x, int y) ButtonMotionMask, FALSE, (xcEventHandler)xlib_drag, NULL); #endif + rescale_mode_draw(xcDRAW_FINAL, NULL); if (op != XCF_Cancel) { - fscale = UDrawRescaleBox(&areawin->save); - if (fscale != 0.0) elementrescale(fscale); + XPoint newpoints[5]; + fscale = UGetRescaleBox(&areawin->save, newpoints); + if (fscale != 0.) { + elementrescale(fscale); + areawin->redraw_needed = True; + } } eventmode = NORMAL_MODE; break; case(SELAREA_MODE): - UDrawBox(areawin->origin, areawin->save); + selarea_mode_draw(xcDRAW_FINAL, NULL); #ifdef TCL_WRAPPER Tk_DeleteEventHandler(areawin->area, ButtonMotionMask | @@ -5915,16 +5869,22 @@ void finish_op(int op, int x, int y) ButtonMotionMask, False, (xcEventHandler)xlib_drag, NULL); #endif + areawin->panx = areawin->pany = 0; if (op != XCF_Cancel) panbutton((u_int) 5, (areawin->width >> 1) - (x - areawin->origin.x), (areawin->height >> 1) - (y - areawin->origin.y), 0); break; + default: + break; } /* Remove any selections */ if ((eventmode == SELAREA_MODE) || (eventmode == PAN_MODE) || (eventmode == MOVE_MODE)) + { eventmode = NORMAL_MODE; + areawin->redraw_needed = True; + } else if (eventmode != MOVE_MODE && eventmode != EPATH_MODE && eventmode != EPOLY_MODE && eventmode != ARC_MODE && eventmode != EARC_MODE && eventmode != SPLINE_MODE && @@ -5939,10 +5899,6 @@ void finish_op(int op, int x, int y) highlightnetlist(topobject, areawin->topinstance, 0); XDefineCursor(dpy, areawin->window, DEFAULTCURSOR); - -#ifdef DOUBLEBUFFER - drawarea(NULL, NULL, NULL); -#endif } snap(x, y, &snappt); @@ -5958,6 +5914,7 @@ void finish_op(int op, int x, int y) void inst_op(genericptr editpart, int op, int x, int y) { + UNUSED(editpart); UNUSED(op); UNUSED(x); UNUSED(y); } /*--------------------------------------------------------------*/ @@ -5968,9 +5925,8 @@ void path_op(genericptr editpart, int op, int x, int y) { polyptr newpoly; splineptr newspline; - genericptr *ggen; Boolean donecycles = False; - XPoint *refpt, *cptr; + UNUSED(x); UNUSED(y); /* Don't allow point cycling in a multi-part edit. */ /* Allowing it is just confusing. Instead, we treat */ @@ -5988,16 +5944,13 @@ void path_op(genericptr editpart, int op, int x, int y) if (op != XCF_Continue_Element) { dotrack = False; - UDrawPath(newpath, xobjs.pagelist[areawin->page]->wirewidth); } if (op == XCF_Continue_Element) { nextpathcycle(newpath, 1); patheditpush(newpath); } else if (op == XCF_Finish_Element) { - SetFunction(dpy, areawin->gc, GXcopy); - XTopSetForeground(newpath->color); - UDrawPath(newpath, xobjs.pagelist[areawin->page]->wirewidth); + path_mode_draw(xcDRAW_FINAL, newpath); incr_changes(topobject); } else { /* restore previous path from edit stack */ @@ -6019,18 +5972,17 @@ void path_op(genericptr editpart, int op, int x, int y) if (areawin->editstack->parts > 0) { dotrack = True; nextpathcycle(newpath, 1); + path_mode_draw(xcDRAW_EDIT, newpath); } else { XPoint warppt; - - XcSetFunction(GXcopy); - XcTopSetForeground(newpath->color); user_to_window(areawin->origin, &warppt); warppointer(warppt.x, warppt.y); + path_mode_draw(xcDRAW_FINAL, newpath); } - UDrawPath(newpath, xobjs.pagelist[areawin->page]->wirewidth); } else { + path_mode_draw(xcDRAW_EMPTY, newpath); topobject->parts--; free_single((genericptr)newpath); free(newpath); @@ -6053,27 +6005,27 @@ void path_op(genericptr editpart, int op, int x, int y) polyptr newbox; newbox = (polyptr)editpart; - UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth); /* prevent length and/or width zero boxes */ if (newbox->points->x != (newbox->points + 2)->x && (newbox->points + 1)->y != (newbox->points + 3)->y) { if (op != XCF_Cancel) { - SetFunction(dpy, areawin->gc, GXcopy); - XTopSetForeground(newbox->color); - UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth); + poly_mode_draw(xcDRAW_FINAL, newbox); incr_changes(topobject); if (!nonnetwork(newbox)) invalidate_netlist(topobject); register_for_undo(XCF_Box, UNDO_MORE, areawin->topinstance, newbox); } else { + poly_mode_draw(xcDRAW_EMPTY, newbox); free_single((genericptr)newbox); free(newbox); topobject->parts--; + } } else { + poly_mode_draw(xcDRAW_EMPTY, newbox); free_single((genericptr)newbox); free(newbox); topobject->parts--; @@ -6092,7 +6044,6 @@ void path_op(genericptr editpart, int op, int x, int y) if (op != XCF_Continue_Element) { dotrack = False; - UDrawPolygon(newpoly, xobjs.pagelist[areawin->page]->wirewidth); } if (op == XCF_Continue_Element) { @@ -6108,15 +6059,14 @@ void path_op(genericptr editpart, int op, int x, int y) (newpoly->points[i].y != newpoly->points[i - 1].y)) break; if (i == newpoly->number) { + poly_mode_draw(xcDRAW_EMPTY, newpoly); /* Remove this polygon with the standard delete */ /* method (saves polygon on undo stack). */ newpoly->type |= REMOVE_TAG; delete_tagged(areawin->topinstance); } else { - SetFunction(dpy, areawin->gc, GXcopy); - XTopSetForeground(newpoly->color); - UDrawPolygon(newpoly, xobjs.pagelist[areawin->page]->wirewidth); + poly_mode_draw(xcDRAW_FINAL, newpoly); if (!nonnetwork(newpoly)) invalidate_netlist(topobject); incr_changes(topobject); } @@ -6141,16 +6091,17 @@ void path_op(genericptr editpart, int op, int x, int y) if (areawin->editstack->parts > 0) { dotrack = True; nextpolycycle(&newpoly, -1); + poly_mode_draw(xcDRAW_EDIT, newpoly); } else { - XcSetFunction(GXcopy); XcTopSetForeground(newpoly->color); user_to_window(areawin->origin, &warppt); warppointer(warppt.x, warppt.y); + poly_mode_draw(xcDRAW_FINAL, newpoly); } - UDrawPolygon(newpoly, xobjs.pagelist[areawin->page]->wirewidth); } else { + poly_mode_draw(xcDRAW_EMPTY, newpoly); topobject->parts--; free(newpoly); } @@ -6177,8 +6128,6 @@ void path_op(genericptr editpart, int op, int x, int y) if (op != XCF_Continue_Element) { dotrack = False; - UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth); - UDrawXLine(areawin->save, newarc->position); } if (op == XCF_Continue_Element) { @@ -6191,15 +6140,13 @@ void path_op(genericptr editpart, int op, int x, int y) if (newarc->radius != 0 && newarc->yaxis != 0 && (newarc->angle1 != newarc->angle2)) { - SetFunction(dpy, areawin->gc, GXcopy); XTopSetForeground(newarc->color); incr_changes(topobject); if (eventmode == ARC_MODE) { register_for_undo(XCF_Arc, UNDO_MORE, areawin->topinstance, newarc); } - UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth); - + arc_mode_draw(xcDRAW_FINAL, newarc); } else { @@ -6208,6 +6155,7 @@ void path_op(genericptr editpart, int op, int x, int y) /* never existed. If we were editing an arc, use the */ /* standard delete method (saves arc on undo stack). */ + arc_mode_draw(xcDRAW_EMPTY, newarc); if (eventmode == ARC_MODE) { free_single((genericptr)newarc); free(newarc); @@ -6240,21 +6188,21 @@ void path_op(genericptr editpart, int op, int x, int y) if (areawin->editstack->parts > 0) { dotrack = True; nextarccycle(&newarc, -1); - UDrawXLine(areawin->save, newarc->position); + arc_mode_draw(xcDRAW_EDIT, newarc); } else { - SetFunction(dpy, areawin->gc, GXcopy); - XTopSetForeground(newarc->color); if (eventmode != ARC_MODE) { XPoint warppt; user_to_window(areawin->origin, &warppt); warppointer(warppt.x, warppt.y); } + arc_mode_draw(xcDRAW_FINAL, newarc); } - UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth); } - else + else { + arc_mode_draw(xcDRAW_EMPTY, newarc); topobject->parts--; + } } pwriteback(areawin->topinstance); @@ -6275,7 +6223,6 @@ void path_op(genericptr editpart, int op, int x, int y) newspline = (splineptr)editpart; if (op != XCF_Continue_Element) { - UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth); dotrack = False; } @@ -6298,14 +6245,12 @@ void path_op(genericptr editpart, int op, int x, int y) newspline->ctrl[0].y != newspline->ctrl[1].y || newspline->ctrl[0].y != newspline->ctrl[2].y) { if (op == XCF_Finish_Element) { - SetFunction(dpy, areawin->gc, GXcopy); - XTopSetForeground(newspline->color); incr_changes(topobject); if (eventmode == SPLINE_MODE) { register_for_undo(XCF_Spline, UNDO_MORE, areawin->topinstance, newspline); } - UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth); + spline_mode_draw(xcDRAW_FINAL, newspline); } else { /* restore previous spline from edit stack */ free_single((genericptr)newspline); @@ -6326,24 +6271,25 @@ void path_op(genericptr editpart, int op, int x, int y) if (areawin->editstack->parts > 0) { dotrack = True; nextsplinecycle(&newspline, 1); - UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth); + spline_mode_draw(xcDRAW_EDIT, newspline); } else { - SetFunction(dpy, areawin->gc, GXcopy); - XTopSetForeground(newspline->color); if (eventmode != SPLINE_MODE) { XPoint warppt; user_to_window(areawin->origin, &warppt); warppointer(warppt.x, warppt.y); } - UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth); + spline_mode_draw(xcDRAW_FINAL, newspline); } } - else + else { + spline_mode_draw(xcDRAW_EMPTY, newspline); topobject->parts--; + } } } else { + spline_mode_draw(xcDRAW_EMPTY, newspline); free_single((genericptr)newspline); free(newspline); topobject->parts--; @@ -6369,17 +6315,11 @@ void path_op(genericptr editpart, int op, int x, int y) /* then register the move for the remaining items. */ if (donecycles) { - short *eselect, cycle, *sellist, *newsel, selects; - Boolean fullmove = False; + short *eselect; for (eselect = areawin->selectlist; eselect < areawin->selectlist + - areawin->selects; eselect++) { - cycle = checkcycle(SELTOGENERIC(eselect), 0); - if (cycle < 0) { - fullmove = True; /* At least 1 object moved */ - break; - } - } + areawin->selects; eselect++) + checkcycle(SELTOGENERIC(eselect), 0); /* Remove all (remaining) cycles */ for (eselect = areawin->selectlist; eselect < areawin->selectlist + @@ -6408,7 +6348,10 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata) XEvent discard; int savewidth = areawin->width, saveheight = areawin->height; XCWindowData *thiswin; +#ifndef HAVE_CAIRO XGCValues values; +#endif /* !HAVE_CAIRO */ + UNUSED(w); UNUSED(clientdata); UNUSED(calldata); if ((dpy != NULL) && xcIsRealized(areawin->area)) { @@ -6428,11 +6371,19 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata) if (thiswin->width > maxwidth) maxwidth = thiswin->width; if (thiswin->height > maxheight) maxheight = thiswin->height; } -#ifdef DOUBLEBUFFER +#if !defined(HAVE_CAIRO) if (dbuf != (Pixmap)NULL) XFreePixmap(dpy, dbuf); dbuf = XCreatePixmap(dpy, areawin->window, maxwidth, maxheight, DefaultDepthOfScreen(xcScreen(w))); #endif +#ifdef HAVE_CAIRO + /* TODO: probably make this a generalized function call, which */ + /* should be handled depending on the surface in the xtgui.c, */ + /* xcwin32.c, etc. files. */ + /* For now only support xlib surface */ + cairo_xlib_surface_set_size(areawin->surface, areawin->width, + areawin->height); +#else if (areawin->clipmask != (Pixmap)NULL) XFreePixmap(dpy, areawin->clipmask); areawin->clipmask = XCreatePixmap(dpy, areawin->window, maxwidth, maxheight, 1); @@ -6448,6 +6399,18 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata) values.background = 0; areawin->cmgc = XCreateGC(dpy, areawin->clipmask, GCForeground | GCBackground, &values); +#endif /* !HAVE_CAIRO */ + + /* Clear fixed_pixmap */ + if (areawin->fixed_pixmap) { +#ifdef HAVE_CAIRO + cairo_pattern_destroy(areawin->fixed_pixmap); + areawin->fixed_pixmap = NULL; +#else /* !HAVE_CAIRO */ + XFreePixmap(dpy, areawin->fixed_pixmap); + areawin->fixed_pixmap = (Pixmap) NULL; +#endif /* !HAVE_CAIRO */ + } reset_gs(); @@ -6460,83 +6423,160 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata) } /* Flush all expose events from the buffer */ - while (XCheckWindowEvent(dpy, areawin->window, ExposureMask, &discard) == True); } } -/*--------------------------------------*/ -/* Draw the primary graphics window */ -/*--------------------------------------*/ +/*----------------------*/ +/* Draw the grids, etc. */ +/*----------------------*/ -void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata) +#ifndef HAVE_CAIRO +void draw_grids(void) { - Window win, tmpwin; float x, y, spc, spc2, i, j, fpart; - /*short *selectobj; (jdk) */ - XPoint originpt; - XEvent discard; -#ifdef OPENGL - GLsizei width, height; + float major_snapspace, spc3; + + spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale; + if (areawin->gridon && spc > 8) { + fpart = (float)(-areawin->pcorner.x) + / xobjs.pagelist[areawin->page]->gridspace; + x = xobjs.pagelist[areawin->page]->gridspace * + (fpart - (float)((int)fpart)) * areawin->vscale; + fpart = (float)(-areawin->pcorner.y) + / xobjs.pagelist[areawin->page]->gridspace; + y = xobjs.pagelist[areawin->page]->gridspace * + (fpart - (float)((int)fpart)) * areawin->vscale; + + SetForeground(dpy, areawin->gc, GRIDCOLOR); + for (i = x; i < (float)areawin->width; i += spc) + DrawLine (dpy, areawin->window, areawin->gc, (int)(i + 0.5), + 0, (int)(i + 0.5), areawin->height); + for (j = (float)areawin->height - y; j > 0; j -= spc) + DrawLine (dpy, areawin->window, areawin->gc, 0, (int)(j - 0.5), + areawin->width, (int)(j - 0.5)); + } + + if (areawin->axeson) { + XPoint originpt, zeropt; + zeropt.x = zeropt.y = 0; + SetForeground(dpy, areawin->gc, AXESCOLOR); + user_to_window(zeropt, &originpt); + DrawLine(dpy, areawin->window, areawin->gc, originpt.x, 0, + originpt.x, areawin->height); + DrawLine(dpy, areawin->window, areawin->gc, 0, originpt.y, + areawin->width, originpt.y); + } + + /* bounding box goes beneath everything except grid/axis lines */ + UDrawBBox(); + + /* draw a little red dot at each snap-to point */ + + spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale; + if (areawin->snapto && spc2 > 8) { + float x2, y2; + + fpart = (float)(-areawin->pcorner.x) + / xobjs.pagelist[areawin->page]->snapspace; + x2 = xobjs.pagelist[areawin->page]->snapspace * + (fpart - (float)((int)fpart)) * areawin->vscale; + fpart = (float)(-areawin->pcorner.y) + / xobjs.pagelist[areawin->page]->snapspace; + y2 = xobjs.pagelist[areawin->page]->snapspace * + (fpart - (float)((int)fpart)) * areawin->vscale; + +#if defined(TCL_WRAPPER) && defined(XC_WIN32) + { + HDC hdc = CreateCompatibleDC(NULL); + SelectObject(hdc, Tk_GetHWND(areawin->window)); #endif + SetForeground(dpy, areawin->gc, SNAPCOLOR); + for (i = x2; i < areawin->width; i += spc2) + for (j = areawin->height - y2; j > 0; j -= spc2) +#if defined(TCL_WRAPPER) && defined(XC_WIN32) + SetPixelV(hdc, (int)(i + 0.5), (int)(j - 0.05), areawin->gc->foreground); +#endif + DrawPoint (dpy, areawin->window, areawin->gc, (int)(i + 0.5), + (int)(j - 0.5)); +#if defined(TCL_WRAPPER) && defined(XC_WIN32) + DeleteDC(hdc); + } +#endif + }; + + /* Draw major snap points (code contributed by John Barry) */ + + major_snapspace = xobjs.pagelist[areawin->page]->gridspace * 20; + spc3 = major_snapspace * areawin->vscale; + if (spc > 4) { + fpart = (float)(-areawin->pcorner.x) / major_snapspace; + x = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale; + fpart = (float)(-areawin->pcorner.y) / major_snapspace; + y = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale; + + SetForeground(dpy, areawin->gc, GRIDCOLOR); + for (i = x; i < (float)areawin->width; i += spc3) { + for (j = (float)areawin->height - y; j > 0; j -= spc3) { + XDrawArc(dpy, areawin->window, areawin->gc, (int)(i + 0.5) - 1, + (int)(j - 0.5) - 1, 2, 2, 0, 360*64); + } + } + } - if (!xcIsRealized(areawin->area)) return; - - newmatrix(); - -#ifdef OPENGL - glXMakeCurrent(dpy, (GLXDrawable)areawin->window, grXcontext); - glDrawBuffer(GL_BACK); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - width = (GLsizei)Tk_Width(areawin->area); - height = (GLsizei)Tk_Height(areawin->area); - - glViewport((GLsizei)0, (GLsizei)0, width, height); - - /* Need to twiddle with these? */ - glScalef(1.0 / (float)(width >> 1), -1.0 / (float)(height >> 1), 1.0); - glTranslated(-(width >> 1), -(height >> 1), 0); - - glClearColor(1.0, 1.0, 1.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - glEnable(GL_BLEND); - glEnable(GL_POINT_SMOOTH); - glEnable(GL_LINE_SMOOTH); - glEnable(GL_POLYGON_SMOOTH); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - XcSetFunction(GXcopy); + SetBackground(dpy, areawin->gc, BACKGROUND); +} +#endif /* !HAVE_CAIRO */ -#else +/*------------------------------------------------------*/ +/* Draw fixed parts of the primary graphics window */ +/*------------------------------------------------------*/ - XcSetFunction(GXcopy); +void draw_fixed(void) +{ + Boolean old_ongoing; +#ifndef HAVE_CAIRO + Window old_window; +#endif /* !HAVE_CAIRO */ -#ifdef DOUBLEBUFFER - tmpwin = areawin->window; - win = (Window)dbuf; - areawin->window = win; + if (xobjs.suspend >= 0) return; + old_ongoing = areawin->redraw_ongoing; + areawin->redraw_ongoing = True; + + /* Set drawing context to fixed_pixmap */ +#ifdef HAVE_CAIRO + cairo_identity_matrix(areawin->cr); + cairo_push_group(areawin->cr); +#else /* HAVE_CAIRO */ + old_window = areawin->window; + areawin->window = areawin->fixed_pixmap; +#endif /* HAVE_CAIRO */ + + /* Clear background */ +#ifdef HAVE_CAIRO + if (xobjs.pagelist[areawin->page]->background.name != (char *)NULL) { +#ifdef HAVE_GS + copybackground(); +#else /* HAVE_GS */ + SetForeground(dpy, areawin->gc, BACKGROUND); + cairo_paint(areawin->cr); +#endif /* HAVE_GS */ + } + else { + SetForeground(dpy, areawin->gc, BACKGROUND); + cairo_paint(areawin->cr); + } +#else /* HAVE_CAIRO */ if (xobjs.pagelist[areawin->page]->background.name == (char *)NULL || (copybackground() < 0)) { - XSetForeground(dpy, areawin->gc, BACKGROUND); - XFillRectangle(dpy, win, areawin->gc, 0, 0, areawin->width, + SetForeground(dpy, areawin->gc, BACKGROUND); + XFillRectangle(dpy, areawin->window, areawin->gc, 0, 0, areawin->width, areawin->height); } -#else - - if (xobjs.pagelist[areawin->page]->background.name != (char *)NULL) - copybackground(); - else - XClearWindow(dpy, areawin->window); -#endif - -#endif /* OPENGL */ - - win = areawin->window; - SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel); +#endif /* !HAVE_CAIRO */ + + newmatrix(); /* draw GRIDCOLOR lines for grid; mark axes in AXESCOLOR */ @@ -6544,95 +6584,7 @@ void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata) && eventmode != FONTCAT_MODE && eventmode != EFONTCAT_MODE && eventmode != CATMOVE_MODE && eventmode != CATTEXT_MODE) { - float major_snapspace, spc3; - - spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale; - if (areawin->gridon && spc > 8) { - fpart = (float)(-areawin->pcorner.x) - / xobjs.pagelist[areawin->page]->gridspace; - x = xobjs.pagelist[areawin->page]->gridspace * - (fpart - (float)((int)fpart)) * areawin->vscale; - fpart = (float)(-areawin->pcorner.y) - / xobjs.pagelist[areawin->page]->gridspace; - y = xobjs.pagelist[areawin->page]->gridspace * - (fpart - (float)((int)fpart)) * areawin->vscale; - - SetForeground(dpy, areawin->gc, GRIDCOLOR); - for (i = x; i < (float)areawin->width; i += spc) - DrawLine (dpy, win, areawin->gc, (int)(i + 0.5), - 0, (int)(i + 0.5), areawin->height); - for (j = (float)areawin->height - y; j > 0; j -= spc) - DrawLine (dpy, win, areawin->gc, 0, (int)(j - 0.5), - areawin->width, (int)(j - 0.5)); - }; - if (areawin->axeson) { - XPoint zeropt; - zeropt.x = zeropt.y = 0; - SetForeground(dpy, areawin->gc, AXESCOLOR); - user_to_window(zeropt, &originpt); - DrawLine (dpy, win, areawin->gc, originpt.x, 0, - originpt.x, areawin->height); - DrawLine (dpy, win, areawin->gc, 0, originpt.y, - areawin->width, originpt.y); - } - - /* bounding box goes beneath everything except grid/axis lines */ - UDrawBBox(); - - /* draw a little red dot at each snap-to point */ - - spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale; - if (areawin->snapto && spc2 > 8) { - float x2, y2; - - fpart = (float)(-areawin->pcorner.x) - / xobjs.pagelist[areawin->page]->snapspace; - x2 = xobjs.pagelist[areawin->page]->snapspace * - (fpart - (float)((int)fpart)) * areawin->vscale; - fpart = (float)(-areawin->pcorner.y) - / xobjs.pagelist[areawin->page]->snapspace; - y2 = xobjs.pagelist[areawin->page]->snapspace * - (fpart - (float)((int)fpart)) * areawin->vscale; - -#if defined(TCL_WRAPPER) && defined(XC_WIN32) && defined(DOUBLEBUFFER) - { - HDC hdc = CreateCompatibleDC(NULL); - SelectObject(hdc, Tk_GetHWND(win)); -#endif - SetForeground(dpy, areawin->gc, SNAPCOLOR); - for (i = x2; i < areawin->width; i += spc2) - for (j = areawin->height - y2; j > 0; j -= spc2) -#if defined(TCL_WRAPPER) && defined(XC_WIN32) && defined(DOUBLEBUFFER) - SetPixelV(hdc, (int)(i + 0.5), (int)(j - 0.05), areawin->gc->foreground); -#endif - DrawPoint (dpy, win, areawin->gc, (int)(i + 0.5), - (int)(j - 0.5)); -#if defined(TCL_WRAPPER) && defined(XC_WIN32) && defined(DOUBLEBUFFER) - DeleteDC(hdc); - } -#endif - }; - - /* Draw major snap points (code contributed by John Barry) */ - - major_snapspace = xobjs.pagelist[areawin->page]->gridspace * 20; - spc3 = major_snapspace * areawin->vscale; - if (spc > 4) { - fpart = (float)(-areawin->pcorner.x) / major_snapspace; - x = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale; - fpart = (float)(-areawin->pcorner.y) / major_snapspace; - y = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale; - - SetForeground(dpy, areawin->gc, GRIDCOLOR); - for (i = x; i < (float)areawin->width; i += spc3) { - for (j = (float)areawin->height - y; j > 0; j -= spc3) { - XDrawArc(dpy, win, areawin->gc, (int)(i + 0.5) - 1, - (int)(j - 0.5) - 1, 2, 2, 0, 360*64); - } - } - } - - SetBackground(dpy, areawin->gc, BACKGROUND); + draw_grids(); /* Determine the transformation matrix for the topmost object */ /* and draw the hierarchy above the current edit object (if */ @@ -6699,10 +6651,37 @@ void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata) xobjs.pagelist[areawin->page]->wirewidth, &areawin->hierstack); if (areawin->hierstack) free_stack(&areawin->hierstack); - /* draw the highlighted netlist, if any */ - if (checkvalid(topobject) != -1) - if (topobject->highlight.netlist != NULL) - highlightnetlist(topobject, areawin->topinstance, 1); +#ifdef HAVE_CAIRO + if (areawin->fixed_pixmap) + cairo_pattern_destroy(areawin->fixed_pixmap); + areawin->fixed_pixmap = cairo_pop_group(areawin->cr); +#else /* HAVE_CAIRO */ + areawin->window = old_window; +#endif /* HAVE_CAIRO */ + areawin->redraw_ongoing = old_ongoing; +} + +/*--------------------------------------*/ +/* Draw the primary graphics window */ +/*--------------------------------------*/ + +void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata) +{ + XEvent discard; + xcDrawType redrawtype = xcDRAW_EDIT; + UNUSED(w); UNUSED(clientdata); UNUSED(calldata); + + if (!xcIsRealized(areawin->area)) return; + if (xobjs.suspend >= 0) return; + +#ifndef HAVE_CAIRO + /* Make sure a fixed pixmap exists */ + if (!areawin->fixed_pixmap) { + areawin->fixed_pixmap = XCreatePixmap(dpy, areawin->window, + areawin->width, areawin->height, + DefaultDepthOfScreen(xcScreen(areawin->area))); + } +#endif /* !HAVE_CAIRO */ /* Sanity check---specifically to track down an error */ if ((areawin->selects == 1) && *(areawin->selectlist) >= topobject->parts) { @@ -6711,88 +6690,46 @@ void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata) unselect_all(); } - /* draw selected elements in the SELECTION color */ - /* special case---single label partial text selected */ - - if ((areawin->selects == 1) && SELECTTYPE(areawin->selectlist) == LABEL - && areawin->textend > 0 && areawin->textpos > areawin->textend) { - labelptr drawlabel = SELTOLABEL(areawin->selectlist); - UDrawString(drawlabel, DOSUBSTRING, areawin->topinstance); - } - else { - if (eventmode == NORMAL_MODE || eventmode == MOVE_MODE || eventmode == COPY_MODE - || eventmode == SELAREA_MODE || eventmode == CATALOG_MODE) - draw_all_selected(); - } + if (areawin->redraw_needed) + redrawtype = xcREDRAW_FORCED; - /* fast copy of buffer */ - -#ifdef OPENGL - glXSwapBuffers(dpy, (GLXDrawable)areawin->window); - - /* Draw interactive elements into the front buffer */ - glDrawBuffer(GL_FRONT); - -#else -#ifdef DOUBLEBUFFER - areawin->window = tmpwin; - SetFunction(dpy, areawin->gc, GXcopy); - XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0, areawin->width, - areawin->height, 0, 0); -#endif -#endif /* OPENGL */ - - /* draw pending elements, if any */ - - if (eventmode != NORMAL_MODE) { - SetFunction(dpy, areawin->gc, GXcopy); - if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE || - eventmode == CATTEXT_MODE) { - labelptr newlabel = TOLABEL(EDITPART); - UDrawTLine(newlabel); - } - else if (eventmode == SELAREA_MODE) { - UDrawBox(areawin->origin, areawin->save); - } - else if (eventmode == RESCALE_MODE) { - UDrawRescaleBox(&areawin->save); - } - else if (eventmode == BOX_MODE || eventmode == WIRE_MODE) { - SetForeground(dpy, areawin->gc, BACKGROUND); - UDrawPolygon(TOPOLY(ENDPART), xobjs.pagelist[areawin->page]->wirewidth); - XcSetXORFg(areawin->color, BACKGROUND); - XcSetFunction(GXxor); - UDrawPolygon(TOPOLY(ENDPART), xobjs.pagelist[areawin->page]->wirewidth); - } - else if (eventmode == ARC_MODE) { - SetForeground(dpy, areawin->gc, BACKGROUND); - UDrawArc(TOARC(ENDPART), xobjs.pagelist[areawin->page]->wirewidth); - XcSetXORFg(areawin->color, BACKGROUND); - XcSetFunction(GXxor); - UDrawArc(TOARC(ENDPART), xobjs.pagelist[areawin->page]->wirewidth); - } - else if (eventmode == SPLINE_MODE) { - SetForeground(dpy, areawin->gc, BACKGROUND); - UDrawSpline(TOSPLINE(ENDPART), xobjs.pagelist[areawin->page]->wirewidth); - XcSetXORFg(areawin->color, BACKGROUND); - XcSetFunction(GXxor); - UDrawSpline(TOSPLINE(ENDPART), xobjs.pagelist[areawin->page]->wirewidth); - } - else if (eventmode == EPOLY_MODE || eventmode == EARC_MODE || - eventmode == ESPLINE_MODE || eventmode == EPATH_MODE) { - XcSetXORFg(areawin->color, BACKGROUND); - XcSetFunction(GXxor); - } + switch (eventmode) { + case ARC_MODE: case EARC_MODE: + arc_mode_draw(redrawtype, TOARC(EDITPART)); + break; + case SPLINE_MODE: case ESPLINE_MODE: + spline_mode_draw(redrawtype, TOSPLINE(EDITPART)); + break; + case BOX_MODE: case EPOLY_MODE: case WIRE_MODE: + poly_mode_draw(redrawtype, TOPOLY(EDITPART)); + break; + case EPATH_MODE: + path_mode_draw(redrawtype, TOPATH(EDITPART)); + break; + case TEXT_MODE: case CATTEXT_MODE: case ETEXT_MODE: + text_mode_draw(redrawtype, TOLABEL(EDITPART)); + break; + case SELAREA_MODE: + selarea_mode_draw(redrawtype, NULL); + break; + case RESCALE_MODE: + rescale_mode_draw(redrawtype, NULL); + break; + case CATMOVE_MODE: case MOVE_MODE: case COPY_MODE: + move_mode_draw(redrawtype, NULL); + break; + case ASSOC_MODE: case EINST_MODE: case FONTCAT_MODE: case EFONTCAT_MODE: + case PAN_MODE: case NORMAL_MODE: case UNDO_MODE: case CATALOG_MODE: + normal_mode_draw(redrawtype, NULL); } /* flush out multiple expose/resize events from the event queue */ - - while (XCheckWindowEvent(dpy, areawin->window, ExposureMask, &discard) == True); + while (XCheckWindowEvent(dpy, areawin->window, ExposureMask, &discard)); /* end by restoring graphics state */ - SetForeground(dpy, areawin->gc, areawin->gccolor); - SetFunction(dpy, areawin->gc, areawin->gctype); + + areawin->redraw_needed = False; } /*----------------------------------------------------------------------*/ @@ -6818,7 +6755,13 @@ void drawarea(xcWidget w, caddr_t clientdata, caddr_t calldata) /* Note: need to check ancestry here, not just blindly redraw */ /* all the windows all the time. */ areawin = thiswin; - drawwindow(NULL, NULL, NULL); + +#ifdef HAVE_CAIRO + /* Don't respond to an expose event if the graphics context */ + /* has not yet been created. */ + if (areawin->cr != NULL) +#endif + drawwindow(NULL, NULL, NULL); } areawin = focuswin; drawwindow(w, clientdata, calldata); diff --git a/filelist.c b/filelist.c index 62fd93c..1271f6f 100644 --- a/filelist.c +++ b/filelist.c @@ -76,7 +76,7 @@ extern Tcl_Interp *xcinterp; extern Display *dpy; extern XCWindowData *areawin; extern ApplicationData appdata; -extern int *appcolors; +extern colorindex *colorlist; extern short popups; /* total number of popup windows */ extern char _STR2[250]; extern char _STR[150]; @@ -149,7 +149,7 @@ void startfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event) #endif XSetFunction(dpy, areawin->gc, GXcopy); - XSetForeground(dpy, areawin->gc, AUXCOLOR); + XSetForeground(dpy, areawin->gc, colorlist[AUXCOLOR].color.pixel); XSetLineAttributes(dpy, areawin->gc, 1, LineSolid, CapRound, JoinMiter); /* draw initial box */ @@ -158,7 +158,8 @@ void startfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event) dragfilebox(w, NULL, (XMotionEvent *)event); XSetFunction(dpy, areawin->gc, GXxor); - XSetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND); + XSetForeground(dpy, areawin->gc, colorlist[AUXCOLOR].color.pixel ^ + colorlist[BACKGROUND].color.pixel); } /*-------------------------------------------------------------------------*/ @@ -182,8 +183,8 @@ void endfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event) #endif /* Restore graphics state values */ - XSetForeground(dpy, areawin->gc, areawin->gccolor); - XSetFunction(dpy, areawin->gc, areawin->gctype); + XSetForeground(dpy, areawin->gc, colorlist[areawin->gccolor].color.pixel); + XSetFunction(dpy, areawin->gc, GXcopy); } #endif @@ -232,10 +233,15 @@ void crashrecover() if (xobjs.tempfile != NULL) { unlink(xobjs.tempfile); free(xobjs.tempfile); + xobjs.tempfile = NULL; + } + if (strlen(_STR2) == 0) { + Wprintf("Error: No temp file name for crash recovery!"); + } + else { + xobjs.tempfile = strdup(_STR2); + startloadfile(-1); } - xobjs.tempfile = strdup(_STR2); - - startloadfile(-1); } /*----------------------------------------------------------------------*/ @@ -378,7 +384,7 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata) filter = okaystruct->filter; if (sgc == NULL) { - values.foreground = FOREGROUND; + values.foreground = colorlist[FOREGROUND].color.pixel; values.font = appdata.filefont->fid; values.function = GXcopy; values.graphics_exposures = False; @@ -417,9 +423,9 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata) /* print "Invalid Directory" to the file list window. */ if (cwd == NULL) { - XSetForeground(dpy, sgc, BACKGROUND); + XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel); XFillRectangle(dpy, lwin, sgc, 0, 0, textwidth, textheight); - XSetForeground(dpy, sgc, AUXCOLOR); + XSetForeground(dpy, sgc, colorlist[AUXCOLOR].color.pixel); XDrawString(dpy, lwin, sgc, 10, textheight / 2, "(Invalid Directory)", 19); return; @@ -476,19 +482,19 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata) /* Write the filenames onto the pixmap */ - XSetForeground(dpy, sgc, BACKGROUND); + XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel); XFillRectangle(dpy, flistpix, sgc, 0, 0, textwidth, pixheight); - XSetForeground(dpy, sgc, FOREGROUND); + XSetForeground(dpy, sgc, colorlist[FOREGROUND].color.pixel); for (n = 0; n < flfiles; n++) { switch (files[n].filetype) { case DIRECTORY: - XSetForeground(dpy, sgc, SELECTCOLOR); + XSetForeground(dpy, sgc, colorlist[SELECTCOLOR].color.pixel); break; case MATCH: - XSetForeground(dpy, sgc, FILTERCOLOR); + XSetForeground(dpy, sgc, colorlist[FILTERCOLOR].color.pixel); break; case NONMATCH: - XSetForeground(dpy, sgc, FOREGROUND); + XSetForeground(dpy, sgc, colorlist[FOREGROUND].color.pixel); break; } XDrawString(dpy, flistpix, sgc, 10, 10 + FILECHARASCENT + n * FILECHARHEIGHT, @@ -498,7 +504,7 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata) /* Copy the pixmap of filenames into the file list window */ - XSetForeground(dpy, sgc, BACKGROUND); + XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel); XFillRectangle(dpy, lwin, sgc, 0, 0, textwidth, textheight); XCopyArea(dpy, flistpix, lwin, sgc, 0, flstart * FILECHARHEIGHT, textwidth, textheight, 0, 0); @@ -604,7 +610,7 @@ void fileselect(xcWidget w, popupstruct *okaystruct, XButtonEvent *event) /* highlight the entry. . . */ - XSetForeground(dpy, sgc, AUXCOLOR); + XSetForeground(dpy, sgc, colorlist[AUXCOLOR].color.pixel); XDrawString(dpy, flistpix, sgc, 10, 10 + FILECHARASCENT + filenum * FILECHARHEIGHT, files[filenum].filename, strlen(files[filenum].filename)); XCopyArea(dpy, flistpix, lwin, sgc, 0, flstart * FILECHARHEIGHT, @@ -709,7 +715,7 @@ void showlscroll(xcWidget w, caddr_t clientdata, caddr_t calldata) pstart = (flstart * sheight) / flfiles; pheight = (finscr * sheight) / flfiles; - XSetForeground(dpy, sgc, BARCOLOR); + XSetForeground(dpy, sgc, colorlist[BARCOLOR].color.pixel); XFillRectangle(dpy, swin, sgc, 0, pstart, swidth, pheight); } flcurrent = -1; diff --git a/files.c b/files.c index 900b032..5678ec7 100644 --- a/files.c +++ b/files.c @@ -75,7 +75,6 @@ extern XtAppContext app; extern Display *dpy; extern Window win; extern short beeper; -extern int *appcolors; extern int number_colors; extern colorindex *colorlist; @@ -487,6 +486,7 @@ void initmem(objectptr localdata) localdata->ports = NULL; localdata->calls = NULL; localdata->valid = False; + localdata->infolabels = False; localdata->traversed = False; } @@ -564,7 +564,7 @@ Boolean compare_single(genericptr *compgen, genericptr *gchk) TOLABEL(compgen)->position.y == TOLABEL(gchk)->position.y && TOLABEL(compgen)->rotation == TOLABEL(gchk)->rotation && TOLABEL(compgen)->scale == TOLABEL(gchk)->scale && - TOLABEL(compgen)->justify == TOLABEL(gchk)->justify && + TOLABEL(compgen)->anchor == TOLABEL(gchk)->anchor && TOLABEL(compgen)->pin == TOLABEL(gchk)->pin && !stringcomp(TOLABEL(compgen)->string, TOLABEL(gchk)->string)); break; @@ -825,6 +825,9 @@ void getfile(xcWidget button, pointertype mode, caddr_t nulldata) {crashrecover, "recover", "ps"}, /* mode RECOVER */ #ifdef ASG {importspice, "import", "spice"}, /* mode IMPORTSPICE */ +#endif +#ifdef HAVE_CAIRO + {importgraphic, "import", "ppm"}, /* mode IMPORTGRAPHIC */ #endif }; @@ -1317,7 +1320,7 @@ objinstptr new_library_instance(short mode, char *objname, char *buffer, /* May declare instanced scale and rotation first */ lineptr = varfscan(localdata, lineptr, &newobjinst->scale, (genericptr)newobjinst, P_SCALE); - lineptr = varscan(localdata, lineptr, &newobjinst->rotation, + lineptr = varfscan(localdata, lineptr, &newobjinst->rotation, (genericptr)newobjinst, P_ROTATION); } readparams(NULL, newobjinst, libobj, lineptr); @@ -1887,6 +1890,36 @@ void importfile() loadfile(1, -1); } +/*------------------------------------------------------*/ +/* Import an PPM graphic file onto the current page */ +/*------------------------------------------------------*/ + +#ifdef HAVE_CAIRO +void importgraphic(void) +{ + char inname[250]; + FILE *spcfile; + + if (eventmode == CATALOG_MODE) { + Wprintf("Cannot import a graphic while in the library window."); + return; + } + + if (!nextfilename()) { + xc_tilde_expand(_STR, 149); + sscanf(_STR, "%149s", inname); + if (!new_graphic(NULL, inname, 0, 0)) { + Wprintf("Error: Graphic file not found."); + return; + } + } + else { + Wprintf("Error: No graphic file to read."); + return; + } +} +#endif /* HAVE_CAIRO */ + /*--------------------------------------------------------------*/ /* Skip forward in the input file to the next comment line */ /*--------------------------------------------------------------*/ @@ -2273,9 +2306,9 @@ Boolean loadfile(short mode, int libnum) #ifndef TCL_WRAPPER setgridtype(teststr2); #else - if (strstr(teststr2, "inch")) + if (strstr(teststr2, "inch")) Tcl_Eval(xcinterp, "xcircuit::coordstyle inches"); - else + else Tcl_Eval(xcinterp, "xcircuit::coordstyle centimeters"); #endif xobjs.pagelist[areawin->page]->outscale = tmpfl; @@ -2669,15 +2702,8 @@ void readlabel(objectptr localdata, char *lineptr, stringpart **strhead) int cval, cindex; sscanf(segptr, "%f %f %f", &cr, &cg, &cb); newpart->type = FONT_COLOR; - cval = rgb_alloccolor((int)(cr * 65535), (int)(cg * 65535), + cindex = rgb_alloccolor((int)(cr * 65535), (int)(cg * 65535), (int)(cb * 65535)); - for (cindex = 0; cindex < number_colors; cindex++) - if (colorlist[cindex].color.pixel == cval) - break; - if (cindex == number_colors) { - Wprintf("Error: Cannot allocate another color"); - cindex = DEFAULTCOLOR; - } newpart->data.color = cindex; } else if (!strcmp(cmdptr, "cf")) { /* change font or scale command */ @@ -2954,7 +2980,6 @@ void readparams(objectptr localdata, objinstptr newinst, objectptr libobj, newops->which = P_COLOR; newops->parameter.ivalue = rgb_alloccolor((int)(r * 65535), (int)(g * 65535), (int)(b * 65535)); - addnewcolorentry(newops->parameter.ivalue); *substrend = csave; } else { @@ -3081,15 +3106,6 @@ char *varpscan(objectptr localdata, char *lineptr, short *hvalue, if (sscanf(lineptr, "%hd", hvalue) != 1) { parse_ps_string(lineptr, key, 99, FALSE, TRUE); - /* This bit of a hack takes care of scale-variant */ - /* linewidth specifiers for object instances. */ - - if (!strncmp(key, "/sv", 3)) { - ((objinstptr)thiselem)->style &= ~LINE_INVARIANT; - return varpscan(localdata, advancetoken(skipwhitespace(lineptr)), - hvalue, thiselem, pointno, offset, which); - } - ops = match_param(localdata, key); newepp = make_new_eparam(key); @@ -3149,6 +3165,16 @@ char *varfscan(objectptr localdata, char *lineptr, float *fvalue, if (sscanf(lineptr, "%f", fvalue) != 1) { parse_ps_string(lineptr, key, 99, FALSE, TRUE); + + /* This bit of a hack takes care of scale-variant */ + /* linewidth specifiers for object instances. */ + + if (!strncmp(key, "/sv", 3)) { + ((objinstptr)thiselem)->style &= ~LINE_INVARIANT; + return varfscan(localdata, advancetoken(skipwhitespace(lineptr)), + fvalue, thiselem, which); + } + ops = match_param(localdata, key); newepp = make_new_eparam(key); @@ -3161,7 +3187,7 @@ char *varfscan(objectptr localdata, char *lineptr, float *fvalue, *fvalue = ops->parameter.fvalue; } else - Fprintf(stderr, "Error: no parameter defined!\n"); + Fprintf(stderr, "Error: no parameter \"%s\" defined!\n", key); } /* advance to next token */ @@ -3596,16 +3622,15 @@ void readimagedata(FILE *ps, int width, int height) flatebuf = filtbuf; - pixel.b[3] = 0; q = 0; - for (y = 0; y < height; y++) { + for (y = 0; y < height; y++) for (x = 0; x < width; x++) { - pixel.b[2] = flatebuf[q++]; - pixel.b[1] = flatebuf[q++]; - pixel.b[0] = flatebuf[q++]; - XPutPixel(iptr->image, x, y, pixel.i); + u_char r, g, b; + r = flatebuf[q++]; + g = flatebuf[q++]; + b = flatebuf[q++]; + xcImagePutPixel(iptr->image, x, y, r, g, b); } - } free(flatebuf); @@ -3696,8 +3721,58 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, } } if (lgen == localdata->plist + localdata->parts) { + char *cptr, *d1ptr, *d2ptr; char *pch = textprint(plab->string, areawin->topinstance); - Fprintf(stderr, "Warning: Unattached pin \"%s\" in " + + /* Check for likely delimiters before applying warning */ + + if ((cptr = strchr(pch, ':')) != NULL) { + d1ptr = strchr(pch, '['); + d2ptr = strchr(pch, ']'); + if (d1ptr != NULL && d2ptr != NULL && + d1ptr < cptr && d2ptr > cptr) { + if (areawin->buschar != '[') { + areawin->buschar = '['; + Fprintf(stderr, "Warning: Bus character \'[\'" + " apparently used but not declared.\n"); + } + } + d1ptr = strchr(pch, '{'); + d2ptr = strchr(pch, '}'); + if (d1ptr != NULL && d2ptr != NULL && + d1ptr < cptr && d2ptr > cptr) { + if (areawin->buschar != '{') { + areawin->buschar = '{'; + Fprintf(stderr, "Warning: Bus character \'{\'" + " apparently used in pin \"%s\"" + " but not declared.\n", pch); + } + } + d1ptr = strchr(pch, '<'); + d2ptr = strchr(pch, '>'); + if (d1ptr != NULL && d2ptr != NULL && + d1ptr < cptr && d2ptr > cptr) { + if (areawin->buschar != '<') { + areawin->buschar = '<'; + Fprintf(stderr, "Warning: Bus character \'<\'" + " apparently used in pin \"%s\"" + " but not declared.\n", pch); + } + } + d1ptr = strchr(pch, '('); + d2ptr = strchr(pch, ')'); + if (d1ptr != NULL && d2ptr != NULL && + d1ptr < cptr && d2ptr > cptr) { + if (areawin->buschar != '(') { + areawin->buschar = '('; + Fprintf(stderr, "Warning: Bus character \'(\'" + " apparently used in pin \"%s\"" + " but not declared.\n", pch); + } + } + } + else + Fprintf(stderr, "Warning: Unattached pin \"%s\" in " "symbol %s\n", pch, localdata->symschem->name); free(pch); @@ -3716,7 +3791,6 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, if (sscanf(buffer, "%f %f %f", &red, &green, &blue) == 3) { curcolor = rgb_alloccolor((int)(red * 65535), (int)(green * 65535), (int)(blue * 65535)); - addnewcolorentry(curcolor); colorkey = NULL; } else { @@ -4285,9 +4359,11 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, NEW_GRAPHIC(newgp, localdata); (*newgp)->color = curcolor; (*newgp)->passed = NULL; +#ifndef HAVE_CAIRO (*newgp)->clipmask = (Pixmap)NULL; (*newgp)->target = NULL; (*newgp)->valid = False; +#endif /* HAVE_CAIRO */ (*newgp)->source = img->image; img->refcount++; lineptr += strlen(img->filename) + 1; @@ -4323,7 +4399,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, if ((newgp != NULL) && (*newgp != NULL)) { lineptr = varfscan(localdata, lineptr, &(*newgp)->scale, (genericptr)*newgp, P_SCALE); - lineptr = varscan(localdata, lineptr, &(*newgp)->rotation, + lineptr = varfscan(localdata, lineptr, &(*newgp)->rotation, (genericptr)*newgp, P_ROTATION); lineptr = varpscan(localdata, lineptr, &(*newgp)->position.x, (genericptr)*newgp, 0, offx, P_POSITION_X); @@ -4375,7 +4451,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, } /* no. segments is ignored---may be a derived quantity, anyway */ if (version < 2.25) { - sscanf(lineptr, "%*s %hd %hd %hd %hd", &(*newlabel)->justify, + sscanf(lineptr, "%*s %hd %hf %hd %hd", &(*newlabel)->anchor, &(*newlabel)->rotation, &(*newlabel)->position.x, &(*newlabel)->position.y); (*newlabel)->position.x -= offx; (*newlabel)->position.y -= offy; @@ -4384,9 +4460,9 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, else { *lineptr++ = '\0'; lineptr = advancetoken(lineptr); /* skip string token */ - lineptr = varscan(localdata, lineptr, &(*newlabel)->justify, - (genericptr)*newlabel, P_JUSTIFY); - lineptr = varscan(localdata, lineptr, &(*newlabel)->rotation, + lineptr = varscan(localdata, lineptr, &(*newlabel)->anchor, + (genericptr)*newlabel, P_ANCHOR); + lineptr = varfscan(localdata, lineptr, &(*newlabel)->rotation, (genericptr)*newlabel, P_ROTATION); lineptr = varfscan(localdata, lineptr, &(*newlabel)->scale, (genericptr)*newlabel, P_SCALE); @@ -4397,7 +4473,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, } if (version < 2.4) (*newlabel)->rotation = -(*newlabel)->rotation; - while ((*newlabel)->rotation < 0) (*newlabel)->rotation += 360; + while ((*newlabel)->rotation < 0.0) (*newlabel)->rotation += 360.0; (*newlabel)->pin = False; if (strcmp(keyword, "label")) { /* all the schematic types */ @@ -4717,7 +4793,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, } if (!matchtech && ((*libobj)->name != objnamestart)) - if (version > 3.7) + if (version > 3.7) continue; // no prefix in file must match // null prefix in library object. @@ -4746,7 +4822,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, else (*newinst)->style = LINE_INVARIANT; - lineptr = varscan(localdata, lineptr, &(*newinst)->rotation, + lineptr = varfscan(localdata, lineptr, &(*newinst)->rotation, (genericptr)*newinst, P_ROTATION); lineptr = varpscan(localdata, lineptr, &(*newinst)->position.x, (genericptr)*newinst, 0, offx, P_POSITION_X); @@ -4757,15 +4833,17 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy, /* earlier. Later versions don't allow negative rotation */ if (version < 2.4) { - if ((*newinst)->rotation < 0) { + if ((*newinst)->rotation < 0.0) { (*newinst)->scale = -((*newinst)->scale); - (*newinst)->rotation++; + (*newinst)->rotation += 1.0; } (*newinst)->rotation = -(*newinst)->rotation; } - while ((*newinst)->rotation > 360) (*newinst)->rotation -= 360; - while ((*newinst)->rotation < 0) (*newinst)->rotation += 360; + while ((*newinst)->rotation > 360.0) + (*newinst)->rotation -= 360.0; + while ((*newinst)->rotation < 0.0) + (*newinst)->rotation += 360.0; std_eparam((genericptr)(*newinst), colorkey); @@ -5216,8 +5294,9 @@ void savetechnology(char *technology, char *outname) &written, DEFAULTCOLOR); } else { - if ((spec->thisinst->scale != 1.0) || (spec->thisinst->rotation != 0)) { - fprintf(ps, "%3.3f %d ", spec->thisinst->scale, + if ((spec->thisinst->scale != 1.0) || + (spec->thisinst->rotation != 0.0)) { + fprintf(ps, "%3.3f %3.3f ", spec->thisinst->scale, spec->thisinst->rotation); } printparams(ps, spec->thisinst, 0); @@ -5296,10 +5375,12 @@ void output_graphic_data(FILE *ps, short *glist) u_long i; u_char b[4]; } pixel; + int width = xcImageGetWidth(img->image); + int height = xcImageGetHeight(img->image); if (glist[i] == 0) continue; - fprintf(ps, "%%imagedata %d %d\n", img->image->width, img->image->height); + fprintf(ps, "%%imagedata %d %d\n", width, height); fprintf(ps, "currentfile /ASCII85Decode filter "); #ifdef HAVE_LIBZ @@ -5311,19 +5392,18 @@ void output_graphic_data(FILE *ps, short *glist) /* creating a stream buffer is wasteful if we're just using ASCII85 */ /* decoding but is a must for compression filters. */ - ilen = 3 * img->image->width * img->image->height; + ilen = 3 * width * height; filtbuf = (u_char *)malloc(ilen + 4); q = 0; - for (j = 0; j < img->image->height; j++) { - for (k = 0; k < img->image->width; k++) { - pixel.i = XGetPixel(img->image, k, j); - filtbuf[q++] = (u_char)pixel.b[2]; - filtbuf[q++] = (u_char)pixel.b[1]; - filtbuf[q++] = (u_char)pixel.b[0]; + + for (j = 0; j < height; j++) + for (k = 0; k < width; k++) { + unsigned char r, g, b; + xcImageGetPixel(img->image, k, j, &r, &g, &b); + filtbuf[q++] = r; + filtbuf[q++] = g; + filtbuf[q++] = b; } - } - for (j = 0; j < 4; j++) - filtbuf[q++] = 0; /* Extra encoding goes here */ #ifdef HAVE_LIBZ @@ -5336,6 +5416,7 @@ void output_graphic_data(FILE *ps, short *glist) #endif ascbuf[5] = '\0'; + pixel.i = 0; for (j = 0; j < ilen; j += 4) { if ((j + 4) > ilen) lastpix = TRUE; if (!lastpix && (flatebuf[j] + flatebuf[j + 1] + flatebuf[j + 2] @@ -5382,11 +5463,11 @@ void output_graphic_data(FILE *ps, short *glist) fprintf(ps, "/%sdata exch def\n", fptr); fprintf(ps, "/%s <<\n", fptr); fprintf(ps, " /ImageType 1 /Width %d /Height %d /BitsPerComponent 8\n", - img->image->width, img->image->height); + width, height); fprintf(ps, " /MultipleDataSources false\n"); fprintf(ps, " /Decode [0 1 0 1 0 1]\n"); fprintf(ps, " /ImageMatrix [1 0 0 -1 %d %d]\n", - (img->image->width >> 1), (img->image->height >> 1)); + width >> 1, height >> 1); fprintf(ps, " /DataSource %sdata >> def\n\n", fptr); } } @@ -5407,7 +5488,7 @@ void output_graphic_data(FILE *ps, short *glist) void savefile(short mode) { - FILE *ps, *pro; + FILE *ps, *pro, *enc; char outname[150], temp[150], prologue[150], *fname, *fptr, ascbuf[6]; /* u_char decodebuf[6]; (jdk */ short written, fontsused[256], i, page, curpage, multipage; @@ -5570,10 +5651,80 @@ void savefile(short mode) for(;;) { if (fgets(temp, 149, pro) == NULL) break; + if (!strncmp(temp, "%%EndProlog", 11)) break; fputs(temp, ps); } fclose(pro); + /* Special font encodings not known to PostScript */ + /* (anything other than Standard and ISOLatin-1) */ + + for (findex = 0; findex < fontcount; findex++) { + if ((fontsused[findex] & 0xf80) == 0x400) { + /* Cyrillic (ISO8859-5) */ + sprintf(prologue, "%s/%s", PROLOGUE_DIR, CYRILLIC_ENC_FILE); + pro = fopen(prologue, "r"); + if (pro == NULL) { + sprintf(prologue, "%s", CYRILLIC_ENC_FILE); + pro = fopen(prologue, "r"); + if (pro == NULL) { + Wprintf("Warning: Missing font encoding vectors."); + Wprintf("Output may not print properly."); + } + } + if (pro != NULL) { + for(;;) { + if (fgets(temp, 149, pro) == NULL) break; + fputs(temp, ps); + } + fclose(pro); + } + } + else if ((fontsused[findex] & 0xf80) == 0x180) { + /* Eastern European (ISOLatin2) */ + sprintf(prologue, "%s/%s", PROLOGUE_DIR, ISOLATIN2_ENC_FILE); + pro = fopen(prologue, "r"); + if (pro == NULL) { + sprintf(prologue, "%s", ISOLATIN2_ENC_FILE); + pro = fopen(prologue, "r"); + if (pro == NULL) { + Wprintf("Warning: Missing font encoding vectors."); + Wprintf("Output may not print properly."); + } + } + if (pro != NULL) { + for(;;) { + if (fgets(temp, 149, pro) == NULL) break; + fputs(temp, ps); + } + fclose(pro); + } + } + else if ((fontsused[findex] & 0xf80) == 0x300) { + /* Turkish (ISOLatin5) */ + sprintf(prologue, "%s/%s", PROLOGUE_DIR, ISOLATIN5_ENC_FILE); + pro = fopen(prologue, "r"); + if (pro == NULL) { + sprintf(prologue, "%s", ISOLATIN5_ENC_FILE); + pro = fopen(prologue, "r"); + if (pro == NULL) { + Wprintf("Warning: Missing font encoding vectors."); + Wprintf("Output may not print properly."); + } + } + if (pro != NULL) { + for(;;) { + if (fgets(temp, 149, pro) == NULL) break; + fputs(temp, ps); + } + fclose(pro); + } + } + } + + /* Finish off prolog */ + fputs("%%EndProlog\n", ps); + /* Special font handling */ for (findex = 0; findex < fontcount; findex++) { @@ -5593,19 +5744,79 @@ void savefile(short mode) for (i = 0; i < fontcount; i++) { if (i == findex) continue; if (!strcmp(fonts[i].family, fonts[findex].family) && - ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) + ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) { fontorig = fonts[i].psname; - if (fontorig == NULL) fontorig = fonts[findex].psname; + break; + } } + if (fontorig == NULL) fontorig = fonts[findex].psname; fprintf(ps, "/%s findfont dup length dict begin\n", fontorig); fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n"); fprintf(ps, "/Encoding ISOLatin1Encoding def currentdict end\n"); fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname); } - /* To do: ISO-Latin2 encoding */ + /* Derived Cyrillic (ISO8859-5) encoding */ + + if ((fontsused[findex] & 0xf80) == 0x400) { + char *fontorig = NULL; + short i; + /* find the original standard-encoded font (can be itself) */ + for (i = 0; i < fontcount; i++) { + if (i == findex) continue; + if (!strcmp(fonts[i].family, fonts[findex].family) && + ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) { + fontorig = fonts[i].psname; + break; + } + } + if (fontorig == NULL) fontorig = fonts[findex].psname; + fprintf(ps, "/%s findfont dup length dict begin\n", fontorig); + fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n"); + fprintf(ps, "/Encoding ISO8859_5Encoding def currentdict end\n"); + fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname); + } + + /* ISO-Latin2 encoding */ if ((fontsused[findex] & 0xf80) == 0x180) { + char *fontorig = NULL; + short i; + /* find the original standard-encoded font (can be itself) */ + for (i = 0; i < fontcount; i++) { + if (i == findex) continue; + if (!strcmp(fonts[i].family, fonts[findex].family) && + ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) { + fontorig = fonts[i].psname; + break; + } + } + if (fontorig == NULL) fontorig = fonts[findex].psname; + fprintf(ps, "/%s findfont dup length dict begin\n", fontorig); + fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n"); + fprintf(ps, "/Encoding ISOLatin2Encoding def currentdict end\n"); + fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname); + } + + /* ISO-Latin5 encoding */ + + if ((fontsused[findex] & 0xf80) == 0x300) { + char *fontorig = NULL; + short i; + /* find the original standard-encoded font (can be itself) */ + for (i = 0; i < fontcount; i++) { + if (i == findex) continue; + if (!strcmp(fonts[i].family, fonts[findex].family) && + ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) { + fontorig = fonts[i].psname; + break; + } + } + if (fontorig == NULL) fontorig = fonts[findex].psname; + fprintf(ps, "/%s findfont dup length dict begin\n", fontorig); + fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n"); + fprintf(ps, "/Encoding ISOLatin5Encoding def currentdict end\n"); + fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname); } /* To do: Special encoding */ @@ -5731,15 +5942,13 @@ void savefile(short mode) int printRGBvalues(char *tstr, int index, const char *postfix) { int i; - for (i = 0; i < number_colors; i++) { - if (colorlist[i].color.pixel == index) { - sprintf(tstr, "%4.3f %4.3f %4.3f %s", - (float)colorlist[i].color.red / 65535, - (float)colorlist[i].color.green / 65535, - (float)colorlist[i].color.blue / 65535, - postfix); - return 0; - } + if (index >= 0 && index < number_colors) { + sprintf(tstr, "%4.3f %4.3f %4.3f %s", + (float)colorlist[index].color.red / 65535, + (float)colorlist[index].color.green / 65535, + (float)colorlist[index].color.blue / 65535, + postfix); + return 0; } /* The program can reach this point for any color which is */ @@ -5978,8 +6187,7 @@ char *writesegment(stringpart *chrptr, float *lastscale, int *lastfont, int *mar if (chrptr->data.color == DEFAULTCOLOR) strcat(_STR, "sce} "); else - if (printRGBvalues(_STR + 1, - colorlist[chrptr->data.color].color.pixel, "scb} ") < 0) + if (printRGBvalues(_STR + 1, chrptr->data.color, "scb} ") < 0) strcat(_STR, "sce} "); break; case MARGINSTOP: @@ -6213,8 +6421,8 @@ short printparams(FILE *ps, objinstptr sinst, short stcount) case XC_STRING: segs = writelabelsegs(ps, &loccount, ops->parameter.string); if (segs == 0) { - /* When writing object parameters, we cannot allow a */ - /* NULL value. Instead, print an empty string (). */ + /* When writing object parameters, we cannot allow a */ + /* NULL value. Instead, print an empty string (). */ dostcount(ps, &stcount, 3); fputs("() ", ps); } @@ -6518,7 +6726,7 @@ void printOneObject(FILE *ps, objectptr localdata, int ccolor) sobj = TOOBJINST(savegen); varfcheck(ps, sobj->scale, localdata, &stcount, *savegen, P_SCALE); if (!(sobj->style & LINE_INVARIANT)) fprintf(ps, "/sv "); - varcheck(ps, sobj->rotation, localdata, &stcount, *savegen, P_ROTATION); + varfcheck(ps, sobj->rotation, localdata, &stcount, *savegen, P_ROTATION); xyvarcheck(sobj->position, 0, savegen); opsubstitute(sobj->thisobject, sobj); @@ -6552,7 +6760,7 @@ void printOneObject(FILE *ps, objectptr localdata, int ccolor) stcount += (2 + strlen(fptr)); varfcheck(ps, sg->scale, localdata, &stcount, *savegen, P_SCALE); - varcheck(ps, sg->rotation, localdata, &stcount, *savegen, P_ROTATION); + varfcheck(ps, sg->rotation, localdata, &stcount, *savegen, P_ROTATION); xyvarcheck(sg->position, 0, savegen); fprintf(ps, "graphic\n"); break; @@ -6579,9 +6787,9 @@ void printOneObject(FILE *ps, objectptr localdata, int ccolor) sprintf(_STR, "%hd ", segs); dostcount(ps, &stcount, strlen(_STR)); fputs(_STR, ps); - varcheck(ps, TOLABEL(savegen)->justify, localdata, &stcount, - *savegen, P_JUSTIFY); - varcheck(ps, TOLABEL(savegen)->rotation, localdata, &stcount, + varcheck(ps, TOLABEL(savegen)->anchor, localdata, &stcount, + *savegen, P_ANCHOR); + varfcheck(ps, TOLABEL(savegen)->rotation, localdata, &stcount, *savegen, P_ROTATION); varfcheck(ps, TOLABEL(savegen)->scale, localdata, &stcount, *savegen, P_SCALE); diff --git a/fontfile.c b/fontfile.c index 19bf64a..5ff9a12 100644 --- a/fontfile.c +++ b/fontfile.c @@ -43,6 +43,10 @@ extern fontinfo *fonts; extern Globaldata xobjs; extern short beeper; +#ifdef HAVE_CAIRO +extern XCWindowData *areawin; +extern const char *utf8encodings[][256]; +#endif extern float version; @@ -56,7 +60,7 @@ extern Tcl_Interp *xcinterp; FILE *findfontfile(char *fontname) { - int i; + size_t i; char tempname[256]; FILE *fd; @@ -147,7 +151,7 @@ FILE *findfontfile(char *fontname) /* other error occurred. */ /*----------------------------------------------------------------------*/ -int loadfontfile(char *fontname) +int loadfontfile(char *fname) { FILE *fd; char temp[250], commandstr[30], tempname[100]; @@ -159,11 +163,16 @@ int loadfontfile(char *fontname) objectptr *j, *eptr; objectptr *encoding = NULL; float saveversion = version; + char *fontname = strdup(fname); +#ifdef HAVE_CAIRO + const char **utf8enc = NULL; +#endif /* HAVE_CAIRO */ /* check to see if font name is in list of fonts */ for (i = 0; i < fontcount; i++) { if (!strcmp(fonts[i].psname, fontname)) { + free(fontname); return 0; } } @@ -188,6 +197,7 @@ int loadfontfile(char *fontname) if (!strcmp(fonts[i].psname, tempname)) { /* Fprintf(stdout, "Font already loaded.\n"); */ fclose(fd); + free(fontname); return 0; } } @@ -257,8 +267,9 @@ int loadfontfile(char *fontname) sscanf(temp, "%*s %*s %99s", tempname); tempname[0] = tolower(tempname[0]); - if (!strcmp(tempname, "bold")) + if (!strcmp(tempname, "bold")) { flags |= 0x1; + } sscanf(temp, "%*s %*s %*s %99s", tempname); tempname[0] = tolower(tempname[0]); @@ -283,13 +294,20 @@ int loadfontfile(char *fontname) fonts[fontcount].encoding = encoding; /* use original encoding */ fonts[fontcount].flags = flags; fonts[fontcount].scale = fontscale; +#ifdef HAVE_CAIRO + fonts[fontcount].utf8encoding = utf8enc; + xc_cairo_set_fontinfo(fontcount); +#endif /* HAVE_CAIRO */ fontcount++; } } else if (!strcmp(cmdptr, "encoding:")) { + #ifdef HAVE_CAIRO + const char *findencstr; + #endif /* HAVE_CAIRO */ sscanf(temp, "%*s %99s", tempname); - + if (!strcmp(tempname, "special") || !strcmp(tempname, "Special")) { flags |= 0x80; #ifdef TCL_WRAPPER @@ -298,10 +316,28 @@ int loadfontfile(char *fontname) makenewencodingbutton("Special", (char)1); #endif } + +#ifdef HAVE_CAIRO + utf8enc = utf8encodings[0]; + /* treat encoding of symbol font in a special way */ + if (!strcmp(family, "Symbol")) + findencstr = "Symbol"; + else + findencstr = tempname; + + /* Now try to find the encoding, */ + /* default to the first encoding (stdenc) if not found */ + utf8enc = utf8encodings[0]; + for (i = 0; utf8encodings[i][0]; i++) + if (!strcmp(utf8encodings[i][0], findencstr)) { + utf8enc = utf8encodings[i]; + break; + } +#endif /* HAVE_CAIRO */ /* ISO-LatinX encodings where X=1 to 6 */ - if (strstr(tempname, "ISO") != NULL) { + if (strstr(tempname, "Latin") != NULL) { char estr[12]; for (i = 0; i < 6; i++) { if (strchr(tempname, '1' + (char)i) != NULL) { @@ -317,6 +353,19 @@ int loadfontfile(char *fontname) } } } + /* i == 6 maps to ISO8859-5 */ + if (strstr(tempname, "8859-5") != NULL) { +#ifndef TCL_WRAPPER + char estr[12]; +#endif + flags |= ((6 + 2) << 7); +#ifdef TCL_WRAPPER + XcInternalTagCall(xcinterp, 3, "label", "encoding", "ISO8859-5"); +#else + snprintf(estr, sizeof(estr), "ISO-8859-5"); + makenewencodingbutton(estr, (char)8); +#endif + } /* Make space for the font encoding vector */ @@ -365,6 +414,10 @@ int loadfontfile(char *fontname) fonts[fontcount].encoding = encoding; fonts[fontcount].flags = flags; fonts[fontcount].scale = fontscale; +#ifdef HAVE_CAIRO + fonts[fontcount].utf8encoding = utf8enc; + xc_cairo_set_fontinfo(fontcount); +#endif /* HAVE_CAIRO */ fontcount++; /* Create a new menu button for the font family, if this is the first */ @@ -380,5 +433,6 @@ int loadfontfile(char *fontname) } } fclose(fd); + free(fontname); return 1; } diff --git a/formats.c b/formats.c index 5c86c99..9b29a2b 100644 --- a/formats.c +++ b/formats.c @@ -44,7 +44,6 @@ extern char _STR[150]; extern Globaldata xobjs; extern XCWindowData *areawin; extern Display *dpy; -extern int *appcolors; /*----------------------------------------------*/ #ifdef LGF @@ -236,7 +235,7 @@ void loadlgf(int mode) NEW_LABEL(newlabel, topobject); labeldefaults(*newlabel, False, xmat(pvalx), ymat(pvaly)); - (*newlabel)->justify = TOP | NOTBOTTOM; + (*newlabel)->anchor = TOP | NOTBOTTOM; (*newlabel)->color = DEFAULTCOLOR; (*newlabel)->string->data.font = 0; strptr = makesegment(&((*newlabel)->string), NULL); @@ -391,8 +390,10 @@ void loadlgf(int mode) (*newinst)->passed = NULL; if (pvalx2 & 0x01) pvalx2 ^= 0x02; - if (pvalx2 >= 4) (*newinst)->rotation = -(((pvalx2 - 4) * 90) + 1); - else (*newinst)->rotation = (pvalx2 * 90) + 1; + if (pvalx2 >= 4) + (*newinst)->rotation = (float)(-((pvalx2 - 4) * 90) + 1); + else + (*newinst)->rotation = (float)((pvalx2 * 90) + 1); (*newinst)->thisobject = *libobj; (*newinst)->bbox.lowerleft.x = (*libobj)->bbox.lowerleft.x; (*newinst)->bbox.lowerleft.y = (*libobj)->bbox.lowerleft.y; @@ -427,8 +428,8 @@ void loadlgf(int mode) else (*newlabel)->position.x += ((flip) ? 54 : -54); - (*newlabel)->justify = NOTBOTTOM; - if (flip) (*newlabel)->justify |= (RIGHT | NOTLEFT); + (*newlabel)->anchor = NOTBOTTOM; + if (flip) (*newlabel)->anchor |= (RIGHT | NOTLEFT); (*newlabel)->string->data.font = 0; strptr = makesegment(&((*newlabel)->string), NULL); strptr->type = TEXT_STRING; @@ -498,7 +499,7 @@ void loadlgf(int mode) for (iolabel = topobject->plist; iolabel < topobject->plist + topobject->parts; iolabel++) if (IS_LABEL(*iolabel)) { - if (TOLABEL(iolabel)->rotation == 500) { + if (TOLABEL(iolabel)->rotation == 500.0) { genericptr *tmplabel; free(TOLABEL(iolabel)->string); @@ -630,7 +631,6 @@ void loadmat4(caddr_t nullval) sscanf(bb + 1, "%f %f %f", &red, &green, &blue); curcolor = rgb_alloccolor((int)(red * 65535), (int)(green * 65535), (int)(blue * 65535)); - addnewcolorentry(curcolor); } if ((bb = strchr(buffer, '/')) != NULL) { sscanf(bb, "%4s", &colorstr[matcolors]); diff --git a/functions.c b/functions.c index f13e971..7d61eef 100644 --- a/functions.c +++ b/functions.c @@ -42,7 +42,8 @@ extern Display *dpy; extern Pixmap STIPPLE[8]; extern XCWindowData *areawin; extern Globaldata xobjs; -extern int *appcolors; +extern int number_colors; +extern colorindex *colorlist; /*------------------------------------------------------------------------*/ /* find the squared length of a wire (or distance between two points in */ @@ -309,7 +310,7 @@ void calcspline(splineptr thespline) /* Find the (x,y) position and tangent rotation of a point on a spline */ /*------------------------------------------------------------------------*/ -void findsplinepos(splineptr thespline, float t, XPoint *retpoint, int *retrot) +void findsplinepos(splineptr thespline, float t, XPoint *retpoint, float *retrot) { float ax, bx, cx, ay, by, cy; float tsq = t * t; @@ -323,7 +324,7 @@ void findsplinepos(splineptr thespline, float t, XPoint *retpoint, int *retrot) if (retrot != NULL) { dxdt = (double)(3 * ax * tsq + 2 * bx * t + cx); dydt = (double)(3 * ay * tsq + 2 * by * t + cy); - *retrot = (int)(INVRFAC * atan2(dxdt, dydt)); /* reversed y, x */ + *retrot = INVRFAC * atan2(dxdt, dydt); /* reversed y, x */ if (*retrot < 0) *retrot += 360; } } @@ -635,10 +636,10 @@ void user_to_window(XPoint upt, XPoint *wpt) /* Return rotation relative to a specific CTM */ /*----------------------------------------------------------------------*/ -int UGetCTMRotation(Matrix *ctm) +float UGetCTMRotation(Matrix *ctm) { float rads = (float)atan2((double)(ctm->d), (double)(ctm->a)); - return (int)(rads / RADFAC); + return rads / RADFAC; } /*----------------------------------------------------------------------*/ @@ -648,7 +649,7 @@ int UGetCTMRotation(Matrix *ctm) /* window. Thus, there is no routine UTopDrawingRotation(). */ /*----------------------------------------------------------------------*/ -int UTopRotation() +float UTopRotation() { return UGetCTMRotation(DCTM); } @@ -835,6 +836,11 @@ void UResetCTM(Matrix *ctm) ctm->a = ctm->e = 1; ctm->b = ctm->d = 0; ctm->c = ctm->f = 0; /* 0.5 for nearest-int real->int conversion? */ + +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } /*------------------------------------------------------------------------*/ @@ -854,6 +860,11 @@ void InvertCTM(Matrix *ctm) ctm->e = tmpa / det; ctm->c = tx / det; ctm->f = ty / det; + +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } /*------------------------------------------------------------------------*/ @@ -867,6 +878,11 @@ void UCopyCTM(fctm, tctm) tctm->d = fctm->d; tctm->e = fctm->e; tctm->f = fctm->f; + +#ifdef HAVE_CAIRO + if (tctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(tctm); +#endif /* HAVE_CAIRO */ } /*-------------------------------------------------------------------------*/ @@ -878,17 +894,23 @@ void UMakeWCTM(Matrix *ctm) { ctm->a *= areawin->vscale; ctm->b *= areawin->vscale; - ctm->c = (ctm->c - (float)areawin->pcorner.x) * areawin->vscale; + ctm->c = (ctm->c - (float)areawin->pcorner.x) * areawin->vscale + + areawin->panx; ctm->d *= -areawin->vscale; ctm->e *= -areawin->vscale; ctm->f = (float)areawin->height + ((float)areawin->pcorner.y - ctm->f) * - areawin->vscale; + areawin->vscale + areawin->pany; + +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } /*------------------------------------------------------------------------*/ -void UMultCTM(Matrix *ctm, XPoint position, float scale, short rotate) +void UMultCTM(Matrix *ctm, XPoint position, float scale, float rotate) { float tmpa, tmpb, tmpd, tmpe, yscale; float mata, matb, matc; @@ -912,6 +934,11 @@ void UMultCTM(Matrix *ctm, XPoint position, float scale, short rotate) ctm->a = mata; ctm->b = matb; ctm->c = matc; + +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } /*----------------------------------------------------------------------*/ @@ -922,6 +949,11 @@ void USlantCTM(Matrix *ctm, float beta) { ctm->b += ctm->a * beta; ctm->e += ctm->d * beta; + +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } #define EPS 1e-9 @@ -950,34 +982,40 @@ void UPreScaleCTM(Matrix *ctm) /* with the PostScript output due to roundoff error. This code */ /* matches what PostScript produces. */ +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } /*----------------------------------------------------------------------*/ -/* Adjust justification and CTM as necessary for flip invariance */ +/* Adjust anchoring and CTM as necessary for flip invariance */ /*----------------------------------------------------------------------*/ -short flipadjust(short justify) +short flipadjust(short anchor) { - short tmpjust = justify & (~FLIPINV); + short tmpanchor = anchor & (~FLIPINV); - if (justify & FLIPINV) { + if (anchor & FLIPINV) { if (((DCTM)->a < -EPS) || (((DCTM)->a < EPS) && ((DCTM)->a > -EPS) && (((DCTM)->d * (DCTM)->b) < 0))) { - if ((tmpjust & (RIGHT | NOTLEFT)) != NOTLEFT) - tmpjust ^= (RIGHT | NOTLEFT); + if ((tmpanchor & (RIGHT | NOTLEFT)) != NOTLEFT) + tmpanchor ^= (RIGHT | NOTLEFT); + + /* NOTE: Justification does not change under flip invariance. */ } if ((DCTM)->e > EPS) { - if ((tmpjust & (TOP | NOTBOTTOM)) != NOTBOTTOM) - tmpjust ^= (TOP | NOTBOTTOM); + if ((tmpanchor & (TOP | NOTBOTTOM)) != NOTBOTTOM) + tmpanchor ^= (TOP | NOTBOTTOM); } UPreScaleCTM(DCTM); } - return tmpjust; + return tmpanchor; } /*------------------------------------------------------------------------*/ -void UPreMultCTM(Matrix *ctm, XPoint position, float scale, short rotate) +void UPreMultCTM(Matrix *ctm, XPoint position, float scale, float rotate) { float tmpa, tmpb, tmpd, tmpe, yscale; float mata, matd; @@ -1001,6 +1039,11 @@ void UPreMultCTM(Matrix *ctm, XPoint position, float scale, short rotate) ctm->a = mata; ctm->d = matd; + +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } /*----------------------------------------------------------------------*/ @@ -1020,6 +1063,11 @@ void UPreMultCTMbyMat(Matrix *ctm, Matrix *pre) ctm->f += pre->c * ctm->d + pre->f * ctm->e; ctm->e = pre->b * ctm->d + pre->e * ctm->e; ctm->d = matd; + +#ifdef HAVE_CAIRO + if (ctm == DCTM && areawin->redraw_ongoing) + xc_cairo_set_matrix(ctm); +#endif /* HAVE_CAIRO */ } /*------------------------------------------------------------------------*/ @@ -1071,6 +1119,10 @@ void UPopCTM() lastmatrix = areawin->MatStack->nextmatrix; free(areawin->MatStack); areawin->MatStack = lastmatrix; + +#ifdef HAVE_CAIRO + xc_cairo_set_matrix(lastmatrix); +#endif /* HAVE_CAIRO */ } /*------------------------------------------------------------------------*/ @@ -1091,7 +1143,7 @@ void UPushCTM() /*------------------------------------------------------------------------*/ void UTransformPoints(XPoint *points, XPoint *newpoints, short number, - XPoint atpt, float scale, short rotate) + XPoint atpt, float scale, float rotate) { Matrix LCTM; @@ -1105,7 +1157,7 @@ void UTransformPoints(XPoint *points, XPoint *newpoints, short number, /*----------------------------------------------------*/ void InvTransformPoints(XPoint *points, XPoint *newpoints, short number, - XPoint atpt, float scale, short rotate) + XPoint atpt, float scale, float rotate) { Matrix LCTM; @@ -1287,13 +1339,13 @@ void labelbbox(labelptr labox, XPoint *npoints, objinstptr callinst) TextExtents tmpext; short j; - tmpext = ULength(labox, callinst, 0, NULL); - points[0].x = points[1].x = (labox->justify & NOTLEFT ? - (labox->justify & RIGHT ? -tmpext.maxwidth : + tmpext = ULength(labox, callinst, NULL); + points[0].x = points[1].x = (labox->anchor & NOTLEFT ? + (labox->anchor & RIGHT ? -tmpext.maxwidth : -tmpext.maxwidth / 2) : 0); points[2].x = points[3].x = points[0].x + tmpext.maxwidth; - points[0].y = points[3].y = (labox->justify & NOTBOTTOM ? - (labox->justify & TOP ? -tmpext.ascent : + points[0].y = points[3].y = (labox->anchor & NOTBOTTOM ? + (labox->anchor & TOP ? -tmpext.ascent : -(tmpext.ascent + tmpext.base) / 2) : -tmpext.base) + tmpext.descent; points[1].y = points[2].y = points[0].y + tmpext.ascent - tmpext.descent; @@ -1302,7 +1354,7 @@ void labelbbox(labelptr labox, XPoint *npoints, objinstptr callinst) if (labox->pin) for (j = 0; j < 4; j++) - pinadjust(labox->justify, &points[j].x, &points[j].y, 1); + pinadjust(labox->anchor, &points[j].x, &points[j].y, 1); UTransformPoints(points, npoints, 4, labox->position, labox->scale, labox->rotation); @@ -1315,8 +1367,8 @@ void labelbbox(labelptr labox, XPoint *npoints, objinstptr callinst) void graphicbbox(graphicptr gp, XPoint *npoints) { XPoint points[4]; - int hw = gp->source->width >> 1; - int hh = gp->source->height >> 1; + int hw = xcImageGetWidth(gp->source) >> 1; + int hh = xcImageGetHeight(gp->source) >> 1; points[1].x = points[2].x = hw; points[0].x = points[3].x = -hw; @@ -1520,7 +1572,7 @@ void calcbboxinst(objinstptr thisinst) if (IS_LABEL(*gelem)) { labelptr btext = TOLABEL(gelem); - if (btext->pin && !(btext->justify & PINVISIBLE)) { + if (btext->pin && !(btext->anchor & PINVISIBLE)) { hasschembbox = TRUE; calcbboxsingle(gelem, thisinst, &pllx, &plly, &purx, &pury); continue; @@ -1679,7 +1731,7 @@ void calcbboxvalues(objinstptr thisinst, genericptr *newelement) if (IS_LABEL(*bboxgen)) { labelptr btext = TOLABEL(bboxgen); - if (btext->pin && !(btext->justify & PINVISIBLE)) { + if (btext->pin && !(btext->anchor & PINVISIBLE)) { goto nextgen; } } @@ -1766,7 +1818,7 @@ void centerview(objinstptr tinst) /* Copy new position values to the current window */ - if (tobj == topobject) { + if ((areawin->topinstance != NULL) && (tobj == topobject)) { areawin->pcorner = tobj->pcorner; areawin->vscale = tobj->viewscale; } @@ -1778,6 +1830,7 @@ void centerview(objinstptr tinst) void refresh(xcWidget bw, caddr_t clientdata, caddr_t calldata) { + areawin->redraw_needed = True; drawarea(NULL, NULL, NULL); if (areawin->scrollbarh) drawhbar(areawin->scrollbarh, NULL, NULL); @@ -1797,7 +1850,8 @@ void zoomview(xcWidget w, caddr_t clientdata, caddr_t calldata) eventmode == FONTCAT_MODE || eventmode == EFONTCAT_MODE || eventmode == CATMOVE_MODE) { - centerview(areawin->topinstance); + if (areawin->topinstance) + centerview(areawin->topinstance); areawin->lastbackground = NULL; renderbackground(); refresh(NULL, NULL, NULL); @@ -1808,26 +1862,40 @@ void zoomview(xcWidget w, caddr_t clientdata, caddr_t calldata) /* Basic X Graphics Routines in the User coordinate system */ /*---------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawSimpleLine(XPoint *pt1, XPoint *pt2) { XPoint newpt1, newpt2; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + UTransformbyCTM(DCTM, pt1, &newpt1, 1); UTransformbyCTM(DCTM, pt2, &newpt2, 1); DrawLine(dpy, areawin->window, areawin->gc, newpt1.x, newpt1.y, newpt2.x, newpt2.y); } +#endif /* !HAVE_CAIRO */ /*-------------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawLine(XPoint *pt1, XPoint *pt2) { float tmpwidth = UTopTransScale(xobjs.pagelist[areawin->page]->wirewidth); + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + SetLineAttributes(dpy, areawin->gc, tmpwidth, LineSolid, CapRound, JoinBevel); UDrawSimpleLine(pt1, pt2); } +#endif /* !HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Add circle at given point to indicate that the point is a parameter. */ @@ -1843,10 +1911,16 @@ void UDrawLine(XPoint *pt1, XPoint *pt2) /* negative = clockwise)). */ /*----------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawCircle(XPoint *upt, u_char which) { XPoint wpt; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + user_to_window(*upt, &wpt); SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapButt, JoinMiter); @@ -1869,19 +1943,27 @@ void UDrawCircle(XPoint *upt, u_char which) break; } } +#endif /* !HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Add "X" at string origin */ /*----------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawXAt(XPoint *wpt) { + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapButt, JoinMiter); DrawLine(dpy, areawin->window, areawin->gc, wpt->x - 3, wpt->y - 3, wpt->x + 3, wpt->y + 3); DrawLine(dpy, areawin->window, areawin->gc, wpt->x + 3, wpt->y - 3, wpt->x - 3, wpt->y + 3); } +#endif /* !HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Draw "X" on current level */ @@ -1986,14 +2068,14 @@ void extendschembbox(objinstptr bbinst, XPoint *origin, XPoint *corner) /* Adjust a pinlabel position to account for pad spacing */ /*----------------------------------------------------------------------*/ -void pinadjust (short justify, short *xpoint, short *ypoint, short dir) +void pinadjust (short anchor, short *xpoint, short *ypoint, short dir) { int delx, dely; - dely = (justify & NOTBOTTOM) ? - ((justify & TOP) ? -PADSPACE : 0) : PADSPACE; - delx = (justify & NOTLEFT) ? - ((justify & RIGHT) ? -PADSPACE : 0) : PADSPACE; + dely = (anchor & NOTBOTTOM) ? + ((anchor & TOP) ? -PADSPACE : 0) : PADSPACE; + delx = (anchor & NOTLEFT) ? + ((anchor & RIGHT) ? -PADSPACE : 0) : PADSPACE; if (xpoint != NULL) *xpoint += (dir > 0) ? delx : -delx; if (ypoint != NULL) *ypoint += (dir > 0) ? dely : -dely; @@ -2007,36 +2089,51 @@ void pinadjust (short justify, short *xpoint, short *ypoint, short dir) void UDrawTextLine(labelptr curlabel, short tpos) { XPoint points[2]; /* top and bottom of text cursor line */ - short xdist, xbase, tmpjust; + short tmpanchor, xbase; + int maxwidth; TextExtents tmpext; + TextLinesInfo tlinfo; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } /* correct for position, rotation, scale, and flip invariance of text */ UPushCTM(); UPreMultCTM(DCTM, curlabel->position, curlabel->scale, curlabel->rotation); - tmpjust = flipadjust(curlabel->justify); + tmpanchor = flipadjust(curlabel->anchor); - SetFunction(dpy, areawin->gc, GXxor); - SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND); + SetForeground(dpy, areawin->gc, AUXCOLOR); - tmpext = ULength(curlabel, areawin->topinstance, tpos, NULL); - xdist = tmpext.width; + tlinfo.dostop = 0; + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; + + tmpext = ULength(curlabel, areawin->topinstance, &tlinfo); + maxwidth = tmpext.maxwidth; xbase = tmpext.base; - tmpext = ULength(curlabel, areawin->topinstance, 0, NULL); - - points[0].x = (tmpjust & NOTLEFT ? - (tmpjust & RIGHT ? -tmpext.maxwidth : -tmpext.maxwidth >> 1) : 0) - + xdist; - points[0].y = (tmpjust & NOTBOTTOM ? - (tmpjust & TOP ? -tmpext.ascent : -(tmpext.ascent + tmpext.base) / 2) - : -tmpext.base) + xbase - 3; + tlinfo.dostop = tpos; + tmpext = ULength(curlabel, areawin->topinstance, &tlinfo); + + points[0].x = (tmpanchor & NOTLEFT ? + (tmpanchor & RIGHT ? -maxwidth : -maxwidth >> 1) : 0) + tmpext.width; + if ((tmpanchor & JUSTIFYRIGHT) && tlinfo.padding) + points[0].x += tlinfo.padding[tlinfo.line]; + else if ((tmpanchor & TEXTCENTERED) && tlinfo.padding) + points[0].x += 0.5 * tlinfo.padding[tlinfo.line]; + points[0].y = (tmpanchor & NOTBOTTOM ? + (tmpanchor & TOP ? -tmpext.ascent : -(tmpext.ascent + xbase) / 2) + : -xbase) + tmpext.base - 3; points[1].x = points[0].x; points[1].y = points[0].y + TEXTHEIGHT + 6; if (curlabel->pin) { - pinadjust(tmpjust, &(points[0].x), &(points[0].y), 1); - pinadjust(tmpjust, &(points[1].x), &(points[1].y), 1); + pinadjust(tmpanchor, &(points[0].x), &(points[0].y), 1); + pinadjust(tmpanchor, &(points[1].x), &(points[1].y), 1); } + if (tlinfo.padding != NULL) free(tlinfo.padding); /* draw the line */ @@ -2062,12 +2159,17 @@ void UDrawTLine(labelptr curlabel) /* Draw an X */ /*----------------------*/ +#ifndef HAVE_CAIRO void UDrawXLine(XPoint opt, XPoint cpt) { XPoint upt, vpt; - SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND); - SetFunction(dpy, areawin->gc, GXxor); + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + SetForeground(dpy, areawin->gc, AUXCOLOR); user_to_window(cpt, &upt); user_to_window(opt, &vpt); @@ -2081,23 +2183,27 @@ void UDrawXLine(XPoint opt, XPoint cpt) DrawLine(dpy, areawin->window, areawin->gc, upt.x + 3, upt.y - 3, upt.x - 3, upt.y + 3); - SetFunction(dpy, areawin->gc, areawin->gctype); SetForeground(dpy, areawin->gc, areawin->gccolor); } +#endif /* HAVE_CAIRO */ /*-------------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawBox(XPoint origin, XPoint corner) { XPoint worig, wcorn; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + user_to_window(origin, &worig); user_to_window(corner, &wcorn); - SetFunction(dpy, areawin->gc, GXxor); - SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND); + SetForeground(dpy, areawin->gc, AUXCOLOR); SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel); - DrawLine(dpy, areawin->window, areawin->gc, worig.x, worig.y, worig.x, wcorn.y); DrawLine(dpy, areawin->window, areawin->gc, worig.x, wcorn.y, @@ -2107,15 +2213,15 @@ void UDrawBox(XPoint origin, XPoint corner) DrawLine(dpy, areawin->window, areawin->gc, wcorn.x, worig.y, worig.x, worig.y); } +#endif /* HAVE_CAIRO */ /*----------------------------------------------------------------------*/ -/* Draw a box indicating the dimensions of the edit element that most */ +/* Get a box indicating the dimensions of the edit element that most */ /* closely reach the position "corner". */ /*----------------------------------------------------------------------*/ -float UDrawRescaleBox(XPoint *corner) +float UGetRescaleBox(XPoint *corner, XPoint *newpoints) { - XPoint origpoints[5], newpoints[5]; genericptr rgen; float savescale, newscale; long mindist, testdist, refdist; @@ -2124,12 +2230,13 @@ float UDrawRescaleBox(XPoint *corner) objinstptr rinst; int i; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + // return 0.0; + } + if (areawin->selects == 0) return 0.0; - SetFunction(dpy, areawin->gc, GXxor); - SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND); - SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel); - /* Use only the 1st selection as a reference to set the scale */ rgen = SELTOGENERIC(areawin->selectlist); @@ -2232,18 +2339,51 @@ float UDrawRescaleBox(XPoint *corner) break; } + return newscale; +} + +/*----------------------------------------------------------------------*/ +/* Draw a box indicating the dimensions of the edit element that most */ +/* closely reach the position "corner". */ +/*----------------------------------------------------------------------*/ + +#ifndef HAVE_CAIRO +void UDrawRescaleBox(XPoint *corner) +{ + XPoint origpoints[5], newpoints[5]; + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + + if (areawin->selects == 0) + return; + + UGetRescaleBox(corner, newpoints); + + SetForeground(dpy, areawin->gc, AUXCOLOR); + SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel); + UTransformbyCTM(DCTM, newpoints, origpoints, 4); strokepath(origpoints, 4, 0, 1); - return newscale; } +#endif /* HAVE_CAIRO */ /*-------------------------------------------------------------------------*/ + +#ifndef HAVE_CAIRO void UDrawBBox() { XPoint origin; XPoint worig, wcorn, corner; objinstptr bbinst = areawin->topinstance; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + if ((!areawin->bboxon) || (checkforbbox(topobject) != NULL)) return; origin = bbinst->bbox.lowerleft; @@ -2266,11 +2406,13 @@ void UDrawBBox() DrawLine(dpy, areawin->window, areawin->gc, wcorn.x, worig.y, worig.x, worig.y); } +#endif /* !HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Fill and/or draw a border around the stroking path */ /*----------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void strokepath(XPoint *pathlist, short number, short style, float width) { float tmpwidth; @@ -2365,6 +2507,7 @@ void strokepath(XPoint *pathlist, short number, short style, float width) } } } +#endif /* !HAVE_CAIRO */ /*-------------------------------------------------------------------------*/ @@ -2379,53 +2522,68 @@ void makesplinepath(splineptr thespline, XPoint *pathlist) /*-------------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawSpline(splineptr thespline, float passwidth) { XPoint tmppoints[SPLINESEGS]; float scaledwidth; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + scaledwidth = thespline->width * passwidth; makesplinepath(thespline, tmppoints); strokepath(tmppoints, SPLINESEGS, thespline->style, scaledwidth); - if (thespline->cycle != NULL) { - UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]); - UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]); - } } +#endif /* HAVE_CAIRO */ /*-------------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawPolygon(polyptr thepoly, float passwidth) { XPoint *tmppoints = (pointlist) malloc(thepoly->number * sizeof(XPoint)); float scaledwidth; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + scaledwidth = thepoly->width * passwidth; UTransformbyCTM(DCTM, thepoly->points, tmppoints, thepoly->number); strokepath(tmppoints, thepoly->number, thepoly->style, scaledwidth); free(tmppoints); } +#endif /* HAVE_CAIRO */ /*-------------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawArc(arcptr thearc, float passwidth) { XPoint tmppoints[RSTEPS + 2]; float scaledwidth; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + scaledwidth = thearc->width * passwidth; UfTransformbyCTM(DCTM, thearc->points, tmppoints, thearc->number); strokepath(tmppoints, thearc->number, thearc->style, scaledwidth); - if (thearc->cycle != NULL) { - UDrawXLine(thearc->position, areawin->save); - } } +#endif /* HAVE_CAIRO */ /*-------------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawPath(pathptr thepath, float passwidth) { XPoint *tmppoints = (pointlist) malloc(sizeof(XPoint)); @@ -2434,22 +2592,10 @@ void UDrawPath(pathptr thepath, float passwidth) splineptr thespline; int pathsegs = 0, curseg = 0; float scaledwidth; - Boolean draweditlines = FALSE; - /* First pass---check for any splines that are being edited. If */ - /* any one is, then draw all control points for all splines in the */ - /* path. */ - - for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts; - genpath++) { - switch(ELEMENTTYPE(*genpath)) { - case SPLINE: - thespline = TOSPLINE(genpath); - if (thespline->cycle != NULL) - draweditlines = TRUE; - break; - } - if (draweditlines) break; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; } for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts; @@ -2468,11 +2614,6 @@ void UDrawPath(pathptr thepath, float passwidth) tmppoints = (pointlist) realloc(tmppoints, pathsegs * sizeof(XPoint)); makesplinepath(thespline, tmppoints + curseg); curseg = pathsegs; - - if (draweditlines) { - UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]); - UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]); - } break; } } @@ -2481,6 +2622,7 @@ void UDrawPath(pathptr thepath, float passwidth) strokepath(tmppoints, pathsegs, thepath->style, scaledwidth); free(tmppoints); } +#endif /* HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Main recursive object instance drawing routine. */ @@ -2492,6 +2634,7 @@ void UDrawPath(pathptr thepath, float passwidth) /* stack contains graphics context information */ /*----------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawObject(objinstptr theinstance, short level, int passcolor, float passwidth, pushlistptr *stack) { @@ -2505,6 +2648,11 @@ void UDrawObject(objinstptr theinstance, short level, int passcolor, u_char xm, ym; objectptr theobject = theinstance->thisobject; + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } + /* Save the number of selections and set it to zero while we do the */ /* object drawing. */ @@ -2631,9 +2779,9 @@ void UDrawObject(objinstptr theinstance, short level, int passcolor, case(LABEL): if (level == 0 || TOLABEL(areagen)->pin == False) UDrawString(TOLABEL(areagen), curcolor, theinstance); - else if ((TOLABEL(areagen)->justify & PINVISIBLE) && areawin->pinpointon) + else if ((TOLABEL(areagen)->anchor & PINVISIBLE) && areawin->pinpointon) UDrawString(TOLABEL(areagen), curcolor, theinstance); - else if (TOLABEL(areagen)->justify & PINVISIBLE) + else if (TOLABEL(areagen)->anchor & PINVISIBLE) UDrawStringNoX(TOLABEL(areagen), curcolor, theinstance); else if (level == 1 && TOLABEL(areagen)->pin && TOLABEL(areagen)->pin != INFO && areawin->pinpointon) @@ -2692,6 +2840,7 @@ void UDrawObject(objinstptr theinstance, short level, int passcolor, pop_stack(stack); } } +#endif /* HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Recursively run through the current page and find any labels which */ @@ -2710,7 +2859,7 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f, genericptr *areagen; objectptr theobject = theinstance->thisobject; char *ltext; - int lrjust, tbjust; + int lranchor, tbanchor; UPushCTM(); if (level != 0) @@ -2733,8 +2882,8 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f, case(LABEL): thislabel = TOLABEL(areagen); if (level == 0 || thislabel->pin == False || - (thislabel->justify & PINVISIBLE)) - if (thislabel->justify & LATEXLABEL) { + (thislabel->anchor & PINVISIBLE)) + if (thislabel->anchor & LATEXLABEL) { if (checkonly) { *checkonly = TRUE; return; @@ -2756,8 +2905,8 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f, xfpos.x /= scale2; xfpos.y /= scale2; ltext = textprinttex(thislabel->string, theinstance); - tbjust = thislabel->justify & (NOTBOTTOM | TOP); - lrjust = thislabel->justify & (NOTLEFT | RIGHT); + tbanchor = thislabel->anchor & (NOTBOTTOM | TOP); + lranchor = thislabel->anchor & (NOTLEFT | RIGHT); /* The 1.2 factor accounts for the difference between */ /* Xcircuit's label scale of "1" and LaTeX's "normalsize" */ @@ -2766,13 +2915,13 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f, xfpos.x, xfpos.y, 1.2 * thislabel->scale); if (thislabel->rotation != 0) fprintf(f, "\\rotatebox{-%d}{", thislabel->rotation); - if (lrjust == (NOTLEFT | RIGHT)) fprintf(f, "\\rightbox{"); - else if (lrjust == NOTLEFT) fprintf(f, "\\centbox{"); - if (tbjust == (NOTBOTTOM | TOP)) fprintf(f, "\\topbox{"); - else if (tbjust == NOTBOTTOM) fprintf(f, "\\midbox{"); + if (lranchor == (NOTLEFT | RIGHT)) fprintf(f, "\\rightbox{"); + else if (lranchor == NOTLEFT) fprintf(f, "\\centbox{"); + if (tbanchor == (NOTBOTTOM | TOP)) fprintf(f, "\\topbox{"); + else if (tbanchor == NOTBOTTOM) fprintf(f, "\\midbox{"); fprintf(f, "%s", ltext); - if (lrjust != NORMAL) fprintf(f, "}"); - if (tbjust != NORMAL) fprintf(f, "}"); + if (lranchor != NORMAL) fprintf(f, "}"); + if (tbanchor != NORMAL) fprintf(f, "}"); if (thislabel->rotation != 0) fprintf(f, "}"); fprintf(f, "}%%\n"); free(ltext); diff --git a/graphic.c b/graphic.c index 38c54a3..76f4c65 100644 --- a/graphic.c +++ b/graphic.c @@ -17,11 +17,6 @@ #include #endif -#ifdef OPENGL -#include -#include -#endif /* OPENGL */ - #ifdef TCL_WRAPPER #include #endif @@ -110,12 +105,13 @@ short *collect_graphics(short *pagelist) /* Otherwise, return TRUE. */ /*----------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO Boolean transform_graphic(graphicptr gp) { - int width, height, twidth, theight, rotation; - float scale, tscale; + int width, height, twidth, theight; + float scale, tscale, rotation, crot; double cosr, sinr; - int x, y, c, s, hw, hh, thw, thh, xorig, yorig, crot, xc, yc; + int x, y, c, s, hw, hh, thw, thh, xorig, yorig, xc, yc; int screen = DefaultScreen(dpy); static GC cmgc = (GC)NULL; @@ -123,8 +119,8 @@ Boolean transform_graphic(graphicptr gp) scale = gp->scale * tscale; rotation = gp->rotation + UTopRotation(); - if (rotation >= 360) rotation -= 360; - else if (rotation < 0) rotation += 360; + if (rotation >= 360.0) rotation -= 360.0; + else if (rotation < 0.0) rotation += 360.0; /* Check if the top-level rotation and scale match the */ /* saved target image. If so, then we're done. */ @@ -139,8 +135,8 @@ Boolean transform_graphic(graphicptr gp) /* that fits the rotated and scaled image. */ crot = rotation; - if (crot > 90 && crot < 180) crot = 180 - crot; - if (crot > 270 && crot < 360) crot = 360 - crot; + if (crot > 90.0 && crot < 180.0) crot = 180.0 - crot; + if (crot > 270.0 && crot < 360.0) crot = 360.0 - crot; cosr = cos(RADFAC * crot); sinr = sin(RADFAC * crot); width = gp->source->width * scale; @@ -187,7 +183,7 @@ Boolean transform_graphic(graphicptr gp) return FALSE; } - if (rotation != 0) { + if (rotation != 0.0) { gp->clipmask = XCreatePixmap(dpy, areawin->window, twidth, theight, 1); if (cmgc == (GC)NULL) { XGCValues values; @@ -223,12 +219,14 @@ Boolean transform_graphic(graphicptr gp) gp->trot = rotation; return TRUE; } +#endif /* HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Draw a graphic image by copying from the image to the window. */ /* Image is centered on the center point of the graphic image. */ /*----------------------------------------------------------------------*/ +#ifndef HAVE_CAIRO void UDrawGraphic(graphicptr gp) { XPoint ppt; @@ -271,6 +269,7 @@ void UDrawGraphic(graphicptr gp) } } } +#endif /* HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Allocate space for a new graphic source image of size width x height */ @@ -297,10 +296,7 @@ Imagedata *addnewimage(char *name, int width, int height) else iptr->filename = NULL; /* must be filled in later! */ iptr->refcount = 0; /* no calls yet */ - iptr->image = XCreateImage(dpy, DefaultVisual(dpy, screen), - DefaultDepth(dpy, screen), ZPixmap, 0, NULL, - width, height, 8, 0); - iptr->image->data = (char *)malloc(height * iptr->image->bytes_per_line); + iptr->image = xcImageCreate(width, height); return iptr; } @@ -323,10 +319,6 @@ graphicptr new_graphic(objinstptr destinst, char *filename, int px, int py) FILE *fg; int nr, width, height, imax, x, y, i; /* nf, (jdk) */ char id[5], c, buf[128]; - union { - u_char b[4]; - u_long i; - } pixel; locdestinst = (destinst == NULL) ? areawin->topinstance : destinst; destobject = locdestinst->thisobject; @@ -404,14 +396,13 @@ graphicptr new_graphic(objinstptr destinst, char *filename, int px, int py) iptr = addnewimage(filename, width, height); /* Read the image data from the PPM file */ - - pixel.b[3] = 0; for (y = 0; y < height; y++) for (x = 0; x < width; x++) { - fread(&pixel.b[2], 1, 1, fg); - fread(&pixel.b[1], 1, 1, fg); - fread(&pixel.b[0], 1, 1, fg); - XPutPixel(iptr->image, x, y, pixel.i); + u_char r, g, b; + fread(&r, 1, 1, fg); + fread(&g, 1, 1, fg); + fread(&b, 1, 1, fg); + xcImagePutPixel(iptr->image, x, y, r, g, b); } } @@ -421,14 +412,16 @@ graphicptr new_graphic(objinstptr destinst, char *filename, int px, int py) (*gp)->scale = 1.0; (*gp)->position.x = px; (*gp)->position.y = py; - (*gp)->rotation = 0; + (*gp)->rotation = 0.0; (*gp)->color = DEFAULTCOLOR; (*gp)->passed = NULL; - (*gp)->clipmask = (Pixmap)NULL; (*gp)->source = iptr->image; +#ifndef HAVE_CAIRO (*gp)->target = NULL; - (*gp)->trot = 0; + (*gp)->trot = 0.0; (*gp)->tscale = 0; + (*gp)->clipmask = (Pixmap)NULL; +#endif /* HAVE_CAIRO */ calcbboxvalues(locdestinst, (genericptr *)gp); updatepagebounds(destobject); @@ -453,10 +446,6 @@ graphicptr gradient_field(objinstptr destinst, int px, int py, int c1, int c2) int width, height, imax, x, y, i; int r, g, b, rd, gd, bd; char id[11]; - union { - u_char b[4]; - u_long i; - } pixel; locdestinst = (destinst == NULL) ? areawin->topinstance : destinst; destobject = locdestinst->thisobject; @@ -491,15 +480,13 @@ graphicptr gradient_field(objinstptr destinst, int px, int py, int c1, int c2) gd = (colorlist[c2].color.green >> 8) - g; bd = (colorlist[c2].color.blue >> 8) - b; - pixel.b[3] = 0; - for (y = 0; y < height; y++) { - pixel.b[2] = r + ((y * rd) / (height - 1)); - pixel.b[1] = g + ((y * gd) / (height - 1)); - pixel.b[0] = b + ((y * bd) / (height - 1)); - for (x = 0; x < width; x++) { - XPutPixel(iptr->image, x, y, pixel.i); - } - } + for (y = 0; y < height; y++) + for (x = 0; x < width; x++) { + xcImagePutPixel(iptr->image, x, y, + r + ((y * rd) / (height - 1)), + g + ((y * gd) / (height - 1)), + b + ((y * bd) / (height - 1))); + } iptr->refcount++; NEW_GRAPHIC(gp, destobject); @@ -507,14 +494,16 @@ graphicptr gradient_field(objinstptr destinst, int px, int py, int c1, int c2) (*gp)->scale = 1.0; (*gp)->position.x = px; (*gp)->position.y = py; - (*gp)->rotation = 0; + (*gp)->rotation = 0.0; (*gp)->color = DEFAULTCOLOR; (*gp)->passed = NULL; - (*gp)->clipmask = (Pixmap)NULL; (*gp)->source = iptr->image; +#ifndef HAVE_CAIRO (*gp)->target = NULL; - (*gp)->trot = 0; + (*gp)->trot = 0.0; (*gp)->tscale = 0; + (*gp)->clipmask = (Pixmap)NULL; +#endif /* HAVE_CAIRO */ calcbboxvalues(locdestinst, (genericptr *)gp); updatepagebounds(destobject); @@ -530,7 +519,7 @@ graphicptr gradient_field(objinstptr destinst, int px, int py, int c1, int c2) /* Free memory associated with the XImage structure for a graphic. */ /*----------------------------------------------------------------------*/ -void freeimage(XImage *source) +void freeimage(xcImage *source) { int i, j; Imagedata *iptr; @@ -540,12 +529,7 @@ void freeimage(XImage *source) if (iptr->image == source) { iptr->refcount--; if (iptr->refcount <= 0) { - if (iptr->image->data != NULL) { - /* Free data first, because we used our own malloc() */ - free(iptr->image->data); - iptr->image->data = NULL; - } - XDestroyImage(iptr->image); + xcImageDestroy(iptr->image); free(iptr->filename); /* Remove this from the list of images */ @@ -565,6 +549,7 @@ void freeimage(XImage *source) void freegraphic(graphicptr gp) { +#ifndef HAVE_CAIRO if (gp->target != NULL) { if (gp->target->data != NULL) { /* Free data first, because we used our own malloc() */ @@ -574,7 +559,65 @@ void freegraphic(graphicptr gp) XDestroyImage(gp->target); } if (gp->clipmask != (Pixmap)NULL) XFreePixmap(dpy, gp->clipmask); +#endif /* HAVE_CAIRO */ freeimage(gp->source); } /*----------------------------------------------------------------------*/ +/* A light wrapper around XImage, to a generalized xcImage */ +/*----------------------------------------------------------------------*/ + +#ifndef HAVE_CAIRO +xcImage *xcImageCreate(int width, int height) +{ + int screen = DefaultScreen(dpy); + xcImage *img = XCreateImage(dpy, DefaultVisual(dpy, screen), + DefaultDepth(dpy, screen), ZPixmap, 0, NULL, width, height, 8, 0); + img->data = (char *) malloc(height * img->bytes_per_line); + return img; +} + +void xcImageDestroy(xcImage *img) +{ + free(img->data); + img->data = NULL; + XDestroyImage(img); +} + +int xcImageGetWidth(xcImage *img) +{ + return img->width; +} + +int xcImageGetHeight(xcImage *img) +{ + return img->height; +} + +void xcImagePutPixel(xcImage *img, int x, int y, u_char r, u_char g, u_char b) +{ + union { + u_char b[4]; + u_long i; + } pixel; + pixel.b[3] = 0; + pixel.b[2] = r; + pixel.b[1] = g; + pixel.b[0] = b; + XPutPixel(img, x, y, pixel.i); +} + +void xcImageGetPixel(xcImage *img, int x, int y, u_char *r, u_char *g, + u_char *b) +{ + union { + u_char b[4]; + u_long i; + } pixel; + pixel.i = XGetPixel(img, x, y); + *r = pixel.b[2]; + *g = pixel.b[1]; + *b = pixel.b[0]; +} +#endif /* HAVE_CAIRO */ + diff --git a/help.c b/help.c index f392a79..e4c3eff 100644 --- a/help.c +++ b/help.c @@ -56,8 +56,8 @@ extern Display *dpy; extern GC hgc; extern XCWindowData *areawin; extern ApplicationData appdata; -extern int *appcolors; extern xcWidget top; +extern colorindex *colorlist; extern short popups; extern xcWidget menuwidgets[]; extern char *function_names[NUM_FUNCTIONS]; @@ -131,7 +131,7 @@ void printhelppix() { XCF_Dotted, "Dotted line style"}, { XCF_Solid, "Solid line style"}, { XCF_SPACER, NULL}, - { XCF_Justify, "Text Justification"}, + { XCF_Anchor, "Text Anchoring"}, { XCF_Superscript, "Text Superscript"}, { XCF_Subscript, "Text Subscript"}, { XCF_Font, "Toggle text font"}, @@ -156,6 +156,7 @@ void printhelppix() { XCF_Text_Up, "Move up one line"}, { XCF_Text_Down, "Move down one line"}, { XCF_Text_Delete, "Delete character(s)"}, + { XCF_Text_Delete_Param, "Delete parameter from text"}, { XCF_Text_Return, "End text edit"}, { XCF_Text_Split, "Split label at cursor"}, { XCF_SPACER, NULL}, @@ -195,8 +196,8 @@ void printhelppix() /* Set up the GC for drawing to the help window pixmap */ if (hgc == NULL) { - values.foreground = FOREGROUND; - values.background = BACKGROUND; + values.foreground = colorlist[FOREGROUND].color.pixel; + values.background = colorlist[BACKGROUND].color.pixel; values.graphics_exposures = False; values.font = appdata.helpfont->fid; hgc = XCreateGC(dpy, hwin, GCForeground | GCBackground | GCFont @@ -260,10 +261,10 @@ void printhelppix() helppix = XCreatePixmap(dpy, hwin, helpwidth, helpheight, DefaultDepthOfScreen(DefaultScreenOfDisplay(dpy))); - XSetForeground(dpy, hgc, FOREGROUND); + XSetForeground(dpy, hgc, colorlist[FOREGROUND].color.pixel); XFillRectangle(dpy, helppix, hgc, 0, 0, helpwidth, helpheight); - XSetForeground(dpy, hgc, BACKGROUND); + XSetForeground(dpy, hgc, colorlist[BACKGROUND].color.pixel); XDrawString(dpy, helppix, hgc, (helpwidth - XTextWidth(appdata.helpfont, helptitle, strlen(helptitle))) >> 1, t1 + 2, helptitle, strlen(helptitle)); vtmp = lineheight + 15; @@ -290,7 +291,7 @@ void printhelppix() } free(bindings); } - XSetForeground(dpy, hgc, AUXCOLOR); + XSetForeground(dpy, hgc, colorlist[AUXCOLOR].color.pixel); XDrawLine(dpy, helppix, hgc, 0, t1 + 7, helpwidth, t1 + 7); } @@ -458,7 +459,7 @@ void showhsb(xcWidget hsb, caddr_t clientdata, caddr_t calldata) XClearArea(dpy, hwin, 0, pstart + pheight, SBARSIZE, hheight - (pstart + pheight), False); - XSetForeground(dpy, hgc, BARCOLOR); + XSetForeground(dpy, hgc, colorlist[BARCOLOR].color.pixel); XFillRectangle(dpy, hwin, hgc, 0, pstart, SBARSIZE, pheight); } diff --git a/keybindings.c b/keybindings.c index b77d703..7518591 100644 --- a/keybindings.c +++ b/keybindings.c @@ -81,7 +81,7 @@ extern XCWindowData *areawin; /*--------------------------------------------------------------*/ static char *function_names[NUM_FUNCTIONS + 1] = { - "Page", "Justify", "Superscript", "Subscript", "Normalscript", + "Page", "Anchor", "Superscript", "Subscript", "Normalscript", "Nextfont", "Boldfont", "Italicfont", "Normalfont", "Underline", "Overline", "ISO Encoding", "Halfspace", "Quarterspace", "Special", "Tab Stop", "Tab Forward", "Tab Backward", @@ -620,27 +620,28 @@ void default_keybindings() add_vbinding(ALL_WINDOWS, XK_9, XCF_Page, 9); add_vbinding(ALL_WINDOWS, XK_0, XCF_Page, 10); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_1, XCF_Justify, 0); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_2, XCF_Justify, 1); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_3, XCF_Justify, 2); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_4, XCF_Justify, 3); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_5, XCF_Justify, 4); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_6, XCF_Justify, 5); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_7, XCF_Justify, 6); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_8, XCF_Justify, 7); - add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_9, XCF_Justify, 8); - - add_vbinding(ALL_WINDOWS, XK_KP_End, XCF_Justify, 0); - add_vbinding(ALL_WINDOWS, XK_KP_Down, XCF_Justify, 1); - add_vbinding(ALL_WINDOWS, XK_KP_Next, XCF_Justify, 2); - add_vbinding(ALL_WINDOWS, XK_KP_Left, XCF_Justify, 3); - add_vbinding(ALL_WINDOWS, XK_KP_Begin, XCF_Justify, 4); - add_vbinding(ALL_WINDOWS, XK_KP_Right, XCF_Justify, 5); - add_vbinding(ALL_WINDOWS, XK_KP_Home, XCF_Justify, 6); - add_vbinding(ALL_WINDOWS, XK_KP_Up, XCF_Justify, 7); - add_vbinding(ALL_WINDOWS, XK_KP_Prior, XCF_Justify, 8); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_1, XCF_Anchor, 0); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_2, XCF_Anchor, 1); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_3, XCF_Anchor, 2); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_4, XCF_Anchor, 3); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_5, XCF_Anchor, 4); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_6, XCF_Anchor, 5); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_7, XCF_Anchor, 6); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_8, XCF_Anchor, 7); + add_vbinding(ALL_WINDOWS, SHIFT | XK_KP_9, XCF_Anchor, 8); + + add_vbinding(ALL_WINDOWS, XK_KP_End, XCF_Anchor, 0); + add_vbinding(ALL_WINDOWS, XK_KP_Down, XCF_Anchor, 1); + add_vbinding(ALL_WINDOWS, XK_KP_Next, XCF_Anchor, 2); + add_vbinding(ALL_WINDOWS, XK_KP_Left, XCF_Anchor, 3); + add_vbinding(ALL_WINDOWS, XK_KP_Begin, XCF_Anchor, 4); + add_vbinding(ALL_WINDOWS, XK_KP_Right, XCF_Anchor, 5); + add_vbinding(ALL_WINDOWS, XK_KP_Home, XCF_Anchor, 6); + add_vbinding(ALL_WINDOWS, XK_KP_Up, XCF_Anchor, 7); + add_vbinding(ALL_WINDOWS, XK_KP_Prior, XCF_Anchor, 8); add_binding(ALL_WINDOWS, XK_Delete, XCF_Text_Delete); + add_binding(ALL_WINDOWS, ALT | XK_Delete, XCF_Text_Delete_Param); add_binding(ALL_WINDOWS, XK_Return, XCF_Text_Return); add_binding(ALL_WINDOWS, BUTTON1, XCF_Text_Return); add_binding(ALL_WINDOWS, XK_BackSpace, XCF_Text_Delete); diff --git a/lib/analoglib3.lps b/lib/analoglib3.lps index ece3c9d..e600a83 100644 --- a/lib/analoglib3.lps +++ b/lib/analoglib3.lps @@ -1,7 +1,7 @@ %! PostScript set of library objects for XCircuit -% Version: 3.6 +% Version: 3.9 % Library name is: analoglib3 -% Author: R. Timothy Edwards +% Author: % % Depend analoglib3::NPNModel generic::arrowhead @@ -9,6 +9,7 @@ % Depend analoglib3::ACsource analog::source analoglib2::sinusoid % Depend analoglib3::Vpwl analog::source % Depend analoglib3::Switch generic::circle generic::arrowhead +% Depend analoglib3::Vpulse analog::source % XCircuitLib library objects /analoglib3::pMOS { @@ -20,14 +21,14 @@ 1 1.000 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon 1 1.000 -52 0 8 0.000 360.000 xcarc 1.000 0.000 0.000 scb -(S) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel -(D) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel -(G) {/Times-Roman cf} 2 7 0 1.000 -64 0 pinlabel +(S) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel +(D) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel +(G) {/Times-Roman cf} 2 7 0.000 1.000 -64 0 pinlabel 0.180 0.545 0.341 scb mark @fingers ( M=) @length ( L=) @width ( W=) @model ( ) @subs ( %pD %pG %pS ) -@index @class (spice:) {/Times-Roman cf} ctmk 4 0 1.000 -196 -139 infolabel +@index @class (spice:) {/Times-Roman cf} ctmk 4 0.000 1.000 -196 -139 infolabel mark ( %x %y) @width ( ) @length (sim:p %pG %pD %pS ) {/Times-Roman cf} ctmk 4 -0 1.000 -196 -187 infolabel +0.000 1.000 -196 -187 infolabel 0.647 0.165 0.165 scb mark @fingers {hS} (=) {hS} (M) {CR} @length (=) {Tf} (L) {hS} {CR} @width (=) {Ts} (W) {/Times-Roman cf} ctmk p_jst p_rot 0.700 p_xps1 p_yps1 label @@ -38,9 +39,9 @@ mark @model {/Times-RomanISO cf} ctmk 16 p_rot 0.700 p_xps p_yps label endgate } def -1.000 90 <> /analoglib3::pMOS libinst +1.000 90.000 <> /analoglib3::pMOS libinst <> /analoglib3::pMOS libinst -1.000 90 <> /analoglib3::pMOS libinst /analoglib3::pMOS1finger { @@ -52,14 +53,14 @@ endgate 1 1.000 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon 1 1.000 -52 0 8 0.000 360.000 xcarc 1.000 0.000 0.000 scb -(S) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel -(D) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel -(G) {/Times-Roman cf} 2 7 0 1.000 -64 0 pinlabel +(S) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel +(D) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel +(G) {/Times-Roman cf} 2 7 0.000 1.000 -64 0 pinlabel 0.180 0.545 0.341 scb mark @length ( L=) @width ( W=) @model ( ) @subs ( %pD %pG %pS ) @index @class -(spice:) {/Times-Roman cf} ctmk 4 0 1.000 -196 -139 infolabel +(spice:) {/Times-Roman cf} ctmk 4 0.000 1.000 -196 -139 infolabel mark ( %x %y) @width ( ) @length (sim:p %pG %pD %pS ) {/Times-Roman cf} ctmk 4 -0 1.000 -196 -187 infolabel +0.000 1.000 -196 -187 infolabel 0.647 0.165 0.165 scb mark @length (=) {Tf} (L) {hS} {CR} @width (=) {Ts} (W) {/Times-Roman cf} ctmk p_jst p_rot 0.700 p_xps2 p_yps2 label @@ -70,9 +71,9 @@ mark @model {/Times-RomanISO cf} ctmk 16 p_rot 0.700 p_xps1 p_yps1 label endgate } def -1.000 90 <> /analoglib3::pMOS1finger libinst +1.000 90.000 <> /analoglib3::pMOS1finger libinst <> /analoglib3::pMOS1finger libinst -1.000 90 <> /analoglib3::pMOS1finger libinst /analoglib3::nMOS { @@ -83,14 +84,14 @@ endgate 1 1.000 -44 -28 -44 28 2 polygon 1 1.000 -44 0 -64 0 2 polygon 1.000 0.000 0.000 scb -(G) {/Times-Roman cf} 2 7 0 1.000 -64 0 pinlabel -(S) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel -(D) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel +(G) {/Times-Roman cf} 2 7 0.000 1.000 -64 0 pinlabel +(S) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel +(D) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel 0.180 0.545 0.341 scb mark @fingers ( m=) @length ( l=) @width ( w=) @model ( ) @subs ( %pD %pG %pS ) -@index @class (spice:) {/Times-Roman cf} ctmk 4 0 1.000 -244 -139 infolabel +@index @class (spice:) {/Times-Roman cf} ctmk 4 0.000 1.000 -244 -139 infolabel mark ( %x %y) @width ( ) @length (sim:n %pG %pD %pS ) {/Times-Roman cf} ctmk 4 -0 1.000 -244 -187 infolabel +0.000 1.000 -244 -187 infolabel 0.647 0.165 0.165 scb mark @fingers (=) {Tf} {Tf} (M) {CR} @length (=) {Tf} (L) {hS} {CR} @width (=) {Ts} (W) {/Times-Roman cf} ctmk p_jst p_rot 0.700 p_xps2 p_yps2 label @@ -101,10 +102,10 @@ mark @model {/Times-RomanISO cf} ctmk 20 p_rot 0.700 p_xps1 p_yps1 label endgate } def -1.000 90 <> /analoglib3::nMOS libinst +1.000 90.000 <> /analoglib3::nMOS libinst <> /analoglib3::nMOS libinst -1.000 90 <> /analoglib3::nMOS libinst /analoglib3::nMOS1finger { @@ -115,14 +116,14 @@ endgate 1 1.000 -44 -28 -44 28 2 polygon 1 1.000 -44 0 -64 0 2 polygon 1.000 0.000 0.000 scb -(G) {/Times-Roman cf} 2 7 0 1.000 -64 0 pinlabel -(S) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel -(D) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel +(G) {/Times-Roman cf} 2 7 0.000 1.000 -64 0 pinlabel +(S) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel +(D) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel 0.180 0.545 0.341 scb mark @length ( l=) @width ( w=) @model ( ) @subs ( %pD %pG %pS ) @index @class -(spice:) {/Times-Roman cf} ctmk 4 360 1.000 -244 -139 infolabel +(spice:) {/Times-Roman cf} ctmk 4 360.000 1.000 -244 -139 infolabel mark ( %x %y) @width ( ) @length (sim:n %pG %pD %pS ) {/Times-Roman cf} ctmk 4 -0 1.000 -244 -187 infolabel +0.000 1.000 -244 -187 infolabel 0.647 0.165 0.165 scb mark @length (=) {Tf} (L) {hS} {CR} @width (=) {Ts} (W) {/Times-Roman cf} ctmk p_jst p_rot 0.700 p_xps2 p_yps2 label @@ -133,9 +134,9 @@ mark @model {/Times-RomanISO cf} ctmk 20 p_rot 0.700 p_xps1 p_yps1 label endgate } def -1.000 90 <> /analoglib3::nMOS1finger libinst +1.000 90.000 <> /analoglib3::nMOS1finger libinst <> /analoglib3::nMOS1finger libinst -1.000 90 <> /analoglib3::nMOS1finger libinst /generic::arrowhead { @@ -160,15 +161,15 @@ endgate 1 1.000 0 48 0 64 2 polygon 1 1.000 0 -48 -48 -22 2 polygon 1 1.000 0 -48 0 -64 2 polygon -1.000 120 0 -48 generic::arrowhead +1.000 120.000 0 -48 generic::arrowhead 1.000 0.000 0.000 scb -(C) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel -(B) {/Times-Roman cf} 2 7 0 1.000 -64 0 pinlabel -(E) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel +(C) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel +(B) {/Times-Roman cf} 2 7 0.000 1.000 -64 0 pinlabel +(E) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel 0.180 0.545 0.341 scb mark @m ( M=) @length ( L=) @width ( W=) @model ( ) @subs ( %pC %pB %pE ) -@index @class (spice:) {/Times-Roman cf} ctmk 4 0 1.000 -244 -139 infolabel -(sim:b %pB %pE %pC) {/Times-Roman cf} 2 4 0 1.000 -244 -187 infolabel +@index @class (spice:) {/Times-Roman cf} ctmk 4 0.000 1.000 -244 -139 infolabel +(sim:b %pB %pE %pC) {/Times-Roman cf} 2 4 0.000 1.000 -244 -187 infolabel 0.000 0.000 1.000 scb mark @index @class {/Times-Roman cf} ctmk 16 p_rot 0.700 p_xps2 p_yps2 label sce @@ -179,7 +180,7 @@ mark @m {Tf} (=) {Tf} (M) {CR} @length {Tf} (=) {Tf} (L) {CR} @width {Ts} {hS} endgate } def -1.000 90 <> /analoglib3::NPNModel libinst +1.000 90.000 <> /analoglib3::NPNModel libinst /analoglib3::ResModel { <> /analoglib3::ResModel libinst +1.000 90.000 <> /analoglib3::ResModel libinst /analoglib3::MiMCap { <> /analoglib3::MiMCap libinst +1.000 90.000 <> /analoglib3::MiMCap libinst /analoglib3::IndModel { <> /analoglib3::IndModel libinst +1.000 90.000 <> /analoglib3::IndModel libinst /analog::source { % hidden @@ -292,15 +297,15 @@ endgate /analoglib3::Vsource { <> begingate -1.000 360 0 0 analog::source +1.000 360.000 0 0 analog::source (+) {/Symbol cf} 2 5 p_rot 1.000 0 14 label (-) {/Symbol cf} 2 5 p_rot 1.000 0 -22 label 1.000 0.000 0.000 scb -(v.p) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel -(v.m) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel +(v.p) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel +(v.m) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel 0.180 0.545 0.341 scb mark @value ( %pv.p %pv.m ) @index @class (spice:) {/Times-Roman cf} ctmk 20 -360 1.000 -96 -160 infolabel +360.000 1.000 -96 -160 infolabel 0.647 0.165 0.165 scb mark (V) {hS} @value {/Times-Roman cf} ctmk p_jst p_rot 0.700 48 -16 label 0.000 0.000 1.000 scb @@ -308,7 +313,7 @@ mark @index @class {/Times-Roman cf} ctmk 20 p_rot 0.700 p_xps p_yps label endgate } def -1.000 270 <> /analoglib3::Vsource libinst +1.000 270.000 <> /analoglib3::Vsource libinst /analoglib2::sinusoid { % hidden @@ -320,13 +325,13 @@ endgate /analoglib3::ACsource { <> begingate -1.000 0 0 0 analog::source +1.000 0.000 0 0 analog::source 1.000 0.000 0.000 scb -(s.p) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel -(s.m) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel +(s.p) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel +(s.m) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel 0.180 0.545 0.341 scb mark (\)) @units @freq ( ) @value ( ) @offset ( %ps.p %ps.m SIN\() @index -(spice:V) {/Times-Roman cf} ctmk 20 0 1.000 -336 -160 infolabel +(spice:V) {/Times-Roman cf} ctmk 20 0.000 1.000 -336 -160 infolabel 0.647 0.165 0.165 scb mark (Hz) @units {hS} @freq {CR} (offset) {ss} (V) {hS} @offset {CR} (p-p) {ss} (V) {hS} @value {/Times-Roman cf} ctmk p_jst p_rot 0.750 p_xps1 p_yps1 label @@ -337,28 +342,28 @@ mark @index (V) {/Times-RomanISO cf} ctmk 16 p_rot 0.700 p_xps p_yps label endgate } def -1.000 90 <> /analoglib3::ACsource libinst +1.000 90.000 <> /analoglib3::ACsource libinst /analoglib3::Vpwl { <> begingate -1.000 360 0 0 analog::source +1.000 360.000 0 0 analog::source (+) {/Symbol cf} 2 5 p_rot 1.000 0 14 label (-) {/Symbol cf} 2 5 p_rot 1.000 0 -22 label 1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel +(1) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel +(2) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel 0.000 0.000 1.000 scb mark @index @class {/Times-Roman cf} ctmk p_jst p_rot 0.700 p_xps p_yps label 0.180 0.545 0.341 scb mark (\)) @pwl ( %p1 %p2 PWL\() @index @class (spice:) {/Times-Roman cf} ctmk -16 0 1.000 -304 -176 infolabel +16 0.000 1.000 -304 -176 infolabel 0.647 0.165 0.165 scb mark @pwl {/Times-Roman cf} ctmk p_jst p_rot 0.700 p_xps1 p_yps1 label endgate } def -1.000 270 <> /analoglib3::Vpwl libinst +1.000 270.000 <> /analoglib3::Vpwl libinst /analoglib3::Capacitor { <> /analoglib3::Capacitor libinst +1.000 90.000 <> /analoglib3::Capacitor libinst /analoglib3::Resistor { <> /analoglib3::Resistor libinst +1.000 90.000 <> /analoglib3::Resistor libinst /generic::circle { % trivial @@ -417,8 +424,8 @@ begingate 1 1.000 16 0 6 0.000 360.000 xcarc 1 1.000 0 0 10 0 2 polygon 1.000 0.000 0.000 scb -(out) {/Times-Roman cf} 2 4 0 1.000 16 0 pinlabel -(out) {/Times-Roman cf} 2 7 0 1.000 0 0 pinlabel +(out) {/Times-Roman cf} 2 4 -0.000 1.000 16 0 pinlabel +(out) {/Times-Roman cf} 2 7 -0.000 1.000 0 0 pinlabel endgate } def @@ -426,30 +433,56 @@ endgate <> begingate 1 1.300 32 32 2 -43 2 polygon 1 0.600 8 -24 57 49.000 90.000 xcarc --1.000 90 0 -64 generic::circle -1.000 90 0 48 generic::circle +-1.000 /sv 90.000 0 -64 generic::circle +1.000 90.000 0 48 generic::circle 1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.000 0 48 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel +(1) {/Times-Roman cf} 2 9 0.000 1.000 0 48 pinlabel +(2) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel sce 1 1.000 32 -16 96 -16 2 polygon --1.000 270 16 -16 generic::arrowhead +-1.000 /sv 270.000 16 -16 generic::arrowhead 1.000 0.000 0.000 scb -(3) {/Times-Roman cf} 2 20 0 1.000 96 -16 pinlabel -(4) {/Times-Roman cf} 2 20 0 1.000 96 -48 pinlabel +(3) {/Times-Roman cf} 2 20 0.000 1.000 96 -16 pinlabel +(4) {/Times-Roman cf} 2 20 0.000 1.000 96 -48 pinlabel 0.180 0.545 0.341 scb mark @model ( %p1 %p2 %p3 %p4 ) @index @class (spice1:) {/Times-Roman cf} ctmk -16 0 0.700 -128 -192 infolabel +16 0.000 0.700 -128 -192 infolabel sce -(+) {/Symbol cf} 2 17 0 0.700 96 -8 label -(-) {/Symbol cf} 2 17 0 0.700 96 -40 label +(+) {/Symbol cf} 2 17 0.000 0.700 96 -8 label +(-) {/Symbol cf} 2 17 0.000 0.700 96 -40 label 1 1.000 96 -48 72 -48 72 -64 3 polygon 1 1.000 54 -64 90 -64 2 polygon 1 1.000 62 -72 82 -72 2 polygon 1 1.000 70 -80 74 -80 2 polygon 0.180 0.545 0.341 scb -mark ( sw) @model (spice@1:.model ) {/Times-Roman cf} ctmk 16 0 0.700 -128 -160 -infolabel +mark ( sw) @model (spice@1:.model ) {/Times-Roman cf} ctmk 16 0.000 0.700 -128 +-160 infolabel +endgate +} def + +/analoglib3::Vpulse { +<> begingate +1.000 360.000 0 0 analog::source +1.000 0.000 0.000 scb +(v.p) {/Times-Roman cf} 2 9 0.000 1.000 0 64 pinlabel +(v.m) {/Times-Roman cf} 2 13 0.000 1.000 0 -64 pinlabel +0.180 0.545 0.341 scb +mark (\)) @period ( ) @pwidth ( ) @t_fall ( ) @t_rise ( ) @t_delay ( ) @vpulse +( ) @vinit ( PULSE\() @vpulse ( %pv.p %pv.m DC=) @index @class (spice:) +{/Times-Roman cf} ctmk 20 360.000 1.000 -96 -160 infolabel +0.647 0.165 0.165 scb +mark (V) {hS} @vpulse (\261) @vinit {/Times-Roman cf} ctmk p_jst p_rot 0.700 48 +-16 label +0.000 0.000 1.000 scb +mark @index @class {/Times-Roman cf} ctmk 20 p_rot 0.700 p_xps p_yps label +sce +1 1.000 -24 -12 -16 -12 -16 12 -8 12 -8 -12 0 -12 0 12 8 12 8 -12 16 -12 16 12 +24 12 12 polygon +mark (s) @period (T=) {0.647 0.165 0.165 scb} {/Times-Roman cf} ctmk 16 0.000 +0.700 48 -52 label +(+) {/Times-Roman cf} 2 21 0.000 0.600 0 22 label endgate } def diff --git a/lib/cyrillic.enc b/lib/cyrillic.enc new file mode 100644 index 0000000..57887f4 --- /dev/null +++ b/lib/cyrillic.enc @@ -0,0 +1,39 @@ +%%BeginResource: encoding ISO8859_5Encoding +/ISO8859_5Encoding [ +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus /comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon /less /equal /greater /question +% 100 +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft /bar /braceright /asciitilde /.notdef +% 200 +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /afii10023 /afii10051 /afii10052 /afii10053 /afii10054 /afii10055 /afii10056 +/afii10057 /afii10058 /afii10059 /afii10060 /afii10061 /.notdef /afii10062 /afii10145 +/afii10017 /afii10018 /afii10019 /afii10020 /afii10021 /afii10022 /afii10024 /afii10025 +/afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032 /afii10033 +% 300 +/afii10034 /afii10035 /afii10036 /afii10037 /afii10038 /afii10039 /afii10040 /afii10041 +/afii10042 /afii10043 /afii10044 /afii10045 /afii10046 /afii10047 /afii10048 /afii10049 +/afii10065 /afii10066 /afii10067 /afii10068 /afii10069 /afii10070 /afii10072 /afii10073 +/afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080 /afii10081 +/afii10082 /afii10083 /afii10084 /afii10085 /afii10086 /afii10087 /afii10088 /afii10089 +/afii10090 /afii10091 /afii10092 /afii10093 /afii10094 /afii10095 /afii10096 /afii10097 +/.notdef /afii10071 /afii10099 /afii10100 /afii10101 /afii10102 /afii10103 /afii10104 +/afii10105 /afii10106 /afii10107 /afii10108 /afii10109 /.notdef /afii10110 /afii10193 +] def +%%EndResource diff --git a/lib/digitaltcl.lps b/lib/digitaltcl.lps index 4cb9c49..4ab3fe2 100644 --- a/lib/digitaltcl.lps +++ b/lib/digitaltcl.lps @@ -8,19 +8,19 @@ /digital::LED { % nonetwork <> begingate p_col4 scb diff --git a/lib/fonts/courier_cyrillic.xfe b/lib/fonts/courier_cyrillic.xfe new file mode 100644 index 0000000..1d0b791 --- /dev/null +++ b/lib/fonts/courier_cyrillic.xfe @@ -0,0 +1,50 @@ +% XCircuit Font encoding (XFE) file +% (Note that there are no vector font Cyrillic characters here, +% but it can be used with the Cairo graphics interface.) +name: Courier-Cyrillic +file: courier.lps +family: Courier +weight: normal +shape: normal +type: PostScript +encoding: ISO8859-5 +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar +Cr::space Cr::exclam Cr::quote Cr::pound Cr::dollar Cr::percent Cr::ampersand +Cr::apostrophe Cr::lparen Cr::rparen Cr::asterisk Cr::plus Cr::comma Cr::minus +Cr::period Cr::slash Cr::zero Cr::one Cr::two Cr::three Cr::four Cr::five +Cr::six Cr::seven Cr::eight Cr::nine Cr::colon Cr::semi Cr::less Cr::equal +Cr::more Cr::question Cr::at Cr::A Cr::B Cr::C Cr::D Cr::E Cr::F Cr::G Cr::H +Cr::I Cr::J Cr::K Cr::L Cr::M Cr::N Cr::O Cr::P Cr::Q Cr::R Cr::S Cr::T Cr::U +Cr::V Cr::W Cr::X Cr::Y Cr::Z Cr::lbracket Cr::backslash Cr::rbracket Cr::caret +Cr::underscore Cr::apostrophe Cr::a Cr::b Cr::c Cr::d Cr::e Cr::f Cr::g Cr::h +Cr::i Cr::j Cr::k Cr::l Cr::m Cr::n Cr::o Cr::p Cr::q Cr::r Cr::s Cr::t Cr::u +Cr::v Cr::w Cr::x Cr::y Cr::z Cr::lbrace Cr::vbar Cr::rbrace Cr::tilde Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar Cr::nullchar +Cr::nullchar Cr::nullchar Cr::nullchar Cr::upexclam Cr::cent +Cr::lb Cr::aslash Cr::yen Cr::itf Cr::sy1 Cr::sy2 Cr::apos2 Cr::lqt Cr::lgqt +Cr::lsang Cr::rsang Cr::fi Cr::fl Cr::x Cr::minus Cr::dag Cr::ddag Cr::dot +Cr::x Cr::para Cr::bullet Cr::comma2 Cr::rqt2 Cr::rqt Cr::rgqt Cr::dots +Cr::perzer Cr::x Cr::uqest Cr::x Cr::grave Cr::acute Cr::hat Cr::tilchar +Cr::bar Cr::uu Cr::dot Cr::umlaut Cr::x Cr::circ Cr::cedilla Cr::x +Cr::uml2 Cr::ced2 Cr::vee Cr::emdash Cr::x Cr::x Cr::x +Cr::x Cr::x Cr::x Cr::x Cr::x Cr::x +Cr::x Cr::x Cr::x Cr::x Cr::x Cr::x +Cr::x Cr::AE Cr::x Cr::ordfem Cr::x Cr::x +Cr::x Cr::x Cr::Lslash Cr::Oslash Cr::OE Cr::ordmasc Cr::x +Cr::x Cr::x Cr::x Cr::x Cr::ae Cr::x +Cr::x Cr::x Cr::onesup Cr::x Cr::x Cr::lslash +Cr::osl Cr::oe Cr::sset Cr::x Cr::x Cr::x Cr::x + +derived: Courier-Bold-Cyrillic bold normal PostScript +derived: Courier-Italic-Cyrillic normal italic PostScript +derived: Courier-BoldItalic-Cyrillic bold italic PostScript + diff --git a/lib/fonts/helvetica_cyrillic.xfe b/lib/fonts/helvetica_cyrillic.xfe new file mode 100644 index 0000000..e6414a3 --- /dev/null +++ b/lib/fonts/helvetica_cyrillic.xfe @@ -0,0 +1,50 @@ +% XCircuit Font encoding (XFE) file +% (Note that there are no vector font Cyrillic characters here, +% but it can be used with the Cairo graphics interface.) +name: Helvetica-Cyrillic +file: helvetica.lps +family: Helvetica +weight: normal +shape: normal +type: PostScript +encoding: ISO8859-5 +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar +Hv::space Hv::exclam Hv::quote Hv::pound Hv::dollar Hv::percent Hv::ampersand +Hv::apostrophe Hv::lparen Hv::rparen Hv::asterisk Hv::plus Hv::comma Hv::minus +Hv::period Hv::slash Hv::zero Hv::one Hv::two Hv::three Hv::four Hv::five +Hv::six Hv::seven Hv::eight Hv::nine Hv::colon Hv::semi +Hv::less Hv::equal Hv::more Hv::question Hv::at Hv::A Hv::B Hv::C Hv::D +Hv::E Hv::F Hv::G Hv::H Hv::I Hv::J Hv::K Hv::L Hv::M Hv::N Hv::O Hv::P +Hv::Q Hv::R Hv::S Hv::T Hv::U Hv::V Hv::W Hv::X Hv::Y Hv::Z Hv::lbracket +Hv::backslash Hv::rbracket Hv::caret Hv::underscore Hv::apostrophe Hv::a +Hv::b Hv::c Hv::d Hv::e Hv::f Hv::g Hv::h Hv::i Hv::j Hv::k Hv::l Hv::m +Hv::n Hv::o Hv::p Hv::q Hv::r Hv::s Hv::t Hv::u Hv::v Hv::w Hv::x +Hv::y Hv::z Hv::lbrace Hv::vbar Hv::rbrace Hv::tilde +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar +Hv::nullchar Hv::nullchar Hv::nullchar Hv::nullchar Hv::upexclam Hv::cent +Hv::lb Hv::aslash Hv::yen Hv::itf Hv::sy1 Hv::sy2 Hv::apos2 Hv::lqt Hv::lgqt +Hv::lsang Hv::rsang Hv::fi Hv::fl Hv::x Hv::dash Hv::dag Hv::ddag Hv::dot +Hv::x Hv::para Hv::bullet Hv::comma2 Hv::rqt2 Hv::rqt Hv::rgqt Hv::dots +Hv::perzer Hv::x Hv::uqest Hv::x Hv::grave Hv::acute Hv::hat Hv::tilchar +Hv::bar Hv::uu Hv::dot Hv::umlaut Hv::x Hv::circ Hv::cedilla Hv::x +Hv::uml2 Hv::ced2 Hv::vee Hv::emdash Hv::x Hv::x Hv::x +Hv::x Hv::x Hv::x Hv::x Hv::x Hv::x +Hv::x Hv::x Hv::x Hv::x Hv::x Hv::x +Hv::x Hv::AE Hv::x Hv::ordfem Hv::x Hv::x +Hv::x Hv::x Hv::Lslash Hv::Oslash Hv::OE Hv::ordmasc Hv::x +Hv::x Hv::x Hv::x Hv::x Hv::ae Hv::x +Hv::x Hv::x Hv::onesup Hv::x Hv::x Hv::lslash +Hv::osl Hv::oe Hv::sset Hv::x Hv::x Hv::x Hv::x + +derived: Helvetica-Bold-Cyrillic bold normal PostScript +derived: Helvetica-Oblique-Cyrillic normal italic PostScript +derived: Helvetica-BoldOblique-Cyrillic bold italic PostScript diff --git a/lib/fonts/testtest.ps b/lib/fonts/testtest.ps new file mode 100644 index 0000000..8a5e05c --- /dev/null +++ b/lib/fonts/testtest.ps @@ -0,0 +1,206 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: testtest.ps +%%Creator: XCircuit v3.9 rev63 +%%CreationDate: Mon Sep 25 21:09:24 2017 +%%Pages: 1 +%%BoundingBox: 68 68 694 604 +%%DocumentNeededResources: font Times-Roman +%%EndComments +%%BeginProlog +% +% PostScript prolog for output from xcircuit +% Version: 3.9 +% +% Electrical circuit (and otherwise general) drawing program +% +% Written by Tim Edwards 8/5/93--4/12/16 (tim@opencircuitdesign.com) +% The Johns Hopkins University (1993-2004) +% MultiGiG, Inc. (2004-2012) +% Open Circuit Design (2012-2016) +% +%%BeginResource: procset XCIRCproc 3.9 1 +% +% supporting definitions --- these are the primary xcircuit types. + +/XCIRCsave save def +/topmat matrix currentmatrix def + +/fontslant { /slant exch def [1 0 slant 1 0 0] + exch findfont exch makefont dup length dict /ndict exch def + { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall + ndict definefont pop} def +/ul { count 0 gt { dup type /stringtype eq showflag 1 eq and { gsave + currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) + false charpath flattenpath pathbbox grestore exch pop 1 index + sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 + rlineto stroke moveto } if } if } def +/ol { count 0 gt { dup type /stringtype eq showflag 1 eq and { gsave gsave + currentpoint topmat setmatrix 2 index stringwidth pop 3 index + true charpath flattenpath pathbbox grestore exch pop + exch pop topmat setmatrix (_) true charpath pathbbox grestore + exch pop 1 index sub setlinewidth exch pop currentpoint + exch 4 1 roll exch sub add moveto pop 0 rlineto stroke + moveto } if } if } def +/stW { gsave currentpoint newpath moveto true charpath flattenpath + pathbbox pop exch pop sub grestore } def +/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs + 0 currentpoint pop put} def +/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def +/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt + {currentpoint exch pop moveto exit} {pop} ifelse } for } def +/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt + {currentpoint exch pop moveto exit} {pop} ifelse } for } def +/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def +/hS { qS qS } def +/pspc 0 def +/cf0 { scalefont setfont } bind def +/Kn { dup kY add /kY exch def rmoveto } bind def +/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul + 0.33 mul neg Kn} def +/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul + 0.67 mul Kn } def +/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def +/MR { /twidth exch def } def +/CRx { } def +/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto CRx } def +/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq + { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} + {fscale0 mul fscale mul cf0} ifelse } def +/ctmk { counttomark dup 2 add -1 roll pop } bind def +/label { gsave translate 0 0 moveto dup scale neg + /rotval exch def /twidth 100000 def /just exch def just 128 and + 0 gt {/mshow {pop} def} {/mshow {show} def} ifelse just 16 and 0 + gt {gsave rotval rotate 0 1 dtransform gsave pagemat setmatrix + idtransform exch grestore 1 0 dtransform gsave pagemat setmatrix + idtransform exch grestore dup abs 1e-9 lt {pop mul 0 gt} {3 1 roll + pop pop 0 lt} ifelse grestore {-1 /rotval rotval neg def /just just + dup 3 and 1 ne {3 xor} if def} {1} ifelse exch -1e-9 lt {-1 /rotval + rotval neg def /just just dup 12 and 4 ne {12 xor} if def} {1} + ifelse scale } if /showflag 0 def /fspc pspc def /Bline 0 def + /numlines 0 def /padding 0 array def /Tabs 0 array def + /fscale 1.0 def /kY 0 def gsave /CRx { linewid padding + aload pop numlines 1 add dup /numlines exch def array astore + /padding exch def /linewid 0 def } def dup 1 add copy dup 1 0 + dtransform exch atan rotate {exch dup type /stringtype eq {gsave dup + gsave newpath 0 0 moveto true charpath flattenpath pathbbox pop exch + pop exch pop grestore currentpoint pop add dup /linewid exch def twidth + ge {grestore CR exch 1 add dup 2 add {CR} exch 1 roll exch} {grestore} + ifelse true charpath flattenpath} {dup type /arraytype eq {exec} {12 + string cvs true charpath flattenpath} ifelse} ifelse} repeat + CRx /CRx {padding aload pop just 1280 and 0 gt {blockwid exch sub just + 1024 and 0 gt {0.5 mul} if} {pop 0} ifelse 0 rmoveto numlines 1 sub + dup /numlines exch def array astore /padding exch def} def exch pop + pathbbox grestore 4 copy pop exch pop exch sub /blockwid exch def + 3 -1 roll pop 3 1 roll just 1 and 0 gt {just 2 and + 0 gt {exch pop neg fspc sub} {exch sub 0.5 mul neg} ifelse} {pop neg + fspc add} ifelse exch Bline exch just 4 and 0 gt {just 8 and 0 gt + {exch pop neg fspc sub} {add 0.5 mul neg} ifelse} {pop neg fspc add} + ifelse rotval rotate Kn currentpoint translate /showflag 1 def /Bline + 0 def /Tabs 0 array def /fscale 1.0 def /kY 0 def CRx {dup type + /stringtype eq {mshow} {dup type /arraytype eq {exec} {12 string cvs + mshow} ifelse} ifelse} repeat grestore endclip} def +/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 10 def label + /pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def +/pinglobal { pinlabel } def +/infolabel { pinlabel } def +/graphic { gsave 4 index cvx exec /DataSource get resetfile translate 0 0 + moveto neg rotate dup scale cvx exec image grestore endclip} def + +/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def +/cRedef {/defColor currentcolor 3 array astore def} def +/begingate {dup type /dicttype ne {1 dict} if begin % default params + dup type /dicttype ne {1 dict} if begin % instanced params + /hlevel hlevel 1 add def /defColor currentcolor sce 3 array astore + def gsave sce translate 0 0 moveto neg rotate dup type /nametype + eq not { dup abs currentlinewidth exch div setlinewidth } { pop } + ifelse dup abs scale clipped 1 and 1 eq {/clipped clipped 1 add def} + if} bind def +/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef + scb end end endclip} bind def + +/hlevel 0 def +/endclip {clipped 1 and 1 eq {grestore /clipped clipped 1 sub def} if} def +/tmpa [1 0 0 1 0 0] def +/gar {8 8 true tmpa {} imagemask} bind +{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind +{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind +{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind +{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind +{8 8 true tmpa {} imagemask} bind +{8 8 true tmpa {} imagemask} bind 7 array astore def +/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll + neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy + gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll + { 3 index exch 5 exch put dup -8 3 index { 3 index + exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def +/setstyles { + currentlinewidth mul setlinewidth /style exch def style 2048 and 0 gt + clipped 1 and 0 eq and {clip newpath /clipped clipped 1 add def} { + style 1 and 0 gt not {closepath} if + style 1024 and 0 gt {2 setlinecap 0 setlinejoin} if + style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if + style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if + gsave style 16 and 0 gt { style 224 and -5 bitshift style 256 and 0 gt { + 7 exch sub 8 div dup 1 exch sub currentrgbcolor 3 array astore + {3 copy mul add 4 1 roll pop} forall pop pop setrgbcolor eofill} + {dup 7 lt {gar exch get ppaint} {pop eofill} ifelse} ifelse} + {style 256 and 0 gt {1 setgray eofill} if} ifelse grestore style 8 and 0 gt + style 512 eq or {newpath} {stroke} ifelse grestore endclip} ifelse} def + +/addtoy {exch dup dup 2 mul 3 add 1 roll -1 1 { 4 1 roll dup 4 1 roll add + 4 -1 roll 2 mul 1 add index 2 mul 2 add 2 roll} for pop} def +/addtoy1 {1 exch addtoy pop} def +/addtoy3 {3 exch addtoy pop} def +/addtoy4 {4 exch addtoy pop} def +/addtox {exch dup dup 2 mul 3 add 1 roll -1 1 { 4 1 roll dup 4 1 roll 3 -1 roll + add exch 4 -1 roll 2 mul 1 add index 2 mul 2 add 2 roll} for pop} def +/addtox1 {1 exch addtox pop} def +/addtox3 {3 exch addtox pop} def +/addtox4 {4 exch addtox pop} def +/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def +/xcarc { gsave newpath arc setstyles } def +/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll + 3 index div 1 scale } def +/ele { 0 4 1 roll 0 4 1 roll } bind def +/ellipse { gsave elb newpath ele arc setmatrix setstyles } def +/pellip { elb ele arc setmatrix } def +/nellip { elb ele arcn setmatrix } def +/spline { gsave moveto curveto setstyles } def +/polyc { {lineto} repeat } bind def +/beginpath { gsave moveto } bind def +/endpath { setstyles } bind def +/bop { 1 setlinecap 2 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef + /clipped 0 def} def +/psinsertion {/PSobj save def /showpage {} def /setpagedevice {pop} def bop + rotate translate dup scale} def +/end_insert {PSobj restore} def +/setpagemat {/pagemat matrix currentmatrix def} def +/inchscale {setpagemat 0.375 mul dup scale} def +/cmscale {setpagemat 0.35433071 mul dup scale} def + +%%EndResource +%%EndProlog +% XCircuit output starts here. + +%%BeginSetup + + +%%EndSetup + +%%Page: testtest 1 +%%PageOrientation: Portrait +%%PageBoundingBox: 72 72 690 600 +/pgsave save def bop +1.0000 inchscale +2.6000 setlinewidth 992 896 translate + +0.679 1.000 0.184 scb +512 1.000 -800 -704 -800 704 848 704 848 -704 4 polygon +sce +(this page has a bounding box.) {/Times-Roman cf} 2 16 0.000 0.700 -336 288 +label +pgsave restore showpage + +%%Trailer +XCIRCsave restore +%%EOF diff --git a/lib/fonts/times_roman_cyrillic.xfe b/lib/fonts/times_roman_cyrillic.xfe new file mode 100644 index 0000000..1e7b15c --- /dev/null +++ b/lib/fonts/times_roman_cyrillic.xfe @@ -0,0 +1,51 @@ +% XCircuit Font encoding (XFE) file +% (Note that there are no vector font Cyrillic characters here, +% but it can be used with the Cairo graphics interface.) +name: Times-Roman-Cyrillic +file: times_roman.lps +family: Times-Roman +weight: normal +shape: normal +type: PostScript +encoding: ISO8859-5 +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar +TR::space TR::exclam TR::quote TR::pound TR::dollar TR::percent TR::ampersand +TR::apostrophe TR::lparen TR::rparen TR::asterisk TR::plus TR::comma TR::minus +TR::period TR::slash TR::zero TR::one TR::two TR::three TR::four TR::five +TR::six TR::seven TR::eight TR::nine TR::colon TR::semi TR::less TR::equal +TR::more TR::question TR::at TR::A TR::B TR::C TR::D TR::E TR::F TR::G TR::H +TR::I TR::J TR::K TR::L TR::M TR::N TR::O TR::P TR::Q TR::R TR::S TR::T TR::U +TR::V TR::W TR::X TR::Y TR::Z TR::lbracket TR::backslash TR::rbracket +TR::caret TR::underscore TR::apostrophe TR::a TR::b TR::c TR::d TR::e +TR::f TR::g TR::h TR::i TR::j TR::k TR::l TR::m TR::n TR::o TR::p TR::q +TR::r TR::s TR::t TR::u TR::v TR::w TR::x TR::y TR::z TR::lbrace TR::vbar +TR::rbrace TR::tilde +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar TR::nullchar +TR::upexclam TR::cent TR::lb TR::aslash TR::yen TR::itf TR::sy1 TR::sy2 +TR::apos2 TR::lqt TR::lgqt TR::lsang TR::rsang TR::fi TR::fl TR::x +TR::minus TR::dag TR::ddag TR::dot TR::x TR::para TR::bullet TR::comma2 +TR::rqt2 TR::rqt TR::rgqt TR::dots TR::perzer TR::x TR::uqest TR::x +TR::grave TR::acute TR::hat TR::tilchar TR::bar TR::uu TR::dot TR::umlaut +TR::x TR::circ TR::cedilla TR::x TR::uml2 TR::ced2 TR::vee TR::emdash +TR::x TR::x TR::x TR::x TR::x +TR::x TR::x TR::x TR::x TR::x TR::x +TR::x TR::x TR::x TR::x TR::x TR::AE +TR::x TR::ordfem TR::x TR::x TR::x TR::x +TR::Lslash TR::Oslash TR::OE TR::ordmasc TR::x TR::x +TR::x TR::x TR::x TR::ae TR::x TR::x +TR::x TR::onesup TR::x TR::x TR::lslash TR::osl TR::oe +TR::sset TR::x TR::x TR::x TR::x + +derived: Times-Bold-Cyrillic bold normal PostScript +derived: Times-Italic-Cyrillic normal italic PostScript +derived: Times-BoldItalic-Cyrillic bold italic PostScript diff --git a/lib/isolatin2.enc b/lib/isolatin2.enc new file mode 100644 index 0000000..5fcccfd --- /dev/null +++ b/lib/isolatin2.enc @@ -0,0 +1,39 @@ +%%BeginResource: encoding ISOLatin2Encoding +/ISOLatin2Encoding [ +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus /comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon /less /equal /greater /question +% 100 +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft /bar /braceright /asciitilde /.notdef +% 200 +/.notdef /emdash /AE /ordfeminine /Oslash /OE /ordmasculine /ae +/dotlessi /oslash /oe /threesuperior /thorn /twosuperior /threequarters /Eth +/trademark /registered /onequarter /Thorn /logicalnot /plusminus /minus /onesuperior +/copyright /mu /eth /brokenbar /onehalf /dotlessj /Euro /.notdef +/space /Aogonek /breve /Lslash /currency /Lcaron /Sacute /section +/dieresis /Scaron /Scedilla /Tcaron /Zacute /hyphen /Zcaron /Zdotaccent +/degree /aogonek /ogonek /lslash /acute /lcaron /sacute /caron +/cedilla /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent +% 300 +/Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla +/Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron +/Eth /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply +/Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcedilla /germandbls +/racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla +/ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron +/dbar /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide +/rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcedilla /dotaccent +] def +%%EndResource diff --git a/lib/isolatin5.enc b/lib/isolatin5.enc new file mode 100644 index 0000000..c2b7b7c --- /dev/null +++ b/lib/isolatin5.enc @@ -0,0 +1,40 @@ +%%BeginResource: encoding ISOLatin5Encoding +/ISOLatin5Encoding [ +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus /comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon /less /equal /greater /question +% 100 +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft /bar /braceright /asciitilde /.notdef +% 200 +/.notdef /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger +/daggerdbl /circumflex /perthousand /Scaron /guilsinglleft /OE /.notdef +/.notdef /.notdef /.notdef /quoteleft /quoteright /quotedblleft +/quotedblright /bullet /endash /emdash /tilde /trademark /scaron +/guilsinglright /oe /.notdef /.notdef /Ydieresis +/space /exclamdown /cent /sterling /currency /yen /brokenbar /section +/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron +/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /bullet +/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown +% 300 +/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis +/Gbreve /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply +/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Idotaccent /Scedilla /germandbls +/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla +/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis +/gbreve /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide +/oslash /ugrave /uacute /ucircumflex /udieresis /dotlessi /scedilla /ydieresis +] def +%%EndResource diff --git a/lib/tcl/bparams.tcl b/lib/tcl/bparams.tcl index 55c7198..8bf3de5 100644 --- a/lib/tcl/bparams.tcl +++ b/lib/tcl/bparams.tcl @@ -10,7 +10,7 @@ bind .xcircuit.mainframe.mainarea.drawing { \ if {[eventmode] == "normal" && [select get] == {} \ && [select here] != {}} { - xcircuit::prompteditparams {substring numeric expression} + xcircuit::prompteditparams } else { standardaction %b down %s } diff --git a/lib/tcl/edif.tcl b/lib/tcl/edif.tcl index c1dc5bc..3cd5c7f 100644 --- a/lib/tcl/edif.tcl +++ b/lib/tcl/edif.tcl @@ -241,44 +241,44 @@ proc parse_geometry {elemtype elemdata} { foreach dtext $dparams { set dtk [lindex $dtext 0] switch $dtk { - justify { + anchor { set jval [lindex $dtext 1] switch $jval { UPPERRIGHT { - label $handle justify top - label $handle justify right + label $handle anchor top + label $handle anchor right } CENTERRIGHT { - label $handle justify middle - label $handle justify right + label $handle anchor middle + label $handle anchor right } LOWERRIGHT { - label $handle justify bottom - label $handle justify right + label $handle anchor bottom + label $handle anchor right } UPPERCENTER { - label $handle justify top - label $handle justify center + label $handle anchor top + label $handle anchor center } CENTERCENTER { - label $handle justify middle - label $handle justify center + label $handle anchor middle + label $handle anchor center } LOWERCENTER { - label $handle justify bottom - label $handle justify center + label $handle anchor bottom + label $handle anchor center } UPPERLEFT { - label $handle justify top - label $handle justify left + label $handle anchor top + label $handle anchor left } CENTERLEFT { - label $handle justify middle - label $handle justify left + label $handle anchor middle + label $handle anchor left } LOWERLEFT { - label $handle justify bottom - label $handle justify left + label $handle anchor bottom + label $handle anchor left } } } diff --git a/lib/tcl/files.tcl b/lib/tcl/files.tcl index 6a8f075..34394e3 100644 --- a/lib/tcl/files.tcl +++ b/lib/tcl/files.tcl @@ -51,6 +51,7 @@ proc xcircuit::writeall {} { technology save $tname } } else { + page ${pageno} update page ${pageno} save } } diff --git a/lib/tcl/mousehint.tcl b/lib/tcl/mousehint.tcl index 9d1e8d4..66fda5c 100644 --- a/lib/tcl/mousehint.tcl +++ b/lib/tcl/mousehint.tcl @@ -10,11 +10,11 @@ proc xcircuit::automousehint {window} { set frame [winfo top $window] - set btext [bindkey $window -compat Button1] + set btext [$window bindkey -compat Button1] ${frame}.infobar.mousehints.left configure -text $btext - set btext [bindkey $window -compat Button2] + set btext [$window bindkey -compat Button2] ${frame}.infobar.mousehints.middle configure -text $btext - set btext [bindkey $window -compat Button3] + set btext [$window bindkey -compat Button3] ${frame}.infobar.mousehints.right configure -text $btext } @@ -46,6 +46,7 @@ proc xcircuit::mousehint_create {name} { mousehint_bindings ${name} ${name}.infobar.mousehints + xcircuit::automousehint ${name}.mainframe.mainarea.drawing xcircuit::mousehint_show ${name} } @@ -79,24 +80,24 @@ proc xcircuit::mousehint_hide { name } { #------------------------------------------------------------------------ # Highlights buttons on the mouse_canvas when the user # presses the corresponding mouse buttons -# Seems unnescesary, but without it who would guess that those +# Seems unnecessary, but without it who would guess that those # rectangles are supposed to look like mouse buttons? #------------------------------------------------------------------------ proc xcircuit::mousehint_bindings { name mouse_frame } { - bind all "${mouse_frame}.left configure -state active ; \ + bind ${name} "${mouse_frame}.left configure -state active ; \ xcircuit::automousehint ${name}.mainframe.mainarea.drawing" - bind all "${mouse_frame}.middle configure -state active ; \ + bind ${name} "${mouse_frame}.middle configure -state active ; \ xcircuit::automousehint ${name}.mainframe.mainarea.drawing" - bind all "${mouse_frame}.right configure -state active ; \ + bind ${name} "${mouse_frame}.right configure -state active ; \ xcircuit::automousehint ${name}.mainframe.mainarea.drawing" - bind all "${mouse_frame}.left configure -state normal" - bind all "${mouse_frame}.middle configure -state normal" - bind all "${mouse_frame}.right configure -state normal" + bind ${name} "${mouse_frame}.left configure -state normal" + bind ${name} "${mouse_frame}.middle configure -state normal" + bind ${name} "${mouse_frame}.right configure -state normal" - bind all "xcircuit::automousehint ${name}.mainframe.mainarea.drawing" + bind ${name} "xcircuit::automousehint ${name}.mainframe.mainarea.drawing" bind ${mouse_frame}.title "::xcircuit::mousehint_hide ${name}" } diff --git a/lib/tcl/resource.tcl b/lib/tcl/resource.tcl index 4700e97..8d2550c 100644 --- a/lib/tcl/resource.tcl +++ b/lib/tcl/resource.tcl @@ -2,77 +2,99 @@ # XCircuit Resource setup for TCL #-------------------------------- -option add *xcircuit.width 1200 -option add *xcircuit.height 930 -option add *xcircuit*activeBackground #a07650 -option add *xcircuit*foreground #a07650 -option add *xcircuit*activeForeground beige -option add *xcircuit*font -*-times-medium-r-normal--12-* - -option add *xcircuit1.width 900 -option add *xcircuit1.height 700 -option add *xcircuit1*activeBackground #a07650 -option add *xcircuit1*foreground #a07650 -option add *xcircuit1*activeForeground beige -option add *xcircuit1*font -*-times-medium-r-normal--12-* - -option add *xcircuit2.width 700 -option add *xcircuit2.height 500 -option add *xcircuit2*activeBackground #a07650 -option add *xcircuit2*foreground #a07650 -option add *xcircuit2*activeForeground beige -option add *xcircuit2*font -*-times-medium-r-normal--12-* - -option add *menubar.filebutton*background beige -option add *menubar.editbutton*background beige -option add *menubar.textbutton*background beige -option add *menubar.optionsbutton*background beige -option add *menubar.windowbutton*background beige -option add *menubar.netlistbutton*background beige -option add *menubar*font -*-times-bold-r-normal--12-* - -option add *librarymenu*activeBackground #805630 -option add *librarymenu*foreground #805630 -option add *librarymenu*activeForeground beige -option add *librarymenu*font -*-times-medium-r-normal--12-* -option add *librarymenu*background beige - -option add *pagemenu*activeBackground #805630 -option add *pagemenu*foreground #805630 -option add *pagemenu*activeForeground beige -option add *pagemenu*font -*-times-medium-r-normal--12-* -option add *pagemenu*background beige - -option add *filelist*activeBackground #805630 -option add *filelist*foreground #805630 -option add *filelist*background white -option add *filelist*activeForeground beige -option add *filelist*font -*-times-medium-r-normal--12-* -option add *filelist*txt*font -*-courier-medium-r-normal--12-* - -option add *output*activeBackground #805630 -option add *output*foreground #805630 -option add *output*background white -option add *output*activeForeground beige -option add *output*font -*-times-medium-r-normal--12-* -option add *output*txt*font -*-courier-medium-r-normal--12-* - -option add *output.textent.butp.psmenu*background beige -option add *output.textent.txtf.sizb.sizemenu*background beige -option add *output.textent.buto.orientmenu*background beige - -option add *help*activeBackground #805630 -option add *help*foreground #805630 -option add *help*background white -option add *help*activeForeground beige -option add *help*font -*-times-medium-r-normal--12-* -option add *help*txt*font -*-times-courier-r-normal--12-* - -option add *dialog*activeBackground #805630 -option add *dialog*foreground #805630 -option add *dialog*background white -option add *dialog*activeForeground beige -option add *dialog*font -*-times-medium-r-normal--12-* -option add *dialog*txt*font -*-courier-medium-r-normal--12-* +option add *background #a07650 startupFile +option add *borderwidth 1 startupFile + +option add *mainarea.corner.background brown4 startupFile +option add *message.background beige startupFile +option add *message1.background beige startupFile +option add *message2.background beige startupFile + +option add *xcircuit.width 1200 startupFile +option add *xcircuit.height 930 startupFile +option add *xcircuit*activeBackground #a07650 startupFile +option add *xcircuit*foreground #a07650 startupFile +option add *xcircuit*activeForeground beige startupFile +option add *xcircuit*font -*-times-medium-r-normal--12-* startupFile + +option add *xcircuit1.width 900 startupFile +option add *xcircuit1.height 700 startupFile +option add *xcircuit1*activeBackground #a07650 startupFile +option add *xcircuit1*foreground #a07650 startupFile +option add *xcircuit1*activeForeground beige startupFile +option add *xcircuit1*font -*-times-medium-r-normal--12-* startupFile + +option add *xcircuit2.width 700 startupFile +option add *xcircuit2.height 500 startupFile +option add *xcircuit2*activeBackground #a07650 startupFile +option add *xcircuit2*foreground #a07650 startupFile +option add *xcircuit2*activeForeground beige startupFile +option add *xcircuit2*font -*-times-medium-r-normal--12-* startupFile + +option add *menubar.filebutton*background beige startupFile +option add *menubar.editbutton*background beige startupFile +option add *menubar.textbutton*background beige startupFile +option add *menubar.optionsbutton*background beige startupFile +option add *menubar.windowbutton*background beige startupFile +option add *menubar.netlistbutton*background beige startupFile +option add *menubar*font -*-times-bold-r-normal--12-* startupFile + +option add *librarymenu*activeBackground #805630 startupFile +option add *librarymenu*foreground #805630 startupFile +option add *librarymenu*activeForeground beige startupFile +option add *librarymenu*font -*-times-medium-r-normal--12-* startupFile +option add *librarymenu*background beige startupFile + +option add *pagemenu*activeBackground #805630 startupFile +option add *pagemenu*foreground #805630 startupFile +option add *pagemenu*activeForeground beige startupFile +option add *pagemenu*font -*-times-medium-r-normal--12-* startupFile +option add *pagemenu*background beige startupFile + +option add *filelist*activeBackground #805630 startupFile +option add *filelist*foreground #805630 startupFile +option add *filelist*background white startupFile +option add *filelist*activeForeground beige startupFile +option add *filelist*font -*-times-medium-r-normal--12-* startupFile +option add *filelist*txt*font -*-courier-medium-r-normal--12-* startupFile + +option add *output*activeBackground #805630 startupFile +option add *output*foreground #805630 startupFile +option add *output*background white startupFile +option add *output*activeForeground beige startupFile +option add *output*font -*-times-medium-r-normal--12-* startupFile +option add *output*txt*font -*-courier-medium-r-normal--12-* startupFile + +option add *output.textent.butp.psmenu*background beige startupFile +option add *output.textent.txtf.sizb.sizemenu*background beige startupFile +option add *output.textent.buto.orientmenu*background beige startupFile + +option add *help*activeBackground #805630 startupFile +option add *help*foreground #805630 startupFile +option add *help*background white startupFile +option add *help*activeForeground beige startupFile +option add *help*font -*-times-medium-r-normal--12-* startupFile +option add *help*txt*font -*-times-courier-r-normal--12-* startupFile + +option add *dialog*activeBackground #805630 startupFile +option add *dialog*foreground #805630 startupFile +option add *dialog*background white startupFile +option add *dialog*activeForeground beige startupFile +option add *dialog*font -*-times-medium-r-normal--12-* startupFile +option add *dialog*txt*font -*-courier-medium-r-normal--12-* startupFile + +option add *makesymbol*activeBackground #805630 startupFile +option add *makesymbol*foreground #805630 startupFile +option add *makesymbol*background white startupFile +option add *makesymbol*activeForeground beige startupFile +option add *makesymbol*font -*-times-medium-r-normal--12-* startupFile +option add *makesymbol*txt*font -*-courier-medium-r-normal--12-* startupFile + +option add *savetech*activeBackground #805630 startupFile +option add *savetech*foreground #805630 startupFile +option add *savetech*background white startupFile +option add *savetech*activeForeground beige startupFile +option add *savetech*font -*-times-medium-r-normal--12-* startupFile +option add *savetech*txt*font -*-courier-medium-r-normal--12-* startupFile # End of Resource configuration file. diff --git a/lib/tcl/symbol.tcl b/lib/tcl/symbol.tcl index 8197978..9198205 100644 --- a/lib/tcl/symbol.tcl +++ b/lib/tcl/symbol.tcl @@ -34,6 +34,7 @@ proc xcircuit::getsubckttext {name} { } } } + deselect selected return "" } @@ -57,8 +58,8 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { config suspend true ;# suspend graphics and change count - set techname [.dialog.techself.techselect cget -text] - set symbolname [.dialog.textent.txt get] + set techname [.makesymbol.techself.techselect cget -text] + set symbolname [.makesymbol.textent.txt get] if {[string length $symbolname] == 0} { set symbolname [page label] if {[string length $symbolname] == 0 || [string first "Page " $symbolname] >= 0} { @@ -80,6 +81,7 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { # Therefore, create an object but don't use xcircuit::symbol if {$filename == ""} { + deselect selected xcircuit::symbol make ${techname}${symbolname} $XCOps(library); set schematicname [schematic get] set noschem 0 @@ -98,10 +100,10 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { foreach j $oldpinlabels { delete $j } - set leftpins [.dialog.pinself.left.list index end] - set toppins [.dialog.pinself.top.list index end] - set rightpins [.dialog.pinself.right.list index end] - set botpins [.dialog.pinself.bottom.list index end] + set leftpins [.makesymbol.pinself.left.list index end] + set toppins [.makesymbol.pinself.top.list index end] + set rightpins [.makesymbol.pinself.right.list index end] + set botpins [.makesymbol.pinself.bottom.list index end] set hpins $leftpins if {$rightpins > $leftpins} {set hpins $rightpins} @@ -135,14 +137,14 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { for {set j 0} {$j < $rightpins} {incr j} { set tabx [expr $x - $qtrspace] polygon make 2 "$x $y" "$tabx $y" - set pintext [.dialog.pinself.right.list get $j] + set pintext [.makesymbol.pinself.right.list get $j] lappend pinlabels $pintext set tlab [label make pin "$pintext" "$x $y"] - label $tlab justify left - label $tlab justify middle + label $tlab anchor left + label $tlab anchor middle set nlab [element $tlab copy relative "-$halfspace 0"] label $nlab type normal - label $nlab justify right + label $nlab anchor right incr y $pinspace deselect selected } @@ -151,14 +153,14 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { for {set j 0} {$j < $leftpins} {incr j} { set tabx [expr $x + $qtrspace] polygon make 2 "$x $y" "$tabx $y" - set pintext [.dialog.pinself.left.list get $j] + set pintext [.makesymbol.pinself.left.list get $j] lappend pinlabels $pintext set tlab [label make pin "$pintext" "$x $y"] - label $tlab justify right - label $tlab justify middle + label $tlab anchor right + label $tlab anchor middle set nlab [element $tlab copy relative "$halfspace 0"] label $nlab type normal - label $nlab justify left + label $nlab anchor left incr y $pinspace deselect selected } @@ -167,15 +169,15 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { for {set j 0} {$j < $botpins} {incr j} { set taby [expr $y + $qtrspace] polygon make 2 "$x $y" "$x $taby" - set pintext [.dialog.pinself.bottom.list get $j] + set pintext [.makesymbol.pinself.bottom.list get $j] lappend pinlabels $pintext set tlab [label make pin "$pintext" "$x $y"] rotate $tlab 270 - label $tlab justify right - label $tlab justify middle + label $tlab anchor right + label $tlab anchor middle set nlab [element $tlab copy relative "0 $halfspace"] label $nlab type normal - label $nlab justify left + label $nlab anchor left incr x $pinspace deselect selected } @@ -184,23 +186,23 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { for {set j 0} {$j < $toppins} {incr j} { set taby [expr $y - $qtrspace] polygon make 2 "$x $y" "$x $taby" - set pintext [.dialog.pinself.top.list get $j] + set pintext [.makesymbol.pinself.top.list get $j] lappend pinlabels $pintext set tlab [label make pin "$pintext" "$x $y"] rotate $tlab 90 - label $tlab justify right - label $tlab justify middle + label $tlab anchor right + label $tlab anchor middle set nlab [element $tlab copy relative "0 -$halfspace"] label $nlab type normal - label $nlab justify left + label $nlab anchor left incr x $pinspace deselect selected } deselect selected set nlab [label make "$symbolname" {0 0}] - label $nlab justify middle - label $nlab justify center + label $nlab anchor middle + label $nlab anchor center element $nlab color set blue deselect selected @@ -213,7 +215,7 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { } set nlab [label make "{Parameter class} {Parameter index}" "0 -$pinspace"] - label $nlab justify center + label $nlab anchor center element $nlab color set blue deselect selected @@ -245,7 +247,7 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { set x [expr ([lindex $bbox 2] + [lindex $bbox 0]) / 2] set y [expr [lindex $bbox 1] - $pinspace] set nlab [label make info "$subckttext" "$x $y"] - label $nlab justify center + label $nlab anchor center deselect selected set y [expr $y - $pinspace] set nlab [label make info "spice-1:.ends" "$x $y"] @@ -283,7 +285,7 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { deselect selected set nlab [label make info "$itext" "0 $y"] - label $nlab justify center + label $nlab anchor center if {$noschem == 1} { deselect selected @@ -294,7 +296,7 @@ proc xcircuit::makesymbol {{filename ""} {orderedpins ""}} { set itext [list {Text "spice@1:%F"}] lappend itext [subst {Text "$filename"}] set nlab [label make info "$itext" "0 $y"] - label $nlab justify center + label $nlab anchor center deselect selected pop } else { @@ -353,19 +355,19 @@ proc xcircuit::getpinlist {schematicname} { #--------------------------------------------------------------------------- proc xcircuit::getselectedpinwidget {} { - set w .dialog.pinself.left.list + set w .makesymbol.pinself.left.list set result [$w curselection] if {$result != {}} {return $w} - set w .dialog.pinself.top.list + set w .makesymbol.pinself.top.list set result [$w curselection] if {$result != {}} {return $w} - set w .dialog.pinself.right.list + set w .makesymbol.pinself.right.list set result [$w curselection] if {$result != {}} {return $w} - set w .dialog.pinself.bottom.list + set w .makesymbol.pinself.bottom.list set result [$w curselection] if {$result != {}} {return $w} } @@ -392,7 +394,7 @@ proc xcircuit::movepinleft {} { set idx [$w curselection] set pinname [$w get $idx] $w delete $idx - .dialog.pinself.left.list insert end $pinname + .makesymbol.pinself.left.list insert end $pinname $w selection set $idx } } @@ -407,7 +409,7 @@ proc xcircuit::movepintop {} { set idx [$w curselection] set pinname [$w get $idx] $w delete $idx - .dialog.pinself.top.list insert end $pinname + .makesymbol.pinself.top.list insert end $pinname $w selection set $idx } @@ -423,7 +425,7 @@ proc xcircuit::movepinright {} { set idx [$w curselection] set pinname [$w get $idx] $w delete $idx - .dialog.pinself.right.list insert end $pinname + .makesymbol.pinself.right.list insert end $pinname $w selection set $idx } } @@ -438,7 +440,7 @@ proc xcircuit::movepinbottom {} { set idx [$w curselection] set pinname [$w get $idx] $w delete $idx - .dialog.pinself.bottom.list insert end $pinname + .makesymbol.pinself.bottom.list insert end $pinname $w selection set $idx } } @@ -491,6 +493,8 @@ proc xcircuit::addpinarranger {w {pinlist {}}} { # If so, we pass the ordered list to the symbol construction routine, and # we also prevent symbol pins from being deleted. + config suspend true ;# suspend graphics and change count + if {$pinlist == {}} { set pinlist [xcircuit::getpinlist [page label]] if {[xcircuit::getsubckttext [page label]] != {}} { @@ -543,6 +547,7 @@ proc xcircuit::addpinarranger {w {pinlist {}}} { button ${w}.bbar.movebottom -text "Move Bottom" -bg beige -command \ {xcircuit::movepinbottom} } + config suspend false if {$orderedpins == 0} { pack ${w}.bbar.remove -side left -ipadx 10 @@ -569,38 +574,27 @@ proc xcircuit::removepinarranger {w} { } } -#--------------------------------------------------------------------------- -# Redefine popupdialog to remove the pin arranger any time it is invoked. -#--------------------------------------------------------------------------- - -proc xcircuit::popupdialog {} { - xcircuit::removepinarranger .dialog - xcircuit::removelists .dialog - wm deiconify .dialog - focus .dialog.textent.txt -} - #--------------------------------------------------------------------------- # Redefine the procedure for the "Make Matching Symbol" menu button. #--------------------------------------------------------------------------- proc xcircuit::promptmakesymbol {{name ""}} { global XCOps - .dialog.bbar.okay configure -command \ + .makesymbol.bbar.okay configure -command \ {if {[string first "Page " [page label]] >= 0} { \ - page label [.dialog.textent.txt get]}; \ + page label [.makesymbol.textent.txt get]}; \ xcircuit::makesymbol; \ - wm withdraw .dialog} - .dialog.textent.title.field configure -text "Confirm symbol name:" - .dialog.textent.txt delete 0 end + wm withdraw .makesymbol} + .makesymbol.textent.title.field configure -text "Confirm symbol name:" + .makesymbol.textent.txt delete 0 end if {[string length $name] == 0 && [string first "Page " [page label]] < 0} { set name [page label]} - .dialog.textent.txt insert 0 $name + .makesymbol.textent.txt insert 0 $name - xcircuit::popupdialog - xcircuit::addtechlist .dialog "Technology: " - xcircuit::addliblist .dialog "Place in: " - xcircuit::addpinarranger .dialog + xcircuit::popupdialog .makesymbol + xcircuit::addtechlist .makesymbol "Technology: " + xcircuit::addliblist .makesymbol "Place in: " + xcircuit::addpinarranger .makesymbol } #--------------------------------------------------------------------------- @@ -631,17 +625,17 @@ proc xcircuit::spice2symbol {filename {subcktname ""}} { if {[string length $infolabel] == 0} {return} set pinlabels [lrange $infolabel 2 end] - .dialog.bbar.okay configure -command \ + .makesymbol.bbar.okay configure -command \ "if {[string first {Page } [page label]] >= 0} { \ - page label [.dialog.textent.txt get]}; \ + page label [.makesymbol.textent.txt get]}; \ xcircuit::makesymbol $filename [list $pinlabels]; \ - wm withdraw .dialog" - .dialog.textent.title.field configure -text "Confirm symbol name:" - .dialog.textent.txt delete 0 end - .dialog.textent.txt insert 0 [lindex $infolabel 1] - xcircuit::popupdialog - xcircuit::addliblist .dialog "Place in: " - xcircuit::addpinarranger .dialog $pinlabels + wm withdraw .makesymbol" + .makesymbol.textent.title.field configure -text "Confirm symbol name:" + .makesymbol.textent.txt delete 0 end + .makesymbol.textent.txt insert 0 [lindex $infolabel 1] + xcircuit::popupdialog .makesymbol + xcircuit::addliblist .makesymbol "Place in: " + xcircuit::addpinarranger .makesymbol $pinlabels } #--------------------------------------------------------------------------- diff --git a/lib/tcl/text.tcl b/lib/tcl/text.tcl index 22c2241..49c95ea 100644 --- a/lib/tcl/text.tcl +++ b/lib/tcl/text.tcl @@ -128,6 +128,7 @@ proc xcircuit::autoincr {{value 1} {position first}} { if {$nopreselect} { deselect undo series end + refresh } } else { if {$nopreselect} { diff --git a/lib/tcl/tkcon.tcl b/lib/tcl/tkcon.tcl index bcf4dab..dc53218 100755 --- a/lib/tcl/tkcon.tcl +++ b/lib/tcl/tkcon.tcl @@ -238,18 +238,18 @@ proc ::tkcon::Init {} { if {![interp issafe]} {cd [file dirname [info script]]} set envHome PREF_FOLDER set rcfile tkcon.cfg - set histfile tkcon.hst + set histfile xcircuit_tkcon.hst catch {console hide} } windows { set envHome HOME set rcfile tkcon.cfg - set histfile tkcon.hst + set histfile xcircuit_tkcon.hst } unix { set envHome HOME set rcfile .tkconrc - set histfile .tkcon_history + set histfile .xcircuit_tkcon_hst } } if {[info exists env($envHome)]} { diff --git a/lib/tcl/wrapper.tcl b/lib/tcl/wrapper.tcl index 20486e0..412b565 100644 --- a/lib/tcl/wrapper.tcl +++ b/lib/tcl/wrapper.tcl @@ -24,8 +24,8 @@ proc xcircuit::new_window { name } { # All the internal frames frame ${name}.menubar - frame ${name}.infobar -borderwidth 1 -bg #a07650 - frame ${name}.mainframe -borderwidth 1 -bg #a07650 + frame ${name}.infobar + frame ${name}.mainframe grid propagate ${name} false grid ${name}.menubar -sticky news -row 0 -column 0 @@ -40,7 +40,7 @@ proc xcircuit::new_window { name } { grid columnconfigure ${name} 1 -weight 1 frame ${name}.mainframe.mainarea - frame ${name}.mainframe.toolbar -bg #a07650 -borderwidth 1 + frame ${name}.mainframe.toolbar pack ${name}.mainframe.toolbar -side right -fill y pack ${name}.mainframe.mainarea -expand true -fill both @@ -48,9 +48,9 @@ proc xcircuit::new_window { name } { set drawing ${name}.mainframe.mainarea.drawing simple $drawing -bg white -commandproc "focus $drawing ; set XCOps(focus) $name" - simple ${name}.mainframe.mainarea.sbleft -width 13 -bg #a07650 - simple ${name}.mainframe.mainarea.sbbottom -height 13 -bg #a07650 - simple ${name}.mainframe.mainarea.corner -width 13 -height 13 -bg brown4 + simple ${name}.mainframe.mainarea.sbleft -width 13 + simple ${name}.mainframe.mainarea.sbbottom -height 13 + simple ${name}.mainframe.mainarea.corner -width 13 -height 13 # The drawing area and its scrollbars @@ -86,17 +86,16 @@ proc xcircuit::new_window { name } { label ${name}.message -text \ "Welcome to Xcircuit v${XCIRCUIT_VERSION} rev ${XCIRCUIT_REVISION}" \ - -background beige -justify left -anchor w + -justify left -anchor w grid ${name}.message -row 0 -column 1 -sticky news -ipadx 10 button ${name}.infobar.symb -text "Symbol" -bg gray30 -fg white button ${name}.infobar.schem -text "Schematic" -bg red -fg white button ${name}.infobar.mode -text "Wire Mode" -bg skyblue2 -fg gray20 - label ${name}.infobar.message1 -text "Editing: Page 1" \ - -background beige + label ${name}.infobar.message1 -text "Editing: Page 1" label ${name}.infobar.message2 -text "Grid 1/6 in : Snap 1/12 in" \ - -background beige -justify left -anchor w + -justify left -anchor w pack ${name}.infobar.symb ${name}.infobar.schem ${name}.infobar.message1 \ ${name}.infobar.mode -side left -ipadx 6 -fill y pack ${name}.infobar.message2 -ipadx 6 -expand true -fill both @@ -160,19 +159,23 @@ proc xcircuit::new_window { name } { # These are supposed to disable the scroll wheel on the scrollbars. . . - bind ${name}.mainframe.mainarea.sbleft {} - bind ${name}.mainframe.mainarea.sbleft {} - bind ${name}.mainframe.mainarea.sbbottom {} - bind ${name}.mainframe.mainarea.sbbottom {} - if {$tcl_platform(platform) == "windows"} { bind $name \ "catch {config focus ${drawing} ; focus ${drawing}; \ set XCOps(focus) ${name} ; xcircuit::updatedialog}" + + bind ${name}.mainframe.mainarea.sbleft {} + bind ${name}.mainframe.mainarea.sbbottom {} + } else { bind $drawing {focus %W} bind $name "catch {config focus $drawing ; \ set XCOps(focus) ${name} ; xcircuit::updatedialog}" + + bind ${name}.mainframe.mainarea.sbleft {} + bind ${name}.mainframe.mainarea.sbleft {} + bind ${name}.mainframe.mainarea.sbbottom {} + bind ${name}.mainframe.mainarea.sbbottom {} } # Window-specific variable defaults (variables associated with toggle @@ -184,6 +187,7 @@ proc xcircuit::new_window { name } { set XCWinOps(${name},colorval) inherit set XCWinOps(${name},jhoriz) left set XCWinOps(${name},jvert) bottom + set XCWinOps(${name},justif) left set XCWinOps(${name},linestyle) solid set XCWinOps(${name},fillamount) 0 set XCWinOps(${name},opaque) false @@ -195,7 +199,7 @@ proc xcircuit::new_window { name } { set XCWinOps(${name},showbbox) false set XCWinOps(${name},fontfamily) Helvetica set XCWinOps(${name},fontstyle) normal - set XCWinOps(${name},fontencoding) Standard + set XCWinOps(${name},fontencoding) ISOLatin1 set XCWinOps(${name},fontlining) normal set XCWinOps(${name},fontscript) normal set XCWinOps(${name},gridstyle) "internal units" @@ -221,7 +225,7 @@ proc xcircuit::new_window { name } { set XCWinOps(${name},xposparam) false set XCWinOps(${name},yposparam) false set XCWinOps(${name},styleparam) false - set XCWinOps(${name},justparam) false + set XCWinOps(${name},anchorparam) false set XCWinOps(${name},startparam) false set XCWinOps(${name},endparam) false set XCWinOps(${name},radiusparam) false @@ -253,12 +257,25 @@ proc xcircuit::new_window { name } { #----------------------------------------------------------------- # Function bindings for the mouse scroll wheel. + # Note that Windows uses MouseWheel and direction passed as %D, + # while Linux uses Button-4 and Button-5. #----------------------------------------------------------------- - xcircuit::keybind { pan up 0.05 ; refresh} $drawing - xcircuit::keybind { pan down 0.05 ; refresh} $drawing - xcircuit::keybind { pan left 0.05 ; refresh} $drawing - xcircuit::keybind { pan right 0.05 ; refresh} $drawing + if {$tcl_platform(platform) == "windows"} { + xcircuit::keybind {if { %D/120 >= 1} \ + {pan up 0.1 ; refresh} else {pan down 0.1 ; refresh}} $drawing + xcircuit::keybind {if { %D/120 >= 1} \ + {pan left 0.1 ; refresh} else {pan right 0.1 ; refresh}} $drawing + xcircuit::keybind {if { %D/120 >= 1} \ + {zoom in ; refresh} else {zoom out ; refresh}} $drawing + } else { + xcircuit::keybind { pan up 0.05 ; refresh} $drawing + xcircuit::keybind { pan down 0.05 ; refresh} $drawing + xcircuit::keybind { pan left 0.05 ; refresh} $drawing + xcircuit::keybind { pan right 0.05 ; refresh} $drawing + xcircuit::keybind { zoom in ; refresh} $drawing + xcircuit::keybind { zoom out ; refresh} $drawing + } #----------------------------------------------------------------- # Evaluate registered callback procedures @@ -273,6 +290,8 @@ proc xcircuit::new_window { name } { #---------------------------------------------------------------------- proc xcircuit::closewindow {name} { + global XCOps + set winlist [config windownames] if {[llength $winlist] > 1} { if {[lsearch $winlist $name] != -1} { @@ -280,6 +299,7 @@ proc xcircuit::closewindow {name} { set newwin [lindex [config windownames] 0] destroy [winfo top $name] config focus $newwin + set XCOps(focus) [winfo top $newwin] } } else { quit @@ -359,22 +379,22 @@ proc xcircuit::getinitstate {wname} { # Support procedures for tag callbacks #---------------------------------------------------------------------- -proc xcircuit::popupdialog {} { - set wstate [xcircuit::getinitstate .dialog] - xcircuit::removelists .dialog - wm deiconify .dialog - if {"$wstate" != "normal"} {centerwin .dialog} - raise .dialog - focus .dialog.textent.txt +proc xcircuit::popupdialog {{w .dialog}} { + set wstate [xcircuit::getinitstate ${w}] + xcircuit::removelists ${w} + wm deiconify ${w} + if {"$wstate" != "normal"} {centerwin ${w}} + raise ${w} + focus ${w}.textent.txt } -proc xcircuit::popupfilelist {} { - set wstate [xcircuit::getinitstate .filelist] - xcircuit::removelists .filelist - wm deiconify .filelist - centerwin .filelist - raise .filelist - focus .filelist.textent.txt +proc xcircuit::popupfilelist {{w .filelist}} { + set wstate [xcircuit::getinitstate ${w}] + xcircuit::removelists ${w} + wm deiconify ${w} + centerwin ${w} + raise ${w} + focus ${w}.textent.txt } #---------------------------------------------------------------------- @@ -420,64 +440,64 @@ proc xcircuit::setsheetsize {} { set ycm [lindex $slist 2] if {$xcm == 21.0 && $ycm == 29.7} { - set XCOps(sheetsize) a4 - .output.textent.txtf.sizb configure -text "A4" + set XCOps(sheetsize) a4 + .output.textent.txtf.sizb configure -text "A4" } elseif {$xcm == 29.7 && $ycm == 42.0} { - set XCOps(sheetsize) a3 - .output.textent.txtf.sizb configure -text "A3" + set XCOps(sheetsize) a3 + .output.textent.txtf.sizb configure -text "A3" } elseif {$xcm == 14.8 && $ycm == 18.4} { - set XCOps(sheetsize) a5 - .output.textent.txtf.sizb configure -text "A5" + set XCOps(sheetsize) a5 + .output.textent.txtf.sizb configure -text "A5" } elseif {$xcm == 25.7 && $ycm == 36.4} { - set XCOps(sheetsize) b4 - .output.textent.txtf.sizb configure -text "B4" + set XCOps(sheetsize) b4 + .output.textent.txtf.sizb configure -text "B4" } elseif {$xcm == 18.2 && $ycm == 25.7} { - set XCOps(sheetsize) b5 - .output.textent.txtf.sizb configure -text "B5" + set XCOps(sheetsize) b5 + .output.textent.txtf.sizb configure -text "B5" } else { - set XCOps(sheetsize) special - .output.textent.txtf.sizb configure -text "Special" + set XCOps(sheetsize) special + .output.textent.txtf.sizb configure -text "Special" } } elseif {$coordstyle == "in"} { set xin [lindex $slist 0] set yin [lindex $slist 2] if {$xin == 8.5 && $yin == 11.0} { - set XCOps(sheetsize) letter - .output.textent.txtf.sizb configure -text Letter + set XCOps(sheetsize) letter + .output.textent.txtf.sizb configure -text Letter } elseif {$xin == 8.5 && $yin == 14.0} { - set XCOps(sheetsize) legal - .output.textent.txtf.sizb configure -text Legal + set XCOps(sheetsize) legal + .output.textent.txtf.sizb configure -text Legal } elseif {$xin == 5.5 && $yin == 8.5} { - set XCOps(sheetsize) statement - .output.textent.txtf.sizb configure -text Statement + set XCOps(sheetsize) statement + .output.textent.txtf.sizb configure -text Statement } elseif {$xin == 11.0 && $yin == 17.0} { - set XCOps(sheetsize) tabloid - .output.textent.txtf.sizb configure -text Tabloid + set XCOps(sheetsize) tabloid + .output.textent.txtf.sizb configure -text Tabloid } elseif {$xin == 17.0 && $yin == 11.0} { - set XCOps(sheetsize) ledger - .output.textent.txtf.sizb configure -text Ledger + set XCOps(sheetsize) ledger + .output.textent.txtf.sizb configure -text Ledger } elseif {$xin == 8.5 && $yin == 13.0} { - set XCOps(sheetsize) folio - .output.textent.txtf.sizb configure -text Folio + set XCOps(sheetsize) folio + .output.textent.txtf.sizb configure -text Folio } elseif {$xin == 10.0 && $yin == 14.0} { - set XCOps(sheetsize) tenfourteen - .output.textent.txtf.sizb configure -text 10x14 + set XCOps(sheetsize) tenfourteen + .output.textent.txtf.sizb configure -text 10x14 } elseif {$xin == 7.5 && $yin == 10.0} { - set XCOps(sheetsize) executive - .output.textent.txtf.sizb configure -text Executive + set XCOps(sheetsize) executive + .output.textent.txtf.sizb configure -text Executive } elseif {$xin == 17.0 && $yin == 22.0} { - set XCOps(sheetsize) ansic - .output.textent.txtf.sizb configure -text "ANSI C" + set XCOps(sheetsize) ansic + .output.textent.txtf.sizb configure -text "ANSI C" } elseif {$xin == 22.0 && $yin == 34.0} { - set XCOps(sheetsize) ansid - .output.textent.txtf.sizb configure -text "ANSI D" + set XCOps(sheetsize) ansid + .output.textent.txtf.sizb configure -text "ANSI D" } elseif {$xin == 34.0 && $yin == 44.0} { - set XCOps(sheetsize) ansie - .output.textent.txtf.sizb configure -text "ANSI E" + set XCOps(sheetsize) ansie + .output.textent.txtf.sizb configure -text "ANSI E" } else { - set XCOps(sheetsize) special - .output.textent.txtf.sizb configure -text "Special" + set XCOps(sheetsize) special + .output.textent.txtf.sizb configure -text "Special" } } } @@ -569,6 +589,7 @@ proc xcircuit::pageupdate { {subcommand "none"} } { .output.title.field configure -text \ "PostScript output properties (Page [xcircuit::page])" set fname [xcircuit::page filename] + if {$fname == ""} {set fname [xcircuit::page label]} .output.textent.but1 configure -text Apply .output.textent.but2 configure -text Apply .output.textent.but3 configure -text Apply @@ -818,7 +839,7 @@ xcircuit::tag parameter { if {"%1" == "make"} {set cond true} else {set cond fal style {set XCWinOps($XCOps(focus),styleparam) $cond} "start angle" {set XCWinOps($XCOps(focus),startparam) $cond} "end angle" {set XCWinOps($XCOps(focus),endparam) $cond} - justification {set XCWinOps($XCOps(focus),justparam) $cond} + anchoring {set XCWinOps($XCOps(focus),anchorparam) $cond} radius {set XCWinOps($XCOps(focus),radiusparam) $cond} "minor axis" {set XCWinOps($XCOps(focus),minorparam) $cond} rotation {set XCWinOps($XCOps(focus),rotationparam) $cond} @@ -861,7 +882,7 @@ xcircuit::tag label {if {%# == 3} { } family {if {"%2" != "-all"} {set XCWinOps($XCOps(focus),fontfamily) %2}} style {set XCWinOps($XCOps(focus),fontstyle) %2} - justify { + anchor { switch -- %2 { top - bottom - @@ -869,10 +890,11 @@ xcircuit::tag label {if {%# == 3} { default {set XCWinOps($XCOps(focus),jhoriz) %2} } } + justify {set XCWinOps($XCOps(focus),justif) %2} flipinvariant {set XCWinOps($XCOps(focus),flipinvariant) %2} visible {set XCWinOps($XCOps(focus),pinvisible) %2} latex {set XCWinOps($XCOps(focus),latexmode) %2} - }} elseif {(%# == 4) && ("%1" == "justify")} { + }} elseif {(%# == 4) && ("%1" == "anchor")} { switch -- %2 { top - bottom - @@ -1157,6 +1179,18 @@ proc xcircuit::make_parameter_listbox {} { listbox .parameter.vallist -bg white listbox .parameter.parvals -bg white + # Code to get the listboxes to scroll in synchrony + bind .parameter.keylist {xcircuit::paramscroll -1} + bind .parameter.keylist {xcircuit::paramscroll 1} + bind .parameter.vallist {xcircuit::paramscroll -1} + bind .parameter.vallist {xcircuit::paramscroll 1} + bind .parameter.parvals {xcircuit::paramscroll -1} + bind .parameter.parvals {xcircuit::paramscroll 1} + # Also bind to the mouse wheel (Windows-specific, generally) + bind .parameter.keylist {xcircuit::paramscroll %D} + bind .parameter.vallist {xcircuit::paramscroll %D} + bind .parameter.parvals {xcircuit::paramscroll %D} + button .parameter.dismiss -text "Dismiss" -bg beige \ -command {wm withdraw .parameter} @@ -1206,110 +1240,150 @@ proc xcircuit::make_parameter_listbox {} { } } +#----------------------------------------------------------------- +# Scroll all listboxes in the .parameter window at the same +# time, in reponse to any one of them receiving a scroll event. +#----------------------------------------------------------------- + +proc xcircuit::paramscroll {value} { + global tcl_platform + set idx [.parameter.keylist nearest 0] + + if {$tcl_platform(platform) == "windows"} { + set idx [expr {$idx + $value / 120}] + } else { + set idx [expr {$idx + $value}] + } + + .parameter.keylist yview $idx + .parameter.vallist yview $idx + .parameter.parvals yview $idx + + # Important! This prohibits the default binding actions. + return -code break +} + # Update the dialog box, if it has been left visible # (Corrected 2/4/12: Don't delete contents except in these specific cases!) -proc xcircuit::updatedialog {} { +proc xcircuit::updatedialog {{w dialog}} { global XCOps - if {[xcircuit::getinitstate .dialog] == "normal"} { - switch -- $XCOps(dialog) { + if {[xcircuit::getinitstate .${w}] == "normal"} { + switch -- $XCOps(${w}) { linewidth { set btext [format "%g" [lindex [xcircuit::border get] 0]] - .dialog.textent.txt delete 0 end - .dialog.textent.txt insert 0 $btext + .${w}.textent.txt delete 0 end + .${w}.textent.txt insert 0 $btext } textscale { set cscale [xcircuit::label scale] - .dialog.textent.txt delete 0 end - .dialog.textent.txt insert 0 $cscale + .${w}.textent.txt delete 0 end + .${w}.textent.txt insert 0 $cscale } elementscale { set selects [xcircuit::select] if {$selects > 0} { set cscale [xcircuit::element scale] - .dialog.textent.txt delete 0 end - .dialog.textent.txt insert 0 $cscale + .${w}.textent.txt delete 0 end + .${w}.textent.txt insert 0 $cscale } } } } } -proc xcircuit::makedialogline {dframe textline} { - if {[catch {frame .dialog.${dframe} -bg beige}]} { - .dialog.${dframe}.title.field configure -text ${textline} +proc xcircuit::makedialogline {dframe textline {w dialog}} { + if {[catch {frame .${w}.${dframe} -bg beige}]} { + .${w}.${dframe}.title.field configure -text ${textline} } else { - pack .dialog.${dframe} -side top -padx 20 -pady 7 -fill x + pack .${w}.${dframe} -side top -padx 20 -pady 7 -fill x - frame .dialog.${dframe}.title -bg beige - entry .dialog.${dframe}.txt -bg white -relief sunken -width 50 + frame .${w}.${dframe}.title -bg beige + entry .${w}.${dframe}.txt -bg white -relief sunken -width 50 - pack .dialog.${dframe}.title -side top -fill x - pack .dialog.${dframe}.txt -side bottom -fill x -expand true + pack .${w}.${dframe}.title -side top -fill x + pack .${w}.${dframe}.txt -side bottom -fill x -expand true - label .dialog.${dframe}.title.field -text ${textline} -bg beige - pack .dialog.${dframe}.title.field -side left + label .${w}.${dframe}.title.field -text ${textline} -bg beige + pack .${w}.${dframe}.title.field -side left } } -proc xcircuit::removedialogline {dframe} { +proc xcircuit::removedialogline {dframe {w dialog}} { global XCOps - pack forget .dialog.${dframe} - destroy .dialog.${dframe} - set XCOps(dialog) 0 + pack forget .${w}.${dframe} + destroy .${w}.${dframe} + set XCOps(${w}) 0 } -#-------------------------------------- -# Create the simple popup prompt window -#-------------------------------------- +#-------------------------------------------- +# Create a simple popup prompt window +# With "Apply", "Okay", and "Cancel" buttons +#-------------------------------------------- -toplevel .dialog -bg beige -wm title .dialog "Dialog Box" -wm group .dialog . -wm protocol .dialog WM_DELETE_WINDOW {wm withdraw .dialog} -wm withdraw .dialog -set XCOps(dialog) 0 +proc make_simple_dialog {name} { + set window .${name} + toplevel ${window} -bg beige + wm title ${window} "Dialog Box" + wm group ${window} . + wm protocol ${window} WM_DELETE_WINDOW [subst {wm withdraw ${window}}] + wm withdraw ${window} + set XCOps(${name}) 0 -xcircuit::makedialogline textent "Select file to load:" + xcircuit::makedialogline textent "Select file to load:" ${name} -frame .dialog.bbar -bg beige -pack .dialog.bbar -side bottom -padx 20 -pady 7 -fill x + frame ${window}.bbar -bg beige + pack ${window}.bbar -side bottom -padx 20 -pady 7 -fill x -button .dialog.bbar.okay -text Okay -bg beige -command {.dialog.bbar.apply invoke ;\ - wm withdraw .dialog} -button .dialog.bbar.apply -text Apply -bg beige -button .dialog.bbar.cancel -text Cancel -bg beige -command {wm withdraw .dialog} + button ${window}.bbar.okay -text Okay -bg beige \ + -command [subst {${window}.bbar.apply invoke ;\ + wm withdraw ${window}}] + button ${window}.bbar.apply -text Apply -bg beige + button ${window}.bbar.cancel -text Cancel -bg beige -command \ + [subst {wm withdraw ${window}}] -bind .dialog.textent.txt {.dialog.bbar.apply invoke} + bind ${window}.textent.txt [subst {${window}.bbar.apply invoke}] -pack .dialog.bbar.okay -side left -ipadx 10 -pack .dialog.bbar.apply -side left -ipadx 10 -pack .dialog.bbar.cancel -side right -ipadx 10 + pack ${window}.bbar.okay -side left -ipadx 10 + pack ${window}.bbar.apply -side left -ipadx 10 + pack ${window}.bbar.cancel -side right -ipadx 10 +} #-------------------------------------- -# Create the query prompt window +# Create a query prompt window with +# "Okay" and "Cancel" buttons, and a +# "Select:" title message #-------------------------------------- -toplevel .query -bg beige -wm title .query "Query Dialog Box" -wm group .query . -wm protocol .query WM_DELETE_WINDOW {wm withdraw .query} -wm withdraw .query +proc make_query_dialog {name} { + set window .${name} + toplevel ${window} -bg beige + wm title ${window} "Query Dialog Box" + wm group ${window} . + wm protocol ${window} WM_DELETE_WINDOW [subst {wm withdraw ${window}}] + wm withdraw ${window} -frame .query.title -bg beige -frame .query.bbar -bg beige + frame ${window}.title -bg beige + frame ${window}.bbar -bg beige -pack .query.title -side top -padx 20 -pady 7 -fill x -pack .query.bbar -side bottom -padx 20 -pady 7 -fill x + pack ${window}.title -side top -padx 20 -pady 7 -fill x + pack ${window}.bbar -side bottom -padx 20 -pady 7 -fill x -label .query.title.field -text "Select:" -bg beige -pack .query.title.field -side left + label ${window}.title.field -text "Select:" -bg beige + pack ${window}.title.field -side left -button .query.bbar.okay -text Okay -bg beige -button .query.bbar.cancel -text Cancel -bg beige -command {wm withdraw .query} + button ${window}.bbar.okay -text Okay -bg beige + button ${window}.bbar.cancel -text Cancel -bg beige -command \ + [subst {wm withdraw ${window}}] -pack .query.bbar.okay -side left -ipadx 10 -pack .query.bbar.cancel -side right -ipadx 10 + pack ${window}.bbar.okay -side left -ipadx 10 + pack ${window}.bbar.cancel -side right -ipadx 10 +} + +make_query_dialog query +make_simple_dialog dialog +make_simple_dialog savetech +make_simple_dialog makesymbol #-------------------------------------------------------- # Generate all of the menu cascades @@ -1330,13 +1404,13 @@ proc xcircuit::printstring {stringlist} { return $p } -proc xcircuit::printjust {justif} { - switch [expr {$justif & 3}] { +proc xcircuit::printanchor {anchor} { + switch [expr {$anchor & 3}] { 0 {set p "left"} 1 {set p "center"} 3 {set p "right"} } - switch [expr {$justif & 12}] { + switch [expr {$anchor & 12}] { 0 {append p " bottom"} 4 {append p " middle"} 12 {append p " top"} @@ -1348,14 +1422,14 @@ proc xcircuit::labelmakeparam {} { global XCOps if {[xcircuit::select] > 0} { ;# this should be true. . . set XCOps(dialog) paramname - xcircuit::removedialogline textent2 ;# default is the selected text + xcircuit::removedialogline textent2 dialog ;# default is the selected text .dialog.bbar.apply configure -command \ [subst {xcircuit::parameter make substring \[.dialog.textent.txt get\];\ xcircuit::updateparams substring}] .dialog.textent.title.field configure -text "Parameter name:" + .dialog.textent.txt delete 0 end + xcircuit::popupdialog } - .dialog.textent.txt delete 0 end - xcircuit::popupdialog } proc xcircuit::promptmakeparam {{mode substring}} { @@ -1363,11 +1437,11 @@ proc xcircuit::promptmakeparam {{mode substring}} { set XCOps(dialog) paramdefault if {$mode == "label"} {set mode substring} - xcircuit::makedialogline textent2 "Default value:" + xcircuit::makedialogline textent2 "Default value:" dialog .dialog.bbar.apply configure -command \ [subst {xcircuit::parameter make $mode \ \[.dialog.textent.txt get\] \[.dialog.textent2.txt get\] -forward; \ - xcircuit::removedialogline textent2; \ + xcircuit::removedialogline textent2 dialog; \ xcircuit::updateparams $mode}] .dialog.textent.title.field configure -text \ "Parameter name:" @@ -1507,8 +1581,8 @@ proc xcircuit::updateparams { {mode {substring numeric expression}} } { "substring" { .parameter.vallist insert end [xcircuit::printstring $p_val] } - "justification" { - .parameter.vallist insert end [xcircuit::printjust $p_val] + "anchoring" { + .parameter.vallist insert end [xcircuit::printanchor $p_val] } default { .parameter.vallist insert end $p_val @@ -1536,16 +1610,16 @@ proc xcircuit::promptmakesymbol {{name ""}} { global XCOps set XCOps(dialog) makeobject - .dialog.bbar.apply configure -command \ + .makesymbol.bbar.apply configure -command \ {if {[string first "Page " [page label]] >= 0} { \ - page label [.dialog.textent.txt get]}; \ - xcircuit::symbol make [.dialog.textent.txt get] $XCOps(library)} - xcircuit::removedialogline textent2 - .dialog.textent.title.field configure -text "Name for new object:" - .dialog.textent.txt delete 0 end - .dialog.textent.txt insert 0 $name - xcircuit::popupdialog - xcircuit::addliblist .dialog "Place in: " + page label [.makesymbol.textent.txt get]}; \ + xcircuit::symbol make [.makesymbol.textent.txt get] $XCOps(library)} + xcircuit::removedialogline textent2 makesymbol + .makesymbol.textent.title.field configure -text "Name for new object:" + .makesymbol.textent.txt delete 0 end + .makesymbol.textent.txt insert 0 $name + xcircuit::popupdialog .makesymbol + xcircuit::addliblist .makesymbol Place in: " } #---------------------------------------------------------------------- @@ -1554,26 +1628,26 @@ proc xcircuit::prompttargettech {{name ""}} { global XCOps set XCOps(dialog) targettech - .dialog.bbar.apply configure -command { \ + .savetech.bbar.apply configure -command { \ set selects [xcircuit::select]; \ if {$selects > 0} { \ - if {[catch {set techname [.dialog.textent2.txt get]}]} {\ + if {[catch {set techname [.savetech.textent2.txt get]}]} {\ set techname $XCOps(technology)}; \ - technology objects $techname [.dialog.textent.txt get]}\ + technology objects $techname [.savetech.textent.txt get]}\ } - xcircuit::removedialogline textent2 - .dialog.textent.title.field configure -text "Objects to move:" - .dialog.textent.txt delete 0 end - .dialog.textent.txt insert 0 $name + xcircuit::removedialogline textent2 savetech + .savetech.textent.title.field configure -text "Objects to move:" + .savetech.textent.txt delete 0 end + .savetech.textent.txt insert 0 $name xcircuit::popupdialog - xcircuit::addtechlist .dialog "Target technology: " + xcircuit::addtechlist .savetech "Target technology: " # Add an additional selection to the tech menu for adding a new # technology namespace. This is relevant only to "prompttargettech". - .dialog.techself.techselect.menu add \ + .savetech.techself.techselect.menu add \ command -label "Add New Tech" -command \ - "xcircuit::makedialogline textent2 {New tech name:}" + "xcircuit::makedialogline textent2 {New tech name:}" savetech } #---------------------------------------------------------------------- @@ -1730,19 +1804,19 @@ proc xcircuit::promptsavetech {} { global XCOps set XCOps(dialog) techname - .dialog.bbar.apply configure -command \ - {xcircuit::technology save [.dialog.techself.techselect cget -text] \ - [.dialog.textent.txt get]} - .dialog.textent.title.field configure -text "Filename to save technology as:" - .dialog.textent.txt delete 0 end - xcircuit::popupdialog - xcircuit::addtechlist .dialog "Save which technology: " {(user)} true + .savetech.bbar.apply configure -command \ + {xcircuit::technology save [.savetech.techself.techselect cget -text] \ + [.savetech.textent.txt get]} + .savetech.textent.title.field configure -text "Filename to save technology as:" + .savetech.textent.txt delete 0 end + xcircuit::popupdialog .savetech + xcircuit::addtechlist .savetech "Save which technology: " {(user)} true set fname "" catch {set fname [technology filename $XCOps(technology)]} if {$fname == "(no associated file)"} { set fname $XCOps(technology).lps } - .dialog.textent.txt insert 0 $fname + .savetech.textent.txt insert 0 $fname } #---------------------------------------------------------------------- @@ -2008,7 +2082,7 @@ proc xcircuit::allcolorbuttons {window} { set colorlist [color get -all] set frame [winfo top $window] - set idx 0 + set idx 17 ;# NUMBER_OF_COLORS in xcircuit.h foreach colorrgb $colorlist { ${frame}.menubar.optionsbutton.optionsmenu.elementsmenu.colormenu \ add radio -image img_col$idx -activebackground $colorrgb \ @@ -2590,7 +2664,7 @@ proc xcircuit::makemenus {window} { $m add cascade -label "Style" -menu $m.stylemenu $m add cascade -label "Encoding" -menu $m.encodingmenu $m add cascade -label "Insert" -menu $m.insertmenu - $m add cascade -label "Justification" -menu $m.justifymenu + $m add cascade -label "Anchoring" -menu $m.anchormenu $m add command -label "Parameterize" \ -command {xcircuit::labelmakeparam} $m add command -label "Unparameterize" \ @@ -2657,21 +2731,28 @@ proc xcircuit::makemenus {window} { $m2 add command -label "Character" -command "xcircuit::label insert special" $m2 add command -label "Parameter" -command "xcircuit::prompteditparams" - set m2 [menu $m.justifymenu -tearoff 0] - $m2 add radio -label "Left Justified" -variable XCWinOps(${window},jhoriz) \ + set m2 [menu $m.anchormenu -tearoff 0] + $m2 add radio -label "Left Anchored" -variable XCWinOps(${window},jhoriz) \ + -value left -command "xcircuit::label anchor left" + $m2 add radio -label "Center Anchored" -variable XCWinOps(${window},jhoriz) \ + -value center -command "xcircuit::label anchor center" + $m2 add radio -label "Right Anchored" -variable XCWinOps(${window},jhoriz) \ + -value right -command "xcircuit::label anchor right" + $m2 add separator + $m2 add radio -label "Top Anchored" -variable XCWinOps(${window},jvert) \ + -value top -command "xcircuit::label anchor top" + $m2 add radio -label "Middle Anchored" -variable XCWinOps(${window},jvert) \ + -value middle -command "xcircuit::label anchor middle" + $m2 add radio -label "Bottom Anchored" -variable XCWinOps(${window},jvert) \ + -value bottom -command "xcircuit::label anchor bottom" + $m2 add separator + $m2 add radio -label "Left Justified" -variable XCWinOps(${window},justif) \ -value left -command "xcircuit::label justify left" - $m2 add radio -label "Center Justified" -variable XCWinOps(${window},jhoriz) \ + $m2 add radio -label "Center Justified" -variable XCWinOps(${window},justif) \ -value center -command "xcircuit::label justify center" - $m2 add radio -label "Right Justified" -variable XCWinOps(${window},jhoriz) \ + $m2 add radio -label "Right Justified" -variable XCWinOps(${window},justif) \ -value right -command "xcircuit::label justify right" $m2 add separator - $m2 add radio -label "Top Justified" -variable XCWinOps(${window},jvert) \ - -value top -command "xcircuit::label justify top" - $m2 add radio -label "Middle Justified" -variable XCWinOps(${window},jvert) \ - -value middle -command "xcircuit::label justify middle" - $m2 add radio -label "Bottom Justified" -variable XCWinOps(${window},jvert) \ - -value bottom -command "xcircuit::label justify bottom" - $m2 add separator $m2 add check -label "Flip Invariant" \ -variable XCWinOps(${window},flipinvariant) \ -onvalue true -offvalue false -command {xcircuit::label flipinvariant \ @@ -2851,11 +2932,11 @@ proc xcircuit::makemenus {window} { {if {$XCWinOps($XCOps(focus),yposparam)} \ {xcircuit::parameter make "y position"} \ {xcircuit::parameter replace "y position"}} - $m3 add check -label "Justification" -variable XCWinOps(${window},justparam) \ + $m3 add check -label "Anchoring" -variable XCWinOps(${window},anchorparam) \ -onvalue true -offvalue false -command \ - {if {$XCWinOps($XCOps(focus),justparam)} \ - {xcircuit::parameter make justification} \ - {xcircuit::parameter replace justification}} + {if {$XCWinOps($XCOps(focus),anchorparam)} \ + {xcircuit::parameter make anchoring} \ + {xcircuit::parameter replace anchoring}} $m3 add check -label "Rotation" -variable XCWinOps(${window},rotationparam) \ -onvalue true -offvalue false -command \ {if {$XCWinOps($XCOps(focus),rotationparam)} \ @@ -3051,7 +3132,7 @@ proc xcircuit::enable_mousehints {} { set XCOps(mousehints) 1 foreach window [config windownames] { set frame [winfo top $window] - xcircuit::mousehint_create $frame + catch {xcircuit::mousehint_create $frame} } } } @@ -3197,6 +3278,15 @@ proc xcircuit::makehelpwindow {} { message .help.listwin.win -width 200 -justify left -anchor n \ -relief groove -text "Click on a function for help text" + # Keep boxes aligned! + bind .help.listwin.keys {xcircuit::helpscroll -1} + bind .help.listwin.keys {xcircuit::helpscroll 1} + bind .help.listwin.func {xcircuit::helpscroll -1} + bind .help.listwin.func {xcircuit::helpscroll 1} + # Also bind to the mouse wheel (Windows-specific, generally) + bind .help.listwin.keys {xcircuit::helpscroll %D} + bind .help.listwin.func {xcircuit::helpscroll %D} + grid .help.listwin.func -row 0 -column 0 -sticky news -padx 1 -pady 1 grid .help.listwin.keys -row 0 -column 1 -sticky news -padx 1 -pady 1 grid .help.listwin.sb -row 0 -column 2 -sticky ns -padx 1 -pady 1 @@ -3208,6 +3298,28 @@ proc xcircuit::makehelpwindow {} { bind .help.listwin.func "xcircuit::printhelp" } +#----------------------------------------------------------------- +# Scroll all listboxes in the .help.listwin window at the same +# time, in reponse to any one of them receiving a scroll event. +#----------------------------------------------------------------- + +proc xcircuit::helpscroll {value} { + global tcl_platform + set idx [.help.listwin.func nearest 0] + + if {$tcl_platform(platform) == "windows"} { + set idx [expr {$idx + $value / 120}] + } else { + set idx [expr {$idx + $value}] + } + + .help.listwin.func yview $idx + .help.listwin.keys yview $idx + + # Important! This prohibits the default binding actions. + return -code break +} + #----------------------------------------------------------------- # Procedure to update and display the help window #----------------------------------------------------------------- diff --git a/lib/tcl/xcircuit.tcl.in b/lib/tcl/xcircuit.tcl.in index 3d4504b..5eee0d6 100755 --- a/lib/tcl/xcircuit.tcl.in +++ b/lib/tcl/xcircuit.tcl.in @@ -244,7 +244,7 @@ if {[string length $argv] == 0} { } unset tcllibdir -# The GUI wrapper iconfies the window while generating it +# The GUI wrapper iconifies the window while generating it catch {wm deiconify $XCOps(toplevel)} # Invoke the "wire" button by default diff --git a/lib/tcl/xcstartup.tcl b/lib/tcl/xcstartup.tcl index a117e04..f191818 100644 --- a/lib/tcl/xcstartup.tcl +++ b/lib/tcl/xcstartup.tcl @@ -28,15 +28,17 @@ if {[catch {set XCOps(fontoverride)}]} { loadfont courieriso.xfe loadfont symbol.xfe -# Alternate font encodings: Uncomment these if you want them -# loaded by default -# -# loadfont times_romaniso2.xfe -# loadfont courieriso2.xfe -# loadfont helveticaiso2.xfe -# loadfont times_romaniso5.xfe -# loadfont courieriso5.xfe -# loadfont helveticaiso5.xfe + # Alternate font encodings known to xcircuit + + loadfont times_romaniso2.xfe + loadfont courieriso2.xfe + loadfont helveticaiso2.xfe + loadfont times_romaniso5.xfe + loadfont courieriso5.xfe + loadfont helveticaiso5.xfe + loadfont times_roman_cyrillic.xfe + loadfont courier_cyrillic.xfe + loadfont helvetica_cyrillic.xfe } if {[catch {set XCOps(liboverride)}]} { diff --git a/lib/xcircps2.pro b/lib/xcircps2.pro index 60e3b99..39e9018 100644 --- a/lib/xcircps2.pro +++ b/lib/xcircps2.pro @@ -1,15 +1,16 @@ %%BeginProlog % % PostScript prolog for output from xcircuit -% Version: 3.8 +% Version: 3.9 % % Electrical circuit (and otherwise general) drawing program % -% Written by Tim Edwards 8/5/93--11/1/10 (tim.edwards@multigig.com) +% Written by Tim Edwards 8/5/93--4/12/16 (tim@opencircuitdesign.com) % The Johns Hopkins University (1993-2004) % MultiGiG, Inc. (2004-2012) +% Open Circuit Design (2012-2016) % -%%BeginResource: procset XCIRCproc 3.8 0 +%%BeginResource: procset XCIRCproc 3.9 1 % % supporting definitions --- these are the primary xcircuit types. @@ -20,18 +21,18 @@ exch findfont exch makefont dup length dict /ndict exch def { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall ndict definefont pop} def -/ul { dup type /stringtype eq showflag 1 eq and { gsave +/ul { count 0 gt { dup type /stringtype eq showflag 1 eq and { gsave currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) false charpath flattenpath pathbbox grestore exch pop 1 index sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave + rlineto stroke moveto } if } if } def +/ol { count 0 gt { dup type /stringtype eq showflag 1 eq and { gsave gsave currentpoint topmat setmatrix 2 index stringwidth pop 3 index true charpath flattenpath pathbbox grestore exch pop exch pop topmat setmatrix (_) true charpath pathbbox grestore exch pop 1 index sub setlinewidth exch pop currentpoint exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def + moveto } if } if } def /stW { gsave currentpoint newpath moveto true charpath flattenpath pathbbox pop exch pop sub grestore } def /Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs @@ -52,13 +53,14 @@ 0.67 mul Kn } def /ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def /MR { /twidth exch def } def -/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def +/CRx { } def +/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto CRx } def /cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} {fscale0 mul fscale mul cf0} ifelse } def /ctmk { counttomark dup 2 add -1 roll pop } bind def /label { gsave translate 0 0 moveto dup scale neg - /rotval exch def /twidth 100000 def /just exch def just 384 and + /rotval exch def /twidth 100000 def /just exch def just 128 and 0 gt {/mshow {pop} def} {/mshow {show} def} ifelse just 16 and 0 gt {gsave rotval rotate 0 1 dtransform gsave pagemat setmatrix idtransform exch grestore 1 0 dtransform gsave pagemat setmatrix @@ -66,20 +68,27 @@ pop pop 0 lt} ifelse grestore {-1 /rotval rotval neg def /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch -1e-9 lt {-1 /rotval rotval neg def /just just dup 12 and 4 ne {12 xor} if def} {1} - ifelse scale } if /showflag 0 def /fspc pspc def /Bline 0 def /Tabs - 0 array def /fscale 1.0 def /kY 0 def gsave dup 1 add copy dup - 1 0 dtransform exch atan rotate {exch dup type /stringtype eq {gsave - dup gsave newpath 0 0 moveto true charpath flattenpath pathbbox pop - exch pop exch pop grestore currentpoint pop add twidth + ifelse scale } if /showflag 0 def /fspc pspc def /Bline 0 def + /numlines 0 def /padding 0 array def /Tabs 0 array def + /fscale 1.0 def /kY 0 def gsave /CRx { linewid padding + aload pop numlines 1 add dup /numlines exch def array astore + /padding exch def /linewid 0 def } def dup 1 add copy dup 1 0 + dtransform exch atan rotate {exch dup type /stringtype eq {gsave dup + gsave newpath 0 0 moveto true charpath flattenpath pathbbox pop exch + pop exch pop grestore currentpoint pop add dup /linewid exch def twidth ge {grestore CR exch 1 add dup 2 add {CR} exch 1 roll exch} {grestore} ifelse true charpath flattenpath} {dup type /arraytype eq {exec} {12 - string cvs true charpath flattenpath} ifelse} ifelse} repeat exch pop - pathbbox grestore 3 -1 roll pop 3 1 roll just 1 and 0 gt {just 2 and + string cvs true charpath flattenpath} ifelse} ifelse} repeat + CRx /CRx {padding aload pop just 1280 and 0 gt {blockwid exch sub just + 1024 and 0 gt {0.5 mul} if} {pop 0} ifelse 0 rmoveto numlines 1 sub + dup /numlines exch def array astore /padding exch def} def exch pop + pathbbox grestore 4 copy pop exch pop exch sub /blockwid exch def + 3 -1 roll pop 3 1 roll just 1 and 0 gt {just 2 and 0 gt {exch pop neg fspc sub} {exch sub 0.5 mul neg} ifelse} {pop neg fspc add} ifelse exch Bline exch just 4 and 0 gt {just 8 and 0 gt {exch pop neg fspc sub} {add 0.5 mul neg} ifelse} {pop neg fspc add} ifelse rotval rotate Kn currentpoint translate /showflag 1 def /Bline - 0 def /Tabs 0 array def /fscale 1.0 def /kY 0 def {dup type + 0 def /Tabs 0 array def /fscale 1.0 def /kY 0 def CRx {dup type /stringtype eq {mshow} {dup type /arraytype eq {exec} {12 string cvs mshow} ifelse} ifelse} repeat grestore endclip} def /pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 10 def label diff --git a/lib/xspice.lps b/lib/xspice.lps new file mode 100644 index 0000000..90d60ac --- /dev/null +++ b/lib/xspice.lps @@ -0,0 +1,591 @@ +%! PostScript set of library objects for XCircuit +% Version: 3.9 +% Library name is: xspice +% Author: +% + + +% XCircuitLib library objects +/xspice::d_dff { +<> begingate +1 1.000 -64 64 -96 64 2 polygon +1.000 0.000 0.000 scb +(D) {/Times-Roman cf} 2 23 0.000 0.700 -96 64 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d %pD %%d %pCLK %%d %pS %%d %pC %%d %pQ %%d %pQbar d_dff_) @index +(spice1:A) {/Times-Roman cf} ctmk 20 0.000 0.700 -144 -176 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 16 label +sce +0 1.000 -64 -64 -64 96 64 96 64 -64 4 polygon +1 1.000 64 64 96 64 2 polygon +1.000 0.000 0.000 scb +(Q) {/Times-Roman cf} 2 20 0.000 0.700 96 64 pinlabel +(CLK) {/Times-Roman cf} 2 23 0.000 0.700 -96 -32 pinlabel +sce +1 1.000 64 -32 96 -32 2 polygon +1.000 0.000 0.000 scb +(Qbar) {/Times-Roman cf} 2 20 0.000 0.700 96 -32 pinlabel +sce +(D) {/Times-Roman cf} 2 21 0.000 0.700 -48 64 label +1 1.000 -64 -48 -48 -32 -64 -16 3 polygon +(S) {/Times-Roman cf} 2 21 0.000 0.700 0 80 label +(C) {/Times-Roman cf} 2 21 0.000 0.700 0 -48 label +(Q) {/Times-Roman cf} 2 21 0.000 0.700 48 64 label +(Q) {ol} {/Times-Roman cf} 3 21 0.000 0.700 48 -32 label +1.000 0.000 0.000 scb +(C) {/Times-Roman cf} 2 29 0.000 0.700 0 -96 pinlabel +(S) {/Times-Roman cf} 2 17 0.000 0.700 0 128 pinlabel +sce +1 1.000 0 -96 0 -64 2 polygon +1 1.000 0 128 0 96 2 polygon +0.180 0.545 0.341 scb +mark @reset_load ( reset_load=) @set_load ( set_load=) @clk_load ( clk_load=) +@data_load ( data_load=) @ic (spice3:+ ic=) {/Times-Roman cf} ctmk 20 0.000 +0.700 -144 -240 infolabel +mark @fall_delay ( fall_delay=) @rise_delay (spice4:+ rise_delay=) +{/Times-Roman cf} ctmk 20 0.000 0.700 -144 -272 infolabel +mark @reset_delay ( reset_delay=) @set_delay ( set_delay=) @clk_delay +( d_dff\(clk_delay=) @index (spice2:.model d_dff_) {/Times-Roman cf} ctmk 20 +0.000 0.700 -144 -208 infolabel +sce +1 1.000 -96 -32 -64 -32 2 polygon +endgate +} def + +/xspice::adc_bridge { +<> begingate +1 1.000 48 0 80 0 2 polygon +1 1.000 -48 0 -80 0 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 0 pinlabel +(D) {/Times-Roman cf} 2 20 0.000 0.700 80 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( [%p"A"] %%d [%p"D"] adc_bridge_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -64 infolabel +mark (\)) @fall_delay ( fall_delay=) @rise_delay ( rise_delay=) @in_high +( in_high=) @in_low ( adc_bridge\(in_low=) @index (spice2:.model adc_bridge_) +{/Times-Roman cf} ctmk 20 0.000 0.700 -112 -96 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -48 0 -32 -16 32 -16 48 0 32 16 -32 16 -48 0 7 polygon +endgate +} def + +/xspice::dac_bridge { +<> begingate +1 1.000 48 0 80 0 2 polygon +1 1.000 -48 0 -80 0 2 polygon +1.000 0.000 0.000 scb +(D) {/Times-Roman cf} 2 23 0.000 0.700 -80 0 pinlabel +(A) {/Times-Roman cf} 2 20 0.000 0.700 80 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d [%p"D"] [%p"A"] dac_bridge_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -64 infolabel +mark @out_high ( out_high=) @out_low ( dac_bridge\(out_low=) @index +(spice2:.model dac_bridge_) {/Times-Roman cf} ctmk 20 0.000 0.700 -112 -96 +infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -48 0 -32 -16 32 -16 48 0 32 16 -32 16 -48 0 7 polygon +0.180 0.545 0.341 scb +mark (\)) @t_fall ( t_fall=) @t_rise ( t_rise=) @input_load ( input_load=) +@out_undef (spice3:+ out_undef=) {/Times-Roman cf} ctmk 20 0.000 0.700 -112 +-128 infolabel +endgate +} def + +/xspice::d_buffer { +<> +begingate +1 1.000 48 0 80 0 2 polygon +1 1.000 -48 0 -80 0 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 0 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 80 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d %pA %%d %pX d_buffer_) @index (spice1:A) {/Times-Roman cf} ctmk +20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_buffer\(rise_delay=) @index (spice2:.model d_buffer_) {/Times-Roman cf} ctmk +20 0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 -16 0 label +sce +1 1.000 48 0 -48 48 -48 -48 48 0 4 polygon +endgate +} def + +/xspice::d_inverter { +<> +begingate +1 1.000 64 0 80 0 2 polygon +1 1.000 -48 0 -80 0 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 0 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 80 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d %pin %%d %pout d_inverter_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_inverter\(rise_delay=) @index (spice2:.model d_inverter_) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 -16 0 label +sce +1 1.000 56 0 8 0.000 360.000 xcarc +1 1.000 48 0 -48 48 -48 -48 48 0 4 polygon +endgate +} def + +/xspice::d_and2 { +<> +begingate +1 1.000 64 0 96 0 2 polygon +1 1.000 -48 32 -80 32 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 32 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 96 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d [%pA %pB] %%d %pX d_and2_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_and\(rise_delay=) @index (spice2:.model d_and2_) {/Times-Roman cf} ctmk 20 +0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -48 -48 -48 48 2 polygon +1 1.000 -48 48 16 48 2 polygon +1 1.000 -48 -48 16 -48 2 polygon +1 1.000 16 0 48 270.000 450.000 xcarc +1 1.000 -48 -32 -80 -32 2 polygon +1.000 0.000 0.000 scb +(B) {/Times-Roman cf} 2 23 0.000 0.700 -80 -32 pinlabel +endgate +} def + +/xspice::d_nand2 { +<> +begingate +1 1.000 80 0 96 0 2 polygon +1 1.000 -48 32 -80 32 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 32 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 96 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d [%pA %pB] %%d %pX d_nand2_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_nand\(rise_delay=) @index (spice2:.model d_nand2_) {/Times-Roman cf} ctmk 20 +0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -48 -48 -48 48 2 polygon +1 1.000 -48 48 16 48 2 polygon +1 1.000 -48 -48 16 -48 2 polygon +1 1.000 16 0 48 270.000 450.000 xcarc +1 1.000 -48 -32 -80 -32 2 polygon +1.000 0.000 0.000 scb +(B) {/Times-Roman cf} 2 23 0.000 0.700 -80 -32 pinlabel +sce +1 1.000 72 0 8 0.000 360.000 xcarc +endgate +} def + +/xspice::d_or2 { +<> +begingate +1 1.000 64 0 96 0 2 polygon +1 1.000 -40 32 -80 32 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 32 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 96 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d [%pA %pB] %%d %pX d_or2_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_or\(rise_delay=) @index (spice2:.model d_or2_) {/Times-Roman cf} ctmk 20 +0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -48 48 -16 48 2 polygon +1 1.000 -40 -32 -80 -32 2 polygon +1.000 0.000 0.000 scb +(B) {/Times-Roman cf} 2 23 0.000 0.700 -80 -32 pinlabel +sce +1 1.000 -32 32 -32 -32 -48 -48 -48 48 spline +1 1.000 56 24 16 48 -16 48 64 0 spline +1 1.000 56 -24 16 -48 -16 -48 64 0 spline +1 1.000 -48 -48 -16 -48 2 polygon +endgate +} def + +/xspice::d_nor2 { +<> +begingate +1 1.000 80 0 96 0 2 polygon +1 1.000 -40 32 -80 32 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 32 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 96 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d [%pA %pB] %%d %pX d_nor2_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_nor\(rise_delay=) @index (spice2:.model d_nor2_) {/Times-Roman cf} ctmk 20 +0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -48 48 -16 48 2 polygon +1 1.000 -40 -32 -80 -32 2 polygon +1.000 0.000 0.000 scb +(B) {/Times-Roman cf} 2 23 0.000 0.700 -80 -32 pinlabel +sce +1 1.000 -32 32 -32 -32 -48 -48 -48 48 spline +1 1.000 56 24 16 48 -16 48 64 0 spline +1 1.000 56 -24 16 -48 -16 -48 64 0 spline +1 1.000 -48 -48 -16 -48 2 polygon +1 1.000 72 0 8 0.000 360.000 xcarc +endgate +} def + +/xspice::d_xor2 { +<> +begingate +1 1.000 64 0 96 0 2 polygon +1 1.000 -48 32 -80 32 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 32 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 96 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d [%pA %pB] %%d %pX d_xor2_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_xor\(rise_delay=) @index (spice2:.model d_xor2_) {/Times-Roman cf} ctmk 20 +0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -44 48 -16 48 2 polygon +1 1.000 -48 -32 -80 -32 2 polygon +1.000 0.000 0.000 scb +(B) {/Times-Roman cf} 2 23 0.000 0.700 -80 -32 pinlabel +sce +1 1.000 -28 32 -28 -32 -44 -48 -44 48 spline +1 1.000 56 24 16 48 -16 48 64 0 spline +1 1.000 56 -24 16 -48 -16 -48 64 0 spline +1 1.000 -44 -48 -16 -48 2 polygon +1 1.000 -40 32 -40 -32 -56 -48 -56 48 spline +endgate +} def + +/xspice::d_xnor2 { +<> +begingate +1 1.000 80 0 96 0 2 polygon +1 1.000 -48 32 -80 32 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 32 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 96 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d [%pA %pB] %%d %pX d_xnor2_) @index (spice1:A) {/Times-Roman cf} +ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @input_load ( input_load=) @fall_delay ( fall_delay=) @rise_delay +( d_xnor\(rise_delay=) @index (spice2:.model d_xnor2_) {/Times-Roman cf} ctmk 20 +0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 0 label +sce +1 1.000 -44 48 -16 48 2 polygon +1 1.000 -48 -32 -80 -32 2 polygon +1.000 0.000 0.000 scb +(B) {/Times-Roman cf} 2 23 0.000 0.700 -80 -32 pinlabel +sce +1 1.000 -28 32 -28 -32 -44 -48 -44 48 spline +1 1.000 56 24 16 48 -16 48 64 0 spline +1 1.000 56 -24 16 -48 -16 -48 64 0 spline +1 1.000 -44 -48 -16 -48 2 polygon +1 1.000 -40 32 -40 -32 -56 -48 -56 48 spline +1 1.000 72 0 8 0.000 360.000 xcarc +endgate +} def + +/xspice::d_tristate { +<> begingate +1 1.000 48 0 80 0 2 polygon +1 1.000 -48 0 -80 0 2 polygon +1.000 0.000 0.000 scb +(A) {/Times-Roman cf} 2 23 0.000 0.700 -80 0 pinlabel +(X) {/Times-Roman cf} 2 20 0.000 0.700 80 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d %pA %%d %pEN %%d %pX d_tristate_) @index (spice1:A) +{/Times-Roman cf} ctmk 20 0.000 0.700 -112 -128 infolabel +mark (\)) @enable_load ( enable_load=) @input_load ( input_load=) @delay +( d_tristate\(delay=) @index (spice2:.model d_tristate_) {/Times-Roman cf} ctmk +20 0.000 0.700 -112 -160 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 -16 0 label +sce +1 1.000 48 0 -48 48 -48 -48 48 0 4 polygon +1 1.000 0 -24 0 -48 2 polygon +1.000 0.000 0.000 scb +(EN) {/Times-Roman cf} 2 29 0.000 0.700 0 -48 pinlabel +endgate +} def + +/xspice::d_pullup { +<> begingate +1.000 0.000 0.000 scb +(X) {/Times-Roman cf} 2 29 0.000 0.700 32 0 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d %pA %%d %pX d_pullup_) @index (spice1:A) {/Times-Roman cf} ctmk +20 0.000 0.700 -120 -40 infolabel +mark (\)) @load ( d_pullup\(load=) @index (spice2:.model d_pullup_) +{/Times-Roman cf} ctmk 20 0.000 0.700 -120 -72 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 20 0.000 0.700 64 64 label +sce +1 1.000 32 128 32 100 2 polygon +1 1.000 32 0 32 28 2 polygon +1 1.000 32 28 46 34 18 46 46 58 18 70 46 82 18 94 32 100 8 polygon +1 1.000 0 128 64 128 2 polygon +(Vdd) {/Times-Roman cf} 2 17 0.000 0.700 32 136 label +endgate +} def + +/xspice::d_pulldown { +<> begingate +1.000 0.000 0.000 scb +(X) {/Times-Roman cf} 2 17 0.000 0.700 32 160 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d %pA %%d %pX d_pulldown_) @index (spice1:A) {/Times-Roman cf} ctmk +20 0.000 0.700 -224 -32 infolabel +mark (\)) @load ( d_pulldown\(load=) @index (spice2:.model d_pulldown_) +{/Times-Roman cf} ctmk 20 0.000 0.700 -224 -64 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 20 0.000 0.700 64 96 label +sce +1 1.000 32 160 32 132 2 polygon +1 1.000 32 32 32 60 2 polygon +1 1.000 32 60 46 66 18 78 46 90 18 102 46 114 18 126 32 132 8 polygon +1 1.000 0 32 64 32 2 polygon +1 1.000 12 20 52 20 2 polygon +1 1.000 24 8 40 8 2 polygon +endgate +} def + +/xspice::d_latch { +<> begingate +1 1.000 -64 64 -96 64 2 polygon +1.000 0.000 0.000 scb +(D) {/Times-Roman cf} 2 23 0.000 0.700 -96 64 pinlabel +0.180 0.545 0.341 scb +mark @index ( %%d %pD %%d %pEN %%d %pS %%d %pC %%d %pQ %%d %pQbar d_latch_) @index +(spice1:A) {/Times-Roman cf} ctmk 20 0.000 0.700 -144 -176 infolabel +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 0 16 label +sce +0 1.000 -64 -64 -64 96 64 96 64 -64 4 polygon +1 1.000 64 64 96 64 2 polygon +1.000 0.000 0.000 scb +(Q) {/Times-Roman cf} 2 20 0.000 0.700 96 64 pinlabel +(EN) {/Times-Roman cf} 2 23 0.000 0.700 -96 -32 pinlabel +sce +1 1.000 64 -32 96 -32 2 polygon +1.000 0.000 0.000 scb +(Qbar) {/Times-Roman cf} 2 20 0.000 0.700 96 -32 pinlabel +sce +(D) {/Times-Roman cf} 2 21 0.000 0.700 -48 64 label +(S) {/Times-Roman cf} 2 21 0.000 0.700 0 80 label +(C) {/Times-Roman cf} 2 21 0.000 0.700 0 -48 label +(Q) {/Times-Roman cf} 2 21 0.000 0.700 48 64 label +(Q) {ol} {/Times-Roman cf} 3 21 0.000 0.700 48 -32 label +1.000 0.000 0.000 scb +(C) {/Times-Roman cf} 2 29 0.000 0.700 0 -96 pinlabel +(S) {/Times-Roman cf} 2 17 0.000 0.700 0 128 pinlabel +sce +1 1.000 0 -96 0 -64 2 polygon +1 1.000 0 128 0 96 2 polygon +0.180 0.545 0.341 scb +mark @reset_load ( reset_load=) @set_load ( set_load=) @enable_load +( enable_load=) @data_load ( data_load=) @ic (spice3:+ ic=) {/Times-Roman cf} +ctmk 20 0.000 0.700 -144 -240 infolabel +mark (\)) @fall_delay ( fall_delay=) @rise_delay (spice4:+ rise_delay=) +{/Times-Roman cf} ctmk 20 0.000 0.700 -144 -272 infolabel +mark @reset_delay ( reset_delay=) @set_delay ( set_delay=) @enable_delay +( d_latch\(enable_delay=) @index (spice2:.model d_latch_) {/Times-Roman cf} ctmk +20 0.000 0.700 -144 -208 infolabel +sce +1 1.000 -96 -32 -64 -32 2 polygon +(EN) {/Times-Roman cf} 2 20 0.000 0.700 -56 -32 label +endgate +} def + +/xspice::d_ram_8x1k { +<> begingate +0.000 0.000 1.000 scb +mark @index (A) {/Times-Roman cf} ctmk 21 0.000 0.700 224 96 label +sce +0 1.000 -64 -64 -64 224 544 224 544 -64 4 polygon +1.000 0.000 0.000 scb +(D7) {/Times-Roman cf} 2 23 0.000 0.700 -96 -32 pinlabel +sce +1 1.000 -96 -32 -64 -32 2 polygon +(D7) {/Times-Roman cf} 2 20 0.000 0.700 -56 -32 label +1.000 0.000 0.000 scb +(D6) {/Times-Roman cf} 2 23 0.000 0.700 -96 0 pinlabel +sce +1 1.000 -96 0 -64 0 2 polygon +(D6) {/Times-Roman cf} 2 20 0.000 0.700 -56 0 label +1.000 0.000 0.000 scb +(D5) {/Times-Roman cf} 2 23 0.000 0.700 -96 32 pinlabel +sce +1 1.000 -96 32 -64 32 2 polygon +(D5) {/Times-Roman cf} 2 20 0.000 0.700 -56 32 label +1.000 0.000 0.000 scb +(D4) {/Times-Roman cf} 2 23 0.000 0.700 -96 64 pinlabel +sce +1 1.000 -96 64 -64 64 2 polygon +(D4) {/Times-Roman cf} 2 20 0.000 0.700 -56 64 label +1.000 0.000 0.000 scb +(D3) {/Times-Roman cf} 2 23 0.000 0.700 -96 96 pinlabel +sce +1 1.000 -96 96 -64 96 2 polygon +(D3) {/Times-Roman cf} 2 20 0.000 0.700 -56 96 label +1.000 0.000 0.000 scb +(D2) {/Times-Roman cf} 2 23 0.000 0.700 -96 128 pinlabel +sce +1 1.000 -96 128 -64 128 2 polygon +(D2) {/Times-Roman cf} 2 20 0.000 0.700 -56 128 label +1.000 0.000 0.000 scb +(D1) {/Times-Roman cf} 2 23 0.000 0.700 -96 160 pinlabel +sce +1 1.000 -96 160 -64 160 2 polygon +(D1) {/Times-Roman cf} 2 20 0.000 0.700 -56 160 label +1.000 0.000 0.000 scb +(D0) {/Times-Roman cf} 2 23 0.000 0.700 -96 192 pinlabel +sce +1 1.000 -96 192 -64 192 2 polygon +(D0) {/Times-Roman cf} 2 20 0.000 0.700 -56 192 label +1.000 0.000 0.000 scb +(Q7) {/Times-Roman cf} 2 20 0.000 0.700 576 -32 pinlabel +sce +1 1.000 576 -32 544 -32 2 polygon +(Q7) {/Times-Roman cf} 2 23 0.000 0.700 536 -32 label +1.000 0.000 0.000 scb +(Q6) {/Times-Roman cf} 2 20 0.000 0.700 576 0 pinlabel +sce +1 1.000 576 0 544 0 2 polygon +(Q6) {/Times-Roman cf} 2 23 0.000 0.700 536 0 label +1.000 0.000 0.000 scb +(Q5) {/Times-Roman cf} 2 20 0.000 0.700 576 32 pinlabel +sce +1 1.000 576 32 544 32 2 polygon +(Q5) {/Times-Roman cf} 2 23 0.000 0.700 536 32 label +1.000 0.000 0.000 scb +(Q4) {/Times-Roman cf} 2 20 0.000 0.700 576 64 pinlabel +sce +1 1.000 576 64 544 64 2 polygon +(Q4) {/Times-Roman cf} 2 23 0.000 0.700 536 64 label +1.000 0.000 0.000 scb +(Q3) {/Times-Roman cf} 2 20 0.000 0.700 576 96 pinlabel +sce +1 1.000 576 96 544 96 2 polygon +(Q3) {/Times-Roman cf} 2 23 0.000 0.700 536 96 label +1.000 0.000 0.000 scb +(Q2) {/Times-Roman cf} 2 20 0.000 0.700 576 128 pinlabel +sce +1 1.000 576 128 544 128 2 polygon +(Q2) {/Times-Roman cf} 2 23 0.000 0.700 536 128 label +1.000 0.000 0.000 scb +(Q1) {/Times-Roman cf} 2 20 0.000 0.700 576 160 pinlabel +sce +1 1.000 576 160 544 160 2 polygon +(Q1) {/Times-Roman cf} 2 23 0.000 0.700 536 160 label +1.000 0.000 0.000 scb +(Q0) {/Times-Roman cf} 2 20 0.000 0.700 576 192 pinlabel +sce +1 1.000 576 192 544 192 2 polygon +(Q0) {/Times-Roman cf} 2 23 0.000 0.700 536 192 label +1 1.000 368 -64 368 -96 2 polygon +1 1.000 416 -64 416 -96 2 polygon +1 1.000 464 -64 464 -96 2 polygon +1.000 0.000 0.000 scb +(A2) {/Times-Roman cf} 2 29 0.000 0.700 368 -96 pinlabel +(A1) {/Times-Roman cf} 2 29 0.000 0.700 416 -96 pinlabel +(A0) {/Times-Roman cf} 2 29 0.000 0.700 464 -96 pinlabel +sce +1 1.000 320 -64 320 -96 2 polygon +1.000 0.000 0.000 scb +(A3) {/Times-Roman cf} 2 29 0.000 0.700 320 -96 pinlabel +sce +1 1.000 272 -64 272 -96 2 polygon +1.000 0.000 0.000 scb +(A4) {/Times-Roman cf} 2 29 0.000 0.700 272 -96 pinlabel +sce +1 1.000 224 -64 224 -96 2 polygon +1.000 0.000 0.000 scb +(A5) {/Times-Roman cf} 2 29 0.000 0.700 224 -96 pinlabel +sce +1 1.000 176 -64 176 -96 2 polygon +1.000 0.000 0.000 scb +(A6) {/Times-Roman cf} 2 29 0.000 0.700 176 -96 pinlabel +sce +1 1.000 128 -64 128 -96 2 polygon +1.000 0.000 0.000 scb +(A7) {/Times-Roman cf} 2 29 0.000 0.700 128 -96 pinlabel +sce +1 1.000 80 -64 80 -96 2 polygon +1.000 0.000 0.000 scb +(A8) {/Times-Roman cf} 2 29 0.000 0.700 80 -96 pinlabel +sce +1 1.000 32 -64 32 -96 2 polygon +1.000 0.000 0.000 scb +(A9) {/Times-Roman cf} 2 29 0.000 0.700 32 -96 pinlabel +sce +(A9) {/Times-Roman cf} 2 17 0.000 0.700 32 -48 label +(A8) {/Times-Roman cf} 2 17 0.000 0.700 80 -48 label +(A7) {/Times-Roman cf} 2 17 0.000 0.700 128 -48 label +(A6) {/Times-Roman cf} 2 17 0.000 0.700 176 -48 label +(A5) {/Times-Roman cf} 2 17 0.000 0.700 224 -48 label +(A4) {/Times-Roman cf} 2 17 0.000 0.700 272 -48 label +(A3) {/Times-Roman cf} 2 17 0.000 0.700 320 -48 label +(A2) {/Times-Roman cf} 2 17 0.000 0.700 368 -48 label +(A1) {/Times-Roman cf} 2 17 0.000 0.700 416 -48 label +(A0) {/Times-Roman cf} 2 17 0.000 0.700 464 -48 label +(SRAM 1k x 8) {/Times-Roman cf} 2 21 0.000 0.700 224 48 label +0.180 0.545 0.341 scb +mark ( %%d [ %pD7 %pD6 %pD5 %pD4 %pD3 %pD2 %pD1 %pD0 ]) @index (spice1:A) +{/Times-Roman cf} ctmk 20 0.000 0.700 -144 -192 infolabel +(spice2:+ %%d [ %pQ7 %pQ6 %pQ5 %pQ4 %pQ3 %pQ2 %pQ1 %pQ0 ]) {/Times-Roman cf} 2 +20 0.000 0.700 -144 -224 infolabel +(spice3:+ %%d [ %pA9 %pA8 %pA7 %pA6 %pA5 %pA4 %pA3 %pA2 %pA1 %pA0 ]) +{/Times-Roman cf} 2 20 0.000 0.700 -144 -256 infolabel +mark @index (spice4:+ d_ram_8x1k) {/Times-Roman cf} ctmk 20 0.000 0.700 -144 -288 +infolabel +mark @read_delay ( read_delay=) @ic ( ic=) @select_value +( d_ram\(select_value=) @index (spice5:.model d_ram_8x1k) {/Times-Roman cf} ctmk +20 0.000 0.700 -144 -320 infolabel +mark (\)) @enable_load ( enable_load=) @select_load ( select_load=) +@address_load ( address_load=) @data_load (spice6:+ data_load=) +{/Times-Roman cf} ctmk 20 0.000 0.700 -144 -352 infolabel +endgate +} def + + +% EndLib diff --git a/libraries.c b/libraries.c index ce57086..7962d7b 100644 --- a/libraries.c +++ b/libraries.c @@ -42,7 +42,6 @@ /*-------------------------------------------------------------------------*/ extern Display *dpy; /* Works well to make this globally accessible */ -extern int *appcolors; extern Cursor appcursors[NUM_CURSORS]; extern Globaldata xobjs; extern XCWindowData *areawin; @@ -50,6 +49,8 @@ extern char _STR[150]; extern short fontcount; extern fontinfo *fonts; extern Boolean was_preselected; +extern int number_colors; +extern colorindex *colorlist; /*---------------------------------------------------------*/ /* Find the Helvetica font for use in labeling the objects */ @@ -647,7 +648,7 @@ void composepagelib(short mode) strptr->type = TEXT_STRING; strptr->data.string = (char *) malloc(1 + strlen(libobj->name)); strcpy(strptr->data.string, libobj->name); - (*pagelabel)->justify = TOP | NOTBOTTOM | NOTLEFT; + (*pagelabel)->anchor = TOP | NOTBOTTOM | NOTLEFT; } } @@ -894,14 +895,14 @@ void composelib(short mode) strptr->type = TEXT_STRING; strptr->data.string = strdup(libobj->name); - (*drawname)->justify = TOP | NOTBOTTOM | NOTLEFT; + (*drawname)->anchor = TOP | NOTBOTTOM | NOTLEFT; /* If the label is longer than the object width, then */ /* adjust positions accordingly. Note that as an ad- */ /* hoc spacing rule, a padding of 30 is put between */ /* objects; this padding is reduced to 5 */ - tmpext = ULength(*drawname, drawinst, 0, NULL); + tmpext = ULength(*drawname, drawinst, NULL); /* Ad-hoc spacing rule is 5 for labels */ tmpext.width += 5; @@ -1546,6 +1547,7 @@ void copycat() if (areawin->topinstance == xobjs.libtop[USERLIB]) drawarea(NULL, NULL, NULL); else startcatalog(NULL, (pointertype)USERLIB, NULL); + zoomview(NULL, NULL, NULL); } /*--------------------------------------------------------*/ @@ -1709,7 +1711,6 @@ void catalog_op(int op, int x, int y) if (newselect == areawin->selectlist + areawin->selects) { newselect = allocselect(); *newselect = newinst; - XcSetFunction(GXcopy); XcTopSetForeground(SELECTCOLOR); UDrawObject(*libobj, SINGLE, SELECTCOLOR, xobjs.pagelist[areawin->page]->wirewidth, NULL); diff --git a/log_text.html b/log_text.html deleted file mode 100644 index e69de29..0000000 diff --git a/menucalls.c b/menucalls.c index 389049a..a4b71f2 100644 --- a/menucalls.c +++ b/menucalls.c @@ -46,7 +46,6 @@ extern xcWidget top; extern Display *dpy; extern Globaldata xobjs; extern XCWindowData *areawin; -extern int *appcolors; extern int number_colors; extern colorindex *colorlist; extern ApplicationData appdata; @@ -590,50 +589,65 @@ void makenewfontbutton() /*---------------------------------------------------------------*/ /* Some Xcircuit routines using toggle and toggleexcl, */ /* put here because they reference the menu structures directly. */ +/* */ +/* Note that by bypassing addnewcolorentry(), the new colors in */ +/* colorlist are NOT added to the GUI list of colors. */ /*---------------------------------------------------------------*/ void setcolorscheme(Boolean boolvalue) { + int i; + if (boolvalue) { - PARAMCOLOR = appdata.parampix; - AUXCOLOR = appdata.auxpix; - OFFBUTTONCOLOR = appdata.buttonpix; - SELECTCOLOR = appdata.selectpix; - GRIDCOLOR = appdata.gridpix; - SNAPCOLOR = appdata.snappix; - AXESCOLOR = appdata.axespix; - BACKGROUND = appdata.bg; - FOREGROUND = appdata.fg; + colorlist[PARAMCOLOR].color.pixel = appdata.parampix; + colorlist[AUXCOLOR].color.pixel = appdata.auxpix; + colorlist[OFFBUTTONCOLOR].color.pixel = appdata.buttonpix; + colorlist[SELECTCOLOR].color.pixel = appdata.selectpix; + colorlist[GRIDCOLOR].color.pixel = appdata.gridpix; + colorlist[SNAPCOLOR].color.pixel = appdata.snappix; + colorlist[AXESCOLOR].color.pixel = appdata.axespix; + colorlist[BACKGROUND].color.pixel = appdata.bg; + colorlist[FOREGROUND].color.pixel = appdata.fg; } else { - PARAMCOLOR = appdata.parampix2; - AUXCOLOR = appdata.auxpix2; - OFFBUTTONCOLOR = appdata.buttonpix2; - SELECTCOLOR = appdata.selectpix2; - GRIDCOLOR = appdata.gridpix2; - SNAPCOLOR = appdata.snappix2; - AXESCOLOR = appdata.axespix2; - BACKGROUND = appdata.bg2; - FOREGROUND = appdata.fg2; + colorlist[PARAMCOLOR].color.pixel = appdata.parampix2; + colorlist[AUXCOLOR].color.pixel = appdata.auxpix2; + colorlist[OFFBUTTONCOLOR].color.pixel = appdata.buttonpix2; + colorlist[SELECTCOLOR].color.pixel = appdata.selectpix2; + colorlist[GRIDCOLOR].color.pixel = appdata.gridpix2; + colorlist[SNAPCOLOR].color.pixel = appdata.snappix2; + colorlist[AXESCOLOR].color.pixel = appdata.axespix2; + colorlist[BACKGROUND].color.pixel = appdata.bg2; + colorlist[FOREGROUND].color.pixel = appdata.fg2; } - BARCOLOR = appdata.barpix; - FILTERCOLOR = appdata.filterpix; - - LOCALPINCOLOR = appdata.localcolor; - GLOBALPINCOLOR = appdata.globalcolor; - INFOLABELCOLOR = appdata.infocolor; - RATSNESTCOLOR = appdata.ratsnestcolor; - BBOXCOLOR = appdata.bboxpix; - CLIPMASKCOLOR = appdata.clipcolor; - -#if !defined(TCL_WRAPPER) && !defined(DOUBLEBUFFER) - { - Arg wargs[1]; - XtSetArg(wargs[0], XtNbackground, BACKGROUND); - XtSetValues(areawin->area, wargs, 1); + colorlist[BARCOLOR].color.pixel = appdata.barpix; + colorlist[FILTERCOLOR].color.pixel = appdata.filterpix; + + colorlist[LOCALPINCOLOR].color.pixel = appdata.localcolor; + colorlist[GLOBALPINCOLOR].color.pixel = appdata.globalcolor; + colorlist[INFOLABELCOLOR].color.pixel = appdata.infocolor; + colorlist[RATSNESTCOLOR].color.pixel = appdata.ratsnestcolor; + colorlist[BBOXCOLOR].color.pixel = appdata.bboxpix; + colorlist[CLIPMASKCOLOR].color.pixel = appdata.clipcolor; + + /* Fill in pixel information */ + + for (i = 0; i < NUMBER_OF_COLORS; i++) { + unsigned short r, g, b; + + /* Get the color the hard way by querying the X server colormap */ + xc_get_color_rgb(colorlist[i].color.pixel, &r, &g, &b); + + /* Store this information locally so we don't have to do */ + /* the lookup the hard way in the future. */ + + colorlist[i].color.red = r; + colorlist[i].color.green = g; + colorlist[i].color.blue = b; } -#endif + areawin->redraw_needed = True; + drawarea(NULL, NULL, NULL); } /*----------------------------------------------------------------*/ @@ -854,18 +868,12 @@ void setcolormark(int colorval) /* Set GUI variables and execute any command tags associated */ /* with the "color" command */ +#ifdef TCL_WRAPPER char cstr[6]; - int i; - if (colorval != DEFAULTCOLOR) { - for (i = 0; i < number_colors; i++) - if (colorlist[i].color.pixel == colorval) { - sprintf(cstr, "%5d", i); - break; - } - } + if (colorval != DEFAULTCOLOR) + sprintf(cstr, "%5d", colorval); -#ifdef TCL_WRAPPER XcInternalTagCall(xcinterp, 3, "color", "set", (colorval == DEFAULTCOLOR) ? "inherit" : cstr); #endif @@ -1009,8 +1017,7 @@ int setelementstyle(xcWidget w, u_short value, u_short mask) continue; } - XSetFunction(dpy, areawin->gc, GXcopy); - XSetForeground(dpy, areawin->gc, BACKGROUND); + SetForeground(dpy, areawin->gc, BACKGROUND); easydraw(*sstyle, DOFORALL); *estyle = newstyle; @@ -1018,8 +1025,7 @@ int setelementstyle(xcWidget w, u_short value, u_short mask) (SELTOPOLY(sstyle))->color = (value & BBOX) ? BBOXCOLOR : DEFAULTCOLOR; - XSetFunction(dpy, areawin->gc, GXxor); - XSetForeground(dpy, areawin->gc, SELECTCOLOR ^ BACKGROUND); + SetForeground(dpy, areawin->gc, SELECTCOLOR); easydraw(*sstyle, DOFORALL); #ifdef TCL_WRAPPER @@ -1084,13 +1090,10 @@ int setelementstyle(xcWidget w, u_short value, u_short mask) void setcolor(xcWidget w, int cindex) { short *scolor; - int *ecolor, cval, oldcolor; + int *ecolor, oldcolor; Boolean selected = False; stringpart *strptr, *nextptr; - if (cindex == -1) cval = -1; - else cval = colorlist[cindex].color.pixel; - if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { labelptr curlabel = TOLABEL(EDITPART); strptr = findstringpart(areawin->textpos - 1, NULL, curlabel->string, @@ -1118,7 +1121,7 @@ void setcolor(xcWidget w, int cindex) + areawin->selects; scolor++) { ecolor = &(SELTOCOLOR(scolor)); oldcolor = *ecolor; - *ecolor = cval; + *ecolor = cindex; selected = True; register_for_undo(XCF_Color, (scolor == areawin->selectlist @@ -1128,10 +1131,10 @@ void setcolor(xcWidget w, int cindex) } } - setcolormark(cval); + setcolormark(cindex); if (!selected) { if (eventmode != TEXT_MODE && eventmode != ETEXT_MODE) - areawin->color = cval; + areawin->color = cindex; } else pwriteback(areawin->topinstance); } @@ -1148,7 +1151,7 @@ void togglefontmark(int fontval) /*------------------------------------------------------*/ /* Set checkmarks on label style menu */ -/* fvalue is for font, jvalue is for justification */ +/* fvalue is for font, jvalue is for anchoring */ /*------------------------------------------------------*/ void togglestylemark(int styleval) @@ -1170,19 +1173,22 @@ void toggleencodingmark(int encodingval) } /*------------------------------------------------------*/ -/* Set checkmarks on label justification & flags menu */ +/* Set checkmarks on label anchoring & flags menu */ /*------------------------------------------------------*/ -void togglejustmarks(int justvalue) +void toggleanchormarks(int anchorvalue) { - XcInternalTagCall(xcinterp, 4, "label", "justify", (justvalue & RIGHT) ? "right" : - (justvalue & NOTLEFT) ? "center" : "left", - (justvalue & TOP) ? "top" : (justvalue & NOTBOTTOM) ? "middle" : "bottom"); - XcInternalTagCall(xcinterp, 3, "label", "flipinvariant", (justvalue & FLIPINV) ? + XcInternalTagCall(xcinterp, 4, "label", "anchor", (anchorvalue & RIGHT) ? "right" : + (anchorvalue & NOTLEFT) ? "center" : "left", + (anchorvalue & TOP) ? "top" : (anchorvalue & NOTBOTTOM) ? "middle" : "bottom"); + XcInternalTagCall(xcinterp, 3, "label", "justify", (anchorvalue & JUSTIFYRIGHT) ? + "right" : (anchorvalue & TEXTCENTERED) ? "center" : (anchorvalue & JUSTIFYBOTH) + ? "both" : "left"); + XcInternalTagCall(xcinterp, 3, "label", "flipinvariant", (anchorvalue & FLIPINV) ? "true" : "false"); - XcInternalTagCall(xcinterp, 3, "label", "latex", (justvalue & LATEXLABEL) ? + XcInternalTagCall(xcinterp, 3, "label", "latex", (anchorvalue & LATEXLABEL) ? "true" : "false"); - XcInternalTagCall(xcinterp, 3, "label", "visible", (justvalue & PINVISIBLE) ? + XcInternalTagCall(xcinterp, 3, "label", "visible", (anchorvalue & PINVISIBLE) ? "true" : "false"); } @@ -1197,7 +1203,7 @@ void setfontmarks(short fvalue, short jvalue) togglestylemark(fvalue); togglefontmark(fvalue); } - togglejustmarks(jvalue); + toggleanchormarks(jvalue); } #endif /* TCL_WRAPPER */ @@ -1253,7 +1259,7 @@ void startunparam(xcWidget w, pointertype value, caddr_t calldata) void setdefaultfontmarks() { - setfontmarks(areawin->psfont, areawin->justify); + setfontmarks(areawin->psfont, areawin->anchor); } /*----------------------------------------------------------------*/ @@ -1685,7 +1691,7 @@ Boolean dospecial() int cfont; curlabel = TOLABEL(EDITPART); - if (curlabel->justify & LATEXLABEL) return False; + if (curlabel->anchor & LATEXLABEL) return False; cfont = findcurfont(areawin->textpos, curlabel->string, areawin->topinstance); composefontlib(cfont); diff --git a/menus.h b/menus.h index fdd1367..d506423 100644 --- a/menus.h +++ b/menus.h @@ -61,8 +61,8 @@ menustruct FontStyles[] = { }; menustruct FontEncodings[] = { - {"Standard", setaction(fontencoding, Number(0))}, - {"ISO-Latin1", action(fontencoding, Number(2))}, + {"Standard", action(fontencoding, Number(0))}, + {"ISO-Latin1", setaction(fontencoding, Number(2))}, }; menustruct TextSpacing[] = { @@ -76,16 +76,16 @@ menustruct TextSpacing[] = { {"Character", action(addtotext, Number(SPECIAL))}, }; -menustruct Justifs[] = { - {"Left Justified", setaction(sethjust, Number(NORMAL))}, - {"Center Justified", action(sethjust, Number(NOTLEFT))}, - {"Right Justified", action(sethjust, Number(NOTLEFT | RIGHT))}, +menustruct Anchors[] = { + {"Left Anchored", setaction(sethanchor, Number(NORMAL))}, + {"Center Anchored", action(sethanchor, Number(NOTLEFT))}, + {"Right Anchored", action(sethanchor, Number(NOTLEFT | RIGHT))}, {" ", noaction}, - {"Top Justified", action(setvjust, Number(NOTBOTTOM | TOP))}, - {"Middle Justified", action(setvjust, Number(NOTBOTTOM))}, - {"Bottom Justified", setaction(setvjust, Number(NORMAL))}, + {"Top Anchored", action(setvanchor, Number(NOTBOTTOM | TOP))}, + {"Middle Anchored", action(setvanchor, Number(NOTBOTTOM))}, + {"Bottom Anchored", setaction(setvanchor, Number(NORMAL))}, {" ", noaction}, - {"Flip Invariant", setaction(setjustbit, Number(FLIPINV))}, + {"Flip Invariant", setaction(setanchorbit, Number(FLIPINV))}, }; menustruct BoxEditStyles[] = { @@ -150,7 +150,7 @@ menustruct Parameterize[] = { {"Substring", action(promptparam, NULL)}, {"Numeric", action(startparam, Number(P_NUMERIC))}, {"Style", action(startparam, Number(P_STYLE))}, - {"Justification", action(startparam, Number(P_JUSTIFY))}, + {"Anchoring", action(startparam, Number(P_ANCHOR))}, {"Start Angle", action(startparam, Number(P_ANGLE1))}, {"End Angle", action(startparam, Number(P_ANGLE2))}, {"Radius", action(startparam, Number(P_RADIUS))}, @@ -183,11 +183,11 @@ menustruct TextMenu[] = { {"Style", submenu(FontStyles)}, {"Encoding", submenu(FontEncodings)}, {"Insert", submenu(TextSpacing)}, - {"Justification (keypad)", submenu(Justifs)}, + {"Anchoring (keypad)", submenu(Anchors)}, {"Parameterize", action(promptparam, NULL)}, {"Unparameterize", action(startunparam, Number(P_SUBSTRING))}, {" ", noaction}, - {"Set LaTeX Mode", action(setjustbit, Number(LATEXLABEL))}, + {"Set LaTeX Mode", action(setanchorbit, Number(LATEXLABEL))}, {" ", noaction}, {"Make Label (t)", action(changetool, Number(XCF_Text))}, }; @@ -261,7 +261,7 @@ menustruct SchemaMenu[] = { {"Make Info Pin (I)", action(changetool, Number(XCF_Info_Label))}, {"Make Global Pin (G)", action(changetool, Number(XCF_Pin_Global))}, {"Convert Label to...", submenu(PinConvert)}, - {"Pin Visibility", action(setpinjustbit, Number(PINVISIBLE))}, + {"Pin Visibility", action(setpinanchorbit, Number(PINVISIBLE))}, /* {"Make Object Non-Schematic", action(maketrivial, NULL)}, */ {"Make Matching Symbol", action(dobeforeswap, NULL)}, {"Associate with Symbol", action(startschemassoc, Number(1))}, @@ -295,7 +295,12 @@ menustruct FileMenu[] = { #endif {"Read Xcircuit File", action(getfile, Number(NORMAL))}, {"Import Xcircuit PS", action(getfile, Number(IMPORT))}, +#if !defined(HAVE_CAIRO) || defined(HAVE_GS) {"Import background PS", action(getfile, Number(PSBKGROUND))}, +#endif +#ifdef HAVE_CAIRO + {"Import graphic image", action(getfile, Number(IMPORTGRAPHIC))}, +#endif #ifdef ASG {"Import SPICE deck", action(getfile, Number(IMPORTSPICE))}, #endif diff --git a/netlist.c b/netlist.c index 4e04473..e573959 100644 --- a/netlist.c +++ b/netlist.c @@ -65,7 +65,6 @@ extern Tcl_Obj *TclGetStringParts(stringpart *); /*----------------------------------------------------------------------*/ extern Display *dpy; -extern int *appcolors; /*----------------------------------------------------------------------*/ @@ -74,6 +73,8 @@ extern char _STR2[250]; extern XCWindowData *areawin; extern Globaldata xobjs; extern Boolean load_in_progress; +extern int number_colors; +extern colorindex *colorlist; LabellistPtr global_labels; @@ -619,7 +620,9 @@ void gennetlist(objinstptr thisinst) } } if (i == thisobject->parts) - Fprintf(stderr, "Warning: Symbol %s has no pins!\n", thisobject->name); + /* Don't warn if schematic has infolabels */ + if (thisobject->symschem == NULL || thisobject->symschem->infolabels == 0) + Fprintf(stderr, "Warning: Symbol %s has no pins!\n", thisobject->name); } /* If this is a secondary schematic, run on the primary (master) */ @@ -816,6 +819,12 @@ void gennetlist(objinstptr thisinst) mergenets(pschem, netlist, tmplist); } } + else if (clab->pin == INFO) { + /* Note the presence of info labels in the */ + /* subcircuit, indicating that it needs to be */ + /* called because it will generate output. */ + cschem->infolabels = TRUE; + } } } @@ -1297,22 +1306,9 @@ void gencalls(objectptr thisobject) /* to ensure that the netlist output is generated. */ /*----------------------------------------------------------*/ - if (pschem->calls->ports == NULL) { - - for (k = 0; k < callsymb->parts; k++) { - genericptr *pgen; - labelptr plab; - - pgen = callsymb->plist + k; - if (IS_LABEL(*pgen)) { - plab = TOLABEL(pgen); - if (plab->pin == INFO) - break; - } - } - if (k == callsymb->parts) /* No info labels: */ + if (pschem->calls->ports == NULL) + if (pschem->infolabels == FALSE) removecall(pschem, pschem->calls); /* Remove the call */ - } } } } @@ -1511,8 +1507,7 @@ Boolean highlightnet(objectptr cschem, objinstptr cinst, int netid, u_char mode) Boolean rval = FALSE; objectptr pschem; - XcSetFunction(GXcopy); - XSetForeground(dpy, areawin->gc, curcolor); + SetForeground(dpy, areawin->gc, curcolor); pschem = (cschem->schemtype == SECONDARY) ? cschem->symschem : cschem; @@ -1701,7 +1696,7 @@ Boolean match_buses(Genericlist *list1, Genericlist *list2, int mode) // are non-matching. if (list1->subnets != 0 && list2->subnets != 0) - return FALSE; + return FALSE; else if (list1->subnets != 1 && list2->subnets != 1) return FALSE; } @@ -1787,7 +1782,7 @@ Genericlist *new_tmp_pin(objectptr cschem, XPoint *pinpt, char *pinstring, NEW_LABEL(newlabel, cschem); labeldefaults(*newlabel, LOCAL, pinpt->x, pinpt->y); - (*newlabel)->justify = 0; + (*newlabel)->anchor = 0; (*newlabel)->color = DEFAULTCOLOR; strptr = (*newlabel)->string; strptr->type = TEXT_STRING; @@ -1820,7 +1815,7 @@ labelptr new_global_pin(labelptr clabel, objinstptr cinst) newlabel = (labelptr) malloc(sizeof(label)); newlabel->type = LABEL; labeldefaults(newlabel, GLOBAL, 0, 0); - newlabel->justify = 0; + newlabel->anchor = 0; newlabel->color = DEFAULTCOLOR; free(newlabel->string); newlabel->string = stringcopyall(clabel->string, cinst); @@ -3255,7 +3250,7 @@ void ratsnest(objinstptr thisinst) NEW_POLY(newpoly, cschem); polydefaults(*newpoly, 1, portpos.x, portpos.y); (*newpoly)->style |= UNCLOSED; - (*newpoly)->color = xc_getlayoutcolor(RATSNESTCOLOR); + (*newpoly)->color = RATSNESTCOLOR; addpoly(cschem, *newpoly, (Genericlist *)llist); } else @@ -3463,6 +3458,52 @@ u_int devindex(objectptr cfrom, CalllistPtr clist) return objindex; } +/*----------------------------------------------------------------------*/ +/* Generate and return a list of all info label prefixes in a design */ +/* This does not depend on the netlist being generated (i.e., does not */ +/* use CalllistPtr) */ +/*----------------------------------------------------------------------*/ + +void genprefixlist(objectptr cschem, slistptr *modelist) +{ + int locpos; + genericptr *pgen; + labelptr plabel; + objinstptr cinst; + stringpart *strptr; + slistptr modeptr; + + for (pgen = cschem->plist; pgen < cschem->plist + cschem->parts; pgen++) { + if (IS_LABEL(*pgen)) { + plabel = TOLABEL(pgen); + if (plabel->pin == INFO) { + + strptr = findtextinstring(":", &locpos, plabel->string, cinst); + if (locpos <= 0 || strptr == NULL) + continue; /* null after netlist type designator, don't count */ + + for (modeptr = *modelist; modeptr; modeptr = modeptr->next) + if (!strncmp(modeptr->alias, strptr->data.string, locpos)) + break; + + if (modeptr == NULL) { /* Mode has not been enumerated */ + modeptr = (slistptr)malloc(sizeof(stringlist)); + modeptr->alias = (char *)malloc(locpos + 1); + strncpy(modeptr->alias, strptr->data.string, locpos); + modeptr->next = *modelist; + *modelist = modeptr; + } + } + } + else if (IS_OBJINST(*pgen)) { + cinst = TOOBJINST(pgen); + genprefixlist(cinst->thisobject, modelist); + if (cinst->thisobject->symschem != NULL) + genprefixlist(cinst->thisobject->symschem, modelist); + } + } +} + /*----------------------------------------------------------------------*/ /* Create and return an ordered list of info labels for the schematic */ /* page cschem. A linked label list is returned, combining info labels */ @@ -3473,7 +3514,7 @@ u_int devindex(objectptr cfrom, CalllistPtr clist) LabellistPtr geninfolist(objectptr cschem, objinstptr cinst, char *mode) { - int locpos, j; /* i, (jdk) */ + int locpos, j; int vmax; genericptr *pgen; labelptr plabel; @@ -3650,7 +3691,7 @@ char *parseinfo(objectptr cfrom, objectptr cthis, CalllistPtr clist, { /* genericptr *pgen; (jdk) */ stringpart *strptr, *ppin, *optr; - char *snew, *sout = NULL; + char *snew, *sout = NULL, *pstring; u_char *strt, *fnsh; PortlistPtr ports; oparamptr ops, instops; @@ -3866,8 +3907,8 @@ char *parseinfo(objectptr cfrom, objectptr cthis, CalllistPtr clist, fnsh = strt + 1; while (*fnsh != '\0' && !isspace(*fnsh) && *fnsh != '"') fnsh++; - strncpy(_STR, strt, (int)(fnsh - strt)); - _STR[(int)(fnsh - strt)] = '\0'; + strncpy(_STR2, strt, (int)(fnsh - strt)); + _STR2[(int)(fnsh - strt)] = '\0'; i += (fnsh - strt); /* if (is_quoted || *fnsh == '\0') i++; */ if (is_quoted) i++; @@ -3884,11 +3925,18 @@ char *parseinfo(objectptr cfrom, objectptr cthis, CalllistPtr clist, for (ports = pschem->ports; ports != NULL; ports = ports->next) { + + subnet = getsubnet(ports->netid, pschem); ppin = nettopin(ports->netid, pschem, NULL); - if (!textcomp(ppin, _STR, NULL)) { + // NOTE: _STR is used inside textprintsubnet() + pstring = textprintsubnet(ppin, NULL, subnet); + if (!strcmp(pstring, _STR2)) { portid = ports->portid; + free(pstring); break; } + else + free(pstring); } if (ports != NULL) { @@ -4148,7 +4196,7 @@ int writedevice(FILE *fp, char *mode, objectptr cfrom, CalllistPtr clist, /* Devices are always symbols. If the call indicates a schematic */ /* and a separate associated symbol, then we want the symbol. */ - /* If we're writing a flat netlist, then return -1 to indicate that */ + /* If we're writing a flat netlist, then return -1 to indicate that */ /* the symbol instance needs to be flattened. */ cthis = clist->callobj; @@ -6591,7 +6639,7 @@ void append_included(char *filename) for (numi = 0; *(included_files + numi) != (ino_t)NULL; numi++); included_files = (ino_t *)realloc(included_files, - (++numi) * sizeof(ino_t)); + (++numi + 1) * sizeof(ino_t)); *(included_files + numi - 1) = filestatus.st_ino; *(included_files + numi) = (ino_t)NULL; diff --git a/ngspice.c b/ngspice.c index 50b5f2d..5efcf33 100644 --- a/ngspice.c +++ b/ngspice.c @@ -55,7 +55,6 @@ extern char _STR2[250], _STR[150]; extern Globaldata xobjs; extern XCWindowData *areawin; extern Display *dpy; -extern int *appcolors; extern int number_colors; extern colorindex *colorlist; extern Cursor appcursors[NUM_CURSORS]; @@ -443,7 +442,7 @@ int xctcl_spice(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int result, idx; - char *msg, *eptr; + char *msg, *msgin, *eptr; static char *subCmds[] = { "start", "send", "get", "break", "resume", "status", @@ -534,20 +533,24 @@ int xctcl_spice(ClientData clientData, Tcl_Interp *interp, /* method, so we keep control over the output and the */ /* state of the simulator. */ - msg = Tcl_GetString(objv[2]); - if (!strncmp(msg, "run", 3) || !strncmp(msg, "resume", 6)) { + msgin = Tcl_GetString(objv[2]); + if (!strncmp(msgin, "run", 3) || !strncmp(msgin, "resume", 6)) { Tcl_SetResult(interp, "Do not use \"send\" with " "\"run\" or \"resume\"\n", NULL); return TCL_ERROR; } else - send_to_spice(msg); + send_to_spice(msgin); msg = recv_from_spice(interp, EXPECT_PROMPT); if (*msg == '\0') return TCL_ERROR; - else - Tcl_SetResult(interp, msg, TCL_STATIC); + else { + char *mp = msg; + /* ngspice echos the terminal, so walk past input */ + while (*mp++ == *msgin++); + Tcl_SetResult(interp, mp, TCL_STATIC); + } break; case FlushIdx: @@ -587,12 +590,14 @@ int xctcl_spice(ClientData clientData, Tcl_Interp *interp, if (break_spice(interp) < 0) return TCL_ERROR; + if (objc == 2) break; + /* Similar to "spice send {print ...}", but processes */ /* the output like "spice break" does to return just */ /* the result. However, if no index is provided for */ /* the variable, we determine the timestep and set the */ /* index accordingly. */ - if (objc == 2) break; + msg = Tcl_GetString(objv[2]); if (strchr(msg, '[') != NULL) sprintf(_STR2, "print %s", msg); diff --git a/opengl.c b/opengl.c deleted file mode 100644 index 75d1868..0000000 --- a/opengl.c +++ /dev/null @@ -1,445 +0,0 @@ -/*----------------------------------------------------------------------*/ -/* opengl.c --- routines defining graphics, whether OpenGL or X11 */ -/* Copyright (c) 2005 Tim Edwards, MultiGiG, Inc. */ -/*----------------------------------------------------------------------*/ - -#ifdef OPENGL - -/*----------------------------------------------------------------------*/ -/* written by Tim Edwards, 6/1/05 */ -/*----------------------------------------------------------------------*/ - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -/*----------------------------------------------------------------------*/ -/* Local includes */ -/*----------------------------------------------------------------------*/ - -#ifdef TCL_WRAPPER -#include -#endif - -#include "xcircuit.h" -#include "colordefs.h" - -/*----------------------------------------------------------------------*/ -/* Function prototype declarations */ -/*----------------------------------------------------------------------*/ - -#include "prototypes.h" - -extern Colormap cmap; -extern int *appcolors; - -extern char STIPDATA[STIPPLES][4]; - -extern float gl_line_limit, gl_point_limit; - -/*----------------------------------------------------------------------*/ -/* Global variables--- */ -/* Maintain current linewidth, because we need to pass this to the */ -/* rendering routines, since we're duplicating all of the X calls, */ -/* and they don't pass linewidth to the geometry drawing routines. */ -/*----------------------------------------------------------------------*/ - -float cur_linewidth; - -/*----------------------------------------------*/ -/* Set color in OpenGL (this should be replaced */ -/* for speed. . .) */ -/*----------------------------------------------*/ - -void -SetForeground(Display *dpy, GC nullptr, int idx) -{ - XColor fgcolor; - int red, green, blue; - - fgcolor.pixel = idx; - fgcolor.flags = DoRed | DoGreen | DoBlue; - - XQueryColor(dpy, cmap, &fgcolor); - - glColor3us((GLushort)fgcolor.red, (GLushort)fgcolor.green, - (GLushort)fgcolor.blue); -} - -/*----------------------------------------------*/ -/* Don't know if this is meaningful or not. */ -/*----------------------------------------------*/ - -void -SetBackground(Display *dpy, GC nullptr, int idx) -{ - /* null proc */ -} - -/*------------------------------------------------------*/ -/* Set drawing function */ -/*------------------------------------------------------*/ - -void -SetFunction(Display *dpy, GC nullptr, int xfunction) -{ - switch (xfunction) { - case GXcopy: - glDisable(GL_COLOR_LOGIC_OP); - /* Is it better to disable the logic op? */ - /* - glEnable(GL_COLOR_LOGIC_OP); - glLogicOp(GL_COPY); - */ - break; - case GXxor: - glEnable(GL_COLOR_LOGIC_OP); - glLogicOp(GL_XOR); - break; - } -} - -/*------------------------------------------------------*/ -/* Set line attributes */ -/*------------------------------------------------------*/ - -void -SetLineAttributes(Display *dpy, GC nullptr, float lwidth, - int ldash, int lcap, int lbevel) -{ - GLfloat glwidth = (lwidth <= 0) ? 1 : (GLfloat)lwidth; - glLineWidth(glwidth); - glPointSize(glwidth); - - cur_linewidth = (float)glwidth; - - if (lwidth > gl_line_limit) - glDisable(GL_LINE_SMOOTH); - else - glEnable(GL_LINE_SMOOTH); - - switch (ldash) { - case LineSolid: - glDisable(GL_LINE_STIPPLE); - break; - case LineOnOffDash: - glEnable(GL_LINE_STIPPLE); - break; - } - /* Cap and Mitre not handled by OpenGL */ -} - -/*------------------------------------------------------*/ -/* Set Line dash */ -/*------------------------------------------------------*/ - -void -SetDashes(Display *dpy, GC nullptr, int offset, char dashlist[], int n) -{ - union { - char dashbytes[2]; - u_short dashpat; - } dashspec; - - dashspec.dashbytes[0] = dashlist[0]; - dashspec.dashbytes[1] = dashlist[1]; - - glLineStipple((GLint)1, (GLushort)dashspec.dashpat); -} - -/*------------------------------------------------------*/ -/* Set Polygon fill stipple (optimize this!) */ -/*------------------------------------------------------*/ - -void -SetStipple(Display *dpy, GC nullptr, int stipple) -{ - u_char stipdata[128]; - char *stipsrc = STIPDATA[stipple]; - char *stipdest = stipdata; - int i; - for (i = 0; i < 32; i++) { - memcpy(stipdest, stipsrc, 4); - stipdest += 4; - } - glPolygonStipple((GLubyte *)stipdata); -} - -/*------------------------------------------------------*/ -/* Set Polygon fill style */ -/* (Currently there is no differentiating between the */ -/* FillStippled and FillOpaqueStippled styles) */ -/*------------------------------------------------------*/ - -void -SetFillStyle(Display *dpy, GC nullptr, int fillstyle) -{ - switch(fillstyle) { - case FillSolid: - glDisable(GL_POLYGON_STIPPLE); - break; - case FillStippled: - glEnable(GL_POLYGON_STIPPLE); - break; - case FillOpaqueStippled: - glEnable(GL_POLYGON_STIPPLE); - break; - } -} - -/*------------------------------------------------------*/ -/* Draw a line without endpoints */ -/*------------------------------------------------------*/ - -void -DrawLineNoEndpoint(Display *dpy, Window win, GC nullptr, - int x1, int y1, int x2, int y2) -{ - int i; - GLdouble x, y; - double theta, xmin, ymin, xmax, ymax, xoff, yoff; - - /* Simple line, if we are within the hardware's width */ - /* limit for lines. */ - - if (cur_linewidth < gl_line_limit) { - glBegin(GL_LINES); - glVertex2i(x1, y1); - glVertex2i(x2, y2); - glEnd(); - return; - } - - /* If we're outside the hardware's limit to draw */ - /* lines, then we revert to a (much slower) */ - /* quadrangle drawing routine. */ - - glBegin(GL_QUADS); - - xmin = (double)x1; - ymin = (double)y1; - xmax = (double)x2; - ymax = (double)y2; - theta = atan2(ymax - ymin, xmax - xmin); - xoff = cur_linewidth * cos(theta - 1.5708) / 2; - yoff = cur_linewidth * sin(theta - 1.5708) / 2; - - x = (GLdouble)(xmax + xoff); - y = (GLdouble)(ymax + yoff); - glVertex2d(x, y); - - x = (GLdouble)(xmax - xoff); - y = (GLdouble)(ymax - yoff); - glVertex2d(x, y); - - x = (GLdouble)(xmin - xoff); - y = (GLdouble)(ymin - yoff); - glVertex2d(x, y); - - x = (GLdouble)(xmin + xoff); - y = (GLdouble)(ymin + yoff); - glVertex2d(x, y); - - glEnd(); -} - -/*------------------------------------------------------*/ -/* Draw line (compatibility function for XDrawLine() */ -/*------------------------------------------------------*/ - -void -DrawLine(Display *dpy, Window win, GC nullptr, - int x1, int y1, int x2, int y2) -{ - /* Lines are capped with round ends. */ - /* (to-do: deal with the square end flag on lines) */ - - DrawLineNoEndpoint(dpy, win, nullptr, x1, y1, x2, y2); - DrawPoint(dpy, win, nullptr, x1, y1); - DrawPoint(dpy, win, nullptr, x2, y2); -} - -/*--------------------------------------------------------------*/ -/* Draw multiple lines (compatibility function for XDrawLines() */ -/* (Slight performance improvement over DrawLine by calling */ -/* point-drawing routine only once in-between segments). */ -/*--------------------------------------------------------------*/ - -void -DrawLines(Display *dpy, Window win, GC nullptr, - XPoint *points, int npoints, int mode) -{ - int i; - - for (i = 0; i < npoints - 1; i++) { - DrawLineNoEndpoint(dpy, win, nullptr, points[i].x, points[i].y, - points[i + 1].x, points[i + 1].y); - DrawPoint(dpy, win, nullptr, points[i].x, points[i].y); - } - DrawPoint(dpy, win, nullptr, points[i].x, points[i].y); -} - -/*------------------------------------------------------*/ -/* Draw point (compatibility function for XDrawPoint() */ -/* To avoid the problem with OpenGL's inability to */ -/* render smooth circles at all zoom levels, we bypass */ -/* the glPoint mechanism and use a tesselated polygon */ -/* instead. */ -/*------------------------------------------------------*/ - -void -DrawPoint(Display *dpy, Window win, GC nullptr, int x, int y) -{ - int i; - double theta, delta, radius; - GLdouble px, py; - - /* If we're below the OpenGL hardware limit on smooth point */ - /* drawing, then use the simple point-rendering routine. */ - - if (cur_linewidth < gl_point_limit) { - glBegin(GL_POINTS); - glVertex2i(x, y); - glEnd(); - return; - } - - /* If we're above the OpenGL hardware limit on point size, */ - /* use a (much slower) 72-point polygon to render each dot. */ - /* This generally works well because at the scale where */ - /* the hardware can't render the point, it is unlikely that */ - /* there will be more than a handful of points visible in */ - /* the window. */ - - radius = (double)(cur_linewidth / 2); - theta = 0; - delta = RADFAC * (360 / RSTEPS); - - glBegin(GL_POLYGON); - for (i = 0; i < RSTEPS; i++) { - px = (GLdouble)(x + radius * cos(theta)); - py = (GLdouble)(y + radius * sin(theta)); - theta += delta; - glVertex2d(px, py); - } - glEnd(); -} - -/*----------------------------------------------------------------------*/ -/* Helper function for GLU polygon tesselation intersections. */ -/* This routine was arbitrarily scrapped together from information in */ -/* the manpage for gluTessCallback(). */ -/*----------------------------------------------------------------------*/ - -void -myCombine(GLdouble coords[3], GLdouble *vertex_data[4], - GLfloat weight[4], GLdouble **outData) -{ - GLdouble *new = (GLdouble *)malloc(2 * sizeof(GLdouble)); - new[0] = coords[0]; - new[1] = coords[1]; - *outData = new; -} - -/*----------------------------------------------------------------------*/ -/* Draw a filled polygon (compatibility function for XFillPolygon() */ -/*----------------------------------------------------------------------*/ - -void -FillPolygon(Display *dpy, Window win, GC nullptr, XPoint *points, - int npoints, int shape, int mode) -{ - int i, j; - static GLUtesselator *tess = NULL; - static GLdouble *v; - - if (tess == NULL) { - tess = gluNewTess(); - gluTessCallback(tess, GLU_TESS_BEGIN, (_GLUfuncptr)glBegin); - gluTessCallback(tess, GLU_TESS_VERTEX, (_GLUfuncptr)glVertex2dv); - gluTessCallback(tess, GLU_TESS_END, (_GLUfuncptr)glEnd); - gluTessCallback(tess, GLU_TESS_COMBINE, (_GLUfuncptr)myCombine); - v = (GLdouble *)malloc(2 * npoints * sizeof(GLdouble)); - } - else { - v = (GLdouble *)realloc(v, 2 * npoints * sizeof(GLdouble)); - } - - gluTessBeginPolygon(tess, NULL); - gluTessBeginContour(tess); - j = 0; - for (i = 0; i < npoints; i++, j += 2) { - v[j] = (GLdouble)points[i].x; - v[j + 1] = (GLdouble)points[i].y; - gluTessVertex(tess, &v[j], &v[j]); - } - gluTessEndContour(tess); - gluTessEndPolygon(tess); -} - -/*------------------------------------------------------*/ -/* Render a background image */ -/*------------------------------------------------------*/ - -void -backgroundbbox(int b) -{ - /* null proc for now . . . */ -} - -void -readbackground(FILE *f) -{ - /* null proc for now . . . */ -} - -void -savebackground(FILE *f, char *c) -{ - /* null proc for now . . . */ -} - -void -loadbackground() -{ - /* null proc for now . . . */ -} - -int -renderbackground() -{ - /* null proc for now . . . */ -} - -int -copybackground() -{ - /* null proc for now . . . */ -} - -int -reset_gs() -{ - /* This is a null proc because OpenGL doesn't use */ - /* ghostscript, and it's easier to make a null proc */ - /* than to #ifdef the calls. */ - -} - -int -exit_gs() -{ - /* ditto */ -} - -/*-------------------------------------------------------------------------*/ - -#endif /* OPENGL */ diff --git a/parameter.c b/parameter.c index eb277cb..e26bd95 100644 --- a/parameter.c +++ b/parameter.c @@ -62,7 +62,7 @@ u_char param_select[] = { POLYGON | SPLINE | LABEL | OBJINST | ARC, /* P_POSITION_X */ POLYGON | SPLINE | LABEL | OBJINST | ARC, /* P_POSITION_Y */ POLYGON | SPLINE | ARC | PATH, /* P_STYLE */ - LABEL, /* P_JUSTIFY */ + LABEL, /* P_ANCHOR */ ARC, /* P_ANGLE1 */ ARC, /* P_ANGLE2 */ ARC, /* P_RADIUS */ @@ -90,7 +90,7 @@ Widget *param_buttons[] = { &ParametersPositionButton, /* P_POSITION_X */ &ParametersPositionButton, /* P_POSITION_Y */ &ParametersStyleButton, /* P_STYLE */ - &ParametersJustificationButton, /* P_JUSTIFY */ + &ParametersAnchoringButton, /* P_ANCHOR */ &ParametersStartAngleButton, /* P_ANGLE1 */ &ParametersEndAngleButton, /* P_ANGLE2 */ &ParametersRadiusButton, /* P_RADIUS */ @@ -820,11 +820,11 @@ int epsubstitute(genericptr thiselem, objectptr thisobj, objinstptr pinst, break; } break; - case P_JUSTIFY: + case P_ANCHOR: retval = max(retval, 1); switch(thiselem->type) { case LABEL: - TOLABEL(&thiselem)->justify = ival; + TOLABEL(&thiselem)->anchor = ival; break; } break; @@ -869,10 +869,10 @@ int epsubstitute(genericptr thiselem, objectptr thisobj, objinstptr pinst, retval = max(retval, 1); switch(thiselem->type) { case LABEL: - TOLABEL(&thiselem)->rotation = ival; + TOLABEL(&thiselem)->rotation = fval; break; case OBJINST: - TOOBJINST(&thiselem)->rotation = ival; + TOOBJINST(&thiselem)->rotation = fval; break; } break; @@ -1004,7 +1004,7 @@ int psubstitute(objinstptr thisinst) Boolean has_param(genericptr celem) { - if (IS_LABEL(celem) == LABEL) { + if (IS_LABEL(celem)) { stringpart *cstr; labelptr clab = (labelptr)celem; for (cstr = clab->string; cstr != NULL; cstr = cstr->nextpart) @@ -1151,10 +1151,10 @@ void pwriteback(objinstptr thisinst) break; } break; - case P_JUSTIFY: + case P_ANCHOR: switch(thiselem->type) { case LABEL: - wtemp.ival = TOLABEL(eptr)->justify; + wtemp.ival = TOLABEL(eptr)->anchor; break; } break; @@ -1189,10 +1189,10 @@ void pwriteback(objinstptr thisinst) case P_ROTATION: switch(thiselem->type) { case OBJINST: - wtemp.ival = TOOBJINST(eptr)->rotation; + wtemp.fval = TOOBJINST(eptr)->rotation; break; case LABEL: - wtemp.ival = TOLABEL(eptr)->rotation; + wtemp.fval = TOLABEL(eptr)->rotation; break; } break; @@ -1750,11 +1750,12 @@ void makenumericalp(genericptr *gelem, u_int mode, char *key, short cycle) case P_POSITION_Y: newops->parameter.ivalue = (int)TOLABEL(gelem)->position.y; break; - case P_JUSTIFY: - newops->parameter.ivalue = (int)TOLABEL(gelem)->justify; + case P_ANCHOR: + newops->parameter.ivalue = (int)TOLABEL(gelem)->anchor; break; case P_ROTATION: - newops->parameter.ivalue = (int)TOLABEL(gelem)->rotation; + newops->type = XC_FLOAT; + newops->parameter.fvalue = TOLABEL(gelem)->rotation; break; case P_SCALE: newops->type = XC_FLOAT; @@ -1802,7 +1803,8 @@ void makenumericalp(genericptr *gelem, u_int mode, char *key, short cycle) newops->parameter.ivalue = (int)TOOBJINST(gelem)->position.y; break; case P_ROTATION: - newops->parameter.ivalue = (int)TOOBJINST(gelem)->rotation; + newops->type = XC_FLOAT; + newops->parameter.fvalue = TOOBJINST(gelem)->rotation; break; case P_SCALE: newops->type = XC_FLOAT; @@ -2319,7 +2321,7 @@ void free_object_param(objectptr thisobj, oparamptr thisparam) for (strptr = plab->string; strptr != NULL; strptr = strptr->nextpart) { if (strptr->type == PARAM_START) { if (!strcmp(strptr->data.string, key)) { - unmakeparam(plab, strptr); + unmakeparam(plab, NULL, strptr); pending = TRUE; break; } @@ -2365,9 +2367,10 @@ stringpart *searchparam(stringpart *tstr) /* Remove parameterization from a label string or substring. */ /*--------------------------------------------------------------*/ -void unmakeparam(labelptr thislabel, stringpart *thispart) +void unmakeparam(labelptr thislabel, objinstptr thisinst, stringpart *thispart) { oparamptr ops; + oparamptr testop; stringpart *strptr, *lastpart, *endpart, *newstr, *subs; char *key; @@ -2386,34 +2389,52 @@ void unmakeparam(labelptr thislabel, stringpart *thispart) /* parameter. The parameter itself will be deleted by a different */ /* method, using free_object_param(). */ - ops = match_param(topobject, key); - subs = ops->parameter.string; + ops = (thisinst != NULL) ? match_instance_param(thisinst, key) : + match_param(topobject, key); - /* Copy the default parameter into the place we are unparameterizing */ + if (ops == NULL) ops = match_param(topobject, key); - newstr = NULL; - newstr = stringcopy(subs); + if (ops == NULL) return; /* Report error? */ - /* Delete the "PARAM_END" off of the copied string and link it into */ - /* the existing string. */ - /* (NOTE: If parameter is an empty string, there may be nothing */ - /* before PARAM_END. . .) */ + /* Copy the default parameter into the place we are unparameterizing */ + /* Promote first to a string type if necessary */ + + if (ops->type == XC_STRING) { + subs = ops->parameter.string; + newstr = NULL; + newstr = stringcopy(subs); + + /* Delete the "PARAM_END" off of the copied string and link it */ + /* into the existing string. */ + /* (NOTE: If parameter is an empty string, there may be nothing */ + /* before PARAM_END. . .) */ + + if (newstr->type != PARAM_END) { + for (endpart = newstr; endpart->nextpart->type != PARAM_END; + endpart = endpart->nextpart); + free(endpart->nextpart); + endpart->nextpart = thispart->nextpart; + } + else { + endpart = newstr; + newstr = newstr->nextpart; + free(endpart); + endpart = NULL; + } - if (newstr->type != PARAM_END) { - for (endpart = newstr; endpart->nextpart->type != PARAM_END; - endpart = endpart->nextpart); - free(endpart->nextpart); - endpart->nextpart = thispart->nextpart; + /* Remove dangling link from instance parameter */ + /* (If this was a global parameter, it will have no effect) */ + for (strptr = ops->parameter.string; strptr->type != PARAM_END; + strptr = strptr->nextpart); + strptr->nextpart = NULL; } else { - endpart = newstr; - newstr = newstr->nextpart; - free(endpart); - endpart = NULL; + /* This should not happen */ + Fprintf(stderr, "Error: String contains non-string parameter!\n"); + redrawtext(thislabel); + return; } - /* Find the stringpart before the parameter call (if any) */ - lastpart = NULL; for (strptr = thislabel->string; strptr != NULL && strptr != thispart; strptr = strptr->nextpart) { @@ -2456,7 +2477,36 @@ void unparameterize(int mode) else ptype = ALL_TYPES; - if ((areawin->selects == 1) && (mode == P_SUBSTRING) && areawin->textend > 0 + // NOTE: Need a different method for interactive edit; remove only the + // parameter under the cursor. + + if (eventmode == ETEXT_MODE) { + /* ETEXT_MODE implies there is only one selected label */ + settext = SELTOLABEL(areawin->selectlist); + strptr = findstringpart(areawin->textpos, &locpos, settext->string, + areawin->topinstance); + + /* Assume the cursor is inside a parameter and find the end */ + while (strptr != NULL && strptr->type != PARAM_START && strptr->type != PARAM_END) + strptr = strptr->nextpart; + + if (strptr && (strptr->type == PARAM_END)) { + strptr = strptr->nextpart; + tmpptr = settext->string; + while (tmpptr != NULL) { + if (tmpptr->type == PARAM_START) { + if (tmpptr->nextpart == strptr) { + /* tmpptr now points to the parameter to be removed */ + unmakeparam(settext, areawin->topinstance, tmpptr); + break; + } + } + tmpptr = tmpptr->nextpart; + } + } + lastptr = NULL; + } + else if ((areawin->selects == 1) && (mode == P_SUBSTRING) && areawin->textend > 0 && areawin->textend < areawin->textpos) { if (SELECTTYPE(areawin->selectlist) != LABEL) return; /* Not a label */ settext = SELTOLABEL(areawin->selectlist); @@ -2477,17 +2527,30 @@ void unparameterize(int mode) /* Finish search, unlinking any parameter we might be inside */ for (; tmpptr != NULL; tmpptr = nextstringpart(tmpptr, areawin->topinstance)); - if (lastptr != NULL) unmakeparam(settext, lastptr); + if (lastptr != NULL) unmakeparam(settext, areawin->topinstance, lastptr); } else { for (fselect = areawin->selectlist; fselect < areawin->selectlist + areawin->selects; fselect++) { if ((mode == P_SUBSTRING) && SELECTTYPE(fselect) == LABEL) { + u_char found; + settext = SELTOLABEL(fselect); - strptr = settext->string; - while (strptr != NULL && strptr->type != PARAM_START) - strptr = strptr->nextpart; - if (strptr != NULL) unmakeparam(settext, strptr); + + // Remove all parameters from the string. + found = 1; + while (found == (u_char)1) { + found = (u_char)0; + strptr = settext->string; + while (strptr != NULL) { + if (strptr->type == PARAM_START) { + unmakeparam(settext, areawin->topinstance, strptr); + found = (u_char)1; + break; + } + strptr = strptr->nextpart; + } + } } else if (mode == P_POSITION) { removenumericalp(topobject->plist + (*fselect), P_POSITION_X); diff --git a/prototypes.h b/prototypes.h index bb5fb38..049b949 100644 --- a/prototypes.h +++ b/prototypes.h @@ -48,26 +48,10 @@ extern char *translateencoding(int); extern char *evaluate_expr(objectptr, oparamptr, objinstptr); -/* from opengl.c: compatibility functions for OpenGL/X11 */ - -#ifdef OPENGL -extern void SetForeground(Display *, GC, int); -extern void SetBackground(Display *, GC, int); -extern void SetFunction(Display *, GC, int); -extern void SetLineAttributes(Display *, GC, float, int, int, int); -extern void SetDashes(Display *, GC, int, char dashlist[], int); -extern void SetStipple(Display *, GC, int); -extern void SetFillStyle(Display *, GC, int); -extern void DrawLine(Display *, Window, GC, int, int, int, int); -extern void DrawLines(Display *, Window, GC, XPoint *, int, int); -extern void DrawPoint(Display *, Window, GC, int, int); -extern void FillPolygon(Display *, Window, GC, XPoint *, int, int, int); -#endif - /* from elements.c: */ /* element constructor functions */ -extern labelptr new_label(objinstptr, stringpart *, int, int, int); +extern labelptr new_label(objinstptr, stringpart *, int, int, int, u_char); extern labelptr new_simple_label(objinstptr, char *, int, int, int); extern labelptr new_temporary_label(objectptr, char *, int, int); extern polyptr new_polygon(objinstptr, pointlist *, int); @@ -96,7 +80,7 @@ extern void textbutton(u_char, int, int); extern void charreport(labelptr); extern Boolean labeltext(int, char *); extern void textreturn(void); -extern void rejustify(short); +extern void reanchor(short); extern void findconstrained(polyptr); extern void reversepoints(XPoint *, short); extern void reversefpoints(XfPoint *, short); @@ -121,6 +105,16 @@ extern void startwire(XPoint *); extern void setendpoint(short *, short, XPoint **, XPoint *); extern void wire_op(int, int ,int); +void arc_mode_draw(xcDrawType type, arc *newarc); +void spline_mode_draw(xcDrawType type, spline *newspline); +void poly_mode_draw(xcDrawType type, polygon *newpoly); +void path_mode_draw(xcDrawType type, path *newpoly); +void text_mode_draw(xcDrawType type, label *newlabel); +void selarea_mode_draw(xcDrawType type, void *unused); +void rescale_mode_draw(xcDrawType type, void *unused); +void move_mode_draw(xcDrawType type, void *unused); +void normal_mode_draw(xcDrawType type, void *unused); + /* from events.c: */ extern Boolean recursefind(objectptr, objectptr); @@ -171,14 +165,14 @@ extern int ipow10(int); extern int calcgcf(int, int); extern void fraccalc(float, char *); extern void printpos(short, short); -extern void findwirex(XPoint *, XPoint *, XPoint *, XPoint *, int *); -extern void findattach(XPoint *, int *, XPoint *); +extern void findwirex(XPoint *, XPoint *, XPoint *, XPoint *, float *); +extern void findattach(XPoint *, float *, XPoint *); extern XPoint *pathclosepoint(pathptr, XPoint *); extern void placeselects(short, short, XPoint *); extern void drag(int, int); extern void xlib_drag(xcWidget, caddr_t, XEvent *); -extern void elemrotate(genericptr *, short, XPoint *); -extern void elementrotate(short, XPoint *); +extern void elemrotate(genericptr *, float, XPoint *); +extern void elementrotate(float, XPoint *); extern void edit(int, int); extern void pathedit(genericptr); extern void xc_lower(); @@ -233,6 +227,8 @@ extern void finish_op(int, int, int); extern void path_op(genericptr, int, int, int); extern void inst_op(genericptr, int, int, int); extern void resizearea(xcWidget, caddr_t, caddr_t); +void draw_grids(void); +void draw_fixed(void); extern void drawarea(xcWidget, caddr_t, caddr_t); extern void standard_element_delete(short); extern void delete_for_xfer(short, short *, int); @@ -293,6 +289,7 @@ extern Boolean loadlibrary(short); extern void startloadfile(int); extern void normalloadfile(void); extern void importfile(void); +extern void importgraphic(void); extern Boolean loadfile(short, int); extern void readlabel(objectptr, char *, stringpart **); extern void readparams(objectptr, objinstptr, objectptr, char *); @@ -371,7 +368,7 @@ extern void initsplines(void); extern void computecoeffs(splineptr, float *, float *, float *, float *, float *, float *); extern void calcspline(splineptr); -extern void findsplinepos(splineptr, float, XPoint *, int *); +extern void findsplinepos(splineptr, float, XPoint *, float *); extern void ffindsplinepos(splineptr, float, XfPoint *); extern float findsplinemin(splineptr, XPoint *); extern short closepoint(polyptr, XPoint *); @@ -384,7 +381,7 @@ extern void user_to_window(XPoint, XPoint *); extern float UTopScale(void); extern float UTopTransScale(float); extern float UTopDrawingScale(void); -extern int UTopRotation(void); +extern float UTopRotation(void); extern void UTopOffset(int *, int *); extern void UTopDrawingOffset(int *, int *); @@ -396,20 +393,20 @@ extern void UResetCTM(Matrix *); extern void InvertCTM(Matrix *); extern void UCopyCTM(Matrix *, Matrix *); extern void UMakeWCTM(Matrix *); -extern void UMultCTM(Matrix *, XPoint, float, short); +extern void UMultCTM(Matrix *, XPoint, float, float); extern void USlantCTM(Matrix *, float); extern void UPreScaleCTM(Matrix *); extern short flipadjust(short); -extern void UPreMultCTM(Matrix *, XPoint, float, short); +extern void UPreMultCTM(Matrix *, XPoint, float, float); extern void UPreMultCTMbyMat(Matrix *, Matrix *); extern void UTransformbyCTM(Matrix *, XPoint *, XPoint *, short); extern void UfTransformbyCTM(Matrix *, XfPoint *, XPoint *, short); extern void UPopCTM(void); extern void UPushCTM(void); extern void UTransformPoints(XPoint *, XPoint *, short, XPoint, float, - short); + float); extern void InvTransformPoints(XPoint *, XPoint *, short, XPoint, float, - short); + float); extern void manhattanize(XPoint *, polyptr, short, Boolean); extern void bboxcalc(short, short *, short *); extern void calcextents(genericptr *, short *, short *, short *, short *); @@ -443,7 +440,8 @@ extern void UDrawTextLine(labelptr, short); extern void UDrawTLine(labelptr); extern void UDrawXLine(XPoint, XPoint); extern void UDrawBox(XPoint, XPoint); -extern float UDrawRescaleBox(XPoint *); +extern float UGetRescaleBox(XPoint *corner, XPoint *newpoints); +extern void UDrawRescaleBox(XPoint *); extern void UDrawBBox(void); extern void strokepath(XPoint *, short, short, float); extern void makesplinepath(splineptr, XPoint *); @@ -559,11 +557,11 @@ extern void setfontmarks(short, short); extern void startparam(xcWidget, pointertype, caddr_t); extern void startunparam(xcWidget, pointertype, caddr_t); extern void setdefaultfontmarks(void); -extern void setjustbit(xcWidget, pointertype, caddr_t); -extern void setpinjustbit(xcWidget, pointertype, caddr_t); -extern void setjust(xcWidget, pointertype, labelptr, short); -extern void setvjust(xcWidget, pointertype, caddr_t); -extern void sethjust(xcWidget, pointertype, caddr_t); +extern void setanchorbit(xcWidget, pointertype, caddr_t); +extern void setpinanchorbit(xcWidget, pointertype, caddr_t); +extern void setanchor(xcWidget, pointertype, labelptr, short); +extern void setvanchor(xcWidget, pointertype, caddr_t); +extern void sethanchor(xcWidget, pointertype, caddr_t); extern void boxedit(xcWidget, pointertype, caddr_t); extern void locloadfont(xcWidget, char *); extern short findbestfont(short, short, short, short); @@ -584,7 +582,7 @@ extern void setfloat(xcWidget, float *); extern void autoset(xcWidget, xcWidgetList, caddr_t); extern void autostop(xcWidget, caddr_t, caddr_t); extern void togglegridstyles(xcWidget); -extern void togglejustifs(xcWidget); +extern void toggleanchors(xcWidget); extern void togglefontstyles(xcWidget); extern void toggleencodings(xcWidget); extern void getkern(xcWidget, caddr_t, caddr_t); @@ -730,6 +728,8 @@ extern void clearlocalpins(objectptr); extern void append_included(char *); extern Boolean check_included(char *); extern void free_included(void); +extern void genprefixlist(objectptr, slistptr *); + /* from ngspice.c: */ extern int exit_spice(void); @@ -762,7 +762,7 @@ extern void insertparam(void); extern void makeparam(labelptr, char *); extern void searchinst(objectptr, objectptr, char *); extern stringpart *searchparam(stringpart *); -extern void unmakeparam(labelptr, stringpart *); +extern void unmakeparam(labelptr, objinstptr, stringpart *); extern void removenumericalp(genericptr *, u_int); extern void unparameterize(int); extern void parameterize(int, char *, short); @@ -802,9 +802,14 @@ extern xcWidget *pytoolbuttons(int *); /* from rcfile.c: */ extern short execcommand(short, char *); +#ifdef TCL_WRAPPER +extern int defaultscript(void); +extern int loadrcfile(void); +#else extern void defaultscript(void); -extern void execscript(void); extern void loadrcfile(void); +#endif +extern void execscript(void); #ifndef HAVE_PYTHON extern short readcommand(short, FILE *); #endif @@ -819,6 +824,13 @@ extern graphicptr gradient_field(objinstptr, int, int, int, int); extern void invalidate_graphics(objectptr); extern void freegraphic(graphicptr); extern short *collect_graphics(short *); +xcImage *xcImageCreate(int width, int height); +void xcImageDestroy(xcImage *img); +int xcImageGetWidth(xcImage *img); +int xcImageGetHeight(xcImage *img); +void xcImagePutPixel(xcImage *img, int x, int y, u_char r, u_char g, u_char b); +void xcImageGetPixel(xcImage *img, int x, int y, u_char *r, u_char *g, + u_char *b); /* from flate.c */ @@ -849,6 +861,8 @@ extern int renderbackground(void); extern int copybackground(void); extern int exit_gs(void); extern int reset_gs(void); +void write_scale_position_and_run_gs(float norm, float xpos, float ypos, + const char *bgfile); #ifndef TCL_WRAPPER extern Boolean render_client(XEvent *); @@ -963,11 +977,12 @@ extern Boolean pin_is_bus(labelptr, objinstptr); extern int find_cardinal(int, labelptr, objinstptr); extern int find_ordinal(int, labelptr, objinstptr); -extern short UDrawChar(u_char, short, short, int, int, float); +void UDrawCharString(u_char *text, int start, int end, XfPoint *offset, + short styles, short ffont, int groupheight, int passcolor, float tmpscale); extern void UDrawString(labelptr, int, objinstptr); extern void UDrawStringNoX(labelptr, int, objinstptr); extern void CheckMarginStop(labelptr, objinstptr, Boolean); -extern TextExtents ULength(labelptr, objinstptr, short, XPoint *); +extern TextExtents ULength(labelptr, objinstptr, TextLinesInfo *); extern void undrawtext(labelptr); extern void redrawtext(labelptr); extern void composefontlib(short); @@ -992,6 +1007,8 @@ extern int rgb_alloccolor(int, int, int); extern void addtocolorlist(xcWidget, int); extern int addnewcolorentry(int); extern int xc_getlayoutcolor(int); +void xc_get_color_rgb(unsigned long cidx, unsigned short *red, + unsigned short *green, unsigned short *blue); extern int query_named_color(char *); extern caddr_t CvtStringToPixel(XrmValuePtr, int *, XrmValuePtr, XrmValuePtr); extern void outputpopup(xcWidget, caddr_t, caddr_t); @@ -1003,7 +1020,7 @@ extern void dointr(int); extern void DoNothing(xcWidget, caddr_t, caddr_t); extern u_short countchanges(char **); extern u_short getchanges(objectptr); -extern void quitcheck(xcWidget, caddr_t, caddr_t); +extern int quitcheck(xcWidget, caddr_t, caddr_t); extern void quit(xcWidget, caddr_t); extern void resizetoolbar(void); extern void writescalevalues(char *, char *, char *); @@ -1017,3 +1034,9 @@ extern void delwin(xcWidget, popupstruct *, XClientMessageEvent *); extern void makecursors(void); + +/* from cairo.c */ + +void xc_cairo_set_matrix(const Matrix *xcm); +void xc_cairo_set_color(int coloridx); +void xc_cairo_set_fontinfo(size_t fontidx); diff --git a/python.c b/python.c index bb44246..e353552 100644 --- a/python.c +++ b/python.c @@ -87,7 +87,6 @@ extern short beeper; extern Widget menuwidgets[]; extern Display *dpy; extern keybinding *keylist; -extern int *appcolors; extern int number_colors; extern colorindex *colorlist; extern ApplicationData appdata; @@ -1089,11 +1088,11 @@ static PyObject *xc_getattr(PyObject *self, PyObject *args) PyDict_SetItem(rdict, PyString_FromString("position"), make_pair(&(TOLABEL(gelem)->position))); PyDict_SetItem(rdict, PyString_FromString("rotation"), - PyInt_FromLong((long)TOLABEL(gelem)->rotation)); + PyFloat_FromDouble((double)TOLABEL(gelem)->rotation)); PyDict_SetItem(rdict, PyString_FromString("scale"), PyFloat_FromDouble((double)TOLABEL(gelem)->scale)); - PyDict_SetItem(rdict, PyString_FromString("justify"), - PyInt_FromLong((long)TOLABEL(gelem)->justify)); + PyDict_SetItem(rdict, PyString_FromString("anchor"), + PyInt_FromLong((long)TOLABEL(gelem)->anchor)); PyDict_SetItem(rdict, PyString_FromString("pin"), PyInt_FromLong((long)TOLABEL(gelem)->pin)); lstr = PyGetStringParts(TOLABEL(gelem)->string); @@ -1154,7 +1153,7 @@ static PyObject *xc_getattr(PyObject *self, PyObject *args) PyDict_SetItem(rdict, PyString_FromString("position"), make_pair(&(TOOBJINST(gelem)->position))); PyDict_SetItem(rdict, PyString_FromString("rotation"), - PyInt_FromLong((long)TOOBJINST(gelem)->rotation)); + PyFloat_FromDouble((double)TOOBJINST(gelem)->rotation)); PyDict_SetItem(rdict, PyString_FromString("scale"), PyFloat_FromDouble((double)TOOBJINST(gelem)->scale)); PyDict_SetItem(rdict, PyString_FromString("name"), @@ -1328,8 +1327,8 @@ static PyObject *xc_setattr(PyObject *self, PyObject *args) switch(ELEMENTTYPE(*gelem)) { case LABEL: - if ((dval = PyDict_GetItemString(attrdict, "justify")) != NULL) { - TOLABEL(gelem)->justify = PyInt_AsLong(dval); + if ((dval = PyDict_GetItemString(attrdict, "anchor")) != NULL) { + TOLABEL(gelem)->anchor = PyInt_AsLong(dval); } if ((dval = PyDict_GetItemString(attrdict, "string")) != NULL) { freelabel(TOLABEL(gelem)->string); diff --git a/rcfile.c b/rcfile.c index e97c2dd..e6c5393 100644 --- a/rcfile.c +++ b/rcfile.c @@ -52,7 +52,6 @@ extern short fontcount; extern XCWindowData *areawin; extern Globaldata xobjs; extern short beeper; -extern int *appcolors; extern Widget menuwidgets[]; extern Display *dpy; diff --git a/render.c b/render.c index faa8d87..77ff166 100644 --- a/render.c +++ b/render.c @@ -4,11 +4,8 @@ /* These routines work only if ghostscript is on the system. */ /*----------------------------------------------------------------------*/ -/* We use OpenGL functions to read and scale images if OpenGL is enabled */ -#ifndef OPENGL - -/* #undef GS_DEBUG */ -#define GS_DEBUG +#undef GS_DEBUG +/* #define GS_DEBUG */ #include #include @@ -59,30 +56,28 @@ extern char _STR2[250], _STR[150]; extern Globaldata xobjs; extern XCWindowData *areawin; extern Display *dpy; -extern int *appcolors; extern int number_colors; extern colorindex *colorlist; extern Cursor appcursors[NUM_CURSORS]; +#ifdef HAVE_CAIRO +cairo_surface_t *bbuf = NULL; +#else /* HAVE_CAIRO */ Pixmap bbuf = (Pixmap)NULL; /* background buffer */ -#ifdef DOUBLEBUFFER extern Pixmap dbuf; -#endif +#endif /* HAVE_CAIRO */ #ifndef HAVE_VFORK #define vfork fork #endif -int gs_state; /* Track state of the renderer */ - -#define GS_INIT 0 /* Initial state; gs is idle. */ -#define GS_PENDING 1 /* Drawing in progress; gs is busy. */ -#define GS_READY 2 /* Drawing done; gs is waiting for "next". */ +gs_state_t gs_state; /* Track state of the renderer */ /*------------------------------------------------------*/ /* Global variable definitions */ /*------------------------------------------------------*/ +#ifndef HAVE_CAIRO Atom gv, gvc, gvpage, gvnext, gvdone; #ifndef _MSC_VER pid_t gsproc = -1; /* ghostscript process */ @@ -93,6 +88,7 @@ int fgs[2]; /* stdin pipe pair for ghostscript */ Window mwin = 0; /* "false" window hack to get gs */ /* process to capture ClientMessage */ /* events. */ +#endif /* HAVE_CAIRO */ /*--------------------------------------------------------------*/ /* Preliminary in allowing generic PostScript backgrounds */ @@ -103,6 +99,7 @@ Window mwin = 0; /* "false" window hack to get gs */ void ghostinit_local() { +#ifndef HAVE_CAIRO sprintf(_STR, "%ld %d %d %d %d %d %g %g %d %d %d %d", 0L, 0, 0, 0, areawin->width * 75 / 72, @@ -114,6 +111,7 @@ void ghostinit_local() XChangeProperty(dpy, areawin->window, gvc, XA_STRING, 8, PropModeReplace, _STR, strlen(_STR)); XSync(dpy, False); +#endif /* HAVE_CAIRO */ gs_state = GS_INIT; } @@ -129,6 +127,7 @@ void ghostinit_local() Boolean render_client(XEvent *eventPtr) { +#ifndef HAVE_CAIRO if (eventPtr->xclient.message_type == gvpage) { #ifdef GS_DEBUG fprintf(stdout, "Xcircuit: Received PAGE message from ghostscript\n"); @@ -160,6 +159,7 @@ Boolean render_client(XEvent *eventPtr) } return False; } +#endif /* HAVE_CAIRO */ return True; } @@ -169,11 +169,13 @@ Boolean render_client(XEvent *eventPtr) #ifdef TCL_WRAPPER +#ifndef HAVE_CAIRO void handle_client(ClientData clientData, XEvent *eventPtr) { if (render_client(eventPtr) == False) fprintf(stderr, "Xcircuit: Received unknown client message\n"); } +#endif /* HAVE_CAIRO */ #endif @@ -183,6 +185,7 @@ void handle_client(ClientData clientData, XEvent *eventPtr) void ghostinit() { +#ifndef HAVE_CAIRO gv = XInternAtom(dpy, "GHOSTVIEW", False); gvc = XInternAtom(dpy, "GHOSTVIEW_COLORS", False); gvpage = XInternAtom(dpy, "PAGE", False); @@ -194,12 +197,14 @@ void ghostinit() #ifdef TCL_WRAPPER Tk_CreateClientMessageHandler((Tk_ClientMessageProc *)handle_client); #endif +#endif /* HAVE_CAIRO */ } /*------------------------------------------------------*/ /* Send a ClientMessage event */ /*------------------------------------------------------*/ +#ifndef HAVE_CAIRO void send_client(Atom msg) { XEvent event; @@ -217,6 +222,7 @@ void send_client(Atom msg) XSendEvent(dpy, mwin, False, 0, &event); XFlush(dpy); } +#endif /* HAVE_CAIRO */ /*------------------------------------------------------*/ /* Ask ghostscript to produce the next page. */ @@ -224,6 +230,7 @@ void send_client(Atom msg) void ask_for_next() { +#ifndef HAVE_CAIRO if (gs_state != GS_READY) { /* If we're in the middle of rendering something, halt */ /* immediately and start over. */ @@ -237,6 +244,7 @@ void ask_for_next() #ifdef GS_DEBUG fprintf(stdout, "Xcircuit: Sent NEXT message to ghostscript\n"); #endif +#endif /* HAVE_CAIRO */ } /*--------------------------------------------------------*/ @@ -245,6 +253,7 @@ void ask_for_next() /* to xcircuit's stderr) */ /*--------------------------------------------------------*/ +#ifndef HAVE_CAIRO void start_gs() { int std_out[2], std_err[2], ret; @@ -258,25 +267,12 @@ void start_gs() #ifdef TCL_WRAPPER if (bbuf != (Pixmap)NULL) Tk_FreePixmap(dpy, bbuf); -#ifdef DOUBLEBUFFER bbuf = Tk_GetPixmap(dpy, dbuf, areawin->width, areawin->height, Tk_Depth(areawin->area)); -#else - bbuf = Tk_GetPixmap(dpy, (Drawable)areawin->window, - areawin->width, areawin->height, - Tk_Depth(areawin->area)); -#endif - #else /* !TCL_WRAPPER */ if (bbuf != (Pixmap)NULL) XFreePixmap(dpy, bbuf); -#ifdef DOUBLEBUFFER bbuf = XCreatePixmap(dpy, dbuf, areawin->width, areawin->height, DefaultDepthOfScreen(xcScreen(areawin->area))); -#else - bbuf = XCreatePixmap(dpy, areawin->window, - areawin->width, areawin->height, - DefaultDepthOfScreen(xcScreen(areawin->area))); -#endif /* DOUBLEBUFFER */ #endif /* TCL_WRAPPER */ XSync(dpy, False); @@ -292,7 +288,7 @@ void start_gs() #ifndef XC_WIN32 ret = pipe(std_err); #else - ret = _pipe(srd_err, pipe_size, pipe_mode); + ret = _pipe(std_err, pipe_size, pipe_mode); #endif /* XC_WIN32 */ #endif @@ -310,22 +306,12 @@ void start_gs() #ifdef HAVE_PUTENV sprintf(env_str1, "DISPLAY=%s", XDisplayString(dpy)); putenv(env_str1); -#ifdef DOUBLEBUFFER sprintf(env_str2, "GHOSTVIEW=%ld %ld", (long)areawin->window, (long)bbuf); putenv(env_str2); -#else - sprintf(env_str2, "GHOSTVIEW=%ld", (long)areawin->window); - putenv(env_str2); -#endif #else setenv("DISPLAY", XDisplayString(dpy), True); -#ifdef DOUBLEBUFFER sprintf(_STR, "%ld %ld", (long)areastruct.areawin, (long)bbuf); setenv("GHOSTVIEW", _STR, True); -#else - sprintf(_STR, "%ld", (long)areastruct.areawin); - setenv("GHOSTVIEW", _STR, True); -#endif #endif SetHandleInformation((HANDLE)_get_osfhandle(fgs[1]), HANDLE_FLAG_INHERIT, 0); @@ -375,22 +361,12 @@ void start_gs() #ifdef HAVE_PUTENV sprintf(env_str1, "DISPLAY=%s", XDisplayString(dpy)); putenv(env_str1); -#ifdef DOUBLEBUFFER sprintf(env_str2, "GHOSTVIEW=%ld %ld", (long)areawin->window, (long)bbuf); putenv(env_str2); -#else - sprintf(env_str2, "GHOSTVIEW=%ld", (long)areawin->window); - putenv(env_str2); -#endif #else setenv("DISPLAY", XDisplayString(dpy), True); -#ifdef DOUBLEBUFFER sprintf(_STR, "%ld %ld", (long)areawin->window, (long)bbuf); setenv("GHOSTVIEW", _STR, True); -#else - sprintf(_STR, "%ld", (long)areawin->window); - setenv("GHOSTVIEW", _STR, True); -#endif #endif Flush(stderr); execlp(GS_EXEC, "gs", "-dNOPAUSE", "-", (char *)NULL); @@ -405,6 +381,7 @@ void start_gs() } #endif } +#endif /* HAVE_CAIRO */ /*--------------------------------------------------------*/ /* Parse the background file for Bounding Box information */ @@ -578,10 +555,12 @@ void savebackground(FILE *fo, char *psfilename) void register_bg(char *gsfile) { +#ifndef HAVE_CAIRO if (gsproc < 0) start_gs(); else reset_gs(); +#endif /* !HAVE_CAIRO */ xobjs.pagelist[areawin->page]->background.name = (char *) malloc(strlen(gsfile) + 1); @@ -608,6 +587,7 @@ void loadbackground() /* Send text to the ghostscript renderer */ /*------------------------------------------------------*/ +#ifndef HAVE_CAIRO void send_to_gs(char *text) { #ifndef XC_WIN32 @@ -620,6 +600,33 @@ void send_to_gs(char *text) fprintf(stdout, "writing: %s", text); #endif } +#endif /* !HAVE_CAIRO */ + +/*------------------------------------------------------*/ +/* write scale and position to ghostscript */ +/* and tell ghostscript to run the requested file */ +/*------------------------------------------------------*/ + +#ifndef HAVE_CAIRO +void write_scale_position_and_run_gs(float norm, float xpos, float ypos, + const char *bgfile) +{ + send_to_gs("/GSobj save def\n"); + send_to_gs("/setpagedevice {pop} def\n"); + send_to_gs("gsave\n"); + sprintf(_STR, "%3.2f %3.2f translate\n", xpos, ypos); + send_to_gs(_STR); + sprintf(_STR, "%3.2f %3.2f scale\n", norm, norm); + send_to_gs(_STR); + sprintf(_STR, "(%s) run\n", bgfile); + send_to_gs(_STR); + send_to_gs("GSobj restore\n"); + send_to_gs("grestore\n"); + + Wprintf("Rendering background image."); + XDefineCursor(dpy, areawin->window, WAITFOR); +} +#endif /* !HAVE_CAIRO */ /*------------------------------------------------------*/ /* Call ghostscript to render the background into the */ @@ -632,7 +639,9 @@ int renderbackground() float psnorm, psxpos, psypos, defscale; float devres = 0.96; /* = 72.0 / 75.0, ps_units/in : screen_dpi */ +#ifndef HAVE_CAIRO if (gsproc < 0) return -1; +#endif /* !HAVE_CAIRO */ defscale = (xobjs.pagelist[areawin->page]->coordstyle == CM) ? CMSCALE : INCHSCALE; @@ -640,8 +649,10 @@ int renderbackground() psnorm = areawin->vscale * (1.0 / defscale) * devres; psxpos = (float)(-areawin->pcorner.x) * areawin->vscale * devres; - psypos = (float)(-areawin->pcorner.y) * areawin->vscale * devres - + ((float)areawin->height / 12.0); + psypos = (float)(-areawin->pcorner.y) * areawin->vscale * devres; +#ifndef HAVE_CAIRO + psypos += areawin->height / 12.; +#endif /* !HAVE_CAIRO */ /* Conditions for re-rendering: Must have a background specified */ /* and must be on the page, not a library or other object. */ @@ -667,30 +678,19 @@ int renderbackground() areawin->lastbackground = NULL; - /* write scale and position to ghostscript */ - /* and tell ghostscript to run the requested file */ - - send_to_gs("/GSobj save def\n"); - send_to_gs("/setpagedevice {pop} def\n"); - send_to_gs("gsave\n"); - sprintf(_STR, "%3.2f %3.2f translate\n", psxpos, psypos); - send_to_gs(_STR); - sprintf(_STR, "%3.2f %3.2f scale\n", psnorm, psnorm); - send_to_gs(_STR); - sprintf(_STR, "(%s) run\n", bgfile); - send_to_gs(_STR); - send_to_gs("GSobj restore\n"); - send_to_gs("grestore\n"); - #ifdef GS_DEBUG fprintf(stdout, "Rendering background from file \"%s\"\n", bgfile); #endif Wprintf("Rendering background image."); - XDefineCursor(dpy, areawin->window, WAITFOR); + + /* write scale and position to ghostscript */ + /* and tell ghostscript to run the requested file */ + + write_scale_position_and_run_gs(psnorm, psxpos, psypos, bgfile); /* The page will be refreshed when we receive confirmation */ /* from ghostscript that the buffer has been rendered. */ - + return 0; } @@ -708,11 +708,11 @@ int copybackground() if (is_page(topobject) == -1) return -1; -#ifdef DOUBLEBUFFER - XCopyArea(dpy, bbuf, dbuf, areawin->gc, 0, 0, - areawin->width, areawin->height, 0, 0); +#ifdef HAVE_CAIRO + cairo_set_source_surface(areawin->cr, bbuf, 0., 0.); + cairo_paint(areawin->cr); #else - XCopyArea(dpy, bbuf, areawin->window, areawin->gc, 0, 0, + XCopyArea(dpy, bbuf, dbuf, areawin->gc, 0, 0, areawin->width, areawin->height, 0, 0); #endif @@ -725,6 +725,7 @@ int copybackground() int exit_gs() { +#ifndef HAVE_CAIRO #ifdef _MSC_VER if (gsproc == INVALID_HANDLE_VALUE) return -1; /* gs not running */ #else @@ -750,8 +751,9 @@ int exit_gs() #else gsproc = -1; #endif - gs_state = GS_INIT; +#endif /* !HAVE_CAIRO */ + gs_state = GS_INIT; return 0; } @@ -761,19 +763,19 @@ int exit_gs() int reset_gs() { -#ifdef _MSC_VER +#ifndef HAVE_CAIRO + #ifdef _MSC_VER if (gsproc == INVALID_HANDLE_VALUE) return -1; -#else + #else if (gsproc < 0) return -1; -#endif + #endif exit_gs(); ghostinit_local(); start_gs(); +#endif /* !HAVE_CAIRO */ return 0; } -#endif /* !OPENGL */ - /*----------------------------------------------------------------------*/ diff --git a/schema.c b/schema.c index ba6faf7..fcd14fb 100644 --- a/schema.c +++ b/schema.c @@ -48,11 +48,11 @@ extern Tcl_Interp *xcinterp; extern Globaldata xobjs; extern XCWindowData *areawin; -extern int *appcolors; extern xcWidget menuwidgets[]; extern xcWidget netbutton; extern char _STR[150]; extern char _STR2[250]; +extern colorindex *colorlist; /*-------------------------------------------------------------------------*/ @@ -515,37 +515,37 @@ void setsymschem() if (topobject->schemtype == PRIMARY || topobject->schemtype == SECONDARY) { if (topobject->symschem == NULL) { - XtSetArg(aargs[0], XtNbackground, OFFBUTTONCOLOR); - XtSetArg(aargs[1], XtNforeground, OFFBUTTONCOLOR); + XtSetArg(aargs[0], XtNbackground, colorlist[OFFBUTTONCOLOR].color.pixel); + XtSetArg(aargs[1], XtNforeground, colorlist[OFFBUTTONCOLOR].color.pixel); } else { - XtSetArg(aargs[0], XtNbackground, BACKGROUND); - XtSetArg(aargs[1], XtNforeground, FOREGROUND); + XtSetArg(aargs[0], XtNbackground, colorlist[BACKGROUND].color.pixel); + XtSetArg(aargs[1], XtNforeground, colorlist[FOREGROUND].color.pixel); } - XtSetArg(bargs[1], XtNforeground, FOREGROUND); - XtSetArg(bargs[0], XtNbackground, SNAPCOLOR); + XtSetArg(bargs[1], XtNforeground, colorlist[FOREGROUND].color.pixel); + XtSetArg(bargs[0], XtNbackground, colorlist[SNAPCOLOR].color.pixel); } else { if (topobject->symschem != NULL) { - XtSetArg(bargs[0], XtNbackground, BACKGROUND); - XtSetArg(bargs[1], XtNforeground, FOREGROUND); + XtSetArg(bargs[0], XtNbackground, colorlist[BACKGROUND].color.pixel); + XtSetArg(bargs[1], XtNforeground, colorlist[FOREGROUND].color.pixel); } else { - XtSetArg(bargs[0], XtNbackground, OFFBUTTONCOLOR); - XtSetArg(bargs[1], XtNforeground, OFFBUTTONCOLOR); + XtSetArg(bargs[0], XtNbackground, colorlist[OFFBUTTONCOLOR].color.pixel); + XtSetArg(bargs[1], XtNforeground, colorlist[OFFBUTTONCOLOR].color.pixel); } - XtSetArg(aargs[1], XtNforeground, FOREGROUND); + XtSetArg(aargs[1], XtNforeground, colorlist[FOREGROUND].color.pixel); if (topobject->schemtype == FUNDAMENTAL) - XtSetArg(aargs[0], XtNbackground, AUXCOLOR); + XtSetArg(aargs[0], XtNbackground, colorlist[AUXCOLOR].color.pixel); else if (topobject->schemtype == TRIVIAL || topobject->symschem != NULL) - XtSetArg(aargs[0], XtNbackground, SNAPCOLOR); + XtSetArg(aargs[0], XtNbackground, colorlist[SNAPCOLOR].color.pixel); else { - XtSetArg(aargs[0], XtNbackground, OFFBUTTONCOLOR); - XtSetArg(aargs[1], XtNforeground, OFFBUTTONCOLOR); - XtSetArg(bargs[0], XtNbackground, BBOXCOLOR); - XtSetArg(bargs[1], XtNforeground, FOREGROUND); + XtSetArg(aargs[0], XtNbackground, colorlist[OFFBUTTONCOLOR].color.pixel); + XtSetArg(aargs[1], XtNforeground, colorlist[OFFBUTTONCOLOR].color.pixel); + XtSetArg(bargs[0], XtNbackground, colorlist[BBOXCOLOR].color.pixel); + XtSetArg(bargs[1], XtNforeground, colorlist[FOREGROUND].color.pixel); } } @@ -887,6 +887,8 @@ void swapschem(int allow_create, int libnum, char *fullname) if (eventmode == MOVE_MODE || eventmode == COPY_MODE) standard_element_delete(ERASE); + else + unselect_all(); /* Generate a library instance for this object and set the */ /* top instance to point to it. */ @@ -946,12 +948,13 @@ void swapschem(int allow_create, int libnum, char *fullname) NEW_LABEL(pinlab, topobject); (*pinlab)->pin = lpin->pin; (*pinlab)->color = lpin->color; - (*pinlab)->rotation = 0; + (*pinlab)->rotation = 0.0; (*pinlab)->scale = 1.0; - (*pinlab)->justify = areawin->justify; + (*pinlab)->anchor = areawin->anchor; (*pinlab)->position.x = 0; (*pinlab)->position.y = topobject->parts * (TEXTHEIGHT + 10); (*pinlab)->passed = NULL; + (*pinlab)->cycle = NULL; u2u_snap(&((*pinlab)->position)); (*pinlab)->string = stringcopy(lpin->string); incr_changes(topobject); diff --git a/selection.c b/selection.c index e500f7b..aa1a65a 100644 --- a/selection.c +++ b/selection.c @@ -42,11 +42,12 @@ /*----------------------------------------------------------------------*/ extern Display *dpy; -extern int *appcolors; extern Cursor appcursors[NUM_CURSORS]; extern XCWindowData *areawin; extern Globaldata xobjs; extern char _STR[150]; +extern int number_colors; +extern colorindex *colorlist; #ifdef TCL_WRAPPER extern Tcl_Interp *xcinterp; @@ -110,15 +111,18 @@ void selectfilter(xcWidget w, pointertype value, caddr_t calldata) Boolean checkselect_draw(short value, Boolean draw_selected) { - short *check, savemode; + short *check; value &= areawin->filter; /* apply the selection filter */ if (areawin->selects == 0) { - savemode = eventmode; - if (!draw_selected) eventmode = PENDING_MODE; - select_element(value); - eventmode = savemode; + if (draw_selected) + select_element(value); + else { + Boolean save_redraw = areawin->redraw_needed; + select_element(value); + areawin->redraw_needed = save_redraw; + } } if (areawin->selects == 0) return False; for (check = areawin->selectlist; check < areawin->selectlist + @@ -158,9 +162,14 @@ void geneasydraw(short instance, int mode, objectptr curobj, objinstptr curinst) { genericptr elementptr = *(curobj->plist + instance); +#ifdef HAVE_CAIRO + cairo_save(areawin->cr); + cairo_reset_clip(areawin->cr); +#else // Note: Setting areawin->clipped to -1 prevents the clipmask from being // applied to elements, areawin->clipped = -1; +#endif /* HAVE_CAIRO */ switch (ELEMENTTYPE(*(curobj->plist + instance))) { case ARC: @@ -186,7 +195,11 @@ void geneasydraw(short instance, int mode, objectptr curobj, objinstptr curinst) UDrawGraphic((graphicptr)elementptr); break; } +#ifdef HAVE_CAIRO + cairo_restore(areawin->cr); +#else areawin->clipped = 0; +#endif /* HAVE_CAIRO */ } /*-------------------------------------------------*/ @@ -195,25 +208,15 @@ void geneasydraw(short instance, int mode, objectptr curobj, objinstptr curinst) void gendrawselected(short *newselect, objectptr curobj, objinstptr curinst) { - /* Don't draw selection color when selecting for edit */ - if (eventmode == PENDING_MODE) return; - if (*newselect >= curobj->parts) return; // Safety check - XcSetFunction(GXcopy); - XcSetForeground(BACKGROUND); - geneasydraw(*newselect, DOFORALL, curobj, curinst); - indicateparams(*(curobj->plist + *newselect)); - - XcSetFunction(GXxor); - XcSetForeground(SELECTCOLOR ^ BACKGROUND); + XcSetForeground(SELECTCOLOR); geneasydraw(*newselect, DOFORALL, curobj, curinst); - SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND); + SetForeground(dpy, areawin->gc, AUXCOLOR); indicateparams(*(curobj->plist + *newselect)); SetForeground(dpy, areawin->gc, areawin->gccolor); - SetFunction(dpy, areawin->gc, areawin->gctype); } /*---------------------------------------------------*/ @@ -272,7 +275,7 @@ void setoptionmenu() return; case LABEL: mlabel = SELTOLABEL(mselect); - setfontmarks(mlabel->string->data.font, mlabel->justify); + setfontmarks(mlabel->string->data.font, mlabel->anchor); return; } } @@ -693,7 +696,7 @@ void advancecycle(genericptr *pgen, short newvalue) *endptr = *pptr; *pptr = tmpcyc; pptr->flags &= ~LASTENTRY; - pptr->number = -1; + endptr->number = -1; endptr--; endptr->flags |= LASTENTRY; } @@ -1006,7 +1009,9 @@ Boolean selectarea(objectptr selobj, XPoint *boxpts, short level) XPoint adj; labelptr slab = TOLABEL(curgen); short j, state, isect, tmpl1, tmpl2; + int padding; TextExtents tmpext; + TextLinesInfo tlinfo; selected = False; @@ -1022,17 +1027,21 @@ Boolean selectarea(objectptr selobj, XPoint *boxpts, short level) if (slab->pin) { for (j = 0; j < 4; j++) - pinadjust(slab->justify, &(newboxpts[j].x), + pinadjust(slab->anchor, &(newboxpts[j].x), &(newboxpts[j].y), -1); } - tmpext = ULength(slab, areawin->topinstance, 0, NULL); - adj.x = (slab->justify & NOTLEFT ? (slab->justify & RIGHT ? + tlinfo.dostop = 0; + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; + + tmpext = ULength(slab, areawin->topinstance, &tlinfo); + adj.x = (slab->anchor & NOTLEFT ? (slab->anchor & RIGHT ? tmpext.maxwidth : tmpext.maxwidth >> 1) : 0); - adj.y = (slab->justify & NOTBOTTOM ? (slab->justify & TOP ? + adj.y = (slab->anchor & NOTBOTTOM ? (slab->anchor & TOP ? tmpext.ascent : (tmpext.ascent + tmpext.base) >> 1) : tmpext.base); - + /* Label selection: For each character in the label string, */ /* do an insideness test with the select box. */ @@ -1042,9 +1051,16 @@ Boolean selectarea(objectptr selobj, XPoint *boxpts, short level) if (locpos < 0) continue; /* only look at printable characters */ if (strptr->type == RETURN) tmpl2 = 0; tmpl1 = tmpl2; - tmpext = ULength(slab, areawin->topinstance, j + 1, NULL); + tlinfo.dostop = j + 1; + tmpext = ULength(slab, areawin->topinstance, &tlinfo); tmpl2 = tmpext.maxwidth; - isect = test_insideness(((tmpl1 + tmpl2) >> 1) - adj.x, + if ((slab->anchor & JUSTIFYRIGHT) && tlinfo.padding) + padding = (int)tlinfo.padding[tlinfo.line]; + else if ((slab->anchor & TEXTCENTERED) && tlinfo.padding) + padding = (int)(0.5 * tlinfo.padding[tlinfo.line]); + else + padding = 0; + isect = test_insideness(((tmpl1 + tmpl2) >> 1) - adj.x + padding, (tmpext.base + (BASELINE >> 1)) - adj.y, newboxpts); /* tiny state machine */ @@ -1067,9 +1083,11 @@ Boolean selectarea(objectptr selobj, XPoint *boxpts, short level) } if (state == 1) areawin->textpos = j; /* selection goes to end of string */ - /* If a label happens to be empty (can happen in the case of */ - /* a label with parameters that are all empty strings), then */ - /* check if the bounding box surrounds the label position. */ + if (tlinfo.padding != NULL) free(tlinfo.padding); + + /* If a label happens to be empty (can happen in the case of */ + /* a label with parameters that are all empty strings), then */ + /* check if the bounding box surrounds the label position. */ else if (tmpext.width == 0) { isect = test_insideness(0, 0, newboxpts); @@ -1078,7 +1096,7 @@ Boolean selectarea(objectptr selobj, XPoint *boxpts, short level) areawin->textend = 1; } } - + } break; case(PATH): @@ -1181,9 +1199,6 @@ void draw_normal_selected(objectptr thisobj, objinstptr thisinst) saveselects = areawin->selects; - /* reset the graphics state */ - SetFunction(dpy, areawin->gc, GXcopy); - areawin->selects = 0; drawarea(NULL, NULL, NULL); areawin->selects = saveselects; @@ -1217,8 +1232,10 @@ static void freeselection(selection *rselect) void freeselects() { - if (areawin->selects > 0) + if (areawin->selects > 0) { free(areawin->selectlist); + areawin->redraw_needed =True; + } areawin->selects = 0; free_stack(&areawin->hierstack); } @@ -1270,7 +1287,6 @@ void unselect_all() if (xobjs.suspend < 0) draw_normal_selected(topobject, areawin->topinstance); clearselects(); - } /*----------------------------------------------------------------------*/ @@ -1383,7 +1399,7 @@ void startselect() eventmode = SELAREA_MODE; areawin->origin.x = areawin->save.x; areawin->origin.y = areawin->save.y; - UDrawBox(areawin->origin, areawin->save); + selarea_mode_draw(xcDRAW_INIT, NULL); #ifdef TCL_WRAPPER Tk_CreateEventHandler(areawin->area, ButtonMotionMask | @@ -1409,11 +1425,9 @@ void trackselarea() newpos = UGetCursorPos(); if (newpos.x == areawin->save.x && newpos.y == areawin->save.y) return; - UDrawBox(areawin->origin, areawin->save); - UDrawBox(areawin->origin, newpos); - areawin->save.x = newpos.x; areawin->save.y = newpos.y; + selarea_mode_draw(xcDRAW_EDIT, NULL); } /*----------------------*/ @@ -1427,11 +1441,9 @@ void trackrescale() newpos = UGetCursorPos(); if (newpos.x == areawin->save.x && newpos.y == areawin->save.y) return; - UDrawRescaleBox(&areawin->save); - UDrawRescaleBox(&newpos); - areawin->save.x = newpos.x; areawin->save.y = newpos.y; + rescale_mode_draw(xcDRAW_EDIT, NULL); } /*----------------------------------------------------------------------*/ @@ -1690,9 +1702,7 @@ short *recurse_select_element(short class, u_char mode) { } if (ilast >= 0) { newselect = rselect->selectlist + ilast; - SetFunction(dpy, areawin->gc, GXcopy); - XTopSetForeground(SELTOCOLOR(newselect)); - geneasydraw(*newselect, DEFAULTCOLOR, topobject, areawin->topinstance); + areawin->redraw_needed = True; areawin->selects--; for (k = jlast; k < areawin->selects; k++) *(areawin->selectlist + k) = *(areawin->selectlist + k + 1); @@ -1729,7 +1739,7 @@ short *recurse_select_element(short class, u_char mode) { if (ilast >= 0) { newselect = allocselect(); *newselect = *(rselect->selectlist + ilast); - gendrawselected(newselect, topobject, areawin->topinstance); + areawin->redraw_needed = True; setoptionmenu(); u2u_snap(&areawin->save); diff --git a/spiceparser/Makefile b/spiceparser/Makefile new file mode 100644 index 0000000..b96d343 --- /dev/null +++ b/spiceparser/Makefile @@ -0,0 +1,688 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# spiceparser/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/xcircuit +pkgincludedir = $(includedir)/xcircuit +pkglibdir = $(libdir)/xcircuit +pkglibexecdir = $(libexecdir)/xcircuit +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +target_triplet = x86_64-unknown-linux-gnu +subdir = spiceparser +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_$(V)) +am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY)) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libspiceparser_a_AR = $(AR) $(ARFLAGS) +libspiceparser_a_LIBADD = +am_libspiceparser_a_OBJECTS = bitlist.$(OBJEXT) eqn.$(OBJEXT) \ + eqnlist.$(OBJEXT) equations.$(OBJEXT) hash.$(OBJEXT) \ + list.$(OBJEXT) list_search.$(OBJEXT) memory.$(OBJEXT) \ + mergedup.$(OBJEXT) names.$(OBJEXT) netlist.$(OBJEXT) \ + netlist_dev.$(OBJEXT) netlist_extract.$(OBJEXT) \ + netlist_funcs.$(OBJEXT) netlist_lib.$(OBJEXT) \ + netlist_spice.$(OBJEXT) netlist_template.$(OBJEXT) \ + scanner.$(OBJEXT) sort.$(OBJEXT) xcircspice.$(OBJEXT) +libspiceparser_a_OBJECTS = $(am_libspiceparser_a_OBJECTS) +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libspiceparser_a_SOURCES) +DIST_SOURCES = $(libspiceparser_a_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = aclocal-1.14 +ALL_TARGET = all-recursive +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AUTOCONF = autoconf +AUTOHEADER = autoheader +AUTOMAKE = automake-1.14 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=none +CFLAGS = -g -Wno-pointer-sign -fPIC +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"xcircuit\" -DVERSION=\"3.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DSPICE_EXEC=\"ngspice\" -DTCL_WRAPPER=1 +DEPDIR = .deps +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +EXTRA_LIB_SPECS = -lm +GREP = /bin/grep +GS_EXEC = gs +GS_LIBS = +HAVE_LGF = LGF +INC_SPECS = -I/usr/include -I/usr/include +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INSTALL_TARGET = install-recursive +INTERPRETER = TCL +INTERP_PATH = tcl +LD = /bin/ld +LDDL_FLAGS = -Wl,-z,relro -Wl,--export-dynamic -Wl,--version-script=symbol.map +LDFLAGS = +LD_RUN_PATH = -Wl,-rpath,/usr/lib64 +LIBOBJS = +LIBS = -ldl -lz -lpthread -lieee -lm -lz -lXt -lSM -lICE -lm -lX11 -lXpm +LIB_SPECS = -L/usr/lib64 -ltcl8.6 -L/usr/lib64 -ltk8.6 +LTLIBOBJS = +M4 = /bin/m4 +MAKEINFO = makeinfo +MKDIR_P = /bin/mkdir -p +OBJEXT = o +PACKAGE = xcircuit +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_CONFIG = /bin/pkg-config +PKG_CONFIG_LIBDIR = +PKG_CONFIG_PATH = +PYTHON = +RANLIB = ranlib +REVISION = 71 +SET_MAKE = +SHDLIB_EXT = .so +SHELL = /bin/sh +SHLIB_LD = ${CC} -shared ${CFLAGS} ${LDFLAGS} -fPIC -Wl,-soname,${@} +SHLIB_LIB_SPECS = +SPICE_EXEC = ngspice +STARTUP_FILE = xcstartup.tcl +STDLIBS = +STRIP = +SUBDIRS = +SUBLIB = +TCL_LIB_DIR = /usr/lib64 +VERSION = 3.9 +WISH_EXE = /usr/bin/wish +WRAPPER_SCRIPT = wrapper.tcl +XCIRCUIT_TARGET = tcl +XMKMF = +X_CFLAGS = +X_EXTRA_LIBS = +X_LIBS = +X_PRE_LIBS = -lSM -lICE +abs_builddir = /home/tim/gitsrc/xcircuit-3.9/spiceparser +abs_srcdir = /home/tim/gitsrc/xcircuit-3.9/spiceparser +abs_top_builddir = /home/tim/gitsrc/xcircuit-3.9 +abs_top_srcdir = /home/tim/gitsrc/xcircuit-3.9 +ac_ct_CC = gcc +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +cairo_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 +cairo_LIBS = -lcairo +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +fontconfig_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 +fontconfig_LIBS = -lfontconfig -lfreetype +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/tim/gitsrc/xcircuit-3.9/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = x86_64-unknown-linux-gnu +target_alias = +target_cpu = x86_64 +target_os = linux-gnu +target_vendor = unknown +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +AUTOMAKE_OPTIONS = foreign no-dependencies +EXTRA_DIST = +INCLUDES = -I.. ${INC_SPECS} + +# Requirements for spiceparser library +noinst_LIBRARIES = libspiceparser.a +libspiceparser_a_SOURCES = \ + bitlist.c eqn.c eqnlist.c equations.c hash.c list.c list_search.c \ + memory.c mergedup.c names.c netlist.c netlist_dev.c netlist_extract.c \ + netlist_funcs.c netlist_lib.c netlist_spice.c netlist_template.c \ + scanner.c sort.c xcircspice.c + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign spiceparser/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign spiceparser/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +libspiceparser.a: $(libspiceparser_a_OBJECTS) $(libspiceparser_a_DEPENDENCIES) $(EXTRA_libspiceparser_a_DEPENDENCIES) + $(AM_V_at)-rm -f libspiceparser.a + $(AM_V_AR)$(libspiceparser_a_AR) libspiceparser.a $(libspiceparser_a_OBJECTS) $(libspiceparser_a_LIBADD) + $(AM_V_at)$(RANLIB) libspiceparser.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(AM_V_CC)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LIBRARIES) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/spiceparser/Makefile.in b/spiceparser/Makefile.in index 1c726ba..1bf3c9d 100644 --- a/spiceparser/Makefile.in +++ b/spiceparser/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -36,7 +80,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = spiceparser -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -47,6 +92,10 @@ CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = libspiceparser_a_AR = $(AR) $(ARFLAGS) libspiceparser_a_LIBADD = am_libspiceparser_a_OBJECTS = bitlist.$(OBJEXT) eqn.$(OBJEXT) \ @@ -58,27 +107,73 @@ am_libspiceparser_a_OBJECTS = bitlist.$(OBJEXT) eqn.$(OBJEXT) \ netlist_spice.$(OBJEXT) netlist_template.$(OBJEXT) \ scanner.$(OBJEXT) sort.$(OBJEXT) xcircspice.$(OBJEXT) libspiceparser_a_OBJECTS = $(am_libspiceparser_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libspiceparser_a_SOURCES) DIST_SOURCES = $(libspiceparser_a_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -111,6 +206,7 @@ am__relativize = \ ACLOCAL = @ACLOCAL@ ALL_TARGET = @ALL_TARGET@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -131,6 +227,7 @@ EXEEXT = @EXEEXT@ EXTRA_LIB_SPECS = @EXTRA_LIB_SPECS@ GREP = @GREP@ GS_EXEC = @GS_EXEC@ +GS_LIBS = @GS_LIBS@ HAVE_LGF = @HAVE_LGF@ INC_SPECS = @INC_SPECS@ INSTALL = @INSTALL@ @@ -161,13 +258,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ REVISION = @REVISION@ SET_MAKE = @SET_MAKE@ SHDLIB_EXT = @SHDLIB_EXT@ SHELL = @SHELL@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LIB_SPECS = @SHLIB_LIB_SPECS@ SPICE_EXEC = @SPICE_EXEC@ @@ -203,11 +302,15 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +cairo_CFLAGS = @cairo_CFLAGS@ +cairo_LIBS = @cairo_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +fontconfig_CFLAGS = @fontconfig_CFLAGS@ +fontconfig_LIBS = @fontconfig_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -289,10 +392,11 @@ $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libspiceparser.a: $(libspiceparser_a_OBJECTS) $(libspiceparser_a_DEPENDENCIES) - -rm -f libspiceparser.a - $(libspiceparser_a_AR) libspiceparser.a $(libspiceparser_a_OBJECTS) $(libspiceparser_a_LIBADD) - $(RANLIB) libspiceparser.a + +libspiceparser.a: $(libspiceparser_a_OBJECTS) $(libspiceparser_a_DEPENDENCIES) $(EXTRA_libspiceparser_a_DEPENDENCIES) + $(AM_V_at)-rm -f libspiceparser.a + $(AM_V_AR)$(libspiceparser_a_AR) libspiceparser.a $(libspiceparser_a_OBJECTS) $(libspiceparser_a_LIBADD) + $(AM_V_at)$(RANLIB) libspiceparser.a mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -301,28 +405,31 @@ distclean-compile: -rm -f *.tab.c .c.o: - $(COMPILE) -c $< + $(AM_V_CC)$(COMPILE) -c -o $@ $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -337,57 +444,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -403,12 +465,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -420,15 +477,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -437,6 +490,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -473,13 +541,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -514,10 +579,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -596,22 +666,21 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic \ - clean-noinstLIBRARIES ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/spiceparser/example b/spiceparser/example new file mode 100755 index 0000000..2d98d4a Binary files /dev/null and b/spiceparser/example differ diff --git a/svg.c b/svg.c index 78ac70c..3b155d1 100644 --- a/svg.c +++ b/svg.c @@ -5,6 +5,7 @@ #include #include +#include #include #ifndef XC_WIN32 #include @@ -53,7 +54,6 @@ extern Display *dpy; extern Pixmap STIPPLE[8]; extern XCWindowData *areawin; extern Globaldata xobjs; -extern int *appcolors; extern colorindex *colorlist; extern int number_colors; extern fontinfo *fonts; @@ -70,18 +70,12 @@ FILE *svgf; void svg_printcolor(int passcolor, char *prefix) { - int i; - if (passcolor != DEFAULTCOLOR) { - for (i = 0; i < number_colors; i++) { - if (colorlist[i].color.pixel == passcolor) break; - } - if (i < number_colors) { - fprintf(svgf, "%s\"#%02x%02x%02x\" ", + if ((passcolor < number_colors) && (passcolor != DEFAULTCOLOR)) { + fprintf(svgf, "%s\"#%02x%02x%02x\" ", prefix, - (colorlist[i].color.red >> 8), - (colorlist[i].color.green >> 8), - (colorlist[i].color.blue >> 8)); - } + (colorlist[passcolor].color.red >> 8), + (colorlist[passcolor].color.green >> 8), + (colorlist[passcolor].color.blue >> 8)); } } @@ -229,13 +223,17 @@ void SVGCreateImages(int page) fname = tmpnam(NULL); ppf = fopen(fname, "w"); if (ppf != NULL) { - fprintf(ppf, "P6 %d %d 255\n", img->image->width, img->image->height); - for (y = 0; y < img->image->height; y++) { - for (x = 0; x < img->image->width; x++) { - pixel.i = XGetPixel(img->image, x, y); - fwrite(&pixel.b[2], 1, 1, ppf); - fwrite(&pixel.b[1], 1, 1, ppf); - fwrite(&pixel.b[0], 1, 1, ppf); + int width, height; + width = xcImageGetWidth(img->image); + height = xcImageGetWidth(img->image); + fprintf(ppf, "P6 %d %d 255\n", width, height); + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + u_char r, g, b; + xcImageGetPixel(img->image, x, y, &r, &g, &b); + fwrite(&r, 1, 1, ppf); + fwrite(&g, 1, 1, ppf); + fwrite(&b, 1, 1, ppf); } } } @@ -274,7 +272,9 @@ void SVGDrawGraphic(graphicptr gp) int i; char outname[128], *pptr; float tscale; - int rotation; + float rotation; + int width = xcImageGetWidth(gp->source); + int height = xcImageGetHeight(gp->source); for (i = 0; i < xobjs.images; i++) { img = xobjs.imagelist + i; @@ -291,20 +291,19 @@ void SVGDrawGraphic(graphicptr gp) UPushCTM(); UPreMultCTM(DCTM, gp->position, gp->scale, gp->rotation); - corner.x = -(gp->source->width >> 1); - corner.y = (gp->source->height >> 1); + corner.x = -(width >> 1); + corner.y = (height >> 1); UTransformbyCTM(DCTM, &corner, &ppt, 1); UPopCTM(); tscale = gp->scale * UTopScale(); rotation = gp->rotation + UTopRotation(); - if (rotation >= 360) rotation -= 360; - else if (rotation < 0) rotation += 360; + if (rotation >= 360.0) rotation -= 360.0; + else if (rotation < 0.0) rotation += 360.0; - fprintf(svgf, "source->width, gp->source->height); + fprintf(svgf, " width=\"%dpx\" height=\"%dpx\"", width, height); fprintf(svgf, " xlink:href=\"%s\">\n", outname); fprintf(svgf, "\n"); } @@ -519,7 +518,7 @@ void SVGDrawObject(objinstptr theinstance, short level, int passcolor, pushlistp case(LABEL): if (level == 0 || TOLABEL(areagen)->pin == False || - (TOLABEL(areagen)->justify & PINVISIBLE)) + (TOLABEL(areagen)->anchor & PINVISIBLE)) SVGDrawString(TOLABEL(areagen), curcolor, theinstance); break; } @@ -546,15 +545,17 @@ void SVGDrawString(labelptr drawlabel, int passcolor, objinstptr localinst) { stringpart *strptr; char *textptr; - short fstyle, ffont, tmpjust, baseline, deltay; + short fstyle, ffont, tmpanchor, baseline, deltay; int pos, defaultcolor, curcolor, scolor; short oldx, oldfont, oldstyle; int olinerise = 4; float tmpscale = 1.0, natscale = 1.0; XPoint newpoint; TextExtents tmpext; + TextLinesInfo tlinfo; short *tabstops = NULL; short tabno, numtabs = 0, group = 0; + short linenum = 0; int open_text, open_span, open_decor; XPoint *decorations = NULL; short nvals = 0; @@ -618,8 +619,8 @@ void SVGDrawString(labelptr drawlabel, int passcolor, objinstptr localinst) UPushCTM(); UPreMultCTM(DCTM, drawlabel->position, drawlabel->scale, drawlabel->rotation); - /* check for flip invariance; recompute CTM and justification if necessary */ - tmpjust = flipadjust(drawlabel->justify); + /* check for flip invariance; recompute CTM and anchoring if necessary */ + tmpanchor = flipadjust(drawlabel->anchor); /* Note that the Y-scale is inverted or text comes out upside-down. But we */ /* need to adjust to the Y baseline. */ @@ -631,19 +632,22 @@ void SVGDrawString(labelptr drawlabel, int passcolor, objinstptr localinst) fprintf(svgf, ">\n"); /* "natural" (unscaled) length */ - tmpext = ULength(drawlabel, localinst, 0, NULL); - - newpoint.x = (tmpjust & NOTLEFT ? - (tmpjust & RIGHT ? -tmpext.maxwidth : -tmpext.maxwidth >> 1) : 0); - newpoint.y = (tmpjust & NOTBOTTOM ? - (tmpjust & TOP ? -tmpext.ascent : -(tmpext.ascent + tmpext.base) >> 1) + tlinfo.dostop = 0; + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; + tmpext = ULength(drawlabel, localinst, &tlinfo); + + newpoint.x = (tmpanchor & NOTLEFT ? + (tmpanchor & RIGHT ? -tmpext.maxwidth : -tmpext.maxwidth >> 1) : 0); + newpoint.y = (tmpanchor & NOTBOTTOM ? + (tmpanchor & TOP ? -tmpext.ascent : -(tmpext.ascent + tmpext.base) >> 1) : -tmpext.base); /* Pinlabels have an additional offset spacing to pad */ /* them from the circuit point to which they attach. */ if (drawlabel->pin) { - pinadjust(tmpjust, &(newpoint.x), &(newpoint.y), 1); + pinadjust(tmpanchor, &(newpoint.x), &(newpoint.y), 1); } oldx = newpoint.x; @@ -653,6 +657,16 @@ void SVGDrawString(labelptr drawlabel, int passcolor, objinstptr localinst) open_span = 0; open_decor = 0; pos = 0; + + /* Adjust for center or right justification */ + if (tlinfo.padding != NULL) { + if (tmpanchor & JUSTIFYRIGHT) + newpoint.x += tlinfo.padding[linenum]; + else if (tmpanchor & TEXTCENTERED) + newpoint.x += 0.5 * tlinfo.padding[linenum]; + linenum++; + } + for (strptr = drawlabel->string; strptr != NULL; strptr = nextstringpart(strptr, localinst)) { @@ -833,6 +847,15 @@ void SVGDrawString(labelptr drawlabel, int passcolor, objinstptr localinst) baseline -= BASELINE; newpoint.y = baseline; newpoint.x = oldx; + + if (tlinfo.padding != NULL) { + if (tmpanchor & JUSTIFYRIGHT) + newpoint.x += tlinfo.padding[linenum]; + else if (tmpanchor & TEXTCENTERED) + newpoint.x += 0.5 * tlinfo.padding[linenum]; + linenum++; + } + fprintf(svgf, "", newpoint.x, -newpoint.y); open_span++; break; @@ -968,6 +991,7 @@ void SVGDrawString(labelptr drawlabel, int passcolor, objinstptr localinst) UPopCTM(); if (tabstops != NULL) free(tabstops); + if (tlinfo.padding != NULL) free(tlinfo.padding); /* If there were decorations (underlines, overlines), generate them */ diff --git a/tclxcircuit.c b/tclxcircuit.c index 2c192bd..6e49bba 100644 --- a/tclxcircuit.c +++ b/tclxcircuit.c @@ -18,16 +18,15 @@ #include +#ifdef HAVE_CAIRO +#include +#endif + #ifndef _MSC_VER #include #include #endif -#ifdef OPENGL -#include -#include -#endif /* OPENGL */ - #include "xcircuit.h" #include "colordefs.h" #include "menudep.h" @@ -44,7 +43,6 @@ extern char _STR[150], _STR2[250]; extern XCWindowData *areawin; extern Globaldata xobjs; extern int number_colors; -extern int *appcolors; extern colorindex *colorlist; extern Cursor appcursors[NUM_CURSORS]; extern ApplicationData appdata; @@ -57,12 +55,6 @@ extern short flstart; extern int pressmode; extern u_char undo_collect; -#ifdef OPENGL -GLXContext grXcontext; -XVisualInfo *grVisualInfo; -float gl_line_limit, gl_point_limit; -#endif /* OPENGL */ - char STIPDATA[STIPPLES][4] = { "\000\004\000\001", "\000\005\000\012", @@ -90,6 +82,25 @@ short flags = -1; #define CONST84 #endif +/*----------------------------------------------------------------------*/ +/* Procedure for waiting on X to map a window */ +/* This code copied from Tk sources, where it is used for the "tkwait" */ +/* command. */ +/*----------------------------------------------------------------------*/ + +static void +WaitVisibilityProc(ClientData clientData, XEvent *eventPtr) +{ + int *donePtr = (int *) clientData; + + if (eventPtr->type == VisibilityNotify) { + *donePtr = 1; + } + if (eventPtr->type == DestroyNotify) { + *donePtr = 2; + } +} + /*----------------------------------------------------------------------*/ /* Deal with systems which don't define va_copy(). */ /*----------------------------------------------------------------------*/ @@ -483,8 +494,8 @@ int xctcl_eventmode(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { static char *modeNames[] = { - "normal", "undo", "move", "copy", "pan", "selarea", - "pending", "rescale", "catalog", "cattext", + "normal", "undo", "move", "copy", "pan", + "selarea", "rescale", "catalog", "cattext", "fontcat", "efontcat", "text", "wire", "box", "arc", "spline", "etext", "epoly", "earc", "espline", "epath", "einst", "assoc", "catmove", @@ -815,7 +826,15 @@ int GetXCStringFromList(Tcl_Interp *interp, Tcl_Obj *list, stringpart **rstring) "string part types", TCL_EXACT, &idx) != TCL_OK) { Tcl_ResetResult(interp); idx = -1; - result = Tcl_ListObjIndex(interp, lobj, 0, &tobj); + + // If there's only one object and the first item doesn't match + // a stringpart itentifying word, then assume that "list" is a + // single text string. + + if (numobjs == 1) + tobj = list; + else + result = Tcl_ListObjIndex(interp, lobj, 0, &tobj); } else { result = Tcl_ListObjIndex(interp, lobj, (numparts > 1) ? 1 : 0, &tobj); @@ -1360,9 +1379,9 @@ int xctcl_symschem(ClientData clientData, Tcl_Interp *interp, return TCL_ERROR; break; case GoToIdx: - /* This is supposed to specifically go to the specified type, */ - /* so don't call swapschem to change views if we're already */ - /* on the right view. */ + /* This is supposed to specifically go to the specified type, */ + /* so don't call swapschem to change views if we're already */ + /* on the right view. */ if (topobject->schemtype == PRIMARY || topobject->schemtype == SECONDARY) { if (!strncmp(Tcl_GetString(objv[0]), "sym", 3)) { @@ -2405,7 +2424,7 @@ int xctcl_color(ClientData clientData, Tcl_Interp *interp, break; case IndexIdx: - /* Return the index of the color */ + /* Return the index of the color. For use with parameterized color */ if ((objc - nidx) == 2) { result = GetColorFromObj(interp, objv[nidx + 1], &cindex, TRUE); if (result != TCL_OK) return result; @@ -2419,7 +2438,7 @@ int xctcl_color(ClientData clientData, Tcl_Interp *interp, break; case ValueIdx: - /* Return the value of the color. For use with parameterized color */ + /* Return the value of the color as an {R G B} list */ if ((objc - nidx) == 2) { result = GetColorFromObj(interp, objv[nidx + 1], &cindex, TRUE); if (result != TCL_OK) return result; @@ -2427,7 +2446,7 @@ int xctcl_color(ClientData clientData, Tcl_Interp *interp, Tcl_SetResult(interp, "Color index out of range", NULL); return TCL_ERROR; } - Tcl_SetObjResult(interp, Tcl_NewIntObj(colorlist[cindex].color.pixel)); + Tcl_SetObjResult(interp, TclIndexToRGB(cindex)); return TCL_OK; } else { @@ -2441,7 +2460,7 @@ int xctcl_color(ClientData clientData, Tcl_Interp *interp, if ((objc - nidx) == 2) { option = Tcl_GetString(objv[nidx + 1]); if (!strncmp(option, "-all", 4)) { - for (i = 0; i < number_colors; i++) { + for (i = NUMBER_OF_COLORS; i < number_colors; i++) { char colorstr[14]; sprintf(colorstr, "#%04x%04x%04x", colorlist[i].color.red, @@ -2468,7 +2487,7 @@ int xctcl_color(ClientData clientData, Tcl_Interp *interp, if (ccol == DEFAULTCOLOR) Tcl_SetObjResult(interp, Tcl_NewStringObj("inherit", 7)); else { - for (i = 0; i < number_colors; i++) + for (i = NUMBER_OF_COLORS; i < number_colors; i++) if (colorlist[i].color.pixel == ccol) break; Tcl_SetObjResult(interp, Tcl_NewIntObj(i)); @@ -2739,15 +2758,15 @@ int xctcl_rotate(ClientData clientData, Tcl_Interp *interp, objPtr = NULL; if (SELECTTYPE(areawin->selectlist + i) == OBJINST) { objinstptr pinst = SELTOOBJINST(areawin->selectlist + i); - objPtr = Tcl_NewIntObj(pinst->rotation); + objPtr = Tcl_NewDoubleObj((double)(pinst->rotation)); } else if (SELECTTYPE(areawin->selectlist + i) == LABEL) { labelptr plab = SELTOLABEL(areawin->selectlist + i); - objPtr = Tcl_NewIntObj(plab->rotation); + objPtr = Tcl_NewDoubleObj((double)(plab->rotation)); } else if (SELECTTYPE(areawin->selectlist + i) == GRAPHIC) { graphicptr gp = SELTOGRAPHIC(areawin->selectlist + i); - objPtr = Tcl_NewIntObj(gp->rotation); + objPtr = Tcl_NewDoubleObj((double)(gp->rotation)); } if (objPtr != NULL) { if (numfound > 0) @@ -2911,7 +2930,7 @@ char * translateparamtype(int type) { const char *param_types[] = {"numeric", "substring", "x position", - "y position", "style", "justification", "start angle", "end angle", + "y position", "style", "anchoring", "start angle", "end angle", "radius", "minor axis", "rotation", "scale", "linewidth", "color", "expression", "position", NULL}; @@ -2955,7 +2974,7 @@ int xctcl_param(ClientData clientData, Tcl_Interp *interp, /* The order of these type names must match the enumeration in xcircuit.h */ static char *param_types[] = {"numeric", "substring", "x position", - "y position", "style", "justification", "start angle", "end angle", + "y position", "style", "anchoring", "start angle", "end angle", "radius", "minor axis", "rotation", "scale", "linewidth", "color", "expression", "position", NULL}; /* (jdk) */ @@ -3353,6 +3372,7 @@ next_param: } /* Redraw everything (this could be finessed. . .) */ + areawin->redraw_needed = True; drawarea(areawin->area, (caddr_t)NULL, (caddr_t)NULL); } else { @@ -3639,7 +3659,6 @@ int xctcl_deselect(ClientData clientData, Tcl_Interp *interp, for (i = 0; i < areawin->selects; i++) { short *newselect = areawin->selectlist + i; if ((genericptr)ehandle == SELTOGENERIC(newselect)) { - SetFunction(dpy, areawin->gc, GXcopy); XTopSetForeground(SELTOCOLOR(newselect)); geneasydraw(*newselect, DEFAULTCOLOR, topobject, areawin->topinstance); @@ -3905,74 +3924,86 @@ int xctcl_object(ClientData clientData, Tcl_Interp *interp, } /*----------------------------------------------------------------------*/ -/* Get justification (or associated fields) global setting, or apply */ +/* Get anchoring (or associated fields) global setting, or apply */ /* to selected labels. */ /*----------------------------------------------------------------------*/ int -getjustification(Tcl_Interp *interp, short bitfield) +getanchoring(Tcl_Interp *interp, short bitfield) { int i, rval; labelptr tlab; if (areawin->selects == 0) { if (bitfield & RIGHT) { - Tcl_AppendElement(interp, (areawin->justify & RIGHT) ? - "right" : (areawin->justify & NOTLEFT) ? "center" : "left"); + Tcl_AppendElement(interp, (areawin->anchor & RIGHT) ? + "right" : (areawin->anchor & NOTLEFT) ? "center" : "left"); } else if (bitfield & TOP) { - Tcl_AppendElement(interp, (areawin->justify & TOP) ? - "top" : (areawin->justify & NOTBOTTOM) ? "middle" : "bottom"); + Tcl_AppendElement(interp, (areawin->anchor & TOP) ? + "top" : (areawin->anchor & NOTBOTTOM) ? "middle" : "bottom"); + } + else if (bitfield & JUSTIFYRIGHT) { + Tcl_AppendElement(interp, (areawin->anchor & JUSTIFYRIGHT) ? "right" : + (areawin->anchor & TEXTCENTERED) ? "center" : + (areawin->anchor & JUSTIFYBOTH) ? "both" : + "left"); } else { - Tcl_AppendElement(interp, (areawin->justify & bitfield) ? + Tcl_AppendElement(interp, (areawin->anchor & bitfield) ? "true" : "false"); } - return (areawin->justify & bitfield); + return (areawin->anchor & bitfield); } for (i = 0; i < areawin->selects; i++) { if (SELECTTYPE(areawin->selectlist + i) != LABEL) continue; tlab = SELTOLABEL(areawin->selectlist + i); if (bitfield == PINVISIBLE && tlab->pin == NORMAL) continue; if (bitfield & RIGHT) { - Tcl_AppendElement(interp, (tlab->justify & RIGHT) ? - "right" : (tlab->justify & NOTLEFT) ? "center" : "left"); + Tcl_AppendElement(interp, (tlab->anchor & RIGHT) ? + "right" : (tlab->anchor & NOTLEFT) ? "center" : "left"); } else if (bitfield & TOP) { - Tcl_AppendElement(interp, (tlab->justify & TOP) ? - "top" : (tlab->justify & NOTBOTTOM) ? "middle" : "bottom"); + Tcl_AppendElement(interp, (tlab->anchor & TOP) ? + "top" : (tlab->anchor & NOTBOTTOM) ? "middle" : "bottom"); + } + else if (bitfield & JUSTIFYRIGHT) { + Tcl_AppendElement(interp, (tlab->anchor & JUSTIFYRIGHT) ? "right" : + (tlab->anchor & TEXTCENTERED) ? "center" : + (tlab->anchor & JUSTIFYBOTH) ? "both" : + "left"); } else { - Tcl_AppendElement(interp, (tlab->justify & bitfield) ? "true" : "false"); + Tcl_AppendElement(interp, (tlab->anchor & bitfield) ? "true" : "false"); } - rval = tlab->justify; + rval = tlab->anchor; } return (rval & bitfield); } /*----------------------------------------------------------------------*/ -/* Set justification (and associated fields) global setting, or apply */ +/* Set anchoring (and associated fields) global setting, or apply */ /* to selected labels. */ /*----------------------------------------------------------------------*/ void -setjustification(short bitfield, short value) +setanchoring(short bitfield, short value) { int i; labelptr tlab; if (areawin->selects == 0) { - areawin->justify &= (~bitfield); - if (value > 0) areawin->justify |= value; + areawin->anchor &= (~bitfield); + if (value > 0) areawin->anchor |= value; return; } for (i = 0; i < areawin->selects; i++) { if (SELECTTYPE(areawin->selectlist + i) != LABEL) continue; tlab = SELTOLABEL(areawin->selectlist + i); if (bitfield == PINVISIBLE && tlab->pin == NORMAL) continue; - tlab->justify &= (~bitfield); - if (value > 0) tlab->justify |= value; + tlab->anchor &= (~bitfield); + if (value > 0) tlab->anchor |= value; } } @@ -3989,7 +4020,7 @@ translateencoding(int psfont) { const char *encValues[] = {"Standard", "special", "ISOLatin1", "ISOLatin2", "ISOLatin3", "ISOLatin4", "ISOLatin5", - "ISOLatin6", NULL}; + "ISOLatin6", "ISO8859-5", NULL}; int i; i = (fonts[psfont].flags & 0xf80) >> 7; @@ -4026,11 +4057,12 @@ int xctcl_label(ClientData clientData, Tcl_Interp *interp, Tcl_Obj *objPtr, *listPtr; labelptr tlab; - static char *subCmds[] = {"make", "type", "insert", "justify", "flipinvariant", - "visible", "font", "scale", "encoding", "style", "family", "substring", - "text", "latex", "list", "replace", "position", NULL}; + static char *subCmds[] = {"make", "type", "insert", "anchor", "justify", + "flipinvariant", "visible", "font", "scale", "encoding", "style", + "family", "substring", "text", "latex", "list", "replace", "position", + NULL}; enum SubIdx { - MakeIdx, TypeIdx, InsertIdx, JustIdx, FlipIdx, VisibleIdx, + MakeIdx, TypeIdx, InsertIdx, AnchorIdx, JustifyIdx, FlipIdx, VisibleIdx, FontIdx, ScaleIdx, EncodingIdx, StyleIdx, FamilyIdx, SubstringIdx, TextIdx, LaTeXIdx, ListIdx, ReplaceIdx, PositionIdx }; @@ -4047,14 +4079,16 @@ int xctcl_label(ClientData clientData, Tcl_Interp *interp, static int pinTypes[] = {NORMAL, NORMAL, LOCAL, LOCAL, GLOBAL, INFO, INFO}; - static char *justValues[] = {"left", "center", "right", "top", "middle", + static char *anchorValues[] = {"left", "center", "right", "top", "middle", "bottom", NULL}; + static char *justifyValues[] = {"left", "center", "right", "both", NULL}; + const char *styValues[] = {"normal", "bold", "italic", "bolditalic", NULL}; const char *encValues[] = {"Standard", "special", "ISOLatin1", "ISOLatin2", "ISOLatin3", "ISOLatin4", "ISOLatin5", - "ISOLatin6", NULL}; + "ISOLatin6", "ISO8859-5", NULL}; /* Tk "label" has been renamed to "tcl_label", but we want to */ /* consider the "label" command to be overloaded, such that the */ @@ -4143,7 +4177,8 @@ int xctcl_label(ClientData clientData, Tcl_Interp *interp, &position)) != TCL_OK) return result; - newlab = new_label(NULL, strptr, idx2, position.x, position.y); + newlab = new_label(NULL, strptr, idx2, position.x, position.y, + (u_char)1); singlebbox((genericptr *)&newlab); objPtr = Tcl_NewHandleObj(newlab); Tcl_SetObjResult(interp, objPtr); @@ -4407,51 +4442,75 @@ int xctcl_label(ClientData clientData, Tcl_Interp *interp, case VisibleIdx: /* Change visibility of pin */ if (objc == nidx + 1) - jval = getjustification(interp, PINVISIBLE); + jval = getanchoring(interp, PINVISIBLE); else { if ((result = Tcl_GetBooleanFromObj(interp, objv[nidx + 1], &value)) != TCL_OK) return result; if (jval != value) - setjustification(PINVISIBLE, (value) ? PINVISIBLE : NORMAL); + setanchoring(PINVISIBLE, (value) ? PINVISIBLE : NORMAL); } break; case FlipIdx: if (objc == nidx + 1) - jval = getjustification(interp, FLIPINV); + jval = getanchoring(interp, FLIPINV); else { if ((result = Tcl_GetBooleanFromObj(interp, objv[nidx + 1], &value)) != TCL_OK) return result; if (jval != value) - setjustification(FLIPINV, (value) ? FLIPINV : NORMAL); + setanchoring(FLIPINV, (value) ? FLIPINV : NORMAL); } break; case LaTeXIdx: if (objc == nidx + 1) - jval = getjustification(interp, LATEXLABEL); + jval = getanchoring(interp, LATEXLABEL); else { if ((result = Tcl_GetBooleanFromObj(interp, objv[nidx + 1], &value)) != TCL_OK) return result; if (jval != value) - setjustification(LATEXLABEL, (value) ? LATEXLABEL : NORMAL); + setanchoring(LATEXLABEL, (value) ? LATEXLABEL : NORMAL); } break; - case JustIdx: + case JustifyIdx: if (objc == nidx + 1) { - jval = getjustification(interp, RIGHT | NOTLEFT); - jval2 = getjustification(interp, TOP | NOTBOTTOM); + jval = getanchoring(interp, JUSTIFYRIGHT | JUSTIFYBOTH | TEXTCENTERED); } else { if (Tcl_GetIndexFromObj(interp, objv[nidx + 1], - (CONST84 char **)justValues, + (CONST84 char **)justifyValues, "justification", 0, &idx2) != TCL_OK) { return TCL_ERROR; } + switch (idx2) { + case 0: value = NORMAL; break; + case 1: value = TEXTCENTERED; break; + case 2: value = JUSTIFYRIGHT; break; + case 3: value = JUSTIFYBOTH; break; + } + jval = getanchoring(interp, JUSTIFYRIGHT | JUSTIFYBOTH | TEXTCENTERED); + if (jval != value) { + setanchoring(JUSTIFYRIGHT | JUSTIFYBOTH | TEXTCENTERED, value); + refresh(NULL, NULL, NULL); + } + } + break; + + case AnchorIdx: + if (objc == nidx + 1) { + jval = getanchoring(interp, RIGHT | NOTLEFT); + jval2 = getanchoring(interp, TOP | NOTBOTTOM); + } + else { + if (Tcl_GetIndexFromObj(interp, objv[nidx + 1], + (CONST84 char **)anchorValues, + "anchoring", 0, &idx2) != TCL_OK) { + return TCL_ERROR; + } switch (idx2) { case 0: value = NORMAL; break; case 1: value = NOTLEFT; break; @@ -4462,16 +4521,16 @@ int xctcl_label(ClientData clientData, Tcl_Interp *interp, } switch (idx2) { case 0: case 1: case 2: - jval = getjustification(interp, RIGHT | NOTLEFT); + jval = getanchoring(interp, RIGHT | NOTLEFT); if (jval != value) { - setjustification(RIGHT | NOTLEFT, value); + setanchoring(RIGHT | NOTLEFT, value); refresh(NULL, NULL, NULL); } break; case 3: case 4: case 5: - jval2 = getjustification(interp, TOP | NOTBOTTOM); + jval2 = getanchoring(interp, TOP | NOTBOTTOM); if (jval2 != value) { - setjustification(TOP | NOTBOTTOM, value); + setanchoring(TOP | NOTBOTTOM, value); refresh(NULL, NULL, NULL); } break; @@ -5274,7 +5333,9 @@ int xctcl_graphic(ClientData clientData, Tcl_Interp *interp, oldscale = gp->scale; gp->scale = (float)dvalue; if (gp->scale != oldscale) { +#ifndef HAVE_CAIRO gp->valid = False; +#endif /* !HAVE_CAIRO */ drawarea(areawin->area, (caddr_t)clientData, (caddr_t)NULL); calcbboxvalues(areawin->topinstance, topobject->plist + *(areawin->selectlist + i)); @@ -6447,13 +6508,14 @@ int xctcl_config(ClientData clientData, Tcl_Interp *interp, /* Give it the same page number and view as the current window */ if (objc == 3) { - XCWindowData *newwin; + XCWindowData *newwin, *savewin; + savewin = areawin; // In case focus callback overwrites areawin. newwin = GUI_init(objc - 2, objv + 2); if (newwin != NULL) { - newwin->page = areawin->page; - newwin->vscale = areawin->vscale; - newwin->pcorner = areawin->pcorner; - newwin->topinstance = areawin->topinstance; + newwin->page = savewin->page; + newwin->vscale = savewin->vscale; + newwin->pcorner = savewin->pcorner; + newwin->topinstance = savewin->topinstance; } else { Tcl_SetResult(interp, "Unable to create new window structure\n", NULL); @@ -6481,6 +6543,10 @@ int xctcl_config(ClientData clientData, Tcl_Interp *interp, objectptr savestack; if (areawin == winptr) break; + else if (areawin == NULL) { + areawin = winptr; + break; + } if ((eventmode == MOVE_MODE || eventmode == COPY_MODE) && winptr->editstack->parts == 0) { locsave = areawin->save; @@ -7006,7 +7072,13 @@ int xctcl_quit(ClientData clientData, Tcl_Interp *interp, return TCL_ERROR; } quit(areawin->area, NULL); - return XcTagCallback(interp, objc, objv); + + if (consoleinterp == interp) + Tcl_Exit(XcTagCallback(interp, objc, objv)); + else + Tcl_Eval(interp, "catch {tkcon eval exit}\n"); + + return TCL_OK; /* Not reached */ } /*----------------------------------------------------------------------*/ @@ -7014,13 +7086,23 @@ int xctcl_quit(ClientData clientData, Tcl_Interp *interp, int xctcl_promptquit(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + int result; + /* quit, with checks */ if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, "(no arguments)"); return TCL_ERROR; } - if (areawin != NULL) - quitcheck(areawin->area, NULL, NULL); + if (areawin != NULL) { + result = quitcheck(areawin->area, NULL, NULL); + if (result == 1) { + /* Immediate exit */ + if (consoleinterp == interp) + Tcl_Exit(XcTagCallback(interp, objc, objv)); + else + Tcl_Eval(interp, "catch {tkcon eval exit}\n"); + } + } return XcTagCallback(interp, objc, objv); } @@ -7034,6 +7116,7 @@ int xctcl_refresh(ClientData clientData, Tcl_Interp *interp, Tcl_WrongNumArgs(interp, 1, objv, "(no arguments)"); return TCL_ERROR; } + areawin->redraw_needed = True; drawarea(areawin->area, (caddr_t)clientData, (caddr_t)NULL); if (areawin->scrollbarh) drawhbar(areawin->scrollbarh, NULL, NULL); @@ -7058,6 +7141,7 @@ int loadlinkfile(objinstptr tinst, char *filename, int target, Boolean do_load) FILE *ps; char file_return[150]; int result; + Boolean fgood; /* Shorthand: "%n" can be used to indicate that the link filename is */ /* the same as the name of the object, minus technology prefix. */ @@ -7085,36 +7169,41 @@ int loadlinkfile(objinstptr tinst, char *filename, int target, Boolean do_load) ps = fileopen(_STR, ".ps", file_return, 149); if (ps != NULL) { + fgood = TRUE; fclose(ps); - for (j = 0; j < xobjs.pages; j++) { - if (xobjs.pagelist[j]->filename == NULL) - continue; - else if (!strcmp(file_return, xobjs.pagelist[j]->filename)) - break; - else if ((strlen(xobjs.pagelist[j]->filename) > 0) && + } + else + fgood = FALSE; + + for (j = 0; j < xobjs.pages; j++) { + if (xobjs.pagelist[j]->filename == NULL) + continue; + else if (!strcmp(file_return, xobjs.pagelist[j]->filename)) + break; + else if ((strlen(xobjs.pagelist[j]->filename) > 0) && !strcmp(file_return + strlen(file_return) - 3, ".ps") && !strncmp(xobjs.pagelist[j]->filename, file_return, strlen(file_return) - 3)) - break; - else if ((xobjs.pagelist[j]->pageinst != NULL) && (tinst->thisobject == + break; + else if ((xobjs.pagelist[j]->pageinst != NULL) && (tinst->thisobject == xobjs.pagelist[j]->pageinst->thisobject->symschem)) - break; - } - if (j < xobjs.pages) { + break; + } + if (j < xobjs.pages) { - /* Duplicate page. Don't load it, but make sure that an association */ - /* exists between the symbol and schematic. */ + /* Duplicate page. Don't load it, but make sure that an association */ + /* exists between the symbol and schematic. */ - if (tinst->thisobject->symschem == NULL) { - tinst->thisobject->symschem = + if (tinst->thisobject->symschem == NULL) { + tinst->thisobject->symschem = xobjs.pagelist[j]->pageinst->thisobject; - if (xobjs.pagelist[j]->pageinst->thisobject->symschem == NULL) + if (xobjs.pagelist[j]->pageinst->thisobject->symschem == NULL) xobjs.pagelist[j]->pageinst->thisobject->symschem = tinst->thisobject; - } - return 0; } + return 0; } - else { + + if (fgood == FALSE) { Fprintf(stderr, "Failed to open dependency \"%s\"\n", _STR); return -1; } @@ -7173,13 +7262,13 @@ int xctcl_page(ClientData clientData, Tcl_Interp *interp, "load", "list", "import", "save", "saveonly", "make", "directory", "reset", "links", "fit", "filename", "label", "scale", "width", "height", "size", "margins", "bbox", "goto", "orientation", - "encapsulation", "handle", "changes", NULL + "encapsulation", "handle", "update", "changes", NULL }; enum SubIdx { LoadIdx, ListIdx, ImportIdx, SaveIdx, SaveOnlyIdx, MakeIdx, DirIdx, ResetIdx, LinksIdx, FitIdx, FileIdx, LabelIdx, ScaleIdx, WidthIdx, HeightIdx, SizeIdx, MarginsIdx, BBoxIdx, GoToIdx, - OrientIdx, EPSIdx, HandleIdx, ChangesIdx + OrientIdx, EPSIdx, HandleIdx, UpdateIdx, ChangesIdx }; char *importTypes[] = {"xcircuit", "postscript", "background", "spice", NULL}; @@ -7568,6 +7657,11 @@ int xctcl_page(ClientData clientData, Tcl_Interp *interp, newpage((short)pageno); break; + case UpdateIdx: + calcbbox(curpage->pageinst); + if (curpage->pmode & 2) autoscale(pageno); + break; + case BBoxIdx: if (((objc - nidx) == 2) || ((objc - nidx) == 3)) { Tcl_Obj *tuple; @@ -8305,7 +8399,7 @@ int xctcl_library(ClientData clientData, Tcl_Interp *interp, { char *filename = NULL, *objname, *argv; int j = 0, libnum = -1; - int idx, nidx, result; + int idx, nidx, result, res; Tcl_Obj *olist; Tcl_Obj **newobjv; int newobjc, hidmode; @@ -8339,8 +8433,10 @@ int xctcl_library(ClientData clientData, Tcl_Interp *interp, lname = xobjs.libtop[libnum + LIBRARY]->thisobject->name; Tcl_SetObjResult(interp, Tcl_NewStringObj(lname, strlen(lname))); } - else + else { + result = TCL_OK; Tcl_SetObjResult(interp, Tcl_NewIntObj(libnum + 1)); + } } else Tcl_SetObjResult(interp, Tcl_NewIntObj(libnum + 1)); @@ -8380,7 +8476,7 @@ int xctcl_library(ClientData clientData, Tcl_Interp *interp, /* if loading of default libraries is not overridden, load them first */ if (!(flags & (LIBOVERRIDE | LIBLOADED))) { - defaultscript(); + result = defaultscript(); flags |= LIBLOADED; } @@ -8413,11 +8509,11 @@ int xctcl_library(ClientData clientData, Tcl_Interp *interp, } strcpy(_STR, filename); - result = loadlibrary(libnum); - if (result == False) { - result = loadfile(2, libnum); + res = loadlibrary(libnum); + if (res == False) { + res = loadfile(2, libnum); TechReplaceRestore(); - if (result == False) { + if (res == False) { Tcl_SetResult(interp, "Error loading library.\n", NULL); return TCL_ERROR; } @@ -8566,7 +8662,7 @@ int xctcl_library(ClientData clientData, Tcl_Interp *interp, return TCL_OK; /* no tag callback */ break; } - return XcTagCallback(interp, objc, objv); + return (result == TCL_OK) ? XcTagCallback(interp, objc, objv) : result; } /*----------------------------------------------------------------------*/ @@ -8719,7 +8815,7 @@ int xctcl_bind(ClientData clientData, Tcl_Interp *interp, Tcl_SetResult(interp, "Key is already bound to a command.\n", NULL); return (result); } - return XcTagCallback(interp, objc, objv); + return (result == TCL_OK) ? XcTagCallback(interp, objc, objv) : result; } /*----------------------------------------------------------------------*/ @@ -8834,10 +8930,11 @@ short execcommand(short pflags, char *cmdptr) /* loading of the startup script) */ /*----------------------------------------------------------------------*/ -void defaultscript() +int defaultscript() { FILE *fd; char *tmp_s = getenv((const char *)"XCIRCUIT_SRC_DIR"); + int result; flags = LIBOVERRIDE | LIBLOADED | FONTOVERRIDE; @@ -8855,7 +8952,8 @@ void defaultscript() } } fclose(fd); - Tcl_EvalFile(xcinterp, _STR2); + result = Tcl_EvalFile(xcinterp, _STR2); + return result; } /*----------------------------------------------------------------------*/ @@ -8927,8 +9025,8 @@ Tcl_Obj *evaluate_raw(objectptr thisobj, oparamptr ops, objinstptr pinst, if ((ips == NULL) && !strncmp(pptr, "p_", 2)) { ips = &temps; if (!strcmp(pptr + 2, "rotation")) { - temps.type = XC_INT; - temps.parameter.ivalue = pinst ? pinst->rotation : 0; + temps.type = XC_FLOAT; + temps.parameter.fvalue = pinst ? pinst->rotation : 0; } else if (!strcmp(pptr + 2, "xposition")) { temps.type = XC_INT; @@ -8955,8 +9053,8 @@ Tcl_Obj *evaluate_raw(objectptr thisobj, oparamptr ops, objinstptr pinst, UTopDrawingOffset(NULL, &temps.parameter.ivalue); } else if (!strcmp(pptr + 2, "top_rotation")) { - temps.type = XC_INT; - temps.parameter.ivalue = UTopRotation(); + temps.type = XC_FLOAT; + temps.parameter.fvalue = UTopRotation(); } else if (!strcmp(pptr + 2, "top_scale")) { temps.type = XC_FLOAT; @@ -9128,11 +9226,12 @@ char *evaluate_expr(objectptr thisobj, oparamptr ops, objinstptr pinst) /* Execute the .xcircuitrc startup script */ /*----------------------------------------------------------------------*/ -void loadrcfile() +int loadrcfile() { char *userdir = getenv((const char *)"HOME"); FILE *fd; short i; + int result, result1 = TCL_OK; /* Initialize flags */ @@ -9167,10 +9266,14 @@ void loadrcfile() } if (fd != NULL) { fclose(fd); - Tcl_EvalFile(xcinterp, _STR2); + result = Tcl_EvalFile(xcinterp, _STR2); + if (result != TCL_OK) { + Fprintf(stderr, "Encountered error in startup file."); + Fprintf(stderr, "%s\n", Tcl_GetStringResult(xcinterp)); + Fprintf(stderr, "Running default startup script instead.\n"); + } } - /* Add the default font if not loaded already */ if (!(flags & FONTOVERRIDE)) { @@ -9188,8 +9291,8 @@ void loadrcfile() /* arrange the loaded libraries */ - if (!(flags & (LIBOVERRIDE | LIBLOADED))) { - defaultscript(); + if ((result != TCL_OK) || !(flags & (LIBOVERRIDE | LIBLOADED))) { + result1 = defaultscript(); } /* Add the default colors */ @@ -9214,14 +9317,16 @@ void loadrcfile() /* These colors must be enabled whether or not colors are overridden, */ /* because they are needed by the schematic capture system. */ - addnewcolorentry(xc_getlayoutcolor(LOCALPINCOLOR)); - addnewcolorentry(xc_getlayoutcolor(GLOBALPINCOLOR)); - addnewcolorentry(xc_getlayoutcolor(INFOLABELCOLOR)); - addnewcolorentry(xc_getlayoutcolor(RATSNESTCOLOR)); - addnewcolorentry(xc_getlayoutcolor(BBOXCOLOR)); + // addnewcolorentry(xc_getlayoutcolor(LOCALPINCOLOR)); + // addnewcolorentry(xc_getlayoutcolor(GLOBALPINCOLOR)); + // addnewcolorentry(xc_getlayoutcolor(INFOLABELCOLOR)); + // addnewcolorentry(xc_getlayoutcolor(RATSNESTCOLOR)); + // addnewcolorentry(xc_getlayoutcolor(BBOXCOLOR)); - if (!(flags & KEYOVERRIDE)) + if ((result != TCL_OK) || !(flags & KEYOVERRIDE)) { default_keybindings(); + } + return (result1 != TCL_OK) ? result1 : result; } /*----------------------------------------------------------------------*/ @@ -9346,7 +9451,8 @@ int xctcl_action(ClientData clientData, void xctk_drawarea(ClientData clientData, XEvent *eventPtr) { Tcl_ServiceAll(); - drawarea(areawin->area, (caddr_t)clientData, (caddr_t)NULL); + if (areawin->topinstance != NULL) + drawarea(areawin->area, (caddr_t)clientData, (caddr_t)NULL); } /*----------------------------------------------------------------------*/ @@ -9385,28 +9491,32 @@ void xctk_panvbar(ClientData clientData, XEvent *eventPtr) void xctk_drawhbar(ClientData clientData, XEvent *eventPtr) { - drawhbar(areawin->scrollbarh, (caddr_t)clientData, (caddr_t)NULL); + if (areawin->topinstance) + drawhbar(areawin->scrollbarh, (caddr_t)clientData, (caddr_t)NULL); } /*----------------------------------------------------------------------*/ void xctk_drawvbar(ClientData clientData, XEvent *eventPtr) { - drawvbar(areawin->scrollbarv, (caddr_t)clientData, (caddr_t)NULL); + if (areawin->topinstance) + drawvbar(areawin->scrollbarv, (caddr_t)clientData, (caddr_t)NULL); } /*----------------------------------------------------------------------*/ void xctk_endhbar(ClientData clientData, XEvent *eventPtr) { - endhbar(areawin->scrollbarh, (caddr_t)clientData, (XButtonEvent *)eventPtr); + if (areawin->topinstance) + endhbar(areawin->scrollbarh, (caddr_t)clientData, (XButtonEvent *)eventPtr); } /*----------------------------------------------------------------------*/ void xctk_endvbar(ClientData clientData, XEvent *eventPtr) { - endvbar(areawin->scrollbarv, (caddr_t)clientData, (XButtonEvent *)eventPtr); + if (areawin->topinstance) + endvbar(areawin->scrollbarv, (caddr_t)clientData, (XButtonEvent *)eventPtr); } /*----------------------------------------------------------------------*/ @@ -9431,6 +9541,10 @@ void xctk_drag(ClientData clientData, XEvent *eventPtr) drag((int)b_event->x, (int)b_event->y); flusharea(); +#ifdef HAVE_CAIRO + if (areawin->redraw_needed) + drawarea(NULL, NULL, NULL); +#endif /* HAVE_CAIRO */ } /*----------------------------------------------------------------------*/ @@ -9662,7 +9776,7 @@ XCWindowData *GUI_init(int objc, Tcl_Obj *CONST objv[]) { Tk_Window tkwind, tktop, tkdraw, tksb; Tk_Window wsymb, wschema, corner; - int i, locobjc; + int i, locobjc, done = 1; XGCValues values; Window win; popupstruct *fileliststruct; @@ -9670,13 +9784,6 @@ XCWindowData *GUI_init(int objc, Tcl_Obj *CONST objv[]) char winpath[512]; XCWindowData *newwin; -#ifdef OPENGL - int attributeList[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; - GLfloat params[2]; - GLenum errnum; - int n; -#endif - tktop = Tk_MainWindow(xcinterp); if (tktop == (Tk_Window)NULL) { Fprintf(stderr, "No Top-Level Tk window available. . .\n"); @@ -9786,26 +9893,41 @@ XCWindowData *GUI_init(int objc, Tcl_Obj *CONST objv[]) (Tk_EventProc *)xctk_swapschem, Number(0)); Tk_CreateEventHandler(wschema, ButtonPressMask, (Tk_EventProc *)xctk_swapschem, Number(0)); - } - /* Setup event handlers for the drawing area and scrollbars */ - /* There are purposely no callback functions for these windows---they are */ - /* defined as type "simple" to keep down the cruft, as I will define my own */ - /* event handlers. */ + /* Setup event handlers for the drawing area and scrollbars */ + /* There are purposely no callback functions for these windows---they are */ + /* defined as type "simple" to keep down the cruft, as I will define my */ + /* own event handlers. */ - if (locobjc > 0) { Tk_CreateEventHandler(newwin->area, StructureNotifyMask, (Tk_EventProc *)xctk_resizearea, NULL); Tk_CreateEventHandler(newwin->area, ExposureMask, (Tk_EventProc *)xctk_drawarea, NULL); } + if ((locobjc > 0) || !Tk_IsMapped(newwin->area)) { + + /* This code copied from code for the "tkwait" command */ + + Tk_CreateEventHandler(newwin->area, + VisibilityChangeMask|StructureNotifyMask, + WaitVisibilityProc, (ClientData) &done); + done = 0; + } + /* Make sure the window is mapped */ Tk_MapWindow(tkwind); win = Tk_WindowId(tkwind); - Tk_MapWindow(newwin->area); + + if (!done) { + while (!done) Tcl_DoOneEvent(0); + Tk_DeleteEventHandler(newwin->area, + VisibilityChangeMask|StructureNotifyMask, + WaitVisibilityProc, (ClientData) &done); + } + newwin->window = Tk_WindowId(newwin->area); newwin->width = Tk_Width(newwin->area); newwin->height = Tk_Height(newwin->area); @@ -9830,9 +9952,8 @@ XCWindowData *GUI_init(int objc, Tcl_Obj *CONST objv[]) /* Allocate space for the basic color map */ /*----------------------------------------*/ - number_colors = 0; - colorlist = (colorindex *)malloc(sizeof(colorindex)); - appcolors = (int *) malloc(NUMBER_OF_COLORS * sizeof(int)); + number_colors = NUMBER_OF_COLORS; + colorlist = (colorindex *)malloc(NUMBER_OF_COLORS * sizeof(colorindex)); areawin = newwin; build_app_database(tkwind); areawin = NULL; @@ -9867,37 +9988,6 @@ XCWindowData *GUI_init(int objc, Tcl_Obj *CONST objv[]) Tk_CreateEventHandler(tkdraw, LeaveWindowMask, (Tk_EventProc *)xctk_endfiletrack, (ClientData)tkdraw); } - - /* OpenGL setup */ - -#ifdef OPENGL - grVisualInfo = glXChooseVisual(dpy, DefaultScreen(dpy), attributeList); - grXcontext = glXCreateContext(dpy, grVisualInfo, NULL, GL_FALSE); - - glLineWidth(1.0); - glShadeModel(GL_FLAT); - glPixelStorei(GL_PACK_LSB_FIRST, TRUE); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - - /* Check OpenGL line and point size limits. */ - /* Note that one has to do glXMakeCurrent() for the values */ - /* returned by glGet*() to be meaningful! */ - - glXMakeCurrent(dpy, (GLXDrawable)win, grXcontext); - params[0] = params[1] = 0.0; - glGetFloatv(GL_LINE_WIDTH_RANGE, (GLfloat *)params); - errnum = glGetError(); - if (errnum != GL_NO_ERROR) Fprintf(stdout, "Error %d\n", errnum); - gl_line_limit = (float)params[1]; - Fprintf(stdout, "line limits: %g and %g\n", (float)params[0], gl_line_limit); - /* glGetFloatv(GL_POINT_SIZE_RANGE, params); */ - glGetFloatv(GL_POINT_SIZE_RANGE, (GLfloat *)params); - gl_point_limit = (float)params[1]; - Fprintf(stdout, "point limits: %g and %g\n", (float)params[0], gl_point_limit); - -#endif /* OPENGL */ } /*-------------------------------------------------------------------*/ @@ -9914,6 +10004,11 @@ XCWindowData *GUI_init(int objc, Tcl_Obj *CONST objv[]) newwin->gc = XCreateGC(dpy, win, GCForeground | GCBackground | GCGraphicsExposures, &values); +#ifdef HAVE_CAIRO + newwin->surface = cairo_xlib_surface_create(dpy, newwin->window, + DefaultVisual(dpy, 0), newwin->width, newwin->height); + newwin->cr = cairo_create(newwin->surface); +#else /* HAVE_CAIRO */ newwin->clipmask = XCreatePixmap(dpy, win, newwin->width, newwin->height, 1); @@ -9921,6 +10016,7 @@ XCWindowData *GUI_init(int objc, Tcl_Obj *CONST objv[]) values.background = 0; newwin->cmgc = XCreateGC(dpy, newwin->clipmask, GCForeground | GCBackground, &values); +#endif /* HAVE_CAIRO */ XDefineCursor (dpy, win, *newwin->defaultcursor); return newwin; @@ -9953,9 +10049,7 @@ int xctcl_start(ClientData clientData, Tcl_Interp *interp, } post_initialize(); -#ifndef OPENGL ghostinit(); -#endif /* The Tcl version accepts some command-line arguments. Due */ /* to the way ".wishrc" is processed, all arguments are */ @@ -10000,19 +10094,19 @@ int xctcl_start(ClientData clientData, Tcl_Interp *interp, for (argc = 0; argc < objc; argc++) { argv = Tcl_GetString(objv[argc]); - if (*argv == '-') { + if (*argv == '-') { if (!strncmp(argv, "-exec", 5)) { if (++argc < objc) { argv = Tcl_GetString(objv[argc]); - result = Tcl_EvalFile(interp, argv); - if (result != TCL_OK) + result = Tcl_EvalFile(interp, argv); + if (result != TCL_OK) return result; - else + else rcoverride = True; } else { - Tcl_SetResult(interp, "No filename given to exec argument.", NULL); - return TCL_ERROR; + Tcl_SetResult(interp, "No filename given to exec argument.", NULL); + return TCL_ERROR; } } else if (!strncmp(argv, "-2", 2)) { @@ -10024,7 +10118,8 @@ int xctcl_start(ClientData clientData, Tcl_Interp *interp, } } - if (!rcoverride) loadrcfile(); + if (!rcoverride) + result = loadrcfile(); composelib(PAGELIB); /* make sure we have a valid page list */ composelib(LIBLIB); /* and library directory */ @@ -10057,7 +10152,7 @@ int xctcl_start(ClientData clientData, Tcl_Interp *interp, drawarea(areawin->area, NULL, NULL); /* Return back to the interpreter; Tk is handling the GUI */ - return XcTagCallback(interp, 1, &cmdname); + return (result == TCL_OK) ? XcTagCallback(interp, 1, &cmdname) : result; } /*--------------------------------------------------------------*/ diff --git a/text.c b/text.c index 078a92e..282ebd9 100644 --- a/text.c +++ b/text.c @@ -37,12 +37,14 @@ extern XCWindowData *areawin; extern Globaldata xobjs; extern short fontcount; extern fontinfo *fonts; -extern int *appcolors; extern colorindex *colorlist; extern char _STR[150]; +#ifdef HAVE_CAIRO +extern const char *utf8encodings[][256]; +#endif /* Global value of distance between characters in the font catalog */ -short del; +short del = 64; #ifndef TCL_WRAPPER @@ -57,6 +59,9 @@ short del; char *evaluate_expr(objectptr thisobj, oparamptr ops, objinstptr pinst) { + UNUSED(thisobj); + UNUSED(pinst); + if (ops->type != XC_EXPR) return NULL; return strdup(ops->parameter.expr); } @@ -95,8 +100,7 @@ void joinlabels() return; } - XcSetFunction(GXcopy); - XSetForeground(dpy, areawin->gc, BACKGROUND); + SetForeground(dpy, areawin->gc, BACKGROUND); for (jl = areawin->selectlist; jl < areawin->selectlist + areawin->selects; jl++) { @@ -121,7 +125,7 @@ void joinlabels() } } - XSetForeground(dpy, areawin->gc, dest->color); + SetForeground(dpy, areawin->gc, dest->color); UDrawString(dest, dest->color, areawin->topinstance); incr_changes(topobject); @@ -285,6 +289,9 @@ stringpart *deletestring0(stringpart *dstr, stringpart **strtop, objinstptr this case XC_STRING: ops->parameter.string = dstr->nextpart; break; + case XC_EXPR: + /* Deleting an expression result can only be bad. */ + return NULL; default: /* What to be done here? */ break; @@ -570,7 +577,7 @@ void charprint(char *sout, stringpart *strptr, int locpos) switch (strptr->type) { case TEXT_STRING: if (strptr->data.string) { - if (locpos > strlen(strptr->data.string)) { + if (locpos > (int) strlen(strptr->data.string)) { strcpy(sout, ""); } else sc = *(strptr->data.string + locpos); @@ -613,7 +620,7 @@ void charprinttex(char *sout, stringpart *strptr, int locpos) switch (strptr->type) { case TEXT_STRING: if (strptr->data.string) { - if (locpos > strlen(strptr->data.string)) { + if (locpos > (int) strlen(strptr->data.string)) { strcpy(sout, ""); } else sc = *(strptr->data.string + locpos); @@ -760,6 +767,7 @@ char *textprintnet(char *prefix, char *pinstring, Genericlist *sublist) char *newstr, *sptr; buslist *sbus; int i; + UNUSED(pinstring); if (sublist->subnets == 0) { newstr = (char *)malloc(strlen(prefix) + 10); @@ -799,7 +807,8 @@ int textcompx(stringpart *string, char *text, Boolean exact, objinstptr localins stringpart *strptr; char *tptr = text; char *sptr; - int rval, llen = strlen(text), slen; + int rval; + size_t llen = strlen(text), slen; Boolean has_text = FALSE; for (strptr = string; strptr != NULL; strptr = nextstringpart(strptr, localinst)) { @@ -1002,7 +1011,7 @@ Genericlist *break_up_bus(labelptr blab, objinstptr thisinst, Genericlist *netli static Genericlist *subnets = NULL; char *tptr; buslist *sbus, *jbus; - int bpos, istart, iend, tlen, i, j, netstart, matched; + int istart, iend, i, j, netstart, matched; char *buspos, *busend, *busptr; if (pin_is_bus(blab, thisinst) == FALSE) return NULL; @@ -1014,7 +1023,6 @@ Genericlist *break_up_bus(labelptr blab, objinstptr thisinst, Genericlist *netli subnets->subnets = 0; tptr = textprint(blab->string, thisinst); - tlen = strlen(tptr) + 1; buspos = strchr(tptr, areawin->buschar); /* The notation "(...)" with NO TEXT preceding the opening bus */ @@ -1029,7 +1037,6 @@ Genericlist *break_up_bus(labelptr blab, objinstptr thisinst, Genericlist *netli netstart = (netlist->subnets == 0) ? netlist->net.id : 0; - bpos = (int)(buspos - tptr); busend = find_delimiter(buspos); if (busend == NULL) { @@ -1154,7 +1161,7 @@ int stringcomprelaxed(stringpart *string1, stringpart *string2, buspos = strchr(strptr1->data.string, matchchar); if (buspos != NULL) { bpos = (int)(buspos - (char *)(strptr1->data.string)); - if (strlen(strptr2->data.string) > bpos) { + if ((int) strlen(strptr2->data.string) > bpos) { if (!strcmp(strptr1->data.string + bpos, strptr2->data.string + bpos)) { in_bus = 2; @@ -1403,12 +1410,13 @@ stringpart *stringcopyback(stringpart *string, objinstptr thisinst) /* draw a single character at 0, 0 using current transformation matrix */ /*---------------------------------------------------------------------*/ -short UDrawChar(u_char code, short styles, short ffont, int groupheight, +#ifndef HAVE_CAIRO +static float UDrawChar(u_char code, short styles, short ffont, int groupheight, int passcolor, float passwidth) { objectptr drawchar; XPoint alphapts[2]; - short localwidth; + float localwidth; objinst charinst; if ((ffont >= fontcount) || (fonts[ffont].encoding == NULL)) @@ -1418,7 +1426,7 @@ short UDrawChar(u_char code, short styles, short ffont, int groupheight, alphapts[0].y = 0; charinst.type = OBJINST; charinst.color = DEFAULTCOLOR; - charinst.rotation = 0; + charinst.rotation = 0.0; charinst.scale = fonts[ffont].scale; charinst.position = alphapts[0]; charinst.params = NULL; @@ -1428,7 +1436,8 @@ short UDrawChar(u_char code, short styles, short ffont, int groupheight, drawchar = fonts[ffont].encoding[(u_char)code]; charinst.thisobject = drawchar; - localwidth = (drawchar->bbox.lowerleft.x + drawchar->bbox.width) * fonts[ffont].scale; + localwidth = (drawchar->bbox.lowerleft.x + drawchar->bbox.width) + * fonts[ffont].scale; if ((fonts[ffont].flags & 0x22) == 0x22) { /* font is derived and italic */ USlantCTM(DCTM, 0.25); /* premultiply by slanting function */ @@ -1450,6 +1459,33 @@ short UDrawChar(u_char code, short styles, short ffont, int groupheight, } return localwidth; } +#endif /* !HAVE_CAIRO */ + +/*---------------------------------------------------------------------*/ +/* Draw a string at position offset, starting at the start index and */ +/* ending before the end index. The offset is updated on return. */ +/*---------------------------------------------------------------------*/ + +#ifndef HAVE_CAIRO +void UDrawCharString(u_char *text, int start, int end, XfPoint *offset, + short styles, short ffont, int groupheight, int passcolor, float tmpscale) +{ + int idx; + + float tmpthick = ((fonts[ffont].flags & 0x21) == 0x21) ? 4.0 : 2.0; + for (idx = start; idx < end; idx++) + { + XPoint p; + p.x = offset->x; + p.y = offset->y; + UPushCTM(); + UPreMultCTM(DCTM, p, tmpscale, 0); + offset->x += UDrawChar(text[idx], styles, ffont, groupheight, passcolor, + tmpthick) * tmpscale; + UPopCTM(); + } +} +#endif /* !HAVE_CAIRO */ /*----------------------------------------------------------------------*/ /* Draw an entire string, including parameter substitutions */ @@ -1460,18 +1496,30 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, Boolean drawX) { stringpart *strptr; - char *textptr; - short fstyle, ffont, tmpjust, baseline; + u_char *textptr; + short fstyle, ffont, tmpanchor; + float baseline; int pos, group = 0; int defaultcolor, curcolor, scolor; - short oldx, oldfont, oldstyle; - float tmpscale = 1.0, natscale = 1.0, tmpthick = 2.0; - XPoint newpoint, bboxin[2], bboxout[2]; + float oldx; + short oldfont, oldstyle; + float tmpscale = 1.0, natscale = 1.0; + XfPoint newpoint; + XPoint bboxin[2], bboxout[2]; u_char xm, ym; TextExtents tmpext; + TextLinesInfo tlinfo; short *tabstops = NULL; short tabno, numtabs = 0; - int marginstop = 0; + short linenum = 0; +#ifdef HAVE_CAIRO + cairo_matrix_t fm = {40., 0., 0., -40., 0., 0.}; /* TODO: Why 40? */ + + if (!areawin->redraw_ongoing) { + areawin->redraw_needed = True; + return; + } +#endif /* HAVE_CAIRO */ if (fontcount == 0) return; @@ -1498,24 +1546,33 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, UPushCTM(); UPreMultCTM(DCTM, drawlabel->position, drawlabel->scale, drawlabel->rotation); - /* check for flip invariance; recompute CTM and justification if necessary */ + /* check for flip invariance; recompute CTM and anchoring if necessary */ + + tmpanchor = flipadjust(drawlabel->anchor); - tmpjust = flipadjust(drawlabel->justify); + tlinfo.dostop = 0; + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; /* "natural" (unscaled) length */ - tmpext = ULength(drawlabel, localinst, 0, NULL); + tmpext = ULength(drawlabel, localinst, &tlinfo); - newpoint.x = (tmpjust & NOTLEFT ? - (tmpjust & RIGHT ? -tmpext.maxwidth : -tmpext.maxwidth >> 1) : 0); - newpoint.y = (tmpjust & NOTBOTTOM ? - (tmpjust & TOP ? -tmpext.ascent : -(tmpext.ascent + tmpext.base) >> 1) + newpoint.x = (tmpanchor & NOTLEFT ? + (tmpanchor & RIGHT ? -tmpext.maxwidth : -tmpext.maxwidth >> 1) : 0); + newpoint.y = (tmpanchor & NOTBOTTOM ? + (tmpanchor & TOP ? -tmpext.ascent : -(tmpext.ascent + tmpext.base) >> 1) : -tmpext.base); /* Pinlabels have an additional offset spacing to pad */ /* them from the circuit point to which they attach. */ if (drawlabel->pin) { - pinadjust(tmpjust, &(newpoint.x), &(newpoint.y), 1); + XPoint p; + p.x = newpoint.x; + p.y = newpoint.y; + pinadjust(tmpanchor, &p.x, &p.y, 1); + newpoint.x = p.x; + newpoint.y = p.y; } oldx = newpoint.x; @@ -1525,7 +1582,7 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, bboxin[0].x = newpoint.x; bboxin[0].y = newpoint.y + tmpext.descent; - bboxin[1].x = newpoint.x + tmpext.width; + bboxin[1].x = newpoint.x + tmpext.maxwidth; bboxin[1].y = newpoint.y + tmpext.ascent; UTransformbyCTM(DCTM, bboxin, bboxout, 2); xm = (bboxout[0].x < bboxout[1].x) ? 0 : 1; @@ -1535,6 +1592,18 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, bboxout[1 - xm].x > 0 && bboxout[1 - ym].y > 0) { pos = 0; + + /* At the beginning of the line, add offsets for right or center */ + /* justification, if required. */ + + if (tlinfo.padding != NULL) { + if (tmpanchor & JUSTIFYRIGHT) + newpoint.x += tlinfo.padding[linenum]; + else if (tmpanchor & TEXTCENTERED) + newpoint.x += 0.5 * tlinfo.padding[linenum]; + linenum++; + } + for (strptr = drawlabel->string; strptr != NULL; strptr = nextstringpart(strptr, localinst)) { @@ -1556,16 +1625,16 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, oldstyle = fstyle; } } - - /* simple boldface technique for derived fonts */ - - tmpthick = ((fonts[ffont].flags & 0x21) == 0x21) ? 4.0 : 2.0; +#ifdef HAVE_CAIRO + cairo_set_font_face(areawin->cr, fonts[ffont].font_face); + cairo_set_font_matrix(areawin->cr, &fm); +#endif /* HAVE_CAIRO */ break; case FONT_SCALE: tmpscale = natscale * strptr->data.scale; - // if (baseline == newpoint.y) /* reset top-level scale */ - // natscale = tmpscale; + /* if (baseline == newpoint.y) */ /* reset top-level scale */ + /* natscale = tmpscale; */ break; case KERN: @@ -1575,8 +1644,12 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, case FONT_COLOR: if (defaultcolor != DOFORALL) { - if (strptr->data.color != DEFAULTCOLOR) - curcolor = colorlist[strptr->data.color].color.pixel; + if (strptr->data.color != DEFAULTCOLOR) { + curcolor = strptr->data.color; +#ifdef HAVE_CAIRO + XTopSetForeground(curcolor); +#endif + } else { if (curcolor != DEFAULTCOLOR) { XTopSetForeground(defaultcolor); @@ -1616,8 +1689,16 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, baseline -= BASELINE; newpoint.y = baseline; newpoint.x = oldx; + + if (tlinfo.padding != NULL) { + if (tmpanchor & JUSTIFYRIGHT) + newpoint.x += tlinfo.padding[linenum]; + else if (tmpanchor & TEXTCENTERED) + newpoint.x += 0.5 * tlinfo.padding[linenum]; + linenum++; + } break; - + case SUBSCRIPT: natscale *= SUBSCALE; tmpscale = natscale; @@ -1635,6 +1716,10 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, ffont = oldfont; /* revert to top-level font and style */ fstyle = oldstyle; newpoint.y = baseline; +#ifdef HAVE_CAIRO + cairo_set_font_face(areawin->cr, fonts[oldfont].font_face); + cairo_set_font_matrix(areawin->cr, &fm); +#endif /* HAVE_CAIRO */ break; case UNDERLINE: @@ -1643,15 +1728,19 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, case OVERLINE: if (strptr->nextpart != NULL && strptr->nextpart->type == TEXT_STRING) { - objectptr charptr; int tmpheight; group = 0; for (textptr = strptr->nextpart->data.string; textptr && *textptr != '\0'; textptr++) { +#ifdef HAVE_CAIRO + tmpheight = fonts[ffont].glyph_top[*textptr]; +#else /* HAVE_CAIRO */ + objectptr charptr; charptr = fonts[ffont].encoding[*(u_char *)textptr]; tmpheight = (int)((float)charptr->bbox.height * fonts[ffont].scale); +#endif /* HAVE_CAIRO */ if (group < tmpheight) group = tmpheight; } fstyle |= 16; @@ -1661,15 +1750,28 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, case NOLINE: break; +#ifdef HAVE_CAIRO + case HALFSPACE: + newpoint.x += fonts[ffont].glyph_advance[' '] * tmpscale / 2.; + break; + + case QTRSPACE: + newpoint.x += fonts[ffont].glyph_advance[' '] * tmpscale / 4.; + break; +#else /* HAVE_CAIRO */ case HALFSPACE: case QTRSPACE: { + XPoint p; short addx; + p.x = newpoint.x; + p.y = newpoint.y; UPushCTM(); - UPreMultCTM(DCTM, newpoint, tmpscale, 0); + UPreMultCTM(DCTM, p, tmpscale, 0); addx = UDrawChar((u_char)32, fstyle, ffont, group, - curcolor, tmpthick); + curcolor, 2.); newpoint.x += addx >> ((strptr->type == HALFSPACE) ? 1 : 2); UPopCTM(); } break; +#endif /* HAVE_CAIRO */ case TEXT_STRING: textptr = strptr->data.string; @@ -1687,28 +1789,35 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, } } - for (; textptr && *textptr != '\0'; textptr++) { - pos++; - UPushCTM(); - UPreMultCTM(DCTM, newpoint, tmpscale, 0); - - /* Special case of selection: only substring is */ - /* drawn in the selection color. */ - - scolor = curcolor; - if (passcolor == DOSUBSTRING) { - if (pos <= areawin->textpos && pos > areawin->textend) - scolor = SELECTCOLOR; - else if (pos > areawin->textpos) { - XTopSetForeground(curcolor); - } - } - newpoint.x += UDrawChar(*textptr, fstyle, ffont, - group, scolor, tmpthick) * tmpscale; - - UPopCTM(); + scolor = curcolor; + if (passcolor == DOSUBSTRING) { + int len = strlen(textptr); + int begin_sel = min(max(0, areawin->textend - pos), len); + int end_sel = min(max(0, areawin->textpos - pos), len); + if (begin_sel > 0) { + UDrawCharString(textptr, 0, begin_sel, &newpoint, fstyle, + ffont, group, scolor, tmpscale); + } + if (begin_sel < end_sel) { + scolor = SELECTCOLOR; +#ifdef HAVE_CAIRO + XTopSetForeground(scolor); +#endif /* HAVE_CAIRO */ + UDrawCharString(textptr, begin_sel, end_sel, &newpoint, + fstyle, ffont, group, scolor, tmpscale); + } + if (end_sel < len) { + scolor = curcolor; + XTopSetForeground(curcolor); + UDrawCharString(textptr, end_sel, len, &newpoint, fstyle, + ffont, group, scolor, tmpscale); + } } - pos--; + else { + UDrawCharString(textptr, 0, strlen(textptr), + &newpoint, fstyle, ffont, group, scolor, tmpscale); + } + pos += strlen(textptr) - 1; break; } pos++; @@ -1718,6 +1827,7 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, /* enddraw: (jdk) */ if (tabstops != NULL) free(tabstops); + if (tlinfo.padding != NULL) free(tlinfo.padding); /* Pop the string transformation matrix */ @@ -1725,7 +1835,8 @@ void UDrawString0(labelptr drawlabel, int passcolor, objinstptr localinst, if (drawX && drawlabel->pin) UDrawXDown(drawlabel); - if ((defaultcolor != DOFORALL) && (passcolor != curcolor)) { + if ((defaultcolor != DOFORALL) && (passcolor != curcolor) && + (passcolor != DOSUBSTRING)) { XTopSetForeground(passcolor); } } @@ -1750,23 +1861,49 @@ void UDrawStringNoX(labelptr drawlabel, int passcolor, objinstptr localinst) /*----------------------------------------------------------------------*/ /* Compute the actual length of a string or portion thereof. */ +/* */ +/* The third argument is a pointer to a structure TextLinesInfo, having */ +/* fields "dostop", "tbreak", and "padding". The third argument may */ +/* be NULL, in which case dostop defaults to 0 and tbreak and */ +/* padding default to NULL. */ +/* */ +/* If "dostop" is non-zero, ULength computes the length to a specific */ +/* location in the string. */ +/* If "padding" is non-NULL, it is a pointer to an array to be */ +/* allocated and filled in with the individual padding lengths. If */ +/* the array is already allocated, then it is assumed to contain valid */ +/* linewidth information from a previous call to ULength(). */ +/* If "tbreak" is non-NULL, it is a pointer to an XPoint, and the */ +/* return TextExtents record "width" will be filled in with the index */ +/* position in the string that is closest to that point. */ +/* When using either "dostop" or "tbreak", the line number stopped on */ +/* is returned in TextLinesInfo field "line". When using "tbreak", the */ +/* position index is returned in "dostop". */ /*----------------------------------------------------------------------*/ TextExtents ULength(labelptr drawlabel, objinstptr localinst, - short dostop, XPoint *tbreak) + TextLinesInfo *tlinfo) { + short dostop; + XPoint tbreak; + float oldscale, strscale, natscale, locscale = 1.0, xtotal = 0.5; float lasttotal = xtotal; stringpart *strptr; u_char *textptr; - objectptr *somebet = NULL, chptr; + objectptr *somebet = NULL; short locpos = 0, lastpos = 0; float ykern = 0.0; TextExtents retext; short *tabstops = NULL; short tabno, numtabs = 0; - int marginstop = 0; + short linenum = 0; Boolean dobreak = FALSE; +#ifdef HAVE_CAIRO + fontinfo *font = NULL; +#endif /* HAVE_CAIRO */ + + dostop = (tlinfo == NULL) ? 0 : tlinfo->dostop; retext.ascent = retext.descent = retext.base = 0; retext.width = retext.maxwidth = 0; @@ -1776,8 +1913,18 @@ TextExtents ULength(labelptr drawlabel, objinstptr localinst, /* Don't draw temporary labels from schematic capture system */ else if (drawlabel->string->type != FONT_NAME) return retext; + /* Copy tbreak point locally */ + if ((tlinfo != NULL) && (tlinfo->tbreak != NULL)) tbreak = *tlinfo->tbreak; + + /* Adjust tbreak x value for justification */ + if ((tlinfo != NULL) && (tlinfo->padding != NULL)) { + if (drawlabel->anchor & JUSTIFYRIGHT) + tbreak.x -= tlinfo->padding[linenum]; + else if (drawlabel->anchor & TEXTCENTERED) + tbreak.x -= 0.5 * tlinfo->padding[linenum]; + } + natscale = 1.0; - oldscale = strscale = natscale; for (strptr = drawlabel->string; strptr != NULL; @@ -1798,24 +1945,57 @@ TextExtents ULength(labelptr drawlabel, objinstptr localinst, ykern = 0.0; break; case RETURN: + if (tlinfo != NULL) { + if (tlinfo->padding == NULL) { + stringpart *nextret = strptr; + int numlines = 2; + while ((nextret = nextstringpart(nextret, localinst)) != NULL) + if (nextret->type == RETURN) + numlines++; + tlinfo->padding = (float *)malloc(numlines * sizeof(float)); + } + if (tlinfo->padding != NULL) + tlinfo->padding[linenum++] = xtotal; + } natscale = strscale = oldscale; ykern = 0.0; retext.base -= BASELINE; - retext.maxwidth = max(retext.width, xtotal); + retext.maxwidth = max(retext.width, retext.maxwidth); + retext.maxwidth = max(retext.maxwidth, xtotal); xtotal = 0.5; + + /* Re-copy tbreak point locally */ + if ((tlinfo != NULL) && (tlinfo->tbreak != NULL)) + tbreak = *tlinfo->tbreak; + + /* Adjust tbreak x value for justification on next line */ + if ((tlinfo != NULL) && (tlinfo->padding != NULL)) { + if (drawlabel->anchor & JUSTIFYRIGHT) + tbreak.x -= tlinfo->padding[linenum]; + else if (drawlabel->anchor & TEXTCENTERED) + tbreak.x -= 0.5 * tlinfo->padding[linenum]; + } break; case HALFSPACE: if (somebet) { - chptr = (*(somebet + 32)); +#ifdef HAVE_CAIRO + xtotal += font->glyph_advance[' '] * locscale * strscale / 2.; +#else /* HAVE_CAIRO */ + objectptr chptr = (*(somebet + 32)); xtotal += (float)(chptr->bbox.width + chptr->bbox.lowerleft.x) - * locscale * natscale / 2; + * locscale * natscale / 2.; +#endif /* HAVE_CAIRO */ } break; case QTRSPACE: if (somebet) { - chptr = (*(somebet + 32)); - xtotal += (float)(chptr->bbox.width + chptr->bbox.lowerleft.x) - * locscale * natscale / 4; +#ifdef HAVE_CAIRO + xtotal += font->glyph_advance[' '] * locscale * strscale / 4.; +#else /* HAVE_CAIRO */ + objectptr chptr = (*(somebet + 32)); + xtotal += (float)(chptr->bbox.width + chptr->bbox.lowerleft.x) + * locscale * natscale / 4.; +#endif /* HAVE_CAIRO */ } break; case TABBACKWARD: /* find first tab value with x < xtotal */ @@ -1842,8 +2022,8 @@ TextExtents ULength(labelptr drawlabel, objinstptr localinst, break; case FONT_SCALE: strscale = natscale * strptr->data.scale; - if (ykern == 0.0) - natscale = strscale; + /* if (ykern == 0.0) */ + /* natscale = strscale; */ break; case KERN: xtotal += strptr->data.kern[0]; @@ -1855,6 +2035,9 @@ TextExtents ULength(labelptr drawlabel, objinstptr localinst, locscale = fonts[strptr->data.font].scale; if (ykern == 0.0) natscale = locscale; +#ifdef HAVE_CAIRO + font = fonts + strptr->data.font; +#endif /* HAVE_CAIRO */ } break; case TEXT_STRING: @@ -1876,46 +2059,75 @@ TextExtents ULength(labelptr drawlabel, objinstptr localinst, if (somebet == NULL) break; for (; textptr && *textptr != '\0'; textptr++) { + float advance, top, bottom; if (dostop && (locpos >= dostop)) break; locpos++; - chptr = (*(somebet + *textptr)); - xtotal += (float)(chptr->bbox.width + chptr->bbox.lowerleft.x) - * locscale * strscale; - retext.ascent = max(retext.ascent, (short)(retext.base + ykern + - (float)((chptr->bbox.height + chptr->bbox.lowerleft.y) - * locscale * strscale))); - retext.descent = min(retext.descent, (short)(retext.base + ykern + - (float)(chptr->bbox.lowerleft.y * locscale * strscale))); - - if (tbreak != NULL) - if ((xtotal > tbreak->x) && (retext.base <= tbreak->y)) { +#ifdef HAVE_CAIRO + advance = font->glyph_advance[*textptr]; + top = font->glyph_top[*textptr]; + bottom = font->glyph_bottom[*textptr]; +#else /* HAVE_CAIRO */ + { + objectptr chptr = *(somebet + *textptr); + advance = chptr->bbox.width + chptr->bbox.lowerleft.x; + top = chptr->bbox.height + chptr->bbox.lowerleft.y; + bottom = chptr->bbox.lowerleft.y; + } +#endif /* HAVE_CAIRO */ + xtotal += advance * locscale * strscale; + retext.ascent = max(retext.ascent, (short)(retext.base + ykern + + top * locscale * strscale)); + retext.descent = min(retext.descent, (short)(retext.base + ykern + + bottom * locscale * strscale)); + + if ((tlinfo != NULL) && (tlinfo->tbreak != NULL)) { + if ((xtotal > tbreak.x) && (retext.base <= tbreak.y)) { dobreak = TRUE; break; } + } lasttotal = xtotal; lastpos = locpos; } break; } + if (strptr->type != TEXT_STRING) locpos++; if (dostop && (locpos >= dostop)) break; if (dobreak) break; } if (tabstops != NULL) free(tabstops); - /* special case: return character position in retext.width */ - if (tbreak != NULL) { + /* Update width and maxwidth entries */ + retext.width = max(retext.width, xtotal); + retext.maxwidth = max(retext.maxwidth, xtotal); + + /* If not doing "dostop", put the last position into the */ + /* list of padding. Since padding values are currently */ + /* linewidths, subtract them from maxwidth. */ + + if (tlinfo != NULL) { + int i; + if ((tlinfo->dostop == 0) && (tlinfo->padding != NULL)) { + tlinfo->padding[linenum] = xtotal; + for (i = 0; i <= linenum; i++) + tlinfo->padding[i] = retext.maxwidth - tlinfo->padding[i]; + } + tlinfo->line = linenum; + } + + /* Return character position in tlinfo->dostop (which should */ + /* be unused if using "tbreak" */ + + if ((tlinfo != NULL) && (tlinfo->tbreak != NULL)) { int slen = stringlength(drawlabel->string, True, localinst); - if ((tbreak->x - lasttotal) < (xtotal - tbreak->x)) + if ((tbreak.x - lasttotal) < (xtotal - tbreak.x)) locpos = lastpos + 1; if (locpos < 1) locpos = 1; else if (locpos > slen) locpos = slen; - retext.width = locpos; - return retext; + if (tlinfo != NULL) tlinfo->dostop = locpos; } - retext.width = max(retext.width, xtotal); - retext.maxwidth = max(retext.maxwidth, xtotal); return retext; } @@ -1926,7 +2138,7 @@ TextExtents ULength(labelptr drawlabel, objinstptr localinst, void RemoveMarginNewlines(labelptr settext, objinstptr localinst) { - stringpart *strptr, *nextptr; + stringpart *strptr; int strpos = 0; for (strptr = settext->string; strptr != NULL; @@ -1934,7 +2146,7 @@ void RemoveMarginNewlines(labelptr settext, objinstptr localinst) switch (strptr->type) { case RETURN: if (strptr->data.flags != 0) { - // Remove (without merge) + /* Remove (without merge) */ strptr = deletestring0(strptr, &settext->string, localinst, FALSE); if (strpos <= areawin->textpos) areawin->textpos--; } @@ -1966,8 +2178,9 @@ void InsertMarginNewlines(labelptr settext, objinstptr localinst) { stringpart *strptr, *lastseg = NULL; int margin = 0; - int strpos = 0, locpos, tmplen, slen, savelen; + int strpos = 0, locpos, slen, savelen; TextExtents tmpext; + TextLinesInfo tlinfo; /* 1) Find the position of the margin stop. Track position */ /* in string a la findstringpart(), as we need to pass this */ @@ -1992,12 +2205,15 @@ void InsertMarginNewlines(labelptr settext, objinstptr localinst) } if (margin > 0) break; } - if (margin == 0) return; // Should not happen. . . + if (margin == 0) return; /* Should not happen. . . */ lastseg = strptr; /* 2) Compute the drawn string length at each word break. When a */ /* word overruns the margin, place a line break in front of it. */ + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; + while (1) { strptr = findstringpart(strpos, &locpos, settext->string, localinst); if (strptr == NULL) break; @@ -2005,7 +2221,10 @@ void InsertMarginNewlines(labelptr settext, objinstptr localinst) slen = strlen(strptr->data.string); /* Ignore trailing spaces */ while ((slen > 0) && (*(strptr->data.string + slen - 1) == ' ')) slen--; - tmpext = ULength(settext, localinst, strpos + slen, NULL); + + tlinfo.dostop = strpos + slen; + + tmpext = ULength(settext, localinst, &tlinfo); if (tmpext.width > margin) { savelen = 0; while ((slen > 0) && (tmpext.width > margin)) { @@ -2014,21 +2233,22 @@ void InsertMarginNewlines(labelptr settext, objinstptr localinst) slen--; savelen = slen; } - tmpext = ULength(settext, localinst, strpos + slen - 1, NULL); + tlinfo.dostop = strpos + slen - 1; + tmpext = ULength(settext, localinst, &tlinfo); } /* Take the first space, in case we have a single word so long that */ /* it exceeds the margin by itself. */ if (savelen > slen) slen = savelen; if (slen > 0) { - // Split string at word separation before the margin. + /* Split string at word separation before the margin. */ while ((slen > 0) && (*(strptr->data.string + slen) == ' ')) slen++; strptr = splitstring(strpos + slen, &settext->string, localinst); strptr = nextstringpart(strptr, localinst); } - // Insert a carriage return, if the previous segment was not - // already one. + /* Insert a carriage return, if the previous segment was not */ + /* already one. */ if (slen > 0 || (lastseg->type != RETURN)) { strptr = makesegment(&settext->string, strptr); strptr->type = RETURN; @@ -2043,7 +2263,7 @@ void InsertMarginNewlines(labelptr settext, objinstptr localinst) strpos += strlen(strptr->data.string); } else if (strptr->type == MARGINSTOP) { - // Allows multiple margin stops in the same text block + /* Allows multiple margin stops in the same text block */ margin = strptr->data.width; strpos++; } @@ -2066,6 +2286,7 @@ void CheckMarginStop(labelptr settext, objinstptr localinst, Boolean force) stringpart *strptr; int margin = 0; TextExtents tmpext; + TextLinesInfo tlinfo; for (strptr = settext->string; strptr != NULL; strptr = nextstringpart(strptr, localinst)) { @@ -2077,14 +2298,17 @@ void CheckMarginStop(labelptr settext, objinstptr localinst, Boolean force) if (margin > 0) break; } if (margin > 0) { - tmpext = ULength(settext, localinst, 0, NULL); + tlinfo.dostop = 0; + tlinfo.tbreak = NULL; + tlinfo.padding = NULL; + tmpext = ULength(settext, localinst, &tlinfo); if ((force == TRUE) || (tmpext.maxwidth > margin)) { RemoveMarginNewlines(settext, localinst); InsertMarginNewlines(settext, localinst); } } else { - // In case the Margin Stop directive just got deleted. . . + /* In case the Margin Stop directive just got deleted. . . */ RemoveMarginNewlines(settext, localinst); } } @@ -2095,7 +2319,6 @@ void CheckMarginStop(labelptr settext, objinstptr localinst, Boolean force) void undrawtextsimple(labelptr settext) { - SetFunction(dpy, areawin->gc, GXcopy); XTopSetForeground(BACKGROUND); UDrawString(settext, DOFORALL, areawin->topinstance); } @@ -2163,19 +2386,14 @@ void redrawtext(labelptr curlabel) void composefontlib(short cfont) { /* genericptr *pgen; (jdk) */ - objinstptr *drawinst; - objectptr *curlib, libobj, nullobj; + objectptr nullobj; objectptr directory = xobjs.libtop[FONTLIB]->thisobject; - short visobjects, i, qdel; + short visobjects, i; polyptr *drawbox; pointlist pointptr; reset(directory, NORMAL); - /* Create a pointer to the font library */ - - curlib = xobjs.fontlib.library; - /* Find the number of non-null characters. Do this by assuming */ /* that all fonts encode nullchar at position zero. */ @@ -2194,20 +2412,28 @@ void composefontlib(short cfont) * sizeof(genericptr)); directory->parts = 0; - /* 0.5 is the default vscale; 16 is no. characters per line */ - del = min(areawin->width, areawin->height) / (0.5 * 16); - qdel = del >> 2; - for (i = 0; i < 256; i++) { + stringpart *sfont, *schar; + labelptr label; + u_char character[2] = {0, 0}; + character[0] = i; - if ((libobj = fonts[cfont].encoding[i]) == nullobj) continue; - - NEW_OBJINST(drawinst, directory); - instancedefaults(*drawinst, libobj, - (i % 16) * del + qdel, /* X position */ - -(i / 16) * del + qdel); /* Y position */ - drawinst = (objinstptr *)directory->plist + directory->parts - 1; - (*drawinst)->color = DEFAULTCOLOR; + if (fonts[cfont].encoding[i] == nullobj) + continue; + + sfont = (stringpart *) malloc(sizeof(stringpart)); + schar = (stringpart *) malloc(sizeof(stringpart)); + sfont->type = FONT_NAME; + sfont->data.font = cfont; + sfont->nextpart = schar; + schar->type = TEXT_STRING; + schar->data.string = strdup(character); + schar->nextpart = NULL; + label = new_label(xobjs.libtop[FONTLIB], sfont, NORMAL, + (i % 16) * del + del / 2, -(i / 16) * del - del / 2 - 32 /2, + (u_char)0); + label->anchor = NOTLEFT; + label->color = DEFAULTCOLOR; } /* separate characters with gridlines (17 vert., 17 horiz.) */ @@ -2268,7 +2494,7 @@ void fontcat_op(int op, int x, int y) window_to_user(x, y, &areawin->save); - chy = -areawin->save.y / del + 1; + chy = -areawin->save.y / del; chx = areawin->save.x / del; chx = min(15, chx); diff --git a/tutorial/footnote.html b/tutorial/footnote.html deleted file mode 100644 index 0e20367..0000000 --- a/tutorial/footnote.html +++ /dev/null @@ -1,27 +0,0 @@ - -A footnote about the "mu" character in LaTeX - - -It just so happens that although the "mu" -character is encoded into the Adobe fonts, but is not part of any of the -TeX fonts or TeX font encodings of standard Adobe (or TrueType) fonts. -However, it is not strictly true that printing the character is impossible. -I, being the enterprising character that I am, have found a (somewhat -kludgy) workaround: - -
    -
  1. First, you must be using one of the PSNFSS packages available under - LaTeX2e, such as "times" (\usepackage{times}) -
  2. Next, create the following definition:
    - \def\micro{\special{ps:(µ)show}\nobreak\hspace*{0.55em}}
    - (The "mu" character here is the embedded 8-bit character encoding - hex 0xb5, or decimal 181, or octal 0625). -
  3. The \micro definition can be used as follows, for example:
    - The correlator measures 700\,{\micro}m $\times$ 1170\,{\micro}m -
  4. This definition of \micro uses a \special{} function defined only - by (as far as I know) dvips, so the proper symbol will only show - up after postprocessing the .dvi file through dvips. -
- - - diff --git a/tutorial/giffiles/aggregate.gif b/tutorial/giffiles/aggregate.gif deleted file mode 100644 index 371b19f..0000000 Binary files a/tutorial/giffiles/aggregate.gif and /dev/null differ diff --git a/tutorial/giffiles/alib.gif b/tutorial/giffiles/alib.gif deleted file mode 100644 index 865dc2d..0000000 Binary files a/tutorial/giffiles/alib.gif and /dev/null differ diff --git a/tutorial/giffiles/amp1.gif b/tutorial/giffiles/amp1.gif deleted file mode 100644 index d022255..0000000 Binary files a/tutorial/giffiles/amp1.gif and /dev/null differ diff --git a/tutorial/giffiles/amp2.gif b/tutorial/giffiles/amp2.gif deleted file mode 100644 index 5606af0..0000000 Binary files a/tutorial/giffiles/amp2.gif and /dev/null differ diff --git a/tutorial/giffiles/amp3.gif b/tutorial/giffiles/amp3.gif deleted file mode 100644 index c9fcd8f..0000000 Binary files a/tutorial/giffiles/amp3.gif and /dev/null differ diff --git a/tutorial/giffiles/arcs1.gif b/tutorial/giffiles/arcs1.gif deleted file mode 100644 index 09db235..0000000 Binary files a/tutorial/giffiles/arcs1.gif and /dev/null differ diff --git a/tutorial/giffiles/bridge.gif b/tutorial/giffiles/bridge.gif deleted file mode 100644 index ac18bbc..0000000 Binary files a/tutorial/giffiles/bridge.gif and /dev/null differ diff --git a/tutorial/giffiles/bridge1.gif b/tutorial/giffiles/bridge1.gif deleted file mode 100644 index da964e2..0000000 Binary files a/tutorial/giffiles/bridge1.gif and /dev/null differ diff --git a/tutorial/giffiles/bridge2.gif b/tutorial/giffiles/bridge2.gif deleted file mode 100644 index 53ea047..0000000 Binary files a/tutorial/giffiles/bridge2.gif and /dev/null differ diff --git a/tutorial/giffiles/bridge3.gif b/tutorial/giffiles/bridge3.gif deleted file mode 100644 index d0bcd2c..0000000 Binary files a/tutorial/giffiles/bridge3.gif and /dev/null differ diff --git a/tutorial/giffiles/bridge4.gif b/tutorial/giffiles/bridge4.gif deleted file mode 100644 index 3439f07..0000000 Binary files a/tutorial/giffiles/bridge4.gif and /dev/null differ diff --git a/tutorial/giffiles/bridge5.gif b/tutorial/giffiles/bridge5.gif deleted file mode 100644 index 668ae54..0000000 Binary files a/tutorial/giffiles/bridge5.gif and /dev/null differ diff --git a/tutorial/giffiles/bridge6.gif b/tutorial/giffiles/bridge6.gif deleted file mode 100644 index 3aafac5..0000000 Binary files a/tutorial/giffiles/bridge6.gif and /dev/null differ diff --git a/tutorial/giffiles/dff.gif b/tutorial/giffiles/dff.gif deleted file mode 100644 index 6260fba..0000000 Binary files a/tutorial/giffiles/dff.gif and /dev/null differ diff --git a/tutorial/giffiles/filter1.gif b/tutorial/giffiles/filter1.gif deleted file mode 100644 index 3529749..0000000 Binary files a/tutorial/giffiles/filter1.gif and /dev/null differ diff --git a/tutorial/giffiles/filter2.gif b/tutorial/giffiles/filter2.gif deleted file mode 100644 index 57d2733..0000000 Binary files a/tutorial/giffiles/filter2.gif and /dev/null differ diff --git a/tutorial/giffiles/fullamp.gif b/tutorial/giffiles/fullamp.gif deleted file mode 100644 index a2efe6b..0000000 Binary files a/tutorial/giffiles/fullamp.gif and /dev/null differ diff --git a/tutorial/giffiles/fullamp_anno.gif b/tutorial/giffiles/fullamp_anno.gif deleted file mode 100644 index db0f63a..0000000 Binary files a/tutorial/giffiles/fullamp_anno.gif and /dev/null differ diff --git a/tutorial/giffiles/halfamp.gif b/tutorial/giffiles/halfamp.gif deleted file mode 100644 index 63ca65e..0000000 Binary files a/tutorial/giffiles/halfamp.gif and /dev/null differ diff --git a/tutorial/giffiles/integrate1.gif b/tutorial/giffiles/integrate1.gif deleted file mode 100644 index f77b941..0000000 Binary files a/tutorial/giffiles/integrate1.gif and /dev/null differ diff --git a/tutorial/giffiles/lib1.gif b/tutorial/giffiles/lib1.gif deleted file mode 100644 index 06f4483..0000000 Binary files a/tutorial/giffiles/lib1.gif and /dev/null differ diff --git a/tutorial/giffiles/load1.gif b/tutorial/giffiles/load1.gif deleted file mode 100644 index 76fc7eb..0000000 Binary files a/tutorial/giffiles/load1.gif and /dev/null differ diff --git a/tutorial/giffiles/nand4.gif b/tutorial/giffiles/nand4.gif deleted file mode 100644 index 56292a5..0000000 Binary files a/tutorial/giffiles/nand4.gif and /dev/null differ diff --git a/tutorial/giffiles/object.gif b/tutorial/giffiles/object.gif deleted file mode 100644 index f783581..0000000 Binary files a/tutorial/giffiles/object.gif and /dev/null differ diff --git a/tutorial/giffiles/objedit.gif b/tutorial/giffiles/objedit.gif deleted file mode 100644 index 3318d19..0000000 Binary files a/tutorial/giffiles/objedit.gif and /dev/null differ diff --git a/tutorial/giffiles/overunder.gif b/tutorial/giffiles/overunder.gif deleted file mode 100644 index f1fce9b..0000000 Binary files a/tutorial/giffiles/overunder.gif and /dev/null differ diff --git a/tutorial/giffiles/path1.gif b/tutorial/giffiles/path1.gif deleted file mode 100644 index 11c6a1e..0000000 Binary files a/tutorial/giffiles/path1.gif and /dev/null differ diff --git a/tutorial/giffiles/path2.gif b/tutorial/giffiles/path2.gif deleted file mode 100644 index 384c37f..0000000 Binary files a/tutorial/giffiles/path2.gif and /dev/null differ diff --git a/tutorial/giffiles/path3.gif b/tutorial/giffiles/path3.gif deleted file mode 100644 index 3dc0213..0000000 Binary files a/tutorial/giffiles/path3.gif and /dev/null differ diff --git a/tutorial/giffiles/path4.gif b/tutorial/giffiles/path4.gif deleted file mode 100644 index 34671ba..0000000 Binary files a/tutorial/giffiles/path4.gif and /dev/null differ diff --git a/tutorial/giffiles/path5.gif b/tutorial/giffiles/path5.gif deleted file mode 100644 index 326a015..0000000 Binary files a/tutorial/giffiles/path5.gif and /dev/null differ diff --git a/tutorial/giffiles/pcbcap.gif b/tutorial/giffiles/pcbcap.gif deleted file mode 100644 index 69bbd8c..0000000 Binary files a/tutorial/giffiles/pcbcap.gif and /dev/null differ diff --git a/tutorial/giffiles/pcbdiode.gif b/tutorial/giffiles/pcbdiode.gif deleted file mode 100644 index 0906f88..0000000 Binary files a/tutorial/giffiles/pcbdiode.gif and /dev/null differ diff --git a/tutorial/giffiles/poly1.gif b/tutorial/giffiles/poly1.gif deleted file mode 100644 index 360f400..0000000 Binary files a/tutorial/giffiles/poly1.gif and /dev/null differ diff --git a/tutorial/giffiles/poly2.gif b/tutorial/giffiles/poly2.gif deleted file mode 100644 index b58ea3c..0000000 Binary files a/tutorial/giffiles/poly2.gif and /dev/null differ diff --git a/tutorial/giffiles/powersup.gif b/tutorial/giffiles/powersup.gif deleted file mode 100644 index 68a9576..0000000 Binary files a/tutorial/giffiles/powersup.gif and /dev/null differ diff --git a/tutorial/giffiles/powersup2.gif b/tutorial/giffiles/powersup2.gif deleted file mode 100644 index d00e6eb..0000000 Binary files a/tutorial/giffiles/powersup2.gif and /dev/null differ diff --git a/tutorial/giffiles/quadparts.gif b/tutorial/giffiles/quadparts.gif deleted file mode 100644 index 0be0e22..0000000 Binary files a/tutorial/giffiles/quadparts.gif and /dev/null differ diff --git a/tutorial/giffiles/save1.gif b/tutorial/giffiles/save1.gif deleted file mode 100644 index c98500e..0000000 Binary files a/tutorial/giffiles/save1.gif and /dev/null differ diff --git a/tutorial/giffiles/save2.gif b/tutorial/giffiles/save2.gif deleted file mode 100644 index d947ad6..0000000 Binary files a/tutorial/giffiles/save2.gif and /dev/null differ diff --git a/tutorial/giffiles/select1.gif b/tutorial/giffiles/select1.gif deleted file mode 100644 index dfc319e..0000000 Binary files a/tutorial/giffiles/select1.gif and /dev/null differ diff --git a/tutorial/giffiles/select2.gif b/tutorial/giffiles/select2.gif deleted file mode 100644 index 26d255d..0000000 Binary files a/tutorial/giffiles/select2.gif and /dev/null differ diff --git a/tutorial/giffiles/spline1.gif b/tutorial/giffiles/spline1.gif deleted file mode 100644 index 0f6368a..0000000 Binary files a/tutorial/giffiles/spline1.gif and /dev/null differ diff --git a/tutorial/giffiles/spline2.gif b/tutorial/giffiles/spline2.gif deleted file mode 100644 index 25c1264..0000000 Binary files a/tutorial/giffiles/spline2.gif and /dev/null differ diff --git a/tutorial/giffiles/spline3.gif b/tutorial/giffiles/spline3.gif deleted file mode 100644 index 01df61f..0000000 Binary files a/tutorial/giffiles/spline3.gif and /dev/null differ diff --git a/tutorial/giffiles/symbol_enc.gif b/tutorial/giffiles/symbol_enc.gif deleted file mode 100644 index 934bfdb..0000000 Binary files a/tutorial/giffiles/symbol_enc.gif and /dev/null differ diff --git a/tutorial/giffiles/text.gif b/tutorial/giffiles/text.gif deleted file mode 100644 index 0939c71..0000000 Binary files a/tutorial/giffiles/text.gif and /dev/null differ diff --git a/tutorial/giffiles/text2.gif b/tutorial/giffiles/text2.gif deleted file mode 100644 index e988e64..0000000 Binary files a/tutorial/giffiles/text2.gif and /dev/null differ diff --git a/tutorial/giffiles/tut1.gif b/tutorial/giffiles/tut1.gif deleted file mode 100644 index d664463..0000000 Binary files a/tutorial/giffiles/tut1.gif and /dev/null differ diff --git a/tutorial/giffiles/wramp1.gif b/tutorial/giffiles/wramp1.gif deleted file mode 100644 index 7e57adb..0000000 Binary files a/tutorial/giffiles/wramp1.gif and /dev/null differ diff --git a/tutorial/index.html b/tutorial/index.html deleted file mode 120000 index 1808037..0000000 --- a/tutorial/index.html +++ /dev/null @@ -1 +0,0 @@ -tutorial.html \ No newline at end of file diff --git a/tutorial/netfiles/filter.spc b/tutorial/netfiles/filter.spc deleted file mode 100644 index 394b0b0..0000000 --- a/tutorial/netfiles/filter.spc +++ /dev/null @@ -1,6 +0,0 @@ -Spice circuit filter - -V1 GND Vin SIN(0 5 5k) -C2 Vout GND 1.0u -R3 Vin Vout 100k -.end diff --git a/tutorial/netfiles/integrator.spc b/tutorial/netfiles/integrator.spc deleted file mode 100644 index 2448672..0000000 --- a/tutorial/netfiles/integrator.spc +++ /dev/null @@ -1,17 +0,0 @@ -Spice circuit integrator - -.subckt wramp bias out in.p in.m -M1 net.1 net.1 GND GND nmos -M2 out net.1 GND GND nmos -M3 net.1 net.2 Vdd Vdd pmos -M4 out net.3 Vdd Vdd pmos -M5 net.3 net.3 Vdd Vdd pmos -M6 net.2 net.2 Vdd Vdd pmos -M7 net.4 bias GND GND nmos -M8 net.3 in.p net.4 GND nmos -M9 net.2 in.m net.4 GND nmos -.ends - -C10 Output GND 1.0P -X1 Bias Output Input Output wramp -.end diff --git a/tutorial/pcb/FlareLED.ps b/tutorial/pcb/FlareLED.ps deleted file mode 100644 index d807858..0000000 --- a/tutorial/pcb/FlareLED.ps +++ /dev/null @@ -1,720 +0,0 @@ -%!PS-Adobe-3.0 -%%Title: examples/FlareLED -%%Creator: Xcircuit v2.3 -%%CreationDate: Mon Jul 2 14:17:57 2001 -%%Pages: 1 -%%BoundingBox: -319 -124 931 916 -%%DocumentNeededResources: font Helvetica font Helvetica-Bold font Times-Roman -%%+ font Times-RomanISO font Symbol -%%EndComments -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.3 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--5/16/01 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.3 1 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/ul { dup type /stringtype eq showflag 1 eq and { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave currentpoint newpath moveto true charpath flattenpath - pathbbox pop exch pop sub grestore } def -/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs - 0 currentpoint pop put} def -/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def -/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def -/hS { qS qS } def -/pspc 0 def -/cf0 { scalefont setfont } bind def -/Kn { dup kY add /kY exch def rmoveto } bind def -/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.33 mul neg Kn} def -/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.67 mul Kn } def -/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def -/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def -/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq - { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} - {fscale0 mul fscale mul cf0} ifelse } def -/ctmk { counttomark dup 2 add -1 roll pop } bind def -/label { gsave translate 0 0 moveto dup scale /rotval exch def /just exch def - just 16 and 0 gt {0 1 dtransform gsave pagemat setmatrix idtransform - exch grestore 1 0 dtransform gsave pagemat setmatrix idtransform - exch grestore dup 0 eq {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse - {-1 /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch 0 lt - {-1 /just just dup 12 and 4 ne {12 xor} if def} {1} ifelse scale } - if /showflag 0 def /fspc pspc def /Bline 0 def /Tabs 0 array def - /fscale 1.0 def /kY 0 def - gsave dup 1 add copy 0 exch {exch dup type /stringtype eq {true - charpath flattenpath} {exec} ifelse } repeat pop pathbbox grestore - 3 -1 roll pop 3 1 roll just 1 and 0 gt {just 2 and 0 gt {exch pop - neg fspc sub} {exch sub 0.5 mul neg} ifelse} {pop neg fspc add} - ifelse exch Bline exch just 4 and 0 gt {just 8 and 0 gt {exch pop - neg fspc sub} {add 0.5 mul neg} ifelse} {pop neg fspc add} ifelse - /showflag 1 def rotval rotate Kn currentpoint translate - /Bline 0 def /Tabs 0 array def /fscale 1.0 def /kY 0 def - {dup type /stringtype eq {show}{exec} ifelse} repeat grestore } def -/pinlabel { hlevel 0 eq { /pspc 20 def label /pspc 0 def } - { pop pop pop pop pop {pop} repeat } ifelse } def -/pinglobal { pinlabel } def -/infolabel { pinlabel } def - -/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def -/cRedef {/defColor currentcolor 3 array astore def} def -/begingate { /hlevel hlevel 1 add def /defColor currentcolor sce 3 array - astore def gsave sce translate 0 0 moveto dup 0 lt - {neg 1 sub -1 1 scale} if rotate dup scale } bind def -/makeparm {3 string cvs dup length 1 add string /tstr exch def tstr exch - 1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def -/beginparm { -1 1 {makeparm exch def} for - dup type /arraytype eq { aload length -1 1 {makeparm exch def} - for } if begingate } bind def -/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef - scb} bind def - -/hlevel 0 def -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt style 512 eq or { newpath } { stroke } ifelse grestore } def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def -/insertion {/PSobj save def /showpage {} def bop translate} def -/end_insert {PSobj restore} def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -/Times-Roman findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall -/Encoding ISOLatin1Encoding def currentdict end -/Times-RomanISO exch definefont pop - -% XCircuit output starts here. - -/PIC16C54 { -% 0 0 480 736 bbox -(?) 1 beginparm -0 1.00 0 0 0 736 480 736 480 0 4 polygon -(PIC16C54A) {/Helvetica-Bold cf} 2 21 0 1.00 240 320 label -(Vdd) {/Helvetica cf} 2 23 0 1.00 464 368 label -(RA2) {/Helvetica cf} 2 20 0 1.00 16 688 label -(RA3) {/Helvetica cf} 2 20 0 1.00 16 624 label -(RTCC) {/Helvetica cf} 2 20 0 1.00 16 560 label -(MCLR) {ol} {/Helvetica cf} 3 20 0 1.00 16 496 label -(Vss) {/Helvetica cf} 2 20 0 1.00 16 368 label -(RB0) {/Helvetica cf} 2 20 0 1.00 16 240 label -(RB1) {/Helvetica cf} 2 20 0 1.00 16 176 label -(RB2) {/Helvetica cf} 2 20 0 1.00 16 112 label -(RB3) {/Helvetica cf} 2 20 0 1.00 16 48 label -(RB4) {/Helvetica cf} 2 23 0 1.00 464 48 label -(RB5) {/Helvetica cf} 2 23 0 1.00 464 112 label -(RB6) {/Helvetica cf} 2 23 0 1.00 464 176 label -(RB7) {/Helvetica cf} 2 23 0 1.00 464 240 label -(OSC2/CLKOUT) {/Helvetica cf} 2 23 0 1.00 464 496 label -(OSC1/CLKIN) {/Helvetica cf} 2 23 0 1.00 464 560 label -(RA0) {/Helvetica cf} 2 23 0 1.00 464 624 label -(RA1) {/Helvetica cf} 2 23 0 1.00 464 688 label -sce -mark v1 (pcb:U) {/Helvetica cf} ctmk 21 0 1.00 224 256 infolabel -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 23 0 1.00 0 688 pinlabel -(2) {/Helvetica cf} 2 23 0 1.00 0 624 pinlabel -(3) {/Helvetica cf} 2 23 0 1.00 0 560 pinlabel -(4) {/Helvetica cf} 2 23 0 1.00 0 496 pinlabel -(5) {/Helvetica cf} 2 23 0 1.00 0 368 pinlabel -(6) {/Helvetica cf} 2 23 0 1.00 0 240 pinlabel -(7) {/Helvetica cf} 2 23 0 1.00 0 176 pinlabel -(8) {/Helvetica cf} 2 23 0 1.00 0 112 pinlabel -(9) {/Helvetica cf} 2 23 0 1.00 0 48 pinlabel -(10) {/Helvetica cf} 2 20 0 1.00 480 48 pinlabel -(11) {/Helvetica cf} 2 20 0 1.00 480 112 pinlabel -(12) {/Helvetica cf} 2 20 0 1.00 480 176 pinlabel -(13) {/Helvetica cf} 2 20 0 1.00 480 240 pinlabel -(14) {/Helvetica cf} 2 20 0 1.00 480 368 pinlabel -(15) {/Helvetica cf} 2 20 0 1.00 480 496 pinlabel -(16) {/Helvetica cf} 2 20 0 1.00 480 560 pinlabel -(17) {/Helvetica cf} 2 20 0 1.00 480 624 pinlabel -(18) {/Helvetica cf} 2 20 0 1.00 480 688 pinlabel -endgate -} def - -/LTC490 { -% 0 0 416 384 bbox -(?) 1 beginparm -0 1.00 0 0 0 384 416 384 416 0 4 polygon -(RS422) {/Helvetica cf} 2 21 0 1.00 192 176 label -(Transciever) {/Helvetica cf} 2 21 0 1.00 208 128 label -(LTC490) {/Helvetica-Bold cf} 2 21 0 1.00 192 256 label -(Vcc) {/Helvetica cf} 2 20 0 1.00 16 336 label -(R) {/Helvetica cf} 2 20 0 1.00 16 240 label -(D) {/Helvetica cf} 2 20 0 1.00 16 144 label -(GND) {/Helvetica cf} 2 20 0 1.00 16 48 label -(Y) {/Helvetica cf} 2 23 0 1.00 400 48 label -(Z) {/Helvetica cf} 2 23 0 1.00 400 144 label -(B) {/Helvetica cf} 2 23 0 1.00 400 240 label -(A) {/Helvetica cf} 2 23 0 1.00 400 336 label -sce -mark v1 (pcb:U) {/Helvetica cf} ctmk 21 0 1.00 208 80 infolabel -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 23 0 1.00 0 336 pinlabel -(2) {/Helvetica cf} 2 23 0 1.00 0 240 pinlabel -(3) {/Helvetica cf} 2 23 0 1.00 0 144 pinlabel -(4) {/Helvetica cf} 2 23 0 1.00 0 48 pinlabel -(5) {/Helvetica cf} 2 20 0 1.00 416 48 pinlabel -(6) {/Helvetica cf} 2 20 0 1.00 416 144 pinlabel -(7) {/Helvetica cf} 2 20 0 1.00 416 240 pinlabel -(8) {/Helvetica cf} 2 20 0 1.00 416 336 pinlabel -endgate -} def - -/terminal_block { -% -160 -80 320 173 bbox -(?) 1 beginparm -0 1.00 -160 -80 -160 48 160 48 160 -80 4 polygon -(ED100/3DS) {/Helvetica cf} 2 21 0 1.00 0 80 label -1 1.00 0 -16 32 0.00 360.00 xcarc -1 1.00 96 -16 32 0.00 360.00 xcarc -1 1.00 -96 -16 32 0.00 360.00 xcarc -sce -mark v1 (pcb:J) {/Helvetica cf} ctmk 21 0 1.00 0 -112 infolabel -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 25 0 1.00 -96 -16 pinlabel -(2) {/Helvetica cf} 2 25 0 1.00 0 -16 pinlabel -(3) {/Helvetica cf} 2 25 0 1.00 96 -16 pinlabel -endgate -} def - -/LTC1152 { -% -192 -192 384 384 bbox -(?) 1 beginparm -0 1.00 -192 -192 -192 192 192 192 192 -192 4 polygon -(LTC1152) {/Helvetica-Bold cf} 2 25 0 1.00 0 48 label -(Op-amp) {/Helvetica cf} 2 29 0 1.00 0 0 label -(SHDN) {/Helvetica cf} 2 20 0 1.00 -176 144 label -(IN) {/Helvetica cf} (-) {/Symbol cf} 4 20 0 1.00 -176 48 label -(IN) {/Helvetica cf} (+) {/Symbol cf} 4 20 0 1.00 -176 -48 label -(-) {/Symbol cf} (V) {/Helvetica cf} 4 20 0 1.00 -176 -144 label -(COMP) {/Helvetica cf} 2 23 0 1.00 176 -144 label -(OUT) {/Helvetica cf} 2 23 0 1.00 176 -48 label -(+) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 176 48 label -(CP) {/Helvetica cf} 2 23 0 1.00 176 144 label -sce -mark v1 (pcb:U) {/Helvetica cf} ctmk 21 0 1.00 0 -80 infolabel -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 23 0 1.00 -192 144 pinlabel -(2) {/Helvetica cf} 2 23 0 1.00 -192 48 pinlabel -(3) {/Helvetica cf} 2 23 0 1.00 -192 -48 pinlabel -(5) {/Helvetica cf} 2 20 0 1.00 192 -144 pinlabel -(4) {/Helvetica cf} 2 23 0 1.00 -192 -144 pinlabel -(6) {/Helvetica cf} 2 20 0 1.00 192 -48 pinlabel -(7) {/Helvetica cf} 2 20 0 1.00 192 48 pinlabel -(8) {/Helvetica cf} 2 20 0 1.00 192 144 pinlabel -endgate -} def - -/DSUB9 { -% -160 0 320 186 bbox -(?) 1 beginparm -1 1.00 -128 96 16 0.00 360.00 xcarc -1 1.00 -32 32 16 0.00 360.00 xcarc -1 1.00 0 96 16 0.00 360.00 xcarc -1 1.00 64 96 16 0.00 360.00 xcarc -1 1.00 128 96 16 15.00 375.00 xcarc -1 1.00 96 32 16 0.00 360.00 xcarc -1 1.00 32 32 16 0.00 360.00 xcarc -1 1.00 -64 96 16 0.00 360.00 xcarc -1 1.00 -96 32 16 0.00 360.00 xcarc -sce -mark v1 (pcb:J) {/Helvetica cf} ctmk 21 0 1.00 16 -48 infolabel -128 128 beginpath -128 96 32 450.00 333.43 arcn -124 17 1 polyc -96 32 32 333.43 270.00 arcn --96 0 1 polyc --96 32 32 270.00 206.57 arcn --156 81 1 polyc --128 -96 32 206.57 90.00 arcn -128 128 1 polyc -1 1.00 endpath -(AMP 745781-4) {/Helvetica cf} 2 25 0 1.00 0 160 label -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 25 0 1.00 -128 96 pinlabel -(3) {/Helvetica cf} 2 25 0 1.00 0 96 pinlabel -(2) {/Helvetica cf} 2 25 0 1.00 -64 96 pinlabel -(4) {/Helvetica cf} 2 25 0 1.00 64 96 pinlabel -(5) {/Helvetica cf} 2 25 0 1.00 128 96 pinlabel -(6) {/Helvetica cf} 2 29 0 1.00 -96 32 pinlabel -(7) {/Helvetica cf} 2 29 0 1.00 -32 32 pinlabel -(8) {/Helvetica cf} 2 29 0 1.00 32 32 pinlabel -(9) {/Helvetica cf} 2 29 0 1.00 96 32 pinlabel -endgate -} def - -/Crystal { -% -144 -144 288 288 bbox -(?) 1 beginparm -0 1.00 -144 -144 -144 144 144 144 144 -144 4 polygon -(CTX169) {/Helvetica-Bold cf} 2 25 0 1.00 0 16 label -(MHz) {hS} (20) {/Helvetica cf} 4 21 0 1.00 0 -32 label -(N/C) {/Helvetica cf} 2 20 0 1.00 -128 96 label -(GND) {/Helvetica cf} 2 20 0 1.00 -128 -96 label -(OUT) {/Helvetica cf} 2 23 0 1.00 128 -96 label -(Vdd) {/Helvetica cf} 2 23 0 1.00 128 96 label -sce -mark v1 (pcb:X) {/Helvetica cf} ctmk 21 0 1.00 0 -176 infolabel -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 23 0 1.00 -144 96 pinlabel -(2) {/Helvetica cf} 2 23 0 1.00 -144 -96 pinlabel -(3) {/Helvetica cf} 2 20 0 1.00 144 -96 pinlabel -(4) {/Helvetica cf} 2 20 0 1.00 144 96 pinlabel -endgate -} def - -/ADC12138 { -% -240 -464 480 928 bbox -(?) 1 beginparm -0 1.00 -240 -464 -240 464 240 464 240 -464 4 polygon -(CH0) {/Helvetica cf} 2 20 0 1.00 -224 416 label -(CH1) {/Helvetica cf} 2 20 0 1.00 -224 352 label -(CH2) {/Helvetica cf} 2 20 0 1.00 -224 288 label -(CH3) {/Helvetica cf} 2 20 0 1.00 -224 224 label -(CH4) {/Helvetica cf} 2 20 0 1.00 -224 160 label -(CH5) {/Helvetica cf} 2 20 0 1.00 -224 96 label -(CH6) {/Helvetica cf} 2 20 0 1.00 -224 32 label -(CH7) {/Helvetica cf} 2 20 0 1.00 -224 -32 label -(COM) {/Helvetica cf} 2 20 0 1.00 -224 -96 label -(MuxOut1) {/Helvetica cf} 2 20 0 1.00 -224 -160 label -(A/Din2) {/Helvetica cf} 2 20 0 1.00 -224 -352 label -(DGND) {/Helvetica cf} 2 20 0 1.00 -224 -416 label -(+) {/Symbol cf} (VA) {/Helvetica cf} 4 23 0 1.00 224 -416 label -(-) {/Symbol cf} (Vref) {/Helvetica cf} 4 23 0 1.00 224 -352 label -(+) {/Symbol cf} (Vref) {/Helvetica cf} 4 23 0 1.00 224 -288 label -(AGND) {/Helvetica cf} 2 23 0 1.00 224 -224 label -(PD) {/Helvetica cf} 2 23 0 1.00 224 -160 label -(EOC) {/Helvetica cf} 2 23 0 1.00 224 -96 label -(CONV) {ol} {/Helvetica cf} 3 23 0 1.00 224 -32 label -(CS) {ol} {/Helvetica cf} 3 23 0 1.00 224 32 label -(DO) {/Helvetica cf} 2 23 0 1.00 224 96 label -(DI) {/Helvetica cf} 2 23 0 1.00 224 160 label -(SCLK) {/Helvetica cf} 2 23 0 1.00 224 224 label -(A/Din1) {/Helvetica cf} 2 20 0 1.00 -224 -224 label -(MuxOut2) {/Helvetica cf} 2 20 0 1.00 -224 -288 label -(CCLK) {/Helvetica cf} 2 23 0 1.00 224 288 label -(DOR) {ol} {/Helvetica cf} 3 23 0 1.00 224 352 label -(+) {/Symbol cf} (VD) {/Helvetica cf} 4 23 0 1.00 224 416 label -(ADC12138) {/Helvetica-Bold cf} 2 21 0 1.00 0 64 label -sce -mark v1 (pcb:U) {/Helvetica cf} ctmk 21 0 1.00 0 0 infolabel -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 23 0 1.00 -240 416 pinlabel -(2) {/Helvetica cf} 2 23 0 1.00 -240 352 pinlabel -(3) {/Helvetica cf} 2 23 0 1.00 -240 288 pinlabel -(4) {/Helvetica cf} 2 23 0 1.00 -240 224 pinlabel -(5) {/Helvetica cf} 2 23 0 1.00 -240 160 pinlabel -(6) {/Helvetica cf} 2 23 0 1.00 -240 96 pinlabel -(7) {/Helvetica cf} 2 23 0 1.00 -240 32 pinlabel -(8) {/Helvetica cf} 2 23 0 1.00 -240 -32 pinlabel -(9) {/Helvetica cf} 2 23 0 1.00 -240 -96 pinlabel -(10) {/Helvetica cf} 2 23 0 1.00 -240 -160 pinlabel -(11) {/Helvetica cf} 2 23 0 1.00 -240 -224 pinlabel -(12) {/Helvetica cf} 2 23 0 1.00 -240 -288 pinlabel -(13) {/Helvetica cf} 2 23 0 1.00 -240 -352 pinlabel -(14) {/Helvetica cf} 2 23 0 1.00 -240 -416 pinlabel -(15) {/Helvetica cf} 2 20 0 1.00 240 -416 pinlabel -(16) {/Helvetica cf} 2 20 0 1.00 240 -352 pinlabel -(17) {/Helvetica cf} 2 20 0 1.00 240 -288 pinlabel -(18) {/Helvetica cf} 2 20 0 1.00 240 -224 pinlabel -(19) {/Helvetica cf} 2 20 0 1.00 240 -160 pinlabel -(20) {/Helvetica cf} 2 20 0 1.00 240 -96 pinlabel -(21) {/Helvetica cf} 2 20 0 1.00 240 -32 pinlabel -(22) {/Helvetica cf} 2 20 0 1.00 240 32 pinlabel -(23) {/Helvetica cf} 2 20 0 1.00 240 96 pinlabel -(24) {/Helvetica cf} 2 20 0 1.00 240 160 pinlabel -(25) {/Helvetica cf} 2 20 0 1.00 240 224 pinlabel -(26) {/Helvetica cf} 2 20 0 1.00 240 288 pinlabel -(27) {/Helvetica cf} 2 20 0 1.00 240 352 pinlabel -(28) {/Helvetica cf} 2 20 0 1.00 240 416 pinlabel -endgate -} def - -/TK11950 { -% -336 -112 672 224 bbox -(?) 1 beginparm -0 1.00 -336 -112 -336 112 336 112 336 -112 4 polygon -(NOISE BYPASS) {/Helvetica cf} 2 20 0 1.00 -320 64 label -(CONTROL) {/Helvetica cf} 2 20 0 1.00 -320 0 label -(RESET OUT) {/Helvetica cf} 2 20 0 1.00 -320 -64 label -(VO) {/Helvetica cf} 2 23 0 1.00 320 -64 label -(GND) {/Helvetica cf} 2 23 0 1.00 320 0 label -(VIN) {/Helvetica cf} 2 23 0 1.00 320 64 label -(TK11950) {/Helvetica-Bold cf} 2 21 0 1.00 64 16 label -(V) {hS} (5.0) {/Helvetica cf} 4 29 0 1.00 64 -32 label -sce -mark v1 (pcb:U) {/Helvetica cf} ctmk 21 0 1.00 0 -144 infolabel -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 23 0 1.00 -336 64 pinlabel -(2) {/Helvetica cf} 2 23 0 1.00 -336 0 pinlabel -(3) {/Helvetica cf} 2 23 0 1.00 -336 -64 pinlabel -(4) {/Helvetica cf} 2 20 0 1.00 336 -64 pinlabel -(5) {/Helvetica cf} 2 20 0 1.00 336 0 pinlabel -(6) {/Helvetica cf} 2 20 0 1.00 336 64 pinlabel -endgate -} def - -/Capacitor { -% -32 -64 186 128 bbox -(1.0) (\265) (?) 3 beginparm -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 -32 -6 32 -6 2 polygon -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -mark v2 v1 ( %p1 %p2 ) v3 (spice:C) {/Times-RomanISO cf} ctmk 4 0 1.00 -208 --160 infolabel -sce -(sim:c %p1 %p2) {/Times-Roman cf} 2 4 0 1.00 -208 -208 infolabel -mark (F) v2 {hS} v1 {/Times-RomanISO cf} ctmk 20 0 1.00 48 0 label -sce -mark v3 (pcb:C) {/Times-Roman cf} ctmk 20 0 1.00 -208 -256 infolabel -endgate -} def - -/LM13700 { -% -256 -256 480 544 bbox -(?) 1 beginparm -0 1.00 -256 -256 -256 288 224 288 224 -256 4 polygon -(BufIn1) {/Helvetica cf} 2 20 0 1.00 -240 -144 label -(BufOut1) {/Helvetica cf} 2 20 0 1.00 -240 -208 label -(BufIn2) {/Helvetica cf} 2 23 0 1.00 208 -144 label -(+) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 208 -80 label -(Out2) {/Helvetica cf} 2 23 0 1.00 208 -16 label -1.000 0.000 0.000 scb -(7) {/Helvetica cf} 2 23 0 1.00 -256 -144 pinlabel -(8) {/Helvetica cf} 2 23 0 1.00 -256 -208 pinlabel -(10) {/Helvetica cf} 2 20 0 1.00 224 -144 pinlabel -(11) {/Helvetica cf} 2 20 0 1.00 224 -80 pinlabel -(12) {/Helvetica cf} 2 20 0 1.00 224 -16 pinlabel -sce -(LM13700) {/Helvetica-Bold cf} 2 21 0 1.00 -16 16 label -(Iabc1) {/Helvetica cf} 2 20 0 1.00 -240 240 label -(Dbias1) {/Helvetica cf} 2 20 0 1.00 -240 176 label -(1) {/Helvetica cf} (+) {/Symbol cf} (In) {/Helvetica cf} 6 20 0 1.00 -240 112 -label -(Out1) {/Helvetica cf} 2 20 0 1.00 -240 -16 label -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 23 0 1.00 -256 240 pinlabel -(2) {/Helvetica cf} 2 23 0 1.00 -256 176 pinlabel -(3) {/Helvetica cf} 2 23 0 1.00 -256 112 pinlabel -(4) {/Helvetica cf} 2 23 0 1.00 -256 48 pinlabel -(5) {/Helvetica cf} 2 23 0 1.00 -256 -16 pinlabel -(14) {/Helvetica cf} 2 20 0 1.00 224 112 pinlabel -(15) {/Helvetica cf} 2 20 0 1.00 224 176 pinlabel -(16) {/Helvetica cf} 2 20 0 1.00 224 240 pinlabel -sce -(-) {/Symbol cf} (V) {/Helvetica cf} 4 20 0 1.00 -240 -80 label -1.000 0.000 0.000 scb -(6) {/Helvetica cf} 2 23 0 1.00 -256 -80 pinlabel -(13) {/Helvetica cf} 2 20 0 1.00 224 48 pinlabel -sce -(BufOut2) {/Helvetica cf} 2 23 0 1.00 208 -208 label -1.000 0.000 0.000 scb -(9) {/Helvetica cf} 2 20 0 1.00 224 -208 pinlabel -sce -(1) {/Helvetica cf} (-) {/Symbol cf} (In) {/Helvetica cf} 6 20 0 1.00 -240 48 -label -(Iabc2) {/Helvetica cf} 2 23 0 1.00 208 240 label -(Dbias2) {/Helvetica cf} 2 23 0 1.00 208 176 label -(2) {/Helvetica cf} (+) {/Symbol cf} (In) {/Helvetica cf} 6 23 0 1.00 208 112 -label -(2) {/Helvetica cf} (-) {/Symbol cf} (In) {/Helvetica cf} 6 23 0 1.00 208 48 -label -sce -mark v1 (pcb:U) {/Helvetica cf} ctmk 21 0 1.00 -16 -304 infolabel -endgate -} def - -/Resistor { -% -14 -64 157 128 bbox -(1.0) (k) (?) 3 beginparm -1 1.00 0 64 0 36 2 polygon -1 1.00 0 -64 0 -36 2 polygon -1 1.00 0 -36 14 -30 -14 -18 14 -6 -14 6 14 18 -14 30 0 36 8 polygon -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -mark v2 v1 ( %p1 %p2 ) v3 (spice:R) {/Times-Roman cf} ctmk 4 0 1.00 -208 -160 -infolabel -sce -(sim:R %p1 %p2) {/Times-Roman cf} 2 4 0 1.00 -208 -208 infolabel -mark (W) {/Symbol cf} v2 {hS} v1 {/Times-Roman cf} ctmk 20 0 1.00 32 0 label -sce -mark v3 (pcb:R) {/Times-Roman cf} ctmk 20 0 1.00 -208 -256 infolabel -endgate -} def - -/gnd { -% -32 -60 64 68 bbox -% trivial -begingate -1 1.00 0 0 0 -32 2 polygon -1 1.00 -32 -32 32 -32 2 polygon -1 1.00 -18 -46 18 -46 2 polygon -1 1.00 -4 -60 4 -60 2 polygon -1.000 0.000 0.000 scb -(GND) {/Times-Roman cf} 2 1 0 1.00 0 0 pinglobal -endgate -} def - -/dot { -% -10 -10 20 20 bbox -% trivial -begingate -248 1.00 0 0 6 0.00 360.00 xcarc -1.000 0.000 0.000 scb -(x) {/Times-Roman cf} 2 29 0 1.00 0 0 pinlabel -endgate -} def - -/vdd { -% -32 0 64 66 bbox -% trivial -begingate -1 1.00 0 0 0 32 2 polygon -1 1.00 -32 32 32 32 2 polygon -(Vdd) {/Times-Roman cf} 2 17 0 0.90 0 38 label -1.000 0.000 0.000 scb -(Vdd) {/Times-Roman cf} 2 13 0 1.00 0 0 pinglobal -endgate -} def - -%%Page: 1 1 -%%PageOrientation: Portrait -/pgsave save def bop -% 1688 848 offsets -1.0000 inchscale -2.6000 setlinewidth - -1.00 0 664 1648 [(5) ] PIC16C54 -1.00 180 -24 2384 [(6) ] LTC490 -1.00 0 712 -160 [(2) ] terminal_block -1.00 0 1800 944 [(7) ] LTC1152 -1.00 0 -568 1296 [(3) ] DSUB9 -1.00 180 1576 2192 [(1) ] Crystal -1.00 0 904 1088 [(2) ] ADC12138 -1.00 -181 -56 1664 [(4) ] TK11950 -1 1.00 1432 2288 1304 2288 1304 2208 1144 2208 4 polygon -1.00 -1 2072 1168 Capacitor -1.00 0 920 304 [(1) ] LM13700 -1.00 0 1096 -160 [(1) ] terminal_block -1.00 0 1320 1424 Resistor -1.00 0 120 1984 Resistor -1.00 0 328 1456 Resistor -1.00 -1 -696 2064 Resistor -1.00 0 408 1600 Resistor -1.00 0 1384 992 Resistor -1.00 0 1784 2224 Capacitor -1.00 -1 1512 720 Capacitor -1.00 0 2088 832 Capacitor -1.00 0 -280 1456 Capacitor -1.00 0 504 416 Capacitor -1 1.00 664 544 504 544 504 480 3 polygon -1 1.00 504 352 504 224 664 224 3 polygon -1 1.00 -664 1328 -664 224 504 224 3 polygon -1.00 0 -664 224 gnd -1 1.00 664 160 -472 160 -472 1328 3 polygon -1 1.00 -696 2000 -696 1392 2 polygon -1 1.00 -440 2240 -504 2240 -504 1392 3 polygon -1 1.00 -440 2336 -568 2336 -568 1392 3 polygon -1 1.00 280 1664 408 1664 408 2336 -24 2336 4 polygon -1 1.00 -24 2048 344 2048 2 polygon -1 1.00 344 2048 344 1728 280 1728 3 polygon -1 1.00 328 1520 328 1600 280 1600 3 polygon -1 1.00 408 1664 408 1664 2 polygon -1 1.00 328 1520 408 1520 408 1536 3 polygon -1.00 -181 1704 1760 [(3) ] TK11950 -1 1.00 1144 736 1352 736 2 polygon -1.00 0 1352 736 dot -1 1.00 1608 896 1384 896 1384 928 3 polygon -1 1.00 1608 1088 1384 1088 1384 1056 3 polygon -1 1.00 1992 992 2136 992 2136 1232 1384 1232 1384 1088 5 polygon -1.00 0 1384 1088 dot -1 1.00 -440 2144 -696 2144 -696 2128 3 polygon -1 1.00 -440 2048 -536 2048 -536 2000 -696 2000 4 polygon -1 1.00 -632 1392 -632 2144 2 polygon -1.00 0 -632 2144 dot -1.00 0 -696 2000 dot -1 1.00 -440 1392 -440 1888 408 1888 3 polygon -1.00 0 408 1888 dot -1.00 0 408 1664 dot -1.00 0 328 1520 dot -1 1.00 1144 2016 1368 2016 1368 2112 1432 2112 4 polygon -1 1.00 664 2016 568 2016 568 2432 1784 2432 1784 2288 1720 2288 6 polygon -1 1.00 1352 2016 1784 2016 1784 2160 3 polygon -1.00 0 1368 2016 dot -1 1.00 1144 1376 1240 1376 1240 2144 1144 2144 4 polygon -1 1.00 1144 1312 1224 1312 1224 1632 616 1632 616 1888 664 1888 6 polygon -1 1.00 1144 1248 1208 1248 1208 1616 600 1616 600 1824 664 1824 6 polygon -1 1.00 1144 1184 1192 1184 1192 1600 584 1600 584 1760 664 1760 6 polygon -1 1.00 1144 1120 1176 1120 1176 1584 568 1584 568 1696 664 1696 6 polygon -1 1.00 1144 1056 1256 1056 1256 1760 1144 1760 4 polygon -1 1.00 1144 992 1272 992 1272 1696 1144 1696 4 polygon -1 1.00 1144 2272 1208 2272 1208 2416 24 2416 24 2240 -24 2240 6 polygon -1 1.00 -24 2144 40 2144 40 2400 1176 2400 1176 2336 1144 2336 6 polygon -1 1.00 664 736 632 736 632 800 664 800 4 polygon -1 1.00 664 864 632 864 632 928 664 928 4 polygon -1 1.00 664 672 600 672 2 polygon -1.00 0 456 608 gnd -1.00 0 -280 1360 gnd -1 1.00 -280 1392 -440 1392 2 polygon -1.00 0 1368 2112 vdd -1 1.00 1992 800 2040 800 2040 768 2088 768 4 polygon -1.00 0 1512 640 dot -1 1.00 1608 800 1512 800 1512 784 3 polygon -1.00 0 2088 896 dot -1 1.00 1992 1088 2072 1088 2072 1104 3 polygon -1.00 0 2072 1232 dot -1 1.00 664 96 408 96 408 480 664 480 4 polygon -1 1.00 408 96 408 0 1208 0 1208 480 1128 480 5 polygon -1.00 0 408 96 dot -1 1.00 408 480 408 1040 536 1040 536 1440 664 1440 5 polygon -1.00 0 408 480 dot -(Flare Genesis) {/Helvetica cf} 2 16 0 1.50 1896 432 label -(LED Interface) {/Helvetica cf} 2 16 0 1.50 1896 336 label -1 1.00 664 416 632 416 632 16 712 16 712 -176 5 polygon -1 1.00 664 352 616 352 616 -176 3 polygon -1 1.00 1000 -176 1000 -16 1240 -16 1240 352 1144 352 5 polygon -1 1.00 1096 -176 1096 -32 1256 -32 1256 416 1144 416 5 polygon -1 1.00 1192 -176 1192 -288 344 -288 344 1072 504 1072 504 1248 664 1248 -7 polygon -1 1.00 1144 288 1304 288 1304 -320 296 -320 296 1104 472 1104 472 1504 664 -1504 8 polygon -1 1.00 1144 672 1288 672 1288 800 1144 800 4 polygon -1 1.00 1384 1072 1288 1072 1288 800 1192 800 4 polygon -1.00 0 1288 800 dot -1.00 0 1384 1072 dot -1 1.00 1144 864 1240 864 1240 928 1144 928 4 polygon -1 1.00 1560 848 1560 992 1608 992 3 polygon -1 1.00 1560 848 1352 848 1352 640 2136 640 2136 896 1992 896 6 polygon -1 1.00 1512 656 1512 640 2 polygon -1 1.00 1576 800 1576 720 2 polygon -1.00 0 1576 800 dot -1.00 0 1576 720 gnd -1 1.00 -392 1664 -440 1664 2 polygon -1.00 0 -440 1664 dot -1 1.00 -392 1728 -424 1728 -424 1856 472 1856 472 2144 664 2144 6 polygon -1 1.00 120 1920 120 1856 2 polygon -1.00 0 120 2048 dot -1.00 0 120 1856 dot -1 1.00 -392 1600 -408 1600 -408 1520 -280 1520 4 polygon -1 1.00 -280 1360 -280 1392 2 polygon -1.00 0 -280 1392 dot -1 1.00 328 1392 328 1248 -472 1248 3 polygon -1.00 0 -472 1248 dot -1 1.00 1144 224 1320 224 2 polygon -1 1.00 1176 224 1176 32 504 32 504 160 4 polygon -1.00 0 504 160 dot -1.00 0 1176 224 dot -1 1.00 1320 1360 1320 224 2 polygon -1 1.00 2136 1232 2136 1696 2040 1696 3 polygon -1.00 0 2136 1232 dot -1 1.00 2040 1760 2136 1760 2136 1936 1320 1936 1320 1760 1368 1760 6 polygon -1 1.00 1320 1488 1320 1584 2088 1584 2088 1824 2040 1824 5 polygon -1 1.00 664 992 600 992 600 1184 664 1184 4 polygon -1 1.00 664 1120 600 1120 2 polygon -1 1.00 664 1056 600 1056 2 polygon -1.00 0 600 1056 dot -1.00 0 600 1120 dot -1 1.00 600 992 600 608 2 polygon -1.00 0 600 672 dot -1.00 0 600 992 dot -1 1.00 1240 864 1240 608 456 608 3 polygon -1.00 0 600 608 dot -1.00 0 1240 864 dot -(is not complete!) {CR} (this schematic) {/Helvetica cf} 4 16 0 1.00 1864 -80 -label -0 1.00 1592 -176 1592 496 2456 496 2456 -176 4 polygon -1 1.00 1592 400 2456 400 2 polygon -1 1.00 1592 304 2456 304 2 polygon -(1.0) {/Helvetica cf} 2 16 0 1.50 1896 240 label -1 1.00 1592 208 2456 208 2 polygon -(Project:) {/Helvetica cf} 2 16 0 1.50 1624 432 label -(Name:) {/Helvetica cf} 2 16 0 1.50 1624 336 label -(Revision:) {/Helvetica cf} 2 16 0 1.50 1624 240 label -(Design:) {/Helvetica cf} 2 16 0 1.50 1624 144 label -(Date:) {/Helvetica cf} 2 16 0 1.50 1624 48 label -(Notes:) {/Helvetica cf} 2 16 0 1.50 1624 -48 label -1 1.00 1592 112 2456 112 2 polygon -1 1.00 1592 16 2456 16 2 polygon -(Harry Eaton) {/Helvetica cf} 2 16 0 1.50 1912 144 label -0 1.00 1576 -192 1576 512 2472 512 2472 -192 4 polygon -1.00 0 -664 224 dot -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/pcb/LED b/tutorial/pcb/LED deleted file mode 100755 index dcfdb16..0000000 --- a/tutorial/pcb/LED +++ /dev/null @@ -1,1794 +0,0 @@ -# release: pcb 1.7.0.ALPHA -# date: Sat Jan 16 20:06:58 1999 -# user: root (root) -# host: localhost - -PCB("" 3500 3300) - -Grid(5 0 0 0) -Cursor(65 880 4) -Flags(0x000001d0) -Groups("4,5,6,c:1,2,3,s:8:7:") -Styles("Signal,10,40,20:Power,25,60,35:Fat,40,60,35:Skinny,8,36,20") - -Symbol(' ' 18) -( -) -Symbol('!' 12) -( - SymbolLine(0 35 0 40 8) - SymbolLine(0 0 0 25 8) -) -Symbol('"' 12) -( - SymbolLine(0 0 0 10 8) - SymbolLine(10 0 10 10 8) -) -Symbol('#' 12) -( - SymbolLine(0 25 20 25 8) - SymbolLine(0 15 20 15 8) - SymbolLine(15 10 15 30 8) - SymbolLine(5 10 5 30 8) -) -Symbol('$' 12) -( - SymbolLine(15 5 20 10 8) - SymbolLine(5 5 15 5 8) - SymbolLine(0 10 5 5 8) - SymbolLine(0 10 0 15 8) - SymbolLine(0 15 5 20 8) - SymbolLine(5 20 15 20 8) - SymbolLine(15 20 20 25 8) - SymbolLine(20 25 20 30 8) - SymbolLine(15 35 20 30 8) - SymbolLine(5 35 15 35 8) - SymbolLine(0 30 5 35 8) - SymbolLine(10 0 10 40 8) -) -Symbol('%' 12) -( - SymbolLine(0 5 0 10 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 10 0 8) - SymbolLine(10 0 15 5 8) - SymbolLine(15 5 15 10 8) - SymbolLine(10 15 15 10 8) - SymbolLine(5 15 10 15 8) - SymbolLine(0 10 5 15 8) - SymbolLine(0 40 40 0 8) - SymbolLine(35 40 40 35 8) - SymbolLine(40 30 40 35 8) - SymbolLine(35 25 40 30 8) - SymbolLine(30 25 35 25 8) - SymbolLine(25 30 30 25 8) - SymbolLine(25 30 25 35 8) - SymbolLine(25 35 30 40 8) - SymbolLine(30 40 35 40 8) -) -Symbol('&' 12) -( - SymbolLine(0 35 5 40 8) - SymbolLine(0 5 0 15 8) - SymbolLine(0 5 5 0 8) - SymbolLine(0 25 15 10 8) - SymbolLine(5 40 10 40 8) - SymbolLine(10 40 20 30 8) - SymbolLine(0 15 25 40 8) - SymbolLine(5 0 10 0 8) - SymbolLine(10 0 15 5 8) - SymbolLine(15 5 15 10 8) - SymbolLine(0 25 0 35 8) -) -Symbol(''' 12) -( - SymbolLine(0 10 10 0 8) -) -Symbol('(' 12) -( - SymbolLine(0 35 5 40 8) - SymbolLine(0 5 5 0 8) - SymbolLine(0 5 0 35 8) -) -Symbol(')' 12) -( - SymbolLine(0 0 5 5 8) - SymbolLine(5 5 5 35 8) - SymbolLine(0 40 5 35 8) -) -Symbol('*' 12) -( - SymbolLine(0 10 20 30 8) - SymbolLine(0 30 20 10 8) - SymbolLine(0 20 20 20 8) - SymbolLine(10 10 10 30 8) -) -Symbol('+' 12) -( - SymbolLine(0 20 20 20 8) - SymbolLine(10 10 10 30 8) -) -Symbol(',' 12) -( - SymbolLine(0 50 10 40 8) -) -Symbol('-' 12) -( - SymbolLine(0 20 20 20 8) -) -Symbol('.' 12) -( - SymbolLine(0 40 5 40 8) -) -Symbol('/' 12) -( - SymbolLine(0 35 30 5 8) -) -Symbol('0' 12) -( - SymbolLine(0 35 5 40 8) - SymbolLine(0 5 0 35 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 15 0 8) - SymbolLine(15 0 20 5 8) - SymbolLine(20 5 20 35 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 30 20 10 8) -) -Symbol('1' 12) -( - SymbolLine(5 40 15 40 8) - SymbolLine(10 0 10 40 8) - SymbolLine(0 10 10 0 8) -) -Symbol('2' 12) -( - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 20 0 8) - SymbolLine(20 0 25 5 8) - SymbolLine(25 5 25 15 8) - SymbolLine(0 40 25 15 8) - SymbolLine(0 40 25 40 8) -) -Symbol('3' 12) -( - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 15 0 8) - SymbolLine(15 0 20 5 8) - SymbolLine(20 5 20 35 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 20 20 20 8) -) -Symbol('4' 12) -( - SymbolLine(0 20 20 0 8) - SymbolLine(0 20 25 20 8) - SymbolLine(20 0 20 40 8) -) -Symbol('5' 12) -( - SymbolLine(0 0 20 0 8) - SymbolLine(0 0 0 20 8) - SymbolLine(0 20 5 15 8) - SymbolLine(5 15 15 15 8) - SymbolLine(15 15 20 20 8) - SymbolLine(20 20 20 35 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 35 5 40 8) -) -Symbol('6' 12) -( - SymbolLine(15 0 20 5 8) - SymbolLine(5 0 15 0 8) - SymbolLine(0 5 5 0 8) - SymbolLine(0 5 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(15 20 20 25 8) - SymbolLine(0 20 15 20 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) - SymbolLine(20 25 20 35 8) -) -Symbol('7' 12) -( - SymbolLine(0 40 25 15 8) - SymbolLine(25 0 25 15 8) - SymbolLine(0 0 25 0 8) -) -Symbol('8' 12) -( - SymbolLine(0 35 5 40 8) - SymbolLine(0 25 0 35 8) - SymbolLine(0 25 5 20 8) - SymbolLine(5 20 15 20 8) - SymbolLine(15 20 20 25 8) - SymbolLine(20 25 20 35 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 15 5 20 8) - SymbolLine(0 5 0 15 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 15 0 8) - SymbolLine(15 0 20 5 8) - SymbolLine(20 5 20 15 8) - SymbolLine(15 20 20 15 8) -) -Symbol('9' 12) -( - SymbolLine(0 40 20 20 8) - SymbolLine(20 5 20 20 8) - SymbolLine(15 0 20 5 8) - SymbolLine(5 0 15 0 8) - SymbolLine(0 5 5 0 8) - SymbolLine(0 5 0 15 8) - SymbolLine(0 15 5 20 8) - SymbolLine(5 20 20 20 8) -) -Symbol(':' 12) -( - SymbolLine(0 15 5 15 8) - SymbolLine(0 25 5 25 8) -) -Symbol(';' 12) -( - SymbolLine(0 40 10 30 8) - SymbolLine(10 15 10 20 8) -) -Symbol('<' 12) -( - SymbolLine(0 20 10 10 8) - SymbolLine(0 20 10 30 8) -) -Symbol('=' 12) -( - SymbolLine(0 15 20 15 8) - SymbolLine(0 25 20 25 8) -) -Symbol('>' 12) -( - SymbolLine(0 10 10 20 8) - SymbolLine(0 30 10 20 8) -) -Symbol('?' 12) -( - SymbolLine(10 20 10 25 8) - SymbolLine(10 35 10 40 8) - SymbolLine(0 5 0 10 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 15 0 8) - SymbolLine(15 0 20 5 8) - SymbolLine(20 5 20 10 8) - SymbolLine(10 20 20 10 8) -) -Symbol('A' 12) -( - SymbolLine(0 5 0 40 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 20 0 8) - SymbolLine(20 0 25 5 8) - SymbolLine(25 5 25 40 8) - SymbolLine(0 20 25 20 8) -) -Symbol('B' 12) -( - SymbolLine(0 40 20 40 8) - SymbolLine(20 40 25 35 8) - SymbolLine(25 25 25 35 8) - SymbolLine(20 20 25 25 8) - SymbolLine(5 20 20 20 8) - SymbolLine(5 0 5 40 8) - SymbolLine(0 0 20 0 8) - SymbolLine(20 0 25 5 8) - SymbolLine(25 5 25 15 8) - SymbolLine(20 20 25 15 8) -) -Symbol('C' 12) -( - SymbolLine(5 40 20 40 8) - SymbolLine(0 35 5 40 8) - SymbolLine(0 5 0 35 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 20 0 8) -) -Symbol('D' 12) -( - SymbolLine(5 0 5 40 8) - SymbolLine(20 0 25 5 8) - SymbolLine(25 5 25 35 8) - SymbolLine(20 40 25 35 8) - SymbolLine(0 40 20 40 8) - SymbolLine(0 0 20 0 8) -) -Symbol('E' 12) -( - SymbolLine(0 20 15 20 8) - SymbolLine(0 40 20 40 8) - SymbolLine(0 0 0 40 8) - SymbolLine(0 0 20 0 8) -) -Symbol('F' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 0 20 0 8) - SymbolLine(0 20 15 20 8) -) -Symbol('G' 12) -( - SymbolLine(20 0 25 5 8) - SymbolLine(5 0 20 0 8) - SymbolLine(0 5 5 0 8) - SymbolLine(0 5 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 20 40 8) - SymbolLine(20 40 25 35 8) - SymbolLine(25 25 25 35 8) - SymbolLine(20 20 25 25 8) - SymbolLine(10 20 20 20 8) -) -Symbol('H' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(25 0 25 40 8) - SymbolLine(0 20 25 20 8) -) -Symbol('I' 12) -( - SymbolLine(0 0 10 0 8) - SymbolLine(5 0 5 40 8) - SymbolLine(0 40 10 40 8) -) -Symbol('J' 12) -( - SymbolLine(0 0 15 0 8) - SymbolLine(15 0 15 35 8) - SymbolLine(10 40 15 35 8) - SymbolLine(5 40 10 40 8) - SymbolLine(0 35 5 40 8) -) -Symbol('K' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 20 20 0 8) - SymbolLine(0 20 20 40 8) -) -Symbol('L' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 40 20 40 8) -) -Symbol('M' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 0 15 15 8) - SymbolLine(15 15 30 0 8) - SymbolLine(30 0 30 40 8) -) -Symbol('N' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 0 0 5 8) - SymbolLine(0 5 25 30 8) - SymbolLine(25 0 25 40 8) -) -Symbol('O' 12) -( - SymbolLine(0 5 0 35 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 15 0 8) - SymbolLine(15 0 20 5 8) - SymbolLine(20 5 20 35 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 35 5 40 8) -) -Symbol('P' 12) -( - SymbolLine(5 0 5 40 8) - SymbolLine(0 0 20 0 8) - SymbolLine(20 0 25 5 8) - SymbolLine(25 5 25 15 8) - SymbolLine(20 20 25 15 8) - SymbolLine(5 20 20 20 8) -) -Symbol('Q' 12) -( - SymbolLine(0 5 0 35 8) - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 15 0 8) - SymbolLine(15 0 20 5 8) - SymbolLine(20 5 20 35 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 35 5 40 8) - SymbolLine(10 30 20 40 8) -) -Symbol('R' 12) -( - SymbolLine(0 0 20 0 8) - SymbolLine(20 0 25 5 8) - SymbolLine(25 5 25 15 8) - SymbolLine(20 20 25 15 8) - SymbolLine(5 20 20 20 8) - SymbolLine(5 0 5 40 8) - SymbolLine(5 20 25 40 8) -) -Symbol('S' 12) -( - SymbolLine(20 0 25 5 8) - SymbolLine(5 0 20 0 8) - SymbolLine(0 5 5 0 8) - SymbolLine(0 5 0 15 8) - SymbolLine(0 15 5 20 8) - SymbolLine(5 20 20 20 8) - SymbolLine(20 20 25 25 8) - SymbolLine(25 25 25 35 8) - SymbolLine(20 40 25 35 8) - SymbolLine(5 40 20 40 8) - SymbolLine(0 35 5 40 8) -) -Symbol('T' 12) -( - SymbolLine(0 0 20 0 8) - SymbolLine(10 0 10 40 8) -) -Symbol('U' 12) -( - SymbolLine(0 0 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) - SymbolLine(20 0 20 35 8) -) -Symbol('V' 12) -( - SymbolLine(0 0 0 30 8) - SymbolLine(0 30 10 40 8) - SymbolLine(10 40 20 30 8) - SymbolLine(20 0 20 30 8) -) -Symbol('W' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 40 15 25 8) - SymbolLine(15 25 30 40 8) - SymbolLine(30 0 30 40 8) -) -Symbol('X' 12) -( - SymbolLine(0 0 0 5 8) - SymbolLine(0 5 25 30 8) - SymbolLine(25 30 25 40 8) - SymbolLine(0 30 0 40 8) - SymbolLine(0 30 25 5 8) - SymbolLine(25 0 25 5 8) -) -Symbol('Y' 12) -( - SymbolLine(0 0 0 5 8) - SymbolLine(0 5 10 15 8) - SymbolLine(10 15 20 5 8) - SymbolLine(20 0 20 5 8) - SymbolLine(10 15 10 40 8) -) -Symbol('Z' 12) -( - SymbolLine(0 0 25 0 8) - SymbolLine(25 0 25 5 8) - SymbolLine(0 30 25 5 8) - SymbolLine(0 30 0 40 8) - SymbolLine(0 40 25 40 8) -) -Symbol('[' 12) -( - SymbolLine(0 0 5 0 8) - SymbolLine(0 0 0 40 8) - SymbolLine(0 40 5 40 8) -) -Symbol('\' 12) -( - SymbolLine(0 5 30 35 8) -) -Symbol(']' 12) -( - SymbolLine(0 0 5 0 8) - SymbolLine(5 0 5 40 8) - SymbolLine(0 40 5 40 8) -) -Symbol('^' 12) -( - SymbolLine(0 5 5 0 8) - SymbolLine(5 0 10 5 8) -) -Symbol('_' 12) -( - SymbolLine(0 40 20 40 8) -) -Symbol('a' 12) -( - SymbolLine(15 20 20 25 8) - SymbolLine(5 20 15 20 8) - SymbolLine(0 25 5 20 8) - SymbolLine(0 25 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(20 20 20 35 8) - SymbolLine(20 35 25 40 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) -) -Symbol('b' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) - SymbolLine(20 25 20 35 8) - SymbolLine(15 20 20 25 8) - SymbolLine(5 20 15 20 8) - SymbolLine(0 25 5 20 8) -) -Symbol('c' 12) -( - SymbolLine(5 20 20 20 8) - SymbolLine(0 25 5 20 8) - SymbolLine(0 25 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 20 40 8) -) -Symbol('d' 12) -( - SymbolLine(20 0 20 40 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 35 5 40 8) - SymbolLine(0 25 0 35 8) - SymbolLine(0 25 5 20 8) - SymbolLine(5 20 15 20 8) - SymbolLine(15 20 20 25 8) -) -Symbol('e' 12) -( - SymbolLine(5 40 20 40 8) - SymbolLine(0 35 5 40 8) - SymbolLine(0 25 0 35 8) - SymbolLine(0 25 5 20 8) - SymbolLine(5 20 15 20 8) - SymbolLine(15 20 20 25 8) - SymbolLine(0 30 20 30 8) - SymbolLine(20 30 20 25 8) -) -Symbol('f' 10) -( - SymbolLine(5 5 5 40 8) - SymbolLine(5 5 10 0 8) - SymbolLine(10 0 15 0 8) - SymbolLine(0 20 10 20 8) -) -Symbol('g' 12) -( - SymbolLine(15 20 20 25 8) - SymbolLine(5 20 15 20 8) - SymbolLine(0 25 5 20 8) - SymbolLine(0 25 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) - SymbolLine(0 50 5 55 8) - SymbolLine(5 55 15 55 8) - SymbolLine(15 55 20 50 8) - SymbolLine(20 20 20 50 8) -) -Symbol('h' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 25 5 20 8) - SymbolLine(5 20 15 20 8) - SymbolLine(15 20 20 25 8) - SymbolLine(20 25 20 40 8) -) -Symbol('i' 10) -( - SymbolLine(0 10 0 15 8) - SymbolLine(0 25 0 40 8) -) -Symbol('j' 10) -( - SymbolLine(5 10 5 15 8) - SymbolLine(5 25 5 50 8) - SymbolLine(0 55 5 50 8) -) -Symbol('k' 12) -( - SymbolLine(0 0 0 40 8) - SymbolLine(0 25 15 40 8) - SymbolLine(0 25 10 15 8) -) -Symbol('l' 10) -( - SymbolLine(0 0 0 35 8) - SymbolLine(0 35 5 40 8) -) -Symbol('m' 12) -( - SymbolLine(5 25 5 40 8) - SymbolLine(5 25 10 20 8) - SymbolLine(10 20 15 20 8) - SymbolLine(15 20 20 25 8) - SymbolLine(20 25 20 40 8) - SymbolLine(20 25 25 20 8) - SymbolLine(25 20 30 20 8) - SymbolLine(30 20 35 25 8) - SymbolLine(35 25 35 40 8) - SymbolLine(0 20 5 25 8) -) -Symbol('n' 12) -( - SymbolLine(5 25 5 40 8) - SymbolLine(5 25 10 20 8) - SymbolLine(10 20 15 20 8) - SymbolLine(15 20 20 25 8) - SymbolLine(20 25 20 40 8) - SymbolLine(0 20 5 25 8) -) -Symbol('o' 12) -( - SymbolLine(0 25 0 35 8) - SymbolLine(0 25 5 20 8) - SymbolLine(5 20 15 20 8) - SymbolLine(15 20 20 25 8) - SymbolLine(20 25 20 35 8) - SymbolLine(15 40 20 35 8) - SymbolLine(5 40 15 40 8) - SymbolLine(0 35 5 40 8) -) -Symbol('p' 12) -( - SymbolLine(5 25 5 55 8) - SymbolLine(0 20 5 25 8) - SymbolLine(5 25 10 20 8) - SymbolLine(10 20 20 20 8) - SymbolLine(20 20 25 25 8) - SymbolLine(25 25 25 35 8) - SymbolLine(20 40 25 35 8) - SymbolLine(10 40 20 40 8) - SymbolLine(5 35 10 40 8) -) -Symbol('q' 12) -( - SymbolLine(20 25 20 55 8) - SymbolLine(15 20 20 25 8) - SymbolLine(5 20 15 20 8) - SymbolLine(0 25 5 20 8) - SymbolLine(0 25 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) -) -Symbol('r' 12) -( - SymbolLine(5 25 5 40 8) - SymbolLine(5 25 10 20 8) - SymbolLine(10 20 20 20 8) - SymbolLine(0 20 5 25 8) -) -Symbol('s' 12) -( - SymbolLine(5 40 20 40 8) - SymbolLine(20 40 25 35 8) - SymbolLine(20 30 25 35 8) - SymbolLine(5 30 20 30 8) - SymbolLine(0 25 5 30 8) - SymbolLine(0 25 5 20 8) - SymbolLine(5 20 20 20 8) - SymbolLine(20 20 25 25 8) - SymbolLine(0 35 5 40 8) -) -Symbol('t' 10) -( - SymbolLine(5 0 5 35 8) - SymbolLine(5 35 10 40 8) - SymbolLine(0 15 10 15 8) -) -Symbol('u' 12) -( - SymbolLine(0 20 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) - SymbolLine(20 20 20 35 8) -) -Symbol('v' 12) -( - SymbolLine(0 20 0 30 8) - SymbolLine(0 30 10 40 8) - SymbolLine(10 40 20 30 8) - SymbolLine(20 20 20 30 8) -) -Symbol('w' 12) -( - SymbolLine(0 20 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(5 40 10 40 8) - SymbolLine(10 40 15 35 8) - SymbolLine(15 20 15 35 8) - SymbolLine(15 35 20 40 8) - SymbolLine(20 40 25 40 8) - SymbolLine(25 40 30 35 8) - SymbolLine(30 20 30 35 8) -) -Symbol('x' 12) -( - SymbolLine(0 20 20 40 8) - SymbolLine(0 40 20 20 8) -) -Symbol('y' 12) -( - SymbolLine(0 20 0 35 8) - SymbolLine(0 35 5 40 8) - SymbolLine(20 20 20 50 8) - SymbolLine(15 55 20 50 8) - SymbolLine(5 55 15 55 8) - SymbolLine(0 50 5 55 8) - SymbolLine(5 40 15 40 8) - SymbolLine(15 40 20 35 8) -) -Symbol('z' 12) -( - SymbolLine(0 20 20 20 8) - SymbolLine(0 40 20 20 8) - SymbolLine(0 40 20 40 8) -) -Symbol('{' 12) -( - SymbolLine(5 5 10 0 8) - SymbolLine(5 5 5 15 8) - SymbolLine(0 20 5 15 8) - SymbolLine(0 20 5 25 8) - SymbolLine(5 25 5 35 8) - SymbolLine(5 35 10 40 8) -) -Symbol('|' 12) -( - SymbolLine(0 0 0 40 8) -) -Symbol('}' 12) -( - SymbolLine(0 0 5 5 8) - SymbolLine(5 5 5 15 8) - SymbolLine(5 15 10 20 8) - SymbolLine(5 25 10 20 8) - SymbolLine(5 25 5 35 8) - SymbolLine(0 40 5 35 8) -) -Symbol('~' 12) -( - SymbolLine(0 25 5 20 8) - SymbolLine(5 20 10 20 8) - SymbolLine(10 20 15 25 8) - SymbolLine(15 25 20 25 8) - SymbolLine(20 25 25 20 8) -) -Via(2075 1455 50 30 28 "" 0x12120002) -Via(1790 1570 50 30 28 "" 0x12120002) -Via(1450 1575 50 30 28 "" 0x12120002) -Via(1070 1265 50 30 28 "" 0x00000002) -Via(1520 2495 50 30 28 "" 0x00000002) -Via(465 3015 110 30 110 "" 0x0000000a) -Via(1605 2660 50 30 28 "" 0x00000002) -Via(1985 1300 50 30 28 "" 0x00000002) -Via(465 605 110 30 110 "" 0x0000000a) -Via(2965 595 110 30 110 "" 0x0000000a) -Via(2965 3005 110 30 110 "" 0x0000000a) -Via(1185 2660 50 30 28 "" 0x00000002) - -Element(0x00000000 "3 TERM BLOCK" "J2" "DK ED1602-ND" 1695 2925 -590 76 0 150 0x00000000) -( - Pin(0 0 110 30 140 48 "1" "1" 0x00000001) - Pin(-194 0 110 30 140 48 "2" "2" 0x00000001) - Pin(-388 0 110 30 140 48 "3" "3" 0x00000001) - ElementLine (-388 160 -388 140 10) - ElementLine (-194 160 -194 140 10) - ElementLine (0 160 0 140 10) - ElementLine (81 -170 101 -170 10) - ElementLine (81 -190 81 -170 10) - ElementLine (101 -190 81 -190 10) - ElementLine (-509 -170 -489 -170 10) - ElementLine (-509 -190 -509 -170 10) - ElementLine (-489 -190 -509 -190 10) - ElementLine (101 -200 101 160 10) - ElementLine (-489 -200 101 -200 10) - ElementLine (-489 160 -489 -200 10) - ElementLine (101 160 -489 160 10) - ) - -Element(0x00000000 "RS422 Transciever" "U6" "LTC490" 1005 895 -505 -55 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "Vcc" "1" 0x00000101) - Pin(0 -100 60 30 90 28 "R" "2" 0x00000001) - Pin(0 -200 60 30 90 28 "D" "3" 0x00000001) - Pin(0 -300 60 30 90 28 "GND" "4" 0x00000001) - Pin(-300 -300 60 30 90 28 "Y" "5" 0x00000001) - Pin(-300 -200 60 30 90 28 "Z" "6" 0x00000001) - Pin(-300 -100 60 30 90 28 "B" "7" 0x00000001) - Pin(-300 0 60 30 90 28 "A" "8" 0x00000001) - ElementLine (50 50 50 -350 10) - ElementLine (50 -350 -350 -350 10) - ElementLine (-350 -350 -350 50 10) - ElementLine (50 50 -100 50 10) - ElementLine (-200 50 -350 50 10) - ElementArc (-150 50 50 50 180 180 10) - ) - -Element(0x00000000 "PIC16C54A" "U5" "PIC16C54" 1195 860 465 80 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "RA2" "1" 0x00000101) - Pin(100 0 60 30 90 28 "RA3" "2" 0x00000001) - Pin(200 0 60 30 90 28 "RTCC" "3" 0x00000001) - Pin(300 0 60 30 90 28 "/MCLR" "4" 0x00000001) - Pin(400 0 60 30 90 28 "Vss" "5" 0x00000001) - Pin(500 0 60 30 90 28 "RB0" "6" 0x00000001) - Pin(600 0 60 30 90 28 "RB1" "7" 0x00000001) - Pin(700 0 60 30 90 28 "RB2" "8" 0x00000001) - Pin(800 0 60 30 90 28 "RB3" "9" 0x00000001) - Pin(800 -300 60 30 90 28 "RB4" "10" 0x00000001) - Pin(700 -300 60 30 90 28 "RB5" "11" 0x00000001) - Pin(600 -300 60 30 90 28 "RB6" "12" 0x00000001) - Pin(500 -300 60 30 90 28 "RB7" "13" 0x00000001) - Pin(400 -300 60 30 90 28 "Vdd" "14" 0x00000001) - Pin(300 -300 60 30 90 28 "OSC2/CLKOUT" "15" 0x00000001) - Pin(200 -300 60 30 90 28 "OSC1/CLKIN" "16" 0x00000001) - Pin(100 -300 60 30 90 28 "RA0" "17" 0x00000001) - Pin(0 -300 60 30 90 28 "RA1" "18" 0x00000001) - ElementLine (-50 50 850 50 10) - ElementLine (850 50 850 -350 10) - ElementLine (850 -350 -50 -350 10) - ElementLine (-50 50 -50 -100 10) - ElementLine (-50 -200 -50 -350 10) - ElementArc (-50 -150 50 50 90 180 10) - ) - -Element(0x00000000 "SMD Cap" "C17" "" 2155 815 -90 -329 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x00000001) - Pin(0 -200 80 30 110 35 "2" "2" 0x00000001) - ElementLine (-50 50 50 50 10) - ElementLine (50 50 50 -250 10) - ElementLine (50 -250 -50 -250 10) - ElementLine (-50 -250 -50 50 10) - ) - -Element(0x00000000 "SMD 0805" "C13" "" 2525 1510 -30 45 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(0 -90 0 -90 60 30 90 "2" "2" 0x00000100) - ElementLine (-35 -125 -35 35 10) - ElementLine (35 -125 -35 -125 10) - ElementLine (35 35 35 -125 10) - ElementLine (-35 35 35 35 10) - ) - -Element(0x00000010 "SMD 0805" "C16" "" 1080 1355 -15 -115 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(90 0 90 0 60 30 90 "2" "2" 0x00000100) - ElementLine (125 -35 -35 -35 10) - ElementLine (125 35 125 -35 10) - ElementLine (-35 35 125 35 10) - ElementLine (-35 -35 -35 35 10) - ) - -Element(0x00000000 "SMD 0805" "C14" "" 1175 1690 -195 20 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(0 90 0 90 60 30 90 "2" "2" 0x00000100) - ElementLine (35 125 35 -35 10) - ElementLine (-35 125 35 125 10) - ElementLine (-35 -35 -35 125 10) - ElementLine (35 -35 -35 -35 10) - ) - -Element(0x00000000 "SMD Cap" "C15" "" 1280 1785 65 -174 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x02000001) - Pin(0 -200 80 30 110 35 "2" "2" 0x00000001) - ElementLine (-50 50 50 50 10) - ElementLine (50 50 50 -250 10) - ElementLine (50 -250 -50 -250 10) - ElementLine (-50 -250 -50 50 10) - ) - -Element(0x00000010 "SMD 0805" "C10" "" 2095 1310 -190 -60 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(90 0 90 0 60 30 90 "2" "2" 0x00000100) - ElementLine (125 -35 -35 -35 10) - ElementLine (125 35 125 -35 10) - ElementLine (-35 35 125 35 10) - ElementLine (-35 -35 -35 35 10) - ) - -Element(0x00000000 "SMD Cap" "C12" "" 2345 1320 -35 -129 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x00000001) - Pin(200 0 80 30 110 35 "2" "2" 0x02020001) - ElementLine (-50 -50 -50 50 10) - ElementLine (-50 50 250 50 10) - ElementLine (250 50 250 -50 10) - ElementLine (250 -50 -50 -50 10) - ) - -Element(0x00000000 "R 0.25W" "R13" "100" 1130 1435 230 65 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x00000101) - Pin(400 0 60 30 90 28 "2" "2" 0x10000001) - ElementLine (100 -50 300 -50 10) - ElementLine (300 -50 300 50 10) - ElementLine (300 50 100 50 10) - ElementLine (100 50 100 -50 10) - ElementLine (40 0 100 0 10) - ElementLine (300 0 360 0 10) - ) - -Element(0x00000000 "R 0.25W" "R14" "100" 1105 1075 -265 60 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x00000001) - Pin(-400 0 60 30 90 28 "2" "2" 0x00000001) - ElementLine (-100 50 -300 50 10) - ElementLine (-300 50 -300 -50 10) - ElementLine (-300 -50 -100 -50 10) - ElementLine (-100 -50 -100 50 10) - ElementLine (-40 0 -100 0 10) - ElementLine (-300 0 -360 0 10) - ) - -Element(0x00000000 "R 0.5W" "R11" "" 2815 1700 60 -90 0 150 0x00000000) -( - Pin(0 0 85 30 115 48 "1" "1" 0x00000101) - Pin(0 -800 85 30 115 48 "2" "2" 0x00000001) - ElementLine (0 -60 0 -115 10) - ElementLine (-115 -115 115 -115 10) - ElementLine (115 -115 115 -685 10) - ElementLine (115 -685 -115 -685 10) - ElementLine (-115 -685 -115 -115 10) - ElementLine (0 -685 0 -750 10) - ) - -Element(0x00000000 "TK11950" "U3" "5.0V" 2235 1510 -139 -2 0 150 0x00000000) -( - Pad(-7 0 8 0 24 30 54 "NOISE BYPASS" "1" 0x00000100) - Pad(-7 37 8 37 24 30 54 "CONTROL" "2" 0x00000100) - Pad(-7 75 8 75 24 30 54 "RESET OUT" "3" 0x00000100) - Pad(119 75 134 75 24 30 54 "VO" "4" 0x00000100) - Pad(119 37 134 37 24 30 54 "GND" "5" 0x00000100) - Pad(119 0 134 0 24 30 54 "VIN" "6" 0x00000100) - ElementLine (0 -22 0 -34 10) - ElementLine (0 -34 132 -34 10) - ElementLine (132 -34 132 -22 10) - ElementLine (0 96 0 108 10) - ElementLine (0 108 132 108 10) - ElementLine (132 108 132 96 10) - ElementLine (13 -24 119 -24 10) - ) - -Element(0x00000000 "TK11950" "U4" "5.0V" 1180 1590 -254 -132 0 150 0x00000000) -( - Pad(7 0 -8 0 24 30 54 "NOISE BYPASS" "1" 0x00000100) - Pad(7 -37 -8 -37 24 30 54 "CONTROL" "2" 0x00000100) - Pad(7 -75 -8 -75 24 30 54 "RESET OUT" "3" 0x00000100) - Pad(-119 -75 -134 -75 24 30 54 "VO" "4" 0x00000100) - Pad(-119 -37 -134 -37 24 30 54 "GND" "5" 0x00000100) - Pad(-119 0 -134 0 24 30 54 "VIN" "6" 0x00000100) - ElementLine (0 22 0 34 10) - ElementLine (0 34 -132 34 10) - ElementLine (-132 34 -132 22 10) - ElementLine (0 -96 0 -108 10) - ElementLine (0 -108 -132 -108 10) - ElementLine (-132 -108 -132 -96 10) - ElementLine (-13 24 -119 24 10) - ) - -Element(0x00000000 "SMD 0805" "C5" "" 1495 1315 -225 -30 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(-90 0 -90 0 60 30 90 "2" "2" 0x00000100) - ElementLine (-125 35 35 35 10) - ElementLine (-125 -35 -125 35 10) - ElementLine (35 -35 -125 -35 10) - ElementLine (35 35 35 -35 10) - ) - -Element(0x00000010 "SMD 0805" "C11" "" 2270 1420 -260 -30 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(-90 0 -90 0 60 30 90 "2" "2" 0x00000100) - ElementLine (-125 35 35 35 10) - ElementLine (-125 -35 -125 35 10) - ElementLine (35 -35 -125 -35 10) - ElementLine (35 35 35 -35 10) - ) - -Element(0x00000000 "SMD Cap" "C9" "" 2030 1185 -145 -40 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x20200001) - Pin(200 0 80 30 110 35 "2" "2" 0x02020001) - ElementLine (0 45 0 50 10) - ElementLine (0 50 200 50 10) - ElementLine (200 50 200 45 10) - ElementLine (200 -45 200 -50 10) - ElementLine (200 -50 0 -50 10) - ElementLine (0 -50 0 -45 10) - ) - -Element(0x00000000 "R 0.25W" "R7" "100" 1655 2065 150 -30 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x02000001) - Pin(400 0 60 30 90 28 "2" "2" 0x02020001) - ElementLine (100 -50 300 -50 10) - ElementLine (300 -50 300 50 10) - ElementLine (300 50 100 50 10) - ElementLine (100 50 100 -50 10) - ElementLine (40 0 100 0 10) - ElementLine (300 0 360 0 10) - ) - -Element(0x00000000 "SMD Cap" "C8" "" 2030 1075 65 -124 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x20200001) - Pin(200 0 80 30 110 35 "2" "2" 0x02020001) - ElementLine (-50 -50 -50 50 10) - ElementLine (-50 50 250 50 10) - ElementLine (250 50 250 -50 10) - ElementLine (250 -50 -50 -50 10) - ) - -Element(0x00000000 "SMD Cap" "C7" "" 1530 1075 -370 -144 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x20200001) - Pin(-200 0 80 30 110 35 "2" "2" 0x10100001) - ElementLine (50 50 50 -50 10) - ElementLine (50 -50 -250 -50 10) - ElementLine (-250 -50 -250 50 10) - ElementLine (-250 50 50 50 10) - ) - -Element(0x00000000 "SMD Cap" "C2" "" 1945 1845 65 -19 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x02000101) - Pin(-200 0 80 30 110 35 "2" "2" 0x02000001) - ElementLine (50 50 50 -50 10) - ElementLine (50 -50 -250 -50 10) - ElementLine (-250 -50 -250 50 10) - ElementLine (-250 50 50 50 10) - ) - -Element(0x00000000 "SMD Cap" "C6" "" 1530 1185 -335 -30 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x20200001) - Pin(-200 0 80 30 110 35 "2" "2" 0x10100001) - ElementLine (0 -45 0 -50 10) - ElementLine (0 -50 -200 -50 10) - ElementLine (-200 -50 -200 -45 10) - ElementLine (-200 45 -200 50 10) - ElementLine (-200 50 0 50 10) - ElementLine (0 50 0 45 10) - ) - -Element(0x00000000 "SMD Cap" "C1" "" 1490 1950 -40 71 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x00000101) - Pin(0 -200 80 30 110 35 "2" "2" 0x02000001) - ElementLine (-50 50 50 50 10) - ElementLine (50 50 50 -250 10) - ElementLine (50 -250 -50 -250 10) - ElementLine (-50 -250 -50 50 10) - ) - -Element(0x00000000 "R 0.25W" "R6" "100" 2375 1680 65 115 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x02000101) - Pin(0 400 60 30 90 28 "2" "2" 0x02000001) - ElementLine (50 100 50 300 10) - ElementLine (50 300 -50 300 10) - ElementLine (-50 300 -50 100 10) - ElementLine (-50 100 50 100 10) - ElementLine (0 40 0 100 10) - ElementLine (0 300 0 360 10) - ) - -Element(0x00000000 "R 0.25W" "R8" "100" 2270 1680 -30 245 1 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x02000101) - Pin(0 400 60 30 90 28 "2" "2" 0x02000001) - ElementLine (50 100 50 300 10) - ElementLine (50 300 -50 300 10) - ElementLine (-50 300 -50 100 10) - ElementLine (-50 100 50 100 10) - ElementLine (0 40 0 100 10) - ElementLine (0 300 0 360 10) - ) - -Element(0x00000000 "R 0.25W" "R5" "100" 1375 1750 -170 175 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x00000101) - Pin(0 400 60 30 90 28 "2" "2" 0x00000001) - ElementLine (50 100 50 300 10) - ElementLine (50 300 -50 300 10) - ElementLine (-50 300 -50 100 10) - ElementLine (-50 100 50 100 10) - ElementLine (0 40 0 100 10) - ElementLine (0 300 0 360 10) - ) - -Element(0x00000000 "R 0.25W" "R9" "100" 1655 2170 125 -25 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x02000001) - Pin(400 0 60 30 90 28 "2" "2" 0x02020001) - ElementLine (100 -50 300 -50 10) - ElementLine (300 -50 300 50 10) - ElementLine (300 50 100 50 10) - ElementLine (100 50 100 -50 10) - ElementLine (40 0 100 0 10) - ElementLine (300 0 360 0 10) - ) - -Element(0x00000000 "R 0.25W" "R10" "100" 2160 1675 -30 275 1 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x02000101) - Pin(0 400 60 30 90 28 "2" "2" 0x02020001) - ElementLine (50 100 50 300 10) - ElementLine (50 300 -50 300 10) - ElementLine (-50 300 -50 100 10) - ElementLine (-50 100 50 100 10) - ElementLine (0 40 0 100 10) - ElementLine (0 300 0 360 10) - ) - -Element(0x00000000 "ADC12138CIMSA" "U2" "ADC12138" 1630 1690 105 -449 0 150 0x00000000) -( - Pad(0 30 0 -30 12 30 42 "CH0" "1" 0x00000100) - Pad(26 30 26 -30 12 30 42 "CH1" "2" 0x00000100) - Pad(51 30 51 -30 12 30 42 "CH2" "3" 0x00000100) - Pad(77 30 77 -30 12 30 42 "CH3" "4" 0x00000100) - Pad(102 30 102 -30 12 30 42 "CH4" "5" 0x00000100) - Pad(128 30 128 -30 12 30 42 "CH5" "6" 0x00000100) - Pad(154 30 154 -30 12 30 42 "CH6" "7" 0x00000100) - Pad(179 30 179 -30 12 30 42 "CH7" "8" 0x00000100) - Pad(205 30 205 -30 12 30 42 "COM" "9" 0x00000100) - Pad(230 30 230 -30 12 30 42 "MuOut1" "10" 0x00000100) - Pad(256 30 256 -30 12 30 42 "A/Din1" "11" 0x00000100) - Pad(281 30 281 -30 12 30 42 "MuxOut2" "12" 0x00000100) - Pad(307 30 307 -30 12 30 42 "A/Din2" "13" 0x00000100) - Pad(333 30 333 -30 12 30 42 "DGND" "14" 0x00000100) - Pad(333 -350 333 -290 12 30 42 "VA+" "15" 0x00000100) - Pad(307 -350 307 -290 12 30 42 "Vref-" "16" 0x00000100) - Pad(281 -350 281 -290 12 30 42 "Vref+" "17" 0x00000100) - Pad(256 -350 256 -290 12 30 42 "AGND" "18" 0x00000100) - Pad(230 -350 230 -290 12 30 42 "PD" "19" 0x00000100) - Pad(205 -350 205 -290 12 30 42 "EOC" "20" 0x00000100) - Pad(179 -350 179 -290 12 30 42 "~CONV" "21" 0x00000100) - Pad(154 -350 154 -290 12 30 42 "~CS" "22" 0x00000100) - Pad(128 -350 128 -290 12 30 42 "DO" "23" 0x00000100) - Pad(102 -350 102 -290 12 30 42 "DI" "24" 0x00000100) - Pad(77 -350 77 -290 12 30 42 "SCLK" "25" 0x00000100) - Pad(51 -350 51 -290 12 30 42 "CCLK" "26" 0x00000100) - Pad(26 -350 26 -290 12 30 42 "~DOR" "27" 0x00000100) - Pad(0 -350 0 -290 12 30 42 "VD+" "28" 0x00000100) - ElementLine (0 -70 0 -70 30) - ElementLine (-12 -54 -37 -54 10) - ElementLine (-37 -54 -37 -266 10) - ElementLine (-37 -266 -12 -266 10) - ElementLine (343 -54 370 -54 10) - ElementLine (370 -54 370 -266 10) - ElementLine (370 -266 343 -266 10) - ) - -Element(0x00000000 "R 0.25W" "R4" "100" 1615 1955 130 -35 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x00000101) - Pin(400 0 60 30 90 28 "2" "2" 0x02000001) - ElementLine (100 -50 300 -50 10) - ElementLine (300 -50 300 50 10) - ElementLine (300 50 100 50 10) - ElementLine (100 50 100 -50 10) - ElementLine (40 0 100 0 10) - ElementLine (300 0 360 0 10) - ) - -Element(0x00000010 "SMD 0805" "C4" "" 2070 2390 -25 -180 0 115 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(0 -90 0 -90 60 30 90 "2" "2" 0x00000100) - ElementLine (-35 -125 -35 35 10) - ElementLine (35 -125 -35 -125 10) - ElementLine (35 35 35 -125 10) - ElementLine (-35 35 35 35 10) - ) - -Element(0x00000000 "R 0.25W" "R1" "100" 2180 2625 -35 -145 1 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x00000101) - Pin(0 -400 60 30 90 28 "2" "2" 0x02000001) - ElementLine (-50 -100 -50 -300 10) - ElementLine (-50 -300 50 -300 10) - ElementLine (50 -300 50 -100 10) - ElementLine (50 -100 -50 -100 10) - ElementLine (0 -40 0 -100 10) - ElementLine (0 -300 0 -360 10) - ) - -Element(0x00000000 "R 0.25W" "R2" "100" 2400 2625 60 -100 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x00000101) - Pin(0 -400 60 30 90 28 "2" "2" 0x02000001) - ElementLine (-50 -100 -50 -300 10) - ElementLine (-50 -300 50 -300 10) - ElementLine (50 -300 50 -100 10) - ElementLine (50 -100 -50 -100 10) - ElementLine (0 -40 0 -100 10) - ElementLine (0 -300 0 -360 10) - ) - -Element(0x00000000 "LM13700" "U1" "LM13700" 1955 2285 -475 -130 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "Iabc1" "1" 0x02000101) - Pin(-100 0 60 30 90 28 "Dbias1" "2" 0x00000001) - Pin(-200 0 60 30 90 28 "In+1" "3" 0x00000001) - Pin(-300 0 60 30 90 28 "In-1" "4" 0x00000001) - Pin(-400 0 60 30 90 28 "Out1" "5" 0x00000001) - Pin(-500 0 60 30 90 28 "V-" "6" 0x00000001) - Pin(-600 0 60 30 90 28 "BufIn1" "7" 0x00000001) - Pin(-700 0 60 30 90 28 "BufOut1" "8" 0x00000001) - Pin(-700 300 60 30 90 28 "BufOut2" "9" 0x00000001) - Pin(-600 300 60 30 90 28 "BufIn2" "10" 0x00000001) - Pin(-500 300 60 30 90 28 "V+" "11" 0x00000001) - Pin(-400 300 60 30 90 28 "Out2" "12" 0x00000001) - Pin(-300 300 60 30 90 28 "In-2" "13" 0x00000001) - Pin(-200 300 60 30 90 28 "In+2" "14" 0x00000001) - Pin(-100 300 60 30 90 28 "Dbias2" "15" 0x00000001) - Pin(0 300 60 30 90 28 "Iabc2" "16" 0x00000001) - ElementLine (50 -50 -750 -50 10) - ElementLine (-750 -50 -750 350 10) - ElementLine (-750 350 50 350 10) - ElementLine (50 -50 50 100 10) - ElementLine (50 200 50 350 10) - ElementArc (50 150 50 50 270 180 10) - ) - -Element(0x00000000 "R 0.25W" "R3" "100" 2290 2625 -30 -135 1 150 0x00000000) -( - Pin(0 0 60 30 90 28 "1" "1" 0x00000101) - Pin(0 -400 60 30 90 28 "2" "2" 0x02000001) - ElementLine (-50 -100 -50 -300 10) - ElementLine (-50 -300 50 -300 10) - ElementLine (50 -300 50 -100 10) - ElementLine (50 -100 -50 -100 10) - ElementLine (0 -40 0 -100 10) - ElementLine (0 -300 0 -360 10) - ) - -Element(0x00000000 "SMD 0805" "C3" "" 2075 2510 -40 140 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(0 90 0 90 60 30 90 "2" "2" 0x00000100) - ElementLine (35 125 35 -35 10) - ElementLine (-35 125 35 125 10) - ElementLine (-35 -35 -35 125 10) - ElementLine (35 -35 -35 -35 10) - ) - -Element(0x00000000 "CTX169" "X1" "20 MHz" 2330 910 425 -215 0 150 0x00000000) -( - Pin(0 -60 60 30 90 28 "NC" "1" 0x00000101) - Pin(300 -60 60 30 90 28 "GND" "2" 0x00000001) - Pin(300 -360 60 30 90 28 "OUT" "3" 0x00000001) - Pin(0 -360 60 30 90 28 "Vdd" "4" 0x00000001) - ElementLine (-110 50 -110 -410 10) - ElementLine (-60 -460 350 -460 10) - ElementLine (400 -410 400 0 10) - ElementLine (350 50 -110 50 10) - ElementArc (-60 -410 50 50 270 90 10) - ElementArc (350 -410 50 50 180 90 10) - ElementArc (350 0 50 50 90 90 10) - ) - -Element(0x00000000 "SMD Cap" "C21" "" 2565 1070 -50 61 0 150 0x00000000) -( - Pin(0 0 80 30 110 35 "1" "1" 0x00000001) - Pin(-200 0 80 30 110 35 "2" "2" 0x02020001) - ElementLine (50 50 50 -50 10) - ElementLine (50 -50 -250 -50 10) - ElementLine (-250 -50 -250 50 10) - ElementLine (-250 50 50 50 10) - ) - -Element(0x00000000 "SMD 0805" "C20" "" 2665 2375 -115 55 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(-90 0 -90 0 60 30 90 "2" "2" 0x00000100) - ElementLine (-125 35 35 35 10) - ElementLine (-125 -35 -125 35 10) - ElementLine (35 -35 -125 -35 10) - ElementLine (35 35 35 -35 10) - ) - -Element(0x00000000 "SMD 0805" "C19" "" 2785 2375 -20 55 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(90 0 90 0 60 30 90 "2" "2" 0x00000100) - ElementLine (125 -35 -35 -35 10) - ElementLine (125 35 125 -35 10) - ElementLine (-35 35 125 35 10) - ElementLine (-35 -35 -35 35 10) - ) - -Element(0x00000000 "SMD 0805" "C18" "" 2665 1800 155 -20 0 150 0x00000000) -( - Pad(0 0 0 0 60 30 90 "1" "1" 0x00000100) - Pad(90 0 90 0 60 30 90 "2" "2" 0x00000100) - ElementLine (125 -35 -35 -35 10) - ElementLine (125 35 125 -35 10) - ElementLine (-35 35 125 35 10) - ElementLine (-35 -35 -35 35 10) - ) - -Element(0x00000000 "AMP 745781-4" "J3" "A2100-ND" 820 1610 -125 837 0 150 0x00000000) -( - Pin(0 432 80 30 110 42 "1" "1" 0x00000101) - Pin(0 324 80 30 110 42 "2" "2" 0x00000001) - Pin(0 216 80 30 110 42 "3" "3" 0x00000001) - Pin(0 108 80 30 110 42 "4" "4" 0x00000001) - Pin(0 0 80 30 110 42 "5" "5" 0x00000001) - Pin(-112 378 80 30 110 42 "6" "6" 0x00000001) - Pin(-112 270 80 30 110 42 "7" "7" 0x00000001) - Pin(-112 162 80 30 110 42 "8" "8" 0x00000001) - Pin(-112 54 80 30 110 42 "9" "9" 0x00000001) - Pin(-56 -276 120 30 150 120 "MOUNT HOLE" "10" 0x00000009) - Pin(-56 708 120 30 150 120 "MOUNT HOLE" "11" 0x00000009) - ElementLine (-317 -390 58 -390 10) - ElementLine (-317 -138 -317 -390 10) - ElementLine (-433 455 -434 -22 10) - ElementLine (-317 823 -317 571 10) - ElementLine (58 823 -317 823 10) - ElementLine (58 -390 58 823 10) - ElementArc (-375 -138 58 58 90 90 10) - ElementArc (-375 -22 58 58 270 90 10) - ElementArc (-375 455 58 58 0 90 10) - ElementArc (-375 571 58 58 180 90 10) - ) - -Element(0x00000000 "3 TERM BLOCK" "J1" "DK ED1602-ND" 2285 2925 140 51 0 150 0x00000000) -( - Pin(0 0 110 30 140 48 "1" "1" 0x00000001) - Pin(-194 0 110 30 140 48 "2" "2" 0x00000001) - Pin(-388 0 110 30 140 48 "3" "3" 0x00000001) - ElementLine (-388 160 -388 140 10) - ElementLine (-194 160 -194 140 10) - ElementLine (0 160 0 140 10) - ElementLine (81 -170 101 -170 10) - ElementLine (81 -190 81 -170 10) - ElementLine (101 -190 81 -190 10) - ElementLine (-509 -170 -489 -170 10) - ElementLine (-509 -190 -509 -170 10) - ElementLine (-489 -190 -509 -190 10) - ElementLine (101 -200 101 160 10) - ElementLine (-489 -200 101 -200 10) - ElementLine (-489 160 -489 -200 10) - ElementLine (101 160 -489 160 10) - ) - -Element(0x00000000 "OP-AMP" "U7" "LTC1152" 2575 1925 380 200 0 150 0x00000000) -( - Pin(0 0 60 30 90 28 "SHDN" "1" 0x02000101) - Pin(0 100 60 30 90 28 "-IN" "2" 0x02000001) - Pin(0 200 60 30 90 28 "+IN" "3" 0x02000001) - Pin(0 300 60 30 90 28 "V-" "4" 0x02020001) - Pin(300 300 60 30 90 28 "COMP" "5" 0x02000001) - Pin(300 200 60 30 90 28 "OUT" "6" 0x02000001) - Pin(300 100 60 30 90 28 "V+" "7" 0x02000001) - Pin(300 0 60 30 90 28 "CP" "8" 0x02000001) - ElementLine (-50 -50 -50 350 10) - ElementLine (-50 350 350 350 10) - ElementLine (350 350 350 -50 10) - ElementLine (-50 -50 100 -50 10) - ElementLine (200 -50 350 -50 10) - ElementArc (150 -50 50 50 0 180 10) - ) - -Element(0x00000000 "R 0.5W" "R12" "" 1035 1935 -205 700 0 150 0x00000000) -( - Pin(0 0 85 30 115 48 "1" "1" 0x00000101) - Pin(0 800 90 30 120 48 "2" "2" 0x00000001) - ElementLine (0 60 0 115 10) - ElementLine (115 115 -115 115 10) - ElementLine (-115 115 -115 685 10) - ElementLine (-115 685 115 685 10) - ElementLine (115 685 115 115 10) - ElementLine (0 685 0 750 10) - ) -Rat(1187 1553 0 1061 1553 0 0x00000010) -Rat(1045 1820 1 1175 1780 0 0x00000010) -Rat(1330 1185 1 1405 1315 0 0x00000010) -Rat(2075 1455 1 2180 1420 0 0x00000010) -Rat(2180 1420 0 2185 1310 0 0x00000010) -Rat(2228 1547 0 2354 1547 0 0x00000010) -Layer(1 "solder") -( - Line(1945 1015 1945 1260 15 30 0x00000000) - Line(1615 1960 1555 1960 10 30 0x00000000) - Line(1185 2230 1185 2655 15 30 0x00000000) - Line(705 795 890 980 15 30 0x00000000) - Line(1405 955 1485 875 15 30 0x00000000) - Line(1005 695 1140 560 15 30 0x00000000) - Line(1005 795 1135 665 15 30 0x00000000) - Line(705 895 705 1075 15 30 0x00000000) - Line(1125 1435 1005 1315 15 30 0x00000000) - Line(1005 1235 1065 1175 15 30 0x00000000) - Line(1010 980 1105 1075 15 30 0x00000000) - Line(1345 955 1405 955 15 30 0x00000000) - Line(1065 1175 1125 1175 15 30 0x00000000) - Line(1190 665 1295 560 15 30 0x00000000) - Line(1375 1750 1375 2040 15 30 0x00000000) - Line(1605 2435 1605 2660 10 30 0x00000000) - Line(1655 2285 1520 2420 15 30 0x00000000) - Line(1375 2040 1185 2230 15 30 0x00000000) - Line(1135 665 1190 665 15 30 0x00000000) - Line(1105 1075 970 1210 15 30 0x00000000) - Line(890 980 1010 980 15 30 0x00000000) - Line(2460 965 1995 965 15 30 0x00000000) - Line(1855 2285 1855 2585 15 30 0x00000000) - Line(970 1210 970 1568 15 30 0x00000000) - Line(1520 2420 1520 2495 15 30 0x00000000) - Line(1755 2285 1605 2435 10 30 0x00000000) - Line(1995 965 1945 1015 15 30 0x00000000) - Line(1005 1315 1005 1235 15 30 0x00000000) - Line(2565 1070 2460 965 15 30 0x00000000) - Line(1945 1260 1985 1300 15 30 0x00000000) - Line(1125 1175 1345 955 15 30 0x00000000) - Line(2400 2625 2290 2625 10 30 0x00000000) - Line(970 1568 820 1718 15 30 0x00000000) - Line(1140 560 1195 560 15 30 0x00000000) - Line(1555 1960 1555 2285 10 30 0x00000000) - Text(525 2805 0 120 "LED (BACK)" 0x00000080) -) -Layer(2 "GND-solder") -( - Line(820 2045 920 2145 35 30 0x00000040) - Line(930 1820 930 1932 30 30 0x00000000) - Line(1280 1585 1045 1820 30 30 0x00000000) - Line(1045 1820 930 1820 30 30 0x00000000) - Line(930 1932 820 2042 30 30 0x00000000) - Line(2155 815 2120 780 40 30 0x00000000) - Line(1675 780 1595 860 40 30 0x00000000) - Line(2630 850 2535 755 40 30 0x00000000) - Line(2120 780 1675 780 40 30 0x00000000) - Line(2215 755 2155 815 40 30 0x00000000) - Line(2535 755 2215 755 40 30 0x00000000) - Polygon(0x00000010) - ( - (1125 2635) (1125 2235) (1330 2030) (1330 1705) (1430 1705) - (1430 1635) (1400 1635) (1400 1560) (1240 1720) (1115 1845) - (1115 2010) (1030 2010) (895 2145) (895 2635) - ) - Polygon(0x00000010) - ( - (1430 1885) (1570 1885) (1670 1885) (1670 2000) (1590 2000) - (1590 2235) (1925 2235) (1925 2525) (2645 2525) (2645 1250) - (2405 1250) (2405 1340) (2370 1375) (2320 1375) (2285 1340) - (2285 1305) (2300 1290) (2300 1290) (2300 1135) (2430 1135) - (2430 1005) (2090 1005) (2090 1280) (2000 1370) (2000 1515) - (1370 1515) (1370 1640) (1430 1640) - ) - Polygon(0x00000010) - ( - (2635 1250) (2635 1615) (2895 1615) (2895 1785) (2750 1785) - (2750 2520) (2975 2520) (2975 1250) - ) -) -Layer(3 "Vcc-solder") -( - Line(1455 2780 2695 2780 35 30 0x00000000) - Line(1035 2735 1445 2735 45 30 0x00000000) - Line(2340 1195 2815 1195 30 30 0x00000000) - Line(2815 1195 2815 900 30 30 0x00000000) - Line(1530 1180 1530 1435 30 30 0x00000000) - Line(1070 1265 1525 1265 35 30 0x00000000) - Line(1145 765 1395 765 35 30 0x00000000) - Line(1010 900 1145 765 35 30 0x00000000) - Line(1395 765 1595 565 35 30 0x00000000) - Line(2155 615 2110 660 40 30 0x00000000) - Line(1695 660 1595 560 40 30 0x00000000) - Line(2330 550 2155 615 45 30 0x00000000) - Line(2110 660 1695 660 40 30 0x00000000) - Line(2340 1315 2340 1195 30 30 0x00000000) - Line(2695 1700 2810 1700 30 30 0x00000000) - Line(1455 2585 1355 2285 45 30 0x00000000) - Line(1455 2590 1455 2780 35 30 0x00000000) - Line(2695 2780 2695 1700 30 30 0x00000000) -) -Layer(4 "component") -( - Line(685 2450 585 2350 35 30 0x00000000) - Line(2975 1480 2565 1070 15 30 0x00000000) - Line(2975 2025 2975 1480 15 30 0x00000000) - Line(2875 2125 2975 2025 15 30 0x00000000) - Line(980 1270 980 1774 15 30 0x00000000) - Line(585 1787 708 1664 35 30 0x00000000) - Line(2675 2125 2575 2025 15 30 0x00000000) - Line(2120 2285 2180 2225 15 30 0x00000000) - Line(2055 720 2055 895 10 30 0x00000000) - Line(1835 1285 1835 1340 10 30 0x00000000) - Line(1860 1261 1835 1285 10 30 0x00000000) - Line(1860 1035 1860 1261 10 30 0x00000000) - Line(2090 655 2090 910 10 30 0x00000000) - Line(1995 560 2090 655 10 30 0x00000000) - Line(1809 1263 1809 1340 10 30 0x00000000) - Line(1829 1244 1809 1263 10 30 0x00000000) - Line(1829 1024 1829 1244 10 30 0x00000000) - Line(1991 959 1893 959 10 30 0x00000000) - Line(2235 1500 2235 1475 15 30 0x00000000) - Line(2055 895 1991 959 10 30 0x00000000) - Line(2075 2515 2075 2415 30 30 0x00000000) - Line(1490 1950 1505 1950 10 30 0x00000000) - Line(2075 2415 1520 2415 30 30 0x00000000) - Line(2175 2145 2205 2145 15 30 0x00000000) - Line(1655 1800 1656 1720 10 30 0x00000000) - Line(1490 1950 1490 2150 15 30 0x00000000) - Line(1745 1845 1635 1955 15 30 0x00000000) - Line(1775 1780 1707 1780 10 30 0x00000000) - Line(1655 2170 1945 2170 15 30 0x00000000) - Line(1950 2285 2070 2285 15 30 0x00000000) - Line(1655 2170 1635 2150 15 30 0x00000000) - Line(1655 2065 1835 1885 15 30 0x00000000) - Line(2015 1955 2255 1955 15 30 0x00000000) - Line(2180 2625 2290 2625 15 30 0x00000000) - Line(2075 2615 1985 2615 15 30 0x00000000) - Line(2125 2585 2290 2420 10 30 0x00000000) - Line(2205 2145 2270 2080 15 30 0x00000000) - Line(1315 2225 1255 2285 15 30 0x00000000) - Line(1855 2285 1795 2225 15 30 0x00000000) - Line(2125 2615 2125 2585 10 30 0x00000000) - Line(2495 2530 2400 2625 15 30 0x00000000) - Line(1795 2225 1315 2225 15 30 0x00000000) - Line(1520 2415 1455 2285 30 30 0x00000000) - Line(2440 2110 2345 2205 15 30 0x00000000) - Line(1490 1750 1600 1750 10 30 0x00000000) - Line(2075 2615 2125 2615 10 30 0x00000000) - Line(2875 1800 2755 1800 15 30 0x00000000) - Line(1635 2150 1375 2150 15 30 0x00000000) - Line(1835 1840 1775 1780 10 30 0x00000000) - Line(2000 2225 2095 2225 15 30 0x00000000) - Line(1732 1750 1732 1720 10 30 0x00000000) - Line(1911 1720 1937 1720 10 30 0x00000000) - Line(1985 1300 1937 1300 10 30 0x00000000) - Line(2015 985 1909 985 10 30 0x00000000) - Line(1860 1720 1886 1720 10 30 0x00000000) - Line(1745 1845 1681 1845 10 30 0x00000000) - Line(1950 1840 1835 1840 15 30 0x00000000) - Line(1707 1780 1707 1720 10 30 0x00000000) - Line(1681 1845 1681 1720 10 30 0x00000000) - Line(1122 2585 1122 2740 15 30 0x00000000) - Line(2070 2285 2120 2285 15 30 0x00000000) - Line(1490 1750 1375 1750 15 30 0x00000000) - Line(1950 1840 2015 1955 15 30 0x00000000) - Line(1635 1955 1615 1955 10 30 0x00000000) - Line(2160 1750 1732 1750 10 30 0x00000000) - Line(2160 1675 2440 1955 15 30 0x00000000) - Line(2160 1680 2160 1750 10 30 0x00000000) - Line(1945 2170 2000 2225 15 30 0x00000000) - Line(1505 1950 1655 1800 10 30 0x00000000) - Line(1190 1595 1190 1675 15 30 0x00000000) - Line(1190 1510 1190 1435 15 30 0x00000000) - Line(1190 1435 1130 1435 15 30 0x00000000) - Line(1695 860 1695 1276 10 30 0x00000000) - Line(1795 860 1732 923 10 30 0x00000000) - Line(1797 1015 1797 1225 10 30 0x00000000) - Line(1995 860 1927 927 10 30 0x00000000) - Line(1495 560 1646 711 10 30 0x00000000) - Line(1657 973 1657 1279 10 30 0x00000000) - Line(1657 1279 1681 1303 10 30 0x00000000) - Line(1681 1303 1681 1340 10 30 0x00000000) - Line(1927 927 1885 927 10 30 0x00000000) - Line(1895 860 1758 997 10 30 0x00000000) - Line(1732 923 1732 1340 10 30 0x00000000) - Line(1893 959 1829 1024 10 30 0x00000000) - Line(1646 962 1657 973 10 30 0x00000000) - Line(1797 1225 1784 1239 10 30 0x00000000) - Line(1646 711 1646 962 10 30 0x00000000) - Line(1895 560 2055 720 10 30 0x00000000) - Line(1885 927 1797 1015 10 30 0x00000000) - Line(2090 910 2015 985 10 30 0x00000000) - Line(1985 2615 1955 2585 15 30 0x00000000) - Line(1758 997 1758 1340 10 30 0x00000000) - Line(1707 1288 1707 1340 10 30 0x00000000) - Line(2235 1475 2275 1435 15 30 0x00000000) - Line(1909 985 1860 1035 10 30 0x00000000) - Line(1005 1195 1005 895 35 30 0x00000000) - Line(1060 1255 1005 1195 35 30 0x00000000) - Line(585 2350 585 1787 35 30 0x00000000) - Line(705 595 875 765 15 30 0x00000000) - Line(795 785 795 1155 15 30 0x00000000) - Line(2555 475 1480 475 15 30 0x00000000) - Line(2630 550 2555 475 15 30 0x00000000) - Line(1455 2285 1290 2450 35 30 0x00000000) - Line(875 765 875 1165 15 30 0x00000000) - Line(705 695 795 785 15 30 0x00000000) - Line(980 1774 820 1934 15 30 0x00000000) - Line(705 1075 635 1145 15 30 0x00000000) - Line(2290 2420 2290 2225 10 30 0x00000000) - Line(1480 475 1395 560 15 30 0x00000000) - Line(635 1425 820 1610 15 30 0x00000000) - Line(875 1165 980 1270 15 30 0x00000000) - Line(2095 2225 2175 2145 15 30 0x00000000) - Line(1290 2450 685 2450 35 30 0x00000000) - Line(1600 1750 1630 1720 10 30 0x00000000) - Line(1897 2827 1897 2925 15 30 0x00000000) - Line(915 1731 820 1826 15 30 0x00000000) - Line(915 1275 915 1731 15 30 0x00000000) - Line(1755 2585 2091 2925 15 30 0x00000000) - Line(1501 2764 1501 2925 15 30 0x00000000) - Line(1655 2585 1897 2827 15 30 0x00000000) - Line(1182 2525 1122 2585 15 30 0x00000000) - Line(1520 2495 1490 2525 15 30 0x00000000) - Line(1490 2525 1182 2525 15 30 0x00000000) - Line(1605 2660 1501 2764 15 30 0x00000000) - Line(1185 2655 1485 2655 15 30 0x00000000) - Line(1485 2655 1555 2585 15 30 0x00000000) - Line(1122 2740 1307 2925 15 30 0x00000000) - Line(2255 1955 2375 2075 15 30 0x00000000) - Line(2440 1955 2440 2110 15 30 0x00000000) - Line(2345 2865 2285 2925 15 30 0x00000000) - Line(2345 2205 2345 2865 15 30 0x00000000) - Line(2785 2215 2785 2375 15 30 0x00000000) - Line(795 1155 915 1275 15 30 0x00000000) - Line(2875 2225 2875 2375 15 30 0x00000000) - Line(1784 1239 1784 1340 10 30 0x00000000) - Line(2575 2125 2495 2215 15 30 0x00000000) - Line(2665 2375 2785 2375 15 30 0x00000000) - Line(2575 2225 2575 2375 15 30 0x00000000) - Line(2495 2215 2495 2530 15 30 0x00000000) - Line(2875 1925 2875 1800 15 30 0x00000000) - Line(2875 2125 2785 2215 15 30 0x00000000) - Line(1937 1300 1937 1340 10 30 0x00000000) - Line(2875 2125 2675 2125 15 30 0x00000000) - Line(635 1145 635 1425 15 30 0x00000000) - Line(1835 1885 1835 1840 15 30 0x00000000) - Line(1695 1276 1707 1288 10 30 0x00000000) - Text(2515 2705 0 140 "LED rev 1" 0x00000000) -) -Layer(5 "GND-component") -( - Line(1505 950 1595 860 30 30 0x00000000) - Line(1440 950 1505 950 30 30 0x00000000) - Line(2220 1545 2155 1545 20 30 0x00000000) - Line(2515 1350 2515 1415 30 30 0x00000000) - Line(1200 1350 1230 1350 35 30 0x00000000) - Line(1860 1395 1860 1430 10 30 0x00000000) - Line(1965 1495 1965 1635 25 30 0x00000000) - Line(1855 1495 1965 1495 25 30 0x00000000) - Line(1835 1665 1835 1625 10 30 0x00000000) - Line(1885 1395 1885 1460 10 30 0x00000000) - Line(1965 1660 1965 1635 10 30 0x00000000) - Line(1810 1665 1810 1630 10 30 0x00000000) - Line(1785 1660 1785 1625 10 30 0x00000000) - Line(1760 1625 1760 1660 10 30 0x00000000) - Line(1280 1580 1280 1490 25 30 0x00000000) - Line(1195 1555 1280 1555 20 30 0x00000000) - Line(2545 1320 2515 1350 30 30 0x00000000) - Line(1005 595 1085 595 30 30 0x00000000) - Line(1085 595 1085 955 30 30 0x00000000) - Line(1085 955 1145 1015 30 30 0x00000000) - Line(1145 1015 1245 1015 30 30 0x00000000) - Arc(1445 995 45 45 30 30 270 90 0x00000000) - Polygon(0x00000010) - ( - (2250 1535) (2270 1535) (2270 1485) (2325 1485) (2325 1535) - (2345 1535) (2345 1560) (2325 1560) (2325 1630) (2160 1630) - (2160 1610) (2270 1610) (2270 1560) (2250 1560) - ) - Polygon(0x00000010) - ( - (1995 1470) (1880 1470) (1880 1450) (2015 1450) (2015 1365) - (2160 1365) (2160 1330) (2195 1330) (2195 1425) (2160 1460) - (2160 1630) (2070 1630) (2070 1720) (1995 1720) - ) - Polygon(0x00000010) - ( - (1370 1635) (1930 1635) (1930 1525) (1370 1525) - ) - Polygon(0x00000010) - ( - (1865 1510) (1225 1510) (1225 995) (1415 995) (1415 1255) - (1365 1255) (1365 1365) (1605 1365) (1605 1415) (1865 1415) - ) - Polygon(0x00000000) - ( - (1360 1295) (1390 1295) (1390 1335) (1360 1335) - ) - Polygon(0x00000010) - ( - (1070 1565) (1090 1565) (1090 1810) (1150 1810) (1150 1765) - (1125 1740) (1125 1640) (1145 1640) (1145 1565) (1165 1565) - (1165 1540) (1145 1540) (1145 1485) (1090 1485) (1090 1540) - (1070 1540) - ) -) -Layer(6 "Vcc-component") -( - Line(1045 1870 1045 1935 25 30 0x00000000) - Line(708 2155 708 1988 40 30 0x00000000) - Line(2575 1925 2490 2010 25 30 0x00000000) - Line(1630 1340 1630 1250 10 30 0x00000000) - Line(1910 1430 1965 1430 10 30 0x00000000) - Line(1910 1395 1910 1430 10 30 0x00000000) - Line(1200 2355 1000 2155 35 30 0x00000000) - Line(2575 1925 2485 1835 25 30 0x00000000) - Line(1070 1265 1070 1330 25 30 0x00000000) - Line(2360 1500 2360 1315 25 30 0x00000000) - Line(2445 1250 2445 1675 30 30 0x00000000) - Line(2100 1250 2445 1250 30 30 0x00000000) - Line(1910 1340 1910 1250 10 30 0x00000000) - Line(1965 1430 1965 1400 10 30 0x00000000) - Line(2375 1585 2440 1585 25 30 0x00000000) - Line(2665 1835 2575 1925 30 30 0x00000000) - Line(1120 1875 1190 1875 20 30 0x00000000) - Line(1045 1595 1045 1875 20 30 0x00000000) - Line(1045 1875 1120 1875 20 30 0x00000000) - Line(2875 2025 2675 2025 25 30 0x00000000) - Line(1285 2355 1200 2355 35 30 0x00000000) - Line(1355 2285 1285 2355 35 30 0x00000000) - Line(2675 2025 2575 1925 25 30 0x00000000) - Line(1000 2155 708 2155 40 30 0x00000000) - Line(1060 1510 1060 1375 25 30 0x00000000) - Line(1190 1875 1280 1785 20 30 0x00000000) - Line(2490 2010 2490 2135 25 30 0x00000000) - Line(2450 1510 2495 1510 35 30 0x00000000) - Line(2485 1835 2485 1680 25 30 0x00000000) - Line(2485 1680 2375 1680 25 30 0x00000000) - Line(2665 1800 2665 1835 30 30 0x00000000) - Line(2375 1680 2270 1680 30 30 0x00000000) - Line(2490 2135 2400 2225 25 30 0x00000000) - Polygon(0x00000000) - ( - (1500 1255) (1530 1255) (1530 1295) (1500 1295) - ) - Polygon(0x00000010) - ( - (1445 1255) (1635 1255) (1635 995) (1635 995) (1635 995) - (1635 995) (1635 995) (1445 995) - ) - Polygon(0x00000010) - ( - (1885 1260) (2120 1260) (2120 1005) (1921 1003) (1885 1039) - ) - Polygon(0x00000000) - ( - (2080 1250) (2110 1250) (2110 1295) (2080 1295) - ) -) -Layer(7 "unused") -( -) -Layer(8 "unused") -( - Line(3135 3225 345 3225 35 30 0x00000000) - Line(3135 210 3135 3225 35 30 0x00000000) - Line(345 210 3135 210 35 30 0x00000000) - Line(345 3225 345 210 35 30 0x00000000) -) -Layer(9 "silk") -( -) -Layer(10 "silk") -( - Text(2210 3120 0 115 "ANODE" 0x00000400) - Text(1855 3125 0 115 "-Y" 0x00000400) - Text(2045 3130 0 115 "+Y" 0x00000400) - Text(1255 3125 0 115 "-X" 0x00000400) - Text(1455 3125 0 115 "+X" 0x00000400) - Text(525 295 0 280 "FLARE GENESIS" 0x00000400) - Text(435 2815 0 165 "LED Interface" 0x00000400) - Text(1885 285 0 295 "harry eaton" 0x00000400) -) diff --git a/tutorial/pcb/LED.NET b/tutorial/pcb/LED.NET deleted file mode 100755 index eb9f8a2..0000000 --- a/tutorial/pcb/LED.NET +++ /dev/null @@ -1,47 +0,0 @@ -AGND C8-2 C9-2 C10-2 C11-2 C12-2 C13-2 C20-2 C21-2 R7-2 R9-2 \ - R10-2 U2-6 U2-7 U2-8 U2-9 U2-18 U3-2 U3-5 U7-4 -DGND C5-2 C6-2 C7-2 C14-2 C15-2 C16-2 C17-1 J3-1 U2-14 U2-19 \ - U4-2 U4-5 U5-5 U6-4 X1-2 -Minus12V C3-1 C4-1 J3-9 U1-6 -Plus12V J3-6 R11-1 R12-2 U1-7 U1-11 -S00001 C8-1 C9-1 C10-1 C13-1 C18-1 R2-2 R6-1 R8-1 U2-15 U2-17 \ - U3-4 U7-1 U7-7 -SIG10 Skinny U1-2 U1-8 U1-15 -SIG41 Power C3-2 R3-2 U1-16 -SIG43 C4-2 R1-2 U1-1 -SIG49 C2-1 R4-2 R6-2 R7-1 U2-4 -SIG50 C2-2 R4-1 U1-5 U2-3 -SIG51 C1-1 R5-2 R8-2 R9-1 U2-2 -SIG52 C1-2 R5-1 U1-12 U2-1 -SIG87 U2-10 U2-11 -SIG88 U2-12 U2-13 -SIG91 C19-1 C20-1 C21-1 U2-16 U7-2 U7-6 -SIG100 U2-21 U5-11 -SIG101 U2-20 U5-10 -SIG124 J2-3 U1-4 -SIG125 J2-2 U1-3 -SIG127 J1-2 U1-14 -SIG139 C11-1 U3-1 -SIG146 C12-1 R11-2 U3-6 -SIG150 C15-1 R12-1 U4-6 -SIG155 C14-1 U4-1 -SIG191 U5-16 X1-3 -SIG241 U2-26 U5-15 -SIG252 R13-1 U4-3 U5-4 -SIG258 U5-18 U6-3 -SIG259 U5-17 U6-2 -SIG285 J3-4 R14-1 U6-7 -SIG286 J3-5 R14-2 U6-8 -SIG291 U2-22 U5-9 -SIG292 U2-23 U5-8 -SIG293 U2-24 U5-7 -SIG294 U2-25 U5-6 -SIG296 J3-2 U6-5 -SIG297 J3-3 U6-6 -SIG310 J1-1 R10-1 U2-5 -SIG311 J1-3 U1-13 -SIG321 C5-1 C6-1 C7-1 C16-1 C17-2 R13-2 U2-28 U4-4 U5-14 U6-1 \ - X1-4 -SIG338 R1-1 R2-1 R3-1 U7-3 -SIG341 C18-2 U7-8 -SIG343 C19-2 U7-5 diff --git a/tutorial/pcb/bridge.pcb b/tutorial/pcb/bridge.pcb deleted file mode 100644 index dc79211..0000000 --- a/tutorial/pcb/bridge.pcb +++ /dev/null @@ -1,6 +0,0 @@ -V- T1-2 -V+ T1-1 -int5 T1-3 rectifier1/D4-1 rectifier1/D3-2 -int6 T1-4 rectifier1/D2-1 rectifier1/D1-2 -Vout rectifier1/D3-1 rectifier1/D1-1 C2-1 C1-1 -GND rectifier1/D4-2 rectifier1/D2-2 C2-2 C1-2 diff --git a/tutorial/pcb/flare_objects.gif b/tutorial/pcb/flare_objects.gif deleted file mode 100644 index d2938ed..0000000 Binary files a/tutorial/pcb/flare_objects.gif and /dev/null differ diff --git a/tutorial/pcb/pic_instance.gif b/tutorial/pcb/pic_instance.gif deleted file mode 100644 index eb6ae04..0000000 Binary files a/tutorial/pcb/pic_instance.gif and /dev/null differ diff --git a/tutorial/pcb/pic_object.gif b/tutorial/pcb/pic_object.gif deleted file mode 100644 index 5ba2733..0000000 Binary files a/tutorial/pcb/pic_object.gif and /dev/null differ diff --git a/tutorial/pcb/powersup.pcb b/tutorial/pcb/powersup.pcb deleted file mode 100644 index 15da12b..0000000 --- a/tutorial/pcb/powersup.pcb +++ /dev/null @@ -1,10 +0,0 @@ -NET1 power_supply1/T1-3 power_supply1/rectifier1/D4-1 \ - power_supply1/rectifier1/D3-2 -NET2 power_supply1/T1-4 power_supply1/rectifier1/D2-1 \ - power_supply1/rectifier1/D1-2 -In+ power_supply1/T1-1 -In- power_supply1/T1-2 -Out power_supply1/rectifier1/D3-1 power_supply1/rectifier1/D1-1 \ - power_supply1/C2-1 power_supply1/C1-1 R1-1 -GND power_supply1/rectifier1/D4-2 power_supply1/rectifier1/D2-2 \ - power_supply1/C2-2 power_supply1/C1-2 R1-2 diff --git a/tutorial/psfiles/analoglib1.lps b/tutorial/psfiles/analoglib1.lps deleted file mode 100644 index 9ac56dd..0000000 --- a/tutorial/psfiles/analoglib1.lps +++ /dev/null @@ -1,238 +0,0 @@ -%! PostScript set of library objects for XCircuit -% Version: 2.0 -% Library name is: analoglib -% Author: Tim Edwards -% - -% XCircuitLib library objects - -/arrowhead { -% -12 -32 24 36 bbox -begingate -8 -28 beginpath -3 -18 3 -15 0 0 curveto --3 -15 -3 -18 -8 -28 curveto --2 -26 2 -26 -8 -28 curveto -249 1.00 endpath -endgate -} def - -/source { -% -32 -64 64 128 bbox -% hidden -begingate -1 1.00 0 0 32 0.00 360.00 xcarc -1 1.00 0 32 0 64 2 polygon -1 1.00 0 -32 0 -64 2 polygon -endgate -} def - -/capacitor { -% -32 -64 177 128 bbox -(1.0) (p) 2 beginparm -% fundamental -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 -32 -6 32 -6 2 polygon -1.000 0.000 0.000 scb -(c.1) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(c.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:C%i %pc.1 %pc.2 %v"1.0"%v"p") {/Times-Roman 1.000 cf} 2 0 0 -208 -160 infolabel -(sim:c %pc.1 %pc.2) {/Times-Roman 1.000 cf} 2 0 0 -208 -208 infolabel -(F) v2 {hS} v1 {/Helvetica 1.000 cf} 5 20 0 48 0 label -endgate -} def - -/polarized { -% -32 -64 177 128 bbox -(1.0) (p) 2 beginparm -% fundamental -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 0 -80 74 66.00 114.00 xcarc -1.000 0.000 0.000 scb -(t) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(b) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:C%i %pt %pb %v"1.0"%v"p") {/Times-Roman 1.000 cf} 2 0 0 -208 -160 infolabel -(sim:e %pt %pb %pb) {/Times-Roman 1.000 cf} 2 0 0 -208 -208 infolabel -(F) v2 {hS} v1 {/Helvetica 1.000 cf} 5 20 0 48 0 label -endgate -} def - -/resistor { -% -14 -64 151 128 bbox -(1.0) (k) 2 beginparm -% fundamental -1 1.00 0 64 0 36 2 polygon -1 1.00 0 -64 0 -36 2 polygon -1 1.00 0 -36 14 -30 -14 -18 14 -6 -14 6 14 18 -14 30 0 36 8 polygon -1.000 0.000 0.000 scb -(r.1) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(r.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:R%i %pr.1 %pr.2 %v"1.0"%v"k") {/Times-Roman 1.000 cf} 2 0 0 -208 -160 infolabel -(sim:r %pr.1 %pr.2) {/Times-Roman 1.000 cf} 2 0 0 -208 -208 infolabel -(W) {/Symbol 1.000 cf} v2 {hS} v1 {/Helvetica 1.000 cf} 6 20 0 32 0 label -endgate -} def - -/inductor { -% -14 -64 164 112 bbox -(1.0) (m) 2 beginparm -% fundamental -1 1.00 20 -28 20 -44 0 -48 0 -24 spline -1 1.00 -20 -20 -20 -32 0 -28 0 -24 spline -1 1.00 -20 32 20 16 0 12 0 36 spline -1 1.00 20 12 20 -4 0 -8 0 16 spline -1 1.00 20 -8 20 -24 0 -28 0 -4 spline -1 1.00 -20 20 -20 -8 0 12 0 16 spline -1 1.00 -20 0 -20 -12 0 -8 0 -4 spline -1 1.00 0 -48 0 -64 2 polygon -1 1.00 0 36 0 48 2 polygon -1.000 0.000 0.000 scb -(l.1) {/Times-Roman 1.000 cf} 2 9 0 0 48 pinlabel -(l.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:L%i %pl.1 %pl.2 %v"1.0"%v"m") {/Times-Roman 1.000 cf} 2 0 0 -208 -160 infolabel -(sim:l %pl.1 %pl.2) {/Times-Roman 1.000 cf} 2 0 0 -208 -208 infolabel -(H) v2 {hS} v1 {/Helvetica 1.000 cf} 5 20 0 32 0 label -endgate -} def - -/vsource { -% -32 -64 139 128 bbox -(5) 1 beginparm -% fundamental -1.00 0 0 0 source -(+) {/Symbol 1.000 cf} 2 5 0 0 18 label -(-) {/Symbol 1.000 cf} 2 5 0 0 -18 label -1.000 0.000 0.000 scb -(v.p) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(v.m) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:V%i %pv.m %pv.p %v"5") {/Helvetica 1.000 cf} 2 20 0 -96 -160 infolabel -(V) {hS} v1 {/Helvetica 1.000 cf} 4 20 0 48 0 label -endgate -} def - -/isource { -% -32 -64 163 128 bbox -(1) (m) 2 beginparm -% fundamental -1.00 0 0 0 source -1 0.75 0 20 0 -8 2 polygon -0.80 180 0 -20 arrowhead -1.000 0.000 0.000 scb -(i.p) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(i.m) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:I%i %pi.m %pi.p %v"1"%v"m") {/Times-Roman 1.000 cf} 2 20 0 -96 -160 infolabel -(A) v2 {hS} v1 {/Helvetica 1.000 cf} 5 20 0 48 0 label -endgate -} def - -/acsource { -% -32 -64 211 128 bbox -(5) (0) (1) (k) 4 beginparm -% fundamental -1.00 0 0 0 source -1 0.80 0 -48 0 48 -16 0 16 0 spline -1.000 0.000 0.000 scb -(s.p) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(s.m) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:V%i %ps.m %ps.p SIN\(%v"0" %v"5" %v"1"%v"k"\)) {/Helvetica 1.000 cf} 2 20 0 -336 -160 infolabel -(offset) {ss} (V) {hS} v2 {/Helvetica 1.000 cf} 6 20 0 48 0 label -(p-p) {ss} (V) {hS} v1 {/Helvetica 1.000 cf} 6 20 0 48 48 label -(Hz) v4 {hS} v3 {/Helvetica 1.000 cf} 5 20 0 48 -48 label -endgate -} def - -/nmos { -% -64 -64 161 128 bbox -(3) (2) 2 beginparm -% fundamental -1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon -1 1.00 -44 -28 -44 28 2 polygon -1 1.00 -44 0 -64 0 2 polygon -1.000 0.000 0.000 scb -(G) {/Helvetica 1.000 cf} 2 7 0 -64 0 pinlabel -(S) {/Helvetica 1.000 cf} 2 13 0 0 -64 pinlabel -(D) {/Helvetica 1.000 cf} 2 9 0 0 64 pinlabel -sce -(spice:M%i %pD %pG %pS GND nmos W=%v"3" L=%v"2") {/Times-Roman 1.000 cf} 2 4 0 -244 -139 infolabel -(sim:n %pG %pD %pS) {/Times-Roman 1.000 cf} 2 4 0 -244 -187 infolabel -v1 (W=) {/Helvetica 1.000 cf} 3 20 0 16 16 label -v2 (L=) {/Helvetica 1.000 cf} 3 20 0 16 -16 label -endgate -} def - -/pmos { -% -64 -64 161 128 bbox -(3) (2) 2 beginparm -% fundamental -1 1.00 -44 -28 -44 28 2 polygon -1 1.00 -60 0 -64 0 2 polygon -1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon -1 1.00 -52 0 8 0.00 360.00 xcarc -1.000 0.000 0.000 scb -(S) {/Helvetica 1.000 cf} 2 9 0 0 64 pinlabel -(D) {/Helvetica 1.000 cf} 2 13 0 0 -64 pinlabel -(G) {/Helvetica 1.000 cf} 2 7 0 -64 0 pinlabel -sce -(spice:M%i %pD %pG %pS Vdd pmos W=%v"3" L=%v"2") {/Times-Roman 1.000 cf} 2 4 0 -196 -139 infolabel -(sim:p %pG %pD %pS) {/Times-Roman 1.000 cf} 2 4 0 -196 -187 infolabel -v1 (W=) {/Helvetica 1.000 cf} 3 20 0 16 16 label -v2 (L=) {/Helvetica 1.000 cf} 3 20 0 16 -16 label -endgate -} def - -/npn { -% -64 -64 73 128 bbox -begingate -% fundamental -1 1.00 -48 0 -64 0 2 polygon -1 1.00 -48 48 -48 -48 2 polygon -1 1.00 0 48 -48 22 2 polygon -1 1.00 0 48 0 64 2 polygon -1 1.00 0 -48 -48 -22 2 polygon -1 1.00 0 -48 0 -64 2 polygon -1.00 240 0 -48 arrowhead -1.000 0.000 0.000 scb -(C) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(B) {/Times-Roman 1.000 cf} 2 7 0 -64 0 pinlabel -(E) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:Q%i %pC %pB %pE npn) {/Times-Roman 1.000 cf} 2 4 0 -244 -139 infolabel -(sim:b %pB %pE %pC) {/Times-Roman 1.000 cf} 2 4 0 -244 -187 infolabel -endgate -} def - -/pnp { -% -64 -64 64 128 bbox -begingate -% fundamental -1 1.00 -48 0 -64 0 2 polygon -1 1.00 -48 48 -48 -48 2 polygon -1 1.00 0 48 -48 22 2 polygon -1 1.00 0 48 0 64 2 polygon -1 1.00 0 -48 -48 -22 2 polygon -1 1.00 0 -48 0 -64 2 polygon -1.00 120 -48 22 arrowhead -1.000 0.000 0.000 scb -(C) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -(B) {/Times-Roman 1.000 cf} 2 7 0 -64 0 pinlabel -(E) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -sce -(spice:Q%i %pC %pB %pE pnp) {/Times-Roman 1.000 cf} 2 4 0 -244 -139 infolabel -endgate -} def - -% EndLib diff --git a/tutorial/psfiles/analoglib2.lps b/tutorial/psfiles/analoglib2.lps deleted file mode 100644 index c8050c2..0000000 --- a/tutorial/psfiles/analoglib2.lps +++ /dev/null @@ -1,235 +0,0 @@ -%! PostScript set of library objects for XCircuit -% Version: 2.0 -% Library name is: analoglib2 -% Author: R. Timothy Edwards -% - -% XCircuitLib library objects -/capacitor { -% -32 -64 177 128 bbox -(1.0) (p) 2 beginparm -% fundamental -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 -32 -6 32 -6 2 polygon -1.000 0.000 0.000 scb -(c.1) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(c.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark v2 v1 (spice:C%i %pc.1 %pc.2 ) {/Times-Roman 1.000 cf} ctmk 4 0 -208 -160 infolabel -(sim:c %pc.1 %pc.2) {/Times-Roman 1.000 cf} 2 4 0 -208 -208 infolabel -mark (F) v2 {hS} v1 {/Helvetica 1.000 cf} ctmk 20 0 48 0 label -endgate -} def - -/polarized { -% -32 -64 177 128 bbox -(1.0) (p) 2 beginparm -% fundamental -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 0 -80 74 66.00 114.00 xcarc -1.000 0.000 0.000 scb -(t) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(b) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark v2 v1 (spice:C%i %pt %pb ) {/Times-Roman 1.000 cf} ctmk 4 0 -208 -160 infolabel -(sim:e %pt %pb %pb) {/Times-Roman 1.000 cf} 2 4 0 -208 -208 infolabel -mark (F) v2 {hS} v1 {/Helvetica 1.000 cf} ctmk 20 0 48 0 label -endgate -} def - -/resistor { -% -14 -64 151 128 bbox -(1.0) (k) 2 beginparm -% fundamental -1 1.00 0 64 0 36 2 polygon -1 1.00 0 -64 0 -36 2 polygon -1 1.00 0 -36 14 -30 -14 -18 14 -6 -14 6 14 18 -14 30 0 36 8 polygon -1.000 0.000 0.000 scb -(r.1) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(r.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark v2 v1 (spice:R%i %pr.1 %pr.2 ) {/Times-Roman 1.000 cf} ctmk 4 0 -208 -160 infolabel -(sim:r %pr.1 %pr.2) {/Times-Roman 1.000 cf} 2 4 0 -208 -208 infolabel -mark (W) {/Symbol 1.000 cf} v2 {hS} v1 {/Helvetica 1.000 cf} ctmk 20 0 32 0 label -endgate -} def - -/inductor { -% -14 -64 164 112 bbox -(1.0) (m) 2 beginparm -% fundamental -1 1.00 20 -28 20 -44 0 -48 0 -24 spline -1 1.00 -20 -20 -20 -32 0 -28 0 -24 spline -1 1.00 20 32 20 16 0 12 0 36 spline -1 1.00 20 12 20 -4 0 -8 0 16 spline -1 1.00 20 -8 20 -24 0 -28 0 -4 spline -1 1.00 -20 20 -20 8 0 12 0 16 spline -1 1.00 -20 0 -20 -12 0 -8 0 -4 spline -1 1.00 0 -48 0 -64 2 polygon -1 1.00 0 36 0 48 2 polygon -1.000 0.000 0.000 scb -(l.1) {/Times-Roman 1.000 cf} 2 9 0 0 48 pinlabel -(l.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark v2 v1 (spice:L%i %pl.1 %pl.2 ) {/Times-Roman 1.000 cf} ctmk 4 0 -208 -160 infolabel -(sim:l %pl.1 %pl.2) {/Times-Roman 1.000 cf} 2 4 0 -208 -208 infolabel -mark (H) v2 {hS} v1 {/Helvetica 1.000 cf} ctmk 20 0 32 0 label -endgate -} def - -/source { -% -32 -64 64 128 bbox -% hidden -begingate -1 1.00 0 0 32 0.00 360.00 xcarc -1 1.00 0 32 0 64 2 polygon -1 1.00 0 -32 0 -64 2 polygon -endgate -} def - -/vsource { -% -32 -64 139 128 bbox -(5) 1 beginparm -% fundamental -1.00 0 0 0 source -(+) {/Symbol 1.000 cf} 2 5 0 0 18 label -(-) {/Symbol 1.000 cf} 2 5 0 0 -18 label -1.000 0.000 0.000 scb -(v.p) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(v.m) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark v1 (spice:V%i %pv.m %pv.p ) {/Helvetica 1.000 cf} ctmk 20 0 -96 -160 infolabel -mark (V) {hS} v1 {/Helvetica 1.000 cf} ctmk 20 0 48 0 label -endgate -} def - -/arrowhead { -% -12 -32 24 36 bbox -begingate -8 -28 beginpath -3 -18 3 -15 0 0 curveto --3 -15 -3 -18 -8 -28 curveto --2 -26 2 -26 8 -28 curveto -249 1.00 endpath -endgate -} def - -/isource { -% -32 -64 163 128 bbox -(1) (m) 2 beginparm -% fundamental -1.00 0 0 0 source -1 0.75 0 20 0 -8 2 polygon -0.80 180 0 -20 arrowhead -1.000 0.000 0.000 scb -(i.p) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(i.m) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark v2 v1 (spice:I%i %pi.m %pi.p ) {/Times-Roman 1.000 cf} ctmk 20 0 -96 -160 infolabel -mark (A) v2 {hS} v1 {/Helvetica 1.000 cf} ctmk 20 0 48 0 label -endgate -} def - -/acsource { -% -32 -64 211 128 bbox -(5) (0) (1) (k) 4 beginparm -% fundamental -1.00 0 0 0 source -1 0.80 0 -48 0 48 -16 0 16 0 spline -1.000 0.000 0.000 scb -(s.p) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(s.m) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark (\)) v4 v3 ( ) v1 ( ) v2 (spice:V%i %ps.m %ps.p SIN\() {/Helvetica 1.000 cf} ctmk 20 0 -336 -160 infolabel -mark (offset) {ss} (V) {hS} v2 {/Helvetica 1.000 cf} ctmk 20 0 48 0 label -mark (p-p) {ss} (V) {hS} v1 {/Helvetica 1.000 cf} ctmk 20 0 48 48 label -mark (Hz) v4 {hS} v3 {/Helvetica 1.000 cf} ctmk 20 0 48 -48 label -endgate -} def - -/nmos { -% -64 -64 161 128 bbox -(3) (2) (nmos) 3 beginparm -% fundamental -1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon -1 1.00 -44 -28 -44 28 2 polygon -1 1.00 -44 0 -64 0 2 polygon -1.000 0.000 0.000 scb -(G) {/Helvetica 1.000 cf} 2 7 0 -64 0 pinlabel -(S) {/Helvetica 1.000 cf} 2 13 0 0 -64 pinlabel -(D) {/Helvetica 1.000 cf} 2 9 0 0 64 pinlabel -sce -mark v2 ( L=) v1 ( W=) v3 (spice:M%i %pD %pG %pS GND ) {/Times-Roman 1.000 cf} ctmk 4 0 -244 -139 infolabel -(sim:n %pG %pD %pS) {/Times-Roman 1.000 cf} 2 4 0 -244 -187 infolabel -mark v1 (W=) {/Helvetica 1.000 cf} ctmk 20 0 16 16 label -mark v2 (L=) {/Helvetica 1.000 cf} ctmk 20 0 16 -16 label -endgate -} def - -/pmos { -% -64 -64 161 128 bbox -(3) (2) (pmos) 3 beginparm -% fundamental -1 1.00 -44 -28 -44 28 2 polygon -1 1.00 -60 0 -64 0 2 polygon -1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon -1 1.00 -52 0 8 0.00 360.00 xcarc -1.000 0.000 0.000 scb -(S) {/Helvetica 1.000 cf} 2 9 0 0 64 pinlabel -(D) {/Helvetica 1.000 cf} 2 13 0 0 -64 pinlabel -(G) {/Helvetica 1.000 cf} 2 7 0 -64 0 pinlabel -sce -mark v2 ( L=) v1 ( W=) v3 (spice:M%i %pD %pG %pS Vdd ) {/Times-Roman 1.000 cf} ctmk 4 0 -196 -139 infolabel -(sim:p %pG %pD %pS) {/Times-Roman 1.000 cf} 2 4 0 -196 -187 infolabel -mark v1 (W=) {/Helvetica 1.000 cf} ctmk 20 0 16 16 label -mark v2 (L=) {/Helvetica 1.000 cf} ctmk 20 0 16 -16 label -endgate -} def - -/npn { -% -64 -64 72 128 bbox -(npn) 1 beginparm -% fundamental -1 1.00 -48 0 -64 0 2 polygon -1 1.00 -48 48 -48 -48 2 polygon -1 1.00 0 48 -48 22 2 polygon -1 1.00 0 48 0 64 2 polygon -1 1.00 0 -48 -48 -22 2 polygon -1 1.00 0 -48 0 -64 2 polygon -1.00 240 0 -48 arrowhead -1.000 0.000 0.000 scb -(C) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(B) {/Times-Roman 1.000 cf} 2 7 0 -64 0 pinlabel -(E) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -mark v1 (spice:Q%i %pC %pB %pE ) {/Times-Roman 1.000 cf} ctmk 4 0 -244 -139 infolabel -(sim:b %pB %pE %pC) {/Times-Roman 1.000 cf} 2 4 0 -244 -187 infolabel -endgate -} def - -/pnp { -% -64 -64 72 128 bbox -(pnp) 1 beginparm -% fundamental -1 1.00 -48 0 -64 0 2 polygon -1 1.00 -48 48 -48 -48 2 polygon -1 1.00 0 48 -48 22 2 polygon -1 1.00 0 48 0 64 2 polygon -1 1.00 0 -48 -48 -22 2 polygon -1 1.00 0 -48 0 -64 2 polygon -1.00 120 -48 22 arrowhead -1.000 0.000 0.000 scb -(C) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -(B) {/Times-Roman 1.000 cf} 2 7 0 -64 0 pinlabel -(E) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -sce -mark v1 (spice:Q%i %pC %pB %pE ) {/Times-Roman 1.000 cf} ctmk 4 0 -244 -139 infolabel -endgate -} def - - -% EndLib diff --git a/tutorial/psfiles/bridge.ps b/tutorial/psfiles/bridge.ps deleted file mode 100644 index 392f5ed..0000000 --- a/tutorial/psfiles/bridge.ps +++ /dev/null @@ -1,370 +0,0 @@ -%!PS-Adobe-3.0 -%%Title: ~/tmp/tutorial/bridge -%%Creator: Xcircuit v2.3 -%%CreationDate: Wed Jul 18 11:20:21 2001 -%%Pages: 1 -%%BoundingBox: 114 302 498 490 -%%DocumentNeededResources: font Helvetica font Times-Roman font Times-RomanISO -%%+ font HelveticaISO font Symbol -%%EndComments -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.3 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--5/16/01 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.3 1 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/ul { dup type /stringtype eq showflag 1 eq and { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave currentpoint newpath moveto true charpath flattenpath - pathbbox pop exch pop sub grestore } def -/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs - 0 currentpoint pop put} def -/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def -/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def -/hS { qS qS } def -/pspc 0 def -/cf0 { scalefont setfont } bind def -/Kn { dup kY add /kY exch def rmoveto } bind def -/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.33 mul neg Kn} def -/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.67 mul Kn } def -/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def -/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def -/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq - { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} - {fscale0 mul fscale mul cf0} ifelse } def -/ctmk { counttomark dup 2 add -1 roll pop } bind def -/label { gsave translate 0 0 moveto dup scale /rotval exch def /just exch def - just 16 and 0 gt {0 1 dtransform gsave pagemat setmatrix idtransform - exch grestore 1 0 dtransform gsave pagemat setmatrix idtransform - exch grestore dup 0 eq {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse - {-1 /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch 0 lt - {-1 /just just dup 12 and 4 ne {12 xor} if def} {1} ifelse scale } - if /showflag 0 def /fspc pspc def /Bline 0 def /Tabs 0 array def - /fscale 1.0 def /kY 0 def - gsave dup 1 add copy 0 exch {exch dup type /stringtype eq {true - charpath flattenpath} {exec} ifelse } repeat pop pathbbox grestore - 3 -1 roll pop 3 1 roll just 1 and 0 gt {just 2 and 0 gt {exch pop - neg fspc sub} {exch sub 0.5 mul neg} ifelse} {pop neg fspc add} - ifelse exch Bline exch just 4 and 0 gt {just 8 and 0 gt {exch pop - neg fspc sub} {add 0.5 mul neg} ifelse} {pop neg fspc add} ifelse - /showflag 1 def rotval rotate Kn currentpoint translate - /Bline 0 def /Tabs 0 array def /fscale 1.0 def /kY 0 def - {dup type /stringtype eq {show}{exec} ifelse} repeat grestore } def -/pinlabel { hlevel 0 eq { /pspc 20 def label /pspc 0 def } - { pop pop pop pop pop {pop} repeat } ifelse } def -/pinglobal { pinlabel } def -/infolabel { pinlabel } def - -/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def -/cRedef {/defColor currentcolor 3 array astore def} def -/begingate { /hlevel hlevel 1 add def /defColor currentcolor sce 3 array - astore def gsave sce translate 0 0 moveto dup 0 lt - {neg 1 sub -1 1 scale} if rotate dup scale } bind def -/makeparm {3 string cvs dup length 1 add string /tstr exch def tstr exch - 1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def -/beginparm { -1 1 {makeparm exch def} for - dup type /arraytype eq { aload length -1 1 {makeparm exch def} - for } if begingate } bind def -/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef - scb} bind def - -/hlevel 0 def -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt style 512 eq or { newpath } { stroke } ifelse grestore } def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def -/insertion {/PSobj save def /showpage {} def bop translate} def -/end_insert {PSobj restore} def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -/Times-Roman findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall -/Encoding ISOLatin1Encoding def currentdict end -/Times-RomanISO exch definefont pop - -/Helvetica findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall -/Encoding ISOLatin1Encoding def currentdict end -/HelveticaISO exch definefont pop - -% XCircuit output starts here. - -/inductor { -% -14 -64 29 112 bbox -begingate -1 1.00 20 -28 20 -44 0 -48 0 -24 spline -1 1.00 -20 -20 -20 -32 0 -28 0 -24 spline -1 1.00 20 32 20 16 0 12 0 36 spline -1 1.00 20 12 20 -4 0 -8 0 16 spline -1 1.00 20 -8 20 -24 0 -28 0 -4 spline -1 1.00 -20 20 -20 8 0 12 0 16 spline -1 1.00 -20 0 -20 -12 0 -8 0 -4 spline -1 1.00 0 -48 0 -64 2 polygon -1 1.00 0 36 0 48 2 polygon -1.000 0.000 0.000 scb -(l.1) {/Times-Roman cf} 2 9 0 1.00 0 48 pinlabel -(l.2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -(spice:L%i %pl.1 %pl.2 1.0U) {/Times-Roman cf} 2 0 0 1.00 -208 -160 infolabel -sce -(sim:l %pl.1 %pl.2) {/Times-Roman cf} 2 0 0 1.00 -208 -208 infolabel -endgate -} def - -/Transformer { -% -62 -64 108 112 bbox -(?) 1 beginparm -1.00 0 -48 0 inductor -1 1.00 -16 48 -16 -64 2 polygon -1 1.00 0 48 0 -64 2 polygon -1.00 180 32 -16 inductor -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 25 0 1.00 -48 48 pinlabel -(2) {/Helvetica cf} 2 29 0 1.00 -48 -64 pinlabel -(3) {/Helvetica cf} 2 25 0 1.00 32 48 pinlabel -(4) {/Helvetica cf} 2 29 0 1.00 32 -64 pinlabel -sce -mark v1 (pcb:T) {/Times-Roman cf} ctmk 20 0 1.00 -96 -160 infolabel -endgate -} def - -/circle { -% -6 -12 28 24 bbox -% trivial -begingate -1 1.00 16 0 6 0.00 360.00 xcarc -1 1.00 0 0 10 0 2 polygon -1.000 0.000 0.000 scb -(out) {/Times-Roman cf} 2 4 0 1.00 16 0 pinlabel -(out) {/Times-Roman cf} 2 7 0 1.00 0 0 pinlabel -endgate -} def - -/Diode { -% -18 -48 36 96 bbox -(?) 1 beginparm -248 1.00 -18 -16 0 16 18 -16 3 polygon -1 1.00 0 -48 0 -16 2 polygon -1 1.00 0 48 0 16 2 polygon -1 1.00 -18 16 18 16 2 polygon -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 48 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -48 pinlabel -sce -mark v1 (pcb:D) {/Helvetica cf} ctmk 20 0 1.00 -64 -144 infolabel -mark ( %p1 %p2 diode) v1 (spice:D) {/Times-Roman cf} ctmk 4 0 1.00 -64 -192 -endgate -} def - -/rectifier { -% -112 -48 192 192 bbox -begingate -1.00 315 -64 96 Diode -1.00 225 32 96 Diode -1.00 225 -64 0 Diode -1.00 315 32 0 Diode -1 1.00 -30 130 -16 144 -2 130 3 polygon -1 1.00 66 62 80 48 66 34 3 polygon -1 1.00 -2 -34 -16 -48 -30 -34 3 polygon -1 1.00 -98 34 -112 48 -98 62 3 polygon -endgate -} def - -/dot { -% -10 -10 20 20 bbox -% trivial -begingate -248 1.00 0 0 6 0.00 360.00 xcarc -1.000 0.000 0.000 scb -(x) {/Times-Roman cf} 2 29 0 1.00 0 0 pinlabel -endgate -} def - -/jumper { -% -4 -14 18 28 bbox -% trivial -begingate -1 1.00 0 0 10 -90.00 90.00 xcarc -1 1.00 0 10 0 16 2 polygon -1 1.00 0 -10 0 -16 2 polygon -1.000 0.000 0.000 scb -(a) {/Times-Roman cf} 2 1 0 1.00 0 16 pinlabel -(a) {/Times-Roman cf} 2 13 0 1.00 0 -16 pinlabel -endgate -} def - -/gnd { -% -32 -60 64 68 bbox -% trivial -begingate -1 1.00 0 0 0 -32 2 polygon -1 1.00 -32 -32 32 -32 2 polygon -1 1.00 -18 -46 18 -46 2 polygon -1 1.00 -4 -60 4 -60 2 polygon -1.000 0.000 0.000 scb -(GND) {/Times-Roman cf} 2 1 0 1.00 0 0 pinglobal -endgate -} def - -/Capacitor { -% -32 -64 186 128 bbox -(1.0) (p) (?) 3 beginparm -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 -32 -6 32 -6 2 polygon -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -mark v2 v1 ( %p1 %p2 ) v3 (spice:C) {/Times-RomanISO cf} ctmk 4 0 1.00 -208 --160 infolabel -sce -(sim:c %p1 %p2) {/Times-Roman cf} 2 4 0 1.00 -208 -208 infolabel -mark (F) v2 {hS} v1 {/Times-RomanISO cf} ctmk 20 0 1.00 48 0 label -sce -mark v3 (pcb:C) {/Times-Roman cf} ctmk 20 0 1.00 -208 -256 infolabel -endgate -} def - -/Polarized { -% -32 -64 176 128 bbox -(1.0) (p) (?) 3 beginparm -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 0 -80 74 66.00 114.00 xcarc -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -mark v2 v1 ( %p1 %p2 ) v3 (spice:C) {/Times-RomanISO cf} ctmk 4 0 1.00 -208 --160 infolabel -sce -(sim:e %p1 %p2) {/Times-Roman cf} 2 4 0 1.00 -208 -208 infolabel -mark (F) v2 {hS} v1 {/Times-RomanISO cf} ctmk 20 0 1.00 48 0 label -sce -mark v3 (pcb:C) {/Times-Roman cf} ctmk 20 0 1.00 -208 -256 infolabel -endgate -} def - -%%Page: 1 1 -%%PageOrientation: Portrait -/pgsave save def bop -% 529 953 offsets -1.0000 inchscale -2.6000 setlinewidth - -1.00 0 497 1065 Transformer -1 1.00 449 1113 449 1193 401 1193 3 polygon -1 1.00 449 1001 449 937 401 937 3 polygon -1.00 -1 401 1193 circle -1.00 -1 401 937 circle -1.000 0.000 0.000 scb -(+) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 385 1193 pinlabel -(-) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 385 937 pinlabel -sce -1.00 0 785 1017 rectifier -1 1.00 529 1113 529 1193 769 1193 769 1161 4 polygon -1 1.00 529 1001 529 937 769 937 769 969 4 polygon -1.00 0 769 969 dot -1.00 0 769 1161 dot -1 1.00 673 1065 641 1065 641 953 3 polygon -1 1.00 641 921 641 873 1201 873 3 polygon -1 1.00 865 1065 1201 1065 2 polygon -1 1.00 961 1065 961 1033 2 polygon -1 1.00 1041 1065 1041 1033 2 polygon -1 1.00 961 905 961 873 2 polygon -1 1.00 1041 905 1041 873 2 polygon -1.00 0 1041 873 dot -1.00 0 961 873 dot -1.00 0 961 1065 dot -1.00 0 1041 1065 dot -1.00 0 865 1065 dot -1.00 0 673 1065 dot -1.00 -1 641 937 jumper -1.00 0 641 873 gnd -1.00 0 641 873 dot -1.00 0 1201 873 circle -1.00 0 1201 1065 circle -1.000 0.000 0.000 scb -(Vout) {0 -80 Kn} {/Helvetica cf} 3 28 0 1.00 1217 1065 pinlabel -sce -(+) {/Symbol cf} 2 20 0 1.00 1249 1065 label -(-) {/Symbol cf} 2 20 0 1.00 1249 873 label -(Bridge Rectifier) {/Helvetica cf} 2 24 0 1.00 369 1273 label -1.00 -1 961 969 [(1.0) (\265) ] Capacitor -1.00 0 1041 969 [(10) (\265) ] Polarized -(1N914) {hS} (\327) {hS} (4) {/HelveticaISO cf} 6 24 0 1.00 849 1145 label -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/psfiles/buses.ps b/tutorial/psfiles/buses.ps deleted file mode 100644 index 76b21a7..0000000 --- a/tutorial/psfiles/buses.ps +++ /dev/null @@ -1,245 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Title: buses -%%Creator: Xcircuit v2.3 -%%CreationDate: Mon Nov 5 11:36:02 2001 -%%Pages: 1 -%%BoundingBox: 68 68 712 496 -%%DocumentNeededResources: font Helvetica font Helvetica-Oblique -%%EndComments -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.3 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--5/16/01 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.3 2 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/ul { dup type /stringtype eq showflag 1 eq and { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave currentpoint newpath moveto true charpath flattenpath - pathbbox pop exch pop sub grestore } def -/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs - 0 currentpoint pop put} def -/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def -/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def -/hS { qS qS } def -/pspc 0 def -/cf0 { scalefont setfont } bind def -/Kn { dup kY add /kY exch def rmoveto } bind def -/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.33 mul neg Kn} def -/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.67 mul Kn } def -/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def -/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def -/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq - { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} - {fscale0 mul fscale mul cf0} ifelse } def -/ctmk { counttomark dup 2 add -1 roll pop } bind def -/label { gsave translate 0 0 moveto dup scale /rotval exch def /just exch def - just 16 and 0 gt {0 1 dtransform gsave pagemat setmatrix idtransform - exch grestore 1 0 dtransform gsave pagemat setmatrix idtransform - exch grestore dup 0 eq {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse - {-1 /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch 0 lt - {-1 /just just dup 12 and 4 ne {12 xor} if def} {1} ifelse scale } - if /showflag 0 def /fspc pspc def /Bline 0 def /Tabs 0 array def - /fscale 1.0 def /kY 0 def - gsave dup 1 add copy 0 exch {exch dup type /stringtype eq {true - charpath flattenpath} {exec} ifelse } repeat pop pathbbox grestore - 3 -1 roll pop 3 1 roll just 1 and 0 gt {just 2 and 0 gt {exch pop - neg fspc sub} {exch sub 0.5 mul neg} ifelse} {pop neg fspc add} - ifelse exch Bline exch just 4 and 0 gt {just 8 and 0 gt {exch pop - neg fspc sub} {add 0.5 mul neg} ifelse} {pop neg fspc add} ifelse - /showflag 1 def rotval rotate Kn currentpoint translate - /Bline 0 def /Tabs 0 array def /fscale 1.0 def /kY 0 def - {dup type /stringtype eq {show}{exec} ifelse} repeat grestore } def -/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 20 def label - /pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def -/pinglobal { pinlabel } def -/infolabel { pinlabel } def - -/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def -/cRedef {/defColor currentcolor 3 array astore def} def -/begingate { /hlevel hlevel 1 add def /defColor currentcolor sce 3 array - astore def gsave sce translate 0 0 moveto dup 0 lt - {neg 1 sub -1 1 scale} if rotate dup scale } bind def -/makeparm {3 string cvs dup length 1 add string /tstr exch def tstr exch - 1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def -/beginparm { -1 1 {makeparm exch def} for - dup type /arraytype eq { aload length -1 1 {makeparm exch def} - for } if begingate } bind def -/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef - scb} bind def - -/hlevel 0 def -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt style 512 eq or { newpath } { stroke } ifelse grestore } def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def -/insertion {/PSobj save def /showpage {} def bop translate} def -/end_insert {PSobj restore} def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -% XCircuit output starts here. - -/dbus1 { -% -608 0 1216 42 bbox -begingate -1.000 0.000 0.000 scb -(d[3]) {/Helvetica cf} 2 23 0 1.00 -608 -64 pinlabel -(d[2]) {/Helvetica cf} 2 23 0 1.00 -608 -32 pinlabel -(d[1]) {/Helvetica cf} 2 23 0 1.00 -608 0 pinlabel -(d[0]) {/Helvetica cf} 2 23 0 1.00 -608 32 pinlabel -(d[3]) {/Helvetica cf} 2 20 0 1.00 608 -64 pinlabel -(d[2]) {/Helvetica cf} 2 20 0 1.00 608 -32 pinlabel -(d[1]) {/Helvetica cf} 2 20 0 1.00 608 0 pinlabel -(d[0]) {/Helvetica cf} 2 20 0 1.00 608 32 pinlabel -sce -(data bus) {/Helvetica cf} 2 17 0 1.00 -64 16 label -1 1.00 -608 0 608 0 2 polygon -endgate -} def - -/chip1 { -% -96 -96 192 192 bbox -(?) 1 beginparm -0 1.00 -96 -96 -96 96 96 96 96 -96 4 polygon -( data ) {/Helvetica cf} 2 23 0 1.00 96 0 label -1.000 0.000 0.000 scb -(p0) {/Helvetica cf} 2 20 0 1.00 96 48 pinlabel -(p1) {/Helvetica cf} 2 20 0 1.00 96 16 pinlabel -(p2) {/Helvetica cf} 2 20 0 1.00 96 -16 pinlabel -(p3) {/Helvetica cf} 2 20 0 1.00 96 -48 pinlabel -sce -mark v1 (Chip ) {/Helvetica cf} ctmk 21 0 1.00 0 64 label -endgate -} def - -/arrowhead { -% -12 -32 24 36 bbox -% trivial -begingate -8 -28 beginpath -3 -18 3 -15 0 0 curveto --3 -15 -3 -18 -8 -28 curveto --2 -26 2 -26 8 -28 curveto -249 1.00 endpath -endgate -} def - -/arrow { -% -12 -40 24 80 bbox -% trivial -begingate -1 0.80 0 -40 0 20 2 polygon -1.00 0 0 40 arrowhead -endgate -} def - -%%Page: 1 1 -%%PageOrientation: Portrait -/pgsave save def bop -% 1152 692 offsets -1.0000 inchscale -2.6000 setlinewidth - -1 1.00 288 756 288 884 672 884 672 756 4 polygon -1 1.00 352 1012 352 884 608 884 608 1012 4 polygon -1 1.00 432 1012 432 884 752 884 752 756 4 polygon -1 1.00 224 1012 224 884 864 884 864 756 4 polygon -1 2.00 224 884 864 884 2 polygon -1 1.00 1312 1108 1312 980 1728 980 1728 596 1888 596 5 polygon -1 1.00 1408 1108 1408 980 1728 980 1728 692 1888 692 5 polygon -1 1.00 1584 964 1600 996 2 polygon -(2) {/Helvetica cf} 2 17 0 1.00 1584 996 label -1.000 0.000 0.000 scb -(b\(1\)) {/Helvetica cf} 2 17 0 1.00 1312 1108 pinlabel -(b\(2\)) {/Helvetica cf} 2 17 0 1.00 1408 1108 pinlabel -(a[0]) {/Helvetica cf} 2 17 0 1.00 224 1012 pinlabel -(a[1]) {/Helvetica cf} 2 17 0 1.00 352 1012 pinlabel -(a[2]) {/Helvetica cf} 2 17 0 1.00 432 1012 pinlabel -(a[3]) {/Helvetica cf} 2 29 0 1.00 288 756 pinlabel -sce -1.00 0 1024 340 dbus1 -1.00 0 320 324 [(1) ] chip1 -1.00 -1 1728 324 [(2) ] chip1 -(Three styles of buses in xcircuit) {ul} {/Helvetica cf} 3 21 0 1.00 992 1300 -label -(1\) \252standard\272 method) {/Helvetica cf} 2 16 0 1.00 192 1172 label -(" to see actual pins.) {/Helvetica cf} (Options->Show Pin Positions) -{/Helvetica-Oblique cf} (2\) \252sneaky\272 method. Use ") {/Helvetica cf} 6 -16 0 1.00 224 500 label -1.00 120 448 388 arrow -(real pin position \(normally not seen\)) {/Helvetica cf} 2 16 0 0.80 496 420 -label -1.00 60 992 308 arrow -(named the same.) {CR} (Pins on either end are) {CR} (The bus is a subcircuit.) -{/Helvetica cf} 6 28 0 0.80 1040 276 label -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/psfiles/dff.ps b/tutorial/psfiles/dff.ps deleted file mode 100644 index a15ffed..0000000 --- a/tutorial/psfiles/dff.ps +++ /dev/null @@ -1,228 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Title: dff -%%Creator: Xcircuit v2.5 -%%CreationDate: Tue Dec 18 16:50:59 2001 -%%Pages: 1 -%%BoundingBox: 68 68 371 229 -%%DocumentNeededResources: font Helvetica font Times-Roman -%%EndComments -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.4 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--5/16/01 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.4 1 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/ul { dup type /stringtype eq showflag 1 eq and { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave currentpoint newpath moveto true charpath flattenpath - pathbbox pop exch pop sub grestore } def -/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs - 0 currentpoint pop put} def -/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def -/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def -/hS { qS qS } def -/pspc 0 def -/cf0 { scalefont setfont } bind def -/Kn { dup kY add /kY exch def rmoveto } bind def -/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.33 mul neg Kn} def -/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.67 mul Kn } def -/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def -/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def -/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq - { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} - {fscale0 mul fscale mul cf0} ifelse } def -/ctmk { counttomark dup 2 add -1 roll pop } bind def -/label { gsave translate 0 0 moveto dup scale neg /rotval exch def - /just exch def just 16 and 0 gt {gsave rotval rotate 0 1 dtransform - gsave pagemat setmatrix idtransform exch grestore 1 0 dtransform - gsave pagemat setmatrix idtransform exch grestore dup abs 1e-9 lt - {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse grestore {-1 /rotval - rotval neg def /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse - exch -1e-9 lt {-1 /rotval rotval neg def /just just dup 12 and - 4 ne {12 xor} if def} {1} ifelse scale } if /showflag 0 def - /fspc pspc def /Bline 0 def /Tabs 0 array def /fscale 1.0 def - /kY 0 def gsave dup 1 add copy 0 exch 1 0 dtransform exch atan rotate - {exch dup type /stringtype eq {true charpath flattenpath} {exec} - ifelse } repeat pop pathbbox grestore 3 -1 roll pop 3 1 roll just - 1 and 0 gt {just 2 and 0 gt {exch pop neg fspc sub} {exch sub 0.5 - mul neg} ifelse} {pop neg fspc add} ifelse exch Bline exch just 4 - and 0 gt {just 8 and 0 gt {exch pop neg fspc sub} {add 0.5 mul neg} - ifelse} {pop neg fspc add} ifelse rotval rotate Kn currentpoint - translate /showflag 1 def /Bline 0 def /Tabs 0 array def /fscale - 1.0 def /kY 0 def {dup type /stringtype eq {show}{exec} ifelse} - repeat grestore } def -/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 20 def label - /pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def -/pinglobal { pinlabel } def -/infolabel { pinlabel } def - -/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def -/cRedef {/defColor currentcolor 3 array astore def} def -/begingate { /hlevel hlevel 1 add def /defColor currentcolor sce 3 array - astore def gsave sce translate 0 0 moveto neg rotate dup abs scale - } bind def -/makeparm {3 string cvs dup length 1 add string /tstr exch def tstr exch - 1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def -/beginparm { -1 1 {makeparm exch def} for - dup type /arraytype eq { aload length -1 1 {makeparm exch def} - for } if begingate } bind def -/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef - scb} bind def - -/hlevel 0 def -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt style 512 eq or { newpath } { stroke } ifelse grestore } def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def -/insertion {/PSobj save def /showpage {} def bop translate} def -/end_insert {PSobj restore} def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -% XCircuit output starts here. - -/quadnand { -% -64 -48 128 96 bbox -(?) (1) (1) (2) (3) 5 beginparm -1 1.00 0 -48 -64 -48 -64 48 0 48 4 polygon -1 1.00 56 0 8 0.00 360.00 xcarc -1 1.00 0 0 48 -90.00 90.00 xcarc -1.000 0.000 0.000 scb -mark v5 {/Times-Roman cf} ctmk 4 0 1.00 64 0 pinlabel -mark v3 {/Times-Roman cf} ctmk 7 0 1.00 -64 32 pinlabel -mark v4 {/Times-Roman cf} ctmk 7 0 1.00 -64 -32 pinlabel -sce -mark v2 (-) v1 (pcb:U) {/Helvetica cf} ctmk 20 0 1.00 -80 -96 infolabel -mark v2 (7400-) {/Helvetica cf} ctmk 21 0 0.50 -8 0 label -endgate -} def - -/dot { -% -10 -10 20 20 bbox -% trivial -begingate -248 1.00 0 0 6 0.00 360.00 xcarc -1.000 0.000 0.000 scb -(x) {/Times-Roman cf} 2 29 0 1.00 0 0 pinlabel -endgate -} def - -/circle { -% -6 -12 28 24 bbox -% trivial -begingate -1 1.00 16 0 6 0.00 360.00 xcarc -1 1.00 0 0 10 0 2 polygon -1.000 0.000 0.000 scb -(out) {/Times-Roman cf} 2 4 0 1.00 16 0 pinlabel -(out) {/Times-Roman cf} 2 7 0 1.00 0 0 pinlabel -endgate -} def - -%%Page: 1 1 -%%PageOrientation: Portrait -/pgsave save def bop -% 978 336 offsets -1.0000 inchscale -2.6000 setlinewidth - -1.00 0 450 240 [(?) (4) (12) (13) (11) ] quadnand -1.00 0 450 432 [(?) (3) (9) (10) (8) ] quadnand -1.00 0 770 432 [(?) (2) (4) (5) (6) ] quadnand -1.00 0 770 240 [(?) (1) (1) (2) (3) ] quadnand -1 1.00 834 240 882 240 882 288 674 352 674 400 706 400 6 polygon -1 1.00 834 432 882 432 882 384 674 320 674 272 706 272 6 polygon -1 1.00 386 464 306 464 2 polygon -1 1.00 386 208 306 208 2 polygon -1.00 0 882 432 dot -1.00 0 882 240 dot -1.00 0 914 432 circle -1.00 0 914 240 circle --1.00 0 306 464 circle --1.00 0 306 208 circle -1 1.00 882 432 914 432 2 polygon -1 1.00 882 240 914 240 2 polygon -1 1.00 706 464 594 464 562 432 514 432 4 polygon -1 1.00 706 208 594 208 562 240 514 240 4 polygon -1 1.00 546 432 546 336 354 336 354 272 386 272 5 polygon -1 1.00 386 400 322 400 322 208 3 polygon -1.00 0 322 208 dot -1.00 0 546 432 dot -1.000 0.000 0.000 scb -(Q) {/Helvetica cf} 2 20 0 1.00 930 432 pinlabel -(Q) {ol} {/Helvetica cf} 3 20 0 1.00 930 240 pinlabel -(D) {/Helvetica cf} 2 23 0 1.00 290 464 pinlabel -(CLK) {/Helvetica cf} 2 23 0 1.00 290 208 pinlabel -sce -(D-FF implementation in 7400 IC) {/Helvetica cf} 2 17 0 1.00 594 576 label -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/psfiles/filter.ps b/tutorial/psfiles/filter.ps deleted file mode 100644 index deb06e5..0000000 --- a/tutorial/psfiles/filter.ps +++ /dev/null @@ -1,260 +0,0 @@ -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.0 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--2/25/99 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.0 2 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/cf { dup type /realtype eq {40 mul /fscale exch def} if dup /xfont exch def - findfont fscale scalefont setfont } def -/Ss { gsave 0.67 dup scale gsave mty neg rmoveto - glevel 1 add /glevel exch def } def -/ss { gsave 0.67 dup scale gsave mty 0.5 mul rmoveto - glevel 1 add /glevel exch def } def -/ns { currentpoint transform % preserve x position! - glevel {grestore} repeat /glevel 0 def - itransform pop currentpoint pop sub 0 rmoveto } def -/ul { showflag 1 eq { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { showflag 1 eq { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave true charpath flattenpath pathbbox pop exch pop sub - grestore } def -/bs { stW 0 rmoveto } def -/pspc 0 def -/qS { (aa) stW (a a) stW sub 4 div 0 rmoveto } def -/hS { qS qS } def -/textx { dup 1 add copy 0 exch { exch dup type /stringtype eq - {stringwidth pop add}{exec} ifelse } repeat neg ns } def -/mty { 0 topmat setmatrix (A) true charpath flattenpath pathbbox exch - pop exch sub exch pop neg grestore } def -/texty { gsave 2 copy pop exec mty } def -/tcenter { textx grestore 0.5 mul 0 rmoveto } def -/tright { textx grestore fspc sub 0 rmoveto } def -/tmiddle { texty 0.5 mul rmoveto } def -/ttop { texty fspc sub rmoveto } def -/tshow {{ dup type /stringtype eq {show}{exec} ifelse} repeat ns } def - -/label { gsave translate 0 0 moveto rotate /just exch def just 16 and 0 gt - {0 1 dtransform gsave pagemat setmatrix idtransform exch grestore - 1 0 dtransform gsave pagemat setmatrix idtransform exch grestore - dup 0 eq {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse - {-1 /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch 0 lt - {-1 /just just dup 12 and 4 ne {12 xor} if def} {1} ifelse scale } if - /glevel 0 def /showflag 0 def /fspc pspc def - just 1 and 0 gt {gsave just 2 and 0 gt {tright}{tcenter} ifelse} - {fspc 0 rmoveto} ifelse - just 4 and 0 gt {just 8 and 0 gt {ttop}{tmiddle} ifelse} - {0 fspc rmoveto} ifelse - /showflag 1 def tshow grestore } def -/pinlabel { hlevel 0 eq { /pspc 20 def label /pspc 0 def } - { pop pop pop pop {pop} repeat } ifelse } def -/pinglobal { pinlabel } def -/infolabel { pinlabel } def - -/begingate { /hlevel hlevel 1 add def gsave translate 0 0 moveto dup 0 lt - {neg 1 sub -1 1 scale} if rotate dup scale } bind def -/makeparm {3 string cvs dup length 1 add string /tstr exch def tstr exch - 1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def -/beginparm { -1 1 {makeparm exch def} for - dup type /arraytype eq { aload length -1 1 {makeparm exch def} - for } if begingate } bind def -/endgate { /hlevel hlevel 1 sub def grestore } bind def - -/hlevel 0 def -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt { newpath } { stroke } ifelse grestore } def -/scb { gsave setrgbcolor } bind def /sce { grestore } bind def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 setgray } def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -% XCircuit output starts here. - -/dot { -% -10 -10 20 20 bbox -begingate -248 1.00 0 0 6 0.00 360.00 xcarc -endgate -} def - -/circle { -% -6 -12 28 24 bbox -begingate -1 1.00 16 0 6 0.00 360.00 xcarc -1 1.00 0 0 10 0 2 polygon -1.000 0.000 0.000 scb -(out) {/Times-Roman 1.000 cf} 2 4 0 16 0 pinlabel -(out) {/Times-Roman 1.000 cf} 2 7 0 0 0 pinlabel -sce -endgate -} def - -/gnd { -% -32 -60 64 68 bbox -begingate -1 1.00 0 0 0 -32 2 polygon -1 1.00 -32 -32 32 -32 2 polygon -1 1.00 -18 -46 18 -46 2 polygon -1 1.00 -4 -60 4 -60 2 polygon -1.000 0.000 0.000 scb -(GND) {/Times-Roman 1.000 cf} 2 1 0 0 0 pinglobal -sce -endgate -} def - -/resistor { -% -14 -64 151 128 bbox -(1.0) (k) 2 beginparm -% fundamental -1 1.00 0 64 0 36 2 polygon -1 1.00 0 -64 0 -36 2 polygon -1 1.00 0 -36 14 -30 -14 -18 14 -6 -14 6 14 18 -14 30 0 36 8 polygon -1.000 0.000 0.000 scb -(r.1) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(r.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:R%i %pr.1 %pr.2 %v"1.0"%v"k") {/Times-Roman 1.000 cf} 2 0 0 -208 -160 infolabel -(sim:r %pr.1 %pr.2) {/Times-Roman 1.000 cf} 2 0 0 -208 -208 infolabel -(W) {/Symbol 1.000 cf} v2 {hS} v1 {/Helvetica 1.000 cf} 6 20 0 32 0 label -endgate -} def - -/polarized { -% -32 -64 177 128 bbox -(1.0) (p) 2 beginparm -% fundamental -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 0 -80 74 66.00 114.00 xcarc -1.000 0.000 0.000 scb -(t) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(b) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:C%i %pt %pb %v"1.0"%v"p") {/Times-Roman 1.000 cf} 2 0 0 -208 -160 infolabel -(sim:e %pt %pb %pb) {/Times-Roman 1.000 cf} 2 0 0 -208 -208 infolabel -(F) v2 {hS} v1 {/Helvetica 1.000 cf} 5 20 0 48 0 label -endgate -} def - -/source { -% -32 -64 64 128 bbox -% hidden -begingate -1 1.00 0 0 32 0.00 360.00 xcarc -1 1.00 0 32 0 64 2 polygon -1 1.00 0 -32 0 -64 2 polygon -endgate -} def - -/acsource { -% -32 -64 211 128 bbox -(5) (0) (1) (k) 4 beginparm -% fundamental -1.00 0 0 0 source -1 0.80 0 -48 0 48 -16 0 16 0 spline -1.000 0.000 0.000 scb -(s.p) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(s.m) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -sce -(spice:V%i %ps.m %ps.p SIN\(%v"0" %v"5" %v"1"%v"k"\)) {/Helvetica 1.000 cf} 2 20 0 -336 -160 infolabel -(offset) {ss} (V) {hS} v2 {/Helvetica 1.000 cf} 6 20 0 48 0 label -(p-p) {ss} (V) {hS} v1 {/Helvetica 1.000 cf} 6 20 0 48 48 label -(Hz) v4 {hS} v3 {/Helvetica 1.000 cf} 5 20 0 48 -48 label -endgate -} def - -%%Page: 1 1 -%%PageOrientation: Portrait -/pgsave save def bop -% 912 464 offsets -1.0000 inchscale -2.6000 setlinewidth - -1 1.00 528 528 528 592 784 592 3 polygon -1 1.00 528 400 528 336 784 336 3 polygon -1 1.00 784 464 976 464 2 polygon -1 1.00 784 336 976 336 2 polygon -1.00 0 784 336 dot -1.00 0 784 464 dot -1.00 0 976 464 circle -1.00 0 976 336 circle -1.00 -1 464 336 circle -1 1.00 464 336 528 336 2 polygon -1 1.00 528 592 464 592 2 polygon -1.00 -1 464 592 circle -1.00 0 640 336 gnd -1.00 0 640 336 dot -1.00 0 528 336 dot -1.00 0 528 592 dot -1.000 0.000 0.000 scb -(Vin) {/Helvetica 1.000 cf} 2 23 0 448 592 pinlabel -(Vout) {/Helvetica 1.000 cf} 2 20 0 992 464 pinlabel -sce -1.00 0 784 528 [(10) (k) ] resistor -1.00 0 784 400 [(1.0) (u) ] polarized -1.00 0 528 464 [(5) (0) (5) (k) ] acsource -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/psfiles/integrator.ps b/tutorial/psfiles/integrator.ps deleted file mode 100644 index c290875..0000000 --- a/tutorial/psfiles/integrator.ps +++ /dev/null @@ -1,327 +0,0 @@ -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.0 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--2/25/99 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.0 2 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/cf { dup type /realtype eq {40 mul /fscale exch def} if dup /xfont exch def - findfont fscale scalefont setfont } def -/Ss { gsave 0.67 dup scale gsave mty neg rmoveto - glevel 1 add /glevel exch def } def -/ss { gsave 0.67 dup scale gsave mty 0.5 mul rmoveto - glevel 1 add /glevel exch def } def -/ns { currentpoint transform % preserve x position! - glevel {grestore} repeat /glevel 0 def - itransform pop currentpoint pop sub 0 rmoveto } def -/ul { showflag 1 eq { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { showflag 1 eq { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave true charpath flattenpath pathbbox pop exch pop sub - grestore } def -/bs { stW 0 rmoveto } def -/pspc 0 def -/qS { (aa) stW (a a) stW sub 4 div 0 rmoveto } def -/hS { qS qS } def -/textx { dup 1 add copy 0 exch { exch dup type /stringtype eq - {stringwidth pop add}{exec} ifelse } repeat neg ns } def -/mty { 0 topmat setmatrix (A) true charpath flattenpath pathbbox exch - pop exch sub exch pop neg grestore } def -/texty { gsave 2 copy pop exec mty } def -/tcenter { textx grestore 0.5 mul 0 rmoveto } def -/tright { textx grestore fspc sub 0 rmoveto } def -/tmiddle { texty 0.5 mul rmoveto } def -/ttop { texty fspc sub rmoveto } def -/tshow {{ dup type /stringtype eq {show}{exec} ifelse} repeat ns } def - -/label { gsave translate 0 0 moveto rotate /just exch def just 16 and 0 gt - {0 1 dtransform gsave pagemat setmatrix idtransform exch grestore - 1 0 dtransform gsave pagemat setmatrix idtransform exch grestore - dup 0 eq {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse - {-1 /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch 0 lt - {-1 /just just dup 12 and 4 ne {12 xor} if def} {1} ifelse scale } if - /glevel 0 def /showflag 0 def /fspc pspc def - just 1 and 0 gt {gsave just 2 and 0 gt {tright}{tcenter} ifelse} - {fspc 0 rmoveto} ifelse - just 4 and 0 gt {just 8 and 0 gt {ttop}{tmiddle} ifelse} - {0 fspc rmoveto} ifelse - /showflag 1 def tshow grestore } def -/pinlabel { hlevel 0 eq { /pspc 20 def label /pspc 0 def } - { pop pop pop pop {pop} repeat } ifelse } def -/pinglobal { pinlabel } def -/infolabel { pinlabel } def - -/begingate { /hlevel hlevel 1 add def gsave translate 0 0 moveto dup 0 lt - {neg 1 sub -1 1 scale} if rotate dup scale } bind def -/makeparm {3 string cvs dup length 1 add string /tstr exch def tstr exch - 1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def -/beginparm { -1 1 {makeparm exch def} for - dup type /arraytype eq { aload length -1 1 {makeparm exch def} - for } if begingate } bind def -/endgate { /hlevel hlevel 1 sub def grestore } bind def - -/hlevel 0 def -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt { newpath } { stroke } ifelse grestore } def -/scb { gsave setrgbcolor } bind def /sce { grestore } bind def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 setgray } def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -% XCircuit output starts here. - -/nmos { -% -64 -64 64 128 bbox -begingate -% fundamental -1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon -1 1.00 -44 -28 -44 28 2 polygon -1 1.00 -44 0 -64 0 2 polygon -1.000 0.000 0.000 scb -(G) {/Helvetica 1.000 cf} 2 7 0 -64 0 pinlabel -(S) {/Helvetica 1.000 cf} 2 13 0 0 -64 pinlabel -(D) {/Helvetica 1.000 cf} 2 9 0 0 64 pinlabel -(spice:M%i %pD %pG %pS GND nmos) {/Times-Roman 1.000 cf} 2 4 0 -244 -139 infolabel -(sim:n %pG %pD %pS) {/Times-Roman 1.000 cf} 2 4 0 -244 -187 infolabel -sce -endgate -} def - -/gnd { -% -32 -60 64 68 bbox -begingate -1 1.00 0 0 0 -32 2 polygon -1 1.00 -32 -32 32 -32 2 polygon -1 1.00 -18 -46 18 -46 2 polygon -1 1.00 -4 -60 4 -60 2 polygon -1.000 0.000 0.000 scb -(GND) {/Times-Roman 1.000 cf} 2 1 0 0 0 pinglobal -sce -endgate -} def - -/pmos { -% -64 -64 64 128 bbox -begingate -% fundamental -1 1.00 -44 -28 -44 28 2 polygon -1 1.00 -60 0 -64 0 2 polygon -1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon -1 1.00 -52 0 8 0.00 360.00 xcarc -1.000 0.000 0.000 scb -(S) {/Helvetica 1.000 cf} 2 9 0 0 64 pinlabel -(D) {/Helvetica 1.000 cf} 2 13 0 0 -64 pinlabel -(G) {/Helvetica 1.000 cf} 2 7 0 -64 0 pinlabel -(spice:M%i %pD %pG %pS Vdd pmos) {/Times-Roman 1.000 cf} 2 4 0 -196 -139 infolabel -(sim:p %pG %pD %pS) {/Times-Roman 1.000 cf} 2 4 0 -196 -187 infolabel -sce -endgate -} def - -/vdd { -% -32 0 64 66 bbox -begingate -1 1.00 0 0 0 32 2 polygon -1 1.00 -32 32 32 32 2 polygon -(Vdd) {/Times-Roman 0.900 cf} 2 17 0 0 38 label -1.000 0.000 0.000 scb -(Vdd) {/Times-Roman 1.000 cf} 2 13 0 0 0 pinglobal -sce -endgate -} def - -/dot { -% -10 -10 20 20 bbox -begingate -248 1.00 0 0 6 0.00 360.00 xcarc -endgate -} def - -/circle { -% -6 -12 28 24 bbox -begingate -1 1.00 16 0 6 0.00 360.00 xcarc -1 1.00 0 0 10 0 2 polygon -1.000 0.000 0.000 scb -(out) {/Times-Roman 1.000 cf} 2 4 0 16 0 pinlabel -(out) {/Times-Roman 1.000 cf} 2 7 0 0 0 pinlabel -sce -endgate -} def - -%%Page: wramp 1 -%%PageOrientation: Portrait -/pgsave save def bop -% 454 416 offsets -1.0000 inchscale -2.6000 setlinewidth - -1.00 0 406 480 nmos -1.00 -1 502 480 nmos -1 1.00 406 416 502 416 2 polygon -1.00 0 454 352 nmos -1.00 0 454 288 gnd -1.00 0 406 608 pmos -1.00 -1 502 608 pmos -1.00 0 406 672 vdd -1.00 0 502 672 vdd -1.00 0 742 608 pmos -1.00 -1 166 608 pmos -1 1.00 230 608 342 608 2 polygon -1 1.00 566 608 678 608 2 polygon -1 1.00 614 608 614 544 502 544 3 polygon -1 1.00 406 544 294 544 294 608 3 polygon -1.00 0 166 672 vdd -1.00 0 742 672 vdd -1.00 0 742 192 nmos -1.00 -1 166 192 nmos -1 1.00 166 256 166 544 2 polygon -1 1.00 742 544 742 256 2 polygon -1 1.00 742 448 806 448 2 polygon -1.00 0 166 128 gnd -1.00 0 742 128 gnd -1 1.00 678 192 230 192 2 polygon -1 1.00 166 256 294 256 294 192 3 polygon -1.00 0 294 192 dot -1.00 0 166 256 dot -1.00 0 454 416 dot -1.00 0 294 608 dot -1.00 0 406 544 dot -1.00 0 502 544 dot -1.00 0 614 608 dot -1.00 0 742 448 dot -1.00 0 566 480 circle -1.00 -1 342 480 circle -1.00 -1 390 352 circle -1.00 0 806 448 circle -1.000 0.000 0.000 scb -(in.p) {/Helvetica 1.000 cf} 2 20 0 582 480 pinlabel -(in.m) {/Helvetica 1.000 cf} 2 23 0 326 480 pinlabel -(bias) {/Helvetica 1.000 cf} 2 23 0 374 352 pinlabel -(out) {/Helvetica 1.000 cf} 2 20 0 822 448 pinlabel -sce -pgsave restore showpage - -/wramp { -% -80 -80 160 160 bbox -begingate -0 1.00 -80 -80 -80 80 48 24 48 -24 4 polygon -1 1.00 0 -80 0 -45 2 polygon -1 1.00 48 0 80 0 2 polygon -(-) {/Symbol 1.000 cf} 2 5 0 -61 50 label -(+) {/Symbol 1.000 cf} 2 5 0 -61 -46 label -1.000 0.000 0.000 scb -(in.m) {/Times-Roman 1.000 cf} 2 7 0 -80 48 pinlabel -(in.p) {/Times-Roman 1.000 cf} 2 7 0 -80 -48 pinlabel -(out) {/Times-Roman 1.000 cf} 2 4 0 80 0 pinlabel -(bias) {/Times-Roman 1.000 cf} 2 13 0 0 -80 pinlabel -sce -endgate -} def - -/capacitor { -% -32 -64 64 128 bbox -begingate -% fundamental -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 -32 -6 32 -6 2 polygon -1.000 0.000 0.000 scb -(c.1) {/Times-Roman 1.000 cf} 2 9 0 0 64 pinlabel -(c.2) {/Times-Roman 1.000 cf} 2 13 0 0 -64 pinlabel -(spice:C%i %pc.1 %pc.2 1.0P) {/Times-Roman 1.000 cf} 2 0 0 -208 -160 infolabel -(sim:c %pc.1 %pc.2) {/Times-Roman 1.000 cf} 2 0 0 -208 -208 infolabel -sce -endgate -} def - -%%Page: 2 2 -%%PageOrientation: Portrait -/pgsave save def bop -% 294 390 offsets -1.0000 inchscale -2.6000 setlinewidth - -1.00 0 310 390 wramp -1 1.00 230 438 198 438 198 518 422 518 422 390 5 polygon -1 1.00 390 390 454 390 2 polygon -1.00 0 422 390 dot -1.00 0 454 390 circle -1.00 -1 166 342 circle -1.00 -271 310 310 circle -1.000 0.000 0.000 scb -(Bias) {/Helvetica 1.000 cf} 2 29 0 310 294 pinlabel -sce -1 1.00 166 342 230 342 2 polygon -1.000 0.000 0.000 scb -(Input) {/Helvetica 1.000 cf} 2 23 0 150 342 pinlabel -(Output) {/Helvetica 1.000 cf} 2 20 0 470 390 pinlabel -sce -(Integrator) {/Helvetica 1.000 cf} 2 25 0 294 582 label -1.00 0 422 326 capacitor -1.00 0 422 262 gnd -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/psfiles/powersup.ps b/tutorial/psfiles/powersup.ps deleted file mode 100644 index d568156..0000000 --- a/tutorial/psfiles/powersup.ps +++ /dev/null @@ -1,429 +0,0 @@ -%!PS-Adobe-3.0 -%%Title: powersup -%%Creator: Xcircuit v2.3 -%%CreationDate: Wed Jul 18 14:38:19 2001 -%%Pages: 2 -%%BoundingBox: 118 314 494 478 -%%DocumentNeededResources: font Helvetica font Times-Roman font Times-RomanISO -%%+ font HelveticaISO font Symbol -%%EndComments -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.3 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--5/16/01 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.3 1 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/ul { dup type /stringtype eq showflag 1 eq and { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave currentpoint newpath moveto true charpath flattenpath - pathbbox pop exch pop sub grestore } def -/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs - 0 currentpoint pop put} def -/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def -/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt - {currentpoint exch pop moveto exit} {pop} ifelse } for } def -/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def -/hS { qS qS } def -/pspc 0 def -/cf0 { scalefont setfont } bind def -/Kn { dup kY add /kY exch def rmoveto } bind def -/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.33 mul neg Kn} def -/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul - 0.67 mul Kn } def -/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def -/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def -/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq - { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} - {fscale0 mul fscale mul cf0} ifelse } def -/ctmk { counttomark dup 2 add -1 roll pop } bind def -/label { gsave translate 0 0 moveto dup scale /rotval exch def /just exch def - just 16 and 0 gt {0 1 dtransform gsave pagemat setmatrix idtransform - exch grestore 1 0 dtransform gsave pagemat setmatrix idtransform - exch grestore dup 0 eq {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse - {-1 /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch 0 lt - {-1 /just just dup 12 and 4 ne {12 xor} if def} {1} ifelse scale } - if /showflag 0 def /fspc pspc def /Bline 0 def /Tabs 0 array def - /fscale 1.0 def /kY 0 def - gsave dup 1 add copy 0 exch {exch dup type /stringtype eq {true - charpath flattenpath} {exec} ifelse } repeat pop pathbbox grestore - 3 -1 roll pop 3 1 roll just 1 and 0 gt {just 2 and 0 gt {exch pop - neg fspc sub} {exch sub 0.5 mul neg} ifelse} {pop neg fspc add} - ifelse exch Bline exch just 4 and 0 gt {just 8 and 0 gt {exch pop - neg fspc sub} {add 0.5 mul neg} ifelse} {pop neg fspc add} ifelse - /showflag 1 def rotval rotate Kn currentpoint translate - /Bline 0 def /Tabs 0 array def /fscale 1.0 def /kY 0 def - {dup type /stringtype eq {show}{exec} ifelse} repeat grestore } def -/pinlabel { hlevel 0 eq { /pspc 20 def label /pspc 0 def } - { pop pop pop pop pop {pop} repeat } ifelse } def -/pinglobal { pinlabel } def -/infolabel { pinlabel } def - -/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def -/cRedef {/defColor currentcolor 3 array astore def} def -/begingate { /hlevel hlevel 1 add def /defColor currentcolor sce 3 array - astore def gsave sce translate 0 0 moveto dup 0 lt - {neg 1 sub -1 1 scale} if rotate dup scale } bind def -/makeparm {3 string cvs dup length 1 add string /tstr exch def tstr exch - 1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def -/beginparm { -1 1 {makeparm exch def} for - dup type /arraytype eq { aload length -1 1 {makeparm exch def} - for } if begingate } bind def -/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef - scb} bind def - -/hlevel 0 def -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt style 512 eq or { newpath } { stroke } ifelse grestore } def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def -/insertion {/PSobj save def /showpage {} def bop translate} def -/end_insert {PSobj restore} def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -/Times-Roman findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall -/Encoding ISOLatin1Encoding def currentdict end -/Times-RomanISO exch definefont pop - -/Helvetica findfont dup length dict begin -{1 index /FID ne {def} {pop pop} ifelse} forall -/Encoding ISOLatin1Encoding def currentdict end -/HelveticaISO exch definefont pop - -% XCircuit output starts here. - -/inductor { -% -14 -64 29 112 bbox -begingate -1 1.00 20 -28 20 -44 0 -48 0 -24 spline -1 1.00 -20 -20 -20 -32 0 -28 0 -24 spline -1 1.00 20 32 20 16 0 12 0 36 spline -1 1.00 20 12 20 -4 0 -8 0 16 spline -1 1.00 20 -8 20 -24 0 -28 0 -4 spline -1 1.00 -20 20 -20 8 0 12 0 16 spline -1 1.00 -20 0 -20 -12 0 -8 0 -4 spline -1 1.00 0 -48 0 -64 2 polygon -1 1.00 0 36 0 48 2 polygon -1.000 0.000 0.000 scb -(l.1) {/Times-Roman cf} 2 9 0 1.00 0 48 pinlabel -(l.2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -(spice:L%i %pl.1 %pl.2 1.0U) {/Times-Roman cf} 2 0 0 1.00 -208 -160 infolabel -sce -(sim:l %pl.1 %pl.2) {/Times-Roman cf} 2 0 0 1.00 -208 -208 infolabel -endgate -} def - -/Transformer { -% -62 -64 108 112 bbox -(?) 1 beginparm -1.00 0 -48 0 inductor -1 1.00 -16 48 -16 -64 2 polygon -1 1.00 0 48 0 -64 2 polygon -1.00 180 32 -16 inductor -1.000 0.000 0.000 scb -(1) {/Helvetica cf} 2 25 0 1.00 -48 48 pinlabel -(2) {/Helvetica cf} 2 29 0 1.00 -48 -64 pinlabel -(3) {/Helvetica cf} 2 25 0 1.00 32 48 pinlabel -(4) {/Helvetica cf} 2 29 0 1.00 32 -64 pinlabel -sce -mark v1 (pcb:T) {/Times-Roman cf} ctmk 20 0 1.00 -96 -160 infolabel -endgate -} def - -/circle { -% -6 -12 28 24 bbox -% trivial -begingate -1 1.00 16 0 6 0.00 360.00 xcarc -1 1.00 0 0 10 0 2 polygon -1.000 0.000 0.000 scb -(out) {/Times-Roman cf} 2 4 0 1.00 16 0 pinlabel -(out) {/Times-Roman cf} 2 7 0 1.00 0 0 pinlabel -endgate -} def - -/diode { -% -18 -48 36 96 bbox -(?) 1 beginparm -248 1.00 -18 -16 0 16 18 -16 3 polygon -1 1.00 0 -48 0 -16 2 polygon -1 1.00 0 48 0 16 2 polygon -1 1.00 -18 16 18 16 2 polygon -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 48 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -48 pinlabel -sce -mark v1 (pcb:D) {/Helvetica cf} ctmk 20 0 1.00 -64 -144 infolabel -endgate -} def - -/rectifier { -% -112 -48 192 192 bbox -begingate -1.00 315 -64 96 diode -1.00 225 32 96 diode -1.00 225 -64 0 diode -1.00 315 32 0 diode -1 1.00 -30 130 -16 144 -2 130 3 polygon -1 1.00 66 62 80 48 66 34 3 polygon -1 1.00 -2 -34 -16 -48 -30 -34 3 polygon -1 1.00 -98 34 -112 48 -98 62 3 polygon -endgate -} def - -/dot { -% -10 -10 20 20 bbox -% trivial -begingate -248 1.00 0 0 6 0.00 360.00 xcarc -1.000 0.000 0.000 scb -(x) {/Times-Roman cf} 2 29 0 1.00 0 0 pinlabel -endgate -} def - -/jumper { -% -4 -14 18 28 bbox -% trivial -begingate -1 1.00 0 0 10 -90.00 90.00 xcarc -1 1.00 0 10 0 16 2 polygon -1 1.00 0 -10 0 -16 2 polygon -1.000 0.000 0.000 scb -(a) {/Times-Roman cf} 2 1 0 1.00 0 16 pinlabel -(a) {/Times-Roman cf} 2 13 0 1.00 0 -16 pinlabel -endgate -} def - -/gnd { -% -32 -60 64 68 bbox -% trivial -begingate -1 1.00 0 0 0 -32 2 polygon -1 1.00 -32 -32 32 -32 2 polygon -1 1.00 -18 -46 18 -46 2 polygon -1 1.00 -4 -60 4 -60 2 polygon -1.000 0.000 0.000 scb -(GND) {/Times-Roman cf} 2 1 0 1.00 0 0 pinglobal -endgate -} def - -/Capacitor { -% -32 -64 186 128 bbox -(1.0) (p) (?) 3 beginparm -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 -32 -6 32 -6 2 polygon -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -mark v2 v1 ( %p1 %p2 ) v3 (spice:C) {/Times-RomanISO cf} ctmk 4 0 1.00 -208 --160 infolabel -sce -(sim:c %p1 %p2) {/Times-Roman cf} 2 4 0 1.00 -208 -208 infolabel -mark (F) v2 {hS} v1 {/Times-RomanISO cf} ctmk 20 0 1.00 48 0 label -sce -mark v3 (pcb:C) {/Times-Roman cf} ctmk 20 0 1.00 -208 -256 infolabel -endgate -} def - -/Polarized { -% -32 -64 176 128 bbox -(1.0) (p) (?) 3 beginparm -1 1.00 0 -64 0 -6 2 polygon -1 1.00 0 64 0 6 2 polygon -1 1.00 -32 6 32 6 2 polygon -1 1.00 0 -80 74 66.00 114.00 xcarc -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -mark v2 v1 ( %p1 %p2 ) v3 (spice:C) {/Times-RomanISO cf} ctmk 4 0 1.00 -208 --160 infolabel -sce -(sim:e %p1 %p2) {/Times-Roman cf} 2 4 0 1.00 -208 -208 infolabel -mark (F) v2 {hS} v1 {/Times-RomanISO cf} ctmk 20 0 1.00 48 0 label -sce -mark v3 (pcb:C) {/Times-Roman cf} ctmk 20 0 1.00 -208 -256 infolabel -endgate -} def - -%%Page: power_supply 1 -%%PageOrientation: Portrait -/pgsave save def bop -% power_supply is_symbol -% 529 953 offsets -1.0000 inchscale -2.6000 setlinewidth - -1.00 0 497 1065 Transformer -1 1.00 449 1113 449 1193 401 1193 3 polygon -1 1.00 449 1001 449 937 401 937 3 polygon -1.00 -1 401 1193 circle -1.00 -1 401 937 circle -1.000 0.000 0.000 scb -(+) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 385 1193 pinlabel -(-) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 385 937 pinlabel -sce -1.00 0 785 1017 rectifier -1 1.00 529 1113 529 1193 769 1193 769 1161 4 polygon -1 1.00 529 1001 529 937 769 937 769 969 4 polygon -1.00 0 769 969 dot -1.00 0 769 1161 dot -1 1.00 673 1065 641 1065 641 953 3 polygon -1 1.00 641 921 641 873 1201 873 3 polygon -1 1.00 865 1065 1201 1065 2 polygon -1 1.00 961 1065 961 1033 2 polygon -1 1.00 1041 1065 1041 1033 2 polygon -1 1.00 961 905 961 873 2 polygon -1 1.00 1041 905 1041 873 2 polygon -1.00 0 1041 873 dot -1.00 0 961 873 dot -1.00 0 961 1065 dot -1.00 0 1041 1065 dot -1.00 0 865 1065 dot -1.00 0 673 1065 dot -1.00 -1 641 937 jumper -1.00 0 641 873 gnd -1.00 0 641 873 dot -1.00 0 1201 873 circle -1.00 0 1201 1065 circle -1.000 0.000 0.000 scb -(Vout) {0 -80 Kn} {/Helvetica cf} 3 28 0 1.00 1217 1065 pinlabel -sce -(+) {/Symbol cf} 2 20 0 1.00 1249 1065 label -(-) {/Symbol cf} 2 20 0 1.00 1249 873 label -(Bridge Rectifier) {/Helvetica cf} 2 24 0 1.00 369 1273 label -1.00 -1 961 969 [(1.0) (\265) ] Capacitor -1.00 0 1041 969 [(10) (\265) ] Polarized -(1N914) {hS} (\327) {hS} (4) {/HelveticaISO cf} 6 24 0 1.00 849 1145 label -pgsave restore showpage - -/power_supply { -% -224 -208 416 416 bbox -% power_supply is_schematic -begingate -0 1.00 -224 -208 -224 208 192 208 192 -208 4 polygon -(+) {/Symbol cf} (V) {/Helvetica cf} 4 20 0 1.00 -192 112 label -(-) {/Symbol cf} (V) {/Helvetica cf} 4 20 0 1.00 -192 -112 label -1.000 0.000 0.000 scb -(+) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 -224 112 pinlabel -(-) {/Symbol cf} (V) {/Helvetica cf} 4 23 0 1.00 -224 -112 pinlabel -sce -(power supply) {CR} (unregulated) {/Helvetica cf} 4 21 0 1.00 -16 16 label -1.000 0.000 0.000 scb -(Vout) {/Helvetica cf} 2 20 0 1.00 192 112 pinlabel -sce -(Vout) {/Helvetica cf} 2 23 0 1.00 160 112 label -endgate -} def - -/Resistor { -% -14 -64 157 128 bbox -(1.0) (k) (?) 3 beginparm -1 1.00 0 64 0 36 2 polygon -1 1.00 0 -64 0 -36 2 polygon -1 1.00 0 -36 14 -30 -14 -18 14 -6 -14 6 14 18 -14 30 0 36 8 polygon -1.000 0.000 0.000 scb -(1) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel -(2) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel -sce -mark v2 v1 ( %p1 %p2 ) v3 (spice:R) {/Times-Roman cf} ctmk 4 0 1.00 -208 -160 -infolabel -sce -(sim:R %p1 %p2) {/Times-Roman cf} 2 4 0 1.00 -208 -208 infolabel -mark (W) {/Symbol cf} v2 {hS} v1 {/Times-Roman cf} ctmk 20 0 1.00 32 0 label -sce -mark v3 (pcb:R) {/Times-Roman cf} ctmk 20 0 1.00 -208 -256 infolabel -endgate -} def - -%%Page: 2 2 -%%PageOrientation: Portrait -/pgsave save def bop -% 1166 848 offsets -1.0000 inchscale -2.6000 setlinewidth - -1.00 0 782 1056 power_supply -1 1.00 558 1168 414 1168 2 polygon -1 1.00 558 944 414 944 2 polygon -1.00 0 1166 1040 Resistor -1 1.00 974 1168 1166 1168 1166 1104 3 polygon -1.00 0 1166 976 gnd -(AC input) {/Helvetica cf} 2 21 0 1.00 398 1056 label -(+) {/Symbol cf} 2 21 0 1.00 398 1136 label -(-) {/Symbol cf} 2 21 0 1.00 398 976 label -1.00 -1 414 1168 circle -1.00 -1 414 944 circle -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/psfiles/test1.ps b/tutorial/psfiles/test1.ps deleted file mode 100644 index 5cc16f5..0000000 --- a/tutorial/psfiles/test1.ps +++ /dev/null @@ -1,154 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Title: test1 -%%Creator: Xcircuit v2.0 -%%CreationDate: Mon May 24 11:14:54 1999 -%%Pages: 1 -%%BoundingBox: 68 68 214 118 -%%DocumentNeededResources: font Times-Italic font Times-Roman -%%EndComments -%%BeginProlog -% -% PostScript prolog for output from xcircuit -% Version: 2.0 -% -% Electrical circuit (and otherwise general) drawing program -% -% Written by Tim Edwards 8/5/93--8/8/97 (tim@bach.ece.jhu.edu) -% The Johns Hopkins University -% -%%BeginResource: procset XCIRCproc 2.0 2 -% supporting definitions --- these are the primary xcircuit types. - -/XCIRCsave save def -/topmat matrix currentmatrix def - -/fontslant { /slant exch def [1 0 slant 1 0 0] - exch findfont exch makefont dup length dict /ndict exch def - { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall - ndict definefont pop} def -/cf { dup type /realtype eq {40 mul /fscale exch def} if dup /xfont exch def - findfont fscale scalefont setfont } def -/Ss { gsave 0.67 dup scale gsave mty neg rmoveto - glevel 1 add /glevel exch def } def -/ss { gsave 0.67 dup scale gsave mty 0.5 mul rmoveto - glevel 1 add /glevel exch def } def -/ns { currentpoint transform % preserve x position! - glevel {grestore} repeat /glevel 0 def - itransform pop currentpoint pop sub 0 rmoveto } def -/ul { showflag 1 eq { gsave - currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) - false charpath flattenpath pathbbox grestore exch pop 1 index - sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 - rlineto stroke moveto } if } def -/ol { showflag 1 eq { gsave gsave - currentpoint topmat setmatrix 2 index stringwidth pop 3 index - true charpath flattenpath pathbbox grestore exch pop - exch pop topmat setmatrix (_) true charpath pathbbox grestore - exch pop 1 index sub setlinewidth exch pop currentpoint - exch 4 1 roll exch sub add moveto pop 0 rlineto stroke - moveto } if } def -/stW { gsave true charpath flattenpath pathbbox pop exch pop sub - grestore } def -/bs { stW 0 rmoveto } def -/pspc 0 def -/qS { (aa) stW (a a) stW sub 4 div 0 rmoveto } def -/hS { qS qS } def -/textx { dup 2 mul 1 add copy 0 exch - { exch exec exch stringwidth pop add } repeat neg ns } def -/mty { 0 topmat setmatrix (A) true charpath flattenpath pathbbox exch - pop exch sub exch pop neg grestore } def -/texty { gsave 2 copy pop exec mty } def -/tcenter { textx grestore 0.5 mul 0 rmoveto } def -/tright { textx grestore fspc sub 0 rmoveto } def -/tmiddle { texty 0.5 mul rmoveto } def -/ttop { texty fspc sub rmoveto } def -/tshow { { exec show } repeat ns } def - -/label { gsave translate 0 0 moveto rotate /just exch def just 16 and 0 gt - {0 1 dtransform gsave pagemat setmatrix idtransform exch grestore - 1 0 dtransform gsave pagemat setmatrix idtransform exch grestore - dup 0 eq {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse - {-1 /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse exch 0 lt - {-1 /just just dup 12 and 4 ne {12 xor} if def} {1} ifelse scale } if - /glevel 0 def /showflag 0 def /fspc pspc def - just 1 and 0 gt {gsave just 2 and 0 gt {tright}{tcenter} ifelse} - {fspc 0 rmoveto} ifelse - just 4 and 0 gt {just 8 and 0 gt {ttop}{tmiddle} ifelse} - {0 fspc rmoveto} ifelse -/showflag 1 def tshow grestore } def -/pinlabel { /pspc 20 def label /pspc 0 def } def -/pinglobal { pinlabel } def - -/begingate { gsave translate 0 0 moveto dup 0 lt {neg 1 sub -1 1 scale} if - rotate dup scale /pinlabel { pop pop pop pop 2 mul {pop} repeat} - def } bind def -/beginparm { -1 1 {1 add -1 roll def} for begingate } bind def -/endgate { grestore /pinlabel { /pspc 20 def - label /pspc 0 def } def } bind def - -/tmpa [1 0 0 1 0 0] def -/gar {8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind -{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind -{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind -{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind -{8 8 true tmpa {} imagemask} bind -{8 8 true tmpa {} imagemask} bind 7 array astore def -/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll - neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy - gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll - { 3 index exch 5 exch put dup -8 3 index { 3 index - exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def -/setstyles { - currentlinewidth mul setlinewidth /style exch def - style 1 and 0 gt not {closepath} if - style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if - style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if - style dup 256 ge exch 480 lt and { gsave 1 setgray eofill grestore } if - style 16 and 0 gt { gsave style 224 and -5 bitshift dup 7 lt - {gar exch get ppaint} { pop eofill } ifelse grestore } if - style 8 and 0 gt { newpath } { stroke } ifelse grestore } def -/scb { gsave setrgbcolor } bind def /sce { grestore } bind def - -/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def -/xcarc { gsave newpath arc setstyles } def -/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll - 3 index div 1 scale } def -/ele { 0 4 1 roll 0 4 1 roll } bind def -/ellipse { gsave elb newpath ele arc setmatrix setstyles } def -/pellip { elb ele arc setmatrix } def -/nellip { elb ele arcn setmatrix } def -/spline { gsave moveto curveto setstyles } def -/polyc { {lineto} repeat } bind def -/beginpath { gsave moveto } bind def -/endpath { setstyles } bind def -/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 setgray } def -/setpagemat {/pagemat matrix currentmatrix def} def -/inchscale {setpagemat 0.375 mul dup scale} def -/cmscale {setpagemat 0.35433071 mul dup scale} def - -%%EndResource -%%EndProlog - -/Symbol-Oblique /Symbol .167 fontslant - -% XCircuit output starts here. - -%%Page: 1 1 -%%PageOrientation: Portrait -/pgsave save def bop -% 448 96 offsets -1.0000 inchscale -2.6000 setlinewidth - -(\)) {qS} () {/Times-Roman 1.000 cf} (t) {/Times-Italic 1.000 cf} () {ns} (c) -{ss} () {/Times-Italic 1.000 cf} (pw) {/Symbol-Oblique 1.000 cf} (\) = sin\(2) -{/Times-Roman 1.000 cf} (x) {/Times-Italic 1.000 cf} (\() -{/Times-Roman 1.000 cf} () {qS} (f) {/Times-Italic 1.000 cf} -12 4 0 224 256 label -0 1.00 192 192 192 304 560 304 560 192 4 polygon -pgsave restore showpage - -%%Trailer -XCIRCsave restore -%%EOF diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html deleted file mode 100644 index 421047b..0000000 --- a/tutorial/tutorial.html +++ /dev/null @@ -1,803 +0,0 @@ - - - - -XCircuit Tutorial Page - -
- -

The XCircuit Tutorial

-
-
-

Table of Contents

- - -

Download

- -This download is the tar'd image of everything in the tutorial subdirectory, -including both the standard tutorial and the schematic capture tutorial. -Note that when untar'd, this will expand into a directory tree with top-level -directory named "tutorial".

- -

-
- - - - - - - - - - - - -
File Revision Size Date
tutorial.tar.gz 1 (432KB) January 28, 2003
-
-
- -

Getting started

-Welcome to xcircuit, the circuit drawing program by Tim Edwards. In order to -get the most out of this page, you should have already downloaded, compiled, -and installed the xcircuit program and its libraries.

- -

Task 1: Run the program

-First, start xcircuit without any parameters: xcircuit

- -

-The features of the xcircuit window are as follows: -

    -
  1. Along the top of the screen are buttons for pull-down menus called "File", - "Edit", "Text", "Options", and "Window". -
  2. At the top, beside the menu buttons, is a welcome message in the message - window telling you the version number of the program (Version 2.0). -
  3. On the bottom left is a message window telling you that you are currently - editing "Page 1". -
  4. On the rest of the bottom is a message window telling you that xcircuit - has just loaded the library "/usr/local/lib/xcircuit/builtins.lps" (this - may be in a different directory if xcircuit has not been installed in the - default directories). This message will disappear after about 10 seconds. -
  5. At the left and along the bottom are two scrollbars which report the - position of the drawing relative to the main window, and can be used - to reposition the drawing by clicking on the bar with any mouse button. - Note: Due to the length of time necessary to refresh the drawing - window, the scrollbars cannot be "dragged". -
  6. In the center is a white drawing area with lightly-colored grid and - axis lines. -
-There are two types of mouse button-pushing used in xcircuit. When a button -is pushed and released quickly, I will call it "tapping". When a button -is pushed and held down, I will call it a "pressing". Since pressing -a button is usually performed in order to move objects around on the screen, -I will sometimes refer to it as "dragging" the object.

-Note: Xcircuit does not use double-clicking. - -

Task 2: Change an option from the menu

-Acquaint yourself with the arrangement of menu buttons and pulldown menus. -
    -
  1. Press the button labeled "Options" with mouse button 1 and hold down - the button while you drag the cursor around with the mouse. -
  2. Keeping the mouse button pressed down, move down to the "Elements" button. - Each button will highlight as you pass through it. -
  3. Put the cursor on top of the arrow icon at the right side of the "Elements" - button. You should see a secondary menu titled "Elements" pop up. The - title is the topmost entry of the menu. It has no function and does not - highlight when the cursor is overtop it. -
  4. Keep moving down to the "Color" button and again move the cursor over - the arrow icon. The third and final menu of colors will pop up. Note - that one item, "Inherit Color" has a check mark on it. The check mark - denotes that this entry is the current default color. -
  5. Move down to the purple color button and release the mouse button there. - The menus will disappear. You have just changed the default drawing - color to purple. -
  6. Repeat the procedure up to step 4. When you enter the "color" menu you - will see that the purple color button is now checked, showing that - purple is the default drawing color. -
-Throughout the tutorial I will refer to the menu items using the pulldown -hierarchy, with an arrow ("->") wherever you need to go to a submenu. So -the "Inherit Color" menu item would be referred to as -"Options->Elements->Color->Inherit Color". - -

Task 3: Draw a line

-Now that you understand the function of the menu buttons, it's time to learn -how to draw something. The simplest and most common thing to draw in xcircuit -is a polygon. -
    -
  1. Tap mouse button 1 anywhere in the drawing area and release it - immediately. If you wait too long to release the button, xcircuit will - interpret it as trying to "grab" an element on the screen, and nothing - will happen (because there aren't any elements yet to grab). -
  2. Move the cursor around the screen. A purple line (because you chose - purple to be the default color in Task 2) will appear between the - origin point and will track with the cursor. -
  3. Tap mouse button 1 again to finish a line segment. A new line - will begin at the point the first one left off. Do this several times - to form a polygon. Finish the polygon by tapping mouse button 2. -
  4. Repeat steps 1 through 3 but finish by tapping mouse button 3. - The line you have just created will disappear. You have just - cancelled the operation. -
- - A purple polygon

- -For most operations in xcircuit, tapping mouse button 1 will begin or -continue an operation, tapping mouse button 2 will finish it, and -tapping mouse button 3 will cancel it. The behavior can be slightly -different depending on the circumstance, and the behavior for pressing -buttons 1 and 2 is very different, as demonstrated in Tasks 4 and 5. - -

Task 4: Move an object

-mouse button 1 does have one very different function than that described -in the last task. It can be used to "grab" hold of an object for moving. -
    -
  1. Press mouse button 1 close to a line of the polygon you just - drew. Hold down the button. The line should turn gold colored, - indicating that it has been "selected". If instead nothing happens, - then the cursor is too far away from the line. Releasing the button - releases the object. -
  2. Try grabbing and releasing the polygon from different distances to get - a feel for how close you must be to the object in order to grab it. -
  3. Now grab the polygon, and with the mouse button held down, move the - cursor across the screen. The polygon will follow the cursor. This - is how you move an object in xcircuit. -
- -

Task 5: Change the properties of a polygon

-mouse button 2 also has a selection funtion; in fact, it has two of -them. In the normal drawing mode, it can be used to select objects for editing -or changing properties. In this task you will use mouse button 2 to -select the polygon you just created in order to make it a dashed line. -
    -
  1. Select the object by tapping mouse button 2 with the cursor near - to the object. The object will turn gold, indicating that it has been - selected. -
  2. Tap mouse button 3, and the selection will be canceled. -
  3. Investigate the other form of selection by pressing mouse button 2 - starting below and to the left of the polygon, and dragging the cursor - to the top and right of the polygon. A green box will follow the - movement of the cursor. -
  4. When the box completely surrounds at least one of the endpoints - of any line segment of the polygon, release the button. The polygon - should be selected. -
  5. Click mouse button 3 to deselect the object. -
  6. Repeat steps 3 through 5, noting that if no endpoint of the polygon - is contained within the select box, then the polygon will not - be selected. -
  7. Select the polygon but do not deselect it. -
  8. Go to the "Options->Elements->Border" submenu and select option - "Dashed". When you release the button, the polygon will be drawn - in dashed lines, and it will no longer be selected. -
  9. Experiment with the different Colors, Fill-styles, and Border-styles - available in the menus. Some of the many varieties are shown below. -
- - More purple polygons.
Top left: original. - Top right: dashed.
Center left: closed. Center right: stippled - (50% stipple).
Bottom left: opaque stippled. Bottom right: - filled solid.

- -

Task 6: Change the page

-Xcircuit has multiple pages. There are two ways to change the current -drawing page, from a keyboard macro convenience function, or from the -menu. -
    -
  1. Select the menu item "Window->Goto Page->Page 2". The polygon - you just drew on Page 1 will disappear, and you will be on a - clean page, with the bottom left-hand window saying that you - are editing "Page 2". -
  2. Go back to Page 1 using the keyboard macro: With the cursor - in the drawing area, press the "1" key. You will be back on - page one. -
  3. Keys "1" through "9" and "0" will get you instantly to pages - 1 through 10, respectively. -
  4. End this task on Page 2, which is currently empty. -
- -

Task 7: Select an object from the user library

-Another common task in xcircuit is to grab an object from the object -library and place it on the drawing. -
    -
  1. Select the "Window->Show Library" button from the menu, or press the - "l" (that's "ell" as in "library") key in the drawing window. Note - that the menu button has - "(l)" written after "Show Library", indicating that the keyboard - macro "l" has the same function as the menu button. Generally, - keyboard macros, once memorized, are more convenient to use than - their menu button counterparts. Almost always, the letter or symbol - used for the macro is meaningful and easy to remember (like "a" for - "arc", "s" for "spline", "p" for "pan", "c" for "copy", etc.). -
  2. A page will appear, showing a number of circuit objects in the - built-in object library. -
  3. Grab one object by moving the cursor over top it and pressing and - holding mouse button 1. As soon as the button is pressed, - the object library will disappear, and you will be dragging the - object around Page 2, from which you called up the library. When - you release the button, the object will be deselected. Place it - away from the polygon you drew in the previous tasks. -
  4. Select the object by tapping on it with mouse button 2. - Try changing the border style to dashed. You will see that - nothing happens. This is because object instances from the - library are made up of basic elements like polygons, - arcs, and splines, but they are composite objects which - do not have properties like "Fill-style" and "Border-style". - However, object instances do have the property of color, and - also the property "size" which simple elements like the polygon - do not have. -
  5. Select the object again (if you have not already done so), and - then select the menu item "Options->Elements->Object Size". -
  6. A window will pop up asking you for an object size. Place the - cursor somewhere inside the popup window and change the default - size of "1.00" to "1.5". -
  7. Press the "Okay" button. The popup window will disappear and - the object will now be 1.5 times its original size (that is - to say, its length and width will each be 1.5 times their - previous value). -
- -
-
Part of the default circuits built-in library.

-

- -

Task 8: Use a keyboard macro to create an arc

-As mentioned above, keyboard macros are generally easier to use than -their menu-button counterparts. You will create an arc in both fashions -to show the difference. -
    -
  1. Select the menu item "Edit->Make Arc". -
  2. The information window at the bottom will say "Click button 1 - and drag to create arc". -
  3. Place the cursor where you want the arc center to be and press it. - While holding it down, drag the cursor around the screen. An arc - will follow the cursor. -
  4. Release the mouse button. You will now be editing the angle of the - first endpoint. If you just want a circle, tap mouse button 2 - to end. If you keep pressing mouse button 1, you will be - able to edit, in turn, all the properties of the arc such as - endpoint positions and ellipse axis. -
  5. Now, create an arc by tapping the "a" key while the cursor is in the - drawing area. The main difference is that mouse button 1 is - not held down while you form the radius of the arc. Otherwise, - the arc can be edited as before. -
- - Some differenct arcs. -
Top left: linewidth of 1.5, first endpoint at 90 degrees. - Top right: closed arc. -
Bottom left: red circle. - Bottom right: blue ellipse.

- -

Task 9: Zooming and panning

-
    -
  1. Pan the screen to be centered on the arc by placing the cursor close to - the center of the arc and tapping the "p" key. -
  2. Pan the screen by selecting menu item "Window->Center Pan" and then - tapping mouse button 1 on the point of the drawing area that - you want to be the new center of the screen. -
  3. Tap the "Z" and "z" keys to zoom in and out, or select the menu items - "Window->Zoom In" and "Window->Zoom Out". Note how the scrollbars - on the side and bottom of the screen change with the scale of the - drawing. -
  4. Pan the screen by tapping any mouse button on either of the scrollbars. - Note how this function is similar to the "Pan" function. -
  5. Zoom to a selected area of the screen by making a green selection box - like you did in Task 5, step 3. However, instead of releasing the - button in order to make the selection, type the "Z" key while the - mouse button is still pressed down. The screen area will zoom to - the area of the green box. -
  6. Alternately, choose "Window->Zoom Box" from the menu. Then press - any mouse button and drag to generate the green selection box. When - the button is released, the screen area will zoom to the area of the - green box. -
- -

Task 10: Selection of multiple objects

-
    -
  1. Clear the current page by choosing the menu item "File->Clear Page". - There is no keyboard macro for this command, to prevent accidental - erasure of the screen (which cannot be undeleted). -
  2. Grab several objects from the library (see Task 7) and place them - on top of each other in the middle of the page. -
  3. Decide on one object which you will move, leaving the others where - they are. -
  4. Now press mouse button 1 as if you were going to select the - object you want to move. Because the command is ambiguous---the - program doesn't know which one or ones of the objects you really - want to select---the program will query you one by one for which - objects you want to select. -
  5. One object will turn blue, the cursor will become a question mark, - and the information bar at the bottom will read, for example, - "Click to accetp/reject: 1 of 3" if the program found three - objects under the cursor. Release the mouse button at this - point. -
  6. If the object that you want to select and move is colored blue, - click mouse button 2. If an object that you don't - want to select and move is colored blue, click mouse button - 3. -
  7. When you have chosen or rejected each of the objects, the cursor - will become a circle. You may now press and hold mouse button - 1 and continue with the intended move. -
  8. Try this several times to get used to it. -
- -
-
Three objects simultaneously selected.
- The gold-colored gate has already been selected; the program is now prompting - the user for confirmation to add the blue-colored object to the selection.

-

-
Message window when selecting multiple objects. -

- -

Task 11: Saving a file

-Since the main purpose of xcircuit is to create publishable-quality picutures, -it is necessary to understand a little bit about the PostScript output which -it writes. First I will show you how to save and load a file. - -
    -
  1. Choose a page which you have been drawing on, or create a drawing to - save. -
  2. Select the menu item "File->Write Xcircuit PS". You will get a popup - window that looks like the figure below.
    -
    The file properties popup window. -
  3. If you tap the button labeled "Write". You will get a message in the - bottom message window saying "Warning: Enter a new name". Nothing - has been written at this point. -
  4. Change the filename. Move the cursor over the window containing the - filename. Delete the current file name and type in a new one. - When you are done, either hit the RETURN key or tap the - button labeled "Okay" (both actions have the same effect). -
  5. Important note: If the name has no extension, an - extension ".ps" will automatically be added when the file - is written. If an extension, for instance ".eps", is written - in the filename, then it will be used. -
  6. When you change the filename, the page label will be changed to - match the filename, and the bottom left-hand message window will - now say "Editing: " followed by the page label name, followed by - the page number in parentheses.
    -
    Changes to scale and filename. -
  7. If the filename you chose already exists on the disk, the button - which previously was labeled "Write File" will now say "Overwrite - File", the computer will beep, and the bottom message window will - say "Warning: File exists". -
  8. Tap the button labeled "Close". The window disappears; because - you did not tap the "Write File" button, nothing was written, - although the filename change has been registered. -
  9. Select "File->Write Xcircuit PS" again to bring the window back. - This time, tap the "Write File" button. The file will be written - to the disk current directory, and the button which previously - said "Close" will now say "Done". -
  10. The file which has just been saved is already in a PostScript format. - You may view it with any PostScript previewer (ghostview is recommended). -
- -

Task 12: Loading a file

- -
    -
  1. Go to a new, unused page. -
  2. Select menu item "File->Read Xcircuit PS". You will get a screen that - looks something like the following:
    - The load-file popup window. -
  3. If the file list is larger than the window, you may scroll up and down - the list by clicking mouse button 1 or 2 on the - scrollbar at the right side of the window and dragging it up - and down. -
  4. A green box will be drawn around each filename as your cursor passes - over it. -
  5. Find the file that you just saved in the last task. When the green - box is over this filename, tap mouse button 1. The filename - will turn green, and at the same time will be copied into the - text edit box. -
  6. Tap the "Okay" button to load the file. -
  7. If you do not wish to use the scrolling menu, you may type the filename, - with or without the ".ps" extension, in the text edit box, - followed by the RETURN key or tapping the "Okay" button. -
  8. Selecting a directory name in the file list box, including "../" for - the directory one level up, will go to that directory. Entering a - directory name in the text edit box followed by the RETURN - key will also go to that directory. -
  9. If you know where the xcircuit source is kept, then select the - "File->Read Xcircuit PS", go to the source directory, go to the - "examples" directory, and load one of the example files, such as - "vcoblock.ps". -
- -

Task 13: Entering Text

-Xcircuit has a very complicated interface for entering text, which allows -you to change fonts and font styles within a string, make overlines and -underlines, and subscripts and superscripts.

- -

    -
  1. Go to a new, unused page. -
  2. Let's say you want to type in a fairly complicated expression, like
    - "f(x) = sin(2*pi*omega_c*t)" (except with Greek letters, of course). -
  3. If you've read your TeX manual thoroughly, and understand all the finer - points of mathematical equation typesetting (if you haven't, you should), - then you know that all the variables should be in italic type. -
  4. Select menu item "Text->Style->Italic". The default text font is now - italic style. -
  5. Select menu item "Text->Font->Times Roman" if it is not checked already. - The default text font is now Times Italic (Times font + Italic style). -
  6. Select menu item "Text->Make Label" and click on mouse button 1 - anywhere in the drawing area. -
  7. Alternately, you can just tap the "t" key in the drawing area. -
  8. The green line marks the pointer position, and the "x" marks the - origin (justification) of the text. -
  9. Select menu item "Text->Justification->Middle Justified". You will - see the green "x" move to the center of the line, showing that the - text is vertically centered on its point of origin. -
  10. Alternately, you could type keypad key "6" (on some systems, - Shift-keypad 6) to get center-left justified text. -
  11. Type "f". In the bottom message window, the letter "f" and a vertical - bar "|" appear, showing what's in the string relative to the text - cursor. -
  12. Select menu item "Text->Insert->1/4 Space". This is the proper thing to - do for "italic correction", an extra bit of space necessary after an - italic character followed by an upright character, particularly tall - ones such as "f" and "t" which lean leans rather far to the right of - their character bounding boxes. -
  13. Select menu item "Text->Style->Normal". -
  14. Type "(" -
  15. Select menu item "Text->Style->Italic". -
  16. Type "x" -
  17. Select menu item "Text->Style->Normal". -
  18. Type ") = sin(2" -
  19. Select menu item "Text->Style->Italic". -
  20. Select menu item "Text->Font->Symbol". -
  21. Type "\". A page with the 256 character encodings for the - Symbol font will appear, replacing the current page, as - shown in the figure below.
    -
    -
  22. Click on the "pi" symbol. The screen will immediately - return to the original page, with the "pi" added to the - text line. -
  23. Type "\", then click on the "omega" symbol in the encoding - vector. -
  24. Select menu item "Text->Font->Times-Roman" -
  25. Select menu item "Text->Style->Subscript" (or keypad-minus) -
  26. Type "c" -
  27. Select menu item "Text->Style->Normalscript" (or keypad-enter) -
  28. Type "t" -
  29. Select menu item "Text->Insert->1/4 Space" for another italic - correction. -
  30. Select menu item "Text->Style->Normal". -
  31. Type ")" -
  32. Before typing <RETURN> to complete the text, use - the left- and right-arrow keys to move the cursor around inside - the text string. Note how font- and style- changing commands - embedded in the text string can be seen in the message window. - Their position relative to the text cursor is important when - anticipating the effect of deleting (<DELETE> key) - a text command. -
  33. Yes, this is very complicated, but it is also very powerful. -
- -

-Above: The text figure created in the task.
-Below: The PostScript output of the same text from xcircuit. -


- -Typographical Note: ISO-Latin1 encodings define the Greek character "mu" -(µ) to be used for the symbol "micro", which naturally is used often in -circuit schematics. This differs from the Symbol font "mu" in that it matches -the style and properties of the font in which it is defined. Thus, it is -possible to get a Helvetica "mu", a Times-BoldItalic "mu", etc., something -which is virtually impossible to do even in LaTeX(*). -Due to the font size and style matching, this is always preferable to the -Symbol font "mu". To get the ISO-Latin1 "mu" character, (while entering or -editing text) choose Text->Encoding->ISO-Latin1 from the menu, then -either choose Text->Insert->Character or type "\" at the text cursor, -then select the "mu" character from the character array. - -

Task 14: Making curves and paths

-Curve drawing is a useful feature of most capable drawing programs. The -concept of paths is a powerful aspect of PostScript which is not -usually found elsewhere. Path definitions are used to create a single -entity out of a string of curves, arc segments, and lines. The resulting -entity has its own color, fill styles, and border styles. - -
    -
  1. Go to a new, unused page. -
  2. Type "s" to start a curve (you can think of "s" as standing for - "spline", although these are Bezier curves, not splines, or you - can just think of the curvy "s" shape. The key "c" is reserved - for copying). The first thing you will see is two dotted lines - ending in little "x" marks. These are the curve control points. -
  3. Move the cursor around. Right now you are positioning the - end of the curve but have no control over the control points.
    - -
  4. Place the curve endpoint. If you are satisfied with the shape - of this curve, you can tap mouse button 2 to finish - the curve and quit. However, we'll say that you have more to - do to this curve, so tap mouse button 1 instead. -
  5. You get a message saying "Adjust control point", and the cursor - moves overtop the nearest "x" mark. Now when you move the - cursor, you change the shape of the curve. -
  6. Move the control point two grid blocks to the left of where it - started (make the control line horizontal with a length of - 4 grid blocks).
    - -
  7. Click mouse button 2 to finish the curve. -
  8. Now we will make a simple path. But it takes more than one element - to form a path. Put the cursor over the curve and tap the "c" - key. -
  9. When you move the cursor, a copy of the curve will follow you. -
  10. While you are dragging the curve copy, flip it by tapping the - "f" key and then the "F" key (one horizontal plus one vertical - flip). -
  11. Place the curve with its endpoints overtop the original curve. - The result should look like the figure below. -
  12. Select both curves by tapping mouse button 2 on top of - each one, or by forming a selection box (see Task 5). -
  13. Tap the "j" key in order to "join" the two curves into a single - path. -
  14. If you now move or select the path, you will find that both - curves act as a single entity. -
  15. Select the path and then select menu item - "Options->Elements->Fill->(black box)". The path will then - become solid black. If you color it blue, it will look something - like the right side of the figure below. -
- -

-Curves and paths. Left: The curve has been copied and flipped. -Center: The two curves are placed together and joined into a path. -Right: The path is filled and colored as a single entity. - -

Task 15: Dealing with over/under arrangement of elements

- -
    -
  1. Clear the current page (menu option "File->Clear Page") or go - to a new, unused page. -
  2. Start a box with the "b" key (this is a convenience for - drawing rectangles and squares). -
  3. Click mouse button 2 to finish the box. -
  4. Select the box and choose menu item - "Options->Elements->Fill->(black box)", where the "black box" - is the first menu item in the list. You will now have a black - box. (note that to select the box, the cursor must be near the - edge of the box, not in the middle). -
  5. Select the box again and choose menu item - "Options->Elements->Color->(orange box)". You will now have - a solid, orange box. -
  6. Go to the built-in library ("l" key) and bring back a circuit - object (say, a "nand" gate). -
  7. Place the gate on top of the orange box. -
  8. Make a copy the box ("c" key) and place it beside the first. - mouse button 2 ends the copy command. -
  9. You will notice that the library object suddenly disappeared. - This is because the "copy" command moved the orange box - to the end of the drawing list. Because it is drawn after - the library object, the library object is hidden underneath. -
  10. To get the library object on top again, select everything in the - area of the orange box by forming a selection box around the - orange box (mouse button 2). Tap the "X" key (Shift-X) - to exchange the drawing order of the two elements. The - library object will now be visible on top of the orange box. -
- -

-Over- and Under- arrangements of elements.
- -

Task 16: Making user-defined objects

-One of the most powerful aspects of xcircuit is its ability to deal with -objects on a hierarchical level. Circuits in particular are highly -structured. Often it is desirable to draw a subcircuit and use it -several times. It is much more efficient to draw the subcircuit and -create a user object from it rather than to copy all the -separate elements of the subcircuit every time you want a copy. -This is also true of new circuit components.

- -Say we wish to create a new circuit component, a dependent current -source. - -

    -
  1. Clear the current page or go to a new page. -
  2. We want the dependent current source to look something like the - independent current source (isource) in the builtin library file. - Go to the library and bring back an "isource" object for reference. -
  3. Draw a polygon, as in Task 3. Make it diamond-shaped and three - grid spaces high, two wide (see the figure below). -
  4. Add a line of height one-half-grid space on the top and bottom - of the diamond. -
  5. Now we will do something unusual. We will grab the arrow from - inside the isource object. Edit the original "isource" object - by placing the cursor over it and typing the ">" key (push - object). The page you were on will disappear, and you will - see only the object "isource". -
  6. Using the multiple-selection mechanism described in Task 10, - select the arrowhead and line in the middle of "isource", but - not the surrounding object. -
  7. Make a copy of these two elements with the "c" key. -
  8. While still dragging around the copy of the arrow, return to - the main page by typing the "<" key (pop object). You will - be returned to the original drawing, still dragging the arrow - with you. -
  9. Place the arrow inside the diamond. -
  10. Using a selection box, select all of the components of the - "dependent current source" object you have just constructed. -
  11. Type the "m" key to make the object out of the selected - components. -
  12. You will get a popup box asking for a name for the object. - Type something obvious like "depsource" or "disource". - Spaces are not allowed (if you use them, they will be - converted to underscores). -
  13. Tap the "Okay" button. Now, if you click on the dependent - source, it will be treated just like one of the builtin - objects. -
  14. Type the "L" key to go to the User Library. You - will see that the new object you created is now located - there. You can click on it to bring back another copy, - just like the builtin objects. -
- -

-Steps in creating a new user-defined object.
- -

Task 17: Editing objects and elements

-You briefly edited the built-in "isource" object in the last task, -but did not change anything. In this task, suppose we want to change -the appearance of the "dependent current source" object we made in -the previous task. - -
    -
  1. To edit the object, "push" into it using the ">" key, - as you did for the "isource" in the last task. -
  2. Make the polygon shorter. Put the cursor close to the - top of the diamond and type "e" for "edit". -
  3. Use the multiple-selection mechanism to select only the - diamond. -
  4. Now you will be editing the point position. Move the - point down one-half grid space, and tap mouse - button 2 to complete the edit. -
  5. Do the same for the bottom point. Where the two ends of - the polygon meet, you will need to adjust both of the - points. -
  6. Extend the lines on the top and bottom to meet the - diamond by editing the endpoints just like you did for - the diamond. -
  7. When you are done, return to the main page by "popping" - out of the object page, using the "<" key. -
- -

-Steps in editing the user-defined object.
- -

Task 18: Generating complex geometric shapes

-This can be an incredibly useful feature for general drawing. A -wholesale use of it is necessary to create such extravaganzas as -this rendition of the -JHU Applied -Physics Lab's logo. I have made use of something in PostScript -known as a ``path,'' that is, a linked set of lines, arcs, and splines -which together form the boundary of a single object which can be -bordered, filled, colored, etc. In this task, I will show you how -to generate a picture of a solid cylinder, by making a path consisting -of both ellipses and lines. - -
    -
  1. Start with a clean page. -
  2. Create an ellipse as follows: -
      -
    1. Type macro a to start an arc. -
    2. Drag the arc out to some desired size. -
    3. Click the first mouse button three times (to bypass endpoint - editing and go to ellipse axis editing). The position of - the cursor will move from the side of the circle to the top. -
    4. Drag the ellipse minor axis to the desired size and click - the second mouse button to end. -
  3. - -

    - Creating a path object (solid cylinder): top ellipse.
    - -
  4. The whole ellipse becomes the top of the "cylinder". To make the - bottom of the cylinder: -
      -
    1. Copy the first arc and place it well below the first. -
    2. Type macro e to edit (or select edit from the menu - and click on the lower ellipse). -
    3. Immediately type e again or click on the first mouse - button to go to endpoint editing mode. -
    4. Drag the endpoint around to the other side until the - result is the bottom half of an ellipse. Click the - second mouse button to finish. -
  5. - -

    - Creating a path object (solid cylinder): bottom (half) ellipse.
    - -
  6. Draw two lines to create the sides of the cylinder. -
  7. Select the bottom and sides of the cylinder, and type the j key - to "join" these segments into a single "path". -
  8. Select everything. If you (individually) select any component of the - path (either the side lines or the bottom ellipse), the whole path - will be highlighted. - -
  9. Copy (with the c macro) and place the copy to the side.
  10. - -

    - Creating a path object (solid cylinder): Two cylinder frames.
    - -
  11. Select the path (lower part) of the rightmost cylinder. -
  12. Choose menu item "Options->Elements->Fill->(black box)". Now - you can see how to create arbitrary filled shapes.
  13. - -

    - Creating a path object (solid cylinder): Two cylinders, the right one - consisting of a filled path.
    - -
  14. Finish the cylinder in the following manner: -
      -
    1. Color the path shape dark gray. -
    2. Select the ellipse located above the colored cylinder and - perform the same steps to make it filled solid and colored - light gray. -
    3. Use the X keyboard macro to correctly arrange the - elements, with the light gray ellipse on top of the dark - gray path object. -
    4. Place the black wire frame cylinder on the left on top of - the solid cylinder on the right. Hint: Move the - wire frame halfway on top of the solid cylinder, then - arrange the top-to-bottom order of the elements so - that the wire frame ends up on top, then move the - wire frame the rest of the way. -
    -
- -

-Creating a path object (solid cylinder): Finished cylinder.
- - -

Task 19: Investigating other xcircuit commands

-By now you should understand the basic user interface of xcircuit and be able -to get around the menus, the drawing area, be able to handle the popup -prompting windows, load and save files, write text, and create polygons, -arcs, curves, paths, and user objects. Of course, we have just touched -the surface of xcircuit capabilities. The list of features below -will help you find out all the things that can be done with the program.

- -For help with remembering keyboard macros and their functions, select the -menu item "Options->Help!". You will get a popup window to the right of -the screen which lists all of the available keyboard functions. Tap the -"Done" bottom at the bottom when you no longer need the help menu.

- -


-

Back to the xcircuit home page. . . -

-email: tim@bach.ece.jhu.edu - - diff --git a/tutorial/tutorial2.html b/tutorial/tutorial2.html deleted file mode 100644 index b2322d7..0000000 --- a/tutorial/tutorial2.html +++ /dev/null @@ -1,1455 +0,0 @@ - - - - -XCircuit Schematic Capture Tutorial Page - -

The XCircuit Schematic Capture Tutorial

- - - -
- -

Table of Contents

-
    -
  • Getting Started -
  • Task1 Acquaint yourself with XCircuit -
  • Task2 Run the program -
  • Task3 Drawing a circuit for SPICE simulation -
  • Task4 Introduction to parameters -
  • Task5 Drawing a circuit with parameters -
  • Task6 Making a new "fundamental" object -
  • Task7 A schematic with symbol-less schematics - in the hierarchy -
  • Task8 Identifying electrical connections -
  • Task9 A symbol on its own schematic -
  • Task10 "sim" format and flattened -
  • Task11 "pcb" type netlists -
  • Task12 Multiple-gate chips in PCB netlists -
  • Task13 Modifying netlist formats -
  • Task14 Example: A bridge rectifier for a PCB -
- - -

Getting started

-This tutorial is provided to help users get up and running with the -schematic capture capabilities of xcircuit. -In order to get the most out of this page, you should have already -downloaded, compiled, and installed the xcircuit program and its libraries, -and xcircuit should be compiled with schematic capture capability (on by -default; see the Imakefile for details).

- -

- IMPORTANT NOTICE: - -It is necessary for you to have the new (version 2.3.3) distribution of xcircuit -compiled and installed to get the correct behavior in the tutorial. -In particular, the PostScript prolog has changed and if the old one is -prepended to the new xcircuit files, the files will not be printable or -viewable from a PostScript previewer.

- -There are additional differences between versions 2.1(beta) to version 2.3.3, -mainly in the way symbols and schematics are associated with each other. -The new methods are incorporated into this tutorial. Version 2.3.3 also -corrects some errors in netlist generation, and is generally more stable. -Versions before 2.3.3 will not produce pcb-style netlists -as featured in this tutorial.

- -

- -

Task 1: Acquaint yourself with XCircuit

-If you are not yet familiar with the basic features of xcircuit, I recommend -you to peruse the basic XCircuit tutorial for -essential features of the program which will not be reiterated here. - -

Task 2: Run the program

-XCircuit now starts in schematic capture mode unless explicitly compiled -without the feature. So just start xcircuit as you normally would: -
- xcircuit -
- -Xcircuit in schematic capture mode will start with a window which -has a menu button for ``Netlist'' and two -buttons at the bottom left-hand corner, one of which is blank and the other -which is colored red and labeled ``Schematic.'' -The bottom buttons can be interpreted to mean that the current page is a -schematic drawing, and this schematic has no corresponding symbol (more -about this later).

- -There is a menu button, "Options->Disable (Enable) XSchema", which toggles -the visibility of the ``Netlist'' menu button and the two status buttons at the -bottom. In case you're working on a drawing which has nothing to do with -schematic capture, you might prefer to have the option disabled. This -does not affect the program in any way other than to make the buttons -disappear so that xcircuit looks like the original version without the -schematic capture features.

- -

Task 3: Drawing a circuit for SPICE simulation

-This task outlines some of the features of xcircuit used to make a simple -circuit. In this and the following tasks, you will create an analog -circuit, an operational amplifier, and make it into a symbol to be used -as a subcircuit of a more general circuit (an integrator). First you will -draw a circuit using simple (default) devices, and later I will show how to -pass parameters to devices, such as width and length of individual MOSFETs. - -
    -
  1. Drag the elements which you need from the built-in library to - (a clean) Page 1. Namely, the nMOS, pMOS, Vdd, and GND symbols.

    -

  2. Duplicate elements (copy (c), flip (f)) as necessary - and connect with lines to produce the following transconductance - amplifier schematic:

    - -

    - A transconductance amplifier, schematic drawing.

    - -
  3. Either drag the "dot" object from the library page or use the - period key (".") to place connections between the wires - at junctions. This is not strictly necessary, as xcircuit will - deduce connectivity from the T-connections of wires, not from - the "dot" symbols; it is merely a matter of preference depending - on the style with which you like to draw circuits. In the case - of wires crossing at a junction, the dot is necessary - since crossing wires generally do not indicate a connection in - schematic diagrams. You may also use a "jumper" object to - indicate that two crossing wires do not connect although this, - like the use of dots at T-junctions, is a matter of style and - personal preference.

    - -

  4. Add "circle" connections at the inputs and outputs. Once again, - this is a matter of style; the actual inputs and outputs from - the netlist's point of view will be indicated by pin labels - (see next step). The resulting diagram looks like the following: -

    - -

    - Same transconductance amplifier, a little fancier style.

    - -
  5. Because the amplifier will be a SPICE subcircuit, it is necessary - to tell the netlist generator where the input and output ports - are. For this, you need pin labels. Pin labels differ - from ordinary labels in several ways: By default, they are - colored red (though this can be changed), and are placed with a - slight offset from their marked positions, so the position - marker can be used as a tag to indicate what wire the label is - attached to. Additionally, the marked position is visible on - the drawing, since its exact location with respect to wires is - critical to the resultant netlist. Finally, pin labels only - appear on the top level of the hierarchy.

    - - To generate the pin label, type key macro (capital) T, or - choose menu item "Netlist->Make Pin". Set justification as - desired and place the "x" marking the pin position over the - "o" of the circle objects, or on top of a wire. The pins in - this amplifier will be labeled "in.m", "in.p", "out", and "bias". -

    - - -


    - Transconductance amplifier with I/O pins marked.

    - -
  6. Now it's time to turn this schematic into a symbol, that is, - to make a symbol which will be used on the top-level drawing - to designate the transconductance amplifier. What we really - want to do is to use the symbol "wramp" (stands for "wide - range (transconductance) amplifier", which is what this is), - from library "avlsi.lps" (part of the distribution), as the - symbol for the schematic you just drew. Go to the built-in - library, then edit the "wramp" symbol from there by placing - the cursor over the "wramp" symbol and typing key macro - ">". The result looks like this:

    - -

    - Transconductance amplifier symbol from the "avlsi.lps" library. -

    - - Note that in this picture, the bottom left-hand corner of - the screen says "Symbol" in the button that was, on Page 1, blank, - and the button that used to say "Schematic" is now blank. This - means that this object is a symbol, not a schematic, and it currently - does not have a schematic attached to it.

    - - Also note that the pin labels marking input/output positions for - in.m, - in.p, - out, and - bias - are invisible on the library page, but become visible when - editing the object, that is, when the library object has been placed - on the top-level page. When the library object is used in a circuit, - the pin labels are again invisible. This way, the drawing doesn't - get cluttered up with nested labels.

    - -

  7. The procedure to attach the schematic to this symbol is quite - simple. Choose menu item Netlist->Associate With Schematic. - Immediately, you will be taken to the page directory, with the - message "Click on schematic page to associate." With the first - mouse button, click on Page 1 (assuming that's the amplifier - schematic). Instead of the usual behavior on the page directory - (go immediately to the page under the cursor), you will be - returned back to the amplifier symbol edit page. - - Now both buttons appear at the same time, one named "Symbol" and - one named "Schematic". The one named "Schematic" is colored white, - indicated that the current page is the symbol, and that a - schematic exists which is the circuit represented by this symbol. - Press either button, and you will go to the schematic drawing - (back to Page 1). Press either button again, and you will return - to the symbol. The library object "wramp" is now a symbol for - the schematic of Page 1.

    - - A symbol can be disassociated from its schematic, and - vice versa, by choosing menu item - "Netlist->Disassociate Symbol" or - "Netlist->Disassociate Schematic". - This menu option will appear only for the appropriate case. - Choose this action from the menu now. Note that the white button - in the lower left-hand corner goes back to being blank. The - library object "wramp" is no longer a symbol for the schematic - of Page 1.

    - - Association can be initiated both ways. The alternate method is - as follows: Go back to Page 1 (the amplifier schematic). - Choose menu item "Netlist->Associate with Symbol" (note - that this is the same button that used to be "Disassociate"). - You are transported to the library directory, with the instructions - in the message window to "click on the library page, then the - object to associate".

    - - Click on the first library page (the one containing the wide-range - amplifier symbol "wramp"). Now click on the symbol "wramp". - Now, you will be returned to the original schematic page, and - once again, the buttons in the window's lower-left-hand corner - are red and white, indicating that you are on the schematic page - (red) but can move to the symbol page (white). Alternately to - clicking buttons to move between pages, you can choose menu - item "Netlist->Go To Symbol" (or "Go To Schematic", - as appropriate), or use the "/" key macro. Note that - the key macro only works if an association exists (i.e., it will - never create a new schematic or symbol, as described in the next - paragraph, although this was formerly the behavior in xcircuit - version 2.1(beta)).

    - - The schematic and symbol both do not need to exist before association. - You can associate an existing schematic to a non-existing symbol - or associate an existing symbol to a non-existing schematic by using - the "Netlist->Make Matching Symbol" or - "Netlist->Make Matching Schematic" selection, respectively. - If you are editing a symbol, then you will be transported to the first - blank top-level page. If you are editing a schematic (top-level - page), a new User Library symbol will be generated and you will - be transported there. In either case, the new object will take - the name of its associated object, and all pin labels from the - original will be copied to the new, so that's one less step you - have to do yourself. - -

  8. Now it's time to use the symbol as a subcircuit in a top-level - circuit schematic. Go to Page 2, which will be the top-level - circuit. Draw an integrator as shown below:

    - -

    - Simple continuous-time integrator using a transconductance - amplifier.

    - - Note that there is a "regular" text label titling the page; - this is made in the usual fashion, using key macro (lowercase) - "t", and therefore is not a pin label.

    - - There is a one-to-one correspondence between the - pin labels on the schematic and the pin labels on the - corresponding symbol. This is important to make sure that - the wires attaching to the symbol on the top-level schematic - go to the correct destinations in the amplifier's schematic. - It is not an error to have unassigned pins: A pin inside - the schematic may be labeling a net for reference purposes - only. A pin on the symbol which is not used in the - schematic is much less likely, but may, for instance, be - representing an unconnected pin on an IC.

    - -

  9. Save this page. Call it "integrator". At this point, several - points should be noted: -
      -
    • Two pages were saved instead of one. XCircuit followed - the path of the symbol to its schematic, and saved the - schematic for the amplifier. This becomes a separate - page in the PostScript output. Running "ghostview" or - your favorite PostScript previewer shows the two-page - output. -
    • Page 1, the page containing the schematic of the amplifier, - regardless of what you called it in the first place (if - anything), was renamed "wramp". - By convention, the schematic and symbol have the same - name, although this does not have to be the case. -
    • All the pages got saved as "Full Page" and not as - "Encapsulated". For multi-page files, "Encapsulated" - PostScript is not meaningful. Options for positioning - the schematic on the page will probably appear in the - future. -

    - -

  10. Go to the top-level schematic page (Page 2, or "integrator"). - From the menu, select "Netlist->Write Spice". The message - label will read "spice netlist saved as integrator.spc". - You can view the file integrator.spc - here. Note in particular that xcircuit has generated a - hierarchical netlist, using the amplifier "wramp" as a - subcircuit. The subcircuit contains parameters which are - its pin labels; the call to the subcircuit has parameters - which are the pin labels given on the top level page.

    -

- -For reference, the resulting PostScript file can be found here: -integrator.ps

- -SPICE simulation: Xcircuit provides only the netlist. It can also -provide voltage sources and so forth, which will be described in the -next task. However, it has no concept of "models" and provides no -commands for running analyses. In the example above, the spice file -will need to be edited to insert models for devices "nmos" and "pmos", -Declare a voltage source and value for Vdd, and add commands -for DC operating point determination and transient analysis.

- -

Task 4: Introduction to parameters

- -One thing you may have noticed about the previous circuit is that you -did not, in fact could not specify a value for the capacitor, -which defaulted in the spice netlist to 1.0pF. And there was no way -to specify a width and length of each nMOS and pMOS device. You might -have guessed: There does exist a way to pass values such as capacitance -to the capacitor object, and width and length to the MOS device objects.

- -Here's a brief description of how parameters work:
-Each object contains a list of its parameters, NULL if there are no -parameters. Each item in this list declares what is the type of -parameter (so far, "string" or "integer", with only string types fully -supported at present), a default value for the parameter, and another -list which points to all the locations where the parameter gets -substituted.

- -It is important to keep in mind the distinction between an object -and its instantiations. If you are on Page 1 looking at an object -you just dragged back from the library, you are looking at a single -instance of that object. If you use the > key to -edit the object, then you are editing the object itself. Normally, -there is no particular need to make the distinction. However, when -using parameters, the object itself will declare the default parameter, -but each instance of the object may contain its own unique value for -that parameter.

- -Xcircuit adopts a method for editing parameters in which either the -default value or the instance value may be altered, and which one is -altered depends on what top-level page you came from. The -most obvious way to implement this is that if you edit an object from -one of the library pages, you are assumed to be altering the default -(the object on the library page always displays the default value of -all its parameters). If, instead, you edit the object by getting -there from a top-level page or another object, you are editing the -instance, and changes you make to the parameters will only -affect the value of that instance only. This should be made clear -by the tutorial below. - -

    -
  1. Run xcircuit, which should automatically load "analoglib2.lps" - onto library page 2 (since xcircuit version 2.2.0. Otherwise, - load it from the subdirectory "examples" of the source - distribution). -
  2. Go to library page 2 (macro L, click on second page). - You will see a set of - replacement objects for the basic circuit structures "capacitor", - "resistor", "nmos", etc. The main difference between these and - the original objects is that they contain labels indicating - values.

    -

    - The parameterized analog component library.

    - -
  3. Select, say, the "Resistor" object and drag it back to Page 1. -
  4. Copy the resistor so you have two resistors on Page 1. -
  5. Edit one of the resistors (> key). You will note that, - in addition to pin labels, there are some other strings (called - "info labels") which will be described in detail later. -
  6. Edit the string which reads "1.0 k(Ohm)" (e key macro, or - menu selection Edit->Edit). As you move the - cursor around the string, look at the message window. You will - note that in addition to the usual ASCII characters and string - commands such as font changes, half-space, etc., there is now - an additional embedded command label "Parameter(n)< - text>", where n is the parameter number, and - text is a substring (may be empty) which is the parameter - text. For the resistor, "1.0" is a parameter - describing the value, and "k" is a parameter for the metric - scale prefix. Unlike all other parts of the string, you cannot - delete the parameter delimiter marks (parameters must be - removed from a string with the "Unparameterize" function). -
  7. Replace the substring "1.0" with "20" and replace "k" by "M" - or whatever your favorite resistor value is. Be sure that you - are inside the parameter delimiters when you make the change, - or you will get unexpected results. -
  8. Pop back up to the originating page (< key). You will - see that only the resistor which you edited has its values - changed; the other one still has the original (default) values - of "1.0" and "k". -
  9. Go to the library again (L key, then click on the second - page), and from there, edit the - resistor (> key). From here, change the value to, say, - "2.0 k". Note that now you are changing the default value, - not an instance value. -
  10. Return to the library page (< key). Now the library - object shows the new resistance value, indicating that the - default value was altered. From here, go back to the - originating page (third mouse button). Now you see that the - resistor you altered retained its unique value, but the - resistor you didn't alter changed with the default.
    - The rule here is that each instance of an object accepts the - default unless is specifically declares its own unique value. -
- -
- How does this work?
- -There are already traces of parameterization at work in xcircuit. -Each instance of an object has its own unique value for position, -rotation, color, and scale. These can be thought of as parameters. -Whenever xcircuit draws an object instance, it uses the unique -position, rotation, and scale to alter the 2-D transformation -matrix, then recursively calls the object drawing routine on the -object itself. When parameters are present, xcircuit first looks -up any unique values which the object instance might declare, and -substitutes these values into the object itself. If the instance -does not declare a particular parameter, then xcircuit substitutes -the default value. Then xcircuit recursively calls the drawing -routine on the object. - -
- -

Task 5: Drawing a circuit with parameters

- -
    -
  1. Run xcircuit, as in the last example. - -
  2. Using the parameterized devices from the analoglib2 - library, create the simple lowpass R-C filter shown below:

    - -

    - Simple R-C filter.

    - -
  3. Now, using what you learned from Task 4, alter the individual - parameter values so that they look like the following:

    - -

    - Simple R-C filter, with new parameter values.

    - -
  4. Choose menu item "File->Write XCircuit PS", and rename the top - page something obvious like "filter". Save it if you like. - -
  5. Choose menu item "Netlist->Write Spice". - You can view the resulting SPICE file - filter.spc here. -

- -For reference, the finished PostScript file can be found here: -filter.ps

- -Although there are no MOS devices in this file, as in the previous task, -the SPICE deck will need to be completed with commands for performing -transient analysis and so forth, unless the file is to be used for -netlist comparison purposes only.

- -Spice output is determined solely by the ``info labels'' (which are green -by default, and only show up when the object they are in is on the top-level -page), in particular, those that begin with the token ``spice:''. There -are several ``escape sequences'' which have special meaning in this info -label. They begin with the ``%'' character and are summarized below. -Also, string parameters can be inserted directly into the info label, a -process which is described directly after. - -

Info label escape sequences:

-
-
-
%% -
Inserts the character `%' into the netlist output line. -
? -
When a single question mark is parameterized as its - own parameter, it is interpreted in the following way: If the - parser encounters a non-default value (i.e., a number), it uses - that number as the index. Otherwise, it generates a unique sequence - number for the object instance. This method is preferred over the - "%i" escape, as it allows each part number to be individually - assigned, if desired. -
(parameter) -
Any parameter may be inserted into the info - label, and therefore takes the value of either the instance string, - if defined, or else takes the value of the default string. The - question mark (?) is a special case (see above). -
%n -
Insert the name of the object. -
%p"name" -
Insert the name of a pin. The pin name must - be quoted exactly as is the label which defines the pin. The quotes - may be omitted if the name contains no white space and is followed - by white space (if in doubt, just use the quotes). -
%r -
Insert a carriage-return into the netlist output line. - Carriage-returns can also be inserted directly into the output - by using Alt-Enter or menu option - "Text->Insert->Carriage Return". -
%t -
Insert a tab into the netlist output line. -
-
- -Obsoleted sequences (maintained for backward compatibility): -
-
-
%i -
Insert a number, in sequence, incrementing each time - a new object instance is visited during netlist compilation. -
%v"name" -
Insert the name of a parameter. The parameter - name must be quoted exactly as the label or label segement which - defines the default parameter. Alternately, a parameter - can be inserted directly into the string during text edit mode - using the "Alt-p" key. This is perhaps more intuitive, because the - value shown is either the default or substituted value, as appropriate, - rather than always listing the default value. The library file - analoglib1.lps, - which is available either - at this link or in the source distribution under the "examples" - directory, makes use of the "%v" method. analoglib2.lps - makes use of the direct-insertion method. -
-
- - Example: - -

-sim:n %pG %pS %pD
-
-
- -or: - - -

-spice:M%i %pD %pG %pS GND nmos
-
-
-The top example produces an nMOS transistor line in a "sim" netlist, where -the actual net names inserted into the output file are those which correspond -to the gate, source, and drain pins, respectively. The bottom example does -the same thing for a SPICE netlist file, assuming that the SPICE model will -be called "nmos" (this can be parameterized if more than one model is -required; see paragraph below), and the "%i" sequence ensures that each -transistor gets a different label: M1, M2, M3, and so forth. - -

Inserting string parameters directly into a label:

- -While editing a label, use the key sequence ``Alt-p'' to insert a parameter. -If the object has only one parameter, it will be inserted automatically. If -the object has two or more parameters, xcircuit will prompt for the one to -use (listed by number). Once the copy of the parameter string is in the -label, there is effectively no difference between the copies: making changes -to one automatically changes the other (although the change may not show up -immediately). In general, this method is clearer than using ``%v'', since -the subsituted string appears directly in the info label rather than -referring back to the default string, so ``what you see is what you get.''

- -

    -
  1. From the default analog library (library page 1), grab the - (unparameterized) object "nmos" and drag - it back to page 1 (or whatever page you're working on). -
  2. Edit the "nmos" object (key ">"). -
  3. Use the second mouse button to draw a selection box around the - word ``nmos'' in the first information (green) label. -
  4. The word ``nmos'' will be highlighted; in this selection - mechanism, only that substring of the label has been selected. -
  5. Choose menu option Text->Parameterize. -
  6. Now edit the info label. When you get to the word ``nmos'', - you will notice, as printed in the message field at the bottom - of the xcircuit window, that it is bounded by invisible marker - characters ``Parameter(1)<'' and ``>''. - At this point, the SPICE model is a parameter of the object, - and its default value is ``nmos''. -
  7. Because you entered the object from Page 1 rather than the Library, - what you are editing is the string instance, not the - string default. Change the parameter substring to read - nmos1, indicating an alternate MOS model called ``nmos1'' - (which must be added to the output SPICE file before simulation!). - Make sure that the character "1" comes before the - ">" parameter end marker; otherwise, it is not part of the - parameter, and instead becomes part of the default value. -
  8. Finish editing and return to the calling page (key "<"). -
  9. Grab another object ``nmos'' from the library and place it on - Page 1. Edit it (key ">"). Note that the parameter - string contains the default value ``nmos''. -
  10. Pop back out to Page 1 and run ``Netlist->Write spice''. The - resulting file is simple and can be included below.

    - - - -Spice circuit Page 1

    -M1 net.1 net.2 net.3 GND nmos
    -M2 net.4 net.5 net.6 GND nmos1
    -.end -
    -
    - -
- -Information labels with embedded parameters are used in the library file -analoglib2.lps. -Note that in most objects -("Capacitor", "Resistor"), the parameterized value is in a string and -therefore shows up as part of the circuit diagram. However, others -("PNP", "NPN", where the SPICE model name is parameterized) have the -parameter only in an information label, where it does not show up on -the top-level page. Yet others ("nMOS", "pMOS") contain both (width -and length values appear on the top-level page and are copied into -the information label, but the name of the SPICE model only appears -in the information label).

- -As an addendum to this task, run xcircuit and load the file and generate -a spice circuit which uses two nMOS devices from the "analoglib2" -library page, each instance having a different SPICE model. In -addition, make the widths of the two devices different. - -Note that when more than one string contain the same parameter, editing -one of the values will not be immediately reflected on the screen as -a change in the other(s). Popping back to the level above the object -and returning to edit the object will show all the proper substitutions. - -

Task 6: Making a new "fundamental" object

- -All netlists generate output when they reach a ``fundamental'' object, -which is defined as an object containing one or more informational -labels.

- -Fundamental objects require several features: -

    -
  • Fundamental objects are expected to be symbols. As in all - symbols, lines are interpreted as part of the symbol drawing, - not as nets. The only ``electrically relevant'' elements on - a symbol are the pins. -
  • Fundamental objects contain ``info labels'' which tell the - netlist compiler what to do with the information passed to - the object via the pins. Presently, there are three - different "styles" of netlist, named after the primary - format which uses that kind of netlist: -
      -
    • Hierarchical, or ``spice'' netlists -
    • Flattened, or ``sim'' netlists -
    • Network, or ``pcb'' netlists -
    - Information on each of these netlists is widely available - and distributed with layout and simulation software - packages. In a nutshell, however: -
      -
    • Hierarchical and Flattened netlists both list by - element, with each line of the file consisting - of an element name followed by a list of network names - corresponding to each of the element's pins. - -
      example: -
      - - Q1 net2 D0 gnd npn1
      -
      - indicates that NPN transistor ``Q1'' has a collector - connection to "net2", base connection to "D0", and - an emitter connection to "gnd" (presumably a global - network). -
    • A Network netlist lists by network, with each - line consisting of a network name followed by a list - of pins in the circuit to which the network connects. - The element names are part of the pin names, with - the circuit hierarchy encoded in the element name by - slashes (`/'), much like a file system directory listing. - -
      example: -
      - - Net3 control/74LS00_1#1-2 display/LED#2-5
      -
      - indicates that the network named "Net3" connects - pin number 2 in the first 74LS00 chip in subcircuit - "control" to pin number 5 of the second LED in subcircuit - "display". -
    -
  • A result of being an object and having an info-label is that the - "Symbol" button is green, indicating a "fundamental" element. -
- -There is another type of symbol called a "trivial" symbol. This cannot be -designated from xcircuit. It is only a optimization which tells xcircuit -that an object does not produce output and is not a sub-schematic, and -therefore can be ignored except for the presence of pins. This prevents -the xcircuit netlist generator from wasting time looking for subschematics -or informational labels. Except for saving compute cycles, there is no -other difference between "trivial" and normal symbols. "Trivial" symbols -are declared in the PostScript file with a "% trivial" line. - -

-Task 7: A schematic with symbol-less schematics in the hierarchy

- -A "subschematic" is a special kind of symbol which, unlike other symbols, -contains electrically relevant objects. Really, it's just a grouping of -electrical objects which bypasses the trouble of making a symbol to -represent the grouping. This can be useful, for instance, in drawing -one-half of a differential amplifier and repeating the schematic, flipped -horizontally.

- -XCircuit is extremely sophisticated in its ability to deal with subschematics. -It will determine how the subschematic is used, searching for input and -output "ports" that link the subschematic to the circuit on the level above.

- -The file in the xcircuit source "examples" directory -diffamp_test.ps is an example of such a file with subschematics. -It represents an obvious situation in which a subschematic is useful: This is -a differential amplifier, so a large portion of the amplifer is duplicated on -the positive and negative sides.

- -



-Differential amplifier sub-schematic: One half of an amplifier. -


- -


-Differential amplifier complete schematic -


- -The second of the two figures above shows how the half-amplifer subschematic -connects into the differential amplifier schematic. Note that no pins (pin -labels) have been explicitly called out in the subschematic. All connections -are determined from context. Different contexts which xcircuit finds and -interprets are marked with red circles on the differential schematic -(the unannotated version of the schematic can be -found here). The annotations, called out by number, are as follows:

- - -

    -
  1. Port makes connection to a wire (polygon) -
  2. Port makes connection on one side but not on the other -
  3. Port makes connection to a label (pin) -
  4. Port makes connection to a pin of another object -
  5. Two ports in the subschematic get merged into one network -
  6. (not shown) Port connects to port on another subschematic -
- - -On any given schematic page, port connections between symbols, between -subschematics, and from subschematics to symbols and vice versa, may be -from any layer in the circuit hierarchy to any other layer in the circuit -hierarchy.

- -

Task 8: Identifying electrical connections

- -XCircuit has the ability to highlight all wires belonging to a single -electrical network. This is a very useful feature for debugging -schematics, finding shorts and open-circuits. The command for -identifying network connectivity is menu selection -Netlist->Highlight Connectivity and the default key binding -for the same function is Alt-w. The key macro operates immediately -on either selected elements or whatever element is nearest the cursor, -while the menu item either operates immediately on any selected element -or prompts for a mouse click on an element to show connectivity for. -If multiple elements are selected prior to choosing the connectivity -function, connectivity will be searched for the first item encountered -in the select list which is part of a valid network.

- -As an example, load the file diffamp_test used previously in -Task 7 (examples/diffamp_test.ps in the XCircuit source -distribution). Place the pointer over any wire and type Alt-w. -The whole network will be ``highlighted'' in green. Note some features -of connectivity searches: -

    -
  • Global networks such as ground have all parts of the network - highlighted, even if they are physically separated on the - drawing. -
  • Network selection is a different from element selection: It is - recursive. In the schematic drawing for "ampl_test" (Page 2), - networks inside the "half_amp" sub-schematic can be selected for - connectivity search, even though for purposes of normal move, - copy, etc., the "half_amp" can only be selected as an entire object. -
  • Pins can be selected as well as wires, and pins belonging to a - network will be highlighted along with the rest of the network. -
  • The name of the network is printed in the message window at the - bottom of the xcircuit screen. Hierarchy is relevant: A network - may have a different name depending on whether it is selected on - the top-level schematic, or somewhere down in the schematic - hierarchy. The network name displayed is that name belonging to - the network at the highest level of the hierarchy. -
  • Additional networks can be highlighted without erasing the original. - To erase one network before starting another, click the right - mouse button once ("Cancel" operation). -
- -Currently, there is no method to detect and return a network name for -pin positions connecting two objects (that is, networks which do not -have a polygon or label explicitly attached to them in the schematic -drawing).

- -Note: Network connectivity searches only work as described above -in XCircuit version 2.3.5 rev. 1 and later.

- -

Task 9: A symbol on its own schematic

- -File example "examples/logic8.ps" in the source distribution has -an example of a symbol on its own schematic. Run xcircuit on this example -file, and go to page 2, the schematic for the 2-input NAND gate. At the -bottom of the schematic is a picture of the "NAND" symbol. Note that -you can "push" (">" key) into the symbol picture, and then cross over -("/" key) to the schematic, returning to where you started in a circular -manner. You can do this all day until you run out of memory, so it is -not recommended. Fortunately, when xcircuit generates the circuit netlist, -it is not fooled into this recursive path. Instead, it detects the -presence of the recursion and will not treat the symbol picture as part -of the network. You can verify this by generating a SPICE netlist for -circuit "logic8" and reading the resulting file "logic.spc": - - -
-
-*SPICE circuit "logic" from XCircuit v2.30
-
-.GLOBAL Vdd
-.GLOBAL GND
-
-.subckt invert Out In
-M1 Out In Vdd Vdd pmos
-M2 Out In GND GND nmos
-.ends
-
-.subckt nand Out In.1 In.2
-M1 Out In.1 Vdd Vdd pmos
-M2 Out In.1 ext13 GND nmos
-M3 ext13 In.2 GND GND nmos
-M4 Out In.2 Vdd Vdd pmos
-.ends
-
-X1 int1 Pin.1 invert
-X2 Pin.4 int1 Pin.2 nand
-X3 Pin.5 Pin.2 Pin.3 nand
-.end
-
-
-
- -As you can see, the circuit has been created as intended, and the symbols -marked on their own schematics do not present a problem.

- -Caveat: It is possible to do more subtle forms of recursion. For -instance, in the "logic8" circuit, redraw the NAND2 schematic so -that the output goes through a buffer made of two inverters. This is -perfectly reasonable, by itself. Now, go to the inverter schematic, and -in place of the nMOS + pMOS stack, put a NAND2 gate with its two inputs -tied together between the In and Out pins. This is also perfectly reasonable, -by itself. However, the two changes taken together try to define the -NAND2 and inverter in terms of each other, which is recursive. Versions -of xcircuit before 2.3.5 rev. 1 will simply crash. Later versions will -detect the error as a suspiciously deep hierarchy, and halt the netlist -process before the processor hits a stack limit.

- -

Task 10: "sim" format and flattened netlists

- -"sim" netlists are normally associated with digital VLSI circuits, but they -also can be useful for netlist comparisons of digital, analog, and mixed-signal -VLSI circuits. The standard "sim" format defines device types for nFET -(enhancement and depletion) and pFET transistors, resistors (explicitly -defined and lumped), and capacitors. However, the format has variously -been extended to cover other devices such as bipolar transistors, and any -variation of any component, provided it gets a unique letter assigned for -the device and is meaningful to whatever software uses the format downstream.

- -The main difference between "sim" and "SPICE" netlists is that SPICE allows -hierarchical descriptions containing subcircuits, whereas "sim" is by -definition a "flattened" version of a circuit. There is very little that -is necessary to say here, other than to note the ability of XCircuit to -generate flattened circuit netlists. XCircuit also has an option to -generate flattened SPICE. Note the difference in output, for instance, -between the output "logic.spc" for circuit "logic8" (shown in Task 9, above), -and the following output "logic.fspc" for the same circuit (generated by -Netlist->Write flattened SPICE: - - -

-
-*SPICE (flattened) circuit "logic" from XCircuit v2.30
-
-M1 int1 Pin.1 Vdd Vdd pmos
-M2 int1 Pin.1 GND GND nmos
-M3 Pin.4 int1 Vdd Vdd pmos
-M4 Pin.4 int1 nand1/ext13 GND nmos
-M5 nand1/ext13 Pin.2 GND GND nmos
-M6 Pin.4 Pin.2 Vdd Vdd pmos
-M7 Pin.5 Pin.2 Vdd Vdd pmos
-M8 Pin.5 Pin.2 nand2/ext13 GND nmos
-M9 nand2/ext13 Pin.3 GND GND nmos
-M10 Pin.5 Pin.3 Vdd Vdd pmos
-
-
- - -

Task 11: "pcb" type netlists

- -XCircuit is ostensibly an ideal platform for generating schematic netlists -to compare against PCB (printed circuit board) designs. However, by -default (at least for now), xcircuit libraries are set up primarily for -VLSI layout work, so PCB netlisting requires a little extra work -(because a lot of users want to use XCircuit for PCB netlisting, I'd like -some help putting together libraries of IC's).

- -PCB netlists are fundamentally different from SPICE and sim netlists. -Instead of listing by device, the file lists by network. -The format is flattened, probably on the assumption that printed circuit -boards have no hierarchy. By default, xcircuit will list device pins -(network connections) by the name of the object followed by a dash and -the name of the pin to which the network connects. Any hierarchy present -in the xcircuit file is flattened by separating layers of the hierarchy -with slashes, as is done for the "sim" format.

- -For PCB symbols, the name of the object is used as the part name in the -netlist unless the object's symbol has a "pcb:" info label. In addition, -the sequence number of the part is assigned automatically unless declared -as a parameter in the "pcb:" info label. Typically, PCB components are -labeled "U" for integrated circuits, "R" for resistors, "C" for capacitors, -"J" for connectors and jumpers, and so forth. The sequence number for -each part, if automatically generated, will be unique with respect to -the name used for the part in the netlist output.

- -Consider Harry Eatons's ``LED'' design which comes as an example -in the "PCB" distribution. The relevant files are also linked -here: -

    -
  1. LED (a PCB-format file) -
  2. LED.NET (a PCB netlist file) -
- -Creating the schematic is very complicated, so I've done much of the -work to get you started. Here is an xcircuit file which can be used to -create a (partial, because it's unfinished) netlist to compare -against the LED printed circuit layout and netlist. - - - -The important thing to notice about this file is the way components are -handled. Each component has an object name (a generic name, such as -"Resistor" or a part description, such as "LTC490"), text which may or -may not duplicate the title, and text which parameterizes the object -(such as resistor and capacitor values). In addition, each object is -parameterized for use in PCB. This requires a string inside the object, -an "info label" which is interpreted by the pcb netlist generator in -xcircuit. Also inside the object, not visible from the top level -drawing, are pin numbers for each object. For integrated circuits, -there is text on each pin which is a functional pin description. -This is not needed for the netlist, but makes it much easier to understand -the schematic. - -
    -
  1. Start up xcircuit on the file FlareLED.ps. -
  2. Go to the User Library (the library containing all of the ICs and - connectors in the schematic). - -

    - Integrated circuits and components library for FlareLED. -

    - -
  3. Edit (">" key) the PIC controller (object named - "PIC16C54". -
  4. You will note several things: This is an 18-pin chip, with pin - labels corresponding to the actual DIP package pin numbers. - Next to each pin number is the functional name for that pin. - On the top level page, only the functional names appear. On - the top level page, the device can be flipped, rotated, etc., - without regard to the physical PCB layout. It is only necessary - that the networks of wires correctly connect the pins of - all the components. -
  5. The "PIC16C54" object, like all the integrated circuits in the - schematic, has an "info label" which reads

    -
    
    -	pcb:U?
    -	
    - -

    - PIC 16C54 object, as edited from the library (default parameters) -

    - -
  6. Edit this info label ("e" key). Note that the question - mark is a parameter. -
  7. Escape from the label edit (3rd mouse button) and return to the - main page ("1" key). Now edit the same object, - the PIC16C54, from this page (">" key). -
  8. Now you will see that the info label reads -
    
    -	pcb:U5
    -	
    - This is an instance value. It corresponds to the location - and label for an IC on the PCB layout.

    - -

    - PIC 16C54 instance, as edited from the top page (instanced parameters) -

    - -
  9. End the label edit and return once again to the top level page. - From the menu, choose Netlist->Write pcb. The result - is a file named FlareLED.pcb. Compare this file to - the supplied netlist file named LED.NET. The XCircuit - schematic is not complete, but the parts that are correspond in - both netlist files. -
  10. Challenge: Finish this schematic and show that the two - netlists are the same (``Layout vs. Schematic'', or ``LVS''). -
  11. Another Challenge: Create an xcircuit library containing - the entire 7400 digital IC series and send it to me so I can - post it on this website. -
- -

Task 12: Multiple-gate chips in PCB netlists

- -Pins can be parameterized beginning in version 2.5.2 (it is allowed in -earlier versions but will cause invalid netlist output). Pins normally -work differently than label strings when making substitutions during -netlist generation; it is the network name which is substituted. -However, PCB-type netlists write pin names directly to the output, and -this is where parameterized pin names can be useful: For example, a -``quad part'' like a 7400 quad NAND chip has four NAND gates which are -identical except for their pin numbers on the package. Normally, a -PCB netlist would declare these as four parts, say, ``U1-1'' through -``U1-4''. By parameterizing all of the pin names, four instances can -be made representing the four gates inside the 7400 chip, each having -the correct pinout.

- -A method for saving the pinouts of gate subunits in chips was added -to version 2.5.2 along with the meaningful method for generating PCB -netlists from parameterized pin names. This method allows multiple -instances of a single object to appear on the same library page. -These copies should represent the object with different parameter -values. The most common use of this method is to parameterize pins -of a logic gate that is a subunit of a multiple-gate IC, and show -each of the subunits on the library page, where they can be used to -generate a PCB netlist.

- -Using XCircuit 2.5.2 or later, installed, start xcircuit and go to the -fourth library page ``Library: quadparts''. You will see the -following set of objects (partial view of the library): - -



-Partial view of the ``Quadparts'' library (from preliminary version). -


- -Note that there are four copies of each named object. Each of the copies has -the same name, but three of the names are ``shaded out'' in a gray color. -The part with the name written in black is the original library part. It -contains parameters, but like standard library page objects, it displays all -of the default values for these parameters. As in Tasks 4 and 5, editing -parameter values in this library object will change the default values of -those parameters. The objects with the names printed in gray are -called ``virtual objects.'' They act like objects on a page rather than -objects in a library. Parameters in these objects may take on individual -values, and those specific values are copied along with the object when -it is selected and dragged back to a page.

- -



-Editing a library virtual copy (instance) of gate ``quadnand''. -


- -From the library page, grab all four ``quadnand'' objects and bring them -back to Page 1. With the four objects, one can make, for instance, a -delay flip-flop implementation from a single 7400 chip. This is shown -below: - -


-Delay Flip-Flop using the ``quadparts'' library. -


- -After building the circuit, select Netlist->Write pcb. The -result is a valid PCB netlist for the circuit: - - -
-
-!Q          U2-2-5    U1-1-3
-D           U3-3-9
-CLK         U4-4-13   U3-3-10
-int5        U4-4-12   U3-3-8    U2-2-4
-int6        U4-4-11   U1-1-2
-Q           U2-2-6    U1-1-1
-
-
-
- -

Task 13: Modifying netlist formats

- -The Python interpreter is supposed to make new netlist formats easy to -implement. However, the Python interface does not yet include access -to netlist information, so for the moment, netlist formats are limited.

- -As it stands, netlists must be one of three formats: -

    -
  1. Flattened ("sim" or SPICE) -
  2. Hierarchical (with subcircuits in SPICE "subckt" format) -
  3. Netlist (flattened, in a PCB netlist format) -
- -Flattened netlists are the easiest to implement new formats in, since -the only structure in the file is determined by the elements themselves -(not counting comment lines, such as the first line that xcircuit writes -to the netlist file). The other two formats contain syntax that is -(currently) hard-coded into xcircuit (the "subckt" command in hierarchical -SPICE, and the entire syntax of PCB). Information about how to write -devices is encoded into ``informational labels'' (otherwise abbreviated -as ``info labels''). The syntax of info labels is described above in -Task 5.

- -Modifications to netlist formats can be useful in several ways: -

    -
  1. Implement a completely different netlist type (some subset of VHDL, - for instance) -
  2. Modify an existing format (hspice or pspice syntax vs. ordinary - Berkeley spice3). -
  3. Avoid explicitly drawing circuit schematics for simple devices. -
  4. Write output at the gate level instead of the transistor level. -
- -The last two require some explaining, so start up xcircuit and prepare -for another task.

- -

Aggregate output per device

-Here, we will change an "inverter" into a fundamental device consisting -of two transistors in the usual CMOS configuration for the inverter. -By default, XCircuit neither attaches schematics to gates nor defines -aggregate (multiple line) output for a gate because there are too many -ways to define a gate. For instance, the inverter could be an nMOS -device with a p-pullup, or it could be a bipolar-based TTL inverter, -etc., ad nauseum. - -
    -
  1. Go to the first library page and drag back an inverter to the - first page. -
  2. Add some pin labels to the input and output nodes. Call them, - say, "in" and "out" (or something less boring, if you prefer). -
  3. Edit the inverter device (> key) -
  4. Start an "info label" (I key, or Netlist->Make Info Pin - from the menu) -
  5. Type
    - sim:n %pIn GND %pOut<Alt-Enter>p %pIn Vdd %pOut
    - where "<Alt-Enter>" - is the key combination Alt + Enter (also available using the - menu selection Text->Insert->Carriage Return). - Note that spaces, tabs, and other characters will transfer - to the netlist output, although embedded commands such as color, - font, and size change will not. - The embedded carriage return will end up in the netlist - output, as a real carriage return/newline. The result is shown - below.

    - -

    - Inverter with informational label for "sim" netlist output. -

    - -
  6. Return to the top level page, choose "File->Write Output" to - change the name from "Page 1" to something more useful. - Then, from the menu, select Netlist->Write sim. - The netlist output will look something like the following:
    - - -
    -
    
    -| sim circuit "aggregate" from XCircuit v2.30
    -n in GND out
    -p in Vdd out
    -
    -
    -
    - -
  7. If you return to editing the symbol "invert", you will find - that after writing the netlist, the "Symbol" button in - the lower left-hand corner of the XCircuit window turned - green, indicating that this symbol is now considered to be - a "fundamental" object. That is, it has an informational - label and contains no subcircuits. -
- -

Output not on the device (transistor) level

- -Suppose, in the above example, we didn't know or care what is the -transistor-level implementation of the inverter, but wanted a SPICE -file showing the hierarchy, for which an inverter subcircuit could -be inserted at a later point. - -
    -
  1. Repeat the above task through number 4. -
  2. Write for the info label
    - spice:X%i %pIn %pOut inverter -
  3. Return to the top level page, and write a SPICE netlist. - The netlist output will look something like the following:
    - - -
    -
    
    -*SPICE circuit "aggregate" from XCircuit v2.30
    -
    -X1 in out inverter
    -.end
    -
    -
    -
    - -
  4. While this deck is not directly simulatable, it only awaits the - insertion of an inverter model in the form of a subcircuit. -
- -

Task 14: Example: A bridge rectifier for a PCB

- -This task will summarize most of what has been covered above in the tutorial -with a practical example, a power supply bridge rectifier for a printed circuit -board layout. The example will work through detailed explanations of each -step, for the benefit of the impatient.

- -The bridge rectifier is a simple power supply circuit which transforms an AC -supply (e.g., wall outlet) into a DC current for powering a circuit. The -"bridge" is a diode bridge, a loop of four diodes which act as a full-wave -rectifier. The bridge also acts as a nonlinear resistance in a simple -single-pole R-C low-pass filter. The filter pole is set by a large -polarized capacitor on the rectifier output. The larger the capacitor, -the steadier the output voltage, including resistance to short spikes and -dropouts of the AC supply.

- -Usually the bridge rectifier circuit drives the input of a voltage regulator -to clean up the 120Hz bumps generated by the less-than-ideal lowpass filter, -and to adjust the voltage between the transformer and the circuit being -powered. For simplicity, this example will not consider the voltage -regulator.

- -For more information about bridge rectifiers, see Horowitz and Hill, -The Art of Electronics, 2nd edition, pages 45 and following -(Cambridge Press, 1989).

- -

Step 1

- - If you have xcircuit version 2.3.3 after revision 6, there will be a - symbol "Diode" (with capital-D) in the analoglib2.lps file (the - second library page). If not, you can update your library from this - link: analoglib2.lps, - and skip to Step 2. Alternatively, you can - use the following instructions to generate the PCB-compatible diode - from the simple diode on the first library page (named "diode", no - capital letter).

- - The diode symbol "diode" in the first library is not configured for use in - PCBs. This can be changed easily. Go to the first library page (l - key macro), and edit the diode symbol (> key macro). - Change the pin names to "1" and "2" (edit, or e key) to match - PCB naming conventions. Finally, add an "info label" for the PCB - netlister (I key, or else create a normal label then select - menu item Netlist->Convert Label To...->Info label). The label - text should be - -


-   pcb:D?
-   
- - After creating the label, use the second mouse button to drag a select - box over the question mark. Only the question mark should be highlighted. - Then select menu item Text->Parameterize. As described earlier in - the tutorial, the PCB netlister will use this parameterized string to - determine a part number for the diode, or else the part number can be - explicitly declared by editing the info label from each of the four - instances of symbol "diode" that we will generate. - -



- - Return to a drawing page (< key, 1 key to go to Page 1) - and continue with Step 2. - -

Step 2

- - Go to the library (l key, twice to get to the analoglib2 page, - or once if using an edited version of the simple diode, from Step 1) - and select the diode for copying (c key). - This action will take you back to the main - drawing page, with a diode instance in tow. While the diode is still - selected, rotate it (r key, as many times as necessary). - Place it four times with a click of the first (left) mouse button, - and finish with a click of the third (right) mouse button. Rotate and - position the diodes as shown below. - -



- -

Step 3

- - Connect the diodes together in a bridge configuration. While the - diode endpoints are not quite on the drawing grid when the diode is - rotated 45 degrees, they are fairly close (as drawn, see figure - above), and there is some "slop" in the netlist generator when - considering whether two wires are connected together. No special - measures are necessary to ensure the connection. - -



- - Make a schematic out of the rectifier by selecting all the components - drawn so far, typing m to "make" the object, and name - the object "rectifier". This is a "subschematic", as described - above in the tutorial, and pins will be determined from context. - -

Step 4

- - Grab the transformer symbol from the "analoglib2" library (2nd library - page). Add wires to the transformer input, ending in terminals for - the input AC supply. Name these terminals "V+" and "V-" (typographical - suggestion: use the Symbol font for "+" and "-"). - -



- - Connect the transformer and the rectifier together as shown. - -



- -

Step 5

- - Grab two capacitors (one polarized, one not) from the second library - page. These are the capacitors with values listed. - They are already configured for use with a PCB netlist.

- - The capacitors default to a picofarad value (for use with VLSI - layouts, not PCBs), so the value string needs to be edited to - change this to the "micro" symbol for microFarads.

- - Typographical note:
- The best way to do this is to change the font of the whole - string from "Times-Roman" to "Times-RomanISO" (use menu option - Text->Encoding->ISO-Latin1 or, while editing the label, - use the Alt-e key combination). The "micro" - symbol (Greek "mu") is available from the font symbol table (accessed - with the backslash key while editing text). The change to ISO - encoding will be necessary on both the value string and the "SPICE" - info label.

- - Netlist note:
- The SPICE netlist generator will convert the "mu" symbol to the "u" - used by SPICE. This happens regardless of whether the ISO-encoded - "mu" or the Symbol font "mu" is used. Of course, one may also - write ASCII "u" in the value string. - -




- -

Step 6

- - Connect all the parts together on the top level page as shown. - -



- - Add finishing touches, and the completed bridge rectifier should - look something like the one shown below. - -



- - The xcircuit file can be obtained here: bridge.ps. - -

Step 7

- - Select menu option File->Write XCircuit PS and select a "Page label" - for the file. This will be the name used by the netlist generator for - the netlist file name.

- - Generate the PCB netlist by selecting menu option Netlist->Write pcb. - The result is shown below:

- - -


-   V-          T1-2
-   V+          T1-1
-   int5        T1-3   rectifier1/D4-1   rectifier1/D3-2
-   int6        T1-4   rectifier1/D2-1   rectifier1/D1-2
-   Vout        rectifier1/D3-1   rectifier1/D1-1   C2-1   C1-1
-   GND         rectifier1/D4-2   rectifier1/D2-2   C2-2   C1-2
-   
- -
- - and can also be obtained from this link: - bridge.pcb. - -

Step 8

- - The example is essentially done, but we can take it one step further - by generating a symbol called "power_supply" to represent this circuit - in a larger schematic.

- - Go to an empty page (Page 2, perhaps) and generate the following figure:
- -




- - Labels in black are normal text (created with the t key), and labels - in red are pins (created with the T key). After drawing, select - everything and put it all into an object (m key). Name the object - "power_supply".

- -

Step 9

- - Now go back to Page 1, the bridge rectifier schematic. Choose the menu - selection Netlist->Associate with Symbol. You will be taken to - the library directory. Click (once) on the user library. You will be - taken directly to the user library. Finally, click (once) on the symbol - "power_supply". Now you should be returned to the bridge rectifier - schematic, with the difference that there is a white button labeled - "Symbol" in the bottom left-hand corner of the window. Clicking on the - button toggles the drawing window between the schematic and its - (newly associated) symbol.

- -

Step 10

- - Return to Page 2, the top-level schematic with the "power_supply" symbol. - Try out the following (trivial to the point of uselessness) circuit - (also available at this link: powersup.ps): -
- -



- - Go to menu selection File->Write XCircuit PS and rename the "Page - label" to "powersup". Then select Netlist->Write pcb to - generate a new PCB netlist.

- - Now look at the result:

- - -


-   NET1        power_supply1/T1-3   power_supply1/rectifier1/D4-1   \
-              power_supply1/rectifier1/D3-2
-   NET2        power_supply1/T1-4   power_supply1/rectifier1/D2-1   \
-              power_supply1/rectifier1/D1-2
-   In+         power_supply1/T1-1
-   In-         power_supply1/T1-2
-   Out         power_supply1/rectifier1/D3-1   power_supply1/rectifier1/D1-1   \
-              power_supply1/C2-1   power_supply1/C1-1   R1-1
-   GND         power_supply1/rectifier1/D4-2   power_supply1/rectifier1/D2-2   \
-              power_supply1/C2-2   power_supply1/C1-2   R1-2
-   
- -
- - which can also be obtained from this link: - powersup.pcb. - - Note that the main difference is that the netlist is hierarchical, with - components inside the power supply being referenced by the prepended - name "power_supply1". The resistor, the only component on the top-level - page, is not so prefixed. Throughout the netlist, net names take the - name given in the highest level of the hierarchy.

- -


-

Back to the xcircuit home page. . . -

-email: tim@bach.ece.jhu.edu - - diff --git a/undo.c b/undo.c index e21eb1c..67fa1da 100644 --- a/undo.c +++ b/undo.c @@ -86,6 +86,11 @@ typedef struct { float scale; /* old scale value */ } scaleinfo; +typedef struct { + XPoint rotpos; /* original position */ + float rotation; /* old rotation value */ +} rotateinfo; + u_char undo_collect = (u_char)0; /*----------------------------------------------------------------------*/ @@ -418,7 +423,8 @@ void undelete_one_element(objinstptr thisinst, genericptr thiselem) void register_for_undo(u_int type, u_char mode, objinstptr thisinst, ...) { va_list args; - int drawmode, nval, oval, *idata, snum, deltax, deltay, dir, i; + int drawmode, nval, oval, *idata, snum, deltax, deltay, i; + double dir; short *slist; objectptr delobj; objinstptr newinst; @@ -541,7 +547,7 @@ void register_for_undo(u_int type, u_char mode, objinstptr thisinst, ...) erec->save.string = stringcopyall(((labelptr)egen)->string, areawin->topinstance); - newrecord->idata = ((labelptr)egen)->justify; + newrecord->idata = ((labelptr)egen)->anchor; break; case POLYGON: newrecord->idata = ((polyptr)egen)->number; @@ -589,7 +595,7 @@ void register_for_undo(u_int type, u_char mode, objinstptr thisinst, ...) break; case XCF_ChangeStyle: - case XCF_Justify: + case XCF_Anchor: case XCF_Color: /* 2 args: */ /* egen = element that was changed (with new value) */ @@ -627,13 +633,13 @@ void register_for_undo(u_int type, u_char mode, objinstptr thisinst, ...) case XCF_Rotate: /* 2 args: */ /* fpoint = point of flip (XPoint *) */ - /* dir = direction and amound of rotation (int) */ + /* dir = direction and amount of rotation (float) */ fpoint = va_arg(args, XPoint *); - dir = va_arg(args, int); - newrecord->undodata = (char *)malloc(sizeof(XPoint)); - ((XPoint *)newrecord->undodata)->x = fpoint->x; - ((XPoint *)newrecord->undodata)->y = fpoint->y; - newrecord->idata = dir; + dir = va_arg(args, double); + newrecord->undodata = (char *)malloc(sizeof(rotateinfo)); + ((rotateinfo *)newrecord->undodata)->rotpos.x = fpoint->x; + ((rotateinfo *)newrecord->undodata)->rotpos.y = fpoint->y; + ((rotateinfo *)newrecord->undodata)->rotation = (float)dir; break; case XCF_Move: @@ -773,11 +779,12 @@ short undo_one_action() newpage(thisrecord->idata); break; - case XCF_Justify: + case XCF_Anchor: thislabel = (labelptr)(thisrecord->undodata); snum = thisrecord->idata; - thisrecord->idata = thislabel->justify; - thislabel->justify = snum; + thisrecord->idata = thislabel->anchor; + thislabel->anchor = snum; + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -788,8 +795,10 @@ short undo_one_action() need_redraw = (areawin->selects > 0) ? True : False; select_previous(thisrecord); - if (need_redraw) + if (need_redraw) { + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); + } else draw_all_selected(); break; @@ -805,6 +814,7 @@ short undo_one_action() } else { delete_one_element(thisrecord->thisinst, egen); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; @@ -814,16 +824,16 @@ short undo_one_action() switch (erec->element->type) { case LABEL: { stringpart *tmpstr; - int tmpjust; + int tmpanchor; labelptr elab = (labelptr)(erec->element); undrawtext(elab); tmpstr = elab->string; - tmpjust = (int)elab->justify; + tmpanchor = (int)elab->anchor; elab->string = stringcopyback(erec->save.string, thisrecord->thisinst); - elab->justify = (short)thisrecord->idata; + elab->anchor = (short)thisrecord->idata; erec->save.string = tmpstr; - thisrecord->idata = tmpjust; + thisrecord->idata = tmpanchor; resolveparams(thisrecord->thisinst); redrawtext(elab); } break; @@ -842,6 +852,7 @@ short undo_one_action() earc->position = erec->save.arcspecs->position; *(erec->save.arcspecs) = tmpinfo; calcarc(earc); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case OBJINST: { @@ -851,6 +862,7 @@ short undo_one_action() tmppt = einst->position; einst->position = erec->save.instpos; erec->save.instpos = tmppt; + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case POLYGON: { @@ -863,6 +875,7 @@ short undo_one_action() epoly->number = thisrecord->idata; erec->save.points = tmppts; thisrecord->idata = tmpnum; + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case SPLINE: { @@ -874,6 +887,7 @@ short undo_one_action() free(erec->save.points); erec->save.points = tmppts; calcspline(espline); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case PATH: { @@ -905,6 +919,7 @@ short undo_one_action() break; } } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } } @@ -930,6 +945,7 @@ short undo_one_action() /* Revert selection to previously selected */ select_previous(thisrecord); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); draw_all_selected(); break; @@ -960,6 +976,7 @@ short undo_one_action() thisspline->style = snum; break; } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -989,6 +1006,7 @@ short undo_one_action() thisspline->color = snum; break; } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1026,7 +1044,9 @@ short undo_one_action() thisgraphic = (graphicptr)egen; escale->scale = thisgraphic->scale; thisgraphic->scale = fnum; +#ifndef HAVE_CAIRO thisgraphic->valid = FALSE; +#endif /* HAVE_CAIRO */ break; case LABEL: thislabel = (labelptr)egen; @@ -1034,6 +1054,7 @@ short undo_one_action() thislabel->scale = fnum; break; } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1048,8 +1069,8 @@ short undo_one_action() break; case XCF_Rotate: - position = *((XPoint *)thisrecord->undodata); - elementrotate(-thisrecord->idata, &position); + position = ((rotateinfo *)thisrecord->undodata)->rotpos; + elementrotate(-((rotateinfo *)thisrecord->undodata)->rotation, &position); break; case XCF_Move: @@ -1057,12 +1078,14 @@ short undo_one_action() select_connected_pins(); placeselects(-(delta->x), -(delta->y), NULL); reset_cycles(); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); draw_all_selected(); break; case XCF_Reorder: reorder_selection(thisrecord); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1182,6 +1205,7 @@ short redo_one_action() thisrecord->undodata = (char *)thisobj; thisrecord->idata = (int)DRAW; unselect_all(); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1195,11 +1219,12 @@ short redo_one_action() newpage(*((int *)thisrecord->undodata)); break; - case XCF_Justify: + case XCF_Anchor: thislabel = (labelptr)(thisrecord->undodata); snum = thisrecord->idata; - thisrecord->idata = thislabel->justify; - thislabel->justify = snum; + thisrecord->idata = thislabel->anchor; + thislabel->anchor = snum; + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1249,6 +1274,7 @@ short redo_one_action() case XCF_Spline: case XCF_Dot: case XCF_Graphic: case XCF_Join: egen = (genericptr)thisrecord->undodata; undelete_one_element(thisrecord->thisinst, egen); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1257,16 +1283,16 @@ short redo_one_action() switch (erec->element->type) { case LABEL: { stringpart *tmpstr; - int tmpjust; + int tmpanchor; labelptr elab = (labelptr)(erec->element); undrawtext(elab); tmpstr = elab->string; - tmpjust = (int)elab->justify; + tmpanchor = (int)elab->anchor; elab->string = stringcopyback(erec->save.string, thisrecord->thisinst); - elab->justify = (short)thisrecord->idata; + elab->anchor = (short)thisrecord->idata; erec->save.string = tmpstr; - thisrecord->idata = tmpjust; + thisrecord->idata = tmpanchor; resolveparams(thisrecord->thisinst); redrawtext(elab); } break; @@ -1277,6 +1303,7 @@ short redo_one_action() tmppt = einst->position; einst->position = erec->save.instpos; erec->save.instpos = tmppt; + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case ARC: { @@ -1294,6 +1321,7 @@ short redo_one_action() earc->position = erec->save.arcspecs->position; *(erec->save.arcspecs) = tmpinfo; calcarc(earc); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case POLYGON: { @@ -1306,6 +1334,7 @@ short redo_one_action() epoly->number = thisrecord->idata; erec->save.points = tmppts; thisrecord->idata = tmpnum; + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case SPLINE: { @@ -1317,6 +1346,7 @@ short redo_one_action() free(erec->save.points); erec->save.points = tmppts; calcspline(espline); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } break; case PATH: { @@ -1348,6 +1378,7 @@ short redo_one_action() break; } } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); } } @@ -1389,6 +1420,7 @@ short redo_one_action() thisspline->style = snum; break; } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1418,6 +1450,7 @@ short redo_one_action() thisspline->color = snum; break; } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1455,7 +1488,9 @@ short redo_one_action() thisgraphic = (graphicptr)egen; escale->scale = thisgraphic->scale; thisgraphic->scale = fnum; +#ifndef HAVE_CAIRO thisgraphic->valid = FALSE; +#endif /* HAVE_CAIRO */ break; case LABEL: thislabel = (labelptr)egen; @@ -1463,12 +1498,13 @@ short redo_one_action() thislabel->scale = fnum; break; } + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; case XCF_Rotate: - position = *((XPoint *)thisrecord->undodata); - elementrotate(thisrecord->idata, &position); + position = ((rotateinfo *)thisrecord->undodata)->rotpos; + elementrotate(((rotateinfo *)thisrecord->undodata)->rotation, &position); break; case XCF_Move: @@ -1476,11 +1512,13 @@ short redo_one_action() select_connected_pins(); placeselects(delta->x, delta->y, NULL); reset_cycles(); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; case XCF_Reorder: reorder_selection(thisrecord); + areawin->redraw_needed = True; drawarea(areawin->area, NULL, NULL); break; @@ -1628,7 +1666,7 @@ void free_undo_data(Undoptr thisrecord, u_char mode) case XCF_Push: case XCF_ChangeStyle: - case XCF_Justify: + case XCF_Anchor: case XCF_Color: /* Do nothing --- undodata points to a valid element */ break; diff --git a/utf8encodings.c b/utf8encodings.c new file mode 100644 index 0000000..a89739c --- /dev/null +++ b/utf8encodings.c @@ -0,0 +1,588 @@ +/*-------------------------------------------------------------------------*/ +/* utf8encodings.c --- translation tables between an encoding and UTF-8 */ +/* Copyright (c) : see below */ +/*-------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------*/ +/* written (ie. converted the tables) by Erik van der Wal, May 2014 */ +/*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------*/ +/* The data in this file is based on a number of files from unicode.org */ +/* The specific source of the translation is referenced in the heading */ +/* above each encoding */ +/* All these files contained the following copyright notice: */ +/* (I underlined the relevant part) */ +/*-------------------------------------------------------------------------*/ +/* +# Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved. +# +# This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +# No claims are made as to fitness for any particular purpose. No +# warranties of any kind are expressed or implied. The recipient +# agrees to determine applicability of information provided. If this +# file has been provided on optical media by Unicode, Inc., the sole +# remedy for any claim will be exchange of defective media within 90 +# days of receipt. +# +# Unicode, Inc. hereby grants the right to freely use the information +# -------------------------- +# supplied in this file in the creation of products supporting the +# Unicode Standard, and to make copies of this file in any form for +# internal or external distribution as long as this notice remains +# ------------------------------ +# attached. +# -------- +*/ + + +/* Since the character at index 0 can never be used, it is used to store */ +/* the identification of the given encoding */ +/* The encoding can be placed in random order, as long as it does start */ +/* with the standard encoding and it ends with a NULL, to indicate the end */ +/* of the list. */ +/* Non-existent characters are encoded with the unicode character: */ +/* 'REPLACEMENT CHARACTER' (typically a boxed question mark). */ + +#define REPLC_CHAR "\xef\xbf\xbd" + +const char *utf8encodings[][256] = { +/*--------------------------------------------------------------------------*/ +/* stdenc */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/stdenc.txt */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "Standard", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&","\xe2\x80\x99", +/* 0x28 */ "(", ")", "*", "+", ",", "\xc2\xad",".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "\xe2\x80\x98","a","b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", REPLC_CHAR, +/* 0x80 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x84 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x88 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x8c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x90 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x94 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x98 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x9c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xa0 */ REPLC_CHAR, "\xc2\xa1", "\xc2\xa2", "\xc2\xa3", +/* 0xa4 */ "\xe2\x81\x84", "\xc2\xa5", "\xc6\x92", "\xc2\xa7", +/* 0xa8 */ "\xc2\xa4", "'", "\xe2\x80\x9c", "\xc2\xab", +/* 0xac */ "\xe2\x80\xb9", "\xe2\x80\xba", "\xef\xac\x81", "\xef\xac\x82", +/* 0xb0 */ REPLC_CHAR, "\xe2\x80\x93", "\xe2\x80\xa0", "\xe2\x80\xa1", +/* 0xb4 */ "\xc2\xb7", REPLC_CHAR, "\xc2\xb6", "\xe2\x80\xa2", +/* 0xb8 */ "\xe2\x80\x9a", "\xe2\x80\x9e", "\xe2\x80\x9d", "\xc2\xbb", +/* 0xbc */ "\xe2\x80\xa6", "\xe2\x80\xb0", REPLC_CHAR, "\xc2\xbf", +/* 0xc0 */ REPLC_CHAR, "`", "\xc2\xb4", "\xcb\x86", +/* 0xc4 */ "\xcb\x9c", "\xc2\xaf", "\xcb\x98", "\xcb\x99", +/* 0xc8 */ "\xc2\xa8", REPLC_CHAR, "\xcb\x9a", "\xc2\xb8", +/* 0xcc */ REPLC_CHAR, "\xcb\x9d", "\xcb\x9b", "\xcb\x87", +/* 0xd0 */ "\xe2\x80\x94", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xd4 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xd8 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xdc */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xe0 */ REPLC_CHAR, "\xc3\x86", REPLC_CHAR, "\xc2\xaa", +/* 0xe4 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xe8 */ "\xc5\x81", "\xc3\x98", "\xc5\x92", "\xc2\xba", +/* 0xec */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xf0 */ REPLC_CHAR, "\xc3\xa6", REPLC_CHAR, REPLC_CHAR, +/* 0xf4 */ REPLC_CHAR, "\xc4\xb1", REPLC_CHAR, REPLC_CHAR, +/* 0xf8 */ "\xc5\x82", "\xc3\xb8", "\xc5\x93", "\xc3\x9f", +/* 0xfc */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR +}, +/*--------------------------------------------------------------------------*/ +/* symbol */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "Symbol", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\xe2\x88\x80", "#", +/* 0x24 */ "\xe2\x88\x83", "%", "&", "\xe2\x88\x8b", +/* 0x28 */ "(", ")", "\xe2\x88\x97", "+", +/* 0x2c */ ",", "\xe2\x88\x92", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "\xe2\x89\x85", "\xce\x91", "\xce\x92", "\xce\xa7", +/* 0x44 */ "\xce\x94", "\xce\x95", "\xce\xa6", "\xce\x93", +/* 0x48 */ "\xce\x97", "\xce\x99", "\xcf\x91", "\xce\x9a", +/* 0x4c */ "\xce\x9b", "\xce\x9c", "\xce\x9d", "\xce\x9f", +/* 0x50 */ "\xce\xa0", "\xce\x98", "\xce\xa1", "\xce\xa3", +/* 0x54 */ "\xce\xa4", "\xce\xa5", "\xcf\x82", "\xe2\x84\xa6", +/* 0x58 */ "\xce\x9e", "\xce\xa8", "\xce\x96", "[", +/* 0x5c */ "\xe2\x88\xb4", "]", "\xe2\x8a\xa5", "_", +/* 0x60 */ "\xef\xa3\xa5", "\xce\xb1", "\xce\xb2", "\xcf\x87", +/* 0x64 */ "\xce\xb4", "\xce\xb5", "\xcf\x86", "\xce\xb3", +/* 0x68 */ "\xce\xb7", "\xce\xb9", "\xcf\x95", "\xce\xba", +/* 0x6c */ "\xce\xbb", "\xc2\xb5", "\xce\xbd", "\xce\xbf", +/* 0x70 */ "\xcf\x80", "\xce\xb8", "\xcf\x81", "\xcf\x83", +/* 0x74 */ "\xcf\x84", "\xcf\x85", "\xcf\x96", "\xcf\x89", +/* 0x78 */ "\xce\xbe", "\xcf\x88", "\xce\xb6", "{", +/* 0x7c */ "|", "}", "\xe2\x88\xbc", REPLC_CHAR, +/* 0x80 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x84 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x88 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x8c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x90 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x94 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x98 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x9c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xa0 */ "\xe2\x82\xac", "\xcf\x92", "\xe2\x80\xb2", "\xe2\x89\xa4", +/* 0xa4 */ "\xe2\x88\x95", "\xe2\x88\x9e", "\xc6\x92", "\xe2\x99\xa3", +/* 0xa8 */ "\xe2\x99\xa6", "\xe2\x99\xa5", "\xe2\x99\xa0", "\xe2\x86\x94", +/* 0xac */ "\xe2\x86\x90", "\xe2\x86\x91", "\xe2\x86\x92", "\xe2\x86\x93", +/* 0xb0 */ "\xc2\xb0", "\xc2\xb1", "\xe2\x80\xb3", "\xe2\x89\xa5", +/* 0xb4 */ "\xc3\x97", "\xe2\x88\x9d", "\xe2\x88\x82", "\xe2\x80\xa2", +/* 0xb8 */ "\xc3\xb7", "\xe2\x89\xa0", "\xe2\x89\xa1", "\xe2\x89\x88", +/* 0xbc */ "\xe2\x80\xa6", "\xef\xa3\xa6", "\xef\xa3\xa7", "\xe2\x86\xb5", +/* 0xc0 */ "\xe2\x84\xb5", "\xe2\x84\x91", "\xe2\x84\x9c", "\xe2\x84\x98", +/* 0xc4 */ "\xe2\x8a\x97", "\xe2\x8a\x95", "\xe2\x88\x85", "\xe2\x88\xa9", +/* 0xc8 */ "\xe2\x88\xaa", "\xe2\x8a\x83", "\xe2\x8a\x87", "\xe2\x8a\x84", +/* 0xcc */ "\xe2\x8a\x82", "\xe2\x8a\x86", "\xe2\x88\x88", "\xe2\x88\x89", +/* 0xd0 */ "\xe2\x88\xa0", "\xe2\x88\x87", "\xef\x9b\x9a", "\xef\x9b\x99", +/* 0xd4 */ "\xef\x9b\x9b", "\xe2\x88\x8f", "\xe2\x88\x9a", "\xe2\x8b\x85", +/* 0xd8 */ "\xc2\xac", "\xe2\x88\xa7", "\xe2\x88\xa8", "\xe2\x87\x94", +/* 0xdc */ "\xe2\x87\x90", "\xe2\x87\x91", "\xe2\x87\x92", "\xe2\x87\x93", +/* 0xe0 */ "\xe2\x97\x8a", "\xe2\x8c\xa9", "\xef\xa3\xa8", "\xef\xa3\xa9", +/* 0xe4 */ "\xef\xa3\xaa", "\xe2\x88\x91", "\xef\xa3\xab", "\xef\xa3\xac", +/* 0xe8 */ "\xef\xa3\xad", "\xef\xa3\xae", "\xef\xa3\xaf", "\xef\xa3\xb0", +/* 0xec */ "\xef\xa3\xb1", "\xef\xa3\xb2", "\xef\xa3\xb3", "\xef\xa3\xb4", +/* 0xf0 */ REPLC_CHAR, "\xe2\x8c\xaa", "\xe2\x88\xab", "\xe2\x8c\xa0", +/* 0xf4 */ "\xef\xa3\xb5", "\xe2\x8c\xa1", "\xef\xa3\xb6", "\xef\xa3\xb7", +/* 0xf8 */ "\xef\xa3\xb8", "\xef\xa3\xb9", "\xef\xa3\xba", "\xef\xa3\xbb", +/* 0xfc */ "\xef\xa3\xbc", "\xef\xa3\xbd", "\xef\xa3\xbe", REPLC_CHAR +}, +/*--------------------------------------------------------------------------*/ +/* iso 8859-1 */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "ISOLatin1", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", +/* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "\x7f", +/* 0x80 */ "\xc2\x80", "\xc2\x81", "\xc2\x82", "\xc2\x83", +/* 0x84 */ "\xc2\x84", "\xc2\x85", "\xc2\x86", "\xc2\x87", +/* 0x88 */ "\xc2\x88", "\xc2\x89", "\xc2\x8a", "\xc2\x8b", +/* 0x8c */ "\xc2\x8c", "\xc2\x8d", "\xc2\x8e", "\xc2\x8f", +/* 0x90 */ "\xc2\x90", "\xc2\x91", "\xc2\x92", "\xc2\x93", +/* 0x94 */ "\xc2\x94", "\xc2\x95", "\xc2\x96", "\xc2\x97", +/* 0x98 */ "\xc2\x98", "\xc2\x99", "\xc2\x9a", "\xc2\x9b", +/* 0x9c */ "\xc2\x9c", "\xc2\x9d", "\xc2\x9e", "\xc2\x9f", +/* 0xa0 */ "\xc2\xa0", "\xc2\xa1", "\xc2\xa2", "\xc2\xa3", +/* 0xa4 */ "\xc2\xa4", "\xc2\xa5", "\xc2\xa6", "\xc2\xa7", +/* 0xa8 */ "\xc2\xa8", "\xc2\xa9", "\xc2\xaa", "\xc2\xab", +/* 0xac */ "\xc2\xac", "\xc2\xad", "\xc2\xae", "\xc2\xaf", +/* 0xb0 */ "\xc2\xb0", "\xc2\xb1", "\xc2\xb2", "\xc2\xb3", +/* 0xb4 */ "\xc2\xb4", "\xc2\xb5", "\xc2\xb6", "\xc2\xb7", +/* 0xb8 */ "\xc2\xb8", "\xc2\xb9", "\xc2\xba", "\xc2\xbb", +/* 0xbc */ "\xc2\xbc", "\xc2\xbd", "\xc2\xbe", "\xc2\xbf", +/* 0xc0 */ "\xc3\x80", "\xc3\x81", "\xc3\x82", "\xc3\x83", +/* 0xc4 */ "\xc3\x84", "\xc3\x85", "\xc3\x86", "\xc3\x87", +/* 0xc8 */ "\xc3\x88", "\xc3\x89", "\xc3\x8a", "\xc3\x8b", +/* 0xcc */ "\xc3\x8c", "\xc3\x8d", "\xc3\x8e", "\xc3\x8f", +/* 0xd0 */ "\xc3\x90", "\xc3\x91", "\xc3\x92", "\xc3\x93", +/* 0xd4 */ "\xc3\x94", "\xc3\x95", "\xc3\x96", "\xc3\x97", +/* 0xd8 */ "\xc3\x98", "\xc3\x99", "\xc3\x9a", "\xc3\x9b", +/* 0xdc */ "\xc3\x9c", "\xc3\x9d", "\xc3\x9e", "\xc3\x9f", +/* 0xe0 */ "\xc3\xa0", "\xc3\xa1", "\xc3\xa2", "\xc3\xa3", +/* 0xe4 */ "\xc3\xa4", "\xc3\xa5", "\xc3\xa6", "\xc3\xa7", +/* 0xe8 */ "\xc3\xa8", "\xc3\xa9", "\xc3\xaa", "\xc3\xab", +/* 0xec */ "\xc3\xac", "\xc3\xad", "\xc3\xae", "\xc3\xaf", +/* 0xf0 */ "\xc3\xb0", "\xc3\xb1", "\xc3\xb2", "\xc3\xb3", +/* 0xf4 */ "\xc3\xb4", "\xc3\xb5", "\xc3\xb6", "\xc3\xb7", +/* 0xf8 */ "\xc3\xb8", "\xc3\xb9", "\xc3\xba", "\xc3\xbb", +/* 0xfc */ "\xc3\xbc", "\xc3\xbd", "\xc3\xbe", "\xc3\xbf" +}, +/*--------------------------------------------------------------------------*/ +/* iso 8859-2 */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-2.TXT */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "ISOLatin2", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", +/* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "\x7f", +/* 0x80 */ "\xc2\x80", "\xc2\x81", "\xc2\x82", "\xc2\x83", +/* 0x84 */ "\xc2\x84", "\xc2\x85", "\xc2\x86", "\xc2\x87", +/* 0x88 */ "\xc2\x88", "\xc2\x89", "\xc2\x8a", "\xc2\x8b", +/* 0x8c */ "\xc2\x8c", "\xc2\x8d", "\xc2\x8e", "\xc2\x8f", +/* 0x90 */ "\xc2\x90", "\xc2\x91", "\xc2\x92", "\xc2\x93", +/* 0x94 */ "\xc2\x94", "\xc2\x95", "\xc2\x96", "\xc2\x97", +/* 0x98 */ "\xc2\x98", "\xc2\x99", "\xc2\x9a", "\xc2\x9b", +/* 0x9c */ "\xc2\x9c", "\xc2\x9d", "\xc2\x9e", "\xc2\x9f", +/* 0xa0 */ "\xc2\xa0", "\xc4\x84", "\xcb\x98", "\xc5\x81", +/* 0xa4 */ "\xc2\xa4", "\xc4\xbd", "\xc5\x9a", "\xc2\xa7", +/* 0xa8 */ "\xc2\xa8", "\xc5\xa0", "\xc5\x9e", "\xc5\xa4", +/* 0xac */ "\xc5\xb9", "\xc2\xad", "\xc5\xbd", "\xc5\xbb", +/* 0xb0 */ "\xc2\xb0", "\xc4\x85", "\xcb\x9b", "\xc5\x82", +/* 0xb4 */ "\xc2\xb4", "\xc4\xbe", "\xc5\x9b", "\xcb\x87", +/* 0xb8 */ "\xc2\xb8", "\xc5\xa1", "\xc5\x9f", "\xc5\xa5", +/* 0xbc */ "\xc5\xba", "\xcb\x9d", "\xc5\xbe", "\xc5\xbc", +/* 0xc0 */ "\xc5\x94", "\xc3\x81", "\xc3\x82", "\xc4\x82", +/* 0xc4 */ "\xc3\x84", "\xc4\xb9", "\xc4\x86", "\xc3\x87", +/* 0xc8 */ "\xc4\x8c", "\xc3\x89", "\xc4\x98", "\xc3\x8b", +/* 0xcc */ "\xc4\x9a", "\xc3\x8d", "\xc3\x8e", "\xc4\x8e", +/* 0xd0 */ "\xc4\x90", "\xc5\x83", "\xc5\x87", "\xc3\x93", +/* 0xd4 */ "\xc3\x94", "\xc5\x90", "\xc3\x96", "\xc3\x97", +/* 0xd8 */ "\xc5\x98", "\xc5\xae", "\xc3\x9a", "\xc5\xb0", +/* 0xdc */ "\xc3\x9c", "\xc3\x9d", "\xc5\xa2", "\xc3\x9f", +/* 0xe0 */ "\xc5\x95", "\xc3\xa1", "\xc3\xa2", "\xc4\x83", +/* 0xe4 */ "\xc3\xa4", "\xc4\xba", "\xc4\x87", "\xc3\xa7", +/* 0xe8 */ "\xc4\x8d", "\xc3\xa9", "\xc4\x99", "\xc3\xab", +/* 0xec */ "\xc4\x9b", "\xc3\xad", "\xc3\xae", "\xc4\x8f", +/* 0xf0 */ "\xc4\x91", "\xc5\x84", "\xc5\x88", "\xc3\xb3", +/* 0xf4 */ "\xc3\xb4", "\xc5\x91", "\xc3\xb6", "\xc3\xb7", +/* 0xf8 */ "\xc5\x99", "\xc5\xaf", "\xc3\xba", "\xc5\xb1", +/* 0xfc */ "\xc3\xbc", "\xc3\xbd", "\xc5\xa3", "\xcb\x99" +}, +/*--------------------------------------------------------------------------*/ +/* iso 8859-3 */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-3.TXT */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "ISOLatin3", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", +/* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "\x7f", +/* 0x80 */ "\xc2\x80", "\xc2\x81", "\xc2\x82", "\xc2\x83", +/* 0x84 */ "\xc2\x84", "\xc2\x85", "\xc2\x86", "\xc2\x87", +/* 0x88 */ "\xc2\x88", "\xc2\x89", "\xc2\x8a", "\xc2\x8b", +/* 0x8c */ "\xc2\x8c", "\xc2\x8d", "\xc2\x8e", "\xc2\x8f", +/* 0x90 */ "\xc2\x90", "\xc2\x91", "\xc2\x92", "\xc2\x93", +/* 0x94 */ "\xc2\x94", "\xc2\x95", "\xc2\x96", "\xc2\x97", +/* 0x98 */ "\xc2\x98", "\xc2\x99", "\xc2\x9a", "\xc2\x9b", +/* 0x9c */ "\xc2\x9c", "\xc2\x9d", "\xc2\x9e", "\xc2\x9f", +/* 0xa0 */ "\xc2\xa0", "\xc4\xa6", "\xcb\x98", "\xc2\xa3", +/* 0xa4 */ "\xc2\xa4", REPLC_CHAR, "\xc4\xa4", "\xc2\xa7", +/* 0xa8 */ "\xc2\xa8", "\xc4\xb0", "\xc5\x9e", "\xc4\x9e", +/* 0xac */ "\xc4\xb4", "\xc2\xad", REPLC_CHAR, "\xc5\xbb", +/* 0xb0 */ "\xc2\xb0", "\xc4\xa7", "\xc2\xb2", "\xc2\xb3", +/* 0xb4 */ "\xc2\xb4", "\xc2\xb5", "\xc4\xa5", "\xc2\xb7", +/* 0xb8 */ "\xc2\xb8", "\xc4\xb1", "\xc5\x9f", "\xc4\x9f", +/* 0xbc */ "\xc4\xb5", "\xc2\xbd", REPLC_CHAR, "\xc5\xbc", +/* 0xc0 */ "\xc3\x80", "\xc3\x81", "\xc3\x82", REPLC_CHAR, +/* 0xc4 */ "\xc3\x84", "\xc4\x8a", "\xc4\x88", "\xc3\x87", +/* 0xc8 */ "\xc3\x88", "\xc3\x89", "\xc3\x8a", "\xc3\x8b", +/* 0xcc */ "\xc3\x8c", "\xc3\x8d", "\xc3\x8e", "\xc3\x8f", +/* 0xd0 */ REPLC_CHAR, "\xc3\x91", "\xc3\x92", "\xc3\x93", +/* 0xd4 */ "\xc3\x94", "\xc4\xa0", "\xc3\x96", "\xc3\x97", +/* 0xd8 */ "\xc4\x9c", "\xc3\x99", "\xc3\x9a", "\xc3\x9b", +/* 0xdc */ "\xc3\x9c", "\xc5\xac", "\xc5\x9c", "\xc3\x9f", +/* 0xe0 */ "\xc3\xa0", "\xc3\xa1", "\xc3\xa2", REPLC_CHAR, +/* 0xe4 */ "\xc3\xa4", "\xc4\x8b", "\xc4\x89", "\xc3\xa7", +/* 0xe8 */ "\xc3\xa8", "\xc3\xa9", "\xc3\xaa", "\xc3\xab", +/* 0xec */ "\xc3\xac", "\xc3\xad", "\xc3\xae", "\xc3\xaf", +/* 0xf0 */ REPLC_CHAR, "\xc3\xb1", "\xc3\xb2", "\xc3\xb3", +/* 0xf4 */ "\xc3\xb4", "\xc4\xa1", "\xc3\xb6", "\xc3\xb7", +/* 0xf8 */ "\xc4\x9d", "\xc3\xb9", "\xc3\xba", "\xc3\xbb", +/* 0xfc */ "\xc3\xbc", "\xc5\xad", "\xc5\x9d", "\xcb\x99" +}, +/*--------------------------------------------------------------------------*/ +/* iso 8859-4 */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-4.TXT */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "ISOLatin4", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", +/* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "\x7f", +/* 0x80 */ "\xc2\x80", "\xc2\x81", "\xc2\x82", "\xc2\x83", +/* 0x84 */ "\xc2\x84", "\xc2\x85", "\xc2\x86", "\xc2\x87", +/* 0x88 */ "\xc2\x88", "\xc2\x89", "\xc2\x8a", "\xc2\x8b", +/* 0x8c */ "\xc2\x8c", "\xc2\x8d", "\xc2\x8e", "\xc2\x8f", +/* 0x90 */ "\xc2\x90", "\xc2\x91", "\xc2\x92", "\xc2\x93", +/* 0x94 */ "\xc2\x94", "\xc2\x95", "\xc2\x96", "\xc2\x97", +/* 0x98 */ "\xc2\x98", "\xc2\x99", "\xc2\x9a", "\xc2\x9b", +/* 0x9c */ "\xc2\x9c", "\xc2\x9d", "\xc2\x9e", "\xc2\x9f", +/* 0xa0 */ "\xc2\xa0", "\xc4\x84", "\xc4\xb8", "\xc5\x96", +/* 0xa4 */ "\xc2\xa4", "\xc4\xa8", "\xc4\xbb", "\xc2\xa7", +/* 0xa8 */ "\xc2\xa8", "\xc5\xa0", "\xc4\x92", "\xc4\xa2", +/* 0xac */ "\xc5\xa6", "\xc2\xad", "\xc5\xbd", "\xc2\xaf", +/* 0xb0 */ "\xc2\xb0", "\xc4\x85", "\xcb\x9b", "\xc5\x97", +/* 0xb4 */ "\xc2\xb4", "\xc4\xa9", "\xc4\xbc", "\xcb\x87", +/* 0xb8 */ "\xc2\xb8", "\xc5\xa1", "\xc4\x93", "\xc4\xa3", +/* 0xbc */ "\xc5\xa7", "\xc5\x8a", "\xc5\xbe", "\xc5\x8b", +/* 0xc0 */ "\xc4\x80", "\xc3\x81", "\xc3\x82", "\xc3\x83", +/* 0xc4 */ "\xc3\x84", "\xc3\x85", "\xc3\x86", "\xc4\xae", +/* 0xc8 */ "\xc4\x8c", "\xc3\x89", "\xc4\x98", "\xc3\x8b", +/* 0xcc */ "\xc4\x96", "\xc3\x8d", "\xc3\x8e", "\xc4\xaa", +/* 0xd0 */ "\xc4\x90", "\xc5\x85", "\xc5\x8c", "\xc4\xb6", +/* 0xd4 */ "\xc3\x94", "\xc3\x95", "\xc3\x96", "\xc3\x97", +/* 0xd8 */ "\xc3\x98", "\xc5\xb2", "\xc3\x9a", "\xc3\x9b", +/* 0xdc */ "\xc3\x9c", "\xc5\xa8", "\xc5\xaa", "\xc3\x9f", +/* 0xe0 */ "\xc4\x81", "\xc3\xa1", "\xc3\xa2", "\xc3\xa3", +/* 0xe4 */ "\xc3\xa4", "\xc3\xa5", "\xc3\xa6", "\xc4\xaf", +/* 0xe8 */ "\xc4\x8d", "\xc3\xa9", "\xc4\x99", "\xc3\xab", +/* 0xec */ "\xc4\x97", "\xc3\xad", "\xc3\xae", "\xc4\xab", +/* 0xf0 */ "\xc4\x91", "\xc5\x86", "\xc5\x8d", "\xc4\xb7", +/* 0xf4 */ "\xc3\xb4", "\xc3\xb5", "\xc3\xb6", "\xc3\xb7", +/* 0xf8 */ "\xc3\xb8", "\xc5\xb3", "\xc3\xba", "\xc3\xbb", +/* 0xfc */ "\xc3\xbc", "\xc5\xa9", "\xc5\xab", "\xcb\x99" +}, +/*--------------------------------------------------------------------------*/ +/* CP1254 (ISO Latin-5) */ +/* based on: */ +/* ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "ISOLatin5", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", +/* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "\x7f", +/* 0x80 */ "\xe2\x82\xac", REPLC_CHAR, "\xe2\x80\x9a", "\xc6\x92", +/* 0x84 */ "\xe2\x80\x9e", "\xe2\x80\xa6", "\xe2\x80\xa0", "\xe2\x80\xa1", +/* 0x88 */ "\xcb\x86", "\xe2\x80\xb0", "\xc5\xa0", "\xe2\x80\xb9", +/* 0x8c */ "\xc5\x92", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x90 */ REPLC_CHAR, "\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", +/* 0x94 */ "\xe2\x80\x9d", "\xe2\x80\xa2", "\xe2\x80\x93", "\xe2\x80\x94", +/* 0x98 */ "\xcb\x9c", "\xe2\x84\xa2", "\xc5\xa1", "\xe2\x80\xba", +/* 0x9c */ "\xc5\x93", REPLC_CHAR, REPLC_CHAR, "\xc5\xb8", +/* 0xa0 */ "\xc2\xa0", "\xc2\xa1", "\xc2\xa2", "\xc2\xa3", +/* 0xa4 */ "\xc2\xa4", "\xc2\xa5", "\xc2\xa6", "\xc2\xa7", +/* 0xa8 */ "\xc2\xa8", "\xc2\xa9", "\xc2\xaa", "\xc2\xab", +/* 0xac */ "\xc2\xac", "\xc2\xad", "\xc2\xae", "\xc2\xaf", +/* 0xb0 */ "\xc2\xb0", "\xc2\xb1", "\xc2\xb2", "\xc2\xb3", +/* 0xb4 */ "\xc2\xb4", "\xc2\xb5", "\xc2\xb6", "\xc2\xb7", +/* 0xb8 */ "\xc2\xb8", "\xc2\xb9", "\xc2\xba", "\xc2\xbb", +/* 0xbc */ "\xc2\xbc", "\xc2\xbd", "\xc2\xbe", "\xc2\xbf", +/* 0xc0 */ "\xc3\x80", "\xc3\x81", "\xc3\x82", "\xc3\x83", +/* 0xc4 */ "\xc3\x84", "\xc3\x85", "\xc3\x86", "\xc3\x87", +/* 0xc8 */ "\xc3\x88", "\xc3\x89", "\xc3\x8a", "\xc3\x8b", +/* 0xcc */ "\xc3\x8c", "\xc3\x8d", "\xc3\x8e", "\xc3\x8f", +/* 0xd0 */ "\xc4\x9e", "\xc3\x91", "\xc3\x92", "\xc3\x93", +/* 0xd4 */ "\xc3\x94", "\xc3\x95", "\xc3\x96", "\xc3\x97", +/* 0xd8 */ "\xc3\x98", "\xc3\x99", "\xc3\x9a", "\xc3\x9b", +/* 0xdc */ "\xc3\x9c", "\xc4\xb0", "\xc5\x9e", "\xc3\x9f", +/* 0xe0 */ "\xc3\xa0", "\xc3\xa1", "\xc3\xa2", "\xc3\xa3", +/* 0xe4 */ "\xc3\xa4", "\xc3\xa5", "\xc3\xa6", "\xc3\xa7", +/* 0xe8 */ "\xc3\xa8", "\xc3\xa9", "\xc3\xaa", "\xc3\xab", +/* 0xec */ "\xc3\xac", "\xc3\xad", "\xc3\xae", "\xc3\xaf", +/* 0xf0 */ "\xc4\x9f", "\xc3\xb1", "\xc3\xb2", "\xc3\xb3", +/* 0xf4 */ "\xc3\xb4", "\xc3\xb5", "\xc3\xb6", "\xc3\xb7", +/* 0xf8 */ "\xc3\xb8", "\xc3\xb9", "\xc3\xba", "\xc3\xbb", +/* 0xfc */ "\xc3\xbc", "\xc4\xb1", "\xc5\x9f", "\xc3\xbf" +}, +/*--------------------------------------------------------------------------*/ +/* iso 8859-6 */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-6.TXT */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "ISOLatin6", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", +/* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "\x7f", +/* 0x80 */ "\xc2\x80", "\xc2\x81", "\xc2\x82", "\xc2\x83", +/* 0x84 */ "\xc2\x84", "\xc2\x85", "\xc2\x86", "\xc2\x87", +/* 0x88 */ "\xc2\x88", "\xc2\x89", "\xc2\x8a", "\xc2\x8b", +/* 0x8c */ "\xc2\x8c", "\xc2\x8d", "\xc2\x8e", "\xc2\x8f", +/* 0x90 */ "\xc2\x90", "\xc2\x91", "\xc2\x92", "\xc2\x93", +/* 0x94 */ "\xc2\x94", "\xc2\x95", "\xc2\x96", "\xc2\x97", +/* 0x98 */ "\xc2\x98", "\xc2\x99", "\xc2\x9a", "\xc2\x9b", +/* 0x9c */ "\xc2\x9c", "\xc2\x9d", "\xc2\x9e", "\xc2\x9f", +/* 0xa0 */ "\xc2\xa0", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xa4 */ "\xc2\xa4", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xa8 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xac */ "\xd8\x8c", "\xc2\xad", REPLC_CHAR, REPLC_CHAR, +/* 0xb0 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xb4 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xb8 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, "\xd8\x9b", +/* 0xbc */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, "\xd8\x9f", +/* 0xc0 */ REPLC_CHAR, "\xd8\xa1", "\xd8\xa2", "\xd8\xa3", +/* 0xc4 */ "\xd8\xa4", "\xd8\xa5", "\xd8\xa6", "\xd8\xa7", +/* 0xc8 */ "\xd8\xa8", "\xd8\xa9", "\xd8\xaa", "\xd8\xab", +/* 0xcc */ "\xd8\xac", "\xd8\xad", "\xd8\xae", "\xd8\xaf", +/* 0xd0 */ "\xd8\xb0", "\xd8\xb1", "\xd8\xb2", "\xd8\xb3", +/* 0xd4 */ "\xd8\xb4", "\xd8\xb5", "\xd8\xb6", "\xd8\xb7", +/* 0xd8 */ "\xd8\xb8", "\xd8\xb9", "\xd8\xba", REPLC_CHAR, +/* 0xdc */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xe0 */ "\xd9\x80", "\xd9\x81", "\xd9\x82", "\xd9\x83", +/* 0xe4 */ "\xd9\x84", "\xd9\x85", "\xd9\x86", "\xd9\x87", +/* 0xe8 */ "\xd9\x88", "\xd9\x89", "\xd9\x8a", "\xd9\x8b", +/* 0xec */ "\xd9\x8c", "\xd9\x8d", "\xd9\x8e", "\xd9\x8f", +/* 0xf0 */ "\xd9\x90", "\xd9\x91", "\xd9\x92", REPLC_CHAR, +/* 0xf4 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xf8 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0xfc */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR +}, +/*--------------------------------------------------------------------------*/ +/* iso 8859-5 */ +/* based on: ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-5.TXT */ +/*--------------------------------------------------------------------------*/ +{ +/* 0x00 */ "ISO8859-5", REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x04 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x08 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x0c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x10 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x14 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x18 */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x1c */ REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, REPLC_CHAR, +/* 0x20 */ " ", "!", "\"", "#", "$", "%", "&", "'", +/* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", +/* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", +/* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", +/* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", +/* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", +/* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", +/* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", +/* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", +/* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", +/* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", +/* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "\x7f", +/* 0x80 */ "\xc2\x80", "\xc2\x81", "\xc2\x82", "\xc2\x83", +/* 0x84 */ "\xc2\x84", "\xc2\x85", "\xc2\x86", "\xc2\x87", +/* 0x88 */ "\xc2\x88", "\xc2\x89", "\xc2\x8a", "\xc2\x8b", +/* 0x8c */ "\xc2\x8c", "\xc2\x8d", "\xc2\x8e", "\xc2\x8f", +/* 0x90 */ "\xc2\x90", "\xc2\x91", "\xc2\x92", "\xc2\x93", +/* 0x94 */ "\xc2\x94", "\xc2\x95", "\xc2\x96", "\xc2\x97", +/* 0x98 */ "\xc2\x98", "\xc2\x99", "\xc2\x9a", "\xc2\x9b", +/* 0x9c */ "\xc2\x9c", "\xc2\x9d", "\xc2\x9e", "\xc2\x9f", +/* 0xa0 */ "\xc2\xa0", "\xd0\x81", "\xd0\x82", "\xd0\x83", +/* 0xa4 */ "\xd0\x84", "\xd0\x85", "\xd0\x86", "\xd0\x87", +/* 0xa8 */ "\xd0\x88", "\xd0\x89", "\xd0\x8a", "\xd0\x8b", +/* 0xac */ "\xd0\x8c", "\xc2\xad", "\xd0\x8e", "\xd0\x8f", +/* 0xb0 */ "\xd0\x90", "\xd0\x91", "\xd0\x92", "\xd0\x93", +/* 0xb4 */ "\xd0\x94", "\xd0\x95", "\xd0\x96", "\xd0\x97", +/* 0xb8 */ "\xd0\x98", "\xd0\x99", "\xd0\x9a", "\xd0\x9b", +/* 0xbc */ "\xd0\x9c", "\xd0\x9d", "\xd0\x9e", "\xd0\x9f", +/* 0xc0 */ "\xd0\xa0", "\xd0\xa1", "\xd0\xa2", "\xd0\xa3", +/* 0xc4 */ "\xd0\xa4", "\xd0\xa5", "\xd0\xa6", "\xd0\xa7", +/* 0xc8 */ "\xd0\xa8", "\xd0\xa9", "\xd0\xaa", "\xd0\xab", +/* 0xcc */ "\xd0\xac", "\xd0\xad", "\xd0\xae", "\xd0\xaf", +/* 0xd0 */ "\xd0\xb0", "\xd0\xb1", "\xd0\xb2", "\xd0\xb3", +/* 0xd4 */ "\xd0\xb4", "\xd0\xb5", "\xd0\xb6", "\xd0\xb7", +/* 0xd8 */ "\xd0\xb8", "\xd0\xb9", "\xd0\xba", "\xd0\xbb", +/* 0xdc */ "\xd0\xbc", "\xd0\xbd", "\xd0\xbe", "\xd0\xbf", +/* 0xe0 */ "\xd1\x80", "\xd1\x81", "\xd1\x82", "\xd1\x83", +/* 0xe4 */ "\xd1\x84", "\xd1\x85", "\xd1\x86", "\xd1\x87", +/* 0xe8 */ "\xd1\x88", "\xd1\x89", "\xd1\x8a", "\xd1\x8b", +/* 0xec */ "\xd1\x8c", "\xd1\x8d", "\xd1\x8e", "\xd1\x8f", +/* 0xf0 */ "\xe2\x84\x96", "\xd1\x91", "\xd1\x92", "\xd1\x93", +/* 0xf4 */ "\xd1\x94", "\xd1\x95", "\xd1\x96", "\xd1\x97", +/* 0xf8 */ "\xd1\x98", "\xd1\x99", "\xd1\x9a", "\xd1\x9b", +/* 0xfc */ "\xd1\x9c", "\xc2\xa7", "\xd1\x9e", "\xd1\x9f" +}, + +/*--------------------------------------------------------------------------*/ +/* Closing line should be NULL */ +/*--------------------------------------------------------------------------*/ +{(char*) 0} + +}; diff --git a/xcircuit-tcl.nsi b/xcircuit-tcl.nsi index 2a51826..221563d 100644 --- a/xcircuit-tcl.nsi +++ b/xcircuit-tcl.nsi @@ -97,6 +97,7 @@ Section "XCircuit" SEC01 File "lib\analoglib3.lps" File "lib\analoglib2.lps" File "lib\analog.lps" + File "lib\xspice.lps" File "lib\xcircps2.pro" SetOutPath "$INSTDIR\xcircuit-${PRODUCT_VERSION}\fonts" File "lib\fonts\times_romaniso.xfe" @@ -825,6 +826,7 @@ Section Uninstall Delete "$INSTDIR\xcircuit-${PRODUCT_VERSION}\fonts\times_romaniso5.xfe" Delete "$INSTDIR\xcircuit-${PRODUCT_VERSION}\fonts\times_romaniso.xfe" Delete "$INSTDIR\xcircuit-${PRODUCT_VERSION}\xcircps2.pro" + Delete "$INSTDIR\xcircuit-${PRODUCT_VERSION}\xspice.lps" Delete "$INSTDIR\xcircuit-${PRODUCT_VERSION}\analog.lps" Delete "$INSTDIR\xcircuit-${PRODUCT_VERSION}\analoglib2.lps" Delete "$INSTDIR\xcircuit-${PRODUCT_VERSION}\analoglib3.lps" diff --git a/xcircuit.c b/xcircuit.c index 19ef136..c7cfe73 100644 --- a/xcircuit.c +++ b/xcircuit.c @@ -106,7 +106,6 @@ Cursor appcursors[NUM_CURSORS]; ApplicationData appdata; XCWindowData *areawin; Globaldata xobjs; -int *appcolors; int number_colors; colorindex *colorlist; short menusize; @@ -129,7 +128,7 @@ extern Tcl_Interp *xcinterp; extern XtAppContext app; #endif -#ifdef DOUBLEBUFFER +#if !defined(HAVE_CAIRO) extern Pixmap dbuf; #endif @@ -169,15 +168,12 @@ void addtocolorlist(xcWidget button, int cvalue) int addnewcolorentry(int ccolor) { - xcWidget newbutton; /* colormenu, (jdk) */ -#ifndef XC_WIN32 - /* Arg wargs[2]; (jdk) */ -#endif - int i; /* , n = 0; (jdk) */ + xcWidget newbutton = (xcWidget)NULL; + int i; /* check to see if entry is already in the color list */ - for (i = 0; i < number_colors; i++) + for (i = NUMBER_OF_COLORS; i < number_colors; i++) if (colorlist[i].color.pixel == ccolor) break; /* make new entry in the menu */ @@ -259,14 +255,16 @@ void quit(xcWidget w, caddr_t nulldata) else Fprintf(stderr, "Ctrl-C exit: reload workspace from \"%s\"\n", xobjs.tempfile); + free(xobjs.tempfile); + xobjs.tempfile = NULL; } - free(xobjs.tempfile); #if defined(HAVE_PYTHON) /* exit by exiting the Python interpreter, if enabled */ exit_interpreter(); #elif defined(TCL_WRAPPER) - exit(0); /* For now, exit. Later, clear all pages and return to interp. */ + /* Let Tcl/Tk handle exit */ + return; #elif defined(XC_WIN32) PostQuitMessage(0); #else @@ -351,11 +349,14 @@ u_short countchanges(char **promptstr) /*----------------------------------------------*/ /* Check for conditions to approve program exit */ +/* Return 0 if prompt "Okay" button ends the */ +/* program, 1 if the program should exit */ +/* immediately. */ /*----------------------------------------------*/ #ifdef TCL_WRAPPER -void quitcheck(xcWidget w, caddr_t clientdata, caddr_t calldata) +int quitcheck(xcWidget w, caddr_t clientdata, caddr_t calldata) { char *promptstr; Boolean doprompt = False; @@ -384,10 +385,13 @@ void quitcheck(xcWidget w, caddr_t clientdata, caddr_t calldata) Tcl_Eval(xcinterp, "wm deiconify .query"); Tcl_Eval(xcinterp, "raise .query"); free(promptstr); + return 0; } else { free(promptstr); - quit(w, NULL); + quit(w, NULL); // preparation for quit + Tcl_Eval(xcinterp, "quitnocheck"); // actual quit + return 1; // not reached } } @@ -687,29 +691,37 @@ int findnearcolor(XColor *cvexact) #endif -/*------------------------------------------------------------------------------*/ -/* Layout colors which are defined from the Xdefaults (BBOXCOLOR, schematic */ -/* label colors) may be duplicated in the colormap. This routine takes a color */ -/* index of a color and returns the index of any color in the layout colormap */ -/* which matches it within the tolerance used by "rgb_alloccolor". This will */ -/* be used to remap the Xdefault-supplied colors to the layout color table, so */ -/* we don't get duplicate entries. */ -/*------------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/* Return the pixel value of a database color in the colorlist vector */ +/* Since this is generally called by defined name, e.g., */ +/* xc_getlayoutcolor(RATSNESTCOLOR), it does not check for invalid */ +/* values of cidx. */ +/*----------------------------------------------------------------------*/ int xc_getlayoutcolor(int cidx) { - XColor loccolor; - int locidx; /* i, (jdk) */ + return colorlist[cidx].color.pixel; +} - loccolor.pixel = cidx; - loccolor.flags = DoRed | DoGreen | DoBlue; +/*----------------------------------------------------------------------*/ +/* Obtain red, green and blue values from a color index */ +/* the colour values range from 0 to 65535 */ +/*----------------------------------------------------------------------*/ +void xc_get_color_rgb(unsigned long cidx, unsigned short *red, + unsigned short *green, unsigned short *blue) +{ + XColor loccolor = { + .pixel = cidx, + .flags = DoRed | DoGreen | DoBlue + }; XQueryColors(dpy, cmap, &loccolor, 1); - - locidx = rgb_alloccolor(loccolor.red, loccolor.green, loccolor.blue); - return locidx; + *red = loccolor.red; + *green = loccolor.green; + *blue = loccolor.blue; } + /*-------------------------------------------------------------------------*/ /* Hack on the resource database Color allocation */ /* */ @@ -799,7 +811,7 @@ int rgb_querycolor(int red, int green, int blue, int *pixval) { int i; - for (i = 0; i < number_colors; i++) { + for (i = NUMBER_OF_COLORS; i < number_colors; i++) { if (abs(colorlist[i].color.red - red) < 512 && abs(colorlist[i].color.green - green) < 512 && abs(colorlist[i].color.blue - blue) < 512) { @@ -820,6 +832,10 @@ int rgb_querycolor(int red, int green, int blue, int *pixval) int rgb_alloccolor(int red, int green, int blue) { + ERROR FIXME! + // XCircuit version 3.9: This no longer works. Need to + // allocate the color and return an index into colorlist[]. + return RGB(red >> 8, green >> 8, blue >> 8); } @@ -844,8 +860,11 @@ int rgb_alloccolor(int red, int green, int blue) pixval = findnearcolor(&newcolor); else pixval = newcolor.pixel; + + // Add this to the colormap + tableidx = addnewcolorentry(pixval); } - return pixval; + return tableidx; } #endif @@ -881,8 +900,8 @@ void makecursors() Tk_Uid fg_uid, bg_uid; #endif - bgcolor.pixel = BACKGROUND; - fgcolor.pixel = FOREGROUND; + bgcolor.pixel = colorlist[BACKGROUND].color.pixel; + fgcolor.pixel = colorlist[FOREGROUND].color.pixel; XQueryColors(dpy, cmap, &fgcolor, 1); XQueryColors(dpy, cmap, &bgcolor, 1); @@ -1038,7 +1057,7 @@ XCWindowData *create_new_window() newwindow->area = (xcWidget)NULL; newwindow->mapped = False; newwindow->psfont = 0; - newwindow->justify = FLIPINV; + newwindow->anchor = FLIPINV; newwindow->page = 0; newwindow->MatStack = NULL; newwindow->textscale = 1.0; @@ -1073,15 +1092,23 @@ XCWindowData *create_new_window() newwindow->attachto = -1; newwindow->color = DEFAULTCOLOR; newwindow->gccolor = 0; - newwindow->gctype = 0; newwindow->time_id = 0; + newwindow->redraw_needed = True; + newwindow->redraw_ongoing = False; +#ifdef HAVE_CAIRO + newwindow->fixed_pixmap = NULL; + newwindow->cr = NULL; +#else /* HAVE_CAIRO */ newwindow->clipmask = (Pixmap)NULL; newwindow->pbuf = (Pixmap)NULL; newwindow->cmgc = (GC)NULL; newwindow->clipped = 0; + newwindow->fixed_pixmap = (Pixmap) NULL; +#endif /* !HAVE_CAIRO */ newwindow->vscale = 1; newwindow->pcorner.x = newwindow->pcorner.y = 0; newwindow->topinstance = (objinstptr)NULL; + newwindow->panx = newwindow->pany = 0; /* Prepend to linked window list in global data (xobjs) */ newwindow->next = xobjs.windowlist; @@ -1145,7 +1172,7 @@ void pre_initialize() xobjs.hold = TRUE; xobjs.showtech = FALSE; - xobjs.suspend = (char)0; /* Suspend graphics until finished with startup */ + xobjs.suspend = (signed char)0; /* Suspend graphics until finished with startup */ xobjs.new_changes = 0; xobjs.filefilter = TRUE; xobjs.tempfile = NULL; @@ -1237,7 +1264,7 @@ SetHandleFromAny(interp, objPtr) Tcl_Interp *interp; /* Used for error reporting if not NULL. */ Tcl_Obj *objPtr; /* The object to convert. */ { - Tcl_ObjType *oldTypePtr = objPtr->typePtr; + Tcl_ObjType *oldTypePtr = (Tcl_ObjType *)objPtr->typePtr; char *string, *end; int length; char *p; @@ -1451,21 +1478,20 @@ void post_initialize() /* set in initmem() should correctly position the empty page in the */ /* middle of the viewing window. */ -#ifdef DOUBLEBUFFER +#if !defined(HAVE_CAIRO) if (dbuf == (Pixmap)NULL) dbuf = XCreatePixmap(dpy, areawin->window, areawin->width, areawin->height, DefaultDepthOfScreen(xcScreen(areawin->area))); #endif -#ifdef TCL_WRAPPER - /* Set up fundamentally necessary colors black and white */ addnewcolorentry(xc_alloccolor("Black")); addnewcolorentry(xc_alloccolor("White")); - /* Set up new Tcl type "handle" for element handles */ +#ifdef TCL_WRAPPER + /* Set up new Tcl type "handle" for element handles */ Tcl_RegisterObjType(&tclHandleType); #endif diff --git a/xcircuit.h b/xcircuit.h index 72d67b8..15a74f9 100644 --- a/xcircuit.h +++ b/xcircuit.h @@ -12,7 +12,7 @@ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; -typedef unsigned long long u_long; +typedef unsigned long long u_long_long; #endif #ifdef XC_WIN32 @@ -23,34 +23,45 @@ typedef unsigned long long u_long; #endif #endif +#ifdef HAVE_CAIRO +#include +#endif + +/*----------------------------------------------------------------------*/ +/* portable definition to prevent unused variables warning */ +/*----------------------------------------------------------------------*/ + +#define UNUSED(x) (void) x + /*----------------------------------------------------------------------*/ -/* Graphics functions defined for X11 (i.e., not OpenGL) */ +/* Graphics functions defined for X11 */ /*----------------------------------------------------------------------*/ -#ifndef OPENGL +#ifdef HAVE_CAIRO + +#define SetForeground(display, gc, fg) xc_cairo_set_color(fg) +typedef cairo_surface_t xcImage; + +#else /* !HAVE_CAIRO */ +typedef XImage xcImage; #define DrawLine XDrawLine #define DrawLines XDrawLines #define DrawPoint XDrawPoint #define FillPolygon XFillPolygon -#define SetForeground XSetForeground -#define SetBackground XSetBackground -#define SetFunction XSetFunction +#define SetForeground(dpy, gc, fg) XSetForeground(dpy, gc, colorlist[fg].color.pixel) +#define SetBackground(dpy, gc, bg) XSetBackground(dpy, gc, colorlist[bg].color.pixel) #define SetThinLineAttributes XSetLineAttributes #define SetLineAttributes(a, b, c, d, e, f) \ XSetLineAttributes(a, b, ((c) >= 1.55 ? (int)(c + 0.45) : 0), d, e, f) #define SetDashes XSetDashes #define SetFillStyle XSetFillStyle #define SetStipple(a,b,c) XSetStipple(a,b,STIPPLE[c]) -#define flusharea() - -#else -#define SetThinLineAttributes SetLineAttributes -#define flusharea glFlush +#endif /* !HAVE_CAIRO */ -#endif /* !OPENGL */ +#define flusharea() /*----------------------------------------------------------------------*/ /* Redefinition of fprintf() allows redirection of output to a console */ @@ -68,7 +79,7 @@ typedef unsigned long long u_long; #ifdef TCL_WRAPPER #define malloc Tcl_Alloc /* (see definition of my_calloc in the asg subdirectory) */ - // #define calloc(a,b) Tcl_Alloc(a * b) + /* #define calloc(a,b) Tcl_Alloc(a * b) */ #define free(a) Tcl_Free((char *)(a)) #define realloc(a,b) Tcl_Realloc((char *)(a), b) #undef strdup @@ -266,9 +277,17 @@ typedef struct { } XlPoint; typedef struct { - short width, maxwidth, ascent, descent, base; + short width, ascent, descent, base; + int maxwidth; } TextExtents; +typedef struct { + float *padding; /* Allocated array of padding info per line */ + XPoint *tbreak; /* Position in text to stop */ + short dostop; /* Location (index) in text to stop */ + short line; /* Stop line number, if using dostop or tbreak. */ +} TextLinesInfo; + /*----------------------------------------------------------------------*/ /* Implementation-specific definitions */ /*----------------------------------------------------------------------*/ @@ -321,17 +340,15 @@ typedef struct { /*----------------------------------------------------------------------*/ /* Event mode definitions (state of drawing area) */ -/* NOTE: changes to this list must be reflected in xctcl_eventmode(). */ /*----------------------------------------------------------------------*/ -enum editmode { +typedef enum editmode { NORMAL_MODE = 0, /* On the drawing page, none of the situations below */ UNDO_MODE, /* In the process of an undo/redo operation */ MOVE_MODE, /* In the process of moving elements */ COPY_MODE, /* In the process of copying elements */ PAN_MODE, /* In the process of panning to follow the cursor */ SELAREA_MODE, /* Area selection box */ - PENDING_MODE, /* Temporary mode to select without drawing selection */ RESCALE_MODE, /* Interactive element rescaling box */ CATALOG_MODE, /* On a library page, library directory, or page directory */ CATTEXT_MODE, /* Editing an existing object name in the library */ @@ -350,7 +367,7 @@ enum editmode { EINST_MODE, /* Editing an instance (from the level above) */ ASSOC_MODE, /* Choosing an associated schematic or symbol */ CATMOVE_MODE /* Moving objects in or between libraries */ -}; +} event_mode_t; /*----------------------------------------------------------------------*/ /* File loading modes */ @@ -359,26 +376,33 @@ enum editmode { enum loadmodes {IMPORT = 1, PSBKGROUND, SCRIPT, RECOVER, #ifdef ASG IMPORTSPICE, +#endif +#ifdef HAVE_CAIRO + IMPORTGRAPHIC, #endif LOAD_MODES }; /*----------------------------------------------------------------------*/ -/* Text justification styles and other parameters (bitmask) */ +/* Text anchoring styles and other parameters (bitmask) */ /*----------------------------------------------------------------------*/ -#define NOTLEFT 1 -#define RIGHT 2 -#define NOTBOTTOM 4 -#define TOP 8 +#define NOTLEFT 1 /* Center or right anchoring */ +#define RIGHT 2 /* Right anchoring */ +#define NOTBOTTOM 4 /* Middle or top anchoring */ +#define TOP 8 /* Top anchoring */ #define FLIPINV 16 /* 1 if text is flip-invariant */ #define PINVISIBLE 32 /* 1 if pin visible outside of object */ #define PINNOOFFSET 64 /* 0 if pin label offset from position */ -#define LATEXLABEL 128 +#define LATEXLABEL 128 /* 1 if label is in LaTeX syntax */ +#define JUSTIFYRIGHT 256 /* Right text justification */ +#define JUSTIFYBOTH 512 /* Right and left text justification */ +#define TEXTCENTERED 1024 /* Centered text */ -#define RLJUSTFIELD 3 /* right-left justification bit field */ -#define TBJUSTFIELD 12 /* top-bottom justification bit field */ -#define NONJUSTFIELD 240 /* everything but justification fields */ +#define RLANCHORFIELD 3 /* right-left anchoring bit field */ +#define TBANCHORFIELD 12 /* top-bottom anchoring bit field */ +#define NONANCHORFIELD 2032 /* everything but anchoring fields */ +#define NONJUSTIFFIELD 255 /* everything but justification fields */ /*----------------------------------------------------------------------*/ /* Text string part: types */ @@ -596,7 +620,7 @@ enum paramwhich { P_POSITION_X, P_POSITION_Y, P_STYLE, - P_JUSTIFY, + P_ANCHOR, P_ANGLE1, P_ANGLE2, P_RADIUS, @@ -725,7 +749,7 @@ typedef struct { eparamptr passed; /* numerical parameters passed from above */ u_short style; XPoint position; - short rotation; + float rotation; float scale; objectptr thisobject; oparamptr params; /* parameter substitutions for this instance */ @@ -774,14 +798,16 @@ typedef struct { int color; /* foreground, for bitmaps only */ eparamptr passed; /* numerical parameters passed from above */ XPoint position; - short rotation; + float rotation; float scale; - XImage *source; /* source data */ - XImage *target; /* target (scaled) data */ - short trot; /* target rotation */ + xcImage *source; /* source data */ +#ifndef HAVE_CAIRO + xcImage *target; /* target (scaled) data */ + float trot; /* target rotation */ float tscale; /* target scale (0 = uninitialized) */ Pixmap clipmask; /* clipmask for non-manhattan rotations */ Boolean valid; /* does target need to be regenerated? */ +#endif /* !HAVE_CAIRO */ } graphic, *graphicptr; /*----------------------------------------------------------------------*/ @@ -794,9 +820,9 @@ typedef struct { eparamptr passed; /* numerical parameters passed from above */ pointselect *cycle; /* Edit position(s), or NULL */ XPoint position; - short rotation; + float rotation; float scale; - short justify; + u_short anchor; u_char pin; stringpart *string; } label, *labelptr; @@ -1035,6 +1061,7 @@ typedef struct _xcobject { PolylistPtr polygons; /* Netlist wires */ PortlistPtr ports; /* Netlist ports */ CalllistPtr calls; /* Netlist subcircuits and connections */ + Boolean infolabels; /* TRUE if object contains info-labels */ NetnamePtr netnames; /* Local names for flattening */ /* (this probably shouldn't be here. . .) */ } object; @@ -1203,22 +1230,12 @@ typedef struct { #define XTopSetForeground(a) if (a == DEFAULTCOLOR) SetForeground(dpy, \ areawin->gc, FOREGROUND); else SetForeground(dpy, areawin->gc, a) -#define XSetXORFg(a,b) if (a == DEFAULTCOLOR) SetForeground(dpy, \ - areawin->gc, FOREGROUND ^ b); else SetForeground(dpy, areawin->gc,\ - a ^ b) - -#define XcSetFunction(z) SetFunction(dpy, areawin->gc, z); \ - areawin->gctype = z - #define XcTopSetForeground(z) XTopSetForeground(z); areawin->gccolor = \ ((z) == DEFAULTCOLOR) ? FOREGROUND : (z) #define XcSetForeground(z) SetForeground(dpy, areawin->gc, z); \ areawin->gccolor = z -#define XcSetXORFg(y,z) XSetXORFg(y,z); areawin->gccolor = \ - ((y) == DEFAULTCOLOR) ? (FOREGROUND ^ z) : (y ^ z) - /*----------------------------------------------------------------------*/ /* Structure for maintaining list of colors */ /*----------------------------------------------------------------------*/ @@ -1239,7 +1256,7 @@ typedef struct { /* 4 */ /* 5 special encoding = 1, Standard Encoding = 0 */ /* 6 ISOLatin1 = 2, ISOLatin2 = 3 */ -/* 7 */ +/* 7+ */ /*----------------------------------------------------------------------*/ typedef struct { @@ -1248,6 +1265,14 @@ typedef struct { float scale; u_short flags; objectptr *encoding; +#ifdef HAVE_CAIRO + const char **utf8encoding; + cairo_font_face_t *font_face; + unsigned long glyph_index[256]; + double glyph_top[256]; + double glyph_bottom[256]; + double glyph_advance[256]; +#endif /* HAVE_CAIRO */ } fontinfo; /*----------------------------------------------------------------------*/ @@ -1279,7 +1304,7 @@ typedef struct _keybinding { enum { XCF_ENDDATA = -2, XCF_SPACER /* -1 */, - XCF_Page /* 0 */, XCF_Justify /* 1 */, + XCF_Page /* 0 */, XCF_Anchor /* 1 */, XCF_Superscript /* 2 */, XCF_Subscript /* 3 */, XCF_Normalscript /* 4 */, XCF_Font /* 5 */, XCF_Boldfont /* 6 */, XCF_Italicfont /* 7 */, @@ -1366,7 +1391,7 @@ typedef struct { /*----------------------------------------------------------------------*/ typedef struct { - XImage *image; + xcImage *image; int refcount; char *filename; } Imagedata; @@ -1385,15 +1410,28 @@ typedef struct _windowdata { /* widgets and X11 parameters */ xcWidget area; xcWidget scrollbarh, scrollbarv; + int panx, pany; Window window; GC gc; +#ifndef HAVE_CAIRO Pixmap clipmask; Pixmap pbuf; /* clipmask buffer for hierarchical clipping */ - char clipped; + signed char clipped; GC cmgc; - int gccolor, gctype; +#endif /* !HAVE_CAIRO */ + int gccolor; xcIntervalId time_id; - + Boolean redraw_needed; + Boolean redraw_ongoing; +#ifdef HAVE_CAIRO + cairo_surface_t *surface; + cairo_t *cr; /* cairo_drawing context */ + cairo_pattern_t *fixed_pixmap; /* pixmap holding the background data of */ + /* all fixed element. ie. not including the */ + /* element currently being edited. */ +#else /* HAVE_CAIRO */ + Pixmap fixed_pixmap; +#endif /* HAVE_CAIRO */ /* global page parameters */ short width, height; short page; @@ -1405,7 +1443,7 @@ typedef struct _windowdata { float linewidth; float zoomfactor; short psfont; - short justify; + u_short anchor; u_short style; int color; short filter; /* selection filter */ @@ -1443,7 +1481,7 @@ typedef struct _windowdata { Matrixptr MatStack; pushlistptr stack; pushlistptr hierstack; - short event_mode; + event_mode_t event_mode; char *lastbackground; Cursor *defaultcursor; } XCWindowData; @@ -1510,7 +1548,7 @@ typedef struct { Boolean hold; /* allow HOLD modifiers on buttons */ Boolean showtech; /* Write technology names in library */ u_short new_changes; - char suspend; /* suspend graphics updates if TRUE */ + signed char suspend; /* suspend graphics updates if TRUE */ short numlibs; short pages; Pagedata **pagelist; @@ -1525,6 +1563,48 @@ typedef struct { XCWindowData *windowlist; /* linked list of known windows */ } Globaldata; + +/*-------------------------------------------------------------------------*/ +/* Track state of the ghostscript renderer */ +/*-------------------------------------------------------------------------*/ + +typedef enum { + GS_INIT, /* Initial state; gs is idle. */ + GS_PENDING, /* Drawing in progress; gs is busy. */ + GS_READY /* Drawing done; gs is waiting for "next". */ +} gs_state_t; + + +/*-------------------------------------------------------------------------*/ +/* For the eventmodes (ARC_MODE, EARC_MODE, SPLINE_MODE, etc) the drawing */ +/* and/or redrawing of the elements is centralized in functions */ +/* corresponding to the eventmode name (arc_mode_draw, spline_mode_draw, */ +/* etc.). Depending on the state these functions clear, draw or whatever */ +/* is needed. A description of the options follows below */ +/* fixed_pixmap refers to the background pixmap without the element(s) */ +/* currently being edited. */ +/*-------------------------------------------------------------------------*/ + +typedef enum { + xcDRAW_INIT, /* Initalize fixed_pixmap and draw the element(s) */ + /* element(s) currently being edited, including */ + /* edit lines. */ + + xcDRAW_EDIT, /* Draw the currently edited element(s), including */ + /* edit lines. */ + + xcDRAW_FINAL, /* Draw the finalized element(s), without edit */ + /* lines to the fixed_pixmap */ + + xcDRAW_EMPTY, /* Refresh the screen by drawing the fixed_pixmap */ + /* This essentially clear the edited elements */ + + xcREDRAW_FORCED /* Redraws everything, including edit lines. Only */ + /* used in drawarea. This one should be called */ + /* when something has changed (eg. zoom). */ + /* It will redraw the fixed_pixmap */ +} xcDrawType; + /*----------------------------------------------------------------------*/ /* structures previously defined in menudefs.h */ /*----------------------------------------------------------------------*/ @@ -1562,3 +1642,4 @@ typedef struct _toolbarstruct { /* Menus and Toolbars are taken care of entirely by scripts in the Tcl/ */ /* Tk version of xcircuit. */ /*----------------------------------------------------------------------*/ + diff --git a/xcwin32.c b/xcwin32.c index bf1fd75..d242268 100644 --- a/xcwin32.c +++ b/xcwin32.c @@ -42,7 +42,6 @@ static char STIPDATA[STIPPLES][4] = { }; extern xcWidget top, message2, message3; extern ApplicationData appdata; -extern int* appcolors; extern int number_colors; extern colorindex *colorlist; extern menustruct TopButtons[]; @@ -2295,9 +2294,8 @@ XCWindowData* GUI_init(int argc, char *argv[]) STIPPLE[i] = WinCreateBitmapFromData(NULL, STIPDATA[i], 4, 4); } - number_colors = 0; - colorlist = (colorindex *)malloc(sizeof(colorindex)); - appcolors = (int *) malloc(NUMBER_OF_COLORS * sizeof(int)); + number_colors = NUMBER_OF_COLORS; + colorlist = (colorindex *)malloc(NUMBER_OF_COLORS * sizeof(colorindex)); } clientRect.right = appdata.width+SBARSIZE; diff --git a/xtfuncs.c b/xtfuncs.c index 60f65e5..a3e8b1f 100644 --- a/xtfuncs.c +++ b/xtfuncs.c @@ -46,7 +46,6 @@ extern xcWidget top; extern Display *dpy; extern Globaldata xobjs; extern XCWindowData *areawin; -extern int *appcolors; extern int number_colors; extern colorindex *colorlist; extern ApplicationData appdata; @@ -89,9 +88,9 @@ void togglegridstyles(xcWidget button) { toggleexcl(button, GridStyles, XtNumber(GridStyles)); } -void togglejustifs(xcWidget button) { +void toggleanchors(xcWidget button) { if (button != NULL) - toggleexcl(button, Justifs, XtNumber(Justifs)); + toggleexcl(button, Anchors, XtNumber(Anchors)); } void togglefontstyles(xcWidget button) { @@ -105,108 +104,108 @@ void toggleencodings(xcWidget button) { } /*--------------------------------------------------------------*/ -/* Toggle a bit in the justification field of a label */ +/* Toggle a bit in the anchoring field of a label */ /*--------------------------------------------------------------*/ -void dojustifybit(xcWidget w, labelptr settext, short bitfield) +void doanchorbit(xcWidget w, labelptr settext, short bitfield) { if (settext != NULL) { - int oldjust = (int)settext->justify; + int oldanchor = (int)settext->anchor; undrawtext(settext); - settext->justify ^= bitfield; + settext->anchor ^= bitfield; redrawtext(settext); pwriteback(areawin->topinstance); - register_for_undo(XCF_Justify, UNDO_MORE, areawin->topinstance, - (genericptr)settext, oldjust); + register_for_undo(XCF_Anchor, UNDO_MORE, areawin->topinstance, + (genericptr)settext, oldanchor); } else - areawin->justify ^= bitfield; + areawin->anchor ^= bitfield; if (w != NULL) { Boolean boolval; if (settext) - boolval = (settext->justify & bitfield) ? 0 : 1; + boolval = (settext->anchor & bitfield) ? 0 : 1; else - boolval = (areawin->justify & bitfield) ? 0 : 1; + boolval = (areawin->anchor & bitfield) ? 0 : 1; toggle(w, (pointertype)(-1), &boolval); } } /*--------------------------------------------------------------*/ -/* Toggle a pin-related bit in the justification field of a */ -/* label. This differs from dojustifybit() in that the label */ +/* Toggle a pin-related bit in the anchoring field of a */ +/* label. This differs from doanchorbit() in that the label */ /* must be a pin, and this function cannot change the default */ -/* behavior set by areawin->justify. */ +/* behavior set by areawin->anchor. */ /*--------------------------------------------------------------*/ -void dopinjustbit(xcWidget w, labelptr settext, short bitfield) +void dopinanchorbit(xcWidget w, labelptr settext, short bitfield) { if ((settext != NULL) && settext->pin) { - int oldjust = (int)settext->justify; + int oldanchor = (int)settext->anchor; undrawtext(settext); - settext->justify ^= bitfield; + settext->anchor ^= bitfield; redrawtext(settext); pwriteback(areawin->topinstance); - register_for_undo(XCF_Justify, UNDO_MORE, areawin->topinstance, - (genericptr)settext, oldjust); + register_for_undo(XCF_Anchor, UNDO_MORE, areawin->topinstance, + (genericptr)settext, oldanchor); if (w != NULL) { - Boolean boolval = (settext->justify & bitfield) ? 0 : 1; + Boolean boolval = (settext->anchor & bitfield) ? 0 : 1; toggle(w, (pointertype)(-1), &boolval); } } } /*----------------------------------------------------------------*/ -/* Set the justification for the label passed as 3rd parameter */ +/* Set the anchoring for the label passed as 3rd parameter */ /*----------------------------------------------------------------*/ -void setjust(xcWidget w, pointertype value, labelptr settext, short mode) +void setanchor(xcWidget w, pointertype value, labelptr settext, short mode) { - short newjust, oldjust; + short newanchor, oldanchor; if (settext != NULL) { if (mode == 1) - newjust = (settext->justify & (NONJUSTFIELD | TBJUSTFIELD)) + newanchor = (settext->anchor & (NONANCHORFIELD | TBANCHORFIELD)) | value; else - newjust = (settext->justify & (NONJUSTFIELD | RLJUSTFIELD)) + newanchor = (settext->anchor & (NONANCHORFIELD | RLANCHORFIELD)) | value; - if (settext->justify != newjust) { - oldjust = (int)settext->justify; + if (settext->anchor != newanchor) { + oldanchor = (int)settext->anchor; undrawtext(settext); - settext->justify = newjust; + settext->anchor = newanchor; redrawtext(settext); pwriteback(areawin->topinstance); - register_for_undo(XCF_Justify, UNDO_MORE, areawin->topinstance, - (genericptr)settext, oldjust); + register_for_undo(XCF_Anchor, UNDO_MORE, areawin->topinstance, + (genericptr)settext, oldanchor); } } else { if (mode == 1) - newjust = (areawin->justify & (NONJUSTFIELD | TBJUSTFIELD)) + newanchor = (areawin->anchor & (NONANCHORFIELD | TBANCHORFIELD)) | value; else - newjust = (areawin->justify & (NONJUSTFIELD | RLJUSTFIELD)) + newanchor = (areawin->anchor & (NONANCHORFIELD | RLANCHORFIELD)) | value; - areawin->justify = newjust; + areawin->anchor = newanchor; } - if (w != NULL) togglejustifs(w); + if (w != NULL) toggleanchors(w); } -/*----------------------------------------------------------------*/ -/* Set vertical justification (top, middle, bottom) on all */ -/* selected labels */ -/*----------------------------------------------------------------*/ +/*--------------------------------------------------------------*/ +/* Set vertical anchoring (top, middle, bottom) on all */ +/* selected labels */ +/*--------------------------------------------------------------*/ -void setvjust(xcWidget w, pointertype value, caddr_t nulldata) +void setvanchor(xcWidget w, pointertype value, caddr_t nulldata) { short *fselect; labelptr settext; @@ -214,7 +213,7 @@ void setvjust(xcWidget w, pointertype value, caddr_t nulldata) if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { settext = *((labelptr *)EDITPART); - setjust(w, value, settext, 2); + setanchor(w, value, settext, 2); } else { for (fselect = areawin->selectlist; fselect < areawin->selectlist + @@ -222,20 +221,20 @@ void setvjust(xcWidget w, pointertype value, caddr_t nulldata) if (SELECTTYPE(fselect) == LABEL) { labelcount++; settext = SELTOLABEL(fselect); - setjust(NULL, value, settext, 2); + setanchor(NULL, value, settext, 2); } } - if (labelcount == 0) setjust(w, value, NULL, 2); + if (labelcount == 0) setanchor(w, value, NULL, 2); else unselect_all(); } } /*----------------------------------------------------------------*/ -/* Set horizontal justification (left, center, right) on all */ +/* Set horizontal anchoring (left, center, right) on all */ /* selected labels */ /*----------------------------------------------------------------*/ -void sethjust(xcWidget w, pointertype value, caddr_t nulldata) +void sethanchor(xcWidget w, pointertype value, caddr_t nulldata) { short *fselect; labelptr settext; @@ -243,7 +242,7 @@ void sethjust(xcWidget w, pointertype value, caddr_t nulldata) if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { settext = *((labelptr *)EDITPART); - setjust(w, value, settext, 1); + setanchor(w, value, settext, 1); } else { for (fselect = areawin->selectlist; fselect < areawin->selectlist + @@ -251,20 +250,20 @@ void sethjust(xcWidget w, pointertype value, caddr_t nulldata) if (SELECTTYPE(fselect) == LABEL) { labelcount++; settext = SELTOLABEL(fselect); - setjust(NULL, value, settext, 1); + setanchor(NULL, value, settext, 1); } } - if (labelcount == 0) setjust(w, value, NULL, 1); + if (labelcount == 0) setanchor(w, value, NULL, 1); else unselect_all(); } } /*--------------------------------------------------------------*/ -/* Set a justify field bit on all selected labels */ +/* Set an anchor field bit on all selected labels */ /* (flip invariance, latex mode, etc.) */ /*--------------------------------------------------------------*/ -void setjustbit(xcWidget w, pointertype value, caddr_t nulldata) +void setanchorbit(xcWidget w, pointertype value, caddr_t nulldata) { short *fselect; labelptr settext; @@ -272,7 +271,7 @@ void setjustbit(xcWidget w, pointertype value, caddr_t nulldata) if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { settext = *((labelptr *)EDITPART); - dojustifybit(w, settext, (short)value); + doanchorbit(w, settext, (short)value); } else { for (fselect = areawin->selectlist; fselect < areawin->selectlist + @@ -280,20 +279,20 @@ void setjustbit(xcWidget w, pointertype value, caddr_t nulldata) if (SELECTTYPE(fselect) == LABEL) { labelcount++; settext = SELTOLABEL(fselect); - dojustifybit(NULL, settext, (short)value); + doanchorbit(NULL, settext, (short)value); } } - if (labelcount == 0) dojustifybit(w, NULL, (short)value); + if (labelcount == 0) doanchorbit(w, NULL, (short)value); else unselect_all(); } } /*--------------------------------------------------------------*/ -/* Set pin-related bit field of "justify" on all selected pins */ +/* Set pin-related bit field of "anchor" on all selected pins */ /* (e.g., pin visibility) */ /*--------------------------------------------------------------*/ -void setpinjustbit(xcWidget w, pointertype value, caddr_t nulldata) +void setpinanchorbit(xcWidget w, pointertype value, caddr_t nulldata) { short *fselect; labelptr settext; @@ -301,7 +300,7 @@ void setpinjustbit(xcWidget w, pointertype value, caddr_t nulldata) if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) { settext = *((labelptr *)EDITPART); if (settext->pin) - dopinjustbit(w, settext, (short)value); + dopinanchorbit(w, settext, (short)value); } else { for (fselect = areawin->selectlist; fselect < areawin->selectlist + @@ -309,7 +308,7 @@ void setpinjustbit(xcWidget w, pointertype value, caddr_t nulldata) if (SELECTTYPE(fselect) == LABEL) { settext = SELTOLABEL(fselect); if (settext->pin) - dopinjustbit(NULL, settext, (short)value); + dopinanchorbit(NULL, settext, (short)value); } } unselect_all(); @@ -394,7 +393,7 @@ void overdrawpixmap(xcWidget button) #endif #else -#define overdrawpixmap(a) +void overdrawpixmap(xcWidget button) {} #endif /* XPM */ /*--------------------------------------------------------------*/ @@ -414,7 +413,7 @@ buttonsave *getgeneric(xcWidget button, void (*getfunction)(), void *dataptr) if (button != NULL) { XtSetArg(wargs[0], XtNforeground, &saveptr->foreground); XtGetValues(button, wargs, 1); - XtSetArg(wargs[0], XtNforeground, OFFBUTTONCOLOR); + XtSetArg(wargs[0], XtNforeground, colorlist[OFFBUTTONCOLOR].color.pixel); XtSetValues(button, wargs, 1); XtRemoveAllCallbacks(button, XtNselect); } @@ -1109,6 +1108,7 @@ void toolcursor(int mode) void highlightexcl(xcWidget widget, int func, int value) { +#ifdef HAVE_XPM Arg args[2]; xcWidget parent = xcParent(PanToolButton); xcWidget sibling, self = (xcWidget)NULL; @@ -1116,8 +1116,8 @@ void highlightexcl(xcWidget widget, int func, int value) /* remove highlight from all widgets in the toolbar */ - XtSetArg(args[0], XtNbackground, BACKGROUND); - XtSetArg(args[1], XtNborderColor, SNAPCOLOR); + XtSetArg(args[0], XtNbackground, colorlist[BACKGROUND].color.pixel); + XtSetArg(args[1], XtNborderColor, colorlist[SNAPCOLOR].color.pixel); for (titem = ToolBar; titem < ToolBar + toolbuttons; titem++) { sibling = XtNameToWidget(parent, titem->name); if (sibling == widget) @@ -1155,10 +1155,11 @@ void highlightexcl(xcWidget widget, int func, int value) /* Now highlight the currently pushed widget */ if (self != (xcWidget)NULL) { - XtSetArg(args[0], XtNbackground, RATSNESTCOLOR); - XtSetArg(args[1], XtNborderColor, RATSNESTCOLOR); + XtSetArg(args[0], XtNbackground, colorlist[RATSNESTCOLOR].color.pixel); + XtSetArg(args[1], XtNborderColor, colorlist[RATSNESTCOLOR].color.pixel); XtSetValues(self, args, 2); } +#endif /* HAVE_XPM */ } /*--------------------*/ @@ -1405,18 +1406,13 @@ void setcolormark(int colorval) if (colorval == DEFAULTCOLOR) w = ColorInheritColorButton; - else { - for (i = 0; i < number_colors; i++) - if (colorlist[i].color.pixel == colorval) { - w = colorlist[i].cbutton; - break; - } - } + else + w = colorlist[colorval].cbutton; /* Remove mark from all menu items */ XtSetArg(args[0], XtNsetMark, False); - for (i = 0; i < number_colors; i++) + for (i = NUMBER_OF_COLORS; i < number_colors; i++) XtSetValues(colorlist[i].cbutton, args, 1); XtSetValues(ColorInheritColorButton, args, 1); @@ -1539,7 +1535,7 @@ void setcolor(xcWidget w, pointertype value, caddr_t calldata) XtSetArg(wargs[0], XtNrectColor, &cval); XtGetValues(w, wargs, 1); - for (cindex = 0; cindex < number_colors; cindex++) + for (cindex = NUMBER_OF_COLORS; cindex < number_colors; cindex++) if (colorlist[cindex].color.pixel == cval) break; if (cindex >= number_colors) { @@ -1575,15 +1571,15 @@ void setcolor(xcWidget w, pointertype value, caddr_t calldata) + areawin->selects; scolor++) { ecolor = &(SELTOCOLOR(scolor)); - *ecolor = cval; + *ecolor = cindex; selected = True; } } - setcolormark(cval); + setcolormark(cindex); if (!selected) { if (eventmode != TEXT_MODE && eventmode != ETEXT_MODE) - areawin->color = cval; + areawin->color = cindex; overdrawpixmap(w); } } @@ -1616,10 +1612,10 @@ void setnewcolor(xcWidget w, caddr_t nullptr) } ccolor = rgb_alloccolor(red, green, blue); } - else + else { ccolor = xc_alloccolor(_STR2); - - addnewcolorentry(ccolor); + addnewcolorentry(ccolor); + } } /*----------------------------------------------------------------*/ @@ -1661,23 +1657,23 @@ void setfontmarks(short fvalue, short jvalue) togglefontmark(fvalue); } if (jvalue >= 0) { - switch(jvalue & (RLJUSTFIELD)) { - case NORMAL: w = JustificationLeftJustifiedButton; break; - case NOTLEFT: w = JustificationCenterJustifiedButton; break; - case RIGHT|NOTLEFT: w = JustificationRightJustifiedButton; break; + switch(jvalue & (RLANCHORFIELD)) { + case NORMAL: w = AnchoringLeftAnchoredButton; break; + case NOTLEFT: w = AnchoringCenterAnchoredButton; break; + case RIGHT|NOTLEFT: w = AnchoringRightAnchoredButton; break; } - toggleexcl(w, Justifs, XtNumber(Justifs)); + toggleexcl(w, Anchors, XtNumber(Anchors)); - switch(jvalue & (TBJUSTFIELD)) { - case NORMAL: w = JustificationBottomJustifiedButton; break; - case NOTBOTTOM: w = JustificationMiddleJustifiedButton; break; - case TOP|NOTBOTTOM: w = JustificationTopJustifiedButton; break; + switch(jvalue & (TBANCHORFIELD)) { + case NORMAL: w = AnchoringBottomAnchoredButton; break; + case NOTBOTTOM: w = AnchoringMiddleAnchoredButton; break; + case TOP|NOTBOTTOM: w = AnchoringTopAnchoredButton; break; } - toggleexcl(w, Justifs, XtNumber(Justifs)); + toggleexcl(w, Anchors, XtNumber(Anchors)); /* Flip Invariance property */ - w = JustificationFlipInvariantButton; + w = AnchoringFlipInvariantButton; if (jvalue & FLIPINV) XtSetArg(wargs[0], XtNsetMark, True); else diff --git a/xtgui.c b/xtgui.c index 5dc8ab7..d1c2eb1 100644 --- a/xtgui.c +++ b/xtgui.c @@ -41,6 +41,9 @@ #include "Xw/Toggle.h" #endif +#ifdef HAVE_CAIRO +#include +#endif /*----------------------------------------------------------------------*/ /* Local includes */ /*----------------------------------------------------------------------*/ @@ -85,7 +88,6 @@ extern Cursor appcursors[NUM_CURSORS]; extern ApplicationData appdata; extern XCWindowData *areawin; extern Globaldata xobjs; -extern int *appcolors; extern int number_colors; extern colorindex *colorlist; extern short menusize; @@ -104,10 +106,7 @@ extern Pixmap helppix; extern aliasptr aliastop; extern float version; -#ifndef OPENGL -static -#endif -char STIPDATA[STIPPLES][4] = { +static char STIPDATA[STIPPLES][4] = { "\000\004\000\001", "\000\005\000\012", "\001\012\005\010", @@ -118,9 +117,7 @@ char STIPDATA[STIPPLES][4] = { "\000\000\000\000" }; -#ifdef DOUBLEBUFFER extern Pixmap dbuf; -#endif /* Bad hack for problems with the DECstation. . . don't know why */ #ifdef UniqueContextProblem @@ -244,7 +241,7 @@ int addnewcolorentry(int ccolor) /* check to see if entry is already in the color list */ - for (i = 0; i < number_colors; i++) + for (i = NUMBER_OF_COLORS; i < number_colors; i++) if (colorlist[i].color.pixel == ccolor) break; /* make new entry in the menu */ @@ -542,7 +539,7 @@ void createmenus (xcWidget form, xcWidget *firstbutton, xcWidget *lastbutton) /* Check for conditions to approve program exit */ /*----------------------------------------------*/ -void quitcheck(xcWidget w, caddr_t clientdata, caddr_t calldata) +int quitcheck(xcWidget w, caddr_t clientdata, caddr_t calldata) { char *promptstr; Boolean doprompt = False; @@ -567,10 +564,12 @@ void quitcheck(xcWidget w, caddr_t clientdata, caddr_t calldata) savebutton = getgeneric(w, quitcheck, NULL); popupprompt(w, promptstr, NULL, quit, savebutton, NULL); free(promptstr); + return 0; } else { free(promptstr); quit(areawin->area, NULL); + return 1; } } @@ -1105,7 +1104,7 @@ void outputpopup(xcWidget button, caddr_t clientdata, caddr_t calldata) XtnSetArg(XtNstring, request); XtnSetArg(XtNborderWidth, 0); XtnSetArg(XtNgravity, WestGravity); - XtnSetArg(XtNbackground, BARCOLOR); + XtnSetArg(XtNbackground, colorlist[BARCOLOR].color.pixel); XtnSetArg(XtNfont, appdata.xcfont); titlearea = XtCreateManagedWidget("title", XwstaticTextWidgetClass, dialog, wargs, n); n = 0; @@ -1657,9 +1656,8 @@ XCWindowData *GUI_init(int argc, char *argv[]) /* Allocate space for the basic color map */ /*----------------------------------------*/ - number_colors = 0; - colorlist = (colorindex *)malloc(sizeof(colorindex)); - appcolors = (int *) malloc(NUMBER_OF_COLORS * sizeof(int)); + number_colors = NUMBER_OF_COLORS; + colorlist = (colorindex *)malloc(NUMBER_OF_COLORS * sizeof(colorindex)); /*-----------------------------------------------------------*/ /* Xw must add these translations for the popup manager */ @@ -1983,6 +1981,11 @@ XCWindowData *GUI_init(int argc, char *argv[]) newwin->gc = XCreateGC(dpy, newwin->window, GCForeground | GCBackground | GCFont, &values); +#ifdef HAVE_CAIRO + newwin->surface = cairo_xlib_surface_create(dpy, newwin->window, + DefaultVisual(dpy, 0), newwin->width, newwin->height); + newwin->cr = cairo_create(newwin->surface); +#else newwin->clipmask = XCreatePixmap(dpy, newwin->window, newwin->width, newwin->height, 1); @@ -1990,6 +1993,7 @@ XCWindowData *GUI_init(int argc, char *argv[]) values.background = 0; newwin->cmgc = XCreateGC(dpy, newwin->clipmask, GCForeground | GCBackground, &values); +#endif /* HAVE_CAIRO */ return newwin; } -- cgit v1.2.3