Switch to BITMAP_FMT_PLANAR_V_LSB.
[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.3  2006/02/15 09:13:16  bernie
18  *#* Switch to BITMAP_FMT_PLANAR_V_LSB.
19  *#*
20  *#* Revision 1.2  2006/02/10 12:33:51  bernie
21  *#* Make emulator display a bit larger.
22  *#*
23  *#* Revision 1.1  2006/01/16 03:51:35  bernie
24  *#* Add LCD Qt emulator.
25  *#*
26  *#*/
27
28 #ifndef DRV_LCD_GFX_QT_H
29 #define DRV_LCD_GFX_QT_H
30
31 #include <qframe.h>
32 #include <qcolor.h>
33
34 // fwd decls
35 class QSizePolicy;
36 class QPaintEvent;
37 class QResizeEvent;
38
39
40 class EmulLCD : public QFrame
41 {
42         Q_OBJECT
43
44 public:
45 // Attributes
46         enum { WIDTH = 128, HEIGHT = 64 };
47
48 // Construction
49         EmulLCD(QWidget *parent = 0, const char *name = 0);
50         virtual ~EmulLCD();
51
52 // Base class overrides
53 protected:
54         virtual QSizePolicy sizePolicy() const;
55         virtual QSize sizeHint() const;
56 //      virtual void paintEvent(QPaintEvent *event);
57         virtual void drawContents(QPainter *p);
58
59 // Operations
60 public:
61         void writeRaster(uint8_t *raster);
62
63 // Implementation
64 protected:
65         /// Frame thickness
66         int frame_width;
67
68         /// LCD colors
69         QColor fg_color, bg_color;
70
71         /// Pixel storage
72         unsigned char raster[(WIDTH * HEIGHT) / 8];
73 };
74
75 #endif // DRV_LCD_GFX_QT_H