lcd_gfx_qt.h

Go to the documentation of this file.
00001 
00039 #ifndef DRV_LCD_GFX_QT_H
00040 #define DRV_LCD_GFX_QT_H
00041 
00042 #include <QtGui/QColor>
00043 #include <QtGui/QFrame>
00044 
00045 // fwd decls
00046 class QSizePolicy;
00047 class QPaintEvent;
00048 class QResizeEvent;
00049 
00050 #define CONFIG_EMULLCD_SCALE 1
00051 
00052 class EmulLCD : public QFrame
00053 {
00054     Q_OBJECT
00055 
00056 public:
00057 // Attributes
00058     enum { WIDTH = 128, HEIGHT = 64 };
00059 
00060 // Construction
00061     EmulLCD(QWidget *parent = 0);
00062     virtual ~EmulLCD();
00063 
00064 // Base class overrides
00065 protected:
00066     virtual void paintEvent(QPaintEvent *event);
00067 
00068     #if CONFIG_EMULLCD_SCALE
00069         virtual int heightForWidth(int w) const;
00070     #endif
00071 
00072 // Operations
00073 public:
00074     void writeRaster(uint8_t *raster);
00075 
00076 // Implementation
00077 protected:
00079     int frame_width;
00080 
00082     QColor fg_color;
00083     QBrush bg_brush;
00084 
00086     unsigned char raster[(WIDTH + 7 / 8) * HEIGHT];
00087 };
00088 
00089 #endif // DRV_LCD_GFX_QT_H