From c410b28f8364d52789abad180f33c5c745ff636c Mon Sep 17 00:00:00 2001 From: Alexander Klingenbeck Date: Mon, 5 Jun 2023 21:38:33 +0200 Subject: [PATCH] Update bindings --- bindings/src/index.ts | 30 +++++++++++++++++++++++++++--- generate-bindings.js | 22 ++++++++++++++++++++-- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/bindings/src/index.ts b/bindings/src/index.ts index 4b5f9ae..e97eaba 100644 --- a/bindings/src/index.ts +++ b/bindings/src/index.ts @@ -544,17 +544,41 @@ function main(){ setOutParam(getFunction(api.functions, "GuiSpinner")!, 2) setOutParam(getFunction(api.functions, "GuiValueBox")!, 2) setOutParam(getFunction(api.functions, "GuiListView")!, 2) - ignore("GuiListViewEx") + + // const setStringListParam = (fun: RayLibFunction, index: number, indexLen: number) => { + // const lenParam = fun!.params![indexLen] + // lenParam.binding = { ignore: true } + // const param = fun!.params![index] + // fun.binding = { customizeCall: "int returnVal = GuiListViewEx(bounds, text, count, focus, scrollIndex, active);" } + // param.binding = { + // jsType: `{ ${param.name}: string[] }`, + // customConverter: (gen,src) => { + // gen.line("// TODO: Read string values") + // }, + // customCleanup: (gen, src) => { + // gen.line("// TODO: Dispose strings") + // } + // } + + // } + + //const glve = getFunction(api.functions, "GuiListViewEx")! + //setStringListParam(glve, 1,2) + //setOutParam(glve, 3) + //setOutParam(glve, 4) + ignore("GuiListViewEx"); + setOutParamString(getFunction(api.functions, "GuiTextBox")!, 1,2) - //ignore("GuiTextBox") + const gtib = getFunction(api.functions, "GuiTextInputBox")! setOutParamString(gtib,4,5) setOutParam(gtib, 6) - //setOutParam(getFunction(api.functions, "GuiTextInputBox")!, 6) + // needs string array ignore("GuiTabBar") ignore("GuiGetIcons") ignore("GuiLoadIcons") + // TODO: Parse and support light struct ignore("CreateLight") ignore("UpdateLightValues") diff --git a/generate-bindings.js b/generate-bindings.js index 2b37481..e5586bd 100644 --- a/generate-bindings.js +++ b/generate-bindings.js @@ -1427,13 +1427,31 @@ function main() { setOutParam(getFunction(api.functions, "GuiSpinner"), 2); setOutParam(getFunction(api.functions, "GuiValueBox"), 2); setOutParam(getFunction(api.functions, "GuiListView"), 2); + // const setStringListParam = (fun: RayLibFunction, index: number, indexLen: number) => { + // const lenParam = fun!.params![indexLen] + // lenParam.binding = { ignore: true } + // const param = fun!.params![index] + // fun.binding = { customizeCall: "int returnVal = GuiListViewEx(bounds, text, count, focus, scrollIndex, active);" } + // param.binding = { + // jsType: `{ ${param.name}: string[] }`, + // customConverter: (gen,src) => { + // gen.line("// TODO: Read string values") + // }, + // customCleanup: (gen, src) => { + // gen.line("// TODO: Dispose strings") + // } + // } + // } + //const glve = getFunction(api.functions, "GuiListViewEx")! + //setStringListParam(glve, 1,2) + //setOutParam(glve, 3) + //setOutParam(glve, 4) ignore("GuiListViewEx"); setOutParamString(getFunction(api.functions, "GuiTextBox"), 1, 2); - //ignore("GuiTextBox") const gtib = getFunction(api.functions, "GuiTextInputBox"); setOutParamString(gtib, 4, 5); setOutParam(gtib, 6); - //setOutParam(getFunction(api.functions, "GuiTextInputBox")!, 6) + // needs string array ignore("GuiTabBar"); ignore("GuiGetIcons"); ignore("GuiLoadIcons");