1 /* -*- c -*- ------------------------------------------------------------- *
3 * Copyright 2004-2005 Murali Krishnan Ganapathy - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
19 #include "scancodes.h"
23 #define NULL ((void *)0)
27 // CHRELATTR = ^N, CHABSATTR = ^O
31 void clearwindow(char top
, char left
, char bot
, char right
,
32 char page
, char fillchar
, char fillattr
);
34 void cls(void); /* Clears the entire current screen page */
36 // Generic user input,
37 // password = 0 iff chars echoed on screen
38 // showoldvalue <> 0 iff current displayed for editing
39 void getuserinput(char *str
, unsigned int size
,
40 unsigned int password
, unsigned int showoldvalue
);
42 static inline void getstring(char *str
, unsigned int size
)
44 getuserinput(str
,size
,0,0);
47 static inline void editstring(char *str
, unsigned int size
)
49 getuserinput(str
,size
,0,1);
52 static inline void getpwd(char * str
, unsigned int size
)
54 getuserinput(str
,size
,1,0);
57 // Box drawing Chars offsets into array
58 #define BOX_TOPLEFT 0x0
59 #define BOX_BOTLEFT 0x1
60 #define BOX_TOPRIGHT 0x2
61 #define BOX_BOTRIGHT 0x3
62 #define BOX_TOP 0x4 // TOP = BOT = HORIZ
67 #define BOX_VERT 0x5 // LEFT=RIGHT=VERT
70 #define BOX_TOPBOT 0x8
71 #define BOX_BOTTOP 0x9
72 #define BOX_MIDDLE 0xA
74 typedef enum {BOX_SINSIN
,BOX_DBLDBL
, BOX_SINDBL
, BOX_DBLSIN
} boxtype
;
76 unsigned char * getboxchars(boxtype bt
);
78 void drawbox(char top
,char left
,char bot
, char right
,
79 char page
, char attr
,boxtype bt
);
81 // Draw a horizontal line
82 // dumb == 1, means just draw the line
83 // dumb == 0 means check the first and last positions and depending on what is
84 // currently on the screen make it a LTRT and/or RTLT appropriately.
85 void drawhorizline(char top
, char left
, char right
, char page
, char attr
,
86 boxtype bt
, char dumb
);