12#include "ViewWrapper_p.h"
13#include "core/View_p.h"
14#include "core/layouting/Item_p.h"
15#include "../Window_p.h"
23 , m_wrappedView(wrapped)
28ViewWrapper::~ViewWrapper()
32void ViewWrapper::setGeometry(Rect geo)
34 m_wrappedView->setGeometry(geo);
37void ViewWrapper::move(
int x,
int y)
39 m_wrappedView->move(x, y);
42bool ViewWrapper::close()
44 return m_wrappedView->close();
47bool ViewWrapper::isVisible()
const
49 return m_wrappedView->isVisible();
52void ViewWrapper::setVisible(
bool is)
54 m_wrappedView->setVisible(is);
57bool ViewWrapper::isExplicitlyHidden()
const
59 return m_wrappedView->isExplicitlyHidden();
62void ViewWrapper::setSize(
int w,
int h)
64 m_wrappedView->setSize(w, h);
67std::shared_ptr<Core::View> ViewWrapper::rootView()
const
69 return m_wrappedView->rootView();
74 m_wrappedView->enableAttribute(attr, enabled);
79 return m_wrappedView->hasAttribute(attr);
84 m_wrappedView->setFlag(flag, enabled);
89 return m_wrappedView->flags();
92Size ViewWrapper::minSize()
const
94 return m_wrappedView->minSize();
97Size ViewWrapper::maxSizeHint()
const
99 return m_wrappedView->maxSizeHint();
102Rect ViewWrapper::geometry()
const
104 return m_wrappedView->geometry();
107Rect ViewWrapper::normalGeometry()
const
109 return m_wrappedView->normalGeometry();
112void ViewWrapper::setNormalGeometry(Rect geo)
114 m_wrappedView->setNormalGeometry(geo);
117void ViewWrapper::setMaximumSize(Size size)
119 m_wrappedView->setMaximumSize(size);
122void ViewWrapper::setWidth(
int w)
124 m_wrappedView->setWidth(w);
127void ViewWrapper::setHeight(
int h)
129 m_wrappedView->setHeight(h);
132void ViewWrapper::setFixedWidth(
int w)
134 m_wrappedView->setFixedWidth(w);
137void ViewWrapper::setFixedHeight(
int h)
139 m_wrappedView->setFixedHeight(h);
142void ViewWrapper::show()
144 m_wrappedView->show();
147void ViewWrapper::hide()
149 m_wrappedView->hide();
152void ViewWrapper::updateGeometry()
154 m_wrappedView->updateGeometry();
157void ViewWrapper::update()
159 m_wrappedView->update();
162void ViewWrapper::setParent(
View *parent)
164 m_wrappedView->setParent(parent);
167void ViewWrapper::raiseAndActivate()
169 m_wrappedView->raiseAndActivate();
172void ViewWrapper::activateWindow()
174 m_wrappedView->activateWindow();
177void ViewWrapper::raise()
179 m_wrappedView->raise();
182bool ViewWrapper::isRootView()
const
184 return m_wrappedView->isRootView();
187Point ViewWrapper::mapToGlobal(Point local)
const
189 return m_wrappedView->mapToGlobal(local);
192Point ViewWrapper::mapFromGlobal(Point global)
const
194 return m_wrappedView->mapFromGlobal(global);
197Point ViewWrapper::mapTo(
View *view, Point pos)
const
199 return m_wrappedView->mapTo(view, pos);
202void ViewWrapper::setWindowOpacity(
double opacity)
204 m_wrappedView->setWindowOpacity(opacity);
207void ViewWrapper::setWindowTitle(
const QString &title)
209 m_wrappedView->setWindowTitle(title);
212void ViewWrapper::setWindowIcon(
const Icon &icon)
214 m_wrappedView->setWindowIcon(icon);
217bool ViewWrapper::isActiveWindow()
const
219 return m_wrappedView->isActiveWindow();
222void ViewWrapper::showNormal()
224 m_wrappedView->showNormal();
227void ViewWrapper::showMinimized()
229 m_wrappedView->showMinimized();
232void ViewWrapper::showMaximized()
234 m_wrappedView->showMaximized();
237bool ViewWrapper::isMinimized()
const
239 return m_wrappedView->isMinimized();
242bool ViewWrapper::isMaximized()
const
244 return m_wrappedView->isMaximized();
247std::shared_ptr<Core::Window> ViewWrapper::window()
const
249 return m_wrappedView->window();
252std::shared_ptr<Core::View> ViewWrapper::childViewAt(Point pos)
const
254 return m_wrappedView->childViewAt(pos);
257std::shared_ptr<Core::View> ViewWrapper::parentView()
const
259 return m_wrappedView->parentView();
262std::shared_ptr<Core::View> ViewWrapper::asWrapper()
264 return m_thisWeakPtr.lock();
267void ViewWrapper::setViewName(
const QString &name)
269 m_wrappedView->setViewName(name);
272void ViewWrapper::grabMouse()
274 m_wrappedView->grabMouse();
277void ViewWrapper::releaseMouse()
279 m_wrappedView->releaseMouse();
282void ViewWrapper::releaseKeyboard()
284 m_wrappedView->releaseKeyboard();
289 m_wrappedView->setFocus(reason);
292bool ViewWrapper::hasFocus()
const
294 return m_wrappedView->hasFocus();
299 return m_wrappedView->focusPolicy();
304 m_wrappedView->setFocusPolicy(policy);
307QString ViewWrapper::viewName()
const
309 return m_wrappedView->viewName();
312void ViewWrapper::setMinimumSize(Size size)
314 m_wrappedView->setMinimumSize(size);
317void ViewWrapper::render(
QPainter *render)
319 m_wrappedView->render(render);
324 m_wrappedView->setCursor(shape);
327void ViewWrapper::setMouseTracking(
bool tracking)
329 m_wrappedView->setMouseTracking(tracking);
334 return m_wrappedView->childViews();
337void ViewWrapper::setZOrder(
int z)
339 m_wrappedView->setZOrder(z);
344 return m_wrappedView->handle();
350 return m_wrappedView->d->type() == type;
352 return type == Core::ViewType::ViewWrapper;
355bool ViewWrapper::onResize(
int w,
int h)
358 return View::onResize(w, h);
361 std::shared_ptr<Core::View> ViewWrapper::create(
flutter::View *wrapped)
364 auto ptr = std::shared_ptr<ViewWrapper>(wrapper);
365 wrapper->setWeakPtr(ptr);
370void ViewWrapper::setWeakPtr(std::weak_ptr<ViewWrapper> thisPtr)
372 m_thisWeakPtr = thisPtr;