Usermode/AxWin4 - Planning mostly
authorJohn Hodge <[email protected]>
Sun, 11 May 2014 14:38:11 +0000 (22:38 +0800)
committerJohn Hodge <[email protected]>
Sun, 11 May 2014 14:38:11 +0000 (22:38 +0800)
Usermode/Applications/axwin4_src/Notes.txt [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/IWindow.cpp [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/Makefile [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/include/IRegion.hpp [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/include/IVideo.hpp [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/include/IWindow.hpp [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/main.cpp [new file with mode: 0644]

diff --git a/Usermode/Applications/axwin4_src/Notes.txt b/Usermode/Applications/axwin4_src/Notes.txt
new file mode 100644 (file)
index 0000000..638f0db
--- /dev/null
@@ -0,0 +1,41 @@
+Layers:
+
+IPC / Client management
+
+Renderers
+Window Management
+> "WM_CreateWindow(Parent, Class, Name)"
+Window Drawing
+> "WD_Fill"
+> "WD_Blit"
+> "WD_LockSurface"
+> "WD_UnlockSurface"
+Decorations
+> ".InitWindow"
+> ".Render"
++ "WM_SetBorder"
+Compositing
+> Dirty rectangling, use 2DCmd to selectively blit
+> Request kernel/server buffers if possible
+
+
+Server-side rendering primitives:
+ # Apply to regions, rendered in fixed order, each has an ID
+> Auto-scaling bitmaps
+ - Control backed by an image with three five regions per axis
+  Edge Fixed, Fill, Center Fixed, Fill, Edge Fixed
+ - Definition is via two pixel counts (edge width, fill width), rest is derived
+ - Command to switch backing image to another already provided
+> Tiling bitmaps + filled rects
+> Text (single line)
+> Canvas (Takes drawing commands, draws to internal buffer)
+> Shared buffer (of an unspecified pixel format)
+
+=== Config options ===
+- Root App
+- Display device (- = stdout)
+- Keyboard device (- = stdin)
+- Mouse device
+- Pipe suffix, port number, etc.
+- Key bindings
+
diff --git a/Usermode/Applications/axwin4_src/Server/IWindow.cpp b/Usermode/Applications/axwin4_src/Server/IWindow.cpp
new file mode 100644 (file)
index 0000000..4243e33
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * 
+ */
+#include <IWindow.hpp>
+
+namespace AxWin {
+
+
+IWindow::IWindow(const std::string &name):
+       m_name(name)
+{
+}
+
+}      // namespace AxWin
+
diff --git a/Usermode/Applications/axwin4_src/Server/Makefile b/Usermode/Applications/axwin4_src/Server/Makefile
new file mode 100644 (file)
index 0000000..47a936c
--- /dev/null
@@ -0,0 +1,8 @@
+
+include ../../Makefile.cfg
+
+CPPFLAGS := -Iinclude/
+OBJ := IWindow.o
+BIN := AxWinServer
+
+include ../../Makefile.tpl
diff --git a/Usermode/Applications/axwin4_src/Server/include/IRegion.hpp b/Usermode/Applications/axwin4_src/Server/include/IRegion.hpp
new file mode 100644 (file)
index 0000000..8208aa5
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Acess2 GUI v4
+ * - By John Hodge (thePowersGang)
+ *
+ * IRegion.hpp
+ * - Representation of a primitive region in a window (part of the window render list)
+ */
+#ifndef _IREGION_HPP_
+#define _IREGION_HPP_
+
+#include <string>
+#include <vector>
+#include "CRect.hpp"
+
+namespace AxWin {
+
+class IRegion
+{
+protected:
+       CWindow&        m_parentWindow;
+public:
+       virtual IRegion(CWindow& parent, const ::AxWin::Rect& position);
+       virtual ~IRegion();
+       
+       virtual void Redraw(const ::AxWin::Rect& area) = 0;
+       virtual bool SetAttr(unsigned int Index, const IPCAttrib& Value) = 0;
+};
+
+};
+
+#endif
+
diff --git a/Usermode/Applications/axwin4_src/Server/include/IVideo.hpp b/Usermode/Applications/axwin4_src/Server/include/IVideo.hpp
new file mode 100644 (file)
index 0000000..aa4fc52
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Acess2 GUI v4
+ * - By John Hodge (thePowersGang)
+ *
+ * IVideo.hpp
+ * - Graphics backend abstraction
+ */
+#ifndef _IVIDEO_HPP_
+#define _IVIDEO_HPP_
+
+namespace AxWin {
+
+class IVideo
+{
+public:
+       virtual ~IVideo();
+       
+       // Allocate a new hardware surface
+       IHWSurface&     AllocateHWSurface(uint16_t Width, uint16_t Height);
+       
+       // Request redraw of backbuffer
+       void    Flip();
+};
+
+};
+
+#endif
+
diff --git a/Usermode/Applications/axwin4_src/Server/include/IWindow.hpp b/Usermode/Applications/axwin4_src/Server/include/IWindow.hpp
new file mode 100644 (file)
index 0000000..6d91cc1
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Acess2 GUI v4
+ * - By John Hodge (thePowersGang)
+ *
+ * IWindow.hpp
+ * - Window abstract base class
+ */
+#ifndef _IWINDOW_HPP_
+#define _IWINDOW_HPP_
+
+#include <string>
+#include <vector>
+#include "CRect.hpp"
+
+namespace AxWin {
+
+class IWindow
+{
+public:
+       virtual IWindow(const ::std::string &name);
+       virtual ~IWindow();
+       
+       virtual void Repaint() = 0;
+       
+       virtual void MouseButton(int ButtonID, int X, int Y, bool Down);
+       virtual void MouseMove(int NewX, int NewY);
+       virtual void KeyEvent(uint32_t Scancode, const ::std::string &Translated, bool Down);
+protected:
+       const ::std::string     m_name;
+};
+
+}      // namespace AxWin
+
+#endif
+
diff --git a/Usermode/Applications/axwin4_src/Server/main.cpp b/Usermode/Applications/axwin4_src/Server/main.cpp
new file mode 100644 (file)
index 0000000..3953e07
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ */
+#include <ipc.hpp>
+#include <input.hpp>
+#include <timing.hpp>
+
+using namespace AxWin;
+
+// === CODE ===
+int main(int argc, char *argv[])
+{
+       // - Load configuration (from file and argv)
+       // - Open graphics
+       Graphics::Open(/*config.m_displayDevice*/);
+       // - Open input
+       // - Initialise compositor structures
+       // - Prepare global hotkeys
+       // - Bind IPC channels
+       // - Start root child process (from config)
+       
+       // - Event loop
+       for( ;; )
+       {
+                int    nfd = 0;
+               fd_set  rfds;
+               
+               Input::FillSelect(&nfd, &rfds);
+               IPC::FillSelect(&nfd, &rfds);
+               
+               // TODO: Timer events
+               int64_t timeout = Timing::GetTimeToNextEvent();
+               int rv = ::_SysSelect(nfd, &rfds, NULL, &rfds, NULL, 0);
+               
+               Timing::CheckEvents();
+               
+               Input::HandleSelect(&rfds);
+               IPC::HandleSelect(&rfds);
+       }
+       return 0;
+}
+

UCC git Repository :: git.ucc.asn.au