diff options
author | Reinhard Tartler <siretart@tauware.de> | 2007-04-05 15:25:19 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2007-04-05 15:25:19 +0200 |
commit | d0c7529cb9833ede3595051df5599a11fe03be48 (patch) | |
tree | 4e63b581f10aa58e714cbf5f08f8c4ade0c09fff /drv_generic_graphic.c | |
parent | 3811bca55e79006fb5c3dc8f25d8ef29ccdda758 (diff) | |
download | lcd4linux-d0c7529cb9833ede3595051df5599a11fe03be48.tar.gz |
import new upstream
Diffstat (limited to 'drv_generic_graphic.c')
-rw-r--r-- | drv_generic_graphic.c | 138 |
1 files changed, 11 insertions, 127 deletions
diff --git a/drv_generic_graphic.c b/drv_generic_graphic.c index 746c7c8..ba569fe 100644 --- a/drv_generic_graphic.c +++ b/drv_generic_graphic.c @@ -1,4 +1,5 @@ -/* $Id: drv_generic_graphic.c,v 1.34 2006/08/14 19:24:22 harbaum Exp $ +/* $Id: drv_generic_graphic.c 745 2007-01-19 05:25:07Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_graphic.c $ * * generic driver helper for graphic displays * @@ -21,129 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * - * $Log: drv_generic_graphic.c,v $ - * Revision 1.34 2006/08/14 19:24:22 harbaum - * Umlaut support, added KVV HTTP-User-Agent - * - * Revision 1.33 2006/08/13 09:53:10 reinelt - * dynamic properties added (used by 'style' of text widget) - * - * Revision 1.32 2006/08/13 06:46:51 reinelt - * T6963 soft-timing & enhancements; indent - * - * Revision 1.31 2006/08/09 17:25:34 harbaum - * Better bar color support and new bold font - * - * Revision 1.30 2006/08/08 20:16:29 harbaum - * Added "extracolor" (used for e.g. bar border) and RGB support for LEDMATRIX - * - * Revision 1.29 2006/07/31 03:48:09 reinelt - * preparations for scrolling - * - * Revision 1.28 2006/06/20 08:50:58 reinelt - * widget_image linker error hopefully finally fixed - * - * Revision 1.27 2006/04/09 17:46:14 reinelt - * vertical bar patch fro graphic displays by Ronald Hopfer - * - * Revision 1.26 2006/04/09 14:17:50 reinelt - * autoconf/library fixes, image and graphic display inversion - * - * Revision 1.25 2006/02/27 07:53:52 reinelt - * some more graphic issues fixed - * - * Revision 1.24 2006/02/27 06:15:55 reinelt - * indent... - * - * Revision 1.23 2006/02/27 06:14:46 reinelt - * graphic bug resulting in all black pixels solved - * - * Revision 1.22 2006/02/24 13:07:10 geronet - * hollow bars for graphic lcd's - * - * Revision 1.21 2006/02/19 07:20:53 reinelt - * image support nearly finished - * - * Revision 1.20 2006/02/08 04:55:05 reinelt - * moved widget registration to drv_generic_graphic - * - * Revision 1.19 2006/02/07 05:36:13 reinelt - * Layers added to Layout - * - * Revision 1.18 2006/01/30 05:47:38 reinelt - * graphic subsystem changed to full-color RGBA - * - * Revision 1.17 2006/01/03 06:13:46 reinelt - * GPIO's for MatrixOrbital - * - * Revision 1.16 2005/12/13 14:07:28 reinelt - * LPH7508 driver finished - * - * Revision 1.15 2005/05/08 04:32:44 reinelt - * CodingStyle added and applied - * - * Revision 1.14 2005/01/18 06:30:23 reinelt - * added (C) to all copyright statements - * - * Revision 1.13 2005/01/09 10:53:24 reinelt - * small type in plugin_uname fixed - * new homepage lcd4linux.bulix.org - * - * Revision 1.12 2004/06/26 12:04:59 reinelt - * - * uh-oh... the last CVS log message messed up things a lot... - * - * Revision 1.11 2004/06/26 09:27:21 reinelt - * - * added '-W' to CFLAGS - * changed all C++ comments to C ones - * cleaned up a lot of signed/unsigned mistakes - * - * Revision 1.10 2004/06/20 10:09:55 reinelt - * - * 'const'ified the whole source - * - * Revision 1.9 2004/06/09 06:40:29 reinelt - * - * splash screen for T6963 driver - * - * Revision 1.8 2004/06/08 21:46:38 reinelt - * - * splash screen for X11 driver (and generic graphic driver) - * - * Revision 1.7 2004/06/01 06:45:30 reinelt - * - * some Fixme's processed - * documented some code - * - * Revision 1.6 2004/03/03 03:47:04 reinelt - * big patch from Martin Hejl: - * - use qprintf() where appropriate - * - save CPU cycles on gettimeofday() - * - add quit() functions to free allocated memory - * - fixed lots of memory leaks - * - * Revision 1.5 2004/02/29 14:30:59 reinelt - * icon visibility fix for generic graphics from Xavier - * - * Revision 1.4 2004/02/24 05:55:04 reinelt - * - * X11 driver ported - * - * Revision 1.3 2004/02/22 17:35:41 reinelt - * some fixes for generic graphic driver and T6963 - * removed ^M from plugin_imon (Nico, are you editing under Windows?) - * - * Revision 1.2 2004/02/18 06:39:20 reinelt - * T6963 driver for graphic displays finished - * - * Revision 1.1 2004/02/15 21:43:43 reinelt - * T6963 driver nearly finished - * framework for graphic displays done - * i2c_sensors patch from Xavier - * some more old generation files removed - * */ /* @@ -186,6 +64,7 @@ #include "plugin.h" #include "layout.h" #include "widget.h" +#include "property.h" #include "widget_text.h" #include "widget_icon.h" #include "widget_bar.h" @@ -194,7 +73,6 @@ #include "drv.h" #include "drv_generic.h" #include "drv_generic_graphic.h" -#include "property.h" #include "font_6x8.h" #include "font_6x8_bold.h" @@ -465,6 +343,7 @@ int drv_generic_graphic_icon_draw(WIDGET * W) unsigned char *bitmap = Icon->bitmap + YRES * Icon->curmap; int layer, row, col; int x, y; + int visible; layer = W->layer; row = YRES * W->row; @@ -482,13 +361,16 @@ int drv_generic_graphic_icon_draw(WIDGET * W) /* maybe grow layout framebuffer */ drv_generic_graphic_resizeFB(row + YRES, col + XRES); + /* Icon visible? */ + visible = P2N(&Icon->visible) > 0; + /* render icon */ for (y = 0; y < YRES; y++) { int mask = 1 << XRES; for (x = 0; x < XRES; x++) { int i = (row + y) * LCOLS + col + x; mask >>= 1; - if (Icon->visible) { + if (visible) { if (bitmap[y] & mask) drv_generic_graphic_FB[layer][i] = fg; else @@ -630,6 +512,7 @@ int drv_generic_graphic_image_draw(WIDGET * W) WIDGET_IMAGE *Image = W->data; int layer, row, col, width, height; int x, y; + int visible; layer = W->layer; row = W->row; @@ -652,10 +535,11 @@ int drv_generic_graphic_image_draw(WIDGET * W) drv_generic_graphic_resizeFB(row + height, col + width); /* render image */ + visible = P2N(&Image->visible); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { int i = (row + y) * LCOLS + col + x; - if (Image->visible) { + if (visible) { drv_generic_graphic_FB[layer][i] = Image->bitmap[y * width + x]; } else { drv_generic_graphic_FB[layer][i] = BG_COL; |