backends/x11: Move some method implementations to cpp files

This commit is contained in:
Vlad Zahorodnii 2022-12-09 17:23:21 +02:00
parent 39607a7457
commit bb83d66508
4 changed files with 64 additions and 45 deletions

View file

@ -603,6 +603,36 @@ xcb_window_t X11WindowedBackend::windowForScreen(Output *output) const
return static_cast<X11WindowedOutput *>(output)->window(); return static_cast<X11WindowedOutput *>(output)->window();
} }
xcb_connection_t *X11WindowedBackend::connection() const
{
return m_connection;
}
xcb_screen_t *X11WindowedBackend::screen() const
{
return m_screen;
}
int X11WindowedBackend::screenNumer() const
{
return m_screenNumber;
}
Display *X11WindowedBackend::display() const
{
return m_display;
}
bool X11WindowedBackend::hasXInput() const
{
return m_hasXInput;
}
QVector<CompositingType> X11WindowedBackend::supportedCompositors() const
{
return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing};
}
xcb_window_t X11WindowedBackend::window() const xcb_window_t X11WindowedBackend::window() const
{ {
return m_outputs.first()->window(); return m_outputs.first()->window();

View file

@ -96,47 +96,28 @@ class KWIN_EXPORT X11WindowedBackend : public OutputBackend
public: public:
explicit X11WindowedBackend(const X11WindowedBackendOptions &options); explicit X11WindowedBackend(const X11WindowedBackendOptions &options);
~X11WindowedBackend() override; ~X11WindowedBackend() override;
bool initialize() override;
xcb_connection_t *connection() const Display *display() const;
{ xcb_connection_t *connection() const;
return m_connection; xcb_screen_t *screen() const;
} int screenNumer() const;
xcb_screen_t *screen() const xcb_window_t rootWindow() const;
{
return m_screen;
}
int screenNumer() const
{
return m_screenNumber;
}
xcb_window_t window() const; xcb_window_t window() const;
xcb_window_t windowForScreen(Output *output) const; xcb_window_t windowForScreen(Output *output) const;
Display *display() const bool hasXInput() const;
{
return m_display;
}
xcb_window_t rootWindow() const;
bool hasXInput() const
{
return m_hasXInput;
}
bool initialize() override;
std::unique_ptr<OpenGLBackend> createOpenGLBackend() override; std::unique_ptr<OpenGLBackend> createOpenGLBackend() override;
std::unique_ptr<QPainterBackend> createQPainterBackend() override; std::unique_ptr<QPainterBackend> createQPainterBackend() override;
std::unique_ptr<InputBackend> createInputBackend() override; std::unique_ptr<InputBackend> createInputBackend() override;
QVector<CompositingType> supportedCompositors() const override;
QVector<CompositingType> supportedCompositors() const override Outputs outputs() const override;
{
return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing};
}
X11WindowedInputDevice *pointerDevice() const; X11WindowedInputDevice *pointerDevice() const;
X11WindowedInputDevice *keyboardDevice() const; X11WindowedInputDevice *keyboardDevice() const;
X11WindowedInputDevice *touchDevice() const; X11WindowedInputDevice *touchDevice() const;
Outputs outputs() const override;
private: private:
void createOutputs(); void createOutputs();
void grabKeyboard(xcb_timestamp_t time); void grabKeyboard(xcb_timestamp_t time);

View file

@ -136,6 +136,26 @@ SoftwareVsyncMonitor *X11WindowedOutput::vsyncMonitor() const
return m_vsyncMonitor.get(); return m_vsyncMonitor.get();
} }
X11WindowedBackend *X11WindowedOutput::backend() const
{
return m_backend;
}
X11WindowedCursor *X11WindowedOutput::cursor() const
{
return m_cursor.get();
}
xcb_window_t X11WindowedOutput::window() const
{
return m_window;
}
QPoint X11WindowedOutput::hostPosition() const
{
return m_hostPosition;
}
void X11WindowedOutput::init(const QSize &pixelSize, qreal scale) void X11WindowedOutput::init(const QSize &pixelSize, qreal scale)
{ {
const int refreshRate = 60000; // TODO: get refresh rate via randr const int refreshRate = 60000; // TODO: get refresh rate via randr

View file

@ -57,24 +57,12 @@ public:
void init(const QSize &pixelSize, qreal scale); void init(const QSize &pixelSize, qreal scale);
void resize(const QSize &pixelSize); void resize(const QSize &pixelSize);
X11WindowedBackend *backend() const X11WindowedBackend *backend() const;
{ X11WindowedCursor *cursor() const;
return m_backend; xcb_window_t window() const;
}
X11WindowedCursor *cursor() const
{
return m_cursor.get();
}
xcb_window_t window() const
{
return m_window;
}
QPoint internalPosition() const; QPoint internalPosition() const;
QPoint hostPosition() const QPoint hostPosition() const;
{
return m_hostPosition;
}
void setHostPosition(const QPoint &pos); void setHostPosition(const QPoint &pos);
void setWindowTitle(const QString &title); void setWindowTitle(const QString &title);