chore: update upstream
This commit is contained in:
53
src/gui.zig
53
src/gui.zig
@@ -243,6 +243,9 @@ pub const io = struct {
|
||||
pub const addKeyEvent = zguiIoAddKeyEvent;
|
||||
extern fn zguiIoAddKeyEvent(key: Key, down: bool) void;
|
||||
|
||||
pub const addInputCharactersUTF8 = zguiIoAddInputCharactersUTF8;
|
||||
extern fn zguiIoAddInputCharactersUTF8(utf8_chars: ?[*:0]const u8) void;
|
||||
|
||||
pub const setKeyEventNativeData = zguiIoSetKeyEventNativeData;
|
||||
extern fn zguiIoSetKeyEventNativeData(key: Key, keycode: i32, scancode: i32) void;
|
||||
|
||||
@@ -298,7 +301,7 @@ pub const Key = enum(u32) {
|
||||
four,
|
||||
five,
|
||||
six,
|
||||
severn,
|
||||
seven,
|
||||
eight,
|
||||
nine,
|
||||
a,
|
||||
@@ -407,11 +410,11 @@ pub const Key = enum(u32) {
|
||||
mouse_wheel_x,
|
||||
mouse_wheel_y,
|
||||
|
||||
pub const mod_ctrl: u32 = 1 << 12;
|
||||
pub const mod_shift: u32 = 1 << 13;
|
||||
pub const mod_alt: u32 = 1 << 14;
|
||||
pub const mod_super: u32 = 1 << 15;
|
||||
pub const mod_mask_: u32 = 0xf000;
|
||||
mod_ctrl = 1 << 12,
|
||||
mod_shift = 1 << 13,
|
||||
mod_alt = 1 << 14,
|
||||
mod_super = 1 << 15,
|
||||
mod_mask_ = 0xf000,
|
||||
};
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
pub const WindowFlags = packed struct(u32) {
|
||||
@@ -558,6 +561,10 @@ pub fn setNextWindowBgAlpha(args: SetNextWindowBgAlpha) void {
|
||||
zguiSetNextWindowBgAlpha(args.alpha);
|
||||
}
|
||||
extern fn zguiSetNextWindowBgAlpha(alpha: f32) void;
|
||||
|
||||
/// `pub fn setKeyboardFocusHere(offset: i32) void`
|
||||
pub const setKeyboardFocusHere = zguiSetKeyboardFocusHere;
|
||||
extern fn zguiSetKeyboardFocusHere(offset: i32) void;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const Begin = struct {
|
||||
popen: ?*bool = null,
|
||||
@@ -1098,6 +1105,19 @@ extern fn zguiGetTextLineHeightWithSpacing() f32;
|
||||
extern fn zguiGetFrameHeight() f32;
|
||||
extern fn zguiGetFrameHeightWithSpacing() f32;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
pub fn getItemRectMax() [2]f32 {
|
||||
var rect: [2]f32 = undefined;
|
||||
zguiGetItemRectMax(&rect);
|
||||
return rect;
|
||||
}
|
||||
pub fn getItemRectMin() [2]f32 {
|
||||
var rect: [2]f32 = undefined;
|
||||
zguiGetItemRectMin(&rect);
|
||||
return rect;
|
||||
}
|
||||
extern fn zguiGetItemRectMax(rect: *[2]f32) void;
|
||||
extern fn zguiGetItemRectMin(rect: *[2]f32) void;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// ID stack/scopes
|
||||
//
|
||||
@@ -2763,14 +2783,21 @@ pub const TableBgTarget = enum(u32) {
|
||||
};
|
||||
|
||||
pub const BeginTable = struct {
|
||||
column: i32,
|
||||
flags: TableFlags = .{},
|
||||
outer_size: [2]f32 = .{ 0, 0 },
|
||||
inner_width: f32 = 0,
|
||||
};
|
||||
pub fn beginTable(name: [:0]const u8, args: BeginTable) void {
|
||||
zguiBeginTable(name, args.flags, args.outer_size, args.inner_width);
|
||||
zguiBeginTable(name, args.column, args.flags, &args.outer_size, args.inner_width);
|
||||
}
|
||||
extern fn zguiBeginTable(str_id: [*:0]const u8, column: i32, flags: TableFlags, outer_size: [2]f32, inner_width: f32) void;
|
||||
extern fn zguiBeginTable(
|
||||
str_id: [*:0]const u8,
|
||||
column: i32,
|
||||
flags: TableFlags,
|
||||
outer_size: *const [2]f32,
|
||||
inner_width: f32,
|
||||
) void;
|
||||
|
||||
pub fn endTable() void {
|
||||
zguiEndTable();
|
||||
@@ -2870,6 +2897,8 @@ pub const MouseButton = enum(u32) {
|
||||
right = 1,
|
||||
middle = 2,
|
||||
};
|
||||
/// `pub fn isMouseDoubleClicked(mouse_button: MouseButton) bool`
|
||||
pub const isMouseDoubleClicked = zguiIsMouseDoubleClicked;
|
||||
/// `pub fn isItemClicked(mouse_button: MouseButton) bool`
|
||||
pub const isItemClicked = zguiIsItemClicked;
|
||||
/// `pub fn isItemVisible() bool`
|
||||
@@ -2890,6 +2919,7 @@ pub const isAnyItemHovered = zguiIsAnyItemHovered;
|
||||
pub const isAnyItemActive = zguiIsAnyItemActive;
|
||||
/// `pub fn isAnyItemFocused() bool`
|
||||
pub const isAnyItemFocused = zguiIsAnyItemFocused;
|
||||
extern fn zguiIsMouseDoubleClicked(mouse_button: MouseButton) bool;
|
||||
extern fn zguiIsItemHovered(flags: HoveredFlags) bool;
|
||||
extern fn zguiIsItemActive() bool;
|
||||
extern fn zguiIsItemFocused() bool;
|
||||
@@ -3023,6 +3053,8 @@ pub const endTooltip = zguiEndTooltip;
|
||||
extern fn zguiBeginTooltip() void;
|
||||
extern fn zguiEndTooltip() void;
|
||||
|
||||
/// `pub fn beginPopupContextWindow() bool`
|
||||
pub const beginPopupContextWindow = zguiBeginPopupContextWindow;
|
||||
pub const PopupFlags = packed struct(u32) {
|
||||
mouse_button_left: bool = false,
|
||||
mouse_button_right: bool = false,
|
||||
@@ -3046,6 +3078,7 @@ pub fn openPopup(str_id: [:0]const u8, flags: PopupFlags) void {
|
||||
pub const endPopup = zguiEndPopup;
|
||||
/// `pub fn closeCurrentPopup() void`
|
||||
pub const closeCurrentPopup = zguiCloseCurrentPopup;
|
||||
extern fn zguiBeginPopupContextWindow() bool;
|
||||
extern fn zguiBeginPopupModal(name: [*:0]const u8, popen: ?*bool, flags: WindowFlags) bool;
|
||||
extern fn zguiEndPopup() void;
|
||||
extern fn zguiOpenPopup(str_id: [*:0]const u8, flags: PopupFlags) void;
|
||||
@@ -3281,9 +3314,11 @@ pub const DrawList = *opaque {
|
||||
anti_aliased_fill: bool = false,
|
||||
allow_vtx_offset: bool = false,
|
||||
|
||||
_padding: u28,
|
||||
_padding: u28 = 0,
|
||||
};
|
||||
|
||||
pub const setDrawListFlags = zguiDrawList_SetFlags;
|
||||
extern fn zguiDrawList_SetFlags(draw_list: DrawList, flags: DrawListFlags) void;
|
||||
pub const getDrawListFlags = zguiDrawList_GetFlags;
|
||||
extern fn zguiDrawList_GetFlags(draw_list: DrawList) DrawListFlags;
|
||||
|
||||
|
Reference in New Issue
Block a user