packages feed

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

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

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

module DearImGui.Raw.Internal.ImFontAtlasRectEntry
  ( ImFontAtlasRectEntry
  , destroy
  , 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 ImFontAtlasRectEntry
instance Storable ImFontAtlasRectEntry where
  sizeOf _    = #{size ImFontAtlasRectEntry}
  alignment _ = #{alignment ImFontAtlasRectEntry}
  peek _ = error "ImFontAtlasRectEntry: opaque struct, peek not supported in v0"
  poke _ _ = error "ImFontAtlasRectEntry: opaque struct, poke not supported in v0"

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

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

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