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