[PATCH weston 1/2] Convert text cursor position protocol to use fixed types.
Kristian Høgsberg
hoegsberg at gmail.com
Mon Jun 4 08:11:10 PDT 2012
On Fri, Jun 01, 2012 at 12:46:09PM -0600, Scott Moreau wrote:
Thanks, all applied.
Kristian
> ---
> clients/window.c | 4 +++-
> protocol/text-cursor-position.xml | 4 ++--
> src/compositor.c | 18 +++++++++---------
> src/compositor.h | 8 +++++---
> src/text-cursor-position.c | 2 +-
> 5 files changed, 20 insertions(+), 16 deletions(-)
>
> diff --git a/clients/window.c b/clients/window.c
> index 69bcb15..88bc8a4 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -2701,7 +2701,9 @@ window_set_text_cursor_position(struct window *window, int32_t x, int32_t y)
> return;
>
> text_cursor_position_notify(text_cursor_position,
> - window->surface, x, y);
> + window->surface,
> + wl_fixed_from_int(x),
> + wl_fixed_from_int(y));
>
> window->send_cursor_position = 0;
> }
> diff --git a/protocol/text-cursor-position.xml b/protocol/text-cursor-position.xml
> index dbeda72..0fbc54e 100644
> --- a/protocol/text-cursor-position.xml
> +++ b/protocol/text-cursor-position.xml
> @@ -3,8 +3,8 @@
> <interface name="text_cursor_position" version="1">
> <request name="notify">
> <arg name="surface" type="object" interface="wl_surface"/>
> - <arg name="x" type="uint"/>
> - <arg name="y" type="uint"/>
> + <arg name="x" type="fixed"/>
> + <arg name="y" type="fixed"/>
> </request>
> </interface>
>
> diff --git a/src/compositor.c b/src/compositor.c
> index b299e03..76339eb 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -2732,23 +2732,23 @@ weston_output_destroy(struct weston_output *output)
>
> WL_EXPORT void
> weston_text_cursor_position_notify(struct weston_surface *surface,
> - int32_t cur_pos_x,
> - int32_t cur_pos_y)
> + wl_fixed_t cur_pos_x,
> + wl_fixed_t cur_pos_y)
> {
> struct weston_output *output;
> - int32_t global_x, global_y;
> + wl_fixed_t global_x, global_y;
>
> - weston_surface_to_global(surface, cur_pos_x, cur_pos_y,
> + weston_surface_to_global_fixed(surface, cur_pos_x, cur_pos_y,
> &global_x, &global_y);
>
> wl_list_for_each(output, &surface->compositor->output_list, link)
> if (output->zoom.active &&
> pixman_region32_contains_point(&output->region,
> - global_x, global_y, NULL))
> - weston_output_update_zoom(output,
> - wl_fixed_from_int(global_x),
> - wl_fixed_from_int(global_y),
> - ZOOM_TEXT_CURSOR);
> + wl_fixed_to_int(global_x),
> + wl_fixed_to_int(global_y),
> + NULL))
> + weston_output_update_zoom(output, global_x, global_y,
> + ZOOM_TEXT_CURSOR);
> }
>
> WL_EXPORT void
> diff --git a/src/compositor.h b/src/compositor.h
> index d070471..9802578 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -631,10 +631,12 @@ weston_compositor_init(struct weston_compositor *ec, struct wl_display *display,
> void
> weston_compositor_shutdown(struct weston_compositor *ec);
> void
> -weston_output_update_zoom(struct weston_output *output,
> - int x, int y, uint32_t type);
> +weston_text_cursor_position_notify(struct weston_surface *surface,
> + wl_fixed_t x, wl_fixed_t y);
> void
> -weston_text_cursor_position_notify(struct weston_surface *surface, int x, int y);
> +weston_output_update_zoom(struct weston_output *output,
> + wl_fixed_t x, wl_fixed_t y,
> + uint32_t type);
> void
> weston_output_update_matrix(struct weston_output *output);
> void
> diff --git a/src/text-cursor-position.c b/src/text-cursor-position.c
> index 6f46636..ef1085a 100644
> --- a/src/text-cursor-position.c
> +++ b/src/text-cursor-position.c
> @@ -37,7 +37,7 @@ static void
> text_cursor_position_notify(struct wl_client *client,
> struct wl_resource *resource,
> struct wl_resource *surface_resource,
> - uint32_t x, uint32_t y)
> + wl_fixed_t x, wl_fixed_t y)
> {
> weston_text_cursor_position_notify((struct weston_surface *) surface_resource, x, y);
> }
> --
> 1.7.7.6
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list