dear-imgui-raw-internal-1.0.0: src/DearImGui/Raw/Internal/ImGuiInputTextState.hsc
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE PatternSynonyms #-}
-- This file was generated by dear-bindings-ffi. Do not edit by hand.
module DearImGui.Raw.Internal.ImGuiInputTextState
( ImGuiInputTextState (..)
, clearFreeMemory
, clearSelection
, clearText
, cursorAnimReset
, cursorClamp
, destroy
, getCursorPos
, getPreferredOffsetX
, getSelectionEnd
, getSelectionStart
, getText
, hasSelection
, init
, onCharPressed
, onKeyPressed
, reloadUserBufAndKeepSelection
, reloadUserBufAndMoveToEnd
, reloadUserBufAndSelectAll
, selectAll
, setSelection
, withDefault
) where
import Control.Exception (bracket_)
import DearImGui.Raw (ImGuiID, ImS8)
import DearImGui.Raw.Enums.ImGuiInputTextFlags (ImGuiInputTextFlags)
import DearImGui.Raw.ImVec2 (ImVec2)
import DearImGui.Raw.ImVector (ImVector)
import {-# SOURCE #-} DearImGui.Raw.Internal.ImGuiContext (ImGuiContext)
import Foreign.C.String (CString)
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 {-# CTYPE "dcimgui_nodefaultargfunctions_internal.h" "ImGuiInputTextState" #-} ImGuiInputTextState = ImGuiInputTextState
{ ctx :: Ptr ImGuiContext
, stb :: Ptr ()
, flags :: ImGuiInputTextFlags
, iD :: ImGuiID
, textLen :: CInt
, textSrc :: CString
, textA :: ImVector CChar
, textToRevertTo :: ImVector CChar
, callbackTextBackup :: ImVector CChar
, bufCapacity :: CInt
, scroll :: ImVec2
, lineCount :: CInt
, wrapWidth :: Float
, cursorAnim :: Float
, cursorFollow :: CBool
, cursorCenterY :: CBool
, selectedAllMouseLock :: CBool
, editedBefore :: CBool
, editedThisFrame :: CBool
, validatedThisFrame :: CBool
, wantReloadUserBuf :: CBool
, lastMoveDirectionLR :: ImS8
, reloadSelectionStart :: CInt
, reloadSelectionEnd :: CInt
}
deriving (Eq, Show)
instance Storable ImGuiInputTextState where
sizeOf _ = #{size ImGuiInputTextState}
alignment _ = #{alignment ImGuiInputTextState}
peek p = ImGuiInputTextState <$> #{peek ImGuiInputTextState, Ctx} p <*> #{peek ImGuiInputTextState, Stb} p <*> #{peek ImGuiInputTextState, Flags} p <*> #{peek ImGuiInputTextState, ID} p <*> #{peek ImGuiInputTextState, TextLen} p <*> #{peek ImGuiInputTextState, TextSrc} p <*> #{peek ImGuiInputTextState, TextA} p <*> #{peek ImGuiInputTextState, TextToRevertTo} p <*> #{peek ImGuiInputTextState, CallbackTextBackup} p <*> #{peek ImGuiInputTextState, BufCapacity} p <*> #{peek ImGuiInputTextState, Scroll} p <*> #{peek ImGuiInputTextState, LineCount} p <*> #{peek ImGuiInputTextState, WrapWidth} p <*> #{peek ImGuiInputTextState, CursorAnim} p <*> #{peek ImGuiInputTextState, CursorFollow} p <*> #{peek ImGuiInputTextState, CursorCenterY} p <*> #{peek ImGuiInputTextState, SelectedAllMouseLock} p <*> #{peek ImGuiInputTextState, EditedBefore} p <*> #{peek ImGuiInputTextState, EditedThisFrame} p <*> #{peek ImGuiInputTextState, ValidatedThisFrame} p <*> #{peek ImGuiInputTextState, WantReloadUserBuf} p <*> #{peek ImGuiInputTextState, LastMoveDirectionLR} p <*> #{peek ImGuiInputTextState, ReloadSelectionStart} p <*> #{peek ImGuiInputTextState, ReloadSelectionEnd} p
poke p v = do
#{poke ImGuiInputTextState, Ctx} p v.ctx
#{poke ImGuiInputTextState, Stb} p v.stb
#{poke ImGuiInputTextState, Flags} p v.flags
#{poke ImGuiInputTextState, ID} p v.iD
#{poke ImGuiInputTextState, TextLen} p v.textLen
#{poke ImGuiInputTextState, TextSrc} p v.textSrc
#{poke ImGuiInputTextState, TextA} p v.textA
#{poke ImGuiInputTextState, TextToRevertTo} p v.textToRevertTo
#{poke ImGuiInputTextState, CallbackTextBackup} p v.callbackTextBackup
#{poke ImGuiInputTextState, BufCapacity} p v.bufCapacity
#{poke ImGuiInputTextState, Scroll} p v.scroll
#{poke ImGuiInputTextState, LineCount} p v.lineCount
#{poke ImGuiInputTextState, WrapWidth} p v.wrapWidth
#{poke ImGuiInputTextState, CursorAnim} p v.cursorAnim
#{poke ImGuiInputTextState, CursorFollow} p v.cursorFollow
#{poke ImGuiInputTextState, CursorCenterY} p v.cursorCenterY
#{poke ImGuiInputTextState, SelectedAllMouseLock} p v.selectedAllMouseLock
#{poke ImGuiInputTextState, EditedBefore} p v.editedBefore
#{poke ImGuiInputTextState, EditedThisFrame} p v.editedThisFrame
#{poke ImGuiInputTextState, ValidatedThisFrame} p v.validatedThisFrame
#{poke ImGuiInputTextState, WantReloadUserBuf} p v.wantReloadUserBuf
#{poke ImGuiInputTextState, LastMoveDirectionLR} p v.lastMoveDirectionLR
#{poke ImGuiInputTextState, ReloadSelectionStart} p v.reloadSelectionStart
#{poke ImGuiInputTextState, ReloadSelectionEnd} p v.reloadSelectionEnd
instance HasField "ctx" (Ptr ImGuiInputTextState) (Ptr (Ptr ImGuiContext)) where
getField = #{ptr ImGuiInputTextState, Ctx}
instance HasField "stb" (Ptr ImGuiInputTextState) (Ptr (Ptr ())) where
getField = #{ptr ImGuiInputTextState, Stb}
instance HasField "flags" (Ptr ImGuiInputTextState) (Ptr ImGuiInputTextFlags) where
getField = #{ptr ImGuiInputTextState, Flags}
instance HasField "iD" (Ptr ImGuiInputTextState) (Ptr ImGuiID) where
getField = #{ptr ImGuiInputTextState, ID}
instance HasField "textLen" (Ptr ImGuiInputTextState) (Ptr CInt) where
getField = #{ptr ImGuiInputTextState, TextLen}
instance HasField "textSrc" (Ptr ImGuiInputTextState) (Ptr CString) where
getField = #{ptr ImGuiInputTextState, TextSrc}
instance HasField "textA" (Ptr ImGuiInputTextState) (Ptr (ImVector CChar)) where
getField = #{ptr ImGuiInputTextState, TextA}
instance HasField "textToRevertTo" (Ptr ImGuiInputTextState) (Ptr (ImVector CChar)) where
getField = #{ptr ImGuiInputTextState, TextToRevertTo}
instance HasField "callbackTextBackup" (Ptr ImGuiInputTextState) (Ptr (ImVector CChar)) where
getField = #{ptr ImGuiInputTextState, CallbackTextBackup}
instance HasField "bufCapacity" (Ptr ImGuiInputTextState) (Ptr CInt) where
getField = #{ptr ImGuiInputTextState, BufCapacity}
instance HasField "scroll" (Ptr ImGuiInputTextState) (Ptr ImVec2) where
getField = #{ptr ImGuiInputTextState, Scroll}
instance HasField "lineCount" (Ptr ImGuiInputTextState) (Ptr CInt) where
getField = #{ptr ImGuiInputTextState, LineCount}
instance HasField "wrapWidth" (Ptr ImGuiInputTextState) (Ptr Float) where
getField = #{ptr ImGuiInputTextState, WrapWidth}
instance HasField "cursorAnim" (Ptr ImGuiInputTextState) (Ptr Float) where
getField = #{ptr ImGuiInputTextState, CursorAnim}
instance HasField "cursorFollow" (Ptr ImGuiInputTextState) (Ptr CBool) where
getField = #{ptr ImGuiInputTextState, CursorFollow}
instance HasField "cursorCenterY" (Ptr ImGuiInputTextState) (Ptr CBool) where
getField = #{ptr ImGuiInputTextState, CursorCenterY}
instance HasField "selectedAllMouseLock" (Ptr ImGuiInputTextState) (Ptr CBool) where
getField = #{ptr ImGuiInputTextState, SelectedAllMouseLock}
instance HasField "editedBefore" (Ptr ImGuiInputTextState) (Ptr CBool) where
getField = #{ptr ImGuiInputTextState, EditedBefore}
instance HasField "editedThisFrame" (Ptr ImGuiInputTextState) (Ptr CBool) where
getField = #{ptr ImGuiInputTextState, EditedThisFrame}
instance HasField "validatedThisFrame" (Ptr ImGuiInputTextState) (Ptr CBool) where
getField = #{ptr ImGuiInputTextState, ValidatedThisFrame}
instance HasField "wantReloadUserBuf" (Ptr ImGuiInputTextState) (Ptr CBool) where
getField = #{ptr ImGuiInputTextState, WantReloadUserBuf}
instance HasField "lastMoveDirectionLR" (Ptr ImGuiInputTextState) (Ptr ImS8) where
getField = #{ptr ImGuiInputTextState, LastMoveDirectionLR}
instance HasField "reloadSelectionStart" (Ptr ImGuiInputTextState) (Ptr CInt) where
getField = #{ptr ImGuiInputTextState, ReloadSelectionStart}
instance HasField "reloadSelectionEnd" (Ptr ImGuiInputTextState) (Ptr CInt) where
getField = #{ptr ImGuiInputTextState, ReloadSelectionEnd}
foreign import capi unsafe "DearImGuiWrappers.h ImGuiInputTextState_Init_wrap"
init
:: Ptr ImGuiInputTextState
-> IO ()
foreign import capi unsafe "DearImGuiWrappers.h ImGuiInputTextState_Destroy_wrap"
destroy
:: Ptr ImGuiInputTextState
-> IO ()
withDefault :: (Ptr ImGuiInputTextState -> IO a) -> IO a
withDefault k = alloca $ \p -> bracket_ (init p) (destroy p) (k p)
-- functions
-- C: void ClearFreeMemory(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_ClearFreeMemory"
clearFreeMemory
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void ClearSelection(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_ClearSelection"
clearSelection
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void ClearText(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_ClearText"
clearText
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void CursorAnimReset(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_CursorAnimReset"
cursorAnimReset
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void CursorClamp(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_CursorClamp"
cursorClamp
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: int GetCursorPos(const ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_GetCursorPos"
getCursorPos
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO CInt
-- C: float GetPreferredOffsetX(const ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_GetPreferredOffsetX"
getPreferredOffsetX
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO Float
-- C: int GetSelectionEnd(const ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_GetSelectionEnd"
getSelectionEnd
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO CInt
-- C: int GetSelectionStart(const ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_GetSelectionStart"
getSelectionStart
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO CInt
-- C: const char* GetText(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_GetText"
getText
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO CString
-- C: bool HasSelection(const ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_HasSelection"
hasSelection
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO CBool
-- C: void OnCharPressed(ImGuiInputTextState* self, unsigned int c)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_OnCharPressed"
onCharPressed
:: (Ptr ImGuiInputTextState) -- ^ self
-> CUInt -- ^ c
-> IO ()
-- C: void OnKeyPressed(ImGuiInputTextState* self, int key)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_OnKeyPressed"
onKeyPressed
:: (Ptr ImGuiInputTextState) -- ^ self
-> CInt -- ^ key
-> IO ()
-- C: void ReloadUserBufAndKeepSelection(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_ReloadUserBufAndKeepSelection"
reloadUserBufAndKeepSelection
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void ReloadUserBufAndMoveToEnd(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_ReloadUserBufAndMoveToEnd"
reloadUserBufAndMoveToEnd
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void ReloadUserBufAndSelectAll(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_ReloadUserBufAndSelectAll"
reloadUserBufAndSelectAll
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void SelectAll(ImGuiInputTextState* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_SelectAll"
selectAll
:: (Ptr ImGuiInputTextState) -- ^ self
-> IO ()
-- C: void SetSelection(ImGuiInputTextState* self, int start, int end)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiInputTextState_SetSelection"
setSelection
:: (Ptr ImGuiInputTextState) -- ^ self
-> CInt -- ^ start
-> CInt -- ^ end
-> IO ()