本文整理汇总了C++中Registry::createSeat方法的典型用法代码示例。如果您正苦于以下问题:C++ Registry::createSeat方法的具体用法?C++ Registry::createSeat怎么用?C++ Registry::createSeat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::createSeat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeWayland
//_______________________________________________________
void WindowManager::initializeWayland()
{
#if BREEZE_HAVE_KWAYLAND
if( !Helper::isWayland() ) return;
if( _seat ) {
// already initialized
return;
}
using namespace KWayland::Client;
auto connection = ConnectionThread::fromApplication( this );
if( !connection ) {
return;
}
Registry *registry = new Registry( this );
registry->create( connection );
connect(registry, &Registry::interfacesAnnounced, this,
[registry, this] {
const auto interface = registry->interface( Registry::Interface::Seat );
if( interface.name != 0 ) {
_seat = registry->createSeat( interface.name, interface.version, this );
connect(_seat, &Seat::hasPointerChanged, this, &WindowManager::waylandHasPointerChanged);
}
}
);
registry->setup();
connection->roundtrip();
#endif
}
示例2: init
void InputStackingOrderTest::init()
{
using namespace KWayland::Client;
// setup connection
m_connection = new ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
m_connection->moveToThread(m_thread);
m_thread->start();
m_connection->initConnection();
QVERIFY(connectedSpy.wait());
m_queue = new EventQueue(this);
QVERIFY(!m_queue->isValid());
m_queue->setup(m_connection);
QVERIFY(m_queue->isValid());
Registry registry;
registry.setEventQueue(m_queue);
QSignalSpy compositorSpy(®istry, &Registry::compositorAnnounced);
QSignalSpy shmSpy(®istry, &Registry::shmAnnounced);
QSignalSpy shellSpy(®istry, &Registry::shellAnnounced);
QSignalSpy seatSpy(®istry, &Registry::seatAnnounced);
QSignalSpy allAnnounced(®istry, &Registry::interfacesAnnounced);
QVERIFY(allAnnounced.isValid());
QVERIFY(shmSpy.isValid());
QVERIFY(shellSpy.isValid());
QVERIFY(compositorSpy.isValid());
QVERIFY(seatSpy.isValid());
registry.create(m_connection->display());
QVERIFY(registry.isValid());
registry.setup();
QVERIFY(allAnnounced.wait());
QVERIFY(!compositorSpy.isEmpty());
QVERIFY(!shmSpy.isEmpty());
QVERIFY(!shellSpy.isEmpty());
QVERIFY(!seatSpy.isEmpty());
m_compositor = registry.createCompositor(compositorSpy.first().first().value<quint32>(), compositorSpy.first().last().value<quint32>(), this);
QVERIFY(m_compositor->isValid());
m_shm = registry.createShmPool(shmSpy.first().first().value<quint32>(), shmSpy.first().last().value<quint32>(), this);
QVERIFY(m_shm->isValid());
m_shell = registry.createShell(shellSpy.first().first().value<quint32>(), shellSpy.first().last().value<quint32>(), this);
QVERIFY(m_shell->isValid());
m_seat = registry.createSeat(seatSpy.first().first().value<quint32>(), seatSpy.first().last().value<quint32>(), this);
QVERIFY(m_seat->isValid());
QSignalSpy hasPointerSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(hasPointerSpy.isValid());
QVERIFY(hasPointerSpy.wait());
screens()->setCurrent(0);
Cursor::setPos(QPoint(640, 512));
}