There are functions below the "Deprecated functions below" comment that are not deprecated.
Move the deprecated functions back down, and add a comment at the end of the file to try to keep this from happening again. Signed-off-by: Derek Foreman <[email protected]> --- src/wayland-server.c | 199 ++++++++++++++++++++++++++------------------------- 1 file changed, 102 insertions(+), 97 deletions(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index c845dd6..5e06f48 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -1331,103 +1331,6 @@ wl_log_set_handler_server(wl_log_func_t handler) wl_log_handler = handler; } -/* Deprecated functions below. */ - -uint32_t -wl_client_add_resource(struct wl_client *client, - struct wl_resource *resource) WL_DEPRECATED; - -WL_EXPORT uint32_t -wl_client_add_resource(struct wl_client *client, - struct wl_resource *resource) -{ - if (resource->object.id == 0) { - resource->object.id = - wl_map_insert_new(&client->objects, - WL_MAP_ENTRY_LEGACY, resource); - } else if (wl_map_insert_at(&client->objects, WL_MAP_ENTRY_LEGACY, - resource->object.id, resource) < 0) { - wl_resource_post_error(client->display_resource, - WL_DISPLAY_ERROR_INVALID_OBJECT, - "invalid new id %d", - resource->object.id); - return 0; - } - - resource->client = client; - wl_signal_init(&resource->destroy_signal); - - return resource->object.id; -} - -struct wl_resource * -wl_client_add_object(struct wl_client *client, - const struct wl_interface *interface, - const void *implementation, - uint32_t id, void *data) WL_DEPRECATED; - -WL_EXPORT struct wl_resource * -wl_client_add_object(struct wl_client *client, - const struct wl_interface *interface, - const void *implementation, uint32_t id, void *data) -{ - struct wl_resource *resource; - - resource = wl_resource_create(client, interface, -1, id); - if (resource == NULL) - wl_client_post_no_memory(client); - else - wl_resource_set_implementation(resource, - implementation, data, NULL); - - return resource; -} - -struct wl_resource * -wl_client_new_object(struct wl_client *client, - const struct wl_interface *interface, - const void *implementation, void *data) WL_DEPRECATED; - -WL_EXPORT struct wl_resource * -wl_client_new_object(struct wl_client *client, - const struct wl_interface *interface, - const void *implementation, void *data) -{ - struct wl_resource *resource; - - resource = wl_resource_create(client, interface, -1, 0); - if (resource == NULL) - wl_client_post_no_memory(client); - else - wl_resource_set_implementation(resource, - implementation, data, NULL); - - return resource; -} - -struct wl_global * -wl_display_add_global(struct wl_display *display, - const struct wl_interface *interface, - void *data, wl_global_bind_func_t bind) WL_DEPRECATED; - -WL_EXPORT struct wl_global * -wl_display_add_global(struct wl_display *display, - const struct wl_interface *interface, - void *data, wl_global_bind_func_t bind) -{ - return wl_global_create(display, interface, interface->version, data, bind); -} - -void -wl_display_remove_global(struct wl_display *display, - struct wl_global *global) WL_DEPRECATED; - -WL_EXPORT void -wl_display_remove_global(struct wl_display *display, struct wl_global *global) -{ - wl_global_destroy(global); -} - /** Add support for a wl_shm pixel format * * \param display The display object @@ -1479,3 +1382,105 @@ wl_display_get_additional_shm_formats(struct wl_display *display) { return &display->additional_shm_formats; } + +/* Deprecated functions below. */ + +uint32_t +wl_client_add_resource(struct wl_client *client, + struct wl_resource *resource) WL_DEPRECATED; + +WL_EXPORT uint32_t +wl_client_add_resource(struct wl_client *client, + struct wl_resource *resource) +{ + if (resource->object.id == 0) { + resource->object.id = + wl_map_insert_new(&client->objects, + WL_MAP_ENTRY_LEGACY, resource); + } else if (wl_map_insert_at(&client->objects, WL_MAP_ENTRY_LEGACY, + resource->object.id, resource) < 0) { + wl_resource_post_error(client->display_resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "invalid new id %d", + resource->object.id); + return 0; + } + + resource->client = client; + wl_signal_init(&resource->destroy_signal); + + return resource->object.id; +} + +struct wl_resource * +wl_client_add_object(struct wl_client *client, + const struct wl_interface *interface, + const void *implementation, + uint32_t id, void *data) WL_DEPRECATED; + +WL_EXPORT struct wl_resource * +wl_client_add_object(struct wl_client *client, + const struct wl_interface *interface, + const void *implementation, uint32_t id, void *data) +{ + struct wl_resource *resource; + + resource = wl_resource_create(client, interface, -1, id); + if (resource == NULL) + wl_client_post_no_memory(client); + else + wl_resource_set_implementation(resource, + implementation, data, NULL); + + return resource; +} + +struct wl_resource * +wl_client_new_object(struct wl_client *client, + const struct wl_interface *interface, + const void *implementation, void *data) WL_DEPRECATED; + +WL_EXPORT struct wl_resource * +wl_client_new_object(struct wl_client *client, + const struct wl_interface *interface, + const void *implementation, void *data) +{ + struct wl_resource *resource; + + resource = wl_resource_create(client, interface, -1, 0); + if (resource == NULL) + wl_client_post_no_memory(client); + else + wl_resource_set_implementation(resource, + implementation, data, NULL); + + return resource; +} + +struct wl_global * +wl_display_add_global(struct wl_display *display, + const struct wl_interface *interface, + void *data, wl_global_bind_func_t bind) WL_DEPRECATED; + +WL_EXPORT struct wl_global * +wl_display_add_global(struct wl_display *display, + const struct wl_interface *interface, + void *data, wl_global_bind_func_t bind) +{ + return wl_global_create(display, interface, interface->version, data, bind); +} + +void +wl_display_remove_global(struct wl_display *display, + struct wl_global *global) WL_DEPRECATED; + +WL_EXPORT void +wl_display_remove_global(struct wl_display *display, struct wl_global *global) +{ + wl_global_destroy(global); +} + +/* Functions at the end of this file are deprecated. Instead of adding new + * code here, add it before the comment above that states: + * Deprecated functions below. + */ -- 2.1.4 _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
