Skip to content

Commit

Permalink
feat(wasm-api): add fullscreen methods for WindowInfo [zig]
Browse files Browse the repository at this point in the history
- add isFullscreen() & hasFullscreen() helpers
  • Loading branch information
postspectacular committed Oct 29, 2022
1 parent 1ad855a commit e480b2c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
15 changes: 14 additions & 1 deletion packages/wasm-api-dom/src/typedefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,20 @@
"- 2 (bit 1): fullscreen supported"
]
}
]
],
"body": {
"zig": [
"/// Returns true if fullscreen mode is currently active (see `.fullscreen`)",
"pub inline fn isFullscreen(self: *const WindowInfo) bool {",
"return self.fullscreen & 1 != 0;",
"}",
"",
"/// Returns true if fullscreen mode is supported (see `.fullscreen`)",
"pub inline fn hasFullscreen(self: *const WindowInfo) bool {",
"return self.fullscreen & 2 != 0;",
"}"
]
}
},
{
"name": "DragEvent",
Expand Down
13 changes: 12 additions & 1 deletion packages/wasm-api-dom/zig/api.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Generated by @thi.ng/wasm-api at 2022-10-29T12:48:23.319Z - DO NOT EDIT!
//! Generated by @thi.ng/wasm-api at 2022-10-29T20:12:33.228Z - DO NOT EDIT!

const std = @import("std");

Expand Down Expand Up @@ -54,6 +54,17 @@ pub const WindowInfo = struct {
/// - 1 (bit 0): fullscreen active
/// - 2 (bit 1): fullscreen supported
fullscreen: u8,

/// Returns true if fullscreen mode is currently active (see `.fullscreen`)
pub inline fn isFullscreen(self: *const WindowInfo) bool {
return self.fullscreen & 1 != 0;
}

/// Returns true if fullscreen mode is supported (see `.fullscreen`)
pub inline fn hasFullscreen(self: *const WindowInfo) bool {
return self.fullscreen & 2 != 0;
}

};

pub const DragEvent = struct {
Expand Down

0 comments on commit e480b2c

Please sign in to comment.