compositor: remove weston-screenshooter protocol

There are no internal users left for this protocol, they have been
migrated to the new weston-output-capture protocol. There are no
external users, because this protocol was private and never installed.

Remove this dead code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2022-10-04 12:13:02 +03:00
parent 949b2eb751
commit 17df553bf3
5 changed files with 0 additions and 92 deletions

View File

@ -7,8 +7,6 @@ srcs_weston = [
text_input_unstable_v1_protocol_c,
input_method_unstable_v1_server_protocol_h,
input_method_unstable_v1_protocol_c,
weston_screenshooter_server_protocol_h,
weston_screenshooter_protocol_c,
]
deps_weston = [
dep_libshared,

View File

@ -31,13 +31,10 @@
#include <libweston/libweston.h>
#include "weston.h"
#include "weston-screenshooter-server-protocol.h"
#include "shared/helpers.h"
#include <libweston/weston-log.h>
struct screenshooter {
struct weston_compositor *ec;
struct wl_global *global;
struct wl_client *client;
struct weston_process process;
struct wl_listener destroy_listener;
@ -45,74 +42,6 @@ struct screenshooter {
struct wl_listener authorization;
};
static void
screenshooter_done(void *data, enum weston_screenshooter_outcome outcome)
{
struct wl_resource *resource = data;
switch (outcome) {
case WESTON_SCREENSHOOTER_SUCCESS:
weston_screenshooter_send_done(resource);
break;
case WESTON_SCREENSHOOTER_NO_MEMORY:
wl_resource_post_no_memory(resource);
break;
default:
break;
}
}
static void
screenshooter_take_shot(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *output_resource,
struct wl_resource *buffer_resource)
{
struct weston_output *output =
weston_head_from_resource(output_resource)->output;
struct weston_compositor *ec = output->compositor;
struct weston_buffer *buffer =
weston_buffer_from_resource(ec, buffer_resource);
if (buffer == NULL) {
wl_resource_post_no_memory(resource);
return;
}
weston_screenshooter_shoot(output, buffer, screenshooter_done, resource);
}
struct weston_screenshooter_interface screenshooter_implementation = {
screenshooter_take_shot
};
static void
bind_shooter(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
struct screenshooter *shooter = data;
struct wl_resource *resource;
bool debug_enabled =
weston_compositor_is_debug_protocol_enabled(shooter->ec);
resource = wl_resource_create(client,
&weston_screenshooter_interface, 1, id);
if (!debug_enabled && !shooter->client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"screenshooter failed: permission denied. "\
"Debug protocol must be enabled");
return;
} else if (!debug_enabled && client != shooter->client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"screenshooter failed: permission denied.");
return;
}
wl_resource_set_implementation(resource, &screenshooter_implementation,
data, NULL);
}
static void
screenshooter_sigchld(struct weston_process *process, int status)
{
@ -187,7 +116,6 @@ screenshooter_destroy(struct wl_listener *listener, void *data)
wl_list_remove(&shooter->destroy_listener.link);
wl_list_remove(&shooter->authorization.link);
wl_global_destroy(shooter->global);
free(shooter);
}
@ -202,9 +130,6 @@ screenshooter_create(struct weston_compositor *ec)
shooter->ec = ec;
shooter->global = wl_global_create(ec->wl_display,
&weston_screenshooter_interface, 1,
shooter, bind_shooter);
weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_SUPER,
screenshooter_binding, shooter);
weston_compositor_add_key_binding(ec, KEY_R, MODIFIER_SUPER,

View File

@ -51,8 +51,6 @@ srcs_libweston = [
pointer_constraints_unstable_v1_server_protocol_h,
relative_pointer_unstable_v1_protocol_c,
relative_pointer_unstable_v1_server_protocol_h,
weston_screenshooter_protocol_c,
weston_screenshooter_server_protocol_h,
single_pixel_buffer_v1_protocol_c,
single_pixel_buffer_v1_server_protocol_h,
text_cursor_position_protocol_c,

View File

@ -34,7 +34,6 @@ generated_protocols = [
[ 'weston-debug', 'internal' ],
[ 'weston-desktop-shell', 'internal' ],
[ 'weston-output-capture', 'internal' ],
[ 'weston-screenshooter', 'internal' ],
[ 'weston-content-protection', 'internal' ],
[ 'weston-test', 'internal' ],
[ 'weston-touch-calibration', 'internal' ],

View File

@ -1,12 +0,0 @@
<protocol name="weston_screenshooter">
<interface name="weston_screenshooter" version="1">
<request name="take_shot">
<arg name="output" type="object" interface="wl_output"/>
<arg name="buffer" type="object" interface="wl_buffer"/>
</request>
<event name="done">
</event>
</interface>
</protocol>