From e19eecaf4b45ee92fda791dc0304fa44e014f423 Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Thu, 18 Oct 2012 18:21:40 -0700 Subject: [PATCH] core: migrate to 0.99.0 Wayland protocol. Signed-off-by: U. Artie Eoff --- configure.ac | 2 +- src/core/harness.cpp | 22 ++++++++++++++-------- src/core/harness.h | 12 +++++++----- src/core/test_bind_interface.cpp | 4 ++-- src/core/test_cursor.cpp | 2 +- src/core/test_data.cpp | 2 +- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index 920dda2..e0b165a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_PREREQ([2.64]) AC_INIT([wayland-fits], - [0.95], + [0.99.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=wayland], [wayland-fits], [http://wayland.freedesktop.org/]) diff --git a/src/core/harness.cpp b/src/core/harness.cpp index 1a32362..1e76727 100644 --- a/src/core/harness.cpp +++ b/src/core/harness.cpp @@ -3,16 +3,21 @@ CoreTestHarness::CoreTestHarness() : Display::Display() - , listener_(0) + , registry_(0) { - listener_ = wl_display_add_global_listener( - *this, &CoreTestHarness::globalListener, this); - FAIL_IF_EQUAL(listener_, NULL); + registry_ = wl_display_get_registry(*this); + + static const struct wl_registry_listener listener = { + &CoreTestHarness::globalListener + }; + + wl_registry_add_listener(registry_, &listener, this); + FAIL_IF_EQUAL(registry_, NULL); } CoreTestHarness::~CoreTestHarness() { - wl_display_remove_global_listener(*this, listener_); + wl_registry_destroy(*this); } void CoreTestHarness::queueTest(Test test) @@ -23,7 +28,7 @@ void CoreTestHarness::queueTest(Test test) void CoreTestHarness::run() { // trigger client global announcements - wl_display_iterate(*this, WL_DISPLAY_READABLE); + wl_display_dispatch(*this); setup(); @@ -37,10 +42,11 @@ void CoreTestHarness::run() } /*static*/ -void CoreTestHarness::globalListener(wl_display* display, uint32_t id, const char* iface, uint32_t version, void* data) +void CoreTestHarness::globalListener( + void *data, struct wl_registry *registry, uint32_t id, const char* iface, uint32_t version) { CoreTestHarness* harness = static_cast(data); - FAIL_UNLESS_EQUAL(display, *harness); + FAIL_UNLESS_EQUAL(registry, *harness); harness->handleGlobal(id, std::string(iface), version); } diff --git a/src/core/harness.h b/src/core/harness.h index 2004c9b..12adad7 100644 --- a/src/core/harness.h +++ b/src/core/harness.h @@ -10,8 +10,8 @@ class CoreTestHarness : public Display { public: - typedef boost::function Test; - typedef std::deque Tests; + typedef boost::function Test; + typedef std::deque Tests; CoreTestHarness(); @@ -39,11 +39,13 @@ public: **/ virtual void teardown() { }; + operator wl_registry*() { return registry_; } + private: - static void globalListener(wl_display*, uint32_t, const char*, uint32_t, void*); + static void globalListener(void*, struct wl_registry*, uint32_t, const char*, uint32_t); - wl_global_listener* listener_; - Tests tests_; + wl_registry* registry_; + Tests tests_; }; #define WFITS_CORE_HARNESS_TEST_CASE(HarnessClass, suite) \ diff --git a/src/core/test_bind_interface.cpp b/src/core/test_bind_interface.cpp index 8ae63ee..b127f45 100644 --- a/src/core/test_bind_interface.cpp +++ b/src/core/test_bind_interface.cpp @@ -17,8 +17,8 @@ public: if (iface == str_interface) { object_ = static_cast( - wl_display_bind( - *this, id, &interface + wl_registry_bind( + *this, id, &interface, 1 ) ); } diff --git a/src/core/test_cursor.cpp b/src/core/test_cursor.cpp index 24d5853..0122eb4 100644 --- a/src/core/test_cursor.cpp +++ b/src/core/test_cursor.cpp @@ -26,7 +26,7 @@ public: { if (iface == "wl_shm") { - shm_ = static_cast(wl_display_bind(*this, id, &wl_shm_interface)); + shm_ = static_cast(wl_registry_bind(*this, id, &wl_shm_interface, 1)); FAIL_IF_EQUAL(shm_, NULL); } } diff --git a/src/core/test_data.cpp b/src/core/test_data.cpp index cd17713..fe20786 100644 --- a/src/core/test_data.cpp +++ b/src/core/test_data.cpp @@ -54,7 +54,7 @@ protected: { \ if (iface == #name) \ { \ - obj_ = static_cast(wl_display_bind(*this, id, & name ## _interface)); \ + obj_ = static_cast(wl_registry_bind(*this, id, & name ## _interface, 1)); \ } \ } \ }; \ -- 2.7.4