refactor: change a -> allocator
This commit is contained in:
parent
ad58b1868d
commit
7b812d73ea
63 changed files with 896 additions and 896 deletions
|
@ -12,8 +12,8 @@ const Self = @This();
|
|||
|
||||
pub fn Create(comptime layout_: Widget.Layout) @import("widget.zig").CreateFunction {
|
||||
return struct {
|
||||
fn create(a: std.mem.Allocator, parent: Plane, event_handler: ?Widget.EventHandler) @import("widget.zig").CreateError!Widget {
|
||||
const self: *Self = try a.create(Self);
|
||||
fn create(allocator: std.mem.Allocator, parent: Plane, event_handler: ?Widget.EventHandler) @import("widget.zig").CreateError!Widget {
|
||||
const self: *Self = try allocator.create(Self);
|
||||
self.* = .{
|
||||
.plane = try Plane.init(&(Widget.Box{}).opts(@typeName(Self)), parent),
|
||||
.layout = layout_,
|
||||
|
@ -24,9 +24,9 @@ pub fn Create(comptime layout_: Widget.Layout) @import("widget.zig").CreateFunct
|
|||
}.create;
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Self, a: std.mem.Allocator) void {
|
||||
pub fn deinit(self: *Self, allocator: std.mem.Allocator) void {
|
||||
self.plane.deinit();
|
||||
a.destroy(self);
|
||||
allocator.destroy(self);
|
||||
}
|
||||
|
||||
pub fn layout(self: *Self) Widget.Layout {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue