catcrafts.net/interfaces/Catcrafts-Views.cppm

27 lines
1 KiB
Text
Raw Normal View History

2025-11-12 20:58:07 +01:00
/*
catcrafts.net
Copyright (C) 2026 Catcrafts
2025-11-12 20:58:07 +01:00
The source code of this website is made available for viewing purposes only.
2025-11-12 20:58:07 +01:00
No permission is granted to copy, modify, distribute, or create derivative works.
*/
export module Catcrafts:Views;
import Crafter.Graphics;
import std;
2025-11-12 20:58:07 +01:00
using namespace Crafter;
export namespace Catcrafts {
// Builds the persistent page chrome (header / <main id="main"> / footer)
// under <body>. Owns the root element for the page's lifetime so its
// children don't get yanked out of the DOM. Must be called from main()
// — the Crafter.Graphics Dom bridge is only safe to use after wasm
// instantiation hands control to user code.
void InitializePage();
2025-11-12 21:24:23 +01:00
// Per-render scratch ref to the <main> content container created by
// InitializePage(). Looking it up fresh on every call costs one
// document.getElementById; in return we don't have to thread a long-lived
// reference across module boundaries.
inline Dom::HtmlElementPtr MainContent() { return Dom::HtmlElementPtr("main"); }
2025-11-12 20:58:07 +01:00
}