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