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

Contents of /ufed/ufed-curses.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Wed Oct 12 20:55:24 2005 UTC (9 years, 3 months ago) by truedfx
Branch: MAIN
File MIME type: text/x-chdr
Many changes. Also, no longer generate ChangeLog since it's no longer a single file and can't easily be generated.

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 int (*callback)(struct item **currentitem, int key),
36 void(*drawitem)(struct item *item, bool highlight),
37 struct item *items,
38 const struct key *keys);
39 extern void scrollcurrent(void);
40 extern bool yesno(const char *);
41
42 static inline WINDOW *win(enum win w) { return window[w].win; }
43 static inline int wTop (enum win w) { return (window[w].top >= 0 ? 0 : LINES) + window[w].top ; }
44 static inline int wLeft (enum win w) { return (window[w].left >= 0 ? 0 : COLS ) + window[w].left ; }
45 static inline int wHeight(enum win w) { return (window[w].height > 0 ? 0 : LINES) + window[w].height; }
46 static inline int wWidth (enum win w) { return (window[w].width > 0 ? 0 : COLS ) + window[w].width ; }
47
48 extern int minheight, minwidth;
49 extern int topy;

  ViewVC Help
Powered by ViewVC 1.1.20