projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop almost all the Qt3 cruft.
[bertos.git]
/
drv
/
lcd_gfx_qt.cpp
diff --git
a/drv/lcd_gfx_qt.cpp
b/drv/lcd_gfx_qt.cpp
index 9ec7f8a57f24acc9b7afac19b176e2947d83eb6e..16d1eab8660bc83aa11cc470844190f93f1afdac 100755
(executable)
--- a/
drv/lcd_gfx_qt.cpp
+++ b/
drv/lcd_gfx_qt.cpp
@@
-14,6
+14,15
@@
/*#*
*#* $Log$
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/05/28 12:17:57 bernie
+ *#* Drop almost all the Qt3 cruft.
+ *#*
+ *#* Revision 1.7 2006/04/27 05:43:08 bernie
+ *#* Fix naming conventions.
+ *#*
+ *#* Revision 1.6 2006/02/20 02:00:40 bernie
+ *#* Port to Qt 4.1.
+ *#*
*#* Revision 1.5 2006/02/15 09:13:16 bernie
*#* Switch to BITMAP_FMT_PLANAR_V_LSB.
*#*
*#* Revision 1.5 2006/02/15 09:13:16 bernie
*#* Switch to BITMAP_FMT_PLANAR_V_LSB.
*#*
@@
-28,7
+37,6
@@
*#*
*#* Revision 1.1 2006/01/16 03:51:35 bernie
*#* Add LCD Qt emulator.
*#*
*#* Revision 1.1 2006/01/16 03:51:35 bernie
*#* Add LCD Qt emulator.
- *#*
*#*/
#include "lcd_gfx_qt.h"
*#*/
#include "lcd_gfx_qt.h"
@@
-36,10
+44,10
@@
#include <cfg/debug.h>
#include <gfx/gfx.h> // CONFIG_BITMAP_FMT
#include <cfg/debug.h>
#include <gfx/gfx.h> // CONFIG_BITMAP_FMT
-#include <
qpainter.h
>
-#include <
qimage.h
>
-#include <
qsizepolicy.h
>
-#include <
qsize.h
>
+#include <
QtGui/QPainter
>
+#include <
QtGui/QImage
>
+#include <
QtGui/QSizePolicy
>
+#include <
QtCore/QSize
>
// Display colors
#define LCD_FG_COLOR 0x0, 0x0, 0x0
// Display colors
#define LCD_FG_COLOR 0x0, 0x0, 0x0
@@
-47,7
+55,7
@@
EmulLCD::EmulLCD(QWidget *parent, const char *name) :
EmulLCD::EmulLCD(QWidget *parent, const char *name) :
- QFrame(parent, name,
WRepaintNoErase |
WResizeNoErase),
+ QFrame(parent, name,
Qt::WRepaintNoErase | Qt::
WResizeNoErase),
fg_color(LCD_FG_COLOR),
bg_color(LCD_BG_COLOR)
{
fg_color(LCD_FG_COLOR),
bg_color(LCD_BG_COLOR)
{
@@
-80,14
+88,15
@@
QSize EmulLCD::sizeHint() const
}
}
-void EmulLCD::
drawContents(QPainter *p
)
+void EmulLCD::
paintEvent(QPaintEvent * /*event*/
)
{
{
+ QPainter p(this);
QImage img(raster, WIDTH, HEIGHT, 1, NULL, 0, QImage::BigEndian);
QImage img(raster, WIDTH, HEIGHT, 1, NULL, 0, QImage::BigEndian);
- p
->setBackgroundMode(
OpaqueMode);
- p
->
setPen(fg_color);
- p
->
setBackgroundColor(bg_color);
- p
->
drawImage(frame_width, frame_width, img);
+ p
.setBackgroundMode(Qt::
OpaqueMode);
+ p
.
setPen(fg_color);
+ p
.
setBackgroundColor(bg_color);
+ p
.
drawImage(frame_width, frame_width, img);
}
void EmulLCD::writeRaster(uint8_t *new_raster)
}
void EmulLCD::writeRaster(uint8_t *new_raster)
@@
-107,7
+116,7
@@
void EmulLCD::writeRaster(uint8_t *new_raster)
uint8_t v = 0;
for (int xbit = 0; xbit < 8; ++xbit)
v |= (new_raster[(xbyte * 8 + xbit) + (y / 8) * WIDTH] & (1 << (y%8)) )
uint8_t v = 0;
for (int xbit = 0; xbit < 8; ++xbit)
v |= (new_raster[(xbyte * 8 + xbit) + (y / 8) * WIDTH] & (1 << (y%8)) )
- ?
(1 << (7 - xbit)) : 0
;
+ ?
0 : (1 << (7 - xbit))
;
raster[y * ((WIDTH + 7) / 8) + xbyte] = v;
}
raster[y * ((WIDTH + 7) / 8) + xbyte] = v;
}
@@
-117,8
+126,7
@@
void EmulLCD::writeRaster(uint8_t *new_raster)
#error Unsupported bitmap format
#endif
#error Unsupported bitmap format
#endif
- QPainter p(this);
- drawContents(&p);
+ repaint();
}
}
@@
-126,13
+134,13
@@
void EmulLCD::writeRaster(uint8_t *new_raster)
#include <gfx/gfx.h>
#include <cfg/debug.h>
#include <gfx/gfx.h>
#include <cfg/debug.h>
-/*!
+DECLARE_WALL(wall_before_raster, WALL_SIZE)
+/**
* Raster buffer to draw into.
*
* Bits in the bitmap bytes have vertical orientation,
* as required by the LCD driver.
*/
* Raster buffer to draw into.
*
* Bits in the bitmap bytes have vertical orientation,
* as required by the LCD driver.
*/
-DECLARE_WALL(wall_before_raster, WALL_SIZE)
static uint8_t lcd_raster[RASTER_SIZE(EmulLCD::WIDTH, EmulLCD::HEIGHT)];
DECLARE_WALL(wall_after_raster, WALL_SIZE)
static uint8_t lcd_raster[RASTER_SIZE(EmulLCD::WIDTH, EmulLCD::HEIGHT)];
DECLARE_WALL(wall_after_raster, WALL_SIZE)
@@
-147,7
+155,7
@@
struct Bitmap lcd_bitmap;
gfx_bitmapClear(&lcd_bitmap);
}
gfx_bitmapClear(&lcd_bitmap);
}
-/*extern "C"*/ void lcd_blit
_b
itmap(Bitmap *bm)
+/*extern "C"*/ void lcd_blit
B
itmap(Bitmap *bm)
{
//FIXME CHECK_WALL(wall_before_raster);
//FIXME CHECK_WALL(wall_after_raster);
{
//FIXME CHECK_WALL(wall_before_raster);
//FIXME CHECK_WALL(wall_after_raster);