From: John Hodge Date: Sat, 17 May 2014 12:14:06 +0000 (+0800) Subject: Usermode/axwin4 - Starting on implementation X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=12b7fdacb831478b4fdc648f6a146c9d2285b9d6;p=tpg%2Facess2.git Usermode/axwin4 - Starting on implementation --- diff --git a/Usermode/Applications/axwin4_src/Notes.txt b/Usermode/Applications/axwin4_src/Notes.txt index 638f0db9..83eff4cc 100644 --- a/Usermode/Applications/axwin4_src/Notes.txt +++ b/Usermode/Applications/axwin4_src/Notes.txt @@ -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 diff --git a/Usermode/Applications/axwin4_src/Server/Makefile b/Usermode/Applications/axwin4_src/Server/Makefile index 47a936c4..ab829634 100644 --- a/Usermode/Applications/axwin4_src/Server/Makefile +++ b/Usermode/Applications/axwin4_src/Server/Makefile @@ -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 index 00000000..db943c57 --- /dev/null +++ b/Usermode/Applications/axwin4_src/Server/compositor.cpp @@ -0,0 +1,47 @@ +/* + * Acess2 GUI v4 + * - By John Hodge (thePowersGang) + * + * compositor.cpp + * - Window compositor + */ +#include +#include + +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 index 00000000..f6f2e7f1 --- /dev/null +++ b/Usermode/Applications/axwin4_src/Server/include/CCompositor.hpp @@ -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 index 00000000..aff7fc8c --- /dev/null +++ b/Usermode/Applications/axwin4_src/Server/include/CConfig.hpp @@ -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 + diff --git a/Usermode/Applications/axwin4_src/Server/main.cpp b/Usermode/Applications/axwin4_src/Server/main.cpp index 3953e07c..362661ab 100644 --- a/Usermode/Applications/axwin4_src/Server/main.cpp +++ b/Usermode/Applications/axwin4_src/Server/main.cpp @@ -1,7 +1,9 @@ /* */ +#include #include #include +#include #include 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; }