Permalink
Browse files

Added webResourceGetData

This requires glib with GString patch applied.
  • Loading branch information...
1 parent e79b880 commit 741baa94d5980bc9bcc6371959755c37e36c3068 @baldo baldo committed Nov 15, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 Graphics/UI/Gtk/WebKit/WebResource.chs
@@ -41,6 +41,7 @@ module Graphics.UI.Gtk.WebKit.WebResource (
webResourceNew,
-- * Methods
+ webResourceGetData,
webResourceGetEncoding,
webResourceGetFrameName,
webResourceGetMimeType,
@@ -52,6 +53,7 @@ import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
+import System.Glib.GString
import System.Glib.GError
import Graphics.UI.Gtk.Gdk.Events
@@ -75,6 +77,11 @@ webResourceNew resData size uri mimeType encoding frameName =
wrapNewGObject mkWebResource $
{#call web_resource_new#} dataPtr (fromIntegral size) uriPtr mimePtr encodingPtr framePtr
+-- | Returns the data of the WebResource.
+webResourceGetData :: WebResourceClass self => self -> IO (Maybe String)
+webResourceGetData wr =
+ {#call web_resource_get_data#} (toWebResource wr) >>= readGString
+
-- | Get encoding.
webResourceGetEncoding ::
WebResourceClass self => self

0 comments on commit 741baa9

Please sign in to comment.