home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)fmcongen.tcl 1.4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)fmcongen.tcl 1.4 19 Jan 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
-
- Class FmConGen : {Object} {
- method destructor
- constructor
- method mif2Bin
- method framePath
- method openMif
- attribute mifPath
- attribute templatePath
- attribute section
- }
-
- method FmConGen::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- constructor FmConGen {class this name section} {
- set this [Object::constructor $class $this $name]
-
- $this section $section
- $this mifPath [$section docLocation]_mif
- set version [[[[$this section] document] editor] version]
- set type [string tolower [$section type]]
- set file fm${version}${type}.mif
- catch {$this templatePath [m4_path_name etc $file]}]
-
- return $this
- }
-
- method FmConGen::mif2Bin {this} {
-
- # Convert the MIF-file to binary and remove it
- # The MIF-file is converted to Frame binary-format using $FM_COMM.
-
- set section [$this section]
- set fm_comm [m4_path_name bin fmcomm]
- set cmnd [list \
- "$fm_comm -b [$this mifPath] [$section docLocation]" \
- [$section uiName] \
- ]
- if {! [$section execute "$cmnd"]} {
- wmtkerror "Conversion to Framemaker binary format failed"
- }
- unlink [$this mifPath]
- }
-
- method FmConGen::framePath {this path} {
-
- if {[string first / $path] == 0} {
- set path "<r\\>$path"
- }
- regsub -all {/} $path {<c\\>} framePath
- return $framePath
- }
-
- method FmConGen::openMif {this} {
-
- # Open the MIF-file
- if {[catch {set mif [open [$this mifPath] w]} reason]} {
- wmtkerror "Error on opening '[$this mifPath]' for writing: $reason"
- return ""
- }
-
- return $mif
- }
-
- # Do not delete this line -- regeneration end marker
-
-