home *** CD-ROM | disk | FTP | other *** search
- // ┌───────┐
- // ─────────>│ AVNER │
- // ─────────>│ BEN │──────> Software Engineering Method
- // └───────┘
- // 10 Dov-Hoz st. Tel-Aviv 63416 Israel tel. 972-3-221535
-
- // The Screen NAVigator, ver 1.10 April 1990
- // Copyright (c) 1989 by Avner Ben
- // Snav is not, and never was, free software.
- // for conditions for use refer to file "copyrigh.txt"
-
- // The Screen Navigator is an object-oriented device-independent
- // character-graphics driver package, written in the C++ language,
- // distributed in the form of C++ source code.
- // For further information refer to the documentation files.
-
- // this simple example is intended as a template to be extended and modified
- // by the user, provided the above title and copyright notice are unchanged
- // and are not ommitted.
-
- /***************************************************************************/
-
- // demonstration part 1 - headers.
- // a simplistic screen driver for the IBM-PC/compatiable running MS-DOS,
- // implementing the virtual functions of the generic screen-driver supplied
- // in snav-2.
- // This simple demo is very device-specific, addressing the machine's
- // internal architecture (it is a "misbehaved" program). It is also
- // Zortech-specific, in assuming the existence of some names and include
- // files.
- // Do not compile with the /Ansi switch on, because dos.h uses far-pointers.
-
- // 28.8.89 avner ben coded.
- ////// snav v1.0
- // 26.10.89 avner ben - adpated for snav demo.
- ////// snav v1.1
- // 13.12.89-11.4.90 avner ben:
- // * added class square_pos and removed to snav2 * added color and cursor
- // processing * removed some function to generic driver *
-
- // site history (of this copy):
- // __.__.__: __________________
-
- #ifndef DEMO1_H
-
- #define DEMO1_H
- #ifndef SNAV2_H
- #include "snav2.hpp"
- #endif
-
- class memory_mapped_pc_screen : public panel
- { // implementation of the generic class panel, assuming PC architecture
-
- private :
- struct vd_char { // video cell
- char c;
- unsigned char color;
- } *vdc, *stvdc;
- unsigned int color_code; // internal-format color combi
- struct save_screen {
- char *s;
- save_screen *next;
- void kill(void);
- } *svbuf;
- color_ind decode_color(unsigned int color_code);
- unsigned int encode_color(const color_ind &color);
-
- public :
- memory_mapped_pc_screen(square_pos *window=NULL,
- boolean wrap_around=FALSE);
- // default size 1:1x25:80
-
- char get_c(point_pos *pt);
- // get char displayed in specified position (no kbd input)
- void put_c(char c, point_pos *pt, direction *dir);
- // write a character on screen
- void put_color(const color_ind &at, point_pos *pt);
- // set color locally
- void put_attr(vd_attr at, point_pos *pt);
- // toggle attribute in specified/cursor position
- void put_background(vd_clr colornum, point_pos *pt);
- // set background color in specified/cursor position
- void put_forground(vd_clr colornum, point_pos *pt);
- // set forground color in specified/cursor position
- boolean get_attr(vd_attr at, point_pos *pt);
- // retrieve color locally
- color_ind get_color(point_pos *pt);
- // retrieve color locally
- void posit(point_pos *pt);
- // position cursor
- void fix(void);
- void save(void);
- void restore(void);
- unsigned int ask_cursor(void);
- void set_cursor(unsigned int cursor_type);
- unsigned int hide_cursor(void);
- };
-
- #endif
-
-