Add LCD Qt emulator.
[bertos.git] / drv / lcd_gfx_qt.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
5  * All Rights Reserved.
6  * -->
7  *
8  * \version $Id$
9  *
10  * \author Bernardo Innocenti <bernie@develer.com>
11  *
12  * \brief Custom control for graphics LCD emulation (interface)
13  */
14
15 /*#*
16  *#* $Log$
17  *#* Revision 1.1  2006/01/16 03:51:35  bernie
18  *#* Add LCD Qt emulator.
19  *#*
20  *#*/
21
22 #ifndef DRV_LCD_GFX_QT_H
23 #define DRV_LCD_GFX_QT_H
24
25 #include <qframe.h>
26 #include <qcolor.h>
27
28 // fwd decls
29 class QSizePolicy;
30 class QPaintEvent;
31 class QResizeEvent;
32
33
34 class EmulLCD : public QFrame
35 {
36         Q_OBJECT
37
38 public:
39 // Attributes
40         enum { WIDTH = 128, HEIGHT = 64 };
41
42 // Construction
43         EmulLCD(QWidget *parent = 0, const char *name = 0);
44         virtual ~EmulLCD();
45
46 // Base class overrides
47 protected:
48         virtual QSizePolicy sizePolicy() const;
49         virtual QSize sizeHint() const;
50 //      virtual void paintEvent(QPaintEvent *event);
51         virtual void drawContents(QPainter *p);
52
53 // Operations
54 public:
55         void writeRaster(uint8_t *raster);
56
57 // Implementation
58 protected:
59         /// Frame thickness
60         int frame_width;
61
62         /// LCD colors
63         QColor fg_color, bg_color;
64
65         /// Pixel storage
66         unsigned char raster[(WIDTH * HEIGHT) / 8];
67 };
68
69 #endif // DRV_LCD_GFX_QT_H