Make View a toplevel struct

This commit is contained in:
Isaac Freund 2020-05-02 16:43:16 +02:00
parent a0d56ef635
commit 9ea26d2a30
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11
11 changed files with 182 additions and 183 deletions

View file

@ -2,7 +2,7 @@ const c = @import("../c.zig");
const Arg = @import("../command.zig").Arg;
const Seat = @import("../seat.zig");
const View = @import("../view.zig").View;
const View = @import("../view.zig");
const ViewStack = @import("../view_stack.zig").ViewStack;
/// Focus either the next or the previous visible view, depending on the enum

View file

@ -2,7 +2,7 @@ const c = @import("../c.zig");
const Arg = @import("../command.zig").Arg;
const Seat = @import("../seat.zig");
const View = @import("../view.zig").View;
const View = @import("../view.zig");
const ViewStack = @import("../view_stack.zig").ViewStack;
/// Bump the focused view to the top of the stack. If the view on the top of

View file

@ -5,7 +5,7 @@ const LayerSurface = @import("layer_surface.zig");
const Log = @import("log.zig").Log;
const Output = @import("output.zig");
const Seat = @import("seat.zig");
const View = @import("view.zig").View;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
const CursorMode = enum {

View file

@ -9,7 +9,7 @@ const Box = @import("box.zig");
const LayerSurface = @import("layer_surface.zig");
const Log = @import("log.zig").Log;
const Root = @import("root.zig").Root;
const View = @import("view.zig").View;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
root: *Root,

View file

@ -5,7 +5,7 @@ const Box = @import("box.zig");
const LayerSurface = @import("layer_surface.zig");
const Output = @import("output.zig");
const Server = @import("server.zig");
const View = @import("view.zig").View;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
pub fn renderOutput(output: *Output) void {

View file

@ -7,7 +7,7 @@ const Log = @import("log.zig").Log;
const Output = @import("output.zig");
const Server = @import("server.zig");
const Seat = @import("seat.zig").Seat;
const View = @import("view.zig").View;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
/// Responsible for all windowing operations

View file

@ -8,7 +8,7 @@ const InputManager = @import("input_manager.zig");
const Keyboard = @import("keyboard.zig").Keyboard;
const LayerSurface = @import("layer_surface.zig");
const Output = @import("output.zig");
const View = @import("view.zig").View;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
const FocusTarget = union(enum) {

View file

@ -10,7 +10,7 @@ const InputManager = @import("input_manager.zig");
const Log = @import("log.zig").Log;
const Output = @import("output.zig");
const Root = @import("root.zig").Root;
const View = @import("view.zig").View;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
allocator: *std.mem.Allocator,

View file

@ -1,4 +1,7 @@
const Self = @This();
const std = @import("std");
const c = @import("c.zig");
const Box = @import("box.zig");
@ -8,9 +11,6 @@ const Root = @import("root.zig").Root;
const ViewStack = @import("view_stack.zig").ViewStack;
const XdgToplevel = @import("xdg_toplevel.zig");
pub const View = struct {
const Self = @This();
const ViewImpl = union(enum) {
xdg_toplevel: XdgToplevel,
};
@ -155,7 +155,7 @@ pub const View = struct {
/// Move a view from one output to another, sending the required enter/leave
/// events.
pub fn sendToOutput(self: *Self, destination_output: *Output) void {
const node = @fieldParentPtr(ViewStack(View).Node, "view", self);
const node = @fieldParentPtr(ViewStack(Self).Node, "view", self);
self.output.views.remove(node);
destination_output.views.push(node);
@ -181,4 +181,3 @@ pub const View = struct {
.xdg_toplevel => |xdg_toplevel| xdg_toplevel.forEachSurface(iterator, user_data),
}
}
};

View file

@ -1,4 +1,4 @@
const View = @import("view.zig").View;
const View = @import("view.zig");
/// A specialized doubly-linked stack that allows for filtered iteration
/// over the nodes. T must be View or *View.

View file

@ -5,7 +5,7 @@ const std = @import("std");
const Box = @import("box.zig");
const Log = @import("log.zig").Log;
const View = @import("view.zig").View;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
const XdgPopup = @import("xdg_popup.zig");