[Pkg-electronics-commits] [gtkwave] 01/03: Imported Upstream version 3.3.50

أحمد المحمودي (Ahmed El-Mahmoudy) aelmahmoudy at sabily.org
Thu Oct 24 07:04:59 UTC 2013


This is an automated email from the git hooks/post-receive script.

aelmahmoudy-guest pushed a commit to branch master
in repository gtkwave.

commit da3f720c7454d21ae284f0879a7be9dcc960cf09
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at sabily.org>
Date:   Thu Oct 24 08:27:03 2013 +0200

    Imported Upstream version 3.3.50
---
 ChangeLog                                          |   21 ++
 LICENSE.TXT                                        |    2 +-
 configure                                          |   20 +-
 configure.ac                                       |    2 +-
 contrib/bundle_for_osx/Info-gtkwave.plist          |    6 +-
 contrib/bundle_for_osx/gtkwave.bundle              |    5 +
 contrib/bundle_for_osx/gtkwave_bin_launcher.sh     |  215 +++++++++++++++++
 contrib/fst_jni/Makefile.am                        |    5 +-
 contrib/fst_jni/Makefile.in                        |    5 +-
 contrib/fst_jni/fstAPI.c                           |   14 ++
 contrib/fst_jni/fstAPI.h                           |   16 ++
 contrib/fst_jni/fstAPI.java                        |    2 +
 ...stSupplimentalVarType.java => fstFileType.java} |   19 +-
 contrib/fst_jni/fstReader.java                     |    1 +
 contrib/fst_jni/fstScopeType.java                  |    5 +-
 ...lDataType.java => fstSupplementalDataType.java} |    4 +-
 ...talVarType.java => fstSupplementalVarType.java} |    4 +-
 contrib/fst_jni/fstWriter.java                     |    1 +
 contrib/fst_jni/zzz_test.csh                       |    5 +-
 doc/gtkwave.odt                                    |  Bin 1380009 -> 1390832 bytes
 src/analyzer.h                                     |   19 +-
 src/baseconvert.c                                  |  108 +++++----
 src/bsearch.c                                      |   14 +-
 src/fgetdynamic.c                                  |   21 +-
 src/fst.c                                          |  117 ++++++++--
 src/globals.c                                      |   20 +-
 src/globals.h                                      |    8 +
 src/helpers/fst/fstapi.c                           |  244 ++++++++++++++++++--
 src/helpers/fst/fstapi.h                           |  224 +++++++++---------
 src/helpers/vcd2fst.c                              |   31 ++-
 src/menu.c                                         |   85 ++++++-
 src/menu.h                                         |    5 +-
 src/mouseover.c                                    |    4 +-
 src/tree.c                                         |    9 +-
 src/tree.h                                         |    1 +
 src/treesearch_gtk2.c                              |   34 ++-
 src/wavewindow.c                                   |   75 ++++--
 37 files changed, 1080 insertions(+), 291 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b9146b4..c8368cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1349,3 +1349,24 @@
 		gtkwave can process these types (e.g., signal + std_ulogic), 
 		but there are currently no simulators supporting them.  These
 		are written by using fstWriterCreateVar2().
+3.3.50	15oct13	Limit number of rows that can be displayed in mouseover in
+		order to prevent potential X11 crashes on extremely wide
+		signals.
+		Added "/File/Grab To File" PNG image grab menu option.
+		Added missing $dumpvars emission in fst2vcd.
+		Added missing atto and zepto time prefix parsing in vcd2fst.
+		Added VHDL package type to FST.
+		Added red box around 'U' vector values for VHDL similar to 
+		'X' for Verilog.
+		Used FST "attribute name" for variable types if specified.
+		CRLF fix for save file reading on LF-only systems.
+		Fix Valgrind hit in fst.c that was causing crashes on OSX.
+		Added fstWriterSetFiletype() and fstReaderGetFiletype()
+		to provide sim language hint to gtkwave for language-
+		appropriate formatting of various data.
+		Added fstWriterSetSourceStem() so writers can embed source
+		stems in the FST file.  Specify before the appropriate
+		hierarchy or variable declaration.
+		Added gtkwave_bin_launcher.sh script to set up environment
+		variables on OSX for running the bin/ directory files from
+		a terminal rather than as an app invocation.
diff --git a/LICENSE.TXT b/LICENSE.TXT
index 47ebc7e..b598654 100644
--- a/LICENSE.TXT
+++ b/LICENSE.TXT
@@ -1,6 +1,6 @@
 ##########################################################################
 
-GTKWave 3.3.48 Wave Viewer is Copyright (C) 1999-2013 Tony Bybell.  
+GTKWave 3.3.50 Wave Viewer is Copyright (C) 1999-2013 Tony Bybell.  
 Portions of GTKWave are Copyright (C) 1999-2013 Udi Finkelstein. 
 Context support is Copyright (C) 2007-2013 Kermin Elliott Fleming.
 Trace group support is  Copyright (C) 2009-2013 Donald Baltus.
diff --git a/configure b/configure
index e3d5fc0..c0a35aa 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gtkwave 3.3.49.
+# Generated by GNU Autoconf 2.69 for gtkwave 3.3.50.
 #
 # Report bugs to <bybell at rocketmail.com>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='gtkwave'
 PACKAGE_TARNAME='gtkwave'
-PACKAGE_VERSION='3.3.49'
-PACKAGE_STRING='gtkwave 3.3.49'
+PACKAGE_VERSION='3.3.50'
+PACKAGE_STRING='gtkwave 3.3.50'
 PACKAGE_BUGREPORT='bybell at rocketmail.com'
 PACKAGE_URL=''
 
@@ -1380,7 +1380,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gtkwave 3.3.49 to adapt to many kinds of systems.
+\`configure' configures gtkwave 3.3.50 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1446,7 +1446,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gtkwave 3.3.49:";;
+     short | recursive ) echo "Configuration of gtkwave 3.3.50:";;
    esac
   cat <<\_ACEOF
 
@@ -1592,7 +1592,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gtkwave configure 3.3.49
+gtkwave configure 3.3.50
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2236,7 +2236,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gtkwave $as_me 3.3.49, which was
+It was created by gtkwave $as_me 3.3.50, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3103,7 +3103,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='gtkwave'
- VERSION='3.3.49'
+ VERSION='3.3.50'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -10873,7 +10873,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by gtkwave $as_me 3.3.49, which was
+This file was extended by gtkwave $as_me 3.3.50, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10939,7 +10939,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-gtkwave config.status 3.3.49
+gtkwave config.status 3.3.50
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 630e749..c52414f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(gtkwave, 3.3.49, bybell at rocketmail.com)
+AC_INIT(gtkwave, 3.3.50, bybell at rocketmail.com)
 AC_CONFIG_SRCDIR([src/vcd.c])
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADER([config.h])
diff --git a/contrib/bundle_for_osx/Info-gtkwave.plist b/contrib/bundle_for_osx/Info-gtkwave.plist
index 9cb48c0..b89797f 100644
--- a/contrib/bundle_for_osx/Info-gtkwave.plist
+++ b/contrib/bundle_for_osx/Info-gtkwave.plist
@@ -8,7 +8,7 @@
     <key>CFBundleExecutable</key>
     <string>gtkwave</string>
     <key>CFBundleGetInfoString</key>
-    <string>3.3.49, (C) 1999-2013 Tony Bybell http://gtkwave.sourceforge.net</string>
+    <string>3.3.50, (C) 1999-2013 Tony Bybell http://gtkwave.sourceforge.net</string>
     <key>CFBundleIconFile</key>
     <string>gtkwave.icns</string>
     <key>CFBundleIdentifier</key>
@@ -18,11 +18,11 @@
     <key>CFBundlePackageType</key>
     <string>APPL</string>
     <key>CFBundleShortVersionString</key>
-    <string>3.3.49</string>
+    <string>3.3.50</string>
     <key>CFBundleSignature</key>
     <string>????</string>
     <key>CFBundleVersion</key>
-    <string>3.3.49</string>
+    <string>3.3.50</string>
     <key>NSHumanReadableCopyright</key>
     <string>Copyright 1999 - 2013 Tony Bybell, GNU General Public License.</string>
     <key>LSMinimumSystemVersion</key>
diff --git a/contrib/bundle_for_osx/gtkwave.bundle b/contrib/bundle_for_osx/gtkwave.bundle
index cc2f04a..9ade42d 100644
--- a/contrib/bundle_for_osx/gtkwave.bundle
+++ b/contrib/bundle_for_osx/gtkwave.bundle
@@ -69,6 +69,11 @@
   <binary>${prefix}/bin/rtlbrowse</binary>
   <binary>${prefix}/bin/vermin</binary>
 
+  <data dest="${bundle}/Contents/Resources/bin/gtkwave_bin_launcher.sh">
+    ${project}/gtkwave_bin_launcher.sh
+  </data>
+
+
   <!-- Copy in GTK+ modules.  Note the ${gtkdir} macro, which expands
        to the correct library subdirectory for the specified gtk
        version.
diff --git a/contrib/bundle_for_osx/gtkwave_bin_launcher.sh b/contrib/bundle_for_osx/gtkwave_bin_launcher.sh
new file mode 100755
index 0000000..bd92d72
--- /dev/null
+++ b/contrib/bundle_for_osx/gtkwave_bin_launcher.sh
@@ -0,0 +1,215 @@
+#!/bin/sh
+
+#
+# Use this to launch executables from the bundle 
+# on the command line.  Example:
+#
+# gtkwave_bin_launcher.sh vcd2fst -o test.fst test.vcd
+#
+# gtkwave_bin_launcher.sh only needs to be in your path,
+# for the gtkwave bin/ executables, use the name found
+# in bin/ only, no absolute or relative path prefixes!
+#
+# dash arguments might need to be specified first
+# as above for some executables as GNU getargs is 
+# not used for OSX.  do not assume full dash
+# argument names are available as in Linux!
+#
+
+if test "x$IGE_DEBUG_LAUNCHER" != x; then
+    set -x
+fi
+
+if test "x$IGE_DEBUG_GDB" != x; then
+    EXEC="gdb --args"
+else
+    EXEC=exec
+fi
+
+export OWD="`pwd`"
+
+if [[ $(echo $0 | awk '/^\//') == $0 ]]; then
+    export NNAM=$(dirname $0)
+    name="$NNAM"
+    bundle="$NNAM/../../.."
+else
+    cd -P -- "$(dirname -- "$0")"
+    export NNAM="$(pwd -P)/$(basename -- "$0")"
+    name="$NNAM"
+    tmp="$NNAM"
+    bundle=`dirname "$tmp"`/../../..
+    cd $OWD
+fi
+
+
+bundle_contents="$bundle"/Contents
+bundle_res="$bundle_contents"/Resources
+bundle_lib="$bundle_res"/lib
+bundle_bin="$bundle_res"/bin
+bundle_data="$bundle_res"/share
+bundle_etc="$bundle_res"/etc
+
+export DYLD_LIBRARY_PATH="$bundle_lib"
+export XDG_CONFIG_DIRS="$bundle_etc"/xdg
+export XDG_DATA_DIRS="$bundle_data"
+export GTK_DATA_PREFIX="$bundle_res"
+export GTK_EXE_PREFIX="$bundle_res"
+export GTK_PATH="$bundle_res"
+
+export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
+export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
+export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
+export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
+
+APP=name
+I18NDIR="$bundle_data/locale"
+# Set the locale-related variables appropriately:
+unset LANG LC_MESSAGES LC_MONETARY LC_COLLATE
+
+# Has a language ordering been set?
+# If so, set LC_MESSAGES and LANG accordingly; otherwise skip it.
+# First step uses sed to clean off the quotes and commas, to change - to _, and change the names for the chinese scripts from "Hans" to CN and "Hant" to TW.
+APPLELANGUAGES=`defaults read .GlobalPreferences AppleLanguages | sed -En   -e 's/\-/_/' -e 's/Hant/TW/' -e 's/Hans/CN/' -e 's/[[:space:]]*\"?([[:alnum:]_]+)\"?,?/\1/p' `
+if test "$APPLELANGUAGES"; then
+    # A language ordering exists.
+    # Test, item per item, to see whether there is an corresponding locale.
+    for L in $APPLELANGUAGES; do
+	#test for exact matches:
+       if test -f "$I18NDIR/${L}/LC_MESSAGES/$APP.mo"; then
+	    export LANG=$L
+            break
+        fi
+	#This is a special case, because often the original strings are in US
+	#English and there is no translation file.
+	if test "x$L" == "xen_US"; then
+	    export LANG=$L
+	    break
+	fi
+	#OK, now test for just the first two letters:
+        if test -f "$I18NDIR/${L:0:2}/LC_MESSAGES/$APP.mo"; then
+	    export LANG=${L:0:2}
+	    break
+	fi
+	#Same thing, but checking for any english variant.
+	if test "x${L:0:2}" == "xen"; then
+	    export LANG=$L
+	    break
+	fi;
+    done  
+fi
+unset APPLELANGUAGES L
+
+## If we didn't get a language from the language list, try the Collation preference, in case it's the only setting that exists.
+#APPLECOLLATION=`defaults read .GlobalPreferences AppleCollationOrder`
+#if test -z ${LANG} -a -n $APPLECOLLATION; then
+#    if test -f "$I18NDIR/${APPLECOLLATION:0:2}/LC_MESSAGES/$APP.mo"; then
+#	export LANG=${APPLECOLLATION:0:2}
+#    fi
+#fi
+#if test ! -z $APPLECOLLATION; then
+#    export LC_COLLATE=$APPLECOLLATION
+#fi
+#unset APPLECOLLATION
+
+# Continue by attempting to find the Locale preference.
+APPLELOCALE=`defaults read .GlobalPreferences AppleLocale`
+
+if test -f "$I18NDIR/${APPLELOCALE:0:5}/LC_MESSAGES/$APP.mo"; then
+    if test -z $LANG; then 
+        export LANG="${APPLELOCALE:0:5}"
+    fi
+
+elif test -z $LANG -a -f "$I18NDIR/${APPLELOCALE:0:2}/LC_MESSAGES/$APP.mo"; then
+    export LANG="${APPLELOCALE:0:2}"
+fi
+
+#Next we need to set LC_MESSAGES. If at all possilbe, we want a full
+#5-character locale to avoid the "Locale not supported by C library"
+#warning from Gtk -- even though Gtk will translate with a
+#two-character code.
+if test -n $LANG; then 
+#If the language code matches the applelocale, then that's the message
+#locale; otherwise, if it's longer than two characters, then it's
+#probably a good message locale and we'll go with it.
+
+#    if test $LANG == ${APPLELOCALE:0:5} -o $LANG != ${LANG:0:2}; then
+#	export LC_MESSAGES=$LANG
+
+#Next try if the Applelocale is longer than 2 chars and the language
+#bit matches $LANG
+
+#    elif test $LANG == ${APPLELOCALE:0:2} -a $APPLELOCALE > ${APPLELOCALE:0:2}; then
+#	export LC_MESSAGES=${APPLELOCALE:0:5}
+
+#Fail. Get a list of the locales in $PREFIX/share/locale that match
+#our two letter language code and pick the first one, special casing
+#english to set en_US
+
+#   elif test $LANG == "en"; then
+    if test $LANG == "en"; then
+	export LC_MESSAGES="en_US"
+    else
+	LOC=`find $PREFIX/share/locale -name $LANG???`
+	for L in $LOC; do 
+	    export LC_MESSAGES=$L
+	done
+    fi
+else
+#All efforts have failed, so default to US english
+    export LANG="en_US"
+    export LC_MESSAGES="en_US"
+fi
+CURRENCY=`echo $APPLELOCALE |  sed -En 's/.*currency=([[:alpha:]]+).*/\1/p'`
+if test "x$CURRENCY" != "x"; then 
+#The user has set a special currency. Gtk doesn't install LC_MONETARY files, but Apple does in /usr/share/locale, so we're going to look there for a locale to set LC_CURRENCY to.
+    if test -f /usr/local/share/$LC_MESSAGES/LC_MONETARY; then
+	if test -a `cat /usr/local/share/$LC_MESSAGES/LC_MONETARY` == $CURRENCY; then
+	    export LC_MONETARY=$LC_MESSAGES
+	fi
+    fi
+    if test -z "$LC_MONETARY"; then 
+	FILES=`find /usr/share/locale -name LC_MONETARY -exec grep -H $CURRENCY {} \;`
+	if test -n "$FILES"; then 
+	    export LC_MONETARY=`echo $FILES | sed -En 's%/usr/share/locale/([[:alpha:]_]+)/LC_MONETARY.*%\1%p'`
+	fi
+    fi
+fi
+
+#No currency value means that the AppleLocale governs:
+if test -z "$LC_MONETARY"; then
+    LC_MONETARY=${APPLELOCALE:0:5}
+fi
+#For Gtk, which only looks at LC_ALL:
+export LC_ALL=$LC_MESSAGES
+
+unset APPLELOCALE FILES LOC
+
+if test -f "$bundle_lib/charset.alias"; then
+    export CHARSETALIASDIR="$bundle_lib"
+fi
+
+# Extra arguments can be added in environment.sh.
+EXTRA_ARGS=
+if test -f "$bundle_res/environment.sh"; then
+  source "$bundle_res/environment.sh"
+fi
+
+# Strip out the argument added by the OS.
+if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then
+    shift 1
+fi
+
+# export DLYD_INSERT_LIBRARIES=/usr/lib/libMallocDebug.A.dylib
+# export MallocScribble=YES
+# export MallocPreScribble=YES
+# export MallocGuardEdges=YES
+# export MallocStackLogging=YES
+# export MallocStackLoggingNoCompact=YES
+# export NSZombieEnabled=YES
+# export MallocErrorAbort=YES
+# export MallocCheckHeapEach=100
+# export MallocCheckHeapStart=100
+
+export EX_NAME="$1"
+shift
+$EXEC "$bundle_contents/Resources/bin/$EX_NAME" $* $EXTRA_ARGS
diff --git a/contrib/fst_jni/Makefile.am b/contrib/fst_jni/Makefile.am
index bc384c5..45a3553 100644
--- a/contrib/fst_jni/Makefile.am
+++ b/contrib/fst_jni/Makefile.am
@@ -9,14 +9,15 @@ EXTRA_DIST= \
 	fstArrayType.java \
 	fstAttrType.java \
 	fstEnumValueType.java \
+	fstFileType.java \
 	fstHier.java \
 	fstHierType.java \
 	fstMiscType.java \
 	fstPackType.java \
 	fstReader.java \
 	fstScopeType.java \
-	fstSupplimentalDataType.java \
-	fstSupplimentalVarType.java \
+	fstSupplementalDataType.java \
+	fstSupplementalVarType.java \
 	fstVarDir.java \
 	fstVarType.java \
 	fstWriter.java \
diff --git a/contrib/fst_jni/Makefile.in b/contrib/fst_jni/Makefile.in
index 233a83a..e1b5926 100644
--- a/contrib/fst_jni/Makefile.in
+++ b/contrib/fst_jni/Makefile.in
@@ -231,14 +231,15 @@ EXTRA_DIST = \
 	fstArrayType.java \
 	fstAttrType.java \
 	fstEnumValueType.java \
+	fstFileType.java \
 	fstHier.java \
 	fstHierType.java \
 	fstMiscType.java \
 	fstPackType.java \
 	fstReader.java \
 	fstScopeType.java \
-	fstSupplimentalDataType.java \
-	fstSupplimentalVarType.java \
+	fstSupplementalDataType.java \
+	fstSupplementalVarType.java \
 	fstVarDir.java \
 	fstVarType.java \
 	fstWriter.java \
diff --git a/contrib/fst_jni/fstAPI.c b/contrib/fst_jni/fstAPI.c
index 0c0c8b6..e745570 100644
--- a/contrib/fst_jni/fstAPI.c
+++ b/contrib/fst_jni/fstAPI.c
@@ -73,6 +73,13 @@ fstWriterSetPackType((void *)(long)ctx, (int)typ);
 }
 
 
+JNIEXPORT void JNICALL Java_fstAPI_fstWriterSetFileType
+  (JNIEnv *env, jobject obj, jlong ctx, jint typ)
+{
+fstWriterSetFileType((void *)(long)ctx, (int)typ);
+}
+
+
 JNIEXPORT void JNICALL Java_fstAPI_fstWriterSetRepackOnClose
   (JNIEnv *env, jobject obj, jlong ctx, jboolean enable)
 {
@@ -317,6 +324,13 @@ return((jint)fstReaderGetCurrentScopeLen((void *)(long)ctx));
 }
 
 
+JNIEXPORT jint JNICALL Java_fstAPI_fstReaderGetFileType
+  (JNIEnv *env, jobject obj, jlong ctx)
+{
+return((jint)fstReaderGetFileType((void *)(long)ctx));
+}
+
+
 JNIEXPORT jlong JNICALL Java_fstAPI_fstReaderGetTimezero
   (JNIEnv *env, jobject obj, jlong ctx)
 {
diff --git a/contrib/fst_jni/fstAPI.h b/contrib/fst_jni/fstAPI.h
index d02d4db..485fb9c 100644
--- a/contrib/fst_jni/fstAPI.h
+++ b/contrib/fst_jni/fstAPI.h
@@ -73,6 +73,14 @@ JNIEXPORT void JNICALL Java_fstAPI_fstWriterSetPackType
 
 /*
  * Class:     fstAPI
+ * Method:    fstWriterSetFileType
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_fstAPI_fstWriterSetFileType
+  (JNIEnv *, jobject, jlong, jint);
+
+/*
+ * Class:     fstAPI
  * Method:    fstWriterSetRepackOnClose
  * Signature: (JZ)V
  */
@@ -273,6 +281,14 @@ JNIEXPORT jint JNICALL Java_fstAPI_fstReaderGetCurrentScopeLen
 
 /*
  * Class:     fstAPI
+ * Method:    fstReaderGetFileType
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_fstAPI_fstReaderGetFileType
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     fstAPI
  * Method:    fstReaderGetTimezero
  * Signature: (J)J
  */
diff --git a/contrib/fst_jni/fstAPI.java b/contrib/fst_jni/fstAPI.java
index 9127d65..0b13020 100644
--- a/contrib/fst_jni/fstAPI.java
+++ b/contrib/fst_jni/fstAPI.java
@@ -48,6 +48,7 @@ protected native void fstWriterFlushContext(long ctx);
 protected native void fstWriterSetUpscope(long ctx);
 protected native void fstWriterSetAttrEnd(long ctx);
 protected native void fstWriterSetPackType(long ctx, int typ);
+protected native void fstWriterSetFileType(long ctx, int typ);
 protected native void fstWriterSetRepackOnClose(long ctx, boolean enable);
 protected native void fstWriterSetParallelMode(long ctx, boolean enable);
 protected native void fstWriterSetTimescale(long ctx, int ts);
@@ -76,6 +77,7 @@ protected native void fstReaderClose(long ctx);
 protected native boolean fstReaderIterateHierRewind(long ctx);
 protected native void fstReaderResetScope(long ctx);
 protected native int fstReaderGetCurrentScopeLen(long ctx);
+protected native int fstReaderGetFileType(long ctx);
 protected native long fstReaderGetTimezero(long ctx);
 protected native long fstReaderGetStartTime(long ctx);
 protected native long fstReaderGetEndTime(long ctx);
diff --git a/contrib/fst_jni/fstSupplimentalVarType.java b/contrib/fst_jni/fstFileType.java
similarity index 71%
copy from contrib/fst_jni/fstSupplimentalVarType.java
copy to contrib/fst_jni/fstFileType.java
index e515def..2dfa8b9 100644
--- a/contrib/fst_jni/fstSupplimentalVarType.java
+++ b/contrib/fst_jni/fstFileType.java
@@ -20,20 +20,15 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-public class fstSupplimentalVarType
+public class fstFileType
 {
-fstSupplimentalVarType( ) { }
+private fstFileType( ) { }
 
-public static final int FST_SVT_MIN = 0;
+public static final int FST_FT_MIN = 0;
 
-public static final int FST_SVT_NONE = 0;
+public static final int FST_FT_VERILOG = 0;
+public static final int FST_FT_VHDL = 1;
+public static final int FST_FT_VERILOG_VHDL = 2;
 
-public static final int FST_SVT_VHDL_SIGNAL = 1;
-public static final int FST_SVT_VHDL_VARIABLE = 2;
-public static final int FST_SVT_VHDL_CONSTANT = 3;
-public static final int FST_SVT_VHDL_FILE = 4;
-public static final int FST_SVT_VHDL_MEMORY = 5;
-
-public static final int FST_SVT_MAX = 5;
+public static final int FST_FT_MAX = 2;
 };
-
diff --git a/contrib/fst_jni/fstReader.java b/contrib/fst_jni/fstReader.java
index 2cc18d2..1c284d2 100644
--- a/contrib/fst_jni/fstReader.java
+++ b/contrib/fst_jni/fstReader.java
@@ -46,6 +46,7 @@ public void 	fstReaderClrFacProcessMask(int facidx) { fstReaderClrFacProcessMask
 public long 	fstReaderGetAliasCount() { return(fstReaderGetAliasCount(ctx)); }
 public String 	fstReaderGetCurrentFlatScope() { return(fstReaderGetCurrentFlatScope(ctx)); }
 public int 	fstReaderGetCurrentScopeLen() { return(fstReaderGetCurrentScopeLen(ctx)); }
+public int 	fstReaderGetFileType() { return(fstReaderGetFileType(ctx)); }
 public String 	fstReaderGetCurrentScopeUserInfo() { return(fstReaderGetCurrentScopeUserInfo(ctx)); }
 public String 	fstReaderGetDateString() { return(fstReaderGetDateString(ctx)); }
 public long 	fstReaderGetDumpActivityChangeTime(int idx) { return(fstReaderGetDumpActivityChangeTime(ctx, idx)); }
diff --git a/contrib/fst_jni/fstScopeType.java b/contrib/fst_jni/fstScopeType.java
index 38cd781..c70acff 100644
--- a/contrib/fst_jni/fstScopeType.java
+++ b/contrib/fst_jni/fstScopeType.java
@@ -30,7 +30,7 @@ public static final String [] FST_ST_NAMESTRINGS =
 		"package", "program",
 
 		"vhdl_architecture", "vhdl_procedure", "vhdl_function", "vhdl_record", "vhdl_process", 
-		"vhdl_block", "vhdl_for_generate", "vhdl_if_generate", "vhdl_generate"
+		"vhdl_block", "vhdl_for_generate", "vhdl_if_generate", "vhdl_generate", "vhdl_package"
 	};
 
 public static final int FST_ST_MIN = 0;
@@ -57,8 +57,9 @@ public static final int FST_ST_VHDL_BLOCK = 17;
 public static final int FST_ST_VHDL_FOR_GENERATE = 18;
 public static final int FST_ST_VHDL_IF_GENERATE = 19;
 public static final int FST_ST_VHDL_GENERATE = 20;
+public static final int FST_ST_VHDL_PACKAGE = 21;
 
-public static final int FST_ST_MAX = 20;
+public static final int FST_ST_MAX = 21;
 
 public static final int FST_ST_GEN_ATTRBEGIN = 252;
 public static final int FST_ST_GEN_ATTREND = 253;
diff --git a/contrib/fst_jni/fstSupplimentalDataType.java b/contrib/fst_jni/fstSupplementalDataType.java
similarity index 97%
rename from contrib/fst_jni/fstSupplimentalDataType.java
rename to contrib/fst_jni/fstSupplementalDataType.java
index 9b9499c..78bb3f3 100644
--- a/contrib/fst_jni/fstSupplimentalDataType.java
+++ b/contrib/fst_jni/fstSupplementalDataType.java
@@ -20,9 +20,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-public class fstSupplimentalDataType
+public class fstSupplementalDataType
 {
-fstSupplimentalDataType( ) { }
+fstSupplementalDataType( ) { }
 
 public static final int FST_SDT_MIN                    = 0;
 
diff --git a/contrib/fst_jni/fstSupplimentalVarType.java b/contrib/fst_jni/fstSupplementalVarType.java
similarity index 95%
rename from contrib/fst_jni/fstSupplimentalVarType.java
rename to contrib/fst_jni/fstSupplementalVarType.java
index e515def..c25f1ed 100644
--- a/contrib/fst_jni/fstSupplimentalVarType.java
+++ b/contrib/fst_jni/fstSupplementalVarType.java
@@ -20,9 +20,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-public class fstSupplimentalVarType
+public class fstSupplementalVarType
 {
-fstSupplimentalVarType( ) { }
+fstSupplementalVarType( ) { }
 
 public static final int FST_SVT_MIN = 0;
 
diff --git a/contrib/fst_jni/fstWriter.java b/contrib/fst_jni/fstWriter.java
index 43977ee..7381686 100644
--- a/contrib/fst_jni/fstWriter.java
+++ b/contrib/fst_jni/fstWriter.java
@@ -57,6 +57,7 @@ public void 	fstWriterSetComment(String comm) { fstWriterSetComment(ctx, comm);
 public void 	fstWriterSetDate(String dat) { fstWriterSetDate(ctx, dat); }
 public void 	fstWriterSetDumpSizeLimit(long numbytes) { fstWriterSetDumpSizeLimit(ctx, numbytes); }
 public void 	fstWriterSetEnvVar(String envvar) { fstWriterSetEnvVar(ctx, envvar); }
+public void     fstWriterSetFileType(int typ) { fstWriterSetFileType(ctx, typ); }
 public void 	fstWriterSetPackType(int typ) { fstWriterSetPackType(ctx, typ); }
 public void 	fstWriterSetParallelMode(boolean enable) { fstWriterSetParallelMode(ctx, enable); }
 public void 	fstWriterSetRepackOnClose(boolean enable) { fstWriterSetRepackOnClose(ctx, enable); }
diff --git a/contrib/fst_jni/zzz_test.csh b/contrib/fst_jni/zzz_test.csh
index 89f4406..ef0f8e2 100755
--- a/contrib/fst_jni/zzz_test.csh
+++ b/contrib/fst_jni/zzz_test.csh
@@ -6,13 +6,14 @@ javac \
 	fstArrayType.java \
 	fstAttrType.java \
 	fstEnumValueType.java \
+	fstFileType.java \
 	fstHier.java \
 	fstHierType.java \
 	fstMiscType.java \
 	fstPackType.java \
 	fstScopeType.java \
-	fstSupplimentalDataType.java \
-	fstSupplimentalVarType.java \
+	fstSupplementalDataType.java \
+	fstSupplementalVarType.java \
 	fstVarDir.java \
 	fstVarType.java \
 	fstWriter.java \
diff --git a/doc/gtkwave.odt b/doc/gtkwave.odt
index dba34f5..80ce565 100644
Binary files a/doc/gtkwave.odt and b/doc/gtkwave.odt differ
diff --git a/src/analyzer.h b/src/analyzer.h
index 325f5e4..3bd400c 100644
--- a/src/analyzer.h
+++ b/src/analyzer.h
@@ -22,6 +22,15 @@
 #define WAVE_ARRAY_SUPPORT
 #endif
 
+
+/* struct Node bitfield widths */
+#define WAVE_VARXT_WIDTH (16)
+#define WAVE_VARXT_MAX_ID ((1 << WAVE_VARXT_WIDTH) - 1)
+#define WAVE_VARDT_WIDTH (6)
+#define WAVE_VARDIR_WIDTH (3)
+#define WAVE_VARTYPE_WIDTH (6)
+
+
 typedef struct _SearchProgressData {
     GtkWidget *window;
     GtkWidget *pbar;
@@ -187,14 +196,15 @@ struct Node
     unsigned int array_height, this_row;
 #endif
 
-    unsigned vardt   : 6; /* see nodeVarDataType, this is an internal value */
-
-    unsigned vardir  : 3; /* see nodeVarDir, this is an internal value (currently used only by extload and FST) */
-    unsigned vartype : 6; /* see nodeVarType, this is an internal value */
+    unsigned varxt   : WAVE_VARXT_WIDTH; /* reference inside subvar_pnt[] */
+    unsigned vardt   : WAVE_VARDT_WIDTH; /* see nodeVarDataType, this is an internal value */
+    unsigned vardir  : WAVE_VARDIR_WIDTH; /* see nodeVarDir, this is an internal value (currently used only by extload and FST) */
+    unsigned vartype : WAVE_VARTYPE_WIDTH; /* see nodeVarType, this is an internal value */
 
     unsigned extvals : 1; /* was formerly a pointer to ExtNode "ext", now simply a flag */
   };
 
+
 #ifdef WAVE_USE_STRUCT_PACKING
 #pragma pack(pop)
 #endif
@@ -295,6 +305,7 @@ enum nodeVarType {
 };
 
 
+#define WAVE_NODEVARDATATYPE_STR \
 static const char *vardatatype_strings[] = { \
     "", \
     "boolean", \
diff --git a/src/baseconvert.c b/src/baseconvert.c
index 2ea65be..9edbf72 100644
--- a/src/baseconvert.c
+++ b/src/baseconvert.c
@@ -709,64 +709,78 @@ return(rv);
 
 int vtype(Trptr t, char *vec)
 {
-	int i, nbits, res;
+int i, nbits, res;
+int an_u_encountered = 0;
 
-	if (vec == NULL)
-		return(AN_X);
-	nbits=t->n.nd->msi-t->n.nd->lsi;
-	if(nbits<0)nbits=-nbits;
-	nbits++;
-	res = AN_1;
-	for (i = 0; i < nbits; i++)
-	switch (*vec) {
-	case AN_X:		
-	case 'x':
-	case 'X':
-			return(AN_X);
-	case AN_Z:		
-	case 'z':
-	case 'Z':
-			if (res == AN_0) return(AN_X); vec++; res = AN_Z; break;
-	default:	if (res == AN_Z) return(AN_X); vec++; res = AN_0; break;
-	}
+if (vec == NULL)
+	return(AN_X);
 
-	return(res);
+nbits=t->n.nd->msi-t->n.nd->lsi;
+if(nbits<0)nbits=-nbits;
+nbits++;
+res = AN_1;
+for (i = 0; i < nbits; i++)
+	{
+	switch (*vec) 
+		{
+		case AN_X:		
+		case 'x':
+		case 'X':
+				return(AN_X);
+		case AN_U:		
+		case 'u':
+		case 'U':
+				an_u_encountered = 1; break;
+		case AN_Z:		
+		case 'z':
+		case 'Z':
+				if (res == AN_0) return(AN_X); vec++; res = AN_Z; break;
+		default:	if (res == AN_Z) return(AN_X); vec++; res = AN_0; break;
+		}
+	}	
+
+return(!an_u_encountered ? res : AN_U);
 }
 
 int vtype2(Trptr t, vptr v)
 {
-	int i, nbits, res;
-	char *vec=(char *)v->v;
+int i, nbits, res;
+int an_u_encountered = 0;
+char *vec=(char *)v->v;
 
-	if(!t->t_filter_converted)
-		{
-		if (vec == NULL)
-			return(AN_X);
-		}
-		else
-		{
-		return ( ((vec == NULL) || (vec[0] == 0)) ? AN_Z : AN_0 );
-		}
+if(!t->t_filter_converted)
+	{
+	if (vec == NULL)
+		return(AN_X);
+	}
+	else
+	{
+	return ( ((vec == NULL) || (vec[0] == 0)) ? AN_Z : AN_0 );
+	}
 
-	nbits=t->n.vec->nbits;
-	res = AN_1;
-	for (i = 0; i < nbits; i++)
+nbits=t->n.vec->nbits;
+res = AN_1;
+for (i = 0; i < nbits; i++)
+	{
+	switch (*vec) 
 		{
-		switch (*vec) 
-			{
-			case AN_X:		
-			case 'x':
-			case 'X':
-					return(AN_X);
-			case AN_Z:		
-			case 'z':
-			case 'Z':
-					if (res == AN_0) return(AN_X); vec++; res = AN_Z; break;
-			default:	if (res == AN_Z) return(AN_X); vec++; res = AN_0; break;
-			}
+		case AN_X:		
+		case 'x':
+		case 'X':
+				return(AN_X);
+		case AN_U:		
+		case 'u':
+		case 'U':
+				an_u_encountered = 1; break;
+		case AN_Z:		
+		case 'z':
+		case 'Z':
+				if (res == AN_0) return(AN_X); vec++; res = AN_Z; break;
+		default:	if (res == AN_Z) return(AN_X); vec++; res = AN_0; break;
 		}
+	}
 
-	return(res);
+return(!an_u_encountered ? res : AN_U);
 }
 
 /*
diff --git a/src/bsearch.c b/src/bsearch.c
index b7b9ef8..e43f611 100644
--- a/src/bsearch.c
+++ b/src/bsearch.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) Tony Bybell 1999-2011.
+ * Copyright (c) Tony Bybell 1999-2013.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -121,6 +121,12 @@ if((!GLOBALS->max_compare_pos_bsearch_c_1)||(GLOBALS->max_compare_time_bsearch_c
 	GLOBALS->max_compare_index=&(n->harray[1]); 
 	}
 
+while(GLOBALS->max_compare_pos_bsearch_c_1->next) /* non-RoSync dumper deglitching fix */
+	{
+	if(GLOBALS->max_compare_pos_bsearch_c_1->time != GLOBALS->max_compare_pos_bsearch_c_1->next->time) break;
+	GLOBALS->max_compare_pos_bsearch_c_1 = GLOBALS->max_compare_pos_bsearch_c_1->next;
+	}
+
 return(GLOBALS->max_compare_pos_bsearch_c_1);
 }
 
@@ -170,6 +176,12 @@ if((!GLOBALS->vmax_compare_pos_bsearch_c_1)||(GLOBALS->vmax_compare_time_bsearch
 	GLOBALS->vmax_compare_index=&(b->vectors[1]);
 	}
 
+while(GLOBALS->vmax_compare_pos_bsearch_c_1->next) /* non-RoSync dumper deglitching fix */
+	{
+	if(GLOBALS->vmax_compare_pos_bsearch_c_1->time != GLOBALS->vmax_compare_pos_bsearch_c_1->next->time) break;
+	GLOBALS->vmax_compare_pos_bsearch_c_1 = GLOBALS->vmax_compare_pos_bsearch_c_1->next;
+	}
+
 return(GLOBALS->vmax_compare_pos_bsearch_c_1);
 }
 
diff --git a/src/fgetdynamic.c b/src/fgetdynamic.c
index bdf4870..4035887 100644
--- a/src/fgetdynamic.c
+++ b/src/fgetdynamic.c
@@ -1,5 +1,5 @@
 /* 
- * Copyright (c) Tony Bybell 1999-2009.
+ * Copyright (c) Tony Bybell 1999-2013.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -18,19 +18,22 @@
 char *fgetmalloc(FILE *handle)
 {
 struct vlist_t *v;
-char *pnt;
+char *pnt = NULL;
 int i, ch;
 
 v = vlist_create(sizeof(char));
 
-for(;;)
+do
 	{
-	ch=fgetc(handle);
-	if((ch==EOF)||(ch==0x00)||(ch=='\n')||(ch=='\r')) break;
-
-	pnt = (char *)vlist_alloc(&v, 0);
-	*pnt = (char)ch;
-	}
+	for(;;)
+		{
+		ch=fgetc(handle);
+		if((ch==EOF)||(ch==0x00)||(ch=='\n')||(ch=='\r')) break;
+	
+		pnt = (char *)vlist_alloc(&v, 0);
+		*pnt = (char)ch;
+		}
+	} while(!pnt && ((ch=='\n')||(ch=='\r'))); /* fix for \n\r on \n systems */
 
 GLOBALS->fgetmalloc_len = vlist_size(v);
 
diff --git a/src/fst.c b/src/fst.c
index 9caea39..c7a6674 100644
--- a/src/fst.c
+++ b/src/fst.c
@@ -1,5 +1,5 @@
 /* 
- * Copyright (c) Tony Bybell 2009-2011.
+ * Copyright (c) Tony Bybell 2009-2013.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -154,6 +154,7 @@ char *s;
 unsigned char ttype;
 int sdt = FST_SDT_NONE;
 int svt = FST_SVT_NONE;
+long sxt = 0;
 
 while((h = fstReaderIterateHier(xc)))
         {
@@ -179,14 +180,15 @@ while((h = fstReaderIterateHier(xc)))
 				case FST_ST_VCD_PROGRAM:	ttype = TREE_VCD_ST_PROGRAM; break;
 
 				case FST_ST_VHDL_ARCHITECTURE:	ttype = TREE_VHDL_ST_ARCHITECTURE; break;
-				case FST_ST_VHDL_PROCEDURE:	ttype = TREE_VHDL_ST_PROCEDURE; break;
-				case FST_ST_VHDL_FUNCTION:	ttype = TREE_VHDL_ST_FUNCTION; break;
-				case FST_ST_VHDL_RECORD:	ttype = TREE_VHDL_ST_RECORD; break;
-				case FST_ST_VHDL_PROCESS:	ttype = TREE_VHDL_ST_PROCESS; break;
-				case FST_ST_VHDL_BLOCK:		ttype = TREE_VHDL_ST_BLOCK; break;
-				case FST_ST_VHDL_FOR_GENERATE:	ttype = TREE_VHDL_ST_GENFOR; break;
-				case FST_ST_VHDL_IF_GENERATE:	ttype = TREE_VHDL_ST_GENIF; break;
-				case FST_ST_VHDL_GENERATE:	ttype = TREE_VHDL_ST_GENERATE; break;
+				case FST_ST_VHDL_PROCEDURE:	ttype = TREE_VHDL_ST_PROCEDURE;    break;
+				case FST_ST_VHDL_FUNCTION:	ttype = TREE_VHDL_ST_FUNCTION;     break;
+				case FST_ST_VHDL_RECORD:	ttype = TREE_VHDL_ST_RECORD;       break;
+				case FST_ST_VHDL_PROCESS:	ttype = TREE_VHDL_ST_PROCESS;      break;
+				case FST_ST_VHDL_BLOCK:		ttype = TREE_VHDL_ST_BLOCK;        break;
+				case FST_ST_VHDL_FOR_GENERATE:	ttype = TREE_VHDL_ST_GENFOR;       break;
+				case FST_ST_VHDL_IF_GENERATE:	ttype = TREE_VHDL_ST_GENIF;        break;
+				case FST_ST_VHDL_GENERATE:	ttype = TREE_VHDL_ST_GENERATE;     break;
+				case FST_ST_VHDL_PACKAGE:	ttype = TREE_VHDL_ST_PACKAGE;      break;
 
 				default:			ttype = TREE_UNKNOWN; break;
 				}
@@ -291,6 +293,7 @@ while((h = fstReaderIterateHier(xc)))
 
 			h->u.var.svt_workspace = svt;
 			h->u.var.sdt_workspace = sdt;
+			h->u.var.sxt_workspace = sxt;
 
 			return(h);
                         break;
@@ -300,9 +303,62 @@ while((h = fstReaderIterateHier(xc)))
 				{
 				if(h->u.attr.subtype == FST_MT_SUPVAR)
 					{
+					if(h->u.attr.name)
+						{
+						JRB subvar_jrb_node;
+						char *attr_pnt;
+
+						if(GLOBALS->fst_filetype == FST_FT_VHDL)
+							{
+							char *lc_p = attr_pnt = strdup_2(h->u.attr.name);
+
+							while(*lc_p)
+								{
+								*lc_p = tolower(*lc_p); /* convert attrib name to lowercase for VHDL */
+								lc_p++;
+								}
+							}
+							else
+							{
+							attr_pnt = NULL;
+							}
+
+						/* sxt points to actual type name specified in FST file */
+						subvar_jrb_node = jrb_find_str(GLOBALS->subvar_jrb, attr_pnt ? attr_pnt : h->u.attr.name);
+						if(subvar_jrb_node)
+							{
+							sxt = subvar_jrb_node->val.ui;
+							}
+							else
+							{
+							Jval jv;
+
+							if(GLOBALS->subvar_jrb_count != WAVE_VARXT_MAX_ID)
+								{
+								sxt = jv.ui = ++GLOBALS->subvar_jrb_count;
+								/* subvar_jrb_node = */ jrb_insert_str(GLOBALS->subvar_jrb, strdup_2(attr_pnt ? attr_pnt : h->u.attr.name), jv);
+								}
+								else
+								{
+								sxt = 0;
+								if(!GLOBALS->subvar_jrb_count_locked)
+									{
+									fprintf(stderr, FST_RDLOAD"Max number (%d) of type attributes reached, please increase WAVE_VARXT_MAX_ID.\n", WAVE_VARXT_MAX_ID);
+									GLOBALS->subvar_jrb_count_locked = 1;
+									}
+								}
+							}
+
+						if(attr_pnt)
+							{
+							free_2(attr_pnt);
+							}
+						}					
+
 					svt = h->u.attr.arg >> FST_SDT_SVT_SHIFT_COUNT;
 					sdt = h->u.attr.arg & (FST_SDT_ABS_MAX-1);
 					GLOBALS->supplemental_datatypes_encountered = 1;
+					GLOBALS->supplemental_vartypes_encountered |= ((svt != FST_SVT_NONE) && (svt != FST_SVT_VHDL_SIGNAL));
 					}
 				}
 			break;
@@ -381,7 +437,16 @@ f_name_len = calloc_2(F_NAME_MODULUS+1,sizeof(int));
 f_name_max_len = calloc_2(F_NAME_MODULUS+1,sizeof(int));
 
 nnam_max = 16;
-nnam = malloc_2(nnam_max);
+nnam = malloc_2(nnam_max + 1);
+
+GLOBALS->fst_filetype = fstReaderGetFileType(GLOBALS->fst_fst_c_1);
+if(GLOBALS->fst_filetype == FST_FT_VHDL)
+	{
+	GLOBALS->is_vhdl_component_format = 1;
+	}
+
+GLOBALS->subvar_jrb = make_jrb(); /* only used for attributes such as generated in VHDL, etc. */
+
 
 GLOBALS->numfacs=fstReaderGetVarCount(GLOBALS->fst_fst_c_1);
 GLOBALS->mvlfacs_fst_c_3=(struct fac *)calloc_2(GLOBALS->numfacs,sizeof(struct fac));
@@ -587,6 +652,9 @@ for(i=0;i<GLOBALS->numfacs;i++)
 			{
 			case FST_VT_VCD_PARAMETER:
 			case FST_VT_VCD_INTEGER:
+			case FST_VT_SV_INT:
+			case FST_VT_SV_SHORTINT:
+			case FST_VT_SV_LONGINT:
 				GLOBALS->mvlfacs_fst_c_3[i].flags = VZT_RD_SYM_F_INTEGER;
 				break;	
 
@@ -748,10 +816,19 @@ for(i=0;i<GLOBALS->numfacs;i++)
 	
 			if(f->flags&VZT_RD_SYM_F_INTEGER)
 				{
-				node_block[i].msi=31;
-				node_block[i].lsi=0;
-				GLOBALS->mvlfacs_fst_c_3[i].len=32;
-				}
+				if(f->len != 0)
+					{
+					node_block[i].msi = f->len - 1;
+					node_block[i].lsi = 0;
+					GLOBALS->mvlfacs_fst_c_3[i].len = f->len;
+					}
+					else
+					{
+					node_block[i].msi = 31;
+					node_block[i].lsi = 0;
+					GLOBALS->mvlfacs_fst_c_3[i].len = 32;
+					}	
+			}
 	
 			if(GLOBALS->fast_tree_sort) 
 				{
@@ -779,6 +856,7 @@ for(i=0;i<GLOBALS->numfacs;i++)
         n->mv.mvlfac = GLOBALS->mvlfacs_fst_c_3+i;
 	GLOBALS->mvlfacs_fst_c_3[i].working_node = n;
 	n->vardir = nvd;
+	n->varxt  = h->u.var.sxt_workspace;
 	if((h->u.var.svt_workspace == FST_SVT_NONE) && (h->u.var.sdt_workspace == FST_SDT_NONE))
 		{
 		n->vartype = nvt;
@@ -846,6 +924,17 @@ free_2(f_name_len); f_name_len = NULL;
 
 if(numvars != GLOBALS->numfacs) { GLOBALS->mvlfacs_fst_rvs_alias = realloc_2(GLOBALS->mvlfacs_fst_rvs_alias, numvars * sizeof(fstHandle)); }
 
+if(GLOBALS->subvar_jrb_count) /* generate lookup table for typenames explicitly given as attributes */
+	{
+	JRB subvar_jrb_node = NULL;
+	GLOBALS->subvar_pnt = calloc_2(GLOBALS->subvar_jrb_count + 1, sizeof(char *));
+
+	jrb_traverse(subvar_jrb_node, GLOBALS->subvar_jrb)
+		{
+		GLOBALS->subvar_pnt[subvar_jrb_node->val.ui] = subvar_jrb_node->key.s;
+		}
+	}
+
 decorated_module_cleanup(); /* ...also now in gtk2_treesearch.c */
 freeze_facility_pack();
 iter_through_comp_name_table();
diff --git a/src/globals.c b/src/globals.c
index 8cf0edb..b508205 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -315,6 +315,13 @@ NULL, /* double_curr_fst */
 NULL, /* double_fini_fst */
 0, /* nonimplicit_direction_encountered */
 0, /* supplemental_datatypes_encountered */
+0, /* supplemental_vartypes_encountered */
+0, /* is_vhdl_component_format */
+NULL, /* subvar_jrb */
+0, /* subvar_jrb_count */
+NULL, /* subvar_pnt */
+0, /* fst_filetype */
+0, /* subvar_jrb_count_locked */
 
 
 /*
@@ -597,6 +604,7 @@ NULL, /* filesel_newviewer_menu_c_1 245 */
 NULL, /* filesel_logfile_menu_c_1 246 */
 NULL, /* filesel_scriptfile_menu */
 NULL, /* filesel_writesave 247 */
+NULL, /* filesel_imagegrab */
 0, /* save_success_menu_c_1 248 */
 NULL, /* filesel_vcd_writesave 249 */
 NULL, /* filesel_lxt_writesave 250 */
@@ -1925,7 +1933,8 @@ void reload_into_new_context_2(void)
  strcpy2_into_new_context(new_globals, &new_globals->fcurr_ttranslate_c_1, &GLOBALS->fcurr_ttranslate_c_1);
  strcpy2_into_new_context(new_globals, &new_globals->fcurr_ptranslate_c_1, &GLOBALS->fcurr_ptranslate_c_1);
  strcpy2_into_new_context(new_globals, &new_globals->fcurr_translate_c_2, &GLOBALS->fcurr_translate_c_2);
- 
+
+ strcpy2_into_new_context(new_globals, &new_globals->filesel_imagegrab, &GLOBALS->filesel_imagegrab);
 
  /* renderopt.c */
 #ifdef WAVE_GTK_UNIX_PRINT
@@ -1989,6 +1998,15 @@ void reload_into_new_context_2(void)
  }
 
 
+ /* fst.c, though might be others later */
+ if(GLOBALS->subvar_jrb)
+	{
+ 	jrb_free_tree(GLOBALS->subvar_jrb);
+ 	GLOBALS->subvar_jrb = NULL;
+ 	GLOBALS->subvar_jrb_count = 0;
+	}
+
+
  /* deallocate any loader-related stuff */
  switch(GLOBALS->loaded_file_type) {
    case LXT_FILE:
diff --git a/src/globals.h b/src/globals.h
index 89c1093..fae9a0c 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -314,6 +314,13 @@ double *double_curr_fst;
 double *double_fini_fst;
 char nonimplicit_direction_encountered;
 char supplemental_datatypes_encountered;
+char supplemental_vartypes_encountered;
+char is_vhdl_component_format;
+JRB subvar_jrb;
+unsigned int subvar_jrb_count;
+char **subvar_pnt;
+unsigned char fst_filetype;
+unsigned subvar_jrb_count_locked : 1;
 
 
 /*
@@ -593,6 +600,7 @@ char *filesel_newviewer_menu_c_1; /* from menu.c 262 */
 char *filesel_logfile_menu_c_1; /* from menu.c 263 */
 char *filesel_scriptfile_menu; /* from menu.c */
 char *filesel_writesave; /* from menu.c 264 */
+char *filesel_imagegrab; /* from menu.c */
 char save_success_menu_c_1; /* from menu.c 265 */
 char *filesel_vcd_writesave; /* from menu.c 266 */
 char *filesel_lxt_writesave; /* from menu.c 267 */
diff --git a/src/helpers/fst/fstapi.c b/src/helpers/fst/fstapi.c
index ab24e64..8c7c075 100644
--- a/src/helpers/fst/fstapi.c
+++ b/src/helpers/fst/fstapi.c
@@ -33,25 +33,42 @@
 #include <pthread.h>
 #endif
 
-/* this define is to force writer backward compatibility with old readers */
-#ifndef FST_DYNAMIC_ALIAS_DISABLE
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#elif defined(__GNUC__)
+#ifndef __MINGW32__
+#ifndef alloca
+#define alloca __builtin_alloca
+#endif
+#else
+#include <malloc.h>
+#endif
+#elif defined(_MSC_VER)
+#include <malloc.h>
+#define alloca _alloca
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX (4096)
+#endif
+
 /* note that Judy versus Jenkins requires more experimentation: they are  */
 /* functionally equivalent though it appears Jenkins is slightly faster.  */
 /* in addition, Jenkins is not bound by the LGPL.                         */
 #ifdef _WAVE_HAVE_JUDY
 #include <Judy.h>
 #else
+/* should be more than enough for fstWriterSetSourceStem() */
+#define FST_PATH_HASHMASK 		((1UL << 16) - 1)
 typedef const void *Pcvoid_t;
 typedef void *Pvoid_t;
 typedef void **PPvoid_t;
 #define JudyHSIns(a,b,c,d) JenkinsIns((a),(b),(c),(hashmask))
 #define JudyHSFreeArray(a,b) JenkinsFree((a),(hashmask))
 void JenkinsFree(void *base_i, uint32_t hashmask);
-void **JenkinsIns(void *base_i, unsigned char *mem, uint32_t length, uint32_t hashmask);
-#endif
+void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint32_t hashmask);
 #endif
 
-
 #undef  FST_DEBUG
 
 #define FST_BREAK_SIZE 			(1UL << 27)
@@ -65,7 +82,9 @@ void **JenkinsIns(void *base_i, unsigned char *mem, uint32_t length, uint32_t ha
 #define FST_ID_NAM_ATTR_SIZ		(65536+4096)
 #define FST_DOUBLE_ENDTEST 		(2.7182818284590452354)
 #define FST_HDR_SIM_VERSION_SIZE 	(128)
-#define FST_HDR_DATE_SIZE 		(120)
+#define FST_HDR_DATE_SIZE 		(119)
+#define FST_HDR_FILETYPE_SIZE		(1)
+#define FST_HDR_TIMEZERO_SIZE		(8)
 #define FST_GZIO_LEN			(32768)
 
 #if defined(__i386__) || defined(__x86_64__) || defined(_AIX)
@@ -136,6 +155,36 @@ return(ftruncate(fd, length));
 
 
 /*
+ * realpath compatibility
+ */
+static char *fstRealpath(const char *path, char *resolved_path) 
+{
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __CYGWIN__ || defined HAVE_REALPATH
+
+#if (defined(__MACH__) && defined(__APPLE__))
+if(!resolved_path)
+        {
+        resolved_path = malloc(PATH_MAX+1); /* fixes bug on Leopard when resolved_path == NULL */
+        }
+#endif
+                         
+return(realpath(path, resolved_path));
+
+#else
+#ifdef __MINGW32__
+if(!resolved_path)
+        {
+        resolved_path = malloc(PATH_MAX+1);
+        }
+return(_fullpath(resolved_path, path, PATH_MAX));
+#else
+return(NULL);
+#endif
+#endif
+}
+
+
+/*
  * mmap compatibility
  */
 #if defined __CYGWIN__ || defined __MINGW32__
@@ -304,6 +353,21 @@ do      {
 
 return(pnt);
 }
+
+
+static unsigned char *fstCopyVarint64ToRight(unsigned char *pnt, uint64_t v)
+{
+uint64_t nxt;
+
+while((nxt = v>>7))
+        {
+        *(pnt++) = (v&0x7f) | 0x80;
+        v = nxt;
+        }
+*(pnt++) = (v&0x7f);
+
+return(pnt);
+}
  
 
 static uint64_t fstGetVarint64(unsigned char *mem, int *skiplen)
@@ -490,7 +554,6 @@ uint64_t firsttime;
 uint32_t vchg_siz;
 uint32_t vchg_alloc_siz;
 
-
 uint32_t secnum;
 off_t section_start;
 
@@ -503,6 +566,8 @@ uint32_t num_blackouts;
 
 uint64_t dump_size_limit;
 
+unsigned char filetype; /* default is 0, FST_FT_VERILOG */
+
 unsigned compress_hier : 1;
 unsigned repack_on_close : 1;
 unsigned skip_writing_section_hdr : 1;
@@ -533,6 +598,9 @@ size_t fst_huge_break_size;
 
 fstHandle next_huge_break;
 
+Pvoid_t path_array;
+uint32_t path_array_count;
+
 unsigned fseek_failed : 1;
 };
 
@@ -672,12 +740,15 @@ time(&walltime);
 strcpy(dbuf, asctime(localtime(&walltime)));
 fstFwrite(dbuf, FST_HDR_DATE_SIZE, 1, xc->handle);	/* +202 date */
 
-/* date size is deliberately overspecified at 120 bytes in order to provide backfill for new args */
+/* date size is deliberately overspecified at 119 bytes (originally 128) in order to provide backfill for new args */
+
+#define FST_HDR_OFFS_FILETYPE			(FST_HDR_OFFS_DATE + FST_HDR_DATE_SIZE)
+fputc(xc->filetype, xc->handle);		/* +321 filetype */
 
-#define FST_HDR_OFFS_TIMEZERO			(FST_HDR_OFFS_DATE + FST_HDR_DATE_SIZE)
+#define FST_HDR_OFFS_TIMEZERO			(FST_HDR_OFFS_FILETYPE + FST_HDR_FILETYPE_SIZE)
 fstWriterUint64(xc->handle, xc->timezero);	/* +322 timezero */
 
-#define FST_HDR_LENGTH				(FST_HDR_OFFS_TIMEZERO + 8)
+#define FST_HDR_LENGTH				(FST_HDR_OFFS_TIMEZERO + FST_HDR_TIMEZERO_SIZE)
 						/* +330 next section starts here */
 fflush(xc->handle);
 }
@@ -1796,6 +1867,14 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
 	pthread_attr_destroy(&xc->thread_attr);
 #endif
 
+	if(xc->path_array)
+		{
+#ifndef _WAVE_HAVE_JUDY
+		const uint32_t hashmask = FST_PATH_HASHMASK;
+#endif
+		JudyHSFreeArray(&(xc->path_array), NULL);
+		}
+
 	free(xc->filename); xc->filename = NULL;
 	free(xc);
 	}
@@ -1843,6 +1922,43 @@ if(xc && vers)
 }
 
 
+void fstWriterSetFileType(void *ctx, enum fstFileType filetype)
+{
+struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
+if(xc)
+        {
+	if((filetype >= FST_FT_MIN) && (filetype <= FST_FT_MAX))
+		{
+	        off_t fpos = ftello(xc->handle);
+
+		xc->filetype = filetype;
+
+	        fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_FILETYPE, SEEK_SET); 
+		fputc(xc->filetype, xc->handle);
+	        fflush(xc->handle);
+	        fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
+		}
+	}
+}
+
+
+static void fstWriterSetAttrDoubleArgGeneric(void *ctx, int typ, uint64_t arg1, uint64_t arg2)
+{
+struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
+if(xc)
+        {
+	unsigned char buf[11]; /* ceil(64/7) = 10 + null term */
+	unsigned char *pnt = fstCopyVarint64ToRight(buf, arg1);
+	if(arg1)
+		{
+		*pnt = 0; /* this converts any *nonzero* arg1 when made a varint into a null-term string */
+		}
+
+	fstWriterSetAttrBegin(xc, FST_AT_MISC, typ, (char *)buf, arg2);
+	}
+}
+
+
 static void fstWriterSetAttrGeneric(void *ctx, const char *comm, int typ, uint64_t arg)
 {
 struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
@@ -1863,6 +1979,60 @@ if(xc && comm)
 }
 
 
+void fstWriterSetSourceStem(void *ctx, const char *path, unsigned int line, unsigned int use_realpath)
+{
+struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
+
+if(xc && path && path[0])
+	{
+	uint64_t sidx = 0;
+	int slen = strlen(path);
+#ifndef _WAVE_HAVE_JUDY
+	const uint32_t hashmask = FST_PATH_HASHMASK;
+	const unsigned char *path2 = (const unsigned char *)path;	
+#else
+	char *path2 = alloca(slen + 1); /* judy lacks const qualifier in its JudyHSIns definition */
+	strcpy(path2, path);
+#endif
+
+	PPvoid_t pv = JudyHSIns(&(xc->path_array), path2, slen, NULL);
+        if(*pv)
+        	{
+                sidx = (long)(*pv);
+                }
+                else
+               	{
+		char *rp = NULL;
+
+		sidx = ++xc->path_array_count;
+               	*pv = (void *)(long)(xc->path_array_count);
+
+		if(use_realpath)
+			{
+			rp = fstRealpath(
+#ifndef _WAVE_HAVE_JUDY
+				(const char *)
+#endif
+				path2, NULL);
+			}
+		
+		fstWriterSetAttrGeneric(xc, rp ? rp : 
+#ifndef _WAVE_HAVE_JUDY
+			(const char *)
+#endif
+			path2, FST_MT_PATHNAME, sidx);
+
+		if(rp)
+			{
+			free(rp);
+			}
+		}
+
+	fstWriterSetAttrDoubleArgGeneric(xc, FST_MT_SOURCESTEM, sidx, line);
+	}
+}
+
+
 void fstWriterSetComment(void *ctx, const char *comm)
 {
 fstWriterSetAttrGeneric(ctx, comm, FST_MT_COMMENT, 0);
@@ -1903,14 +2073,14 @@ if(xc && s)
         	{
                 switch(*pnt)
                 	{
-                        case 'm': seconds_exp = -3; mat = 1; break;
-                        case 'u': seconds_exp = -6; mat = 1; break;
-                        case 'n': seconds_exp = -9; mat = 1; break;
+                        case 'm': seconds_exp =  -3; mat = 1; break;
+                        case 'u': seconds_exp =  -6; mat = 1; break;
+                        case 'n': seconds_exp =  -9; mat = 1; break;
                         case 'p': seconds_exp = -12; mat = 1; break;
                         case 'f': seconds_exp = -15; mat = 1; break;
                         case 'a': seconds_exp = -18; mat = 1; break;
                         case 'z': seconds_exp = -21; mat = 1; break;
-                        case 's': seconds_exp = -0; mat = 1; break;
+                        case 's': seconds_exp =   0; mat = 1; break;
                         default: break;
                         }
 
@@ -2026,9 +2196,9 @@ return(0);
  */
 fstHandle fstWriterCreateVar2(void *ctx, enum fstVarType vt, enum fstVarDir vd,
         uint32_t len, const char *nam, fstHandle aliasHandle,
-        const char *type, enum fstSupplimentalVarType svt, enum fstSupplimentalDataType sdt)
+        const char *type, enum fstSupplementalVarType svt, enum fstSupplementalDataType sdt)
 {
-fstWriterSetAttrGeneric(ctx, type ? type : "", FST_MT_SUPVAR, (svt<<FST_SDT_SVT_SHIFT_COUNT) | (sdt & (FST_SDT_ABS_MAX-1)));
+fstWriterSetAttrGeneric(ctx, type ? type : "", FST_MT_SUPVAR, (svt<<FST_SDT_SVT_SHIFT_COUNT) | (sdt & FST_SDT_ABS_MAX));
 return(fstWriterCreateVar(ctx, vt, vd, len, nam, aliasHandle));
 }
 
@@ -2486,7 +2656,7 @@ static const char *vartypes[] = {
 
 static const char *modtypes[] = {
 	"module", "task", "function", "begin", "fork", "generate", "struct", "union", "class", "interface", "package", "program",
-        "vhdl_architecture", "vhdl_procedure", "vhdl_function", "vhdl_record", "vhdl_process", "vhdl_block", "vhdl_for_generate", "vhdl_if_generate", "vhdl_generate"
+        "vhdl_architecture", "vhdl_procedure", "vhdl_function", "vhdl_record", "vhdl_process", "vhdl_block", "vhdl_for_generate", "vhdl_if_generate", "vhdl_generate", "vhdl_package"
 	};
 
 static const char *attrtypes[] = {
@@ -2536,6 +2706,8 @@ uint32_t longest_signal_value_len;	/* longest len value encountered */
 unsigned char *temp_signal_value_buf;	/* malloced for len in longest_signal_value_len */
 
 signed char timescale;
+unsigned char filetype;
+
 unsigned double_endian_match : 1;
 unsigned native_doubles_for_cb : 1;
 unsigned contains_geom_section : 1;
@@ -2914,6 +3086,14 @@ struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
 return(xc ? xc->date : NULL);
 }
 
+
+int fstReaderGetFileType(void *ctx)
+{
+struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
+return(xc ? xc->filetype : FST_FT_VERILOG);
+}
+
+
 int64_t fstReaderGetTimezero(void *ctx)
 {
 struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
@@ -3208,6 +3388,15 @@ if(!(isfeof=feof(xc->fh)))
 			xc->hier.u.attr.name_length = pnt - xc->hier.u.scope.name;
 
 			xc->hier.u.attr.arg = fstReaderVarint64(xc->fh);
+
+			if(xc->hier.u.attr.typ == FST_AT_MISC)
+				{
+				if(xc->hier.u.attr.subtype == FST_MT_SOURCESTEM)
+					{
+					int sidx_skiplen_dummy = 0;
+	                                xc->hier.u.attr.arg_from_name = fstGetVarint64((unsigned char *)xc->str_scope_nam, &sidx_skiplen_dummy);
+					}
+				}
 			break;
 
 		case FST_ST_GEN_ATTREND:
@@ -3247,6 +3436,7 @@ if(!(isfeof=feof(xc->fh)))
 			xc->hier.htyp = FST_HT_VAR;
 			xc->hier.u.var.svt_workspace = FST_SVT_NONE;
 			xc->hier.u.var.sdt_workspace = FST_SDT_NONE;
+			xc->hier.u.var.sxt_workspace = 0;
 			xc->hier.u.var.typ = tag;
 			xc->hier.u.var.direction = fgetc(xc->fh);
 			xc->hier.u.var.name = pnt = xc->str_scope_nam;
@@ -3432,7 +3622,17 @@ while(!feof(xc->fh))
 									}
 									else
 									{
-									fprintf(fv, "$attrbegin %s %02x %s %"PRId64" $end\n", attrtypes[attrtype], subtype, str, attrarg);
+									if(subtype == FST_MT_SOURCESTEM)
+										{
+										int sidx_skiplen_dummy = 0;
+										uint64_t sidx = fstGetVarint64((unsigned char *)str, &sidx_skiplen_dummy);
+
+										fprintf(fv, "$attrbegin %s %02x %"PRId64" %"PRId64" $end\n", attrtypes[attrtype], subtype, sidx, attrarg);
+										}
+										else
+										{
+										fprintf(fv, "$attrbegin %s %02x %s %"PRId64" $end\n", attrtypes[attrtype], subtype, str, attrarg);
+										}
 									}
 								break;
 					}
@@ -3720,6 +3920,8 @@ if(gzread_pass_status)
 				xc->version[FST_HDR_SIM_VERSION_SIZE] = 0;
 				fstFread(xc->date, FST_HDR_DATE_SIZE, 1, xc->f);
 				xc->date[FST_HDR_DATE_SIZE] = 0;
+				ch = fgetc(xc->f);
+				xc->filetype = (unsigned char)ch;
 				xc->timezero = fstReaderUint64(xc->f);
 				}
 			}
@@ -4019,6 +4221,8 @@ scatterptr = calloc(xc->maxhandle, sizeof(uint32_t));
 headptr = calloc(xc->maxhandle, sizeof(uint32_t));
 length_remaining = calloc(xc->maxhandle, sizeof(uint32_t));
 
+if(fv) { fprintf(fv, "$dumpvars\n"); } 
+
 for(;;)
 	{
 	uint32_t *tc_head = NULL;
@@ -5507,7 +5711,7 @@ acceptable.  Do NOT use for cryptographic purposes.
 --------------------------------------------------------------------
 */
 
-static uint32_t j_hash(uint8_t *k, uint32_t length, uint32_t initval)
+static uint32_t j_hash(const uint8_t *k, uint32_t length, uint32_t initval)
 {
    uint32_t a,b,c,len;
 
@@ -5566,7 +5770,7 @@ unsigned char mem[1];
 };
 
 
-void **JenkinsIns(void *base_i, unsigned char *mem, uint32_t length, uint32_t hashmask)
+void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint32_t hashmask)
 {
 struct collchain_t ***base = (struct collchain_t ***)base_i;
 uint32_t hf, h;
diff --git a/src/helpers/fst/fstapi.h b/src/helpers/fst/fstapi.h
index 38a89c0..6e7fb84 100644
--- a/src/helpers/fst/fstapi.h
+++ b/src/helpers/fst/fstapi.h
@@ -40,6 +40,16 @@ extern "C" {
 
 typedef uint32_t fstHandle;
 
+enum fstFileType {
+    FST_FT_MIN                 = 0,
+
+    FST_FT_VERILOG             = 0,
+    FST_FT_VHDL                = 1,
+    FST_FT_VERILOG_VHDL        = 2, 
+
+    FST_FT_MAX                 = 2
+};
+
 enum fstBlockType {
     FST_BL_HDR		       = 0,
     FST_BL_VCDATA              = 1,
@@ -77,8 +87,9 @@ enum fstScopeType {
     FST_ST_VHDL_FOR_GENERATE   = 18,
     FST_ST_VHDL_IF_GENERATE    = 19,
     FST_ST_VHDL_GENERATE       = 20,
+    FST_ST_VHDL_PACKAGE        = 21,
 
-    FST_ST_MAX                 = 20,
+    FST_ST_MAX                 = 21,
 
     FST_ST_GEN_ATTRBEGIN       = 252,
     FST_ST_GEN_ATTREND         = 253,
@@ -116,12 +127,12 @@ enum fstVarType {
 
     FST_VT_SV_BIT              = 22,
     FST_VT_SV_LOGIC            = 23,
-    FST_VT_SV_INT              = 24,	/* declare as 31:0 */
-    FST_VT_SV_SHORTINT         = 25,	/* declare as 15:0 */
-    FST_VT_SV_LONGINT          = 26,	/* declare as 63:0 */
-    FST_VT_SV_BYTE             = 27,	/* declare as 7:0  */
+    FST_VT_SV_INT              = 24,	/* declare as size = 32 */
+    FST_VT_SV_SHORTINT         = 25,	/* declare as size = 16 */
+    FST_VT_SV_LONGINT          = 26,	/* declare as size = 64 */
+    FST_VT_SV_BYTE             = 27,	/* declare as size = 8  */
     FST_VT_SV_ENUM             = 28,	/* declare as appropriate type range */
-    FST_VT_SV_SHORTREAL        = 29,	/* declare and emit same as FST_VT_VCD_REAL */
+    FST_VT_SV_SHORTREAL        = 29,	/* declare and emit same as FST_VT_VCD_REAL (needs to be emitted as double, not a float) */
 
     FST_VT_MAX                 = 29	/* end of vartypes */
 };
@@ -154,7 +165,7 @@ enum fstHierType {
 enum fstAttrType {
     FST_AT_MIN         = 0,
 
-    FST_AT_MISC        = 0,
+    FST_AT_MISC        = 0,	/* self-contained: does not need matching FST_HT_ATTREND */
     FST_AT_ARRAY       = 1,
     FST_AT_ENUM        = 2,
     FST_AT_PACK        = 3,
@@ -165,12 +176,14 @@ enum fstAttrType {
 enum fstMiscType {
     FST_MT_MIN         = 0,
 
-    FST_MT_COMMENT     = 0,	/* self-contained: does not need matching FST_HT_ATTREND, use fstWriterSetComment() to emit */
-    FST_MT_ENVVAR      = 1,	/* self-contained: does not need matching FST_HT_ATTREND, use fstWriterSetEnvVar() to emit */
-    FST_MT_SUPVAR      = 2,
-    FST_MT_UNKNOWN     = 3,
+    FST_MT_COMMENT     = 0,	/* use fstWriterSetComment() to emit */
+    FST_MT_ENVVAR      = 1,	/* use fstWriterSetEnvVar() to emit */
+    FST_MT_SUPVAR      = 2,	/* use fstWriterCreateVar2() to emit */
+    FST_MT_PATHNAME    = 3,     /* reserved for fstWriterSetSourceStem() string -> number management */
+    FST_MT_SOURCESTEM  = 4,     /* use fstWriterSetSourceStem() to emit */
+    FST_MT_UNKNOWN     = 5,
 
-    FST_MT_MAX         = 3
+    FST_MT_MAX         = 5
 };
 
 enum fstArrayType {
@@ -212,7 +225,7 @@ enum fstPackType {
     FST_PT_MAX           = 3
 };
 
-enum fstSupplimentalVarType {
+enum fstSupplementalVarType {
     FST_SVT_MIN                    = 0,
 
     FST_SVT_NONE                   = 0,
@@ -226,7 +239,7 @@ enum fstSupplimentalVarType {
     FST_SVT_MAX                    = 5,
 };
 
-enum fstSupplimentalDataType {
+enum fstSupplementalDataType {
     FST_SDT_MIN                    = 0,
 
     FST_SDT_NONE                   = 0,
@@ -250,8 +263,8 @@ enum fstSupplimentalDataType {
 
     FST_SDT_MAX                    = 16,
 
-    FST_SDT_SVT_SHIFT_COUNT        = 10, /* FST_SVT_* is ORed in to the left after shifting FST_SDT_SVT_SHIFT_COUNT */
-    FST_SDT_ABS_MAX		   = (1<<(FST_SDT_SVT_SHIFT_COUNT))
+    FST_SDT_SVT_SHIFT_COUNT        = 10, /* FST_SVT_* is ORed in by fstWriterCreateVar2() to the left after shifting FST_SDT_SVT_SHIFT_COUNT */
+    FST_SDT_ABS_MAX		   = ((1<<(FST_SDT_SVT_SHIFT_COUNT))-1)
 };
 
 
@@ -273,10 +286,9 @@ union {
 	struct fstHierVar {
 		unsigned char typ; /* FST_VT_MIN ... FST_VT_MAX */
 		unsigned char direction; /* FST_VD_MIN ... FST_VD_MAX */
-
 		unsigned char svt_workspace; /* zeroed out by FST reader, for client code use */
 		unsigned char sdt_workspace; /* zeroed out by FST reader, for client code use */
-
+		unsigned int  sxt_workspace; /* zeroed out by FST reader, for client code use */
 		const char *name;
 		uint32_t length;
 		fstHandle handle;
@@ -290,6 +302,7 @@ union {
 		unsigned char subtype; /* from fstMiscType, fstArrayType, fstEnumValueType, fstPackType */
 		const char *name;
 		uint64_t arg; /* number of array elements, struct members, or some other payload (possibly ignored) */
+		uint64_t arg_from_name; /* for when name is overloaded as a variable-length integer (FST_AT_MISC + FST_MT_SOURCESTEM) */
 		uint32_t name_length; /* strlen(u.attr.name) */
 		} attr;
 	} u;
@@ -299,109 +312,100 @@ union {
 /*
  * writer functions
  */
+void		fstWriterClose(void *ctx);
+void *		fstWriterCreate(const char *nam, int use_compressed_hier);
+		/* used for Verilog/SV */
+fstHandle 	fstWriterCreateVar(void *ctx, enum fstVarType vt, enum fstVarDir vd,
+        		uint32_t len, const char *nam, fstHandle aliasHandle);
+		/* future expansion for VHDL and other languages.  The variable type, data type, etc map onto
+		   the current Verilog/SV one.  The "type" string is optional for a more verbose or custom description */
+fstHandle 	fstWriterCreateVar2(void *ctx, enum fstVarType vt, enum fstVarDir vd,
+        		uint32_t len, const char *nam, fstHandle aliasHandle,
+			const char *type, enum fstSupplementalVarType svt, enum fstSupplementalDataType sdt);
+void 		fstWriterEmitValueChange(void *ctx, fstHandle handle, const void *val);
+void 		fstWriterEmitVariableLengthValueChange(void *ctx, fstHandle handle, const void *val, uint32_t len);
+void 		fstWriterEmitDumpActive(void *ctx, int enable);
+void 		fstWriterEmitTimeChange(void *ctx, uint64_t tim);
+void 		fstWriterFlushContext(void *ctx);
+int 		fstWriterGetDumpSizeLimitReached(void *ctx);
+int 		fstWriterGetFseekFailed(void *ctx);
+void 		fstWriterSetAttrBegin(void *ctx, enum fstAttrType attrtype, int subtype,
+                	const char *attrname, uint64_t arg);
+void 		fstWriterSetAttrEnd(void *ctx);
+void 		fstWriterSetComment(void *ctx, const char *comm);
+void 		fstWriterSetDate(void *ctx, const char *dat);
+void 		fstWriterSetDumpSizeLimit(void *ctx, uint64_t numbytes);
+void 		fstWriterSetEnvVar(void *ctx, const char *envvar);
+void 		fstWriterSetFileType(void *ctx, enum fstFileType filetype);
+void 		fstWriterSetPackType(void *ctx, int typ); 		/* type = 0 (libz), 1 (fastlz) */
+void 		fstWriterSetParallelMode(void *ctx, int enable);
+void 		fstWriterSetRepackOnClose(void *ctx, int enable); 	/* type = 0 (none), 1 (libz) */
+void 		fstWriterSetScope(void *ctx, enum fstScopeType scopetype,
+                	const char *scopename, const char *scopecomp);
+void		fstWriterSetSourceStem(void *ctx, const char *path, unsigned int line, unsigned int use_realpath);
+void 		fstWriterSetTimescale(void *ctx, int ts);
+void 		fstWriterSetTimescaleFromString(void *ctx, const char *s);
+void 		fstWriterSetTimezero(void *ctx, int64_t tim);
+void 		fstWriterSetUpscope(void *ctx);
+void 		fstWriterSetVersion(void *ctx, const char *vers);
 
-/* used for Verilog/SV */
-fstHandle fstWriterCreateVar(void *ctx, enum fstVarType vt, enum fstVarDir vd,
-        uint32_t len, const char *nam, fstHandle aliasHandle);
-
-/* future expansion for VHDL and other languages.  The variable type, data type, etc map onto
-   the current Verilog/SV one.  The "type" string is optional for a more verbose or custom description */
-fstHandle fstWriterCreateVar2(void *ctx, enum fstVarType vt, enum fstVarDir vd,
-        uint32_t len, const char *nam, fstHandle aliasHandle,
-	const char *type, enum fstSupplimentalVarType svt, enum fstSupplimentalDataType sdt);
-
-void fstWriterSetPackType(void *ctx, int typ); 		/* type = 0 (libz), 1 (fastlz) */
-void fstWriterSetRepackOnClose(void *ctx, int enable); 	/* type = 0 (none), 1 (libz) */
-void fstWriterSetParallelMode(void *ctx, int enable);
-void fstWriterSetDumpSizeLimit(void *ctx, uint64_t numbytes);
-int fstWriterGetDumpSizeLimitReached(void *ctx);
-int fstWriterGetFseekFailed(void *ctx);
-
-void *fstWriterCreate(const char *nam, int use_compressed_hier);
-void fstWriterClose(void *ctx);
-void fstWriterSetDate(void *ctx, const char *dat);
-void fstWriterSetVersion(void *ctx, const char *vers);
-void fstWriterSetComment(void *ctx, const char *comm);
-void fstWriterSetEnvVar(void *ctx, const char *envvar);
-void fstWriterSetTimescale(void *ctx, int ts);
-void fstWriterSetTimescaleFromString(void *ctx, const char *s);
-void fstWriterSetTimezero(void *ctx, int64_t tim);
-void fstWriterSetScope(void *ctx, enum fstScopeType scopetype,
-                const char *scopename, const char *scopecomp);
-void fstWriterSetUpscope(void *ctx);
-void fstWriterEmitValueChange(void *ctx, fstHandle handle, const void *val);
-void fstWriterEmitVariableLengthValueChange(void *ctx, fstHandle handle, const void *val, uint32_t len);
-void fstWriterEmitDumpActive(void *ctx, int enable);
-void fstWriterEmitTimeChange(void *ctx, uint64_t tim);
-void fstWriterFlushContext(void *ctx);
-void fstWriterSetAttrBegin(void *ctx, enum fstAttrType attrtype, int subtype,
-                const char *attrname, uint64_t arg);
-void fstWriterSetAttrEnd(void *ctx);
 
 /*
  * reader functions
  */
-void *fstReaderOpen(const char *nam);
-void *fstReaderOpenForUtilitiesOnly(void);
-void fstReaderClose(void *ctx);
-
-int fstReaderProcessHier(void *ctx, FILE *vcdhandle);
-int fstReaderIterateHierRewind(void *ctx);
+void 		fstReaderClose(void *ctx);
+void 		fstReaderClrFacProcessMask(void *ctx, fstHandle facidx);
+void 		fstReaderClrFacProcessMaskAll(void *ctx);
+uint64_t 	fstReaderGetAliasCount(void *ctx);
+const char *	fstReaderGetCurrentFlatScope(void *ctx);
+void *		fstReaderGetCurrentScopeUserInfo(void *ctx);
+int 		fstReaderGetCurrentScopeLen(void *ctx);
+const char *	fstReaderGetDateString(void *ctx);
+int 		fstReaderGetDoubleEndianMatchState(void *ctx);
+uint64_t 	fstReaderGetDumpActivityChangeTime(void *ctx, uint32_t idx);
+unsigned char 	fstReaderGetDumpActivityChangeValue(void *ctx, uint32_t idx);
+uint64_t 	fstReaderGetEndTime(void *ctx);
+int 		fstReaderGetFacProcessMask(void *ctx, fstHandle facidx);
+int 		fstReaderGetFileType(void *ctx);
+int 		fstReaderGetFseekFailed(void *ctx);
+fstHandle 	fstReaderGetMaxHandle(void *ctx);
+uint64_t 	fstReaderGetMemoryUsedByWriter(void *ctx);
+uint32_t 	fstReaderGetNumberDumpActivityChanges(void *ctx);
+uint64_t 	fstReaderGetScopeCount(void *ctx);
+uint64_t 	fstReaderGetStartTime(void *ctx);
+signed char 	fstReaderGetTimescale(void *ctx);
+int64_t 	fstReaderGetTimezero(void *ctx);
+uint64_t 	fstReaderGetValueChangeSectionCount(void *ctx);
+char *		fstReaderGetValueFromHandleAtTime(void *ctx, uint64_t tim, fstHandle facidx, char *buf);
+uint64_t 	fstReaderGetVarCount(void *ctx);
+const char *	fstReaderGetVersionString(void *ctx);
 struct fstHier *fstReaderIterateHier(void *ctx);
+int 		fstReaderIterateHierRewind(void *ctx);
+int 		fstReaderIterBlocks(void *ctx,
+        		void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value),
+        		void *user_callback_data_pointer, FILE *vcdhandle);
+int 		fstReaderIterBlocks2(void *ctx,
+        		void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value),
+        		void (*value_change_callback_varlen)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value, uint32_t len),
+        		void *user_callback_data_pointer, FILE *vcdhandle);
+void 		fstReaderIterBlocksSetNativeDoublesOnCallback(void *ctx, int enable);
+void *		fstReaderOpen(const char *nam);
+void *		fstReaderOpenForUtilitiesOnly(void);
+const char *	fstReaderPopScope(void *ctx);
+int 		fstReaderProcessHier(void *ctx, FILE *vcdhandle);
+const char *	fstReaderPushScope(void *ctx, const char *nam, void *user_info);
+void 		fstReaderResetScope(void *ctx);
+void 		fstReaderSetFacProcessMask(void *ctx, fstHandle facidx);
+void 		fstReaderSetFacProcessMaskAll(void *ctx);
+void 		fstReaderSetLimitTimeRange(void *ctx, uint64_t start_time, uint64_t end_time);
+void 		fstReaderSetUnlimitedTimeRange(void *ctx);
 
-void fstReaderResetScope(void *ctx);
-const char *fstReaderPopScope(void *ctx);
-const char *fstReaderPushScope(void *ctx, const char *nam, void *user_info);
-const char *fstReaderGetCurrentFlatScope(void *ctx);
-void *fstReaderGetCurrentScopeUserInfo(void *ctx);
-int fstReaderGetCurrentScopeLen(void *ctx);
-
-signed char fstReaderGetTimescale(void *ctx);
-int64_t fstReaderGetTimezero(void *ctx);
-uint64_t fstReaderGetStartTime(void *ctx);
-uint64_t fstReaderGetEndTime(void *ctx);
-uint64_t fstReaderGetMemoryUsedByWriter(void *ctx);
-uint64_t fstReaderGetScopeCount(void *ctx);
-uint64_t fstReaderGetVarCount(void *ctx);
-fstHandle fstReaderGetMaxHandle(void *ctx);
-uint64_t fstReaderGetAliasCount(void *ctx);
-uint64_t fstReaderGetValueChangeSectionCount(void *ctx);
-int fstReaderGetDoubleEndianMatchState(void *ctx);
-const char *fstReaderGetVersionString(void *ctx);
-const char *fstReaderGetDateString(void *ctx);
-int fstReaderGetFseekFailed(void *ctx);
-
-void fstReaderSetLimitTimeRange(void *ctx, uint64_t start_time, uint64_t end_time);
-void fstReaderSetUnlimitedTimeRange(void *ctx);
-
-uint32_t fstReaderGetNumberDumpActivityChanges(void *ctx);
-uint64_t fstReaderGetDumpActivityChangeTime(void *ctx, uint32_t idx);
-unsigned char fstReaderGetDumpActivityChangeValue(void *ctx, uint32_t idx);
-
-int fstReaderGetFacProcessMask(void *ctx, fstHandle facidx);
-void fstReaderSetFacProcessMask(void *ctx, fstHandle facidx);
-void fstReaderClrFacProcessMask(void *ctx, fstHandle facidx);
-void fstReaderSetFacProcessMaskAll(void *ctx);
-void fstReaderClrFacProcessMaskAll(void *ctx);
-
-void fstReaderIterBlocksSetNativeDoublesOnCallback(void *ctx, int enable);
-
-int fstReaderIterBlocks(void *ctx,
-        void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value),
-        void *user_callback_data_pointer, FILE *vcdhandle);
-
-int fstReaderIterBlocks2(void *ctx,
-        void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value),
-        void (*value_change_callback_varlen)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value, uint32_t len),
-        void *user_callback_data_pointer, FILE *vcdhandle);
-
-char *fstReaderGetValueFromHandleAtTime(void *ctx, uint64_t tim, fstHandle facidx, char *buf);
 
 /*
  * utility functions
  */
-int fstUtilityBinToEsc(unsigned char *d, unsigned char *s, int len);
-int fstUtilityEscToBin(unsigned char *d, unsigned char *s, int len);
+int 		fstUtilityBinToEsc(unsigned char *d, unsigned char *s, int len);
+int 		fstUtilityEscToBin(unsigned char *d, unsigned char *s, int len);
 
 #ifdef __cplusplus
 }
diff --git a/src/helpers/vcd2fst.c b/src/helpers/vcd2fst.c
index e4c89ff..1c3aa42 100644
--- a/src/helpers/vcd2fst.c
+++ b/src/helpers/vcd2fst.c
@@ -490,6 +490,8 @@ fstWriterSetParallelMode(ctx, parallel_mode);
 
 while(!feof(f))
 	{
+	char *buf1;
+
 	ss = getline_replace(&wbuf, &buf, &glen, f);
 	if(ss == -1)
 		{
@@ -497,7 +499,10 @@ while(!feof(f))
 		}
 	line++;
 
-	if(!strncmp(buf, "$var", 4))
+	if(buf[0] != '$') continue;
+	buf1 = buf + 1;
+
+	if(!strncmp(buf1, "var", 3))
 		{
 		char *st = strtok(buf+5, " \t");
 		enum fstVarType vartype;
@@ -744,7 +749,7 @@ while(!feof(f))
 			}
 		}
 	else
-	if(!strncmp(buf, "$scope", 6))
+	if(!strncmp(buf1, "scope", 5))
 		{
 		char *st = strtok(buf+6, " \t");
 		enum fstScopeType scopetype = FST_ST_VCD_MODULE;
@@ -948,7 +953,7 @@ while(!feof(f))
 			}
 		}
 	else
-	if(!strncmp(buf, "$upscope", 8))
+	if(!strncmp(buf1, "upscope", 7))
 		{
 		fstWriterSetUpscope(ctx);
 #if defined(VCD2FST_EXTLOAD_CONV)
@@ -959,7 +964,7 @@ while(!feof(f))
 #endif
 		}
 	else
-	if(!strncmp(buf, "$endd", 5))
+	if(!strncmp(buf1, "endd", 4))
 		{
 #if defined(VCD2FST_EXTLOAD_CONV)
 #ifdef _WAVE_HAVE_JUDY
@@ -974,7 +979,7 @@ while(!feof(f))
 		break;
 		}
 	else
-	if(!strncmp(buf, "$timezero", 9))
+	if(!strncmp(buf1, "timezero", 8))
 		{
 		char *pnt;
 		uint64_t tzero = 0;
@@ -998,7 +1003,7 @@ while(!feof(f))
 		fstWriterSetTimezero(ctx, tzero);
 		}
 	else
-	if(!strncmp(buf, "$timescale", 10))
+	if(!strncmp(buf1, "timescale", 9))
 		{
 		char *pnt;
 		char *num = NULL;
@@ -1028,12 +1033,14 @@ while(!feof(f))
 			int mat = 0;
 			switch(*pnt)
 				{
-				case 'm': exp = -3; mat = 1; break;
-				case 'u': exp = -6; mat = 1; break;
-				case 'n': exp = -9; mat = 1; break;
+				case 'm': exp = -3;  mat = 1; break;
+				case 'u': exp = -6;  mat = 1; break;
+				case 'n': exp = -9;  mat = 1; break;
 				case 'p': exp = -12; mat = 1; break;
 				case 'f': exp = -15; mat = 1; break;
-				case 's': exp = -0; mat = 1; break;
+				case 'a': exp = -18; mat = 1; break;
+				case 'z': exp = -21; mat = 1; break;
+				case 's': exp =  0;  mat = 1; break;
 				default: break;
 				}
 			if(mat) break;
@@ -1054,7 +1061,7 @@ while(!feof(f))
 		fstWriterSetTimescale(ctx, exp);
 		}
 	else
-	if(!strncmp(buf, "$date", 5))
+	if(!strncmp(buf1, "date", 4))
 		{
 		char *pnt, *rsp;
 		int found = 0;
@@ -1110,7 +1117,7 @@ while(!feof(f))
 		fstWriterSetDate(ctx, pnt);
 		}
 	else
-	if((!strncmp(buf, "$version", 8)) || (!strncmp(buf, "$comment", 8)))
+	if((!strncmp(buf1, "version", 7)) || (!strncmp(buf1, "comment", 7)))
 		{
 		char *pnt, *crpnt, *rsp;
 		int is_version = (buf[1] == 'v');
diff --git a/src/menu.c b/src/menu.c
index 63f0900..eadc2f6 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,5 +1,5 @@
 /* 
- * Copyright (c) Tony Bybell 1999-2012.
+ * Copyright (c) Tony Bybell 1999-2013.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -4267,6 +4267,83 @@ entrybox("Regexp Highlight",300,GLOBALS->regexp_string_menu_c_1,NULL,128,GTK_SIG
 
 /**/
 
+#if GTK_CHECK_VERSION(2,14,0)
+
+void
+menu_write_screengrab_cleanup(GtkWidget *widget, gpointer data)
+{
+GdkWindow *gw;
+gint w, h;
+GdkColormap *cm;
+GdkPixbuf *dest = NULL;
+GdkPixbuf *dest2;
+GError *err = NULL;
+gboolean succ = FALSE;
+
+if(!GLOBALS->filesel_ok)
+	{
+	return;
+	}
+
+gw = gtk_widget_get_window(GTK_WIDGET(GLOBALS->mainwindow));
+if(gw)
+	{
+	gdk_drawable_get_size(gw, &w, &h);
+	cm = gdk_drawable_get_colormap(gw);
+	if(cm)
+		{
+		dest = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, w, h);
+		if(dest)
+			{
+			dest2 = gdk_pixbuf_get_from_drawable(dest, gw, cm, 0, 0, 0, 0, w, h);
+			if(dest2)
+				{
+				succ = gdk_pixbuf_save (dest2, *GLOBALS->fileselbox_text, "png", &err, NULL);
+				}
+			}
+		}
+	}
+
+if(dest)
+	{
+	g_object_unref(dest);
+	}
+
+if(!succ)
+	{
+        fprintf(stderr, "Error opening imagegrab file '%s' for writing.\n",*GLOBALS->fileselbox_text);
+	perror("Why");
+	errno=0;
+	}
+	else
+	{
+	wave_gconf_client_set_string("/current/imagegrab", GLOBALS->filesel_imagegrab);
+	}
+}
+
+void
+menu_write_screengrab_as(gpointer null_data, guint callback_action, GtkWidget *widget)
+{
+if(GLOBALS->helpbox_is_active)
+	{
+	help_text_bold("\n\nGrab To File");
+	help_text(
+		" will open a file requester that will ask for the name"
+		" to be used for a PNG format image grab of the main GTKWave window."
+		" Note that if the main window is covered by other windows or"
+		" is partially offscreen, the grabbed image might not appear properly."
+	);
+	return;
+	}
+
+errno = 0;
+fileselbox("Grab To File",&GLOBALS->filesel_imagegrab,GTK_SIGNAL_FUNC(menu_write_screengrab_cleanup), GTK_SIGNAL_FUNC(NULL), "*.png", 1);
+}
+
+#endif
+
+/**/ 
+
 void
 menu_write_save_cleanup(GtkWidget *widget, gpointer data)
 {
@@ -6107,6 +6184,11 @@ static gtkwave_mlist_t menu_items[] =
     WAVE_GTKIFE("/File/Close", "<Control>W", menu_quit_close, WV_MENU_WCLOSE, "<Item>"),
     WAVE_GTKIFE("/File/<separator>", NULL, NULL, WV_MENU_SEP2VCD, "<Separator>"),
     WAVE_GTKIFE("/File/Print To File", "<Control>P", menu_print, WV_MENU_FPTF, "<Item>"),
+
+#if GTK_CHECK_VERSION(2,14,0)
+    WAVE_GTKIFE("/File/Grab To File", NULL, menu_write_screengrab_as, WV_MENU_SGRAB, "<Item>"),
+#endif
+
     WAVE_GTKIFE("/File/<separator>", NULL, NULL, WV_MENU_SEP1, "<Separator>"),
     WAVE_GTKIFE("/File/Read Save File", "<Control>O", menu_read_save_file, WV_MENU_FRSF, "<Item>"),
     WAVE_GTKIFE("/File/Write Save File", "<Control>S", menu_write_save_file, WV_MENU_FWSF, "<Item>"),
@@ -6123,6 +6205,7 @@ static gtkwave_mlist_t menu_items[] =
     WAVE_GTKIFE("/File/Read Tcl Script File", NULL, menu_read_script_file, WV_MENU_TCLSCR, "<Item>"),
     WAVE_GTKIFE("/File/<separator>", NULL, NULL, WV_MENU_TCLSEP, "<Separator>"),
 #endif
+
     WAVE_GTKIFE("/File/Quit", "<Control>Q", menu_quit, WV_MENU_FQY, "<Item>"),
 
     WAVE_GTKIFE("/Edit/Set Trace Max Hier", NULL, menu_set_max_hier, WV_MENU_ESTMH, "<Item>"),
diff --git a/src/menu.h b/src/menu.h
index 5d5e4d0..afff673 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -1,5 +1,5 @@
 /* 
- * Copyright (c) Tony Bybell 1999-2012.
+ * Copyright (c) Tony Bybell 1999-2013.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -90,6 +90,9 @@ WV_MENU_WRTIM,
 WV_MENU_WCLOSE,
 WV_MENU_SEP2VCD,
 WV_MENU_FPTF,
+#if GTK_CHECK_VERSION(2,14,0)
+WV_MENU_SGRAB,
+#endif
 WV_MENU_SEP1,
 WV_MENU_FRSF,
 WV_MENU_FWSF,
diff --git a/src/mouseover.c b/src/mouseover.c
index bdf31cf..d431d4c 100644
--- a/src/mouseover.c
+++ b/src/mouseover.c
@@ -249,7 +249,8 @@ gdk_draw_rectangle(GLOBALS->mo_pixmap_mouseover_c_1, GLOBALS->mo_black_mouseover
 gtkwave_signal_connect(GTK_OBJECT(GLOBALS->mo_area_mouseover_c_1), "expose_event",GTK_SIGNAL_FUNC(expose_event), NULL);
 }
 
-#define MOUSEOVER_BREAKSIZE (32)
+#define MOUSEOVER_BREAKSIZE      (32)
+#define MOUSEOVER_BREAKSIZE_ROWS (64)
 
 void move_mouseover(Trptr t, gint xin, gint yin, TimeType tim)
 {
@@ -324,6 +325,7 @@ if(t)
 
 		num_info_rows++;
 		}
+	if(num_info_rows > MOUSEOVER_BREAKSIZE_ROWS) num_info_rows = MOUSEOVER_BREAKSIZE_ROWS; /* prevent possible X11 overflow */
 
 	totalmax = (nmaxlen > vmaxlen) ? nmaxlen : vmaxlen;
 	totalmax += 8;
diff --git a/src/tree.c b/src/tree.c
index 4f88c9d..6b1d82e 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -435,7 +435,14 @@ if(t2->t_which >= 0)
 			char *sc = GLOBALS->comp_name_idx[thidx];
 			int tlen = strlen(t2->name) + 2 + 1 + strlen(sc) + 1 + 1;
 			tmp = wave_alloca(tlen);
-			sprintf(tmp, "%s  (%s)", t2->name, sc);
+			if(!GLOBALS->is_vhdl_component_format)
+				{
+				sprintf(tmp, "%s  (%s)", t2->name, sc);
+				}
+			else
+				{
+				sprintf(tmp, "%s  : %s", t2->name, sc);
+				}
 			}
 			else
 			{
diff --git a/src/tree.h b/src/tree.h
index 71b179f..61dd907 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -85,6 +85,7 @@ enum tree_kind
    TREE_VHDL_ST_LINKAGE,
 
    /* FSDB VHDL scope types: FSDB also reuses/defines GHW's TREE_VHDL_ST_BLOCK, TREE_VHDL_ST_GENFOR, TREE_VHDL_ST_GENIF */
+   /* FST reuses TREE_VHDL_ST_PACKAGE */
    TREE_VHDL_ST_ARCHITECTURE,
    TREE_VHDL_ST_FUNCTION,
    TREE_VHDL_ST_PROCEDURE,
diff --git a/src/treesearch_gtk2.c b/src/treesearch_gtk2.c
index 9753443..4239465 100644
--- a/src/treesearch_gtk2.c
+++ b/src/treesearch_gtk2.c
@@ -25,6 +25,7 @@
 
 WAVE_NODEVARTYPE_STR
 WAVE_NODEVARDIR_STR
+WAVE_NODEVARDATATYPE_STR
 
 enum { VIEW_DRAG_INACTIVE, TREE_TO_VIEW_DRAG_ACTIVE, SEARCH_TO_VIEW_DRAG_ACTIVE };
 
@@ -111,6 +112,14 @@ return(s);
 }
 
 
+/* truncate VHDL types to string directly after final '.' */
+char *varxt_fix(char *s)
+{
+char *pnt = strrchr(s, '.');
+return(pnt ? (pnt+1) : s);
+}
+
+
 /* Fill the store model using current SIG_ROOT and FILTER_STR.  */
 void
 fill_sig_store (void)
@@ -136,9 +145,14 @@ fill_sig_store (void)
 	int is_tname = 0;
 	int wrexm;
 	int vardt;
+	unsigned int varxt;
+	char *varxt_pnt;
 
 	if(i < 0) continue;
 
+	varxt = GLOBALS->facs[i]->n->varxt;
+	varxt_pnt = varxt ? varxt_fix(GLOBALS->subvar_pnt[varxt]) : NULL;
+
 	vartype = GLOBALS->facs[i]->n->vartype;
 	if((vartype < 0) || (vartype > ND_VARTYPE_MAX))
 		{
@@ -200,9 +214,11 @@ fill_sig_store (void)
 			gtk_list_store_set (GLOBALS->sig_store_treesearch_gtk2_c_1, &iter,
 				    NAME_COLUMN, s,
 				    TREE_COLUMN, t,
-				    TYPE_COLUMN, vartype_strings[vartype],
+				    TYPE_COLUMN, 
+						(((GLOBALS->supplemental_datatypes_encountered) && (!GLOBALS->supplemental_vartypes_encountered)) ?
+							(varxt ? varxt_pnt : vardatatype_strings[vardt]) : vartype_strings[vartype]),
 				    DIR_COLUMN, vardir_strings[vardir],
-				    DTYPE_COLUMN, vardatatype_strings[vardt],
+				    DTYPE_COLUMN, varxt ? varxt_pnt : vardatatype_strings[vardt],
 				    -1);
 
 			if(s != t->name)
@@ -220,9 +236,11 @@ fill_sig_store (void)
 			gtk_list_store_set (GLOBALS->sig_store_treesearch_gtk2_c_1, &iter,
 				    NAME_COLUMN, s,
 				    TREE_COLUMN, t,
-				    TYPE_COLUMN, vartype_strings[vartype],
+				    TYPE_COLUMN, 
+						(((GLOBALS->supplemental_datatypes_encountered) && (!GLOBALS->supplemental_vartypes_encountered)) ?
+							(varxt ? varxt_pnt : vardatatype_strings[vardt]) : vartype_strings[vartype]),
 				    DIR_COLUMN, vardir_strings[vardir],
-				    DTYPE_COLUMN, vardatatype_strings[vardt],
+				    DTYPE_COLUMN, varxt ? varxt_pnt : vardatatype_strings[vardt],
 				    -1);
 			}
       		}
@@ -1433,12 +1451,12 @@ do_tooltips:
 		case VCD_FILE:
 		case VCD_RECODER_FILE:
 		case DUMPLESS_FILE:
-					column = gtk_tree_view_column_new_with_attributes (GLOBALS->supplemental_datatypes_encountered ? "VType" : "Type",
+					column = gtk_tree_view_column_new_with_attributes (((GLOBALS->supplemental_datatypes_encountered) && (GLOBALS->supplemental_vartypes_encountered)) ? "VType" : "Type",
 							   renderer,
 							   "text", TYPE_COLUMN,
 							   NULL);
 					gtk_tree_view_append_column (GTK_TREE_VIEW (sig_view), column);
-					if(GLOBALS->supplemental_datatypes_encountered)
+					if((GLOBALS->supplemental_datatypes_encountered) && (GLOBALS->supplemental_vartypes_encountered))
 						{
 						column = gtk_tree_view_column_new_with_attributes ("DType",
 							   renderer,
@@ -1712,12 +1730,12 @@ GtkWidget* treeboxframe(char *title, GtkSignalFunc func)
 		case VCD_FILE:
 		case VCD_RECODER_FILE:
 		case DUMPLESS_FILE:
-					column = gtk_tree_view_column_new_with_attributes (GLOBALS->supplemental_datatypes_encountered ? "VType" : "Type",
+					column = gtk_tree_view_column_new_with_attributes (((GLOBALS->supplemental_datatypes_encountered) && (GLOBALS->supplemental_vartypes_encountered)) ? "VType" : "Type",
 							   renderer,
 							   "text", TYPE_COLUMN,
 							   NULL);
 					gtk_tree_view_append_column (GTK_TREE_VIEW (sig_view), column);
-					if(GLOBALS->supplemental_datatypes_encountered)
+					if((GLOBALS->supplemental_datatypes_encountered) && (GLOBALS->supplemental_vartypes_encountered))
 						{
 						column = gtk_tree_view_column_new_with_attributes ("DType",
 							   renderer,
diff --git a/src/wavewindow.c b/src/wavewindow.c
index 9884da4..0abf467 100644
--- a/src/wavewindow.c
+++ b/src/wavewindow.c
@@ -4033,32 +4033,48 @@ if(!(h->flags&(HIST_REAL|HIST_STRING)))
         }       
 /* type = (!(h->flags&(HIST_REAL|HIST_STRING))) ? vtype(t,h->v.h_vector) : AN_0; */
 if(_x0>-1) {
+GdkGC *gltype, *gtype;
+
+switch(lasttype)
+	{
+	case AN_X:	gltype = GLOBALS->gc.gc_x_wavewindow_c_1; break;
+	case AN_U:	gltype = GLOBALS->gc.gc_u_wavewindow_c_1; break;
+	default:	gltype = GLOBALS->gc.gc_vtrans_wavewindow_c_1; break;
+	}
+switch(type)
+	{
+	case AN_X:	gtype = GLOBALS->gc.gc_x_wavewindow_c_1; break;
+	case AN_U:	gtype = GLOBALS->gc.gc_u_wavewindow_c_1; break;
+	default:	gtype = GLOBALS->gc.gc_vtrans_wavewindow_c_1; break;
+	}
+
 if(GLOBALS->use_roundcaps)
 	{
+
 	if (type == AN_Z) {
 		if (lasttype != -1) {
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0-1, _y0,_x0,   yu);
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0-1, _y1);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0-1, _y0,_x0,   yu);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0, yu,_x0-1, _y1);
 		}
 	} else
 	if (lasttype==AN_Z) {
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0+1, _y0,_x0,   yu);
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0+1, _y1);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0+1, _y0,_x0,   yu);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0, yu,_x0+1, _y1);
 	} else {
 		if (lasttype != type) {
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0-1, _y0,_x0,   yu);
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0-1, _y1);
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0+1, _y0,_x0,   yu);
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0+1, _y1);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0-1, _y0,_x0,   yu);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0, yu,_x0-1, _y1);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0+1, _y0,_x0,   yu);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0, yu,_x0+1, _y1);
 		} else {
-	wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0-2, _y0,_x0+2, _y1);
-	wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0+2, _y0,_x0-2, _y1);
+	wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0-2, _y0,_x0+2, _y1);
+	wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0+2, _y0,_x0-2, _y1);
 		}
 	}
 	}
 	else
 	{
-	wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, _y0,_x0, _y1);
+	wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0, _y0,_x0, _y1);
 	}
 }
 		
@@ -4820,41 +4836,56 @@ if(_x1>GLOBALS->wavewidth)
 type = vtype2(t,h);
 
 if(_x0>-1) {
+GdkGC *gltype, *gtype;
+
+switch(lasttype)
+	{
+	case AN_X:	gltype = GLOBALS->gc.gc_x_wavewindow_c_1; break;
+	case AN_U:	gltype = GLOBALS->gc.gc_u_wavewindow_c_1; break;
+	default:	gltype = GLOBALS->gc.gc_vtrans_wavewindow_c_1; break;
+	}
+switch(type)
+	{
+	case AN_X:	gtype = GLOBALS->gc.gc_x_wavewindow_c_1; break;
+	case AN_U:	gtype = GLOBALS->gc.gc_u_wavewindow_c_1; break;
+	default:	gtype = GLOBALS->gc.gc_vtrans_wavewindow_c_1; break;
+	}
+
 if(GLOBALS->use_roundcaps)
 	{
 	if (type == AN_Z) 
 		{
 		if (lasttype != -1) 
 			{
-			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0-1, _y0,_x0,   yu);
-			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0-1, _y1);
+			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0-1, _y0,_x0,   yu);
+			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0, yu,_x0-1, _y1);
 			}
 		} 
 		else
 		if (lasttype==AN_Z) 
 			{
-			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0+1, _y0,_x0,   yu);
-			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0+1, _y1);
+			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0+1, _y0,_x0,   yu);
+			wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0, yu,_x0+1, _y1);
 			} 
 			else 
 			{
 			if (lasttype != type) 
 				{
-				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0-1, _y0,_x0,   yu);
-				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (lasttype==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0-1, _y1);
-				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0+1, _y0,_x0,   yu);
-				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, yu,_x0+1, _y1);
+				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0-1, _y0,_x0,   yu);
+				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gltype,_x0, yu,_x0-1, _y1);
+				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0+1, _y0,_x0,   yu);
+				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0, yu,_x0+1, _y1);
 				} 
 				else 
 				{
-				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0-2, _y0,_x0+2, _y1);
-				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0+2, _y0,_x0-2, _y1);
+				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0-2, _y0,_x0+2, _y1);
+				wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0+2, _y0,_x0-2, _y1);
 				}
 			}
 		}
 		else
 		{
-		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, (type==AN_X? GLOBALS->gc.gc_x_wavewindow_c_1:GLOBALS->gc.gc_vtrans_wavewindow_c_1),_x0, _y0,_x0, _y1);
+		wave_gdk_draw_line(GLOBALS->wavepixmap_wavewindow_c_1, gtype,_x0, _y0,_x0, _y1);
 		}
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gtkwave.git



More information about the Pkg-electronics-commits mailing list