glib 0.11.0 → 0.11.1
raw patch · 4 files changed
+11/−16 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Gtk2HsSetup.hs +1/−1
- System/Glib/GList.chs +7/−12
- System/Glib/GObject.chs +2/−2
- glib.cabal +1/−1
Gtk2HsSetup.hs view
@@ -455,7 +455,7 @@ -- existance of a .chs module may not depend on some CPP condition. extractDeps :: ModDep -> IO ModDep extractDeps md@ModDep { mdLocation = Nothing } = return md-extractDeps md@ModDep { mdLocation = Just f } = withFileContents f $ \con -> do+extractDeps md@ModDep { mdLocation = Just f } = withUTF8FileContents f $ \con -> do let findImports acc (('{':'#':xs):xxs) = case (dropWhile ((==) ' ') xs) of ('i':'m':'p':'o':'r':'t':' ':ys) -> case simpleParse (takeWhile ((/=) '#') ys) of
System/Glib/GList.chs view
@@ -44,6 +44,7 @@ import Foreign import Control.Exception (bracket)+import Control.Monad (foldM) {# context lib="glib" prefix="g" #} @@ -115,24 +116,18 @@ -- Turn a list of something into a GList. -- toGList :: [Ptr a] -> IO GList-toGList xs = makeList nullPtr xs+toGList = foldM prepend nullPtr . reverse where- -- makeList :: GList -> [Ptr a] -> IO GList- makeList current (x:xs) = do- newHead <- {#call unsafe list_prepend#} current (castPtr x)- makeList newHead xs- makeList current [] = return current+ -- prepend :: GList -> Ptr a -> IO GList+ prepend l x = {#call unsafe list_prepend#} l (castPtr x) -- Turn a list of something into a GSList. -- toGSList :: [Ptr a] -> IO GSList-toGSList xs = makeList nullPtr xs+toGSList = foldM prepend nullPtr . reverse where- -- makeList :: GSList -> [Ptr a] -> IO GSList- makeList current (x:xs) = do- newHead <- {#call unsafe slist_prepend#} current (castPtr x)- makeList newHead xs- makeList current [] = return current+ -- prepend :: GSList -> Ptr a -> IO GList+ prepend l x = {#call unsafe slist_prepend#} l (castPtr x) -- Temporarily allocate a list of something --
System/Glib/GObject.chs view
@@ -66,6 +66,7 @@ {#import System.Glib.Types#} import System.Glib.GValue (GValue) import System.Glib.GType (GType, typeInstanceIsA)+import System.Glib.GTypeConstants ( object ) import System.Glib.GParameter import System.Glib.Attributes (newNamedAttr, Attr) import Foreign.StablePtr@@ -102,8 +103,7 @@ -- | The type constant to check if an instance is of 'GObject' type. gTypeGObject :: GType-gTypeGObject =- {# call fun unsafe g_object_get_type #}+gTypeGObject = object -- | This function wraps any object that does not derive from Object. -- It should be used whenever a function returns a pointer to an existing
glib.cabal view
@@ -1,5 +1,5 @@ Name: glib-Version: 0.11.0+Version: 0.11.1 License: LGPL-2.1 License-file: COPYING Copyright: (c) 2001-2010 The Gtk2Hs Team