packages feed

dear-imgui-raw-internal-1.0.0: src/DearImGui/Raw/Internal/ImGuiTypingSelectState.hsc

{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE PatternSynonyms #-}

-- This file was generated by dear-bindings-ffi. Do not edit by hand.

module DearImGui.Raw.Internal.ImGuiTypingSelectState
  ( ImGuiTypingSelectState
  , clear
  , destroy
  , init
  , searchBufferLength
  , withDefault
  ) where

import Control.Exception (bracket_)
import DearImGui.Raw (ImGuiID)
import DearImGui.Raw.Internal.ImGuiTypingSelectRequest (ImGuiTypingSelectRequest)
import Foreign.C.Types
import Foreign.Marshal.Alloc (alloca)
import Foreign.Ptr (Ptr, plusPtr)
import Foreign.Storable (Storable (..))
import GHC.Records (HasField (..))
import Prelude hiding (init)

#include "dcimgui_nodefaultargfunctions_internal.h"

-- structs (opaque)

data ImGuiTypingSelectState
instance Storable ImGuiTypingSelectState where
  sizeOf _    = #{size ImGuiTypingSelectState}
  alignment _ = #{alignment ImGuiTypingSelectState}
  peek _ = error "ImGuiTypingSelectState: opaque struct, peek not supported in v0"
  poke _ _ = error "ImGuiTypingSelectState: opaque struct, poke not supported in v0"

instance HasField "request" (Ptr ImGuiTypingSelectState) (Ptr ImGuiTypingSelectRequest) where
  getField = #{ptr ImGuiTypingSelectState, Request}

instance HasField "searchBuffer" (Ptr ImGuiTypingSelectState) (Ptr CChar) where
  getField = #{ptr ImGuiTypingSelectState, SearchBuffer}

searchBufferLength :: Int
searchBufferLength = #{const 64}

instance HasField "focusScope" (Ptr ImGuiTypingSelectState) (Ptr ImGuiID) where
  getField = #{ptr ImGuiTypingSelectState, FocusScope}

instance HasField "lastRequestFrame" (Ptr ImGuiTypingSelectState) (Ptr CInt) where
  getField = #{ptr ImGuiTypingSelectState, LastRequestFrame}

instance HasField "lastRequestTime" (Ptr ImGuiTypingSelectState) (Ptr Float) where
  getField = #{ptr ImGuiTypingSelectState, LastRequestTime}

instance HasField "singleCharModeLock" (Ptr ImGuiTypingSelectState) (Ptr CBool) where
  getField = #{ptr ImGuiTypingSelectState, SingleCharModeLock}

foreign import capi unsafe "DearImGuiWrappers.h ImGuiTypingSelectState_Init_wrap"
  init
    :: Ptr ImGuiTypingSelectState
    -> IO ()

foreign import capi unsafe "DearImGuiWrappers.h ImGuiTypingSelectState_Destroy_wrap"
  destroy
    :: Ptr ImGuiTypingSelectState
    -> IO ()

withDefault :: (Ptr ImGuiTypingSelectState -> IO a) -> IO a
withDefault k = alloca $ \p -> bracket_ (init p) (destroy p) (k p)

-- functions

-- C: void Clear(ImGuiTypingSelectState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiTypingSelectState_Clear"
  clear
    :: (Ptr ImGuiTypingSelectState) -- ^ self
    -> IO ()