Add C API function to handle new surfaces of different types

This commit is contained in:
Peter Guy
2025-10-11 22:14:00 -07:00
parent 7cf4c8dc53
commit dba0ff5339
3 changed files with 24 additions and 5 deletions

View File

@@ -1551,8 +1551,24 @@ pub const CAPI = struct {
}
/// Returns the config to use for surfaces that inherit from this one.
/// Deprecated: Use ghostty_surface_inherited_config_window/tab/split instead.
export fn ghostty_surface_inherited_config(surface: *Surface) Surface.Options {
return surface.newSurfaceOptions();
return surface.newSurfaceOptions(.window);
}
/// Returns the config to use for new windows that inherit from this surface.
export fn ghostty_surface_inherited_config_window(surface: *Surface) Surface.Options {
return surface.newSurfaceOptions(.window);
}
/// Returns the config to use for new tabs that inherit from this surface.
export fn ghostty_surface_inherited_config_tab(surface: *Surface) Surface.Options {
return surface.newSurfaceOptions(.tab);
}
/// Returns the config to use for new splits that inherit from this surface.
export fn ghostty_surface_inherited_config_split(surface: *Surface) Surface.Options {
return surface.newSurfaceOptions(.split);
}
/// Update the configuration to the provided config for only this surface.