2019-04-22 22:59:43 +00:00
|
|
|
// Copyright 2019 The Chromium OS Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2018-05-03 20:19:37 +00:00
|
|
|
/* automatically generated by rust-bindgen */
|
|
|
|
|
2018-08-20 15:11:42 +00:00
|
|
|
/// @page page_xdg_shell_unstable_v6 The xdg_shell_unstable_v6 protocol
|
|
|
|
/// @section page_ifaces_xdg_shell_unstable_v6 Interfaces
|
|
|
|
/// - @subpage page_iface_zxdg_shell_v6 - create desktop-style surfaces
|
|
|
|
/// - @subpage page_iface_zxdg_positioner_v6 - child surface positioner
|
|
|
|
/// - @subpage page_iface_zxdg_surface_v6 - desktop user interface surface base interface
|
|
|
|
/// - @subpage page_iface_zxdg_toplevel_v6 - toplevel surface
|
|
|
|
/// - @subpage page_iface_zxdg_popup_v6 - short-lived, popup surfaces for menus
|
|
|
|
/// @section page_copyright_xdg_shell_unstable_v6 Copyright
|
|
|
|
/// <pre>
|
|
|
|
///
|
|
|
|
/// Copyright © 2008-2013 Kristian Høgsberg
|
|
|
|
/// Copyright © 2013 Rafael Antognolli
|
|
|
|
/// Copyright © 2013 Jasper St. Pierre
|
|
|
|
/// Copyright © 2010-2013 Intel Corporation
|
|
|
|
///
|
|
|
|
/// 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>
|
|
|
|
#[repr(C)]
|
|
|
|
#[derive(Debug, Copy, Clone)]
|
|
|
|
pub struct wl_output {
|
2018-05-03 20:19:37 +00:00
|
|
|
_unused: [u8; 0],
|
|
|
|
}
|
2018-08-20 15:11:42 +00:00
|
|
|
#[repr(C)]
|
|
|
|
pub struct dwl_context {
|
|
|
|
pub _bindgen_opaque_blob: [u64; 52usize],
|
|
|
|
}
|
|
|
|
#[repr(C)]
|
|
|
|
#[derive(Debug, Copy, Clone)]
|
2018-05-03 20:19:37 +00:00
|
|
|
pub struct dwl_dmabuf {
|
2018-08-20 15:11:42 +00:00
|
|
|
pub _bindgen_opaque_blob: [u64; 3usize],
|
2018-05-03 20:19:37 +00:00
|
|
|
}
|
2018-08-20 15:11:42 +00:00
|
|
|
#[repr(C)]
|
|
|
|
#[derive(Debug, Copy, Clone)]
|
2018-05-03 20:19:37 +00:00
|
|
|
pub struct dwl_surface {
|
2018-08-20 15:11:42 +00:00
|
|
|
pub _bindgen_opaque_blob: [u64; 12usize],
|
2018-05-03 20:19:37 +00:00
|
|
|
}
|
gpu_display/wayland: Added keyboard and pointing devices
Added preliminary version of keyboard and pointing device routine
for wayland implementation. The pointing input is wired as a multi
touch device. Due to the fact that wayland client is callback based,
all the necessary incoming events are serialized and stashed in the
temp circular buffer and then processed afterwards from the main event
loop.
Known issues:
1. Mouse input can't be properly wired inside the guest as a mouse
device without pointer locking, but this is not what we want. The
approach emulates it as a multitouch device, but, of course, it
implies limitations in functionality. Limitations include cursor
in the VM that doesn't move in unison with the host cursor.
2. I kept the mouse cursor surface since it's not decided yet which
approach for handling pointing input device will be used (see #1).
Removing the mouse surface in the guest would remove the lagging
guest cursor. The alternatives to the multi-touch device are:
"- Relative mice (e.g. a typical PC mouse). These are relative
devices, meaning they send deltas from the current cursor
position. Some apps like games rely on these events.
- Touchscreens (multitouch, single touch). These are absolute
devices, and are much easier to implement seamless guest/host
input for.
- Touchpads (these are absolute devices). I'm not sure these are
really compelling for any use case." -nkgold@
3. This code is for POC purpose only, so there are still lot of minor
issues and negligence in it.
Looking forward for your comments and proposals.
BUG=b:177939148
TEST=crosvm $ARGS \
--display-window-keyboard \
--display-window-mouse \
--gpu=3d,glx=false,egl=true \
--wayland-sock=/run/user/1000/wayland-0 \
$OTHER_ARGS
Change-Id: If4a9b73b8da4e0cc52fa619bbd6e5588ccdb7874
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2688439
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2021-02-02 06:14:16 +00:00
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub const DWL_KEYBOARD_KEY_STATE_RELEASED: i32 = 0;
|
|
|
|
pub const DWL_KEYBOARD_KEY_STATE_PRESSED: i32 = 1;
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub const DWL_EVENT_TYPE_KEYBOARD_ENTER: u32 = 0x00;
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub const DWL_EVENT_TYPE_KEYBOARD_LEAVE: u32 = 0x01;
|
|
|
|
pub const DWL_EVENT_TYPE_KEYBOARD_KEY: u32 = 0x02;
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub const DWL_EVENT_TYPE_POINTER_ENTER: u32 = 0x10;
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub const DWL_EVENT_TYPE_POINTER_LEAVE: u32 = 0x11;
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub const DWL_EVENT_TYPE_POINTER_MOVE: u32 = 0x12;
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub const DWL_EVENT_TYPE_POINTER_BUTTON: u32 = 0x13;
|
|
|
|
pub const DWL_EVENT_TYPE_TOUCH_DOWN: u32 = 0x20;
|
|
|
|
pub const DWL_EVENT_TYPE_TOUCH_UP: u32 = 0x21;
|
|
|
|
pub const DWL_EVENT_TYPE_TOUCH_MOTION: u32 = 0x22;
|
|
|
|
|
|
|
|
pub const DWL_SURFACE_FLAG_RECEIVE_INPUT: u32 = 1 << 0;
|
|
|
|
pub const DWL_SURFACE_FLAG_HAS_ALPHA: u32 = 1 << 1;
|
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
#[derive(Debug, Copy, Clone)]
|
|
|
|
pub struct dwl_event {
|
|
|
|
pub surface_descriptor: *const ::std::ffi::c_void,
|
|
|
|
pub event_type: u32,
|
|
|
|
pub params: [i32; 3usize],
|
|
|
|
}
|
|
|
|
|
2018-05-03 20:19:37 +00:00
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_context_new() -> *mut dwl_context;
|
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_context_destroy(self_: *mut *mut dwl_context);
|
|
|
|
}
|
|
|
|
extern "C" {
|
2018-10-03 17:22:32 +00:00
|
|
|
pub fn dwl_context_setup(
|
|
|
|
self_: *mut dwl_context,
|
|
|
|
socket_path: *const ::std::os::raw::c_char,
|
|
|
|
) -> bool;
|
2018-05-03 20:19:37 +00:00
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_context_fd(self_: *mut dwl_context) -> ::std::os::raw::c_int;
|
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_context_dispatch(self_: *mut dwl_context);
|
|
|
|
}
|
|
|
|
extern "C" {
|
2018-10-03 17:22:32 +00:00
|
|
|
pub fn dwl_context_dmabuf_new(
|
|
|
|
self_: *mut dwl_context,
|
2021-04-26 23:40:48 +00:00
|
|
|
import_id: u32,
|
2018-10-03 17:22:32 +00:00
|
|
|
fd: ::std::os::raw::c_int,
|
|
|
|
offset: u32,
|
|
|
|
stride: u32,
|
|
|
|
modifiers: u64,
|
|
|
|
width: u32,
|
|
|
|
height: u32,
|
|
|
|
fourcc: u32,
|
|
|
|
) -> *mut dwl_dmabuf;
|
2018-05-03 20:19:37 +00:00
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_dmabuf_destroy(self_: *mut *mut dwl_dmabuf);
|
|
|
|
}
|
|
|
|
extern "C" {
|
2018-10-03 17:22:32 +00:00
|
|
|
pub fn dwl_context_surface_new(
|
|
|
|
self_: *mut dwl_context,
|
2021-04-26 23:40:48 +00:00
|
|
|
parent_id: u32,
|
|
|
|
surface_id: u32,
|
2018-10-03 17:22:32 +00:00
|
|
|
shm_fd: ::std::os::raw::c_int,
|
|
|
|
shm_size: usize,
|
|
|
|
buffer_size: usize,
|
|
|
|
width: u32,
|
|
|
|
height: u32,
|
|
|
|
stride: u32,
|
gpu_display/wayland: Added keyboard and pointing devices
Added preliminary version of keyboard and pointing device routine
for wayland implementation. The pointing input is wired as a multi
touch device. Due to the fact that wayland client is callback based,
all the necessary incoming events are serialized and stashed in the
temp circular buffer and then processed afterwards from the main event
loop.
Known issues:
1. Mouse input can't be properly wired inside the guest as a mouse
device without pointer locking, but this is not what we want. The
approach emulates it as a multitouch device, but, of course, it
implies limitations in functionality. Limitations include cursor
in the VM that doesn't move in unison with the host cursor.
2. I kept the mouse cursor surface since it's not decided yet which
approach for handling pointing input device will be used (see #1).
Removing the mouse surface in the guest would remove the lagging
guest cursor. The alternatives to the multi-touch device are:
"- Relative mice (e.g. a typical PC mouse). These are relative
devices, meaning they send deltas from the current cursor
position. Some apps like games rely on these events.
- Touchscreens (multitouch, single touch). These are absolute
devices, and are much easier to implement seamless guest/host
input for.
- Touchpads (these are absolute devices). I'm not sure these are
really compelling for any use case." -nkgold@
3. This code is for POC purpose only, so there are still lot of minor
issues and negligence in it.
Looking forward for your comments and proposals.
BUG=b:177939148
TEST=crosvm $ARGS \
--display-window-keyboard \
--display-window-mouse \
--gpu=3d,glx=false,egl=true \
--wayland-sock=/run/user/1000/wayland-0 \
$OTHER_ARGS
Change-Id: If4a9b73b8da4e0cc52fa619bbd6e5588ccdb7874
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2688439
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2021-02-02 06:14:16 +00:00
|
|
|
flags: u32,
|
2018-10-03 17:22:32 +00:00
|
|
|
) -> *mut dwl_surface;
|
2018-05-03 20:19:37 +00:00
|
|
|
}
|
gpu_display/wayland: Added keyboard and pointing devices
Added preliminary version of keyboard and pointing device routine
for wayland implementation. The pointing input is wired as a multi
touch device. Due to the fact that wayland client is callback based,
all the necessary incoming events are serialized and stashed in the
temp circular buffer and then processed afterwards from the main event
loop.
Known issues:
1. Mouse input can't be properly wired inside the guest as a mouse
device without pointer locking, but this is not what we want. The
approach emulates it as a multitouch device, but, of course, it
implies limitations in functionality. Limitations include cursor
in the VM that doesn't move in unison with the host cursor.
2. I kept the mouse cursor surface since it's not decided yet which
approach for handling pointing input device will be used (see #1).
Removing the mouse surface in the guest would remove the lagging
guest cursor. The alternatives to the multi-touch device are:
"- Relative mice (e.g. a typical PC mouse). These are relative
devices, meaning they send deltas from the current cursor
position. Some apps like games rely on these events.
- Touchscreens (multitouch, single touch). These are absolute
devices, and are much easier to implement seamless guest/host
input for.
- Touchpads (these are absolute devices). I'm not sure these are
really compelling for any use case." -nkgold@
3. This code is for POC purpose only, so there are still lot of minor
issues and negligence in it.
Looking forward for your comments and proposals.
BUG=b:177939148
TEST=crosvm $ARGS \
--display-window-keyboard \
--display-window-mouse \
--gpu=3d,glx=false,egl=true \
--wayland-sock=/run/user/1000/wayland-0 \
$OTHER_ARGS
Change-Id: If4a9b73b8da4e0cc52fa619bbd6e5588ccdb7874
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2688439
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2021-02-02 06:14:16 +00:00
|
|
|
|
2018-05-03 20:19:37 +00:00
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_destroy(self_: *mut *mut dwl_surface);
|
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_commit(self_: *mut dwl_surface);
|
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_buffer_in_use(self_: *mut dwl_surface, buffer_index: usize) -> bool;
|
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_flip(self_: *mut dwl_surface, buffer_index: usize);
|
|
|
|
}
|
|
|
|
extern "C" {
|
2021-04-26 23:40:48 +00:00
|
|
|
pub fn dwl_surface_flip_to(self_: *mut dwl_surface, import_id: u32);
|
2018-05-03 20:19:37 +00:00
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_close_requested(self_: *const dwl_surface) -> bool;
|
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_set_position(self_: *mut dwl_surface, x: u32, y: u32);
|
2018-08-20 15:11:42 +00:00
|
|
|
}
|
2021-04-26 23:40:48 +00:00
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_descriptor(self_: *const dwl_surface) -> *const ::std::ffi::c_void;
|
|
|
|
}
|
gpu_display/wayland: Added keyboard and pointing devices
Added preliminary version of keyboard and pointing device routine
for wayland implementation. The pointing input is wired as a multi
touch device. Due to the fact that wayland client is callback based,
all the necessary incoming events are serialized and stashed in the
temp circular buffer and then processed afterwards from the main event
loop.
Known issues:
1. Mouse input can't be properly wired inside the guest as a mouse
device without pointer locking, but this is not what we want. The
approach emulates it as a multitouch device, but, of course, it
implies limitations in functionality. Limitations include cursor
in the VM that doesn't move in unison with the host cursor.
2. I kept the mouse cursor surface since it's not decided yet which
approach for handling pointing input device will be used (see #1).
Removing the mouse surface in the guest would remove the lagging
guest cursor. The alternatives to the multi-touch device are:
"- Relative mice (e.g. a typical PC mouse). These are relative
devices, meaning they send deltas from the current cursor
position. Some apps like games rely on these events.
- Touchscreens (multitouch, single touch). These are absolute
devices, and are much easier to implement seamless guest/host
input for.
- Touchpads (these are absolute devices). I'm not sure these are
really compelling for any use case." -nkgold@
3. This code is for POC purpose only, so there are still lot of minor
issues and negligence in it.
Looking forward for your comments and proposals.
BUG=b:177939148
TEST=crosvm $ARGS \
--display-window-keyboard \
--display-window-mouse \
--gpu=3d,glx=false,egl=true \
--wayland-sock=/run/user/1000/wayland-0 \
$OTHER_ARGS
Change-Id: If4a9b73b8da4e0cc52fa619bbd6e5588ccdb7874
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2688439
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2021-02-02 06:14:16 +00:00
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_context_pending_events(self_: *const dwl_context) -> bool;
|
|
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_context_next_event(self_: *mut dwl_context, event: *mut dwl_event);
|
|
|
|
}
|
2021-05-21 16:33:27 +00:00
|
|
|
extern "C" {
|
|
|
|
pub fn dwl_surface_set_scanout_id(self_: *mut dwl_surface, scanout_id: u32);
|
|
|
|
}
|