macos: hook up clipboards

This commit is contained in:
Mitchell Hashimoto
2023-02-19 15:18:01 -08:00
parent 8889dd7de2
commit dff45003e1
5 changed files with 73 additions and 13 deletions

View File

@@ -368,6 +368,11 @@ pub const CAPI = struct {
};
}
/// Return the userdata associated with the app.
export fn ghostty_app_userdata(v: *App) ?*anyopaque {
return v.runtime.opts.userdata;
}
export fn ghostty_app_free(ptr: ?*App) void {
if (ptr) |v| {
v.destroy();
@@ -400,6 +405,11 @@ pub const CAPI = struct {
if (ptr) |v| v.app.closeWindow(v);
}
/// Returns the app associated with a surface.
export fn ghostty_surface_app(win: *Window) *App {
return win.app;
}
/// Tell the surface that it needs to schedule a render
export fn ghostty_surface_refresh(win: *Window) void {
win.window.refresh();