1231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*
2231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
3231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
4231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    This library is free software; you can redistribute it and/or
5231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    modify it under the terms of the GNU Library General Public
6231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    License as published by the Free Software Foundation; either
7231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    version 2 of the License, or (at your option) any later version.
8231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
9231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    This library is distributed in the hope that it will be useful,
10231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    but WITHOUT ANY WARRANTY; without even the implied warranty of
11231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    Library General Public License for more details.
13231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
14231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    You should have received a copy of the GNU Library General Public License
15231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    along with this library; see the file COPYING.LIB.  If not, write to
16231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    Boston, MA 02110-1301, USA.
18231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block*/
19231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
20231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "config.h"
21231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "qwebinspector.h"
22231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
23231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "Element.h"
24231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "InspectorController.h"
25231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "qwebelement.h"
26231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "qwebinspector_p.h"
27231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "qwebpage_p.h"
28231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
29231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include <QResizeEvent>
30231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
31231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*!
32231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \class QWebInspector
33231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \since 4.6
346c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    \inmodule QtWebKit
35231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \brief The QWebInspector class allows the placement and control of a
36231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    QWebPage's inspector.
376c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    The inspector can display a page's hierarchy, its loading statistics and
386c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    the current state of its individual elements. It is mostly used by web
396c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    developers.
40231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
416c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    The QWebPage to be inspected must be specified using the setPage() method.
42231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
43231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    A typical use of QWebInspector follows:
44231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
45231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \snippet webkitsnippets/qtwebkit_qwebinspector_snippet.cpp 0
46231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
476c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    A QWebInspector can be made visible either programmatically using
486c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    setVisible(), or by the user through the attached QWebPage's context
496c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    menu.
506c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen
51231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \note A QWebInspector will display a blank widget if either:
52231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \list
53231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        \o page() is null
54231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        \o QWebSettings::DeveloperExtrasEnabled is false
55231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \endlist
56231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
57231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \section1 Resources
58231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
59643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    This class acts mostly as a container and a controller for the inspector.
60231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    Most of the resources needed by the inspector are owned by the associated
61231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    QWebPage and are allocated the first time that:
62231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \list
63231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        \o an element is inspected
64231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        \o the QWebInspector is shown.
65231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \endlist
66231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
67231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \section1 Inspector configuration persistence
68231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
69231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    The inspector allows the user to configure some options through its
706c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    user interface (e.g. the resource tracking "Always enable" option).
716c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    These settings will be persisted automatically by QtWebKit only if
726c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    your application previously called QCoreApplication::setOrganizationName()
736c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    and QCoreApplication::setApplicationName().
746c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    See QSettings's default constructor documentation for an explanation
756c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    of why this is necessary.
76231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block*/
77231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
78231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*!
796c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    Constructs an unbound QWebInspector with \a parent as its parent.
80231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block*/
81231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve BlockQWebInspector::QWebInspector(QWidget* parent)
82231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    : QWidget(parent)
83231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    , d(new QWebInspectorPrivate(this))
84231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
85231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
86231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
87231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*!
88231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    Destroys the inspector.
89231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block*/
90231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve BlockQWebInspector::~QWebInspector()
91231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
92231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    // Remove association principally to prevent deleting a child frontend
93231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    setPage(0);
944576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    delete d;
954576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    d = 0;
96231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
97231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
98231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*!
996c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    Bind this inspector to the QWebPage to be inspected.
100231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
1016c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    \bold {Notes:}
1026c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    \list
1036c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen        \o There can only be one QWebInspector associated with a QWebPage
1046c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen           and vice versa.
1056c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen        \o Calling this method with a null \a page will break the current association, if any.
1066c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen        \o If \a page is already associated to another QWebInspector, the association
1076c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen           will be replaced and the previous QWebInspector will become unbound
1086c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen    \endlist
109231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
110231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    \sa page()
111231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block*/
112231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid QWebInspector::setPage(QWebPage* page)
113231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
114231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (d->page) {
115231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        // Break currentPage-->this
116231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        d->page->d->setInspector(0);
117231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    }
118231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (page && page->d->inspector && page->d->inspector != this) {
119231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        // Break newPage<->newPageCurrentInspector
120231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        page->d->inspector->setPage(0);
121231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    }
122231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
123231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    d->page = page;
124231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
125231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (page) {
126231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        // Setup the reciprocal association
127231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        page->d->setInspector(this);
128231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    }
129231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
130231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
131231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*!
132231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    Returns the inspected QWebPage.
133231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    If no web page is currently associated, a null pointer is returned.
134231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block*/
135231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve BlockQWebPage* QWebInspector::page() const
136231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
137231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    return d->page;
138231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
139231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
140231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*! \reimp */
141231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve BlockQSize QWebInspector::sizeHint() const
142231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
143231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    return QSize(450, 300);
144231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
145231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
146231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*! \reimp */
147231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockbool QWebInspector::event(QEvent* ev)
148231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
149231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    return QWidget::event(ev);
150231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
151231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
152231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*! \reimp */
153231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid QWebInspector::resizeEvent(QResizeEvent* event)
154231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
155231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    d->adjustFrontendSize(event->size());
156231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
157231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
158231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*! \reimp */
159231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid QWebInspector::showEvent(QShowEvent* event)
160231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
161d0825bca7fe65beaee391d30da42e937db621564Steve Block#if ENABLE(INSPECTOR)
162231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    // Allows QWebInspector::show() to init the inspector.
163231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (d->page)
164231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        d->page->d->inspectorController()->show();
165d0825bca7fe65beaee391d30da42e937db621564Steve Block#endif
166231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
167231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
168231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*! \reimp */
169231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid QWebInspector::hideEvent(QHideEvent* event)
170231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
171dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block#if ENABLE(INSPECTOR)
172dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    if (d->page)
173dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block        d->page->d->inspectorController()->close();
174dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block#endif
175d0825bca7fe65beaee391d30da42e937db621564Steve Block}
176d0825bca7fe65beaee391d30da42e937db621564Steve Block
177d0825bca7fe65beaee391d30da42e937db621564Steve Block/*! \reimp */
178d0825bca7fe65beaee391d30da42e937db621564Steve Blockvoid QWebInspector::closeEvent(QCloseEvent* event)
179d0825bca7fe65beaee391d30da42e937db621564Steve Block{
180d0825bca7fe65beaee391d30da42e937db621564Steve Block#if ENABLE(INSPECTOR)
181231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (d->page)
182dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block        d->page->d->inspectorController()->close();
183d0825bca7fe65beaee391d30da42e937db621564Steve Block#endif
184231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
185231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
186231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*! \internal */
187231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid QWebInspectorPrivate::setFrontend(QWidget* newFrontend)
188231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
189231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (frontend)
190231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        frontend->setParent(0);
191231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
192231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    frontend = newFrontend;
193231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
194231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (frontend) {
195231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        frontend->setParent(q);
196231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        frontend->show();
197231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        adjustFrontendSize(q->size());
198231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    }
199231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
200231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
201bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen/*!
202bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen * \internal
203bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen */
204bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenvoid QWebInspectorPrivate::attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend)
205bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen{
206bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen    if (remoteFrontend)
207bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen        remoteFrontend->setParent(0);
208bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen
209bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen    remoteFrontend = newRemoteFrontend;
210bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen
211bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen    if (remoteFrontend)
212bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen        remoteFrontend->setParent(q);
213bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen}
214bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen
215bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen/*!
216bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen * \internal
217bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen */
218bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenvoid QWebInspectorPrivate::detachRemoteFrontend()
219bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen{
220bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen    if (remoteFrontend) {
221bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen        remoteFrontend->deleteLater();
222bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen        remoteFrontend = 0;
223bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen    }
224bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen}
225bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen
226231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockvoid QWebInspectorPrivate::adjustFrontendSize(const QSize& size)
227231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
228231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    if (frontend)
229231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        frontend->resize(size);
230231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
231231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
232