MyWindow::MyWindow(QQuickWindow *parent) : QQuickWindow(parent) { setObjectName ("MyWindow"); m_noBorder = false; m_windowStatus = StopCenter; m_topHint = false; old_topHint=false; m_noNotifyIcon = false; m_windowActive = false; m_mousePenetrate = false; m_minimumWidth = 0; m_minimumHeight = 0; m_maximumWidth = 9999999; m_maximumHeight = 9999999; connect (this, &QQuickWindow::widthChanged, this, &MyWindow::actualWidthChanged); connect (this, &QQuickWindow::heightChanged, this, &MyWindow::actualHeightChanged); connect (this, &QQuickWindow::xChanged, this, &MyWindow::actualXChanged); connect (this, &QQuickWindow::yChanged, this, &MyWindow::actualYChanged); connect (this, &QQuickWindow::xChanged, this, &MyWindow::onActualXChanged); connect (this, &QQuickWindow::yChanged, this, &MyWindow::onActualYChanged); connect (contentItem (), &QQuickItem::xChanged, this, &MyWindow::xChanged); connect (contentItem (), &QQuickItem::yChanged, this, &MyWindow::yChanged); }
QTransform QuickItemNodeInstance::contentItemTransform() const { if (contentItem()) return contentItemTransformForItem(contentItem(), nodeInstanceServer()); return QTransform(); }
QRectF QuickItemNodeInstance::contentItemBoundingBox() const { if (contentItem()) { QTransform contentItemTransform = DesignerSupport::parentTransform(contentItem()); return contentItemTransform.mapRect(contentItem()->boundingRect()); } return QRectF(); }
/*! Enables or disables all buttons in the keyboard that have not been disabled directly. */ void HbInputVkbWidget::setKeyboardDimmed(bool dimmed) { HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem()); if (buttonGroup) { buttonGroup->setEnabled(!dimmed); } }
void MyWindow::setHeight(int arg) { if (m_height != arg&&arg<=maximumHeight ()&&arg>=minimumHeight ()) { m_height = arg; contentItem ()->setHeight (arg); emit heightChanged(arg); } }
void MyWindow::setWidth(int arg) { if (m_width != arg&&arg<=maximumWidth ()&&arg>=minimumWidth ()) { m_width = arg; contentItem ()->setWidth (arg); emit widthChanged(arg); } }
/*! Sets the keypad to given mode. Possible values are EModeAbc, EModeNumeric and EModeSct. */ void HbInputVkbWidget::setMode(HbKeypadMode mode, HbModifiers modifiers) { Q_D(HbInputVkbWidget); d->mMode = mode; d->mModifiers = modifiers; d->updateButtons(); d->updateKeyCodes(); d->applyEditorConstraints(); HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem()); if (buttonGroup && d->mOwner->focusObject()) { buttonGroup->setCustomButtonActions(d->mOwner->focusObject()->editorInterface().actions()); } if (d->mInputModeIndicator) { d->mInputModeIndicator->updateIndicator(); } }
Panel::Panel(QScreen *screen, Element *elm) : QQuickWindow() , m_element(elm) { elm->setParentItem(contentItem()); setScreen(screen); setWidth(elm->width()); setHeight(elm->height()); setColor(Qt::transparent); setFlags(Qt::BypassWindowManagerHint); show(); create(); Client::client()->setInputRegion(this, elm->inputRegion()); m_panel = Client::client()->setPanel(this, screen, (int)elm->location()); desktop_shell_panel_add_listener(m_panel, &s_listener, this); connect(elm, &Element::published, this, &Panel::move); connect(elm, &QQuickItem::widthChanged, [this]() { setWidth(m_element->width()); }); connect(elm, &QQuickItem::heightChanged, [this]() { setHeight(m_element->height()); }); connect(elm, &Element::inputRegionChanged, [this]() { Client::client()->setInputRegion(this, m_element->inputRegion()); }); connect(screen, &QObject::destroyed, [this]() { delete this; }); }
void LipstickCompositor::surfaceMapped() { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); //Ignore surface if it's not a window surface if (!surface->hasShellSurface()) return; QVariantMap properties = surface->windowProperties(); QString category = properties.value("CATEGORY").toString(); if (surface->surfaceItem()) { // Always cause a repaint on surface mapped maybePostUpdateRequest(); return; } // The surface was mapped for the first time int id = m_nextWindowId++; LipstickCompositorWindow *item = new LipstickCompositorWindow(id, category, surface, contentItem()); item->setSize(surface->size()); QObject::connect(item, SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed())); // Whenever the item is damaged, cause a full repaint QObject::connect(item, SIGNAL(textureChanged()), this, SLOT(maybePostUpdateRequest())); m_totalWindowCount++; m_mappedSurfaces.insert(id, item); item->setTouchEventsEnabled(true); emit windowCountChanged(); emit windowAdded(item); windowAdded(id); emit availableWinIdsChanged(); }
int MyWindow::y() const { return QQuickWindow::y ()+contentItem ()->y (); }
void MyWindow::setY(int arg) { QQuickWindow::setY (arg-contentItem ()->y ()); }
void MyWindow::setX(int arg) { QQuickWindow::setX (arg-contentItem ()->x ()); }