home *** CD-ROM | disk | FTP | other *** search
- //
- // *************************************************************************
- // * *
- // * OMEGA C++ Windowing Class Library *
- // * ================================= *
- // * *
- // * Copyright 1991,92 Tom Clancy *
- // * Submitted to the public domain, April 1992 *
- // * *
- // *************************************************************************
- // * *
- // * Screen Class Object *
- // * *
- // *************************************************************************
- //
-
-
- #ifndef _OMSCREEN
- #define _OMSCREEN
- #endif
-
- #ifndef _OMEVENT
- #include "omevent.hpp"
- #endif
-
-
- #define DOUBLEBAR 1
- #define SINGLEBAR 0
-
- #define v80x25 0
- #define wisev80x30 1
- #define wisev80x43 2
- #define wisev80x60 3
-
- #define wisev132x25 4
- #define wisev132x30 5
- #define wisev132x43 6
- #define wisev132x60 7
-
- #define ON 1
- #define OFF 0
-
- #define TRUE 1
- #define FALSE 0
-
- enum boxchars {
- vertbar,
- horizbar,
- upperleft,
- upperright,
- bottomleft,
- bottomright,
-
- };
-
- enum Shdirection {
- shNoshadow,
- shTopleft,
- shTopright,
- shBottomleft,
- shBottomright,
- };
-
-
- int video_mode();
- void OMEGA_SETUP();
-
- class oScreen : public event_handler {
-
- char far *vscreen;
- char far *screenbuff;
-
- int FGcolor, BKcolor;
- int Fillchar;
- static int vActive;
-
-
- public:
-
- struct image {
- int len, wid;
- char *i;
- };
-
- oScreen();
-
- // screen setting methods
-
- virtual void setfgcolor(int fg) {FGcolor=fg;}
- virtual void setbkcolor(int bk) {BKcolor=bk;}
- void setfillchar(int c) {Fillchar=c;}
- void setvidmode(int m);
- void restoreoldvmode();
- int setvga43();
- int setvga50();
-
- virtual int getfgcolor() {return FGcolor;}
- virtual int getbkcolor() {return BKcolor;}
- int getfillchar() {return Fillchar;}
- int getscreenlen();
- int getscreenwid();
- unsigned getvvseg();
- unsigned getvvofs();
-
- // fastwrite methods
-
- virtual void writeat(int x, int y, int fg, int bk, char *str);
- virtual void plainwriteat(int x, int y, char *str);
- virtual void chwriteat(int x, int y, int fg, int bk, unsigned char c);
- virtual void plainchwriteat(int x, int y, unsigned char c);
- virtual void writeshadow(int x, int y);
- void writecenter(int y, int fg, int bk, char *str);
- void writebetween(int y, int x1, int x2, int fg, int bk, char *str);
-
- virtual void attribln(int y, int x1, int x2, int fg, int bk);
- void fillarea(int x, int y, int x2, int y2, int fg, int bk, char c);
- void fillscreen(int fg, int bk, char c);
- void clearline(int y, int fg, int bk);
- void clearline(int y, int x1, int x2, int fg, int bk);
- void attribarea(int x, int y, int x2, int y2, int fg, int bk);
- void attribscreen(int fg, int bk);
- void clrscr();
-
- void drawline(int y, int x1, int x2, int fg, int bk, int style);
- void drawbox(int x, int y, int x2, int y2, int fg, int bk, int style);
- void drawhollowbox(int x, int y, int x2, int y2, int fg, int bk, int style);
-
- // Absolute Screen Writes (for use with things that need to be absolute!)
-
- void abswritecenter(int y, int fg, int bk, char *str);
- void abswritebetween(int y, int x1, int x2, int fg, int bk, char *str);
- void absfillarea(int x, int y, int x2, int y2, int fg, int bk, char c);
- void absfillscreen(int fg, int bk, char c);
- void absclearline(int y, int fg, int bk);
- void absclearline(int y, int x1, int x2, int fg, int bk);
- void absattribarea(int x, int y, int x2, int y2, int fg, int bk);
- void absattribscreen(int fg, int bk);
- void absclrscr();
- void absdrawline(int y, int x1, int x2, int fg, int bk, int style);
- void absdrawbox(int x, int y, int x2, int y2, int fg, int bk, int style);
-
- // cursor methods
-
- void cursoron();
- void cursoroff();
- void linecursor();
- void blockcursor();
- virtual void movexy(int x, int y);
- virtual void wherexy(int &x, int &y);
-
- // screen and image saving methods
-
- void save_screen();
- void show_screen();
- void restore_screen();
- char *save_image(int x, int y, int x2, int y2, image &im);
- void show_image(int x, int y, image im);
- void restore_image(int x, int y, image &im);
-
- // virtual screen methods
-
- void activate_virtual();
- void deactivate_virtual();
- void display_virtual();
- void run(){return;}
- };
-
-