?? 01zinc.tcl
字號:
global env # Write out file configuration to config.h file set fd [open $zincConfigDir/zinccnfg.h w] puts $fd "/* zinccnfg.h - Zinc configuration header file */" puts $fd $zincFileWarningMsg puts $fd [format "/* File created %s from %s */" $dateInfo $configname] puts $fd "" puts $fd "/*" puts $fd " * Because some defines may be prevously defined in z_env.hpp " puts $fd " * most must be undefined." puts $fd "*/" # Generate needed #defines. puts $fd "#undef ZAF_ISO8859_1" puts $fd "#undef ZAF_UNICODE" if {$zincConfigCompile(ZINC_UNICODE) != 0} { puts $fd "#define ZAF_UNICODE" } else { puts $fd "#define ZAF_ISO8859_1" } puts $fd "" puts $fd "#undef USE_ZAF_CODE_SET_DATA" if {$zincConfigCompile(ZINC_CODE_SET) != 0} { puts $fd "#define USE_ZAF_CODE_SET_DATA" } puts $fd "" puts $fd "#undef USE_ZAF_ERROR_SYSTEM" if {$zincConfigCompile(ZINC_ERROR_SYS) != 0} { puts $fd "#define USE_ZAF_ERROR_SYSTEM" } puts $fd "" puts $fd "#undef USE_ZAF_HELP_TIPS" if {$zincConfigCompile(ZINC_HELP_TIPS) != 0} { puts $fd "#define USE_ZAF_HELP_TIPS" } puts $fd "" puts $fd "#undef USE_ZAF_KEYBOARD" if {$zincConfigCompile(ZINC_KEYBOARD) != 0} { puts $fd "#define USE_ZAF_KEYBOARD" } puts $fd "" puts $fd "#undef USE_ZAF_MOUSE" if {$zincConfigCompile(ZINC_MOUSE) != 0} { puts $fd "#define USE_ZAF_MOUSE" } puts $fd "" puts $fd "#undef USE_ZAF_SEARCH_PATH" if {$zincConfigCompile(ZINC_SEARCH_PATH) != 0} { puts $fd "#define USE_ZAF_SEARCH_PATH" } puts $fd "" puts $fd "#undef USE_ZAF_PERSISTENCE" if {$zincConfigCompile(ZINC_PERSIST) != 0} { puts $fd "#define USE_ZAF_PERSISTENCE" } if {$zincConfigCompile(ZINC_PERSIST) == 0 || $zincConfigCompile(ZINC_READ) == 0} { puts $fd "#define EXCLUDE_ZAF_READ" } if {$zincConfigCompile(ZINC_PERSIST) == 0 || $zincConfigCompile(ZINC_WRITE) == 0} { puts $fd "#define EXCLUDE_ZAF_WRITE" } puts $fd "" # Make sure ZAF_ITEXT is definded correctly. puts $fd "/* Make sure ZAF_ITEXT is defined correctly. */" puts $fd "#undef ZAF_ITEXT" puts $fd "#if defined(ZAF_UNICODE)" puts $fd "# define ZAF_ITEXT(x) L ## x" puts $fd "#else" puts $fd "# define ZAF_ITEXT(x) x" puts $fd "#endif" close $fd}###################################################################### zincConfigSave - save a configuration#proc zincConfigSave {} { global zincConfigList global zincArchType global zincConfigDir global zincConfigChange global zincConfigMisc global zincConfigCompile set configname [dialogGetValue "Zinc Configuration" "Configuration"] set zincConfig(ARCH) [dialogGetValue "Zinc Configuration" "Processor"] if {$configname == ""} { messageBox "Need to specify a configuation file" return } set fd [open $zincConfigDir/$configname.cfg w] set dateInfo [exec date] set fstr "%-30s : %s" puts $fd "# DO NOT MODIFY THIS FILE - GENERATED AUTOMATICALLY" puts $fd [format "# File: %s.cfg" $configname] puts $fd [format "# Creation date: %s" $dateInfo] puts $fd [format $fstr "ARCHITECTURE" $zincArchType ] # Output general configuration values puts $fd [format $fstr "BUILD_DEBUG" $zincConfigMisc(DEBUG_BUILD)] puts $fd [format $fstr "BUILD_TOOL" $zincConfigMisc(BUILD_TOOL)] # Output Configuration Options values puts $fd [format $fstr "ZINC_UNICODE" $zincConfigCompile(ZINC_UNICODE)] puts $fd [format $fstr "ZINC_CODE_SET" $zincConfigCompile(ZINC_CODE_SET)] puts $fd [format $fstr "ZINC_ERROR_SYS" $zincConfigCompile(ZINC_ERROR_SYS)] puts $fd [format $fstr "ZINC_HELP_TIPS" $zincConfigCompile(ZINC_HELP_TIPS)] puts $fd [format $fstr "ZINC_KEYBOARD" $zincConfigCompile(ZINC_KEYBOARD)] puts $fd [format $fstr "ZINC_MOUSE" $zincConfigCompile(ZINC_MOUSE)] puts $fd [format $fstr "ZINC_SEARCH_PATH" $zincConfigCompile(ZINC_SEARCH_PATH)] puts $fd [format $fstr "ZINC_PERIST" $zincConfigCompile(ZINC_PERSIST)] if {$zincConfigCompile(ZINC_PERSIST) == 0} { puts $fd [format $fstr "ZINC_READ" 0] puts $fd [format $fstr "ZINC_WRITE" 0] } else { puts $fd [format $fstr "ZINC_READ" $zincConfigCompile(ZINC_READ)] puts $fd [format $fstr "ZINC_WRITE" $zincConfigCompile(ZINC_WRITE)] } puts $fd "" close $fd set zincConfigChange 0}########################################################### zincUnpostAll - drop all windows#proc zincUnpostAll {} { dialogUnpost "Configuration Options" dialogUnpost "Build Options"}###################################################################### zincConfigDelete - delete a configuration#proc zincConfigDelete {args} { global zincConfigDir # Get the configuration file name set configname [dialogGetValue "Zinc Configuration" "Configuration"] if {$configname == ""} { noticePost error "Need to specify a configuation file" return } set answer [noticePost question "Do you want to remove the configuration $configname?" Yes No] if {$answer != 1} { return } # Remove configuration file set configname [dialogGetValue "Zinc Configuration" Configuration] exec rm $zincConfigDir/$configname.cfg # Update the list of configuration files zincSetFileList}###################################################################### zincConfigBuild - process the "build" button to build the zinc# system#proc zincConfigBuild {} { global zincHome global zincArchType global zincConfigMisc global zincConfigChange global zincToolDB global zincToolAllList global env set configname [dialogGetValue "Zinc Configuration" "Configuration"] if {$configname == ""} { noticePost error "Need to specify a configuation file" return } set zincBuildWarningMsg \"If a Configuration Option has been changed then a Clean Build must be done.Do you want to continue?" set answer [noticePost question $zincBuildWarningMsg Yes No] if {$answer != 1} { return } set dateInfo [exec date] # Create the output files for compilation zincWriteConfigH $configname $dateInfo cd $zincHome/target/src/zinc # split out the processor type/BSP set archType [split $zincArchType - ] set cpuType [lindex $archType 0] # get the tool to use for build set tool $zincToolDB($zincConfigMisc(BUILD_TOOL),TOOL) set cmd {runTerminal "Build Zinc" 0 shwait \ $env(WIND_BASE)/host/[wtxHostType]/bin/make CPU=$cpuType TOOL=$tool NEW_DEFINES=-DZINC_CONFIG_TOOL } # check for debug if {$zincConfigMisc(DEBUG_BUILD)} { set cmd [concat $cmd "ADDED_C++FLAGS=-g" ] } # Type of build set cmd [concat $cmd "configtoolApplibs" ] eval $cmd }###################################################################### zincConfigBuildClean - process the "build" button to build the zinc# system#proc zincConfigBuildClean {} { global zincHome global zincArchType global zincConfigMisc global zincConfigChange global env set configname [dialogGetValue "Zinc Configuration" "Configuration"] if {$configname == ""} { noticePost error "Need to specify a configuation file." return } set dateInfo [exec date] # Create the output files for compilation zincWriteConfigH $configname $dateInfo cd $zincHome/target/src/zinc # split out the processor type/BSP set archType [split $zincArchType - ] set cpuType [lindex $archType 0] set cmd {runTerminal "Build Zinc" 0 shwait \ $env(WIND_BASE)/host/[wtxHostType]/bin/make CPU=$cpuType NEW_DEFINES=-DZINC_CONFIG_TOOL } # check for debug if {$zincConfigMisc(DEBUG_BUILD)} { set cmd [concat $cmd "ADDED_C++FLAGS=-g" ] } # Type of build set cmd [concat $cmd "configtoolApplibsClean" ] eval $cmd }########################################################### zincConfigClean - process the "clean" button#proc zincConfigClean {} { global env global zincHome global zincConfigMisc global zincArchTypeset zincCleanWarningMsg \" Performing a clean operation will remove all object files.Continuing will require a rebuild of all zinc components.Do you want to continue?" set configname [dialogGetValue "Zinc Configuration" "Configuration"] if {$configname == ""} { noticePost error "Need to specify a configuation file" return } set answer [noticePost question $zincCleanWarningMsg Yes No] if {$answer != 1} { return } # split out the processor type/BSP set archType [split $zincArchType - ] set cpuType [lindex $archType 0] cd $zincHome/target/src/zinc runTerminal "Clean Zinc" 0 shwait \ $env(WIND_BASE)/host/[wtxHostType]/bin/make CPU=$cpuType zincrclean}########################################################### zincConfigQuit - process the zinc-Windows "quit" button#proc zincConfigQuit {} { global zincConfigChange global zDebugFd# close $zDebugFd if {$zincConfigChange == 1} { set answer [noticePost question "Your Configuration has changed.\nDo you really want to Quit?" Yes No] if {$answer == 0} {return} } zincUnpostAll dialogUnpost "Zinc Configuration"}################################################################################ Procedure to launch the designer.#proc launchZinc {} { global env exec $env(WIND_BASE)/host/$env(WIND_HOST_TYPE)/bin/zdesign \! &}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -