73#ifndef STAGE_INTERACT_UI_COORD_H
74#define STAGE_INTERACT_UI_COORD_H
143 template<
typename...ARGS>
235 Literal* elm = unConst(
this)->getPosition(idx);
236 return not isnil(elm)
244 Literal* elm = unConst(
this)->getPosition(idx);
264 size_t subSiz = this->
size(),
265 parSiz = parent.
size(),
268 if (parSiz >= subSiz)
272 and ( (*
this)[idx]== parent[idx]
274 or isnil (parent[idx])))
277 ENSURE (idx < subSiz);
278 return idx == parSiz;
286 operator string()
const
294 if (isnil (component))
295 return "UI:?/" + path;
298 return "UI:" + component;
300 return "UI:" + component +
"/" + path;
306 if (
empty())
return "";
320 for ( ; pos<
end; ++pos )
339 NOTREACHED (
"component index numbering broken");
352 buff.reserve (10 * (siz -
UIC_PATH));
365 size_t len = buff.length();
387 REQUIRE (not
empty());
394 Literal* elm = unConst(
this)->getPosition(idx);
416 std::vector<Literal> elms;
417 if (not isnil (newContent))
419 if (not std::strchr (newContent,
'/'))
423 elms.emplace_back (newContent);
429 string sequence{newContent};
432 while (string::npos != (last = sequence.find (
'/', pos)))
434 elms.emplace_back (
Symbol{sequence.substr(pos, last - pos)});
437 sequence = sequence.substr(pos);
438 if (not isnil (sequence))
439 elms.emplace_back (
Symbol{sequence});
456 size_t cnt = pathElms.size();
458 for (
size_t i=0 ; i < cnt; ++i)
461 for (
size_t i = idx+cnt; i<
end; ++i)
492 class LocationClause;
501 template<
typename...ARGS>
534 return std::move (*
this);
542 return std::move (*
this);
550 return std::move (*
this);
558 return std::move (*
this);
566 return std::move (*
this);
574 return std::move (*
this);
583 return std::move (*
this);
596 return std::move (*
this);
605 +
" to the complete rooted path "+
string(
uic_));
608 return std::move (*
this);
620 return std::move (*
this);
628 return std::move (*
this);
640 return std::move (*
this);
648 return std::move (*
this);
662 PathArray::normalise();
Adapter for building an implementation of the »Lumiera Forward Iterator« concept.
Abstraction for path-like topological coordinates.
size_t indexOf(Literal const &content) const
reverse lookup of actual path content
void truncateTo(size_t newSize)
PathArray(IndexSeq< prefix... >, IndexSeq< rest... >, ARGS &&...args)
Literal * expandPosition(size_t idx)
void normalise()
establish the contract of PathArray
void setContent(Literal *pos, const char *val)
Token or Atom with distinct identity.
Builder && view(Literal viewID)
augment UI coordinates to indicate a specific view to be used
Builder && overwrite(size_t depth, Literal newSpec)
Builder && tab(Literal tabID)
augment UI coordinates to indicate a specific tab within the view"
Builder && prepend(Literal elmID)
augment partially defined UI coordinates by extending them towards the root
Builder(UICoord &&anonRef)
Builder && path(Literal pathDef)
augment UI coordinates to define a complete local path
Builder && panel(Literal panelID)
augment UI coordinates to indicate a specific view to be used
LocationClause create()
interprets the current (inline) builder contents as create clause, which has the meaning "create a ne...
Builder && persp(Literal perspectiveID)
augment UI coordinates to mandate a specific perspective to be active within the window
Builder && window(Literal windowID)
change UI coordinate spec to define it to be rooted within the given window
Builder && truncateTo(size_t depth)
possibly shorten this path specification to a limited depth
Builder(Builder &&)=default
Builder && noTab()
augment UI coordinates to indicate that no tab specification is necessary
Builder && append(Literal elm)
augment UI coordinates by appending a further component at the end.
Builder(UICoord const &base)
UICoord const & uiCoord()
Builder && tab(uint tabIdx)
augment UI coordinates to indicate a tab specified by index number
Describe a location within the UI through structural/topological coordinates.
size_t findStartIdx() const
friend bool operator>=(UICoord const &l, UICoord const &r)
friend bool operator<(UICoord const &l, UICoord const &r)
friend bool operator<=(UICoord const &l, UICoord const &r)
friend bool operator==(UICoord const &l, UICoord const &r)
iterator pathSeq() const
iterative access to the path sequence section
static Builder window(Literal windowID)
Builder: start definition of UI-Coordinates rooted in given window.
static Builder firstWindow()
Builder: start definition of UI-Coordinates rooted in the firstWindow
Builder tab(Literal tabID) const
void setTailSequence(size_t idx, std::vector< Literal > &pathElms)
replace the existing path information with the given elements
void setComponent(size_t idx, Literal newContent)
Builder path(Literal pathDefinition) const
convenience builder function so set a full path definition
Builder persp(Literal perspectiveID) const
Builder panel(Literal panelID) const
Literal getWindow() const
bool isExtendedBelow(UICoord const &parent) const
Check if this coordinate spec can be seen as an extension of the given parent coordinates and thus re...
UICoord(ARGS &&...args)
UI-Coordinates can be created explicitly by specifying a sequence of Literal tokens,...
UICoord(UICoord const &)=default
UICoord(UICoord &&)=default
bool isIncomplete() const
void setTailSequence(size_t idx, Literal newContent)
replace / overwrite existing content starting at given index.
Builder append(Literal elmID) const
Builder prepend(Literal elmID) const
bool isPresent(size_t idx) const
UICoord & operator=(UICoord const &)=default
Builder view(Literal viewID) const
bool isWildcard(size_t idx) const
friend bool operator!=(UICoord const &l, UICoord const &r)
friend bool operator>(UICoord const &l, UICoord const &r)
static Builder currentWindow()
Builder: start definition of UI-Coordinates rooted in the currentWindow
Literal accesComponent(UIPathElm idx) const
Types marked with this mix-in may be moved but not copied.
Lumiera error handling (C++ interface).
LumieraError< LERR_(LOGIC)> Logic
const Symbol UIC_ELIDED
indicate that a component is elided or irrelevant here
const Symbol UIC_FIRST_WINDOW
window spec to refer to the first window of the application
const Symbol UIC_CURRENT_WINDOW
window spec to refer to the current window
Lumiera GTK UI implementation root.
bool contains(MAP &map, typename MAP::key_type const &key)
shortcut for containment test on a map
std::string toString(TY const &val) noexcept
get some string representation of any object, reliably.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
bool isnil(lib::time::Duration const &dur)
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Foundation abstraction to implement path-like component sequences.
A single location specification to be matched and fulfilled.
Marker types to indicate a literal string and a Symbol.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...