Layers:
IPC / Client management
+Compositor / Window Manager
+Renderer / Window Contents
Renderers
Window Management
> 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
include ../../Makefile.cfg
-CPPFLAGS := -Iinclude/
+CPPFLAGS += -Iinclude/
OBJ := IWindow.o
BIN := AxWinServer
--- /dev/null
+/*
+ * 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
+
--- /dev/null
+/*
+ * Acess2 GUI v4
+ * - By John Hodge (thePowersGang)
+ *
+ * CCompositor.hpp
+ * - Window Compositor
+ */
+#ifndef _CCOMPOSITOR_H_
+#define _CCOMPOSITOR_H_
+
+
+
+#endif
+
--- /dev/null
+/*
+ * 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
+
/*
*/
+#include <CConfig.hpp>
#include <ipc.hpp>
#include <input.hpp>
+#include <video.hpp>
#include <timing.hpp>
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( ;; )
{
Input::HandleSelect(&rfds);
IPC::HandleSelect(&rfds);
+
+ Compositor::Redraw();
}
return 0;
}