// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go.
// DO NOT EDIT.

package glfw

// #include "structs_accessor.h"
// #include "wrapper.h"
// #include "../../imgui/extra_types.h"
import "C"
import "github.com/AllenDang/cimgui-go/internal"

func CharCallback(window *GLFWwindow, c uint32) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_CharCallback(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.uint(c))

	windowFin()
}

func CursorEnterCallback(window *GLFWwindow, entered int32) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_CursorEnterCallback(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.int(entered))

	windowFin()
}

func CursorPosCallback(window *GLFWwindow, x, y float64) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_CursorPosCallback(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.double(x), C.double(y))

	windowFin()
}

func ContentScaleForWindow(window *GLFWwindow) float32 {
	windowArg, windowFin := window.Handle()

	defer func() {
		windowFin()
	}()
	return float32(C.ImGui_ImplGlfw_GetContentScaleForWindow(internal.ReinterpretCast[*C.GLFWwindow](windowArg)))
}

func InitForOpenGL(window *GLFWwindow, install_callbacks bool) bool {
	windowArg, windowFin := window.Handle()

	defer func() {
		windowFin()
	}()
	return C.ImGui_ImplGlfw_InitForOpenGL(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.bool(install_callbacks)) == C.bool(true)
}

func InitForOther(window *GLFWwindow, install_callbacks bool) bool {
	windowArg, windowFin := window.Handle()

	defer func() {
		windowFin()
	}()
	return C.ImGui_ImplGlfw_InitForOther(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.bool(install_callbacks)) == C.bool(true)
}

func InitForVulkan(window *GLFWwindow, install_callbacks bool) bool {
	windowArg, windowFin := window.Handle()

	defer func() {
		windowFin()
	}()
	return C.ImGui_ImplGlfw_InitForVulkan(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.bool(install_callbacks)) == C.bool(true)
}

func InstallCallbacks(window *GLFWwindow) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_InstallCallbacks(internal.ReinterpretCast[*C.GLFWwindow](windowArg))

	windowFin()
}

func KeyCallback(window *GLFWwindow, key, scancode, action, mods int32) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_KeyCallback(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.int(key), C.int(scancode), C.int(action), C.int(mods))

	windowFin()
}

func MouseButtonCallback(window *GLFWwindow, button, action, mods int32) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_MouseButtonCallback(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.int(button), C.int(action), C.int(mods))

	windowFin()
}

func NewFrame() {
	C.ImGui_ImplGlfw_NewFrame()
}

func RestoreCallbacks(window *GLFWwindow) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_RestoreCallbacks(internal.ReinterpretCast[*C.GLFWwindow](windowArg))

	windowFin()
}

func ScrollCallback(window *GLFWwindow, xoffset, yoffset float64) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_ScrollCallback(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.double(xoffset), C.double(yoffset))

	windowFin()
}

func SetCallbacksChainForAllWindows(chain_for_all_windows bool) {
	C.ImGui_ImplGlfw_SetCallbacksChainForAllWindows(C.bool(chain_for_all_windows))
}

func Shutdown() {
	C.ImGui_ImplGlfw_Shutdown()
}

func Sleep(milliseconds int32) {
	C.ImGui_ImplGlfw_Sleep(C.int(milliseconds))
}

func WindowFocusCallback(window *GLFWwindow, focused int32) {
	windowArg, windowFin := window.Handle()
	C.ImGui_ImplGlfw_WindowFocusCallback(internal.ReinterpretCast[*C.GLFWwindow](windowArg), C.int(focused))

	windowFin()
}
