gi-poppler-0.18.17: GI/Poppler/Objects/AnnotMarkup.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
/No description available in the introspection data./
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Poppler.Objects.AnnotMarkup
(
-- * Exported types
AnnotMarkup(..) ,
IsAnnotMarkup ,
toAnnotMarkup ,
noAnnotMarkup ,
-- * Methods
-- ** getDate #method:getDate#
#if ENABLE_OVERLOADING
AnnotMarkupGetDateMethodInfo ,
#endif
annotMarkupGetDate ,
-- ** getExternalData #method:getExternalData#
#if ENABLE_OVERLOADING
AnnotMarkupGetExternalDataMethodInfo ,
#endif
annotMarkupGetExternalData ,
-- ** getLabel #method:getLabel#
#if ENABLE_OVERLOADING
AnnotMarkupGetLabelMethodInfo ,
#endif
annotMarkupGetLabel ,
-- ** getOpacity #method:getOpacity#
#if ENABLE_OVERLOADING
AnnotMarkupGetOpacityMethodInfo ,
#endif
annotMarkupGetOpacity ,
-- ** getPopupIsOpen #method:getPopupIsOpen#
#if ENABLE_OVERLOADING
AnnotMarkupGetPopupIsOpenMethodInfo ,
#endif
annotMarkupGetPopupIsOpen ,
-- ** getPopupRectangle #method:getPopupRectangle#
#if ENABLE_OVERLOADING
AnnotMarkupGetPopupRectangleMethodInfo ,
#endif
annotMarkupGetPopupRectangle ,
-- ** getReplyTo #method:getReplyTo#
#if ENABLE_OVERLOADING
AnnotMarkupGetReplyToMethodInfo ,
#endif
annotMarkupGetReplyTo ,
-- ** getSubject #method:getSubject#
#if ENABLE_OVERLOADING
AnnotMarkupGetSubjectMethodInfo ,
#endif
annotMarkupGetSubject ,
-- ** hasPopup #method:hasPopup#
#if ENABLE_OVERLOADING
AnnotMarkupHasPopupMethodInfo ,
#endif
annotMarkupHasPopup ,
-- ** setLabel #method:setLabel#
#if ENABLE_OVERLOADING
AnnotMarkupSetLabelMethodInfo ,
#endif
annotMarkupSetLabel ,
-- ** setOpacity #method:setOpacity#
#if ENABLE_OVERLOADING
AnnotMarkupSetOpacityMethodInfo ,
#endif
annotMarkupSetOpacity ,
-- ** setPopup #method:setPopup#
#if ENABLE_OVERLOADING
AnnotMarkupSetPopupMethodInfo ,
#endif
annotMarkupSetPopup ,
-- ** setPopupIsOpen #method:setPopupIsOpen#
#if ENABLE_OVERLOADING
AnnotMarkupSetPopupIsOpenMethodInfo ,
#endif
annotMarkupSetPopupIsOpen ,
-- ** setPopupRectangle #method:setPopupRectangle#
#if 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.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 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
-- | Memory-managed wrapper type.
newtype AnnotMarkup = AnnotMarkup (ManagedPtr AnnotMarkup)
foreign import ccall "poppler_annot_markup_get_type"
c_poppler_annot_markup_get_type :: IO GType
instance GObject AnnotMarkup where
gobjectType = c_poppler_annot_markup_get_type
-- | Type class for types which can be safely cast to `AnnotMarkup`, for instance with `toAnnotMarkup`.
class (GObject o, O.IsDescendantOf AnnotMarkup o) => IsAnnotMarkup o
instance (GObject o, O.IsDescendantOf AnnotMarkup o) => IsAnnotMarkup o
instance O.HasParentTypes AnnotMarkup
type instance O.ParentTypes AnnotMarkup = '[Poppler.Annot.Annot, GObject.Object.Object]
-- | Cast to `AnnotMarkup`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toAnnotMarkup :: (MonadIO m, IsAnnotMarkup o) => o -> m AnnotMarkup
toAnnotMarkup = liftIO . unsafeCastTo AnnotMarkup
-- | A convenience alias for `Nothing` :: `Maybe` `AnnotMarkup`.
noAnnotMarkup :: Maybe AnnotMarkup
noAnnotMarkup = Nothing
#if 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 "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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList AnnotMarkup
type instance O.AttributeList AnnotMarkup = AnnotMarkupAttributeList
type AnnotMarkupAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList AnnotMarkup = AnnotMarkupSignalList
type AnnotMarkupSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
-- method AnnotMarkup::get_date
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "Date"}))
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_date" poppler_annot_markup_get_date ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO (Ptr GLib.Date.Date)
{- |
Returns the date and time when the annotation was created
-}
annotMarkupGetDate ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m GLib.Date.Date
{- ^ __Returns:__ a 'GI.GLib.Structs.Date.Date' representing the date and time
when the annotation was created, or 'Nothing' -}
annotMarkupGetDate popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_get_date popplerAnnot'
checkUnexpectedReturnNULL "annotMarkupGetDate" result
result' <- (wrapBoxed GLib.Date.Date) result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupGetDateMethodInfo
instance (signature ~ (m GLib.Date.Date), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetDateMethodInfo a signature where
overloadedMethod _ = annotMarkupGetDate
#endif
-- method AnnotMarkup::get_external_data
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "AnnotExternalDataType"}))
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_external_data" poppler_annot_markup_get_external_data ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO CUInt
{- |
Gets the external data type of /@popplerAnnot@/.
-}
annotMarkupGetExternalData ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m Poppler.Enums.AnnotExternalDataType
{- ^ __Returns:__ 'GI.Poppler.Enums.AnnotExternalDataType' of /@popplerAnnot@/. -}
annotMarkupGetExternalData popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_get_external_data popplerAnnot'
let result' = (toEnum . fromIntegral) result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupGetExternalDataMethodInfo
instance (signature ~ (m Poppler.Enums.AnnotExternalDataType), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetExternalDataMethodInfo a signature where
overloadedMethod _ = annotMarkupGetExternalData
#endif
-- method AnnotMarkup::get_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_label" poppler_annot_markup_get_label ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO CString
{- |
Retrieves the label text of /@popplerAnnot@/.
-}
annotMarkupGetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m T.Text
{- ^ __Returns:__ the label text of /@popplerAnnot@/. -}
annotMarkupGetLabel popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_get_label popplerAnnot'
checkUnexpectedReturnNULL "annotMarkupGetLabel" result
result' <- cstringToText result
freeMem result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetLabelMethodInfo a signature where
overloadedMethod _ = annotMarkupGetLabel
#endif
-- method AnnotMarkup::get_opacity
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TDouble)
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_opacity" poppler_annot_markup_get_opacity ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO CDouble
{- |
Retrieves the opacity value of /@popplerAnnot@/.
-}
annotMarkupGetOpacity ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m Double
{- ^ __Returns:__ the opacity value of /@popplerAnnot@/,
between 0 (transparent) and 1 (opaque) -}
annotMarkupGetOpacity popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_get_opacity popplerAnnot'
let result' = realToFrac result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupGetOpacityMethodInfo
instance (signature ~ (m Double), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetOpacityMethodInfo a signature where
overloadedMethod _ = annotMarkupGetOpacity
#endif
-- method AnnotMarkup::get_popup_is_open
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_popup_is_open" poppler_annot_markup_get_popup_is_open ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO CInt
{- |
Retrieves the state of the popup window related to /@popplerAnnot@/.
-}
annotMarkupGetPopupIsOpen ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m Bool
{- ^ __Returns:__ the state of /@popplerAnnot@/. 'True' if it\'s open, 'False' in
other case. -}
annotMarkupGetPopupIsOpen popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_get_popup_is_open popplerAnnot'
let result' = (/= 0) result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupGetPopupIsOpenMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetPopupIsOpenMethodInfo a signature where
overloadedMethod _ = annotMarkupGetPopupIsOpen
#endif
-- method AnnotMarkup::get_popup_rectangle
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "poppler_rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle to store the popup rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_popup_rectangle" poppler_annot_markup_get_popup_rectangle ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
Ptr Poppler.Rectangle.Rectangle -> -- poppler_rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
IO CInt
{- |
Retrieves the rectangle of the popup window related to /@popplerAnnot@/.
/Since: 0.12/
-}
annotMarkupGetPopupRectangle ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m ((Bool, Poppler.Rectangle.Rectangle))
{- ^ __Returns:__ 'True' if 'GI.Poppler.Structs.Rectangle.Rectangle' was correctly filled, 'False' otherwise -}
annotMarkupGetPopupRectangle popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
popplerRect <- callocBoxedBytes 32 :: IO (Ptr Poppler.Rectangle.Rectangle)
result <- poppler_annot_markup_get_popup_rectangle popplerAnnot' popplerRect
let result' = (/= 0) result
popplerRect' <- (wrapBoxed Poppler.Rectangle.Rectangle) popplerRect
touchManagedPtr popplerAnnot
return (result', popplerRect')
#if ENABLE_OVERLOADING
data AnnotMarkupGetPopupRectangleMethodInfo
instance (signature ~ (m ((Bool, Poppler.Rectangle.Rectangle))), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetPopupRectangleMethodInfo a signature where
overloadedMethod _ = annotMarkupGetPopupRectangle
#endif
-- method AnnotMarkup::get_reply_to
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Poppler", name = "AnnotMarkupReplyType"}))
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_reply_to" poppler_annot_markup_get_reply_to ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO CUInt
{- |
Gets the reply type of /@popplerAnnot@/.
-}
annotMarkupGetReplyTo ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m Poppler.Enums.AnnotMarkupReplyType
{- ^ __Returns:__ 'GI.Poppler.Enums.AnnotMarkupReplyType' of /@popplerAnnot@/. -}
annotMarkupGetReplyTo popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_get_reply_to popplerAnnot'
let result' = (toEnum . fromIntegral) result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupGetReplyToMethodInfo
instance (signature ~ (m Poppler.Enums.AnnotMarkupReplyType), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetReplyToMethodInfo a signature where
overloadedMethod _ = annotMarkupGetReplyTo
#endif
-- method AnnotMarkup::get_subject
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_get_subject" poppler_annot_markup_get_subject ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO CString
{- |
Retrives the subject text of /@popplerAnnot@/.
-}
annotMarkupGetSubject ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m T.Text
{- ^ __Returns:__ the subject text of /@popplerAnnot@/. -}
annotMarkupGetSubject popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_get_subject popplerAnnot'
checkUnexpectedReturnNULL "annotMarkupGetSubject" result
result' <- cstringToText result
freeMem result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupGetSubjectMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupGetSubjectMethodInfo a signature where
overloadedMethod _ = annotMarkupGetSubject
#endif
-- method AnnotMarkup::has_popup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_has_popup" poppler_annot_markup_has_popup ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
IO CInt
{- |
Return 'True' if the markup annotation has a popup window associated
/Since: 0.12/
-}
annotMarkupHasPopup ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> m Bool
{- ^ __Returns:__ 'True', if /@popplerAnnot@/ has popup, 'False' otherwise -}
annotMarkupHasPopup popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_markup_has_popup popplerAnnot'
let result' = (/= 0) result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotMarkupHasPopupMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupHasPopupMethodInfo a signature where
overloadedMethod _ = annotMarkupHasPopup
#endif
-- method AnnotMarkup::set_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a text string containing the new label, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_set_label" poppler_annot_markup_set_label ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
CString -> -- label : TBasicType TUTF8
IO ()
{- |
Sets the label text of /@popplerAnnot@/, replacing the current one
/Since: 0.16/
-}
annotMarkupSetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> Maybe (T.Text)
{- ^ /@label@/: a text string containing the new label, or 'Nothing' -}
-> m ()
annotMarkupSetLabel popplerAnnot label = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
maybeLabel <- case label of
Nothing -> return nullPtr
Just jLabel -> do
jLabel' <- textToCString jLabel
return jLabel'
poppler_annot_markup_set_label popplerAnnot' maybeLabel
touchManagedPtr popplerAnnot
freeMem maybeLabel
return ()
#if ENABLE_OVERLOADING
data AnnotMarkupSetLabelMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetLabelMethodInfo a signature where
overloadedMethod _ = annotMarkupSetLabel
#endif
-- method AnnotMarkup::set_opacity
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "opacity", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a constant opacity value, between 0 (transparent) and 1 (opaque)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_set_opacity" poppler_annot_markup_set_opacity ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
CDouble -> -- opacity : TBasicType TDouble
IO ()
{- |
Sets the opacity of /@popplerAnnot@/. This value applies to
all visible elements of /@popplerAnnot@/ in its closed state,
but not to the pop-up window that appears when it\'s openened
/Since: 0.16/
-}
annotMarkupSetOpacity ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> Double
{- ^ /@opacity@/: a constant opacity value, between 0 (transparent) and 1 (opaque) -}
-> m ()
annotMarkupSetOpacity popplerAnnot opacity = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
let opacity' = realToFrac opacity
poppler_annot_markup_set_opacity popplerAnnot' opacity'
touchManagedPtr popplerAnnot
return ()
#if ENABLE_OVERLOADING
data AnnotMarkupSetOpacityMethodInfo
instance (signature ~ (Double -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetOpacityMethodInfo a signature where
overloadedMethod _ = annotMarkupSetOpacity
#endif
-- method AnnotMarkup::set_popup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "popup_rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_set_popup" poppler_annot_markup_set_popup ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
Ptr Poppler.Rectangle.Rectangle -> -- popup_rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
IO ()
{- |
Associates a new popup window for editing contents of /@popplerAnnot@/.
Popup window shall be displayed by viewers at /@popupRect@/ on the page.
/Since: 0.16/
-}
annotMarkupSetPopup ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> Poppler.Rectangle.Rectangle
{- ^ /@popupRect@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -}
-> m ()
annotMarkupSetPopup popplerAnnot popupRect = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
popupRect' <- unsafeManagedPtrGetPtr popupRect
poppler_annot_markup_set_popup popplerAnnot' popupRect'
touchManagedPtr popplerAnnot
touchManagedPtr popupRect
return ()
#if ENABLE_OVERLOADING
data AnnotMarkupSetPopupMethodInfo
instance (signature ~ (Poppler.Rectangle.Rectangle -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetPopupMethodInfo a signature where
overloadedMethod _ = annotMarkupSetPopup
#endif
-- method AnnotMarkup::set_popup_is_open
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "is_open", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether popup window should initially be displayed open", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_set_popup_is_open" poppler_annot_markup_set_popup_is_open ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
CInt -> -- is_open : TBasicType TBoolean
IO ()
{- |
Sets the state of the popup window related to /@popplerAnnot@/.
/Since: 0.16/
-}
annotMarkupSetPopupIsOpen ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> Bool
{- ^ /@isOpen@/: whether popup window should initially be displayed open -}
-> m ()
annotMarkupSetPopupIsOpen popplerAnnot isOpen = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
let isOpen' = (fromIntegral . fromEnum) isOpen
poppler_annot_markup_set_popup_is_open popplerAnnot' isOpen'
touchManagedPtr popplerAnnot
return ()
#if ENABLE_OVERLOADING
data AnnotMarkupSetPopupIsOpenMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetPopupIsOpenMethodInfo a signature where
overloadedMethod _ = annotMarkupSetPopupIsOpen
#endif
-- method AnnotMarkup::set_popup_rectangle
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "poppler_annot", argType = TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnotMarkup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "poppler_rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle to set", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "poppler_annot_markup_set_popup_rectangle" poppler_annot_markup_set_popup_rectangle ::
Ptr AnnotMarkup -> -- poppler_annot : TInterface (Name {namespace = "Poppler", name = "AnnotMarkup"})
Ptr Poppler.Rectangle.Rectangle -> -- poppler_rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"})
IO ()
{- |
Sets the rectangle of the popup window related to /@popplerAnnot@/.
This doesn\'t have any effect if /@popplerAnnot@/ doesn\'t have a
popup associated, use 'GI.Poppler.Objects.AnnotMarkup.annotMarkupSetPopup' to associate
a popup window to a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup'.
/Since: 0.33/
-}
annotMarkupSetPopupRectangle ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotMarkup a) =>
a
{- ^ /@popplerAnnot@/: a 'GI.Poppler.Objects.AnnotMarkup.AnnotMarkup' -}
-> Poppler.Rectangle.Rectangle
{- ^ /@popplerRect@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' to set -}
-> m ()
annotMarkupSetPopupRectangle popplerAnnot popplerRect = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
popplerRect' <- unsafeManagedPtrGetPtr popplerRect
poppler_annot_markup_set_popup_rectangle popplerAnnot' popplerRect'
touchManagedPtr popplerAnnot
touchManagedPtr popplerRect
return ()
#if ENABLE_OVERLOADING
data AnnotMarkupSetPopupRectangleMethodInfo
instance (signature ~ (Poppler.Rectangle.Rectangle -> m ()), MonadIO m, IsAnnotMarkup a) => O.MethodInfo AnnotMarkupSetPopupRectangleMethodInfo a signature where
overloadedMethod _ = annotMarkupSetPopupRectangle
#endif