File indexing completed on 2024-12-22 05:09:24

0001 /*
0002     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 #ifndef WAYLAND_SURFACE_P_H
0007 #define WAYLAND_SURFACE_P_H
0008 
0009 #include "surface.h"
0010 #include "wayland_pointer_p.h"
0011 // Wayland
0012 #include <wayland-client-protocol.h>
0013 
0014 namespace KWayland
0015 {
0016 namespace Client
0017 {
0018 class Q_DECL_HIDDEN Surface::Private
0019 {
0020 public:
0021     Private(Surface *q);
0022     void setupFrameCallback();
0023 
0024     WaylandPointer<wl_surface, wl_surface_destroy> surface;
0025     bool frameCallbackInstalled = false;
0026     QSize size;
0027     bool foreign = false;
0028     qint32 scale = 1;
0029     QList<Output *> outputs;
0030 
0031     void setup(wl_surface *s);
0032 
0033     static QList<Surface *> s_surfaces;
0034 
0035 private:
0036     void handleFrameCallback();
0037     static void frameCallback(void *data, wl_callback *callback, uint32_t time);
0038     static void enterCallback(void *data, wl_surface *wl_surface, wl_output *output);
0039     static void leaveCallback(void *data, wl_surface *wl_surface, wl_output *output);
0040     void removeOutput(Output *o);
0041 
0042     Surface *q;
0043     static const wl_callback_listener s_listener;
0044     static const wl_surface_listener s_surfaceListener;
0045 };
0046 
0047 }
0048 }
0049 
0050 #endif