Adding debian version 3.35-1.
[syslinux-debian/hramrach.git] / menu / libmenu / tui.h
blob92f938633cd28b82cda1971c4b45de9eb7ecf2e4
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 * ----------------------------------------------------------------------- */
13 #ifndef __TUI_H__
14 #define __TUI_H__
16 #include <com32.h>
17 #include "syslnx.h"
18 #include "com32io.h"
19 #include "scancodes.h"
22 #ifndef NULL
23 #define NULL ((void *)0)
24 #endif
26 #define BELL 0x07
27 // CHRELATTR = ^N, CHABSATTR = ^O
28 #define CHABSATTR 15
29 #define CHRELATTR 14
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
63 #define BOX_BOT 0x4
64 #define BOX_HORIZ 0x4
65 #define BOX_LEFT 0x5
66 #define BOX_RIGHT 0x5
67 #define BOX_VERT 0x5 // LEFT=RIGHT=VERT
68 #define BOX_LTRT 0x6
69 #define BOX_RTLT 0x7
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);
88 #endif