1 //--------------------------------------------------------------------
4 // Copyright 1997-2005 by Christopher J. Madsen
6 // Support class for curses applications
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of
11 // the License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //--------------------------------------------------------------------
22 #ifndef INCLUDED_CONWIN_HPP
24 #define INCLUDED_CONWIN_HPP
27 #undef border // It interferes with my member function
29 #define KEY_ESCAPE 0x1B
31 #define KEY_DELETE 0x7F
32 #define KEY_RETURN 0x0D
55 void init(short x
, short y
, short width
, short height
, Style style
);
58 void border() { ::box(win
, 0, 0); };
59 void clear() { werase(win
); };
60 void move(short x
, short y
) { move_panel(pan
, y
, x
); };
61 ///void put(short x, short y, const String& s);
62 void put(short x
, short y
, const char* s
) { mvwaddstr(win
, y
, x
, s
); };
63 void putAttribs(short x
, short y
, Style color
, short count
);
64 void putChar(short x
, short y
, char c
, short count
);
66 void resize(short width
, short height
);
67 void setAttribs(Style color
);
68 void setCursor(short x
, short y
);
69 void update(unsigned short margin
=0) {};
71 void hide() { hide_panel(pan
); };
72 void show() { show_panel(pan
); };
74 static void getScreenSize(int& x
, int& y
) { getmaxyx(curscr
, y
, x
); };
75 static void hideCursor() { curs_set(0); };
76 static void showCursor(bool insert
=true) { curs_set(insert
? 1 : 2); };
77 static void shutdown();
78 static bool startup();
81 #endif // INCLUDED_CONWIN_HPP
83 //--------------------------------------------------------------------
86 // c-file-style: "cjm"