lcd_gfx_qt.h

Go to the documentation of this file.
00001 
00040 /*#*
00041  *#* $Log$
00042  *#* Revision 1.5  2006/05/28 12:17:57  bernie
00043  *#* Drop almost all the Qt3 cruft.
00044  *#*
00045  *#* Revision 1.4  2006/02/20 02:00:40  bernie
00046  *#* Port to Qt 4.1.
00047  *#*
00048  *#* Revision 1.3  2006/02/15 09:13:16  bernie
00049  *#* Switch to BITMAP_FMT_PLANAR_V_LSB.
00050  *#*
00051  *#* Revision 1.2  2006/02/10 12:33:51  bernie
00052  *#* Make emulator display a bit larger.
00053  *#*
00054  *#* Revision 1.1  2006/01/16 03:51:35  bernie
00055  *#* Add LCD Qt emulator.
00056  *#*
00057  *#*/
00058 
00059 #ifndef DRV_LCD_GFX_QT_H
00060 #define DRV_LCD_GFX_QT_H
00061 
00062 #include <QtGui/QColor>
00063 #include <QtGui/QFrame>
00064 
00065 // fwd decls
00066 class QSizePolicy;
00067 class QPaintEvent;
00068 class QResizeEvent;
00069 
00070 
00071 class EmulLCD : public QFrame
00072 {
00073     Q_OBJECT
00074 
00075 public:
00076 // Attributes
00077     enum { WIDTH = 128, HEIGHT = 64 };
00078 
00079 // Construction
00080     EmulLCD(QWidget *parent = 0, const char *name = 0);
00081     virtual ~EmulLCD();
00082 
00083 // Base class overrides
00084 protected:
00085     virtual QSizePolicy sizePolicy() const;
00086     virtual QSize sizeHint() const;
00087     virtual void paintEvent(QPaintEvent *event);
00088 
00089 // Operations
00090 public:
00091     void writeRaster(uint8_t *raster);
00092 
00093 // Implementation
00094 protected:
00096     int frame_width;
00097 
00099     QColor fg_color, bg_color;
00100 
00102     unsigned char raster[(WIDTH * HEIGHT) / 8];
00103 };
00104 
00105 #endif // DRV_LCD_GFX_QT_H