packages feed

gi-poppler-0.0.34.13: GI/Poppler/Structs/ActionGotoRemote.hs


{- |
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.Poppler.Structs.ActionGotoRemote
    ( 

-- * Exported types
    ActionGotoRemote(..)                    ,
    newZeroActionGotoRemote                 ,
    noActionGotoRemote                      ,


 -- * Properties
-- ** Dest
    actionGotoRemoteReadDest                ,


-- ** FileName
    actionGotoRemoteReadFileName            ,


-- ** Title
    actionGotoRemoteReadTitle               ,


-- ** Type
    actionGotoRemoteReadType                ,




    ) 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.Poppler.Types
import GI.Poppler.Callbacks

newtype ActionGotoRemote = ActionGotoRemote (ForeignPtr ActionGotoRemote)
-- | Construct a `ActionGotoRemote` struct initialized to zero.
newZeroActionGotoRemote :: MonadIO m => m ActionGotoRemote
newZeroActionGotoRemote = liftIO $ callocBytes 32 >>= wrapPtr ActionGotoRemote

noActionGotoRemote :: Maybe ActionGotoRemote
noActionGotoRemote = Nothing

actionGotoRemoteReadType :: ActionGotoRemote -> IO ActionType
actionGotoRemoteReadType s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CUInt
    let val' = (toEnum . fromIntegral) val
    return val'

actionGotoRemoteReadTitle :: ActionGotoRemote -> IO T.Text
actionGotoRemoteReadTitle s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO CString
    val' <- cstringToText val
    return val'

actionGotoRemoteReadFileName :: ActionGotoRemote -> IO T.Text
actionGotoRemoteReadFileName s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO CString
    val' <- cstringToText val
    return val'

actionGotoRemoteReadDest :: ActionGotoRemote -> IO Dest
actionGotoRemoteReadDest s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO (Ptr Dest)
    val' <- (newBoxed Dest) val
    return val'

type family ResolveActionGotoRemoteMethod (t :: Symbol) (o :: *) :: * where
    ResolveActionGotoRemoteMethod l o = MethodResolutionFailed l o

instance (info ~ ResolveActionGotoRemoteMethod t ActionGotoRemote, MethodInfo info ActionGotoRemote p) => IsLabelProxy t (ActionGotoRemote -> p) where
    fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveActionGotoRemoteMethod t ActionGotoRemote, MethodInfo info ActionGotoRemote p) => IsLabel t (ActionGotoRemote -> p) where
    fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif