source: abuse/trunk/src/console.hpp @ 97

Last change on this file since 97 was 57, checked in by Sam Hocevar, 11 years ago
  • Move each header to the same directory as its corresponding source, to get a better idea of which files are likely to export symbols.
File size: 1.4 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef __CONSOLE_HPP_
11#define __CONSOLE_HPP_
12#include "jwindow.hpp"
13
14class console
15{
16  protected :
17  int lastx,lasty,w,h,cx,cy;
18  JCFont *fnt;
19  char *screen;
20  jwindow *con_win;
21  window_manager *wm;
22  char *name;
23  public :
24
25  console(window_manager *WM, JCFont *font, int width, int height, char const *Name);
26  int showing() { return con_win!=NULL; }
27  void show();
28  void hide();
29  void redraw();
30  void put_char(char ch);
31  void do_cr();
32  int screen_w() { return w*fnt->width(); }
33  int screen_h() { return h*fnt->height(); }
34  int wx() { return con_win->x1(); }
35  int wy() { return con_win->y1(); }
36  void draw_cursor();
37  void put_string(char const *st);
38  void draw_char(int x, int y, char ch);
39  void toggle() { if (con_win) hide(); else show(); }
40  void print_f(char const *format, ...);
41  ~console();
42} ;
43
44class shell_term : public console
45{
46  char shcmd[300];
47  public :
48  shell_term(window_manager *WM, JCFont *font, int width, int height, char const *Name);
49  virtual ~shell_term() {};
50  int handle_event(event &ev, window_manager *wm);
51  virtual void prompt();
52  virtual void execute(char const *st);
53} ;
54
55#endif
Note: See TracBrowser for help on using the repository browser.