mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +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
37 lines
729 B
Zig
37 lines
729 B
Zig
const c = @import("c.zig");
|
|
|
|
pub const Point = extern struct {
|
|
x: c.CGFloat,
|
|
y: c.CGFloat,
|
|
|
|
pub fn cval(self: Point) c.struct_CGPoint {
|
|
return @bitCast(self);
|
|
}
|
|
};
|
|
|
|
pub const Rect = extern struct {
|
|
origin: Point,
|
|
size: Size,
|
|
|
|
pub fn init(x: f64, y: f64, width: f64, height: f64) Rect {
|
|
return @bitCast(c.CGRectMake(x, y, width, height));
|
|
}
|
|
|
|
pub fn cval(self: Rect) c.struct_CGRect {
|
|
return @bitCast(self);
|
|
}
|
|
|
|
pub fn isNull(self: Rect) bool {
|
|
return c.CGRectIsNull(self.cval());
|
|
}
|
|
};
|
|
|
|
pub const Size = extern struct {
|
|
width: c.CGFloat,
|
|
height: c.CGFloat,
|
|
|
|
pub fn cval(self: Size) c.struct_CGSize {
|
|
return @bitCast(self);
|
|
}
|
|
};
|