Commit 4dda8b16 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

introduce cursor shape protocol

This extension allows the cursor shape by its ID rather than graphical
data through surface. This is an extension, so the existing behavior
will work as-is without any changes.

Bug: b/70666810
Change-Id: Iafa576a6d2e0103f7bc1b6eb295a0187f967a80a
Reviewed-on: https://chromium-review.googlesource.com/1040670
Commit-Queue: David Reveman <reveman@chromium.org>
Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559427}
parent 403cebbd
...@@ -131,6 +131,8 @@ void Pointer::SetCursor(Surface* surface, const gfx::Point& hotspot) { ...@@ -131,6 +131,8 @@ void Pointer::SetCursor(Surface* surface, const gfx::Point& hotspot) {
} }
UpdatePointerSurface(surface); UpdatePointerSurface(surface);
cursor_changed = true; cursor_changed = true;
} else if (!surface && cursor_ != ui::CursorType::kNone) {
cursor_changed = true;
} }
if (hotspot != hotspot_) { if (hotspot != hotspot_) {
...@@ -146,14 +148,26 @@ void Pointer::SetCursor(Surface* surface, const gfx::Point& hotspot) { ...@@ -146,14 +148,26 @@ void Pointer::SetCursor(Surface* surface, const gfx::Point& hotspot) {
// snapshot of cursor, otherwise cancel pending capture and immediately set // snapshot of cursor, otherwise cancel pending capture and immediately set
// the cursor to "none". // the cursor to "none".
if (root_surface()) { if (root_surface()) {
cursor_ = ui::CursorType::kCustom;
CaptureCursor(hotspot); CaptureCursor(hotspot);
} else { } else {
cursor_ = ui::CursorType::kNone;
cursor_bitmap_.reset(); cursor_bitmap_.reset();
cursor_capture_weak_ptr_factory_.InvalidateWeakPtrs(); cursor_capture_weak_ptr_factory_.InvalidateWeakPtrs();
UpdateCursor(); UpdateCursor();
} }
} }
void Pointer::SetCursorType(ui::CursorType cursor_type) {
if (cursor_ == cursor_type)
return;
cursor_ = cursor_type;
cursor_bitmap_.reset();
UpdatePointerSurface(nullptr);
cursor_capture_weak_ptr_factory_.InvalidateWeakPtrs();
UpdateCursor();
}
void Pointer::SetGesturePinchDelegate(PointerGesturePinchDelegate* delegate) { void Pointer::SetGesturePinchDelegate(PointerGesturePinchDelegate* delegate) {
pinch_delegate_ = delegate; pinch_delegate_ = delegate;
} }
...@@ -446,9 +460,7 @@ void Pointer::UpdateCursor() { ...@@ -446,9 +460,7 @@ void Pointer::UpdateCursor() {
auto* helper = WMHelper::GetInstance(); auto* helper = WMHelper::GetInstance();
aura::client::CursorClient* cursor_client = helper->GetCursorClient(); aura::client::CursorClient* cursor_client = helper->GetCursorClient();
if (cursor_bitmap_.drawsNothing()) { if (cursor_ == ui::CursorType::kCustom) {
cursor_ = ui::CursorType::kNone;
} else {
SkBitmap bitmap = cursor_bitmap_; SkBitmap bitmap = cursor_bitmap_;
gfx::Point hotspot = gfx::Point hotspot =
gfx::ScaleToFlooredPoint(cursor_hotspot_, capture_ratio_); gfx::ScaleToFlooredPoint(cursor_hotspot_, capture_ratio_);
...@@ -468,14 +480,14 @@ void Pointer::UpdateCursor() { ...@@ -468,14 +480,14 @@ void Pointer::UpdateCursor() {
ui::PlatformCursor platform_cursor; ui::PlatformCursor platform_cursor;
#if defined(USE_OZONE) #if defined(USE_OZONE)
// TODO(reveman): Add interface for creating cursors from GpuMemoryBuffers // TODO(reveman): Add interface for creating cursors from GpuMemoryBuffers
// and use that here instead of the current bitmap API. crbug.com/686600 // and use that here instead of the current bitmap API.
// https://crbug.com/686600
platform_cursor = ui::CursorFactoryOzone::GetInstance()->CreateImageCursor( platform_cursor = ui::CursorFactoryOzone::GetInstance()->CreateImageCursor(
bitmap, hotspot, 0); bitmap, hotspot, 0);
#elif defined(USE_X11) #elif defined(USE_X11)
XcursorImage* image = ui::SkBitmapToXcursorImage(&bitmap, hotspot); XcursorImage* image = ui::SkBitmapToXcursorImage(&bitmap, hotspot);
platform_cursor = ui::CreateReffedCustomXCursor(image); platform_cursor = ui::CreateReffedCustomXCursor(image);
#endif #endif
cursor_ = ui::CursorType::kCustom;
cursor_.SetPlatformCursor(platform_cursor); cursor_.SetPlatformCursor(platform_cursor);
cursor_.set_custom_bitmap(bitmap); cursor_.set_custom_bitmap(bitmap);
cursor_.set_custom_hotspot(hotspot); cursor_.set_custom_hotspot(hotspot);
......
...@@ -57,6 +57,10 @@ class Pointer : public SurfaceTreeHost, ...@@ -57,6 +57,10 @@ class Pointer : public SurfaceTreeHost,
// pointer location, in surface local coordinates. // pointer location, in surface local coordinates.
void SetCursor(Surface* surface, const gfx::Point& hotspot); void SetCursor(Surface* surface, const gfx::Point& hotspot);
// Set the pointer cursor type. This is similar to SetCursor, but this method
// accepts ui::CursorType instead of the surface for the pointer image.
void SetCursorType(ui::CursorType cursor_type);
// Set delegate for pinch events. // Set delegate for pinch events.
void SetGesturePinchDelegate(PointerGesturePinchDelegate* delegate); void SetGesturePinchDelegate(PointerGesturePinchDelegate* delegate);
......
...@@ -18,9 +18,11 @@ ...@@ -18,9 +18,11 @@
#include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
#include "components/viz/service/surfaces/surface.h" #include "components/viz/service/surfaces/surface.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/env.h" #include "ui/aura/env.h"
#include "ui/events/event_utils.h" #include "ui/events/event_utils.h"
#include "ui/events/test/event_generator.h" #include "ui/events/test/event_generator.h"
#include "ui/views/widget/widget.h"
namespace exo { namespace exo {
namespace { namespace {
...@@ -112,6 +114,210 @@ TEST_F(PointerTest, SetCursor) { ...@@ -112,6 +114,210 @@ TEST_F(PointerTest, SetCursor) {
pointer.reset(); pointer.reset();
} }
TEST_F(PointerTest, SetCursorNull) {
std::unique_ptr<Surface> surface(new Surface);
std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
surface->Attach(buffer.get());
surface->Commit();
MockPointerDelegate delegate;
std::unique_ptr<Pointer> pointer(new Pointer(&delegate));
ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface.get()))
.WillRepeatedly(testing::Return(true));
EXPECT_CALL(delegate, OnPointerFrame()).Times(1);
EXPECT_CALL(delegate, OnPointerEnter(surface.get(), gfx::PointF(), 0));
generator.MoveMouseTo(surface->window()->GetBoundsInScreen().origin());
pointer->SetCursor(nullptr, gfx::Point());
RunAllPendingInMessageLoop();
EXPECT_EQ(nullptr, pointer->root_surface());
aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(
shell_surface->GetWidget()->GetNativeWindow()->GetRootWindow());
EXPECT_EQ(ui::CursorType::kNone, cursor_client->GetCursor().native_type());
EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
pointer.reset();
}
TEST_F(PointerTest, SetCursorType) {
std::unique_ptr<Surface> surface(new Surface);
std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
surface->Attach(buffer.get());
surface->Commit();
MockPointerDelegate delegate;
std::unique_ptr<Pointer> pointer(new Pointer(&delegate));
ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface.get()))
.WillRepeatedly(testing::Return(true));
EXPECT_CALL(delegate, OnPointerFrame()).Times(1);
EXPECT_CALL(delegate, OnPointerEnter(surface.get(), gfx::PointF(), 0));
generator.MoveMouseTo(surface->window()->GetBoundsInScreen().origin());
pointer->SetCursorType(ui::CursorType::kIBeam);
RunAllPendingInMessageLoop();
EXPECT_EQ(nullptr, pointer->root_surface());
aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(
shell_surface->GetWidget()->GetNativeWindow()->GetRootWindow());
EXPECT_EQ(ui::CursorType::kIBeam, cursor_client->GetCursor().native_type());
// Set the pointer with surface after setting pointer type.
std::unique_ptr<Surface> pointer_surface(new Surface);
std::unique_ptr<Buffer> pointer_buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
pointer_surface->Attach(pointer_buffer.get());
pointer_surface->Commit();
pointer->SetCursor(pointer_surface.get(), gfx::Point());
RunAllPendingInMessageLoop();
{
viz::SurfaceId surface_id = pointer->host_window()->GetSurfaceId();
viz::SurfaceManager* surface_manager = aura::Env::GetInstance()
->context_factory_private()
->GetFrameSinkManager()
->surface_manager();
ASSERT_TRUE(surface_manager->GetSurfaceForId(surface_id)->HasActiveFrame());
const viz::CompositorFrame& frame =
surface_manager->GetSurfaceForId(surface_id)->GetActiveFrame();
EXPECT_EQ(gfx::Rect(0, 0, 10, 10),
frame.render_pass_list.back()->output_rect);
}
// Set the pointer type after the pointer surface is specified.
pointer->SetCursorType(ui::CursorType::kCross);
RunAllPendingInMessageLoop();
EXPECT_EQ(nullptr, pointer->root_surface());
EXPECT_EQ(ui::CursorType::kCross, cursor_client->GetCursor().native_type());
EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
pointer.reset();
}
TEST_F(PointerTest, SetCursorAndSetCursorType) {
std::unique_ptr<Surface> surface(new Surface);
std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
surface->Attach(buffer.get());
surface->Commit();
MockPointerDelegate delegate;
std::unique_ptr<Pointer> pointer(new Pointer(&delegate));
ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface.get()))
.WillRepeatedly(testing::Return(true));
EXPECT_CALL(delegate, OnPointerFrame()).Times(1);
EXPECT_CALL(delegate, OnPointerEnter(surface.get(), gfx::PointF(), 0));
generator.MoveMouseTo(surface->window()->GetBoundsInScreen().origin());
std::unique_ptr<Surface> pointer_surface(new Surface);
std::unique_ptr<Buffer> pointer_buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
pointer_surface->Attach(pointer_buffer.get());
pointer_surface->Commit();
// Set pointer surface.
pointer->SetCursor(pointer_surface.get(), gfx::Point());
RunAllPendingInMessageLoop();
{
viz::SurfaceId surface_id = pointer->host_window()->GetSurfaceId();
viz::SurfaceManager* surface_manager = aura::Env::GetInstance()
->context_factory_private()
->GetFrameSinkManager()
->surface_manager();
ASSERT_TRUE(surface_manager->GetSurfaceForId(surface_id)->HasActiveFrame());
const viz::CompositorFrame& frame =
surface_manager->GetSurfaceForId(surface_id)->GetActiveFrame();
EXPECT_EQ(gfx::Rect(0, 0, 10, 10),
frame.render_pass_list.back()->output_rect);
}
// Set the cursor type to the kNone through SetCursorType.
pointer->SetCursorType(ui::CursorType::kNone);
RunAllPendingInMessageLoop();
EXPECT_EQ(nullptr, pointer->root_surface());
// Set the same pointer surface again.
pointer->SetCursor(pointer_surface.get(), gfx::Point());
RunAllPendingInMessageLoop();
{
viz::SurfaceId surface_id = pointer->host_window()->GetSurfaceId();
viz::SurfaceManager* surface_manager = aura::Env::GetInstance()
->context_factory_private()
->GetFrameSinkManager()
->surface_manager();
ASSERT_TRUE(surface_manager->GetSurfaceForId(surface_id)->HasActiveFrame());
const viz::CompositorFrame& frame =
surface_manager->GetSurfaceForId(surface_id)->GetActiveFrame();
EXPECT_EQ(gfx::Rect(0, 0, 10, 10),
frame.render_pass_list.back()->output_rect);
}
EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
pointer.reset();
}
TEST_F(PointerTest, SetCursorNullAndSetCursorType) {
std::unique_ptr<Surface> surface(new Surface);
std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
surface->Attach(buffer.get());
surface->Commit();
MockPointerDelegate delegate;
std::unique_ptr<Pointer> pointer(new Pointer(&delegate));
ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface.get()))
.WillRepeatedly(testing::Return(true));
EXPECT_CALL(delegate, OnPointerFrame()).Times(1);
EXPECT_CALL(delegate, OnPointerEnter(surface.get(), gfx::PointF(), 0));
generator.MoveMouseTo(surface->window()->GetBoundsInScreen().origin());
// Set nullptr surface.
pointer->SetCursor(nullptr, gfx::Point());
RunAllPendingInMessageLoop();
EXPECT_EQ(nullptr, pointer->root_surface());
aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(
shell_surface->GetWidget()->GetNativeWindow()->GetRootWindow());
EXPECT_EQ(ui::CursorType::kNone, cursor_client->GetCursor().native_type());
// Set the cursor type.
pointer->SetCursorType(ui::CursorType::kIBeam);
RunAllPendingInMessageLoop();
EXPECT_EQ(nullptr, pointer->root_surface());
EXPECT_EQ(ui::CursorType::kIBeam, cursor_client->GetCursor().native_type());
// Set nullptr surface again.
pointer->SetCursor(nullptr, gfx::Point());
RunAllPendingInMessageLoop();
EXPECT_EQ(nullptr, pointer->root_surface());
EXPECT_EQ(ui::CursorType::kNone, cursor_client->GetCursor().native_type());
EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
pointer.reset();
}
TEST_F(PointerTest, OnPointerEnter) { TEST_F(PointerTest, OnPointerEnter) {
std::unique_ptr<Surface> surface(new Surface); std::unique_ptr<Surface> surface(new Surface);
std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
......
...@@ -50,6 +50,7 @@ source_set("wayland") { ...@@ -50,6 +50,7 @@ source_set("wayland") {
"//skia", "//skia",
"//third_party/wayland:wayland_server", "//third_party/wayland:wayland_server",
"//third_party/wayland-protocols:alpha_compositing_protocol", "//third_party/wayland-protocols:alpha_compositing_protocol",
"//third_party/wayland-protocols:cursor_shapes_protocol",
"//third_party/wayland-protocols:gaming_input_protocol", "//third_party/wayland-protocols:gaming_input_protocol",
"//third_party/wayland-protocols:input_timestamps_protocol", "//third_party/wayland-protocols:input_timestamps_protocol",
"//third_party/wayland-protocols:keyboard_configuration_protocol", "//third_party/wayland-protocols:keyboard_configuration_protocol",
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <alpha-compositing-unstable-v1-server-protocol.h> #include <alpha-compositing-unstable-v1-server-protocol.h>
#include <aura-shell-server-protocol.h> #include <aura-shell-server-protocol.h>
#include <cursor-shapes-unstable-v1-server-protocol.h>
#include <gaming-input-unstable-v1-server-protocol.h> #include <gaming-input-unstable-v1-server-protocol.h>
#include <gaming-input-unstable-v2-server-protocol.h> #include <gaming-input-unstable-v2-server-protocol.h>
#include <grp.h> #include <grp.h>
...@@ -4954,6 +4955,97 @@ void bind_keyboard_extension(wl_client* client, ...@@ -4954,6 +4955,97 @@ void bind_keyboard_extension(wl_client* client,
data, nullptr); data, nullptr);
} }
////////////////////////////////////////////////////////////////////////////////
// cursor_shapes interface:
static ui::CursorType GetCursorType(int32_t cursor_shape) {
switch (cursor_shape) {
#define ADD_CASE(wayland, chrome) \
case ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_##wayland: \
return ui::CursorType::chrome
ADD_CASE(POINTER, kPointer);
ADD_CASE(CROSS, kCross);
ADD_CASE(HAND, kHand);
ADD_CASE(IBEAM, kIBeam);
ADD_CASE(WAIT, kWait);
ADD_CASE(HELP, kHelp);
ADD_CASE(EAST_RESIZE, kEastResize);
ADD_CASE(NORTH_RESIZE, kNorthResize);
ADD_CASE(NORTH_EAST_RESIZE, kNorthEastResize);
ADD_CASE(NORTH_WEST_RESIZE, kNorthWestResize);
ADD_CASE(SOUTH_RESIZE, kSouthResize);
ADD_CASE(SOUTH_EAST_RESIZE, kSouthEastResize);
ADD_CASE(SOUTH_WEST_RESIZE, kSouthWestResize);
ADD_CASE(WEST_RESIZE, kWestResize);
ADD_CASE(NORTH_SOUTH_RESIZE, kNorthSouthResize);
ADD_CASE(EAST_WEST_RESIZE, kEastWestResize);
ADD_CASE(NORTH_EAST_SOUTH_WEST_RESIZE, kNorthEastSouthWestResize);
ADD_CASE(NORTH_WEST_SOUTH_EAST_RESIZE, kNorthWestSouthEastResize);
ADD_CASE(COLUMN_RESIZE, kColumnResize);
ADD_CASE(ROW_RESIZE, kRowResize);
ADD_CASE(MIDDLE_PANNING, kMiddlePanning);
ADD_CASE(EAST_PANNING, kEastPanning);
ADD_CASE(NORTH_PANNING, kNorthPanning);
ADD_CASE(NORTH_EAST_PANNING, kNorthEastPanning);
ADD_CASE(NORTH_WEST_PANNING, kNorthWestPanning);
ADD_CASE(SOUTH_PANNING, kSouthPanning);
ADD_CASE(SOUTH_EAST_PANNING, kSouthEastPanning);
ADD_CASE(SOUTH_WEST_PANNING, kSouthWestPanning);
ADD_CASE(WEST_PANNING, kWestPanning);
ADD_CASE(MOVE, kMove);
ADD_CASE(VERTICAL_TEXT, kVerticalText);
ADD_CASE(CELL, kCell);
ADD_CASE(CONTEXT_MENU, kContextMenu);
ADD_CASE(ALIAS, kAlias);
ADD_CASE(PROGRESS, kProgress);
ADD_CASE(NO_DROP, kNoDrop);
ADD_CASE(COPY, kCopy);
ADD_CASE(NONE, kNone);
ADD_CASE(NOT_ALLOWED, kNotAllowed);
ADD_CASE(ZOOM_IN, kZoomIn);
ADD_CASE(ZOOM_OUT, kZoomOut);
ADD_CASE(GRAB, kGrab);
ADD_CASE(GRABBING, kGrabbing);
ADD_CASE(DND_NONE, kDndNone);
ADD_CASE(DND_MOVE, kDndMove);
ADD_CASE(DND_COPY, kDndCopy);
ADD_CASE(DND_LINK, kDndLink);
#undef ADD_CASE
default:
return ui::CursorType::kNull;
}
}
void cursor_shapes_set_cursor_shape(wl_client* client,
wl_resource* resource,
wl_resource* pointer_resource,
int32_t shape) {
ui::CursorType cursor_type = GetCursorType(shape);
if (cursor_type == ui::CursorType::kNull) {
wl_resource_post_error(resource, ZCR_CURSOR_SHAPES_V1_ERROR_INVALID_SHAPE,
"Unrecognized shape %d", shape);
return;
}
Pointer* pointer = GetUserDataAs<Pointer>(pointer_resource);
pointer->SetCursorType(cursor_type);
}
const struct zcr_cursor_shapes_v1_interface cursor_shapes_implementation = {
cursor_shapes_set_cursor_shape};
void bind_cursor_shapes(wl_client* client,
void* data,
uint32_t version,
uint32_t id) {
wl_resource* resource =
wl_resource_create(client, &zcr_cursor_shapes_v1_interface, version, id);
wl_resource_set_implementation(resource, &cursor_shapes_implementation, data,
nullptr);
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// input_timestamps_v1 interface: // input_timestamps_v1 interface:
...@@ -5107,6 +5199,8 @@ Server::Server(Display* display) ...@@ -5107,6 +5199,8 @@ Server::Server(Display* display)
display_, bind_stylus_tools); display_, bind_stylus_tools);
wl_global_create(wl_display_.get(), &zcr_keyboard_extension_v1_interface, 1, wl_global_create(wl_display_.get(), &zcr_keyboard_extension_v1_interface, 1,
display_, bind_keyboard_extension); display_, bind_keyboard_extension);
wl_global_create(wl_display_.get(), &zcr_cursor_shapes_v1_interface, 1,
display_, bind_cursor_shapes);
wl_global_create(wl_display_.get(), wl_global_create(wl_display_.get(),
&zwp_input_timestamps_manager_v1_interface, 1, display_, &zwp_input_timestamps_manager_v1_interface, 1, display_,
bind_input_timestamps_manager); bind_input_timestamps_manager);
......
...@@ -322,3 +322,24 @@ source_set("input_timestamps_protocol") { ...@@ -322,3 +322,24 @@ source_set("input_timestamps_protocol") {
public_configs = [ ":input_timestamps_protocol_config" ] public_configs = [ ":input_timestamps_protocol_config" ]
} }
config("cursor_shapes_protocol_config") {
include_dirs = [ "include/protocol" ]
}
source_set("cursor_shapes_protocol") {
sources = [
"include/protocol/cursor-shapes-unstable-v1-client-protocol.h",
"include/protocol/cursor-shapes-unstable-v1-server-protocol.h",
"protocol/cursor-shapes-protocol.c",
]
deps = [
"//third_party/wayland:wayland_util",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":cursor_shapes_protocol_config" ]
}
...@@ -61,6 +61,9 @@ To import a new snapshot of wayland-protocols: ...@@ -61,6 +61,9 @@ To import a new snapshot of wayland-protocols:
wayland-scanner code < unstable/keyboard/keyboard-extension-unstable-v1.xml > protocol/keyboard-extension-protocol.c wayland-scanner code < unstable/keyboard/keyboard-extension-unstable-v1.xml > protocol/keyboard-extension-protocol.c
wayland-scanner server-header < unstable/keyboard/keyboard-extension-unstable-v1.xml > include/protocol/keyboard-extension-unstable-v1-server-protocol.h wayland-scanner server-header < unstable/keyboard/keyboard-extension-unstable-v1.xml > include/protocol/keyboard-extension-unstable-v1-server-protocol.h
wayland-scanner client-header < unstable/keyboard/keyboard-extension-unstable-v1.xml > include/protocol/keyboard-extension-unstable-v1-client-protocol.h wayland-scanner client-header < unstable/keyboard/keyboard-extension-unstable-v1.xml > include/protocol/keyboard-extension-unstable-v1-client-protocol.h
wayland-scanner code < unstable/cursor-shapes/cursor-shapes-unstable-v1.xml > protocol/cursor-shapes-protocol.c
wayland-scanner server-header < unstable/cursor-shapes/cursor-shapes-unstable-v1.xml > include/protocol/cursor-shapes-unstable-v1-server-protocol.h
wayland-scanner client-header < unstable/cursor-shapes/cursor-shapes-unstable-v1.xml > include/protocol/cursor-shapes-unstable-v1-client-protocol.h
wayland-scanner code < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > protocol/pointer-gestures-v1-protocol.c wayland-scanner code < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > protocol/pointer-gestures-v1-protocol.c
wayland-scanner client-header < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > include/protocol/pointer-gestures-unstable-v1-client-protocol.h wayland-scanner client-header < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > include/protocol/pointer-gestures-unstable-v1-client-protocol.h
wayland-scanner server-header < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > include/protocol/pointer-gestures-unstable-v1-server-protocol.h wayland-scanner server-header < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > include/protocol/pointer-gestures-unstable-v1-server-protocol.h
......
/* Generated by wayland-scanner 1.13.0 */
#ifndef CURSOR_SHAPES_V1_CLIENT_PROTOCOL_H
#define CURSOR_SHAPES_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_cursor_shapes_v1 The cursor_shapes_v1 protocol
* @section page_ifaces_cursor_shapes_v1 Interfaces
* - @subpage page_iface_zcr_cursor_shapes_v1 - Allows to set the cursor shape
* @section page_copyright_cursor_shapes_v1 Copyright
* <pre>
*
* Copyright 2018 The Chromium Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_pointer;
struct zcr_cursor_shapes_v1;
/**
* @page page_iface_zcr_cursor_shapes_v1 zcr_cursor_shapes_v1
* @section page_iface_zcr_cursor_shapes_v1_desc Description
*
* Allows to set the semantic cursor shape rather than a surface for a
* pointer cursor.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding uinterface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and uinterface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
* @section page_iface_zcr_cursor_shapes_v1_api API
* See @ref iface_zcr_cursor_shapes_v1.
*/
/**
* @defgroup iface_zcr_cursor_shapes_v1 The zcr_cursor_shapes_v1 interface
*
* Allows to set the semantic cursor shape rather than a surface for a
* pointer cursor.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding uinterface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and uinterface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
*/
extern const struct wl_interface zcr_cursor_shapes_v1_interface;
#ifndef ZCR_CURSOR_SHAPES_V1_ERROR_ENUM
#define ZCR_CURSOR_SHAPES_V1_ERROR_ENUM
enum zcr_cursor_shapes_v1_error {
/**
* the specified shape value is invalid
*/
ZCR_CURSOR_SHAPES_V1_ERROR_INVALID_SHAPE = 0,
};
#endif /* ZCR_CURSOR_SHAPES_V1_ERROR_ENUM */
#ifndef ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ENUM
#define ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ENUM
/**
* @ingroup iface_zcr_cursor_shapes_v1
* the type of cursor shape
*/
enum zcr_cursor_shapes_v1_cursor_shape_type {
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NULL = 0,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_POINTER = 1,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CROSS = 2,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_HAND = 3,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_IBEAM = 4,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_WAIT = 5,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_HELP = 6,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_EAST_RESIZE = 7,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_RESIZE = 8,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_EAST_RESIZE = 9,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_WEST_RESIZE = 10,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_RESIZE = 11,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_EAST_RESIZE = 12,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_WEST_RESIZE = 13,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_WEST_RESIZE = 14,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_SOUTH_RESIZE = 15,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_EAST_WEST_RESIZE = 16,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_EAST_SOUTH_WEST_RESIZE = 17,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_WEST_SOUTH_EAST_RESIZE = 18,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_COLUMN_RESIZE = 19,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ROW_RESIZE = 20,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_MIDDLE_PANNING = 21,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_EAST_PANNING = 22,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_PANNING = 23,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_EAST_PANNING = 24,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_WEST_PANNING = 25,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_PANNING = 26,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_EAST_PANNING = 27,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_WEST_PANNING = 28,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_WEST_PANNING = 29,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_MOVE = 30,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_VERTICAL_TEXT = 31,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CELL = 32,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CONTEXT_MENU = 33,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ALIAS = 34,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_PROGRESS = 35,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NO_DROP = 36,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_COPY = 37,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NONE = 38,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NOT_ALLOWED = 39,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ZOOM_IN = 40,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ZOOM_OUT = 41,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_GRAB = 42,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_GRABBING = 43,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CUSTOM = 44,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_NONE = 45,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_MOVE = 46,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_COPY = 47,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_LINK = 48,
};
#endif /* ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ENUM */
#define ZCR_CURSOR_SHAPES_V1_SET_CURSOR_SHAPE 0
/**
* @ingroup iface_zcr_cursor_shapes_v1
*/
#define ZCR_CURSOR_SHAPES_V1_SET_CURSOR_SHAPE_SINCE_VERSION 1
/** @ingroup iface_zcr_cursor_shapes_v1 */
static inline void
zcr_cursor_shapes_v1_set_user_data(struct zcr_cursor_shapes_v1 *zcr_cursor_shapes_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zcr_cursor_shapes_v1, user_data);
}
/** @ingroup iface_zcr_cursor_shapes_v1 */
static inline void *
zcr_cursor_shapes_v1_get_user_data(struct zcr_cursor_shapes_v1 *zcr_cursor_shapes_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zcr_cursor_shapes_v1);
}
static inline uint32_t
zcr_cursor_shapes_v1_get_version(struct zcr_cursor_shapes_v1 *zcr_cursor_shapes_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zcr_cursor_shapes_v1);
}
/** @ingroup iface_zcr_cursor_shapes_v1 */
static inline void
zcr_cursor_shapes_v1_destroy(struct zcr_cursor_shapes_v1 *zcr_cursor_shapes_v1)
{
wl_proxy_destroy((struct wl_proxy *) zcr_cursor_shapes_v1);
}
/**
* @ingroup iface_zcr_cursor_shapes_v1
*
* Sets the pointer cursor to the specified shape. The server will change
* the cursor graphics based on the specified shape and its graphic assets
* and system condition.
*
* The "shape" argument needs to be one of the values in cursor_shape_type
* enum. Otherwise invalid_shape error is raised.
*
* This is similar to wl_pointer::set_cursor request, but this accepts a
* shape instead of contents in the form of a surface.
*
* The client which do not know this protocol should work as-is, so
* wl_pointer::set_cursor will change the cursor graphics even when it's
* combined with this request; and another invocation of set_cursor_shape
* will change the cursor shape again. This means the last invoked one will
* be used for the actual cursor.
*/
static inline void
zcr_cursor_shapes_v1_set_cursor_shape(struct zcr_cursor_shapes_v1 *zcr_cursor_shapes_v1, struct wl_pointer *pointer, int32_t shape)
{
wl_proxy_marshal((struct wl_proxy *) zcr_cursor_shapes_v1,
ZCR_CURSOR_SHAPES_V1_SET_CURSOR_SHAPE, pointer, shape);
}
#ifdef __cplusplus
}
#endif
#endif
/* Generated by wayland-scanner 1.13.0 */
#ifndef CURSOR_SHAPES_V1_SERVER_PROTOCOL_H
#define CURSOR_SHAPES_V1_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
#ifdef __cplusplus
extern "C" {
#endif
struct wl_client;
struct wl_resource;
/**
* @page page_cursor_shapes_v1 The cursor_shapes_v1 protocol
* @section page_ifaces_cursor_shapes_v1 Interfaces
* - @subpage page_iface_zcr_cursor_shapes_v1 - Allows to set the cursor shape
* @section page_copyright_cursor_shapes_v1 Copyright
* <pre>
*
* Copyright 2018 The Chromium Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_pointer;
struct zcr_cursor_shapes_v1;
/**
* @page page_iface_zcr_cursor_shapes_v1 zcr_cursor_shapes_v1
* @section page_iface_zcr_cursor_shapes_v1_desc Description
*
* Allows to set the semantic cursor shape rather than a surface for a
* pointer cursor.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding uinterface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and uinterface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
* @section page_iface_zcr_cursor_shapes_v1_api API
* See @ref iface_zcr_cursor_shapes_v1.
*/
/**
* @defgroup iface_zcr_cursor_shapes_v1 The zcr_cursor_shapes_v1 interface
*
* Allows to set the semantic cursor shape rather than a surface for a
* pointer cursor.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding uinterface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and uinterface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
*/
extern const struct wl_interface zcr_cursor_shapes_v1_interface;
#ifndef ZCR_CURSOR_SHAPES_V1_ERROR_ENUM
#define ZCR_CURSOR_SHAPES_V1_ERROR_ENUM
enum zcr_cursor_shapes_v1_error {
/**
* the specified shape value is invalid
*/
ZCR_CURSOR_SHAPES_V1_ERROR_INVALID_SHAPE = 0,
};
#endif /* ZCR_CURSOR_SHAPES_V1_ERROR_ENUM */
#ifndef ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ENUM
#define ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ENUM
/**
* @ingroup iface_zcr_cursor_shapes_v1
* the type of cursor shape
*/
enum zcr_cursor_shapes_v1_cursor_shape_type {
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NULL = 0,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_POINTER = 1,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CROSS = 2,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_HAND = 3,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_IBEAM = 4,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_WAIT = 5,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_HELP = 6,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_EAST_RESIZE = 7,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_RESIZE = 8,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_EAST_RESIZE = 9,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_WEST_RESIZE = 10,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_RESIZE = 11,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_EAST_RESIZE = 12,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_WEST_RESIZE = 13,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_WEST_RESIZE = 14,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_SOUTH_RESIZE = 15,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_EAST_WEST_RESIZE = 16,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_EAST_SOUTH_WEST_RESIZE = 17,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_WEST_SOUTH_EAST_RESIZE = 18,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_COLUMN_RESIZE = 19,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ROW_RESIZE = 20,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_MIDDLE_PANNING = 21,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_EAST_PANNING = 22,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_PANNING = 23,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_EAST_PANNING = 24,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NORTH_WEST_PANNING = 25,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_PANNING = 26,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_EAST_PANNING = 27,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_SOUTH_WEST_PANNING = 28,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_WEST_PANNING = 29,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_MOVE = 30,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_VERTICAL_TEXT = 31,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CELL = 32,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CONTEXT_MENU = 33,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ALIAS = 34,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_PROGRESS = 35,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NO_DROP = 36,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_COPY = 37,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NONE = 38,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_NOT_ALLOWED = 39,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ZOOM_IN = 40,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ZOOM_OUT = 41,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_GRAB = 42,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_GRABBING = 43,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_CUSTOM = 44,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_NONE = 45,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_MOVE = 46,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_COPY = 47,
ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_LINK = 48,
};
#endif /* ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_ENUM */
/**
* @ingroup iface_zcr_cursor_shapes_v1
* @struct zcr_cursor_shapes_v1_interface
*/
struct zcr_cursor_shapes_v1_interface {
/**
* set pointer cursor to the shape
*
* Sets the pointer cursor to the specified shape. The server
* will change the cursor graphics based on the specified shape and
* its graphic assets and system condition.
*
* The "shape" argument needs to be one of the values in
* cursor_shape_type enum. Otherwise invalid_shape error is raised.
*
* This is similar to wl_pointer::set_cursor request, but this
* accepts a shape instead of contents in the form of a surface.
*
* The client which do not know this protocol should work as-is, so
* wl_pointer::set_cursor will change the cursor graphics even when
* it's combined with this request; and another invocation of
* set_cursor_shape will change the cursor shape again. This means
* the last invoked one will be used for the actual cursor.
*/
void (*set_cursor_shape)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *pointer,
int32_t shape);
};
/**
* @ingroup iface_zcr_cursor_shapes_v1
*/
#define ZCR_CURSOR_SHAPES_V1_SET_CURSOR_SHAPE_SINCE_VERSION 1
#ifdef __cplusplus
}
#endif
#endif
/* Generated by wayland-scanner 1.13.0 */
/*
* Copyright 2018 The Chromium Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_pointer_interface;
static const struct wl_interface *types[] = {
&wl_pointer_interface,
NULL,
};
static const struct wl_message zcr_cursor_shapes_v1_requests[] = {
{ "set_cursor_shape", "oi", types + 0 },
};
WL_EXPORT const struct wl_interface zcr_cursor_shapes_v1_interface = {
"zcr_cursor_shapes_v1", 1,
1, zcr_cursor_shapes_v1_requests,
0, NULL,
};
Cursor shapes protocol
Maintainers:
Jun Mukai <mukai@chromium.org>
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="cursor_shapes_v1">
<copyright>
Copyright 2018 The Chromium Authors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
</copyright>
<interface name="zcr_cursor_shapes_v1" version="1">
<description summary="Allows to set the cursor shape">
Allows to set the semantic cursor shape rather than a surface for a
pointer cursor.
Warning! The protocol described in this file is experimental and
backward incompatible changes may be made. Backward compatible changes
may be added together with the corresponding uinterface version bump.
Backward incompatible changes are done by bumping the version number in
the protocol and uinterface names and resetting the interface version.
Once the protocol is to be declared stable, the 'z' prefix and the
version number in the protocol and interface names are removed and the
interface version number is reset.
</description>
<enum name="error">
<entry name="invalid_shape" value="0"
summary="the specified shape value is invalid"/>
</enum>
<enum name="cursor_shape_type">
<description summary="the type of cursor shape"/>
<entry name="pointer" value="0"/>
<entry name="cross" value="1"/>
<entry name="hand" value="2"/>
<entry name="ibeam" value="3"/>
<entry name="wait" value="4"/>
<entry name="help" value="5"/>
<entry name="east_resize" value="6"/>
<entry name="north_resize" value="7"/>
<entry name="north_east_resize" value="8"/>
<entry name="north_west_resize" value="9"/>
<entry name="south_resize" value="10"/>
<entry name="south_east_resize" value="11"/>
<entry name="south_west_resize" value="12"/>
<entry name="west_resize" value="13"/>
<entry name="north_south_resize" value="14"/>
<entry name="east_west_resize" value="15"/>
<entry name="north_east_south_west_resize" value="16"/>
<entry name="north_west_south_east_resize" value="17"/>
<entry name="column_resize" value="18"/>
<entry name="row_resize" value="19"/>
<entry name="middle_panning" value="20"/>
<entry name="east_panning" value="21"/>
<entry name="north_panning" value="22"/>
<entry name="north_east_panning" value="23"/>
<entry name="north_west_panning" value="24"/>
<entry name="south_panning" value="25"/>
<entry name="south_east_panning" value="26"/>
<entry name="south_west_panning" value="27"/>
<entry name="west_panning" value="28"/>
<entry name="move" value="29"/>
<entry name="vertical_text" value="30"/>
<entry name="cell" value="31"/>
<entry name="context_menu" value="32"/>
<entry name="alias" value="33"/>
<entry name="progress" value="34"/>
<entry name="no_drop" value="35"/>
<entry name="copy" value="36"/>
<entry name="none" value="37"/>
<entry name="not_allowed" value="38"/>
<entry name="zoom_in" value="39"/>
<entry name="zoom_out" value="40"/>
<entry name="grab" value="41"/>
<entry name="grabbing" value="42"/>
<entry name="dnd_none" value="43"/>
<entry name="dnd_move" value="44"/>
<entry name="dnd_copy" value="45"/>
<entry name="dnd_link" value="46"/>
</enum>
<request name="set_cursor_shape">
<description summary="set pointer cursor to the shape">
Sets the pointer cursor to the specified shape. The server will change
the cursor graphics based on the specified shape and its graphic assets
and system condition.
The "shape" argument needs to be one of the values in cursor_shape_type
enum. Otherwise invalid_shape error is raised.
This is similar to wl_pointer::set_cursor request, but this accepts a
shape instead of contents in the form of a surface.
The client which do not know this protocol should work as-is, so
wl_pointer::set_cursor will change the cursor graphics even when it's
combined with this request; and another invocation of set_cursor_shape
will change the cursor shape again. This means the last invoked one will
be used for the actual cursor.
</description>
<arg name="pointer" type="object" interface="wl_pointer"/>
<arg name="shape" type="int"/>
</request>
</interface>
</protocol>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment