home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
docprocs.tcl
< prev
next >
Wrap
Text File
|
1996-10-29
|
3KB
|
109 lines
require "genlink.tcl"
require "genlinkext.tcl"
require "genfilepro.tcl"
require "genitempro.tcl"
# args : fileTypes
# the storeFile and section arguments are added by the docwriter
# for internal use
proc createFileSections { fileTypes storeFile section} {
set fid [open $storeFile w]
GenLink new genLink [$section document]
puts $fid [genLink getDocStructure "$fileTypes"]
close $fid
}
proc createFileAndPropertySections {fileTypes propertyTypes storeFile section} {
set fid [open $storeFile w]
GenLinkExtended new genLinkExt [$section document]
puts $fid [genLinkExt getDocStructure "$fileTypes" "$propertyTypes"]
close $fid
}
proc createSourceFileSections { parentType storeFile section} {
set sv [[$section document] documentedSystem]
if [$sv isNil] {
wmtkerror "Invalid documented system"
return
}
set fileTypes {}
set fvs [$sv localFileVersions]
foreach fv $fvs {
set fileType [[$fv file] type]
set editor [[docTool document] editor]
set edName [$editor name]
set edVers [$editor version]
set class [Document::getClass $editor $edVers $fileType]
if {$class == ""} {
# no section class for the localFileVersion,
# check the objtype for isAscii
set spec [getObjectSpec $docToolObjectHdlr \
ExternalFileVersion $fileType]
if {$spec == ""} {
continue
} else {
if {![$spec isAscii]} {
continue
}
}
} else {
set kind [Document::getFileClass $editor \
$edVers $fileType]
if {$kind == "externalBinary"} {
puts "externalBinary, type '$fileType'"
continue
}
}
lappend_unique fileTypes $fileType
}
GenLink new genLink [$section document]
set fid [open $storeFile w]
set first 1
foreach fileType $fileTypes {
if {$first == 1} {
puts $fid "$fileType Sources | + | | $parentType"
} else {
puts $fid "$fileType Sources | - | | $parentType"
}
set first 0
puts $fid [genLink getDocStructure "$fileType"]
}
close $fid
}
proc createFilePropSections { fileTypes properties storeFile section} {
set fid [open $storeFile w]
GenFileProp new genFileProp [$section document]
puts $fid [genFileProp getDocStructure "$fileTypes" "$properties"]
close $fid
}
proc createClassItemPropSections {properties storeFile section} {
createItemPropSections cad cl cad_class name $properties $storeFile \
$section
}
proc createItemPropSections { fileTypes itemType componentType labelType
properties storeFile section} {
set fid [open $storeFile w]
GenItemProp new genItemProp [$section document]
puts $fid [genItemProp getDocStructure "$fileTypes" "$itemType" \
"$componentType" "$labelType" "$properties"]
close $fid
}
proc dispatchContentsGen { name section } {
# remove 'gen' and lowercase
set newName [string range $name 3 end]ConGen
set nm [string tolower $newName]
set filenm [string range $nm 0 9].tcl
uplevel "require $filenm"
$newName new contentsGen $section
contentsGen generate
contentsGen delete
}