Move Cursor.Mode impl functions to Cursor

This commit is contained in:
Leon Henrik Plickat
2020-10-17 22:40:15 +02:00
committed by Isaac Freund
parent d5d1e87a95
commit ec5d5e8826
2 changed files with 189 additions and 190 deletions

View File

@ -24,7 +24,6 @@ const log = @import("log.zig");
const util = @import("util.zig");
const Box = @import("Box.zig");
const Mode = @import("Cursor.zig").Mode;
const Seat = @import("Seat.zig");
const View = @import("View.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
@ -312,7 +311,7 @@ fn handleRequestMove(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) voi
const self = @fieldParentPtr(Self, "listen_request_move", listener.?);
const event = util.voidCast(c.wlr_xdg_toplevel_move_event, data.?);
const seat = util.voidCast(Seat, event.seat.*.seat.*.data.?);
Mode.enter(&seat.cursor, .move, self.view);
seat.cursor.enterMode(.move, self.view);
}
/// Called when the client asks to be resized via the cursor.
@ -320,5 +319,5 @@ fn handleRequestResize(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) v
const self = @fieldParentPtr(Self, "listen_request_resize", listener.?);
const event = util.voidCast(c.wlr_xdg_toplevel_resize_event, data.?);
const seat = util.voidCast(Seat, event.seat.*.seat.*.data.?);
Mode.enter(&seat.cursor, .resize, self.view);
seat.cursor.enterMode(.resize, self.view);
}