Codebase list gtkwave / 873e374
Imported Upstream version 3.3.39 أحمد المحمودي (Ahmed El-Mahmoudy) 11 years ago
30 changed file(s) with 492 addition(s) and 129 deletion(s). Raw diff Collapse all Expand all
00 Analog support is new as of 1.3.81 and should be considered experimental.
11 The analog waves are auto-scaling. Manual scaling will be added in a
22 future release. If you wish to make an analog wave taller, simply
3 highlight the wave you want to make larger and press CTRL-A to add extra
4 rows to the wave.
3 highlight the wave you want to make larger and right click-select Insert
4 Analog Height Extension from the popup menu.
55
66 Note that currently double floats are not written in a platform
77 independent manner with GHW files. This should not be an issue unless you
12361236 Changed twinwave for MinGW so that it does not target two
12371237 panes in a single window. Something is apparently now
12381238 broken in the GtkSocket/GtkPlug implementation for Win32.
1239 3.3.39 08aug12 Fixed relative pathnames when generated in MinGW and used
1240 back on Linux.
1241 Added --output filename option to fst2vcd, vzt2vcd, and
1242 lxt2vcd.
1243 Fix crash on OSX if gtk_widget_set_sensitive is called on
1244 a separator.
1245 Fixed OSX version so it looks for .gtkwaverc in the home
1246 directory and if not found, probes the resource bundle for
1247 Contents/Resources/examples/gtkwaverc (no dot in the name).
1248 Added GTKWave User's Guide option to help menu on OSX.
1249 Added + vs ++ separators for twinwave.
1250 Dynamic resize fixes.
00 ##########################################################################
11
2 GTKWave 3.3.37 Wave Viewer is Copyright (C) 1999-2012 Tony Bybell.
2 GTKWave 3.3.39 Wave Viewer is Copyright (C) 1999-2012 Tony Bybell.
33 Portions of GTKWave are Copyright (C) 1999-2012 Udi Finkelstein.
44 Context support is Copyright (C) 2007-2012 Kermin Elliott Fleming.
55 Trace group support is Copyright (C) 2009-2012 Donald Baltus.
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.63 for gtkwave 3.3.38.
2 # Generated by GNU Autoconf 2.63 for gtkwave 3.3.39.
33 #
44 # Report bugs to <bybell@rocketmail.com>.
55 #
595595 # Identity of this package.
596596 PACKAGE_NAME='gtkwave'
597597 PACKAGE_TARNAME='gtkwave'
598 PACKAGE_VERSION='3.3.38'
599 PACKAGE_STRING='gtkwave 3.3.38'
598 PACKAGE_VERSION='3.3.39'
599 PACKAGE_STRING='gtkwave 3.3.39'
600600 PACKAGE_BUGREPORT='bybell@rocketmail.com'
601601
602602 ac_unique_file="src/vcd.c"
13851385 # Omit some internal or obsolete options to make the list less imposing.
13861386 # This message is too long to be a string in the A/UX 3.1 sh.
13871387 cat <<_ACEOF
1388 \`configure' configures gtkwave 3.3.38 to adapt to many kinds of systems.
1388 \`configure' configures gtkwave 3.3.39 to adapt to many kinds of systems.
13891389
13901390 Usage: $0 [OPTION]... [VAR=VALUE]...
13911391
14511451
14521452 if test -n "$ac_init_help"; then
14531453 case $ac_init_help in
1454 short | recursive ) echo "Configuration of gtkwave 3.3.38:";;
1454 short | recursive ) echo "Configuration of gtkwave 3.3.39:";;
14551455 esac
14561456 cat <<\_ACEOF
14571457
15881588 test -n "$ac_init_help" && exit $ac_status
15891589 if $ac_init_version; then
15901590 cat <<\_ACEOF
1591 gtkwave configure 3.3.38
1591 gtkwave configure 3.3.39
15921592 generated by GNU Autoconf 2.63
15931593
15941594 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
16021602 This file contains any messages produced by compilers while
16031603 running configure, to aid debugging if configure makes a mistake.
16041604
1605 It was created by gtkwave $as_me 3.3.38, which was
1605 It was created by gtkwave $as_me 3.3.39, which was
16061606 generated by GNU Autoconf 2.63. Invocation command line was
16071607
16081608 $ $0 $@
24522452
24532453 # Define the identity of the package.
24542454 PACKAGE='gtkwave'
2455 VERSION='3.3.38'
2455 VERSION='3.3.39'
24562456
24572457
24582458 cat >>confdefs.h <<_ACEOF
1429614296 # report actual input values of CONFIG_FILES etc. instead of their
1429714297 # values after options handling.
1429814298 ac_log="
14299 This file was extended by gtkwave $as_me 3.3.38, which was
14299 This file was extended by gtkwave $as_me 3.3.39, which was
1430014300 generated by GNU Autoconf 2.63. Invocation command line was
1430114301
1430214302 CONFIG_FILES = $CONFIG_FILES
1435914359 _ACEOF
1436014360 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1436114361 ac_cs_version="\\
14362 gtkwave config.status 3.3.38
14362 gtkwave config.status 3.3.39
1436314363 configured by $0, generated by GNU Autoconf 2.63,
1436414364 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
1436514365
11 # Process this file with autoconf to produce a configure script.
22
33 AC_PREREQ(2.59)
4 AC_INIT(gtkwave, 3.3.38, bybell@rocketmail.com)
4 AC_INIT(gtkwave, 3.3.39, bybell@rocketmail.com)
55 AC_CONFIG_SRCDIR([src/vcd.c])
66 AM_INIT_AUTOMAKE
77 AC_CONFIG_HEADER([config.h])
6464 <binary>${prefix}/bin/vcd2vzt</binary>
6565 <binary>${prefix}/bin/vzt2vcd</binary>
6666 <binary>${prefix}/bin/vztminer</binary>
67 <binary>${prefix}/bin/fstminer</binary>
6768 <binary>${prefix}/bin/rtlbrowse</binary>
6869 <binary>${prefix}/bin/vermin</binary>
6970
212213 <data dest="${bundle}/Contents/Resources/man/vztminer.1">
213214 ${project}/../../man/vztminer.1
214215 </data>
216 <data dest="${bundle}/Contents/Resources/man/fstminer.1">
217 ${project}/../../man/fstminer.1
218 </data>
215219 <data dest="${bundle}/Contents/Resources/doc/gtkwave.odt">
216220 ${project}/../../doc/gtkwave.odt
221 </data>
222 <data dest="${bundle}/Contents/Resources/doc/gtkwave.pdf">
223 ${project}/gtkwave.pdf
217224 </data>
218225
219226
00 #!/bin/sh
1
2 if [ -f ./gtkwave.pdf ]
3 then
4 echo Skipping download of gtkwave.pdf
5 else
6 echo Downloading gtkwave.pdf...
7 curl http://gtkwave.sourceforge.net/gtkwave.pdf >gtkwave.pdf
8 fi
19
210 gcc -o ../../examples/transaction ../../examples/transaction.c -DHAVE_INTTYPES_H
311
Binary diff not shown
0 .TH "FST2VCD" "1" "3.2.2" "Anthony Bybell" "Filetype Conversion"
0 .TH "FST2VCD" "1" "3.3.29" "Anthony Bybell" "Filetype Conversion"
11 .SH "NAME"
22 .LP
33 fst2vcd \- Converts FST files to VCD
66 fst2vcd [\fIoption\fP]... [\fIFSTFILE\fP]
77 .SH "DESCRIPTION"
88 .LP
9 Converts FST files to VCD files on stdout.
9 Converts FST files to VCD files. If an output filename is not specified, the VCD is emitted to stdout.
1010
1111 .SH "OPTIONS"
1212 .LP
1313 .TP
1414 \fB\-f,\-\-fstname\fR <\fIfilename\fP>
1515 Specify FST input filename.
16 .TP
17 \fB\-o,\-\-output\fR <\fIfilename\fP>
18 Specify optional VCD output filename.
1619 .TP
1720 \fB\-h,\-\-help\fR
1821 Display help then exit.
0 .TH "LXT2VCD" "1" "3.2.2" "Anthony Bybell" "Filetype Conversion"
0 .TH "LXT2VCD" "1" "3.3.39" "Anthony Bybell" "Filetype Conversion"
11 .SH "NAME"
22 .LP
33 lxt2vcd \- Converts LXT2 files to VCD
66 lxt2vcd [\fIoption\fP]... [\fILXT2FILE\fP]
77 .SH "DESCRIPTION"
88 .LP
9 Converts LXT2 files to VCD files on stdout. Note that "regular" LXT2 files will convert to VCD files with monotonically increasing time values. LXT2
9 Converts LXT2 files to VCD files on stdout. If an output filename is not specified, the VCD is emitted to stdout. Note that "regular" LXT2 files will convert to VCD files with monotonically increasing time values. LXT2
1010 files which are dumped with the "partial" option (to speed up access in wave viewers) will dump with monotonically increasing time values per 2k block
1111 of nets. This may be fixed in later versions of \fIlxt2vcd\fP.
1212
1515 .TP
1616 \fB\-l,\-\-lxtname\fR <\fIfilename\fP>
1717 Specify LXT2 input filename.
18 .TP
19 \fB\-o,\-\-output\fR <\fIfilename\fP>
20 Specify optional VCD output filename.
1821 .TP
1922 \fB\-f,\-\-flatearth\fR
2023 Emit flattened hierarchies.
0 .TH "TWINWAVE" "1" "3.3.28" "Anthony Bybell" "Simulation Wave Viewer Multiplexer"
0 .TH "TWINWAVE" "1" "3.3.39" "Anthony Bybell" "Simulation Wave Viewer Multiplexer"
11 .SH "NAME"
22 .LP
3 twinwave \- Wraps multiple GTKWave sessions in one window
3 twinwave \- Wraps multiple GTKWave sessions in one window or two synchronized windows
44 .SH "SYNTAX"
55 .LP
6 twinwave <\fIarglist1\fP> + <\fIarglist2\fP>
6 twinwave <\fIarglist1\fP> <\fIseparator\fP> <\fIarglist2\fP>
77 .SH "DESCRIPTION"
88 .LP
9 Wraps multiple GTKWave sessions in one window with synchronized markers, horizontal scrolling, and zooming.
9 Wraps multiple GTKWave sessions with synchronized markers, horizontal scrolling, and zooming.
1010 .SH "EXAMPLES"
1111 .LP
1212 To run this program the standard way type:
1313 .TP
1414 twinwave filename1.vcd filename1.sav + filename2.vcd filename2.sav
15 Two viewers are then opened in one window.
15 Two synchronized viewers are then opened in one window.
16 .TP
17 twinwave filename1.vcd filename1.sav ++ filename2.vcd filename2.sav
18 Two synchronized viewers are then opened in two windows.
1619 .SH "LIMITATIONS"
1720 \fItwinwave\fP uses the GtkSocket/GtkPlug mechanism to embed two \fIgtkwave\fP(1) sessions into one window. The amount of
1821 coupling is currently limited to communication of temporal information. Other than that, the two gtkwave processes are isolated
2023 Keep in mind that using the same save file for each session
2124 may cause unintended behavior problems if the save file is written back to disk: only the session written last will be saved. (i.e.,
2225 the save file isn't cloned and made unique to each session.)
23 Note that \fItwinwave\fP compiled against Quartz (not X11) on OSX does not place both sessions in a single window.
26 Note that \fItwinwave\fP compiled against Quartz (not X11) on OSX as well as MinGW does not place both sessions in a single window.
2427 .LP
2528 .SH "AUTHORS"
2629 .LP
0 .TH "VZT2VCD" "1" "3.2.2" "Anthony Bybell" "Filetype Conversion"
0 .TH "VZT2VCD" "1" "3.3.39" "Anthony Bybell" "Filetype Conversion"
11 .SH "NAME"
22 .LP
33 vzt2vcd \- Converts VZT files to VCD
66 vzt2vcd [\fIoption\fP]... [\fIVZTFILE\fP]
77 .SH "DESCRIPTION"
88 .LP
9 Converts VZT files to VCD files on stdout.
9 Converts VZT files to VCD files. If an output filename is not specified, the VCD is emitted to stdout.
1010
1111 .SH "OPTIONS"
1212 .LP
1313 .TP
1414 \fB\-v,\-\-vztname\fR <\fIfilename\fP>
1515 Specify VZT input filename.
16 .TP
17 \fB\-o,\-\-output\fR <\fIfilename\fP>
18 Specify optional VCD output filename.
1619 .TP
1720 \fB\-f,\-\-flatearth\fR
1821 Emit flattened hierarchies.
1212
1313 #include "alert_sheet.m"
1414 #include <sys/stat.h>
15
16 /*************************/
17 /* menu.c */
18 /*************************/
19
20 void gtk_open_external_file(const char *fpath)
21 {
22 NSString *nspath = [NSString stringWithUTF8String:fpath];
23 [[NSWorkspace sharedWorkspace] openFile:nspath];
24 }
25
1526
1627 /*************************/
1728 /* file.c */
1414 #endif
1515 #include <gtk/gtk.h>
1616
17 void gtk_open_external_file(const char *fpath);
1718 char *gtk_file_req_bridge(const char *title, const char *fpath, const char *pattn, int is_writemode);
1819 int gtk_simplereqbox_req_bridge(char *title, char *default_text, char *oktext, char *canceltext, int is_alert);
1920 int entrybox_req_bridge(char *title, int width, char *dflt_text, char *comment, int maxch, char **out_text_entry);
798798 0, /* signal_fill_width 374 */
799799 0, /* old_signal_fill_width 375 */
800800 0, /* old_signal_fill_height */
801 1, /* right_align_active */
801802 1, /* fontheight 376 */
802803 0, /* dnd_state 377 */
803804 0, /* dnd_cursor_timer */
12291230 0, /* use_big_fonts 594 */
12301231 0, /* use_nonprop_fonts */
12311232 ~0, /* do_resize_signals 595 */
1233 ~0, /* first_unsized_signals */
12321234 0, /* initial_signal_window_width */
12331235 0, /* constant_marker_update 596 */
12341236 0, /* use_roundcaps 597 */
797797 int signal_fill_width; /* from signalwindow.c 401 */
798798 int old_signal_fill_width; /* from signalwindow.c 402 */
799799 int old_signal_fill_height; /* from signalwindow.c 403 */
800 int right_align_active; /* from signalwindow.c */
800801 int fontheight; /* from signalwindow.c 404 */
801802 char dnd_state; /* from signalwindow.c 405 */
802803 unsigned int dnd_cursor_timer; /* from signalwindow.c */
12141215 char use_big_fonts; /* from wavewindow.c 648 */
12151216 char use_nonprop_fonts; /* from wavewindow.c 649 */
12161217 char do_resize_signals; /* from wavewindow.c 650 */
1218 char first_unsized_signals;
12171219 int initial_signal_window_width;
12181220 char constant_marker_update; /* from wavewindow.c 651 */
12191221 char use_roundcaps; /* from wavewindow.c 652 */
2828
2929 #include "wave_locale.h"
3030
31 #define FST_VCD_WRITE_BUF_SIZ (2 * 1024 * 1024)
32
3133 void print_help(char *nam)
3234 {
3335 #ifdef __linux__
3436 printf(
3537 "Usage: %s [OPTION]... [FSTFILE]\n\n"
3638 " -f, --fstname=FILE specify FST input filename\n"
39 " -o, --output=FILE specify output filename\n"
3740 " -h, --help display this help then exit\n\n"
38 "VCD is emitted to stdout.\n\n"
41 "VCD is emitted to stdout if output filename is unspecified.\n\n"
3942 "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam);
4043 #else
4144 printf(
4245 "Usage: %s [OPTION]... [FSTFILE]\n\n"
4346 " -f specify FST input filename\n"
47 " -o specify output filename\n"
4448 " -h display this help then exit\n\n"
45
46 "FST is emitted to stdout.\n\n"
49 "VCD is emitted to stdout if output filename is unspecified.\n\n"
4750 "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam);
4851 #endif
4952
5558 {
5659 char opt_errors_encountered=0;
5760 char *fstname=NULL;
61 char *outname=NULL;
62 char *fvbuf=NULL;
5863 int c;
5964 struct fstReaderContext *xc;
6065 FILE *fv;
6974 static struct option long_options[] =
7075 {
7176 {"fstname", 1, 0, 'f'},
77 {"output", 1, 0, 'o'},
7278 {"help", 0, 0, 'h'},
7379 {0, 0, 0, 0}
7480 };
7581
76 c = getopt_long (argc, argv, "f:h", long_options, &option_index);
82 c = getopt_long (argc, argv, "f:o:h", long_options, &option_index);
7783 #else
78 c = getopt (argc, argv, "f:h");
84 c = getopt (argc, argv, "f:o:h");
7985 #endif
8086
8187 if (c == -1) break; /* no more args */
8692 if(fstname) free(fstname);
8793 fstname = malloc(strlen(optarg)+1);
8894 strcpy(fstname, optarg);
95 break;
96
97 case 'o':
98 if(outname) free(outname);
99 outname = malloc(strlen(optarg)+1);
100 strcpy(outname, optarg);
89101 break;
90102
91103 case 'h':
129141
130142 if(!xc)
131143 {
132 fprintf(stderr, "could not open '%s', exiting.\n", fstname);
144 fprintf(stderr, "Could not open '%s', exiting.\n", fstname);
133145 exit(255);
134146 }
135147
136 fv = stdout;
148 if(outname)
149 {
150 fv = fopen(outname, "wb");
151 if(!fv)
152 {
153 fprintf(stderr, "Could not open '%s', exiting.\n", outname);
154 perror("Why");
155 exit(255);
156 }
157 fvbuf = malloc(FST_VCD_WRITE_BUF_SIZ);
158 setvbuf(fv, fvbuf, _IOFBF, FST_VCD_WRITE_BUF_SIZ);
159 }
160 else
161 {
162 fv = stdout;
163 }
164
137165 if(!fstReaderProcessHier(xc, fv)) /* these 3 lines do all the VCD writing work */
138166 {
139167 fprintf(stderr, "could not process hierarchy for '%s', exiting.\n", fstname);
143171 fstReaderIterBlocks(xc, NULL, NULL, fv); /* these 3 lines do all the VCD writing work */
144172
145173 fstReaderClose(xc);
174
175 if(outname)
176 {
177 free(outname);
178 fclose(fv);
179 }
180
181 free(fvbuf);
146182 free(fstname);
147183
148184 exit(0);
3333 static int names_only = 0;
3434 static char *killed_list = NULL;
3535 char killed_value = 1;
36
37 extern void free_hier(void);
38 extern char *output_hier(char *name);
3936
4037 char vcd_blackout;
4138
3030
3131 #include "wave_locale.h"
3232
33 #define LXT_VCD_WRITE_BUF_SIZ (2 * 1024 * 1024)
34
3335 int flat_earth = 0;
3436 int notruncate = 0;
37 static FILE *fv = NULL;
38
3539 extern void free_hier(void);
36 extern char *output_hier(char *name);
40 extern char *fv_output_hier(FILE *fv, char *name);
3741
3842
3943 /*
122126 if(vcd_prevtime != *pnt_time)
123127 {
124128 vcd_prevtime = *pnt_time;
125 printf("#"LXT2_RD_LLD"\n", *pnt_time);
129 fprintf(fv, "#"LXT2_RD_LLD"\n", *pnt_time);
126130 }
127131
128132 if(!(*pnt_value)[0])
130134 if(!vcd_blackout)
131135 {
132136 vcd_blackout = 1;
133 printf("$dumpoff\n");
137 fprintf(fv, "$dumpoff\n");
134138 }
135139
136140 return;
140144 if(vcd_blackout)
141145 {
142146 vcd_blackout = 0;
143 printf("$dumpon\n");
147 fprintf(fv, "$dumpon\n");
144148 }
145149 }
146150
147151 if(g->flags & LXT2_RD_SYM_F_DOUBLE)
148152 {
149 printf("r%s %s\n", *pnt_value, vcdid(*pnt_facidx));
153 fprintf(fv, "r%s %s\n", *pnt_value, vcdid(*pnt_facidx));
150154 }
151155 else
152156 if(g->flags & LXT2_RD_SYM_F_STRING)
153157 {
154 printf("s%s %s\n", *pnt_value, vcdid(*pnt_facidx));
158 fprintf(fv, "s%s %s\n", *pnt_value, vcdid(*pnt_facidx));
155159 }
156160 else
157161 {
158162 if(g->len==1)
159163 {
160 printf("%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx));
164 fprintf(fv, "%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx));
161165 }
162166 else
163167 {
164 printf("b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx));
168 fprintf(fv, "b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx));
165169 }
166170 }
167171 }
215219 }
216220
217221 time(&walltime);
218 printf("$date\n");
219 printf("\t%s",asctime(localtime(&walltime)));
220 printf("$end\n");
221 printf("$version\n\tlxt2vcd\n$end\n");
222 printf("$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's');
222 fprintf(fv, "$date\n");
223 fprintf(fv, "\t%s",asctime(localtime(&walltime)));
224 fprintf(fv, "$end\n");
225 fprintf(fv, "$version\n\tlxt2vcd\n$end\n");
226 fprintf(fv, "$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's');
223227
224228 timezero = lxt2_rd_get_timezero(lt);
225229 if(timezero)
226230 {
227 printf("$timezero "LXT2_RD_LLD" $end\n", timezero);
231 fprintf(fv, "$timezero "LXT2_RD_LLD" $end\n", timezero);
228232 }
229233
230234 for(i=0;i<numfacs;i++)
234238
235239 if(!flat_earth)
236240 {
237 netname = output_hier(lxt2_rd_get_facname(lt, i));
241 netname = fv_output_hier(fv, lxt2_rd_get_facname(lt, i));
238242 }
239243 else
240244 {
243247
244248 if(g->flags & LXT2_RD_SYM_F_DOUBLE)
245249 {
246 printf("$var real 1 %s %s $end\n", vcdid(newindx), netname);
250 fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname);
247251 }
248252 else
249253 if(g->flags & LXT2_RD_SYM_F_STRING)
250254 {
251 printf("$var real 1 %s %s $end\n", vcdid(newindx), netname);
255 fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname);
252256 }
253257 else
254258
257261 {
258262 if(g->msb!=-1)
259263 {
260 printf("$var wire 1 %s %s ["LXT2_RD_LD"] $end\n", vcdid(newindx), netname, g->msb);
264 fprintf(fv, "$var wire 1 %s %s ["LXT2_RD_LD"] $end\n", vcdid(newindx), netname, g->msb);
261265 }
262266 else
263267 {
264 printf("$var wire 1 %s %s $end\n", vcdid(newindx), netname);
268 fprintf(fv, "$var wire 1 %s %s $end\n", vcdid(newindx), netname);
265269 }
266270 }
267271 else
268272 {
269273 if(!(g->flags & LXT2_RD_SYM_F_INTEGER))
270274 {
271 printf("$var wire "LXT2_RD_LD" %s %s ["LXT2_RD_LD":"LXT2_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb);
275 fprintf(fv, "$var wire "LXT2_RD_LD" %s %s ["LXT2_RD_LD":"LXT2_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb);
272276 }
273277 else
274278 {
275 printf("$var integer "LXT2_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname);
279 fprintf(fv, "$var integer "LXT2_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname);
276280 }
277281 }
278282 }
280284
281285 if(!flat_earth)
282286 {
283 output_hier(""); /* flush any remaining hierarchy if not back to toplevel */
287 fv_output_hier(fv, ""); /* flush any remaining hierarchy if not back to toplevel */
284288 free_hier();
285289 }
286290
287 printf("$enddefinitions $end\n");
288 printf("$dumpvars\n");
291 fprintf(fv, "$enddefinitions $end\n");
292 fprintf(fv, "$dumpvars\n");
289293
290294 vcd_prevtime = lxt2_rd_get_start_time(lt)-1;
291295
293297
294298 if(vcd_prevtime!=lxt2_rd_get_end_time(lt))
295299 {
296 printf("#"LXT2_RD_LLD"\n", lxt2_rd_get_end_time(lt));
300 fprintf(fv, "#"LXT2_RD_LLD"\n", lxt2_rd_get_end_time(lt));
297301 }
298302
299303 lxt2_rd_close(lt);
315319 printf(
316320 "Usage: %s [OPTION]... [LXT2FILE]\n\n"
317321 " -l, --lxtname=FILE specify LXT2 input filename\n"
322 " -o, --output=FILE specify output filename\n"
318323 " -f, --flatearth emit flattened hierarchies\n"
319324 " -n, --notruncate do not shorten bitvectors\n"
320325 " -h, --help display this help then exit\n\n"
321 "VCD is emitted to stdout.\n\n"
326 "VCD is emitted to stdout if output filename is unspecified.\n\n"
322327 "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam);
323328 #else
324329 printf(
325330 "Usage: %s [OPTION]... [LXT2FILE]\n\n"
326331 " -l specify LXT2 input filename\n"
332 " -o specify output filename\n"
327333 " -f emit flattened hierarchies\n"
328334 " -n do not shorten bitvectors\n"
329335 " -h display this help then exit\n\n"
330
331 "VCD is emitted to stdout.\n\n"
336 "VCD is emitted to stdout if output filename is unspecified.\n\n"
332337 "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam);
333338 #endif
334339
340345 {
341346 char opt_errors_encountered=0;
342347 char *lxname=NULL;
348 char *outname=NULL;
349 char *fvbuf=NULL;
343350 int c;
344351 int rc;
345352
353360 static struct option long_options[] =
354361 {
355362 {"lxtname", 1, 0, 'l'},
363 {"output", 1, 0, 'o'},
356364 {"flatearth", 0, 0, 'f'},
357365 {"notruncate", 0, 0, 'n'},
358366 {"help", 0, 0, 'h'},
359367 {0, 0, 0, 0}
360368 };
361369
362 c = getopt_long (argc, argv, "l:fnh", long_options, &option_index);
370 c = getopt_long (argc, argv, "l:o:fnh", long_options, &option_index);
363371 #else
364 c = getopt (argc, argv, "l:fnh");
372 c = getopt (argc, argv, "l:o:fnh");
365373 #endif
366374
367375 if (c == -1) break; /* no more args */
374382 strcpy(lxname, optarg);
375383 break;
376384
385 case 'o':
386 if(outname) free(outname);
387 outname = malloc(strlen(optarg)+1);
388 strcpy(outname, optarg);
389 break;
390
377391 case 'f': flat_earth=1;
378392 break;
379393
416430 print_help(argv[0]);
417431 }
418432
433 if(outname)
434 {
435 fv = fopen(outname, "wb");
436 if(!fv)
437 {
438 fprintf(stderr, "Could not open '%s', exiting.\n", outname);
439 perror("Why");
440 exit(255);
441 }
442 fvbuf = malloc(LXT_VCD_WRITE_BUF_SIZ);
443 setvbuf(fv, fvbuf, _IOFBF, LXT_VCD_WRITE_BUF_SIZ);
444 }
445 else
446 {
447 fv = stdout;
448 }
449
419450 rc=process_lxt(lxname);
451
452 if(outname)
453 {
454 free(outname);
455 fclose(fv);
456 }
457
458 free(fvbuf);
420459 free(lxname);
421460
422461 return(rc);
5151 * navigate up and down the scope hierarchy and
5252 * emit the appropriate vcd scope primitives
5353 */
54 static void diff_hier(struct namehier *nh1, struct namehier *nh2)
54 static void diff_hier(FILE *fv, struct namehier *nh1, struct namehier *nh2)
5555 {
5656 if(!nh2)
5757 {
5858 while((nh1)&&(nh1->not_final))
5959 {
60 printf("$scope module %s $end\n", nh1->name);
60 fprintf(fv, "$scope module %s $end\n", nh1->name);
6161 nh1=nh1->next;
6262 }
6363 return;
7474 {
7575 while((nh1)&&(nh1->not_final))
7676 {
77 printf("$scope module %s $end\n", nh1->name);
77 fprintf(fv, "$scope module %s $end\n", nh1->name);
7878 nh1=nh1->next;
7979 }
8080 break;
8484 {
8585 while((nh2)&&(nh2->not_final))
8686 {
87 printf("$upscope $end\n");
87 fprintf(fv, "$upscope $end\n");
8888 nh2=nh2->next;
8989 }
9090 break;
9595 /* prune old hier */
9696 while((nh2)&&(nh2->not_final))
9797 {
98 printf("$upscope $end\n");
98 fprintf(fv, "$upscope $end\n");
9999 nh2=nh2->next;
100100 }
101101
102102 /* add new hier */
103103 while((nh1)&&(nh1->not_final))
104104 {
105 printf("$scope module %s $end\n", nh1->name);
105 fprintf(fv, "$scope module %s $end\n", nh1->name);
106106 nh1=nh1->next;
107107 }
108108 break;
117117 /*
118118 * output scopedata for a given name if needed, return pointer to name string
119119 */
120 char *output_hier(char *name)
120 char *fv_output_hier(FILE *fv, char *name)
121121 {
122122 char *pnt, *pnt2;
123123 char *s;
150150 pnt=(++pnt2);
151151 }
152152
153 diff_hier(nh_head, nhold);
153 diff_hier(fv, nh_head, nhold);
154154 free_hier();
155155 nhold=nh_head;
156156
3030
3131 #include "wave_locale.h"
3232
33 #define VZT_VCD_WRITE_BUF_SIZ (2 * 1024 * 1024)
34
3335 static int flat_earth = 0;
3436 static int vectorize = 0;
3537 static int notruncate = 0;
38 static FILE *fv = NULL;
3639
3740 extern void free_hier(void);
38 extern char *output_hier(char *name);
39
41 extern char *fv_output_hier(FILE *fv, char *name);
4042
4143 /*
4244 * generate a vcd identifier for a given facindx
124126 if(vcd_prevtime != *pnt_time)
125127 {
126128 vcd_prevtime = *pnt_time;
127 printf("#"VZT_RD_LLD"\n", *pnt_time);
129 fprintf(fv, "#"VZT_RD_LLD"\n", *pnt_time);
128130 }
129131
130132 if(!(*pnt_value)[0])
132134 if(!vcd_blackout)
133135 {
134136 vcd_blackout = 1;
135 printf("$dumpoff\n");
137 fprintf(fv, "$dumpoff\n");
136138 }
137139
138140 return;
142144 if(vcd_blackout)
143145 {
144146 vcd_blackout = 0;
145 printf("$dumpon\n");
147 fprintf(fv, "$dumpon\n");
146148 }
147149 }
148150
149151 if(g->flags & VZT_RD_SYM_F_DOUBLE)
150152 {
151 printf("r%s %s\n", *pnt_value, vcdid(*pnt_facidx));
153 fprintf(fv, "r%s %s\n", *pnt_value, vcdid(*pnt_facidx));
152154 }
153155 else
154156 if(g->flags & VZT_RD_SYM_F_STRING)
155157 {
156 printf("s%s %s\n", *pnt_value, vcdid(*pnt_facidx));
158 fprintf(fv, "s%s %s\n", *pnt_value, vcdid(*pnt_facidx));
157159 }
158160 else
159161 {
160162 if(g->len==1)
161163 {
162 printf("%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx));
164 fprintf(fv, "%c%s\n", (*pnt_value)[0], vcdid(*pnt_facidx));
163165 }
164166 else
165167 {
166 printf("b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx));
168 fprintf(fv, "b%s %s\n", vcd_truncate_bitvec(*pnt_value), vcdid(*pnt_facidx));
167169 }
168170 }
169171 }
219221 }
220222
221223 time(&walltime);
222 printf("$date\n");
223 printf("\t%s",asctime(localtime(&walltime)));
224 printf("$end\n");
225 printf("$version\n\tvzt2vcd\n$end\n");
226 printf("$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's');
224 fprintf(fv, "$date\n");
225 fprintf(fv, "\t%s",asctime(localtime(&walltime)));
226 fprintf(fv, "$end\n");
227 fprintf(fv, "$version\n\tvzt2vcd\n$end\n");
228 fprintf(fv, "$timescale %d%c%c $end\n", time_scale, time_dimension, !scale ? ' ' : 's');
227229
228230 timezero = vzt_rd_get_timezero(lt);
229231 if(timezero)
230232 {
231 printf("$timezero "VZT_RD_LLD" $end\n", timezero);
233 fprintf(fv, "$timezero "VZT_RD_LLD" $end\n", timezero);
232234 }
233235
234236 for(i=0;i<numfacs;i++)
243245
244246 if(!flat_earth)
245247 {
246 netname = output_hier(vzt_rd_get_facname(lt, i));
248 netname = fv_output_hier(fv, vzt_rd_get_facname(lt, i));
247249 }
248250 else
249251 {
252254
253255 if(g->flags & VZT_RD_SYM_F_DOUBLE)
254256 {
255 printf("$var real 1 %s %s $end\n", vcdid(newindx), netname);
257 fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname);
256258 }
257259 else
258260 if(g->flags & VZT_RD_SYM_F_STRING)
259261 {
260 printf("$var real 1 %s %s $end\n", vcdid(newindx), netname);
262 fprintf(fv, "$var real 1 %s %s $end\n", vcdid(newindx), netname);
261263 }
262264 else
263265
266268 {
267269 if(g->msb!=-1)
268270 {
269 printf("$var wire 1 %s %s ["VZT_RD_LD"] $end\n", vcdid(newindx), netname, g->msb);
271 fprintf(fv, "$var wire 1 %s %s ["VZT_RD_LD"] $end\n", vcdid(newindx), netname, g->msb);
270272 }
271273 else
272274 {
273 printf("$var wire 1 %s %s $end\n", vcdid(newindx), netname);
275 fprintf(fv, "$var wire 1 %s %s $end\n", vcdid(newindx), netname);
274276 }
275277 }
276278 else
277279 {
278280 if(!(g->flags & VZT_RD_SYM_F_INTEGER))
279281 {
280 if(g->len) printf("$var wire "VZT_RD_LD" %s %s ["VZT_RD_LD":"VZT_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb);
282 if(g->len) fprintf(fv, "$var wire "VZT_RD_LD" %s %s ["VZT_RD_LD":"VZT_RD_LD"] $end\n", g->len, vcdid(newindx), netname, g->msb, g->lsb);
281283 }
282284 else
283285 {
284 printf("$var integer "VZT_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname);
286 fprintf(fv, "$var integer "VZT_RD_LD" %s %s $end\n", g->len, vcdid(newindx), netname);
285287 }
286288 }
287289 }
289291
290292 if(!flat_earth)
291293 {
292 output_hier(""); /* flush any remaining hierarchy if not back to toplevel */
294 fv_output_hier(fv, ""); /* flush any remaining hierarchy if not back to toplevel */
293295 free_hier();
294296 }
295297
296 printf("$enddefinitions $end\n");
297 printf("$dumpvars\n");
298 fprintf(fv, "$enddefinitions $end\n");
299 fprintf(fv, "$dumpvars\n");
298300
299301 vcd_prevtime = vzt_rd_get_start_time(lt)-1;
300302
302304
303305 if(vcd_prevtime!=vzt_rd_get_end_time(lt))
304306 {
305 printf("#"VZT_RD_LLD"\n", vzt_rd_get_end_time(lt));
307 fprintf(fv, "#"VZT_RD_LLD"\n", vzt_rd_get_end_time(lt));
306308 }
307309
308310 vzt_rd_close(lt);
324326 printf(
325327 "Usage: %s [OPTION]... [VZTFILE]\n\n"
326328 " -v, --vztname=FILE specify VZT input filename\n"
329 " -o, --output=FILE specify output filename\n"
327330 " -f, --flatearth emit flattened hierarchies\n"
328331 " -c, --coalesce coalesce bitblasted vectors\n"
329332 " -n, --notruncate do not shorten bitvectors\n"
330333 " -h, --help display this help then exit\n\n"
331 "VCD is emitted to stdout.\n\n"
334 "VCD is emitted to stdout if output filename is unspecified.\n\n"
332335 "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam);
333336 #else
334337 printf(
335338 "Usage: %s [OPTION]... [VZTFILE]\n\n"
336339 " -v specify VZT input filename\n"
340 " -o specify output filename\n"
337341 " -f emit flattened hierarchies\n"
338342 " -c coalesce bitblasted vectors\n"
339343 " -n do not shorten bitvectors\n"
340344 " -h display this help then exit\n\n"
341
342 "VCD is emitted to stdout.\n\n"
345 "VCD is emitted to stdout if output filename is unspecified.\n\n"
343346 "Report bugs to <"PACKAGE_BUGREPORT">.\n",nam);
344347 #endif
345348
351354 {
352355 char opt_errors_encountered=0;
353356 char *lxname=NULL;
357 char *outname=NULL;
358 char *fvbuf=NULL;
354359 int c;
355360 int rc;
356361
364369 static struct option long_options[] =
365370 {
366371 {"vztname", 1, 0, 'v'},
372 {"output", 1, 0, 'o'},
367373 {"coalesce", 0, 0, 'c'},
368374 {"flatearth", 0, 0, 'f'},
369375 {"notruncate", 0, 0, 'n'},
371377 {0, 0, 0, 0}
372378 };
373379
374 c = getopt_long (argc, argv, "v:cfnh", long_options, &option_index);
380 c = getopt_long (argc, argv, "v:o:cfnh", long_options, &option_index);
375381 #else
376 c = getopt (argc, argv, "v:cfnh");
382 c = getopt (argc, argv, "v:o:cfnh");
377383 #endif
378384
379385 if (c == -1) break; /* no more args */
386392 strcpy(lxname, optarg);
387393 break;
388394
395 case 'o':
396 if(outname) free(outname);
397 outname = malloc(strlen(optarg)+1);
398 strcpy(outname, optarg);
399 break;
400
389401 case 'c': vectorize=1;
390402 break;
391403
431443 print_help(argv[0]);
432444 }
433445
446 if(outname)
447 {
448 fv = fopen(outname, "wb");
449 if(!fv)
450 {
451 fprintf(stderr, "Could not open '%s', exiting.\n", outname);
452 perror("Why");
453 exit(255);
454 }
455 fvbuf = malloc(VZT_VCD_WRITE_BUF_SIZ);
456 setvbuf(fv, fvbuf, _IOFBF, VZT_VCD_WRITE_BUF_SIZ);
457 }
458 else
459 {
460 fv = stdout;
461 }
462
434463 rc=process_vzt(lxname);
464
465 if(outname)
466 {
467 free(outname);
468 fclose(fv);
469 }
470
471 free(fvbuf);
435472 free(lxname);
436473
437474 return(rc);
3434 static int names_only = 0;
3535 static char *killed_list = NULL;
3636 char killed_value = 1;
37
38 extern void free_hier(void);
39 extern char *output_hier(char *name);
4037
4138 char vcd_blackout;
4239
17191719
17201720 #ifdef MAC_INTEGRATION
17211721 {
1722 GtkOSXApplication *theApp = theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
1722 GtkOSXApplication *theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
17231723 gtk_widget_hide(menubar);
17241724 gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
17251725 gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE);
19641964
19651965 #ifdef MAC_INTEGRATION
19661966 {
1967 GtkOSXApplication *theApp = theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
1967 GtkOSXApplication *theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
19681968 gtk_widget_hide(menubar);
19691969 gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
19701970 gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE);
18931893 update_maxmarker_labels();
18941894 }
18951895 }
1896 /**/
1897 #ifdef MAC_INTEGRATION
1898 void menu_help_manual(gpointer null_data, guint callback_action, GtkWidget *widget)
1899 {
1900 if(GLOBALS->helpbox_is_active)
1901 {
1902 help_text_bold("\n\nWave User's Guide");
1903 help_text(
1904 " opens the PDF file of the GTKWave User's Guide for viewing."
1905 );
1906 return;
1907 }
1908 else
1909 {
1910 const gchar *bundle_id = quartz_application_get_bundle_id();
1911 if(bundle_id)
1912 {
1913 const gchar *rpath = quartz_application_get_resource_path();
1914 const char *suf = "/doc/gtkwave.pdf";
1915 char *pdfpath = NULL;
1916 FILE *handle;
1917
1918 if(rpath)
1919 {
1920 pdfpath = (char *)alloca(strlen(rpath) + strlen(suf) + 1);
1921 strcpy(pdfpath, rpath);
1922 strcat(pdfpath, suf);
1923 }
1924
1925 if(!pdfpath || !(handle=fopen(pdfpath,"rb")))
1926 {
1927 }
1928 else
1929 {
1930 fclose(handle);
1931 gtk_open_external_file(pdfpath);
1932 return;
1933 }
1934 }
1935
1936 simplereqbox("Wave User's Guide",400,"Could not open PDF!","OK", NULL, NULL, 1);
1937 }
1938 }
1939 #endif
18961940 /**/
18971941 void menu_help(gpointer null_data, guint callback_action, GtkWidget *widget)
18981942 {
61086152
61096153 /* 130 */
61106154 WAVE_GTKIFE("/Help/WAVE Help", "<Control>H", menu_help, WV_MENU_HWH, "<Item>"),
6155 #ifdef MAC_INTEGRATION
6156 WAVE_GTKIFE("/Help/WAVE User Manual", NULL, menu_help_manual, WV_MENU_HWM, "<Item>"),
6157 #endif
61116158 WAVE_GTKIFE("/Help/Wave Version", NULL, menu_version, WV_MENU_HWV, "<Item>"),
61126159 };
61136160
62946341 #endif
62956342 case WV_MENU_FQY:
62966343 case WV_MENU_HWH:
6344 #ifdef MAC_INTEGRATION
6345 case WV_MENU_HWM:
6346 #endif
62976347 case WV_MENU_HWV:
62986348 break;
62996349
63546404 int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]);
63556405 int i;
63566406 GtkWidget *mw;
6357
63586407 #ifdef WAVE_USE_MENU_BLACKOUTS
63596408 for(i=0;i<(sizeof(menu_blackouts)/sizeof(char *));i++)
63606409 {
63746423 #endif
63756424 case WV_MENU_FQY:
63766425 case WV_MENU_HWH:
6426 #ifdef MAC_INTEGRATION
6427 case WV_MENU_HWM:
6428 #endif
63776429 case WV_MENU_HWV:
63786430 break;
63796431
63836435 #else
63846436 mw = gtk_item_factory_get_widget(GLOBALS->item_factory_menu_c_1, menu_items[i].path);
63856437 #endif
6386 if(mw) gtk_widget_set_sensitive(mw, TRUE);
6438 if(mw)
6439 {
6440 #ifdef MAC_INTEGRATION
6441 if(menu_items[i].callback)
6442 #endif
6443 {
6444 gtk_widget_set_sensitive(mw, TRUE);
6445 }
6446 }
63876447 break;
63886448 }
63896449 }
69677027 #endif
69687028 case WV_MENU_FQY:
69697029 case WV_MENU_HWH:
7030 #ifdef MAC_INTEGRATION
7031 case WV_MENU_HWM:
7032 #endif
69707033 case WV_MENU_HWV:
69717034 break;
69727035
69737036 default:
69747037 mw = menu_wlist[i];
6975 if(mw) gtk_widget_set_sensitive(mw, FALSE);
7038 if(mw)
7039 {
7040 #ifdef MAC_INTEGRATION
7041 if(menu_items[i].callback)
7042 #endif
7043 {
7044 gtk_widget_set_sensitive(mw, FALSE);
7045 }
7046 }
69767047 break;
69777048 }
69787049 }
69817052 for(i=0;i<(sizeof(menu_blackouts)/sizeof(char *));i++)
69827053 {
69837054 mw = menu_wlist[i];
6984 if(mw) gtk_widget_set_sensitive(mw, FALSE);
7055 if(mw)
7056 {
7057 gtk_widget_set_sensitive(mw, FALSE);
7058 }
69857059 }
69867060 #endif
69877061 }
70327106 for(i=0;i<nmenu_items;i++)
70337107 {
70347108 mw = menu_wlist[i];
7035 if(mw) gtk_widget_set_sensitive(mw, tr);
7109 if(mw)
7110 {
7111 if(menu_items[i].callback)
7112 {
7113 gtk_widget_set_sensitive(mw, tr);
7114 }
7115 }
70367116 }
70377117 }
70387118 #endif
70757155 #endif
70767156 case WV_MENU_FQY:
70777157 case WV_MENU_HWH:
7158 #ifdef MAC_INTEGRATION
7159 case WV_MENU_HWM:
7160 #endif
70787161 case WV_MENU_HWV:
70797162 mw = menu_wlist[i];
7080 if(mw) gtk_widget_set_sensitive(mw, TRUE);
7163 if(mw)
7164 {
7165 #ifdef MAC_INTEGRATION
7166 if(menu_items[i].callback)
7167 #endif
7168 {
7169 gtk_widget_set_sensitive(mw, TRUE);
7170 }
7171 }
70817172 break;
70827173
70837174 default:
280280 WV_MENU_TDSCALEP,
281281 WV_MENU_TDSCALEF,
282282 WV_MENU_HWH,
283 #ifdef MAC_INTEGRATION
284 WV_MENU_HWM,
285 #endif
283286 WV_MENU_HWV,
284287 WV_MENU_NUMITEMS
285288 };
00 /*
1 * Copyright (c) Tony Bybell 1999-2010.
1 * Copyright (c) Tony Bybell 1999-2012.
22 *
33 * This program is free software; you can redistribute it and/or
44 * modify it under the terms of the GNU General Public License
3434 #include "color.h"
3535 #include "vlist.h"
3636 #include "rc.h"
37
38 #ifdef MAC_INTEGRATION
39 #include <gtkosxapplication.h>
40 #endif
3741
3842 #ifndef _MSC_VER
3943 #ifndef __MINGW32__
952956
953957 if(!(handle=fopen(rcpath,"rb")))
954958 {
955 wave_gconf_client_set_string("/current/rcfile", "");
956 errno=0;
957 return; /* no .rc file */
959 #ifdef MAC_INTEGRATION
960 const gchar *bundle_id = quartz_application_get_bundle_id();
961 if(bundle_id)
962 {
963 const gchar *rpath = quartz_application_get_resource_path();
964 const char *suf = "/examples/gtkwaverc";
965
966 rcpath = NULL;
967 if(rpath)
968 {
969 rcpath = (char *)alloca(strlen(rpath) + strlen(suf) + 1);
970 strcpy(rcpath, rpath);
971 strcat(rcpath, suf);
972 }
973
974 if(!rcpath || !(handle=fopen(rcpath,"rb")))
975 {
976 wave_gconf_client_set_string("/current/rcfile", "");
977 errno=0;
978 return; /* no .rc file */
979 }
980 else
981 {
982 wave_gconf_client_set_string("/current/rcfile", rcpath);
983 }
984 }
985 else
986 #endif
987 {
988 wave_gconf_client_set_string("/current/rcfile", "");
989 errno=0;
990 return; /* no .rc file */
991 }
958992 }
959993 else
960994 {
23252325 }
23262326 }
23272327 }
2328 #else
2329 static void find_dumpfile_scrub_slashes(char *s)
2330 {
2331 if(s)
2332 {
2333 if(s[0] && s[1] && s[2] && (s[1] == ':') && (s[2] == '\\'))
2334 {
2335 while(*s)
2336 {
2337 if(*s == '\\') *s = '/';
2338 s++;
2339 }
2340 }
2341 }
2342 }
23282343 #endif
23292344
23302345
23392354 char *grf = NULL;
23402355 int dotdot_levels = 0;
23412356
2342 #ifdef __MINGW32__
23432357 find_dumpfile_scrub_slashes(orig_save);
23442358 find_dumpfile_scrub_slashes(orig_dump);
23452359 find_dumpfile_scrub_slashes(this_save);
2346 #endif
23472360
23482361 dup_orig_save = strdup_2(orig_save);
23492362 rhs_orig_save_slash = strrchr(dup_orig_save, SLASH);
3737 hadj=GTK_ADJUSTMENT(GLOBALS->signal_hslider);
3838 xsrc=(gint)hadj->value;
3939 DEBUG(printf("Signal HSlider Moved to %d\n",xsrc));
40 GLOBALS->right_align_active = 0;
4041
4142 gdk_draw_rectangle(GLOBALS->signalpixmap, GLOBALS->gc.gc_mdgray, TRUE,
4243 0, -1, GLOBALS->signal_fill_width, GLOBALS->fontheight);
12331234 GLOBALS->signal_fill_width, widget->allocation.height, -1);
12341235 }
12351236
1237 if (!GLOBALS->left_justify_sigs && !GLOBALS->do_resize_signals)
1238 if (width < GLOBALS->max_signal_name_pixel_width+15)
1239 {
1240 int delta = GLOBALS->max_signal_name_pixel_width+15 - width;
1241
1242 GtkAdjustment *hadj;
1243
1244 if(GLOBALS->signalpixmap)
1245 {
1246
1247 hadj=GTK_ADJUSTMENT(GLOBALS->signal_hslider);
1248
1249 /* int pos = GLOBALS->max_signal_name_pixel_width+15 - (gint)hadj->value; */
1250
1251 if ((gint) hadj->value > delta)
1252 {
1253 GLOBALS->right_align_active = 1;
1254 delta = (gint)hadj->value;
1255 }
1256 if (GLOBALS->right_align_active)
1257 hadj->value = (gint)delta;
1258 }
1259 } else {
1260 GLOBALS->right_align_active = 1;
1261 }
1262
12361263 GLOBALS->old_signal_fill_height= widget->allocation.height;
12371264 gdk_draw_rectangle(GLOBALS->signalpixmap, widget->style->bg_gc[GTK_STATE_PRELIGHT], TRUE, 0, 0,
12381265 GLOBALS->signal_fill_width, widget->allocation.height);
2121 #include <unistd.h>
2222
2323 #include "debug.h"
24
25 static int use_embedded = 1;
2426
2527 #if !defined _MSC_VER && defined WAVE_USE_GTK2
2628
8486 split_point = i;
8587 break;
8688 }
89
90 if(!strcmp(argv[i], "++"))
91 {
92 split_point = i;
93 use_embedded = 0;
94 break;
95 }
8796 }
8897
8998 if(split_point < 0)
9099 {
91 printf("Usage:\n------\n%s arglist1 + arglist2\n\n"
92 "The '+' between argument lists splits what goes to each viewer.\n\n", argv[0]);
100 printf("Usage:\n------\n%s arglist1 separator arglist2\n\n"
101 "The '+' between argument lists splits and creates one window.\n"
102 "The '++' between argument lists splits and creates two windows.\n"
103 "\n", argv[0]);
93104 exit(255);
94105 }
95106
364375 sleep(2);
365376 shmctl(shmid, IPC_RMID, &ds); /* mark for destroy */
366377 #endif
367 gtk_main();
378 if(use_embedded)
379 {
380 gtk_main();
381 }
368382 }
369383 else
370384 {
372386 char **arglist = calloc(n_items, sizeof(char *));
373387
374388 sprintf(buf, "0+%08X", shmid);
375 sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[0])));
389 if(use_embedded)
390 {
391 sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[0])));
392 }
393 else
394 {
395 sprintf(buf2, "%x", 0);
396 }
376397
377398 arglist[0] = "gtkwave";
378399 arglist[1] = "-D";
399420 char **arglist = calloc(n_items, sizeof(char *));
400421
401422 sprintf(buf, "1+%08X", shmid);
402 sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[1])));
423 if(use_embedded)
424 {
425 sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[1])));
426 }
427 else
428 {
429 sprintf(buf2, "%x", 0);
430 }
403431
404432 arglist[0] = "gtkwave";
405433 arglist[1] = "-D";
444472 }
445473
446474 #endif
447
24222422
24232423 if(GLOBALS->signalwindow)
24242424 {
2425 gtk_widget_set_usize(GTK_WIDGET(GLOBALS->signalwindow), os+30, -1);
2425 /* printf("VALUES: %d %d %d\n", GLOBALS->initial_signal_window_width, GLOBALS->signalwindow->allocation.width, GLOBALS->max_signal_name_pixel_width); */
2426 if (GLOBALS->first_unsized_signals && GLOBALS->max_signal_name_pixel_width !=0)
2427 {
2428 GLOBALS->first_unsized_signals = 0;
2429 gtk_paned_set_position(GTK_PANED(GLOBALS->panedwindow), GLOBALS->max_signal_name_pixel_width+30);
2430 } else {
2431 gtk_widget_set_usize(GTK_WIDGET(GLOBALS->signalwindow), os+30, -1);
2432 }
24262433 }
24272434 }
24282435 else