home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / delphitgt.tcl < prev    next >
Text File  |  1997-05-07  |  43KB  |  1,719 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. # Copyright (c) 1997 by Cayenne Software, Inc.
  4. #
  5. # This software is furnished under a license and may be used only in
  6. # accordance with the terms of such license and with the inclusion of
  7. # the above copyright notice. This software or any other copies thereof
  8. # may not be provided or otherwise made available to any other person.
  9. # No title to and ownership of the software is hereby transferred.
  10. #
  11. # The information in this software is subject to change without notice
  12. # and should not be construed as a commitment by Cayenne Software, Inc.
  13. #
  14. #---------------------------------------------------------------------------
  15. #
  16. #       File            : delphitgt.tcl
  17. #       Author          : 
  18. #       Original date   : May 1997
  19. #       Description     : Classes for code generation
  20. #
  21. #---------------------------------------------------------------------------
  22.  
  23. #---------------------------------------------------------------------------
  24. #      File:           @(#)dpargument.tcl    /main/hindenburg/4
  25. #---------------------------------------------------------------------------
  26.  
  27. # Start user added include file section
  28. # End user added include file section
  29.  
  30.  
  31. Class DPArgument : {GCObject} {
  32.     constructor
  33.     method destructor
  34.     method generate
  35.     attribute name
  36.     attribute passedBy
  37.     attribute type
  38. }
  39.  
  40. constructor DPArgument {class this type} {
  41.     set this [GCObject::constructor $class $this]
  42.     $this type $type
  43.     # Start constructor user section
  44.     # End constructor user section
  45.     return $this
  46. }
  47.  
  48. method DPArgument::destructor {this} {
  49.     # Start destructor user section
  50.     # End destructor user section
  51. }
  52.  
  53. method DPArgument::generate {this whole unit} {
  54.     switch [$this passedBy] {
  55.         "Variable" {
  56.             $whole append "var "
  57.         }
  58.         "Constant" {
  59.             $whole append "const "
  60.         }
  61.     }
  62.     $whole append "[$this name]: "
  63.     [$this type] generate $whole $unit
  64. }
  65.  
  66. # Do not delete this line -- regeneration end marker
  67.  
  68. #---------------------------------------------------------------------------
  69. #      File:           @(#)dpcomment.tcl    /main/hindenburg/1
  70. #---------------------------------------------------------------------------
  71.  
  72. # Start user added include file section
  73. # End user added include file section
  74.  
  75.  
  76. Class DPComment : {GCObject} {
  77.     constructor
  78.     method destructor
  79.     method generate
  80.     attribute comment
  81. }
  82.  
  83. constructor DPComment {class this} {
  84.     set this [GCObject::constructor $class $this]
  85.     # Start constructor user section
  86.     # End constructor user section
  87.     return $this
  88. }
  89.  
  90. method DPComment::destructor {this} {
  91.     # Start destructor user section
  92.     # End destructor user section
  93. }
  94.  
  95. method DPComment::generate {this whole} {
  96.    if { [string length [$this comment]] > 0 } {
  97.       set restComment [$this comment]
  98.       set newlinePos [string first "\n" $restComment ]
  99.       while {$newlinePos != -1} {
  100.          set thisline [string range $restComment 0 [expr $newlinePos - 1]]
  101.          set restComment \
  102.          [string range $restComment [expr $newlinePos + 1] end]
  103.          set newlinePos [string first "\n" $restComment ]
  104.          $whole append "// $thisline\n"
  105.       }
  106.       $whole append "// $restComment\n"
  107.    }
  108.  
  109. }
  110.  
  111. # Do not delete this line -- regeneration end marker
  112.  
  113. #---------------------------------------------------------------------------
  114. #      File:           @(#)dpcontrole.tcl    /main/hindenburg/2
  115. #---------------------------------------------------------------------------
  116.  
  117. # Start user added include file section
  118. # End user added include file section
  119.  
  120.  
  121. Class DPControlEvent : {GCObject} {
  122.     constructor
  123.     method destructor
  124.     method generate
  125.     attribute name
  126.     attribute method
  127. }
  128.  
  129. constructor DPControlEvent {class this method} {
  130.     set this [GCObject::constructor $class $this]
  131.     $this method $method
  132.     # Start constructor user section
  133.     # End constructor user section
  134.     return $this
  135. }
  136.  
  137. method DPControlEvent::destructor {this} {
  138.     # Start destructor user section
  139.     # End destructor user section
  140. }
  141.  
  142. method DPControlEvent::generate {this section} {
  143.     if {![regexp ^(after|before) [string tolower [$this name]]]} {
  144.         $section append "On"
  145.     }
  146.     $section append [$this name]
  147.     $section append " = "
  148.     $section append [[$this method] name]
  149.     $section append "\n"
  150. }
  151.  
  152. # Do not delete this line -- regeneration end marker
  153.  
  154. #---------------------------------------------------------------------------
  155. #      File:           @(#)dpcookie.tcl    /main/hindenburg/4
  156. #---------------------------------------------------------------------------
  157.  
  158. # Start user added include file section
  159. # End user added include file section
  160.  
  161.  
  162. Class DPCookie : {GCObject} {
  163.     constructor
  164.     method destructor
  165. }
  166.  
  167. global DPCookie::controls
  168. set DPCookie::controls "// Visual Components"
  169.  
  170. global DPCookie::events
  171. set DPCookie::events "// Events"
  172.  
  173. global DPCookie::properties
  174. set DPCookie::properties "// Properties"
  175.  
  176. global DPCookie::implement0
  177. set DPCookie::implement0 "// !! Implement this method !!"
  178.  
  179. global DPCookie::startUserSection
  180. set DPCookie::startUserSection "// Start user section"
  181.  
  182. global DPCookie::endUserSection
  183. set DPCookie::endUserSection "// End user section"
  184.  
  185. global DPCookie::startUserInclude
  186. set DPCookie::startUserInclude "// Start user include section"
  187.  
  188. global DPCookie::endUserInclude
  189. set DPCookie::endUserInclude "// End user include section"
  190.  
  191. global DPCookie::assocAttribs
  192. set DPCookie::assocAttribs "// Association attributes"
  193.  
  194. global DPCookie::userDefAttribs
  195. set DPCookie::userDefAttribs "// User defined attributes"
  196.  
  197. global DPCookie::formAttrib
  198. set DPCookie::formAttrib "// Form attribute"
  199.  
  200. global DPCookie::userDefMethods
  201. set DPCookie::userDefMethods "// User defined methods"
  202.  
  203. global DPCookie::accessMethods
  204. set DPCookie::accessMethods "// Access methods"
  205.  
  206. global DPCookie::assocMethods
  207. set DPCookie::assocMethods "// Association methods"
  208.  
  209. global DPCookie::classFeatureAttribs
  210. set DPCookie::classFeatureAttribs "// Class feature attributes"
  211.  
  212. global DPCookie::classFeatureMethods
  213. set DPCookie::classFeatureMethods "// Class feature methods"
  214.  
  215. global DPCookie::regenMarker
  216. set DPCookie::regenMarker "// Do not delete this line -- regeneration marker"
  217.  
  218. global DPCookie::obsoleteCode
  219. set DPCookie::obsoleteCode "// Obsolete code section"
  220.  
  221. global DPCookie::genProjectInclude
  222. set DPCookie::genProjectInclude "// Generated"
  223.  
  224. global DPCookie::genProjectCode
  225. set DPCookie::genProjectCode "// Generated"
  226.  
  227. global DPCookie::genProjectStart
  228. set DPCookie::genProjectStart "// Do not delete this block -- regeneration marker -- start"
  229.  
  230. global DPCookie::genProjectEnd
  231. set DPCookie::genProjectEnd "// Do not delete this block -- regeneration marker -- end"
  232.  
  233.  
  234. constructor DPCookie {class this} {
  235.     set this [GCObject::constructor $class $this]
  236.     # Start constructor user section
  237.     # End constructor user section
  238.     return $this
  239. }
  240.  
  241. method DPCookie::destructor {this} {
  242.     # Start destructor user section
  243.     # End destructor user section
  244. }
  245.  
  246. # Do not delete this line -- regeneration end marker
  247.  
  248. #---------------------------------------------------------------------------
  249. #      File:           @(#)dpenumcomp.tcl    /main/hindenburg/1
  250. #---------------------------------------------------------------------------
  251.  
  252. # Start user added include file section
  253. # End user added include file section
  254.  
  255.  
  256. Class DPEnumComponent : {GCObject} {
  257.     constructor
  258.     method destructor
  259.     method generate
  260.     attribute name
  261. }
  262.  
  263. constructor DPEnumComponent {class this} {
  264.     set this [GCObject::constructor $class $this]
  265.     # Start constructor user section
  266.     # End constructor user section
  267.     return $this
  268. }
  269.  
  270. method DPEnumComponent::destructor {this} {
  271.     # Start destructor user section
  272.     # End destructor user section
  273. }
  274.  
  275. method DPEnumComponent::generate {this section} {
  276.     $section append [$this name]
  277. }
  278.  
  279. # Do not delete this line -- regeneration end marker
  280.  
  281. #---------------------------------------------------------------------------
  282. #      File:           @(#)dpfeature.tcl    /main/hindenburg/3
  283. #---------------------------------------------------------------------------
  284.  
  285. # Start user added include file section
  286. # End user added include file section
  287.  
  288.  
  289. Class DPFeature : {GCObject} {
  290.     constructor
  291.     method destructor
  292.     attribute name
  293.     attribute access
  294.     attribute isClassFeature
  295.     attribute comment
  296. }
  297.  
  298. constructor DPFeature {class this} {
  299.     set this [GCObject::constructor $class $this]
  300.     $this access "Published"
  301.     $this isClassFeature 0
  302.     # Start constructor user section
  303.     # End constructor user section
  304.     return $this
  305. }
  306.  
  307. method DPFeature::destructor {this} {
  308.     # Start destructor user section
  309.     # End destructor user section
  310. }
  311.  
  312. # Do not delete this line -- regeneration end marker
  313.  
  314. #---------------------------------------------------------------------------
  315. #      File:           @(#)dpproject.tcl    /main/hindenburg/4
  316. #---------------------------------------------------------------------------
  317.  
  318. # Start user added include file section
  319. # End user added include file section
  320.  
  321.  
  322. Class DPProject : {GCObject} {
  323.     constructor
  324.     method destructor
  325.     method generate
  326.     method generateFile
  327.     method getUnit
  328.     method setUnit
  329.     method removeUnit
  330.     method getForm
  331.     method setForm
  332.     method removeForm
  333.     attribute name
  334.     attribute isLibrary
  335.     attribute unit
  336.     attribute form
  337. }
  338.  
  339. constructor DPProject {class this} {
  340.     set this [GCObject::constructor $class $this]
  341.     $this isLibrary 0
  342.     $this unit [Dictionary new]
  343.     $this form [Dictionary new]
  344.     # Start constructor user section
  345.     # End constructor user section
  346.     return $this
  347. }
  348.  
  349. method DPProject::destructor {this} {
  350.     # Start destructor user section
  351.     # End destructor user section
  352. }
  353.  
  354. method DPProject::generate {this typeToClassDict} {
  355.  
  356.     $typeToClassDict foreach ooplclass fileDict {
  357.         if {[[$this unit] exists [$ooplclass getName]]} {
  358.             set unitfile [TextSection new]
  359.             [[$this unit] set [$ooplclass getName]] generate $unitfile
  360.             $fileDict set "pas" $unitfile
  361.             if {[[[$this unit] set [$ooplclass getName]] unitType] == "formclass"} {
  362.                 set formfile [TextSection new]
  363.                 [[$this unit] set [$ooplclass getName]] generateForm $formfile
  364.                 $fileDict set "txt" $formfile
  365.             }
  366.         }
  367.     }
  368. }
  369.  
  370. method DPProject::generateFile {this section} {
  371.     if {[$this isLibrary]} {
  372.         $section append "library "
  373.     } else {
  374.         $section append "program "
  375.     }
  376.     $section append [$this name]
  377.     $section append ";\n\nuses\n"
  378.     $section indent +
  379.     if {![$this isLibrary]} {
  380.         $section append "Forms,\n"
  381.     }
  382.  
  383.     set first 1
  384.     [$this unit] foreach key unt {
  385.         if {$first} {
  386.             set first 0
  387.         } else {
  388.             $section append ",\n"
  389.         }
  390.         $section append [$unt name]
  391.         $section append " in \""
  392.         $section append [[$unt delphiclass] name]
  393.         $section append ".pas\""
  394.     }
  395.  
  396.     $section append ";\n\n"
  397.     $section indent -
  398.  
  399.     if {![$this isLibrary]} {
  400.         $section append "\{\$R \*.RES\}\n\n"
  401.     }
  402.     $section append "begin\n"
  403.     if {![$this isLibrary]} {
  404.         $section indent +
  405.         $section append "Application.Initialize;\n"
  406.  
  407.         [$this form] foreach key frm {
  408.             $section append "Application.CreateForm\("
  409.             $section append [[$frm type] name]
  410.             $section append ", "
  411.             $section append [$frm name]
  412.             $section append "\);\n"
  413.         }
  414.  
  415.         $section append "Application.Run\n"
  416.         $section indent -
  417.     }
  418.     $section append "end.\n"
  419. }
  420.  
  421. # Do not delete this line -- regeneration end marker
  422.  
  423. method DPProject::getUnit {this name} {
  424.     return [[$this unit] set $name]
  425. }
  426.  
  427. method DPProject::setUnit {this name newUnit} {
  428.     [$this unit] set $name $newUnit
  429. }
  430.  
  431. method DPProject::removeUnit {this name} {
  432.     [$this unit] unset $name
  433. }
  434.  
  435. method DPProject::getForm {this name} {
  436.     return [[$this form] set $name]
  437. }
  438.  
  439. method DPProject::setForm {this name newForm} {
  440.     [$this form] set $name $newForm
  441. }
  442.  
  443. method DPProject::removeForm {this name} {
  444.     [$this form] unset $name
  445. }
  446.  
  447. #---------------------------------------------------------------------------
  448. #      File:           @(#)dptype.tcl    /main/hindenburg/5
  449. #---------------------------------------------------------------------------
  450.  
  451. # Start user added include file section
  452. # End user added include file section
  453.  
  454.  
  455. Class DPType : {GCObject} {
  456.     constructor
  457.     method destructor
  458.     method addAsInclude
  459.     method generate
  460.     attribute name
  461.     attribute isArray
  462.     attribute arraySize
  463.     attribute includeType
  464.     attribute includeName
  465. }
  466.  
  467. constructor DPType {class this} {
  468.     set this [GCObject::constructor $class $this]
  469.     $this isArray 0
  470.     $this includeType "none"
  471.     # Start constructor user section
  472.     # End constructor user section
  473.     return $this
  474. }
  475.  
  476. method DPType::destructor {this} {
  477.     # Start destructor user section
  478.     # End destructor user section
  479. }
  480.  
  481. method DPType::addAsInclude {this unit} {
  482.     switch [$this includeType] {
  483.         "user" {
  484.             $unit addInclude [$this includeName]
  485.         }
  486.         "imp" {
  487.             $unit addImpinclude [$this includeName]
  488.         }
  489.         "system" {
  490.             $unit addSysteminclude [$this includeName]
  491.         }
  492.         "none" {
  493.         }
  494.         default {
  495.         }
  496.     }
  497. }
  498.  
  499. method DPType::generate {this whole unit} {
  500.     if {[$this isArray]} {
  501.         $whole append "array[1.."
  502.         $whole append [$this arraySize]
  503.         $whole append "] of "
  504.     }
  505.     $whole append [$this name]
  506.     $this addAsInclude $unit
  507. }
  508.  
  509. # Do not delete this line -- regeneration end marker
  510.  
  511. #---------------------------------------------------------------------------
  512. #      File:           @(#)dpunit.tcl    /main/hindenburg/8
  513. #---------------------------------------------------------------------------
  514.  
  515. # Start user added include file section
  516. # End user added include file section
  517.  
  518.  
  519. Class DPUnit : {GCObject} {
  520.     constructor
  521.     method destructor
  522.     method addInclude
  523.     method addSysteminclude
  524.     method addImpinclude
  525.     method generateDeclaration
  526.     method generateMethods
  527.     method generateIncludes
  528.     method generateImpIncludes
  529.     method generate
  530.     attribute name
  531.     attribute unitName
  532.     attribute unitType
  533.     attribute includeSet
  534.     attribute comment
  535.     attribute systemincludeSet
  536.     attribute userinclude
  537.     attribute impincludeSet
  538. }
  539.  
  540. constructor DPUnit {class this} {
  541.     set this [GCObject::constructor $class $this]
  542.     $this unitType "none"
  543.     $this includeSet [List new]
  544.     $this systemincludeSet [List new]
  545.     $this impincludeSet [List new]
  546.     # Start constructor user section
  547.     # End constructor user section
  548.     return $this
  549. }
  550.  
  551. method DPUnit::destructor {this} {
  552.     # Start destructor user section
  553.     # End destructor user section
  554. }
  555.  
  556. method DPUnit::addInclude {this unit} {
  557.     if {$unit == ""} {
  558.         return
  559.     }
  560.     if {[[$this impincludeSet] search -exact $unit] != -1} {
  561.         [$this impincludeSet] removeValue $unit
  562.     }
  563.     if {$unit != [$this unitName] && [[$this includeSet] search -exact $unit] == -1} {
  564.         [$this includeSet] insert $unit
  565.     }
  566. }
  567.  
  568. method DPUnit::addSysteminclude {this unit} {
  569.     if {$unit == ""} {
  570.         return
  571.     }
  572.     if {$unit != [$this unitName] && [[$this systemincludeSet] search -exact $unit] == -1} {
  573.         if {$unit != "System"} {
  574.             [$this systemincludeSet] insert $unit
  575.         }
  576.     }
  577. }
  578.  
  579. method DPUnit::addImpinclude {this unit} {
  580.     if {$unit == ""} {
  581.         return
  582.     }
  583.     if {$unit != [$this unitName] && [[$this impincludeSet] search -exact $unit] == -1 && [[$this includeSet] search -exact $unit] == -1} {
  584.         [$this impincludeSet] insert $unit
  585.     }
  586. }
  587.  
  588. method DPUnit::generateDeclaration {this section} {
  589.     # !! Implement this function !!
  590. }
  591.  
  592. method DPUnit::generateMethods {this section} {
  593.     $section append "${DPCookie::regenMarker}\n\n"
  594. }
  595.  
  596. method DPUnit::generateIncludes {this section} {
  597.  
  598.     set first 1
  599.     if {[$this userinclude] != "" || ![[$this includeSet] empty] || ![[$this systemincludeSet] empty]} {
  600.         $section append "uses\n" 
  601.         $section indent +
  602.  
  603.         # Uses
  604.         #
  605.         $section append "${DPCookie::startUserInclude}\n"
  606.  
  607.         if {[$this userinclude] != ""} {
  608.             set usesList [split [[$this userinclude] contents] "\n"]
  609.  
  610.             set oldremain ""
  611.             foreach line $usesList {
  612.                 if {[regexp {^[     ]*([^     ,;]+)([,;])?([     ]*.*)$} $line total name dummy remain]} {
  613.                     if {$first} {
  614.                         set first 0
  615.                     } else {
  616.                         $section append ","
  617.                         $section append "${oldremain}\n"
  618.                     }
  619.                     set oldremain $remain
  620.                     $section append "${name}"
  621.                 }
  622.             }
  623.             if {!$first} {
  624.                 if {![[$this includeSet] empty] || ![[$this systemincludeSet] empty]} {
  625.                     $section append ","
  626.                 }
  627.                 $section append "${remain}\n"
  628.             }
  629.         }
  630.         $section append "${DPCookie::endUserInclude}\n"
  631.  
  632.         set first 1
  633.         if {![[$this systemincludeSet] empty]} {
  634.             [$this systemincludeSet] foreach include {
  635.                 if {$first} {
  636.                     set first 0
  637.                 } else {
  638.                     $section append ",\n"
  639.                 }
  640.                 $section append "${include}"
  641.             }
  642.         }
  643.         if {![[$this includeSet] empty]} {
  644.             [$this includeSet] foreach include {
  645.                 if {$first} {
  646.                     set first 0
  647.                 } else {
  648.                     $section append ",\n"
  649.                 }
  650.                 $section append "${include}"
  651.             }
  652.         }
  653.         $section append ";\n\n"
  654.         $section indent -
  655.     }
  656. }
  657.  
  658. method DPUnit::generateImpIncludes {this section} {
  659.     set first 1
  660.     if {![[$this impincludeSet] empty]} {
  661.         $section append "uses\n" 
  662.         $section indent +
  663.  
  664.         # Uses
  665.         #
  666.         set first 1
  667.         if {![[$this impincludeSet] empty]} {
  668.             [$this impincludeSet] foreach include {
  669.                 if {$first} {
  670.                     set first 0
  671.                 } else {
  672.                     $section append ",\n"
  673.                 }
  674.                 $section append "${include}"
  675.             }
  676.         }
  677.         $section append ";\n\n"
  678.         $section indent -
  679.     }
  680. }
  681.  
  682. method DPUnit::generate {this section} {
  683.  
  684.     set declSection [TextSection new]
  685.     set defSection [TextSection new]
  686.     set inclSection [TextSection new]
  687.     set impInclSection [TextSection new]
  688.  
  689.     # Declaration part
  690.     $this generateDeclaration $declSection
  691.  
  692.     # Definition part
  693.     $this generateMethods $defSection
  694.  
  695.     # Includes part
  696.     $this generateIncludes $inclSection
  697.  
  698.     # Implementation includes part
  699.     $this generateImpIncludes $impInclSection
  700.  
  701.     $section append "unit [$this unitName];\n\n"
  702.  
  703.     $section append "interface\n\n"
  704.     $section appendSect $inclSection
  705.     $section append "type\n"
  706.     $section appendSect $declSection
  707.  
  708.     $section append "\n\nimplementation\n\n"
  709.     $section appendSect $impInclSection
  710.     $section appendSect $defSection
  711.  
  712.     $section append "\nend.\n"
  713. }
  714.  
  715. # Do not delete this line -- regeneration end marker
  716.  
  717. #---------------------------------------------------------------------------
  718. #      File:           @(#)dpvariable.tcl    /main/hindenburg/4
  719. #---------------------------------------------------------------------------
  720.  
  721. # Start user added include file section
  722. # End user added include file section
  723.  
  724.  
  725. Class DPVariable : {DPFeature} {
  726.     constructor
  727.     method destructor
  728.     method generate
  729.     method addProc
  730.     method removeProc
  731.     attribute type
  732.     attribute procSet
  733. }
  734.  
  735. constructor DPVariable {class this type} {
  736.     set this [DPFeature::constructor $class $this]
  737.     $this type $type
  738.     $this procSet [List new]
  739.     # Start constructor user section
  740.     # End constructor user section
  741.     return $this
  742. }
  743.  
  744. method DPVariable::destructor {this} {
  745.     # Start destructor user section
  746.     # End destructor user section
  747.     $this DPFeature::destructor
  748. }
  749.  
  750. method DPVariable::generate {this whole unit} {
  751.     if {[$this comment] != ""} {
  752.         [$this comment] generate $whole
  753.     }
  754.     $whole append "[$this name]: "
  755.     [$this type] generate $whole $unit
  756.     $whole append ";\n" 
  757. }
  758.  
  759. # Do not delete this line -- regeneration end marker
  760.  
  761. method DPVariable::addProc {this newProc} {
  762.     [$this procSet] append $newProc
  763.  
  764. }
  765.  
  766. method DPVariable::removeProc {this oldProc} {
  767.     [$this procSet] removeValue $oldProc
  768. }
  769. #---------------------------------------------------------------------------
  770. #      File:           @(#)dpcontrol.tcl    /main/hindenburg/3
  771. #---------------------------------------------------------------------------
  772.  
  773. # Start user added include file section
  774. # End user added include file section
  775.  
  776.  
  777. Class DPControl : {DPVariable} {
  778.     constructor
  779.     method destructor
  780.     method generateComponent
  781.     method addEvent
  782.     method removeEvent
  783.     method addChild
  784.     method removeChild
  785.     attribute properties
  786.     attribute eventSet
  787.     attribute childSet
  788. }
  789.  
  790. constructor DPControl {class this type} {
  791.     set this [DPVariable::constructor $class $this $type]
  792.     $this eventSet [List new]
  793.     $this childSet [List new]
  794.     # Start constructor user section
  795.     # End constructor user section
  796.     return $this
  797. }
  798.  
  799. method DPControl::destructor {this} {
  800.     # Start destructor user section
  801.     # End destructor user section
  802.     $this DPVariable::destructor
  803. }
  804.  
  805. method DPControl::generateComponent {this section} {
  806.     $section append "object "
  807.     $section append "[$this name]: [[$this type] name]\n"
  808.     $section indent +
  809.     [$this eventSet] foreach event {
  810.         $event generate $section
  811.     }
  812.     if {[$this properties] != ""} {
  813.         $section appendSect [$this properties]
  814.     }
  815.     [$this childSet] foreach child {
  816.         $child generateComponent $section
  817.     }
  818.     $section indent -
  819.     $section append "end\n"
  820. }
  821.  
  822. # Do not delete this line -- regeneration end marker
  823.  
  824. method DPControl::addEvent {this newEvent} {
  825.     [$this eventSet] append $newEvent
  826.  
  827. }
  828.  
  829. method DPControl::removeEvent {this oldEvent} {
  830.     [$this eventSet] removeValue $oldEvent
  831. }
  832.  
  833. method DPControl::addChild {this newChild} {
  834.     [$this childSet] append $newChild
  835.  
  836. }
  837.  
  838. method DPControl::removeChild {this oldChild} {
  839.     [$this childSet] removeValue $oldChild
  840. }
  841.  
  842. #---------------------------------------------------------------------------
  843. #      File:           @(#)dpmethod.tcl    /main/hindenburg/6
  844. #---------------------------------------------------------------------------
  845.  
  846. # Start user added include file section
  847. # End user added include file section
  848.  
  849.  
  850. Class DPMethod : {DPFeature} {
  851.     constructor
  852.     method destructor
  853.     method generateTypes
  854.     method generateGenCode
  855.     method generateUserCode
  856.     method generateReturnType
  857.     method generateArguments
  858.     method generateDeclaration
  859.     method generateDefinition
  860.     method generate
  861.     method addArg
  862.     method removeArg
  863.     attribute methodType
  864.     attribute userCodeFirst
  865.     attribute hasUserSection
  866.     attribute isVirtual
  867.     attribute isDynamic
  868.     attribute isAbstract
  869.     attribute isOverride
  870.     attribute usercode
  871.     attribute gencode
  872.     attribute gentypes
  873.     attribute usertypes
  874.     attribute argSet
  875. }
  876.  
  877. constructor DPMethod {class this} {
  878.     set this [DPFeature::constructor $class $this]
  879.     $this methodType "None"
  880.     $this userCodeFirst 0
  881.     $this hasUserSection 0
  882.     $this isVirtual 0
  883.     $this isDynamic 0
  884.     $this isAbstract 0
  885.     $this isOverride 0
  886.     $this argSet [List new]
  887.     # Start constructor user section
  888.     # End constructor user section
  889.     return $this
  890. }
  891.  
  892. method DPMethod::destructor {this} {
  893.     # Start destructor user section
  894.     # End destructor user section
  895.     $this DPFeature::destructor
  896. }
  897.  
  898. method DPMethod::generateTypes {this whole} {
  899.     if {[$this gentypes] != ""} {
  900.         $whole appendSect [$this gentypes]
  901.     }
  902.     if {[$this hasUserSection]} {
  903.         $whole indent +
  904.         $whole append "${DPCookie::startUserSection}\n"
  905.         $whole indent -
  906.     }
  907.     if {[$this usertypes] != ""} {
  908.         $whole appendSect [$this usertypes]
  909.     }
  910.     if {[$this hasUserSection]} {
  911.         $whole indent +
  912.         $whole append "${DPCookie::endUserSection}\n"
  913.         $whole indent -
  914.     }
  915. }
  916.  
  917. method DPMethod::generateGenCode {this whole} {
  918.     $whole indent +
  919.     if {[$this gencode] != ""} {
  920.         $whole appendSect [$this gencode]
  921.     } elseif {![$this hasUserSection] && [$this usercode] == ""} {
  922.         $whole append "${DPCookie::implement0}\n"
  923.     }
  924.     $whole indent -
  925. }
  926.  
  927. method DPMethod::generateUserCode {this whole} {
  928.     if {[$this hasUserSection]} {
  929.         $whole indent +
  930.         $whole append "${DPCookie::startUserSection}\n"
  931.         $whole indent -
  932.     }
  933.     if {[$this usercode] != ""} {
  934.         $whole appendSect [$this usercode]
  935.     }
  936.     if {[$this hasUserSection]} {
  937.         $whole indent +
  938.         $whole append "${DPCookie::endUserSection}\n"
  939.         $whole indent -
  940.     }
  941. }
  942.  
  943. method DPMethod::generateReturnType {this whole unit} {
  944. }
  945.  
  946. method DPMethod::generateArguments {this whole unit} {
  947.  
  948.     if {[[$this argSet] contents] != ""} {
  949.         $whole append "("
  950.         set first 1
  951.         [$this argSet] foreach arg {
  952.             if {$first} {
  953.                 set first 0
  954.             } else {
  955.                 $whole append "; "
  956.             }
  957.             $arg generate $whole $unit
  958.         }
  959.         $whole append ")"
  960.     }
  961.     $this generateReturnType $whole $unit
  962.     $whole append ";"
  963. }
  964.  
  965. method DPMethod::generateDeclaration {this whole unit} {
  966.     if {[$this isClassFeature]} {
  967.         $whole append "class " 
  968.     }
  969.     $whole append "[$this methodType] [$this name]"
  970.     $this generateArguments $whole $unit
  971.  
  972.     if {[$this isOverride]} {
  973.         $whole append " override;"
  974.     }
  975.     if {[$this isVirtual]} {
  976.         $whole append " virtual;"
  977.     }
  978.     if {[$this isDynamic]} {
  979.         $whole append " dynamic;"
  980.     }
  981.     if {[$this isAbstract]} {
  982.         $whole append " abstract;"
  983.     }
  984.     $whole append "\n"
  985. }
  986.  
  987. method DPMethod::generateDefinition {this whole unit} {
  988.     if {[$this isClassFeature]} {
  989.         $whole append "class " 
  990.     }
  991.     $whole append "[$this methodType] [$unit name].[$this name]"
  992.  
  993.     $this generateArguments $whole $unit
  994. }
  995.  
  996. method DPMethod::generate {this whole unit} {
  997.     if {[$this comment] != ""} {
  998.         [$this comment] generate $whole
  999.     }
  1000.     $this generateDefinition $whole $unit
  1001.  
  1002.     $whole append "\n"
  1003.  
  1004.     $this generateTypes $whole
  1005.     $whole append "begin\n"
  1006.  
  1007.     if {[$this userCodeFirst]} {
  1008.         $this generateUserCode $whole
  1009.         $this generateGenCode $whole
  1010.     } else {
  1011.         $this generateGenCode $whole
  1012.         $this generateUserCode $whole
  1013.     }
  1014.     $whole append "end;\n\n\n"
  1015. }
  1016.  
  1017. # Do not delete this line -- regeneration end marker
  1018.  
  1019. method DPMethod::addArg {this newArg} {
  1020.     [$this argSet] append $newArg
  1021.  
  1022. }
  1023.  
  1024. method DPMethod::removeArg {this oldArg} {
  1025.     [$this argSet] removeValue $oldArg
  1026. }
  1027.  
  1028. #---------------------------------------------------------------------------
  1029. #      File:           @(#)dpprocedur.tcl    /main/hindenburg/1
  1030. #---------------------------------------------------------------------------
  1031.  
  1032. # Start user added include file section
  1033. # End user added include file section
  1034.  
  1035.  
  1036. Class DPProcedure : {DPMethod} {
  1037.     constructor
  1038.     method destructor
  1039.     attribute methodType
  1040. }
  1041.  
  1042. constructor DPProcedure {class this} {
  1043.     set this [DPMethod::constructor $class $this]
  1044.     $this methodType "procedure"
  1045.     # Start constructor user section
  1046.     # End constructor user section
  1047.     return $this
  1048. }
  1049.  
  1050. method DPProcedure::destructor {this} {
  1051.     # Start destructor user section
  1052.     # End destructor user section
  1053.     $this DPMethod::destructor
  1054. }
  1055.  
  1056. # Do not delete this line -- regeneration end marker
  1057.  
  1058. #---------------------------------------------------------------------------
  1059. #      File:           @(#)dpevent.tcl    /main/hindenburg/1
  1060. #---------------------------------------------------------------------------
  1061.  
  1062. # Start user added include file section
  1063. # End user added include file section
  1064.  
  1065.  
  1066. Class DPEvent : {DPProcedure} {
  1067.     constructor
  1068.     method destructor
  1069.     attribute methodType
  1070. }
  1071.  
  1072. constructor DPEvent {class this} {
  1073.     set this [DPProcedure::constructor $class $this]
  1074.     $this methodType "procedure"
  1075.     # Start constructor user section
  1076.     # End constructor user section
  1077.     return $this
  1078. }
  1079.  
  1080. method DPEvent::destructor {this} {
  1081.     # Start destructor user section
  1082.     # End destructor user section
  1083.     $this DPProcedure::destructor
  1084. }
  1085.  
  1086. # Do not delete this line -- regeneration end marker
  1087.  
  1088. #---------------------------------------------------------------------------
  1089. #      File:           @(#)dpclass.tcl    /main/hindenburg/9
  1090. #---------------------------------------------------------------------------
  1091.  
  1092. # Start user added include file section
  1093. # End user added include file section
  1094.  
  1095.  
  1096. Class DPClass : {DPUnit} {
  1097.     constructor
  1098.     method destructor
  1099.     method generateGlobVars
  1100.     method generateDeclaration
  1101.     method generateMethods
  1102.     method addGlobvar
  1103.     method removeGlobvar
  1104.     method addAssocvar
  1105.     method removeAssocvar
  1106.     method addUservar
  1107.     method removeUservar
  1108.     method addProperty
  1109.     method removeProperty
  1110.     method getGenmethod
  1111.     method setGenmethod
  1112.     method removeGenmethod
  1113.     method getUsermethod
  1114.     method setUsermethod
  1115.     method removeUsermethod
  1116.     method getEvent
  1117.     method setEvent
  1118.     method removeEvent
  1119.     attribute unitType
  1120.     attribute userConstructors
  1121.     attribute destructr
  1122.     attribute constructr
  1123.     attribute superclass
  1124.     attribute globvarSet
  1125.     attribute assocvarSet
  1126.     attribute uservarSet
  1127.     attribute obsoletecode
  1128.     attribute propertySet
  1129.     attribute genmethod
  1130.     attribute usermethod
  1131.     attribute event
  1132. }
  1133.  
  1134. constructor DPClass {class this} {
  1135.     set this [DPUnit::constructor $class $this]
  1136.     $this unitType "class"
  1137.     $this userConstructors 0
  1138.     $this globvarSet [List new]
  1139.     $this assocvarSet [List new]
  1140.     $this uservarSet [List new]
  1141.     $this propertySet [List new]
  1142.     $this genmethod [Dictionary new]
  1143.     $this usermethod [Dictionary new]
  1144.     $this event [Dictionary new]
  1145.     # Start constructor user section
  1146.     # End constructor user section
  1147.     return $this
  1148. }
  1149.  
  1150. method DPClass::destructor {this} {
  1151.     # Start destructor user section
  1152.     # End destructor user section
  1153.     $this DPUnit::destructor
  1154. }
  1155.  
  1156. method DPClass::generateGlobVars {this section} {
  1157.     if {![[$this globvarSet] empty]} {
  1158.         $section append "\n${DPCookie::classFeatureAttribs}\n"
  1159.         $section append "var\n"
  1160.         $section indent +
  1161.         [$this globvarSet] foreach var {
  1162.             $var generate $section $this
  1163.         }
  1164.         $section indent -
  1165.     }
  1166. }
  1167.  
  1168. method DPClass::generateDeclaration {this section} {
  1169.  
  1170.     set sectionList {NoneSection ProtectedSection PrivateSection PublicSection PublishedSection}
  1171.  
  1172.     $section indent +
  1173.     if {[$this comment] != ""} {
  1174.         [$this comment] generate $section
  1175.     }
  1176.  
  1177.     $section append "[$this name] = class"
  1178.  
  1179.     # Generate superclass
  1180.     if {[$this superclass] != ""} {
  1181.         $section append "("
  1182.         [$this superclass] generate $section $this
  1183.         $section append ")"
  1184.     }
  1185.     $section append "\n"
  1186.  
  1187.     if {[$this unitType] == "formclass"} {
  1188.         $section indent +
  1189.         $section append "\n${DPCookie::controls}\n"
  1190.         [[$this form] control] foreach key control {
  1191.             $control generate $section $this
  1192.         }
  1193.         $section append "\n${DPCookie::events}\n"
  1194.         [$this event] foreach key evt {
  1195.             $evt generateDeclaration $section $this
  1196.         }
  1197.         $section indent -
  1198.     }
  1199.  
  1200.     # Create access sections
  1201.     #
  1202.     foreach sec $sectionList {
  1203.         set $sec [TextSection new]
  1204.         [set $sec] indent +
  1205.     }
  1206.  
  1207.     # User defined attributes
  1208.     #
  1209.     $PrivateSection append "\n${DPCookie::userDefAttribs}\n"
  1210.     [$this uservarSet] foreach var {
  1211.         $var generate [set [$var access]Section] $this
  1212.     }
  1213.  
  1214.     # Association attributes
  1215.     #
  1216.     $PrivateSection append "\n${DPCookie::assocAttribs}\n"
  1217.     [$this assocvarSet] foreach var {
  1218.         $var generate [set [$var access]Section] $this
  1219.     }
  1220.  
  1221.     # User methods
  1222.     #
  1223.     foreach sec $sectionList {
  1224.         [set $sec] append "\n${DPCookie::userDefMethods}\n"
  1225.     }
  1226.     # Constructor
  1227.     if {[$this constructr] != ""} {
  1228.         [$this constructr] generateDeclaration [set [[$this constructr] access]Section] $this
  1229.     }
  1230.     # Destructor
  1231.     if {[$this destructr] != ""} {
  1232.         [$this destructr] generateDeclaration [set [[$this destructr] access]Section] $this
  1233.     }
  1234.  
  1235.     [$this usermethod] foreach key method {
  1236.         $method generateDeclaration [set [$method access]Section] $this
  1237.     }
  1238.  
  1239.     # Access methods
  1240.     #
  1241.     foreach sec $sectionList {
  1242.         [set $sec] append "\n${DPCookie::accessMethods}\n"
  1243.     }
  1244.     [$this genmethod] foreach key method {
  1245.         $method generateDeclaration [set [$method access]Section] $this
  1246.     }
  1247.  
  1248.     # Properties
  1249.     #
  1250.     foreach sec $sectionList {
  1251.         [set $sec] append "\n${DPCookie::properties}\n"
  1252.     }
  1253.     [$this propertySet] foreach prop {
  1254.         $prop generate [set [$prop access]Section] $this
  1255.     }
  1256.  
  1257.     $section append "\nprivate\n"
  1258.     $section appendSect $PrivateSection
  1259.     $section append "\nprotected\n"
  1260.     $section appendSect $ProtectedSection
  1261.     $section append "\npublic\n"
  1262.     $section appendSect $PublicSection
  1263.     $section append "\npublished\n"
  1264.     $section appendSect $PublishedSection
  1265.     $section append "end;\n"
  1266.     $section indent -
  1267.  
  1268.     $this generateGlobVars $section
  1269. }
  1270.  
  1271. method DPClass::generateMethods {this section} {
  1272.  
  1273.     if {[$this unitType] == "formclass"} {
  1274.         $section append "\{\$R \*.DFM\}\n\n"
  1275.         [$this event] foreach key evt {
  1276.             $evt generate $section $this
  1277.         }
  1278.     }
  1279.  
  1280.     if {[$this constructr] != ""} {
  1281.         [$this constructr] generate $section $this
  1282.     }
  1283.     if {[$this destructr] != ""} {
  1284.         [$this destructr] generate $section $this
  1285.     }
  1286.  
  1287.     [$this usermethod] foreach key method {
  1288.         if {![$method isAbstract]} {
  1289.             $method generate $section $this
  1290.         }
  1291.     }
  1292.  
  1293.     $section append "${DPCookie::regenMarker}\n\n"
  1294.     [$this genmethod] foreach key method {
  1295.         $method generate $section $this
  1296.     }
  1297.  
  1298.     if {[$this obsoletecode] != ""} {
  1299.         $section append "${DPCookie::obsoleteCode}\n\n"
  1300.         $section append "\{\$IFDEF OBSOLETE_CODE\}\n"
  1301.         $section appendSect [$this obsoletecode]
  1302.         $section append "\{\$ENDIF\}\n"
  1303.     }
  1304. }
  1305.  
  1306. # Do not delete this line -- regeneration end marker
  1307.  
  1308. method DPClass::addGlobvar {this newGlobvar} {
  1309.     [$this globvarSet] append $newGlobvar
  1310.  
  1311. }
  1312.  
  1313. method DPClass::removeGlobvar {this oldGlobvar} {
  1314.     [$this globvarSet] removeValue $oldGlobvar
  1315. }
  1316.  
  1317. method DPClass::addAssocvar {this newAssocvar} {
  1318.     [$this assocvarSet] append $newAssocvar
  1319.  
  1320. }
  1321.  
  1322. method DPClass::removeAssocvar {this oldAssocvar} {
  1323.     [$this assocvarSet] removeValue $oldAssocvar
  1324. }
  1325.  
  1326. method DPClass::addUservar {this newUservar} {
  1327.     [$this uservarSet] append $newUservar
  1328.  
  1329. }
  1330.  
  1331. method DPClass::removeUservar {this oldUservar} {
  1332.     [$this uservarSet] removeValue $oldUservar
  1333. }
  1334.  
  1335. method DPClass::addProperty {this newProperty} {
  1336.     [$this propertySet] append $newProperty
  1337.  
  1338. }
  1339.  
  1340. method DPClass::removeProperty {this oldProperty} {
  1341.     [$this propertySet] removeValue $oldProperty
  1342. }
  1343.  
  1344. method DPClass::getGenmethod {this name} {
  1345.     return [[$this genmethod] set $name]
  1346. }
  1347.  
  1348. method DPClass::setGenmethod {this name newGenmethod} {
  1349.     [$this genmethod] set $name $newGenmethod
  1350. }
  1351.  
  1352. method DPClass::removeGenmethod {this name} {
  1353.     [$this genmethod] unset $name
  1354. }
  1355.  
  1356. method DPClass::getUsermethod {this name} {
  1357.     return [[$this usermethod] set $name]
  1358. }
  1359.  
  1360. method DPClass::setUsermethod {this name newUsermethod} {
  1361.     [$this usermethod] set $name $newUsermethod
  1362. }
  1363.  
  1364. method DPClass::removeUsermethod {this name} {
  1365.     [$this usermethod] unset $name
  1366. }
  1367.  
  1368. method DPClass::getEvent {this name} {
  1369.     return [[$this event] set $name]
  1370. }
  1371.  
  1372. method DPClass::setEvent {this name newEvent} {
  1373.     [$this event] set $name $newEvent
  1374. }
  1375.  
  1376. method DPClass::removeEvent {this name} {
  1377.     [$this event] unset $name
  1378. }
  1379.  
  1380. #---------------------------------------------------------------------------
  1381. #      File:           @(#)dpenumunit.tcl    /main/hindenburg/1
  1382. #---------------------------------------------------------------------------
  1383.  
  1384. # Start user added include file section
  1385. # End user added include file section
  1386.  
  1387.  
  1388. Class DPEnumUnit : {DPUnit} {
  1389.     constructor
  1390.     method destructor
  1391.     method generateDeclaration
  1392.     method addComponent
  1393.     method removeComponent
  1394.     attribute unitType
  1395.     attribute componentSet
  1396. }
  1397.  
  1398. constructor DPEnumUnit {class this} {
  1399.     set this [DPUnit::constructor $class $this]
  1400.     $this unitType "enum"
  1401.     $this componentSet [List new]
  1402.     # Start constructor user section
  1403.     # End constructor user section
  1404.     return $this
  1405. }
  1406.  
  1407. method DPEnumUnit::destructor {this} {
  1408.     # Start destructor user section
  1409.     # End destructor user section
  1410.     $this DPUnit::destructor
  1411. }
  1412.  
  1413. method DPEnumUnit::generateDeclaration {this section} {
  1414.  
  1415.     $section indent +
  1416.     $section append "[$this name] = ("
  1417.     set first 1
  1418.     [$this componentSet] foreach component {
  1419.         if {$first} {
  1420.             set first 0
  1421.         } else {
  1422.             $section append ", "
  1423.         }
  1424.         $component generate $section
  1425.     }
  1426.     $section append ");\n"
  1427.     $section indent -
  1428. }
  1429.  
  1430. # Do not delete this line -- regeneration end marker
  1431.  
  1432. method DPEnumUnit::addComponent {this newComponent} {
  1433.     [$this componentSet] append $newComponent
  1434.  
  1435. }
  1436.  
  1437. method DPEnumUnit::removeComponent {this oldComponent} {
  1438.     [$this componentSet] removeValue $oldComponent
  1439. }
  1440.  
  1441. #---------------------------------------------------------------------------
  1442. #      File:           @(#)dpformclas.tcl    /main/hindenburg/2
  1443. #---------------------------------------------------------------------------
  1444.  
  1445. # Start user added include file section
  1446. # End user added include file section
  1447.  
  1448.  
  1449. Class DPFormClass : {DPClass} {
  1450.     constructor
  1451.     method destructor
  1452.     method generateForm
  1453.     attribute unitType
  1454.     attribute form
  1455. }
  1456.  
  1457. constructor DPFormClass {class this form} {
  1458.     set this [DPClass::constructor $class $this]
  1459.     $this unitType "formclass"
  1460.     $this form $form
  1461.     # Start constructor user section
  1462.     # End constructor user section
  1463.     return $this
  1464. }
  1465.  
  1466. method DPFormClass::destructor {this} {
  1467.     # Start destructor user section
  1468.     # End destructor user section
  1469.     $this DPClass::destructor
  1470. }
  1471.  
  1472. method DPFormClass::generateForm {this section} {
  1473.     [$this form] generateComponent $section
  1474. }
  1475.  
  1476. # Do not delete this line -- regeneration end marker
  1477.  
  1478. #---------------------------------------------------------------------------
  1479. #      File:           @(#)dptypedefu.tcl    /main/hindenburg/2
  1480. #---------------------------------------------------------------------------
  1481.  
  1482. # Start user added include file section
  1483. # End user added include file section
  1484.  
  1485.  
  1486. Class DPTypeDefUnit : {DPUnit} {
  1487.     constructor
  1488.     method destructor
  1489.     method generateDeclaration
  1490.     attribute unitType
  1491.     attribute typedefType
  1492. }
  1493.  
  1494. constructor DPTypeDefUnit {class this typedefType} {
  1495.     set this [DPUnit::constructor $class $this]
  1496.     set this [GCObject::constructor $class $this]
  1497.     $this unitType "typedef"
  1498.     $this typedefType $typedefType
  1499.     # Start constructor user section
  1500.     # End constructor user section
  1501.     return $this
  1502. }
  1503.  
  1504. method DPTypeDefUnit::destructor {this} {
  1505.     # Start destructor user section
  1506.     # End destructor user section
  1507.     $this DPUnit::destructor
  1508. }
  1509.  
  1510. method DPTypeDefUnit::generateDeclaration {this section} {
  1511.     $section indent +
  1512.     $section append "[$this name] = "
  1513.     [$this typedefType] generate $section $this
  1514.     $section append ";\n"
  1515.     $section indent -
  1516. }
  1517.  
  1518. # Do not delete this line -- regeneration end marker
  1519.  
  1520. #---------------------------------------------------------------------------
  1521. #      File:           @(#)dpproperty.tcl    /main/hindenburg/2
  1522. #---------------------------------------------------------------------------
  1523.  
  1524. # Start user added include file section
  1525. # End user added include file section
  1526.  
  1527.  
  1528. Class DPProperty : {DPFeature} {
  1529.     constructor
  1530.     method destructor
  1531.     method generate
  1532.     attribute type
  1533.     attribute read
  1534.     attribute write
  1535. }
  1536.  
  1537. constructor DPProperty {class this type} {
  1538.     set this [DPFeature::constructor $class $this]
  1539.     $this type $type
  1540.     # Start constructor user section
  1541.     # End constructor user section
  1542.     return $this
  1543. }
  1544.  
  1545. method DPProperty::destructor {this} {
  1546.     # Start destructor user section
  1547.     # End destructor user section
  1548.     $this DPFeature::destructor
  1549. }
  1550.  
  1551. method DPProperty::generate {this whole unit} {
  1552.  
  1553.     $whole append "property "
  1554.     $whole append "[$this name]: "
  1555.     [$this type] generate $whole $unit
  1556.     if {[$this read] != ""} {
  1557.             $whole append " read "
  1558.             $whole append [[$this read] name]
  1559.         }
  1560.     if {[$this write] != ""} {
  1561.             $whole append " write "
  1562.             $whole append [[$this write] name]
  1563.         }
  1564.     $whole append ";\n"
  1565. }
  1566. #endif
  1567.  
  1568. # Do not delete this line -- regeneration end marker
  1569.  
  1570. #---------------------------------------------------------------------------
  1571. #      File:           @(#)dpfunction.tcl    /main/hindenburg/3
  1572. #---------------------------------------------------------------------------
  1573.  
  1574. # Start user added include file section
  1575. # End user added include file section
  1576.  
  1577.  
  1578. Class DPFunction : {DPMethod} {
  1579.     constructor
  1580.     method destructor
  1581.     method generateReturnType
  1582.     attribute methodType
  1583.     attribute returnvalue
  1584. }
  1585.  
  1586. constructor DPFunction {class this returnvalue} {
  1587.     set this [DPMethod::constructor $class $this]
  1588.     $this methodType "function"
  1589.     $this returnvalue $returnvalue
  1590.     # Start constructor user section
  1591.     # End constructor user section
  1592.     return $this
  1593. }
  1594.  
  1595. method DPFunction::destructor {this} {
  1596.     # Start destructor user section
  1597.     # End destructor user section
  1598.     $this DPMethod::destructor
  1599. }
  1600.  
  1601. method DPFunction::generateReturnType {this whole unit} {
  1602.     $whole append ": "
  1603.     [$this returnvalue] generate $whole $unit
  1604. }
  1605. #endif
  1606.  
  1607. # Do not delete this line -- regeneration end marker
  1608.  
  1609. #---------------------------------------------------------------------------
  1610. #      File:           @(#)dpform.tcl    /main/hindenburg/2
  1611. #---------------------------------------------------------------------------
  1612.  
  1613. # Start user added include file section
  1614. # End user added include file section
  1615.  
  1616.  
  1617. Class DPForm : {DPControl} {
  1618.     constructor
  1619.     method destructor
  1620.     method getControl
  1621.     method setControl
  1622.     method removeControl
  1623.     attribute name
  1624.     attribute control
  1625. }
  1626.  
  1627. constructor DPForm {class this type} {
  1628.     set this [DPControl::constructor $class $this $type]
  1629.     $this control [Dictionary new]
  1630.     # Start constructor user section
  1631.     # End constructor user section
  1632.     return $this
  1633. }
  1634.  
  1635. method DPForm::destructor {this} {
  1636.     # Start destructor user section
  1637.     # End destructor user section
  1638.     $this DPControl::destructor
  1639. }
  1640.  
  1641. # Do not delete this line -- regeneration end marker
  1642.  
  1643. method DPForm::getControl {this name} {
  1644.     return [[$this control] set $name]
  1645. }
  1646.  
  1647. method DPForm::setControl {this name newControl} {
  1648.     [$this control] set $name $newControl
  1649. }
  1650.  
  1651. method DPForm::removeControl {this name} {
  1652.     [$this control] unset $name
  1653. }
  1654.  
  1655. #---------------------------------------------------------------------------
  1656. #      File:           @(#)dpconstruc.tcl    /main/hindenburg/2
  1657. #---------------------------------------------------------------------------
  1658.  
  1659. # Start user added include file section
  1660. # End user added include file section
  1661.  
  1662.  
  1663. Class DPConstructor : {DPProcedure} {
  1664.     constructor
  1665.     method destructor
  1666.     attribute methodType
  1667.     attribute hasUserSection
  1668. }
  1669.  
  1670. constructor DPConstructor {class this} {
  1671.     set this [DPProcedure::constructor $class $this]
  1672.     $this methodType "constructor"
  1673.     $this hasUserSection 1
  1674.     # Start constructor user section
  1675.     # End constructor user section
  1676.     return $this
  1677. }
  1678.  
  1679. method DPConstructor::destructor {this} {
  1680.     # Start destructor user section
  1681.     # End destructor user section
  1682.     $this DPProcedure::destructor
  1683. }
  1684.  
  1685. # Do not delete this line -- regeneration end marker
  1686.  
  1687. #---------------------------------------------------------------------------
  1688. #      File:           @(#)dpdestruct.tcl    /main/hindenburg/2
  1689. #---------------------------------------------------------------------------
  1690.  
  1691. # Start user added include file section
  1692. # End user added include file section
  1693.  
  1694.  
  1695. Class DPDestructor : {DPProcedure} {
  1696.     constructor
  1697.     method destructor
  1698.     attribute methodType
  1699.     attribute hasUserSection
  1700. }
  1701.  
  1702. constructor DPDestructor {class this} {
  1703.     set this [DPProcedure::constructor $class $this]
  1704.     $this methodType "destructor"
  1705.     $this hasUserSection 1
  1706.     # Start constructor user section
  1707.     # End constructor user section
  1708.     return $this
  1709. }
  1710.  
  1711. method DPDestructor::destructor {this} {
  1712.     # Start destructor user section
  1713.     # End destructor user section
  1714.     $this DPProcedure::destructor
  1715. }
  1716.  
  1717. # Do not delete this line -- regeneration end marker
  1718.  
  1719.