FDOSTUI
FreeDOS Text User Interface
Typedefs | Enumerations | Functions | Variables
screen.h File Reference

screen drawing routines (no clipping) The draw.h module contians clipping routines. More...

Go to the source code of this file.

Typedefs

typedef unsigned short int screen_block_t
 
typedef unsigned char screen_char_t
 

Enumerations

enum  foreground {
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15,
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15,
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15
}
 foreground colors More...
 
enum  foreground {
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15,
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15,
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15
}
 
enum  foreground {
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15,
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15,
  fcolor_black = 0, fcolor_blue = 1, fcolor_green = 2, fcolor_cyan = 3,
  fcolor_red = 4, fcolor_magenta = 5, fcolor_yellow = 14, fcolor_white = 15
}
 
enum  background {
  bcolor_black = 0, bcolor_blue = 1, bcolor_green = 2, bcolor_cyan = 3,
  bcolor_red = 4, bcolor_magenta = 5, bcolor_light_gray = 7, bcolor_black = 0,
  bcolor_blue = 1, bcolor_green = 2, bcolor_cyan = 3, bcolor_red = 4,
  bcolor_magenta = 5, bcolor_light_gray = 7, bcolor_black = 0, bcolor_blue = 1,
  bcolor_green = 2, bcolor_cyan = 3, bcolor_red = 4, bcolor_magenta = 5,
  bcolor_light_gray = 7
}
 background color More...
 
enum  background {
  bcolor_black = 0, bcolor_blue = 1, bcolor_green = 2, bcolor_cyan = 3,
  bcolor_red = 4, bcolor_magenta = 5, bcolor_light_gray = 7, bcolor_black = 0,
  bcolor_blue = 1, bcolor_green = 2, bcolor_cyan = 3, bcolor_red = 4,
  bcolor_magenta = 5, bcolor_light_gray = 7, bcolor_black = 0, bcolor_blue = 1,
  bcolor_green = 2, bcolor_cyan = 3, bcolor_red = 4, bcolor_magenta = 5,
  bcolor_light_gray = 7
}
 
enum  background {
  bcolor_black = 0, bcolor_blue = 1, bcolor_green = 2, bcolor_cyan = 3,
  bcolor_red = 4, bcolor_magenta = 5, bcolor_light_gray = 7, bcolor_black = 0,
  bcolor_blue = 1, bcolor_green = 2, bcolor_cyan = 3, bcolor_red = 4,
  bcolor_magenta = 5, bcolor_light_gray = 7, bcolor_black = 0, bcolor_blue = 1,
  bcolor_green = 2, bcolor_cyan = 3, bcolor_red = 4, bcolor_magenta = 5,
  bcolor_light_gray = 7
}
 

Functions

int screen_init ()
 configures the display screen More...
 
void screen_deinit ()
 returns the screen to mode on entry More...
 
int screen_set25lines ()
 set 25 line screen mode More...
 
int screen_set50lines ()
 set 50 line screen mode More...
 
void screen_changed_size ()
 
void screen_fill (screen_char_t const i_char, enum foreground const i_fcolor, enum background const i_bcolor)
 fill entire screen display More...
 
void screen_fill_area (int const i_col, int const i_row, unsigned int const i_columns, unsigned int const i_rows, screen_char_t const i_char, enum foreground const i_fcolor, enum background const i_bcolor)
 fill an area of the screen More...
 
void screen_putc (int const i_col, int const i_row, screen_char_t const i_char, unsigned int const i_repeat_count, enum foreground const i_fcolor, enum background const i_bcolor)
 draw a character to the screen More...
 
void screen_putvc (int const i_col, int const i_row, screen_char_t const i_char, unsigned int const i_repeat_count, enum foreground const i_fcolor, enum background const i_bcolor)
 draw a character to the screen More...
 
void screen_puts (int const i_col, int const i_row, unsigned char const __FAR *i_string, unsigned int const i_length, enum foreground const i_fcolor, enum background const i_bcolor)
 draw a string to the screen More...
 
void screen_set_color (int const i_col, int const i_row, unsigned int const i_repeat_count, enum foreground const i_fcolor, enum background const i_bcolor)
 sets the foreground and background color of a horizontal region More...
 
screen_block_t screen_getc (int const i_col, int const i_row)
 reads a character and it's attribute from the screen More...
 
screen_block_t __FAR * screen_read (screen_block_t __FAR *o_block, unsigned int const i_columns, int const i_col, int const i_row)
 read a line of screen memory More...
 
screen_block_t const __FAR * screen_write (int const i_col, int const i_row, screen_block_t const __FAR *i_block, unsigned int const i_columns)
 write a line of screen memory More...
 
void screen_push (int const i_copy)
 
void screen_pop ()
 

Variables

unsigned int _video_cols
 
unsigned int _video_rows
 
int _video_has_color
 

Detailed Description

screen drawing routines (no clipping) The draw.h module contians clipping routines.

Enumeration Type Documentation

◆ background [1/3]

enum background

background color

Enumerator
bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

◆ background [2/3]

enum background
Enumerator
bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

◆ background [3/3]

enum background
Enumerator
bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

bcolor_black 

black

bcolor_blue 

blue

bcolor_green 

green

bcolor_cyan 

cyan

bcolor_red 

red

bcolor_magenta 

magenta

bcolor_light_gray 

light gray

◆ foreground [1/3]

enum foreground

foreground colors

Enumerator
fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

◆ foreground [2/3]

enum foreground
Enumerator
fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

◆ foreground [3/3]

enum foreground
Enumerator
fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

fcolor_black 

black

fcolor_blue 

blue

fcolor_green 

green

fcolor_cyan 

cyan

fcolor_red 

red

fcolor_magenta 

magenta

fcolor_yellow 

light yellow

fcolor_white 

light white

Function Documentation

◆ screen_deinit()

void screen_deinit ( )

returns the screen to mode on entry

Returns
none

◆ screen_fill()

void screen_fill ( screen_char_t const  i_char,
enum foreground const  i_fcolor,
enum background const  i_bcolor 
)

fill entire screen display

Parameters
[in]i_charfill character
[in]i_colorforeground color
[in]i_bcolorbackground color
Returns
none

◆ screen_fill_area()

void screen_fill_area ( int const  i_col,
int const  i_row,
unsigned int const  i_columns,
unsigned int const  i_rows,
screen_char_t const  i_char,
enum foreground const  i_fcolor,
enum background const  i_bcolor 
)

fill an area of the screen

Parameters
[in]i_colcolumn
[in]i_rowrow
[in]i_columnsnumber of columns
[in]i_rowsnumber of rows
[in]i_charfill character
[in]i_fcolorforeground color
[in]i_bcolorbackground color
Returns
none

◆ screen_getc()

int screen_getc ( int const  i_col,
int const  i_row 
)

reads a character and it's attribute from the screen

Parameters
[in]i_colcolumn
[in]i_rowrwo
Returns
character and attribute

◆ screen_init()

int screen_init ( )

configures the display screen

Returns
0 suceess display initialized
!0 error unable to initalize the disply

◆ screen_putc()

void screen_putc ( int const  i_col,
int const  i_row,
screen_char_t const  i_char,
unsigned int const  i_repeat_count,
enum foreground const  i_fcolor,
enum background const  i_bcolor 
)

draw a character to the screen

Parameters
[in]i_colcolumn
[in]i_rowrow
[in]i_repeat_countnumber of times to repeat horizontally
[in]i_fcolorforeground color
[in]i_bcolorbackground color
Returns
none

◆ screen_puts()

void screen_puts ( int const  i_col,
int const  i_row,
unsigned char const __FAR *  i_string,
unsigned int const  i_length,
enum foreground const  i_fcolor,
enum background const  i_bcolor 
)

draw a string to the screen

Parameters
[in]i_colcolumn
[in]i_rowrow
[in]i_stringstring to write
[in]i_lengthlength of string
[in]i_fcolorforeground color
[in]i_bcolorbackground color
Returns
none

◆ screen_putvc()

void screen_putvc ( int const  i_col,
int const  i_row,
screen_char_t const  i_char,
unsigned int const  i_repeat_count,
enum foreground const  i_fcolor,
enum background const  i_bcolor 
)

draw a character to the screen

Parameters
[in]i_colcolumn
[in]i_rowrow
[in]i_repeat_countnumber of times to repeat vertically
[in]i_fcolorforeground color
[in]i_bcolorbackground color
Returns
none

◆ screen_read()

screen_block_t __FAR * screen_read ( screen_block_t __FAR *  o_block,
unsigned int const  i_columns,
int const  i_col,
int const  i_row 
)

read a line of screen memory

Parameters
[out]o_blockmemory block to place screen data (must be large enough)
[in]i_columnsnumber of columns to read
[in]i_colcolumn
[in]i_rowrow
Returns
ending address of block

curses version will add a null termination byte. Therefore, o_block must be i_columns+1 long. The return address will be the termination byte o_block+i_columns.

◆ screen_set25lines()

int screen_set25lines ( )

set 25 line screen mode

Returns
0 success
!0 failure

◆ screen_set50lines()

int screen_set50lines ( )

set 50 line screen mode

Returns
0 success
!0 failure

◆ screen_set_color()

void screen_set_color ( int const  i_col,
int const  i_row,
unsigned int const  i_repeat_count,
enum foreground const  i_fcolor,
enum background const  i_bcolor 
)

sets the foreground and background color of a horizontal region

Parameters
[in]i_colcolumn
[in]i_rowrow
[in]i_repeat_countnumber of times to repeat horizontally
[in]i_fcolorforeground color
[in]i_bcolorbackground color

◆ screen_write()

screen_block_t __FAR * screen_write ( int const  i_col,
int const  i_row,
screen_block_t const __FAR *  i_block,
unsigned int const  i_columns 
)

write a line of screen memory

Parameters
[in]i_colcolumn
[in]i_rowrow
[in]i_blockblock of memory containing data to write toscreen
[in]i_columnsnumber of columns to write
Returns
ending address of memory block

Variable Documentation

◆ _video_cols

_video_cols

number of video columns

◆ _video_rows

_video_rows

number of video rows