From 855ab9cd70240aba4b8e084f1f86ec07bff9258f Mon Sep 17 00:00:00 2001 From: Not-Nik Date: Wed, 2 Oct 2024 22:19:14 +0200 Subject: [PATCH] raygui: Revert property parameters back to i32s (#131) --- lib/generate_functions.py | 4 ++-- lib/raygui-ext.zig | 4 ++-- lib/raygui.zig | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/generate_functions.py b/lib/generate_functions.py index 364f701..0ff4513 100755 --- a/lib/generate_functions.py +++ b/lib/generate_functions.py @@ -174,8 +174,8 @@ _fix_enums_data = [ ("flags", "Gesture", r"SetGesturesEnabled"), ("button", "GamepadButton", r".*GamepadButton.*"), ("button", "MouseButton", r".*MouseButton.*"), - ("control", "GuiState", r"Gui.etStyle"), - ("property", "GuiControlProperty", r"Gui.etStyle"), + ("control", "GuiControl", r"Gui.etStyle"), +# ("property", "GuiControlProperty", r"Gui.etStyle"), ] def fix_enums(arg_name, arg_type, func_name): if func_name.startswith("rl"): diff --git a/lib/raygui-ext.zig b/lib/raygui-ext.zig index e73a396..900ab21 100644 --- a/lib/raygui-ext.zig +++ b/lib/raygui-ext.zig @@ -13,8 +13,8 @@ pub extern "c" fn GuiSetState(state: c_int) void; pub extern "c" fn GuiGetState() c_int; pub extern "c" fn GuiSetFont(font: rl.Font) void; pub extern "c" fn GuiGetFont() rl.Font; -pub extern "c" fn GuiSetStyle(control: rgui.GuiState, property: rgui.GuiControlProperty, value: c_int) void; -pub extern "c" fn GuiGetStyle(control: rgui.GuiState, property: rgui.GuiControlProperty) c_int; +pub extern "c" fn GuiSetStyle(control: rgui.GuiControl, property: c_int, value: c_int) void; +pub extern "c" fn GuiGetStyle(control: rgui.GuiControl, property: c_int) c_int; pub extern "c" fn GuiLoadStyle(fileName: [*c]const u8) void; pub extern "c" fn GuiLoadStyleDefault() void; pub extern "c" fn GuiEnableTooltip() void; diff --git a/lib/raygui.zig b/lib/raygui.zig index 39903cc..cd18d1d 100644 --- a/lib/raygui.zig +++ b/lib/raygui.zig @@ -513,13 +513,13 @@ pub fn guiGetFont() Font { } /// Set one style property -pub fn guiSetStyle(control: GuiState, property: GuiControlProperty, value: i32) void { - cdef.GuiSetStyle(control, property, @as(c_int, value)); +pub fn guiSetStyle(control: GuiControl, property: i32, value: i32) void { + cdef.GuiSetStyle(control, @as(c_int, property), @as(c_int, value)); } /// Get one style property -pub fn guiGetStyle(control: GuiState, property: GuiControlProperty) i32 { - return @as(i32, cdef.GuiGetStyle(control, property)); +pub fn guiGetStyle(control: GuiControl, property: i32) i32 { + return @as(i32, cdef.GuiGetStyle(control, @as(c_int, property))); } /// Load style file over global style variable (.rgs)