mirror of
https://github.com/swaywm/zig-wlroots
synced 2024-09-29 05:36:47 +02:00
Bind wlr_tablet_tool.h
This commit is contained in:
parent
b4d2e2f2ad
commit
d0461e5f38
5 changed files with 131 additions and 6 deletions
|
@ -28,11 +28,10 @@ pub const Cursor = extern struct {
|
|||
touch_motion: wl.Signal(*wlr.Touch.event.Motion),
|
||||
touch_cancel: wl.Signal(*wlr.Touch.event.Cancel),
|
||||
|
||||
// TODO
|
||||
tablet_tool_axis: wl.Signal(void),
|
||||
tablet_tool_proximity: wl.Signal(void),
|
||||
tablet_tool_tip: wl.Signal(void),
|
||||
tablet_tool_button: wl.Signal(void),
|
||||
tablet_tool_axis: wl.Signal(*wlr.Tablet.event.Axis),
|
||||
tablet_tool_proximity: wl.Signal(*wlr.Tablet.event.Proximity),
|
||||
tablet_tool_tip: wl.Signal(*wlr.Tablet.event.Tip),
|
||||
tablet_tool_button: wl.Signal(*wlr.Tablet.event.Button),
|
||||
},
|
||||
|
||||
data: ?*c_void,
|
||||
|
|
5
src/types/list.zig
Normal file
5
src/types/list.zig
Normal file
|
@ -0,0 +1,5 @@
|
|||
pub const List = extern struct {
|
||||
capacity: usize,
|
||||
length: usize,
|
||||
items: ?[*]?*c_void,
|
||||
};
|
116
src/types/tablet_tool.zig
Normal file
116
src/types/tablet_tool.zig
Normal file
|
@ -0,0 +1,116 @@
|
|||
const wlr = @import("../wlroots.zig");
|
||||
|
||||
const wl = @import("wayland").server.wl;
|
||||
|
||||
pub const TabletTool = extern struct {
|
||||
pub const Type = extern enum {
|
||||
pen = 1,
|
||||
eraser,
|
||||
brush,
|
||||
pencil,
|
||||
airbrush,
|
||||
mouse,
|
||||
lens,
|
||||
totem,
|
||||
};
|
||||
|
||||
type: Type,
|
||||
hardware_serial: u64,
|
||||
hardware_wacom: u64,
|
||||
|
||||
tilt: bool,
|
||||
pressure: bool,
|
||||
distance: bool,
|
||||
rotation: bool,
|
||||
slider: bool,
|
||||
wheel: bool,
|
||||
|
||||
events: extern struct {
|
||||
destroy: wl.Signal(*TabletTool),
|
||||
},
|
||||
|
||||
data: ?*c_void,
|
||||
};
|
||||
|
||||
pub const Tablet = extern struct {
|
||||
pub const event = struct {
|
||||
pub const Axis = extern struct {
|
||||
device: *wlr.InputDevice,
|
||||
tool: *TabletTool,
|
||||
|
||||
time_msec: u32,
|
||||
updated_axes: u32,
|
||||
/// From 0..1
|
||||
x: f64,
|
||||
/// From 0..1
|
||||
y: f64,
|
||||
/// Relative to last event
|
||||
dx: f64,
|
||||
/// Relative to last event
|
||||
dy: f64,
|
||||
pressure: f64,
|
||||
distance: f64,
|
||||
tilt_x: f64,
|
||||
tilt_y: f64,
|
||||
rotation: f64,
|
||||
slider: f64,
|
||||
wheel_delta: f64,
|
||||
};
|
||||
|
||||
pub const Proximity = extern struct {
|
||||
pub const State = extern enum {
|
||||
out,
|
||||
in,
|
||||
};
|
||||
|
||||
device: *wlr.InputDevice,
|
||||
tool: *TabletTool,
|
||||
|
||||
time_msec: u32,
|
||||
x: f64,
|
||||
y: f64,
|
||||
state: Proximity.State,
|
||||
};
|
||||
|
||||
pub const Tip = extern struct {
|
||||
pub const State = extern enum {
|
||||
up,
|
||||
down,
|
||||
};
|
||||
|
||||
device: *wlr.InputDevice,
|
||||
tool: *TabletTool,
|
||||
|
||||
time_msec: u32,
|
||||
x: f64,
|
||||
y: f64,
|
||||
state: Tip.State,
|
||||
};
|
||||
|
||||
pub const Button = extern struct {
|
||||
device: *wlr.InputDevice,
|
||||
tool: *TabletTool,
|
||||
|
||||
time_msec: u32,
|
||||
x: f64,
|
||||
y: f64,
|
||||
state: wlr.ButtonState,
|
||||
};
|
||||
};
|
||||
|
||||
const Impl = opaque {};
|
||||
|
||||
impl: *const Impl,
|
||||
|
||||
events: extern struct {
|
||||
axis: wl.Signal,
|
||||
proximity: wl.Signal,
|
||||
tip: wl.Signal,
|
||||
button: wl.Signal,
|
||||
},
|
||||
|
||||
name: [*:0]u8,
|
||||
paths: wlr.List,
|
||||
|
||||
data: ?*c_void,
|
||||
};
|
|
@ -37,7 +37,7 @@ pub const Touch = extern struct {
|
|||
|
||||
const Impl = opaque {};
|
||||
|
||||
impl: *Impl,
|
||||
impl: *const Impl,
|
||||
|
||||
events: extern struct {
|
||||
down: wl.Signal(*event.Down),
|
||||
|
|
|
@ -39,6 +39,9 @@ pub const AxisSource = @import("types/pointer.zig").AxisSource;
|
|||
|
||||
pub const Touch = @import("types/touch.zig").Touch;
|
||||
|
||||
pub const Tablet = @import("types/tablet_tool.zig").Tablet;
|
||||
pub const TabletTool = @import("types/tablet_tool.zig").TabletTool;
|
||||
|
||||
pub const DataDeviceManager = @import("types/data_device.zig").DataDeviceManager;
|
||||
pub const DataOffer = @import("types/data_device.zig").DataOffer;
|
||||
pub const DataSource = @import("types/data_device.zig").DataSource;
|
||||
|
@ -54,5 +57,7 @@ pub const XCursorTheme = @import("xcursor.zig").XCursorTheme;
|
|||
pub const XCursorManager = @import("types/xcursor_manager.zig").XCursorManager;
|
||||
pub const XCursorManagerTheme = @import("types/xcursor_manager.zig").XCursorManagerTheme;
|
||||
|
||||
pub const List = @import("types/list.zig").List;
|
||||
|
||||
pub const Edges = @import("util/edges.zig").Edges;
|
||||
pub const log = @import("util/log.zig");
|
||||
|
|
Loading…
Reference in a new issue