|
| bool | isAutotile (const QString &id) |
| |
| bool | isScrolling (const QString &id) |
| |
| QString | extractAlgorithmId (const QString &id) |
| | Extract the algorithm id portion from an autotile preview id.
|
| |
| QString | makeAutotileId (const QString &algorithmId) |
| |
| bool | isScrollingFamily (const QString &id) |
| | Prefix test over the whole scrolling family: the bare sentinel AND the prefixed template stamp.
|
| |
| QString | makeScrollingId (const QString &templateLayoutId) |
| | Build the rules-visible template stamp.
|
| |
| QString | extractTemplateId (const QString &id) |
| | Extract the template layout UUID from a scrolling-family id.
|
| |
LayoutPreview::id namespace utilities.
There are three id forms sharing a single namespace at the consumer level. Manual zone layouts use UUID strings. Autotile-algorithm previews use the prefixed form "autotile:<algorithmId>". Scrolling has no layout entity of its own, so its ASSIGNMENT id is the bare payload-free sentinel "scrolling:" (see ScrollingId below for why it is compared exactly, not by prefix); a fourth, rules-query-only form "scrolling:<templateUuid>" exists solely as the rules-visible ActiveLayout stamp (see the scrolling FAMILY block below). Everyone who needs to build, parse, or classify a LayoutPreview id goes through the helpers here — no inline "autotile:" or "scrolling:" literals outside this namespace.
Lives in phosphor-layout-api because both phosphor-zones and phosphor-tiles produce LayoutPreview values with these IDs, and every consumer of ILayoutSource must be able to classify an id without pulling in either library-specific header.
| QString PhosphorLayout::LayoutId::extractAlgorithmId |
( |
const QString & |
id | ) |
|
|
inline |
Extract the algorithm id portion from an autotile preview id.
(The misuse warning below is a bare qWarning by design: PhosphorLayoutApi declares no logging category of its own — it is a contract library, and the few .cpp files it does build carry only interface glue, no logging. The message is a programmer-error flag, not runtime noise worth filtering. These helpers are inline and header-resident so a consumer can classify an id without linking anything.) Callers are expected to check isAutotile first — passing a non-autotile id here is a contract violation. We warn and return an empty string so the misuse is loud rather than silent, but remain graceful in release (no assert — the empty return gives callers a testable signal).