| 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 "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 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_pointer; | 15 struct wl_pointer; |
| 15 struct wl_registry; | 16 struct wl_registry; |
| 16 struct wl_seat; | 17 struct wl_seat; |
| 17 struct wl_shm; | 18 struct wl_shm; |
| 18 struct wl_shm_pool; | 19 struct wl_shm_pool; |
| 19 struct wl_surface; | 20 struct wl_surface; |
| 20 struct xdg_shell; | 21 struct xdg_shell; |
| 21 struct xdg_surface; | 22 struct xdg_surface; |
| 22 | 23 |
| 23 namespace wl { | 24 namespace wl { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 37 static void (*deleter)(wl_compositor*); | 38 static void (*deleter)(wl_compositor*); |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 template <> | 41 template <> |
| 41 struct ObjectTraits<wl_display> { | 42 struct ObjectTraits<wl_display> { |
| 42 static const wl_interface* interface; | 43 static const wl_interface* interface; |
| 43 static void (*deleter)(wl_display*); | 44 static void (*deleter)(wl_display*); |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 template <> | 47 template <> |
| 48 struct ObjectTraits<wl_keyboard> { |
| 49 static const wl_interface* interface; |
| 50 static void (*deleter)(wl_keyboard*); |
| 51 }; |
| 52 |
| 53 template <> |
| 47 struct ObjectTraits<wl_pointer> { | 54 struct ObjectTraits<wl_pointer> { |
| 48 static const wl_interface* interface; | 55 static const wl_interface* interface; |
| 49 static void (*deleter)(wl_pointer*); | 56 static void (*deleter)(wl_pointer*); |
| 50 }; | 57 }; |
| 51 | 58 |
| 52 template <> | 59 template <> |
| 53 struct ObjectTraits<wl_registry> { | 60 struct ObjectTraits<wl_registry> { |
| 54 static const wl_interface* interface; | 61 static const wl_interface* interface; |
| 55 static void (*deleter)(wl_registry*); | 62 static void (*deleter)(wl_registry*); |
| 56 }; | 63 }; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 119 |
| 113 template <typename T> | 120 template <typename T> |
| 114 wl::Object<T> Bind(wl_registry* registry, uint32_t name, uint32_t version) { | 121 wl::Object<T> Bind(wl_registry* registry, uint32_t name, uint32_t version) { |
| 115 return wl::Object<T>(static_cast<T*>( | 122 return wl::Object<T>(static_cast<T*>( |
| 116 wl_registry_bind(registry, name, ObjectTraits<T>::interface, version))); | 123 wl_registry_bind(registry, name, ObjectTraits<T>::interface, version))); |
| 117 } | 124 } |
| 118 | 125 |
| 119 } // namespace wl | 126 } // namespace wl |
| 120 | 127 |
| 121 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ | 128 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OBJECT_H_ |
| OLD | NEW |