/** * \file * * * \author Bernie Innocenti * * \brief Custom control for graphics LCD emulation (interface) */ #ifndef DRV_LCD_GFX_QT_H #define DRV_LCD_GFX_QT_H // uint8_t #include #include #include #include #define LCD_WIDTH 128 // fwd decls class QSizePolicy; class QPaintEvent; class QResizeEvent; #define CONFIG_EMULLCD_SCALE 1 class EmulLCD : public QFrame { Q_OBJECT public: // Attributes enum { WIDTH = 128, HEIGHT = 64 }; // Construction EmulLCD(QWidget *parent = 0); virtual ~EmulLCD(); // Base class overrides protected: virtual void paintEvent(QPaintEvent *event); #if CONFIG_EMULLCD_SCALE virtual int heightForWidth(int w) const; #endif // Operations public: void writeRaster(uint8_t *raster); // Implementation protected: /// Frame thickness int frame_width; /// Brushes for painting the LCD QColor fg_color; QBrush bg_brush; /// Pixel storage unsigned char raster[(WIDTH + 7 / 8) * HEIGHT]; }; void lcd_gfx_qt_init(Bitmap *lcd_bitmap); void lcd_gfx_qt_blitBitmap(const Bitmap *bm); #endif // DRV_LCD_GFX_QT_H