Main Page | Namespace List | Data Structures | File List | Namespace Members | Data Fields | Globals

conio2.h File Reference

A conio implementation for Mingw/Dev-C++. More...

#include <conio.h>

Data Structures

struct  text_info
 Structure holding information about screen. More...
struct  char_info
 Structure used by gettext/puttext. More...

Cursor types

Predefined cursor types.



#define _NOCURSOR   0
 no cursor
#define _SOLIDCURSOR   100
 cursor filling whole cell
#define _NORMALCURSOR   20
 cursor filling 20 percent of cell height

Defines

#define gettext   _conio_gettext
 Define alias for _conio_gettext.

Enumerations

enum  COLORS {
  BLACK, BLUE, GREEN, CYAN,
  RED, MAGENTA, BROWN, LIGHTGRAY,
  DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN,
  LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE
}
 Colors which you can use in your application. More...

Functions

void gettextinfo (struct text_info *info)
 Returns information of the screen.
void inittextinfo (void)
 Call this if you need real value of normattr attribute in the text_info structure.
void clreol (void)
 Clears rest of the line from cursor position to the end of line without moving the cursor.
void clrscr (void)
 Clears whole screen.
void delline (void)
 Delete the current line (line on which is cursor) and then moves all lines below one line up.
void insline (void)
 Insert blank line at the cursor position.
void _conio_gettext (int left, int top, int right, int bottom, struct char_info *buf)
 Gets text from the screen.
void puttext (int left, int top, int right, int bottom, struct char_info *buf)
 Puts text back to the screen.
void movetext (int left, int top, int right, int bottom, int destleft, int desttop)
 Copies text.
void gotoxy (int x, int y)
 Moves cursor to the specified position.
void cputsxy (int x, int y, char *str)
 Puts string at the specified position.
void putchxy (int x, int y, char ch)
 Puts char at the specified position.
void _setcursortype (int type)
 Sets the cursor type.
void textattr (int _attr)
 Sets attribute of text.
void normvideo (void)
 Sets text attribute back to value it had after program start.
void textbackground (int color)
 Sets text background color.
void textcolor (int color)
 Sets text foreground color.
int wherex (void)
 Reads the cursor X position.
int wherey (void)
 Reads the cursor Y position.
char * getpass (const char *prompt, char *str)
 Reads password.
void highvideo (void)
 Makes foreground colors light.
void lowvideo (void)
 Makes foreground colors dark.


Detailed Description

A conio implementation for Mingw/Dev-C++.

Written by: Hongli Lai <hongli@telekabel.nl> tkorrovi <tkorrovi@altavista.net> on 2002/02/26. Andrew Westcott <ajwestco@users.sourceforge.net> Michal Molhanec <michal@molhanec.net>

Offered for use in the public domain without any warranty.


Define Documentation

#define gettext   _conio_gettext
 

Define alias for _conio_gettext.

If you want to use gettext function from some other library (e.g. GNU gettext) you have to define _CONIO_NO_GETTEXT_ so you won't get name conflict.


Enumeration Type Documentation

enum COLORS
 

Colors which you can use in your application.

Enumeration values:
BLACK  black color
BLUE  blue color
GREEN  green color
CYAN  cyan color
RED  red color
MAGENTA  magenta color
BROWN  brown color
LIGHTGRAY  light gray color
DARKGRAY  dark gray color
LIGHTBLUE  light blue color
LIGHTGREEN  light green color
LIGHTCYAN  light cyan color
LIGHTRED  light red color
LIGHTMAGENTA  light magenta color
YELLOW  yellow color
WHITE  white color


Function Documentation

void _conio_gettext int  left,
int  top,
int  right,
int  bottom,
struct char_info buf
 

Gets text from the screen.

If you haven't defined _CONIO_NO_GETTEXT_ prior to including conio2.h you can use this function also under the gettext name.

See also:
char_info

puttext

Parameters:
left Left coordinate of the rectangle, inclusive, starting from 1.
top Top coordinate of the rectangle, inclusive, starting from 1.
right Right coordinate of the rectangle, inclusive, starting from 1.
bottom Bottom coordinate of the rectangle, inclusive, starting from 1.
buf You have to pass buffer of size (right - left + 1) * (bottom - top + 1) * sizeof(char_info).

void _setcursortype int  type  ) 
 

Sets the cursor type.

See also:
cursortypes
Parameters:
type cursor type, under Win32 it is height of the cursor in percents

void cputsxy int  x,
int  y,
char *  str
 

Puts string at the specified position.

Parameters:
x horizontal position
y vertical position
str string

void delline void   ) 
 

Delete the current line (line on which is cursor) and then moves all lines below one line up.

Lines below the line are moved one line up.

char* getpass const char *  prompt,
char *  str
 

Reads password.

This function behaves like cgets.

See also:
cgets
Parameters:
prompt prompt which will be displayed to user
str string for the password. str[0] have to contain length of the str - 3
Returns:
&str[2], the password will be stored in str beginning at str[2], in str[1] will be length of the string without \0, at str[2 + str[1]] will be \0.

void gettextinfo struct text_info info  ) 
 

Returns information of the screen.

See also:
text_info

void gotoxy int  x,
int  y
 

Moves cursor to the specified position.

Parameters:
x horizontal position
y vertical position

void highvideo void   ) 
 

Makes foreground colors light.

If the current foreground color is less than DARKGRAY adds 8 to the its value making dark colors light.

See also:
COLORS

lowvideo

void inittextinfo void   ) 
 

Call this if you need real value of normattr attribute in the text_info structure.

See also:
text_info

void insline void   ) 
 

Insert blank line at the cursor position.

Original content of the line and content of lines below moves one line down. The last line is deleted.

void lowvideo void   ) 
 

Makes foreground colors dark.

If the current foreground color is higher than LIGHTGRAY substracts 8 from its value making light colors dark.

See also:
COLORS

highvideo

void movetext int  left,
int  top,
int  right,
int  bottom,
int  destleft,
int  desttop
 

Copies text.

Parameters:
left Left coordinate of the rectangle, inclusive, starting from 1.
top Top coordinate of the rectangle, inclusive, starting from 1.
right Right coordinate of the rectangle, inclusive, starting from 1.
bottom Bottom coordinate of the rectangle, inclusive, starting from 1.
destleft Left coordinate of the destination rectangle.
desttop Top coordinate of the destination rectangle.

void normvideo void   ) 
 

Sets text attribute back to value it had after program start.

It uses text_info's normattr value.

See also:
text_info

void putchxy int  x,
int  y,
char  ch
 

Puts char at the specified position.

Parameters:
x horizontal position
y vertical position
ch char

void puttext int  left,
int  top,
int  right,
int  bottom,
struct char_info buf
 

Puts text back to the screen.

See also:
char_info

_conio_gettext

Parameters:
left Left coordinate of the rectangle, inclusive, starting from 1.
top Top coordinate of the rectangle, inclusive, starting from 1.
right Right coordinate of the rectangle, inclusive, starting from 1.
bottom Bottom coordinate of the rectangle, inclusive, starting from 1.
buf You have to pass buffer of size (right - left + 1) * (bottom - top + 1) * sizeof(char_info).

void textattr int  _attr  ) 
 

Sets attribute of text.

Parameters:
_attr new text attribute

void textbackground int  color  ) 
 

Sets text background color.

See also:
COLORS
Parameters:
color new background color

void textcolor int  color  ) 
 

Sets text foreground color.

See also:
COLORS
Parameters:
color new foreground color

int wherex void   ) 
 

Reads the cursor X position.

Returns:
cursor X position

int wherey void   ) 
 

Reads the cursor Y position.

Returns:
cursor Y position


Generated on Tue Aug 3 02:07:03 2004 for CONIO by doxygen 1.3.8