home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
pbtarget.tcl
< prev
next >
Wrap
Text File
|
1997-11-07
|
69KB
|
2,534 lines
#---------------------------------------------------------------------------
#
# Copyright (c) 1997 by Cayenne Software, Inc.
#
# This software is furnished under a license and may be used only in
# accordance with the terms of such license and with the inclusion of
# the above copyright notice. This software or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the software is hereby transferred.
#
# The information in this software is subject to change without notice
# and should not be construed as a commitment by Cayenne Software, Inc.
#
#---------------------------------------------------------------------------
#
# File : pbtarget.tcl
# Author :
# Original date : November 1997
# Description : Classes for code generation
#
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# File: @(#)pbaccess.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBAccess : {GCObject} {
constructor
method destructor
method generate
attribute accessRight
}
constructor PBAccess {class this i_accessRight} {
set this [GCObject::constructor $class $this]
$this accessRight $i_accessRight
# Start constructor user section
# End constructor user section
return $this
}
method PBAccess::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PBAccess::generate {this} {
return [$this accessRight]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbbuiltinp.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBBuiltinProperty : {GCObject} {
constructor
method destructor
method generate
method clone
attribute name
attribute type
attribute value
attribute where
}
global PBBuiltinProperty::InTypeDef
set PBBuiltinProperty::InTypeDef 0
global PBBuiltinProperty::InOnCreate
set PBBuiltinProperty::InOnCreate 1
constructor PBBuiltinProperty {class this i_name i_type i_value} {
set this [GCObject::constructor $class $this]
$this name $i_name
$this type $i_type
$this value $i_value
# Start constructor user section
# initialize 'where'
$this where ${PBBuiltinProperty::InTypeDef}
# End constructor user section
return $this
}
method PBBuiltinProperty::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PBBuiltinProperty::generate {this} {
if {[$this where] == ${PBBuiltinProperty::InTypeDef}} {
return "[$this type] [$this name] = [$this value]"
}
if {[$this where] == ${PBBuiltinProperty::InOnCreate}} {
return "this.[$this name] = [$this value]"
}
return ""
}
method PBBuiltinProperty::clone {this} {
return [PBBuiltinProperty new [$this name] [$this type] [$this value] \
-where [$this where]]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbclasskin.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBClassKind : {GCObject} {
constructor
method destructor
}
global PBClassKind::Window
set PBClassKind::Window "Window"
global PBClassKind::Menu
set PBClassKind::Menu "Menu"
global PBClassKind::Structure
set PBClassKind::Structure "Structure"
global PBClassKind::VCUserObject
set PBClassKind::VCUserObject "VisualCustomUserObject"
global PBClassKind::VSUserObject
set PBClassKind::VSUserObject "VisualStandardUserObject"
global PBClassKind::CCUserObject
set PBClassKind::CCUserObject "ClassCustomUserObject"
global PBClassKind::CSUserObject
set PBClassKind::CSUserObject "ClassStandardUserObject"
global PBClassKind::NotSupported
set PBClassKind::NotSupported "NotSupported"
constructor PBClassKind {class this} {
set this [GCObject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method PBClassKind::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbcookie.tcl /main/titanic/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBCookie : {GCObject} {
constructor
method destructor
}
global PBCookie::implementThisFunction
set PBCookie::implementThisFunction "// Implement this function !!"
global PBCookie::implementThisEvent
set PBCookie::implementThisEvent "// Implement this event !!"
global PBCookie::dataAttributeSection
set PBCookie::dataAttributeSection "// User defined attributes"
global PBCookie::associationAttributeSection
set PBCookie::associationAttributeSection "// Association attributes"
global PBCookie::nonModeledAttributeSection
set PBCookie::nonModeledAttributeSection "// Non modeled user defined attributes"
global PBCookie::associationAccessorMethod
set PBCookie::associationAccessorMethod "// Association accessor method"
global PBCookie::startUserSection
set PBCookie::startUserSection "// Start user code section"
global PBCookie::endUserSection
set PBCookie::endUserSection "// End user code section"
global PBCookie::startBinaryDataSection
set PBCookie::startBinaryDataSection "Start of PowerBuilder Binary Data Section : Do NOT Edit"
global PBCookie::endBinaryDataSection
set PBCookie::endBinaryDataSection "End of PowerBuilder Binary Data Section : No Source Expected After This Point"
global PBCookie::controlClassMapSection
set PBCookie::controlClassMapSection "// Control to class mappings"
constructor PBCookie {class this} {
set this [GCObject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method PBCookie::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbdefiniti.tcl /main/titanic/4
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBDefinition : {GCObject} {
constructor
method destructor
method getGlobalDefinition
method controlPresentInSupers
method libraryEntry
attribute name
attribute isGlobalType
attribute isRegenerated
attribute _libraryEntry
attribute ooplClass
}
constructor PBDefinition {class this i_name ooplClass} {
set this [GCObject::constructor $class $this]
$this isGlobalType 1
$this isRegenerated 0
$this name $i_name
$this ooplClass $ooplClass
# Start constructor user section
# End constructor user section
return $this
}
method PBDefinition::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PBDefinition::getGlobalDefinition {this} {
return $this
}
method PBDefinition::controlPresentInSupers {this name} {
set ooplClass [$this ooplClass]
if {$ooplClass == ""} {
return 0
}
# look in oopl model for the control
while {($ooplClass != "") && \
!([$ooplClass isBuiltin]) } {
if {[PBDefinition::controlPresentInSuper $ooplClass $name]} {
return 1
}
set ooplClass [$ooplClass getSuperClass]
}
return 0
}
proc PBDefinition::controlPresentInSuper {ooplClass name} {
if {($ooplClass == "") || \
([$ooplClass isBuiltin])} {
return 0
}
set assocSet [$ooplClass genAssocAttrSet]
foreach assoc $assocSet {
set oppClass [$assoc getOppositeClass]
set assocName [$assoc getName]
if {$assocName == $name} {
return 1
}
if {[PBDefinition::controlPresentInSuper $oppClass $name]} {
return 1
}
}
return 0
}
# Do not delete this line -- regeneration end marker
method PBDefinition::libraryEntry {this args} {
if {$args == ""} {
return [$this _libraryEntry]
}
set ref [$this _libraryEntry]
if {$ref != ""} {
$ref _globalDefinition ""
}
set obj [lindex $args 0]
if {$obj != ""} {
$obj _globalDefinition $this
}
$this _libraryEntry $obj
}
#---------------------------------------------------------------------------
# File: @(#)pbfeature.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBFeature : {GCObject} {
constructor
method destructor
attribute name
attribute type
}
constructor PBFeature {class this i_name type} {
set this [GCObject::constructor $class $this]
$this name $i_name
$this type $type
# Start constructor user section
# End constructor user section
return $this
}
method PBFeature::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pblibrarye.tcl /main/titanic/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBLibraryEntry : {GCObject} {
constructor
method destructor
method getName
method getKind
method getFileType
method getSrcFileType
method generate
method genExportHeader
method genExportComments
method model
method globalDefinition
attribute _model
attribute _globalDefinition
attribute exportComments
}
constructor PBLibraryEntry {class this model globalDefinition} {
set this [GCObject::constructor $class $this]
$this _model $model
[$model _libraryEntrySet] append $this
$this _globalDefinition $globalDefinition
$globalDefinition _libraryEntry $this
# Start constructor user section
$this exportComments ""
# End constructor user section
return $this
}
method PBLibraryEntry::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PBLibraryEntry::getName {this} {
return [[$this globalDefinition] name]
}
method PBLibraryEntry::getKind {this} {
return [[$this globalDefinition] getKind]
}
method PBLibraryEntry::getFileType {this} {
set kind [$this getKind]
return [PBLibraryEntry::getFileTypeByKind $kind]
}
proc PBLibraryEntry::getFileTypeByKind {kind} {
if {$kind == ${PBClassKind::Window}} {
return "window"
} elseif {$kind == ${PBClassKind::Menu}} {
return "menu"
} elseif {$kind == ${PBClassKind::Structure}} {
return "structure"
} elseif {$kind == ${PBClassKind::VCUserObject} ||
$kind == ${PBClassKind::VSUserObject} ||
$kind == ${PBClassKind::CCUserObject} ||
$kind == ${PBClassKind::CSUserObject}} {
return "userobject"
}
return ""
}
method PBLibraryEntry::getSrcFileType {this} {
set fileType [$this getFileType]
return [PBLibraryEntry::getSrcFileTypeByFileType $fileType]
}
proc PBLibraryEntry::getSrcFileTypeByFileType {fileType} {
if {$fileType == ""} {
return ""
}
return "sr[string index $fileType 0]"
}
method PBLibraryEntry::generate {this} {
set sect [TextSection new]
$this genExportHeader $sect
$this genExportComments $sect
[$this globalDefinition] generate $sect
return $sect
}
method PBLibraryEntry::genExportHeader {this sect} {
$sect append \
"\$PBExportHeader\$[$this getName].[$this getSrcFileType]\n"
}
method PBLibraryEntry::genExportComments {this sect} {
if {[$this exportComments] != ""} {
set comment [$this exportComments]
} else {
set comment "Generated by ObjectTeam"
}
$sect append "\$PBExportComments\$$comment\n"
}
# Do not delete this line -- regeneration end marker
method PBLibraryEntry::model {this args} {
if {$args == ""} {
return [$this _model]
}
set ref [$this _model]
if {$ref != ""} {
[$ref _libraryEntrySet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _libraryEntrySet] append $this
}
$this _model $obj
}
method PBLibraryEntry::globalDefinition {this args} {
if {$args == ""} {
return [$this _globalDefinition]
}
set ref [$this _globalDefinition]
if {$ref != ""} {
$ref _libraryEntry ""
}
set obj [lindex $args 0]
if {$obj != ""} {
$obj _libraryEntry $this
}
$this _globalDefinition $obj
}
#---------------------------------------------------------------------------
# File: @(#)pbmodel.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBModel : {GCObject} {
constructor
method destructor
method generate
method findLibraryEntry
method libraryEntrySet
method addLibraryEntry
method removeLibraryEntry
attribute _libraryEntrySet
}
constructor PBModel {class this} {
set this [GCObject::constructor $class $this]
$this _libraryEntrySet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method PBModel::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PBModel::generate {this TypeToClassDict} {
[$this libraryEntrySet] foreach entry {
set sectionDict [Dictionary new]
$sectionDict set [$entry getFileType] [$entry generate]
set ooplClass [[$entry globalDefinition] ooplClass]
$TypeToClassDict set $ooplClass $sectionDict
}
}
method PBModel::findLibraryEntry {this name kind} {
[$this libraryEntrySet] foreach entry {
if {[$entry getName] == $name && [$entry getKind] == $kind} {
return $entry
}
}
return ""
}
# Do not delete this line -- regeneration end marker
method PBModel::libraryEntrySet {this} {
return [$this _libraryEntrySet]
}
method PBModel::addLibraryEntry {this newLibraryEntry} {
[$this _libraryEntrySet] append $newLibraryEntry
$newLibraryEntry _model $this
}
method PBModel::removeLibraryEntry {this oldLibraryEntry} {
$oldLibraryEntry _model ""
[$this _libraryEntrySet] removeValue $oldLibraryEntry
}
#---------------------------------------------------------------------------
# File: @(#)pbmodifier.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBModifier : {GCObject} {
constructor
method destructor
method generate
attribute name
}
constructor PBModifier {class this i_name} {
set this [GCObject::constructor $class $this]
$this name $i_name
# Start constructor user section
# End constructor user section
return $this
}
method PBModifier::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PBModifier::generate {this} {
return [$this name]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbtype.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBType : {GCObject} {
constructor
method destructor
method generate
attribute name
}
constructor PBType {class this i_name} {
set this [GCObject::constructor $class $this]
$this name $i_name
# Start constructor user section
# End constructor user section
return $this
}
method PBType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PBType::generate {this} {
return [$this name]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbclass.tcl /main/titanic/11
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBClass : {PBDefinition} {
constructor
method destructor
method generate
method generateForward
method generateTypeDef
method generateInstanceVars
method generateDerivedControls
method generateControlClassMapping
method genOnCreateBody
method genOnDestroyBody
method genTypeSignature
method findObjectStructure
method findObjectFunctions
method findObjectFunction
method findUserEvent
method findScript
method findEvent
method matchObjectFunction
method matchEvent
method objectStructureSet
method addObjectStructure
method removeObjectStructure
method addInstanceVar
method removeInstanceVar
method addAssocInstanceVar
method removeAssocInstanceVar
method addSharedVar
method removeSharedVar
method addObjectFunction
method removeObjectFunction
method addUserEvent
method removeUserEvent
method addScript
method removeScript
attribute superClassName
attribute builtinSuperClassName
attribute nonModeledSharedVars
attribute _objectStructureSet
attribute instanceVarSet
attribute assocInstanceVarSet
attribute sharedVarSet
attribute objectFunctionSet
attribute userEventSet
attribute scriptSet
attribute onDestroyBody
attribute onCreateBody
attribute localExternalFuncs
attribute nonModeledInstanceVars
}
constructor PBClass {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBDefinition::constructor $class $this $i_name $ooplClass]
$this superClassName $i_superClassName
$this builtinSuperClassName $i_builtinSuperClassName
$this _objectStructureSet [List new]
$this instanceVarSet [List new]
$this assocInstanceVarSet [List new]
$this sharedVarSet [List new]
$this objectFunctionSet [List new]
$this userEventSet [List new]
$this scriptSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method PBClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBDefinition::destructor
}
method PBClass::generate {this sect} {
if [$this isGlobalType] {
# Generate forward
#
$sect append "forward\n"
$this generateForward $sect
$sect append "end forward\n\n"
# Generate object structures
#
[$this objectStructureSet] foreach struct {
$struct generate $sect
$sect append "\n"
}
# Generate shared variables
#
$sect append "shared variables\n"
$sect append "${PBCookie::dataAttributeSection}\n"
[$this sharedVarSet] foreach var {
$var generate $sect
$sect append "\n"
}
$sect append "\n${PBCookie::nonModeledAttributeSection}\n"
if {[$this nonModeledSharedVars] != ""} {
$sect appendSect [$this nonModeledSharedVars]
}
$sect append "\n"
$sect append "end variables\n\n"
}
# Generate type definition
#
$sect append "[$this genTypeSignature]\n"
$this generateTypeDef $sect
$sect append "end type\n"
if [$this isGlobalType] {
# Generate global reference variable declaration
#
$sect append "global [$this name] [$this name]\n\n"
# Generate type prototypes (i.e. local external functions)
#
if {[$this localExternalFuncs] != ""} {
$sect append "type prototypes\n"
$sect appendSect [$this localExternalFuncs]
$sect append "end prototypes\n\n"
}
# Generate instance variables
#
$sect append "type variables\n"
$this generateInstanceVars $sect
$sect append "end variables\n\n"
# Generate function prototypes
#
set defSect [TextSection new]
if ![[$this objectFunctionSet] empty] {
$sect append "forward prototypes\n"
[$this objectFunctionSet] foreach func {
$func generate $sect $defSect
$defSect append "\n"
}
$sect append "end prototypes\n\n"
}
} else {
$sect append "\n"
}
# Generate user event bodies
#
[$this userEventSet] foreach event {
$event generate $sect "eventDefinition"
$sect append "\n"
}
if [$this isGlobalType] {
# Generate function bodies
#
if {[$defSect contents] != ""} {
$sect appendSect $defSect
}
}
# Generate on create & on destroy
#
$this genOnCreateBody
set bodySect [$this onCreateBody]
if {$bodySect != "" && [$bodySect contents] != ""} {
$sect append "on [$this name].create\n"
$sect appendSect $bodySect
$sect append "end on\n\n"
}
$this genOnDestroyBody
set bodySect [$this onDestroyBody]
if {$bodySect != "" && [$bodySect contents] != ""} {
$sect append "on [$this name].destroy\n"
$sect appendSect $bodySect
$sect append "end on\n\n"
}
# Generate script bodies
#
[$this scriptSet] foreach script {
$script generate $sect "eventDefinition"
$sect append "\n"
}
if [$this isGlobalType] {
# Generate derived ControlClass creatrion bodies for
# menus and redefined events of controls defined
# in super classes
$this generateDerivedControls $sect
}
}
method PBClass::generateForward {this sect} {
$sect append "[$this genTypeSignature]\n"
$sect append "end type\n"
}
method PBClass::generateTypeDef {this sect} {
# Generate event declarations
#
[$this userEventSet] foreach event {
$event generate $sect "eventDeclaration"
$sect append "\n"
}
}
method PBClass::generateInstanceVars {this sect} {
$sect append "${PBCookie::dataAttributeSection}\n"
[$this instanceVarSet] foreach var {
$var generate $sect
$sect append "\n"
}
$sect append "\n${PBCookie::associationAttributeSection}\n"
[$this assocInstanceVarSet] foreach var {
$var generate $sect
$sect append "\n"
}
$sect append "\n${PBCookie::nonModeledAttributeSection}\n"
if {[$this nonModeledInstanceVars] != ""} {
$sect appendSect [$this nonModeledInstanceVars]
}
$sect append "\n"
$sect append "${PBCookie::controlClassMapSection}\n"
$this generateControlClassMapping $sect
}
method PBClass::generateDerivedControls {this sect} {
# Default no 'DerivedControls' part
#
}
method PBClass::generateControlClassMapping {this sect} {
set ooplClass [$this ooplClass]
if {[$this ooplClass] != ""} {
$sect append "// [$this name] --> [$ooplClass getName]\n"
}
# Generate for object structures
[$this objectStructureSet] foreach struct {
$sect append "// [$struct name] --> [[$struct ooplClass] getName]\n"
}
}
method PBClass::genOnCreateBody {this} {
# Default no 'on create' part
#
}
method PBClass::genOnDestroyBody {this} {
# Default no 'on destroy' part
#
}
method PBClass::genTypeSignature {this} {
set signature ""
if [$this isGlobalType] {
set signature "global "
}
set signature \
"${signature}type [$this name] from [$this superClassName]"
return $signature
}
method PBClass::findObjectStructure {this name} {
set name [string tolower $name]
[$this objectStructureSet] foreach struct {
if {[string tolower [$struct name]] == $name} {
return $struct
}
}
return ""
}
method PBClass::findObjectFunctions {this name} {
set list [List new]
set name [string tolower $name]
[$this objectFunctionSet] foreach func {
if {[string tolower [$func name]] == $name} {
$list append $func
}
}
return $list
}
method PBClass::findObjectFunction {this name argTypes} {
set name [string tolower $name]
[$this objectFunctionSet] foreach func {
if {[string tolower [$func name]] != $name} {
continue
}
set paramTypes [list]
[$func parameterSet] foreach param {
lappend paramTypes [string tolower [[$param type] name]]
}
if {$paramTypes == [string tolower [$argTypes contents]]} {
return $func
}
}
return ""
}
method PBClass::findUserEvent {this name} {
set name [string tolower $name]
[$this userEventSet] foreach event {
if {[string tolower [$event name]] == $name} {
return $event
}
}
return ""
}
method PBClass::findScript {this name} {
set name [string tolower $name]
[$this scriptSet] foreach script {
if {[string tolower [$script name]] == $name} {
return $script
}
}
return ""
}
method PBClass::findEvent {this name} {
set event [$this findScript $name]
if {$event == "" } {
set event [$this findUserEvent $name]
}
return $event
}
method PBClass::matchObjectFunction {this name} {
# finds a function with the same name with an empty body
# because of overloadeing the argument type (and number)
# does not have to match
set name [string tolower $name]
[$this objectFunctionSet] foreach func {
if {[string tolower [$func name]] == $name} {
if {[$func body] == ""} {
return $func
}
}
}
return ""
}
method PBClass::matchEvent {this name} {
# finds a event with the same name with an empty body
# because there is no overloading there's no need for
# finding a following match like at functions.
set name [string tolower $name]
set event [$this findEvent $name]
if {$event != ""} {
if {[$event body] == ""} {
return $event
}
}
return ""
}
# Do not delete this line -- regeneration end marker
method PBClass::objectStructureSet {this} {
return [$this _objectStructureSet]
}
method PBClass::addObjectStructure {this newObjectStructure} {
[$this _objectStructureSet] append $newObjectStructure
$newObjectStructure _theClass $this
}
method PBClass::removeObjectStructure {this oldObjectStructure} {
$oldObjectStructure _theClass ""
[$this _objectStructureSet] removeValue $oldObjectStructure
}
method PBClass::addInstanceVar {this newInstanceVar} {
[$this instanceVarSet] append $newInstanceVar
}
method PBClass::removeInstanceVar {this oldInstanceVar} {
[$this instanceVarSet] removeValue $oldInstanceVar
}
method PBClass::addAssocInstanceVar {this newAssocInstanceVar} {
[$this assocInstanceVarSet] append $newAssocInstanceVar
}
method PBClass::removeAssocInstanceVar {this oldAssocInstanceVar} {
[$this assocInstanceVarSet] removeValue $oldAssocInstanceVar
}
method PBClass::addSharedVar {this newSharedVar} {
[$this sharedVarSet] append $newSharedVar
}
method PBClass::removeSharedVar {this oldSharedVar} {
[$this sharedVarSet] removeValue $oldSharedVar
}
method PBClass::addObjectFunction {this newObjectFunction} {
[$this objectFunctionSet] append $newObjectFunction
}
method PBClass::removeObjectFunction {this oldObjectFunction} {
[$this objectFunctionSet] removeValue $oldObjectFunction
}
method PBClass::addUserEvent {this newUserEvent} {
[$this userEventSet] append $newUserEvent
}
method PBClass::removeUserEvent {this oldUserEvent} {
[$this userEventSet] removeValue $oldUserEvent
}
method PBClass::addScript {this newScript} {
[$this scriptSet] append $newScript
}
method PBClass::removeScript {this oldScript} {
[$this scriptSet] removeValue $oldScript
}
#---------------------------------------------------------------------------
# File: @(#)pbvisual.tcl /main/titanic/7
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBVisual : {PBClass} {
constructor
method destructor
method generate
method genTypeSignature
method generateTypeDef
method generateControlClassMapping
method genOnCreateBody
method genOnDestroyBody
method generateBuiltinProperties
method getGlobalDefinition
method setBuiltinProperty
method removeBuiltinProperty
method addSortedNameKey
method removeSortedNameKey
method getBuiltinProperty
attribute container
attribute sortedNameKeySet
attribute onDestroyResidue
attribute onCreateResidue
attribute builtinProperty
}
constructor PBVisual {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBClass::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
$this sortedNameKeySet [List new]
$this builtinProperty [Dictionary new]
# Start constructor user section
# End constructor user section
return $this
}
method PBVisual::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBClass::destructor
}
method PBVisual::generate {this sect} {
# If this a newly generated object, provide some default property
# settings.
#
if ![$this isRegenerated] {
set classInfo [[PBBuiltinInfo::global] \
getBuiltinClass [$this builtinSuperClassName]]
if {$classInfo != ""} {
[$classInfo mandatoryProp] foreach propName prop {
$this setBuiltinProperty $propName [$prop clone]
}
set residue [$classInfo initialOnCreateResidue]
if {$residue != ""} {
# no need to clone the TextSection here
$this onCreateResidue $residue
}
set residue [$classInfo initialOnDestroyResidue]
if {$residue != ""} {
# no need to clone the TextSection here
$this onDestroyResidue $residue
}
}
}
$this PBClass::generate $sect
}
method PBVisual::genTypeSignature {this} {
set signature [$this PBClass::genTypeSignature]
if {[$this container] != ""} {
set signature "${signature} within [[$this container] name]"
}
return $signature
}
method PBVisual::generateTypeDef {this sect} {
# Generate builtin property settings
#
$this generateBuiltinProperties $sect ${PBBuiltinProperty::InTypeDef}
$this PBClass::generateTypeDef $sect
}
method PBVisual::generateControlClassMapping {this sect} {
$this PBClass::generateControlClassMapping $sect
}
method PBVisual::genOnCreateBody {this} {
if {[$this onCreateBody] == ""} {
$this onCreateBody [TextSection new]
}
set sect [$this onCreateBody]
# Gen builtin property settings
#
$this generateBuiltinProperties $sect ${PBBuiltinProperty::InOnCreate}
$this PBClass::genOnCreateBody
if {[$this onCreateResidue] != ""} {
$sect appendSect [$this onCreateResidue]
}
}
method PBVisual::genOnDestroyBody {this} {
if {[$this onDestroyBody] == ""} {
$this onDestroyBody [TextSection new]
}
set sect [$this onDestroyBody]
$this PBClass::genOnDestroyBody
if {[$this onDestroyResidue] != ""} {
$sect appendSect [$this onDestroyResidue]
}
}
method PBVisual::generateBuiltinProperties {this sect where} {
[$this sortedNameKeySet] foreach name {
if {[[$this builtinProperty] exists $name]} {
set prop [[$this builtinProperty] set $name]
if {$prop != ""} {
if {[$prop where] == $where} {
$sect append "[$prop generate]\n"
}
}
}
}
}
method PBVisual::getGlobalDefinition {this} {
set container [$this container]
if {$container != ""} {
return [$container getGlobalDefinition]
}
return $this
}
method PBVisual::setBuiltinProperty {this name newBuiltinProperty} {
# first append key to sortedNameKeySet
set i [[$this sortedNameKeySet] search -exact $name]
if {$i >= 0} {
[$this sortedNameKeySet] remove $i
}
[$this sortedNameKeySet] append $name
[$this builtinProperty] set $name $newBuiltinProperty
}
method PBVisual::removeBuiltinProperty {this name} {
set i [[$this sortedNameKeySet] search -exact $name]
if {$i >= 0} {
[$this sortedNameKeySet] remove $i
}
[$this builtinProperty] unset $name
}
# Do not delete this line -- regeneration end marker
method PBVisual::addSortedNameKey {this newSortedNameKey} {
[$this sortedNameKeySet] append $newSortedNameKey
}
method PBVisual::removeSortedNameKey {this oldSortedNameKey} {
[$this sortedNameKeySet] removeValue $oldSortedNameKey
}
method PBVisual::getBuiltinProperty {this name} {
return [[$this builtinProperty] set $name]
}
#---------------------------------------------------------------------------
# File: @(#)pbvisualco.tcl /main/titanic/7
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBVisualContainer : {PBVisual} {
constructor
method destructor
method generate
method generateTypeDef
method generateForward
method generateInstanceVars
method generateControlClassMapping
method generateDerivedControls
method genOnCreateBody
method genOnDestroyBody
method findContainedClass
method moveContainedClass
method moveAllContainedClass
method addContainedClass
method removeContainedClass
method addSortedContainedClass
method removeSortedContainedClass
method setDerivedControlBody
method removeDerivedControlBody
method getDerivedControlBody
attribute containerArray
attribute sortedDerivedControlKeySet
attribute containedClassSet
attribute sortedContainedClassSet
attribute binaryData
attribute derivedControlBody
}
constructor PBVisualContainer {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBVisual::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
$this containerArray "Control"
$this sortedDerivedControlKeySet [List new]
$this containedClassSet [List new]
$this sortedContainedClassSet [List new]
$this derivedControlBody [Dictionary new]
# Start constructor user section
# End constructor user section
return $this
}
method PBVisualContainer::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBVisual::destructor
}
method PBVisualContainer::generate {this sect} {
# if there are any move to sorted (else they won't be generated)
$this moveAllContainedClass
$this PBVisual::generate $sect
[$this sortedContainedClassSet] foreach class {
$class generate $sect
}
if {[$this binaryData] != ""} {
$sect append "\n${PBCookie::startBinaryDataSection}\n"
$sect appendSect [$this binaryData]
$sect append ${PBCookie::endBinaryDataSection}
}
}
method PBVisualContainer::generateTypeDef {this sect} {
$this PBVisual::generateTypeDef $sect
# Generate contained object variables
#
[$this sortedContainedClassSet] foreach class {
$sect append "[$class name] [$class name]\n"
}
}
method PBVisualContainer::generateForward {this sect} {
# if there are any move to sorted (else they won't be generated)
$this moveAllContainedClass
$this PBVisual::generateForward $sect
set containedClassList [$this sortedContainedClassSet]
if [$containedClassList empty] {
return
}
$containedClassList foreach class {
$class generateForward $sect
}
if [$this isGlobalType] {
return
}
$sect append "[$this genTypeSignature]\n"
$containedClassList foreach class {
$sect append "[$class name] [$class name]\n"
}
$sect append "end type\n"
}
method PBVisualContainer::generateInstanceVars {this sect} {
$this PBVisual::generateInstanceVars $sect
}
method PBVisualContainer::generateControlClassMapping {this sect} {
$this PBVisual::generateControlClassMapping $sect
[$this sortedContainedClassSet] foreach class {
$class generateControlClassMapping $sect
}
}
method PBVisualContainer::generateDerivedControls {this sect} {
if [$this isGlobalType] {
[$this sortedDerivedControlKeySet] foreach drvCtrl {
if {[[$this derivedControlBody] exists $drvCtrl]} {
set drvCtrlBody [[$this derivedControlBody] set $drvCtrl]
if {$drvCtrlBody != ""} {
$sect appendSect $drvCtrlBody
$sect append "\n"
}
} else {
# there's a key in the sorted list, but not in the dictionary
}
}
}
}
method PBVisualContainer::genOnCreateBody {this} {
if {[$this onCreateBody] == ""} {
$this onCreateBody [TextSection new]
}
set sect [$this onCreateBody]
if {[$this superClassName] != [$this builtinSuperClassName]} {
set isDirectSubClassOfBuiltin 0
} else {
set isDirectSubClassOfBuiltin 1
}
set containedClassList [$this sortedContainedClassSet]
#if {$isDirectSubClassOfBuiltin && [$containedClassList empty]}
# do nothing
#
if {!$isDirectSubClassOfBuiltin && [$containedClassList empty]} {
set classInfo [[PBBuiltinInfo::global] \
getBuiltinClass [$this builtinSuperClassName]]
if {[$this isGlobalType] && [$classInfo isGrContainer]} {
$sect append "call [$this superClassName]::create\n"
}
} elseif {$isDirectSubClassOfBuiltin && ![$containedClassList empty]} {
$containedClassList foreach class {
$sect append "this.[$class name]=create [$class name]\n"
}
$sect append "this.[$this containerArray]\[\]=\{ "
set first 1
$containedClassList foreach class {
if !$first {
$sect append ",&\n"
} else {
set first 0
}
$sect append "this.[$class name]"
}
$sect append "\}\n"
} elseif {!$isDirectSubClassOfBuiltin && ![$containedClassList empty]} {
$sect append "int iCurrent\n"
if [$this isGlobalType] {
$sect append "call [$this superClassName]::create\n"
}
$containedClassList foreach class {
$sect append "this.[$class name]=create [$class name]\n"
}
$sect append \
"iCurrent=UpperBound(this.[$this containerArray])\n"
set i 1
$containedClassList foreach class {
$sect append "this.[$this containerArray\
]\[iCurrent+${i}\]=this.[$class name]\n"
incr i
}
}
$this PBVisual::genOnCreateBody
}
method PBVisualContainer::genOnDestroyBody {this} {
if {[$this onDestroyBody] == ""} {
$this onDestroyBody [TextSection new]
}
set sect [$this onDestroyBody]
if {[$this superClassName] != [$this builtinSuperClassName]} {
set isDirectSubClassOfBuiltin 0
} else {
set isDirectSubClassOfBuiltin 1
}
set containedClassList [$this sortedContainedClassSet]
#if {$isDirectSubClassOfBuiltin && [$containedClassList empty]}
# do nothing
#
set classInfo [[PBBuiltinInfo::global] \
getBuiltinClass [$this builtinSuperClassName]]
if {!$isDirectSubClassOfBuiltin && [$this isGlobalType] &&
[$classInfo isGrContainer]} {
$sect append "call [$this superClassName]::destroy\n"
}
$containedClassList foreach class {
$sect append "destroy(this.[$class name])\n"
}
$this PBVisual::genOnDestroyBody
}
method PBVisualContainer::findContainedClass {this name {recursive 0}} {
[$this sortedContainedClassSet] foreach class {
if {[$class name] == $name} {
return $class
}
if {$recursive && [$class isA "PBVisualContainer"]} {
set cl [$class findContainedClass $name $recursive]
if {$cl != ""} {
return $cl
}
}
}
[$this containedClassSet] foreach class {
if {[$class name] == $name} {
return $class
}
if {$recursive && [$class isA "PBVisualContainer"]} {
set cl [$class findContainedClass $name $recursive]
if {$cl != ""} {
return $cl
}
}
}
return ""
}
method PBVisualContainer::moveContainedClass {this mvContainedClass} {
[$this containedClassSet] removeValue $mvContainedClass
[$this sortedContainedClassSet] append $mvContainedClass
}
method PBVisualContainer::moveAllContainedClass {this} {
while {![[$this containedClassSet] empty]} {
set mvContainedClass [[$this containedClassSet] index 0]
[$this containedClassSet] remove 0
[$this sortedContainedClassSet] append $mvContainedClass
}
}
method PBVisualContainer::addContainedClass {this newContainedClass} {
[$this containedClassSet] append $newContainedClass
$newContainedClass container $this
}
method PBVisualContainer::removeContainedClass {this oldContainedClass} {
$oldContainedClass container ""
[$this containedClassSet] removeValue $oldContainedClass
}
method PBVisualContainer::addSortedContainedClass {this newContainedClass} {
[$this sortedContainedClassSet] append $newContainedClass
$newContainedClass container $this
}
method PBVisualContainer::removeSortedContainedClass {this oldContainedClass} {
$oldContainedClass container ""
[$this sortedContainedClassSet] removeValue $oldContainedClass
}
method PBVisualContainer::setDerivedControlBody {this derivedControl newDerivedControlBody} {
# first append key to sortedDerivedControlKeys
set i [[$this sortedDerivedControlKeySet] search -exact $derivedControl]
if {$i >= 0} {
[$this sortedDerivedControlKeySet] remove $i
}
[$this sortedDerivedControlKeySet] append $derivedControl
[$this derivedControlBody] set $derivedControl $newDerivedControlBody
}
method PBVisualContainer::removeDerivedControlBody {this derivedControl} {
set i [[$this sortedDerivedControlKeySet] search -exact $derivedControl]
if {$i >= 0} {
[$this sortedDerivedControlKeySet] remove $i
}
[$this derivedControlBody] unset $derivedControl
}
# Do not delete this line -- regeneration end marker
method PBVisualContainer::getDerivedControlBody {this derivedControl} {
return [[$this derivedControlBody] set $derivedControl]
}
#---------------------------------------------------------------------------
# File: @(#)pbmenu.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBMenu : {PBVisualContainer} {
constructor
method destructor
method genOnCreateBody
method getKind
method genDerivedMenuCreations
}
constructor PBMenu {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBVisualContainer::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
# Start constructor user section
$this containerArray "Item"
# End constructor user section
return $this
}
method PBMenu::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBVisualContainer::destructor
}
method PBMenu::genOnCreateBody {this} {
# a little hack to add all menu items of superclasses after
# regeneration
$this genDerivedMenuCreations
if {[$this onCreateBody] == ""} {
$this onCreateBody [TextSection new]
}
set sect [$this onCreateBody]
if [$this isGlobalType] {
$sect append "[$this name]=this\n"
}
$this PBVisualContainer::genOnCreateBody
}
method PBMenu::getKind {this} {
return ${PBClassKind::Menu}
}
method PBMenu::genDerivedMenuCreations {this} {
if {![$this isGlobalType]} {
return
}
# visits all superclass control and make an entry in the
# derivedControlBody section (if not already present)
set superSet [List new]
set menuSet [List new]
set ooplClass [$this ooplClass]
if {$ooplClass == ""} {
return
}
# only creation methods of supers must be generated
set ooplClass [$ooplClass getSuperClass]
# create list with most super class (not equals a builtinClass) first
while {($ooplClass != "") && \
!([$ooplClass isBuiltin]) && \
([string tolower [$ooplClass getPBClassKind]] == "menu") } {
# put in front:
$superSet insert $ooplClass
set ooplClass [$ooplClass getSuperClass]
}
set tmpList ""
$superSet foreach superClass {
set pbMenu [$superClass getName]
set tmpList2 [PBMenu::getMenuItems $pbMenu $superClass]
if {$tmpList2 != "" } {
if {$tmpList != "" } {
set tmpList [concat $tmpList $tmpList2]
} else {
set tmpList $tmpList2
}
}
}
if {$tmpList != "" } {
$menuSet contents $tmpList
}
$menuSet foreach menu {
if {![regexp {^ *([^ `]*)`([^ ]*) *$} $menu \
total className controlName] } {
continue
}
set menucreate "$controlName::create"
if {[[$this derivedControlBody] exists $menucreate]} {
# do nothing
} else {
# add
set sect [TextSection new]
$sect append "on $controlName.create\n"
# $sect append "// created by ObjectTeam\n"
$sect append "call $className`$controlName::create\n"
$sect append "this.Tag=\"\"\n"
$sect append "end on\n"
$sect append "\n"
$this setDerivedControlBody $menu $sect
}
}
}
proc PBMenu::getMenuItems {pbMenu ooplClass} {
set controlList ""
if {($ooplClass == "") || \
([$ooplClass isBuiltin]) || \
(([string length [$ooplClass getPBClassKind]] >= 4) &&
([string tolower [string range \
[$ooplClass getPBClassKind] 0 3]] != \
"menu")) } {
return ""
}
set assocSet [$ooplClass genAssocAttrSet]
foreach assoc $assocSet {
set oppClass [$assoc getOppositeClass]
set assocName "$pbMenu`[$assoc getName]"
# add to derivedControlSet
lappend controlList $assocName
set subItems [PBMenu::getMenuItems $pbMenu $oppClass]
if {$subItems != ""} {
set controlList [concat $controlList $subItems]
}
}
return $controlList
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pboperatio.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBOperation : {PBFeature} {
constructor
method destructor
method genParameterList
method genSignature
method addParameter
method removeParameter
attribute body
attribute parameterSet
}
constructor PBOperation {class this i_name type} {
set this [PBFeature::constructor $class $this $i_name $type]
$this parameterSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method PBOperation::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBFeature::destructor
}
method PBOperation::genParameterList {this} {
set sect [TextSection new]
set first 1
[$this parameterSet] foreach parameter {
if $first {
set first 0
} else {
$sect append ", "
}
$parameter generate $sect
}
return $sect
}
method PBOperation::genSignature {this} {
return "[$this name] ([[$this genParameterList] contents])"
}
# Do not delete this line -- regeneration end marker
method PBOperation::addParameter {this newParameter} {
[$this parameterSet] append $newParameter
}
method PBOperation::removeParameter {this oldParameter} {
[$this parameterSet] removeValue $oldParameter
}
#---------------------------------------------------------------------------
# File: @(#)pbwindow.tcl /main/titanic/5
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBWindow : {PBVisualContainer} {
constructor
method destructor
method generate
method genOnCreateBody
method genOnDestroyBody
method getKind
attribute menuName
}
constructor PBWindow {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBVisualContainer::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
$this menuName ""
# Start constructor user section
# End constructor user section
return $this
}
method PBWindow::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBVisualContainer::destructor
}
method PBWindow::generate {this sect} {
# add trigger for both con/destructor if open and close are present.
set openEvent [$this findEvent "open"]
set ctorEvent [$this findEvent "constructor"]
if {$openEvent != "" && $ctorEvent != ""} {
set eventsect [TextSection new]
$eventsect append "TriggerEvent (this, \"constructor\")\n"
$eventsect append "${PBCookie::startUserSection}\n"
if {[$openEvent body] != ""} {
$eventsect appendSect [$openEvent body]
}
$eventsect append "${PBCookie::endUserSection}\n"
$openEvent body $eventsect
}
set closeEvent [$this findEvent "close"]
set dtorEvent [$this findEvent "destructor"]
if {$closeEvent != "" && $dtorEvent != ""} {
set eventsect [TextSection new]
$eventsect append "TriggerEvent (this, \"destructor\")\n"
$eventsect append "${PBCookie::startUserSection}\n"
if {[$closeEvent body] != ""} {
$eventsect appendSect [$closeEvent body]
}
$eventsect append "${PBCookie::endUserSection}\n"
$closeEvent body $eventsect
}
$this PBVisualContainer::generate $sect
}
method PBWindow::genOnCreateBody {this} {
if {[$this onCreateBody] == ""} {
$this onCreateBody [TextSection new]
}
set sect [$this onCreateBody]
set menuName [$this menuName]
if {$menuName != ""} {
$sect append "if this.MenuName = \"${menuName}\" then this.MenuID = create ${menuName}\n"
}
$this PBVisualContainer::genOnCreateBody
}
method PBWindow::genOnDestroyBody {this} {
if {[$this onDestroyBody] == ""} {
$this onDestroyBody [TextSection new]
}
set sect [$this onDestroyBody]
if {[$this menuName] != ""} {
$sect append "if IsValid(MenuID) then destroy(MenuID)\n"
}
$this PBVisualContainer::genOnDestroyBody
}
method PBWindow::getKind {this} {
return ${PBClassKind::Window}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbnametype.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBNameType : {PBFeature} {
constructor
method destructor
method generate
attribute arrayDesc
}
constructor PBNameType {class this i_name type} {
set this [PBFeature::constructor $class $this $i_name $type]
$this arrayDesc ""
# Start constructor user section
# End constructor user section
return $this
}
method PBNameType::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBFeature::destructor
}
method PBNameType::generate {this sect} {
$sect append "[[$this type] generate] [$this name][$this arrayDesc]"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbparamete.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBParameter : {PBNameType} {
constructor
method destructor
method generate
attribute modifier
}
constructor PBParameter {class this i_name type modifier} {
set this [PBNameType::constructor $class $this $i_name $type]
$this modifier $modifier
# Start constructor user section
# End constructor user section
return $this
}
method PBParameter::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBNameType::destructor
}
method PBParameter::generate {this sect} {
if {[$this modifier] != ""} {
set modifier [[$this modifier] generate]
if {$modifier != ""} {
$sect append "$modifier "
}
}
$this PBNameType::generate $sect
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbclasscus.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBClassCustomUserObject : {PBClass} {
constructor
method destructor
method genTypeSignature
method genOnCreateBody
method genOnDestroyBody
method getKind
attribute isAutoInstantiate
}
constructor PBClassCustomUserObject {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBClass::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
$this isAutoInstantiate 0
# Start constructor user section
# End constructor user section
return $this
}
method PBClassCustomUserObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBClass::destructor
}
method PBClassCustomUserObject::genTypeSignature {this} {
set signature [$this PBClass::genTypeSignature]
if [$this isAutoInstantiate] {
set signature "$signature autoinstantiate"
}
return $signature
}
method PBClassCustomUserObject::genOnCreateBody {this} {
set sect [TextSection new]
$this onCreateBody $sect
$sect append "TriggerEvent( this, \"constructor\" )\n"
}
method PBClassCustomUserObject::genOnDestroyBody {this} {
set sect [TextSection new]
$this onDestroyBody $sect
$sect append "TriggerEvent( this, \"destructor\" )\n"
}
method PBClassCustomUserObject::getKind {this} {
return ${PBClassKind::CCUserObject}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbvariable.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBVariable : {PBNameType} {
constructor
method destructor
method generate
attribute defaultValue
attribute isShared
attribute isConstant
attribute access
}
constructor PBVariable {class this i_name type access} {
set this [PBNameType::constructor $class $this $i_name $type]
$this defaultValue ""
$this isShared 0
$this isConstant 0
$this access $access
# Start constructor user section
# End constructor user section
return $this
}
method PBVariable::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBNameType::destructor
}
method PBVariable::generate {this sect} {
if [$this isConstant] {
$sect append "constant "
set access [[$this access] PBAccess::generate]
} else {
set access [[$this access] generate]
}
if {![$this isShared] && $access != ""} {
$sect append "$access "
}
$this PBNameType::generate $sect
if {[$this defaultValue] != ""} {
$sect append " = [$this defaultValue]"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbfunction.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBFunction : {PBOperation} {
constructor
method destructor
method generate
attribute access
}
constructor PBFunction {class this i_name type access} {
set this [PBOperation::constructor $class $this $i_name $type]
$this access $access
# Start constructor user section
# End constructor user section
return $this
}
method PBFunction::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBOperation::destructor
}
method PBFunction::generate {this declSect defSect} {
set funcStart ""
set access [[$this access] generate]
if {$access != ""} {
set funcStart "$access "
}
set type [[$this type] generate]
if {$type != ""} {
set funcStart "${funcStart}function $type "
} else {
set funcStart "${funcStart}subroutine "
}
set funcStart "${funcStart}[$this genSignature]"
$declSect append "${funcStart}\n"
$defSect append "${funcStart};"
if {[$this body] != ""} {
$defSect appendSect [$this body]
} else {
$defSect append "${PBCookie::implementThisFunction}\n"
if {$type != ""} {
$defSect append "$type dummy\n"
$defSect append "return dummy\n"
}
}
if {$type != ""} {
$defSect append "end function\n"
} else {
$defSect append "end subroutine\n"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbevent.tcl /main/titanic/4
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBEvent : {PBOperation} {
constructor
method destructor
method genSignature
method generate
attribute extendAncestorScript
}
constructor PBEvent {class this i_name type} {
set this [PBOperation::constructor $class $this $i_name $type]
$this extendAncestorScript 0
# Start constructor user section
# End constructor user section
return $this
}
method PBEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBOperation::destructor
}
method PBEvent::genSignature {this} {
set paramList [$this parameterSet]
if ![$paramList empty] {
set firstParam [$paramList index]
set paramType [[$firstParam type] name]
if {$paramType == "eventid"} {
set paramName [$firstParam name]
return "[$this name] $paramName"
}
}
return [$this PBOperation::genSignature]
}
method PBEvent::generate {this sect what} {
if {$what == "eventDeclaration"} {
$sect append "event "
set type [[$this type] generate]
if {$type != ""} {
$sect append "type $type "
}
$sect append [$this genSignature]
} else {
# $what == "eventDefinition"
$sect append "event [$this name]\;"
if [$this extendAncestorScript] {
$sect append "call super::[$this name]\;"
}
if {[$this body] != ""} {
$sect appendSect [$this body]
} else {
$sect append "${PBCookie::implementThisEvent}\n"
set type [[$this type] generate]
if {$type != ""} {
$sect append "$type dummy\n"
$sect append "return dummy\n"
}
}
$sect append "end event\n"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbclasssta.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBClassStandardUserObject : {PBClass} {
constructor
method destructor
method genOnCreateBody
method genOnDestroyBody
method getKind
}
constructor PBClassStandardUserObject {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBClass::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
# Start constructor user section
# End constructor user section
return $this
}
method PBClassStandardUserObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBClass::destructor
}
method PBClassStandardUserObject::genOnCreateBody {this} {
set sect [TextSection new]
$this onCreateBody $sect
$sect append "call [$this builtinSuperClassName]::create\n"
$sect append "TriggerEvent( this, \"constructor\" )\n"
}
method PBClassStandardUserObject::genOnDestroyBody {this} {
set sect [TextSection new]
$this onDestroyBody $sect
$sect append "call [$this builtinSuperClassName]::destroy\n"
$sect append "TriggerEvent( this, \"destructor\" )\n"
}
method PBClassStandardUserObject::getKind {this} {
return ${PBClassKind::CSUserObject}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbstructur.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBStructure : {PBDefinition} {
constructor
method destructor
method generate
method getKind
method getGlobalDefinition
method theClass
method addField
method removeField
attribute _theClass
attribute fieldSet
}
constructor PBStructure {class this i_name ooplClass} {
set this [PBDefinition::constructor $class $this $i_name $ooplClass]
$this fieldSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method PBStructure::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBDefinition::destructor
}
method PBStructure::generate {this sect} {
if [$this isGlobalType] {
$sect append "global "
}
$sect append "type [$this name] from structure\n"
[$this fieldSet] foreach field {
$sect append "\t"
$field generate $sect
$sect append "\n"
}
$sect append "end type\n"
}
method PBStructure::getKind {this} {
return ${PBClassKind::Structure}
}
method PBStructure::getGlobalDefinition {this} {
set class [$this theClass]
if {$class != ""} {
return $class
}
return $this
}
# Do not delete this line -- regeneration end marker
method PBStructure::theClass {this args} {
if {$args == ""} {
return [$this _theClass]
}
set ref [$this _theClass]
if {$ref != ""} {
[$ref _objectStructureSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _objectStructureSet] append $this
}
$this _theClass $obj
}
method PBStructure::addField {this newField} {
[$this fieldSet] append $newField
}
method PBStructure::removeField {this oldField} {
[$this fieldSet] removeValue $oldField
}
#---------------------------------------------------------------------------
# File: @(#)pbconstruc.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBConstructor : {PBEvent} {
constructor
method destructor
method generate
attribute preBody
}
constructor PBConstructor {class this i_name type} {
set this [PBEvent::constructor $class $this $i_name $type]
# Start constructor user section
# End constructor user section
return $this
}
method PBConstructor::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBEvent::destructor
}
method PBConstructor::generate {this sect what} {
if {$what == "eventDefinition"} {
# Add cookie strings and preBody to body
#
set newBody [TextSection new]
if {[$this preBody] != ""} {
$newBody appendSect [$this preBody]
}
$newBody append "${PBCookie::startUserSection}\n"
if {[$this body] != ""} {
$newBody appendSect [$this body]
}
$newBody append "${PBCookie::endUserSection}\n"
$this body $newBody
}
$this PBEvent::generate $sect $what
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbdestruct.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBDestructor : {PBEvent} {
constructor
method destructor
method generate
attribute postBody
}
constructor PBDestructor {class this i_name type} {
set this [PBEvent::constructor $class $this $i_name $type]
# Start constructor user section
# End constructor user section
return $this
}
method PBDestructor::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBEvent::destructor
}
method PBDestructor::generate {this sect what} {
if {$what == "eventDefinition"} {
# Add cookie strings and postBody to body
#
set newBody [TextSection new]
$newBody append "${PBCookie::startUserSection}\n"
if {[$this body] != ""} {
$newBody appendSect [$this body]
}
$newBody append "${PBCookie::endUserSection}\n"
if {[$this postBody] != ""} {
$newBody appendSect [$this postBody]
}
$this body $newBody
}
$this PBEvent::generate $sect $what
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbvaracces.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBVarAccess : {PBAccess} {
constructor
method destructor
method generate
attribute readAccess
attribute writeAccess
}
constructor PBVarAccess {class this i_accessRight i_readAccess i_writeAccess} {
set this [PBAccess::constructor $class $this $i_accessRight]
$this readAccess $i_readAccess
$this writeAccess $i_writeAccess
# Start constructor user section
# End constructor user section
return $this
}
method PBVarAccess::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBAccess::destructor
}
method PBVarAccess::generate {this} {
set access [$this PBAccess::generate]
if {[$this readAccess] != ""} {
set access "${access} [$this readAccess]"
}
if {[$this writeAccess] != ""} {
set access "${access} [$this writeAccess]"
}
return [string trim $access]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbvisualcu.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBVisualCustomUserObject : {PBVisualContainer} {
constructor
method destructor
method genTypeSignature
method getKind
attribute isAutoInstantiate
}
constructor PBVisualCustomUserObject {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBVisualContainer::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
$this isAutoInstantiate 0
# Start constructor user section
# End constructor user section
return $this
}
method PBVisualCustomUserObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBVisualContainer::destructor
}
method PBVisualCustomUserObject::genTypeSignature {this} {
set signature [$this PBVisual::genTypeSignature]
if [$this isAutoInstantiate] {
set signature "$signature autoinstantiate"
}
return $signature
}
method PBVisualCustomUserObject::getKind {this} {
return ${PBClassKind::VCUserObject}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)pbvisualst.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class PBVisualStandardUserObject : {PBVisualContainer} {
constructor
method destructor
method getKind
}
constructor PBVisualStandardUserObject {class this i_name ooplClass i_superClassName i_builtinSuperClassName} {
set this [PBVisualContainer::constructor $class $this $i_name $ooplClass $i_superClassName $i_builtinSuperClassName]
# Start constructor user section
# End constructor user section
return $this
}
method PBVisualStandardUserObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this PBVisualContainer::destructor
}
method PBVisualStandardUserObject::getKind {this} {
return ${PBClassKind::VSUserObject}
}
# Do not delete this line -- regeneration end marker