dear-imgui-raw-1.0.0: src/DearImGui/Raw/ImGuiSelectionExternalStorage.hsc
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE PatternSynonyms #-}
-- This file was generated by dear-bindings-ffi. Do not edit by hand.
module DearImGui.Raw.ImGuiSelectionExternalStorage
( ImGuiSelectionExternalStorage (..)
, applyRequests
, destroy
, init
, withDefault
) where
import Control.Exception (bracket_)
import DearImGui.Raw.ImGuiMultiSelectIO (ImGuiMultiSelectIO)
import Foreign.C.Types
import Foreign.Marshal.Alloc (alloca)
import Foreign.Ptr (FunPtr, 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" "ImGuiSelectionExternalStorage" #-} ImGuiSelectionExternalStorage = ImGuiSelectionExternalStorage
{ userData :: Ptr ()
, adapterSetItemSelected :: FunPtr ((Ptr ImGuiSelectionExternalStorage) -> CInt -> CBool -> IO ())
}
deriving (Eq, Show)
instance Storable ImGuiSelectionExternalStorage where
sizeOf _ = #{size ImGuiSelectionExternalStorage}
alignment _ = #{alignment ImGuiSelectionExternalStorage}
peek p = ImGuiSelectionExternalStorage <$> #{peek ImGuiSelectionExternalStorage, UserData} p <*> #{peek ImGuiSelectionExternalStorage, AdapterSetItemSelected} p
poke p v = do
#{poke ImGuiSelectionExternalStorage, UserData} p v.userData
#{poke ImGuiSelectionExternalStorage, AdapterSetItemSelected} p v.adapterSetItemSelected
instance HasField "userData" (Ptr ImGuiSelectionExternalStorage) (Ptr (Ptr ())) where
getField = #{ptr ImGuiSelectionExternalStorage, UserData}
instance HasField "adapterSetItemSelected" (Ptr ImGuiSelectionExternalStorage) (Ptr (FunPtr ((Ptr ImGuiSelectionExternalStorage) -> CInt -> CBool -> IO ()))) where
getField = #{ptr ImGuiSelectionExternalStorage, AdapterSetItemSelected}
foreign import capi unsafe "DearImGuiWrappers.h ImGuiSelectionExternalStorage_Init_wrap"
init
:: Ptr ImGuiSelectionExternalStorage
-> IO ()
foreign import capi unsafe "DearImGuiWrappers.h ImGuiSelectionExternalStorage_Destroy_wrap"
destroy
:: Ptr ImGuiSelectionExternalStorage
-> IO ()
withDefault :: (Ptr ImGuiSelectionExternalStorage -> IO a) -> IO a
withDefault k = alloca $ \p -> bracket_ (init p) (destroy p) (k p)
-- functions
-- C: void ApplyRequests(ImGuiSelectionExternalStorage* self, ImGuiMultiSelectIO* ms_io)
foreign import capi safe "dcimgui_nodefaultargfunctions.h ImGuiSelectionExternalStorage_ApplyRequests"
applyRequests
:: (Ptr ImGuiSelectionExternalStorage) -- ^ self
-> (Ptr ImGuiMultiSelectIO) -- ^ ms_io
-> IO ()