CppExt Backend Overview
The CppExt folder contains all C++-based backend singletons and utility classes used by Uniquenium. These classes are registered into the QML type system via QML_SINGLETON and can be accessed directly in QML by their type name without instantiation.
Architecture
┌─────────────────────────────────────────────────────┐
│ Uniquenium App │
│ main.qml ─── Creates UniDeskComManager instance │
└────────────┬────────────────────────────────────────┘
│ passes comManager property
▼
┌─────────────────────────────────────────────────────┐
│ UniDesk Controls / Components (QML) │
│ ├─ UniDeskWindow / UniDeskButton / UDCText ... │
│ └─ Accesses services via comManager │
└────────────┬────────────────────────────────────────┘
│ import UniDesk 1.0
▼
┌─────────────────────────────────────────────────────┐
│ CppExt C++ Singleton Layer │
│ ├─ UniDeskGlobals Global theme state │
│ ├─ UniDeskSettings User settings persistence │
│ ├─ UniDeskTools General utility functions │
│ ├─ UniDeskExpr Expression engine │
│ ├─ UniDeskSystemInfo System information │
│ ├─ UniDeskPluginMgr Plugin loading/management │
│ ├─ UniDeskTempleteMgr Template import/export │
│ ├─ UniDeskComponentsData Component data persistence│
│ └─ ... │
└─────────────────────────────────────────────────────┘Access
All CppExt singletons are registered via QML_SINGLETON + QML_NAMED_ELEMENT. After import UniDesk 1.0, they can be accessed directly:
qml
import UniDesk 1.0
// Read system theme
console.log("Theme:", UniDeskGlobals.isLight ? "Light" : "Dark")
// Get CPU usage
var stats = UniDeskSystemInfo.getSystemStats()
console.log("CPU:", stats.cpu.usagePercent, "%")
// Evaluate expression
var text = UniDeskExpr.convertStr("Current CPU: %{cpu}%")Relationship with UniDeskComManager
CppExt singletons are responsible for low-level data and native features, while UniDeskComManager (a QML control) is responsible for organizing components and pages at a higher level:
UniDeskComManagercalls methods onUniDeskComponentsDatafor persistence when creating/saving/loading components- Template import/export is handled by
UniDeskTempleteMgr, which signalsUniDeskComManagerto rebuild components - After plugins are loaded by
UniDeskPluginMgr, the newly registered types are merged intoUniDeskComManager.type_list
Documentation Index
| Class | Category | Description |
|---|---|---|
| UniDeskGlobals | Global State | Theme mode, app quit signal, i18n |
| UniDeskSettings | Global State | User settings read/write |
| UniDeskTools | Utilities | Colors, system commands, fonts, wallpapers, UUID, auto-start |
| UniDeskExpr | Expression Engine | %{value} evaluation, API response parsing |
| UniDeskSystemInfo | System Info | CPU, memory, network, battery real-time data |
| UniDeskPluginMgr | Plugin Manager | DLL plugin load, unload, type registration |
| UniDeskTempleteMgr | Template System | Template save, load, list refresh, media handling |
| UniDeskComponentsData | Data Persistence | Page/component JSON read/write |
| UniDeskPluginInterface | Plugin Interface | Abstract base class for C++ plugins |

