Last change
on this file since 608 was
49,
checked in by Sam Hocevar, 15 years ago
|
- Imported original public domain release, for future reference.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[49] | 1 | #ifndef __CONSOLE_HPP_ |
---|
| 2 | #define __CONSOLE_HPP_ |
---|
| 3 | #include "jwindow.hpp" |
---|
| 4 | |
---|
| 5 | class console |
---|
| 6 | { |
---|
| 7 | protected : |
---|
| 8 | int lastx,lasty,w,h,cx,cy; |
---|
| 9 | JCFont *fnt; |
---|
| 10 | char *screen; |
---|
| 11 | jwindow *con_win; |
---|
| 12 | window_manager *wm; |
---|
| 13 | char *name; |
---|
| 14 | public : |
---|
| 15 | |
---|
| 16 | console(window_manager *WM, JCFont *font, int width, int height, char *Name); |
---|
| 17 | int showing() { return con_win!=NULL; } |
---|
| 18 | void show(); |
---|
| 19 | void hide(); |
---|
| 20 | void redraw(); |
---|
| 21 | void put_char(char ch); |
---|
| 22 | void do_cr(); |
---|
| 23 | int screen_w() { return w*fnt->width(); } |
---|
| 24 | int screen_h() { return h*fnt->height(); } |
---|
| 25 | int wx() { return con_win->x1(); } |
---|
| 26 | int wy() { return con_win->y1(); } |
---|
| 27 | void draw_cursor(); |
---|
| 28 | void put_string(char *st); |
---|
| 29 | void draw_char(int x, int y, char ch); |
---|
| 30 | void toggle() { if (con_win) hide(); else show(); } |
---|
| 31 | void printf(const char *format, ...); |
---|
| 32 | ~console(); |
---|
| 33 | } ; |
---|
| 34 | |
---|
| 35 | class shell_term : public console |
---|
| 36 | { |
---|
| 37 | char shcmd[300]; |
---|
| 38 | public : |
---|
| 39 | shell_term(window_manager *WM, JCFont *font, int width, int height, char *Name); |
---|
| 40 | int handle_event(event &ev, window_manager *wm); |
---|
| 41 | virtual void prompt(); |
---|
| 42 | virtual void execute(char *st); |
---|
| 43 | } ; |
---|
| 44 | |
---|
| 45 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.