home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / pboopl.tcl < prev    next >
Text File  |  1997-05-30  |  83KB  |  3,083 lines

  1. #--------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1997
  4. #
  5. #      File:           %W%
  6. #      Author:         <generated>
  7. #
  8. #--------------------------------------------------------------------------
  9.  
  10. #      File:           @(#)pbgassocin.tcl    /main/hindenburg/1
  11.  
  12.  
  13. Class PBGAssocInitializer : {Object OPAssocInitializer} {
  14.     constructor
  15.     method destructor
  16. }
  17.  
  18. constructor PBGAssocInitializer {class this name} {
  19.     set this [Object::constructor $class $this $name]
  20.     # Start constructor user section
  21.     # End constructor user section
  22.     return $this
  23. }
  24.  
  25. method PBGAssocInitializer::destructor {this} {
  26.     # Start destructor user section
  27.     # End destructor user section
  28. }
  29.  
  30. # Do not delete this line -- regeneration end marker
  31.  
  32. selfPromoter OPAssocInitializer {this} {
  33.     PBGAssocInitializer promote $this
  34. }
  35.  
  36. #      File:           @(#)pbgattribi.tcl    /main/hindenburg/1
  37.  
  38.  
  39. Class PBGAttribInitializer : {Object OPAttribInitializer} {
  40.     constructor
  41.     method destructor
  42. }
  43.  
  44. constructor PBGAttribInitializer {class this name} {
  45.     set this [Object::constructor $class $this $name]
  46.     # Start constructor user section
  47.     # End constructor user section
  48.     return $this
  49. }
  50.  
  51. method PBGAttribInitializer::destructor {this} {
  52.     # Start destructor user section
  53.     # End destructor user section
  54. }
  55.  
  56. # Do not delete this line -- regeneration end marker
  57.  
  58. selfPromoter OPAttribInitializer {this} {
  59.     PBGAttribInitializer promote $this
  60. }
  61.  
  62. #      File:           @(#)pbgclass.tcl    /main/hindenburg/5
  63.  
  64.  
  65. Class PBGClass : {Object} {
  66.     constructor
  67.     method destructor
  68.     method promoter
  69.     method generate
  70.     method generateAsContainedClass
  71.     method getPBClassKind
  72.     method getSuperClass
  73.     method getBuiltinSuperClass
  74.     method getBuiltinSuperClassName
  75.     method hasEvent
  76.     method isGlobalType
  77.     method isAutoInstantiate
  78.     method getWindowType
  79.     method isBuiltin
  80.     method addContainedTypeName
  81.     method removeContainedTypeName
  82.     attribute pbClassKind
  83.     attribute superClass
  84.     attribute builtinSuperClass
  85.     attribute inhLoopDetect
  86.     attribute containLoopDetect
  87.     attribute containedTypeNameSet
  88. }
  89.  
  90. constructor PBGClass {class this name} {
  91.     set this [Object::constructor $class $this $name]
  92.     $this pbClassKind ""
  93.     $this superClass "_uninitialized_"
  94.     $this builtinSuperClass "_uninitialized_"
  95.     $this inhLoopDetect 0
  96.     $this containLoopDetect 0
  97.     $this containedTypeNameSet [List new]
  98.     # Start constructor user section
  99.     # End constructor user section
  100.     return $this
  101. }
  102.  
  103. method PBGClass::destructor {this} {
  104.     # Start destructor user section
  105.     # End destructor user section
  106. }
  107.  
  108. method PBGClass::promoter {this} {
  109.     $this pbClassKind ""
  110.     $this superClass "_uninitialized_"
  111.     $this builtinSuperClass "_uninitialized_"
  112.     $this inhLoopDetect 0
  113.     $this containLoopDetect 0
  114.     $this containedTypeNameSet [List new]
  115. }
  116.  
  117. method PBGClass::generate {this model} {
  118.     set kind [$this getPBClassKind]
  119.  
  120.     if {$kind == ${PBClassKind::NotSupported}} {
  121.         return ""
  122.     }
  123.  
  124.     set name [$this getName]
  125.     set superNm [[$this getSuperClass] getName]
  126.  
  127.     set pbDefGen [PB${kind}Gen new $name $this \
  128.         -superNm $superNm \
  129.         -isGlobalType 1 \
  130.         -globalOoplClass $this \
  131.         -container "" \
  132.         -model $model]
  133.  
  134.     return [$pbDefGen generate]
  135. }
  136.  
  137. method PBGClass::generateAsContainedClass {this name globalOoplClass fromOoplClass container} {
  138.     set kind [$this getPBClassKind]
  139.     if {$kind == ${PBClassKind::NotSupported}} {
  140.         return ""
  141.     }
  142.     if [$this containLoopDetect] {
  143.         m4_error $E_GRCONTLOOP [$this getName]
  144.         return ""
  145.     }
  146.  
  147.     if {[$this isBuiltin] || [$this isGlobalType]} {
  148.         set superNm [$this getName]
  149.     } else {
  150.         set superNm [[$this getSuperClass] getName]
  151.     }
  152.  
  153.     if {$name == $superNm} {
  154.         m4_error $E_INVALIDLOCTYPE $name [$fromOoplClass getName] \
  155.             [$this getName] [$globalOoplClass getName]
  156.     }
  157.     set typeNames [$globalOoplClass containedTypeNameSet]
  158.     if {[$typeNames search $name] != -1 ||
  159.             $name == [$globalOoplClass getName]} {
  160.         m4_error $E_MULTDEFLOCTYPES $name [$fromOoplClass getName] \
  161.             [$this getName] [$globalOoplClass getName]
  162.     } else {
  163.         $typeNames append $name
  164.     }
  165.  
  166.     set pbDefGen [PB${kind}Gen new $name $this \
  167.         -superNm $superNm \
  168.         -isGlobalType 0 \
  169.         -globalOoplClass $globalOoplClass \
  170.         -container $container \
  171.         -model ""]
  172.  
  173.     $this containLoopDetect 1
  174.     set def [$pbDefGen generate]
  175.     $this containLoopDetect 0
  176.  
  177.     return $def
  178. }
  179.  
  180. method PBGClass::getPBClassKind {this} {
  181.     if {[$this pbClassKind] != ""} {
  182.         return [$this pbClassKind]
  183.     }
  184.  
  185.     if {[$this getBuiltinSuperClass] == ""} {
  186.         $this pbClassKind ${PBClassKind::NotSupported}
  187.         return [$this pbClassKind]
  188.     }
  189.  
  190.     set superClass [$this getSuperClass]
  191.     if {![$superClass isBuiltin] && ![$superClass isGlobalType]} {
  192.         m4_error $E_NONGLOBALSUPER [$this getName] [$superClass getName]
  193.         $this pbClassKind ${PBClassKind::NotSupported}
  194.         return [$this pbClassKind]
  195.     }
  196.  
  197.     set builtinSuperNm [$this getBuiltinSuperClassName]
  198.     set classInfo [[PBBuiltinInfo::global] getBuiltinClass $builtinSuperNm]
  199.     if {$classInfo == ""} {
  200.         m4_error $E_INVALBUILTINSUPER [$this getName] $builtinSuperNm
  201.         $this pbClassKind ${PBClassKind::NotSupported}
  202.     } else {
  203.         $this pbClassKind [$classInfo kind]
  204.     }
  205.     return [$this pbClassKind]
  206. }
  207.  
  208. method PBGClass::getSuperClass {this} {
  209.     if {[$this superClass] != "_uninitialized_"} {
  210.         return [$this superClass]
  211.     }
  212.  
  213.     if {[string tolower [$this getName]] == "powerobject"} {
  214.         # this is THE root class
  215.         $this superClass ""
  216.         return ""
  217.     }
  218.     set genNodeSet [$this genNodeSet]
  219.     if {[llength $genNodeSet] == 0} {
  220.         m4_warning $W_NOSUPERCLASS [$this getName]
  221.         set superClass [[$this ooplModel] classByName "nonvisualobject"]
  222.         $this superClass $superClass
  223.         return $superClass
  224.     }
  225.     if {[llength $genNodeSet] > 1} {
  226.         m4_error $E_NOMULTINH [$this getName]
  227.     }
  228.     $this superClass [[lindex $genNodeSet 0] superClass]
  229.     return [$this superClass]
  230. }
  231.  
  232. method PBGClass::getBuiltinSuperClass {this} {
  233.     if {[$this builtinSuperClass] != "_uninitialized_"} {
  234.         return [$this builtinSuperClass]
  235.     }
  236.  
  237.     if [$this inhLoopDetect] {
  238.         # error is already given by ooplModel ...
  239.         #m4_error $E_INHLOOP [$this getName]
  240.         $this builtinSuperClass ""
  241.         return ""
  242.     }
  243.     $this inhLoopDetect 1
  244.     if [$this isBuiltin] {
  245.         $this builtinSuperClass $this
  246.         return $this
  247.     }
  248.  
  249.     set superClass [$this getSuperClass]
  250.     if {$superClass != ""} {
  251.         set builtinSuperClass [$superClass getBuiltinSuperClass]
  252.         $this builtinSuperClass $builtinSuperClass
  253.         return $builtinSuperClass
  254.     }
  255.     $this builtinSuperClass ""
  256.     return ""
  257. }
  258.  
  259. method PBGClass::getBuiltinSuperClassName {this} {
  260.     set class [$this getBuiltinSuperClass]
  261.     if {$class == ""} {
  262.         return ""
  263.     }
  264.     return [$class getName]
  265. }
  266.  
  267. method PBGClass::hasEvent {this name} {
  268.     set name [string tolower $name]
  269.  
  270.     foreach oper [$this operationSet] {
  271.         if {[$oper isEvent] && 
  272.                 [string tolower [$oper getName]] == $name} {
  273.             return 1
  274.         }
  275.     }
  276.     return 0
  277. }
  278.  
  279. method PBGClass::isGlobalType {this} {
  280.     if {[$this getPropertyValue is_global_type] == "No"} {
  281.         return 0
  282.     }
  283.     if [$this isBuiltin] {
  284.         # The 'is_global_type' property does not apply to builtin
  285.         # classes, so they do not have the property set to 'No'.
  286.         # They must not be interpreted as global types however.
  287.         return 0
  288.     }
  289.     return 1
  290. }
  291.  
  292. method PBGClass::isAutoInstantiate {this} {
  293.     if {[$this getPropertyValue is_autoinstantiate] == "1"} {
  294.         return 1
  295.     }
  296.     return 0
  297. }
  298.  
  299. method PBGClass::getWindowType {this} {
  300.     set windowType [$this getPropertyValue window_type]
  301.     if {$windowType == ""} {
  302.         set windowType "Main"
  303.     }
  304.     return $windowType
  305. }
  306.  
  307. method PBGClass::isBuiltin {this} {
  308.     if {[$this getPropertyValue is_builtin] == "1"} {
  309.         return 1
  310.     }
  311.     return 0
  312. }
  313.  
  314. # Do not delete this line -- regeneration end marker
  315.  
  316. Class PBGClassD : {PBGClass OPClass} {
  317. }
  318.  
  319. selfPromoter OPClass {this} {
  320.     PBGClassD promote $this
  321. }
  322. method PBGClass::addContainedTypeName {this newContainedTypeName} {
  323.     [$this containedTypeNameSet] append $newContainedTypeName
  324.  
  325. }
  326.  
  327. method PBGClass::removeContainedTypeName {this oldContainedTypeName} {
  328.     [$this containedTypeNameSet] removeValue $oldContainedTypeName
  329. }
  330.  
  331.  
  332. #      File:           @(#)pbgfeature.tcl    /main/hindenburg/1
  333.  
  334.  
  335. Class PBGFeature : {Object} {
  336.     constructor
  337.     method destructor
  338. }
  339.  
  340. constructor PBGFeature {class this name} {
  341.     set this [Object::constructor $class $this $name]
  342.     # Start constructor user section
  343.     # End constructor user section
  344.     return $this
  345. }
  346.  
  347. method PBGFeature::destructor {this} {
  348.     # Start destructor user section
  349.     # End destructor user section
  350. }
  351.  
  352. # Do not delete this line -- regeneration end marker
  353.  
  354. Class PBGFeatureD : {PBGFeature OPFeature} {
  355. }
  356.  
  357. selfPromoter OPFeature {this} {
  358.     PBGFeatureD promote $this
  359. }
  360.  
  361. #      File:           @(#)pbgparamet.tcl    /main/hindenburg/1
  362.  
  363.  
  364. Class PBGParameter : {Object} {
  365.     constructor
  366.     method destructor
  367. }
  368.  
  369. constructor PBGParameter {class this name} {
  370.     set this [Object::constructor $class $this $name]
  371.     # Start constructor user section
  372.     # End constructor user section
  373.     return $this
  374. }
  375.  
  376. method PBGParameter::destructor {this} {
  377.     # Start destructor user section
  378.     # End destructor user section
  379. }
  380.  
  381. # Do not delete this line -- regeneration end marker
  382.  
  383. Class PBGParameterD : {PBGParameter OPParameter} {
  384. }
  385.  
  386. selfPromoter OPParameter {this} {
  387.     PBGParameterD promote $this
  388. }
  389.  
  390. #      File:           @(#)pbgqualini.tcl    /main/hindenburg/1
  391.  
  392.  
  393. Class PBGQualInitializer : {Object OPQualInitializer} {
  394.     constructor
  395.     method destructor
  396. }
  397.  
  398. constructor PBGQualInitializer {class this name} {
  399.     set this [Object::constructor $class $this $name]
  400.     # Start constructor user section
  401.     # End constructor user section
  402.     return $this
  403. }
  404.  
  405. method PBGQualInitializer::destructor {this} {
  406.     # Start destructor user section
  407.     # End destructor user section
  408. }
  409.  
  410. # Do not delete this line -- regeneration end marker
  411.  
  412. selfPromoter OPQualInitializer {this} {
  413.     PBGQualInitializer promote $this
  414. }
  415.  
  416. #      File:           @(#)pbgsupercl.tcl    /main/hindenburg/1
  417.  
  418.  
  419. Class PBGSuperClassInitializer : {Object OPSuperClassInitializer} {
  420.     constructor
  421.     method destructor
  422. }
  423.  
  424. constructor PBGSuperClassInitializer {class this name} {
  425.     set this [Object::constructor $class $this $name]
  426.     # Start constructor user section
  427.     # End constructor user section
  428.     return $this
  429. }
  430.  
  431. method PBGSuperClassInitializer::destructor {this} {
  432.     # Start destructor user section
  433.     # End destructor user section
  434. }
  435.  
  436. # Do not delete this line -- regeneration end marker
  437.  
  438. selfPromoter OPSuperClassInitializer {this} {
  439.     PBGSuperClassInitializer promote $this
  440. }
  441.  
  442. #      File:           @(#)pbgtype.tcl    /main/hindenburg/2
  443.  
  444.  
  445. Class PBGType : {Object} {
  446.     constructor
  447.     method destructor
  448.     attribute arrayDesc
  449. }
  450.  
  451. constructor PBGType {class this name} {
  452.     set this [Object::constructor $class $this $name]
  453.     $this arrayDesc ""
  454.     # Start constructor user section
  455.     # End constructor user section
  456.     return $this
  457. }
  458.  
  459. method PBGType::destructor {this} {
  460.     # Start destructor user section
  461.     # End destructor user section
  462. }
  463.  
  464. # Do not delete this line -- regeneration end marker
  465.  
  466. Class PBGTypeD : {PBGType OPType} {
  467. }
  468.  
  469. selfPromoter OPType {this} {
  470.     PBGTypeD promote $this
  471. }
  472.  
  473. #      File:           @(#)pbbuiltinc.tcl    /main/hindenburg/4
  474.  
  475.  
  476. Class PBBuiltinClass : {GCObject} {
  477.     constructor
  478.     method destructor
  479.     method getMandatoryProp
  480.     method setMandatoryProp
  481.     method removeMandatoryProp
  482.     attribute name
  483.     attribute kind
  484.     attribute isControl
  485.     attribute isGrContainer
  486.     attribute hasCtorDtor
  487.     attribute initialOnCreateResidue
  488.     attribute initialOnDestroyResidue
  489.     attribute mandatoryProp
  490. }
  491.  
  492. constructor PBBuiltinClass {class this i_name} {
  493.     set this [GCObject::constructor $class $this]
  494.     $this isControl 0
  495.     $this isGrContainer 0
  496.     $this hasCtorDtor 0
  497.     $this name $i_name
  498.     $this mandatoryProp [Dictionary new]
  499.     # Start constructor user section
  500.     # End constructor user section
  501.     return $this
  502. }
  503.  
  504. method PBBuiltinClass::destructor {this} {
  505.     # Start destructor user section
  506.     # End destructor user section
  507. }
  508.  
  509. # Do not delete this line -- regeneration end marker
  510.  
  511. method PBBuiltinClass::getMandatoryProp {this name} {
  512.     return [[$this mandatoryProp] set $name]
  513. }
  514.  
  515. method PBBuiltinClass::setMandatoryProp {this name newMandatoryProp} {
  516.     [$this mandatoryProp] set $name $newMandatoryProp
  517. }
  518.  
  519. method PBBuiltinClass::removeMandatoryProp {this name} {
  520.     [$this mandatoryProp] unset $name
  521. }
  522.  
  523.  
  524. #      File:           @(#)pbbuiltini.tcl    /main/hindenburg/5
  525. # End user added include file section
  526.  
  527.  
  528. Class PBBuiltinInfo : {GCObject} {
  529.     constructor
  530.     method destructor
  531.     method getBuiltinClass
  532.     method setBuiltinClass
  533.     method removeBuiltinClass
  534.     attribute builtinClass
  535. }
  536.  
  537. global PBBuiltinInfo::instance
  538. set PBBuiltinInfo::instance ""
  539.  
  540.  
  541. constructor PBBuiltinInfo {class this} {
  542.     set this [GCObject::constructor $class $this]
  543.     $this builtinClass [Dictionary new]
  544.     # Start constructor user section
  545.     # End constructor user section
  546.     return $this
  547. }
  548.  
  549. method PBBuiltinInfo::destructor {this} {
  550.     # Start destructor user section
  551.     # End destructor user section
  552. }
  553.  
  554. proc PBBuiltinInfo::global {} {
  555.     if {${PBBuiltinInfo::instance} != ""} {
  556.         return ${PBBuiltinInfo::instance}
  557.     }
  558.  
  559.     set instance [PBBuiltinInfo new]
  560.     set PBBuiltinInfo::instance $instance
  561.  
  562.     # Fill it ...
  563.     #
  564.     set class [PBBuiltinClass new checkbox \
  565.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  566.     $instance setBuiltinClass checkbox $class
  567.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  568.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 77]
  569.     $class setMandatoryProp Text [ \
  570.         PBBuiltinProperty new Text string \"none\"]
  571.  
  572.     set class [PBBuiltinClass new commandbutton \
  573.         -kind ${PBClassKind::VSUserObject}  -isControl 1 -hasCtorDtor 1]
  574.     $instance setBuiltinClass commandbutton $class
  575.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  576.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 109]
  577.     $class setMandatoryProp Text [ \
  578.         PBBuiltinProperty new Text string \"none\"]
  579.  
  580.     set class [PBBuiltinClass new connection \
  581.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  582.     $instance setBuiltinClass connection $class
  583.  
  584.     set class [PBBuiltinClass new datastore \
  585.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  586.     $instance setBuiltinClass datastore $class
  587.  
  588.         set class [PBBuiltinClass new datawindow \
  589.                 -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  590.         $instance setBuiltinClass datawindow $class
  591.         $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  592.         $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  593.  
  594.     set class [PBBuiltinClass new dropdownlistbox \
  595.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  596.     $instance setBuiltinClass dropdownlistbox $class
  597.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  598.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 229]
  599.  
  600.     set class [PBBuiltinClass new dropdownpicturelistbox \
  601.         -kind ${PBClassKind::VSUserObject} -isControl 1  -hasCtorDtor 1]
  602.     $instance setBuiltinClass dropdownpicturelistbox $class
  603.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  604.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 229]
  605.  
  606.     set class [PBBuiltinClass new dynamicdescriptionarea \
  607.         -kind ${PBClassKind::VSUserObject}  -hasCtorDtor 1]
  608.     $instance setBuiltinClass dynamicdescriptionarea $class
  609.  
  610.     set class [PBBuiltinClass new dynamicstagingarea \
  611.         -kind ${PBClassKind::VSUserObject}  -hasCtorDtor 1]
  612.     $instance setBuiltinClass dynamicstagingarea $class
  613.  
  614.     set class [PBBuiltinClass new editmask \
  615.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  616.     $instance setBuiltinClass editmask $class
  617.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  618.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 101]
  619.  
  620.     set class [PBBuiltinClass new error \
  621.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  622.     $instance setBuiltinClass error $class
  623.  
  624.     set class [PBBuiltinClass new graph \
  625.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  626.     $instance setBuiltinClass graph $class
  627.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 988]
  628.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 721]
  629.     $class setMandatoryProp Title [ \
  630.         PBBuiltinProperty new Title string \"(None)\"]
  631.     $class setMandatoryProp GraphType [ \
  632.         PBBuiltinProperty new GraphType grGraphType ColGraph!]
  633.     set sect [TextSection new]
  634.     $class initialOnCreateResidue $sect
  635.     expand_text $sect {
  636.         TitleDispAttr = create grDispAttr
  637.         LegendDispAttr = create grDispAttr
  638.         PieDispAttr = create grDispAttr
  639.         Series = create grAxis
  640.         Series.DispAttr = create grDispAttr
  641.         Series.LabelDispAttr = create grDispAttr
  642.         Category = create grAxis
  643.         Category.DispAttr = create grDispAttr
  644.         Category.LabelDispAttr = create grDispAttr
  645.         Values = create grAxis
  646.         Values.DispAttr = create grDispAttr
  647.         Values.LabelDispAttr = create grDispAttr
  648.         TitleDispAttr.Weight=700
  649.         TitleDispAttr.FaceName="Arial"
  650.         TitleDispAttr.FontFamily=Swiss!
  651.         TitleDispAttr.FontPitch=Variable!
  652.         TitleDispAttr.Alignment=Center!
  653.         TitleDispAttr.BackColor=536870912
  654.         TitleDispAttr.Format="[General]"
  655.         TitleDispAttr.DisplayExpression="title"
  656.         TitleDispAttr.AutoSize=true
  657.         Category.Label="(None)"
  658.         Category.AutoScale=true
  659.         Category.ShadeBackEdge=true
  660.         Category.SecondaryLine=transparent!
  661.         Category.MajorGridLine=transparent!
  662.         Category.MinorGridLine=transparent!
  663.         Category.DropLines=transparent!
  664.         Category.OriginLine=transparent!
  665.         Category.MajorTic=Outside!
  666.         Category.DataType=adtText!
  667.         Category.DispAttr.Weight=400
  668.         Category.DispAttr.FaceName="Arial"
  669.         Category.DispAttr.FontFamily=Swiss!
  670.         Category.DispAttr.FontPitch=Variable!
  671.         Category.DispAttr.Alignment=Center!
  672.         Category.DispAttr.BackColor=536870912
  673.         Category.DispAttr.Format="[General]"
  674.         Category.DispAttr.DisplayExpression="category"
  675.         Category.DispAttr.AutoSize=true
  676.         Category.LabelDispAttr.Weight=400
  677.         Category.LabelDispAttr.FaceName="Arial"
  678.         Category.LabelDispAttr.FontFamily=Swiss!
  679.         Category.LabelDispAttr.FontPitch=Variable!
  680.         Category.LabelDispAttr.Alignment=Center!
  681.         Category.LabelDispAttr.BackColor=536870912
  682.         Category.LabelDispAttr.Format="[General]"
  683.         Category.LabelDispAttr.DisplayExpression="categoryaxislabel"
  684.         Category.LabelDispAttr.AutoSize=true
  685.         Values.Label="(None)"
  686.         Values.AutoScale=true
  687.         Values.SecondaryLine=transparent!
  688.         Values.MajorGridLine=transparent!
  689.         Values.MinorGridLine=transparent!
  690.         Values.DropLines=transparent!
  691.         Values.MajorTic=Outside!
  692.         Values.DataType=adtDouble!
  693.         Values.DispAttr.Weight=400
  694.         Values.DispAttr.FaceName="Arial"
  695.         Values.DispAttr.FontFamily=Swiss!
  696.         Values.DispAttr.FontPitch=Variable!
  697.         Values.DispAttr.Alignment=Right!
  698.         Values.DispAttr.BackColor=536870912
  699.         Values.DispAttr.Format="[General]"
  700.         Values.DispAttr.DisplayExpression="value"
  701.         Values.DispAttr.AutoSize=true
  702.         Values.LabelDispAttr.Weight=400
  703.         Values.LabelDispAttr.FaceName="Arial"
  704.         Values.LabelDispAttr.FontFamily=Swiss!
  705.         Values.LabelDispAttr.FontPitch=Variable!
  706.         Values.LabelDispAttr.Alignment=Center!
  707.         Values.LabelDispAttr.BackColor=536870912
  708.         Values.LabelDispAttr.Format="[General]"
  709.         Values.LabelDispAttr.DisplayExpression="valuesaxislabel"
  710.         Values.LabelDispAttr.AutoSize=true
  711.         Values.LabelDispAttr.Escapement=900
  712.         Series.Label="(None)"
  713.         Series.AutoScale=true
  714.         Series.SecondaryLine=transparent!
  715.         Series.MajorGridLine=transparent!
  716.         Series.MinorGridLine=transparent!
  717.         Series.DropLines=transparent!
  718.         Series.OriginLine=transparent!
  719.         Series.MajorTic=Outside!
  720.         Series.DataType=adtText!
  721.         Series.DispAttr.Weight=400
  722.         Series.DispAttr.FaceName="Arial"
  723.         Series.DispAttr.FontFamily=Swiss!
  724.         Series.DispAttr.FontPitch=Variable!
  725.         Series.DispAttr.BackColor=536870912
  726.         Series.DispAttr.Format="[General]"
  727.         Series.DispAttr.DisplayExpression="series"
  728.         Series.DispAttr.AutoSize=true
  729.         Series.LabelDispAttr.Weight=400
  730.         Series.LabelDispAttr.FaceName="Arial"
  731.         Series.LabelDispAttr.FontFamily=Swiss!
  732.         Series.LabelDispAttr.FontPitch=Variable!
  733.         Series.LabelDispAttr.Alignment=Center!
  734.         Series.LabelDispAttr.BackColor=536870912
  735.         Series.LabelDispAttr.Format="[General]"
  736.         Series.LabelDispAttr.DisplayExpression="seriesaxislabel"
  737.         Series.LabelDispAttr.AutoSize=true
  738.         LegendDispAttr.Weight=400
  739.         LegendDispAttr.FaceName="Arial"
  740.         LegendDispAttr.FontFamily=Swiss!
  741.         LegendDispAttr.FontPitch=Variable!
  742.         LegendDispAttr.BackColor=536870912
  743.         LegendDispAttr.Format="[General]"
  744.         LegendDispAttr.DisplayExpression="series"
  745.         LegendDispAttr.AutoSize=true
  746.         PieDispAttr.Weight=400
  747.         PieDispAttr.FaceName="Arial"
  748.         PieDispAttr.FontFamily=Swiss!
  749.         PieDispAttr.FontPitch=Variable!
  750.         PieDispAttr.BackColor=536870912
  751.         PieDispAttr.Format="[General]"
  752.         PieDispAttr.DisplayExpression="if(seriescount > 1,\
  753.             series,string(percentofseries,\~"0.00%\~"))"
  754.         PieDispAttr.AutoSize=true
  755.     }
  756.     set sect [TextSection new]
  757.     $class initialOnDestroyResidue $sect
  758.     expand_text $sect {
  759.         destroy TitleDispAttr
  760.         destroy LegendDispAttr
  761.         destroy PieDispAttr
  762.         destroy Series.DispAttr
  763.         destroy Series.LabelDispAttr
  764.         destroy Series
  765.         destroy Category.DispAttr
  766.         destroy Category.LabelDispAttr
  767.         destroy Category
  768.         destroy Values.DispAttr
  769.         destroy Values.LabelDispAttr
  770.         destroy Values
  771.     }
  772.  
  773.     set class [PBBuiltinClass new groupbox \
  774.         -kind ${PBClassKind::VSUserObject} -isControl 1]
  775.     $instance setBuiltinClass groupbox $class
  776.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  777.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  778.     $class setMandatoryProp Text [ \
  779.         PBBuiltinProperty new Text string \"none\"]
  780.  
  781.     set class [PBBuiltinClass new hscrollbar \
  782.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  783.     $instance setBuiltinClass hscrollbar $class
  784.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 293]
  785.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 65]
  786.  
  787.         set class [PBBuiltinClass new line \
  788.             -kind ${PBClassKind::VSUserObject} -isControl 1]
  789.         $instance setBuiltinClass line $class
  790.         $class setMandatoryProp Width [\
  791.             PBBuiltinProperty new Width int 494]
  792.         $class setMandatoryProp Height [\
  793.             PBBuiltinProperty new Height int 361]
  794.  
  795.     set class [PBBuiltinClass new listbox \
  796.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  797.     $instance setBuiltinClass listbox $class
  798.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  799.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  800.  
  801.     set class [PBBuiltinClass new listview \
  802.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  803.     $instance setBuiltinClass listview $class
  804.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  805.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  806.  
  807.     set class [PBBuiltinClass new mailsession \
  808.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  809.     $instance setBuiltinClass mailsession $class
  810.  
  811.     set class [PBBuiltinClass new menu \
  812.         -kind ${PBClassKind::Menu} -isGrContainer 1]
  813.     $instance setBuiltinClass menu $class
  814.     # mandatory prop 'Text' is set in class PBMenuGen
  815.  
  816.     set class [PBBuiltinClass new menucascade \
  817.         -kind ${PBClassKind::Menu} -isGrContainer 1]
  818.     $instance setBuiltinClass menucascade $class
  819.     # mandatory prop 'Text' is set in class PBMenuGen
  820.  
  821.     set class [PBBuiltinClass new message \
  822.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  823.     $instance setBuiltinClass message $class
  824.  
  825.     set class [PBBuiltinClass new multilineedit \
  826.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  827.     $instance setBuiltinClass multilineedit $class
  828.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  829.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  830.  
  831.         set class [PBBuiltinClass new nonvisualobject \
  832.             -kind ${PBClassKind::CCUserObject} -hasCtorDtor 1]
  833.         $instance setBuiltinClass nonvisualobject $class
  834.  
  835.     set class [PBBuiltinClass new olecontrol \
  836.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  837.     $instance setBuiltinClass olecontrol $class
  838.     # mandatory props 'Width' & 'Height' set to 'a' default value
  839.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  840.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  841.  
  842.     set class [PBBuiltinClass new oleobject \
  843.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  844.     $instance setBuiltinClass oleobject $class
  845.  
  846.     set class [PBBuiltinClass new olestorage \
  847.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  848.     $instance setBuiltinClass olestorage $class
  849.  
  850.     set class [PBBuiltinClass new olestream \
  851.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  852.     $instance setBuiltinClass olestream $class
  853.  
  854.         set class [PBBuiltinClass new oval \
  855.             -kind ${PBClassKind::VSUserObject} -isControl 1]
  856.         $instance setBuiltinClass oval $class
  857.         $class setMandatoryProp Width [\
  858.             PBBuiltinProperty new Width int 165]
  859.         $class setMandatoryProp Height [\
  860.             PBBuiltinProperty new Height int 145]
  861.  
  862.     set class [PBBuiltinClass new picture \
  863.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  864.     $instance setBuiltinClass picture $class
  865.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 165]
  866.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 145]
  867.  
  868.     set class [PBBuiltinClass new picturebutton \
  869.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  870.     $instance setBuiltinClass picturebutton $class
  871.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  872.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 145]
  873.     $class setMandatoryProp Text [ \
  874.         PBBuiltinProperty new Text string \"none\"] 
  875.  
  876.     set class [PBBuiltinClass new picturelistbox \
  877.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  878.     $instance setBuiltinClass picturelistbox $class
  879.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  880.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  881.  
  882.     set class [PBBuiltinClass new pipeline \
  883.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  884.     $instance setBuiltinClass pipeline $class
  885.  
  886.     set class [PBBuiltinClass new radiobutton \
  887.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  888.     $instance setBuiltinClass radiobutton $class
  889.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  890.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 77]
  891.     $class setMandatoryProp Text [ \
  892.         PBBuiltinProperty new Text string \"none\"] 
  893.  
  894.         set class [PBBuiltinClass new rectangle \
  895.             -kind ${PBClassKind::VSUserObject} -isControl 1]
  896.         $instance setBuiltinClass rectangle $class
  897.         $class setMandatoryProp Width [\
  898.             PBBuiltinProperty new Width int 165]
  899.         $class setMandatoryProp Height [\
  900.             PBBuiltinProperty new Height int 145]
  901.  
  902.     set class [PBBuiltinClass new richtextedit \
  903.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  904.     $instance setBuiltinClass richtextedit $class
  905.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  906.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  907.  
  908.         set class [PBBuiltinClass new roundrectangle \
  909.             -kind ${PBClassKind::VSUserObject} -isControl 1]
  910.         $instance setBuiltinClass roundrectangle $class
  911.         $class setMandatoryProp Width [\
  912.             PBBuiltinProperty new Width int 165]
  913.         $class setMandatoryProp Height [\
  914.             PBBuiltinProperty new Height int 145]
  915.  
  916.     set class [PBBuiltinClass new singlelineedit \
  917.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  918.     $instance setBuiltinClass singlelineedit $class
  919.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  920.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 93]
  921.  
  922.     set class [PBBuiltinClass new statictext \
  923.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  924.     $instance setBuiltinClass statictext $class
  925.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 247]
  926.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 77]
  927.     $class setMandatoryProp Text [ \
  928.         PBBuiltinProperty new Text string \"none\"] 
  929.  
  930.     set class [PBBuiltinClass new structure \
  931.         -kind ${PBClassKind::Structure}]
  932.     $instance setBuiltinClass structure $class
  933.  
  934.     set class [PBBuiltinClass new tab \
  935.         -kind ${PBClassKind::VSUserObject} -isControl 1 \
  936.         -isGrContainer 1 -hasCtorDtor 1]
  937.     $instance setBuiltinClass tab $class
  938.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 1153]
  939.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 865]
  940.  
  941.     set class [PBBuiltinClass new transaction \
  942.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  943.     $instance setBuiltinClass transaction $class
  944.  
  945.     set class [PBBuiltinClass new transport \
  946.         -kind ${PBClassKind::CSUserObject} -hasCtorDtor 1]
  947.     $instance setBuiltinClass transport $class
  948.  
  949.     set class [PBBuiltinClass new treeview \
  950.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  951.     $instance setBuiltinClass treeview $class
  952.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 494]
  953.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 361]
  954.  
  955.         set class [PBBuiltinClass new userobject \
  956.             -kind ${PBClassKind::VCUserObject} -isControl 1 \
  957.             -isGrContainer 1 -hasCtorDtor 1]
  958.         $instance setBuiltinClass userobject $class
  959.         $class setMandatoryProp Width [\
  960.             PBBuiltinProperty new Width int 2533]
  961.         $class setMandatoryProp Height [\
  962.             PBBuiltinProperty new Height int 1517]
  963.  
  964.     set class [PBBuiltinClass new vscrollbar \
  965.         -kind ${PBClassKind::VSUserObject} -isControl 1 -hasCtorDtor 1]
  966.     $instance setBuiltinClass vscrollbar $class
  967.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 74]
  968.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 257]
  969.  
  970.     set class [PBBuiltinClass new window \
  971.         -kind ${PBClassKind::Window} -isGrContainer 1]
  972.     $instance setBuiltinClass window $class
  973.     $class setMandatoryProp Width [PBBuiltinProperty new Width int 2533]
  974.     $class setMandatoryProp Height [PBBuiltinProperty new Height int 1517]
  975.  
  976.     return ${PBBuiltinInfo::instance}
  977. }
  978.  
  979. # Do not delete this line -- regeneration end marker
  980.  
  981. method PBBuiltinInfo::getBuiltinClass {this name} {
  982.     return [[$this builtinClass] set $name]
  983. }
  984.  
  985. method PBBuiltinInfo::setBuiltinClass {this name newBuiltinClass} {
  986.     [$this builtinClass] set $name $newBuiltinClass
  987. }
  988.  
  989. method PBBuiltinInfo::removeBuiltinClass {this name} {
  990.     [$this builtinClass] unset $name
  991. }
  992.  
  993.  
  994. #      File:           @(#)pbdefiniti.tcl    /main/hindenburg/5
  995.  
  996.  
  997. Class PBDefinitionGen : {GCObject} {
  998.     constructor
  999.     method destructor
  1000.     method generate
  1001.     method createPBDefinition
  1002.     method genFeatures
  1003.     method genDataAttrs
  1004.     method genOperations
  1005.     method genAssocAttrs
  1006.     attribute name
  1007.     attribute superNm
  1008.     attribute builtinSuperNm
  1009.     attribute isGlobalType
  1010.     attribute container
  1011.     attribute model
  1012.     attribute ooplClass
  1013.     attribute globalOoplClass
  1014. }
  1015.  
  1016. constructor PBDefinitionGen {class this i_name ooplClass} {
  1017.     set this [GCObject::constructor $class $this]
  1018.     $this name $i_name
  1019.     $this ooplClass $ooplClass
  1020.     # Start constructor user section
  1021.  
  1022.     $this builtinSuperNm [[$this ooplClass] getBuiltinSuperClassName]
  1023.  
  1024.     # End constructor user section
  1025.     return $this
  1026. }
  1027.  
  1028. method PBDefinitionGen::destructor {this} {
  1029.     # Start destructor user section
  1030.     # End destructor user section
  1031. }
  1032.  
  1033. method PBDefinitionGen::generate {this} {
  1034.     set def [$this createPBDefinition]
  1035.     $this genFeatures $def
  1036.     return $def
  1037. }
  1038.  
  1039. method PBDefinitionGen::createPBDefinition {this} {
  1040.     set type [$this objType]
  1041.     set kind [string range $type 0 [expr {[string length $type] - 4}]]
  1042.     set def [$kind new [$this name] [$this ooplClass] \
  1043.         [$this superNm] [$this builtinSuperNm] \
  1044.         -isGlobalType [$this isGlobalType]]
  1045.  
  1046.     if [$this isGlobalType] {
  1047.         PBLibraryEntry new [$this model] $def
  1048.     } else {
  1049.         [$this container] addContainedClass $def
  1050.     }
  1051.  
  1052.     return $def
  1053. }
  1054.  
  1055. method PBDefinitionGen::genFeatures {this def} {
  1056.     if {[[$this ooplClass] isBuiltin] ||
  1057.         (![$this isGlobalType] && [[$this ooplClass] isGlobalType])} {
  1058.         # Only a type definition (a local one) is generated, without
  1059.         # variables, functions, user events and even scripts!
  1060.         return
  1061.     }
  1062.     $this genDataAttrs $def
  1063.     $this genOperations $def
  1064.     $this genAssocAttrs $def
  1065. }
  1066.  
  1067. method PBDefinitionGen::genDataAttrs {this def} {
  1068.     foreach attr [[$this ooplClass] dataAttrSet] {
  1069.         $attr generate $def
  1070.     } 
  1071. }
  1072.  
  1073. method PBDefinitionGen::genOperations {this def} {
  1074.     foreach oper [[$this ooplClass] operationSet] {
  1075.         $oper generate $def
  1076.     }
  1077.     if {[[$this ooplClass] constructor] != ""} {
  1078.         [[$this ooplClass] constructor] generate $def
  1079.     }
  1080. }
  1081.  
  1082. method PBDefinitionGen::genAssocAttrs {this def} {
  1083.     foreach assoc [[$this ooplClass] genAssocAttrSet] {
  1084.         $assoc generate [$this globalOoplClass] $def
  1085.     }
  1086. }
  1087.  
  1088. # Do not delete this line -- regeneration end marker
  1089.  
  1090.  
  1091. #      File:           @(#)pbgclassen.tcl    /main/hindenburg/1
  1092.  
  1093.  
  1094. Class PBGClassEnum : {PBGClass} {
  1095.     constructor
  1096.     method destructor
  1097.     method generate
  1098. }
  1099.  
  1100. constructor PBGClassEnum {class this name} {
  1101.     set this [PBGClass::constructor $class $this $name]
  1102.     # Start constructor user section
  1103.     # End constructor user section
  1104.     return $this
  1105. }
  1106.  
  1107. method PBGClassEnum::destructor {this} {
  1108.     # Start destructor user section
  1109.     # End destructor user section
  1110. }
  1111.  
  1112. method PBGClassEnum::generate {this model} {
  1113.     m4_error $E_NOENUMS
  1114. }
  1115.  
  1116. # Do not delete this line -- regeneration end marker
  1117.  
  1118. Class PBGClassEnumD : {PBGClassEnum OPClassEnum} {
  1119. }
  1120.  
  1121. selfPromoter OPClassEnum {this} {
  1122.     PBGClassEnumD promote $this
  1123. }
  1124.  
  1125. #      File:           @(#)pbgclassge.tcl    /main/hindenburg/1
  1126.  
  1127.  
  1128. Class PBGClassGenericTypeDef : {PBGClass} {
  1129.     constructor
  1130.     method destructor
  1131.     method generate
  1132. }
  1133.  
  1134. constructor PBGClassGenericTypeDef {class this name} {
  1135.     set this [PBGClass::constructor $class $this $name]
  1136.     # Start constructor user section
  1137.     # End constructor user section
  1138.     return $this
  1139. }
  1140.  
  1141. method PBGClassGenericTypeDef::destructor {this} {
  1142.     # Start destructor user section
  1143.     # End destructor user section
  1144. }
  1145.  
  1146. method PBGClassGenericTypeDef::generate {this model} {
  1147.     $this PBGClass::generate $model
  1148. }
  1149.  
  1150. # Do not delete this line -- regeneration end marker
  1151.  
  1152. Class PBGClassGenericTypeDefD : {PBGClassGenericTypeDef OPClassGenericTypeDef} {
  1153. }
  1154.  
  1155. selfPromoter OPClassGenericTypeDef {this} {
  1156.     PBGClassGenericTypeDefD promote $this
  1157. }
  1158.  
  1159. #      File:           @(#)pbgclasstd.tcl    /main/hindenburg/1
  1160.  
  1161.  
  1162. Class PBGClassTDef : {PBGClass} {
  1163.     constructor
  1164.     method destructor
  1165.     method generate
  1166. }
  1167.  
  1168. constructor PBGClassTDef {class this name} {
  1169.     set this [PBGClass::constructor $class $this $name]
  1170.     # Start constructor user section
  1171.     # End constructor user section
  1172.     return $this
  1173. }
  1174.  
  1175. method PBGClassTDef::destructor {this} {
  1176.     # Start destructor user section
  1177.     # End destructor user section
  1178. }
  1179.  
  1180. method PBGClassTDef::generate {this model} {
  1181.     $this PBGClass::generate $model
  1182. }
  1183.  
  1184. # Do not delete this line -- regeneration end marker
  1185.  
  1186. Class PBGClassTDefD : {PBGClassTDef OPClassTDef} {
  1187. }
  1188.  
  1189. selfPromoter OPClassTDef {this} {
  1190.     PBGClassTDefD promote $this
  1191. }
  1192.  
  1193. #      File:           @(#)pbglinkcla.tcl    /main/hindenburg/1
  1194.  
  1195.  
  1196. Class PBGLinkClass : {PBGClass} {
  1197.     constructor
  1198.     method destructor
  1199.     method generate
  1200. }
  1201.  
  1202. constructor PBGLinkClass {class this name} {
  1203.     set this [PBGClass::constructor $class $this $name]
  1204.     # Start constructor user section
  1205.     # End constructor user section
  1206.     return $this
  1207. }
  1208.  
  1209. method PBGLinkClass::destructor {this} {
  1210.     # Start destructor user section
  1211.     # End destructor user section
  1212. }
  1213.  
  1214. method PBGLinkClass::generate {this model} {
  1215.     $this PBGClass::generate $model
  1216. }
  1217.  
  1218. # Do not delete this line -- regeneration end marker
  1219.  
  1220. Class PBGLinkClassD : {PBGLinkClass OPLinkClass} {
  1221. }
  1222.  
  1223. selfPromoter OPLinkClass {this} {
  1224.     PBGLinkClassD promote $this
  1225. }
  1226.  
  1227. #      File:           @(#)pbgattribu.tcl    /main/hindenburg/1
  1228.  
  1229.  
  1230. Class PBGAttribute : {PBGFeature} {
  1231.     constructor
  1232.     method destructor
  1233. }
  1234.  
  1235. constructor PBGAttribute {class this name} {
  1236.     set this [PBGFeature::constructor $class $this $name]
  1237.     # Start constructor user section
  1238.     # End constructor user section
  1239.     return $this
  1240. }
  1241.  
  1242. method PBGAttribute::destructor {this} {
  1243.     # Start destructor user section
  1244.     # End destructor user section
  1245. }
  1246.  
  1247. # Do not delete this line -- regeneration end marker
  1248.  
  1249. Class PBGAttributeD : {PBGAttribute OPAttribute} {
  1250. }
  1251.  
  1252. selfPromoter OPAttribute {this} {
  1253.     PBGAttributeD promote $this
  1254. }
  1255.  
  1256. #      File:           @(#)pbgconstru.tcl    /main/hindenburg/1
  1257.  
  1258.  
  1259. Class PBGConstructor : {PBGFeature} {
  1260.     constructor
  1261.     method destructor
  1262.     method generate
  1263. }
  1264.  
  1265. constructor PBGConstructor {class this name} {
  1266.     set this [PBGFeature::constructor $class $this $name]
  1267.     # Start constructor user section
  1268.     # End constructor user section
  1269.     return $this
  1270. }
  1271.  
  1272. method PBGConstructor::destructor {this} {
  1273.     # Start destructor user section
  1274.     # End destructor user section
  1275. }
  1276.  
  1277. method PBGConstructor::generate {this class} {
  1278.     return ""
  1279. }
  1280.  
  1281. # Do not delete this line -- regeneration end marker
  1282.  
  1283. Class PBGConstructorD : {PBGConstructor OPConstructor} {
  1284. }
  1285.  
  1286. selfPromoter OPConstructor {this} {
  1287.     PBGConstructorD promote $this
  1288. }
  1289.  
  1290. #      File:           @(#)pbgoperati.tcl    /main/hindenburg/4
  1291.  
  1292.  
  1293. Class PBGOperation : {PBGFeature} {
  1294.     constructor
  1295.     method destructor
  1296.     method generate
  1297.     method generateFunction
  1298.     method generateAccess
  1299.     method generateEvent
  1300.     method isEvent
  1301.     method isUserEvent
  1302. }
  1303.  
  1304. constructor PBGOperation {class this name} {
  1305.     set this [PBGFeature::constructor $class $this $name]
  1306.     # Start constructor user section
  1307.     # End constructor user section
  1308.     return $this
  1309. }
  1310.  
  1311. method PBGOperation::destructor {this} {
  1312.     # Start destructor user section
  1313.     # End destructor user section
  1314. }
  1315.  
  1316. method PBGOperation::generate {this class} {
  1317.     if [$this isEvent] {
  1318.         set oper [$this generateEvent $class]
  1319.     } else {
  1320.         set oper [$this generateFunction $class]
  1321.     }
  1322.  
  1323.     return $oper
  1324. }
  1325.  
  1326. method PBGOperation::generateFunction {this class} {
  1327.     set type [[$this ooplType] generate]
  1328.     set access [$this generateAccess]
  1329.     set func [PBFunction new [$this getName] $type $access]
  1330.  
  1331.     foreach param [$this parameterSet] {
  1332.         $param generate $func
  1333.     }
  1334.  
  1335.     $class addObjectFunction $func
  1336.  
  1337.     return $func
  1338. }
  1339.  
  1340. method PBGOperation::generateAccess {this} {
  1341.     set access [string tolower [$this getPropertyValue "method_access"]]
  1342.     if {$access == "" } {
  1343.         set access "public"
  1344.     }
  1345.     return [PBAccess new $access]
  1346. }
  1347.  
  1348. method PBGOperation::generateEvent {this class} {
  1349.     set type [[$this ooplType] generate]
  1350.     set name [$this getName]
  1351.     if {$name == "constructor"} {
  1352.         set event [PBConstructor new $name $type]
  1353.     } elseif {$name == "destructor"} {
  1354.         set event [PBDestructor new $name $type]
  1355.     } else {
  1356.         set event [PBEvent new $name $type]
  1357.     }
  1358.  
  1359.     set firstParam 1
  1360.     foreach param [$this parameterSet] {
  1361.         # special case when type of first parameter is "eventid";
  1362.         # in this case, prevent mapping of standard type "eventid" 
  1363.         # onto language type "string"
  1364.         if $firstParam {
  1365.             set firstParam 0
  1366.             set pbParam [$param generate $event]
  1367.             if {[[$param ooplType] getName] == "eventid"} {
  1368.                 [$pbParam type] name "eventid"
  1369.                 break
  1370.             }
  1371.         } else {
  1372.             $param generate $event
  1373.         }
  1374.     }
  1375.  
  1376.     if {[$this isUserEvent]} {
  1377.         $class addUserEvent $event
  1378.     } else {
  1379.         $class addScript $event
  1380.     }
  1381.  
  1382.     return $event
  1383. }
  1384.  
  1385. method PBGOperation::isEvent {this} {
  1386.     if {[$this getPropertyValue is_event] == "1"} {
  1387.         return 1
  1388.     }
  1389.     return 0
  1390. }
  1391.  
  1392. method PBGOperation::isUserEvent {this} {
  1393.     set superClass [[$this ooplClass] getSuperClass]
  1394.     while {$superClass != ""} {
  1395.         if [$superClass hasEvent [$this getName]] {
  1396.             return 0
  1397.         }
  1398.         set superClass [$superClass getSuperClass]
  1399.     }
  1400.     return 1
  1401. }
  1402.  
  1403. # Do not delete this line -- regeneration end marker
  1404.  
  1405. Class PBGOperationD : {PBGOperation OPOperation} {
  1406. }
  1407.  
  1408. selfPromoter OPOperation {this} {
  1409.     PBGOperationD promote $this
  1410. }
  1411.  
  1412. #      File:           @(#)pbgctorpar.tcl    /main/hindenburg/1
  1413.  
  1414.  
  1415. Class PBGCtorParameter : {PBGParameter} {
  1416.     constructor
  1417.     method destructor
  1418.     method generate
  1419. }
  1420.  
  1421. constructor PBGCtorParameter {class this name} {
  1422.     set this [PBGParameter::constructor $class $this $name]
  1423.     # Start constructor user section
  1424.     # End constructor user section
  1425.     return $this
  1426. }
  1427.  
  1428. method PBGCtorParameter::destructor {this} {
  1429.     # Start destructor user section
  1430.     # End destructor user section
  1431. }
  1432.  
  1433. method PBGCtorParameter::generate {this oper} {
  1434.     # !! Implement this function !!
  1435. }
  1436.  
  1437. # Do not delete this line -- regeneration end marker
  1438.  
  1439. Class PBGCtorParameterD : {PBGCtorParameter OPCtorParameter} {
  1440. }
  1441.  
  1442. selfPromoter OPCtorParameter {this} {
  1443.     PBGCtorParameterD promote $this
  1444. }
  1445.  
  1446. #      File:           @(#)pbgoperpar.tcl    /main/hindenburg/2
  1447.  
  1448.  
  1449. Class PBGOperParameter : {PBGParameter} {
  1450.     constructor
  1451.     method destructor
  1452.     method generate
  1453.     method generateModifier
  1454. }
  1455.  
  1456. constructor PBGOperParameter {class this name} {
  1457.     set this [PBGParameter::constructor $class $this $name]
  1458.     # Start constructor user section
  1459.     # End constructor user section
  1460.     return $this
  1461. }
  1462.  
  1463. method PBGOperParameter::destructor {this} {
  1464.     # Start destructor user section
  1465.     # End destructor user section
  1466. }
  1467.  
  1468. method PBGOperParameter::generate {this oper} {
  1469.     set type [[$this ooplType] generate]
  1470.     set modifier [$this generateModifier]
  1471.     set param [PBParameter new [$this getName] $type $modifier \
  1472.         -arrayDesc [[$this ooplType] arrayDesc]]
  1473.     $oper addParameter $param
  1474.     return $param
  1475. }
  1476.  
  1477. method PBGOperParameter::generateModifier {this} {
  1478.     set modifier [$this getPropertyValue "pass_by"]
  1479.     if {$modifier == "Reference"} {
  1480.         set modifier "ref"
  1481.     } elseif {$modifier == "ReadOnly"} {
  1482.         set modifier "readonly"
  1483.     } else {
  1484.         set modifier ""
  1485.     }
  1486.     return [PBModifier new $modifier]
  1487. }
  1488.  
  1489. # Do not delete this line -- regeneration end marker
  1490.  
  1491. Class PBGOperParameterD : {PBGOperParameter OPOperParameter} {
  1492. }
  1493.  
  1494. selfPromoter OPOperParameter {this} {
  1495.     PBGOperParameterD promote $this
  1496. }
  1497.  
  1498. #      File:           @(#)pbgbasetyp.tcl    /main/hindenburg/2
  1499.  
  1500.  
  1501. Class PBGBaseType : {PBGType} {
  1502.     constructor
  1503.     method destructor
  1504.     method generate
  1505. }
  1506.  
  1507. constructor PBGBaseType {class this name} {
  1508.     set this [PBGType::constructor $class $this $name]
  1509.     # Start constructor user section
  1510.     # End constructor user section
  1511.     return $this
  1512. }
  1513.  
  1514. method PBGBaseType::destructor {this} {
  1515.     # Start destructor user section
  1516.     # End destructor user section
  1517. }
  1518.  
  1519. method PBGBaseType::generate {this} {
  1520.     set type [$this getType3GL]
  1521.  
  1522.     set arrayDesc ""
  1523.     regexp {\[.*\]$} $type arrayDesc
  1524.     $this arrayDesc $arrayDesc
  1525.  
  1526.     regsub {\[.*\]$} $type "" type    
  1527.     return [PBType new $type]
  1528. }
  1529.  
  1530. # Do not delete this line -- regeneration end marker
  1531.  
  1532. Class PBGBaseTypeD : {PBGBaseType OPBaseType} {
  1533. }
  1534.  
  1535. selfPromoter OPBaseType {this} {
  1536.     PBGBaseTypeD promote $this
  1537. }
  1538.  
  1539. #      File:           @(#)pbgclassty.tcl    /main/hindenburg/1
  1540.  
  1541.  
  1542. Class PBGClassType : {PBGType} {
  1543.     constructor
  1544.     method destructor
  1545.     method generate
  1546. }
  1547.  
  1548. constructor PBGClassType {class this name} {
  1549.     set this [PBGType::constructor $class $this $name]
  1550.     # Start constructor user section
  1551.     # End constructor user section
  1552.     return $this
  1553. }
  1554.  
  1555. method PBGClassType::destructor {this} {
  1556.     # Start destructor user section
  1557.     # End destructor user section
  1558. }
  1559.  
  1560. method PBGClassType::generate {this} {
  1561.     return [PBType new [$this getName]]
  1562. }
  1563.  
  1564. # Do not delete this line -- regeneration end marker
  1565.  
  1566. Class PBGClassTypeD : {PBGClassType OPClassType} {
  1567. }
  1568.  
  1569. selfPromoter OPClassType {this} {
  1570.     PBGClassTypeD promote $this
  1571. }
  1572.  
  1573. #      File:           @(#)pbgenumtyp.tcl    /main/hindenburg/1
  1574.  
  1575.  
  1576. Class PBGEnumType : {PBGType} {
  1577.     constructor
  1578.     method destructor
  1579.     method generate
  1580. }
  1581.  
  1582. constructor PBGEnumType {class this name} {
  1583.     set this [PBGType::constructor $class $this $name]
  1584.     # Start constructor user section
  1585.     # End constructor user section
  1586.     return $this
  1587. }
  1588.  
  1589. method PBGEnumType::destructor {this} {
  1590.     # Start destructor user section
  1591.     # End destructor user section
  1592. }
  1593.  
  1594. method PBGEnumType::generate {this} {
  1595.     return [PBType new [$this getName]]
  1596. }
  1597.  
  1598. # Do not delete this line -- regeneration end marker
  1599.  
  1600. Class PBGEnumTypeD : {PBGEnumType OPEnumType} {
  1601. }
  1602.  
  1603. selfPromoter OPEnumType {this} {
  1604.     PBGEnumTypeD promote $this
  1605. }
  1606.  
  1607. #      File:           @(#)pbgtypedef.tcl    /main/hindenburg/1
  1608.  
  1609.  
  1610. Class PBGTypeDefType : {PBGType} {
  1611.     constructor
  1612.     method destructor
  1613.     method generate
  1614. }
  1615.  
  1616. constructor PBGTypeDefType {class this name} {
  1617.     set this [PBGType::constructor $class $this $name]
  1618.     # Start constructor user section
  1619.     # End constructor user section
  1620.     return $this
  1621. }
  1622.  
  1623. method PBGTypeDefType::destructor {this} {
  1624.     # Start destructor user section
  1625.     # End destructor user section
  1626. }
  1627.  
  1628. method PBGTypeDefType::generate {this} {
  1629.     return [PBType new [$this getName]]
  1630. }
  1631.  
  1632. # Do not delete this line -- regeneration end marker
  1633.  
  1634. Class PBGTypeDefTypeD : {PBGTypeDefType OPTypeDefType} {
  1635. }
  1636.  
  1637. selfPromoter OPTypeDefType {this} {
  1638.     PBGTypeDefTypeD promote $this
  1639. }
  1640.  
  1641. #      File:           @(#)pbclasscus.tcl    /main/hindenburg/1
  1642.  
  1643.  
  1644. Class PBClassCustomUserObjectGen : {PBDefinitionGen} {
  1645.     constructor
  1646.     method destructor
  1647.     method createPBDefinition
  1648. }
  1649.  
  1650. constructor PBClassCustomUserObjectGen {class this i_name ooplClass} {
  1651.     set this [PBDefinitionGen::constructor $class $this $i_name $ooplClass]
  1652.     # Start constructor user section
  1653.     # End constructor user section
  1654.     return $this
  1655. }
  1656.  
  1657. method PBClassCustomUserObjectGen::destructor {this} {
  1658.     # Start destructor user section
  1659.     # End destructor user section
  1660.     $this PBDefinitionGen::destructor
  1661. }
  1662.  
  1663. method PBClassCustomUserObjectGen::createPBDefinition {this} {
  1664.     set def [$this PBDefinitionGen::createPBDefinition]
  1665.     $def isAutoInstantiate [[$this ooplClass] isAutoInstantiate]
  1666.     return $def
  1667. }
  1668.  
  1669. # Do not delete this line -- regeneration end marker
  1670.  
  1671.  
  1672. #      File:           @(#)pbclasssta.tcl    /main/hindenburg/1
  1673.  
  1674.  
  1675. Class PBClassStandardUserObjectGen : {PBDefinitionGen} {
  1676.     constructor
  1677.     method destructor
  1678. }
  1679.  
  1680. constructor PBClassStandardUserObjectGen {class this i_name ooplClass} {
  1681.     set this [PBDefinitionGen::constructor $class $this $i_name $ooplClass]
  1682.     # Start constructor user section
  1683.     # End constructor user section
  1684.     return $this
  1685. }
  1686.  
  1687. method PBClassStandardUserObjectGen::destructor {this} {
  1688.     # Start destructor user section
  1689.     # End destructor user section
  1690.     $this PBDefinitionGen::destructor
  1691. }
  1692.  
  1693. # Do not delete this line -- regeneration end marker
  1694.  
  1695.  
  1696. #      File:           @(#)pbmenugen.tcl    /main/hindenburg/5
  1697.  
  1698.  
  1699. Class PBMenuGen : {PBDefinitionGen} {
  1700.     constructor
  1701.     method destructor
  1702.     method createPBDefinition
  1703.     method genAssocAttrs
  1704. }
  1705.  
  1706. constructor PBMenuGen {class this i_name ooplClass} {
  1707.     set this [PBDefinitionGen::constructor $class $this $i_name $ooplClass]
  1708.     # Start constructor user section
  1709.     # End constructor user section
  1710.     return $this
  1711. }
  1712.  
  1713. method PBMenuGen::destructor {this} {
  1714.     # Start destructor user section
  1715.     # End destructor user section
  1716.     $this PBDefinitionGen::destructor
  1717. }
  1718.  
  1719. method PBMenuGen::createPBDefinition {this} {
  1720.     set def [$this PBDefinitionGen::createPBDefinition]
  1721.  
  1722.     # set default for (mandatory) builtin property 'Text'
  1723.     $def setBuiltinProperty Text [PBBuiltinProperty new Text string \
  1724.         \"[$this name]\" -where ${PBBuiltinProperty::InOnCreate}]
  1725.  
  1726.     return $def
  1727. }
  1728.  
  1729. method PBMenuGen::genAssocAttrs {this def} {
  1730.         foreach assoc [[$this ooplClass] genAssocAttrSet] {
  1731.                 set oppClass [$assoc getOppositeClass]
  1732.         if {$oppClass == ""} {
  1733.             # error is already given
  1734.             continue
  1735.         }
  1736.                 if {[$oppClass getPBClassKind] == ${PBClassKind::Window}} {
  1737.             m4_warning $W_IGNMENUWINAGGR [$assoc getName] \
  1738.                 [$this name] [$oppClass getName]
  1739.             continue
  1740.                 } 
  1741.         $assoc generate [$this globalOoplClass] $def
  1742.         }
  1743. }
  1744.  
  1745. # Do not delete this line -- regeneration end marker
  1746.  
  1747.  
  1748. #      File:           @(#)pbstructur.tcl    /main/hindenburg/2
  1749.  
  1750.  
  1751. Class PBStructureGen : {PBDefinitionGen} {
  1752.     constructor
  1753.     method destructor
  1754.     method createPBDefinition
  1755.     method genFeatures
  1756. }
  1757.  
  1758. constructor PBStructureGen {class this i_name ooplClass} {
  1759.     set this [PBDefinitionGen::constructor $class $this $i_name $ooplClass]
  1760.     # Start constructor user section
  1761.     # End constructor user section
  1762.     return $this
  1763. }
  1764.  
  1765. method PBStructureGen::destructor {this} {
  1766.     # Start destructor user section
  1767.     # End destructor user section
  1768.     $this PBDefinitionGen::destructor
  1769. }
  1770.  
  1771. method PBStructureGen::createPBDefinition {this} {
  1772.     set def [PBStructure new [$this name] [$this ooplClass] \
  1773.         -isGlobalType [$this isGlobalType]]
  1774.  
  1775.     if [$this isGlobalType] {
  1776.         PBLibraryEntry new [$this model] $def
  1777.     } else {
  1778.         [$this container] addObjectStructure $def
  1779.     }
  1780.  
  1781.     return $def
  1782. }
  1783.  
  1784. method PBStructureGen::genFeatures {this def} {
  1785.     foreach attr [[$this ooplClass] dataAttrSet] {
  1786.                 set type [[$attr ooplType] generate]
  1787.                 set field [PBNameType new [$attr getName] $type \
  1788.             -arrayDesc [[$attr ooplType] arrayDesc]]
  1789.                 $def addField $field
  1790.         }
  1791. }
  1792.  
  1793. # Do not delete this line -- regeneration end marker
  1794.  
  1795.  
  1796. #      File:           @(#)pbvisualcu.tcl    /main/hindenburg/1
  1797.  
  1798.  
  1799. Class PBVisualCustomUserObjectGen : {PBDefinitionGen} {
  1800.     constructor
  1801.     method destructor
  1802.     method createPBDefinition
  1803. }
  1804.  
  1805. constructor PBVisualCustomUserObjectGen {class this i_name ooplClass} {
  1806.     set this [PBDefinitionGen::constructor $class $this $i_name $ooplClass]
  1807.     # Start constructor user section
  1808.     # End constructor user section
  1809.     return $this
  1810. }
  1811.  
  1812. method PBVisualCustomUserObjectGen::destructor {this} {
  1813.     # Start destructor user section
  1814.     # End destructor user section
  1815.     $this PBDefinitionGen::destructor
  1816. }
  1817.  
  1818. method PBVisualCustomUserObjectGen::createPBDefinition {this} {
  1819.     set def [$this PBDefinitionGen::createPBDefinition]
  1820.     $def isAutoInstantiate [[$this ooplClass] isAutoInstantiate]
  1821.     return $def
  1822. }
  1823.  
  1824. # Do not delete this line -- regeneration end marker
  1825.  
  1826.  
  1827. #      File:           @(#)pbvisualst.tcl    /main/hindenburg/1
  1828.  
  1829.  
  1830. Class PBVisualStandardUserObjectGen : {PBDefinitionGen} {
  1831.     constructor
  1832.     method destructor
  1833. }
  1834.  
  1835. constructor PBVisualStandardUserObjectGen {class this i_name ooplClass} {
  1836.     set this [PBDefinitionGen::constructor $class $this $i_name $ooplClass]
  1837.     # Start constructor user section
  1838.     # End constructor user section
  1839.     return $this
  1840. }
  1841.  
  1842. method PBVisualStandardUserObjectGen::destructor {this} {
  1843.     # Start destructor user section
  1844.     # End destructor user section
  1845.     $this PBDefinitionGen::destructor
  1846. }
  1847.  
  1848. # Do not delete this line -- regeneration end marker
  1849.  
  1850.  
  1851. #      File:           @(#)pbwindowge.tcl    /main/hindenburg/5
  1852.  
  1853.  
  1854. Class PBWindowGen : {PBDefinitionGen} {
  1855.     constructor
  1856.     method destructor
  1857.     method createPBDefinition
  1858.     method genAssocAttrs
  1859. }
  1860.  
  1861. constructor PBWindowGen {class this i_name ooplClass} {
  1862.     set this [PBDefinitionGen::constructor $class $this $i_name $ooplClass]
  1863.     # Start constructor user section
  1864.     # End constructor user section
  1865.     return $this
  1866. }
  1867.  
  1868. method PBWindowGen::destructor {this} {
  1869.     # Start destructor user section
  1870.     # End destructor user section
  1871.     $this PBDefinitionGen::destructor
  1872. }
  1873.  
  1874. method PBWindowGen::createPBDefinition {this} {
  1875.     set def [$this PBDefinitionGen::createPBDefinition]
  1876.  
  1877.     set windowType [[$this ooplClass] getWindowType]
  1878.     if {$windowType == "MDI" || $windowType == "MDIHelp"} {
  1879.         set mdiclient [PBVisual new "mdi_1" "" "mdiclient" "mdiclient" \
  1880.             -isGlobalType 0]
  1881.         $def addContainedClass $mdiclient
  1882.     }
  1883.     set windowType "[string tolower $windowType]!"
  1884.     $def setBuiltinProperty WindowType [PBBuiltinProperty \
  1885.         new WindowType WindowType $windowType \
  1886.         -where ${PBBuiltinProperty::InTypeDef}]
  1887.  
  1888.     return $def
  1889. }
  1890.  
  1891. method PBWindowGen::genAssocAttrs {this def} {
  1892.     foreach assoc [[$this ooplClass] genAssocAttrSet] {
  1893.         set oppClass [$assoc getOppositeClass]
  1894.         if {$oppClass == ""} {
  1895.             # error is already given
  1896.             continue
  1897.         }
  1898.         if {[$oppClass getPBClassKind] == ${PBClassKind::Menu}} {
  1899.             set menuName [$oppClass getName]
  1900.             $def setBuiltinProperty MenuName [PBBuiltinProperty \
  1901.                 new MenuName string \"${menuName}\" \
  1902.                 -where ${PBBuiltinProperty::InTypeDef}]
  1903.             $def menuName $menuName
  1904.             continue
  1905.         }
  1906.         $assoc generate [$this globalOoplClass] $def
  1907.     }
  1908. }
  1909.  
  1910. # Do not delete this line -- regeneration end marker
  1911.  
  1912.  
  1913. #      File:           @(#)pbgdataatt.tcl    /main/hindenburg/5
  1914.  
  1915.  
  1916. Class PBGDataAttr : {PBGAttribute} {
  1917.     constructor
  1918.     method destructor
  1919.     method generate
  1920.     method generateAccess
  1921.     method isConstant
  1922.     method isShared
  1923. }
  1924.  
  1925. constructor PBGDataAttr {class this name} {
  1926.     set this [PBGAttribute::constructor $class $this $name]
  1927.     # Start constructor user section
  1928.     # End constructor user section
  1929.     return $this
  1930. }
  1931.  
  1932. method PBGDataAttr::destructor {this} {
  1933.     # Start destructor user section
  1934.     # End destructor user section
  1935. }
  1936.  
  1937. method PBGDataAttr::generate {this class} {
  1938.     set type [[$this ooplType] generate]
  1939.     set access [$this generateAccess]
  1940.     set attr [PBVariable new [$this getName] $type $access \
  1941.         -arrayDesc [[$this ooplType] arrayDesc]]
  1942.     set defVal [$this getInitialValue]
  1943.     if {$defVal != ""} {
  1944.         $attr defaultValue $defVal
  1945.     }
  1946.     if {[$this isConstant]} {
  1947.         if {$defVal != ""} {
  1948.             $attr isConstant 1
  1949.         } else {
  1950.             m4_warning $W_CONST_IGNORED [$this getName] \
  1951.                 [$class name]
  1952.         }
  1953.     }
  1954.     $attr isShared [$this isShared]
  1955.     if {[$this isShared]} {
  1956.         $class addSharedVar $attr
  1957.     } else {
  1958.         $class addInstanceVar $attr
  1959.     }
  1960.     return $attr
  1961. }
  1962.  
  1963. method PBGDataAttr::generateAccess {this} {
  1964.     set accessList [$this getPropertyValue "attrib_access"]
  1965.     switch -exact -- $accessList {
  1966.         Public-Public 
  1967.             {return [PBVarAccess new "" "" ""]}
  1968.         Public-Protected
  1969.             {return [PBVarAccess new "" "" "protectedwrite"]}
  1970.         Public-Private
  1971.             {return [PBVarAccess new "" "" "privatewrite"]}
  1972.         Protected-Public -
  1973.         Protected-Protected
  1974.             {return [PBVarAccess new "protected" "" ""]}
  1975.         Protected-Private
  1976.             {return [PBVarAccess new "protected" "" "privatewrite"]}
  1977.         Private-Public -
  1978.         Private-Protected -
  1979.         Private-Private
  1980.             {return [PBVarAccess new "private" "" ""]}
  1981.         default
  1982.             {return [PBVarAccess new "" "" ""]}
  1983.     }
  1984. }
  1985.  
  1986. method PBGDataAttr::isConstant {this} {
  1987.     if {[$this getPropertyValue is_const_attrib] == "1"} {
  1988.         return 1
  1989.     }
  1990.     return 0
  1991. }
  1992.  
  1993. method PBGDataAttr::isShared {this} {
  1994.     return [$this isClassFeature]
  1995. }
  1996.  
  1997. # Do not delete this line -- regeneration end marker
  1998.  
  1999. Class PBGDataAttrD : {PBGDataAttr OPDataAttr} {
  2000. }
  2001.  
  2002. selfPromoter OPDataAttr {this} {
  2003.     PBGDataAttrD promote $this
  2004. }
  2005.  
  2006. #      File:           @(#)pbggenasso.tcl    /main/hindenburg/10
  2007.  
  2008.  
  2009. Class PBGGenAssocAttr : {PBGAttribute} {
  2010.     constructor
  2011.     method destructor
  2012.     method promoter
  2013.     method getThisClass
  2014.     method getOppositeClass
  2015.     method isValidAssociation
  2016.     method genAddAccessor
  2017.     method genGetAccessor
  2018.     method genGetManyAccessor
  2019.     method genRemoveOneAccessor
  2020.     method genRemoveAccessor
  2021.     method genSetAccessor
  2022.     method genAssocVariable
  2023.     method getAssocIdentifier
  2024.     method getAssocVariable
  2025.     method getAccessorAccess
  2026.     method genCtor
  2027.     method genDtor
  2028.     method extendAssoc
  2029.     method reduceAssoc
  2030.     method setAssoc
  2031.     attribute oppClass
  2032. }
  2033.  
  2034. constructor PBGGenAssocAttr {class this name} {
  2035.     set this [PBGAttribute::constructor $class $this $name]
  2036.     $this oppClass "_uninitialized_"
  2037.     # Start constructor user section
  2038.     # End constructor user section
  2039.     return $this
  2040. }
  2041.  
  2042. method PBGGenAssocAttr::destructor {this} {
  2043.     # Start destructor user section
  2044.     # End destructor user section
  2045. }
  2046.  
  2047. method PBGGenAssocAttr::promoter {this} {
  2048.     $this oppClass "_uninitialized_"
  2049. }
  2050.  
  2051. method PBGGenAssocAttr::getThisClass {this} {
  2052.     return [$this ooplClass]
  2053. }
  2054.  
  2055. method PBGGenAssocAttr::getOppositeClass {this} {
  2056.     if {[$this oppClass] != "_uninitialized_"} {
  2057.         return [$this oppClass]
  2058.     }
  2059.  
  2060.     set type [$this ooplType]
  2061.     set ooplClass ""
  2062.     if [$type isA OPBaseType] {
  2063.         m4_error $E_ASSWITHBASETYPE [$this getName] \
  2064.             [[$this getThisClass] getName] [$type getName]
  2065.     } elseif [$type isA OPEnumType] {
  2066.         m4_error $E_ASSWITHENUMTYPE [$this getName] \
  2067.             [[$this getThisClass] getName] [$type getName]
  2068.     } else {
  2069.         set ooplClass [$type ooplClass]
  2070.         if {$ooplClass == ""} {
  2071.             m4_error $E_ASSCLASSNONAME [$this getName] \
  2072.                 [[$this getThisClass] getName]
  2073.         }
  2074.     }
  2075.     $this oppClass $ooplClass
  2076.     return $ooplClass
  2077. }
  2078.  
  2079. method PBGGenAssocAttr::isValidAssociation {this} {
  2080.     set thisClass [$this getThisClass]
  2081.     set oppClass [$this getOppositeClass]
  2082.     if {$oppClass == ""} {
  2083.         # error is already given
  2084.         return 0
  2085.     }
  2086.  
  2087.     if {![$thisClass isGlobalType] || ![$oppClass isGlobalType]} {
  2088.         m4_error $E_ASSGLOBTYPES [$this getName] \
  2089.             [$thisClass getName] [$oppClass getName]
  2090.         return 0
  2091.     }
  2092.  
  2093.     if {[$oppClass getPBClassKind] == ${PBClassKind::Structure}} {
  2094.         m4_error $E_ASSWITHSTRUCT [$this getName] \
  2095.             [$thisClass getName] [$oppClass getName]
  2096.         return 0
  2097.     }
  2098.  
  2099.     if {[$thisClass getBuiltinSuperClass] == ""} {
  2100.         # error is already given
  2101.         return 0
  2102.     }
  2103.     set classInfo [[PBBuiltinInfo::global] getBuiltinClass \
  2104.         [$thisClass getBuiltinSuperClassName]]
  2105.     if ![$classInfo hasCtorDtor] {
  2106.         m4_error $E_ASSCTORDTOR [$this getName] [$thisClass getName] \
  2107.             [$oppClass getName] [$thisClass getName]
  2108.         return 0
  2109.     }
  2110.  
  2111.     if {[$oppClass getBuiltinSuperClass] == ""} {
  2112.         # error is already given
  2113.         return 0
  2114.     }
  2115.     set oppClassInfo [[PBBuiltinInfo::global] getBuiltinClass \
  2116.          [$oppClass getBuiltinSuperClassName]]
  2117.     if {[$this opposite] != "" && ![$oppClassInfo hasCtorDtor]} {
  2118.         m4_error $E_ASSCTORDTOR [$this getName] [$thisClass getName] \
  2119.             [$oppClass getName] [$oppClass getName]
  2120.         return 0
  2121.     }
  2122.  
  2123.     return 1
  2124. }
  2125.  
  2126. method PBGGenAssocAttr::genAddAccessor {this class} {
  2127.     set opposite [$this opposite]
  2128.     if {$opposite == ""} {
  2129.         set accessStr [$this getAccessorAccess w]
  2130.     } else {
  2131.         set accessStr "public"
  2132.     }
  2133.     if {$accessStr == "none"} {
  2134.         return
  2135.     }
  2136.  
  2137.     set ident [$this getAssocIdentifier]
  2138.  
  2139.     set name "add[cap $ident]"
  2140.     set type [PBType new ""]
  2141.     set access [PBAccess new $accessStr]
  2142.  
  2143.     set accessor [PBFunction new $name $type $access]
  2144.     $class addObjectFunction $accessor
  2145.  
  2146.     if [$this isQualified] {
  2147.         set qualifier [$this qualifier]
  2148.     } elseif {$opposite != "" && [$opposite isQualified]} {
  2149.         set qualifier [$opposite qualifier]
  2150.     } else {
  2151.         set qualifier ""
  2152.     }
  2153.     if {$qualifier != ""} {
  2154.         set qualId [$qualifier getName]
  2155.         set qualTypeName [[$qualifier ooplType] getName]
  2156.         set type [PBType new $qualTypeName]
  2157.         set modifier [PBModifier new ""]
  2158.         set param [PBParameter new $qualId $type $modifier]
  2159.         $accessor addParameter $param
  2160.     }
  2161.  
  2162.     set paramId "new[cap $ident]"
  2163.     set paramType [[$this ooplType] generate]
  2164.     set modifier [PBModifier new ""]
  2165.     set param [PBParameter new $paramId $paramType $modifier]
  2166.     $accessor addParameter $param
  2167.  
  2168.     # Generate body
  2169.     #
  2170.     set sect [TextSection new]
  2171.     $accessor body $sect
  2172.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2173.     $sect append "if isNull($paramId) then\n"
  2174.     $sect indent +
  2175.     $sect append "return\n"
  2176.     $sect indent -
  2177.     $sect append "end if\n"
  2178.  
  2179.     if {$opposite != ""} {
  2180.         if {[$opposite getMultiplicity] == "one" &&
  2181.                 ![$opposite isQualified] && ![$this isQualified]} {
  2182.             $sect append [$opposite setAssoc $paramId]
  2183.         }
  2184.         $sect append [$opposite extendAssoc $paramId]
  2185.     }
  2186.  
  2187.     if {[$this isQualified]} {
  2188.         set varName [$this getAssocVariable]
  2189.         $sect append "classset theSet\n"
  2190.         $sect append "theSet = $varName.get($qualId)\n"
  2191.         $sect append "if isNull(theSet) then\n"
  2192.         $sect indent +
  2193.         $sect append "theSet = create classset\n"
  2194.         $sect append "$varName.set($qualId, theSet)\n"
  2195.         $sect indent -
  2196.         $sect append "end if\n"
  2197.         $sect append "theSet.add($paramId)\n"
  2198.     } else {
  2199.         $sect append [$this extendAssoc "" $paramId]
  2200.     }
  2201. }
  2202.  
  2203. method PBGGenAssocAttr::genGetAccessor {this class} {
  2204.     set opposite [$this opposite]
  2205.     if {$opposite == ""} {
  2206.         set accessStr [$this getAccessorAccess r]
  2207.     } else {
  2208.         set accessStr "public"
  2209.     }
  2210.     if {$accessStr == "none"} {
  2211.                 return
  2212.         }
  2213.  
  2214.     set varName [$this getAssocVariable]
  2215.     set name "get[cap $varName]"
  2216.     set type [[$this ooplType] generate]
  2217.         set access [PBAccess new $accessStr]
  2218.  
  2219.     set accessor [PBFunction new $name $type $access]
  2220.     $class addObjectFunction $accessor
  2221.  
  2222.     # Generate body
  2223.     #
  2224.     set sect [TextSection new]
  2225.     $accessor body $sect
  2226.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2227.     $sect append "return $varName\n"
  2228. }
  2229.  
  2230. method PBGGenAssocAttr::genGetManyAccessor {this class} {
  2231.     set opposite [$this opposite]
  2232.     if {$opposite == ""} {
  2233.         set accessStr [$this getAccessorAccess r]
  2234.     } else {
  2235.         set accessStr "public"
  2236.     }
  2237.     if {$accessStr == "none"} {
  2238.         return
  2239.     }
  2240.  
  2241.     set varName [$this getAssocVariable]
  2242.     set name "get[cap $varName]"
  2243.     set type [PBType new "classset"]
  2244.     set access [PBAccess new $accessStr]
  2245.  
  2246.     set accessor [PBFunction new $name $type $access]
  2247.     $class addObjectFunction $accessor
  2248.  
  2249.     # Generate body
  2250.     #
  2251.     set sect [TextSection new]
  2252.     $accessor body $sect
  2253.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2254.     $sect append "return $varName\n"
  2255. }
  2256.  
  2257. method PBGGenAssocAttr::genRemoveOneAccessor {this class} {
  2258.     set opposite [$this opposite]
  2259.     if {$opposite == ""} {
  2260.         set accessStr [$this getAccessorAccess w]
  2261.     } else {
  2262.         set accessStr "public"
  2263.     }
  2264.     if {$accessStr == "none"} {
  2265.         return
  2266.     }
  2267.  
  2268.     set ident [$this getAssocIdentifier]
  2269.  
  2270.     set name "remove[cap $ident]"
  2271.     set type [PBType new ""]
  2272.     set access [PBAccess new $accessStr]
  2273.  
  2274.     set accessor [PBFunction new $name $type $access]
  2275.     $class addObjectFunction $accessor
  2276.  
  2277.     if {$opposite != "" && [$opposite isQualified]} {
  2278.         set qualifier [$opposite qualifier]
  2279.         set qualId [$qualifier getName]
  2280.         set qualTypeName [[$qualifier ooplType] getName]
  2281.         set type [PBType new $qualTypeName]
  2282.         set modifier [PBModifier new ""]
  2283.         set param [PBParameter new $qualId $type $modifier]
  2284.         $accessor addParameter $param
  2285.     }
  2286.  
  2287.     # Generate body
  2288.     #
  2289.     set sect [TextSection new]
  2290.     $accessor body $sect
  2291.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2292.  
  2293.     if {$opposite != ""} {
  2294.         $sect append "if not isNull($ident) then\n"
  2295.         $sect indent +
  2296.         $sect append [$opposite reduceAssoc $ident]
  2297.         $sect indent -
  2298.         $sect append "end if\n"
  2299.     }
  2300.     $sect append "setNull($ident)\n"
  2301. }
  2302.  
  2303. method PBGGenAssocAttr::genRemoveAccessor {this class} {
  2304.     set opposite [$this opposite]
  2305.     if {$opposite == ""} {
  2306.         set accessStr [$this getAccessorAccess w]
  2307.     } else {
  2308.         set accessStr "public"
  2309.     }
  2310.     if {$accessStr == "none"} {
  2311.         return
  2312.     }
  2313.  
  2314.     set ident [$this getAssocIdentifier]
  2315.  
  2316.     set name "remove[cap $ident]"
  2317.     set type [PBType new ""]
  2318.     set access [PBAccess new $accessStr]
  2319.  
  2320.     set accessor [PBFunction new $name $type $access]
  2321.     $class addObjectFunction $accessor
  2322.  
  2323.     if {$opposite != "" && [$opposite isQualified]} {
  2324.         set qualifier [$opposite qualifier]
  2325.         set qualId [$qualifier getName]
  2326.         set qualTypeName [[$qualifier ooplType] getName]
  2327.         set type [PBType new $qualTypeName]
  2328.         set modifier [PBModifier new ""]
  2329.         set param [PBParameter new $qualId $type $modifier]
  2330.         $accessor addParameter $param
  2331.     }
  2332.  
  2333.     set paramId "old[cap $ident]"
  2334.     set paramType [[$this ooplType] generate]
  2335.     set modifier [PBModifier new ""]
  2336.     set param [PBParameter new $paramId $paramType $modifier]
  2337.     $accessor addParameter $param
  2338.  
  2339.     # Generate body
  2340.     #
  2341.     set sect [TextSection new]
  2342.     $accessor body $sect
  2343.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2344.     $sect append "if isNull($paramId) then\n"
  2345.     $sect indent +
  2346.     $sect append "return\n"
  2347.     $sect indent -
  2348.     $sect append "end if\n"
  2349.  
  2350.     if {$opposite != ""} {
  2351.         $sect append [$opposite reduceAssoc $paramId]
  2352.     }
  2353.     $sect append [$this reduceAssoc "" $paramId]
  2354. }
  2355.  
  2356. method PBGGenAssocAttr::genSetAccessor {this class} {
  2357.     set opposite [$this opposite]
  2358.     if {$opposite == ""} {
  2359.         set accessStr [$this getAccessorAccess w]
  2360.     } else {
  2361.         set accessStr "public"
  2362.     }
  2363.     if {$accessStr == "none"} {
  2364.         return
  2365.     }
  2366.  
  2367.     set ident [$this getAssocIdentifier]
  2368.  
  2369.     set name "set[cap $ident]"
  2370.     set type [PBType new ""]
  2371.     set access [PBAccess new $accessStr]
  2372.  
  2373.     set accessor [PBFunction new $name $type $access]
  2374.     $class addObjectFunction $accessor
  2375.  
  2376.     if {$opposite != "" && [$opposite isQualified]} {
  2377.         set qualifier [$opposite qualifier]
  2378.         set qualId [$qualifier getName]
  2379.         set qualTypeName [[$qualifier ooplType] getName]
  2380.         set type [PBType new $qualTypeName]
  2381.         set modifier [PBModifier new ""]
  2382.         set param [PBParameter new $qualId $type $modifier]
  2383.         $accessor addParameter $param
  2384.     }
  2385.  
  2386.     set paramId "new[cap $ident]"
  2387.     set paramType [[$this ooplType] generate]
  2388.     set modifier [PBModifier new ""]
  2389.     set param [PBParameter new $paramId $paramType $modifier]
  2390.     $accessor addParameter $param
  2391.  
  2392.     # Generate body
  2393.     #
  2394.     set sect [TextSection new]
  2395.     $accessor body $sect
  2396.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2397.     if {$opposite != ""} {
  2398.         if {[$opposite isQualified]} {
  2399.             $sect append "if not isNull($paramId) then\n"
  2400.             $sect indent +
  2401.             $sect append [$opposite extendAssoc $paramId]
  2402.             $sect indent -
  2403.             $sect append "end if\n"
  2404.         } else {
  2405.             $sect append "if not isNull($ident) then\n"
  2406.             $sect indent +
  2407.             $sect append [$opposite reduceAssoc $ident]
  2408.             $sect indent -
  2409.             $sect append "end if\n"
  2410.  
  2411.             if {[$opposite getMultiplicity] == "one"} {
  2412.                 $sect append "if not isNull($paramId) then\n"
  2413.                 $sect indent +
  2414.                 $sect append [$opposite setAssoc $paramId]
  2415.                 $sect append [$opposite extendAssoc $paramId]
  2416.                 $sect indent -
  2417.                 $sect append "end if\n"
  2418.             } else {
  2419.                 $sect append "if not isNull($paramId) then\n"
  2420.                 $sect indent +
  2421.                 $sect append [$opposite extendAssoc $paramId]
  2422.                 $sect indent -
  2423.                 $sect append "end if\n"
  2424.             }
  2425.         }
  2426.     }
  2427.  
  2428.     $sect append "$ident = $paramId\n"
  2429. }
  2430.  
  2431. method PBGGenAssocAttr::genAssocVariable {this class} {
  2432.     if [$this isQualified] {
  2433.         set type [PBType new "classdict"]
  2434.     } elseif {[$this getMultiplicity] == "many"} {
  2435.         set type [PBType new "classset"]
  2436.     } else {
  2437.         set type [[$this ooplType] generate]
  2438.     }
  2439.  
  2440.     if {[$this opposite] != ""} {
  2441.         set access [PBVarAccess new "public" "" ""]
  2442.     } else {
  2443.         set access [PBVarAccess new "private" "" ""]
  2444.     }
  2445.  
  2446.         set name [$this getAssocVariable]
  2447.         set var [PBVariable new $name $type $access]
  2448.         $class addAssocInstanceVar $var
  2449. }
  2450.  
  2451. method PBGGenAssocAttr::getAssocIdentifier {this} {
  2452.     if {[$this isLinkAttr]} {
  2453.         return [uncap [[$this ooplType] getName]Of[cap [$this getName]]]
  2454.     }
  2455.     return [$this getName]
  2456. }
  2457.  
  2458. method PBGGenAssocAttr::getAssocVariable {this} {
  2459.     set name [$this getAssocIdentifier]
  2460.     if {[$this isQualified]} {
  2461.         set name "${name}Dict"
  2462.     } elseif {[$this getMultiplicity] == "many"} {
  2463.         set name "${name}Set"
  2464.     }
  2465.     return [uncap $name]
  2466. }
  2467.  
  2468. method PBGGenAssocAttr::getAccessorAccess {this mode} {
  2469.     set accessList [split [$this getPropertyValue assoc_access] -]
  2470.     if {$mode == "r"} {
  2471.         set accessStr [lindex $accessList 0]
  2472.     } else {
  2473.         set accessStr [lindex $accessList 1]
  2474.     }
  2475.     if {$accessStr == ""} {
  2476.         set accessStr "public"
  2477.     }
  2478.     return [string tolower $accessStr]
  2479. }
  2480.  
  2481. method PBGGenAssocAttr::genCtor {this class} {
  2482.     set ctor [$class findEvent "constructor"]
  2483.     if {$ctor == ""} {
  2484.         set ctor [PBConstructor new "constructor" [PBType new ""]]
  2485.         $class addScript $ctor
  2486.     }
  2487.     if {[$ctor preBody] == ""} {
  2488.         $ctor preBody [TextSection new]
  2489.     }
  2490.     set varName [$this getAssocVariable]
  2491.     if {[$this isQualified]} {
  2492.         set initStr "$varName = create classdict"
  2493.     } elseif {[$this getMultiplicity] == "many"} {
  2494.         set initStr "$varName = create classset"
  2495.     } else {
  2496.         set initStr "setNull($varName)"
  2497.     }
  2498.     [$ctor preBody] append "${initStr}\n"
  2499. }
  2500.  
  2501. method PBGGenAssocAttr::genDtor {this class} {
  2502.     set dtor [$class findEvent "destructor"]
  2503.     if {$dtor == ""} {
  2504.         set dtor [PBDestructor new "destructor" [PBType new ""]]
  2505.         $class addScript $dtor
  2506.     }
  2507.     if {[$dtor postBody] == ""} {
  2508.         $dtor postBody [TextSection new]
  2509.     }
  2510.     set varName [$this getAssocVariable]
  2511.     if {[$this isQualified] || [$this getMultiplicity] == "many"} {
  2512.         [$dtor postBody] append "destroy($varName)\n"
  2513.     }
  2514. }
  2515.  
  2516. method PBGGenAssocAttr::extendAssoc {this {prefix ""} {element this}} {
  2517.     if {$prefix != ""} {
  2518.         set prefix "${prefix}."
  2519.     }
  2520.  
  2521.     set varName [$this getAssocVariable]
  2522.  
  2523.     if {[$this isQualified]} {
  2524.         set qualId [[$this qualifier] getName]
  2525.         if {[$this getMultiplicity] == "one"} {
  2526.             return "$prefix$varName.set($qualId, $element)\n"
  2527.         }
  2528.         set ident [$this getAssocIdentifier]
  2529.         return "${prefix}add[cap $ident]($qualId, $element)\n"
  2530.     }
  2531.  
  2532.     if {[$this getMultiplicity] == "one"} {
  2533.         return "$prefix$varName = $element\n"
  2534.     }
  2535.     return "$prefix$varName.add($element)\n"
  2536. }
  2537.  
  2538. method PBGGenAssocAttr::reduceAssoc {this {prefix ""} {element this}} {
  2539.     if {$prefix != ""} {
  2540.         set prefix "${prefix}."
  2541.     }
  2542.  
  2543.     set varName [$this getAssocVariable]
  2544.  
  2545.     if {[$this isQualified]} {
  2546.         set qualId [[$this qualifier] getName]
  2547.         if {[$this getMultiplicity] == "one"} {
  2548.             return "$prefix$varName.remove($qualId)\n"
  2549.         }
  2550.         set ident [$this getAssocIdentifier]
  2551.         return "${prefix}remove[cap $ident]($qualId, $element)\n"
  2552.     }
  2553.  
  2554.     if {[$this getMultiplicity] == "one"} {
  2555.         return "setNull($prefix$varName)\n"
  2556.     }
  2557.  
  2558.     return "$prefix$varName.remove($element)\n"
  2559. }
  2560.  
  2561. method PBGGenAssocAttr::setAssoc {this {prefix ""} {element ""}} {
  2562.     if {$prefix != ""} {
  2563.         set prefix "${prefix}."
  2564.     }
  2565.  
  2566.     set retStr ""
  2567.     if {$element == ""} {
  2568.         set retStr "[[$this ooplType] getName] nullRef\n"
  2569.         set retStr "${retStr}setNull(nullRef)\n"
  2570.         set element "nullRef"
  2571.     }
  2572.     set retStr "${retStr}${prefix}set[\
  2573.         cap [$this getAssocIdentifier]]($element)\n"
  2574.     return $retStr
  2575. }
  2576.  
  2577. # Do not delete this line -- regeneration end marker
  2578.  
  2579. Class PBGGenAssocAttrD : {PBGGenAssocAttr OPGenAssocAttr} {
  2580. }
  2581.  
  2582. selfPromoter OPGenAssocAttr {this} {
  2583.     PBGGenAssocAttrD promote $this
  2584. }
  2585.  
  2586. #      File:           @(#)pbgassocat.tcl    /main/hindenburg/11
  2587.  
  2588.  
  2589. Class PBGAssocAttr : {PBGGenAssocAttr} {
  2590.     constructor
  2591.     method destructor
  2592.     method isAggregation
  2593.     method isContainmentAggregation
  2594.     method generate
  2595. }
  2596.  
  2597. constructor PBGAssocAttr {class this name} {
  2598.     set this [PBGGenAssocAttr::constructor $class $this $name]
  2599.     # Start constructor user section
  2600.     # End constructor user section
  2601.     return $this
  2602. }
  2603.  
  2604. method PBGAssocAttr::destructor {this} {
  2605.     # Start destructor user section
  2606.     # End destructor user section
  2607. }
  2608.  
  2609. method PBGAssocAttr::isAggregation {this} {
  2610.     set compType [[[$this smConnector] getConnector] type]
  2611.     if {$compType == "aggregation"} {
  2612.         return 1
  2613.     }
  2614.     return 0
  2615. }
  2616.  
  2617. method PBGAssocAttr::isContainmentAggregation {this class} {
  2618.     if ![$this isAggregation] {
  2619.         return 0
  2620.     }
  2621.  
  2622.     if [$this isAggregate] {
  2623.         set fromClass [$this getThisClass]
  2624.         set toClass [$this getOppositeClass]
  2625.     } elseif {[$this opposite] != ""} {
  2626.         set fromClass [$this getOppositeClass]
  2627.         set toClass [$this getThisClass]
  2628.     } else {
  2629.         return 0
  2630.     }
  2631.  
  2632.     set containerType [$fromClass getBuiltinSuperClassName]
  2633.     set containeeType [$toClass getBuiltinSuperClassName]
  2634.  
  2635.     # Is it graphical containment, i.e. is it:
  2636.     # - a userobject or window containing a control, or
  2637.     # - a tab containing a userobject?
  2638.     if {$containerType == "userobject" || $containerType == "window"} {
  2639.         set classInfo [[PBBuiltinInfo::global] \
  2640.             getBuiltinClass $containeeType]
  2641.         if {$classInfo != "" && [$classInfo isControl]} {
  2642.             return 1
  2643.         }
  2644.     }
  2645.     if {$containerType == "tab" && $containeeType == "userobject"} {
  2646.         return 1
  2647.     }
  2648.  
  2649.     # Is it a menu containing other menus ?
  2650.     if {($containerType == "menu" || $containerType == "menucascade") &&
  2651.         ($containeeType == "menu" || $containeeType == "menucascade")} {
  2652.         return 1
  2653.     }
  2654.  
  2655.     # Is it a (global) class having an 'object structure' ?
  2656.     if {[$class isGlobalType] && $containeeType == "structure"} {
  2657.         return 1
  2658.     }
  2659.  
  2660.     return 0
  2661. }
  2662.  
  2663. method PBGAssocAttr::generate {this globalOoplClass class} {
  2664.     set oppClass [$this getOppositeClass]
  2665.     if {$oppClass == ""} {
  2666.         # error is already given
  2667.         return
  2668.     }
  2669.  
  2670.     if [$this isContainmentAggregation $class] {
  2671.         if [$this isAggregate] {
  2672.             [$this getOppositeClass] generateAsContainedClass \
  2673.                 [$this getName] $globalOoplClass \
  2674.                 [$this getThisClass] $class
  2675.         } else {
  2676.             m4_error $E_NOREVAGGR [$this getName] \
  2677.                 [[$this getThisClass] getName] \
  2678.                 [[$this getOppositeClass] getName] 
  2679.         }
  2680.         return
  2681.     }
  2682.  
  2683.     if [$this isAggregate] {
  2684.         # This is an aggregate, but it does not represent a valid
  2685.         # containment aggregation
  2686.         m4_warning $W_AGGRASASSOC [$this getName] \
  2687.             [[$this getThisClass] getName] \
  2688.             [[$this getOppositeClass] getName]
  2689.     }
  2690.  
  2691.     # 'normal' association generation ...
  2692.     #
  2693.     if ![$this isValidAssociation] {
  2694.         # error is already given
  2695.         return
  2696.     }
  2697.     $this genAssocVariable $class
  2698.     if {[$this getMultiplicity] == "one"} {
  2699.         $this genRemoveOneAccessor $class
  2700.         $this genSetAccessor $class
  2701.         $this genGetAccessor $class
  2702.     } else {
  2703.         $this genAddAccessor $class
  2704.         $this genRemoveAccessor $class
  2705.         $this genGetManyAccessor $class
  2706.     }
  2707.     $this genCtor $class
  2708.     $this genDtor $class
  2709. }
  2710.  
  2711. # Do not delete this line -- regeneration end marker
  2712.  
  2713. Class PBGAssocAttrD : {PBGAssocAttr OPAssocAttr} {
  2714. }
  2715.  
  2716. selfPromoter OPAssocAttr {this} {
  2717.     PBGAssocAttrD promote $this
  2718. }
  2719.  
  2720. #      File:           @(#)pbglinkatt.tcl    /main/hindenburg/4
  2721.  
  2722.  
  2723. Class PBGLinkAttr : {PBGGenAssocAttr} {
  2724.     constructor
  2725.     method destructor
  2726.     method generate
  2727. }
  2728.  
  2729. constructor PBGLinkAttr {class this name} {
  2730.     set this [PBGGenAssocAttr::constructor $class $this $name]
  2731.     # Start constructor user section
  2732.     # End constructor user section
  2733.     return $this
  2734. }
  2735.  
  2736. method PBGLinkAttr::destructor {this} {
  2737.     # Start destructor user section
  2738.     # End destructor user section
  2739. }
  2740.  
  2741. method PBGLinkAttr::generate {this globalOoplClass class} {
  2742.     if ![$this isValidAssociation] {
  2743.         return
  2744.     }
  2745.     $this genAssocVariable $class
  2746.     if {[$this getMultiplicity] == "one"} {
  2747.         $this genGetAccessor $class
  2748.     } else {
  2749.         $this genGetManyAccessor $class
  2750.     }
  2751.     $this genCtor $class
  2752.     $this genDtor $class
  2753. }
  2754.  
  2755. # Do not delete this line -- regeneration end marker
  2756.  
  2757. Class PBGLinkAttrD : {PBGLinkAttr OPLinkAttr} {
  2758. }
  2759.  
  2760. selfPromoter OPLinkAttr {this} {
  2761.     PBGLinkAttrD promote $this
  2762. }
  2763.  
  2764. #      File:           @(#)pbgqualatt.tcl    /main/hindenburg/6
  2765.  
  2766.  
  2767. Class PBGQualAttr : {PBGGenAssocAttr} {
  2768.     constructor
  2769.     method destructor
  2770.     method generate
  2771.     method genGetQualifiedAccessor
  2772.     method genRemoveQualifiedAccessor
  2773.     method genSetQualifiedAccessor
  2774. }
  2775.  
  2776. constructor PBGQualAttr {class this name} {
  2777.     set this [PBGGenAssocAttr::constructor $class $this $name]
  2778.     # Start constructor user section
  2779.     # End constructor user section
  2780.     return $this
  2781. }
  2782.  
  2783. method PBGQualAttr::destructor {this} {
  2784.     # Start destructor user section
  2785.     # End destructor user section
  2786. }
  2787.  
  2788. method PBGQualAttr::generate {this globalOoplClass class} {
  2789.     if ![$this isValidAssociation] {
  2790.         return
  2791.     }
  2792.     $this genAssocVariable $class
  2793.     $this genGetQualifiedAccessor $class
  2794.  
  2795.     if {[$this getMultiplicity] == "one"} {
  2796.         $this genSetQualifiedAccessor $class
  2797.     } else {
  2798.         $this genAddAccessor $class
  2799.     }
  2800.  
  2801.     $this genRemoveQualifiedAccessor $class
  2802.     $this genCtor $class
  2803.     $this genDtor $class
  2804. }
  2805.  
  2806. method PBGQualAttr::genGetQualifiedAccessor {this class} {
  2807.     set opposite [$this opposite]
  2808.     if {$opposite == ""} {
  2809.         set accessStr [$this getAccessorAccess r]
  2810.     } else {
  2811.         set accessStr "public"
  2812.     }
  2813.     if {$accessStr == "none"} {
  2814.         return
  2815.     }
  2816.  
  2817.     set varName [$this getAssocVariable]
  2818.     set name "get[cap $varName]"
  2819.     if {[$this getMultiplicity] == "many"} {
  2820.         set type [PBType new "classset"]
  2821.     } else {
  2822.         set type [[$this ooplType] generate]
  2823.     }
  2824.     set access [PBAccess new $accessStr]
  2825.  
  2826.     set accessor [PBFunction new $name $type $access]
  2827.     $class addObjectFunction $accessor
  2828.  
  2829.     set qualifier [$this qualifier]
  2830.     set qualId [$qualifier getName]
  2831.         set type [[$qualifier ooplType] generate]
  2832.     set modifier [PBModifier new ""]
  2833.     set param [PBParameter new $qualId $type $modifier]
  2834.     $accessor addParameter $param
  2835.  
  2836.     # The type of a qualifier must be derived from powerobject ...
  2837.  
  2838.     # Generate body
  2839.     #
  2840.     set sect [TextSection new]
  2841.     $accessor body $sect
  2842.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2843.     # note: no cast in powerbuilder
  2844.     $sect append "return $varName.get($qualId)\n"
  2845. }
  2846.  
  2847. method PBGQualAttr::genRemoveQualifiedAccessor {this class} {
  2848.     set opposite [$this opposite]
  2849.     if {$opposite == ""} {
  2850.         set accessStr [$this getAccessorAccess r]
  2851.     } else {
  2852.         set accessStr "public"
  2853.     }
  2854.     if {$accessStr == "none"} {
  2855.         return
  2856.     }
  2857.  
  2858.     set ident [$this getAssocIdentifier]
  2859.  
  2860.     set name "remove[cap $ident]"
  2861.     set type [PBType new ""]
  2862.     set access [PBAccess new $accessStr]
  2863.  
  2864.     set accessor [PBFunction new $name $type $access]
  2865.     $class addObjectFunction $accessor
  2866.  
  2867.     set qualifier [$this qualifier]
  2868.     set qualId [$qualifier getName]
  2869.     set type [[$qualifier ooplType] generate]
  2870.     set modifier [PBModifier new ""]
  2871.     set param [PBParameter new $qualId $type $modifier]
  2872.     $accessor addParameter $param
  2873.  
  2874.     # Generate body
  2875.     #
  2876.     set sect [TextSection new]
  2877.     $accessor body $sect
  2878.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2879.  
  2880.     set paramId "old[cap $ident]"
  2881.     set varName [$this getAssocVariable]
  2882.     if {[$this getMultiplicity] == "one"} {
  2883.         $sect append "powerobject object\n"
  2884.         $sect append "object = $varName.get($qualId)\n"
  2885.         $sect append "if isNull(object) then\n"
  2886.         $sect indent +
  2887.         $sect append "return\n"
  2888.         $sect indent -
  2889.         $sect append "end if\n"
  2890.         $sect append [$this reduceAssoc]
  2891.  
  2892.         if {$opposite != ""} {
  2893.             set typeName [[$this ooplType] getName]
  2894.             $sect append "$typeName $paramId\n"
  2895.             # note: no cast in powerbuilder
  2896.             $sect append "$paramId = object\n"
  2897.         }
  2898.     } else {
  2899.         set type [[$this ooplType] generate]
  2900.         set modifier [PBModifier new ""]
  2901.         set param [PBParameter new $paramId $type $modifier]
  2902.         $accessor addParameter $param
  2903.  
  2904.         $sect append "if isNull($paramId) then\n"
  2905.         $sect indent +
  2906.         $sect append "return\n"
  2907.         $sect indent -
  2908.         $sect append "end if\n"
  2909.         $sect append "classset theSet\n"
  2910.         # note: no cast in powerbuilder
  2911.         $sect append "theSet = $varName.get($qualId)\n"
  2912.         $sect append "if not isNull(theSet) then\n"
  2913.         $sect indent +
  2914.         $sect append "theSet.remove($paramId)\n"
  2915.         $sect indent -
  2916.         $sect append "end if\n"
  2917.     }
  2918.     if {$opposite != ""} {
  2919.         $sect append [$opposite reduceAssoc $paramId]
  2920.     }
  2921. }
  2922.  
  2923. method PBGQualAttr::genSetQualifiedAccessor {this class} {
  2924.     set opposite [$this opposite]
  2925.     if {$opposite == ""} {
  2926.         set accessStr [$this getAccessorAccess w]
  2927.     } else {
  2928.         set accessStr "public"
  2929.     }
  2930.     if {$accessStr == "none"} {
  2931.         return
  2932.     }
  2933.  
  2934.     set ident [$this getAssocIdentifier]
  2935.  
  2936.     set name "set[cap $ident]"
  2937.     set type [PBType new ""]
  2938.     set access [PBAccess new $accessStr]
  2939.  
  2940.     set accessor [PBFunction new $name $type $access]
  2941.     $class addObjectFunction $accessor
  2942.  
  2943.     set qualifier [$this qualifier]
  2944.     set qualId [$qualifier getName]
  2945.     set type [[$qualifier ooplType] generate]
  2946.     set modifier [PBModifier new ""]
  2947.     set param [PBParameter new $qualId $type $modifier]
  2948.     $accessor addParameter $param
  2949.  
  2950.     set paramId "new[cap $ident]"
  2951.     set paramType [[$this ooplType] generate]
  2952.     set modifier [PBModifier new ""]
  2953.     set param [PBParameter new $paramId $paramType $modifier]
  2954.     $accessor addParameter $param
  2955.  
  2956.     # Generate body
  2957.     #
  2958.     set sect [TextSection new]
  2959.     $accessor body $sect
  2960.     $sect append "${PBCookie::associationAccessorMethod}\n"
  2961.     $sect append "if isNull($paramId) then\n"
  2962.     $sect indent +
  2963.     $sect append "return\n"
  2964.     $sect indent -
  2965.     $sect append "end if\n"
  2966.     $sect append "[$this getAssocVariable].set($qualId, $paramId)\n"
  2967.  
  2968.     if {$opposite != ""} {
  2969.         $sect append [$opposite extendAssoc $paramId]
  2970.     }
  2971. }
  2972.  
  2973. # Do not delete this line -- regeneration end marker
  2974.  
  2975. Class PBGQualAttrD : {PBGQualAttr OPQualAttr} {
  2976. }
  2977.  
  2978. selfPromoter OPQualAttr {this} {
  2979.     PBGQualAttrD promote $this
  2980. }
  2981.  
  2982. #      File:           @(#)pbgreverse.tcl    /main/hindenburg/4
  2983.  
  2984.  
  2985. Class PBGReverseLinkAttr : {PBGGenAssocAttr} {
  2986.     constructor
  2987.     method destructor
  2988.     method generate
  2989. }
  2990.  
  2991. constructor PBGReverseLinkAttr {class this name} {
  2992.     set this [PBGGenAssocAttr::constructor $class $this $name]
  2993.     # Start constructor user section
  2994.     # End constructor user section
  2995.     return $this
  2996. }
  2997.  
  2998. method PBGReverseLinkAttr::destructor {this} {
  2999.     # Start destructor user section
  3000.     # End destructor user section
  3001. }
  3002.  
  3003. method PBGReverseLinkAttr::generate {this globalOoplClass class} {
  3004.     if ![$this isValidAssociation] {
  3005.         return
  3006.     }
  3007.     $this genAssocVariable $class
  3008.     if {[$this getMultiplicity] == "one"} {
  3009.         $this genGetAccessor $class
  3010.     } else {
  3011.         $this genGetManyAccessor $class
  3012.     }
  3013.     $this genCtor $class
  3014.     $this genDtor $class
  3015. }
  3016.  
  3017. # Do not delete this line -- regeneration end marker
  3018.  
  3019. Class PBGReverseLinkAttrD : {PBGReverseLinkAttr OPReverseLinkAttr} {
  3020. }
  3021.  
  3022. selfPromoter OPReverseLinkAttr {this} {
  3023.     PBGReverseLinkAttrD promote $this
  3024. }
  3025.  
  3026. #      File:           @(#)pbgqualass.tcl    /main/hindenburg/2
  3027.  
  3028.  
  3029. Class PBGQualAssocAttr : {PBGQualAttr} {
  3030.     constructor
  3031.     method destructor
  3032. }
  3033.  
  3034. constructor PBGQualAssocAttr {class this name} {
  3035.     set this [PBGQualAttr::constructor $class $this $name]
  3036.     # Start constructor user section
  3037.     # End constructor user section
  3038.     return $this
  3039. }
  3040.  
  3041. method PBGQualAssocAttr::destructor {this} {
  3042.     # Start destructor user section
  3043.     # End destructor user section
  3044. }
  3045.  
  3046. # Do not delete this line -- regeneration end marker
  3047.  
  3048. Class PBGQualAssocAttrD : {PBGQualAssocAttr OPQualAssocAttr} {
  3049. }
  3050.  
  3051. selfPromoter OPQualAssocAttr {this} {
  3052.     PBGQualAssocAttrD promote $this
  3053. }
  3054.  
  3055. #      File:           @(#)pbgquallin.tcl    /main/hindenburg/2
  3056.  
  3057.  
  3058. Class PBGQualLinkAttr : {PBGQualAttr} {
  3059.     constructor
  3060.     method destructor
  3061. }
  3062.  
  3063. constructor PBGQualLinkAttr {class this name} {
  3064.     set this [PBGQualAttr::constructor $class $this $name]
  3065.     # Start constructor user section
  3066.     # End constructor user section
  3067.     return $this
  3068. }
  3069.  
  3070. method PBGQualLinkAttr::destructor {this} {
  3071.     # Start destructor user section
  3072.     # End destructor user section
  3073. }
  3074.  
  3075. # Do not delete this line -- regeneration end marker
  3076.  
  3077. Class PBGQualLinkAttrD : {PBGQualLinkAttr OPQualLinkAttr} {
  3078. }
  3079.  
  3080. selfPromoter OPQualLinkAttr {this} {
  3081.     PBGQualLinkAttrD promote $this
  3082. }
  3083.