DEV Community

Cover image for UltraCanvas: a cross-platform C++20 GUI framework for Windows, Linux, macOS and the browser
Adebayo Emmanuel
Adebayo Emmanuel

Posted on Edited on

UltraCanvas: a cross-platform C++20 GUI framework for Windows, Linux, macOS and the browser

Most C++ desktop projects hit the same choice early. Pick one native toolkit and accept that the other platforms are an afterthought, or pick an abstraction layer and accept that nothing quite behaves like the platform underneath.

That is why so much software still ships on one platform, and the GUI API is usually the reason. UltraCanvas goes the other way: it keeps each system's own windowing and rendering stack and puts one C++20 API in front of it, so the same application is a native build on Windows, macOS and Linux rather than one renderer pretending to be all three. Android and iOS are planned next.

WebAssembly is the fourth target, not the point of the project. The same code compiles to it, which is how the browser demo exists, but the desktop builds are the ones people ship.

I spent the last few weeks running its builds on an ordinary Windows laptop and a Linux install. This is what I found, including the parts that are not ready.

Disclosure

I work with the ULTRA OS team on developer outreach, and UltraCanvas is the graphics layer of that project. Everything below comes from builds I ran myself, or from facts I asked the maintainer to confirm. Where a number is his measurement rather than mine, I say so.

What UltraCanvas is

UltraCanvas is a cross-platform C++20 GUI framework, built with CMake and released under the MIT licence. It gives you one API for windowing, rendering, input and events, with the platform-specific code kept in separate folders:

  • Linux: X11 and Cairo
  • Windows: Win32 and Direct2D
  • macOS: Cocoa and Core Graphics
  • WebAssembly: the same API compiled for the browser

Text rendering runs on FreeType, Pango and HarfBuzz. Image work goes through libvips, with ImageMagick where a format needs it. The repository layout makes the promise checkable: a public include set, a platform-independent core, and one folder per operating system. If the abstraction holds, those folders should be the only code that knows which OS it is running on. From what I could see in the tree, that is how it is arranged.

It also builds as a shared library, so it can be loaded from other languages through an FFI instead of being usable only from C++.

The framework is one of ten public repositories by ULTRA OS that together form a small platform. UltraCanvas draws the interface, FileLoader handles files, UltraNet handles protocols, UltraAI handles model providers, PixelFX handles bitmaps, and IODeviceManager handles hardware. The project describes the result as a complete visualisation framework for any application, and the module list is the evidence for that description.

Where it sits among C++ GUI frameworks

Qt's design dates to 1991 and its first public release to 1995. The youngest of the established cross-platform C++ toolkits is roughly a decade old. That age is visible in the architecture: a meta-object compiler, a separate UI description language, and layers that exist largely to manage the legacy. It is visible in the maturity too, and any fair comparison starts there. Qt has tooling, documentation and a talent pool that a young framework cannot match.

The aims are different as well. Qt covers everything from embedded devices to enterprise desktops. UltraCanvas is aimed at desktop applications built around documents, data and drawing: file managers, editors, viewers, CAD tools and charting. That narrower target is why a DWG decoder and a chart engine can ship in the same box as the window manager.

It also explains the dependency policy. UltraCanvas does not try to reinvent every layer. It uses capable open source libraries where they exist, including Cairo, Pango, HarfBuzz, libvips, poppler and librevenge, and groups them into logical modules behind one API. The goal is a better package for the user and for the programmer, which is a modest sentence that explains most of the design decisions below.

Try it in a browser before you build anything

If you read nothing else, open this:

https://ultraos.eu/wasm/UltraCanvasDemo.html

That is the demo application compiled to WebAssembly. It is the same framework and the same codebase as the desktop builds, compiled for the browser, not a web-only version. The first load pulls about 50 MB, because it ships the whole API plus the sample application in one payload rather than a trimmed hello world. For scale, that is roughly what a single Electron app weighs before it does anything useful. On a fast connection it takes a few seconds. On a phone, wait it out once and it caches.

What loads is a component browser where every entry carries a status marker: what works, what is partial, what is planned. The demo includes hundreds of examples, 29 chart types and 32 diagram types. The same demo application is available as a download for Windows, Linux and macOS from the project site, if you would rather run it natively.

The modules behind the framework

The API is only half the design. The other half is a set of modules that a desktop application usually ends up assembling from unrelated libraries:

  • FileLoader: load, save and convert across bitmap, vector, 3D, text, audio and movie formats, and keep the application up to date as those formats change. An application built on it stops caring what format the user shows up with.
  • UltraNet: one surface for HTTP and HTTPS, WebSocket, FTP and SFTP, TCP and UDP, TLS and DNS, with plugins for SMTP, IMAP, MQTT, SSH, LDAP, RTSP and gRPC.
  • UltraAI: a single C++ surface for chat, vision, speech, generation and translation, backed by interchangeable providers: cloud services, local models, or in-process mocks for tests.
  • PixelFX: bitmap manipulation built on libvips and ImageMagick behind a C++20 API.
  • IODeviceManager: scanners, cameras, GPIO and other hardware behind one abstraction layer.

The wider family, some of it still in development, adds UltraCrypt for local vaults, UltraVault for credentials, UltraCloud for storage, UltraDatabase, and smart home drivers for Matter, Thread, Zigbee and Z-Wave.

The bet is the same in each case. An application written against these modules stays portable, and the layers underneath can change without application code noticing.

What already runs on it

Framework claims are cheap. Working applications are the proof, and the repositories include a stack of them. I ran most of these:

  • UltraFiler is the file manager and the best demonstration of the stack. It previews SVG artwork properly, where Explorer shows a generic icon. Image metadata is shown inline. Favourite folders can be pinned. It speaks FTP and SFTP, and the format list in its settings is longer than any file manager I have used. The maintainer measures ZIP extraction at roughly four to five times Explorer's speed on his machine. I could not reproduce that ratio on my hardware, but the cause is visible: Explorer draws an icon for every file as it extracts, and UltraFiler deliberately does not, because themed icons were dropped from the extraction path when they made it unusably slow.
  • Texter is the editor, with syntax highlighting and a Markdown preview that kept up with everything I typed. It also detects the language for spellchecking automatically, and lets you switch language from the context menu without opening system settings. Small thing, but I have not seen another editor do it.
  • UltraViewer opens images, video, audio, PDF, Word and Excel documents, and exports between them. Load an SVG, save it as a JPG at whatever size you set. The preview pane also lets you change the background colour, which matters when you are checking artwork with transparent areas.
  • UltraMail is the mail client, with favicons per sender and a copy button for login codes. It is planned to stay free as the entry point to the ecosystem.
  • UltraAuthenticator implements standard TOTP: six digits, thirty seconds, the same format Google Authenticator uses. It completed Google's own enrolment check, which is a stronger signal than any feature list.
  • CoderBox is a cross-platform programming IDE built on the same framework, still in testing.
  • Also in the repositories: UltraPaint, ArtCreator, ChatCube, UltraAI, UltraCleaner, UltraNetMonitor and UltraClipboard, plus a demo application that previews every ULTRA OS module in one place.

Native DWG and the file format problem

Two details matter for anyone writing document or engineering software.

First, there is a native DWG decoder in the tree, covering AutoCAD drawings from R13 through R2018 and the whole drawing family (.dwg, .dwt, .dws, .bak), with no external CAD engine called out to. Writing DWG files goes through GNU LibreDWG's converter instead, which is an optional external step. If you have ever shipped a viewer that needed a CAD library the size of the application itself, that difference is obvious.

Second, the plugin system covers CDR through librevenge, XAR, PDF through poppler, and the common bitmap formats: PNG, JPG, BMP, GIF, AVIF, WebP and QOI. Vector formats include SVG, EPS, EMF, WMF, AI and DXF.

The "improve details" philosophy

The maintainer calls it improve details, and it shows up in small decisions rather than headline features.

UltraFiler dropped themed icons during ZIP extraction because drawing them made extraction unusably slow. Speed won. Texter switches spellcheck language from the context menu instead of sending you into system settings. UltraViewer lets you change the preview background so transparent artwork is visible against the right colour. None of these would make a feature list. They are the ones a user notices after a week.

The rule behind them is consistent: details matter, but not at the cost of the thing the application is for.

Developer experience: plain C++20, no meta-object compiler

UltraCanvas does not use a meta-object compiler, QML or a runtime virtual machine. Signals and callbacks are std::function and lambdas. The build is CMake, and a first build looks like this:

mkdir build && cd build
cmake ..
make
Enter fullscreen mode Exit fullscreen mode

On Ubuntu or Debian the dependencies are the usual suspects: build-essential, cmake, libcairo2-dev, libpango1.0-dev, libfreetype6-dev, libvips-dev, libharfbuzz-dev and clang.

The API style is deliberate. Where C++ libraries often ask for bitmask flags and magic numbers, UltraCanvas uses Pascal-style enumerations, so a call reads like a sentence instead of a puzzle. Whether that matters to you is a matter of taste, but it is consistent across the framework.

Where things stand

The framework is further along than the applications, and the project is unusually willing to show it. The component browser marks every component's status, and nothing pretends to be finished before it is. A few notes from testing:

  • Some applications are done (Texter, UltraFiler). Others are early and it shows (UltraPaint and ArtCreator are still in testing).
  • UltraMail needs an OAuth client for full Gmail sign-in, though an app password works today. UltraAI's translation and generation features are waiting on provider keys.
  • On Windows, the maintainer recommends Windows 11 for now. Some applications still have rough edges on Windows 10.
  • There are no published framework-wide benchmarks, and I would distrust any for a project this young.
  • Fixes move fast. Favicons and a login-code copy button in UltraMail, and pinned folders in UltraFiler, all landed in new builds within days of my asking.
  • The payment side is still being set up, so nothing is on sale yet.

Roadmap

The desktop environment, UltraDesktop, is the next release. The plan is free on Linux and paid on macOS and Windows.

Further out: a Vulkan backend, Wayland support, 3D model loading, and smart home drivers. The operating system itself comes in two phases. A Linux-based desktop first, with CachyOS as the base, then a custom kernel and drivers later. The stated goal for the OS is a prompt-free desktop, where installing software never means opening a terminal and typing a command. The project is self-funded, which explains both the pace and the ambition.

A follow-up will put the same window side by side in UltraCanvas and in Win32, with the actual code for both.

Common questions

Is UltraCanvas a Qt alternative?
It is an alternative for desktop applications that want a permissive licence, plain C++20 without a meta-object compiler, and a smaller dependency set. Qt is far more mature, has better tooling and a much larger ecosystem, and any honest comparison has to start there.

Does it run on Windows 10?
Yes, with rough edges. Windows 11 is the recommended target for now.

Is it ready for production?
Parts of it are. Texter and UltraFiler behave like finished applications. The framework is stable enough to build with, and the component browser tells you which pieces are still moving.

Links

MIT licensed, early, and still moving. Bug reports are being acted on within days.

Top comments (0)