{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) -} module GI.Gtk.Structs.FixedChild ( -- * Exported types FixedChild(..) , newZeroFixedChild , noFixedChild , -- * Properties -- ** Widget fixedChildReadWidget , -- ** X fixedChildReadX , -- ** Y fixedChildReadY , ) where import Prelude () import Data.GI.Base.ShortPrelude import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import GI.Gtk.Types import GI.Gtk.Callbacks newtype FixedChild = FixedChild (ForeignPtr FixedChild) -- | Construct a `FixedChild` struct initialized to zero. newZeroFixedChild :: MonadIO m => m FixedChild newZeroFixedChild = liftIO $ callocBytes 16 >>= wrapPtr FixedChild noFixedChild :: Maybe FixedChild noFixedChild = Nothing fixedChildReadWidget :: FixedChild -> IO Widget fixedChildReadWidget s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr Widget) val' <- (newObject Widget) val return val' fixedChildReadX :: FixedChild -> IO Int32 fixedChildReadX s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO Int32 return val fixedChildReadY :: FixedChild -> IO Int32 fixedChildReadY s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 12) :: IO Int32 return val type family ResolveFixedChildMethod (t :: Symbol) (o :: *) :: * where ResolveFixedChildMethod l o = MethodResolutionFailed l o instance (info ~ ResolveFixedChildMethod t FixedChild, MethodInfo info FixedChild p) => IsLabelProxy t (FixedChild -> p) where fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info) #if MIN_VERSION_base(4,9,0) instance (info ~ ResolveFixedChildMethod t FixedChild, MethodInfo info FixedChild p) => IsLabel t (FixedChild -> p) where fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info) #endif