| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ | 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ |
| 6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ | 6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ |
| 7 | 7 |
| 8 #include <wayland-client-core.h> | 8 #include <wayland-client-core.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 struct wl_buffer; | 12 struct wl_buffer; |
| 13 struct wl_compositor; | 13 struct wl_compositor; |
| 14 struct wl_keyboard; |
| 14 struct wl_output; | 15 struct wl_output; |
| 15 struct wl_pointer; | 16 struct wl_pointer; |
| 16 struct wl_registry; | 17 struct wl_registry; |
| 17 struct wl_seat; | 18 struct wl_seat; |
| 18 struct wl_shm; | 19 struct wl_shm; |
| 19 struct wl_shm_pool; | 20 struct wl_shm_pool; |
| 20 struct wl_surface; | 21 struct wl_surface; |
| 21 struct xdg_shell; | 22 struct xdg_shell; |
| 22 struct xdg_surface; | 23 struct xdg_surface; |
| 23 | 24 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 static void (*deleter)(wl_display*); | 45 static void (*deleter)(wl_display*); |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 template <> | 48 template <> |
| 48 struct ObjectTraits<wl_output> { | 49 struct ObjectTraits<wl_output> { |
| 49 static const wl_interface* interface; | 50 static const wl_interface* interface; |
| 50 static void (*deleter)(wl_output*); | 51 static void (*deleter)(wl_output*); |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 template <> | 54 template <> |
| 55 struct ObjectTraits<wl_keyboard> { |
| 56 static const wl_interface* interface; |
| 57 static void (*deleter)(wl_keyboard*); |
| 58 }; |
| 59 |
| 60 template <> |
| 54 struct ObjectTraits<wl_pointer> { | 61 struct ObjectTraits<wl_pointer> { |
| 55 static const wl_interface* interface; | 62 static const wl_interface* interface; |
| 56 static void (*deleter)(wl_pointer*); | 63 static void (*deleter)(wl_pointer*); |
| 57 }; | 64 }; |
| 58 | 65 |
| 59 template <> | 66 template <> |
| 60 struct ObjectTraits<wl_registry> { | 67 struct ObjectTraits<wl_registry> { |
| 61 static const wl_interface* interface; | 68 static const wl_interface* interface; |
| 62 static void (*deleter)(wl_registry*); | 69 static void (*deleter)(wl_registry*); |
| 63 }; | 70 }; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 126 |
| 120 template <typename T> | 127 template <typename T> |
| 121 wl::Object<T> Bind(wl_registry* registry, uint32_t name, uint32_t version) { | 128 wl::Object<T> Bind(wl_registry* registry, uint32_t name, uint32_t version) { |
| 122 return wl::Object<T>(static_cast<T*>( | 129 return wl::Object<T>(static_cast<T*>( |
| 123 wl_registry_bind(registry, name, ObjectTraits<T>::interface, version))); | 130 wl_registry_bind(registry, name, ObjectTraits<T>::interface, version))); |
| 124 } | 131 } |
| 125 | 132 |
| 126 } // namespace wl | 133 } // namespace wl |
| 127 | 134 |
| 128 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ | 135 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ |
| OLD | NEW |