poppler 0.12.2.1 → 0.12.2.2
raw patch · 2 files changed
+22/−7 lines, 2 files
Files
- Graphics/UI/Gtk/Poppler/Attachment.chs +19/−4
- poppler.cabal +3/−3
Graphics/UI/Gtk/Poppler/Attachment.chs view
@@ -60,11 +60,22 @@ -> Int -> Bool -{#pointer AttachmentSaveFunc#} +{- typedef gboolean (*PopplerAttachmentSaveFunc) (const gchar *buf,+ gsize count,+ gpointer data,+ GError **error); -}+-- {#pointer AttachmentSaveFunc#}++type TAttachmentSaveFunc = CString -> {#type gsize#} -> Ptr () -> Ptr (Ptr ()) -> IO {#type gboolean#}++type AttachmentSaveFunc = FunPtr TAttachmentSaveFunc+ foreign import ccall "wrapper" mkAttachmentSaveFunc ::- (Ptr Attachment -> CString -> {#type glong#} -> Ptr () -> IO {#type gboolean#})- -> IO AttachmentSaveFunc+ TAttachmentSaveFunc -> IO AttachmentSaveFunc+ -- TAttachmentSaveFunc -> IO AttachmentSaveFunc+ -- (Ptr Attachment -> CString -> {#type glong#} -> Ptr () -> IO {#type gboolean#})+ -- -> IO AttachmentSaveFunc -- | Saves @attachment@ to a file indicated by @filename@. -- Return 'True' if the file successfully saved@@ -76,13 +87,17 @@ withUTFString filename $ \ filenamePtr -> propagateGError ({#call poppler_attachment_save #} (toAttachment attachment) filenamePtr) +++ -- | attachmentSaveToCallback :: AttachmentClass attachment => attachment -> AttachmentSave -> IO Bool attachmentSaveToCallback attachment fun = liftM toBool $ do- funcPtr <- mkAttachmentSaveFunc $ \_ s i _ -> do+ funcPtr <- mkAttachmentSaveFunc $ \s i _ _ -> do str <- peekUTFString s return (fromBool (fun str (fromIntegral i))) {#call attachment_save_to_callback #} (toAttachment attachment) funcPtr (castFunPtrToPtr funcPtr) nullPtr+
poppler.cabal view
@@ -1,10 +1,10 @@ Name: poppler-Version: 0.12.2.1+Version: 0.12.2.2 License: GPL-2 License-file: COPYING Copyright: (c) 2001-2010 The Gtk2Hs Team Author: Andy Stewart-Maintainer: Ian-Woo Kim <ianwookim@gmail.com> +Maintainer: Ian-Woo Kim <ianwookim@gmail.com> Build-Type: Custom Cabal-Version: >= 1.6 Stability: stable@@ -15,7 +15,7 @@ library, to centralize the maintenance effort. And move to forward in a number of areas that don't fit within the goals of xpdf. Category: Graphics-Tested-With: GHC == 7.4 +Tested-With: GHC == 7.4 Extra-Source-Files: Gtk2HsSetup.hs hierarchy.list template-hsc-gtk2hs.h