mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
remove old unused files
This commit is contained in:
@ -1,52 +0,0 @@
|
||||
//! App is the primary GUI application for ghostty. This builds the window,
|
||||
//! sets up the renderer, etc. The primary run loop is started by calling
|
||||
//! the "run" function.
|
||||
const App = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const glfw = @import("glfw");
|
||||
const gl = @import("opengl.zig");
|
||||
const TextRenderer = @import("TextRenderer.zig");
|
||||
const Grid = @import("Grid.zig");
|
||||
const Window = @import("Window.zig");
|
||||
|
||||
const log = std.log;
|
||||
|
||||
alloc: Allocator,
|
||||
|
||||
window: glfw.Window,
|
||||
|
||||
text: TextRenderer,
|
||||
grid: Grid,
|
||||
|
||||
/// Initialize the main app instance. This creates the main window, sets
|
||||
/// up the renderer state, compiles the shaders, etc. This is the primary
|
||||
/// "startup" logic.
|
||||
pub fn init(alloc: Allocator) !App {
|
||||
// Create the window
|
||||
const window = try Window.create(alloc);
|
||||
|
||||
return App{
|
||||
.window = window,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn deinit(self: *App) void {
|
||||
self.window.destroy();
|
||||
self.* = undefined;
|
||||
}
|
||||
|
||||
pub fn run(self: App) !void {
|
||||
while (!self.window.shouldClose()) {
|
||||
// Setup basic OpenGL settings
|
||||
gl.clearColor(0.2, 0.3, 0.3, 1.0);
|
||||
gl.clear(gl.c.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
try self.grid.render();
|
||||
//try self.text.render("sh $ /bin/bash -c \"echo hello\"", 25.0, 25.0, .{ 0.5, 0.8, 0.2 });
|
||||
|
||||
try self.window.swapBuffers();
|
||||
try glfw.waitEvents();
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
const std = @import("std");
|
||||
const fc = @cImport({
|
||||
@cInclude("fontconfig/fontconfig.h");
|
||||
});
|
||||
|
||||
// Set to true when FontConfig is initialized.
|
||||
var initialized: bool = false;
|
||||
|
||||
pub fn list() !void {
|
||||
if (!initialized) {
|
||||
if (fc.FcInit() != fc.FcTrue) {
|
||||
return error.InitializionFailed;
|
||||
}
|
||||
}
|
||||
|
||||
const pat = fc.FcPatternCreate();
|
||||
defer fc.FcPatternDestroy(pat);
|
||||
|
||||
const key = fc.FC_FULLNAME;
|
||||
const os = fc.FcObjectSetBuild(
|
||||
key,
|
||||
@as([*c]const u8, 0), // @as required Zig #1481
|
||||
);
|
||||
defer fc.FcObjectSetDestroy(os);
|
||||
|
||||
const fs = fc.FcFontList(null, pat, os);
|
||||
defer fc.FcFontSetDestroy(fs);
|
||||
|
||||
var i: usize = 0;
|
||||
while (i <= fs.*.nfont) : (i += 1) {
|
||||
const fpat = fs.*.fonts[i];
|
||||
var str: [*c]fc.FcChar8 = undefined;
|
||||
if (fc.FcPatternGetString(fpat, key, 0, &str) == fc.FcResultMatch) {
|
||||
std.log.info("FONT: {s}", .{
|
||||
@ptrCast([*:0]u8, str),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
pub const c = @import("stb/c.zig");
|
@ -1,3 +0,0 @@
|
||||
pub usingnamespace @cImport({
|
||||
@cInclude("stb_image.h");
|
||||
});
|
@ -1,2 +0,0 @@
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include <stb_image.h>
|
Reference in New Issue
Block a user