Adding upstream version 4.02+dfsg.
[syslinux-debian/hramrach.git] / com32 / cmenu / libmenu / tui.h
blobed5548786ad52a8c0e00d2bb49cdbf32dee2e825
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 <getkey.h>
18 #include <consoles.h>
19 #include "syslnx.h"
20 #include "com32io.h"
22 #ifndef NULL
23 #define NULL ((void *)0)
24 #endif
26 #define SO '\016'
27 #define SI '\017'
29 #define TOP_LEFT_CORNER_BORDER '\154'
30 #define TOP_BORDER '\161'
31 #define TOP_RIGHT_CORNER_BORDER '\153'
32 #define BOTTOM_LEFT_CORNER_BORDER '\155'
33 #define BOTTOM_BORDER '\161'
34 #define BOTTOM_RIGHT_CORNER_BORDER '\152'
35 #define LEFT_BORDER '\170'
36 #define RIGHT_BORDER '\170'
37 #define LEFT_MIDDLE_BORDER '\164'
38 #define MIDDLE_BORDER '\161'
39 #define RIGHT_MIDDLE_BORDER '\165'
41 #define BELL 0x07
42 #define GETSTRATTR 0x07
44 // Generic user input,
45 // password = 0 iff chars echoed on screen
46 // showoldvalue <> 0 iff current displayed for editing
47 void getuserinput(char *str, unsigned int size,
48 unsigned int password, unsigned int showoldvalue);
50 static inline void getstring(char *str, unsigned int size)
52 getuserinput(str, size, 0, 0);
55 static inline void editstring(char *str, unsigned int size)
57 getuserinput(str, size, 0, 1);
60 static inline void getpwd(char *str, unsigned int size)
62 getuserinput(str, size, 1, 0);
65 void drawbox(const char, const char, const char, const char,
66 const char);
68 // Draw a horizontal line
69 // dumb == 1, means just draw the line
70 // dumb == 0 means check the first and last positions and depending on what is
71 // currently on the screen make it a LTRT and/or RTLT appropriately.
72 void drawhorizline(const char, const char, const char, const char,
73 const char dumb);
75 #endif