---
name: framework
version: 1.2.1
lang: cpp
description: "Core C++ ImGui app shell: fn::run_app, AppConfig, GLFW + OpenGL + ImGui + ImPlot bootstrap, theming (Mantine dark + indigo), settings/about/menubar/layouts UI, Tabler icons, logging, multi-viewport & AltSnap-safe sizemove, local_files dir, embedded layout storage, dark titlebar (DWM) en Windows, header badge por-app con el icono del .exe en panels arrastrados fuera del main."
members:
  - tokens_cpp_core
  - icon_font_cpp_core
  - app_settings_cpp_core
  - app_about_cpp_core
  - fps_overlay_cpp_core
  - panel_menu_cpp_core
  - layouts_menu_cpp_core
  - app_menubar_cpp_core
  - logger_cpp_core
  - log_window_cpp_core
  - gl_loader_cpp_gfx
  - layout_storage_cpp_core
  - selectable_text_cpp_core
tags: [framework, imgui, cpp, core]
dir_path: cpp/framework
---

## Documentation

Foundational C++ ImGui app shell shared by every desktop app in the registry. Apps opt-in transparently — every C++ app already links `fn_framework` via the `add_imgui_app` macro. The framework provides:

- `fn::run_app(cfg, render_fn)`: GLFW + OpenGL3 + ImGui + ImPlot setup, multi-viewport, docking, AltSnap-safe sizemove, icon attach, layouts persistence, log window, settings window, about window, menubar.
- `fn::local_path(name)`: scoped writable path under `<exe_dir>/local_files/`.
- Design tokens (Mantine dark + indigo accent).
- Tabler icons (TI_* macros).
- `fn::framework_version()` / `fn::framework_description()` (post 1.0.0).

Apps NEVER list these members in their own `uses_functions` — they come transitively via `fn_framework`. Audited via [[cpp_apps]] rule.

### Version policy

Semver. Major = breaking ABI/API of public `fn::run_app` or `AppConfig`. Minor = additive (new optional config field, new helper). Patch = bugfix.

### Boundaries

Framework does NOT include modules like `data_table`. Apps that want tables opt-in via `uses_modules: [data_table_cpp]` and `target_link_libraries(<app> PRIVATE fn_module_data_table)`. The framework is intentionally small.

## Capability growth log

- v1.2.1 (2026-05-18) — fix: `io.ConfigDockingTransparentPayload = true` en `fn::run_app`. Multi-viewport docking pinta dock preview overlays en el target viewport mientras el payload viewport vive en su propio swap-chain; ambos viewports presentaban frames a destiempo y los rects de dock vibraban 1px contra el payload arrastrado. TransparentPayload hace invisible al payload durante el drag → solo el target dibuja overlays → ningun desync visible. Knob upstream recomendado para "rendering of multiple viewport cannot be synced".
- v1.2.0 (2026-05-17) — Header badge en panels arrastrados fuera del main: icono GL extraido del HICON embebido (resource 101, mismo bitmap que el taskbar) y dibujado en el title bar de cada window con `Viewport != main` via iteracion de `g.Windows` con `imgui_internal.h` + `AddImageRounded` sobre `window->DrawList` (no `ForegroundDrawList` — no se renderia en viewports secundarios). Fallback Linux/sin .ico: cuadrado accent redondeado + inicial blanca. Color accent auto-cableado via `codegen_app_modules.py` desde `app.md::icon.accent` (extern `app_header_accent_hex`) con precedencia `cfg.header_badge.accent_hex` > codegen > hash-derived. Permite distinguir de un vistazo de que app viene cada panel flotante con varias apps abiertas.
- v1.1.0 (2026-05-17) — Windows dark titlebar. `attach_dark_titlebar_to_hwnd(HWND)` aplica `DWMWA_USE_IMMERSIVE_DARK_MODE = TRUE` via `DwmSetWindowAttribute` sobre el HWND principal + per-frame scan de `pio.Viewports` para cubrir viewports secundarios (paneles dragged-out). Idempotente (set-once por HWND, `g_dark_titlebar_applied`). Sin efecto en Linux/macOS. Cero opt-in: cualquier app que use `fn::run_app` lo hereda.
- v1.0.0 (2026-05-16) — Initial framing as a versioned module. Members above are the bundled units of `fn_framework` static lib. Pre-1.0.0 history lives in git.

## Notes

- Static lib target: `fn_framework` (defined in `cpp/CMakeLists.txt`).
- Generated header `cpp/framework/version_generated.h` (gitignored) exposes `FN_FRAMEWORK_VERSION` constant.
- About panel of every app reads `fn::framework_version()` at runtime.
