dear-imgui-raw-1.0.0: src/DearImGui/Raw/ImGuiListClipper.hsc
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE PatternSynonyms #-}
-- This file was generated by dear-bindings-ffi. Do not edit by hand.
module DearImGui.Raw.ImGuiListClipper
( ImGuiListClipper (..)
, begin
, destroy
, end
, includeItemByIndex
, includeItemsByIndex
, init
, seekCursorForItem
, step
, withDefault
) where
import Control.Exception (bracket_)
import DearImGui.Raw.Enums.ImGuiListClipperFlags (ImGuiListClipperFlags)
import DearImGui.Raw.ImGuiContext (ImGuiContext)
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.h"
-- structs (opaque)
data {-# CTYPE "dcimgui_nodefaultargfunctions.h" "ImGuiListClipper" #-} ImGuiListClipper = ImGuiListClipper
{ displayStart :: CInt
, displayEnd :: CInt
, userIndex :: CInt
, itemsCount :: CInt
, itemsHeight :: Float
, flags :: ImGuiListClipperFlags
, startPosY :: Double
, startSeekOffsetY :: Double
, ctx :: Ptr ImGuiContext
, tempData :: Ptr ()
}
deriving (Eq, Show)
instance Storable ImGuiListClipper where
sizeOf _ = #{size ImGuiListClipper}
alignment _ = #{alignment ImGuiListClipper}
peek p = ImGuiListClipper <$> #{peek ImGuiListClipper, DisplayStart} p <*> #{peek ImGuiListClipper, DisplayEnd} p <*> #{peek ImGuiListClipper, UserIndex} p <*> #{peek ImGuiListClipper, ItemsCount} p <*> #{peek ImGuiListClipper, ItemsHeight} p <*> #{peek ImGuiListClipper, Flags} p <*> #{peek ImGuiListClipper, StartPosY} p <*> #{peek ImGuiListClipper, StartSeekOffsetY} p <*> #{peek ImGuiListClipper, Ctx} p <*> #{peek ImGuiListClipper, TempData} p
poke p v = do
#{poke ImGuiListClipper, DisplayStart} p v.displayStart
#{poke ImGuiListClipper, DisplayEnd} p v.displayEnd
#{poke ImGuiListClipper, UserIndex} p v.userIndex
#{poke ImGuiListClipper, ItemsCount} p v.itemsCount
#{poke ImGuiListClipper, ItemsHeight} p v.itemsHeight
#{poke ImGuiListClipper, Flags} p v.flags
#{poke ImGuiListClipper, StartPosY} p v.startPosY
#{poke ImGuiListClipper, StartSeekOffsetY} p v.startSeekOffsetY
#{poke ImGuiListClipper, Ctx} p v.ctx
#{poke ImGuiListClipper, TempData} p v.tempData
instance HasField "displayStart" (Ptr ImGuiListClipper) (Ptr CInt) where
getField = #{ptr ImGuiListClipper, DisplayStart}
instance HasField "displayEnd" (Ptr ImGuiListClipper) (Ptr CInt) where
getField = #{ptr ImGuiListClipper, DisplayEnd}
instance HasField "userIndex" (Ptr ImGuiListClipper) (Ptr CInt) where
getField = #{ptr ImGuiListClipper, UserIndex}
instance HasField "itemsCount" (Ptr ImGuiListClipper) (Ptr CInt) where
getField = #{ptr ImGuiListClipper, ItemsCount}
instance HasField "itemsHeight" (Ptr ImGuiListClipper) (Ptr Float) where
getField = #{ptr ImGuiListClipper, ItemsHeight}
instance HasField "flags" (Ptr ImGuiListClipper) (Ptr ImGuiListClipperFlags) where
getField = #{ptr ImGuiListClipper, Flags}
instance HasField "startPosY" (Ptr ImGuiListClipper) (Ptr Double) where
getField = #{ptr ImGuiListClipper, StartPosY}
instance HasField "startSeekOffsetY" (Ptr ImGuiListClipper) (Ptr Double) where
getField = #{ptr ImGuiListClipper, StartSeekOffsetY}
instance HasField "ctx" (Ptr ImGuiListClipper) (Ptr (Ptr ImGuiContext)) where
getField = #{ptr ImGuiListClipper, Ctx}
instance HasField "tempData" (Ptr ImGuiListClipper) (Ptr (Ptr ())) where
getField = #{ptr ImGuiListClipper, TempData}
foreign import capi unsafe "DearImGuiWrappers.h ImGuiListClipper_Init_wrap"
init
:: Ptr ImGuiListClipper
-> IO ()
foreign import capi unsafe "DearImGuiWrappers.h ImGuiListClipper_Destroy_wrap"
destroy
:: Ptr ImGuiListClipper
-> IO ()
withDefault :: (Ptr ImGuiListClipper -> IO a) -> IO a
withDefault k = alloca $ \p -> bracket_ (init p) (destroy p) (k p)
-- functions
-- C: void Begin(ImGuiListClipper* self, int items_count, float items_height)
foreign import capi unsafe "dcimgui_nodefaultargfunctions.h ImGuiListClipper_Begin"
begin
:: (Ptr ImGuiListClipper) -- ^ self
-> CInt -- ^ items_count
-> Float -- ^ items_height
-> IO ()
-- C: void End(ImGuiListClipper* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions.h ImGuiListClipper_End"
end
:: (Ptr ImGuiListClipper) -- ^ self
-> IO ()
-- C: void IncludeItemByIndex(ImGuiListClipper* self, int item_index)
foreign import capi unsafe "dcimgui_nodefaultargfunctions.h ImGuiListClipper_IncludeItemByIndex"
includeItemByIndex
:: (Ptr ImGuiListClipper) -- ^ self
-> CInt -- ^ item_index
-> IO ()
-- C: void IncludeItemsByIndex(ImGuiListClipper* self, int item_begin, int item_end)
foreign import capi unsafe "dcimgui_nodefaultargfunctions.h ImGuiListClipper_IncludeItemsByIndex"
includeItemsByIndex
:: (Ptr ImGuiListClipper) -- ^ self
-> CInt -- ^ item_begin
-> CInt -- ^ item_end
-> IO ()
-- C: void SeekCursorForItem(ImGuiListClipper* self, int item_index)
foreign import capi unsafe "dcimgui_nodefaultargfunctions.h ImGuiListClipper_SeekCursorForItem"
seekCursorForItem
:: (Ptr ImGuiListClipper) -- ^ self
-> CInt -- ^ item_index
-> IO ()
-- C: bool Step(ImGuiListClipper* self)
foreign import capi unsafe "dcimgui_nodefaultargfunctions.h ImGuiListClipper_Step"
step
:: (Ptr ImGuiListClipper) -- ^ self
-> IO CBool