packages feed

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

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

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

module DearImGui.Raw.Internal.ImGuiStyleVarInfo
  ( ImGuiStyleVarInfo
  , destroy
  , getVarPtr
  , init
  , withDefault
  ) where

import Control.Exception (bracket_)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Ptr (Ptr)
import Foreign.Storable (Storable (..))
import Prelude hiding (init)

#include "dcimgui_nodefaultargfunctions_internal.h"

-- structs (opaque)

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

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

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

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

-- functions

-- C: void* GetVarPtr(const ImGuiStyleVarInfo* self, void* parent)
foreign import capi unsafe "dcimgui_nodefaultargfunctions_internal.h ImGuiStyleVarInfo_GetVarPtr"
  getVarPtr
    :: (Ptr ImGuiStyleVarInfo) -- ^ self
    -> (Ptr ()) -- ^ parent
    -> IO (Ptr ())