attr.tcl

Go to the documentation of this file.
00001 /*  -*- tcl -*-*/
00002 /*  ### ### ### ######### ######### #########*/
00003 /*  Terminal packages - ANSI - Attribute codes*/
00004 
00005 /*  ### ### ### ######### ######### #########*/
00006 /*  Requirements*/
00007 
00008 package require  term::ansi::code ; /*  Constants*/
00009 
00010 namespace ::term::ansi::code::attr {}
00011 
00012 /*  ### ### ### ######### ######### #########*/
00013 /*  API. Symbolic names.*/
00014 
00015 ret  ::term::ansi::code::attr::names () {
00016     variable attr
00017     return  $attr
00018 }
00019 
00020 ret  ::term::ansi::code::attr::import (optional ns =attr , type args) {
00021     if {![llength $args]} {set args *}
00022     set args ::term::ansi::code::attr::[join $args " ::term::ansi::code::attr::"]
00023     uplevel 1 [list namespace eval ${ns} [linsert $args 0 namespace import]]
00024     return
00025 }
00026 
00027 /*  ### ### ### ######### ######### #########*/
00028 /*  Internal - Setup*/
00029 
00030 ret  ::term::ansi::code::attr::DEF (type name , type value) {
00031     variable  attr
00032     const            $name $value
00033     lappend   attr   $name
00034     namespace export $name
00035     return
00036 }
00037 
00038 ret  ::term::ansi::code::attr::INIT () {
00039     # ### ### ### ######### ######### #########
00040     ##
00041 
00042     # Colors. Foreground <=> Text
00043     DEF fgblack   30    ; # Black  
00044     DEF fgred     31    ; # Red    
00045     DEF fggreen   32    ; # Green  
00046     DEF fgyellow  33    ; # Yellow 
00047     DEF fgblue    34    ; # Blue   
00048     DEF fgmagenta 35    ; # Magenta
00049     DEF fgcyan    36    ; # Cyan   
00050     DEF fgwhite   37    ; # White  
00051     DEF fgdefault 39    ; # Default (Black)
00052 
00053     # Colors. Background.
00054     DEF bgblack   40    ; # Black  
00055     DEF bgred     41    ; # Red    
00056     DEF bggreen   42    ; # Green  
00057     DEF bgyellow  43    ; # Yellow 
00058     DEF bgblue    44    ; # Blue   
00059     DEF bgmagenta 45    ; # Magenta
00060     DEF bgcyan    46    ; # Cyan   
00061     DEF bgwhite   47    ; # White  
00062     DEF bgdefault 49    ; # Default (Transparent)
00063 
00064     # Non-color attributes. Activation.
00065     DEF bold      1 ; # Bold  
00066     DEF dim       2 ; # Dim
00067     DEF italic    3     ; # Italics      
00068     DEF underline 4 ; # Underscore   
00069     DEF blink     5 ; # Blink
00070     DEF revers    7 ; # Reverse      
00071     DEF hidden    8 ; # Hidden
00072     DEF strike    9     ; # StrikeThrough
00073 
00074     # Non-color attributes. Deactivation.
00075     DEF nobold      22  ; # Bold  
00076     DEF nodim       __  ; # Dim
00077     DEF noitalic    23  ; # Italics      
00078     DEF nounderline 24  ; # Underscore   
00079     DEF noblink     25  ; # Blink
00080     DEF norevers    27  ; # Reverse      
00081     DEF nohidden    28  ; # Hidden
00082     DEF nostrike    29  ; # StrikeThrough
00083 
00084     # Remainder
00085     DEF reset       0   ; # Reset
00086 
00087     ##
00088     # ### ### ### ######### ######### #########
00089     return
00090 }
00091 
00092 /*  ### ### ### ######### ######### #########*/
00093 /*  Data structures.*/
00094 
00095 namespace ::term::ansi::code::attr {
00096     namespace import ::term::ansi::code::const
00097     variable attr {}
00098 }
00099 
00100 ::term::ansi::code::attr::INIT
00101 
00102 /*  ### ### ### ######### ######### #########*/
00103 /*  Ready*/
00104 
00105 package provide term::ansi::code::attr 0.1
00106 
00107 /** 
00108  * ### ### ### ######### ######### #########
00109 

Generated on 21 Sep 2010 for Gui by  doxygen 1.6.1