Skip to content

Commit 68684cf

Browse files
committed
List Clipper
1 parent cf86157 commit 68684cf

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

src/gui.zig

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,10 @@ pub const HoveredFlags = packed struct(c_int) {
828828
pub const isWindowAppearing = cimgui.igIsWindowAppearing;
829829
pub const isWindowCollapsed = cimgui.igIsWindowCollapsed;
830830
pub fn isWindowFocused(flags: FocusedFlags) bool {
831-
return cimgui.igIsWindowFocused(@bitCast(flags))
831+
return cimgui.igIsWindowFocused(@bitCast(flags));
832832
}
833833
pub fn isWindowHovered(flags: HoveredFlags) bool {
834-
return cimgui.igIsWindowHovered(@bitCast(flags))
834+
return cimgui.igIsWindowHovered(@bitCast(flags));
835835
}
836836
//--------------------------------------------------------------------------------------------------
837837
pub fn getWindowPos() Vec2 {
@@ -902,31 +902,32 @@ pub const DockSpaceOverViewport = cimgui.igDockSpaceOverViewport;
902902
// ListClipper
903903
//
904904
//--------------------------------------------------------------------------------------------------
905+
905906
pub const ListClipper = extern struct {
906-
Ctx: *Context,
907-
DisplayStart: c_int,
908-
DisplayEnd: c_int,
909-
ItemsCount: c_int,
910-
ItemsHeight: f32,
911-
StartPosY: f32,
912-
TempData: *anyopaque,
913-
914-
pub const init = zguiListClipper_Init;
915-
extern fn zguiListClipper_Init() ListClipper;
916-
917-
pub fn begin(self: *ListClipper, items_count: ?i32, items_height: ?f32) void {
918-
zguiListClipper_Begin(self, items_count orelse std.math.maxInt(i32), items_height orelse -1.0);
907+
Base: cimgui.ImGuiListClipper,
908+
909+
pub fn init() ListClipper {
910+
return .{
911+
.Base = cimgui.ImGuiListClipper_ImGuiListClipper()
912+
};
913+
}
914+
915+
pub fn begin(self: *ListClipper, items_count: ?i32, items_height: ?f32) void{
916+
cimgui.ImGuiListClipper_Begin(self.Base, items_count orelse std.math.maxInt(i32), items_height orelse -1);
919917
}
920-
extern fn zguiListClipper_Begin(self: *ListClipper, items_count: i32, items_height: f32) void;
921918

922-
pub const end = zguiListClipper_End;
923-
extern fn zguiListClipper_End(self: *ListClipper) void;
919+
pub fn end(self: *ListClipper) void{
920+
cimgui.ImGuiListClipper_End(self.Base);
921+
}
924922

925-
pub const includeItemsByIndex = zguiListClipper_IncludeItemsByIndex;
926-
extern fn zguiListClipper_IncludeItemsByIndex(self: *ListClipper, item_begin: i32, item_end: i32) void;
923+
pub fn includeItemsByIndex(self: *ListClipper, item_begin: c_int, item_end: c_int) void{
924+
cimgui.ImGuiListClipper_IncludeItemsByIndex(self.Base, item_begin, item_end);
925+
}
927926

928-
pub const step = zguiListClipper_Step;
929-
extern fn zguiListClipper_Step(self: *ListClipper) bool;
927+
928+
pub fn step(self: *ListClipper) bool{
929+
return cimgui.ImGuiListClipper_Step(self.Base);
930+
}
930931
};
931932

932933
//--------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)