gnome.pangocairo
importPangoCairo 1.56.1 — pango's cairo rendering backend, the usual entry point
import gnome.pangocairo;
#include <pango/pangocairo.h>
模組名取自本索引給這個套件寫的測試專案。
mcpp add gnome.pangocairo@1.56.1
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// ⭐ THE MODULE, WHICH IS WHAT THE NAMESPACE PROMISES.
//
// In this index the namespace is the contract: `compat.xxx` is consumed with
// `#include`, an owner namespace like `gnome.xxx` exposes `import`. The test
// next to this file takes the header route; this one takes the module, so both
// doors are tested rather than assumed.
//
// ⚠️ THE TWO DOORS DO NOT COMPOSE. A TU that imports the module AND textually
// includes a pango or glib header reaches <time.h> twice — once through the
// module's global fragment, once directly — and the same `struct tm` becomes
// two entities. So a consumer picks ONE, and which one is decided by macros:
// a module cannot carry them. Code using `PANGO_TYPE_*` or `G_OBJECT` takes
// the header route; code using the function API imports and includes nothing.
#ifdef __linux__
import gnome.pangocairo; // re-exports gnome.pango and gnome.pangoft2
int main()
{
int failures = 0;
auto check = [&](bool ok, const char *what) {
g_print("%-58s %s\n", what, ok ? "ok" : "FAILED");
// …
tests/examples/pangocairo/tests/module.cpp · 專案 tests/examples/pangocairo
建置 · 上游資訊清單
- targets
pangocairo-1_0 (lib), pangocairo (lib)- language
c++23- manifest version
1.56.1- dependencies
gnome, freedesktop- 來源
https://raw.githubusercontent.com/mcpplibs/pango/1.56.1/mcpp/pangocairo/mcpp.toml