Commit dd501481 authored by Martin Flöser's avatar Martin Flöser
Browse files

[server] Interface method returning wl_resource* is called ::resource

Simplifies using the library as all Interfaces have the same methods.
Note: there are interfaces not providing the wl_resource* method.
parent c81271a3
......@@ -381,7 +381,7 @@ void TestWaylandSurface::testMultipleSurfaces()
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverSurface2 = serverSurfaceCreated.last().first().value<KWayland::Server::SurfaceInterface*>();
QVERIFY(serverSurface2);
QVERIFY(serverSurface1->surface() != serverSurface2->surface());
QVERIFY(serverSurface1->resource() != serverSurface2->resource());
// create two images
QImage black(24, 24, QImage::Format_RGB32);
......
......@@ -131,7 +131,7 @@ void CompositorInterface::Private::createSurface(wl_client *client, wl_resource
{
SurfaceInterface *surface = new SurfaceInterface(q);
surface->create(client, wl_resource_get_version(resource), id);
if (!surface->surface()) {
if (!surface->resource()) {
wl_resource_post_no_memory(resource);
delete surface;
return;
......
......@@ -402,7 +402,7 @@ void PointerInterface::setFocusedSurface(SurfaceInterface *surface, const QPoint
{
const quint32 serial = d->display->nextSerial();
if (d->focusedSurface.surface && d->focusedSurface.pointer) {
wl_pointer_send_leave(d->focusedSurface.pointer, serial, d->focusedSurface.surface->surface());
wl_pointer_send_leave(d->focusedSurface.pointer, serial, d->focusedSurface.surface->resource());
disconnect(d->destroyConnection);
}
d->focusedSurface.pointer = d->pointerForSurface(surface);
......@@ -417,7 +417,7 @@ void PointerInterface::setFocusedSurface(SurfaceInterface *surface, const QPoint
const QPoint pos = d->globalPos - surfacePosition;
wl_pointer_send_enter(d->focusedSurface.pointer, d->focusedSurface.serial,
d->focusedSurface.surface->surface(),
d->focusedSurface.surface->resource(),
wl_fixed_from_int(pos.x()), wl_fixed_from_int(pos.y()));
}
......@@ -804,7 +804,7 @@ void KeyboardInterface::setFocusedSurface(SurfaceInterface *surface)
{
const quint32 serial = d->display->nextSerial();
if (d->focusedSurface.surface && d->focusedSurface.keyboard) {
wl_keyboard_send_leave(d->focusedSurface.keyboard, serial, d->focusedSurface.surface->surface());
wl_keyboard_send_leave(d->focusedSurface.keyboard, serial, d->focusedSurface.surface->resource());
disconnect(d->destroyConnection);
}
d->focusedSurface.keyboard = d->keyboardForSurface(surface);
......@@ -824,7 +824,7 @@ void KeyboardInterface::setFocusedSurface(SurfaceInterface *surface)
uint32_t *k = reinterpret_cast<uint32_t*>(wl_array_add(&keys, sizeof(uint32_t)));
*k = it.key();
}
wl_keyboard_send_enter(d->focusedSurface.keyboard, serial, d->focusedSurface.surface->surface(), &keys);
wl_keyboard_send_enter(d->focusedSurface.keyboard, serial, d->focusedSurface.surface->resource(), &keys);
wl_array_release(&keys);
d->sendModifiers(d->focusedSurface.keyboard);
......
......@@ -177,7 +177,7 @@ void ShellInterface::Private::createSurface(wl_client *client, uint32_t version,
}
);
if (it != surfaces.constEnd()) {
wl_resource_post_error(surface->surface(), WL_DISPLAY_ERROR_INVALID_OBJECT, "ShellSurface already created");
wl_resource_post_error(surface->resource(), WL_DISPLAY_ERROR_INVALID_OBJECT, "ShellSurface already created");
return;
}
ShellSurfaceInterface *shellSurface = new ShellSurfaceInterface(q, surface);
......@@ -457,7 +457,7 @@ ShellInterface *ShellSurfaceInterface::shell() const {
return d->shell;
}
wl_resource *ShellSurfaceInterface::shellSurface() const {
wl_resource *ShellSurfaceInterface::resource() const {
return d->shellSurface;
}
......
......@@ -76,7 +76,7 @@ public:
SurfaceInterface *surface() const;
ShellInterface *shell() const;
wl_resource *shellSurface() const;
wl_resource *resource() const;
QString title() const;
QByteArray windowClass() const;
......
......@@ -123,7 +123,7 @@ void SubCompositorInterface::Private::subsurface(wl_client *client, wl_resource
// TODO: add check that parentSurface is not a child of surface
SubSurfaceInterface *s = new SubSurfaceInterface(q);
s->d->create(client, wl_resource_get_version(resource), id, surface, parentSurface);
if (!s->subSurface()) {
if (!s->resource()) {
wl_resource_post_no_memory(resource);
delete s;
return;
......@@ -313,7 +313,7 @@ QPoint SubSurfaceInterface::position() const
return d->pos;
}
wl_resource *SubSurfaceInterface::subSurface()
wl_resource *SubSurfaceInterface::resource()
{
return d->subSurface;
}
......
......@@ -72,7 +72,7 @@ public:
};
Mode mode() const;
wl_resource *subSurface();
wl_resource *resource();
QPointer<SurfaceInterface> surface();
QPointer<SurfaceInterface> parentSurface();
......
......@@ -385,7 +385,7 @@ void SurfaceInterface::Private::bufferScaleCallback(wl_client *client, wl_resour
cast(resource)->setScale(scale);
}
wl_resource *SurfaceInterface::surface() const
wl_resource *SurfaceInterface::resource() const
{
return d->surface;
}
......
......@@ -51,7 +51,7 @@ public:
void frameRendered(quint32 msec);
wl_resource *surface() const;
wl_resource *resource() const;
wl_client *client() const;
QRegion damage() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment