huxerui.huxerui
importHuxerUI — declarative cross-platform UI framework in C++20 (GTK4 on Linux, Win32/Direct2D, AppKit/Metal)
import huxerui;
模块名读自上游 modules/huxerui.cppm 里的 `export module` 声明。
mcpp add huxerui.huxerui@0.5.5
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// HuxerUI is a GUI framework, and this test opens no window: a CI runner has
// no display, and the point here is that the PACKAGE resolves, builds and
// links, not that GTK can paint.
//
// The last assertion is the one that carries that weight. Rect/Color are
// header-attached entities that `import huxerui;` re-exports, so on their own
// they would still compile if libhuxerui had never been built.
// FlatLightThemeSpec/FlatDarkThemeSpec are out-of-line definitions living in
// the library itself, so reaching them is what proves the link.
import std;
import huxerui;
using huxerui::Color;
using huxerui::Point;
using huxerui::Rect;
int main() {
const Rect bounds{10.0F, 20.0F, 100.0F, 50.0F};
const bool inside = bounds.Contains(Point{60.0F, 40.0F});
const bool outside = !bounds.Contains(Point{5.0F, 40.0F});
// Rgba32 decodes 0xRRGGBBAA, so this is opaque orange.
// …
tests/examples/huxerui-module/tests/runtime.cpp · 项目 tests/examples/huxerui-module
构建 · 上游清单
- modules
huxerui- targets
huxerui (lib)- language
c++23- manifest version
0.5.5- 来源
https://raw.githubusercontent.com/HuxerUI/HuxerUI/v0.5.5/mcpp.toml