home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)ildocconge.tcl 1.5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)ildocconge.tcl 1.5 04 Jan 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
- require "ilcongen.tcl"
-
- Class IlDocConGen : {IlConGen} {
- method destructor
- constructor
- method generate
- method genComponent
- method genPicture
- method genText
- method genActiveLink
- method section
- attribute linkNr
- attribute ascFid
- attribute _section
- }
-
- method IlDocConGen::destructor {this} {
- set ref [$this _section]
- if {$ref != ""} {
- $ref _contentsGenerator ""
- }
- # Start destructor user section
- # End destructor user section
- $this IlConGen::destructor
- }
-
- constructor IlDocConGen {class this name section} {
- set this [IlConGen::constructor $class $this $name $section]
- $section _contentsGenerator $this
- # Start constructor user section
- $this linkNr 0
- # End constructor user section
- return $this
- }
-
- method IlDocConGen::generate {this} {
-
- set version [[[[$this section] document] editor] version]
-
- $this ascFid [$this openAsc]
-
- if {[$this ascFid] == ""} {
- return
- }
-
- # when the fold-level is lower than 2 the file name will be a chapter
- # else the file will be a section
-
- set header [TextSection new]
- expand_file $header [m4_path_name etc il${version}doc.asc]
-
- set classes [TextSection new]
- expand_file $classes [m4_path_name etc il${version}class.asc]
-
- puts [$this ascFid] "[$header contents]"
- puts [$this ascFid] "\n[$classes contents]"
- puts [$this ascFid] "\n<!End Declarations>"
- case [[$this section] indentation] {
- {0 1} {puts [$this ascFid] "\n<\"Chapter\">"}
- {2} {puts [$this ascFid] "\n<\"Section\">"}
- {3} {puts [$this ascFid] "\n<\"Subsection\">"}
- {4} {puts [$this ascFid] "\n<\"Sub2section\">"}
- }
- puts [$this ascFid] "\n[[$this section] docTitle]"
-
- set inSubdoc 0
- set subLevel 0
-
- foreach sect [[$this section] getTree] {
-
- set level [$sect indentation]
- set name [$sect uiName]
- set type [$sect type]
- set class [$sect operationClass]
-
- if {$inSubdoc} {
- # Check for end of subdoc
- if {$level <= $subLevel} {
- set inSubdoc 0
- set subLevel 0
- }
- }
-
- if {!$inSubdoc} {
- # Check if the section is manipulatable. If so then skip
- # this section and all it's underlying sections.
- if {$class == "manipulate"} {
- # In subdocument
- set inSubdoc 1
- set subLevel $level
- } else {
- # Generate contents for this section
- $this genComponent $sect
- }
- }
- }
-
- close [$this ascFid]
- }
-
- method IlDocConGen::genComponent {this section} {
-
- # Look at the doctype of the class and generate a picture
- # or a text for it in the MIF-file.
- case [$section docType] {
- {Epsi Epsf Eps Ximage} {$this genPicture $section}
- {default} {$this genText $section}
- }
- }
-
- method IlDocConGen::genPicture {this section} {
-
- $this genActiveLink Interleaf $section
-
- puts [$this ascFid] "\n<\"para\","
- puts [$this ascFid] "\tAlignment=\t\tCenter,"
- puts [$this ascFid] "\tFont =\t\t\tF24@Z7@Lnl>"
- puts [$this ascFid] "\n[$section docTitle]"
- }
-
- method IlDocConGen::genText {this section} {
-
- puts [$this ascFid] "\n<\"para\","
- puts [$this ascFid] "\tFont =\t\t\tF14@Z7@Lnl>"
- puts [$this ascFid] "\n[$section docTitle]:"
-
- $this genActiveLink ASCII $section
- }
-
- method IlDocConGen::genActiveLink {this linkType section} {
-
- # linkPath, linkNumber and linkType are used in template 'il..link.asc'
- set linkPath ";[path_name file [$section docLocation]]"
- set linkNumber [$this linkNr]
-
- set link [TextSection new]
- set version [[[[$this section] document] editor] version]
- expand_file $link [m4_path_name etc il${version}link.asc]
- puts [$this ascFid] "\n[$link contents]"
-
- # linknr is used in template
- $this linkNr [incr linkNumber]
- }
-
- # Do not delete this line -- regeneration end marker
-
- method IlDocConGen::section {this args} {
- if {$args == ""} {
- return [$this _section]
- }
- set ref [$this _section]
- if {$ref != ""} {
- $ref _contentsGenerator ""
- }
- set obj [lindex $args 0]
- if {$obj != ""} {
- $obj _contentsGenerator $this
- }
- $this _section $obj
- }
-
-