Display text on LCD displays (even on multiple ones). Allow to create windows (frames) on display, and to combine them (split, add, duplicate, scroll). See http://mbed.org/users/hlipka/notebook/lcdwindow/ for more information.

Dependents:   Mbell

Revision:
3:e5d5e2fe4bf6
Parent:
2:5ac5bab7daaf
--- a/window.h	Sat Nov 27 22:54:13 2010 +0000
+++ b/window.h	Sun Nov 28 22:09:54 2010 +0000
@@ -25,6 +25,7 @@
 #define WINDOW_H_
 
 #include "Stream.h"
+#include "semaphore.h"
 
 using namespace mbed;
 
@@ -55,7 +56,7 @@
     */
     virtual void clear()=0;
 
-    /** 
+    /**
     * set (internal) cursor to a screen column and row
     *
     * @param column  The horizontal position from the left, indexed from 0
@@ -74,7 +75,7 @@
     virtual void character(int column, int row, int c)=0;
 
 #if DOXYGEN_ONLY
-    /** 
+    /**
      * Write a character to the LCD, on the position specified by the cursor
      * sets the cursor to the next position, and wraps (from right to left, next line, and from bottom back to top)
      *
@@ -82,7 +83,7 @@
      */
     int putc(int c);
 
-    /** 
+    /**
      * Write a formated string to the LCD, on the position specified by the cursor
      * does wrap around (as specified by putc)
      *
@@ -92,6 +93,12 @@
     int printf(const char* format, ...);
 #endif
 protected:
+    /**
+     * base constructor
+     * initializes the _guard semaphore needed for syncing parallel writes
+    */
+    Window();
+
     // Stream implementation functions
     virtual int _putc(int value);
     virtual int _getc() {
@@ -100,6 +107,8 @@
 
     int _column;
     int _row;
+
+    Semaphore *_guard;
 };
 
 #endif /*WINDOW_H_*/