Usermode/axwin4 - Starting on implementation
authorJohn Hodge <[email protected]>
Sat, 17 May 2014 12:14:06 +0000 (20:14 +0800)
committerJohn Hodge <[email protected]>
Sat, 17 May 2014 12:14:06 +0000 (20:14 +0800)
Usermode/Applications/axwin4_src/Notes.txt
Usermode/Applications/axwin4_src/Server/Makefile
Usermode/Applications/axwin4_src/Server/compositor.cpp [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/include/CCompositor.hpp [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/include/CConfig.hpp [new file with mode: 0644]
Usermode/Applications/axwin4_src/Server/main.cpp

index 638f0db..83eff4c 100644 (file)
@@ -1,6 +1,8 @@
 Layers:
 
 IPC / Client management
+Compositor / Window Manager
+Renderer / Window Contents
 
 Renderers
 Window Management
@@ -19,6 +21,10 @@ Compositing
 > Request kernel/server buffers if possible
 
 
+Clients own windows
+Windows are composed of multiple regions that conform to several types (see below)
+- Re-draw is handled by using these regions
+
 Server-side rendering primitives:
  # Apply to regions, rendered in fixed order, each has an ID
 > Auto-scaling bitmaps
index 47a936c..ab82963 100644 (file)
@@ -1,7 +1,7 @@
 
 include ../../Makefile.cfg
 
-CPPFLAGS := -Iinclude/
+CPPFLAGS += -Iinclude/
 OBJ := IWindow.o
 BIN := AxWinServer
 
diff --git a/Usermode/Applications/axwin4_src/Server/compositor.cpp b/Usermode/Applications/axwin4_src/Server/compositor.cpp
new file mode 100644 (file)
index 0000000..db943c5
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Acess2 GUI v4
+ * - By John Hodge (thePowersGang)
+ *
+ * compositor.cpp
+ * - Window compositor
+ */
+#include <CVideo.hpp>
+#include <CCompositor.hpp>
+
+namespace AxWin {
+
+CCompositor*   CCompositor::s_instance;
+
+void CCompositor::Initialise(const CConfigCompositor& config)
+{
+       assert(!CCompositor::s_instance);
+       CCompositor::s_instance = new CCompositor(config);
+}
+
+CCompositor::CCompositor(const CConfigCompositor& config):
+       m_config(config)
+{
+       // 
+}
+
+IWindow* CCompositor::CreateWindow(CClient& client)
+{
+       return new CWindow(client);
+}
+
+void CCompositor::Redraw()
+{
+       // Redraw the screen and clear damage rects
+       if( m_damageRects.empty() )
+               return ;
+       
+       // For all windows, check for intersection with damage rect
+}
+
+void CCompositor::DamageArea(const Rect& area)
+{
+
+}
+
+}      // namespace AxWin
+
diff --git a/Usermode/Applications/axwin4_src/Server/include/CCompositor.hpp b/Usermode/Applications/axwin4_src/Server/include/CCompositor.hpp
new file mode 100644 (file)
index 0000000..f6f2e7f
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Acess2 GUI v4
+ * - By John Hodge (thePowersGang) 
+ *
+ * CCompositor.hpp
+ * - Window Compositor
+ */
+#ifndef _CCOMPOSITOR_H_
+#define _CCOMPOSITOR_H_
+
+
+
+#endif
+
diff --git a/Usermode/Applications/axwin4_src/Server/include/CConfig.hpp b/Usermode/Applications/axwin4_src/Server/include/CConfig.hpp
new file mode 100644 (file)
index 0000000..aff7fc8
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Acess2 GUI v4
+ * - By John Hodge (thePowersGang) 
+ *
+ * CConfig.hpp
+ * - Configuration class
+ */
+#ifndef _CCONFIG_H_
+#define _CCONFIG_H_
+
+#include "CConfigInput.hpp"
+#include "CConfigVideo.hpp"
+#include "CConfigIPC.hpp"
+
+namespace AxWin {
+
+class CConfig
+{
+public:
+       CConfig();
+       
+       bool parseCommandline(int argc, char *argv[]);
+       
+       CConfigInput    m_input;
+       CConfigVideo    m_video;
+       CConfigIPC      m_ipc;
+};
+
+}
+
+#endif
+
index 3953e07..362661a 100644 (file)
@@ -1,7 +1,9 @@
 /*
  */
+#include <CConfig.hpp>
 #include <ipc.hpp>
 #include <input.hpp>
+#include <video.hpp>
 #include <timing.hpp>
 
 using namespace AxWin;
@@ -10,14 +12,26 @@ using namespace AxWin;
 int main(int argc, char *argv[])
 {
        // - Load configuration (from file and argv)
+       CConfig config;
+       try {
+               config.parseCommandline(argc, argv);
+       }
+       catch(const std::exception& e) {
+               fprintf(stderr, "Exception: %s\n", e.what());
+               return 1;
+       }
        // - Open graphics
-       Graphics::Open(/*config.m_displayDevice*/);
+       Graphics::Initialise(config.m_video);
        // - Open input
+       Input::Initialise(config.m_input);
+       //  > Handles hotkeys?
        // - Initialise compositor structures
-       // - Prepare global hotkeys
+       Compositor::Initialise(config.m_compositor);
        // - Bind IPC channels
+       IPC::Initialise(config.m_ipc);
        // - Start root child process (from config)
-       
+       // TODO: Spin up child process
+
        // - Event loop
        for( ;; )
        {
@@ -35,6 +49,8 @@ int main(int argc, char *argv[])
                
                Input::HandleSelect(&rfds);
                IPC::HandleSelect(&rfds);
+               
+               Compositor::Redraw();
        }
        return 0;
 }

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