summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkGenStubs.tcl
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-02-07 23:24:13 (GMT)
committernijtmans <nijtmans>2010-02-07 23:24:13 (GMT)
commit8e9497476c9b0554167e93c31b0516a216b12926 (patch)
tree5dcf5cec634aa7952402786f8a8e8bc572656db9 /generic/ttk/ttkGenStubs.tcl
parent72a2e7f509b932f6409e5e2e2e39dfde6da89897 (diff)
downloadtk-8e9497476c9b0554167e93c31b0516a216b12926.zip
tk-8e9497476c9b0554167e93c31b0516a216b12926.tar.gz
tk-8e9497476c9b0554167e93c31b0516a216b12926.tar.bz2
Backport various formatting (spacing)
changes from HEAD, so diffing between 8.5.x and 8.6 shows the real structural differences again. (any signature change not backported!)
Diffstat (limited to 'generic/ttk/ttkGenStubs.tcl')
-rw-r--r--generic/ttk/ttkGenStubs.tcl61
1 files changed, 36 insertions, 25 deletions
diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl
index 961f36b..b868adb 100644
--- a/generic/ttk/ttkGenStubs.tcl
+++ b/generic/ttk/ttkGenStubs.tcl
@@ -1,14 +1,14 @@
# ttkGenStubs.tcl --
#
# This script generates a set of stub files for a given
-# interface.
-#
+# interface.
+#
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# $Id: ttkGenStubs.tcl,v 1.1 2007/03/07 23:46:34 das Exp $
+# $Id: ttkGenStubs.tcl,v 1.1.4.1 2010/02/07 23:24:13 nijtmans Exp $
#
# SOURCE: tcl/tools/genStubs.tcl, revision 1.20
#
@@ -281,7 +281,7 @@ proc genStubs::addPlatformGuard {plat text} {
return "#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */\n${text}#endif /* X11 */\n"
}
}
- return "$text"
+ return $text
}
# genStubs::emitSlots --
@@ -418,7 +418,7 @@ proc genStubs::makeDecl {name decl index} {
append text ";\n"
return $text
}
- append line "$fname "
+ append line $fname
set arg1 [lindex $args 0]
switch -exact $arg1 {
@@ -430,11 +430,14 @@ proc genStubs::makeDecl {name decl index} {
foreach arg [lrange $args 1 end] {
append line $sep
set next {}
- append next [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append next [lindex $arg 0]
+ if {[string index $next end] ne "*"} {
+ append next " "
+ }
+ append next [lindex $arg 1] [lindex $arg 2]
if {[string length $line] + [string length $next] \
+ $pad > 76} {
- append text $line \n
+ append text [string trimright $line] \n
set line "\t\t\t\t"
set pad 28
}
@@ -448,11 +451,14 @@ proc genStubs::makeDecl {name decl index} {
foreach arg $args {
append line $sep
set next {}
- append next [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append next [lindex $arg 0]
+ if {[string index $next end] ne "*"} {
+ append next " "
+ }
+ append next [lindex $arg 1] [lindex $arg 2]
if {[string length $line] + [string length $next] \
+ $pad > 76} {
- append text $line \n
+ append text [string trimright $line] \n
set line "\t\t\t\t"
set pad 28
}
@@ -530,8 +536,11 @@ proc genStubs::makeSlot {name decl index} {
TCL_VARARGS {
set sep "("
foreach arg [lrange $args 1 end] {
- append text $sep [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append text $sep [lindex $arg 0]
+ if {[string index $text end] ne "*"} {
+ append text " "
+ }
+ append text [lindex $arg 1] [lindex $arg 2]
set sep ", "
}
append text ", ...)"
@@ -539,14 +548,17 @@ proc genStubs::makeSlot {name decl index} {
default {
set sep "("
foreach arg $args {
- append text $sep [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append text $sep [lindex $arg 0]
+ if {[string index $text end] ne "*"} {
+ append text " "
+ }
+ append text [lindex $arg 1] [lindex $arg 2]
set sep ", "
}
append text ")"
}
}
-
+
append text "; /* $index */\n"
return $text
}
@@ -782,7 +794,7 @@ proc genStubs::emitInit {name textVar} {
} else {
append text " 0,\n"
}
-
+
forAllStubs $name makeInit noGuard text {" 0, /* $i */\n"}
append text "\};\n"
@@ -874,14 +886,13 @@ proc genStubs::init {} {
# Returns any values that were not assigned to variables.
if {[string length [namespace which lassign]] == 0} {
-proc lassign {valueList args} {
- if {[llength $args] == 0} {
- error "wrong # args: lassign list varname ?varname..?"
- }
-
- uplevel [list foreach $args $valueList {break}]
- return [lrange $valueList [llength $args] end]
-}
+ proc lassign {valueList args} {
+ if {[llength $args] == 0} {
+ error "wrong # args: should be \"lassign list varName ?varName ...?\""
+ }
+ uplevel [list foreach $args $valueList {break}]
+ return [lrange $valueList [llength $args] end]
+ }
}
genStubs::init