pull/12863/merge
Lukas 2026-06-03 12:27:01 -07:00 committed by GitHub
commit 5b4d598217
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
130 changed files with 305 additions and 128 deletions

View File

@ -16,7 +16,7 @@ const BlockingQueue = @import("datastruct/main.zig").BlockingQueue;
const renderer = @import("renderer.zig");
const font = @import("font/main.zig");
const log = std.log.scoped(.app);
const log = @import("log.zig").scoped(.app);
const SurfaceList = std.ArrayListUnmanaged(*apprt.Surface);

View File

@ -38,7 +38,7 @@ const inspectorpkg = @import("inspector/main.zig");
const SurfaceMouse = @import("surface_mouse.zig");
const ProcessInfo = @import("pty.zig").ProcessInfo;
const log = std.log.scoped(.surface);
const log = @import("log.zig").scoped(.surface);
// The renderer implementation to use.
const Renderer = rendererpkg.Renderer;

View File

@ -22,7 +22,7 @@ const configpkg = @import("../config.zig");
const Config = configpkg.Config;
const String = @import("../main_c.zig").String;
const log = std.log.scoped(.embedded_window);
const log = @import("../log.zig").scoped(.embedded_window);
pub const resourcesDir = internal_os.resourcesDir;

View File

@ -2,7 +2,7 @@ const std = @import("std");
const cli = @import("cli.zig");
const state = &@import("../global.zig").state;
const log = std.log.scoped(.benchmark);
const log = @import("../log.zig").scoped(.benchmark);
/// Run the Ghostty benchmark CLI with the given action and arguments.
export fn ghostty_benchmark_cli(

View File

@ -15,7 +15,7 @@ const UTF8Decoder = @import("../terminal/UTF8Decoder.zig");
const simd = @import("../simd/main.zig");
const table = @import("../unicode/main.zig").table;
const log = std.log.scoped(.@"terminal-stream-bench");
const log = @import("../log.zig").scoped(.@"terminal-stream-bench");
opts: Options,

View File

@ -12,7 +12,7 @@ const UTF8Decoder = @import("../terminal/UTF8Decoder.zig");
const unicode = @import("../unicode/main.zig");
const uucode = @import("uucode");
const log = std.log.scoped(.@"terminal-stream-bench");
const log = @import("../log.zig").scoped(.@"terminal-stream-bench");
opts: Options,

View File

@ -12,7 +12,7 @@ const UTF8Decoder = @import("../terminal/UTF8Decoder.zig");
const uucode = @import("uucode");
const symbols_table = @import("../unicode/symbols_table.zig").table;
const log = std.log.scoped(.@"is-symbol-bench");
const log = @import("../log.zig").scoped(.@"is-symbol-bench");
opts: Options,

View File

@ -8,7 +8,7 @@ const Allocator = std.mem.Allocator;
const Benchmark = @import("Benchmark.zig");
const options = @import("options.zig");
const Parser = @import("../terminal/osc.zig").Parser;
const log = std.log.scoped(.@"osc-parser-bench");
const log = @import("../log.zig").scoped(.@"osc-parser-bench");
opts: Options,

View File

@ -12,7 +12,7 @@ const Benchmark = @import("Benchmark.zig");
const options = @import("options.zig");
const Terminal = terminalpkg.Terminal;
const log = std.log.scoped(.@"terminal-stream-bench");
const log = @import("../log.zig").scoped(.@"terminal-stream-bench");
opts: Options,
terminal: Terminal,

View File

@ -8,7 +8,7 @@ const terminalpkg = @import("../terminal/main.zig");
const Benchmark = @import("Benchmark.zig");
const options = @import("options.zig");
const log = std.log.scoped(.@"terminal-stream-bench");
const log = @import("../log.zig").scoped(.@"terminal-stream-bench");
opts: Options,

View File

@ -22,7 +22,7 @@ const options = @import("options.zig");
const Terminal = terminalpkg.Terminal;
const Stream = terminalpkg.Stream(*Handler);
const log = std.log.scoped(.@"terminal-stream-bench");
const log = @import("../log.zig").scoped(.@"terminal-stream-bench");
opts: Options,
terminal: Terminal,

View File

@ -9,7 +9,7 @@ const Diagnostic = diags.Diagnostic;
const DiagnosticList = diags.DiagnosticList;
const CommaSplitter = @import("CommaSplitter.zig");
const log = std.log.scoped(.cli);
const log = @import("../log.zig").scoped(.cli);
// TODO:
// - Only `--long=value` format is accepted. Do we want to allow

View File

@ -5,7 +5,7 @@ const Action = @import("ghostty.zig").Action;
const args = @import("args.zig");
const font = @import("../font/main.zig");
const log = std.log.scoped(.list_fonts);
const log = @import("../log.zig").scoped(.list_fonts);
pub const Options = struct {
/// This is set by the CLI parser for deinit.

View File

@ -8,7 +8,7 @@ const DiskCache = @import("ssh_cache.zig").DiskCache;
const internal_os = @import("../os/main.zig");
const ghostty_terminfo = @import("../terminfo/main.zig").ghostty;
const log = std.log.scoped(.ssh);
const log = @import("../log.zig").scoped(.ssh);
const usage =
\\Usage: ghostty +ssh [flags] [--] <ssh args...>

View File

@ -9,7 +9,7 @@ const c_get = @import("c_get.zig");
const edit = @import("edit.zig");
const Key = @import("key.zig").Key;
const log = std.log.scoped(.config);
const log = @import("../log.zig").scoped(.config);
/// Create a new configuration filled with the initial default values.
export fn ghostty_config_new() ?*Config {

View File

@ -54,7 +54,7 @@ const terminal = struct {
const x11_color = @import("../terminal/x11_color.zig");
};
const log = std.log.scoped(.config);
const log = @import("../log.zig").scoped(.config);
/// Used on Unixes for some defaults.
const c = @cImport({

View File

@ -5,7 +5,7 @@ const alloc = wasm.alloc;
const Config = @import("Config.zig");
const log = std.log.scoped(.config);
const log = @import("../log.zig").scoped(.config);
/// Create a new configuration filled with the initial default values.
export fn config_new() ?*Config {

View File

@ -4,7 +4,7 @@ const assert = @import("../quirks.zig").inlineAssert;
const Allocator = std.mem.Allocator;
const internal_os = @import("../os/main.zig");
const log = std.log.scoped(.config);
const log = @import("../log.zig").scoped(.config);
/// Default path for the XDG home configuration file. Returned value
/// must be freed by the caller.

View File

@ -8,7 +8,7 @@ const cli = @import("../cli.zig");
const internal_os = @import("../os/main.zig");
const formatterpkg = @import("formatter.zig");
const log = std.log.scoped(.config);
const log = @import("../log.zig").scoped(.config);
pub const ParseError = error{ValueRequired} || Allocator.Error;

View File

@ -10,7 +10,7 @@ const crash = @import("main.zig");
const state = &@import("../global.zig").state;
const Surface = @import("../Surface.zig");
const log = std.log.scoped(.sentry);
const log = @import("../log.zig").scoped(.sentry);
/// The global state for the Sentry SDK. This is unavoidable since crash
/// handling is a global process-wide thing.

View File

@ -2,7 +2,7 @@ const std = @import("std");
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const log = std.log.scoped(.sentry_envelope);
const log = @import("../log.zig").scoped(.sentry_envelope);
/// The Sentry Envelope format: https://develop.sentry.dev/sdk/envelopes/
///

View File

@ -22,7 +22,7 @@ const testing = std.testing;
const fastmem = @import("../fastmem.zig");
const tripwire = @import("../tripwire.zig");
const log = std.log.scoped(.atlas);
const log = @import("../log.zig").scoped(.atlas);
/// Data is the raw texture data.
data: []u8,

View File

@ -28,7 +28,7 @@ const RenderOptions = font.face.RenderOptions;
const SpriteFace = font.SpriteFace;
const Style = font.Style;
const log = std.log.scoped(.font_codepoint_resolver);
const log = @import("../log.zig").scoped(.font_codepoint_resolver);
/// The underlying collection of fonts. This will be modified as
/// new fonts are found via the resolver. The resolver takes ownership

View File

@ -29,7 +29,7 @@ const Metrics = font.Metrics;
const Presentation = font.Presentation;
const Style = font.Style;
const log = std.log.scoped(.font_collection);
const log = @import("../log.zig").scoped(.font_collection);
/// The available faces we have. This shouldn't be modified manually.
/// Instead, use the functions available on Collection.

View File

@ -16,7 +16,7 @@ const Library = @import("main.zig").Library;
const Face = @import("main.zig").Face;
const Presentation = @import("main.zig").Presentation;
const log = std.log.scoped(.deferred_face);
const log = @import("../log.zig").scoped(.deferred_face);
/// Fontconfig
fc: if (options.backend == .fontconfig_freetype) ?Fontconfig else void =

View File

@ -35,7 +35,7 @@ const Presentation = font.Presentation;
const Style = font.Style;
const RenderOptions = font.face.RenderOptions;
const log = std.log.scoped(.font_shared_grid);
const log = @import("../log.zig").scoped(.font_shared_grid);
/// Cache for codepoints to font indexes in a group.
codepoints: std.AutoHashMapUnmanaged(CodepointKey, ?Collection.Index) = .{},

View File

@ -29,7 +29,7 @@ const discovery = @import("discovery.zig");
const configpkg = @import("../config.zig");
const Config = configpkg.Config;
const log = std.log.scoped(.font_shared_grid_set);
const log = @import("../log.zig").scoped(.font_shared_grid_set);
/// The allocator to use for all heap allocations.
alloc: Allocator,

View File

@ -13,7 +13,7 @@ const Library = @import("main.zig").Library;
const Presentation = @import("main.zig").Presentation;
const Variation = @import("main.zig").face.Variation;
const log = std.log.scoped(.discovery);
const log = @import("../log.zig").scoped(.discovery);
/// Discover implementation for the compile options.
pub const Discover = switch (options.backend) {

View File

@ -8,7 +8,7 @@ const font = @import("../main.zig");
const opentype = @import("../opentype.zig");
const quirks = @import("../../quirks.zig");
const log = std.log.scoped(.font_face);
const log = @import("../../log.zig").scoped(.font_face);
pub const Face = struct {
/// Our font face

View File

@ -21,7 +21,7 @@ const config = @import("../../config.zig");
const F26Dot6 = opentype.sfnt.F26Dot6;
const log = std.log.scoped(.font_face);
const log = @import("../../log.zig").scoped(.font_face);
pub const Face = struct {
comptime {

View File

@ -5,7 +5,7 @@ const Allocator = std.mem.Allocator;
const js = @import("zig-js");
const font = @import("../main.zig");
const log = std.log.scoped(.font_face);
const log = @import("../../log.zig").scoped(.font_face);
pub const Face = struct {
/// See graphemes field for more details.

View File

@ -15,7 +15,7 @@ const Allocator = std.mem.Allocator;
const font = @import("../main.zig");
const CacheTable = @import("../../datastruct/main.zig").CacheTable;
const log = std.log.scoped(.font_shaper_cache);
const log = @import("../../log.zig").scoped(.font_shaper_cache);
/// Context for cache table.
const CellCacheTableContext = struct {

View File

@ -21,7 +21,7 @@ const Style = font.Style;
const Presentation = font.Presentation;
const CFReleaseThread = os.CFReleaseThread;
const log = std.log.scoped(.font_shaper);
const log = @import("../../log.zig").scoped(.font_shaper);
/// Shaper that uses CoreText.
///

View File

@ -2,7 +2,7 @@ const std = @import("std");
const assert = @import("../../quirks.zig").inlineAssert;
const Allocator = std.mem.Allocator;
const log = std.log.scoped(.font_shaper);
const log = @import("../../log.zig").scoped(.font_shaper);
/// Represents an OpenType font feature setting, which consists of a tag and
/// a numeric parameter >= 0. Most features are boolean, so only parameters

View File

@ -16,7 +16,7 @@ const SharedGrid = font.SharedGrid;
const Style = font.Style;
const Presentation = font.Presentation;
const log = std.log.scoped(.font_shaper);
const log = @import("../../log.zig").scoped(.font_shaper);
/// Shaper that uses Harfbuzz.
pub const Shaper = struct {

View File

@ -12,7 +12,7 @@ const Style = font.Style;
const Presentation = font.Presentation;
const terminal = @import("../../terminal/main.zig");
const log = std.log.scoped(.font_shaper);
const log = @import("../../log.zig").scoped(.font_shaper);
/// Shaper that doesn't do any shaping. Each individual codepoint is mapped
/// directly to the detected text run font's glyph index.

View File

@ -6,7 +6,7 @@ const terminal = @import("../../terminal/main.zig");
const unicode = @import("../../unicode/main.zig");
const uucode = @import("uucode");
const log = std.log.scoped(.font_shaper);
const log = @import("../../log.zig").scoped(.font_shaper);
pub const Shaper = struct {
const RunBuf = std.MultiArrayList(struct {

View File

@ -22,7 +22,7 @@ const Sprite = font.sprite.Sprite;
const special = @import("draw/special.zig");
const log = std.log.scoped(.font_sprite);
const log = @import("../../log.zig").scoped(.font_sprite);
/// Grid metrics for rendering sprites.
metrics: font.Metrics,

View File

@ -8,7 +8,7 @@ const Allocator = std.mem.Allocator;
const font = @import("../../main.zig");
const log = std.log.scoped(.sprite_font);
const log = @import("../../../log.zig").scoped(.sprite_font);
// Utility names for common fractions
pub const one_eighth: f64 = 0.125;

View File

@ -7,7 +7,7 @@ const point = @import("../terminal/point.zig");
const key = @import("key.zig");
const mouse = @import("mouse.zig");
const log = std.log.scoped(.mouse_encode);
const log = @import("../log.zig").scoped(.mouse_encode);
/// Options that affect mouse encoding behavior and provide runtime context.
pub const Options = struct {

View File

@ -4,7 +4,7 @@ const cimgui = @import("dcimgui");
const widgets = @import("../widgets.zig");
const renderer = @import("../../renderer.zig");
const log = std.log.scoped(.inspector_renderer);
const log = @import("../../log.zig").scoped(.inspector_renderer);
/// Renderer information inspector widget.
pub const Info = struct {

173
src/log.zig Normal file
View File

@ -0,0 +1,173 @@
//! Logging wrapper that mirrors `std.log.scoped`. On Darwin debug
//! builds it additionally delivers each entry to Apple's unified
//! logging via an inline `_os_log_impl` call so DWARF resolves the
//! call site to the original Zig source that's what makes Xcode's
//! Jump to Source land on the right file:line during development.
//!
//! Release builds skip the inline SPI path and let the standard log
//! pipeline (logFn `os_log_with_type` C wrapper) deliver os_log
//! entries using only public API. The trade-off is that release
//! builds attribute the log call site to the C wrapper.
//!
//! Non-Darwin targets are a pass-through to `std.log.scoped`.
const std = @import("std");
const builtin = @import("builtin");
const build_config = @import("build_config.zig");
const state = &@import("global.zig").state;
const inline_oslog = builtin.target.os.tag.isDarwin() and builtin.mode == .Debug;
pub fn scoped(comptime scope: @Type(.enum_literal)) type {
const inner = std.log.scoped(scope);
return struct {
pub inline fn err(
comptime format: []const u8,
args: anytype,
) void {
if (comptime inline_oslog) emitDarwin(scope, .err, format, args);
inner.err(format, args);
}
pub inline fn warn(
comptime format: []const u8,
args: anytype,
) void {
if (comptime inline_oslog) emitDarwin(scope, .warn, format, args);
inner.warn(format, args);
}
pub inline fn info(
comptime format: []const u8,
args: anytype,
) void {
if (comptime inline_oslog) emitDarwin(scope, .info, format, args);
inner.info(format, args);
}
pub inline fn debug(
comptime format: []const u8,
args: anytype,
) void {
if (comptime inline_oslog) emitDarwin(scope, .debug, format, args);
inner.debug(format, args);
}
};
}
const LogType = enum(u8) {
default = 0x00,
info = 0x01,
debug = 0x02,
err = 0x10,
fault = 0x11,
};
const OsLog = opaque {};
extern "c" fn os_log_create(
subsystem: [*:0]const u8,
category: [*:0]const u8,
) ?*OsLog;
extern "c" fn os_release(*OsLog) void;
extern "c" fn _os_log_impl(
dso: *const anyopaque,
log: *OsLog,
log_type: u8,
format: [*]const u8,
buf: [*]const u8,
size: u32,
) callconv(.c) void;
const oslog_fmt_public_s: [10:0]u8 linksection("__TEXT,__oslogstring") = "%{public}s".*;
const Dl_info = extern struct {
dli_fname: ?[*:0]const u8,
dli_fbase: ?*const anyopaque,
dli_sname: ?[*:0]const u8,
dli_saddr: ?*const anyopaque,
};
extern "c" fn dladdr(addr: *const anyopaque, info: *Dl_info) c_int;
/// Mach-O header of the image we're linked into, for `_os_log_impl`.
/// `__dso_handle` is unusable (Zig defines its own placeholder in the
/// data segment) and `_dyld_get_image_header(0)` returns the main
/// executable's header instead of ours when this code lives in a dylib
/// like ghostty.debug.dylib.
inline fn dsoHandle() *const anyopaque {
var info: Dl_info = undefined;
_ = dladdr(&oslog_fmt_public_s, &info);
return info.dli_fbase.?;
}
inline fn emitDarwin(
comptime scope: @Type(.enum_literal),
comptime level: std.log.Level,
comptime format: []const u8,
args: anytype,
) void {
@setEvalBranchQuota(10_000);
if (!state.logging.macos) return;
const log = getScopedLog(scope) orelse return;
var stack_buf: [4096]u8 = undefined;
const msg = std.fmt.bufPrintZ(
&stack_buf,
format,
args,
) catch return;
var buf: [12]u8 align(8) = undefined;
buf[0] = 0x02;
buf[1] = 0x01;
buf[2] = 0x22;
buf[3] = 0x08;
@as(*align(1) [*:0]const u8, @ptrCast(&buf[4])).* = msg.ptr;
_os_log_impl(
dsoHandle(),
log,
@intFromEnum(comptime macLevel(level)),
&oslog_fmt_public_s,
&buf,
buf.len,
);
}
inline fn macLevel(comptime level: std.log.Level) LogType {
return comptime switch (level) {
.debug => .debug,
.info => .info,
.warn => .err,
.err => .fault,
};
}
inline fn getScopedLog(comptime scope: @Type(.enum_literal)) ?*OsLog {
const Slot = struct {
var cached: std.atomic.Value(usize) = std.atomic.Value(usize).init(0);
};
const existing = Slot.cached.load(.acquire);
if (existing != 0) return @ptrFromInt(existing);
const fresh = os_log_create(
build_config.bundle_id,
@tagName(scope),
) orelse return null;
if (Slot.cached.cmpxchgStrong(
0,
@intFromPtr(fresh),
.acq_rel,
.acquire,
)) |winner| {
os_release(fresh);
return @ptrFromInt(winner);
}
return fresh;
}

View File

@ -125,6 +125,10 @@ fn logFn(
// macOS logging is thread safe so no need for locks/mutexes
macos: {
if (comptime !builtin.target.os.tag.isDarwin()) break :macos;
// Debug builds skip this branch log.zig's inline path
// handles os_log delivery there instead, so DWARF can resolve the
// call site to Zig source for Xcode's Jump to Source.
if (comptime builtin.mode == .Debug) break :macos;
if (!state.logging.macos) break :macos;
const prefix = if (scope == .default) "" else @tagName(scope) ++ ": ";

View File

@ -6,7 +6,7 @@ const std = @import("std");
const Dir = std.fs.Dir;
const file = @import("file.zig");
const log = std.log.scoped(.tempdir);
const log = @import("../log.zig").scoped(.tempdir);
/// Dir is the directory handle
dir: Dir,

View File

@ -13,7 +13,7 @@ const xev = @import("../global.zig").xev;
const BlockingQueue = @import("../datastruct/main.zig").BlockingQueue;
const Allocator = std.mem.Allocator;
const log = std.log.scoped(.cf_release_thread);
const log = @import("../log.zig").scoped(.cf_release_thread);
pub const Message = union(enum) {
/// Release a slice of CFTypeRefs. Uses alloc to free the slice after

View File

@ -1,6 +1,6 @@
const std = @import("std");
const log = std.log.scoped(.@"linux-cgroup");
const log = @import("../log.zig").scoped(.@"linux-cgroup");
/// Returns the path to the cgroup for the given pid.
pub fn current(buf: []u8, pid: u32) ?[]const u8 {

View File

@ -3,7 +3,7 @@ const builtin = @import("builtin");
const posix = std.posix;
const windows = @import("windows.zig");
const log = std.log.scoped(.os);
const log = @import("../log.zig").scoped(.os);
pub const rlimit = if (@hasDecl(posix.system, "rlimit")) posix.rlimit else struct {};

View File

@ -4,7 +4,7 @@ const builtin = @import("builtin");
const posix = std.posix;
const xev = @import("../global.zig").xev;
const log = std.log.scoped(.flatpak);
const log = @import("../log.zig").scoped(.flatpak);
/// Returns true if we're running in a Flatpak environment.
pub fn isFlatpak() bool {

View File

@ -3,7 +3,7 @@ const builtin = @import("builtin");
const build_config = @import("../build_config.zig");
const locales = @import("i18n_locales.zig");
const log = std.log.scoped(.i18n);
const log = @import("../log.zig").scoped(.i18n);
/// Set for faster membership lookup of locales.
pub const locales_map = map: {

View File

@ -6,7 +6,7 @@ const objc = @import("objc");
const internal_os = @import("main.zig");
const i18n = internal_os.i18n;
const log = std.log.scoped(.os_locale);
const log = @import("../log.zig").scoped(.os_locale);
/// Ensure that the locale is set.
pub fn ensureLocale(alloc: std.mem.Allocator) !void {

View File

@ -2,7 +2,7 @@ const std = @import("std");
const builtin = @import("builtin");
const objc = @import("objc");
const log = std.log.scoped(.os);
const log = @import("../log.zig").scoped(.os);
/// The system-configured double-click interval if its available.
pub fn clickInterval() ?u32 {

View File

@ -4,7 +4,7 @@ const Allocator = std.mem.Allocator;
const build_config = @import("../build_config.zig");
const apprt = @import("../apprt.zig");
const log = std.log.scoped(.@"os-open");
const log = @import("../log.zig").scoped(.@"os-open");
/// Open a URL in the default handling application.
///

View File

@ -6,7 +6,7 @@ const Allocator = std.mem.Allocator;
const ArenaAllocator = std.heap.ArenaAllocator;
const posix = std.posix;
const log = std.log.scoped(.passwd);
const log = @import("../log.zig").scoped(.passwd);
// We want to be extra sure since this will force bad symbols into our import table
comptime {

View File

@ -1,7 +1,7 @@
const std = @import("std");
const builtin = @import("builtin");
const log = std.log.scoped(.systemd);
const log = @import("../log.zig").scoped(.systemd);
/// Returns true if the program was launched as a systemd service.
///

View File

@ -4,7 +4,7 @@ const windows = @import("os/main.zig").windows;
const posix = std.posix;
const assert = @import("quirks.zig").inlineAssert;
const log = std.log.scoped(.pty);
const log = @import("log.zig").scoped(.pty);
/// Redeclare this winsize struct so we can just use a Zig struct. This
/// layout should be correct on all tested platforms. The defaults on this

View File

@ -36,7 +36,7 @@ pub const custom_shader_y_is_down = true;
/// Triple buffering.
pub const swap_chain_count = 3;
const log = std.log.scoped(.metal);
const log = @import("../log.zig").scoped(.metal);
layer: IOSurfaceLayer,

View File

@ -31,7 +31,7 @@ pub const custom_shader_y_is_down = false;
/// sync, we have no need for multi-buffering.
pub const swap_chain_count = 1;
const log = std.log.scoped(.opengl);
const log = @import("../log.zig").scoped(.opengl);
/// We require at least OpenGL 4.3
pub const MIN_VERSION_MAJOR = 4;

View File

@ -21,7 +21,7 @@ const Size = size.Size;
const CellSize = size.CellSize;
const Image = @import("image.zig").Image;
const log = std.log.scoped(.renderer_overlay);
const log = @import("../log.zig").scoped(.renderer_overlay);
/// The colors we use for overlays.
pub const Color = enum {

View File

@ -14,7 +14,7 @@ const BlockingQueue = @import("../datastruct/main.zig").BlockingQueue;
const App = @import("../App.zig");
const Allocator = std.mem.Allocator;
const log = std.log.scoped(.renderer_thread);
const log = @import("../log.zig").scoped(.renderer_thread);
const DRAW_INTERVAL = 8; // 120 FPS
const CURSOR_BLINK_INTERVAL = 600;

View File

@ -41,7 +41,7 @@ const DisplayLink = switch (builtin.os.tag) {
else => void,
};
const log = std.log.scoped(.generic_renderer);
const log = @import("../log.zig").scoped(.generic_renderer);
/// Create a renderer type with the provided graphics API wrapper.
///

View File

@ -10,7 +10,7 @@ const Texture = GraphicsAPI.Texture;
const CellSize = @import("size.zig").CellSize;
const Overlay = @import("Overlay.zig");
const log = std.log.scoped(.renderer_image);
const log = @import("../log.zig").scoped(.renderer_image);
/// Generic image rendering state for the renderer. This stores all
/// images and their placements and exposes only a limited public API

View File

@ -8,7 +8,7 @@ const point = terminal.point;
const Screen = terminal.Screen;
const Terminal = terminal.Terminal;
const log = std.log.scoped(.renderer_link);
const log = @import("../log.zig").scoped(.renderer_link);
/// The link configuration needed for renderers.
pub const Link = struct {

View File

@ -13,7 +13,7 @@ const RenderPass = @import("RenderPass.zig");
const Health = @import("../../renderer.zig").Health;
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
/// Options for beginning a frame.
pub const Options = struct {

View File

@ -9,7 +9,7 @@ const macos = @import("macos");
const IOSurface = macos.iosurface.IOSurface;
const log = std.log.scoped(.IOSurfaceLayer);
const log = @import("../../log.zig").scoped(.IOSurfaceLayer);
/// We subclass CALayer with a custom display handler, we only need
/// to make the subclass once, and then we can use it as a singleton.

View File

@ -8,7 +8,7 @@ const objc = @import("objc");
const mtl = @import("api.zig");
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
/// Options for initializing a render pipeline.
pub const Options = struct {

View File

@ -11,7 +11,7 @@ const Sampler = @import("Sampler.zig");
const Texture = @import("Texture.zig");
const Target = @import("Target.zig");
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
/// Options for beginning a render pass.
pub const Options = struct {

View File

@ -8,7 +8,7 @@ const objc = @import("objc");
const mtl = @import("api.zig");
const Metal = @import("../Metal.zig");
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
/// Options for initializing a sampler.
pub const Options = struct {

View File

@ -12,7 +12,7 @@ const IOSurface = macos.iosurface.IOSurface;
const mtl = @import("api.zig");
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
/// Options for initializing a Target
pub const Options = struct {

View File

@ -9,7 +9,7 @@ const objc = @import("objc");
const mtl = @import("api.zig");
const Metal = @import("../Metal.zig");
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
/// Options for initializing a texture.
pub const Options = struct {

View File

@ -6,7 +6,7 @@ const macos = @import("macos");
const mtl = @import("api.zig");
const Metal = @import("../Metal.zig");
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
/// Options for initializing a buffer.
pub const Options = struct {

View File

@ -7,7 +7,7 @@ const math = @import("../../math.zig");
const mtl = @import("api.zig");
const Pipeline = @import("Pipeline.zig");
const log = std.log.scoped(.metal);
const log = @import("../../log.zig").scoped(.metal);
const pipeline_descs: []const struct { [:0]const u8, PipelineDescription } =
&.{

View File

@ -12,7 +12,7 @@ const RenderPass = @import("RenderPass.zig");
const Health = @import("../../renderer.zig").Health;
const log = std.log.scoped(.opengl);
const log = @import("../../log.zig").scoped(.opengl);
/// Options for beginning a frame.
pub const Options = struct {};

View File

@ -5,7 +5,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const gl = @import("opengl");
const log = std.log.scoped(.opengl);
const log = @import("../../log.zig").scoped(.opengl);
/// Options for initializing a render pipeline.
pub const Options = struct {

View File

@ -7,7 +7,7 @@ const gl = @import("opengl");
const OpenGL = @import("../OpenGL.zig");
const log = std.log.scoped(.opengl);
const log = @import("../../log.zig").scoped(.opengl);
/// Options for initializing a sampler.
pub const Options = struct {

View File

@ -7,7 +7,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const gl = @import("opengl");
const log = std.log.scoped(.opengl);
const log = @import("../../log.zig").scoped(.opengl);
/// Options for initializing a Target
pub const Options = struct {

View File

@ -7,7 +7,7 @@ const gl = @import("opengl");
const OpenGL = @import("../OpenGL.zig");
const log = std.log.scoped(.opengl);
const log = @import("../../log.zig").scoped(.opengl);
/// Options for initializing a texture.
pub const Options = struct {

View File

@ -4,7 +4,7 @@ const gl = @import("opengl");
const OpenGL = @import("../OpenGL.zig");
const log = std.log.scoped(.opengl);
const log = @import("../../log.zig").scoped(.opengl);
/// Options for initializing a buffer.
pub const Options = struct {

View File

@ -5,7 +5,7 @@ const math = @import("../../math.zig");
const Pipeline = @import("Pipeline.zig");
const log = std.log.scoped(.opengl);
const log = @import("../../log.zig").scoped(.opengl);
const pipeline_descs: []const struct { [:0]const u8, PipelineDescription } =
&.{

View File

@ -6,7 +6,7 @@ const glslang = @import("glslang");
const spvcross = @import("spirv_cross");
const configpkg = @import("../config.zig");
const log = std.log.scoped(.shadertoy);
const log = @import("../log.zig").scoped(.shadertoy);
/// The uniform struct used for shadertoy shaders.
pub const Uniforms = extern struct {

View File

@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const terminal_size = @import("../terminal/size.zig");
const log = std.log.scoped(.renderer_size);
const log = @import("../log.zig").scoped(.renderer_size);
/// Controls how extra whitespace around the terminal grid is distributed.
pub const PaddingBalance = enum {

View File

@ -3,7 +3,7 @@ const options = @import("build_options");
const assert = @import("../quirks.zig").inlineAssert;
const scalar_decoder = @import("base64_scalar.zig").scalar_decoder;
const log = std.log.scoped(.simd_base64);
const log = @import("../log.zig").scoped(.simd_base64);
pub fn maxLen(input: []const u8) usize {
if (comptime options.simd) return ghostty_simd_base64_max_length(

View File

@ -5,7 +5,7 @@ const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const Bytes = @import("../Bytes.zig");
const log = std.log.scoped(.@"terminal-stream-bench");
const log = @import("../../log.zig").scoped(.@"terminal-stream-bench");
pub const Options = struct {};

View File

@ -5,7 +5,7 @@ const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const synthetic = @import("../main.zig");
const log = std.log.scoped(.@"terminal-stream-bench");
const log = @import("../../log.zig").scoped(.@"terminal-stream-bench");
pub const Options = struct {
/// Probability of generating a valid value.

View File

@ -23,7 +23,7 @@ const Capacity = pagepkg.Capacity;
const Page = pagepkg.Page;
const Row = pagepkg.Row;
const log = std.log.scoped(.page_list);
const log = @import("../log.zig").scoped(.page_list);
/// The number of PageList.Nodes we preheat the pool with. A node is
/// a very small struct so we can afford to preheat many, but the exact

View File

@ -9,7 +9,7 @@ const testing = std.testing;
const table = @import("parse_table.zig").table;
const osc = @import("osc.zig");
const log = std.log.scoped(.parser);
const log = @import("../log.zig").scoped(.parser);
/// States for the state machine
pub const State = enum {

View File

@ -30,7 +30,7 @@ const Pin = PageList.Pin;
pub const CursorStyle = @import("cursor.zig").Style;
const log = std.log.scoped(.screen);
const log = @import("../log.zig").scoped(.screen);
/// The general purpose allocator to use for all memory allocations.
/// Unfortunately some screen operations do require allocation.

View File

@ -35,7 +35,7 @@ const Page = pagepkg.Page;
const Cell = pagepkg.Cell;
const Row = pagepkg.Row;
const log = std.log.scoped(.terminal);
const log = @import("../log.zig").scoped(.terminal);
/// Default tabstop interval
const TABSTOP_INTERVAL = 8;

View File

@ -11,7 +11,7 @@ const UTF8Decoder = @This();
const std = @import("std");
const testing = std.testing;
const log = std.log.scoped(.utf8decoder);
const log = @import("../log.zig").scoped(.utf8decoder);
// zig fmt: off
const char_classes = [_]u4{

View File

@ -5,7 +5,7 @@ const Allocator = std.mem.Allocator;
const glyph = @import("apc/glyph.zig");
const kitty_gfx = @import("kitty/graphics.zig");
const log = std.log.scoped(.terminal_apc);
const log = @import("../log.zig").scoped(.terminal_apc);
/// APC command handler. This should be hooked into a terminal.Stream handler.
/// The start/feed/end functions are meant to be called from the terminal.Stream

View File

@ -4,7 +4,7 @@ const lib = @import("../lib.zig");
const build_options = @import("terminal_options");
const Result = @import("result.zig").Result;
const log = std.log.scoped(.build_info_c);
const log = @import("../../log.zig").scoped(.build_info_c);
/// C: GhosttyOptimizeMode
pub const OptimizeMode = enum(c_int) {

View File

@ -11,7 +11,7 @@ const KeyEvent = @import("key_event.zig").Event;
const Terminal = @import("terminal.zig").Terminal;
const ZigTerminal = @import("../Terminal.zig");
const log = std.log.scoped(.key_encode);
const log = @import("../../log.zig").scoped(.key_encode);
/// Wrapper around key encoding options that tracks the allocator for C API usage.
const KeyEncoderWrapper = struct {

View File

@ -5,7 +5,7 @@ const CAllocator = lib.alloc.Allocator;
const key = @import("../../input/key.zig");
const Result = @import("result.zig").Result;
const log = std.log.scoped(.key_event);
const log = @import("../../log.zig").scoped(.key_event);
/// Wrapper around KeyEvent that tracks the allocator for C API usage.
/// The UTF-8 text is not owned by this wrapper - the caller is responsible

View File

@ -13,7 +13,7 @@ const Event = mouse_event.Event;
const Terminal = @import("terminal.zig").Terminal;
const ZigTerminal = @import("../Terminal.zig");
const log = std.log.scoped(.mouse_encode);
const log = @import("../../log.zig").scoped(.mouse_encode);
/// Wrapper around mouse encoding options that tracks the allocator for C API usage.
const MouseEncoderWrapper = struct {

View File

@ -8,7 +8,7 @@ const mouse = @import("../../input/mouse.zig");
const mouse_encode = @import("../../input/mouse_encode.zig");
const Result = @import("result.zig").Result;
const log = std.log.scoped(.mouse_event);
const log = @import("../../log.zig").scoped(.mouse_event);
/// Wrapper around mouse event that tracks the allocator for C API usage.
const MouseEventWrapper = struct {

View File

@ -4,7 +4,7 @@ const CAllocator = lib.alloc.Allocator;
const osc = @import("../osc.zig");
const Result = @import("result.zig").Result;
const log = std.log.scoped(.osc);
const log = @import("../../log.zig").scoped(.osc);
/// C: GhosttyOscParser
pub const Parser = ?*osc.Parser;

View File

@ -15,7 +15,7 @@ const Result = @import("result.zig").Result;
const row = @import("row.zig");
const style_c = @import("style.zig");
const log = std.log.scoped(.render_state_c);
const log = @import("../../log.zig").scoped(.render_state_c);
const RenderStateWrapper = struct {
alloc: std.mem.Allocator,

View File

@ -10,7 +10,7 @@ const Selection = @import("../Selection.zig");
const Result = @import("result.zig").Result;
const terminal_c = @import("terminal.zig");
const log = std.log.scoped(.selection_c);
const log = @import("../../log.zig").scoped(.selection_c);
pub const Adjustment = Selection.Adjustment;
pub const Order = Selection.Order;

View File

@ -12,7 +12,7 @@ const terminal_c = @import("terminal.zig");
const types = @import("types.zig");
const Result = @import("result.zig").Result;
const log = std.log.scoped(.selection_gesture_c);
const log = @import("../../log.zig").scoped(.selection_gesture_c);
/// C: GhosttySelectionGesture
pub const Gesture = ?*GestureWrapper;

View File

@ -6,7 +6,7 @@ const CAllocator = lib.alloc.Allocator;
const sgr = @import("../sgr.zig");
const Result = @import("result.zig").Result;
const log = std.log.scoped(.sgr);
const log = @import("../../log.zig").scoped(.sgr);
/// Wrapper around parser that tracks the allocator for C API usage.
const ParserWrapper = struct {

View File

@ -27,7 +27,7 @@ const Result = @import("result.zig").Result;
const Handler = @import("../stream_terminal.zig").Handler;
const log = std.log.scoped(.terminal_c);
const log = @import("../../log.zig").scoped(.terminal_c);
/// Wrapper around ZigTerminal that tracks additional state for C API usage,
/// such as the persistent VT stream needed to handle escape sequences split

Some files were not shown because too many files have changed in this diff Show More