Skip to content

Commit

Permalink
Fix signal rtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
frmdstryr committed May 22, 2024
1 parent 0a76962 commit df31c08
Show file tree
Hide file tree
Showing 124 changed files with 414 additions and 413 deletions.
3 changes: 2 additions & 1 deletion gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,12 +815,13 @@ def generate_class(ns: str, Cls: type):
signal_args.append(f"{name}: {t}")
args = ["self: *Self"] + signal_args + ["data: ?*T"]
fn_name = camel_case("connect-" + signal.get_name(), "-")
rtype = func_return_type(signal, imports)
out.append(" pub inline fn %s(" % fn_name)
out.append(" self: *Self,")
out.append(" comptime T: type,")
out.append(
" callback: %s,"
% f"*const fn ({', '.join(args)}) callconv(.C) void"
% f"*const fn ({', '.join(args)}) callconv(.C) {rtype}"
)
out.append(" data: ?*T,")
out.append(" flags: gobject.ConnectFlags")
Expand Down
4 changes: 2 additions & 2 deletions src/gdk/surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub const Surface = extern struct {
pub inline fn connectEvent(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, event: *gdk.Event, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, event: *gdk.Event, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -259,7 +259,7 @@ pub const Surface = extern struct {
pub inline fn connectRender(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, region: *cairo.Region, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, region: *cairo.Region, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
6 changes: 3 additions & 3 deletions src/gio/application.zig
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pub const Application = extern struct {
pub inline fn connectCommandLine(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, command_line: *gio.ApplicationCommandLine, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, command_line: *gio.ApplicationCommandLine, data: ?*T) callconv(.C) i32,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -250,7 +250,7 @@ pub const Application = extern struct {
pub inline fn connectHandleLocalOptions(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, options: *glib.VariantDict, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, options: *glib.VariantDict, data: ?*T) callconv(.C) i32,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -270,7 +270,7 @@ pub const Application = extern struct {
pub inline fn connectNameLost(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
4 changes: 2 additions & 2 deletions src/gio/d_bus_auth_observer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub const DBusAuthObserver = extern struct {
pub inline fn connectAllowMechanism(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, mechanism: [*c]const u8, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, mechanism: [*c]const u8, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -129,7 +129,7 @@ pub const DBusAuthObserver = extern struct {
pub inline fn connectAuthorizeAuthenticatedPeer(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, stream: *gio.IOStream, credentials: *gio.Credentials, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, stream: *gio.IOStream, credentials: *gio.Credentials, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
2 changes: 1 addition & 1 deletion src/gio/d_bus_interface_skeleton.zig
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub const DBusInterfaceSkeleton = extern struct {
pub inline fn connectGAuthorizeMethod(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, invocation: *gio.DBusMethodInvocation, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, invocation: *gio.DBusMethodInvocation, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
2 changes: 1 addition & 1 deletion src/gio/d_bus_object_skeleton.zig
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub const DBusObjectSkeleton = extern struct {
pub inline fn connectAuthorizeMethod(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, interface: *gio.DBusInterfaceSkeleton, invocation: *gio.DBusMethodInvocation, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, interface: *gio.DBusInterfaceSkeleton, invocation: *gio.DBusMethodInvocation, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
2 changes: 1 addition & 1 deletion src/gio/d_bus_server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub const DBusServer = extern struct {
pub inline fn connectNewConnection(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, connection: *gio.DBusConnection, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, connection: *gio.DBusConnection, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
2 changes: 1 addition & 1 deletion src/gio/debug_controller_d_bus.zig
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub const DebugControllerDBus = extern struct {
pub inline fn connectAuthorize(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, invocation: *gio.DBusMethodInvocation, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, invocation: *gio.DBusMethodInvocation, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
2 changes: 1 addition & 1 deletion src/gio/dtls_connection.zig
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub const DtlsConnection = extern struct {
pub inline fn connectAcceptCertificate(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, peer_cert: *gio.TlsCertificate, errors: gio.TlsCertificateFlags, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, peer_cert: *gio.TlsCertificate, errors: gio.TlsCertificateFlags, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
4 changes: 2 additions & 2 deletions src/gio/settings.zig
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pub const Settings = extern struct {
pub inline fn connectChangeEvent(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, keys: [*c]u32, n_keys: i32, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, keys: [*c]u32, n_keys: i32, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -283,7 +283,7 @@ pub const Settings = extern struct {
pub inline fn connectWritableChangeEvent(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, key: u32, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, key: u32, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
2 changes: 1 addition & 1 deletion src/gio/socket_service.zig
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub const SocketService = extern struct {
pub inline fn connectIncoming(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, connection: *gio.SocketConnection, source_object: *gobject.Object, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, connection: *gio.SocketConnection, source_object: *gobject.Object, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
4 changes: 2 additions & 2 deletions src/gio/threaded_socket_service.zig
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub const ThreadedSocketService = extern struct {
pub inline fn connectRun(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, connection: *gio.SocketConnection, source_object: *gobject.Object, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, connection: *gio.SocketConnection, source_object: *gobject.Object, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -167,7 +167,7 @@ pub const ThreadedSocketService = extern struct {
pub inline fn connectIncoming(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, connection: *gio.SocketConnection, source_object: *gobject.Object, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, connection: *gio.SocketConnection, source_object: *gobject.Object, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
2 changes: 1 addition & 1 deletion src/gio/tls_connection.zig
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub const TlsConnection = extern struct {
pub inline fn connectAcceptCertificate(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, peer_cert: *gio.TlsCertificate, errors: gio.TlsCertificateFlags, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, peer_cert: *gio.TlsCertificate, errors: gio.TlsCertificateFlags, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
12 changes: 6 additions & 6 deletions src/gtk/about_dialog.zig
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ pub const AboutDialog = extern struct {
pub inline fn connectActivateLink(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, uri: [*c]const u8, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, uri: [*c]const u8, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -935,7 +935,7 @@ pub const AboutDialog = extern struct {
pub inline fn connectCloseRequest(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -955,7 +955,7 @@ pub const AboutDialog = extern struct {
pub inline fn connectEnableDebugging(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, toggle: bool, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, toggle: bool, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -1055,7 +1055,7 @@ pub const AboutDialog = extern struct {
pub inline fn connectKeynavFailed(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -1095,7 +1095,7 @@ pub const AboutDialog = extern struct {
pub inline fn connectMnemonicActivate(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -1135,7 +1135,7 @@ pub const AboutDialog = extern struct {
pub inline fn connectQueryTooltip(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
6 changes: 3 additions & 3 deletions src/gtk/action_bar.zig
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ pub const ActionBar = extern struct {
pub inline fn connectKeynavFailed(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -717,7 +717,7 @@ pub const ActionBar = extern struct {
pub inline fn connectMnemonicActivate(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -757,7 +757,7 @@ pub const ActionBar = extern struct {
pub inline fn connectQueryTooltip(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
6 changes: 3 additions & 3 deletions src/gtk/app_chooser_button.zig
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ pub const AppChooserButton = extern struct {
pub inline fn connectKeynavFailed(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -789,7 +789,7 @@ pub const AppChooserButton = extern struct {
pub inline fn connectMnemonicActivate(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -829,7 +829,7 @@ pub const AppChooserButton = extern struct {
pub inline fn connectQueryTooltip(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
10 changes: 5 additions & 5 deletions src/gtk/app_chooser_dialog.zig
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ pub const AppChooserDialog = extern struct {
pub inline fn connectCloseRequest(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -915,7 +915,7 @@ pub const AppChooserDialog = extern struct {
pub inline fn connectEnableDebugging(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, toggle: bool, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, toggle: bool, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -1015,7 +1015,7 @@ pub const AppChooserDialog = extern struct {
pub inline fn connectKeynavFailed(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -1055,7 +1055,7 @@ pub const AppChooserDialog = extern struct {
pub inline fn connectMnemonicActivate(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -1095,7 +1095,7 @@ pub const AppChooserDialog = extern struct {
pub inline fn connectQueryTooltip(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
6 changes: 3 additions & 3 deletions src/gtk/app_chooser_widget.zig
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ pub const AppChooserWidget = extern struct {
pub inline fn connectKeynavFailed(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, direction: gtk.DirectionType, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -772,7 +772,7 @@ pub const AppChooserWidget = extern struct {
pub inline fn connectMnemonicActivate(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, group_cycling: bool, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down Expand Up @@ -812,7 +812,7 @@ pub const AppChooserWidget = extern struct {
pub inline fn connectQueryTooltip(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, x: i32, y: i32, keyboard_mode: bool, tooltip: *gtk.Tooltip, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
6 changes: 3 additions & 3 deletions src/gtk/application.zig
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ pub const Application = extern struct {
pub inline fn connectCommandLine(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, command_line: *gio.ApplicationCommandLine, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, command_line: *gio.ApplicationCommandLine, data: ?*T) callconv(.C) i32,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -353,7 +353,7 @@ pub const Application = extern struct {
pub inline fn connectHandleLocalOptions(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, options: *glib.VariantDict, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, options: *glib.VariantDict, data: ?*T) callconv(.C) i32,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand All @@ -373,7 +373,7 @@ pub const Application = extern struct {
pub inline fn connectNameLost(
self: *Self,
comptime T: type,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) void,
callback: *const fn (self: *Self, data: ?*T) callconv(.C) bool,
data: ?*T,
flags: gobject.ConnectFlags
) u64 {
Expand Down
Loading

0 comments on commit df31c08

Please sign in to comment.