mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-07 19:49:53 -05:00
inital support for hooks...
Currently the following hooks are available: - WinMapPre - WinMapPost
This commit is contained in:
parent
b45544c97a
commit
b3322eeb90
7 changed files with 193 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ const Output = @import("output.zig");
|
|||
const View = @import("view.zig");
|
||||
const Utils = @import("utils.zig");
|
||||
const Keymap = @import("keymap.zig");
|
||||
const Hook = @import("types/hook.zig");
|
||||
const Events = @import("types/events.zig");
|
||||
|
||||
const gpa = std.heap.c_allocator;
|
||||
const server = &@import("main.zig").server;
|
||||
|
|
@ -34,7 +36,11 @@ allocator: *wlr.Allocator,
|
|||
root: Root,
|
||||
seat: Seat,
|
||||
cursor: Cursor,
|
||||
|
||||
// lua data
|
||||
keymaps: std.AutoHashMap(u64, Keymap),
|
||||
hooks: std.ArrayList(*Hook),
|
||||
events: Events,
|
||||
|
||||
// Backend listeners
|
||||
new_input: wl.Listener(*wlr.InputDevice) = .init(handleNewInput),
|
||||
|
|
@ -90,6 +96,8 @@ pub fn init(self: *Server) void {
|
|||
.seat = undefined,
|
||||
.cursor = undefined,
|
||||
.keymaps = .init(gpa),
|
||||
.hooks = try .initCapacity(gpa, 10), // TODO: choose how many slots to start with
|
||||
.events = try .init(gpa),
|
||||
};
|
||||
|
||||
self.renderer.initServer(wl_server) catch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue