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();
}
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
{
return m_outputs.first()->window();

View file

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

View file

@ -136,6 +136,26 @@ SoftwareVsyncMonitor *X11WindowedOutput::vsyncMonitor() const
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)
{
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 resize(const QSize &pixelSize);
X11WindowedBackend *backend() const
{
return m_backend;
}
X11WindowedCursor *cursor() const
{
return m_cursor.get();
}
xcb_window_t window() const
{
return m_window;
}
X11WindowedBackend *backend() const;
X11WindowedCursor *cursor() const;
xcb_window_t window() const;
QPoint internalPosition() const;
QPoint hostPosition() const
{
return m_hostPosition;
}
QPoint hostPosition() const;
void setHostPosition(const QPoint &pos);
void setWindowTitle(const QString &title);