︙ | | | ︙ | |
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
set tdump [$w dump -tag -text 1.0 end]
set gray 1.0
set line ""
set lines {}
foreach {key value index} $tdump {
if {$key eq "tagon"} {
if {$value eq "change"} {
set gray $::grayLevel1
} elseif {[string match "new*" $value]} {
set gray $::grayLevel2
}
} elseif {$key eq "tagoff"} {
if {$value eq "change" || [string match "new*" $value]} {
set gray 1.0
}
} elseif {$key eq "text"} {
append line $value
|
|
|
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
set tdump [$w dump -tag -text 1.0 end]
set gray 1.0
set line ""
set lines {}
foreach {key value index} $tdump {
if {$key eq "tagon"} {
if {$value eq "change"} {
set gray $::Pref(grayLevel1)
} elseif {[string match "new*" $value]} {
set gray $::Pref(grayLevel2)
}
} elseif {$key eq "tagoff"} {
if {$value eq "change" || [string match "new*" $value]} {
set gray 1.0
}
} elseif {$key eq "text"} {
append line $value
|
︙ | | | ︙ | |
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
set tmpFile2 [file nativename $::diff($top,printFile)]
} else {
set tmpFile2 [file nativename ~/eskil.ps]
}
set lines1 {}
set lines2 {}
if {$::wideLines} {
set wraplength 100
set linesPerPage 74
} else {
set wraplength 85
set linesPerPage 66
}
|
|
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
set tmpFile2 [file nativename $::diff($top,printFile)]
} else {
set tmpFile2 [file nativename ~/eskil.ps]
}
set lines1 {}
set lines2 {}
if {$::Pref(wideLines)} {
set wraplength 100
set linesPerPage 74
} else {
set wraplength 85
set linesPerPage 66
}
|
︙ | | | ︙ | |
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
set len [string length $value]
}
append line $value
incr chars $len
}
tagon {
if {$value eq "change"} {
set gray $::grayLevel1
append line "\0bggray\{$gray\}"
} elseif {$value != "last"} {
set gray $::grayLevel2
append line "\0bggray\{$gray\}"
}
}
tagoff {
if {$value != "last"} {
append line "\0bggray\{1.0\}"
set gray 1.0
|
|
|
|
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
set len [string length $value]
}
append line $value
incr chars $len
}
tagon {
if {$value eq "change"} {
set gray $::Pref(grayLevel1)
append line "\0bggray\{$gray\}"
} elseif {$value != "last"} {
set gray $::Pref(grayLevel2)
append line "\0bggray\{$gray\}"
}
}
tagoff {
if {$value != "last"} {
append line "\0bggray\{1.0\}"
set gray 1.0
|
︙ | | | ︙ | |
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
close $ch
if {$::tcl_platform(platform) eq "windows" &&\
![info exists ::env(ENSCRIPT_LIBRARY)]} {
set ::env(ENSCRIPT_LIBRARY) [pwd]
}
set enscriptCmd [list enscript -2jcre -L $linesPerPage -M A4]
if {$::wideLines} {
lappend enscriptCmd -f Courier6
}
if {![regexp {^(.*)( \(.*?\))$} $::diff($top,leftLabel) -> lfile lrest]} {
set lfile $::diff($top,leftLabel)
set lrest ""
}
set lfile [file tail $lfile]$lrest
if {![regexp {^(.*)( \(.*?\))$} $::diff($top,rightLabel) -> rfile rrest]} {
set rfile $::diff($top,rightLabel)
set rrest ""
}
set rfile [file tail $rfile]$rrest
lappend enscriptCmd "--header=$lfile|Page \$% of \$=|$rfile"
if {$::prettyPrint != ""} {
lappend enscriptCmd -E$::prettyPrint
}
lappend enscriptCmd -p $tmpFile2 $tmpFile
if {[catch {eval exec $enscriptCmd} result]} {
if {[string index $result 0] != "\["} {
tk_messageBox -message "Enscript error: $result"
return
|
|
|
|
|
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
close $ch
if {$::tcl_platform(platform) eq "windows" &&\
![info exists ::env(ENSCRIPT_LIBRARY)]} {
set ::env(ENSCRIPT_LIBRARY) [pwd]
}
set enscriptCmd [list enscript -2jcre -L $linesPerPage -M A4]
if {$::Pref(wideLines)} {
lappend enscriptCmd -f Courier6
}
if {![regexp {^(.*)( \(.*?\))$} $::diff($top,leftLabel) -> lfile lrest]} {
set lfile $::diff($top,leftLabel)
set lrest ""
}
set lfile [file tail $lfile]$lrest
if {![regexp {^(.*)( \(.*?\))$} $::diff($top,rightLabel) -> rfile rrest]} {
set rfile $::diff($top,rightLabel)
set rrest ""
}
set rfile [file tail $rfile]$rrest
lappend enscriptCmd "--header=$lfile|Page \$% of \$=|$rfile"
if {$::diff(prettyPrint) != ""} {
lappend enscriptCmd -E$::diff(prettyPrint)
}
lappend enscriptCmd -p $tmpFile2 $tmpFile
if {[catch {eval exec $enscriptCmd} result]} {
if {[string index $result 0] != "\["} {
tk_messageBox -message "Enscript error: $result"
return
|
︙ | | | ︙ | |
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
|
pack .dp.b -side bottom
pack .dp.l -side "top"
}
}
# Create a print dialog.
proc doPrint {top {quiet 0}} {
if {![info exists ::grayLevel1]} {
set ::grayLevel1 0.6
set ::grayLevel2 0.8
set ::wideLines 0
set ::prettyPrint ""
}
if {$quiet} {
PrintDiffs $top 1
return
}
destroy .pr
|
|
<
<
<
|
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
pack .dp.b -side bottom
pack .dp.l -side "top"
}
}
# Create a print dialog.
proc doPrint {top {quiet 0}} {
if {![info exists ::diff(prettyPrint)]} {
set ::diff(prettyPrint) ""
}
if {$quiet} {
PrintDiffs $top 1
return
}
destroy .pr
|
︙ | | | ︙ | |
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
levels that are used on the background to mark changes.\
The first value is used for changed text. The second for\
new/deleted text."
.pr.l1 configure -wraplength 400
.pr.l2 configure -wraplength 400
scale .pr.s1 -orient horizontal -resolution 0.1 -showvalue 1 -from 0.0 \
-to 1.0 -variable grayLevel1
scale .pr.s2 -orient horizontal -resolution 0.1 -showvalue 1 -from 0.0 \
-to 1.0 -variable grayLevel2
frame .pr.f
radiobutton .pr.r1 -text "No Syntax" -variable prettyPrint -value ""
radiobutton .pr.r2 -text "VHDL" -variable prettyPrint -value "vhdl"
radiobutton .pr.r3 -text "Tcl" -variable prettyPrint -value "tcl"
radiobutton .pr.r4 -text "C" -variable prettyPrint -value "c"
frame .pr.fs
radiobutton .pr.fs.r1 -text "80 char" -variable wideLines -value 0
radiobutton .pr.fs.r2 -text "95 char" -variable wideLines -value 1
pack .pr.fs.r1 .pr.fs.r2 -side left -padx 10
button .pr.b1 -text "Print to File" -padx 5\
-command "destroy .pr; update; PrintDiffs $top"
button .pr.b2 -text "Cancel" -padx 5 \
-command {destroy .pr}
|
|
|
|
|
|
|
|
|
|
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
|
levels that are used on the background to mark changes.\
The first value is used for changed text. The second for\
new/deleted text."
.pr.l1 configure -wraplength 400
.pr.l2 configure -wraplength 400
scale .pr.s1 -orient horizontal -resolution 0.1 -showvalue 1 -from 0.0 \
-to 1.0 -variable Pref(grayLevel1)
scale .pr.s2 -orient horizontal -resolution 0.1 -showvalue 1 -from 0.0 \
-to 1.0 -variable Pref(grayLevel2)
frame .pr.f
radiobutton .pr.r1 -text "No Syntax" -variable diff(prettyPrint) -value ""
radiobutton .pr.r2 -text "VHDL" -variable diff(prettyPrint) -value "vhdl"
radiobutton .pr.r3 -text "Tcl" -variable diff(prettyPrint) -value "tcl"
radiobutton .pr.r4 -text "C" -variable diff(prettyPrint) -value "c"
frame .pr.fs
radiobutton .pr.fs.r1 -text "80 char" -variable Pref(wideLines) -value 0
radiobutton .pr.fs.r2 -text "95 char" -variable Pref(wideLines) -value 1
pack .pr.fs.r1 .pr.fs.r2 -side left -padx 10
button .pr.b1 -text "Print to File" -padx 5\
-command "destroy .pr; update; PrintDiffs $top"
button .pr.b2 -text "Cancel" -padx 5 \
-command {destroy .pr}
|
︙ | | | ︙ | |