mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-28 10:01:38 +00:00
core: fixup callconv(.C) -> callconv(.c)
https://ziglang.org/download/0.14.0/release-notes.html#Calling-Convention-Enhancements-and-setAlignStack-Replaced
This commit is contained in:
@@ -43,15 +43,15 @@ pub const App = struct {
|
||||
|
||||
/// Callback called to wakeup the event loop. This should trigger
|
||||
/// a full tick of the app loop.
|
||||
wakeup: *const fn (AppUD) callconv(.C) void,
|
||||
wakeup: *const fn (AppUD) callconv(.c) void,
|
||||
|
||||
/// Callback called to handle an action.
|
||||
action: *const fn (*App, apprt.Target.C, apprt.Action.C) callconv(.C) bool,
|
||||
action: *const fn (*App, apprt.Target.C, apprt.Action.C) callconv(.c) bool,
|
||||
|
||||
/// Read the clipboard value. The return value must be preserved
|
||||
/// by the host until the next call. If there is no valid clipboard
|
||||
/// value then this should return null.
|
||||
read_clipboard: *const fn (SurfaceUD, c_int, *apprt.ClipboardRequest) callconv(.C) void,
|
||||
read_clipboard: *const fn (SurfaceUD, c_int, *apprt.ClipboardRequest) callconv(.c) void,
|
||||
|
||||
/// This may be called after a read clipboard call to request
|
||||
/// confirmation that the clipboard value is safe to read. The embedder
|
||||
@@ -61,13 +61,13 @@ pub const App = struct {
|
||||
[*:0]const u8,
|
||||
*apprt.ClipboardRequest,
|
||||
apprt.ClipboardRequestType,
|
||||
) callconv(.C) void,
|
||||
) callconv(.c) void,
|
||||
|
||||
/// Write the clipboard value.
|
||||
write_clipboard: *const fn (SurfaceUD, [*:0]const u8, c_int, bool) callconv(.C) void,
|
||||
write_clipboard: *const fn (SurfaceUD, [*:0]const u8, c_int, bool) callconv(.c) void,
|
||||
|
||||
/// Close the current surface given by this function.
|
||||
close_surface: ?*const fn (SurfaceUD, bool) callconv(.C) void = null,
|
||||
close_surface: ?*const fn (SurfaceUD, bool) callconv(.c) void = null,
|
||||
};
|
||||
|
||||
/// This is the key event sent for ghostty_surface_key and
|
||||
|
||||
@@ -1527,7 +1527,7 @@ fn adwNotifyDark(
|
||||
style_manager: *adw.StyleManager,
|
||||
_: *gobject.ParamSpec,
|
||||
self: *App,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const color_scheme: apprt.ColorScheme = if (style_manager.getDark() == 0)
|
||||
.light
|
||||
else
|
||||
|
||||
@@ -152,7 +152,7 @@ fn init(
|
||||
}
|
||||
}
|
||||
|
||||
fn gtkResponse(_: *DialogType, response: [*:0]u8, self: *ClipboardConfirmation) callconv(.C) void {
|
||||
fn gtkResponse(_: *DialogType, response: [*:0]u8, self: *ClipboardConfirmation) callconv(.c) void {
|
||||
if (std.mem.orderZ(u8, response, "ok") == .eq) {
|
||||
self.core_surface.completeClipboardRequest(
|
||||
self.pending_req,
|
||||
@@ -165,7 +165,7 @@ fn gtkResponse(_: *DialogType, response: [*:0]u8, self: *ClipboardConfirmation)
|
||||
self.destroy();
|
||||
}
|
||||
|
||||
fn gtkRevealButtonClicked(_: *gtk.Button, self: *ClipboardConfirmation) callconv(.C) void {
|
||||
fn gtkRevealButtonClicked(_: *gtk.Button, self: *ClipboardConfirmation) callconv(.c) void {
|
||||
self.text_view_scroll.as(gtk.Widget).setSensitive(@intFromBool(true));
|
||||
self.text_view.as(gtk.Widget).removeCssClass("blurred");
|
||||
|
||||
@@ -173,7 +173,7 @@ fn gtkRevealButtonClicked(_: *gtk.Button, self: *ClipboardConfirmation) callconv
|
||||
self.reveal_button.as(gtk.Widget).setVisible(@intFromBool(false));
|
||||
}
|
||||
|
||||
fn gtkHideButtonClicked(_: *gtk.Button, self: *ClipboardConfirmation) callconv(.C) void {
|
||||
fn gtkHideButtonClicked(_: *gtk.Button, self: *ClipboardConfirmation) callconv(.c) void {
|
||||
self.text_view_scroll.as(gtk.Widget).setSensitive(@intFromBool(false));
|
||||
self.text_view.as(gtk.Widget).addCssClass("blurred");
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ fn responseCallback(
|
||||
_: *DialogType,
|
||||
response: [*:0]const u8,
|
||||
target: *Target,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const alloc = target.allocator();
|
||||
defer alloc.destroy(target);
|
||||
|
||||
@@ -141,7 +141,7 @@ pub const Target = union(enum) {
|
||||
}
|
||||
};
|
||||
|
||||
fn findActiveWindow(data: ?*const anyopaque, _: ?*const anyopaque) callconv(.C) c_int {
|
||||
fn findActiveWindow(data: ?*const anyopaque, _: ?*const anyopaque) callconv(.c) c_int {
|
||||
const window: *gtk.Window = @ptrCast(@alignCast(@constCast(data orelse return -1)));
|
||||
|
||||
// Confusingly, `isActive` returns 1 when active,
|
||||
|
||||
@@ -67,7 +67,7 @@ pub fn maybePresent(app: *App, window: ?*Window) void {
|
||||
}
|
||||
}
|
||||
|
||||
fn onResponse(_: *DialogType, response: [*:0]const u8, app: *App) callconv(.C) void {
|
||||
fn onResponse(_: *DialogType, response: [*:0]const u8, app: *App) callconv(.c) void {
|
||||
if (std.mem.orderZ(u8, response, "reload") == .eq) {
|
||||
app.reloadConfig(.app, .{}) catch |err| {
|
||||
log.warn("error reloading config error={}", .{err});
|
||||
|
||||
@@ -221,12 +221,12 @@ fn translateMouseButton(button: c_uint) ?c_int {
|
||||
};
|
||||
}
|
||||
|
||||
fn gtkDestroy(_: *gtk.GLArea, self: *ImguiWidget) callconv(.C) void {
|
||||
fn gtkDestroy(_: *gtk.GLArea, self: *ImguiWidget) callconv(.c) void {
|
||||
log.debug("imgui widget destroy", .{});
|
||||
self.deinit();
|
||||
}
|
||||
|
||||
fn gtkRealize(area: *gtk.GLArea, self: *ImguiWidget) callconv(.C) void {
|
||||
fn gtkRealize(area: *gtk.GLArea, self: *ImguiWidget) callconv(.c) void {
|
||||
log.debug("gl surface realized", .{});
|
||||
|
||||
// We need to make the context current so we can call GL functions.
|
||||
@@ -242,7 +242,7 @@ fn gtkRealize(area: *gtk.GLArea, self: *ImguiWidget) callconv(.C) void {
|
||||
_ = cimgui.ImGui_ImplOpenGL3_Init(null);
|
||||
}
|
||||
|
||||
fn gtkUnrealize(area: *gtk.GLArea, self: *ImguiWidget) callconv(.C) void {
|
||||
fn gtkUnrealize(area: *gtk.GLArea, self: *ImguiWidget) callconv(.c) void {
|
||||
_ = area;
|
||||
log.debug("gl surface unrealized", .{});
|
||||
|
||||
@@ -250,7 +250,7 @@ fn gtkUnrealize(area: *gtk.GLArea, self: *ImguiWidget) callconv(.C) void {
|
||||
cimgui.ImGui_ImplOpenGL3_Shutdown();
|
||||
}
|
||||
|
||||
fn gtkResize(area: *gtk.GLArea, width: c_int, height: c_int, self: *ImguiWidget) callconv(.C) void {
|
||||
fn gtkResize(area: *gtk.GLArea, width: c_int, height: c_int, self: *ImguiWidget) callconv(.c) void {
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO();
|
||||
const scale_factor = area.as(gtk.Widget).getScaleFactor();
|
||||
@@ -273,7 +273,7 @@ fn gtkResize(area: *gtk.GLArea, width: c_int, height: c_int, self: *ImguiWidget)
|
||||
active_style.* = style.*;
|
||||
}
|
||||
|
||||
fn gtkRender(_: *gtk.GLArea, _: *gdk.GLContext, self: *ImguiWidget) callconv(.C) c_int {
|
||||
fn gtkRender(_: *gtk.GLArea, _: *gdk.GLContext, self: *ImguiWidget) callconv(.c) c_int {
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
|
||||
// Setup our frame. We render twice because some ImGui behaviors
|
||||
@@ -307,7 +307,7 @@ fn gtkMouseMotion(
|
||||
x: f64,
|
||||
y: f64,
|
||||
self: *ImguiWidget,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
const io: *cimgui.c.ImGuiIO = cimgui.c.igGetIO();
|
||||
const scale_factor: f64 = @floatFromInt(self.gl_area.as(gtk.Widget).getScaleFactor());
|
||||
@@ -325,7 +325,7 @@ fn gtkMouseDown(
|
||||
_: f64,
|
||||
_: f64,
|
||||
self: *ImguiWidget,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.queueRender();
|
||||
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
@@ -343,7 +343,7 @@ fn gtkMouseUp(
|
||||
_: f64,
|
||||
_: f64,
|
||||
self: *ImguiWidget,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.queueRender();
|
||||
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
@@ -359,7 +359,7 @@ fn gtkMouseScroll(
|
||||
x: f64,
|
||||
y: f64,
|
||||
self: *ImguiWidget,
|
||||
) callconv(.C) c_int {
|
||||
) callconv(.c) c_int {
|
||||
self.queueRender();
|
||||
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
@@ -373,7 +373,7 @@ fn gtkMouseScroll(
|
||||
return @intFromBool(true);
|
||||
}
|
||||
|
||||
fn gtkFocusEnter(_: *gtk.EventControllerFocus, self: *ImguiWidget) callconv(.C) void {
|
||||
fn gtkFocusEnter(_: *gtk.EventControllerFocus, self: *ImguiWidget) callconv(.c) void {
|
||||
self.queueRender();
|
||||
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
@@ -381,7 +381,7 @@ fn gtkFocusEnter(_: *gtk.EventControllerFocus, self: *ImguiWidget) callconv(.C)
|
||||
cimgui.c.ImGuiIO_AddFocusEvent(io, true);
|
||||
}
|
||||
|
||||
fn gtkFocusLeave(_: *gtk.EventControllerFocus, self: *ImguiWidget) callconv(.C) void {
|
||||
fn gtkFocusLeave(_: *gtk.EventControllerFocus, self: *ImguiWidget) callconv(.c) void {
|
||||
self.queueRender();
|
||||
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
@@ -393,7 +393,7 @@ fn gtkInputCommit(
|
||||
_: *gtk.IMMulticontext,
|
||||
bytes: [*:0]u8,
|
||||
self: *ImguiWidget,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.queueRender();
|
||||
|
||||
cimgui.c.igSetCurrentContext(self.ig_ctx);
|
||||
@@ -407,7 +407,7 @@ fn gtkKeyPressed(
|
||||
keycode: c_uint,
|
||||
gtk_mods: gdk.ModifierType,
|
||||
self: *ImguiWidget,
|
||||
) callconv(.C) c_int {
|
||||
) callconv(.c) c_int {
|
||||
return @intFromBool(self.keyEvent(
|
||||
.press,
|
||||
ec_key,
|
||||
@@ -423,7 +423,7 @@ fn gtkKeyReleased(
|
||||
keycode: c_uint,
|
||||
gtk_mods: gdk.ModifierType,
|
||||
self: *ImguiWidget,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
_ = self.keyEvent(
|
||||
.release,
|
||||
ec_key,
|
||||
|
||||
@@ -104,7 +104,7 @@ pub fn maybeShow(self: *ResizeOverlay) void {
|
||||
|
||||
/// Actually update the overlay widget. This should only be called from a GTK
|
||||
/// idle handler.
|
||||
fn gtkUpdate(ud: ?*anyopaque) callconv(.C) c_int {
|
||||
fn gtkUpdate(ud: ?*anyopaque) callconv(.c) c_int {
|
||||
const self: *ResizeOverlay = @ptrCast(@alignCast(ud orelse return 0));
|
||||
|
||||
// No matter what our idler is complete with this callback
|
||||
@@ -198,7 +198,7 @@ fn setPosition(label: *gtk.Label, config: *DerivedConfig) void {
|
||||
|
||||
/// If this fires, it means that the delay period has expired and the resize
|
||||
/// overlay widget should be hidden.
|
||||
fn gtkTimerExpired(ud: ?*anyopaque) callconv(.C) c_int {
|
||||
fn gtkTimerExpired(ud: ?*anyopaque) callconv(.c) c_int {
|
||||
const self: *ResizeOverlay = @ptrCast(@alignCast(ud orelse return 0));
|
||||
self.timer = null;
|
||||
if (self.label) |label| hide(label);
|
||||
|
||||
@@ -1025,7 +1025,7 @@ pub fn setTitle(self: *Surface, slice: [:0]const u8, source: SetTitleSource) !vo
|
||||
self.update_title_timer = glib.timeoutAdd(75, updateTitleTimerExpired, self);
|
||||
}
|
||||
|
||||
fn updateTitleTimerExpired(ud: ?*anyopaque) callconv(.C) c_int {
|
||||
fn updateTitleTimerExpired(ud: ?*anyopaque) callconv(.c) c_int {
|
||||
const self: *Surface = @ptrCast(@alignCast(ud.?));
|
||||
|
||||
self.updateTitleLabels();
|
||||
@@ -1265,7 +1265,7 @@ fn gtkClipboardRead(
|
||||
source: ?*gobject.Object,
|
||||
res: *gio.AsyncResult,
|
||||
ud: ?*anyopaque,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const clipboard = gobject.ext.cast(gdk.Clipboard, source orelse return) orelse return;
|
||||
const req: *ClipboardRequest = @ptrCast(@alignCast(ud orelse return));
|
||||
const self = req.self;
|
||||
@@ -1349,7 +1349,7 @@ pub fn showDesktopNotification(
|
||||
app.sendNotification(body.ptr, notification);
|
||||
}
|
||||
|
||||
fn gtkRealize(gl_area: *gtk.GLArea, self: *Surface) callconv(.C) void {
|
||||
fn gtkRealize(gl_area: *gtk.GLArea, self: *Surface) callconv(.c) void {
|
||||
log.debug("gl surface realized", .{});
|
||||
|
||||
// We need to make the context current so we can call GL functions.
|
||||
@@ -1377,7 +1377,7 @@ fn gtkRealize(gl_area: *gtk.GLArea, self: *Surface) callconv(.C) void {
|
||||
|
||||
/// This is called when the underlying OpenGL resources must be released.
|
||||
/// This is usually due to the OpenGL area changing GDK surfaces.
|
||||
fn gtkUnrealize(gl_area: *gtk.GLArea, self: *Surface) callconv(.C) void {
|
||||
fn gtkUnrealize(gl_area: *gtk.GLArea, self: *Surface) callconv(.c) void {
|
||||
log.debug("gl surface unrealized", .{});
|
||||
|
||||
// See gtkRealize for why we do this here.
|
||||
@@ -1405,7 +1405,7 @@ fn gtkUnrealize(gl_area: *gtk.GLArea, self: *Surface) callconv(.C) void {
|
||||
}
|
||||
|
||||
/// render signal
|
||||
fn gtkRender(_: *gtk.GLArea, _: *gdk.GLContext, self: *Surface) callconv(.C) c_int {
|
||||
fn gtkRender(_: *gtk.GLArea, _: *gdk.GLContext, self: *Surface) callconv(.c) c_int {
|
||||
self.render() catch |err| {
|
||||
log.err("surface failed to render: {}", .{err});
|
||||
return 0;
|
||||
@@ -1415,7 +1415,7 @@ fn gtkRender(_: *gtk.GLArea, _: *gdk.GLContext, self: *Surface) callconv(.C) c_i
|
||||
}
|
||||
|
||||
/// resize signal
|
||||
fn gtkResize(gl_area: *gtk.GLArea, width: c_int, height: c_int, self: *Surface) callconv(.C) void {
|
||||
fn gtkResize(gl_area: *gtk.GLArea, width: c_int, height: c_int, self: *Surface) callconv(.c) void {
|
||||
// Some debug output to help understand what GTK is telling us.
|
||||
{
|
||||
const scale_factor = scale: {
|
||||
@@ -1471,7 +1471,7 @@ fn gtkResize(gl_area: *gtk.GLArea, width: c_int, height: c_int, self: *Surface)
|
||||
}
|
||||
|
||||
/// "destroy" signal for surface
|
||||
fn gtkDestroy(_: *gtk.GLArea, self: *Surface) callconv(.C) void {
|
||||
fn gtkDestroy(_: *gtk.GLArea, self: *Surface) callconv(.c) void {
|
||||
log.debug("gl destroy", .{});
|
||||
|
||||
const alloc = self.app.core_app.alloc;
|
||||
@@ -1505,7 +1505,7 @@ fn gtkMouseDown(
|
||||
x: f64,
|
||||
y: f64,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const event = gesture.as(gtk.EventController).getCurrentEvent() orelse return;
|
||||
|
||||
const gtk_mods = event.getModifierState();
|
||||
@@ -1538,7 +1538,7 @@ fn gtkMouseUp(
|
||||
_: f64,
|
||||
_: f64,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const event = gesture.as(gtk.EventController).getCurrentEvent() orelse return;
|
||||
|
||||
const gtk_mods = event.getModifierState();
|
||||
@@ -1557,7 +1557,7 @@ fn gtkMouseMotion(
|
||||
x: f64,
|
||||
y: f64,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const event = ec.as(gtk.EventController).getCurrentEvent() orelse return;
|
||||
|
||||
const scaled = self.scaledCoordinates(x, y);
|
||||
@@ -1603,7 +1603,7 @@ fn gtkMouseMotion(
|
||||
fn gtkMouseLeave(
|
||||
ec_motion: *gtk.EventControllerMotion,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const event = ec_motion.as(gtk.EventController).getCurrentEvent() orelse return;
|
||||
|
||||
// Get our modifiers
|
||||
@@ -1618,14 +1618,14 @@ fn gtkMouseLeave(
|
||||
fn gtkMouseScrollPrecisionBegin(
|
||||
_: *gtk.EventControllerScroll,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.precision_scroll = true;
|
||||
}
|
||||
|
||||
fn gtkMouseScrollPrecisionEnd(
|
||||
_: *gtk.EventControllerScroll,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.precision_scroll = false;
|
||||
}
|
||||
|
||||
@@ -1634,7 +1634,7 @@ fn gtkMouseScroll(
|
||||
x: f64,
|
||||
y: f64,
|
||||
self: *Surface,
|
||||
) callconv(.C) c_int {
|
||||
) callconv(.c) c_int {
|
||||
const scaled = self.scaledCoordinates(x, y);
|
||||
|
||||
// GTK doesn't support any of the scroll mods.
|
||||
@@ -1664,7 +1664,7 @@ fn gtkKeyPressed(
|
||||
keycode: c_uint,
|
||||
gtk_mods: gdk.ModifierType,
|
||||
self: *Surface,
|
||||
) callconv(.C) c_int {
|
||||
) callconv(.c) c_int {
|
||||
return @intFromBool(self.keyEvent(
|
||||
.press,
|
||||
ec_key,
|
||||
@@ -1680,7 +1680,7 @@ fn gtkKeyReleased(
|
||||
keycode: c_uint,
|
||||
state: gdk.ModifierType,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
_ = self.keyEvent(
|
||||
.release,
|
||||
ec_key,
|
||||
@@ -1971,7 +1971,7 @@ pub fn keyEvent(
|
||||
fn gtkInputPreeditStart(
|
||||
_: *gtk.IMMulticontext,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
// log.warn("GTKIM: preedit start", .{});
|
||||
|
||||
// Start our composing state for the input method and reset our
|
||||
@@ -1983,7 +1983,7 @@ fn gtkInputPreeditStart(
|
||||
fn gtkInputPreeditChanged(
|
||||
ctx: *gtk.IMMulticontext,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
// Any preedit change should mark that we're composing. Its possible this
|
||||
// is false using fcitx5-hangul and typing "dkssud<space>" ("안녕"). The
|
||||
// second "s" results in a "commit" for "안" which sets composing to false,
|
||||
@@ -2009,7 +2009,7 @@ fn gtkInputPreeditChanged(
|
||||
fn gtkInputPreeditEnd(
|
||||
_: *gtk.IMMulticontext,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
// log.warn("GTKIM: preedit end", .{});
|
||||
|
||||
// End our composing state for GTK, allowing us to commit the text.
|
||||
@@ -2025,7 +2025,7 @@ fn gtkInputCommit(
|
||||
_: *gtk.IMMulticontext,
|
||||
bytes: [*:0]u8,
|
||||
self: *Surface,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const str = std.mem.sliceTo(bytes, 0);
|
||||
|
||||
// log.debug("GTKIM: input commit composing={} keyevent={} str={s}", .{
|
||||
@@ -2100,7 +2100,7 @@ fn gtkInputCommit(
|
||||
};
|
||||
}
|
||||
|
||||
fn gtkFocusEnter(_: *gtk.EventControllerFocus, self: *Surface) callconv(.C) void {
|
||||
fn gtkFocusEnter(_: *gtk.EventControllerFocus, self: *Surface) callconv(.c) void {
|
||||
if (!self.realized) return;
|
||||
|
||||
// Notify our IM context
|
||||
@@ -2125,7 +2125,7 @@ fn gtkFocusEnter(_: *gtk.EventControllerFocus, self: *Surface) callconv(.C) void
|
||||
};
|
||||
}
|
||||
|
||||
fn gtkFocusLeave(_: *gtk.EventControllerFocus, self: *Surface) callconv(.C) void {
|
||||
fn gtkFocusLeave(_: *gtk.EventControllerFocus, self: *Surface) callconv(.c) void {
|
||||
if (!self.realized) return;
|
||||
|
||||
// Notify our IM context
|
||||
@@ -2243,7 +2243,7 @@ fn gtkDrop(
|
||||
_: f64,
|
||||
_: f64,
|
||||
self: *Surface,
|
||||
) callconv(.C) c_int {
|
||||
) callconv(.c) c_int {
|
||||
const alloc = self.app.core_app.alloc;
|
||||
|
||||
if (g_value_holds(value, gdk.FileList.getGObjectType())) {
|
||||
@@ -2395,7 +2395,7 @@ fn g_value_holds(value_: ?*gobject.Value, g_type: gobject.Type) bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn gtkPromptTitleResponse(source_object: ?*gobject.Object, result: *gio.AsyncResult, ud: ?*anyopaque) callconv(.C) void {
|
||||
fn gtkPromptTitleResponse(source_object: ?*gobject.Object, result: *gio.AsyncResult, ud: ?*anyopaque) callconv(.c) void {
|
||||
if (!adw_version.supportsDialogs()) return;
|
||||
const dialog = gobject.ext.cast(adw.AlertDialog, source_object.?).?;
|
||||
const self: *Surface = @ptrCast(@alignCast(ud));
|
||||
|
||||
@@ -161,7 +161,7 @@ pub fn closeWithConfirmation(tab: *Tab) void {
|
||||
}
|
||||
}
|
||||
|
||||
fn gtkDestroy(_: *gtk.Box, self: *Tab) callconv(.C) void {
|
||||
fn gtkDestroy(_: *gtk.Box, self: *Tab) callconv(.c) void {
|
||||
log.debug("tab box destroy", .{});
|
||||
|
||||
const alloc = self.window.app.core_app.alloc;
|
||||
|
||||
@@ -227,7 +227,7 @@ pub fn createWindow(window: *Window) !*Window {
|
||||
return new_window;
|
||||
}
|
||||
|
||||
fn adwPageAttached(_: *adw.TabView, page: *adw.TabPage, _: c_int, self: *TabView) callconv(.C) void {
|
||||
fn adwPageAttached(_: *adw.TabView, page: *adw.TabPage, _: c_int, self: *TabView) callconv(.c) void {
|
||||
const child = page.getChild().as(gobject.Object);
|
||||
const tab: *Tab = @ptrCast(@alignCast(child.getData(Tab.GHOSTTY_TAB) orelse return));
|
||||
tab.window = self.window;
|
||||
@@ -239,7 +239,7 @@ fn adwClosePage(
|
||||
_: *adw.TabView,
|
||||
page: *adw.TabPage,
|
||||
self: *TabView,
|
||||
) callconv(.C) c_int {
|
||||
) callconv(.c) c_int {
|
||||
const child = page.getChild().as(gobject.Object);
|
||||
const tab: *Tab = @ptrCast(@alignCast(child.getData(Tab.GHOSTTY_TAB) orelse return 0));
|
||||
self.tab_view.closePageFinish(page, @intFromBool(self.forcing_close));
|
||||
@@ -251,7 +251,7 @@ fn adwClosePage(
|
||||
fn adwTabViewCreateWindow(
|
||||
_: *adw.TabView,
|
||||
self: *TabView,
|
||||
) callconv(.C) ?*adw.TabView {
|
||||
) callconv(.c) ?*adw.TabView {
|
||||
const window = createWindow(self.window) catch |err| {
|
||||
log.warn("error creating new window error={}", .{err});
|
||||
return null;
|
||||
@@ -259,7 +259,7 @@ fn adwTabViewCreateWindow(
|
||||
return window.notebook.tab_view;
|
||||
}
|
||||
|
||||
fn adwSelectPage(_: *adw.TabView, _: *gobject.ParamSpec, self: *TabView) callconv(.C) void {
|
||||
fn adwSelectPage(_: *adw.TabView, _: *gobject.ParamSpec, self: *TabView) callconv(.c) void {
|
||||
const page = self.tab_view.getSelectedPage() orelse return;
|
||||
|
||||
// If the tab was previously marked as needing attention
|
||||
|
||||
@@ -101,7 +101,7 @@ fn gtkLeftEnter(
|
||||
_: f64,
|
||||
_: f64,
|
||||
right: *gtk.Label,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
right.as(gtk.Widget).removeCssClass("hidden");
|
||||
}
|
||||
|
||||
@@ -110,6 +110,6 @@ fn gtkLeftEnter(
|
||||
fn gtkLeftLeave(
|
||||
_: *gtk.EventControllerMotion,
|
||||
right: *gtk.Label,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
right.as(gtk.Widget).addCssClass("hidden");
|
||||
}
|
||||
|
||||
@@ -792,7 +792,7 @@ fn gtkWindowNotifyIsActive(
|
||||
_: *adw.ApplicationWindow,
|
||||
_: *gobject.ParamSpec,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
if (!self.isQuickTerminal()) return;
|
||||
|
||||
// Hide when we're unfocused
|
||||
@@ -883,7 +883,7 @@ fn adwTabOverviewOpen(
|
||||
|
||||
fn adwTabOverviewFocusTimer(
|
||||
ud: ?*anyopaque,
|
||||
) callconv(.C) c_int {
|
||||
) callconv(.c) c_int {
|
||||
if (!adw_version.supportsTabOverview()) unreachable;
|
||||
const self: *Window = @ptrCast(@alignCast(ud orelse return 0));
|
||||
self.adw_tab_overview_focus_timer = null;
|
||||
@@ -970,7 +970,7 @@ fn gtkActionAbout(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const name = "Ghostty";
|
||||
const icon = "com.mitchellh.ghostty";
|
||||
const website = "https://ghostty.org";
|
||||
@@ -1014,7 +1014,7 @@ fn gtkActionClose(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.closeWithConfirmation();
|
||||
}
|
||||
|
||||
@@ -1022,7 +1022,7 @@ fn gtkActionNewWindow(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .new_window = {} });
|
||||
}
|
||||
|
||||
@@ -1030,7 +1030,7 @@ fn gtkActionNewTab(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .new_tab = {} });
|
||||
}
|
||||
|
||||
@@ -1038,7 +1038,7 @@ fn gtkActionCloseTab(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .close_tab = {} });
|
||||
}
|
||||
|
||||
@@ -1046,7 +1046,7 @@ fn gtkActionSplitRight(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .new_split = .right });
|
||||
}
|
||||
|
||||
@@ -1054,7 +1054,7 @@ fn gtkActionSplitDown(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .new_split = .down });
|
||||
}
|
||||
|
||||
@@ -1062,7 +1062,7 @@ fn gtkActionSplitLeft(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .new_split = .left });
|
||||
}
|
||||
|
||||
@@ -1070,7 +1070,7 @@ fn gtkActionSplitUp(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .new_split = .up });
|
||||
}
|
||||
|
||||
@@ -1078,7 +1078,7 @@ fn gtkActionToggleInspector(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .inspector = .toggle });
|
||||
}
|
||||
|
||||
@@ -1086,7 +1086,7 @@ fn gtkActionCopy(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .copy_to_clipboard = {} });
|
||||
}
|
||||
|
||||
@@ -1094,7 +1094,7 @@ fn gtkActionPaste(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .paste_from_clipboard = {} });
|
||||
}
|
||||
|
||||
@@ -1102,7 +1102,7 @@ fn gtkActionReset(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .reset = {} });
|
||||
}
|
||||
|
||||
@@ -1110,7 +1110,7 @@ fn gtkActionClear(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .clear_screen = {} });
|
||||
}
|
||||
|
||||
@@ -1118,7 +1118,7 @@ fn gtkActionPromptTitle(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
self.performBindingAction(.{ .prompt_surface_title = {} });
|
||||
}
|
||||
|
||||
@@ -1133,7 +1133,7 @@ fn gtkTitlebarMenuActivate(
|
||||
btn: *gtk.MenuButton,
|
||||
_: *gobject.ParamSpec,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
// debian 12 is stuck on GTK 4.8
|
||||
if (!gtk_version.atLeast(4, 10, 0)) return;
|
||||
const active = btn.getActive() != 0;
|
||||
|
||||
@@ -177,7 +177,7 @@ const Window = struct {
|
||||
}
|
||||
|
||||
/// "destroy" signal for the window
|
||||
fn gtkDestroy(_: *gtk.ApplicationWindow, self: *Window) callconv(.C) void {
|
||||
fn gtkDestroy(_: *gtk.ApplicationWindow, self: *Window) callconv(.c) void {
|
||||
log.debug("window destroy", .{});
|
||||
self.deinit();
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ pub fn Menu(
|
||||
}
|
||||
|
||||
/// Refocus tab that lost focus because of the popover menu
|
||||
fn gtkRefocusTerm(_: *gtk.PopoverMenu, self: *Self) callconv(.C) void {
|
||||
fn gtkRefocusTerm(_: *gtk.PopoverMenu, self: *Self) callconv(.c) void {
|
||||
const window: *Window = switch (T) {
|
||||
Window => self.parent,
|
||||
Surface => self.parent.container.window() orelse return,
|
||||
|
||||
@@ -410,7 +410,7 @@ pub const Window = struct {
|
||||
_: *gdk.Surface,
|
||||
monitor: *gdk.Monitor,
|
||||
apprt_window: *ApprtWindow,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const window = apprt_window.window.as(gtk.Window);
|
||||
const size = apprt_window.config.quick_terminal_size;
|
||||
const position = apprt_window.config.quick_terminal_position;
|
||||
|
||||
@@ -166,7 +166,7 @@ fn beforeSend(
|
||||
event_val: sentry.c.sentry_value_t,
|
||||
_: ?*anyopaque,
|
||||
_: ?*anyopaque,
|
||||
) callconv(.C) sentry.c.sentry_value_t {
|
||||
) callconv(.c) sentry.c.sentry_value_t {
|
||||
// The native SDK at the time of writing doesn't support thread-local
|
||||
// scopes. The full SDK has one global scope. So we use the beforeSend
|
||||
// handler to set thread-specific data such as window size, grid size,
|
||||
@@ -237,7 +237,7 @@ fn beforeSend(
|
||||
}
|
||||
|
||||
pub const Transport = struct {
|
||||
pub fn send(envelope: *sentry.Envelope, ud: ?*anyopaque) callconv(.C) void {
|
||||
pub fn send(envelope: *sentry.Envelope, ud: ?*anyopaque) callconv(.c) void {
|
||||
_ = ud;
|
||||
defer envelope.deinit();
|
||||
|
||||
|
||||
@@ -444,7 +444,7 @@ pub const FlatpakHostCommand = struct {
|
||||
_: [*c]const u8,
|
||||
params: ?*c.GVariant,
|
||||
ud: ?*anyopaque,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const self = @as(*FlatpakHostCommand, @ptrCast(@alignCast(ud)));
|
||||
const state = state: {
|
||||
self.state_mutex.lock();
|
||||
|
||||
@@ -1524,7 +1524,7 @@ const CompletionBlock = objc.Block(struct { self: *Metal }, .{
|
||||
fn bufferCompleted(
|
||||
block: *const CompletionBlock.Context,
|
||||
buffer_id: objc.c.id,
|
||||
) callconv(.C) void {
|
||||
) callconv(.c) void {
|
||||
const self = block.self;
|
||||
const buffer = objc.Object.fromId(buffer_id);
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ fn spvCross(
|
||||
// It would be better to get this out into an output parameter to
|
||||
// show users but for now we can just log it.
|
||||
c.spvc_context_set_error_callback(ctx, @ptrCast(&(struct {
|
||||
fn callback(_: ?*anyopaque, msg_ptr: [*c]const u8) callconv(.C) void {
|
||||
fn callback(_: ?*anyopaque, msg_ptr: [*c]const u8) callconv(.c) void {
|
||||
const msg = std.mem.sliceTo(msg_ptr, 0);
|
||||
std.log.warn("spirv-cross error message={s}", .{msg});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user