From: Axel S. <A....@ke...> - 2007-07-16 10:50:43
|
Fri Jul 13 13:54:16 PDT 2007 Peter Gavin <pg...@gm...> * glib: add GSource support hunk ./glib/System/Glib/MainLoop.chs.pp 52 + Source, + sourceAttach, + sourceSetPriority, + sourceGetPriority hunk ./glib/System/Glib/MainLoop.chs.pp 298 +{# pointer *GSource as Source foreign newtype #} +newSource :: Ptr Source + -> IO Source +newSource sourcePtr = + liftM Source $ newForeignPtr sourcePtr sourceFinalizer +foreign import ccall unsafe "&g_source_unref" + sourceFinalizer :: FunPtr (Ptr Source -> IO ()) + +sourceAttach :: Source + -> MainContext + -> IO Word +sourceAttach source context = + liftM fromIntegral $ {# call source_attach #} source context + +sourceSetPriority :: Source + -> Priority + -> IO () +sourceSetPriority source priority = + {# call source_set_priority #} source $ fromIntegral priority + +sourceGetPriority :: Source + -> IO Priority +sourceGetPriority source = + liftM fromIntegral $ {# call source_get_priority #} source + + |