Commit 132bcb34 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Rename some methods in xdg-foreign classes

parent b07800a2
Pipeline #54661 passed with stage
in 7 minutes and 27 seconds
......@@ -167,7 +167,7 @@ SurfaceInterface *XdgImporterV2Interface::transientFor(SurfaceInterface *surface
if (it == d->parents.constEnd()) {
return nullptr;
}
return (*it)->parentResource();
return (*it)->surface();
}
void XdgImporterV2InterfacePrivate::zxdg_importer_v2_destroy(Resource *resource)
......@@ -185,7 +185,7 @@ void XdgImporterV2InterfacePrivate::zxdg_importer_v2_import_toplevel(Resource *r
return;
}
SurfaceInterface *surface = exp->parentResource();
SurfaceInterface *surface = exp->surface();
if (!surface) {
zxdg_imported_v2_send_destroyed(resource->handle);
return;
......@@ -221,7 +221,7 @@ void XdgImporterV2InterfacePrivate::zxdg_importer_v2_import_toplevel(Resource *r
parents[child] = XdgImported;
children[XdgImported] = child;
SurfaceInterface *parent = XdgImported->parentResource();
SurfaceInterface *parent = XdgImported->surface();
emit q->transientChanged(child, parent);
//child surface destroyed
......@@ -232,7 +232,7 @@ void XdgImporterV2InterfacePrivate::zxdg_importer_v2_import_toplevel(Resource *r
KWaylandServer::XdgImportedV2Interface* parent = *it;
children.remove(*it);
parents.erase(it);
emit q->transientChanged(nullptr, parent->parentResource());
emit q->transientChanged(nullptr, parent->surface());
}
});
});
......@@ -263,17 +263,16 @@ XdgImporterV2InterfacePrivate::XdgImporterV2InterfacePrivate(XdgImporterV2Interf
}
XdgExportedV2Interface::XdgExportedV2Interface(SurfaceInterface *surface, wl_resource *resource )
: QObject(nullptr)
, QtWaylandServer::zxdg_exported_v2(resource)
, surface(surface)
: QtWaylandServer::zxdg_exported_v2(resource)
, m_surface(surface)
{
}
XdgExportedV2Interface::~XdgExportedV2Interface() = default;
SurfaceInterface *XdgExportedV2Interface::parentResource()
SurfaceInterface *XdgExportedV2Interface::surface()
{
return surface;
return m_surface;
}
void XdgExportedV2Interface::zxdg_exported_v2_destroy(Resource *resource)
......@@ -290,7 +289,7 @@ void XdgExportedV2Interface::zxdg_exported_v2_destroy_resource(Resource *resourc
XdgImportedV2Interface::XdgImportedV2Interface(SurfaceInterface *surface, wl_resource *resource)
: QObject(nullptr)
, QtWaylandServer::zxdg_imported_v2(resource)
, surface(surface)
, m_surface(surface)
{
}
......@@ -298,12 +297,12 @@ XdgImportedV2Interface::~XdgImportedV2Interface() = default;
SurfaceInterface *XdgImportedV2Interface::child() const
{
return parentOf.data();
return m_child;
}
SurfaceInterface *XdgImportedV2Interface::parentResource()
SurfaceInterface *XdgImportedV2Interface::surface() const
{
return surface;
return m_surface;
}
void XdgImportedV2Interface::zxdg_imported_v2_set_parent_of(Resource *resource, wl_resource *surface)
......@@ -315,7 +314,7 @@ void XdgImportedV2Interface::zxdg_imported_v2_set_parent_of(Resource *resource,
return;
}
parentOf = surf;
m_child = surf;
emit childChanged(surf);
}
......
......@@ -67,15 +67,14 @@ public:
explicit XdgExportedV2Interface(SurfaceInterface *surface, wl_resource *resource );
~XdgExportedV2Interface() override;
SurfaceInterface *parentResource();
private:
SurfaceInterface *surface;
SurfaceInterface *surface();
protected:
void zxdg_exported_v2_destroy(Resource *resource) override;
void zxdg_exported_v2_destroy_resource(Resource *resource) override;
private:
SurfaceInterface *m_surface;
};
class XdgImportedV2Interface : public QObject, QtWaylandServer::zxdg_imported_v2
......@@ -86,19 +85,18 @@ public:
~XdgImportedV2Interface() override;
SurfaceInterface *child() const;
SurfaceInterface *parentResource();
SurfaceInterface *surface() const;
Q_SIGNALS:
void childChanged(KWaylandServer::SurfaceInterface *child);
private:
SurfaceInterface *surface;
QPointer<SurfaceInterface> parentOf;
SurfaceInterface *m_surface;
QPointer<SurfaceInterface> m_child;
protected:
void zxdg_imported_v2_set_parent_of(Resource *resource, wl_resource *surface) override;
void zxdg_imported_v2_destroy(Resource *resource) override;
void zxdg_imported_v2_destroy_resource(Resource *resource) override;
};
}
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