static void motion(struct wl_listener *listener, void *data) { struct weston_output_zoom *zoom = container_of(listener, struct weston_output_zoom, motion_listener); struct weston_output *output = container_of(zoom, struct weston_output, zoom); weston_output_update_zoom(output); }
WL_EXPORT void weston_text_cursor_position_notify(struct weston_surface *surface, wl_fixed_t cur_pos_x, wl_fixed_t cur_pos_y) { struct weston_output *output; wl_fixed_t global_x, global_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, wl_fixed_to_int(global_x), wl_fixed_to_int(global_y), NULL)) { output->zoom.text_cursor.x = global_x; output->zoom.text_cursor.y = global_y; weston_output_update_zoom(output, ZOOM_FOCUS_TEXT); } }