module GI.Poppler.Unions.Action
(
Action(..) ,
noAction ,
actionCopy ,
actionFree ,
actionReadAny ,
actionReadGotoDest ,
actionReadGotoRemote ,
actionReadJavascript ,
actionReadLaunch ,
actionReadMovie ,
actionReadNamed ,
actionReadOcgState ,
actionReadRendition ,
actionReadType ,
actionReadUri ,
) 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 Action = Action (ForeignPtr Action)
foreign import ccall "poppler_action_get_type" c_poppler_action_get_type ::
IO GType
instance BoxedObject Action where
boxedType _ = c_poppler_action_get_type
noAction :: Maybe Action
noAction = Nothing
actionReadType :: Action -> IO ActionType
actionReadType s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
actionReadAny :: Action -> IO ActionAny
actionReadAny s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionAny)
val' <- (newPtr 16 ActionAny) val
return val'
actionReadGotoDest :: Action -> IO ActionGotoDest
actionReadGotoDest s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionGotoDest)
val' <- (newPtr 24 ActionGotoDest) val
return val'
actionReadGotoRemote :: Action -> IO ActionGotoRemote
actionReadGotoRemote s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionGotoRemote)
val' <- (newPtr 32 ActionGotoRemote) val
return val'
actionReadLaunch :: Action -> IO ActionLaunch
actionReadLaunch s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionLaunch)
val' <- (newPtr 32 ActionLaunch) val
return val'
actionReadUri :: Action -> IO ActionUri
actionReadUri s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionUri)
val' <- (newPtr 24 ActionUri) val
return val'
actionReadNamed :: Action -> IO ActionNamed
actionReadNamed s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionNamed)
val' <- (newPtr 24 ActionNamed) val
return val'
actionReadMovie :: Action -> IO ActionMovie
actionReadMovie s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionMovie)
val' <- (newPtr 32 ActionMovie) val
return val'
actionReadRendition :: Action -> IO ActionRendition
actionReadRendition s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionRendition)
val' <- (newPtr 32 ActionRendition) val
return val'
actionReadOcgState :: Action -> IO ActionOCGState
actionReadOcgState s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionOCGState)
val' <- (newPtr 24 ActionOCGState) val
return val'
actionReadJavascript :: Action -> IO ActionJavascript
actionReadJavascript s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ActionJavascript)
val' <- (newPtr 24 ActionJavascript) val
return val'
foreign import ccall "poppler_action_copy" poppler_action_copy ::
Ptr Action ->
IO (Ptr Action)
actionCopy ::
(MonadIO m) =>
Action ->
m Action
actionCopy _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
result <- poppler_action_copy _obj'
checkUnexpectedReturnNULL "poppler_action_copy" result
result' <- (wrapBoxed Action) result
touchManagedPtr _obj
return result'
foreign import ccall "poppler_action_free" poppler_action_free ::
Ptr Action ->
IO ()
actionFree ::
(MonadIO m) =>
Action ->
m ()
actionFree _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
poppler_action_free _obj'
touchManagedPtr _obj
return ()