📄 01zinc.win32.tcl
字号:
# 01Zinc.win32.tcl - Zinc Tcl initialization file## Copyright (C) 1999- 2003 Wind River Systems, Inc.## modification history# -----------------------# 01j,19jun03,jlb Removed build to vxWorks archive# 01i,19jul01,wdf Made change to elimnate warning from StrongArm compiler.# 01h,29may01,wdf Udated configurator script.# 01g,21dec00,wdf Fixed problem with clean not cleaning the correct# directory.# 01f,20dec00,jlb Added Zinc config tool launch button# 01e,13dec00,wdf Fixed SPR# 36067, 36064, and 62158.# 01d,20oct00,wdf Removed extra items from architecture list.# 01c,11aug00,wdf Changed CONFIG_TOOL to ZINC_CONFIG_TOOL.# 01b,20jul00,wdf Added configuration.# 01a,31oct98,dmm Menu integration for the Zinc Designer### Generic stuff## Be sure we can open the support utility DLL.if [catch {dllLoad [wtxPath host [wtxHostType] bin]SupportTcl.dll} supportDll] { messageBox "Can't find supportTcl.dll"}## Warning message placed in generated source files#set zincFileWarningMsg \"/* * This file is automatically generated from the Zinc * configuration tool. Modify at your own risk. */"## Main window definition#set ZincConfigControls { {label -title "Configuration File:" -x 5 -y 5 -w 70 -h 9} {combo -name zincFileList -sort -x 65 -y 5 -w 80 -h 65 -callback zincConfigSelect -editable} {label -title "Processor:" -x 150 -y 5 -w 50 -h 9} {combo -name zincArchList -x 190 -y 5 -w 80 -h 65 -callback zincSelectArch} {frame -gray -x 2 -y 28 -w 301 -h 170} {label -title " Configuration Item " -x 25 -y 25 -w 100 -h 9} {label -title " " -x 100 -y 25 -w 100 -h 9} {combo -name zincConfigItem -x 110 -y 25 -w 85 -h 70 -callback zincSetConfigItem} {button -name zincSave -title Save -x 5 -y 205 -w 45 -h 15 -callback zincConfigSave} {button -name zincDelete -title Delete -x 55 -y 205 -w 45 -h 15 -callback zincConfigDelete} {button -name zincBuild -title Build -x 105 -y 205 -w 45 -h 15 -callback zincConfigBuild} {button -name zincBuildClean -title "Build Clean" -x 155 -y 205 -w 45 -h 15 -callback zincConfigBuildClean} {button -name zincClean -title Clean -x 205 -y 205 -w 45 -h 15 -callback zincConfigClean} {button -name zincQuit -title Quit -x 255 -y 205 -w 45 -h 15 -callback zincExit} }## Confiruration Option#set ZincConfigPage(0) { {boolean -name zincUnicode -auto -title "Unicode" -x 15 -y 40 -w 140 -h 15} {boolean -name zincCodeSet -auto -title "Code Set Data (required for Unicode)" -x 15 -y 55 -w 140 -h 15} {boolean -name zincError -auto -title "Error System" -x 15 -y 70 -w 140 -h 15} {boolean -name zincHelpTips -auto -title "Help Tips" -x 15 -y 85 -w 140 -h 15} {boolean -name zincKeyboard -auto -title "Keyboard" -x 15 -y 100 -w 140 -h 15} {boolean -name zincMouse -auto -title "Mouse" -x 15 -y 115 -w 140 -h 15} {boolean -name zincSearchPath -auto -title "Search Path" -x 15 -y 130 -w 140 -h 15} {boolean -name zincPersist -auto -title "Persistence" -x 15 -y 145 -w 140 -h 15 -callback zincDisableReadWrite} {boolean -name zincRead -auto -title "Read" -x 30 -y 160 -w 140 -h 15} {boolean -name zincWrite -auto -title "Write" -x 30 -y 175 -w 140 -h 15} }set ZincConfigPageName(0) "Configuration Options"set ZincConfigItemName(0) {zincUnicode zincCodeSet zincError zincHelpTips zincKeyboard zincMouse zincSearchPath zincPersist zincRead zincWrite}## Build Options#set ZincConfigPage(1) { {frame -black -name zincBuildFrame -x 10 -y 50 -w 285 -h 70} {label -name zincBuildLabel -title "Build Options" -x 20 -y 40 -w 80 -h 9} {boolean -name zincDebug -auto -title "Build with debug" -x 20 -y 55 -w 90 -h 15} {label -name titleToolList -title "Tool Selection:" -x 20 -y 90 -w 100 -h 10} {combo -name zincToolList -x 110 -y 90 -w 80 -h 65} }set ZincConfigPageName(1) "Build Options"set ZincConfigItemName(1) {zincBuildFrame zincBuildLabel zincDebug titleToolList zincToolList}set ZincConfigPageList [list 0 1]# set some default valuesset zincLoadNewConfig 0set zincConfigChange 0set zincArchList {}set zincToolAllList {}################################################################################# PROCEDURES################################################################################proc zincInitUI {} { controlCreate launch [list toolbarbutton \ -callback "launchZinc" \ -name zinc \ -tooltip "Launch Zinc Designer" \ -bitmap "[wtxPath host resource bitmaps launch controls]zinc.bmp"] menuItemInsert -statusmessage "Launch Zinc Designer" \ -callback {launchZinc} \ -after -bypath \ {&Tools &Debugger...} "&Zinc Designer" controlCreate launch [list toolbarbutton \ -callback "zincInit" \ -name zinccfg \ -tooltip "Launch Zinc Configuration Tool" \ -bitmap "[wtxPath host resource bitmaps launch controls]zinccfg.bmp"] menuItemInsert -bypath -name zincMenuItem \ -after -callback {zincInit} {"&Tools" "Su&pport..."} \ "Zinc..."} proc launchZinc {args} { toolLaunch "Zinc" "[wtxPath host x86-win32 bin]zdesign.exe" "[wtxPath host x86-win32 bin]" 0 0 0 0 0 0}zincInitUI################################################################################ 01Zinc.win32.tcl - Initialization## This code is executed when Zinc is added to the Tornado # tool set at start time.##zincInitUI###################################################################### zincAddNewTool - add slot for a new build tool in data base#proc zincAddNewTool {zToolName} { global zincToolDB global zincToolAllList if { [lsearch $zincToolAllList $zToolName] == -1 } { lappend zincToolAllList $zToolName set zincToolDB($zToolName,ARCH) {} set zincToolDB($zToolName,TOOL) "" }}###################################################################### zincAddTool - add a WindML build tool #proc zincAddTool {line fd} { global zincToolDB global zincToolAllList global zincConfigMisc set zToolName "" set line [gets $fd] while {![eof $fd]} { set arg [lrange $line 1 end] switch [lindex $line 0] { "NAME" { set zToolName $arg; zincAddNewTool $zToolName } "ARCH" { lappend zincToolDB($zToolName,ARCH) $arg } "TOOL" { set zincToolDB($zToolName,TOOL) $arg } "END" { set zincConfigMisc(BUILD_TOOL) [lindex $zincToolAllList 0]; return } } set line [gets $fd] }}###################################################################### zincReadUglDB - read the UGL data base files#proc zincReadUglDB {} { global zincDBDir global zincArchList global zincToolAllList # Only read data base if not already read set listLength [expr [llength $zincArchList]] if {$listLength != 0} { return } # Get the list of fonts in the font directory set tmpFileList [glob -nocomplain $zincDBDir/*.cfg] foreach file $tmpFileList { set fd [open $file r] set zincDBstate 0 set line [gets $fd] while {![eof $fd]} { switch [lrange $line 0 1] { "## ARCHITECTURE" { set zincDBstate 1; set line [gets $fd] } "## TOOLS" { set zincDBstate 2; set line [gets $fd] } "## GRAPHICS" { set zincDBstate 0; set line [gets $fd]; continue } "## OUTPUT" { set zincDBstate 0; set line [gets $fd]; continue } "## KMAP" { set zincDBstate 0; set line [gets $fd]; continue } "## POINTER" { set zincDBstate 0; set line [gets $fd]; continue } "## KEYBOARD" { set zincDBstate 0; set line [gets $fd]; continue } "## FONTS" { set zincDBstate 0; set line [gets $fd]; continue } "## AUDIO" { set zincDBstate 0; set line [gets $fd]; continue } "## AGFA" { set zincDBstate 0; set line [gets $fd]; continue } "" { set line [gets $fd]; continue } } set comment [lrange $line 0 1] if {[string index $comment 0] == "#" || $zincDBstate == 0} { set line [gets $fd] continue } if {$zincDBstate == 1} { set archType [split $line - ] set bspCnt [llength $archType] if {$bspCnt == 1} { lappend zincArchList $line } } else { zincAddTool $line $fd } set line [gets $fd] } close $fd }}###################################################################### zincSetFileList - set names of configuration files#proc zincSetFileList {} { global zincConfigDir set fileList "" set tmpFileList [glob -nocomplain $zincConfigDir/*.cfg] foreach file $tmpFileList { regsub -all -nocase $zincConfigDir/ $file {} filecfg lappend fileList [ file rootname $filecfg ] } controlValuesSet ZincConfig.zincFileList $fileList}###################################################################### zincSetConfigItem - launch the graphics definition window#proc zincSetConfigItem {args} { # get the event set event [controlEventGet ZincConfig.zincConfigItem] if {$event == "dropdown"} { return } # configuration/processor defined open window beginWaitCursor # get the selected item set configItem [controlSelectionGet ZincConfig.zincConfigItem] # display the new page zincBuildConfigScreen $configItem endWaitCursor}###################################################################### zincCompileConfig - set up configuration for Compile options.#proc zincCompileConfig {} { global zincConfigCompile controlCheckSet ZincConfig.zincUnicode $zincConfigCompile(ZINC_UNICODE) controlCheckSet ZincConfig.zincCodeSet $zincConfigCompile(ZINC_CODE_SET) controlCheckSet ZincConfig.zincError $zincConfigCompile(ZINC_ERROR_SYS) controlCheckSet ZincConfig.zincHelpTips $zincConfigCompile(ZINC_HELP_TIPS) controlCheckSet ZincConfig.zincKeyboard $zincConfigCompile(ZINC_KEYBOARD) controlCheckSet ZincConfig.zincMouse $zincConfigCompile(ZINC_MOUSE) controlCheckSet ZincConfig.zincSearchPath $zincConfigCompile(ZINC_SEARCH_PATH) controlCheckSet ZincConfig.zincPersist $zincConfigCompile(ZINC_PERSIST) controlCheckSet ZincConfig.zincRead $zincConfigCompile(ZINC_READ) controlCheckSet ZincConfig.zincWrite $zincConfigCompile(ZINC_WRITE) # Enable or Disable the Read and Write checkboxes. zincDisableReadWrite}###################################################################### zincCompileConfig - set up configuration for Compile options.#proc zincCompileCheck {} { global zincConfigCompile global zincConfigChange if { $zincConfigCompile(ZINC_UNICODE) != [controlChecked ZincConfig.zincUnicode] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_CODE_SET) != [controlChecked ZincConfig.zincCodeSet] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_ERROR_SYS) != [controlChecked ZincConfig.zincError] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_HELP_TIPS) != [controlChecked ZincConfig.zincHelpTips] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_KEYBOARD) != [controlChecked ZincConfig.zincKeyboard] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_MOUSE) != [controlChecked ZincConfig.zincMouse] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_SEARCH_PATH) != [controlChecked ZincConfig.zincSearchPath] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_PERSIST) != [controlChecked ZincConfig.zincPersist] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_READ) != [controlChecked ZincConfig.zincRead] } { set zincConfigChange 1 } if { $zincConfigCompile(ZINC_WRITE) != [controlChecked ZincConfig.zincWrite] } { set zincConfigChange 1 }}###################################################################### zincMiscConfig - set up configuration for Compile options.#proc zincMiscConfig {} { global zincConfigMisc global zincToolDB global zincArchType global zincOldArchType global zincToolAllList controlCheckSet ZincConfig.zincDebug $zincConfigMisc(DEBUG_BUILD)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -