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