home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
docprocs.tcl
< prev
next >
Wrap
Text File
|
1997-09-25
|
5KB
|
166 lines
require_module_file "genlink.tcl" docwriter
require_module_file "genlinkext.tcl" docwriter
require_module_file "genfilepro.tcl" docwriter
require_module_file "genitempro.tcl" docwriter
# args : fileTypes
# the storeFile and section arguments are added by the docwriter
# for internal use
proc createFileSections { fileTypes storeFile section} {
createPrefixedFileSections $fileTypes "" $storeFile $section
}
proc createPrefixedFileSections { fileTypes prefix storeFile section} {
set fid [open $storeFile w]
GenLink new genLink [$section document]
puts $fid [genLink getDocStructure "$fileTypes" $prefix]
close $fid
}
# args : fileTypes, propertyTypes
# the storeFile and section arguments are added by the docwriter
# for internal use
proc createFileAndPropertySections {fileTypes propertyTypes storeFile section} {
createPrefixedFileAndPropertySections $fileTypes $propertyTypes "" \
$storeFile $section
}
proc createPrefixedFileAndPropertySections {fileTypes propertyTypes prefix
storeFile section} {
set fid [open $storeFile w]
GenLinkExtended new genLinkExt [$section document]
puts $fid [genLinkExt getDocStructure "$fileTypes" "$propertyTypes" \
$prefix]
close $fid
}
# args : parentType
# the storeFile and section arguments are added by the docwriter
# for internal use
proc createSourceFileSections { parentType storeFile section} {
createPrefixedSourceFileSections $parentType "" $storeFile $section
}
proc createPrefixedSourceFileSections { parentType prefix 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" $prefix]
}
close $fid
}
# args : fileTypes, properties
# the storeFile and section arguments are added by the docwriter
# for internal use
proc createFilePropSections { fileTypes properties storeFile section} {
createPrefixedFilePropSections $fileTypes $properties "" \
$storeFile $section
}
proc createPrefixedFilePropSections { fileTypes properties prefix storeFile
section} {
set fid [open $storeFile w]
GenFileProp new genFileProp [$section document]
puts $fid [genFileProp getDocStructure "$fileTypes" "$properties" \
$prefix]
close $fid
}
# args : properties
# the storeFile and section arguments are added by the docwriter
# for internal use
proc createClassItemPropSections {properties storeFile section} {
createPrefixedClassItemPropSections $properties "" $storeFile $section
}
proc createPrefixedClassItemPropSections {properties prefix storeFile section} {
createPrefixedItemPropSections cad cl cad_class name $properties \
$prefix $storeFile $section
}
# args : fileTypes, itemType, componentType, labelType, properties
# the storeFile and section arguments are added by the docwriter
# for internal use
proc createItemPropSections { fileTypes itemType componentType labelType
properties storeFile section} {
createPrefixedItemPropSections $fileTypes $itemType $componentType \
$labelType $properties "" $storeFile $section
}
proc createPrefixedItemPropSections { fileTypes itemType componentType
labelType properties prefix storeFile section} {
set fid [open $storeFile w]
GenItemProp new genItemProp [$section document]
puts $fid [genItemProp getDocStructure "$fileTypes" "$itemType" \
"$componentType" "$labelType" "$properties" $prefix]
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
set s_modules [$moduleHdlr selectedModuleSpecSet]
# should always return 1 module
foreach module [$moduleHdlr moduleSpecSet] {
foreach file [$moduleHdlr getFiles tcl $filenm $module] {
require $file
}
}
$newName new contentsGen $section
contentsGen generate
contentsGen delete
}