feat: introduce v2.0 abstraction layer with core types, backend interface, and plugin system
feat: add fade effects with API control and real-time event subscription test: add API integration tests with isolated test environment and coverage reporting build: update Makefile for recursive source finding, dynamic linking, and test targets docs: document abstraction layer, fade effects, and API enhancements in README
This commit is contained in:
+53
-18
@@ -13,7 +13,7 @@
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<h1>DWN</h1>
|
||||
<span class="version">v1.0.0</span>
|
||||
<span class="version">v2.0.0</span>
|
||||
</div>
|
||||
|
||||
<div class="search-box">
|
||||
@@ -47,6 +47,8 @@
|
||||
<div class="nav-section">
|
||||
<div class="nav-section-title">Advanced</div>
|
||||
<a href="architecture.html" class="nav-link active">Architecture</a>
|
||||
<a href="abstraction-layer.html" class="nav-link">Abstraction Layer</a>
|
||||
<a href="plugin-development.html" class="nav-link">Plugin Development</a>
|
||||
<a href="building.html" class="nav-link">Building from Source</a>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -63,6 +65,7 @@
|
||||
<div class="toc-title">On this page</div>
|
||||
<ul class="toc-list">
|
||||
<li><a href="#overview">Overview</a></li>
|
||||
<li><a href="#abstraction">Abstraction Layer</a></li>
|
||||
<li><a href="#modules">Module Structure</a></li>
|
||||
<li><a href="#event-loop">Event Loop</a></li>
|
||||
<li><a href="#data-structures">Core Data Structures</a></li>
|
||||
@@ -72,30 +75,62 @@
|
||||
</div>
|
||||
|
||||
<h2 id="overview">Overview</h2>
|
||||
<p>DWN is written in ANSI C for X11/Xorg. It uses a modular architecture with a global state singleton and event-driven design.</p>
|
||||
<p>DWN is written in ANSI C for X11/Xorg. It uses a modular architecture with a global state singleton and event-driven design. Version 2.0 introduces a comprehensive abstraction layer enabling backend portability and plugin extensibility.</p>
|
||||
|
||||
<h2 id="abstraction">Abstraction Layer (v2.0)</h2>
|
||||
<p>The new abstraction layer provides backend-agnostic types and a plugin system:</p>
|
||||
|
||||
<div class="code-block">
|
||||
<pre><code>┌─────────────────────────────────────────────────────────┐
|
||||
│ DWN Window Manager │
|
||||
│ DWN Application │
|
||||
├─────────────────────────────────────────────────────────┤
|
||||
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
||||
│ │ main │ │ keys │ │ panel │ │ api │ │
|
||||
│ │ loop │ │ handler │ │ render │ │ server │ │
|
||||
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
|
||||
│ │ │ │ │ │
|
||||
│ ┌────┴────────────┴────────────┴────────────┴────┐ │
|
||||
│ │ DWNState (Global Singleton) │ │
|
||||
│ └────┬────────────┬────────────┬────────────┬────┘ │
|
||||
│ │ │ │ │ │
|
||||
│ ┌────┴────┐ ┌────┴────┐ ┌────┴────┐ ┌────┴────┐ │
|
||||
│ │ client │ │workspace│ │ layout │ │ atoms │ │
|
||||
│ │ mgmt │ │ mgmt │ │ engine │ │ (EWMH) │ │
|
||||
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
|
||||
├─────────────────────────────────────────────────────────┤
|
||||
│ X11 / Xlib │
|
||||
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
|
||||
│ │ Layout │ │ Widget │ │ AI Provider │ │
|
||||
│ │ Plugin │ │ Plugin │ │ API │ │
|
||||
│ │ System │ │ System │ │ (future) │ │
|
||||
│ └──────┬──────┘ └──────┬──────┘ └─────────────────┘ │
|
||||
│ │ │ │
|
||||
│ ┌──────┴────────────────┴───────────────────────────┐ │
|
||||
│ │ Abstract Client Manager │ │
|
||||
│ │ (wm_client.h/c - bidirectional sync) │ │
|
||||
│ └───────────────────────┬───────────────────────────┘ │
|
||||
│ │ │
|
||||
│ ┌───────────────────────┴───────────────────────────┐ │
|
||||
│ │ Backend Abstraction Interface │ │
|
||||
│ │ (backend_interface.h - vtable-based) │ │
|
||||
│ └───────────────────────┬───────────────────────────┘ │
|
||||
│ │ │
|
||||
│ ┌───────────────────────┴───────────────────────────┐ │
|
||||
│ │ X11 Backend │ Wayland Backend │ Headless │ │
|
||||
│ │ (complete) │ (future) │ (future) │ │
|
||||
│ └───────────────────────────────────────────────────┘ │
|
||||
└─────────────────────────────────────────────────────────┘</code></pre>
|
||||
</div>
|
||||
|
||||
<h3>Core Abstractions</h3>
|
||||
<ul>
|
||||
<li><strong>wm_types.h</strong> - Abstract handles, geometry, colors, events</li>
|
||||
<li><strong>wm_string.h/c</strong> - Safe dynamic strings</li>
|
||||
<li><strong>wm_list.h/c</strong> - Dynamic arrays</li>
|
||||
<li><strong>wm_hashmap.h/c</strong> - Hash tables</li>
|
||||
<li><strong>wm_client.h/c</strong> - Abstract client type</li>
|
||||
</ul>
|
||||
|
||||
<h3>Plugin System</h3>
|
||||
<ul>
|
||||
<li><strong>Layout Plugins</strong> - Custom window arrangements (tiling, floating, monocle, grid)</li>
|
||||
<li><strong>Widget Plugins</strong> - Panel components (taskbar, clock, system stats)</li>
|
||||
<li><strong>Dynamic Loading</strong> - Load plugins from shared libraries</li>
|
||||
</ul>
|
||||
|
||||
<h3>Backend Interface</h3>
|
||||
<p>The backend interface defines 80+ operations for window management, events, and rendering. Current implementations:</p>
|
||||
<ul>
|
||||
<li><strong>X11</strong> - Full implementation with event translation</li>
|
||||
<li><strong>Wayland</strong> - Planned for future</li>
|
||||
<li><strong>Headless</strong> - For testing and CI</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="modules">Module Structure</h2>
|
||||
<p>Each module has a header in <code>include/</code> and implementation in <code>src/</code>.</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user