📄 01ugl.win32.tcl
字号:
############################################################################### 01Ugl.win32.tcl - Configuration Utility for the WindML## Copyright (C) 2000 - 2003 Wind River Systems, Inc.## modification history# --------------------# 01l,18jun03,jlb Remove option to build into VxWorks archive and force# build to WindML archive# 01k,18dec00,jlb Reflect changed path names in generated uglConfig.h# 01j,21nov00,jlb Added check box for unicode on Agfa config# 01i,15nov00,jlb Fix lockup when empty config list (SPR 62296)# 01h,10nov00,jlb Removed event queue specification (SPR 35346), changed# INCLUDE_UGL_BMF_UNICODE to INCLUDE_UGL_UNICODE, fixed# lockup of graphics device selection if name changed# (SPR 35995)# 01g,27oct00,jlb Error dialog if Bitmap and Agfa fonts are selected# 01f,26oct00,jlb Allow build for Agfa fonts# 01e,16oct00,jlb Fix input type/device feilds (SPR 35178)# No clean warning for demos/ugl.o (SPR 35223)# Agfa config page present only when Agfa installed# 01d,29sep00,jlb Added build support for WindML demos and WindML objects# Clear graphics option when device changed (SPR 34461)# 01c,28sep00,jlb Added directory sensitive build for graphics# 01b,13sep00,jlb Added Agfa font engine configuration# 01a,05jul00,jlb Written### 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 uglFileWarningMsg \"/* * This file is automatically generated from the WindML * configuration tool. Modify at your own risk. */"## Main window definition#set UglConfigControls { {label -title "Configuration File:" -x 5 -y 5 -w 70 -h 9} {combo -name uglFileList -sort -x 65 -y 5 -w 80 -h 65 -callback uglConfigSelect -editable} {label -title "Processor:" -x 150 -y 5 -w 50 -h 9} {combo -name uglArchList -x 190 -y 5 -w 80 -h 65 -callback uglSelectArch} {frame -gray -x 2 -y 28 -w 296 -h 200} {label -title " Configuration Item " -x 25 -y 25 -w 100 -h 9} {label -title " " -x 100 -y 25 -w 100 -h 9} {combo -name uglConfigItem -x 110 -y 25 -w 80 -h 100 -callback uglSetConfigItem} {button -name save -title Save -x 5 -y 230 -w 40 -h 15 -callback uglConfigSave} {button -name delete -title Delete -x 61 -y 230 -w 40 -h 15 -callback uglConfigDelete} {button -name build -title Build -x 117 -y 230 -w 40 -h 15 -callback uglConfigBuild} {button -name clean -title Clean -x 173 -y 230 -w 40 -h 15 -callback uglConfigClean} {button -name quit -title Quit -x 230 -y 230 -w 40 -h 15 -callback uglExit} }## Graphics window definition#set UglConfigPage(0) { {label -name graphicsDevice -title "Driver for Device:" -x 10 -y 50 -w 100 -h 9} {combo -name chipList -x 100 -y 50 -w 110 -h 65 -callback uglGraphicsChipSelect} {frame -black -name graphicsFrame -x 5 -y 65 -w 290 -h 155} {label -name graphicsOutput -title "Output Type:" -x 10 -y 90 -w 50 -h 9} {combo -name outputDevList -x 60 -y 90 -w 140 -h 65} {label -name graphicsColor -title "Color depth:" -x 10 -y 105 -w 50 -h 9} {combo -name colorDepthList -x 60 -y 105 -w 30 -h 65 -callback uglGraphicsDepthSelect} {label -name graphicsRes -title "Resolution:" -x 95 -y 105 -w 50 -h 9} {combo -name resolutionList -x 135 -y 105 -w 55 -h 65 -callback uglGraphicsResolutionSelect} {label -name graphicsRefresh -title "Refresh rate:" -x 200 -y 105 -w 50 -h 9} {combo -name refreshList -x 245 -y 105 -w 40 -h 65 -callback uglGraphicsRefreshSelect} {boolean -name bVideo -auto -title "Video" -x 20 -y 125 -w 90 -h 15} {boolean -name bJpeg -auto -title "JPEG" -x 20 -y 140 -w 90 -h 15} {boolean -name bdBuffer -auto -title "Double Buffer" -x 20 -y 155 -w 90 -h 15} {boolean -name baBlend -auto -title "Alpha Blending" -x 20 -y 170 -w 90 -h 15} {boolean -name boverlay -auto -title "Overlays" -x 20 -y 185 -w 90 -h 15} {boolean -name bswCursor -auto -title "Software Cursor" -x 20 -y 200 -w 90 -h 15} }set UglConfigPageName(0) "Graphics"set UglConfigItemName(0) {graphicsDevice chipList graphicsFrame graphicsOutput outputDevList graphicsColor colorDepthList graphicsRes resolutionList graphicsRefresh refreshList bVideo bJpeg bdBuffer baBlend boverlay bswCursor}## Input definition dialog #set UglConfigPage(1) { {label -name lPtrLabel -title "Pointer Configuration" -x 10 -y 50 -w 100 -h 9} {frame -name fPtr -black -x 5 -y 60 -w 290 -h 45} {label -name lPtrType -title "Type:" -x 10 -y 65 -w 50 -h 9} {combo -name mouseList -x 60 -y 65 -w 150 -h 65 -callback uglPointerSelect} {label -name lptrDevice -title "Device Name:" -x 10 -y 85 -w 80 -h 9} {text -name ptrDevice -x 60 -y 85 -w 100 -h 12} {label -name lKbdCfg -title "Keyboard Configuration" -x 10 -y 115 -w 100 -h 9} {frame -name fKbd -black -x 5 -y 125 -w 290 -h 45} {label -name lKbdType -title "Type:" -x 10 -y 130 -w 50 -h 9} {combo -name keyboardList -x 60 -y 130 -w 80 -h 65 -callback uglKeyboardSelect} {label -name lKbdMap -title "Key map:" -x 160 -y 130 -w 50 -h 9} {combo -name keyMapList -x 200 -y 130 -w 80 -h 65} {label -name lKbdDevice -title "Device Name:" -x 10 -y 150 -w 80 -h 9} {text -name kbdDevice -x 60 -y 150 -w 100 -h 12} }set UglConfigPageName(1) "Input"set UglConfigItemName(1) {lPtrLabel fPtr lPtrType mouseList lptrDevice ptrDevice lKbdCfg fKbd lKbdType keyboardList lKbdMap keyMapList lKbdDevice kbdDevice}## Bitmap Font definition#set UglConfigPage(2) { {frame -name fBmFonts -black -x 5 -y 75 -w 290 -h 130} {boolean -name bUnicode -auto -title "Support Unicode(multi-byte)" -x 10 -y 45 -w 100 -h 9} {label -name lbmFontSize -title "Glyph Cache Size:" -x 120 -y 45 -w 80 -h 9} {combo -name bmFontSize -x 180 -y 45 -w 100 -h 65 -editable} {label -name lIncBmFonts -title "Included Fonts" -x 12 -y 80 -w 100 -h 9} {label -name lExcBmFonts -title "Excluded Fonts" -x 172 -y 80 -w 100 -h 9} {list -name bmFontInList -multisel -sort -x 10 -y 90 -w 120 -h 115} {list -name bmFontExList -multisel -sort -x 170 -y 90 -w 120 -h 115} {button -name bmfFontIncButton -title "<" -x 140 -y 100 -w 20 -h 12 -callback uglFontInclude} {button -name bmFontIncAllButton -title "<all" -x 140 -y 125 -w 20 -h 12 -callback uglFontIncludeAll} {button -name bmFontExcButton -title ">" -x 140 -y 150 -w 20 -h 12 -callback uglFontExclude} {button -name bmFontExcAllButton -title "all>" -x 140 -y 175 -w 20 -h 12 -callback uglFontExcludeAll} }set UglConfigPageName(2) "UGL Bitmap Fonts"set UglConfigItemName(2) {fBmFonts bUnicode lbmFontSize bmFontSize lIncBmFonts lExcBmFonts bmFontInList bmFontExList bmfFontIncButton bmFontIncAllButton bmFontExcButton bmFontExcAllButton }## Audio definition#set UglConfigPage(3) { {frame -name fAudio -black -x 5 -y 50 -w 290 -h 155} {label -name lAudioType -title "Type:" -x 10 -y 70 -w 80 -h 9} {combo -name audioList -x 80 -y 70 -w 80 -h 65 -callback uglAudioSelect} {label -name lAudioDevice -title "Device Name:" -x 10 -y 90 -w 80 -h 9} {text -name audioDevice -x 80 -y 90 -w 50 -h 12} {label -name lAudioChan -title "Channel Number:" -x 10 -y 110 -w 80 -h 9} {text -name audioChan -x 80 -y 110 -w 20 -h 12} }set UglConfigPageName(3) "Audio"set UglConfigItemName(3) {fAudio lAudioType audioList lAudioDevice audioDevice lAudioChan audioChan }## Miscellaneaous controls## {combo -name toolList -x 110 -y 120 -w 80 -h 65}set UglConfigPage(4) { {frame -black -name buildFrame -x 10 -y 65 -w 280 -h 75} {label -name buildLabel -title "Build Options" -x 20 -y 55 -w 80 -h 9} {boolean -name uglO -auto -title "Build WindML object" -x 15 -y 70 -w 90 -h 15} {boolean -name bDemo -auto -title "Build Examples Programs" -x 110 -y 70 -w 100 -h 15} {boolean -name bDebug -auto -title "Build with debug" -x 110 -y 85 -w 90 -h 15} {label -name ltoolList -title "Tool Selection:" -x 20 -y 120 -w 100 -h 10} {combo -name toolList -x 110 -y 120 -w 80 -h 65 -callback uglToolSelect} {frame -black -name memoryFrame -x 10 -y 155 -w 280 -h 35} {label -name memOptLabel -title "Memory Options" -x 15 -y 145 -w 80 -h 9} {choice -name cVxPool -auto -newgroup -title "VxWorks System Pool" -x 15 -y 160 -w 90 -h 15} {choice -name cUglPool -auto -title "Private Memory Pool" -x 110 -y 160 -w 90 -h 15} {label -name lmemPool -title "Memory Pool Size (Kbyte):" -x 20 -y 175 -w 100 -h 9} {text -name memPool -x 110 -y 175 -w 30 -h 12} }set UglConfigPageName(4) "Miscellaneous"set UglConfigItemName(4) {buildFrame buildLabel uglO bDemo bDebug ltoolList toolList memoryFrame memOptLabel cVxPool cUglPool lmemPool memPool }## Agfa Font definition#set UglConfigPage(5) { {frame -name fAgfaFonts -black -x 5 -y 90 -w 290 -h 130} {boolean -name bAfUnicode -auto -title "Support Unicode(multi-byte)" -x 10 -y 40 -w 100 -h 9} {label -name lagfaFontPath -title "Path:" -x 10 -y 55 -w 80 -h 9} {text -name agfaFontPath -x 50 -y 55 -w 95 -h 12} {label -name lagfaFontTypePath -title "Type Path:" -x 10 -y 75 -w 80 -h 9} {text -name agfaFontTypePath -x 50 -y 75 -w 95 -h 12} {label -name lagfaFontFilename -title "File name:" -x 150 -y 55 -w 80 -h 9} {text -name agfaFontFilename -x 195 -y 55 -w 95 -h 12} {label -name lagfaFontPluginName -title "Plugin name:" -x 150 -y 75 -w 80 -h 9} {text -name agfaFontPluginName -x 195 -y 75 -w 95 -h 12} {label -name lIncAgfaFonts -title "Included Fonts" -x 12 -y 95 -w 100 -h 9} {label -name lExcAgfaFonts -title "Excluded Fonts" -x 172 -y 95 -w 100 -h 9} {list -name agfaFontInList -multisel -sort -x 10 -y 105 -w 120 -h 115} {list -name agfaFontExList -multisel -sort -x 170 -y 105 -w 120 -h 115} {button -name agfafFontIncButton -title "<" -x 140 -y 115 -w 20 -h 12 -callback uglAgfaFontInclude} {button -name agfaFontIncAllButton -title "<all" -x 140 -y 140 -w 20 -h 12 -callback uglAgfaFontIncludeAll} {button -name agfaFontExcButton -title ">" -x 140 -y 165 -w 20 -h 12 -callback uglAgfaFontExclude} {button -name agfaFontExcAllButton -title "all>" -x 140 -y 190 -w 20 -h 12 -callback uglAgfaFontExcludeAll} }set UglConfigPageName(5) "Agfa Fonts"set UglConfigItemName(5) {fAgfaFonts bAfUnicode lagfaFontPath agfaFontPath lagfaFontTypePath agfaFontTypePath lagfaFontFilename agfaFontFilename lagfaFontPluginName agfaFontPluginName lIncAgfaFonts lExcAgfaFonts agfaFontInList agfaFontExList agfafFontIncButton agfaFontIncAllButton agfaFontExcButton agfaFontExcAllButton }set UglConfigPageListWithAgfa [list 0 1 2 5 3 4 ]set UglConfigPageListNoAgfa [list 0 1 2 3 4 ]set UglConfigPageList {}# set some default valuesset uglLoadNewConfig 0set uglConfigChange 0set uglAudioAllDeviceList {}set uglPointerAllDeviceList {} set uglKeyboardAllDeviceList {}set uglKeyboardMapDB(NAME) {}set uglKeyboardMapDB(SELECT) {}set uglArchList {}set uglOutDevList {}set uglOutDevInc {}set uglGraphicsAllDeviceList {}set uglToolAllList {}set uglAgfaConfig(FONTPATH) ""set uglAgfaConfig(TYPEPATH) ""set uglAgfaConfig(FILENAME) "" set uglAgfaConfig(PLUGINNAME) ""################################################################################# PROCEDURES###################################################################################################################################################### uglSetFileList - set names of configuration files#proc uglSetFileList {} { global uglConfigToolDir set fileList "" set tmpFileList [glob -nocomplain $uglConfigToolDir/*.cfg] foreach file $tmpFileList { regsub -all -nocase $uglConfigToolDir/ $file {} filecfg lappend fileList [ file rootname $filecfg ] } controlValuesSet UglConfig.uglFileList $fileList}###################################################################### uglReadUglDB - read the UGL data base files#proc uglReadUglDB {} { global uglDBDir global uglArchList global uglAudioAllDeviceList global uglPointerAllDeviceList global uglKeyboardAllDeviceList global uglKeyboardMapDB global uglArchList global uglOutDevList global uglOutDevInc global uglGraphicsAllDeviceList global uglToolAllList # Only read data base if not already read set listLength [expr [llength $uglArchList]] if {$listLength != 0} { return } # Get the list of fonts in the font directory set tmpFileList [glob -nocomplain $uglDBDir/*.cfg] foreach file $tmpFileList { set fd [open $file r] set uglDBstate 0 set line [gets $fd] while {![eof $fd]} { switch [lrange $line 0 1] { "## ARCHITECTURE" { set uglDBstate 1; set line [gets $fd] } "## GRAPHICS" { set uglDBstate 2; set line [gets $fd] } "## OUTPUT" { set uglDBstate 3; set line [gets $fd] } "## KMAP" { set uglDBstate 4; set line [gets $fd] } "## POINTER" { set uglDBstate 5; set line [gets $fd] } "## KEYBOARD" { set uglDBstate 6; set line [gets $fd] } "## FONTS" { set uglDBstate 7; set line [gets $fd] } "## AUDIO" { set uglDBstate 8; set line [gets $fd] } "## AGFA" { set uglDBstate 9; set line [gets $fd] } "## TOOLS" { set uglDBstate 10; set line [gets $fd] } "" { set line [gets $fd]; continue } } set comment [lrange $line 0 1] if {[string index $comment 0] == "#"} { set line [gets $fd] continue } switch $uglDBstate { 1 { lappend uglArchList $line } 2 { uglAddGraphicsDevice $line $fd} 3 { uglAddOutputDevice $line } 4 { uglAddKeyboardMap $line $fd} 5 { uglAddPointerDevice $line $fd} 6 { uglAddKeyboardDevice $line $fd} 7 { uglAddBmFontEngine $line $fd } 8 { uglAddAudioDevice $line $fd } 9 { uglAddAgfaFontEngine $line $fd } 10 { uglAddTool $line $fd } } set line [gets $fd] } close $fd }}###################################################################### uglAddAgfaFontEngine - add the Agfa font engine#proc uglAddAgfaFontEngine {line fd} { global uglAgfaFontEngineDB set uglAgfaFontEngineDB(FONTTYPE) {} set line [gets $fd] while {![eof $fd]} { set arg [lrange $line 1 end] switch [lindex $line 0] { "PATH" { set uglAgfaFontEngineDB(PATH) $arg } "HEADER" { lappend uglAgfaFontEngineDB(HEADER) $arg} "SELECT" { set uglAgfaFontEngineDB(SELECT) $arg } "TYPE" { lappend uglAgfaFontEngineDB(FONTTYPE) $arg} "END" { return } } set line [gets $fd] }}###################################################################### uglAddBmFontEngine - add the BMF font engine#proc uglAddBmFontEngine {line fd} { global uglBmFontEngineDB set line [gets $fd] while {![eof $fd]} { set arg [lrange $line 1 end] switch [lindex $line 0] { "PATH" { set uglBmFontEngineDB(PATH) $arg ; \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -