Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Revision:
12:63db16fea709
Parent:
8:a460cabc85ac
Child:
18:d849f3ada858
--- a/Core/GUI.h	Fri Apr 22 16:12:42 2016 +0000
+++ b/Core/GUI.h	Sun May 08 14:42:08 2016 +0000
@@ -1,42 +1,34 @@
 #ifndef SIMPLEGUI_GUI_H
 #define SIMPLEGUI_GUI_H
 
-#include "GraphicsDisplay.h"
-#include "EventDispatcher.h"
-#include "FontRenderer.h"
+class GUI;
+
+#include "rtos.h"
+
+#include "GraphicsContext.h"
+#include "Window.h"
 
 /**
 * A singleton class to hold the framework components
 **/
-class GUI {
-    public:
-    
-    GUI(GraphicsDisplay* display, EventDispatcher* dispatcher, FontRenderer* fontRenderer, Font* defaultFont) 
-    : _display(display), _dispatcher(dispatcher), _renderer(fontRenderer), _font(defaultFont)
-    
-    {}
-    
-    GraphicsDisplay* display() {
-        return _display;
-    }
+class GUI
+{
+
+public:
+
+    GUI(GraphicsContext* context);
+
+    GraphicsContext* getGraphicsContext();
+    Window *rootWindow();
     
-    EventDispatcher* eventDispatcher() {
-        return _dispatcher;
-    }
-    
-    FontRenderer* fontRenderer() {
-        return _renderer;
-    }
+    void queueEvent(const Event e);
+    void pumpEvents();
+    void updateWindow();
     
-    Font* defaultFont() {
-        return _font;
-    }
-    
-    private:
-    
-    GraphicsDisplay* _display;
-    EventDispatcher* _dispatcher;
-    FontRenderer* _renderer;
-    Font* _font;
+private:
+
+    GraphicsContext* _context;
+    Mail<Event, 64> _mailbox;
+    Window _rootWindow;
 };
 #endif
\ No newline at end of file