home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / powervww / pvhgr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-05  |  2.7 KB  |  78 lines

  1. //  ____________________________________________________
  2. // |                                                    |
  3. // |  Project:     POWER VIEW INTERFACE                 |
  4. // |  File:        PVHGR.H                              |
  5. // |  Compiler:    WPP386 (10.6)                        |
  6. // |                                                    |
  7. // |  Subject:     Support for graphics-mode version    |
  8. // |                                                    |
  9. // |  Author:      Emil Dotchevski                      |
  10. // |____________________________________________________|
  11. //
  12. // E-mail: zajo@geocities.com
  13. // URL:    http://www.geocities.com/SiliconValley/Bay/3577
  14.  
  15. #ifndef _PVHGR_H
  16. #define _PVHGR_H
  17.  
  18.   #define HGR_MAX_BUFFERS       16
  19.  
  20.   class Thgr : public Titem
  21.   {
  22.     public:
  23.       int hgr_cols, hgr_rows; //width, height in pixels
  24.       int hgr_max_x, hgr_max_y;
  25.       char id; //attr identifier
  26.       char *buffer; //image buffer
  27.       size_t buf_size; //size of the image buffer
  28.       char color; //current color
  29.       Thgr( int _xl, int _yl );
  30.       virtual ~Thgr( void );
  31.       void set_color( char _color );
  32.       virtual void clear( void ) = 0;
  33.       virtual void set_pixel( int _x, int _y ) = 0;
  34.       virtual void line( int x1, int y1, int x2, int y2 ) = 0;
  35.       virtual void draw( char *screen, int l ) = 0;
  36.       virtual void refresh( void )=0;
  37.  
  38.     protected:
  39.       virtual size_t get_buf_size( int _xl, int _yl ) = 0; //calculate buffer size depending on the requested item size
  40.       virtual boolean set_buf_size( int _xl, int _yl ) = 0; //realloc buffer as requested by _xl, _yl
  41.       virtual void resize( int _xl, int _yl );
  42.       virtual void set_palette( void );
  43.       virtual void draw( void );
  44.       virtual void initialize( void );
  45.   };
  46.  
  47.   class Tplane : public Thgr
  48.   {
  49.     public:
  50.       char *plane0; //plane0 data image
  51.       char *plane1; //plane1 data image
  52.       char *plane2; //plane2 data image
  53.       char *plane3; //plane3 data image
  54.       int *mul_table; //multiply table for buffer rows
  55.       size_t plane_size; //size of a plane buffer
  56.       Tplane( int _xl, int _yl );
  57.       virtual void clear( void );
  58.       virtual void set_pixel( int _x, int _y );
  59.       virtual void line( int x1, int y1, int x2, int y2 );
  60.       virtual void draw( char *screen, int l );
  61.  
  62.     protected:
  63.       virtual size_t get_buf_size( int _xl, int _yl ); //calculate buffer size depending on the requested item size
  64.       virtual boolean set_buf_size( int _xl, int _yl ); //realloc buffer as requested by _xl, _yl
  65.   };
  66.  
  67. #endif
  68.  
  69. #ifdef DECLARE_PVHGR
  70.   #define GLOBAL
  71. #else
  72.   #define GLOBAL extern
  73. #endif
  74.  
  75.   GLOBAL Thgr *hgrs[HGR_MAX_BUFFERS];
  76.  
  77. #undef GLOBAL
  78.