50 #ifdef QT_WAYLAND_GL_SUPPORT 54 #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT 58 #include <QtCore/QAbstractEventDispatcher> 59 #include <QtGui/QApplication> 60 #include <QtGui/private/qapplication_p.h> 69 struct wl_surface * surface = wl_compositor_create_surface(
mCompositor);
70 wl_surface_set_user_data(surface, handle);
75 int width,
int height,
77 struct wl_visual *visual)
79 return wl_shm_create_buffer(
mShm, fd, width, height, stride, visual);
97 #ifdef QT_WAYLAND_GL_SUPPORT 100 return mEglIntegration;
104 #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT 107 return mWindowManagerIntegration;
112 uint32_t time, uint32_t edges,
113 struct wl_surface *surface,
114 int32_t width, int32_t height)
122 ww->
configure(time, edges, 0, 0, width, height);
132 mDisplay = wl_display_connect(NULL);
135 qFatal(
"No wayland connection available.");
140 #ifdef QT_WAYLAND_GL_SUPPORT 144 #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT 150 qRegisterMetaType<uint32_t>(
"uint32_t");
152 #ifdef QT_WAYLAND_GL_SUPPORT 153 mEglIntegration->initialize();
169 #ifdef QT_WAYLAND_GL_SUPPORT 170 delete mEglIntegration;
183 wl_display_sync_callback(
mDisplay, func, data);
188 wl_display_frame_callback(
mDisplay, surface, func, data);
194 wl_display_iterate(
mDisplay, WL_DISPLAY_WRITABLE);
211 int ret =
::select(
mFd+1, &rs, &ws, &es, &timeout );
218 wl_display_iterate(
mDisplay, WL_DISPLAY_READABLE);
223 wl_display_iterate(
mDisplay, WL_DISPLAY_READABLE);
236 int32_t x, int32_t y,
237 int32_t physicalWidth,
238 int32_t physicalHeight,
240 const char *make,
const char *model)
243 QRect outputRect =
QRect(x, y, physicalWidth, physicalHeight);
248 struct wl_output *wl_output,
281 const char *interface,
295 if (interface ==
"wl_output") {
296 struct wl_output *output = wl_output_create(
mDisplay,
id, 1);
298 }
else if (interface ==
"wl_compositor") {
302 }
else if (interface ==
"wl_shm") {
304 }
else if (interface ==
"wl_shell"){
307 }
else if (interface ==
"wl_input_device") {
311 }
else if (interface ==
"wl_selection_offer") {
319 struct wl_compositor *compositor,
320 uint32_t
id, uint32_t token)
325 case WL_COMPOSITOR_VISUAL_ARGB32:
328 case WL_COMPOSITOR_VISUAL_PREMULTIPLIED_ARGB32:
329 self->premultiplied_argb_visual =
330 wl_visual_create(
self->mDisplay,
id, 1);
332 case WL_COMPOSITOR_VISUAL_XRGB32:
333 self->rgb_visual = wl_visual_create(
self->mDisplay,
id, 1);
static QWaylandClipboard * clipboard
void createSelectionOffer(uint32_t id)
static QWaylandWindowManagerIntegration * createIntegration(QWaylandDisplay *waylandDisplay)
static void mode(void *data, struct wl_output *wl_output, uint32_t flags, int width, int height, int refresh)
static const struct wl_output_listener outputListener
void createNewScreen(struct wl_output *output, QRect geometry)
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
void configure(uint32_t time, uint32_t edges, int32_t x, int32_t y, int32_t width, int32_t height)
void displayHandleGlobal(uint32_t id, const QByteArray &interface, uint32_t version)
struct wl_visual * rgbVisual()
static QAbstractEventDispatcher * instance(QThread *thread=0)
Returns a pointer to the event dispatcher object for the specified thread.
The QByteArray class provides an array of bytes.
static void handleVisual(void *data, struct wl_compositor *compositor, uint32_t id, uint32_t token)
struct wl_compositor * mCompositor
struct wl_visual * argbVisual()
static void outputHandleGeometry(void *data, struct wl_output *output, int32_t x, int32_t y, int32_t width, int32_t height, int subpixel, const char *make, const char *model)
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
QList< QPlatformScreen * > mScreens
void blockingReadEvents()
static const struct wl_shell_listener shellListener
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
void append(const T &t)
Inserts value at the end of the list.
struct wl_visual * argbPremultipliedVisual()
Q_GUI_EXPORT EGLDisplay display()
void frameCallback(wl_display_frame_func_t func, struct wl_surface *surface, void *data)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
struct wl_surface * createSurface(void *handle)
QList< QWaylandInputDevice * > mInputDevices
static const char * data(const QByteArray &arr)
static int sourceUpdate(uint32_t mask, void *data)
void syncCallback(wl_display_sync_func_t func, void *data)
static QWaylandGLIntegration * createGLIntegration(QWaylandDisplay *waylandDisplay)
Q_CORE_EXPORT void qFatal(const char *,...)
struct wl_shell * wl_shell() const
struct wl_visual * argb_visual
The QRect class defines a rectangle in the plane using integer precision.
struct wl_visual * premultiplied_argb_visual
static void shellHandleConfigure(void *data, struct wl_shell *shell, uint32_t time, uint32_t edges, struct wl_surface *surface, int32_t width, int32_t height)
QSocketNotifier * mReadNotifier
static const struct wl_compositor_listener compositorListener
struct wl_display * mDisplay
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
struct wl_buffer * createShmBuffer(int fd, int width, int height, uint32_t stride, struct wl_visual *visual)
void qErrnoWarning(const char *msg,...)
struct wl_display * wl_display() const
struct wl_visual * rgb_visual