freetype: rename OutlineFuncs* to Funcs*

This commit is contained in:
Ali Chraghi 2022-06-14 02:06:31 +04:30 committed by Stephen Gutekanst
parent 4e3bbf694b
commit 2b325e9c4b
3 changed files with 7 additions and 7 deletions

View file

@ -159,7 +159,7 @@ fn write(ctx: WriterContext, bytes: []const u8) WriterError!usize {
defer outline_ctx.concave_vertices.deinit(); defer outline_ctx.concave_vertices.deinit();
defer outline_ctx.convex_vertices.deinit(); defer outline_ctx.convex_vertices.deinit();
const callbacks = ft.Outline.OutlineFuncs(*OutlineContext){ const callbacks = ft.Outline.Funcs(*OutlineContext){
.move_to = moveToFunction, .move_to = moveToFunction,
.line_to = lineToFunction, .line_to = lineToFunction,
.conic_to = conicToFunction, .conic_to = conicToFunction,

View file

@ -53,7 +53,7 @@ const OutlinePrinter = struct {
pub fn extractOutline(self: *Self) !void { pub fn extractOutline(self: *Self) !void {
try self.path_stream.writer().writeAll("<path d='"); try self.path_stream.writer().writeAll("<path d='");
var callbacks = freetype.Outline.OutlineFuncs(*Self){ var callbacks = freetype.Outline.Funcs(*Self){
.move_to = moveToFunction, .move_to = moveToFunction,
.line_to = lineToFunction, .line_to = lineToFunction,
.conic_to = conicToFunction, .conic_to = conicToFunction,

View file

@ -44,7 +44,7 @@ pub fn bbox(self: Outline) Error!BBox {
return b; return b;
} }
pub fn OutlineFuncs(comptime Context: type) type { pub fn Funcs(comptime Context: type) type {
return struct { return struct {
move_to: fn (ctx: Context, to: Vector) Error!void, move_to: fn (ctx: Context, to: Vector) Error!void,
line_to: fn (ctx: Context, to: Vector) Error!void, line_to: fn (ctx: Context, to: Vector) Error!void,
@ -55,11 +55,11 @@ pub fn OutlineFuncs(comptime Context: type) type {
}; };
} }
pub fn OutlineFuncsWrapper(comptime Context: type) type { pub fn FuncsWrapper(comptime Context: type) type {
return struct { return struct {
const Self = @This(); const Self = @This();
ctx: Context, ctx: Context,
callbacks: OutlineFuncs(Context), callbacks: Funcs(Context),
fn getSelf(ptr: ?*anyopaque) *Self { fn getSelf(ptr: ?*anyopaque) *Self {
return @ptrCast(*Self, @alignCast(@alignOf(Self), ptr)); return @ptrCast(*Self, @alignCast(@alignOf(Self), ptr));
@ -117,8 +117,8 @@ pub fn OutlineFuncsWrapper(comptime Context: type) type {
}; };
} }
pub fn decompose(self: Outline, ctx: anytype, callbacks: OutlineFuncs(@TypeOf(ctx))) Error!void { pub fn decompose(self: Outline, ctx: anytype, callbacks: Funcs(@TypeOf(ctx))) Error!void {
var wrapper = OutlineFuncsWrapper(@TypeOf(ctx)){ .ctx = ctx, .callbacks = callbacks }; var wrapper = FuncsWrapper(@TypeOf(ctx)){ .ctx = ctx, .callbacks = callbacks };
try intToError(c.FT_Outline_Decompose( try intToError(c.FT_Outline_Decompose(
self.handle, self.handle,
&.{ &.{