{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) -} module GI.Poppler.Objects.Page ( -- * Exported types Page(..) , IsPage , toPage , noPage , -- * Methods -- ** addAnnot #method:addAnnot# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageAddAnnotMethodInfo , #endif pageAddAnnot , -- ** findText #method:findText# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageFindTextMethodInfo , #endif pageFindText , -- ** findTextWithOptions #method:findTextWithOptions# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageFindTextWithOptionsMethodInfo , #endif pageFindTextWithOptions , -- ** freeAnnotMapping #method:freeAnnotMapping# pageFreeAnnotMapping , -- ** freeFormFieldMapping #method:freeFormFieldMapping# pageFreeFormFieldMapping , -- ** freeImageMapping #method:freeImageMapping# pageFreeImageMapping , -- ** freeLinkMapping #method:freeLinkMapping# pageFreeLinkMapping , -- ** freeTextAttributes #method:freeTextAttributes# pageFreeTextAttributes , -- ** getAnnotMapping #method:getAnnotMapping# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetAnnotMappingMethodInfo , #endif pageGetAnnotMapping , -- ** getCropBox #method:getCropBox# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetCropBoxMethodInfo , #endif pageGetCropBox , -- ** getDuration #method:getDuration# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetDurationMethodInfo , #endif pageGetDuration , -- ** getFormFieldMapping #method:getFormFieldMapping# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetFormFieldMappingMethodInfo , #endif pageGetFormFieldMapping , -- ** getImage #method:getImage# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetImageMethodInfo , #endif pageGetImage , -- ** getImageMapping #method:getImageMapping# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetImageMappingMethodInfo , #endif pageGetImageMapping , -- ** getIndex #method:getIndex# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetIndexMethodInfo , #endif pageGetIndex , -- ** getLabel #method:getLabel# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetLabelMethodInfo , #endif pageGetLabel , -- ** getLinkMapping #method:getLinkMapping# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetLinkMappingMethodInfo , #endif pageGetLinkMapping , -- ** getSelectedRegion #method:getSelectedRegion# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetSelectedRegionMethodInfo , #endif pageGetSelectedRegion , -- ** getSelectedText #method:getSelectedText# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetSelectedTextMethodInfo , #endif pageGetSelectedText , -- ** getSelectionRegion #method:getSelectionRegion# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetSelectionRegionMethodInfo , #endif pageGetSelectionRegion , -- ** getSize #method:getSize# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetSizeMethodInfo , #endif pageGetSize , -- ** getText #method:getText# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetTextMethodInfo , #endif pageGetText , -- ** getTextAttributes #method:getTextAttributes# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetTextAttributesMethodInfo , #endif pageGetTextAttributes , -- ** getTextAttributesForArea #method:getTextAttributesForArea# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetTextAttributesForAreaMethodInfo , #endif pageGetTextAttributesForArea , -- ** getTextForArea #method:getTextForArea# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetTextForAreaMethodInfo , #endif pageGetTextForArea , -- ** getTextLayout #method:getTextLayout# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetTextLayoutMethodInfo , #endif pageGetTextLayout , -- ** getTextLayoutForArea #method:getTextLayoutForArea# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetTextLayoutForAreaMethodInfo , #endif pageGetTextLayoutForArea , -- ** getThumbnail #method:getThumbnail# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetThumbnailMethodInfo , #endif pageGetThumbnail , -- ** getThumbnailSize #method:getThumbnailSize# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetThumbnailSizeMethodInfo , #endif pageGetThumbnailSize , -- ** getTransition #method:getTransition# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageGetTransitionMethodInfo , #endif pageGetTransition , -- ** removeAnnot #method:removeAnnot# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageRemoveAnnotMethodInfo , #endif pageRemoveAnnot , -- ** render #method:render# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageRenderMethodInfo , #endif pageRender , -- ** renderForPrinting #method:renderForPrinting# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageRenderForPrintingMethodInfo , #endif pageRenderForPrinting , -- ** renderForPrintingWithOptions #method:renderForPrintingWithOptions# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageRenderForPrintingWithOptionsMethodInfo, #endif pageRenderForPrintingWithOptions , -- ** renderSelection #method:renderSelection# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageRenderSelectionMethodInfo , #endif pageRenderSelection , -- ** renderToPs #method:renderToPs# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageRenderToPsMethodInfo , #endif pageRenderToPs , -- ** selectionRegionFree #method:selectionRegionFree# pageSelectionRegionFree , -- * Properties -- ** label #attr:label# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) PageLabelPropertyInfo , #endif getPageLabel , #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack 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 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) foreign import ccall "poppler_page_get_type" c_poppler_page_get_type :: IO GType instance GObject Page where gobjectType _ = c_poppler_page_get_type class GObject o => IsPage o #if MIN_VERSION_base(4,9,0) instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Page a) => IsPage a #endif instance IsPage Page instance GObject.Object.IsObject Page toPage :: (MonadIO m, IsPage o) => o -> m Page toPage = liftIO . unsafeCastTo Page noPage :: Maybe Page noPage = Nothing #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo ResolvePageMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo 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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo ResolvePageMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolvePageMethod t Page, O.MethodInfo info Page p) => O.IsLabelProxy t (Page -> p) where fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #if MIN_VERSION_base(4,9,0) instance (info ~ ResolvePageMethod t Page, O.MethodInfo info Page p) => O.IsLabel t (Page -> p) where #if MIN_VERSION_base(4,10,0) fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #else fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #endif #endif #endif -- VVV Prop "label" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable] -- Nullable: (Nothing,Nothing) getPageLabel :: (MonadIO m, IsPage o) => o -> m (Maybe T.Text) getPageLabel obj = liftIO $ getObjectPropertyString obj "label" #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageLabelPropertyInfo instance AttrInfo PageLabelPropertyInfo where type AttrAllowedOps PageLabelPropertyInfo = '[ 'AttrGet, 'AttrClear] type AttrSetTypeConstraint PageLabelPropertyInfo = (~) () type AttrBaseTypeConstraint PageLabelPropertyInfo = IsPage type AttrGetType PageLabelPropertyInfo = (Maybe T.Text) type AttrLabel PageLabelPropertyInfo = "label" type AttrOrigin PageLabelPropertyInfo = Page attrGet _ = getPageLabel attrSet _ = undefined attrConstruct _ = undefined attrClear _ = undefined #endif #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) instance O.HasAttributeList Page type instance O.AttributeList Page = PageAttributeList type PageAttributeList = ('[ '("label", PageLabelPropertyInfo)] :: [(Symbol, *)]) #endif #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) pageLabel :: AttrLabelProxy "label" pageLabel = AttrLabelProxy #endif #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) type instance O.SignalList Page = PageSignalList type PageSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)]) #endif -- method Page::add_annot -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "annot", argType = TInterface (Name {namespace = "Poppler", name = "Annot"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnot to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_add_annot" poppler_page_add_annot :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Poppler.Annot.Annot -> -- annot : TInterface (Name {namespace = "Poppler", name = "Annot"}) IO () {- | Adds annotation /@annot@/ to /@page@/. @since 0.16 -} pageAddAnnot :: (B.CallStack.HasCallStack, MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> b {- ^ /@annot@/: a 'GI.Poppler.Objects.Annot.Annot' to add -} -> m () pageAddAnnot page annot = liftIO $ do page' <- unsafeManagedPtrCastPtr page annot' <- unsafeManagedPtrCastPtr annot poppler_page_add_annot page' annot' touchManagedPtr page touchManagedPtr annot return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageAddAnnotMethodInfo instance (signature ~ (b -> m ()), MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) => O.MethodInfo PageAddAnnotMethodInfo a signature where overloadedMethod _ = pageAddAnnot #endif -- method Page::find_text -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the text to search for (UTF-8 encoded)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "Rectangle"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_find_text" poppler_page_find_text :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) CString -> -- text : TBasicType TUTF8 IO (Ptr (GList (Ptr Poppler.Rectangle.Rectangle))) {- | Finds /@text@/ in /@page@/ with the default options ('GI.Poppler.Flags.FindFlagsDefault') and returns a 'GI.GLib.Structs.List.List' of rectangles for each occurance of the text on the page. The coordinates are in PDF points. -} pageFindText :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> T.Text {- ^ /@text@/: the text to search for (UTF-8 encoded) -} -> m [Poppler.Rectangle.Rectangle] {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.Rectangle.Rectangle', -} pageFindText page text = liftIO $ do page' <- unsafeManagedPtrCastPtr page text' <- textToCString text result <- poppler_page_find_text page' text' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.Rectangle.Rectangle) result' g_list_free result touchManagedPtr page freeMem text' return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageFindTextMethodInfo instance (signature ~ (T.Text -> m [Poppler.Rectangle.Rectangle]), MonadIO m, IsPage a) => O.MethodInfo PageFindTextMethodInfo a signature where overloadedMethod _ = pageFindText #endif -- method Page::find_text_with_options -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the text to search for (UTF-8 encoded)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TInterface (Name {namespace = "Poppler", name = "FindFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "find options", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "Rectangle"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_find_text_with_options" poppler_page_find_text_with_options :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) CString -> -- text : TBasicType TUTF8 CUInt -> -- options : TInterface (Name {namespace = "Poppler", name = "FindFlags"}) IO (Ptr (GList (Ptr Poppler.Rectangle.Rectangle))) {- | Finds /@text@/ in /@page@/ with the given 'GI.Poppler.Flags.FindFlags' options and returns a 'GI.GLib.Structs.List.List' of rectangles for each occurance of the text on the page. The coordinates are in PDF points. @since 0.22 -} pageFindTextWithOptions :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> T.Text {- ^ /@text@/: the text to search for (UTF-8 encoded) -} -> [Poppler.Flags.FindFlags] {- ^ /@options@/: find options -} -> m [Poppler.Rectangle.Rectangle] {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.Rectangle.Rectangle', -} pageFindTextWithOptions page text options = liftIO $ do page' <- unsafeManagedPtrCastPtr page text' <- textToCString text let options' = gflagsToWord options result <- poppler_page_find_text_with_options page' text' options' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.Rectangle.Rectangle) result' g_list_free result touchManagedPtr page freeMem text' return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 -- method Page::get_annot_mapping -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "AnnotMapping"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_annot_mapping" poppler_page_get_annot_mapping :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO (Ptr (GList (Ptr Poppler.AnnotMapping.AnnotMapping))) {- | Returns a list of 'GI.Poppler.Structs.AnnotMapping.AnnotMapping' items that map from a location on /@page@/ to a 'GI.Poppler.Objects.Annot.Annot'. This list must be freed with 'GI.Poppler.Objects.Page.pageFreeAnnotMapping' when done. -} pageGetAnnotMapping :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m [Poppler.AnnotMapping.AnnotMapping] {- ^ __Returns:__ A 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.AnnotMapping.AnnotMapping' -} pageGetAnnotMapping page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_annot_mapping page' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.AnnotMapping.AnnotMapping) result' g_list_free result touchManagedPtr page return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetAnnotMappingMethodInfo instance (signature ~ (m [Poppler.AnnotMapping.AnnotMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetAnnotMappingMethodInfo a signature where overloadedMethod _ = pageGetAnnotMapping #endif -- method Page::get_crop_box -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "rect", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle to fill", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_crop_box" poppler_page_get_crop_box :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Poppler.Rectangle.Rectangle -> -- rect : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) IO () {- | Retrurns the crop box of /@page@/ -} pageGetCropBox :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> m (Poppler.Rectangle.Rectangle) pageGetCropBox page = liftIO $ do page' <- unsafeManagedPtrCastPtr page rect <- callocBoxedBytes 32 :: IO (Ptr Poppler.Rectangle.Rectangle) poppler_page_get_crop_box page' rect rect' <- (wrapBoxed Poppler.Rectangle.Rectangle) rect touchManagedPtr page return rect' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetCropBoxMethodInfo instance (signature ~ (m (Poppler.Rectangle.Rectangle)), MonadIO m, IsPage a) => O.MethodInfo PageGetCropBoxMethodInfo a signature where overloadedMethod _ = pageGetCropBox #endif -- method Page::get_duration -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TDouble) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_duration" poppler_page_get_duration :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO CDouble {- | Returns the duration of /@page@/ -} pageGetDuration :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> m Double {- ^ __Returns:__ duration in seconds of /@page@/ or -1. -} pageGetDuration page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_duration page' let result' = realToFrac result touchManagedPtr page return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetDurationMethodInfo instance (signature ~ (m Double), MonadIO m, IsPage a) => O.MethodInfo PageGetDurationMethodInfo a signature where overloadedMethod _ = pageGetDuration #endif -- method Page::get_form_field_mapping -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "FormFieldMapping"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_form_field_mapping" poppler_page_get_form_field_mapping :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO (Ptr (GList (Ptr Poppler.FormFieldMapping.FormFieldMapping))) {- | Returns a list of 'GI.Poppler.Structs.FormFieldMapping.FormFieldMapping' items that map from a location on /@page@/ to a form field. This list must be freed with 'GI.Poppler.Objects.Page.pageFreeFormFieldMapping' when done. -} pageGetFormFieldMapping :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m [Poppler.FormFieldMapping.FormFieldMapping] {- ^ __Returns:__ A 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.FormFieldMapping.FormFieldMapping' -} pageGetFormFieldMapping page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_form_field_mapping page' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.FormFieldMapping.FormFieldMapping) result' g_list_free result touchManagedPtr page return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetFormFieldMappingMethodInfo instance (signature ~ (m [Poppler.FormFieldMapping.FormFieldMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetFormFieldMappingMethodInfo a signature where overloadedMethod _ = pageGetFormFieldMapping #endif -- method Page::get_image -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "image_id", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The image identifier", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "cairo", name = "Surface"})) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_image" poppler_page_get_image :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Int32 -> -- image_id : TBasicType TInt IO (Ptr Cairo.Surface.Surface) {- | Returns a cairo surface for the image of the /@page@/ -} pageGetImage :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> Int32 {- ^ /@imageId@/: The image identifier -} -> m Cairo.Surface.Surface {- ^ __Returns:__ A cairo surface for the image -} pageGetImage page imageId = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_image page' imageId checkUnexpectedReturnNULL "pageGetImage" result result' <- (wrapBoxed Cairo.Surface.Surface) result touchManagedPtr page return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetImageMethodInfo instance (signature ~ (Int32 -> m Cairo.Surface.Surface), MonadIO m, IsPage a) => O.MethodInfo PageGetImageMethodInfo a signature where overloadedMethod _ = pageGetImage #endif -- method Page::get_image_mapping -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "ImageMapping"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_image_mapping" poppler_page_get_image_mapping :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO (Ptr (GList (Ptr Poppler.ImageMapping.ImageMapping))) {- | Returns a list of 'GI.Poppler.Structs.ImageMapping.ImageMapping' items that map from a location on /@page@/ to an image of the page. This list must be freed with 'GI.Poppler.Objects.Page.pageFreeImageMapping' when done. -} pageGetImageMapping :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m [Poppler.ImageMapping.ImageMapping] {- ^ __Returns:__ A 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.ImageMapping.ImageMapping' -} pageGetImageMapping page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_image_mapping page' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.ImageMapping.ImageMapping) result' g_list_free result touchManagedPtr page return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetImageMappingMethodInfo instance (signature ~ (m [Poppler.ImageMapping.ImageMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetImageMappingMethodInfo a signature where overloadedMethod _ = pageGetImageMapping #endif -- method Page::get_index -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_index" poppler_page_get_index :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO Int32 {- | Returns the index of /@page@/ -} pageGetIndex :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> m Int32 {- ^ __Returns:__ index value of /@page@/ -} pageGetIndex page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_index page' touchManagedPtr page return result #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetIndexMethodInfo instance (signature ~ (m Int32), MonadIO m, IsPage a) => O.MethodInfo PageGetIndexMethodInfo a signature where overloadedMethod _ = pageGetIndex #endif -- method Page::get_label -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_label" poppler_page_get_label :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO CString {- | Returns the label of /@page@/. Note that page labels and page indices might not coincide. @since 0.16 -} pageGetLabel :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> m T.Text {- ^ __Returns:__ a new allocated string containing the label of /@page@/, or 'Nothing' if /@page@/ doesn\'t have a label -} pageGetLabel page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_label page' checkUnexpectedReturnNULL "pageGetLabel" result result' <- cstringToText result freeMem result touchManagedPtr page return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetLabelMethodInfo instance (signature ~ (m T.Text), MonadIO m, IsPage a) => O.MethodInfo PageGetLabelMethodInfo a signature where overloadedMethod _ = pageGetLabel #endif -- method Page::get_link_mapping -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "LinkMapping"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_link_mapping" poppler_page_get_link_mapping :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO (Ptr (GList (Ptr Poppler.LinkMapping.LinkMapping))) {- | Returns a list of 'GI.Poppler.Structs.LinkMapping.LinkMapping' items that map from a location on /@page@/ to a 'GI.Poppler.Unions.Action.Action'. This list must be freed with 'GI.Poppler.Objects.Page.pageFreeLinkMapping' when done. -} pageGetLinkMapping :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m [Poppler.LinkMapping.LinkMapping] {- ^ __Returns:__ A 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.LinkMapping.LinkMapping' -} pageGetLinkMapping page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_link_mapping page' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.LinkMapping.LinkMapping) result' g_list_free result touchManagedPtr page return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetLinkMappingMethodInfo instance (signature ~ (m [Poppler.LinkMapping.LinkMapping]), MonadIO m, IsPage a) => O.MethodInfo PageGetLinkMappingMethodInfo a signature where overloadedMethod _ = pageGetLinkMapping #endif -- method Page::get_selected_region -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "scale", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "scale specified as pixels per point", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "style", argType = TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerSelectionStyle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "start and end point of selection as a rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "cairo", name = "Region"})) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_selected_region" poppler_page_get_selected_region :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) CDouble -> -- scale : TBasicType TDouble CUInt -> -- style : TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}) Ptr Poppler.Rectangle.Rectangle -> -- selection : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) IO (Ptr Cairo.Region.Region) {- | Returns a region containing the area that would be rendered by 'GI.Poppler.Objects.Page.pageRenderSelection'. The returned region must be freed with @/cairo_region_destroy()/@ @since 0.16 -} pageGetSelectedRegion :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> Double {- ^ /@scale@/: scale specified as pixels per point -} -> Poppler.Enums.SelectionStyle {- ^ /@style@/: a 'GI.Poppler.Enums.SelectionStyle' -} -> Poppler.Rectangle.Rectangle {- ^ /@selection@/: start and end point of selection as a rectangle -} -> m Cairo.Region.Region {- ^ __Returns:__ a cairo_region_t -} pageGetSelectedRegion page scale style selection = liftIO $ do page' <- unsafeManagedPtrCastPtr page let scale' = realToFrac scale let style' = (fromIntegral . fromEnum) style selection' <- unsafeManagedPtrGetPtr selection result <- poppler_page_get_selected_region page' scale' style' selection' checkUnexpectedReturnNULL "pageGetSelectedRegion" result result' <- (wrapBoxed Cairo.Region.Region) result touchManagedPtr page touchManagedPtr selection return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 -- method Page::get_selected_text -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "style", argType = TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerSelectionStyle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #PopplerRectangle including the text", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_selected_text" poppler_page_get_selected_text :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) CUInt -> -- style : TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}) Ptr Poppler.Rectangle.Rectangle -> -- selection : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) IO CString {- | Retrieves the contents of the specified /@selection@/ as text. @since 0.16 -} pageGetSelectedText :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> Poppler.Enums.SelectionStyle {- ^ /@style@/: a 'GI.Poppler.Enums.SelectionStyle' -} -> Poppler.Rectangle.Rectangle {- ^ /@selection@/: the 'GI.Poppler.Structs.Rectangle.Rectangle' including the text -} -> m T.Text {- ^ __Returns:__ a pointer to the contents of the /@selection@/ as a string -} pageGetSelectedText page style selection = liftIO $ do page' <- unsafeManagedPtrCastPtr page let style' = (fromIntegral . fromEnum) style selection' <- unsafeManagedPtrGetPtr selection result <- poppler_page_get_selected_text page' style' selection' checkUnexpectedReturnNULL "pageGetSelectedText" result result' <- cstringToText result freeMem result touchManagedPtr page touchManagedPtr selection return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 -- method Page::get_selection_region -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "scale", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "scale specified as pixels per point", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "style", argType = TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerSelectionStyle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "start and end point of selection as a rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "Rectangle"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_selection_region" poppler_page_get_selection_region :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) CDouble -> -- scale : TBasicType TDouble CUInt -> -- style : TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}) Ptr Poppler.Rectangle.Rectangle -> -- selection : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) IO (Ptr (GList (Ptr Poppler.Rectangle.Rectangle))) {-# DEPRECATED pageGetSelectionRegion ["(Since version 0.16)","Use 'GI.Poppler.Objects.Page.pageGetSelectedRegion' instead."] #-} {- | Returns a region containing the area that would be rendered by 'GI.Poppler.Objects.Page.pageRenderSelection' as a 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.Rectangle.Rectangle'. The returned list must be freed with 'GI.Poppler.Objects.Page.pageSelectionRegionFree'. -} pageGetSelectionRegion :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> Double {- ^ /@scale@/: scale specified as pixels per point -} -> Poppler.Enums.SelectionStyle {- ^ /@style@/: a 'GI.Poppler.Enums.SelectionStyle' -} -> Poppler.Rectangle.Rectangle {- ^ /@selection@/: start and end point of selection as a rectangle -} -> m [Poppler.Rectangle.Rectangle] {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.Rectangle.Rectangle' -} pageGetSelectionRegion page scale style selection = liftIO $ do page' <- unsafeManagedPtrCastPtr page let scale' = realToFrac scale let style' = (fromIntegral . fromEnum) style selection' <- unsafeManagedPtrGetPtr selection result <- poppler_page_get_selection_region page' scale' style' selection' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.Rectangle.Rectangle) result' g_list_free result touchManagedPtr page touchManagedPtr selection return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 -- method Page::get_size -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TDouble, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the width of @page", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "height", argType = TBasicType TDouble, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the height of @page", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_size" poppler_page_get_size :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr CDouble -> -- width : TBasicType TDouble Ptr CDouble -> -- height : TBasicType TDouble IO () {- | Gets the size of /@page@/ at the current scale and rotation. -} pageGetSize :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m ((Double, Double)) pageGetSize page = liftIO $ do page' <- unsafeManagedPtrCastPtr page width <- allocMem :: IO (Ptr CDouble) height <- allocMem :: IO (Ptr CDouble) poppler_page_get_size page' width height width' <- peek width let width'' = realToFrac width' height' <- peek height let height'' = realToFrac height' touchManagedPtr page freeMem width freeMem height return (width'', height'') #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetSizeMethodInfo instance (signature ~ (m ((Double, Double))), MonadIO m, IsPage a) => O.MethodInfo PageGetSizeMethodInfo a signature where overloadedMethod _ = pageGetSize #endif -- method Page::get_text -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_text" poppler_page_get_text :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO CString {- | Retrieves the text of /@page@/. @since 0.16 -} pageGetText :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> m T.Text {- ^ __Returns:__ a pointer to the text of the /@page@/ as a string -} pageGetText page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_text page' checkUnexpectedReturnNULL "pageGetText" result result' <- cstringToText result freeMem result touchManagedPtr page return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetTextMethodInfo instance (signature ~ (m T.Text), MonadIO m, IsPage a) => O.MethodInfo PageGetTextMethodInfo a signature where overloadedMethod _ = pageGetText #endif -- method Page::get_text_attributes -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "TextAttributes"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_text_attributes" poppler_page_get_text_attributes :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO (Ptr (GList (Ptr Poppler.TextAttributes.TextAttributes))) {- | Obtains the attributes of the text as a 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.TextAttributes.TextAttributes'. This list must be freed with 'GI.Poppler.Objects.Page.pageFreeTextAttributes' when done. Each list element is a 'GI.Poppler.Structs.TextAttributes.TextAttributes' struct where start_index and end_index indicates the range of text (as returned by 'GI.Poppler.Objects.Page.pageGetText') to which text attributes apply. See also 'GI.Poppler.Objects.Page.pageGetTextAttributesForArea' @since 0.18 -} pageGetTextAttributes :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m [Poppler.TextAttributes.TextAttributes] {- ^ __Returns:__ A 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.TextAttributes.TextAttributes' -} pageGetTextAttributes page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_text_attributes page' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.TextAttributes.TextAttributes) result' g_list_free result touchManagedPtr page return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetTextAttributesMethodInfo instance (signature ~ (m [Poppler.TextAttributes.TextAttributes]), MonadIO m, IsPage a) => O.MethodInfo PageGetTextAttributesMethodInfo a signature where overloadedMethod _ = pageGetTextAttributes #endif -- method Page::get_text_attributes_for_area -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "area", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Poppler", name = "TextAttributes"}))) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_text_attributes_for_area" poppler_page_get_text_attributes_for_area :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Poppler.Rectangle.Rectangle -> -- area : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) IO (Ptr (GList (Ptr Poppler.TextAttributes.TextAttributes))) {- | Obtains the attributes of the text in /@area@/ as a 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.TextAttributes.TextAttributes'. This list must be freed with 'GI.Poppler.Objects.Page.pageFreeTextAttributes' when done. Each list element is a 'GI.Poppler.Structs.TextAttributes.TextAttributes' struct where start_index and end_index indicates the range of text (as returned by 'GI.Poppler.Objects.Page.pageGetTextForArea') to which text attributes apply. @since 0.26 -} pageGetTextAttributesForArea :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> Poppler.Rectangle.Rectangle {- ^ /@area@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -} -> m [Poppler.TextAttributes.TextAttributes] {- ^ __Returns:__ A 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.TextAttributes.TextAttributes' -} pageGetTextAttributesForArea page area = liftIO $ do page' <- unsafeManagedPtrCastPtr page area' <- unsafeManagedPtrGetPtr area result <- poppler_page_get_text_attributes_for_area page' area' result' <- unpackGList result result'' <- mapM (wrapBoxed Poppler.TextAttributes.TextAttributes) result' g_list_free result touchManagedPtr page touchManagedPtr area return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetTextAttributesForAreaMethodInfo instance (signature ~ (Poppler.Rectangle.Rectangle -> m [Poppler.TextAttributes.TextAttributes]), MonadIO m, IsPage a) => O.MethodInfo PageGetTextAttributesForAreaMethodInfo a signature where overloadedMethod _ = pageGetTextAttributesForArea #endif -- method Page::get_text_for_area -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "area", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_text_for_area" poppler_page_get_text_for_area :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Poppler.Rectangle.Rectangle -> -- area : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) IO CString {- | Retrieves the text of /@page@/ contained in /@area@/. @since 0.26 -} pageGetTextForArea :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> Poppler.Rectangle.Rectangle {- ^ /@area@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -} -> m T.Text {- ^ __Returns:__ a pointer to the text as a string -} pageGetTextForArea page area = liftIO $ do page' <- unsafeManagedPtrCastPtr page area' <- unsafeManagedPtrGetPtr area result <- poppler_page_get_text_for_area page' area' checkUnexpectedReturnNULL "pageGetTextForArea" result result' <- cstringToText result freeMem result touchManagedPtr page touchManagedPtr area return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetTextForAreaMethodInfo instance (signature ~ (Poppler.Rectangle.Rectangle -> m T.Text), MonadIO m, IsPage a) => O.MethodInfo PageGetTextForAreaMethodInfo a signature where overloadedMethod _ = pageGetTextForArea #endif -- method Page::get_text_layout -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "rectangles", argType = TCArray False (-1) 2 (TInterface (Name {namespace = "Poppler", name = "Rectangle"})), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for an array of #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferContainer},Arg {argCName = "n_rectangles", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "length of returned array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}] -- Lengths : [Arg {argCName = "n_rectangles", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "length of returned array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_text_layout" poppler_page_get_text_layout :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr (Ptr Poppler.Rectangle.Rectangle) -> -- rectangles : TCArray False (-1) 2 (TInterface (Name {namespace = "Poppler", name = "Rectangle"})) Ptr Word32 -> -- n_rectangles : TBasicType TUInt IO CInt {- | Obtains the layout of the text as a list of 'GI.Poppler.Structs.Rectangle.Rectangle' This array must be freed with 'GI.GLib.Functions.free' when done. The position in the array represents an offset in the text returned by 'GI.Poppler.Objects.Page.pageGetText' See also 'GI.Poppler.Objects.Page.pageGetTextLayoutForArea'. @since 0.16 -} pageGetTextLayout :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m ((Bool, [Poppler.Rectangle.Rectangle])) {- ^ __Returns:__ 'True' if the page contains text, 'False' otherwise -} pageGetTextLayout page = liftIO $ do page' <- unsafeManagedPtrCastPtr page rectangles <- allocMem :: IO (Ptr (Ptr Poppler.Rectangle.Rectangle)) nRectangles <- allocMem :: IO (Ptr Word32) result <- poppler_page_get_text_layout page' rectangles nRectangles nRectangles' <- peek nRectangles let result' = (/= 0) result rectangles' <- peek rectangles rectangles'' <- (unpackBoxedArrayWithLength 32 nRectangles') rectangles' rectangles''' <- mapM (newBoxed Poppler.Rectangle.Rectangle) rectangles'' freeMem rectangles' touchManagedPtr page freeMem rectangles freeMem nRectangles return (result', rectangles''') #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetTextLayoutMethodInfo instance (signature ~ (m ((Bool, [Poppler.Rectangle.Rectangle]))), MonadIO m, IsPage a) => O.MethodInfo PageGetTextLayoutMethodInfo a signature where overloadedMethod _ = pageGetTextLayout #endif -- method Page::get_text_layout_for_area -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "area", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "rectangles", argType = TCArray False (-1) 3 (TInterface (Name {namespace = "Poppler", name = "Rectangle"})), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for an array of #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferContainer},Arg {argCName = "n_rectangles", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "length of returned array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}] -- Lengths : [Arg {argCName = "n_rectangles", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "length of returned array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_text_layout_for_area" poppler_page_get_text_layout_for_area :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Poppler.Rectangle.Rectangle -> -- area : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) Ptr (Ptr Poppler.Rectangle.Rectangle) -> -- rectangles : TCArray False (-1) 3 (TInterface (Name {namespace = "Poppler", name = "Rectangle"})) Ptr Word32 -> -- n_rectangles : TBasicType TUInt IO CInt {- | Obtains the layout of the text contained in /@area@/ as a list of 'GI.Poppler.Structs.Rectangle.Rectangle' This array must be freed with 'GI.GLib.Functions.free' when done. The position in the array represents an offset in the text returned by 'GI.Poppler.Objects.Page.pageGetTextForArea' @since 0.26 -} pageGetTextLayoutForArea :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> Poppler.Rectangle.Rectangle {- ^ /@area@/: a 'GI.Poppler.Structs.Rectangle.Rectangle' -} -> m ((Bool, [Poppler.Rectangle.Rectangle])) {- ^ __Returns:__ 'True' if the page contains text, 'False' otherwise -} pageGetTextLayoutForArea page area = liftIO $ do page' <- unsafeManagedPtrCastPtr page area' <- unsafeManagedPtrGetPtr area rectangles <- allocMem :: IO (Ptr (Ptr Poppler.Rectangle.Rectangle)) nRectangles <- allocMem :: IO (Ptr Word32) result <- poppler_page_get_text_layout_for_area page' area' rectangles nRectangles nRectangles' <- peek nRectangles let result' = (/= 0) result rectangles' <- peek rectangles rectangles'' <- (unpackBoxedArrayWithLength 32 nRectangles') rectangles' rectangles''' <- mapM (newBoxed Poppler.Rectangle.Rectangle) rectangles'' freeMem rectangles' touchManagedPtr page touchManagedPtr area freeMem rectangles freeMem nRectangles return (result', rectangles''') #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 -- method Page::get_thumbnail -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #PopplerPage to get the thumbnail for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "cairo", name = "Surface"})) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_thumbnail" poppler_page_get_thumbnail :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO (Ptr Cairo.Surface.Surface) {- | Get the embedded thumbnail for the specified page. If the document doesn\'t have an embedded thumbnail for the page, this function returns 'Nothing'. -} pageGetThumbnail :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: the 'GI.Poppler.Objects.Page.Page' to get the thumbnail for -} -> m Cairo.Surface.Surface {- ^ __Returns:__ the tumbnail as a cairo_surface_t or 'Nothing' if the document doesn\'t have a thumbnail for this page. -} pageGetThumbnail page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_thumbnail page' checkUnexpectedReturnNULL "pageGetThumbnail" result result' <- (wrapBoxed Cairo.Surface.Surface) result touchManagedPtr page return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetThumbnailMethodInfo instance (signature ~ (m Cairo.Surface.Surface), MonadIO m, IsPage a) => O.MethodInfo PageGetThumbnailMethodInfo a signature where overloadedMethod _ = pageGetThumbnail #endif -- method Page::get_thumbnail_size -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for width", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "height", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for height", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_thumbnail_size" poppler_page_get_thumbnail_size :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Int32 -> -- width : TBasicType TInt Ptr Int32 -> -- height : TBasicType TInt IO CInt {- | Returns 'True' if /@page@/ has a thumbnail associated with it. It also fills in /@width@/ and /@height@/ with the width and height of the thumbnail. The values of width and height are not changed if no appropriate thumbnail exists. -} pageGetThumbnailSize :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: A 'GI.Poppler.Objects.Page.Page' -} -> m ((Bool, Int32, Int32)) {- ^ __Returns:__ 'True', if /@page@/ has a thumbnail associated with it. -} pageGetThumbnailSize page = liftIO $ do page' <- unsafeManagedPtrCastPtr page width <- allocMem :: IO (Ptr Int32) height <- allocMem :: IO (Ptr Int32) result <- poppler_page_get_thumbnail_size page' width height let result' = (/= 0) result width' <- peek width height' <- peek height touchManagedPtr page freeMem width freeMem height return (result', width', height') #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetThumbnailSizeMethodInfo instance (signature ~ (m ((Bool, Int32, Int32))), MonadIO m, IsPage a) => O.MethodInfo PageGetThumbnailSizeMethodInfo a signature where overloadedMethod _ = pageGetThumbnailSize #endif -- method Page::get_transition -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Poppler", name = "PageTransition"})) -- throws : False -- Skip return : False foreign import ccall "poppler_page_get_transition" poppler_page_get_transition :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) IO (Ptr Poppler.PageTransition.PageTransition) {- | Returns the transition effect of /@page@/ -} pageGetTransition :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> m Poppler.PageTransition.PageTransition {- ^ __Returns:__ a 'GI.Poppler.Structs.PageTransition.PageTransition' or 'Nothing'. -} pageGetTransition page = liftIO $ do page' <- unsafeManagedPtrCastPtr page result <- poppler_page_get_transition page' checkUnexpectedReturnNULL "pageGetTransition" result result' <- (wrapBoxed Poppler.PageTransition.PageTransition) result touchManagedPtr page return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageGetTransitionMethodInfo instance (signature ~ (m Poppler.PageTransition.PageTransition), MonadIO m, IsPage a) => O.MethodInfo PageGetTransitionMethodInfo a signature where overloadedMethod _ = pageGetTransition #endif -- method Page::remove_annot -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "annot", argType = TInterface (Name {namespace = "Poppler", name = "Annot"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerAnnot to remove", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_remove_annot" poppler_page_remove_annot :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Poppler.Annot.Annot -> -- annot : TInterface (Name {namespace = "Poppler", name = "Annot"}) IO () {- | Removes annotation /@annot@/ from /@page@/ @since 0.22 -} pageRemoveAnnot :: (B.CallStack.HasCallStack, MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> b {- ^ /@annot@/: a 'GI.Poppler.Objects.Annot.Annot' to remove -} -> m () pageRemoveAnnot page annot = liftIO $ do page' <- unsafeManagedPtrCastPtr page annot' <- unsafeManagedPtrCastPtr annot poppler_page_remove_annot page' annot' touchManagedPtr page touchManagedPtr annot return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageRemoveAnnotMethodInfo instance (signature ~ (b -> m ()), MonadIO m, IsPage a, Poppler.Annot.IsAnnot b) => O.MethodInfo PageRemoveAnnotMethodInfo a signature where overloadedMethod _ = pageRemoveAnnot #endif -- method Page::render -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the page to render from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cairo", argType = TInterface (Name {namespace = "cairo", name = "Context"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "cairo context to render to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_render" poppler_page_render :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Cairo.Context.Context -> -- cairo : TInterface (Name {namespace = "cairo", name = "Context"}) IO () {- | Render the page to the given cairo context. This function is for rendering a page that will be displayed. If you want to render a page that will be printed use 'GI.Poppler.Objects.Page.pageRenderForPrinting' instead -} pageRender :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: the page to render from -} -> Cairo.Context.Context {- ^ /@cairo@/: cairo context to render to -} -> m () pageRender page cairo = liftIO $ do page' <- unsafeManagedPtrCastPtr page cairo' <- unsafeManagedPtrGetPtr cairo poppler_page_render page' cairo' touchManagedPtr page touchManagedPtr cairo return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageRenderMethodInfo instance (signature ~ (Cairo.Context.Context -> m ()), MonadIO m, IsPage a) => O.MethodInfo PageRenderMethodInfo a signature where overloadedMethod _ = pageRender #endif -- method Page::render_for_printing -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the page to render from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cairo", argType = TInterface (Name {namespace = "cairo", name = "Context"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "cairo context to render to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_render_for_printing" poppler_page_render_for_printing :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Cairo.Context.Context -> -- cairo : TInterface (Name {namespace = "cairo", name = "Context"}) IO () {- | Render the page to the given cairo context for printing. -} pageRenderForPrinting :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: the page to render from -} -> Cairo.Context.Context {- ^ /@cairo@/: cairo context to render to -} -> m () pageRenderForPrinting page cairo = liftIO $ do page' <- unsafeManagedPtrCastPtr page cairo' <- unsafeManagedPtrGetPtr cairo poppler_page_render_for_printing page' cairo' touchManagedPtr page touchManagedPtr cairo return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageRenderForPrintingMethodInfo instance (signature ~ (Cairo.Context.Context -> m ()), MonadIO m, IsPage a) => O.MethodInfo PageRenderForPrintingMethodInfo a signature where overloadedMethod _ = pageRenderForPrinting #endif -- method Page::render_for_printing_with_options -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the page to render from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cairo", argType = TInterface (Name {namespace = "cairo", name = "Context"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "cairo context to render to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TInterface (Name {namespace = "Poppler", name = "PrintFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "print options", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_render_for_printing_with_options" poppler_page_render_for_printing_with_options :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Cairo.Context.Context -> -- cairo : TInterface (Name {namespace = "cairo", name = "Context"}) CUInt -> -- options : TInterface (Name {namespace = "Poppler", name = "PrintFlags"}) IO () {- | Render the page to the given cairo context for printing with the specified options @since 0.16 -} pageRenderForPrintingWithOptions :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: the page to render from -} -> Cairo.Context.Context {- ^ /@cairo@/: cairo context to render to -} -> [Poppler.Flags.PrintFlags] {- ^ /@options@/: print options -} -> m () pageRenderForPrintingWithOptions page cairo options = liftIO $ do page' <- unsafeManagedPtrCastPtr page cairo' <- unsafeManagedPtrGetPtr cairo let options' = gflagsToWord options poppler_page_render_for_printing_with_options page' cairo' options' touchManagedPtr page touchManagedPtr cairo return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageRenderForPrintingWithOptionsMethodInfo instance (signature ~ (Cairo.Context.Context -> [Poppler.Flags.PrintFlags] -> m ()), MonadIO m, IsPage a) => O.MethodInfo PageRenderForPrintingWithOptionsMethodInfo a signature where overloadedMethod _ = pageRenderForPrintingWithOptions #endif -- method Page::render_selection -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #PopplerPage for which to render selection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cairo", argType = TInterface (Name {namespace = "cairo", name = "Context"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "cairo context to render to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "start and end point of selection as a rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "old_selection", argType = TInterface (Name {namespace = "Poppler", name = "Rectangle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "previous selection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "style", argType = TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerSelectionStyle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "glyph_color", argType = TInterface (Name {namespace = "Poppler", name = "Color"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "color to use for drawing glyphs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "background_color", argType = TInterface (Name {namespace = "Poppler", name = "Color"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "color to use for the selection background", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_render_selection" poppler_page_render_selection :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Cairo.Context.Context -> -- cairo : TInterface (Name {namespace = "cairo", name = "Context"}) Ptr Poppler.Rectangle.Rectangle -> -- selection : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) Ptr Poppler.Rectangle.Rectangle -> -- old_selection : TInterface (Name {namespace = "Poppler", name = "Rectangle"}) CUInt -> -- style : TInterface (Name {namespace = "Poppler", name = "SelectionStyle"}) Ptr Poppler.Color.Color -> -- glyph_color : TInterface (Name {namespace = "Poppler", name = "Color"}) Ptr Poppler.Color.Color -> -- background_color : TInterface (Name {namespace = "Poppler", name = "Color"}) IO () {- | Render the selection specified by /@selection@/ for /@page@/ to the given cairo context. The selection will be rendered, using /@glyphColor@/ for the glyphs and /@backgroundColor@/ for the selection background. If non-NULL, /@oldSelection@/ specifies the selection that is already rendered to /@cairo@/, in which case this function will (some day) only render the changed part of the selection. -} pageRenderSelection :: (B.CallStack.HasCallStack, MonadIO m, IsPage a) => a {- ^ /@page@/: the 'GI.Poppler.Objects.Page.Page' for which to render selection -} -> Cairo.Context.Context {- ^ /@cairo@/: cairo context to render to -} -> Poppler.Rectangle.Rectangle {- ^ /@selection@/: start and end point of selection as a rectangle -} -> Poppler.Rectangle.Rectangle {- ^ /@oldSelection@/: previous selection -} -> Poppler.Enums.SelectionStyle {- ^ /@style@/: a 'GI.Poppler.Enums.SelectionStyle' -} -> Poppler.Color.Color {- ^ /@glyphColor@/: color to use for drawing glyphs -} -> Poppler.Color.Color {- ^ /@backgroundColor@/: color to use for the selection background -} -> m () pageRenderSelection page cairo selection oldSelection style glyphColor backgroundColor = liftIO $ do page' <- unsafeManagedPtrCastPtr page cairo' <- unsafeManagedPtrGetPtr cairo selection' <- unsafeManagedPtrGetPtr selection oldSelection' <- unsafeManagedPtrGetPtr oldSelection let style' = (fromIntegral . fromEnum) style glyphColor' <- unsafeManagedPtrGetPtr glyphColor backgroundColor' <- unsafeManagedPtrGetPtr backgroundColor poppler_page_render_selection page' cairo' selection' oldSelection' style' glyphColor' backgroundColor' touchManagedPtr page touchManagedPtr cairo touchManagedPtr selection touchManagedPtr oldSelection touchManagedPtr glyphColor touchManagedPtr backgroundColor return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 -- method Page::render_to_ps -- method type : OrdinaryMethod -- Args : [Arg {argCName = "page", argType = TInterface (Name {namespace = "Poppler", name = "Page"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PopplerPage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ps_file", argType = TInterface (Name {namespace = "Poppler", name = "PSFile"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the PopplerPSFile to render to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_render_to_ps" poppler_page_render_to_ps :: Ptr Page -> -- page : TInterface (Name {namespace = "Poppler", name = "Page"}) Ptr Poppler.PSFile.PSFile -> -- ps_file : TInterface (Name {namespace = "Poppler", name = "PSFile"}) IO () {- | Render the page on a postscript file -} pageRenderToPs :: (B.CallStack.HasCallStack, MonadIO m, IsPage a, Poppler.PSFile.IsPSFile b) => a {- ^ /@page@/: a 'GI.Poppler.Objects.Page.Page' -} -> b {- ^ /@psFile@/: the PopplerPSFile to render to -} -> m () pageRenderToPs page psFile = liftIO $ do page' <- unsafeManagedPtrCastPtr page psFile' <- unsafeManagedPtrCastPtr psFile poppler_page_render_to_ps page' psFile' touchManagedPtr page touchManagedPtr psFile return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data PageRenderToPsMethodInfo instance (signature ~ (b -> m ()), MonadIO m, IsPage a, Poppler.PSFile.IsPSFile b) => O.MethodInfo PageRenderToPsMethodInfo a signature where overloadedMethod _ = pageRenderToPs #endif -- method Page::free_annot_mapping -- method type : MemberFunction -- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Poppler", name = "AnnotMapping"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A list of\n #PopplerAnnotMapping<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_free_annot_mapping" poppler_page_free_annot_mapping :: Ptr (GList (Ptr Poppler.AnnotMapping.AnnotMapping)) -> -- list : TGList (TInterface (Name {namespace = "Poppler", name = "AnnotMapping"})) IO () {- | Frees a list of 'GI.Poppler.Structs.AnnotMapping.AnnotMapping'\<!-- -->s allocated by 'GI.Poppler.Objects.Page.pageGetAnnotMapping'. It also unreferences the 'GI.Poppler.Objects.Annot.Annot'\<!-- -->s that each mapping contains, so if you want to keep them around, you need to reference them with 'GI.GObject.Objects.Object.objectRef'. -} pageFreeAnnotMapping :: (B.CallStack.HasCallStack, MonadIO m) => [Poppler.AnnotMapping.AnnotMapping] {- ^ /@list@/: A list of 'GI.Poppler.Structs.AnnotMapping.AnnotMapping'\<!-- -->s -} -> m () pageFreeAnnotMapping list = liftIO $ do list' <- mapM unsafeManagedPtrGetPtr list list'' <- packGList list' poppler_page_free_annot_mapping list'' mapM_ touchManagedPtr list g_list_free list'' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method Page::free_form_field_mapping -- method type : MemberFunction -- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Poppler", name = "FormFieldMapping"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A list of\n #PopplerFormFieldMapping<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_free_form_field_mapping" poppler_page_free_form_field_mapping :: Ptr (GList (Ptr Poppler.FormFieldMapping.FormFieldMapping)) -> -- list : TGList (TInterface (Name {namespace = "Poppler", name = "FormFieldMapping"})) IO () {- | Frees a list of 'GI.Poppler.Structs.FormFieldMapping.FormFieldMapping'\<!-- -->s allocated by 'GI.Poppler.Objects.Page.pageGetFormFieldMapping'. -} pageFreeFormFieldMapping :: (B.CallStack.HasCallStack, MonadIO m) => [Poppler.FormFieldMapping.FormFieldMapping] {- ^ /@list@/: A list of 'GI.Poppler.Structs.FormFieldMapping.FormFieldMapping'\<!-- -->s -} -> m () pageFreeFormFieldMapping list = liftIO $ do list' <- mapM unsafeManagedPtrGetPtr list list'' <- packGList list' poppler_page_free_form_field_mapping list'' mapM_ touchManagedPtr list g_list_free list'' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method Page::free_image_mapping -- method type : MemberFunction -- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Poppler", name = "ImageMapping"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A list of\n #PopplerImageMapping<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_free_image_mapping" poppler_page_free_image_mapping :: Ptr (GList (Ptr Poppler.ImageMapping.ImageMapping)) -> -- list : TGList (TInterface (Name {namespace = "Poppler", name = "ImageMapping"})) IO () {- | Frees a list of 'GI.Poppler.Structs.ImageMapping.ImageMapping'\<!-- -->s allocated by 'GI.Poppler.Objects.Page.pageGetImageMapping'. -} pageFreeImageMapping :: (B.CallStack.HasCallStack, MonadIO m) => [Poppler.ImageMapping.ImageMapping] {- ^ /@list@/: A list of 'GI.Poppler.Structs.ImageMapping.ImageMapping'\<!-- -->s -} -> m () pageFreeImageMapping list = liftIO $ do list' <- mapM unsafeManagedPtrGetPtr list list'' <- packGList list' poppler_page_free_image_mapping list'' mapM_ touchManagedPtr list g_list_free list'' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method Page::free_link_mapping -- method type : MemberFunction -- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Poppler", name = "LinkMapping"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A list of\n #PopplerLinkMapping<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_free_link_mapping" poppler_page_free_link_mapping :: Ptr (GList (Ptr Poppler.LinkMapping.LinkMapping)) -> -- list : TGList (TInterface (Name {namespace = "Poppler", name = "LinkMapping"})) IO () {- | Frees a list of 'GI.Poppler.Structs.LinkMapping.LinkMapping'\<!-- -->s allocated by 'GI.Poppler.Objects.Page.pageGetLinkMapping'. It also frees the 'GI.Poppler.Unions.Action.Action'\<!-- -->s that each mapping contains, so if you want to keep them around, you need to copy them with 'GI.Poppler.Unions.Action.actionCopy'. -} pageFreeLinkMapping :: (B.CallStack.HasCallStack, MonadIO m) => [Poppler.LinkMapping.LinkMapping] {- ^ /@list@/: A list of 'GI.Poppler.Structs.LinkMapping.LinkMapping'\<!-- -->s -} -> m () pageFreeLinkMapping list = liftIO $ do list' <- mapM unsafeManagedPtrGetPtr list list'' <- packGList list' poppler_page_free_link_mapping list'' mapM_ touchManagedPtr list g_list_free list'' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method Page::free_text_attributes -- method type : MemberFunction -- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Poppler", name = "TextAttributes"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A list of\n #PopplerTextAttributes<!-- -->s", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_free_text_attributes" poppler_page_free_text_attributes :: Ptr (GList (Ptr Poppler.TextAttributes.TextAttributes)) -> -- list : TGList (TInterface (Name {namespace = "Poppler", name = "TextAttributes"})) IO () {- | Frees a list of 'GI.Poppler.Structs.TextAttributes.TextAttributes'\<!-- -->s allocated by 'GI.Poppler.Objects.Page.pageGetTextAttributes'. @since 0.18 -} pageFreeTextAttributes :: (B.CallStack.HasCallStack, MonadIO m) => [Poppler.TextAttributes.TextAttributes] {- ^ /@list@/: A list of 'GI.Poppler.Structs.TextAttributes.TextAttributes'\<!-- -->s -} -> m () pageFreeTextAttributes list = liftIO $ do list' <- mapM unsafeManagedPtrGetPtr list list'' <- packGList list' poppler_page_free_text_attributes list'' mapM_ touchManagedPtr list g_list_free list'' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method Page::selection_region_free -- method type : MemberFunction -- Args : [Arg {argCName = "region", argType = TGList (TInterface (Name {namespace = "Poppler", name = "Rectangle"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GList of\n #PopplerRectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "poppler_page_selection_region_free" poppler_page_selection_region_free :: Ptr (GList (Ptr Poppler.Rectangle.Rectangle)) -> -- region : TGList (TInterface (Name {namespace = "Poppler", name = "Rectangle"})) IO () {-# DEPRECATED pageSelectionRegionFree ["(Since version 0.16)"] #-} {- | Frees /@region@/ -} pageSelectionRegionFree :: (B.CallStack.HasCallStack, MonadIO m) => [Poppler.Rectangle.Rectangle] {- ^ /@region@/: a 'GI.GLib.Structs.List.List' of 'GI.Poppler.Structs.Rectangle.Rectangle' -} -> m () pageSelectionRegionFree region = liftIO $ do region' <- mapM unsafeManagedPtrGetPtr region region'' <- packGList region' poppler_page_selection_region_free region'' mapM_ touchManagedPtr region g_list_free region'' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif