dear-imgui-raw-internal-1.0.0: src/DearImGui/Raw/Internal/ImGuiInputEventMouseViewport.hsc
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE PatternSynonyms #-}
-- This file was generated by dear-bindings-ffi. Do not edit by hand.
module DearImGui.Raw.Internal.ImGuiInputEventMouseViewport
( ImGuiInputEventMouseViewport (..)
, destroy
, init
, withDefault
) where
import Control.Exception (bracket_)
import DearImGui.Raw (ImGuiID)
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)
newtype {-# CTYPE "dcimgui_nodefaultargfunctions_internal.h" "ImGuiInputEventMouseViewport" #-} ImGuiInputEventMouseViewport = ImGuiInputEventMouseViewport
{ hoveredViewportID :: ImGuiID
}
deriving (Eq, Show)
instance Storable ImGuiInputEventMouseViewport where
sizeOf _ = #{size ImGuiInputEventMouseViewport}
alignment _ = #{alignment ImGuiInputEventMouseViewport}
peek p = ImGuiInputEventMouseViewport <$> #{peek ImGuiInputEventMouseViewport, HoveredViewportID} p
poke p v = do
#{poke ImGuiInputEventMouseViewport, HoveredViewportID} p v.hoveredViewportID
instance HasField "hoveredViewportID" (Ptr ImGuiInputEventMouseViewport) (Ptr ImGuiID) where
getField = #{ptr ImGuiInputEventMouseViewport, HoveredViewportID}
foreign import capi unsafe "DearImGuiWrappers.h ImGuiInputEventMouseViewport_Init_wrap"
init
:: Ptr ImGuiInputEventMouseViewport
-> IO ()
foreign import capi unsafe "DearImGuiWrappers.h ImGuiInputEventMouseViewport_Destroy_wrap"
destroy
:: Ptr ImGuiInputEventMouseViewport
-> IO ()
withDefault :: (Ptr ImGuiInputEventMouseViewport -> IO a) -> IO a
withDefault k = alloca $ \p -> bracket_ (init p) (destroy p) (k p)