From bc56729ffe560a0571b1a1213dec11519f91dc4b Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Sat, 17 Oct 2020 13:16:37 -0300 Subject: [PATCH] screenshooter: rename some functions to avoid conflicts We have two functions with the name weston_screenshooter_shoot(): 1. screenshot protocol function that the screenshooter client uses to request screenshots to the compositor 2. libweston function used by the compositor to take screenshots as requested by the screenshooter client Until now we had no problem with that, but in the next commits we are going to use the screenshot protocol in the test suite, which is also user of libweston. So rename screenshot protocol function to weston_screenshooter_take_shot() to avoid the conflict. For consistency, also rename screenshooter_shoot() to screenshooter_take_shot() in compositor/weston-screenshooter.c Signed-off-by: Leandro Ribeiro --- clients/screenshot.c | 6 +++--- compositor/weston-screenshooter.c | 10 +++++----- protocol/weston-screenshooter.xml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clients/screenshot.c b/clients/screenshot.c index bbf2e6bd..ea0a2b2e 100644 --- a/clients/screenshot.c +++ b/clients/screenshot.c @@ -315,9 +315,9 @@ int main(int argc, char *argv[]) output->height, &output->data, sh_data.shm); - weston_screenshooter_shoot(sh_data.screenshooter, - output->output, - output->buffer); + weston_screenshooter_take_shot(sh_data.screenshooter, + output->output, + output->buffer); sh_data.buffer_copy_done = 0; while (!sh_data.buffer_copy_done) wl_display_roundtrip(display); diff --git a/compositor/weston-screenshooter.c b/compositor/weston-screenshooter.c index ed354b0c..18b2dca4 100644 --- a/compositor/weston-screenshooter.c +++ b/compositor/weston-screenshooter.c @@ -61,10 +61,10 @@ screenshooter_done(void *data, enum weston_screenshooter_outcome outcome) } static void -screenshooter_shoot(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *output_resource, - struct wl_resource *buffer_resource) +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; @@ -80,7 +80,7 @@ screenshooter_shoot(struct wl_client *client, } struct weston_screenshooter_interface screenshooter_implementation = { - screenshooter_shoot + screenshooter_take_shot }; static void diff --git a/protocol/weston-screenshooter.xml b/protocol/weston-screenshooter.xml index 8c4486c3..1df83f4a 100644 --- a/protocol/weston-screenshooter.xml +++ b/protocol/weston-screenshooter.xml @@ -1,7 +1,7 @@ - +