{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Poppler.Objects.AnnotMarkup
(
AnnotMarkup(..) ,
IsAnnotMarkup ,
toAnnotMarkup ,
#if defined(ENABLE_OVERLOADING)
ResolveAnnotMarkupMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetDateMethodInfo ,
#endif
annotMarkupGetDate ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetExternalDataMethodInfo ,
#endif
annotMarkupGetExternalData ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetLabelMethodInfo ,
#endif
annotMarkupGetLabel ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetOpacityMethodInfo ,
#endif
annotMarkupGetOpacity ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetPopupIsOpenMethodInfo ,
#endif
annotMarkupGetPopupIsOpen ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetPopupRectangleMethodInfo ,
#endif
annotMarkupGetPopupRectangle ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetReplyToMethodInfo ,
#endif
annotMarkupGetReplyTo ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupGetSubjectMethodInfo ,
#endif
annotMarkupGetSubject ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupHasPopupMethodInfo ,
#endif
annotMarkupHasPopup ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupSetLabelMethodInfo ,
#endif
annotMarkupSetLabel ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupSetOpacityMethodInfo ,
#endif
annotMarkupSetOpacity ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupSetPopupMethodInfo ,
#endif
annotMarkupSetPopup ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupSetPopupIsOpenMethodInfo ,
#endif
annotMarkupSetPopupIsOpen ,
#if defined(ENABLE_OVERLOADING)
AnnotMarkupSetPopupRectangleMethodInfo ,
#endif
annotMarkupSetPopupRectangle ,
) 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.BasicTypes as B.Types
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
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 qualified GI.GLib.Structs.Date as GLib.Date
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
import {-# SOURCE #-} qualified GI.Poppler.Objects.Annot as Poppler.Annot
import {-# SOURCE #-} qualified GI.Poppler.Structs.Rectangle as Poppler.Rectangle
newtype AnnotMarkup = AnnotMarkup (SP.ManagedPtr AnnotMarkup)
deriving (AnnotMarkup -> AnnotMarkup -> Bool
(AnnotMarkup -> AnnotMarkup -> Bool)
-> (AnnotMarkup -> AnnotMarkup -> Bool) -> Eq AnnotMarkup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnnotMarkup -> AnnotMarkup -> Bool
$c/= :: AnnotMarkup -> AnnotMarkup -> Bool
== :: AnnotMarkup -> AnnotMarkup -> Bool
$c== :: AnnotMarkup -> AnnotMarkup -> Bool
Eq)
instance SP.ManagedPtrNewtype AnnotMarkup where
toManagedPtr :: AnnotMarkup -> ManagedPtr AnnotMarkup
toManagedPtr (AnnotMarkup ManagedPtr AnnotMarkup
p) = ManagedPtr AnnotMarkup
p
foreign import ccall "poppler_annot_markup_get_type"
c_poppler_annot_markup_get_type :: IO B.Types.GType
instance B.Types.TypedObject AnnotMarkup where
glibType :: IO GType
glibType = IO GType
c_poppler_annot_markup_get_type
instance B.Types.GObject AnnotMarkup
instance B.GValue.IsGValue AnnotMarkup where
toGValue :: AnnotMarkup -> IO GValue
toGValue AnnotMarkup
o = do
GType
gtype <- IO GType
c_poppler_annot_markup_get_type
AnnotMarkup -> (Ptr AnnotMarkup -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AnnotMarkup
o (GType
-> (GValue -> Ptr AnnotMarkup -> IO ())
-> Ptr AnnotMarkup
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr AnnotMarkup -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO AnnotMarkup
fromGValue GValue
gv = do
Ptr AnnotMarkup
ptr <- GValue -> IO (Ptr AnnotMarkup)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr AnnotMarkup)
(ManagedPtr AnnotMarkup -> AnnotMarkup)
-> Ptr AnnotMarkup -> IO AnnotMarkup
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AnnotMarkup -> AnnotMarkup
AnnotMarkup Ptr AnnotMarkup
ptr
class (SP.GObject o, O.IsDescendantOf AnnotMarkup o) => IsAnnotMarkup o
instance (SP.GObject o, O.IsDescendantOf AnnotMarkup o) => IsAnnotMarkup o
instance O.HasParentTypes AnnotMarkup
type instance O.ParentTypes AnnotMarkup = '[Poppler.Annot.Annot, GObject.Object.Object]
toAnnotMarkup :: (MonadIO m, IsAnnotMarkup o) => o -> m AnnotMarkup
toAnnotMarkup :: o -> m AnnotMarkup
toAnnotMarkup = IO AnnotMarkup -> m AnnotMarkup
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AnnotMarkup -> m AnnotMarkup)
-> (o -> IO AnnotMarkup) -> o -> m AnnotMarkup
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AnnotMarkup -> AnnotMarkup) -> o -> IO AnnotMarkup
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr AnnotMarkup -> AnnotMarkup
AnnotMarkup
#if defined(ENABLE_OVERLOADING)
type family ResolveAnnotMarkupMethod (t :: Symbol) (o :: *) :: * where
ResolveAnnotMarkupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAnnotMarkupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAnnotMarkupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAnnotMarkupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAnnotMarkupMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAnnotMarkupMethod "hasPopup" o = AnnotMarkupHasPopupMethodInfo
ResolveAnnotMarkupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAnnotMarkupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAnnotMarkupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAnnotMarkupMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAnnotMarkupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAnnotMarkupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAnnotMarkupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAnnotMarkupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAnnotMarkupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAnnotMarkupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAnnotMarkupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAnnotMarkupMethod "getAnnotType" o = Poppler.Annot.AnnotGetAnnotTypeMethodInfo
ResolveAnnotMarkupMethod "getColor" o = Poppler.Annot.AnnotGetColorMethodInfo
ResolveAnnotMarkupMethod "getContents" o = Poppler.Annot.AnnotGetContentsMethodInfo
ResolveAnnotMarkupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAnnotMarkupMethod "getDate" o = AnnotMarkupGetDateMethodInfo
ResolveAnnotMarkupMethod "getExternalData" o = AnnotMarkupGetExternalDataMethodInfo
ResolveAnnotMarkupMethod "getFlags" o = Poppler.Annot.AnnotGetFlagsMethodInfo
ResolveAnnotMarkupMethod "getLabel" o = AnnotMarkupGetLabelMethodInfo
ResolveAnnotMarkupMethod "getModified" o = Poppler.Annot.AnnotGetModifiedMethodInfo
ResolveAnnotMarkupMethod "getName" o = Poppler.Annot.AnnotGetNameMethodInfo
ResolveAnnotMarkupMethod "getOpacity" o = AnnotMarkupGetOpacityMethodInfo
ResolveAnnotMarkupMethod "getPageIndex" o = Poppler.Annot.AnnotGetPageIndexMethodInfo
ResolveAnnotMarkupMethod "getPopupIsOpen" o = AnnotMarkupGetPopupIsOpenMethodInfo
ResolveAnnotMarkupMethod "getPopupRectangle" o = AnnotMarkupGetPopupRectangleMethodInfo
ResolveAnnotMarkupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAnnotMarkupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAnnotMarkupMethod "getRectangle" o = Poppler.Annot.AnnotGetRectangleMethodInfo
ResolveAnnotMarkupMethod "getReplyTo" o = AnnotMarkupGetReplyToMethodInfo
ResolveAnnotMarkupMethod "getSubject" o = AnnotMarkupGetSubjectMethodInfo
ResolveAnnotMarkupMethod "setColor" o = Poppler.Annot.AnnotSetColorMethodInfo
ResolveAnnotMarkupMethod "setContents" o = Poppler.Annot.AnnotSetContentsMethodInfo
ResolveAnnotMarkupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAnnotMarkupMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAnnotMarkupMethod "setFlags" o = Poppler.Annot.AnnotSetFlagsMethodInfo
ResolveAnnotMarkupMethod "setLabel" o = AnnotMarkupSetLabelMethodInfo
ResolveAnnotMarkupMethod "setOpacity" o = AnnotMarkupSetOpacityMethodInfo
ResolveAnnotMarkupMethod "setPopup" o = AnnotMarkupSetPopupMethodInfo
ResolveAnnotMarkupMethod "setPopupIsOpen" o = AnnotMarkupSetPopupIsOpenMethodInfo
ResolveAnnotMarkupMethod "setPopupRectangle" o = AnnotMarkupSetPopupRectangleMethodInfo
ResolveAnnotMarkupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAnnotMarkupMethod "setRectangle" o = Poppler.Annot.AnnotSetRectangleMethodInfo
ResolveAnnotMarkupMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAnnotMarkupMethod t AnnotMarkup, O.MethodInfo info AnnotMarkup p) => OL.IsLabel t (AnnotMarkup -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AnnotMarkup
type instance O.AttributeList AnnotMarkup = AnnotMarkupAttributeList
type AnnotMarkupAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AnnotMarkup = AnnotMarkupSignalList
type AnnotMarkupSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_annot_markup_get_date" poppler_annot_markup_get_date ::
Ptr AnnotMarkup ->
IO (Ptr GLib.Date.Date)
annotMarkupGetDate ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m GLib.Date.Date
annotMarkupGetDate :: a -> m Date
annotMarkupGetDate a
popplerAnnot = IO Date -> m Date
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Date -> m Date) -> IO Date -> m Date
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
Ptr Date
result <- Ptr AnnotMarkup -> IO (Ptr Date)
poppler_annot_markup_get_date Ptr AnnotMarkup
popplerAnnot'
Text -> Ptr Date -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"annotMarkupGetDate" Ptr Date
result
Date
result' <- ((ManagedPtr Date -> Date) -> Ptr Date -> IO Date
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Date -> Date
GLib.Date.Date) Ptr Date
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Date -> IO Date
forall (m :: * -> *) a. Monad m => a -> m a
return Date
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetDateMethodInfo
instance (signature ~ (m GLib.Date.Date), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetDateMethodInfo a signature where
overloadedMethod = annotMarkupGetDate
#endif
foreign import ccall "poppler_annot_markup_get_external_data" poppler_annot_markup_get_external_data ::
Ptr AnnotMarkup ->
IO CUInt
annotMarkupGetExternalData ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m Poppler.Enums.AnnotExternalDataType
annotMarkupGetExternalData :: a -> m AnnotExternalDataType
annotMarkupGetExternalData a
popplerAnnot = IO AnnotExternalDataType -> m AnnotExternalDataType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AnnotExternalDataType -> m AnnotExternalDataType)
-> IO AnnotExternalDataType -> m AnnotExternalDataType
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CUInt
result <- Ptr AnnotMarkup -> IO CUInt
poppler_annot_markup_get_external_data Ptr AnnotMarkup
popplerAnnot'
let result' :: AnnotExternalDataType
result' = (Int -> AnnotExternalDataType
forall a. Enum a => Int -> a
toEnum (Int -> AnnotExternalDataType)
-> (CUInt -> Int) -> CUInt -> AnnotExternalDataType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
AnnotExternalDataType -> IO AnnotExternalDataType
forall (m :: * -> *) a. Monad m => a -> m a
return AnnotExternalDataType
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetExternalDataMethodInfo
instance (signature ~ (m Poppler.Enums.AnnotExternalDataType), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetExternalDataMethodInfo a signature where
overloadedMethod = annotMarkupGetExternalData
#endif
foreign import ccall "poppler_annot_markup_get_label" poppler_annot_markup_get_label ::
Ptr AnnotMarkup ->
IO CString
annotMarkupGetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m T.Text
annotMarkupGetLabel :: a -> m Text
annotMarkupGetLabel a
popplerAnnot = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CString
result <- Ptr AnnotMarkup -> IO CString
poppler_annot_markup_get_label Ptr AnnotMarkup
popplerAnnot'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"annotMarkupGetLabel" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetLabelMethodInfo a signature where
overloadedMethod = annotMarkupGetLabel
#endif
foreign import ccall "poppler_annot_markup_get_opacity" poppler_annot_markup_get_opacity ::
Ptr AnnotMarkup ->
IO CDouble
annotMarkupGetOpacity ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m Double
annotMarkupGetOpacity :: a -> m Double
annotMarkupGetOpacity a
popplerAnnot = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CDouble
result <- Ptr AnnotMarkup -> IO CDouble
poppler_annot_markup_get_opacity Ptr AnnotMarkup
popplerAnnot'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetOpacityMethodInfo
instance (signature ~ (m Double), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetOpacityMethodInfo a signature where
overloadedMethod = annotMarkupGetOpacity
#endif
foreign import ccall "poppler_annot_markup_get_popup_is_open" ::
Ptr AnnotMarkup ->
IO CInt
annotMarkupGetPopupIsOpen ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m Bool
a
popplerAnnot = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CInt
result <- Ptr AnnotMarkup -> IO CInt
poppler_annot_markup_get_popup_is_open Ptr AnnotMarkup
popplerAnnot'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetPopupIsOpenMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetPopupIsOpenMethodInfo a signature where
overloadedMethod = annotMarkupGetPopupIsOpen
#endif
foreign import ccall "poppler_annot_markup_get_popup_rectangle" ::
Ptr AnnotMarkup ->
Ptr Poppler.Rectangle.Rectangle ->
IO CInt
annotMarkupGetPopupRectangle ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m ((Bool, Poppler.Rectangle.Rectangle))
a
popplerAnnot = IO (Bool, Rectangle) -> m (Bool, Rectangle)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Rectangle) -> m (Bool, Rectangle))
-> IO (Bool, Rectangle) -> m (Bool, Rectangle)
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
Ptr Rectangle
popplerRect <- Int -> IO (Ptr Rectangle)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Poppler.Rectangle.Rectangle)
CInt
result <- Ptr AnnotMarkup -> Ptr Rectangle -> IO CInt
poppler_annot_markup_get_popup_rectangle Ptr AnnotMarkup
popplerAnnot' Ptr Rectangle
popplerRect
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Rectangle
popplerRect' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Poppler.Rectangle.Rectangle) Ptr Rectangle
popplerRect
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
(Bool, Rectangle) -> IO (Bool, Rectangle)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Rectangle
popplerRect')
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetPopupRectangleMethodInfo
instance (signature ~ (m ((Bool, Poppler.Rectangle.Rectangle))), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetPopupRectangleMethodInfo a signature where
overloadedMethod = annotMarkupGetPopupRectangle
#endif
foreign import ccall "poppler_annot_markup_get_reply_to" poppler_annot_markup_get_reply_to ::
Ptr AnnotMarkup ->
IO CUInt
annotMarkupGetReplyTo ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m Poppler.Enums.AnnotMarkupReplyType
annotMarkupGetReplyTo :: a -> m AnnotMarkupReplyType
annotMarkupGetReplyTo a
popplerAnnot = IO AnnotMarkupReplyType -> m AnnotMarkupReplyType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AnnotMarkupReplyType -> m AnnotMarkupReplyType)
-> IO AnnotMarkupReplyType -> m AnnotMarkupReplyType
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CUInt
result <- Ptr AnnotMarkup -> IO CUInt
poppler_annot_markup_get_reply_to Ptr AnnotMarkup
popplerAnnot'
let result' :: AnnotMarkupReplyType
result' = (Int -> AnnotMarkupReplyType
forall a. Enum a => Int -> a
toEnum (Int -> AnnotMarkupReplyType)
-> (CUInt -> Int) -> CUInt -> AnnotMarkupReplyType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
AnnotMarkupReplyType -> IO AnnotMarkupReplyType
forall (m :: * -> *) a. Monad m => a -> m a
return AnnotMarkupReplyType
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetReplyToMethodInfo
instance (signature ~ (m Poppler.Enums.AnnotMarkupReplyType), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetReplyToMethodInfo a signature where
overloadedMethod = annotMarkupGetReplyTo
#endif
foreign import ccall "poppler_annot_markup_get_subject" poppler_annot_markup_get_subject ::
Ptr AnnotMarkup ->
IO CString
annotMarkupGetSubject ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m T.Text
annotMarkupGetSubject :: a -> m Text
annotMarkupGetSubject a
popplerAnnot = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CString
result <- Ptr AnnotMarkup -> IO CString
poppler_annot_markup_get_subject Ptr AnnotMarkup
popplerAnnot'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"annotMarkupGetSubject" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupGetSubjectMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetSubjectMethodInfo a signature where
overloadedMethod = annotMarkupGetSubject
#endif
foreign import ccall "poppler_annot_markup_has_popup" ::
Ptr AnnotMarkup ->
IO CInt
annotMarkupHasPopup ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> m Bool
a
popplerAnnot = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CInt
result <- Ptr AnnotMarkup -> IO CInt
poppler_annot_markup_has_popup Ptr AnnotMarkup
popplerAnnot'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupHasPopupMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupHasPopupMethodInfo a signature where
overloadedMethod = annotMarkupHasPopup
#endif
foreign import ccall "poppler_annot_markup_set_label" poppler_annot_markup_set_label ::
Ptr AnnotMarkup ->
CString ->
IO ()
annotMarkupSetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> Maybe (T.Text)
-> m ()
annotMarkupSetLabel :: a -> Maybe Text -> m ()
annotMarkupSetLabel a
popplerAnnot Maybe Text
label = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CString
maybeLabel <- case Maybe Text
label of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jLabel -> do
CString
jLabel' <- Text -> IO CString
textToCString Text
jLabel
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jLabel'
Ptr AnnotMarkup -> CString -> IO ()
poppler_annot_markup_set_label Ptr AnnotMarkup
popplerAnnot' CString
maybeLabel
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeLabel
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupSetLabelMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetLabelMethodInfo a signature where
overloadedMethod = annotMarkupSetLabel
#endif
foreign import ccall "poppler_annot_markup_set_opacity" poppler_annot_markup_set_opacity ::
Ptr AnnotMarkup ->
CDouble ->
IO ()
annotMarkupSetOpacity ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> Double
-> m ()
annotMarkupSetOpacity :: a -> Double -> m ()
annotMarkupSetOpacity a
popplerAnnot Double
opacity = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
let opacity' :: CDouble
opacity' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
opacity
Ptr AnnotMarkup -> CDouble -> IO ()
poppler_annot_markup_set_opacity Ptr AnnotMarkup
popplerAnnot' CDouble
opacity'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupSetOpacityMethodInfo
instance (signature ~ (Double -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetOpacityMethodInfo a signature where
overloadedMethod = annotMarkupSetOpacity
#endif
foreign import ccall "poppler_annot_markup_set_popup" ::
Ptr AnnotMarkup ->
Ptr Poppler.Rectangle.Rectangle ->
IO ()
annotMarkupSetPopup ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> Poppler.Rectangle.Rectangle
-> m ()
a
popplerAnnot Rectangle
popupRect = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
Ptr Rectangle
popupRect' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
popupRect
Ptr AnnotMarkup -> Ptr Rectangle -> IO ()
poppler_annot_markup_set_popup Ptr AnnotMarkup
popplerAnnot' Ptr Rectangle
popupRect'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
popupRect
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupSetPopupMethodInfo
instance (signature ~ (Poppler.Rectangle.Rectangle -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetPopupMethodInfo a signature where
overloadedMethod = annotMarkupSetPopup
#endif
foreign import ccall "poppler_annot_markup_set_popup_is_open" ::
Ptr AnnotMarkup ->
CInt ->
IO ()
annotMarkupSetPopupIsOpen ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> Bool
-> m ()
a
popplerAnnot Bool
isOpen = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
let isOpen' :: CInt
isOpen' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
isOpen
Ptr AnnotMarkup -> CInt -> IO ()
poppler_annot_markup_set_popup_is_open Ptr AnnotMarkup
popplerAnnot' CInt
isOpen'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupSetPopupIsOpenMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetPopupIsOpenMethodInfo a signature where
overloadedMethod = annotMarkupSetPopupIsOpen
#endif
foreign import ccall "poppler_annot_markup_set_popup_rectangle" ::
Ptr AnnotMarkup ->
Ptr Poppler.Rectangle.Rectangle ->
IO ()
annotMarkupSetPopupRectangle ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
-> Poppler.Rectangle.Rectangle
-> m ()
a
popplerAnnot Rectangle
popplerRect = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotMarkup
popplerAnnot' <- a -> IO (Ptr AnnotMarkup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
Ptr Rectangle
popplerRect' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
popplerRect
Ptr AnnotMarkup -> Ptr Rectangle -> IO ()
poppler_annot_markup_set_popup_rectangle Ptr AnnotMarkup
popplerAnnot' Ptr Rectangle
popplerRect'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
popplerRect
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AnnotMarkupSetPopupRectangleMethodInfo
instance (signature ~ (Poppler.Rectangle.Rectangle -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetPopupRectangleMethodInfo a signature where
overloadedMethod = annotMarkupSetPopupRectangle
#endif