1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
|
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_HELPER_H_
#define COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_HELPER_H_
#include <alpha-compositing-unstable-v1-client-protocol.h>
#include <aura-output-management-client-protocol.h>
#include <aura-shell-client-protocol.h>
#include <chrome-color-management-client-protocol.h>
#include <content-type-v1-client-protocol.h>
#include <cursor-shapes-unstable-v1-client-protocol.h>
#include <extended-drag-unstable-v1-client-protocol.h>
#include <fractional-scale-v1-client-protocol.h>
#include <fullscreen-shell-unstable-v1-client-protocol.h>
#include <gaming-input-unstable-v2-client-protocol.h>
#include <idle-inhibit-unstable-v1-client-protocol.h>
#include <input-timestamps-unstable-v1-client-protocol.h>
#include <keyboard-configuration-unstable-v1-client-protocol.h>
#include <keyboard-extension-unstable-v1-client-protocol.h>
#include <keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h>
#include <linux-dmabuf-unstable-v1-client-protocol.h>
#include <linux-explicit-synchronization-unstable-v1-client-protocol.h>
#include <notification-shell-unstable-v1-client-protocol.h>
#include <overlay-prioritizer-client-protocol.h>
#include <pointer-constraints-unstable-v1-client-protocol.h>
#include <pointer-gestures-unstable-v1-client-protocol.h>
#include <presentation-time-client-protocol.h>
#include <relative-pointer-unstable-v1-client-protocol.h>
#include <remote-shell-unstable-v1-client-protocol.h>
#include <remote-shell-unstable-v2-client-protocol.h>
#include <secure-output-unstable-v1-client-protocol.h>
#include <single-pixel-buffer-v1-client-protocol.h>
#include <stylus-tools-unstable-v1-client-protocol.h>
#include <stylus-unstable-v2-client-protocol.h>
#include <surface-augmenter-client-protocol.h>
#include <text-input-extension-unstable-v1-client-protocol.h>
#include <text-input-unstable-v1-client-protocol.h>
#include <touchpad-haptics-unstable-v1-client-protocol.h>
#include <ui-controls-unstable-v1-client-protocol.h>
#include <viewporter-client-protocol.h>
#include <vsync-feedback-unstable-v1-client-protocol.h>
#include <wayland-client-core.h>
#include <wayland-client-protocol.h>
#include <xdg-decoration-unstable-v1-client-protocol.h>
#include <xdg-output-unstable-v1-client-protocol.h>
#include <xdg-shell-client-protocol.h>
#include <xdg-shell-unstable-v6-client-protocol.h>
#include "base/scoped_generic.h"
#if defined(USE_GBM)
#include <gbm.h>
#if defined(USE_VULKAN)
#include <vulkan/vulkan.h>
// vulkan.h includes <X11/Xlib.h> when VK_USE_PLATFORM_XLIB_KHR is defined
// after https://github.com/KhronosGroup/Vulkan-Headers/pull/534.
// This defines some macros which break build, so undefine them here.
#undef Always
#undef Bool
#undef False
#undef None
#undef Status
#undef Success
#undef True
#endif // defined(USE_GBM)
#endif // defined(USE_VULKAN)
// Default deleters template specialization forward decl.
#define DEFAULT_DELETER_FDECL(TypeName) \
namespace std { \
template <> \
struct default_delete<TypeName> { \
void operator()(TypeName* ptr); \
}; \
}
DEFAULT_DELETER_FDECL(surface_augmenter)
DEFAULT_DELETER_FDECL(overlay_prioritizer)
DEFAULT_DELETER_FDECL(wl_buffer)
DEFAULT_DELETER_FDECL(wl_callback)
DEFAULT_DELETER_FDECL(wl_compositor)
DEFAULT_DELETER_FDECL(wl_display)
DEFAULT_DELETER_FDECL(wl_pointer)
DEFAULT_DELETER_FDECL(wl_region)
DEFAULT_DELETER_FDECL(wl_registry)
DEFAULT_DELETER_FDECL(wl_seat)
DEFAULT_DELETER_FDECL(wl_shell)
DEFAULT_DELETER_FDECL(wl_shell_surface)
DEFAULT_DELETER_FDECL(wl_shm)
DEFAULT_DELETER_FDECL(wl_shm_pool)
DEFAULT_DELETER_FDECL(wl_subcompositor)
DEFAULT_DELETER_FDECL(wl_subsurface)
DEFAULT_DELETER_FDECL(wl_surface)
DEFAULT_DELETER_FDECL(wl_touch)
DEFAULT_DELETER_FDECL(wl_output)
DEFAULT_DELETER_FDECL(wp_presentation)
DEFAULT_DELETER_FDECL(struct wp_presentation_feedback)
DEFAULT_DELETER_FDECL(zaura_output_manager)
DEFAULT_DELETER_FDECL(zaura_output_manager_v2)
DEFAULT_DELETER_FDECL(zaura_shell)
DEFAULT_DELETER_FDECL(zaura_surface)
DEFAULT_DELETER_FDECL(zaura_toplevel)
DEFAULT_DELETER_FDECL(zaura_output)
DEFAULT_DELETER_FDECL(zcr_color_manager_v1)
DEFAULT_DELETER_FDECL(zcr_color_management_output_v1)
DEFAULT_DELETER_FDECL(zcr_color_management_surface_v1)
DEFAULT_DELETER_FDECL(zcr_color_space_creator_v1)
DEFAULT_DELETER_FDECL(zcr_color_space_v1)
DEFAULT_DELETER_FDECL(zwp_linux_buffer_release_v1)
DEFAULT_DELETER_FDECL(zwp_fullscreen_shell_v1)
DEFAULT_DELETER_FDECL(zwp_input_timestamps_manager_v1)
DEFAULT_DELETER_FDECL(zwp_input_timestamps_v1)
DEFAULT_DELETER_FDECL(zwp_linux_buffer_params_v1)
DEFAULT_DELETER_FDECL(zwp_linux_dmabuf_v1)
DEFAULT_DELETER_FDECL(zwp_linux_explicit_synchronization_v1)
DEFAULT_DELETER_FDECL(zwp_linux_surface_synchronization_v1)
DEFAULT_DELETER_FDECL(wp_single_pixel_buffer_manager_v1)
DEFAULT_DELETER_FDECL(zcr_vsync_feedback_v1)
DEFAULT_DELETER_FDECL(zcr_vsync_timing_v1)
DEFAULT_DELETER_FDECL(wl_data_device_manager)
DEFAULT_DELETER_FDECL(wl_data_device)
DEFAULT_DELETER_FDECL(wl_data_source)
DEFAULT_DELETER_FDECL(wl_data_offer)
DEFAULT_DELETER_FDECL(wp_content_type_manager_v1)
DEFAULT_DELETER_FDECL(wp_content_type_v1)
DEFAULT_DELETER_FDECL(wp_fractional_scale_manager_v1)
DEFAULT_DELETER_FDECL(wp_viewporter)
DEFAULT_DELETER_FDECL(xdg_wm_base)
DEFAULT_DELETER_FDECL(zwp_text_input_manager_v1)
DEFAULT_DELETER_FDECL(zcr_secure_output_v1)
DEFAULT_DELETER_FDECL(zcr_alpha_compositing_v1)
DEFAULT_DELETER_FDECL(zcr_stylus_v2)
DEFAULT_DELETER_FDECL(zcr_pointer_stylus_v2)
DEFAULT_DELETER_FDECL(zcr_cursor_shapes_v1)
DEFAULT_DELETER_FDECL(zcr_gaming_input_v2)
DEFAULT_DELETER_FDECL(zcr_keyboard_configuration_v1)
DEFAULT_DELETER_FDECL(zcr_keyboard_extension_v1)
DEFAULT_DELETER_FDECL(zwp_keyboard_shortcuts_inhibit_manager_v1)
DEFAULT_DELETER_FDECL(zcr_notification_shell_v1)
DEFAULT_DELETER_FDECL(zcr_remote_shell_v1)
DEFAULT_DELETER_FDECL(zcr_remote_shell_v2)
DEFAULT_DELETER_FDECL(zcr_stylus_tools_v1)
DEFAULT_DELETER_FDECL(zcr_text_input_extension_v1)
DEFAULT_DELETER_FDECL(zcr_touchpad_haptics_v1)
DEFAULT_DELETER_FDECL(zwp_pointer_gestures_v1)
DEFAULT_DELETER_FDECL(zwp_pointer_constraints_v1)
DEFAULT_DELETER_FDECL(zwp_relative_pointer_manager_v1)
DEFAULT_DELETER_FDECL(zxdg_decoration_manager_v1)
DEFAULT_DELETER_FDECL(zcr_extended_drag_v1)
DEFAULT_DELETER_FDECL(xdg_surface)
DEFAULT_DELETER_FDECL(xdg_toplevel)
DEFAULT_DELETER_FDECL(zxdg_output_manager_v1)
DEFAULT_DELETER_FDECL(zwp_idle_inhibit_manager_v1)
DEFAULT_DELETER_FDECL(zcr_remote_surface_v1)
DEFAULT_DELETER_FDECL(zcr_remote_surface_v2)
DEFAULT_DELETER_FDECL(zcr_ui_controls_v1)
#if defined(USE_GBM)
DEFAULT_DELETER_FDECL(gbm_bo)
DEFAULT_DELETER_FDECL(gbm_device)
#endif
namespace exo {
namespace wayland {
namespace clients {
#if defined(USE_GBM)
struct DeleteTextureTraits {
static unsigned InvalidValue();
static void Free(unsigned texture);
};
using ScopedTexture = base::ScopedGeneric<unsigned, DeleteTextureTraits>;
struct DeleteEglImageTraits {
static void* InvalidValue();
static void Free(void* image);
};
using ScopedEglImage = base::ScopedGeneric<void*, DeleteEglImageTraits>;
struct DeleteEglSyncTraits {
static void* InvalidValue();
static void Free(void* sync);
};
using ScopedEglSync = base::ScopedGeneric<void*, DeleteEglSyncTraits>;
#if defined(USE_VULKAN)
struct DeleteVkInstanceTraits {
static VkInstance InvalidValue();
static void Free(VkInstance instance);
};
using ScopedVkInstance =
base::ScopedGeneric<VkInstance, DeleteVkInstanceTraits>;
struct DeleteVkDeviceTraits {
static VkDevice InvalidValue();
static void Free(VkDevice device);
};
using ScopedVkDevice = base::ScopedGeneric<VkDevice, DeleteVkDeviceTraits>;
struct DeleteVkPipelineTraits {
VkDevice vk_device;
static VkPipeline InvalidValue();
void Free(VkPipeline pipeline);
};
using ScopedVkPipeline =
base::ScopedGeneric<VkPipeline, DeleteVkPipelineTraits>;
struct DeleteVkPipelineLayoutTraits {
VkDevice vk_device;
static VkPipelineLayout InvalidValue();
void Free(VkPipelineLayout pipeline_layout);
};
using ScopedVkPipelineLayout =
base::ScopedGeneric<VkPipelineLayout, DeleteVkPipelineLayoutTraits>;
struct DeleteVkSamplerTraits {
VkDevice vk_device;
static VkSampler InvalidValue();
void Free(VkSampler sampler);
};
using ScopedVkSampler = base::ScopedGeneric<VkSampler, DeleteVkSamplerTraits>;
struct DeleteVkDescriptorSetLayoutTraits {
VkDevice vk_device;
static VkDescriptorSetLayout InvalidValue();
void Free(VkDescriptorSetLayout descriptor_set_layout);
};
using ScopedVkDescriptorSetLayout =
base::ScopedGeneric<VkDescriptorSetLayout,
DeleteVkDescriptorSetLayoutTraits>;
struct DeleteVkDescriptorPoolTraits {
VkDevice vk_device;
static VkDescriptorPool InvalidValue();
void Free(VkDescriptorPool descriptor_pool);
};
using ScopedVkDescriptorPool =
base::ScopedGeneric<VkDescriptorPool, DeleteVkDescriptorPoolTraits>;
struct DeleteVkCommandPoolTraits {
VkDevice vk_device;
static VkCommandPool InvalidValue();
void Free(VkCommandPool command_pool);
};
using ScopedVkCommandPool =
base::ScopedGeneric<VkCommandPool, DeleteVkCommandPoolTraits>;
struct DeleteVkRenderPassTraits {
VkDevice vk_device;
static VkRenderPass InvalidValue();
void Free(VkRenderPass render_pass);
};
using ScopedVkRenderPass =
base::ScopedGeneric<VkRenderPass, DeleteVkRenderPassTraits>;
struct DeleteVkDeviceMemoryTraits {
VkDevice vk_device;
static VkDeviceMemory InvalidValue();
void Free(VkDeviceMemory device_memory);
};
using ScopedVkDeviceMemory =
base::ScopedGeneric<VkDeviceMemory, DeleteVkDeviceMemoryTraits>;
struct DeleteVkImageTraits {
VkDevice vk_device;
static VkImage InvalidValue();
void Free(VkImage image);
};
using ScopedVkImage = base::ScopedGeneric<VkImage, DeleteVkImageTraits>;
struct DeleteVkImageViewTraits {
VkDevice vk_device;
static VkImageView InvalidValue();
void Free(VkImageView image_view);
};
using ScopedVkImageView =
base::ScopedGeneric<VkImageView, DeleteVkImageViewTraits>;
struct DeleteVkFramebufferTraits {
VkDevice vk_device;
static VkFramebuffer InvalidValue();
void Free(VkFramebuffer framebuffer);
};
using ScopedVkFramebuffer =
base::ScopedGeneric<VkFramebuffer, DeleteVkFramebufferTraits>;
#endif // defined(USE_VULKAN)
#endif // defined(USE_GBM)
} // namespace clients
} // namespace wayland
} // namespace exo
#endif // COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_HELPER_H_
|