Classeine
C++ application platform
Loading...
Searching...
No Matches
classeine

Classeine is a modern C++ framework for building rich, portable UI applications.

It provides a structured system for building graphical applications based on a hierarchical control tree, a virtual windowing layer, and an application composition framework. The design separates UI logic from platform windowing, while still running efficiently on top of SDL2.

The framework is modular and organized into four main components: core infrastructure, rendering and layout system, UI toolkit, and application-level composition.

It is currently in an early stage of development.


Architecture

Classeine is organized into four modules, each with a clear responsibility:

<tt>clsn::core</tt>

Provides foundational infrastructure such as utilities, entity system, logging, virtual filesystem, and general-purpose primitives.

<tt>clsn::draw</tt>

Defines geometric types, layout containers, and rendering abstractions used across the UI system.

<tt>clsn::ui</tt>

The UI toolkit of the framework. It includes the control system, layout management, event handling, focus system, theming, and a virtual windowing layer (layer) that decouples UI composition from OS-level windows.

<tt>clsn::application</tt>

A higher-level layer for application composition. It provides reusable structures such as application shells (stage), dialog systems, and orchestration patterns for building complete applications.


Design overview

  • UI is structured as a control tree
  • Windowing is separated from UI logic
  • Multiple virtual UI layers can exist per OS window
  • Applications are composed from reusable UI structures
  • Platform-specific code is isolated behind a thin abstraction layer (SDL2)

Features

  • Modern C++ design
  • Built on top of:
    • SDL2
    • SDL2_gfx
    • SDL2_image
    • SDL2_ttf
    • sdl2-cmake-modules
    • nlohmann/json
  • No exceptions (uses std::expected)
  • No raw pointers in public APIs
  • RAII-based memory management with smart pointers
  • Virtual windowing system decoupled from OS windows
  • Application composition framework
  • Pluggable look and feel system
  • Global and per-control theming
  • Virtual and sandboxed filesystem support
  • Internationalization infrastructure

Hello world

namespace clsn::hello
{
class hello_world_button final : public ui::button
{
using base = ui::button;
public:
using base::base;
void custom_init() override
{
set_caption({"Click me (count: 0)"});
set_caption_horizontal_alignment(draw::horizontal_alignment::center);
set_caption_vertical_alignment(draw::vertical_alignment::middle);
std::ignore = add_action_listener(
[this](auto&)
{
static auto n{0};
set_caption({core::string_utils::format("Click me (count: {})", ++n)});
});
}
};
}
int main()
{
clsn::ui::runtime::app_settings app_settings{"Classeine Hello World",
clsn::draw::dimension{400, 300}};
clsn::ui::runtime_defaults::default_app::run_app<clsn::hello::hello_world_button>(app_settings);
return 0;
}

Controls

  • button
  • check_box
  • content_pane
  • control_host
  • control_list_view
  • dialog_pane
  • drop_down_button
  • empty_control
  • image_control
  • label
  • menu
  • menu_item_separator
  • message_dialog_pane
  • multiline_label
  • radio_button
  • tab_control
  • tab_page
  • toggle_button

Layout containers

  • dual_layout_container
  • flow_layout_container
  • hbox_layout_container
  • vbox_layout_container
  • xy_layout_container

Supported platforms

  • Linux
  • Windows
  • WebAssembly (Emscripten)

Status

Classeine is under active development. APIs are not yet stable and may change significantly.