| 1 | /* |
| 2 | * Copyright © 2008 Kristian Høgsberg |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files (the |
| 6 | * "Software"), to deal in the Software without restriction, including |
| 7 | * without limitation the rights to use, copy, modify, merge, publish, |
| 8 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 9 | * permit persons to whom the Software is furnished to do so, subject to |
| 10 | * the following conditions: |
| 11 | * |
| 12 | * The above copyright notice and this permission notice (including the |
| 13 | * next paragraph) shall be included in all copies or substantial |
| 14 | * portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | * SOFTWARE. |
| 24 | */ |
| 25 | |
| 26 | /** \file |
| 27 | * |
| 28 | * \brief Include the server API, deprecations and protocol C API. |
| 29 | * |
| 30 | * \warning Use of this header file is discouraged. Prefer including |
| 31 | * wayland-server-core.h instead, which does not include the |
| 32 | * server protocol header and as such only defines the library |
| 33 | * API, excluding the deprecated API below. |
| 34 | */ |
| 35 | |
| 36 | #ifndef WAYLAND_SERVER_H |
| 37 | #define WAYLAND_SERVER_H |
| 38 | |
| 39 | #include <stdint.h> |
| 40 | #include "wayland-server-core.h" |
| 41 | |
| 42 | #ifdef __cplusplus |
| 43 | extern "C" { |
| 44 | #endif |
| 45 | |
| 46 | /* |
| 47 | * The user can set this macro to hide the wl_object, wl_resource and wl_buffer |
| 48 | * objects alongside the associated API. |
| 49 | * |
| 50 | * The structs were meant to be opaque, although we missed that in the early days. |
| 51 | * |
| 52 | * NOTE: the list of structs, functions, etc in this section MUST NEVER GROW. |
| 53 | * Otherwise we will break forward compatibility and applications that used to |
| 54 | * build fine will no longer be able to do so. |
| 55 | */ |
| 56 | #ifndef WL_HIDE_DEPRECATED |
| 57 | |
| 58 | struct wl_object { |
| 59 | const struct wl_interface *interface; |
| 60 | const void *implementation; |
| 61 | uint32_t id; |
| 62 | }; |
| 63 | |
| 64 | struct wl_resource { |
| 65 | struct wl_object object; |
| 66 | wl_resource_destroy_func_t destroy; |
| 67 | struct wl_list link; |
| 68 | struct wl_signal destroy_signal; |
| 69 | struct wl_client *client; |
| 70 | void *data; |
| 71 | }; |
| 72 | |
| 73 | uint32_t |
| 74 | wl_client_add_resource(struct wl_client *client, |
| 75 | struct wl_resource *resource) WL_DEPRECATED; |
| 76 | |
| 77 | struct wl_resource * |
| 78 | wl_client_add_object(struct wl_client *client, |
| 79 | const struct wl_interface *interface, |
| 80 | const void *implementation, |
| 81 | uint32_t id, void *data) WL_DEPRECATED; |
| 82 | |
| 83 | struct wl_resource * |
| 84 | wl_client_new_object(struct wl_client *client, |
| 85 | const struct wl_interface *interface, |
| 86 | const void *implementation, void *data) WL_DEPRECATED; |
| 87 | |
| 88 | struct wl_global * |
| 89 | wl_display_add_global(struct wl_display *display, |
| 90 | const struct wl_interface *interface, |
| 91 | void *data, |
| 92 | wl_global_bind_func_t bind) WL_DEPRECATED; |
| 93 | |
| 94 | void |
| 95 | wl_display_remove_global(struct wl_display *display, |
| 96 | struct wl_global *global) WL_DEPRECATED; |
| 97 | |
| 98 | #endif |
| 99 | |
| 100 | #ifdef __cplusplus |
| 101 | } |
| 102 | #endif |
| 103 | |
| 104 | #include "wayland-server-protocol.h" |
| 105 | |
| 106 | #endif |
| 107 | |