?? 01ugl.tcl
字號(hào):
############################################################################### 01Ugl.tcl - Configuration Utility for the WindML Support## Copyright (C) 2000 Wind River Systems, Inc.## modification history# --------------------# 01m,19jun03,jyo Modifying to make it work with Tornado 2.2.# 01l,24apr01,jlb Add header path to created header file# 01k,20apr01,jlb Add backthe VxWorks archive# 01j,19apr01,jlb Correct build targets for new Makefiles, fixed problem with# tcl error when each page not visited (SPR 64826)# 01i,18apr01,jlb Remove VxWorks archive build and add tool selection dialog# 01h,20nov00,jlb Fixed problem when no config was defined, the keyboard was# defaulting to the first in the list, added UNICODE for Agfa# 01g,10nov00,jlb Removed event queue (SPR 35346), changed INCLUDE_UGL_BMF_UNICODE# to INCLUDE_UGL_UNICODE, validate configuration file name # for legal characters (SPR 35370)# 01f,27oct00,jlb Error dialog if Bitmap and Agfa fonts are selected# 01e,26oct00,jlb Allow build of Agfa fonts# 01d,18oct00,jlb Fix up clean warning message (SPR 35223)# Scale Agfa font configuration# 01c,29sep00,jlb Added build support for WindML demos and WindML objects# 01b,13sep00,jlb Added Agfa font engine configuration# 01a,05jul00,jlb Written################################################################################# Global Data################################################################################ set some default valuesset uglArchList {}################################################################################ Dialogs################################################################################# Main definition dialog#dialogCreate "WindML Configuration" -size 555 250 \ { \ {list "Configuration" -top 2 -left 2 -right 45 -height 80 uglConfigSelect} \ {list "Processor" -top 2 -left 52 -right 100 -height 80 uglConfigArch} \ {hsep h1 -left 0 -right 100 -top @ -width 3 -height 4} \ {list "Configuration Item" -top @ -left 30 -right 70 -height 80 uglSetConfigItem} \ {hsep h2 -left 0 -right 100 -top @ -width 3 -height 4} \ {button Save -top h2 -left 0 -right 20 uglConfigSave} \ {button Delete -top h2 -left 20 -right 40 uglConfigDelete} \ {button Build -top h2 -left 40 -right 60 uglConfigBuild} \ {button Clean -top h2 -left 60 -right 80 uglConfigClean} \ {button Quit -top h2 -left 80 -right 100 uglConfigQuit} \ }set UglConfigPageListNoAgfa {"Graphics" "Input" "Bitmap Fonts" "Audio" "Miscellaneous"}set UglConfigPageListWithAgfa {"Graphics" "Input" "Bitmap Fonts" "Agfa Fonts" "Audio" "Miscellaneous"} ## Graphics definition dialog#dialogCreate "Graphics Configuration" \ { {list Device -height 120 -top 2 -left 5 -right 50 uglGraphicsDeviceSelect} \ {list "Output Type" -height 120 -top 2 -left 60 -right 100 uglGraphicsOutputSelect} \ {hsep h1 -left 0 -right 100 -top @+20 -width 3 -height 4} \ {list "Color Depth" -height 75 -top h1 -left 5 -right 30 uglGraphicsDepthSelect } \ {list "Resolution" -height 75 -top h1 -left 40 -right 60 uglGraphicsResolutionSelect } \ {list "Refresh Rate" -height 75 -top h1 -left 70 -right 95 uglGraphicsRefreshSelect } \ {hsep h2 -left 0 -right 100 -top @ -width 3 -height 4} \ {boolean "Video" -top h2 -left 0 uglGraphicsVideoSelect} \ {boolean "JPEG" -top @ -left 0 uglGraphicsJpegSelect} \ {boolean "Double Buffer" -top @ -left 0 uglGraphicsDbuffSelect} \ {boolean "Alpha Blending" -top @ -left 0 uglGraphicsAlphaSelect } \ {boolean "Overlays" -top @ -left 0 uglGraphicsOverlaySelect } \ {boolean "Software Cursor" -top @ -left 0 uglGraphicsSwcursorSelect} \ {hsep h3 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "OK" -top h3 -left 40 -right 60 uglGraphicsOk} \ {label "" -width 0 -height 0 -top @}\ } ## Input definition dialog#dialogCreate "Input Configuration" \ { \ {list "Pointer Type" -height 80 -top 2 -left 10 -right 50 uglPointerDeviceSelect} \ {hsep h1 -left 0 -right 100 -top @ -width 3 -height 4} \ {text "Pointer Device" -top 2 -left 60 -right 95} \ {list "Keyboard Type" -height 80 -top h1 -left 10 -right 50 uglKeyboardDeviceSelect} \ {list "Keyboard Map" -height 80 -top h1 -left 60 -right 90 uglKeyboardMapSelect} \ {text "Keyboard Device" -top @ -left 10 -right 50} \ {hsep h2 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "OK" -top h2 -left 40 -right 60 uglInputOk } \ {label "" -width 0 -height 0 -top @}\ }## Bit Map Font definition dialog#dialogCreate "Bitmap Font Configuration" -size 700 400 \ { \ {boolean "Support Unicode (Multibyte Fonts)" -top 8 -left 0} \ {list "Glyph Cache Size" -top 2 -left @+40 -right 100 -height 80 uglBmGlypSize} \ {hsep h1 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "<all" -top h1+40 -left 45 -right 55 uglBmFontAllInclude} \ {button "all>" -top @+40 -left 45 -right 55 uglBmFontAllExclude} \ {list "Included Fonts" -height 250 -top h1 -left 0 -right 45 uglBmFontExclude} \ {list "Excluded Fonts" -height 250 -top h1 -left 55 -right 100 uglBmFontInclude} \ {hsep h2 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "OK" -top h2 -left 40 -right 60 uglBmFontOk } \ {label "" -width 0 -height 0 -top @}\ }## Agfa Font definition dialog#dialogCreate "Agfa Font Configuration" -size 700 400 \ { \ {text "Path" -top 2 -left 5 -right 50} \ {text "Type Path" -top 2 -left 50 -right 120} \ {text "File Name" -top 10 -left 5 -right 50} \ {text "Plugin Name" -top 10 -left 50 -right 120} \ {boolean "Support Unicode (Multibyte Fonts)" -top @ -left 0} \ {hsep h1 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "<all" -top h1+40 -left 45 -right 55 uglAgfaFontAllInclude} \ {button "all>" -top @+40 -left 45 -right 55 uglAgfaFontAllExclude} \ {list "Included Fonts" -height 220 -top h1 -left 0 -right 45 uglAgfaFontExclude} \ {list "Excluded Fonts" -height 220 -top h1 -left 55 -right 100 uglAgfaFontInclude} \ {hsep h2 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "OK" -top h2 -left 40 -right 60 uglAgfaFontOk } \ {label "" -width 0 -height 0 -top @}\ }## Audio definition dialog#dialogCreate "Audio Configuration" \ { \ {list "Type" -top 2 -left 5 -right 50 -height 80 uglAudioSelect} \ {text "Device" -top @ -left 5 -right 50} \ {text "Channel Number" -top @ -left 5 -right 50} \ {hsep h1 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "OK" -top h1 -left 40 -right 60 uglAudioOk}\ {label "" -width 0 -height 0 -top @}\ }## Miscellaneous definition dialog#dialogCreate "Miscellaneous Configuration" \ { \ {label "Build Options" -top 2 -left 0} \ {hsep h1 -left 0 -right 100 -top @ -width 3 -height 4} \ {boolean "WindML Object" -top @ -left 0 uglMiscUGLObject} \ {boolean "WindML Examples" -top @ -left 0 uglMiscUGLExample} \ {boolean "Build with debug" -top @ -left 0 uglMiscDebug} \ {hsep h2 -left 0 -right 100 -top @ -width 3 -height 4} \ {list "Build Tool" -height 80 -top h1 -left 50 -right 90 uglToolSelect} \ {label "Memory Options" -top h2+30 -left 0} \ {hsep h3 -left 0 -right 100 -top @ -width 3 -height 4} \ {boolean "VxWorks System Pool" -top h3 -left 0 uglMiscVXPool} \ {boolean "Private System Pool" -top h3 -left 50 uglMiscPrivatePool} \ {text "Private Pool Size" -top @ -left 5 -right 50} \ {hsep h4 -left 0 -right 100 -top @ -width 3 -height 4} \ {button "OK" -top h4 -left 40 -right 60 uglMiscOk } \ }## create "New configuration" dialog#dialogCreate "New Configuration" -size 200 100 \ { \ {text "Configuration:" -y 5 -left 0 -right 100 newConfigName} \ {button "Apply" -top "Configuration:" -left 10 -right 50 newConfigName} \ {button "Cancel" -top "Configuration:" -left 50 -right 90 \ {dialogUnpost "New Configuration"}} \ }## create "Gylph Cache Size" dialog#dialogCreate "Gylph Cache Size" -size 200 100 \ { \ {text "Cache Size:" -y 5 -left 0 -right 100 } \ {button "Apply" -top "Cache Size:" -left 10 -right 50 uglSetFontCacheSize} \ {button "Cancel" -top "Cache Size:" -left 50 -right 90 \ {dialogUnpost "Gylph Cache Size"}} \ }## Warning message placed in source files#set uglFileWarningMsg \"/* * This file is automatically generated from the WindML * configuration tool. Modify at your own risk. */"################################################################################# 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 ] } lappend fileList "New configuration..." dialogSetValue "WindML Configuration" "Configuration" $fileList}################################################################################## listSelectionChange - change list selection.## change current selection to new one and scroll list with new selection on top.#proc listSelectionChange {dialog dialogList newSelection} { set cs [dialogGetValue $dialog $dialogList] dialogListDeselect $dialog $dialogList $cs dialogListSelect $dialog -top $dialogList $newSelection}########################################################### uglUnpostAll - drop all windows#proc uglUnpostAll {} { dialogUnpost "Graphics Configuration" dialogUnpost "Input Configuration" dialogUnpost "Bitmap Font Configuration" dialogUnpost "Agfa Font Configuration" dialogUnpost "Audio Configuration" dialogUnpost "Miscellaneous Configuration"}###################################################################### uglReadUglDB - read the UGL data base files#proc uglReadUglDB {} { global uglDBDir global uglArchList global uglAudioAllDeviceList global uglPointerAllDeviceList global uglKeyboardAllDeviceList global uglKeyboardMapDB 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 } set uglGraphicsAllDeviceList {} set uglOutDevList {} set uglOutDevInc {} set uglAudioAllDeviceList {} set uglPointerAllDeviceList {} set uglKeyboardAllDeviceList {} set uglKeyboardMapDB(NAME) {} set uglKeyboardMapDB(SELECT) {} set uglToolAllList {} # 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) } "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 ; \ uglReadFontDir } "HEADER" { lappend uglBmFontEngineDB(HEADER) $arg} "SELECT" { set uglBmFontEngineDB(SELECT) $arg } "END" { return } } set line [gets $fd] }}###################################################################### uglReadFontDir - read font directory#proc uglReadFontDir {} { global uglBmFontEngineDB global uglHome set fontList "" # Get the list of fonts in the font directory
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -