/* * This Software is the original work of Daniel TUNG * This Software is submitted in partial fulfillment of the * requirements for the degree of BCSE. * Dept. Computer Science, Monash University 2000 * * Copyright (c) 2000 beetung@cs.monash.edu.au * beetung@geocities.com */ #ifndef BOX_H #define BOX_H extern "C" { #include #include #include }; //// //// A box area representing the critical area or so on screen. //// //////////////////////////////////////// class Box { //////////////////////////////////////// public: Box(): xi(-1), yi(-1), xe(-1), ye(-1), data(0) {} Box(int ix, int iy, int ex, int ey, unsigned char *d) : xi(ix), yi(iy), xe(ex), ye(ey), data(d) {} ~Box(); Box(int bpl, int bpp) { bytes_per_line()=(bpl); bytes_per_pixel()=(bpp); } /// /// set the data area /// void setData( unsigned char *d) { data = d; } void setColor(XColor *c) { color = c; } /// /// highlight box /// void drawBoxNow(void) { for (int j=xi; j !=xe; j++) { data[j] =0; } } private: int xi, yi, xe, ye; XColor *color; // color of box highlight unsigned char *data; // data area /// common data across all variables!!! private: static int& bytes_per_line(void) { static int _bpl=-1 ; return _bpl; } static int& bytes_per_pixel(void) { static int _bpp=-1 ; return _bpp; } protected: }; #endif