/[gentoo-src]/ufed/ufed-curses.h
Gentoo

Contents of /ufed/ufed-curses.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Thu Oct 13 08:27:51 2005 UTC (8 years, 6 months ago) by truedfx
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -0 lines
File MIME type: text/x-chdr
Don't show "Select desired USE flags from the list below" in Help screen

1 #define C99 (__STDC_VERSION__ >= 199901L)
2 #if !C99
3 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 95
4 #error Either a C99 compiler, or gcc 2.95.* or higher is required.
5 #endif
6 #endif
7
8 #include <curses.h>
9
10 #if !C99
11 #define inline __inline
12 #endif
13
14 enum win { Top, Left, List, Input, Scrollbar, Right, Bottom, wCount };
15 struct window {
16 WINDOW *win;
17 const int top, left, height, width;
18 };
19 struct item {
20 struct item *prev, *next;
21 int top, height;
22 };
23 struct key {
24 char key;
25 const char *descr;
26 int length;
27 };
28
29 extern struct window window[wCount];
30
31 extern void initcurses(void);
32 extern void cursesdone(void);
33
34 extern int maineventloop(
35 const char *subtitle,
36 int (*callback)(struct item **currentitem, int key),
37 void(*drawitem)(struct item *item, bool highlight),
38 struct item *items,
39 const struct key *keys);
40 extern void scrollcurrent(void);
41 extern bool yesno(const char *);
42
43 static inline WINDOW *win(enum win w) { return window[w].win; }
44 static inline int wTop (enum win w) { return (window[w].top >= 0 ? 0 : LINES) + window[w].top ; }
45 static inline int wLeft (enum win w) { return (window[w].left >= 0 ? 0 : COLS ) + window[w].left ; }
46 static inline int wHeight(enum win w) { return (window[w].height > 0 ? 0 : LINES) + window[w].height; }
47 static inline int wWidth (enum win w) { return (window[w].width > 0 ? 0 : COLS ) + window[w].width ; }
48
49 extern int minheight, minwidth;
50 extern int topy;

  ViewVC Help
Powered by ViewVC 1.1.20