mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00

* update zig * pkg/fontconfig: clean up @as * pkg/freetype,harfbuzz: clean up @as * pkg/imgui: clean up @as * pkg/macos: clean up @as * pkg/pixman,utf8proc: clean up @as * clean up @as * lots more @as cleanup * undo flatpak changes * clean up @as
31 lines
719 B
Zig
31 lines
719 B
Zig
const std = @import("std");
|
|
const c = @import("c.zig");
|
|
const Property = @import("main.zig").Property;
|
|
|
|
pub const ObjectSet = opaque {
|
|
pub fn create() *ObjectSet {
|
|
return @ptrCast(c.FcObjectSetCreate());
|
|
}
|
|
|
|
pub fn destroy(self: *ObjectSet) void {
|
|
c.FcObjectSetDestroy(self.cval());
|
|
}
|
|
|
|
pub fn add(self: *ObjectSet, p: Property) bool {
|
|
return c.FcObjectSetAdd(self.cval(), p.cval().ptr) == c.FcTrue;
|
|
}
|
|
|
|
pub inline fn cval(self: *ObjectSet) *c.struct__FcObjectSet {
|
|
return @ptrCast(@alignCast(self));
|
|
}
|
|
};
|
|
|
|
test "create" {
|
|
const testing = std.testing;
|
|
|
|
var os = ObjectSet.create();
|
|
defer os.destroy();
|
|
|
|
try testing.expect(os.add(.family));
|
|
}
|