{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Poppler.Objects.Page
(
Page(..) ,
IsPage ,
toPage ,
#if defined(ENABLE_OVERLOADING)
ResolvePageMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PageAddAnnotMethodInfo ,
#endif
pageAddAnnot ,
#if defined(ENABLE_OVERLOADING)
PageFindTextMethodInfo ,
#endif
pageFindText ,
#if defined(ENABLE_OVERLOADING)
PageFindTextWithOptionsMethodInfo ,
#endif
pageFindTextWithOptions ,
pageFreeAnnotMapping ,
pageFreeFormFieldMapping ,
pageFreeImageMapping ,
pageFreeLinkMapping ,
pageFreeTextAttributes ,
#if defined(ENABLE_OVERLOADING)
PageGetAnnotMappingMethodInfo ,
#endif
pageGetAnnotMapping ,
#if defined(ENABLE_OVERLOADING)
PageGetCropBoxMethodInfo ,
#endif
pageGetCropBox ,
#if defined(ENABLE_OVERLOADING)
PageGetDurationMethodInfo ,
#endif
pageGetDuration ,
#if defined(ENABLE_OVERLOADING)
PageGetFormFieldMappingMethodInfo ,
#endif
pageGetFormFieldMapping ,
#if defined(ENABLE_OVERLOADING)
PageGetImageMethodInfo ,
#endif
pageGetImage ,
#if defined(ENABLE_OVERLOADING)
PageGetImageMappingMethodInfo ,
#endif
pageGetImageMapping ,
#if defined(ENABLE_OVERLOADING)
PageGetIndexMethodInfo ,
#endif
pageGetIndex ,
#if defined(ENABLE_OVERLOADING)
PageGetLabelMethodInfo ,
#endif
pageGetLabel ,
#if defined(ENABLE_OVERLOADING)
PageGetLinkMappingMethodInfo ,
#endif
pageGetLinkMapping ,
#if defined(ENABLE_OVERLOADING)
PageGetSelectedRegionMethodInfo ,
#endif
pageGetSelectedRegion ,
#if defined(ENABLE_OVERLOADING)
PageGetSelectedTextMethodInfo ,
#endif
pageGetSelectedText ,
#if defined(ENABLE_OVERLOADING)
PageGetSelectionRegionMethodInfo ,
#endif
pageGetSelectionRegion ,
#if defined(ENABLE_OVERLOADING)
PageGetSizeMethodInfo ,
#endif
pageGetSize ,
#if defined(ENABLE_OVERLOADING)
PageGetTextMethodInfo ,
#endif
pageGetText ,
#if defined(ENABLE_OVERLOADING)
PageGetTextAttributesMethodInfo ,
#endif
pageGetTextAttributes ,
#if defined(ENABLE_OVERLOADING)
PageGetTextAttributesForAreaMethodInfo ,
#endif
pageGetTextAttributesForArea ,
#if defined(ENABLE_OVERLOADING)
PageGetTextForAreaMethodInfo ,
#endif
pageGetTextForArea ,
#if defined(ENABLE_OVERLOADING)
PageGetTextLayoutMethodInfo ,
#endif
pageGetTextLayout ,
#if defined(ENABLE_OVERLOADING)
PageGetTextLayoutForAreaMethodInfo ,
#endif
pageGetTextLayoutForArea ,
#if defined(ENABLE_OVERLOADING)
PageGetThumbnailMethodInfo ,
#endif
pageGetThumbnail ,
#if defined(ENABLE_OVERLOADING)
PageGetThumbnailSizeMethodInfo ,
#endif
pageGetThumbnailSize ,
#if defined(ENABLE_OVERLOADING)
PageGetTransitionMethodInfo ,
#endif
pageGetTransition ,
#if defined(ENABLE_OVERLOADING)
PageRemoveAnnotMethodInfo ,
#endif
pageRemoveAnnot ,
#if defined(ENABLE_OVERLOADING)
PageRenderMethodInfo ,
#endif
pageRender ,
#if defined(ENABLE_OVERLOADING)
PageRenderForPrintingMethodInfo ,
#endif
pageRenderForPrinting ,
#if defined(ENABLE_OVERLOADING)
PageRenderForPrintingWithOptionsMethodInfo,
#endif
pageRenderForPrintingWithOptions ,
#if defined(ENABLE_OVERLOADING)
PageRenderSelectionMethodInfo ,
#endif
pageRenderSelection ,
#if defined(ENABLE_OVERLOADING)
PageRenderToPsMethodInfo ,
#endif
pageRenderToPs ,
pageSelectionRegionFree ,
#if defined(ENABLE_OVERLOADING)
PageLabelPropertyInfo ,
#endif
getPageLabel ,
#if defined(ENABLE_OVERLOADING)
pageLabel ,
#endif
) 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.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.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
import {-# SOURCE #-} qualified GI.Poppler.Flags as Poppler.Flags
import {-# SOURCE #-} qualified GI.Poppler.Objects.Annot as Poppler.Annot
import {-# SOURCE #-} qualified GI.Poppler.Objects.PSFile as Poppler.PSFile
import {-# SOURCE #-} qualified GI.Poppler.Structs.AnnotMapping as Poppler.AnnotMapping
import {-# SOURCE #-} qualified GI.Poppler.Structs.Color as Poppler.Color
import {-# SOURCE #-} qualified GI.Poppler.Structs.FormFieldMapping as Poppler.FormFieldMapping
import {-# SOURCE #-} qualified GI.Poppler.Structs.ImageMapping as Poppler.ImageMapping
import {-# SOURCE #-} qualified GI.Poppler.Structs.LinkMapping as Poppler.LinkMapping
import {-# SOURCE #-} qualified GI.Poppler.Structs.PageTransition as Poppler.PageTransition
import {-# SOURCE #-} qualified GI.Poppler.Structs.Rectangle as Poppler.Rectangle
import {-# SOURCE #-} qualified GI.Poppler.Structs.TextAttributes as Poppler.TextAttributes
newtype Page = Page (ManagedPtr Page)
deriving (Page -> Page -> Bool
(Page -> Page -> Bool) -> (Page -> Page -> Bool) -> Eq Page
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Page -> Page -> Bool
$c/= :: Page -> Page -> Bool
== :: Page -> Page -> Bool
$c== :: Page -> Page -> Bool
Eq)
foreign import ccall "poppler_page_get_type"
c_poppler_page_get_type :: IO GType
instance GObject Page where
gobjectType :: IO GType
gobjectType = IO GType
c_poppler_page_get_type
instance B.GValue.IsGValue Page where
toGValue :: Page -> IO GValue
toGValue Page
o = do
GType
gtype <- IO GType
c_poppler_page_get_type
Page -> (Ptr Page -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Page
o (GType -> (GValue -> Ptr Page -> IO ()) -> Ptr Page -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Page -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Page
fromGValue GValue
gv = do
Ptr Page
ptr <- GValue -> IO (Ptr Page)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Page)
(ManagedPtr Page -> Page) -> Ptr Page -> IO Page
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Page -> Page
Page Ptr Page
ptr
class (GObject o, O.IsDescendantOf Page o) => IsPage o
instance (GObject o, O.IsDescendantOf Page o) => IsPage o
instance O.HasParentTypes Page
type instance O.ParentTypes Page = '[GObject.Object.Object]
toPage :: (MonadIO m, IsPage o) => o -> m Page
toPage :: o -> m Page
toPage = IO Page -> m Page
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Page -> m Page) -> (o -> IO Page) -> o -> m Page
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Page -> Page) -> o -> IO Page
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Page -> Page
Page
#if defined(ENABLE_OVERLOADING)
type family ResolvePageMethod (t :: Symbol) (o :: *) :: * where
ResolvePageMethod "addAnnot" o = PageAddAnnotMethodInfo
ResolvePageMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePageMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePageMethod "findText" o = PageFindTextMethodInfo
ResolvePageMethod "findTextWithOptions" o = PageFindTextWithOptionsMethodInfo
ResolvePageMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePageMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePageMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePageMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePageMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePageMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePageMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePageMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePageMethod "removeAnnot" o = PageRemoveAnnotMethodInfo
ResolvePageMethod "render" o = PageRenderMethodInfo
ResolvePageMethod "renderForPrinting" o = PageRenderForPrintingMethodInfo
ResolvePageMethod "renderForPrintingWithOptions" o = PageRenderForPrintingWithOptionsMethodInfo
ResolvePageMethod "renderSelection" o = PageRenderSelectionMethodInfo
ResolvePageMethod "renderToPs" o = PageRenderToPsMethodInfo
ResolvePageMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePageMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePageMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePageMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePageMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePageMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePageMethod "getAnnotMapping" o = PageGetAnnotMappingMethodInfo
ResolvePageMethod "getCropBox" o = PageGetCropBoxMethodInfo
ResolvePageMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePageMethod "getDuration" o = PageGetDurationMethodInfo
ResolvePageMethod "getFormFieldMapping" o = PageGetFormFieldMappingMethodInfo
ResolvePageMethod "getImage" o = PageGetImageMethodInfo
ResolvePageMethod "getImageMapping" o = PageGetImageMappingMethodInfo
ResolvePageMethod "getIndex" o = PageGetIndexMethodInfo
ResolvePageMethod "getLabel" o = PageGetLabelMethodInfo
ResolvePageMethod "getLinkMapping" o = PageGetLinkMappingMethodInfo
ResolvePageMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePageMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePageMethod "getSelectedRegion" o = PageGetSelectedRegionMethodInfo
ResolvePageMethod "getSelectedText" o = PageGetSelectedTextMethodInfo
ResolvePageMethod "getSelectionRegion" o = PageGetSelectionRegionMethodInfo
ResolvePageMethod "getSize" o = PageGetSizeMethodInfo
ResolvePageMethod "getText" o = PageGetTextMethodInfo
ResolvePageMethod "getTextAttributes" o = PageGetTextAttributesMethodInfo
ResolvePageMethod "getTextAttributesForArea" o = PageGetTextAttributesForAreaMethodInfo
ResolvePageMethod "getTextForArea" o = PageGetTextForAreaMethodInfo
ResolvePageMethod "getTextLayout" o = PageGetTextLayoutMethodInfo
ResolvePageMethod "getTextLayoutForArea" o = PageGetTextLayoutForAreaMethodInfo
ResolvePageMethod "getThumbnail" o = PageGetThumbnailMethodInfo
ResolvePageMethod "getThumbnailSize" o = PageGetThumbnailSizeMethodInfo
ResolvePageMethod "getTransition" o = PageGetTransitionMethodInfo
ResolvePageMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePageMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePageMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePageMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePageMethod t Page, O.MethodInfo info Page p) => OL.IsLabel t (Page -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getPageLabel :: (MonadIO m, IsPage o) => o -> m (Maybe T.Text)
getPageLabel :: o -> m (Maybe Text)
getPageLabel o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"label"
#if defined(ENABLE_OVERLOADING)
data PageLabelPropertyInfo
instance AttrInfo PageLabelPropertyInfo where
type AttrAllowedOps PageLabelPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint PageLabelPropertyInfo = IsPage
type AttrSetTypeConstraint PageLabelPropertyInfo = (~) ()
type AttrTransferTypeConstraint PageLabelPropertyInfo = (~) ()
type AttrTransferType PageLabelPropertyInfo = ()
type AttrGetType PageLabelPropertyInfo = (Maybe T.Text)
type AttrLabel PageLabelPropertyInfo = "label"
type AttrOrigin PageLabelPropertyInfo = Page
attrGet = getPageLabel
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Page
type instance O.AttributeList Page = PageAttributeList
type PageAttributeList = ('[ '("label", PageLabelPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
pageLabel :: AttrLabelProxy "label"
pageLabel = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Page = PageSignalList
type PageSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_page_add_annot" poppler_page_add_annot ::
Ptr Page ->
Ptr Poppler.Annot.Annot ->
IO ()
pageAddAnnot ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) =>
a
-> b
-> m ()
pageAddAnnot :: a -> b -> m ()
pageAddAnnot a
page b
annot = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Annot
annot' <- b -> IO (Ptr Annot)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
annot
Ptr Page -> Ptr Annot -> IO ()
poppler_page_add_annot Ptr Page
page' Ptr Annot
annot'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
annot
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PageAddAnnotMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) => O.MethodInfo PageAddAnnotMethodInfo a signature where
overloadedMethod = pageAddAnnot
#endif
foreign import ccall "poppler_page_find_text" poppler_page_find_text ::
Ptr Page ->
CString ->
IO (Ptr (GList (Ptr Poppler.Rectangle.Rectangle)))
pageFindText ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> T.Text
-> m [Poppler.Rectangle.Rectangle]
pageFindText :: a -> Text -> m [Rectangle]
pageFindText a
page Text
text = IO [Rectangle] -> m [Rectangle]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Rectangle] -> m [Rectangle])
-> IO [Rectangle] -> m [Rectangle]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr (GList (Ptr Rectangle))
result <- Ptr Page -> CString -> IO (Ptr (GList (Ptr Rectangle)))
poppler_page_find_text Ptr Page
page' CString
text'
[Ptr Rectangle]
result' <- Ptr (GList (Ptr Rectangle)) -> IO [Ptr Rectangle]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Rectangle))
result
[Rectangle]
result'' <- (Ptr Rectangle -> IO Rectangle)
-> [Ptr Rectangle] -> IO [Rectangle]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Poppler.Rectangle.Rectangle) [Ptr Rectangle]
result'
Ptr (GList (Ptr Rectangle)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Rectangle))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
[Rectangle] -> IO [Rectangle]
forall (m :: * -> *) a. Monad m => a -> m a
return [Rectangle]
result''
#if defined(ENABLE_OVERLOADING)
data PageFindTextMethodInfo
instance (signature ~ (T.Text -> m [Poppler.Rectangle.Rectangle]), MonadIO m, IsPage a) => O.MethodInfo PageFindTextMethodInfo a signature where
overloadedMethod = pageFindText
#endif
foreign import ccall "poppler_page_find_text_with_options" poppler_page_find_text_with_options ::
Ptr Page ->
CString ->
CUInt ->
IO (Ptr (GList (Ptr Poppler.Rectangle.Rectangle)))
pageFindTextWithOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> T.Text
-> [Poppler.Flags.FindFlags]
-> m [Poppler.Rectangle.Rectangle]
pageFindTextWithOptions :: a -> Text -> [FindFlags] -> m [Rectangle]
pageFindTextWithOptions a
page Text
text [FindFlags]
options = IO [Rectangle] -> m [Rectangle]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Rectangle] -> m [Rectangle])
-> IO [Rectangle] -> m [Rectangle]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
CString
text' <- Text -> IO CString
textToCString Text
text
let options' :: CUInt
options' = [FindFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FindFlags]
options
Ptr (GList (Ptr Rectangle))
result <- Ptr Page -> CString -> CUInt -> IO (Ptr (GList (Ptr Rectangle)))
poppler_page_find_text_with_options Ptr Page
page' CString
text' CUInt
options'
[Ptr Rectangle]
result' <- Ptr (GList (Ptr Rectangle)) -> IO [Ptr Rectangle]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Rectangle))
result
[Rectangle]
result'' <- (Ptr Rectangle -> IO Rectangle)
-> [Ptr Rectangle] -> IO [Rectangle]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Poppler.Rectangle.Rectangle) [Ptr Rectangle]
result'
Ptr (GList (Ptr Rectangle)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Rectangle))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
[Rectangle] -> IO [Rectangle]
forall (m :: * -> *) a. Monad m => a -> m a
return [Rectangle]
result''
#if defined(ENABLE_OVERLOADING)
data PageFindTextWithOptionsMethodInfo
instance (signature ~ (T.Text -> [Poppler.Flags.FindFlags] -> m [Poppler.Rectangle.Rectangle]), MonadIO m, IsPage a) => O.MethodInfo PageFindTextWithOptionsMethodInfo a signature where
overloadedMethod = pageFindTextWithOptions
#endif
foreign import ccall "poppler_page_get_annot_mapping" poppler_page_get_annot_mapping ::
Ptr Page ->
IO (Ptr (GList (Ptr Poppler.AnnotMapping.AnnotMapping)))
pageGetAnnotMapping ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m [Poppler.AnnotMapping.AnnotMapping]
pageGetAnnotMapping :: a -> m [AnnotMapping]
pageGetAnnotMapping a
page = IO [AnnotMapping] -> m [AnnotMapping]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AnnotMapping] -> m [AnnotMapping])
-> IO [AnnotMapping] -> m [AnnotMapping]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr (GList (Ptr AnnotMapping))
result <- Ptr Page -> IO (Ptr (GList (Ptr AnnotMapping)))
poppler_page_get_annot_mapping Ptr Page
page'
[Ptr AnnotMapping]
result' <- Ptr (GList (Ptr AnnotMapping)) -> IO [Ptr AnnotMapping]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr AnnotMapping))
result
[AnnotMapping]
result'' <- (Ptr AnnotMapping -> IO AnnotMapping)
-> [Ptr AnnotMapping] -> IO [AnnotMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr AnnotMapping -> AnnotMapping)
-> Ptr AnnotMapping -> IO AnnotMapping
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AnnotMapping -> AnnotMapping
Poppler.AnnotMapping.AnnotMapping) [Ptr AnnotMapping]
result'
Ptr (GList (Ptr AnnotMapping)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr AnnotMapping))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
[AnnotMapping] -> IO [AnnotMapping]
forall (m :: * -> *) a. Monad m => a -> m a
return [AnnotMapping]
result''
#if defined(ENABLE_OVERLOADING)
data PageGetAnnotMappingMethodInfo
instance (signature ~ (m [Poppler.AnnotMapping.AnnotMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetAnnotMappingMethodInfo a signature where
overloadedMethod = pageGetAnnotMapping
#endif
foreign import ccall "poppler_page_get_crop_box" poppler_page_get_crop_box ::
Ptr Page ->
Ptr Poppler.Rectangle.Rectangle ->
IO ()
pageGetCropBox ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m (Poppler.Rectangle.Rectangle)
pageGetCropBox :: a -> m Rectangle
pageGetCropBox a
page = IO Rectangle -> m Rectangle
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rectangle -> m Rectangle) -> IO Rectangle -> m Rectangle
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Rectangle
rect <- Int -> IO (Ptr Rectangle)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes Int
32 :: IO (Ptr Poppler.Rectangle.Rectangle)
Ptr Page -> Ptr Rectangle -> IO ()
poppler_page_get_crop_box Ptr Page
page' Ptr Rectangle
rect
Rectangle
rect' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Poppler.Rectangle.Rectangle) Ptr Rectangle
rect
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Rectangle -> IO Rectangle
forall (m :: * -> *) a. Monad m => a -> m a
return Rectangle
rect'
#if defined(ENABLE_OVERLOADING)
data PageGetCropBoxMethodInfo
instance (signature ~ (m (Poppler.Rectangle.Rectangle)), MonadIO m, IsPage a) => O.MethodInfo PageGetCropBoxMethodInfo a signature where
overloadedMethod = pageGetCropBox
#endif
foreign import ccall "poppler_page_get_duration" poppler_page_get_duration ::
Ptr Page ->
IO CDouble
pageGetDuration ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m Double
pageGetDuration :: a -> m Double
pageGetDuration a
page = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
CDouble
result <- Ptr Page -> IO CDouble
poppler_page_get_duration Ptr Page
page'
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
page
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data PageGetDurationMethodInfo
instance (signature ~ (m Double), MonadIO m, IsPage a) => O.MethodInfo PageGetDurationMethodInfo a signature where
overloadedMethod = pageGetDuration
#endif
foreign import ccall "poppler_page_get_form_field_mapping" poppler_page_get_form_field_mapping ::
Ptr Page ->
IO (Ptr (GList (Ptr Poppler.FormFieldMapping.FormFieldMapping)))
pageGetFormFieldMapping ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m [Poppler.FormFieldMapping.FormFieldMapping]
pageGetFormFieldMapping :: a -> m [FormFieldMapping]
pageGetFormFieldMapping a
page = IO [FormFieldMapping] -> m [FormFieldMapping]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [FormFieldMapping] -> m [FormFieldMapping])
-> IO [FormFieldMapping] -> m [FormFieldMapping]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr (GList (Ptr FormFieldMapping))
result <- Ptr Page -> IO (Ptr (GList (Ptr FormFieldMapping)))
poppler_page_get_form_field_mapping Ptr Page
page'
[Ptr FormFieldMapping]
result' <- Ptr (GList (Ptr FormFieldMapping)) -> IO [Ptr FormFieldMapping]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr FormFieldMapping))
result
[FormFieldMapping]
result'' <- (Ptr FormFieldMapping -> IO FormFieldMapping)
-> [Ptr FormFieldMapping] -> IO [FormFieldMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr FormFieldMapping -> FormFieldMapping)
-> Ptr FormFieldMapping -> IO FormFieldMapping
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FormFieldMapping -> FormFieldMapping
Poppler.FormFieldMapping.FormFieldMapping) [Ptr FormFieldMapping]
result'
Ptr (GList (Ptr FormFieldMapping)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr FormFieldMapping))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
[FormFieldMapping] -> IO [FormFieldMapping]
forall (m :: * -> *) a. Monad m => a -> m a
return [FormFieldMapping]
result''
#if defined(ENABLE_OVERLOADING)
data PageGetFormFieldMappingMethodInfo
instance (signature ~ (m [Poppler.FormFieldMapping.FormFieldMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetFormFieldMappingMethodInfo a signature where
overloadedMethod = pageGetFormFieldMapping
#endif
foreign import ccall "poppler_page_get_image" poppler_page_get_image ::
Ptr Page ->
Int32 ->
IO (Ptr Cairo.Surface.Surface)
pageGetImage ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Int32
-> m Cairo.Surface.Surface
pageGetImage :: a -> Int32 -> m Surface
pageGetImage a
page Int32
imageId = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Surface
result <- Ptr Page -> Int32 -> IO (Ptr Surface)
poppler_page_get_image Ptr Page
page' Int32
imageId
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetImage" Ptr Surface
result
Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Surface -> Surface
Cairo.Surface.Surface) Ptr Surface
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
data PageGetImageMethodInfo
instance (signature ~ (Int32 -> m Cairo.Surface.Surface), MonadIO m, IsPage a) => O.MethodInfo PageGetImageMethodInfo a signature where
overloadedMethod = pageGetImage
#endif
foreign import ccall "poppler_page_get_image_mapping" poppler_page_get_image_mapping ::
Ptr Page ->
IO (Ptr (GList (Ptr Poppler.ImageMapping.ImageMapping)))
pageGetImageMapping ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m [Poppler.ImageMapping.ImageMapping]
pageGetImageMapping :: a -> m [ImageMapping]
pageGetImageMapping a
page = IO [ImageMapping] -> m [ImageMapping]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ImageMapping] -> m [ImageMapping])
-> IO [ImageMapping] -> m [ImageMapping]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr (GList (Ptr ImageMapping))
result <- Ptr Page -> IO (Ptr (GList (Ptr ImageMapping)))
poppler_page_get_image_mapping Ptr Page
page'
[Ptr ImageMapping]
result' <- Ptr (GList (Ptr ImageMapping)) -> IO [Ptr ImageMapping]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr ImageMapping))
result
[ImageMapping]
result'' <- (Ptr ImageMapping -> IO ImageMapping)
-> [Ptr ImageMapping] -> IO [ImageMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr ImageMapping -> ImageMapping)
-> Ptr ImageMapping -> IO ImageMapping
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ImageMapping -> ImageMapping
Poppler.ImageMapping.ImageMapping) [Ptr ImageMapping]
result'
Ptr (GList (Ptr ImageMapping)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr ImageMapping))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
[ImageMapping] -> IO [ImageMapping]
forall (m :: * -> *) a. Monad m => a -> m a
return [ImageMapping]
result''
#if defined(ENABLE_OVERLOADING)
data PageGetImageMappingMethodInfo
instance (signature ~ (m [Poppler.ImageMapping.ImageMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetImageMappingMethodInfo a signature where
overloadedMethod = pageGetImageMapping
#endif
foreign import ccall "poppler_page_get_index" poppler_page_get_index ::
Ptr Page ->
IO Int32
pageGetIndex ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m Int32
pageGetIndex :: a -> m Int32
pageGetIndex a
page = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Int32
result <- Ptr Page -> IO Int32
poppler_page_get_index Ptr Page
page'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PageGetIndexMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPage a) => O.MethodInfo PageGetIndexMethodInfo a signature where
overloadedMethod = pageGetIndex
#endif
foreign import ccall "poppler_page_get_label" poppler_page_get_label ::
Ptr Page ->
IO CString
pageGetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m T.Text
pageGetLabel :: a -> m Text
pageGetLabel a
page = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
CString
result <- Ptr Page -> IO CString
poppler_page_get_label Ptr Page
page'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetLabel" 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
page
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PageGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsPage a) => O.MethodInfo PageGetLabelMethodInfo a signature where
overloadedMethod = pageGetLabel
#endif
foreign import ccall "poppler_page_get_link_mapping" poppler_page_get_link_mapping ::
Ptr Page ->
IO (Ptr (GList (Ptr Poppler.LinkMapping.LinkMapping)))
pageGetLinkMapping ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m [Poppler.LinkMapping.LinkMapping]
pageGetLinkMapping :: a -> m [LinkMapping]
pageGetLinkMapping a
page = IO [LinkMapping] -> m [LinkMapping]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [LinkMapping] -> m [LinkMapping])
-> IO [LinkMapping] -> m [LinkMapping]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr (GList (Ptr LinkMapping))
result <- Ptr Page -> IO (Ptr (GList (Ptr LinkMapping)))
poppler_page_get_link_mapping Ptr Page
page'
[Ptr LinkMapping]
result' <- Ptr (GList (Ptr LinkMapping)) -> IO [Ptr LinkMapping]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr LinkMapping))
result
[LinkMapping]
result'' <- (Ptr LinkMapping -> IO LinkMapping)
-> [Ptr LinkMapping] -> IO [LinkMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr LinkMapping -> LinkMapping)
-> Ptr LinkMapping -> IO LinkMapping
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr LinkMapping -> LinkMapping
Poppler.LinkMapping.LinkMapping) [Ptr LinkMapping]
result'
Ptr (GList (Ptr LinkMapping)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr LinkMapping))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
[LinkMapping] -> IO [LinkMapping]
forall (m :: * -> *) a. Monad m => a -> m a
return [LinkMapping]
result''
#if defined(ENABLE_OVERLOADING)
data PageGetLinkMappingMethodInfo
instance (signature ~ (m [Poppler.LinkMapping.LinkMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetLinkMappingMethodInfo a signature where
overloadedMethod = pageGetLinkMapping
#endif
foreign import ccall "poppler_page_get_selected_region" poppler_page_get_selected_region ::
Ptr Page ->
CDouble ->
CUInt ->
Ptr Poppler.Rectangle.Rectangle ->
IO (Ptr Cairo.Region.Region)
pageGetSelectedRegion ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Double
-> Poppler.Enums.SelectionStyle
-> Poppler.Rectangle.Rectangle
-> m Cairo.Region.Region
pageGetSelectedRegion :: a -> Double -> SelectionStyle -> Rectangle -> m Region
pageGetSelectedRegion a
page Double
scale SelectionStyle
style Rectangle
selection = IO Region -> m Region
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Region -> m Region) -> IO Region -> m Region
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
let scale' :: CDouble
scale' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scale
let style' :: CUInt
style' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SelectionStyle -> Int) -> SelectionStyle -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SelectionStyle -> Int
forall a. Enum a => a -> Int
fromEnum) SelectionStyle
style
Ptr Rectangle
selection' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
selection
Ptr Region
result <- Ptr Page -> CDouble -> CUInt -> Ptr Rectangle -> IO (Ptr Region)
poppler_page_get_selected_region Ptr Page
page' CDouble
scale' CUInt
style' Ptr Rectangle
selection'
Text -> Ptr Region -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetSelectedRegion" Ptr Region
result
Region
result' <- ((ManagedPtr Region -> Region) -> Ptr Region -> IO Region
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Region -> Region
Cairo.Region.Region) Ptr Region
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
selection
Region -> IO Region
forall (m :: * -> *) a. Monad m => a -> m a
return Region
result'
#if defined(ENABLE_OVERLOADING)
data PageGetSelectedRegionMethodInfo
instance (signature ~ (Double -> Poppler.Enums.SelectionStyle -> Poppler.Rectangle.Rectangle -> m Cairo.Region.Region), MonadIO m, IsPage a) => O.MethodInfo PageGetSelectedRegionMethodInfo a signature where
overloadedMethod = pageGetSelectedRegion
#endif
foreign import ccall "poppler_page_get_selected_text" poppler_page_get_selected_text ::
Ptr Page ->
CUInt ->
Ptr Poppler.Rectangle.Rectangle ->
IO CString
pageGetSelectedText ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Poppler.Enums.SelectionStyle
-> Poppler.Rectangle.Rectangle
-> m T.Text
pageGetSelectedText :: a -> SelectionStyle -> Rectangle -> m Text
pageGetSelectedText a
page SelectionStyle
style Rectangle
selection = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
let style' :: CUInt
style' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SelectionStyle -> Int) -> SelectionStyle -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SelectionStyle -> Int
forall a. Enum a => a -> Int
fromEnum) SelectionStyle
style
Ptr Rectangle
selection' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
selection
CString
result <- Ptr Page -> CUInt -> Ptr Rectangle -> IO CString
poppler_page_get_selected_text Ptr Page
page' CUInt
style' Ptr Rectangle
selection'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetSelectedText" 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
page
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
selection
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PageGetSelectedTextMethodInfo
instance (signature ~ (Poppler.Enums.SelectionStyle -> Poppler.Rectangle.Rectangle -> m T.Text), MonadIO m, IsPage a) => O.MethodInfo PageGetSelectedTextMethodInfo a signature where
overloadedMethod = pageGetSelectedText
#endif
foreign import ccall "poppler_page_get_selection_region" poppler_page_get_selection_region ::
Ptr Page ->
CDouble ->
CUInt ->
Ptr Poppler.Rectangle.Rectangle ->
IO (Ptr (GList (Ptr Poppler.Rectangle.Rectangle)))
{-# DEPRECATED pageGetSelectionRegion ["(Since version 0.16)","Use 'GI.Poppler.Objects.Page.pageGetSelectedRegion' instead."] #-}
pageGetSelectionRegion ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Double
-> Poppler.Enums.SelectionStyle
-> Poppler.Rectangle.Rectangle
-> m [Poppler.Rectangle.Rectangle]
pageGetSelectionRegion :: a -> Double -> SelectionStyle -> Rectangle -> m [Rectangle]
pageGetSelectionRegion a
page Double
scale SelectionStyle
style Rectangle
selection = IO [Rectangle] -> m [Rectangle]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Rectangle] -> m [Rectangle])
-> IO [Rectangle] -> m [Rectangle]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
let scale' :: CDouble
scale' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scale
let style' :: CUInt
style' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SelectionStyle -> Int) -> SelectionStyle -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SelectionStyle -> Int
forall a. Enum a => a -> Int
fromEnum) SelectionStyle
style
Ptr Rectangle
selection' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
selection
Ptr (GList (Ptr Rectangle))
result <- Ptr Page
-> CDouble
-> CUInt
-> Ptr Rectangle
-> IO (Ptr (GList (Ptr Rectangle)))
poppler_page_get_selection_region Ptr Page
page' CDouble
scale' CUInt
style' Ptr Rectangle
selection'
[Ptr Rectangle]
result' <- Ptr (GList (Ptr Rectangle)) -> IO [Ptr Rectangle]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Rectangle))
result
[Rectangle]
result'' <- (Ptr Rectangle -> IO Rectangle)
-> [Ptr Rectangle] -> IO [Rectangle]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Poppler.Rectangle.Rectangle) [Ptr Rectangle]
result'
Ptr (GList (Ptr Rectangle)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Rectangle))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
selection
[Rectangle] -> IO [Rectangle]
forall (m :: * -> *) a. Monad m => a -> m a
return [Rectangle]
result''
#if defined(ENABLE_OVERLOADING)
data PageGetSelectionRegionMethodInfo
instance (signature ~ (Double -> Poppler.Enums.SelectionStyle -> Poppler.Rectangle.Rectangle -> m [Poppler.Rectangle.Rectangle]), MonadIO m, IsPage a) => O.MethodInfo PageGetSelectionRegionMethodInfo a signature where
overloadedMethod = pageGetSelectionRegion
#endif
foreign import ccall "poppler_page_get_size" poppler_page_get_size ::
Ptr Page ->
Ptr CDouble ->
Ptr CDouble ->
IO ()
pageGetSize ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m ((Double, Double))
pageGetSize :: a -> m (Double, Double)
pageGetSize a
page = IO (Double, Double) -> m (Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Double, Double) -> m (Double, Double))
-> IO (Double, Double) -> m (Double, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr CDouble
width <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
height <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr Page -> Ptr CDouble -> Ptr CDouble -> IO ()
poppler_page_get_size Ptr Page
page' Ptr CDouble
width Ptr CDouble
height
CDouble
width' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
width
let width'' :: Double
width'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
width'
CDouble
height' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
height
let height'' :: Double
height'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
height'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
width
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
height
(Double, Double) -> IO (Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
width'', Double
height'')
#if defined(ENABLE_OVERLOADING)
data PageGetSizeMethodInfo
instance (signature ~ (m ((Double, Double))), MonadIO m, IsPage a) => O.MethodInfo PageGetSizeMethodInfo a signature where
overloadedMethod = pageGetSize
#endif
foreign import ccall "poppler_page_get_text" poppler_page_get_text ::
Ptr Page ->
IO CString
pageGetText ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m T.Text
pageGetText :: a -> m Text
pageGetText a
page = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
CString
result <- Ptr Page -> IO CString
poppler_page_get_text Ptr Page
page'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetText" 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
page
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PageGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsPage a) => O.MethodInfo PageGetTextMethodInfo a signature where
overloadedMethod = pageGetText
#endif
foreign import ccall "poppler_page_get_text_attributes" poppler_page_get_text_attributes ::
Ptr Page ->
IO (Ptr (GList (Ptr Poppler.TextAttributes.TextAttributes)))
pageGetTextAttributes ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m [Poppler.TextAttributes.TextAttributes]
pageGetTextAttributes :: a -> m [TextAttributes]
pageGetTextAttributes a
page = IO [TextAttributes] -> m [TextAttributes]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [TextAttributes] -> m [TextAttributes])
-> IO [TextAttributes] -> m [TextAttributes]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr (GList (Ptr TextAttributes))
result <- Ptr Page -> IO (Ptr (GList (Ptr TextAttributes)))
poppler_page_get_text_attributes Ptr Page
page'
[Ptr TextAttributes]
result' <- Ptr (GList (Ptr TextAttributes)) -> IO [Ptr TextAttributes]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr TextAttributes))
result
[TextAttributes]
result'' <- (Ptr TextAttributes -> IO TextAttributes)
-> [Ptr TextAttributes] -> IO [TextAttributes]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr TextAttributes -> TextAttributes)
-> Ptr TextAttributes -> IO TextAttributes
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextAttributes -> TextAttributes
Poppler.TextAttributes.TextAttributes) [Ptr TextAttributes]
result'
Ptr (GList (Ptr TextAttributes)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr TextAttributes))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
[TextAttributes] -> IO [TextAttributes]
forall (m :: * -> *) a. Monad m => a -> m a
return [TextAttributes]
result''
#if defined(ENABLE_OVERLOADING)
data PageGetTextAttributesMethodInfo
instance (signature ~ (m [Poppler.TextAttributes.TextAttributes]), MonadIO m, IsPage a) => O.MethodInfo PageGetTextAttributesMethodInfo a signature where
overloadedMethod = pageGetTextAttributes
#endif
foreign import ccall "poppler_page_get_text_attributes_for_area" poppler_page_get_text_attributes_for_area ::
Ptr Page ->
Ptr Poppler.Rectangle.Rectangle ->
IO (Ptr (GList (Ptr Poppler.TextAttributes.TextAttributes)))
pageGetTextAttributesForArea ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Poppler.Rectangle.Rectangle
-> m [Poppler.TextAttributes.TextAttributes]
pageGetTextAttributesForArea :: a -> Rectangle -> m [TextAttributes]
pageGetTextAttributesForArea a
page Rectangle
area = IO [TextAttributes] -> m [TextAttributes]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [TextAttributes] -> m [TextAttributes])
-> IO [TextAttributes] -> m [TextAttributes]
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Rectangle
area' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
area
Ptr (GList (Ptr TextAttributes))
result <- Ptr Page -> Ptr Rectangle -> IO (Ptr (GList (Ptr TextAttributes)))
poppler_page_get_text_attributes_for_area Ptr Page
page' Ptr Rectangle
area'
[Ptr TextAttributes]
result' <- Ptr (GList (Ptr TextAttributes)) -> IO [Ptr TextAttributes]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr TextAttributes))
result
[TextAttributes]
result'' <- (Ptr TextAttributes -> IO TextAttributes)
-> [Ptr TextAttributes] -> IO [TextAttributes]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr TextAttributes -> TextAttributes)
-> Ptr TextAttributes -> IO TextAttributes
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextAttributes -> TextAttributes
Poppler.TextAttributes.TextAttributes) [Ptr TextAttributes]
result'
Ptr (GList (Ptr TextAttributes)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr TextAttributes))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
area
[TextAttributes] -> IO [TextAttributes]
forall (m :: * -> *) a. Monad m => a -> m a
return [TextAttributes]
result''
#if defined(ENABLE_OVERLOADING)
data PageGetTextAttributesForAreaMethodInfo
instance (signature ~ (Poppler.Rectangle.Rectangle -> m [Poppler.TextAttributes.TextAttributes]), MonadIO m, IsPage a) => O.MethodInfo PageGetTextAttributesForAreaMethodInfo a signature where
overloadedMethod = pageGetTextAttributesForArea
#endif
foreign import ccall "poppler_page_get_text_for_area" poppler_page_get_text_for_area ::
Ptr Page ->
Ptr Poppler.Rectangle.Rectangle ->
IO CString
pageGetTextForArea ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Poppler.Rectangle.Rectangle
-> m T.Text
pageGetTextForArea :: a -> Rectangle -> m Text
pageGetTextForArea a
page Rectangle
area = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Rectangle
area' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
area
CString
result <- Ptr Page -> Ptr Rectangle -> IO CString
poppler_page_get_text_for_area Ptr Page
page' Ptr Rectangle
area'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetTextForArea" 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
page
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
area
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PageGetTextForAreaMethodInfo
instance (signature ~ (Poppler.Rectangle.Rectangle -> m T.Text), MonadIO m, IsPage a) => O.MethodInfo PageGetTextForAreaMethodInfo a signature where
overloadedMethod = pageGetTextForArea
#endif
foreign import ccall "poppler_page_get_text_layout" poppler_page_get_text_layout ::
Ptr Page ->
Ptr (Ptr Poppler.Rectangle.Rectangle) ->
Ptr Word32 ->
IO CInt
pageGetTextLayout ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m ((Bool, [Poppler.Rectangle.Rectangle]))
pageGetTextLayout :: a -> m (Bool, [Rectangle])
pageGetTextLayout a
page = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr (Ptr Rectangle)
rectangles <- IO (Ptr (Ptr Rectangle))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Poppler.Rectangle.Rectangle))
Ptr Word32
nRectangles <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Page -> Ptr (Ptr Rectangle) -> Ptr Word32 -> IO CInt
poppler_page_get_text_layout Ptr Page
page' Ptr (Ptr Rectangle)
rectangles Ptr Word32
nRectangles
Word32
nRectangles' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
nRectangles
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Ptr Rectangle
rectangles' <- Ptr (Ptr Rectangle) -> IO (Ptr Rectangle)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Rectangle)
rectangles
[Ptr Rectangle]
rectangles'' <- (Int -> Word32 -> Ptr Rectangle -> IO [Ptr Rectangle]
forall a b.
(Integral a, BoxedObject b) =>
Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength Int
32 Word32
nRectangles') Ptr Rectangle
rectangles'
[Rectangle]
rectangles''' <- (Ptr Rectangle -> IO Rectangle)
-> [Ptr Rectangle] -> IO [Rectangle]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Poppler.Rectangle.Rectangle) [Ptr Rectangle]
rectangles''
Ptr Rectangle -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Rectangle
rectangles'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Ptr (Ptr Rectangle) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Rectangle)
rectangles
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
nRectangles
(Bool, [Rectangle]) -> IO (Bool, [Rectangle])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [Rectangle]
rectangles''')
#if defined(ENABLE_OVERLOADING)
data PageGetTextLayoutMethodInfo
instance (signature ~ (m ((Bool, [Poppler.Rectangle.Rectangle]))), MonadIO m, IsPage a) => O.MethodInfo PageGetTextLayoutMethodInfo a signature where
overloadedMethod = pageGetTextLayout
#endif
foreign import ccall "poppler_page_get_text_layout_for_area" poppler_page_get_text_layout_for_area ::
Ptr Page ->
Ptr Poppler.Rectangle.Rectangle ->
Ptr (Ptr Poppler.Rectangle.Rectangle) ->
Ptr Word32 ->
IO CInt
pageGetTextLayoutForArea ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Poppler.Rectangle.Rectangle
-> m ((Bool, [Poppler.Rectangle.Rectangle]))
pageGetTextLayoutForArea :: a -> Rectangle -> m (Bool, [Rectangle])
pageGetTextLayoutForArea a
page Rectangle
area = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Rectangle
area' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
area
Ptr (Ptr Rectangle)
rectangles <- IO (Ptr (Ptr Rectangle))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Poppler.Rectangle.Rectangle))
Ptr Word32
nRectangles <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Page
-> Ptr Rectangle -> Ptr (Ptr Rectangle) -> Ptr Word32 -> IO CInt
poppler_page_get_text_layout_for_area Ptr Page
page' Ptr Rectangle
area' Ptr (Ptr Rectangle)
rectangles Ptr Word32
nRectangles
Word32
nRectangles' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
nRectangles
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Ptr Rectangle
rectangles' <- Ptr (Ptr Rectangle) -> IO (Ptr Rectangle)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Rectangle)
rectangles
[Ptr Rectangle]
rectangles'' <- (Int -> Word32 -> Ptr Rectangle -> IO [Ptr Rectangle]
forall a b.
(Integral a, BoxedObject b) =>
Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength Int
32 Word32
nRectangles') Ptr Rectangle
rectangles'
[Rectangle]
rectangles''' <- (Ptr Rectangle -> IO Rectangle)
-> [Ptr Rectangle] -> IO [Rectangle]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Poppler.Rectangle.Rectangle) [Ptr Rectangle]
rectangles''
Ptr Rectangle -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Rectangle
rectangles'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
area
Ptr (Ptr Rectangle) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Rectangle)
rectangles
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
nRectangles
(Bool, [Rectangle]) -> IO (Bool, [Rectangle])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [Rectangle]
rectangles''')
#if defined(ENABLE_OVERLOADING)
data PageGetTextLayoutForAreaMethodInfo
instance (signature ~ (Poppler.Rectangle.Rectangle -> m ((Bool, [Poppler.Rectangle.Rectangle]))), MonadIO m, IsPage a) => O.MethodInfo PageGetTextLayoutForAreaMethodInfo a signature where
overloadedMethod = pageGetTextLayoutForArea
#endif
foreign import ccall "poppler_page_get_thumbnail" poppler_page_get_thumbnail ::
Ptr Page ->
IO (Ptr Cairo.Surface.Surface)
pageGetThumbnail ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m Cairo.Surface.Surface
pageGetThumbnail :: a -> m Surface
pageGetThumbnail a
page = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Surface
result <- Ptr Page -> IO (Ptr Surface)
poppler_page_get_thumbnail Ptr Page
page'
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetThumbnail" Ptr Surface
result
Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Surface -> Surface
Cairo.Surface.Surface) Ptr Surface
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
data PageGetThumbnailMethodInfo
instance (signature ~ (m Cairo.Surface.Surface), MonadIO m, IsPage a) => O.MethodInfo PageGetThumbnailMethodInfo a signature where
overloadedMethod = pageGetThumbnail
#endif
foreign import ccall "poppler_page_get_thumbnail_size" poppler_page_get_thumbnail_size ::
Ptr Page ->
Ptr Int32 ->
Ptr Int32 ->
IO CInt
pageGetThumbnailSize ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m ((Bool, Int32, Int32))
pageGetThumbnailSize :: a -> m (Bool, Int32, Int32)
pageGetThumbnailSize a
page = IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32))
-> IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Int32
width <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
height <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr Page -> Ptr Int32 -> Ptr Int32 -> IO CInt
poppler_page_get_thumbnail_size Ptr Page
page' Ptr Int32
width Ptr Int32
height
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Int32
width' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
width
Int32
height' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
height
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
width
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
height
(Bool, Int32, Int32) -> IO (Bool, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
width', Int32
height')
#if defined(ENABLE_OVERLOADING)
data PageGetThumbnailSizeMethodInfo
instance (signature ~ (m ((Bool, Int32, Int32))), MonadIO m, IsPage a) => O.MethodInfo PageGetThumbnailSizeMethodInfo a signature where
overloadedMethod = pageGetThumbnailSize
#endif
foreign import ccall "poppler_page_get_transition" poppler_page_get_transition ::
Ptr Page ->
IO (Ptr Poppler.PageTransition.PageTransition)
pageGetTransition ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> m Poppler.PageTransition.PageTransition
pageGetTransition :: a -> m PageTransition
pageGetTransition a
page = IO PageTransition -> m PageTransition
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PageTransition -> m PageTransition)
-> IO PageTransition -> m PageTransition
forall a b. (a -> b) -> a -> b
$ do
Ptr Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr PageTransition
result <- Ptr Page -> IO (Ptr PageTransition)
poppler_page_get_transition Ptr Page
page'
Text -> Ptr PageTransition -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pageGetTransition" Ptr PageTransition
result
PageTransition
result' <- ((ManagedPtr PageTransition -> PageTransition)
-> Ptr PageTransition -> IO PageTransition
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PageTransition -> PageTransition
Poppler.PageTransition.PageTransition) Ptr PageTransition
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
PageTransition -> IO PageTransition
forall (m :: * -> *) a. Monad m => a -> m a
return PageTransition
result'
#if defined(ENABLE_OVERLOADING)
data PageGetTransitionMethodInfo
instance (signature ~ (m Poppler.PageTransition.PageTransition), MonadIO m, IsPage a) => O.MethodInfo PageGetTransitionMethodInfo a signature where
overloadedMethod = pageGetTransition
#endif
foreign import ccall "poppler_page_remove_annot" poppler_page_remove_annot ::
Ptr Page ->
Ptr Poppler.Annot.Annot ->
IO ()
pageRemoveAnnot ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) =>
a
-> b
-> m ()
a
page b
annot = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Annot
annot' <- b -> IO (Ptr Annot)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
annot
Ptr Page -> Ptr Annot -> IO ()
poppler_page_remove_annot Ptr Page
page' Ptr Annot
annot'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
annot
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PageRemoveAnnotMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) => O.MethodInfo PageRemoveAnnotMethodInfo a signature where
overloadedMethod = pageRemoveAnnot
#endif
foreign import ccall "poppler_page_render" poppler_page_render ::
Ptr Page ->
Ptr Cairo.Context.Context ->
IO ()
pageRender ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Cairo.Context.Context
-> m ()
a
page Context
cairo = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Context
cairo' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cairo
Ptr Page -> Ptr Context -> IO ()
poppler_page_render Ptr Page
page' Ptr Context
cairo'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cairo
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PageRenderMethodInfo
instance (signature ~ (Cairo.Context.Context -> m ()), MonadIO m, IsPage a) => O.MethodInfo PageRenderMethodInfo a signature where
overloadedMethod = pageRender
#endif
foreign import ccall "poppler_page_render_for_printing" poppler_page_render_for_printing ::
Ptr Page ->
Ptr Cairo.Context.Context ->
IO ()
pageRenderForPrinting ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Cairo.Context.Context
-> m ()
a
page Context
cairo = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Context
cairo' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cairo
Ptr Page -> Ptr Context -> IO ()
poppler_page_render_for_printing Ptr Page
page' Ptr Context
cairo'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cairo
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PageRenderForPrintingMethodInfo
instance (signature ~ (Cairo.Context.Context -> m ()), MonadIO m, IsPage a) => O.MethodInfo PageRenderForPrintingMethodInfo a signature where
overloadedMethod = pageRenderForPrinting
#endif
foreign import ccall "poppler_page_render_for_printing_with_options" poppler_page_render_for_printing_with_options ::
Ptr Page ->
Ptr Cairo.Context.Context ->
CUInt ->
IO ()
pageRenderForPrintingWithOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Cairo.Context.Context
-> [Poppler.Flags.PrintFlags]
-> m ()
a
page Context
cairo [PrintFlags]
options = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Context
cairo' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cairo
let options' :: CUInt
options' = [PrintFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [PrintFlags]
options
Ptr Page -> Ptr Context -> CUInt -> IO ()
poppler_page_render_for_printing_with_options Ptr Page
page' Ptr Context
cairo' CUInt
options'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cairo
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PageRenderForPrintingWithOptionsMethodInfo
instance (signature ~ (Cairo.Context.Context -> [Poppler.Flags.PrintFlags] -> m ()), MonadIO m, IsPage a) => O.MethodInfo PageRenderForPrintingWithOptionsMethodInfo a signature where
overloadedMethod = pageRenderForPrintingWithOptions
#endif
foreign import ccall "poppler_page_render_selection" poppler_page_render_selection ::
Ptr Page ->
Ptr Cairo.Context.Context ->
Ptr Poppler.Rectangle.Rectangle ->
Ptr Poppler.Rectangle.Rectangle ->
CUInt ->
Ptr Poppler.Color.Color ->
Ptr Poppler.Color.Color ->
IO ()
pageRenderSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a) =>
a
-> Cairo.Context.Context
-> Poppler.Rectangle.Rectangle
-> Poppler.Rectangle.Rectangle
-> Poppler.Enums.SelectionStyle
-> Poppler.Color.Color
-> Poppler.Color.Color
-> m ()
a
page Context
cairo Rectangle
selection Rectangle
oldSelection SelectionStyle
style Color
glyphColor Color
backgroundColor = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr Context
cairo' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cairo
Ptr Rectangle
selection' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
selection
Ptr Rectangle
oldSelection' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
oldSelection
let style' :: CUInt
style' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SelectionStyle -> Int) -> SelectionStyle -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SelectionStyle -> Int
forall a. Enum a => a -> Int
fromEnum) SelectionStyle
style
Ptr Color
glyphColor' <- Color -> IO (Ptr Color)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Color
glyphColor
Ptr Color
backgroundColor' <- Color -> IO (Ptr Color)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Color
backgroundColor
Ptr Page
-> Ptr Context
-> Ptr Rectangle
-> Ptr Rectangle
-> CUInt
-> Ptr Color
-> Ptr Color
-> IO ()
poppler_page_render_selection Ptr Page
page' Ptr Context
cairo' Ptr Rectangle
selection' Ptr Rectangle
oldSelection' CUInt
style' Ptr Color
glyphColor' Ptr Color
backgroundColor'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cairo
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
selection
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
oldSelection
Color -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Color
glyphColor
Color -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Color
backgroundColor
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PageRenderSelectionMethodInfo
instance (signature ~ (Cairo.Context.Context -> Poppler.Rectangle.Rectangle -> Poppler.Rectangle.Rectangle -> Poppler.Enums.SelectionStyle -> Poppler.Color.Color -> Poppler.Color.Color -> m ()), MonadIO m, IsPage a) => O.MethodInfo PageRenderSelectionMethodInfo a signature where
overloadedMethod = pageRenderSelection
#endif
foreign import ccall "poppler_page_render_to_ps" poppler_page_render_to_ps ::
Ptr Page ->
Ptr Poppler.PSFile.PSFile ->
IO ()
pageRenderToPs ::
(B.CallStack.HasCallStack, MonadIO m, IsPage a, Poppler.PSFile.IsPSFile b) =>
a
-> b
-> m ()
a
page b
psFile = 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 Page
page' <- a -> IO (Ptr Page)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
page
Ptr PSFile
psFile' <- b -> IO (Ptr PSFile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
psFile
Ptr Page -> Ptr PSFile -> IO ()
poppler_page_render_to_ps Ptr Page
page' Ptr PSFile
psFile'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
page
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
psFile
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PageRenderToPsMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsPage a, Poppler.PSFile.IsPSFile b) => O.MethodInfo PageRenderToPsMethodInfo a signature where
overloadedMethod = pageRenderToPs
#endif
foreign import ccall "poppler_page_free_annot_mapping" poppler_page_free_annot_mapping ::
Ptr (GList (Ptr Poppler.AnnotMapping.AnnotMapping)) ->
IO ()
pageFreeAnnotMapping ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Poppler.AnnotMapping.AnnotMapping]
-> m ()
pageFreeAnnotMapping :: [AnnotMapping] -> m ()
pageFreeAnnotMapping [AnnotMapping]
list = 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 AnnotMapping]
list' <- (AnnotMapping -> IO (Ptr AnnotMapping))
-> [AnnotMapping] -> IO [Ptr AnnotMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM AnnotMapping -> IO (Ptr AnnotMapping)
forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed [AnnotMapping]
list
Ptr (GList (Ptr AnnotMapping))
list'' <- [Ptr AnnotMapping] -> IO (Ptr (GList (Ptr AnnotMapping)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr AnnotMapping]
list'
Ptr (GList (Ptr AnnotMapping)) -> IO ()
poppler_page_free_annot_mapping Ptr (GList (Ptr AnnotMapping))
list''
(AnnotMapping -> IO ()) -> [AnnotMapping] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ AnnotMapping -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [AnnotMapping]
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "poppler_page_free_form_field_mapping" poppler_page_free_form_field_mapping ::
Ptr (GList (Ptr Poppler.FormFieldMapping.FormFieldMapping)) ->
IO ()
pageFreeFormFieldMapping ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Poppler.FormFieldMapping.FormFieldMapping]
-> m ()
pageFreeFormFieldMapping :: [FormFieldMapping] -> m ()
pageFreeFormFieldMapping [FormFieldMapping]
list = 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 FormFieldMapping]
list' <- (FormFieldMapping -> IO (Ptr FormFieldMapping))
-> [FormFieldMapping] -> IO [Ptr FormFieldMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FormFieldMapping -> IO (Ptr FormFieldMapping)
forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed [FormFieldMapping]
list
Ptr (GList (Ptr FormFieldMapping))
list'' <- [Ptr FormFieldMapping] -> IO (Ptr (GList (Ptr FormFieldMapping)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr FormFieldMapping]
list'
Ptr (GList (Ptr FormFieldMapping)) -> IO ()
poppler_page_free_form_field_mapping Ptr (GList (Ptr FormFieldMapping))
list''
(FormFieldMapping -> IO ()) -> [FormFieldMapping] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FormFieldMapping -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [FormFieldMapping]
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "poppler_page_free_image_mapping" poppler_page_free_image_mapping ::
Ptr (GList (Ptr Poppler.ImageMapping.ImageMapping)) ->
IO ()
pageFreeImageMapping ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Poppler.ImageMapping.ImageMapping]
-> m ()
pageFreeImageMapping :: [ImageMapping] -> m ()
pageFreeImageMapping [ImageMapping]
list = 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 ImageMapping]
list' <- (ImageMapping -> IO (Ptr ImageMapping))
-> [ImageMapping] -> IO [Ptr ImageMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ImageMapping -> IO (Ptr ImageMapping)
forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed [ImageMapping]
list
Ptr (GList (Ptr ImageMapping))
list'' <- [Ptr ImageMapping] -> IO (Ptr (GList (Ptr ImageMapping)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr ImageMapping]
list'
Ptr (GList (Ptr ImageMapping)) -> IO ()
poppler_page_free_image_mapping Ptr (GList (Ptr ImageMapping))
list''
(ImageMapping -> IO ()) -> [ImageMapping] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ ImageMapping -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [ImageMapping]
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "poppler_page_free_link_mapping" poppler_page_free_link_mapping ::
Ptr (GList (Ptr Poppler.LinkMapping.LinkMapping)) ->
IO ()
pageFreeLinkMapping ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Poppler.LinkMapping.LinkMapping]
-> m ()
pageFreeLinkMapping :: [LinkMapping] -> m ()
pageFreeLinkMapping [LinkMapping]
list = 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 LinkMapping]
list' <- (LinkMapping -> IO (Ptr LinkMapping))
-> [LinkMapping] -> IO [Ptr LinkMapping]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM LinkMapping -> IO (Ptr LinkMapping)
forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed [LinkMapping]
list
Ptr (GList (Ptr LinkMapping))
list'' <- [Ptr LinkMapping] -> IO (Ptr (GList (Ptr LinkMapping)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr LinkMapping]
list'
Ptr (GList (Ptr LinkMapping)) -> IO ()
poppler_page_free_link_mapping Ptr (GList (Ptr LinkMapping))
list''
(LinkMapping -> IO ()) -> [LinkMapping] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ LinkMapping -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [LinkMapping]
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "poppler_page_free_text_attributes" poppler_page_free_text_attributes ::
Ptr (GList (Ptr Poppler.TextAttributes.TextAttributes)) ->
IO ()
pageFreeTextAttributes ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Poppler.TextAttributes.TextAttributes]
-> m ()
pageFreeTextAttributes :: [TextAttributes] -> m ()
pageFreeTextAttributes [TextAttributes]
list = 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 TextAttributes]
list' <- (TextAttributes -> IO (Ptr TextAttributes))
-> [TextAttributes] -> IO [Ptr TextAttributes]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM TextAttributes -> IO (Ptr TextAttributes)
forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed [TextAttributes]
list
Ptr (GList (Ptr TextAttributes))
list'' <- [Ptr TextAttributes] -> IO (Ptr (GList (Ptr TextAttributes)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr TextAttributes]
list'
Ptr (GList (Ptr TextAttributes)) -> IO ()
poppler_page_free_text_attributes Ptr (GList (Ptr TextAttributes))
list''
(TextAttributes -> IO ()) -> [TextAttributes] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ TextAttributes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [TextAttributes]
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "poppler_page_selection_region_free" poppler_page_selection_region_free ::
Ptr (GList (Ptr Poppler.Rectangle.Rectangle)) ->
IO ()
{-# DEPRECATED pageSelectionRegionFree ["(Since version 0.16)"] #-}
pageSelectionRegionFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Poppler.Rectangle.Rectangle]
-> m ()
pageSelectionRegionFree :: [Rectangle] -> m ()
pageSelectionRegionFree [Rectangle]
region = 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 Rectangle]
region' <- (Rectangle -> IO (Ptr Rectangle))
-> [Rectangle] -> IO [Ptr Rectangle]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [Rectangle]
region
Ptr (GList (Ptr Rectangle))
region'' <- [Ptr Rectangle] -> IO (Ptr (GList (Ptr Rectangle)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr Rectangle]
region'
Ptr (GList (Ptr Rectangle)) -> IO ()
poppler_page_selection_region_free Ptr (GList (Ptr Rectangle))
region''
(Rectangle -> IO ()) -> [Rectangle] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [Rectangle]
region
Ptr (GList (Ptr Rectangle)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Rectangle))
region''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif