#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))
module GI.Poppler.Structs.ActionLayer
    (
    ActionLayer(..)                         ,
    newZeroActionLayer                      ,
    noActionLayer                           ,
 
#if ENABLE_OVERLOADING
    actionLayer_action                      ,
#endif
    getActionLayerAction                    ,
    setActionLayerAction                    ,
#if ENABLE_OVERLOADING
    actionLayer_layers                      ,
#endif
    clearActionLayerLayers                  ,
    getActionLayerLayers                    ,
    setActionLayerLayers                    ,
    ) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
newtype ActionLayer = ActionLayer (ManagedPtr ActionLayer)
instance WrappedPtr ActionLayer where
    wrappedPtrCalloc = callocBytes 16
    wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 16 >=> wrapPtr ActionLayer)
    wrappedPtrFree = Just ptr_to_g_free
newZeroActionLayer :: MonadIO m => m ActionLayer
newZeroActionLayer = liftIO $ wrappedPtrCalloc >>= wrapPtr ActionLayer
instance tag ~ 'AttrSet => Constructible ActionLayer tag where
    new _ attrs = do
        o <- newZeroActionLayer
        GI.Attributes.set o attrs
        return o
noActionLayer :: Maybe ActionLayer
noActionLayer = Nothing
getActionLayerAction :: MonadIO m => ActionLayer -> m Poppler.Enums.ActionLayerAction
getActionLayerAction s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CUInt
    let val' = (toEnum . fromIntegral) val
    return val'
setActionLayerAction :: MonadIO m => ActionLayer -> Poppler.Enums.ActionLayerAction -> m ()
setActionLayerAction s val = liftIO $ withManagedPtr s $ \ptr -> do
    let val' = (fromIntegral . fromEnum) val
    poke (ptr `plusPtr` 0) (val' :: CUInt)
#if ENABLE_OVERLOADING
data ActionLayerActionFieldInfo
instance AttrInfo ActionLayerActionFieldInfo where
    type AttrAllowedOps ActionLayerActionFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ActionLayerActionFieldInfo = (~) Poppler.Enums.ActionLayerAction
    type AttrBaseTypeConstraint ActionLayerActionFieldInfo = (~) ActionLayer
    type AttrGetType ActionLayerActionFieldInfo = Poppler.Enums.ActionLayerAction
    type AttrLabel ActionLayerActionFieldInfo = "action"
    type AttrOrigin ActionLayerActionFieldInfo = ActionLayer
    attrGet _ = getActionLayerAction
    attrSet _ = setActionLayerAction
    attrConstruct = undefined
    attrClear _ = undefined
actionLayer_action :: AttrLabelProxy "action"
actionLayer_action = AttrLabelProxy
#endif
getActionLayerLayers :: MonadIO m => ActionLayer -> m ([Ptr ()])
getActionLayerLayers s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO (Ptr (GList (Ptr ())))
    val' <- unpackGList val
    return val'
setActionLayerLayers :: MonadIO m => ActionLayer -> Ptr (GList (Ptr ())) -> m ()
setActionLayerLayers s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (val :: Ptr (GList (Ptr ())))
clearActionLayerLayers :: MonadIO m => ActionLayer -> m ()
clearActionLayerLayers s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr (GList (Ptr ())))
#if ENABLE_OVERLOADING
data ActionLayerLayersFieldInfo
instance AttrInfo ActionLayerLayersFieldInfo where
    type AttrAllowedOps ActionLayerLayersFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ActionLayerLayersFieldInfo = (~) (Ptr (GList (Ptr ())))
    type AttrBaseTypeConstraint ActionLayerLayersFieldInfo = (~) ActionLayer
    type AttrGetType ActionLayerLayersFieldInfo = [Ptr ()]
    type AttrLabel ActionLayerLayersFieldInfo = "layers"
    type AttrOrigin ActionLayerLayersFieldInfo = ActionLayer
    attrGet _ = getActionLayerLayers
    attrSet _ = setActionLayerLayers
    attrConstruct = undefined
    attrClear _ = clearActionLayerLayers
actionLayer_layers :: AttrLabelProxy "layers"
actionLayer_layers = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList ActionLayer
type instance O.AttributeList ActionLayer = ActionLayerAttributeList
type ActionLayerAttributeList = ('[ '("action", ActionLayerActionFieldInfo), '("layers", ActionLayerLayersFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveActionLayerMethod (t :: Symbol) (o :: *) :: * where
    ResolveActionLayerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveActionLayerMethod t ActionLayer, O.MethodInfo info ActionLayer p) => OL.IsLabel t (ActionLayer -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif