Add explicit moc includes to sources for moc-covered headers

* speeds up incremental builds as changes to a header will not always
  need the full mocs_compilation.cpp for all the target's headers rebuild,
  while having a moc file sourced into a source file only adds minor
  extra costs, due to small own code and the used headers usually
  already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
  resulting in those quickly processed, while the minor extra cost of the
  sourced moc files does not outweigh that in summary.
  Measured times actually improved by some percent points.
  (ideally CMake would just skip empty mocs_compilation.cpp & its object
  file one day)
* enables compiler to see all methods of a class in same compilation unit
  to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
  moc code being sourced into the cpp file there definitions can be ensured
  and often are already for the needs of the normal class methods
This commit is contained in:
Laurent Montel 2023-07-05 08:30:14 +02:00
parent ad1c820c21
commit b823747c3b
374 changed files with 758 additions and 0 deletions

View file

@ -89,3 +89,5 @@ void GenericSceneOpenGLTest::testRestart()
// TODO: introduce frameRendered signal in SceneOpenGL
QTest::qWait(100);
}
#include "moc_generic_scene_opengl_test.cpp"

View file

@ -235,3 +235,5 @@ void Test::setOutputConfig(const QVector<OutputInfo> &infos)
static_cast<VirtualBackend *>(kwinApp()->outputBackend())->setVirtualOutputs(converted);
}
}
#include "moc_kwin_wayland_test.cpp"

View file

@ -120,3 +120,5 @@ void OnScreenNotificationTest::message()
QCOMPARE(notification.message(), QStringLiteral("bar"));
QCOMPARE(messageChangedSpy.count(), 2);
}
#include "moc_onscreennotificationtest.cpp"

View file

@ -231,3 +231,5 @@ void Activities::reallyStop(const QString &id)
}
} // namespace
#include "moc_activities.cpp"

View file

@ -111,3 +111,5 @@ Window *ApplicationMenu::findWindowWithApplicationMenu(const QString &serviceNam
}
} // namespace KWin
#include "moc_appmenu.cpp"

View file

@ -49,3 +49,5 @@ void DrmAbstractOutput::updateEnabled(bool enabled)
}
}
#include "moc_drm_abstract_output.cpp"

View file

@ -488,3 +488,5 @@ EglDisplay *DrmBackend::sceneEglDisplayObject() const
return m_gpus.front()->eglDisplay();
}
}
#include "moc_drm_backend.cpp"

View file

@ -192,3 +192,5 @@ DrmGpu *EglGbmBackend::gpu() const
}
} // namespace KWin
#include "moc_drm_egl_backend.cpp"

View file

@ -481,3 +481,5 @@ std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::importWithCpu(Surface &surfa
return ret;
}
}
#include "moc_drm_egl_layer_surface.cpp"

View file

@ -941,3 +941,5 @@ uint32_t DrmLease::lesseeId() const
return m_lesseeId;
}
}
#include "moc_drm_gpu.cpp"

View file

@ -527,3 +527,5 @@ bool DrmOutput::needsColormanagement() const
return m_pipeline->colorimetry() != NamedColorimetry::BT709 || m_pipeline->transferFunction() != NamedTransferFunction::sRGB || m_gpu->isNVidia();
}
}
#include "moc_drm_output.cpp"

View file

@ -187,3 +187,5 @@ int32_t DrmPlane::transformationToDegrees(DrmPlane::Transformations transformati
}
}
}
#include "moc_drm_plane.cpp"

View file

@ -62,3 +62,5 @@ std::shared_ptr<DrmOutputLayer> DrmQPainterBackend::createLayer(DrmVirtualOutput
}
}
#include "moc_drm_qpainter_backend.cpp"

View file

@ -83,3 +83,5 @@ void DrmVirtualOutput::recreateSurface()
}
}
#include "moc_drm_virtual_output.cpp"

View file

@ -33,3 +33,5 @@ void FakeInputBackend::initialize()
}
} // namespace KWin
#include "moc_fakeinputbackend.cpp"

View file

@ -158,3 +158,5 @@ bool FakeInputDevice::isLidSwitch() const
}
} // namespace KWin
#include "moc_fakeinputdevice.cpp"

View file

@ -704,3 +704,5 @@ QStringList Connection::devicesSysNames() const
}
#include "connection.moc"
#include "moc_connection.cpp"

View file

@ -713,3 +713,5 @@ void Device::setOutputArea(const QRectF &outputArea)
}
}
}
#include "moc_device.cpp"

View file

@ -52,3 +52,5 @@ void LibinputBackend::updateScreens()
}
} // namespace KWin
#include "moc_libinputbackend.cpp"

View file

@ -152,3 +152,5 @@ EglDisplay *VirtualBackend::sceneEglDisplayObject() const
}
} // namespace KWin
#include "moc_virtual_backend.cpp"

View file

@ -192,3 +192,5 @@ std::pair<std::shared_ptr<KWin::GLTexture>, ColorDescription> VirtualEglBackend:
}
} // namespace
#include "moc_virtual_egl_backend.cpp"

View file

@ -75,3 +75,5 @@ void VirtualOutput::vblank(std::chrono::nanoseconds timestamp)
}
}
#include "moc_virtual_output.cpp"

View file

@ -101,3 +101,5 @@ VirtualQPainterLayer *VirtualQPainterBackend::primaryLayer(Output *output)
return m_outputs[output].get();
}
}
#include "moc_virtual_qpainter_backend.cpp"

View file

@ -761,3 +761,5 @@ void WaylandBuffer::unlock()
}
} // KWin
#include "moc_wayland_backend.cpp"

View file

@ -468,3 +468,5 @@ void WaylandDisplay::registry_global_remove(void *data, wl_registry *registry, u
}
#include "wayland_display.moc"
#include "moc_wayland_display.cpp"

View file

@ -333,3 +333,5 @@ OutputLayer *WaylandEglBackend::cursorLayer(Output *output)
}
}
#include "moc_wayland_egl_backend.cpp"

View file

@ -346,3 +346,5 @@ void WaylandOutput::lockPointer(Pointer *pointer, bool lock)
}
}
#include "moc_wayland_output.cpp"

View file

@ -177,3 +177,5 @@ OutputLayer *WaylandQPainterBackend::cursorLayer(Output *output)
}
}
#include "moc_wayland_qpainter_backend.cpp"

View file

@ -519,3 +519,5 @@ EglDisplay *X11StandaloneBackend::sceneEglDisplayObject() const
return m_eglDisplay.get();
}
}
#include "moc_x11_standalone_backend.cpp"

View file

@ -135,3 +135,5 @@ void X11Cursor::notifyCursorChanged()
}
}
#include "moc_x11_standalone_cursor.cpp"

View file

@ -127,3 +127,5 @@ void WindowBasedEdge::doUpdateBlocking()
}
}
#include "moc_x11_standalone_edge.cpp"

View file

@ -110,3 +110,5 @@ void EffectsHandlerImplX11::doCheckInputWindowStacking()
}
}
#include "moc_x11_standalone_effects.cpp"

View file

@ -474,3 +474,5 @@ void EglPixmapTexture::onDamage()
}
} // namespace KWin
#include "moc_x11_standalone_egl_backend.cpp"

View file

@ -944,3 +944,5 @@ void GlxPixmapTexture::onDamage()
}
} // namespace
#include "moc_x11_standalone_glx_backend.cpp"

View file

@ -151,3 +151,5 @@ void OMLSyncControlVsyncMonitor::arm()
}
} // namespace KWin
#include "moc_x11_standalone_omlsynccontrolvsyncmonitor.cpp"

View file

@ -68,3 +68,5 @@ void X11Output::updateEnabled(bool enabled)
}
} // namespace KWin
#include "moc_x11_standalone_output.cpp"

View file

@ -46,3 +46,5 @@ void X11PlaceholderOutput::updateEnabled(bool enabled)
}
} // namespace KWin
#include "moc_x11_standalone_placeholderoutput.cpp"

View file

@ -153,3 +153,5 @@ void SGIVideoSyncVsyncMonitor::arm()
}
} // namespace KWin
#include "moc_x11_standalone_sgivideosyncvsyncmonitor.cpp"

View file

@ -286,3 +286,5 @@ void XInputIntegration::startListening()
}
}
#include "moc_x11_standalone_xinputintegration.cpp"

View file

@ -819,3 +819,5 @@ EglDisplay *X11WindowedBackend::sceneEglDisplayObject() const
}
} // namespace KWin
#include "moc_x11_windowed_backend.cpp"

View file

@ -281,3 +281,5 @@ std::pair<std::shared_ptr<GLTexture>, ColorDescription> X11WindowedEglBackend::t
}
} // namespace
#include "moc_x11_windowed_egl_backend.cpp"

View file

@ -474,3 +474,5 @@ xcb_pixmap_t X11WindowedOutput::importBuffer(GraphicsBuffer *graphicsBuffer)
}
} // namespace KWin
#include "moc_x11_windowed_output.cpp"

View file

@ -177,3 +177,5 @@ OutputLayer *X11WindowedQPainterBackend::cursorLayer(Output *output)
}
}
#include "moc_x11_windowed_qpainter_backend.cpp"

View file

@ -231,3 +231,5 @@ void ClientMachine::resolveFinished()
}
} // namespace
#include "moc_client_machine.cpp"

View file

@ -329,3 +329,5 @@ void ColorDevice::scheduleUpdate()
}
} // namespace KWin
#include "moc_colordevice.cpp"

View file

@ -85,3 +85,5 @@ void ColorManager::handleSessionActiveChanged(bool active)
}
} // namespace KWin
#include "moc_colormanager.cpp"

View file

@ -1136,3 +1136,5 @@ void X11Compositor::createOpenGLSafePoint(OpenGLSafePoint safePoint)
// included for CompositorSelectionOwner
#include "composite.moc"
#include "moc_composite.cpp"

View file

@ -298,3 +298,4 @@ void DumbGraphicsBuffer::unmap()
} // namespace KWin
#include "gbmgraphicsbufferallocator.moc"
#include "moc_gbmgraphicsbufferallocator.cpp"

View file

@ -80,3 +80,5 @@ bool GraphicsBuffer::alphaChannelFromDrmFormat(uint32_t format)
}
} // namespace KWin
#include "moc_graphicsbuffer.cpp"

View file

@ -25,3 +25,5 @@ void InputBackend::setConfig(KSharedConfigPtr config)
}
} // namespace KWin
#include "moc_inputbackend.cpp"

View file

@ -24,3 +24,5 @@ void InputDevice::setOutputName(const QString &outputName)
}
} // namespace KWin
#include "moc_inputdevice.cpp"

View file

@ -460,3 +460,5 @@ bool Output::moveCursor(const QPointF &position)
}
} // namespace KWin
#include "moc_output.cpp"

View file

@ -128,3 +128,5 @@ void OutputBackend::setSceneEglGlobalShareContext(::EGLContext context)
}
} // namespace KWin
#include "moc_outputbackend.cpp"

View file

@ -65,3 +65,5 @@ bool OutputLayer::scanout(SurfaceItem *surfaceItem)
}
} // namespace KWin
#include "moc_outputlayer.cpp"

View file

@ -58,3 +58,5 @@ std::unique_ptr<SurfaceTexture> RenderBackend::createSurfaceTextureWayland(Surfa
}
} // namespace KWin
#include "moc_renderbackend.cpp"

View file

@ -294,3 +294,5 @@ QRegion RenderLayer::mapFromGlobal(const QRegion &region) const
}
} // namespace KWin
#include "moc_renderlayer.cpp"

View file

@ -281,3 +281,5 @@ void RenderLoop::setVrrPolicy(VrrPolicy policy)
}
} // namespace KWin
#include "moc_renderloop.cpp"

View file

@ -44,3 +44,5 @@ std::unique_ptr<Session> Session::create(Type type)
}
} // namespace KWin
#include "moc_session.cpp"

View file

@ -349,3 +349,5 @@ void ConsoleKitSession::handlePrepareForSleep(bool sleep)
}
} // namespace KWin
#include "moc_session_consolekit.cpp"

View file

@ -348,3 +348,5 @@ void LogindSession::handlePrepareForSleep(bool sleep)
}
} // namespace KWin
#include "moc_session_logind.cpp"

View file

@ -52,3 +52,5 @@ void NoopSession::switchTo(uint terminal)
}
} // namespace KWin
#include "moc_session_noop.cpp"

View file

@ -150,4 +150,5 @@ GraphicsBuffer *ShmGraphicsBufferAllocator::allocate(const GraphicsBufferOptions
} // namespace KWin
#include "moc_shmgraphicsbufferallocator.cpp"
#include "shmgraphicsbufferallocator.moc"

View file

@ -697,3 +697,5 @@ void Cursor::setSource(CursorSource *source)
}
} // namespace
#include "moc_cursor.cpp"

View file

@ -161,3 +161,5 @@ void SurfaceCursorSource::update(KWaylandServer::SurfaceInterface *surface, cons
}
} // namespace KWin
#include "moc_cursorsource.cpp"

View file

@ -532,3 +532,5 @@ void PluginManagerDBusInterface::UnloadPlugin(const QString &name)
}
} // namespace
#include "moc_dbusinterface.cpp"

View file

@ -1685,3 +1685,5 @@ void DataSourceModel::setSource(KWaylandServer::AbstractDataSource *source)
endResetModel();
}
}
#include "moc_debug_console.cpp"

View file

@ -343,3 +343,5 @@ QString DecoratedClientImpl::windowClass() const
}
}
#include "moc_decoratedclient.cpp"

View file

@ -289,3 +289,5 @@ QString DecorationBridge::supportInformation() const
} // Decoration
} // KWin
#include "moc_decorationbridge.cpp"

View file

@ -160,3 +160,5 @@ void DecorationPalette::update()
}
}
#include "moc_decorationpalette.cpp"

View file

@ -177,3 +177,5 @@ void SettingsImpl::readSettings()
}
}
#include "moc_settings.cpp"

View file

@ -417,3 +417,5 @@ void EffectLoader::clear()
}
} // namespace KWin
#include "moc_effectloader.cpp"

View file

@ -2513,3 +2513,5 @@ void EffectFrameImpl::setCrossFadeProgress(qreal progress)
}
} // namespace
#include "moc_effects.cpp"

View file

@ -236,3 +236,5 @@ bool FocusChain::contains(Window *window, VirtualDesktop *desktop) const
}
} // namespace
#include "moc_focuschain.cpp"

View file

@ -119,3 +119,5 @@ FTraceDuration::~FTraceDuration()
}
}
#include "moc_ftrace.cpp"

View file

@ -579,3 +579,5 @@ int GestureRecognizer::startSwipeGesture(const QPointF &startPos)
}
}
#include "moc_gestures.cpp"

View file

@ -302,3 +302,5 @@ void GlobalShortcutsManager::processPinchEnd()
}
} // namespace
#include "moc_globalshortcuts.cpp"

View file

@ -94,3 +94,5 @@ void IdleInhibition::slotDesktopChanged()
}
}
#include "moc_idle_inhibition.cpp"

View file

@ -72,3 +72,5 @@ void IdleDetector::markAsResumed()
}
} // namespace KWin
#include "moc_idledetector.cpp"

View file

@ -3449,3 +3449,5 @@ Decoration::DecoratedClientImpl *InputDeviceHandler::decoration() const
} // namespace
#include "input.moc"
#include "moc_input.cpp"

View file

@ -977,3 +977,5 @@ void InputMethod::textInputInterfaceV3EnableRequested()
show();
}
}
#include "moc_inputmethod.cpp"

View file

@ -30,3 +30,5 @@ void InputPanelV1Integration::createWindow(InputPanelSurfaceV1Interface *shellSu
}
} // namespace KWin
#include "moc_inputpanelv1integration.cpp"

View file

@ -197,3 +197,5 @@ void InputPanelV1Window::maybeShow()
}
} // namespace KWin
#include "moc_inputpanelv1window.cpp"

View file

@ -536,3 +536,5 @@ void InternalWindow::updateInternalWindowGeometry()
}
}
#include "moc_internalwindow.cpp"

View file

@ -603,3 +603,5 @@ bool EffectsModel::shouldStore(const EffectData &data) const
}
}
#include "moc_effectsmodel.cpp"

View file

@ -181,3 +181,5 @@ void ScriptingConfig::reload()
}
} // namespace
#include "moc_genericscriptedconfig.cpp"

View file

@ -30,3 +30,5 @@ bool KWinCompositingData::isDefaults() const
}
return defaults;
}
#include "moc_kwincompositingdata.cpp"

View file

@ -180,3 +180,5 @@ void ButtonsModel::replace(const QVector<DecorationButtonType> &buttons)
}
}
#include "moc_buttonsmodel.cpp"

View file

@ -35,3 +35,5 @@ void Plugin::registerTypes(const char *uri)
}
}
#include "moc_plugin.cpp"

View file

@ -227,3 +227,5 @@ BridgeItem::~BridgeItem()
}
}
#include "moc_previewbridge.cpp"

View file

@ -260,3 +260,5 @@ void Settings::setBorderSizesIndex(int index)
}
}
#include "moc_previewsettings.cpp"

View file

@ -166,3 +166,5 @@ QModelIndex DecorationsModel::findDecoration(const QString &pluginName, const QS
}
}
#include "moc_decorationmodel.cpp"

View file

@ -174,3 +174,5 @@ bool AnimationsModel::needsSave() const
}
}
#include "moc_animationsmodel.cpp"

View file

@ -684,3 +684,5 @@ void DesktopsModel::handleCallError()
}
}
#include "moc_desktopsmodel.cpp"

View file

@ -50,3 +50,5 @@ AnimationsModel *VirtualDesktopsData::animationsModel() const
}
}
#include "moc_virtualdesktopsdata.cpp"

View file

@ -31,3 +31,5 @@ bool DesktopEffectsData::isDefaults() const
}
}
#include "moc_desktopeffectsdata.cpp"

View file

@ -89,3 +89,5 @@ bool EffectsFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex
}
} // namespace KWin
#include "moc_effectsfilterproxymodel.cpp"

View file

@ -88,3 +88,5 @@ void DesktopEffectsKCM::updateNeedsSave()
} // namespace KWin
#include "kcm.moc"
#include "moc_kcm.cpp"

View file

@ -223,3 +223,5 @@ void KActionsOptions::moduleChanged(bool state)
}
#include "main.moc"
#include "moc_main.cpp"

View file

@ -99,3 +99,5 @@ bool KWindowActionsConfig::isSaveNeeded() const
{
return managedWidgetChangeState();
}
#include "moc_mouse.cpp"

View file

@ -317,3 +317,5 @@ bool KMovingConfig::isSaveNeeded() const
{
return managedWidgetChangeState();
}
#include "moc_windows.cpp"

Some files were not shown because too many files have changed in this diff Show more