{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Poppler.Objects.AnnotFreeText
(
AnnotFreeText(..) ,
IsAnnotFreeText ,
toAnnotFreeText ,
#if defined(ENABLE_OVERLOADING)
ResolveAnnotFreeTextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AnnotFreeTextGetCalloutLineMethodInfo ,
#endif
annotFreeTextGetCalloutLine ,
#if defined(ENABLE_OVERLOADING)
AnnotFreeTextGetQuaddingMethodInfo ,
#endif
annotFreeTextGetQuadding ,
) 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.GArray as B.GArray
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.Coerce as Coerce
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 GHC.Records as R
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.Objects.AnnotMarkup as Poppler.AnnotMarkup
import {-# SOURCE #-} qualified GI.Poppler.Structs.AnnotCalloutLine as Poppler.AnnotCalloutLine
newtype AnnotFreeText = AnnotFreeText (SP.ManagedPtr AnnotFreeText)
deriving (AnnotFreeText -> AnnotFreeText -> Bool
(AnnotFreeText -> AnnotFreeText -> Bool)
-> (AnnotFreeText -> AnnotFreeText -> Bool) -> Eq AnnotFreeText
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnnotFreeText -> AnnotFreeText -> Bool
$c/= :: AnnotFreeText -> AnnotFreeText -> Bool
== :: AnnotFreeText -> AnnotFreeText -> Bool
$c== :: AnnotFreeText -> AnnotFreeText -> Bool
Eq)
instance SP.ManagedPtrNewtype AnnotFreeText where
toManagedPtr :: AnnotFreeText -> ManagedPtr AnnotFreeText
toManagedPtr (AnnotFreeText ManagedPtr AnnotFreeText
p) = ManagedPtr AnnotFreeText
p
foreign import ccall "poppler_annot_free_text_get_type"
c_poppler_annot_free_text_get_type :: IO B.Types.GType
instance B.Types.TypedObject AnnotFreeText where
glibType :: IO GType
glibType = IO GType
c_poppler_annot_free_text_get_type
instance B.Types.GObject AnnotFreeText
class (SP.GObject o, O.IsDescendantOf AnnotFreeText o) => IsAnnotFreeText o
instance (SP.GObject o, O.IsDescendantOf AnnotFreeText o) => IsAnnotFreeText o
instance O.HasParentTypes AnnotFreeText
type instance O.ParentTypes AnnotFreeText = '[Poppler.AnnotMarkup.AnnotMarkup, Poppler.Annot.Annot, GObject.Object.Object]
toAnnotFreeText :: (MIO.MonadIO m, IsAnnotFreeText o) => o -> m AnnotFreeText
toAnnotFreeText :: forall (m :: * -> *) o.
(MonadIO m, IsAnnotFreeText o) =>
o -> m AnnotFreeText
toAnnotFreeText = IO AnnotFreeText -> m AnnotFreeText
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO AnnotFreeText -> m AnnotFreeText)
-> (o -> IO AnnotFreeText) -> o -> m AnnotFreeText
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AnnotFreeText -> AnnotFreeText)
-> o -> IO AnnotFreeText
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr AnnotFreeText -> AnnotFreeText
AnnotFreeText
instance B.GValue.IsGValue (Maybe AnnotFreeText) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_poppler_annot_free_text_get_type
gvalueSet_ :: Ptr GValue -> Maybe AnnotFreeText -> IO ()
gvalueSet_ Ptr GValue
gv Maybe AnnotFreeText
P.Nothing = Ptr GValue -> Ptr AnnotFreeText -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr AnnotFreeText
forall a. Ptr a
FP.nullPtr :: FP.Ptr AnnotFreeText)
gvalueSet_ Ptr GValue
gv (P.Just AnnotFreeText
obj) = AnnotFreeText -> (Ptr AnnotFreeText -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AnnotFreeText
obj (Ptr GValue -> Ptr AnnotFreeText -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe AnnotFreeText)
gvalueGet_ Ptr GValue
gv = do
Ptr AnnotFreeText
ptr <- Ptr GValue -> IO (Ptr AnnotFreeText)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr AnnotFreeText)
if Ptr AnnotFreeText
ptr Ptr AnnotFreeText -> Ptr AnnotFreeText -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr AnnotFreeText
forall a. Ptr a
FP.nullPtr
then AnnotFreeText -> Maybe AnnotFreeText
forall a. a -> Maybe a
P.Just (AnnotFreeText -> Maybe AnnotFreeText)
-> IO AnnotFreeText -> IO (Maybe AnnotFreeText)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr AnnotFreeText -> AnnotFreeText)
-> Ptr AnnotFreeText -> IO AnnotFreeText
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AnnotFreeText -> AnnotFreeText
AnnotFreeText Ptr AnnotFreeText
ptr
else Maybe AnnotFreeText -> IO (Maybe AnnotFreeText)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe AnnotFreeText
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAnnotFreeTextMethod (t :: Symbol) (o :: *) :: * where
ResolveAnnotFreeTextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAnnotFreeTextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAnnotFreeTextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAnnotFreeTextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAnnotFreeTextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAnnotFreeTextMethod "hasPopup" o = Poppler.AnnotMarkup.AnnotMarkupHasPopupMethodInfo
ResolveAnnotFreeTextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAnnotFreeTextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAnnotFreeTextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAnnotFreeTextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAnnotFreeTextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAnnotFreeTextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAnnotFreeTextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAnnotFreeTextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAnnotFreeTextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAnnotFreeTextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAnnotFreeTextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAnnotFreeTextMethod "getAnnotType" o = Poppler.Annot.AnnotGetAnnotTypeMethodInfo
ResolveAnnotFreeTextMethod "getCalloutLine" o = AnnotFreeTextGetCalloutLineMethodInfo
ResolveAnnotFreeTextMethod "getColor" o = Poppler.Annot.AnnotGetColorMethodInfo
ResolveAnnotFreeTextMethod "getContents" o = Poppler.Annot.AnnotGetContentsMethodInfo
ResolveAnnotFreeTextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAnnotFreeTextMethod "getDate" o = Poppler.AnnotMarkup.AnnotMarkupGetDateMethodInfo
ResolveAnnotFreeTextMethod "getExternalData" o = Poppler.AnnotMarkup.AnnotMarkupGetExternalDataMethodInfo
ResolveAnnotFreeTextMethod "getFlags" o = Poppler.Annot.AnnotGetFlagsMethodInfo
ResolveAnnotFreeTextMethod "getLabel" o = Poppler.AnnotMarkup.AnnotMarkupGetLabelMethodInfo
ResolveAnnotFreeTextMethod "getModified" o = Poppler.Annot.AnnotGetModifiedMethodInfo
ResolveAnnotFreeTextMethod "getName" o = Poppler.Annot.AnnotGetNameMethodInfo
ResolveAnnotFreeTextMethod "getOpacity" o = Poppler.AnnotMarkup.AnnotMarkupGetOpacityMethodInfo
ResolveAnnotFreeTextMethod "getPageIndex" o = Poppler.Annot.AnnotGetPageIndexMethodInfo
ResolveAnnotFreeTextMethod "getPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupIsOpenMethodInfo
ResolveAnnotFreeTextMethod "getPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupRectangleMethodInfo
ResolveAnnotFreeTextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAnnotFreeTextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAnnotFreeTextMethod "getQuadding" o = AnnotFreeTextGetQuaddingMethodInfo
ResolveAnnotFreeTextMethod "getRectangle" o = Poppler.Annot.AnnotGetRectangleMethodInfo
ResolveAnnotFreeTextMethod "getReplyTo" o = Poppler.AnnotMarkup.AnnotMarkupGetReplyToMethodInfo
ResolveAnnotFreeTextMethod "getSubject" o = Poppler.AnnotMarkup.AnnotMarkupGetSubjectMethodInfo
ResolveAnnotFreeTextMethod "setColor" o = Poppler.Annot.AnnotSetColorMethodInfo
ResolveAnnotFreeTextMethod "setContents" o = Poppler.Annot.AnnotSetContentsMethodInfo
ResolveAnnotFreeTextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAnnotFreeTextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAnnotFreeTextMethod "setFlags" o = Poppler.Annot.AnnotSetFlagsMethodInfo
ResolveAnnotFreeTextMethod "setLabel" o = Poppler.AnnotMarkup.AnnotMarkupSetLabelMethodInfo
ResolveAnnotFreeTextMethod "setOpacity" o = Poppler.AnnotMarkup.AnnotMarkupSetOpacityMethodInfo
ResolveAnnotFreeTextMethod "setPopup" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupMethodInfo
ResolveAnnotFreeTextMethod "setPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupIsOpenMethodInfo
ResolveAnnotFreeTextMethod "setPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupRectangleMethodInfo
ResolveAnnotFreeTextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAnnotFreeTextMethod "setRectangle" o = Poppler.Annot.AnnotSetRectangleMethodInfo
ResolveAnnotFreeTextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAnnotFreeTextMethod t AnnotFreeText, O.OverloadedMethod info AnnotFreeText p) => OL.IsLabel t (AnnotFreeText -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveAnnotFreeTextMethod t AnnotFreeText, O.OverloadedMethod info AnnotFreeText p, R.HasField t AnnotFreeText p) => R.HasField t AnnotFreeText p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAnnotFreeTextMethod t AnnotFreeText, O.OverloadedMethodInfo info AnnotFreeText) => OL.IsLabel t (O.MethodProxy info AnnotFreeText) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AnnotFreeText
type instance O.AttributeList AnnotFreeText = AnnotFreeTextAttributeList
type AnnotFreeTextAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AnnotFreeText = AnnotFreeTextSignalList
type AnnotFreeTextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_annot_free_text_get_callout_line" poppler_annot_free_text_get_callout_line ::
Ptr AnnotFreeText ->
IO (Ptr Poppler.AnnotCalloutLine.AnnotCalloutLine)
annotFreeTextGetCalloutLine ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotFreeText a) =>
a
-> m Poppler.AnnotCalloutLine.AnnotCalloutLine
annotFreeTextGetCalloutLine :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAnnotFreeText a) =>
a -> m AnnotCalloutLine
annotFreeTextGetCalloutLine a
popplerAnnot = IO AnnotCalloutLine -> m AnnotCalloutLine
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AnnotCalloutLine -> m AnnotCalloutLine)
-> IO AnnotCalloutLine -> m AnnotCalloutLine
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotFreeText
popplerAnnot' <- a -> IO (Ptr AnnotFreeText)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
Ptr AnnotCalloutLine
result <- Ptr AnnotFreeText -> IO (Ptr AnnotCalloutLine)
poppler_annot_free_text_get_callout_line Ptr AnnotFreeText
popplerAnnot'
Text -> Ptr AnnotCalloutLine -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"annotFreeTextGetCalloutLine" Ptr AnnotCalloutLine
result
AnnotCalloutLine
result' <- ((ManagedPtr AnnotCalloutLine -> AnnotCalloutLine)
-> Ptr AnnotCalloutLine -> IO AnnotCalloutLine
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AnnotCalloutLine -> AnnotCalloutLine
Poppler.AnnotCalloutLine.AnnotCalloutLine) Ptr AnnotCalloutLine
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
AnnotCalloutLine -> IO AnnotCalloutLine
forall (m :: * -> *) a. Monad m => a -> m a
return AnnotCalloutLine
result'
#if defined(ENABLE_OVERLOADING)
data AnnotFreeTextGetCalloutLineMethodInfo
instance (signature ~ (m Poppler.AnnotCalloutLine.AnnotCalloutLine), MonadIO m, IsAnnotFreeText a) => O.OverloadedMethod AnnotFreeTextGetCalloutLineMethodInfo a signature where
overloadedMethod = annotFreeTextGetCalloutLine
instance O.OverloadedMethodInfo AnnotFreeTextGetCalloutLineMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Poppler.Objects.AnnotFreeText.annotFreeTextGetCalloutLine",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-poppler-0.18.26/docs/GI-Poppler-Objects-AnnotFreeText.html#v:annotFreeTextGetCalloutLine"
})
#endif
foreign import ccall "poppler_annot_free_text_get_quadding" poppler_annot_free_text_get_quadding ::
Ptr AnnotFreeText ->
IO CUInt
annotFreeTextGetQuadding ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotFreeText a) =>
a
-> m Poppler.Enums.AnnotFreeTextQuadding
annotFreeTextGetQuadding :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAnnotFreeText a) =>
a -> m AnnotFreeTextQuadding
annotFreeTextGetQuadding a
popplerAnnot = IO AnnotFreeTextQuadding -> m AnnotFreeTextQuadding
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AnnotFreeTextQuadding -> m AnnotFreeTextQuadding)
-> IO AnnotFreeTextQuadding -> m AnnotFreeTextQuadding
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotFreeText
popplerAnnot' <- a -> IO (Ptr AnnotFreeText)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
CUInt
result <- Ptr AnnotFreeText -> IO CUInt
poppler_annot_free_text_get_quadding Ptr AnnotFreeText
popplerAnnot'
let result' :: AnnotFreeTextQuadding
result' = (Int -> AnnotFreeTextQuadding
forall a. Enum a => Int -> a
toEnum (Int -> AnnotFreeTextQuadding)
-> (CUInt -> Int) -> CUInt -> AnnotFreeTextQuadding
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
AnnotFreeTextQuadding -> IO AnnotFreeTextQuadding
forall (m :: * -> *) a. Monad m => a -> m a
return AnnotFreeTextQuadding
result'
#if defined(ENABLE_OVERLOADING)
data AnnotFreeTextGetQuaddingMethodInfo
instance (signature ~ (m Poppler.Enums.AnnotFreeTextQuadding), MonadIO m, IsAnnotFreeText a) => O.OverloadedMethod AnnotFreeTextGetQuaddingMethodInfo a signature where
overloadedMethod = annotFreeTextGetQuadding
instance O.OverloadedMethodInfo AnnotFreeTextGetQuaddingMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Poppler.Objects.AnnotFreeText.annotFreeTextGetQuadding",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-poppler-0.18.26/docs/GI-Poppler-Objects-AnnotFreeText.html#v:annotFreeTextGetQuadding"
})
#endif