home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / base / root.15 / etc / dcu.d / scripts / scr_init / scr_init~
Text File  |  1998-08-19  |  3KB  |  112 lines

  1. #ident    "@(#)scr_init    4.1"
  2.  
  3. if [ -z "$MSGWID" ]
  4. then
  5.     call int_varload WCURRENT "@longp:&Wcurrent"
  6.     DEFBORD=4
  7.     BADYELLOW=0
  8.     typeset bgchar=32 # default background character is "space"
  9.     case "$TERM" in
  10.     *vt*)
  11.         call Wsetborder_string '@string_t:!++++-|!'
  12.         ;;
  13.     *386|*386-M|*386-m)
  14.         typeset bgchar=${ISL_BGCHAR:-176} # background is stippled.
  15.         BADYELLOW=1
  16.         ;;
  17.     *386*ie)
  18.         if [ "$1" = "boot" ]
  19.         then
  20.             # The computer's monitor is being used with a special version of
  21.             # the 8859-1 code set that contains the stipple character at
  22.             # location 128.
  23.             typeset bgchar=${ISL_BGCHAR:-128} # bkgrnd is stippled.
  24.         else
  25.             :
  26.             # The computer's monitor is being used with the 8859-1 code set,
  27.             # which does not contain the stipple character.  Therefore, use the
  28.             # default background character as assigned above.
  29.         fi
  30.         BADYELLOW=1
  31.         ;;
  32.     *386*mb)
  33.         typeset bgchar=32 # multibyte background is space
  34.         BADYELLOW=1
  35.         ;;
  36.     esac
  37.     if [ -n "$ISL_BG" ]
  38.     then
  39.         if [ "$INIT_SCREEN" = "true" ]    
  40.         then
  41.             call win_init ${ISL_BG:-$BLUE} ${ISL_FG:-$WHITE} $bgchar
  42.         else
  43.             call win_init ${ISL_BG:-$BLUE} ${ISL_FG:-$WHITE} $bgchar > /dev/null 2>&1
  44.         fi
  45.     else
  46.         call win_init ${ISL_BG:-$BLUE} ${ISL_FG:-$WHITE} $bgchar
  47.     fi
  48.     cdecl longp play='&LINES'
  49.     cprint -v LINES play
  50.     cset play='&COLS'
  51.     cprint -v COLUMNS play >&2
  52.     integer HEADBOTLINE=0 FOOTBOTLINE=$LINES-1 FOOTTOPLINE=FOOTBOTLINE-FOOTER_HEIGHT+1 MSGLINE=FOOTTOPLINE-1 LASTLINE=MSGLINE-1
  53.     ADVANCED=:
  54.     NOTADVANCED=on
  55.     advanced() {
  56.         eval "$ADVANCED"
  57.         NOTADVANCED=
  58.     }
  59.     MENU_SELECT_FG=${ISL_MENU_SELECT_FG:-$WHITE}
  60.     MENU_SELECT_BG=${ISL_MENU_SELECT_BG:-$RED}
  61.     HELP_BG=${ISL_HELP_BG:-$BLUE}
  62.     HELP_FG=${ISL_HELP_FG:-$WHITE}
  63.     ERROR_BG=${ISL_ERROR_BG:-$RED}
  64.     ERROR_FG=${ISL_ERROR_FG:-$WHITE}
  65.     COMBO1_BG=${ISL_COMBO1_BG:-$BLUE}
  66.     COMBO1_FG=${ISL_COMBO1_FG:-$WHITE}
  67.     COMBO2_BG=${ISL_COMBO2_BG:-$CYAN}
  68.     COMBO2_FG=${ISL_COMBO2_FG:-$BLACK}
  69.     COMBO3_BG=${ISL_COMBO3_BG:-$BLUE}
  70.     COMBO3_FG=${ISL_COMBO3_FG:-$WHITE}
  71.     function init_head
  72.     {
  73.         unset -f init_head
  74.         open_window 0 0 $COLUMNS-1 0 -noborder -fg ${ISL_HEAD_FG:-$WHITE} -bg ${ISL_HEAD_BG:-$BLUE}
  75.         HEADWID=$CURWIN
  76.         iscolor || wsetattr $HEADWID 01000000
  77.         integer len="(COLUMNS-${#GENERIC_HEADER})/2" len2=COLUMNS-len
  78.         typeset -L$len buf=
  79.         typeset -L$len2 buf2="$GENERIC_HEADER"
  80.         wclear $HEADWID
  81.         wprintf $HEADWID "$buf$buf2"
  82.     }
  83.  
  84.     
  85.     function init_footer {
  86.         unset -f init_footer
  87.         open_window -noborder 0 $MSGLINE $COLUMNS-1 $MSGLINE -fg ${ISL_MSG_FG:-$BLACK} -bg ${ISL_MSG_BG:-$WHITE}
  88.         MSGWID=$CURWIN
  89.         open_window 0 $FOOTTOPLINE $COLUMNS-1 $FOOTBOTLINE -noborder -fg ${ISL_FOOTER_FG:-$WHITE} -bg ${ISL_FOOTER_BG:-$BLUE}
  90.         FOOTWID=$CURWIN
  91.         iscolor || wsetattr $FOOTWID 01000000
  92.     }
  93.  
  94.     if [ -n "$ISL_BG" ]
  95.     then
  96.         if [ "$INIT_SCREEN" = "true" ]    
  97.         then
  98.             init_head
  99.             init_footer
  100.         else
  101.             {
  102.             init_head
  103.             } > /dev/null
  104.             init_footer
  105.             echo -n "\033[2c"
  106.         fi
  107.     else
  108.         init_head
  109.         init_footer
  110.     fi
  111. fi
  112.