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

Last change on this file since 106 was 106, checked in by Sam Hocevar, 11 years ago
  • Rename the "eh" variable to "wm" because it's a window manager, not an event handler.
  • No longer pass the window manager to functions, there's only one.

Inspired by Win32 Abuse changelog for January 28, 2001:

  • Starting work on singleton code; will get rid of all

references to an arbitrary window_manager* because
there's only going to be one, and it's not ever
going to change.

File size: 1.3 KB
RevLine 
[56]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
[2]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  char *name;
22  public :
23
[106]24  console(JCFont *font, int width, int height, char const *Name);
[2]25  int showing() { return con_win!=NULL; }
26  void show();
27  void hide();
28  void redraw();
29  void put_char(char ch);
30  void do_cr();
31  int screen_w() { return w*fnt->width(); }
32  int screen_h() { return h*fnt->height(); }
33  int wx() { return con_win->x1(); }
34  int wy() { return con_win->y1(); }
35  void draw_cursor();
[39]36  void put_string(char const *st);
[2]37  void draw_char(int x, int y, char ch);
38  void toggle() { if (con_win) hide(); else show(); }
[39]39  void print_f(char const *format, ...);
[2]40  ~console();
41} ;
42
43class shell_term : public console
44{
45  char shcmd[300];
46  public :
[106]47  shell_term(JCFont *font, int width, int height, char const *Name);
[2]48  virtual ~shell_term() {};
[106]49  int handle_event(event &ev);
[2]50  virtual void prompt();
[39]51  virtual void execute(char const *st);
[2]52} ;
53
54#endif
Note: See TracBrowser for help on using the repository browser.