From: Duncan C. <dun...@wo...> - 2006-05-02 22:15:30
|
On Tue, 2006-05-02 at 20:00 +0100, Axel Simon wrote: > Duncan, > > I don't new enough versions of Glib on my system. Do you? I did this > because I thought it would fix the FontMap problem (but it didn't of > course). I could install 2.10.2 and test that, though it's currently masked in Gentoo. Duncan > -------- Forwarded Message -------- > From: Axel Simon <A....@ke...> > To: gtk...@li... > Subject: [Gtk2hs-commit] Add support of new floating reference in > GObject. > Date: Tue, 2 May 2006 11:49:33 -0700 > Tue May 2 11:45:12 PDT 2006 Axel Simon <A....@ke...> > * Add support of new floating reference in GObject. > > The floating reference needs to be ignored just as in GtkObject. > There are two issues with this patch: > a) it's untested, it might not even compile > b) it should use GTK_CHECK_VERSION when it should use GLIB_CHECK_VERSION > For b) we don't have the appropriate macros yet, and this change will > probably stay the only thing that needs this macro. > > > hunk ./glib/System/Glib/GObject.chs.pp 80 > -objectNew objType parameters = > - liftM castPtr $ --caller must makeNewGObject as we don't know > +objectNew objType parameters = do > + obj <- liftM castPtr $ --caller must makeNewGObject as we don't know > hunk ./glib/System/Glib/GObject.chs.pp 83 > - withArray (map GParameter parameters) $ \paramArrayPtr -> > - {# call g_object_newv #} objType > - (fromIntegral $ length parameters) paramArrayPtr > + withArray (map GParameter parameters) $ \paramArrayPtr -> > + {# call g_object_newv #} objType > + (fromIntegral $ length parameters) paramArrayPtr > + objectRefSink obj > + return obj > + > + > +#if GTK_CHECK_VERSION(2,10,0) > +-- | Reference and sink an object. > +objectRefSink :: GObjectClass obj => Ptr obj -> IO () > +objectRefSink obj = do > + {#call unsafe object_ref_sink#} (castPtr obj) > + return () > + > +#else > +objectRefSink :: GObjectClass obj => Ptr obj -> IO () > +objectRefSink obj = return () > +#endif > hunk ./glib/System/Glib/GObject.chs.pp 125 > - > hunk ./glib/System/Glib/GObject.chs.pp 149 > --- * The first argument is the contructor of the specific object. > +-- * Note that from Glib 2.10 onwards, 'makeNewGObject' and > +-- 'constructNewGObject' are semantically synonyms. In these new Glib > +-- implementations, each newly created 'GObject' has a reference count > +-- of zero (and a floating reference to keep it alive until it is > +-- referenced). However, for older Glib releases, the distinction > +-- is crucial. > hunk ./glib/System/Glib/GObject.chs.pp 160 > + objectRefSink objPtr > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gtk2hs-commit mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2hs-commit > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gtk2hs-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel |