4#ifndef QWASMWINDOWTREENODE_INC
5#define QWASMWINDOWTREENODE_INC
21 auto *
window = asWasmWindow();
23 previousParent->m_childStack.removeWindow(
window);
29 currentParent->m_childStack.pushWindow(
window, positionPreference);
46 parentNode()->onSubtreeChanged(changeType, parent,
child);
60 parentNode()->m_childStack.windowPositionPreferenceChanged(asWasmWindow(),
69 parentNode()->setActiveChildNode(asWasmWindow());
72 m_activeIndex = ++s_nextActiveIndex;
80 parentNode()->m_childStack.raise(asWasmWindow());
81 parentNode()->bringToTop();
89 parentNode()->m_childStack.lower(asWasmWindow());
93void QWasmWindowTreeNode<Window>::onTopWindowChanged()
95 constexpr int zOrderForElementInFrontOfScreen = 3;
96 int z = zOrderForElementInFrontOfScreen;
97 std::for_each(m_childStack.rbegin(), m_childStack.rend(),
98 [
this, &
z](
Window *
window) { setWindowZOrder(window, z++); });
101template<
class Window>
102void QWasmWindowTreeNode<Window>::setActiveChildNode(
Window *activeChild)
104 m_activeChild = activeChild;
106 auto it = m_childStack.begin();
107 if (
it == m_childStack.end())
109 for (;
it != m_childStack.end(); ++
it)
110 (*it)->onActivationChanged(*
it == m_activeChild);
virtual void setWindowZOrder(Window *window, int z)
void onPositionPreferenceChanged(typename QWasmWindowStack< Window >::PositionPreference positionPreference)
virtual Window * asWasmWindow()
virtual ~QWasmWindowTreeNode()
virtual void onSubtreeChanged(QWasmWindowTreeNodeChangeType changeType, QWasmWindowTreeNode *parent, Window *child)
virtual void onParentChanged(QWasmWindowTreeNode *previous, QWasmWindowTreeNode *current, typename QWasmWindowStack< Window >::PositionPreference positionPreference)
[Window class with invokable method]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
QWasmWindowTreeNodeChangeType
socketLayer bind(QHostAddress::Any, 4000)
QJSValueIterator it(object)