Re: GSeal bugs in GtkAccelLabel hampering flexibility



On Mon, 2009-01-26 at 16:34 -0500, Behdad Esfahbod wrote:
> Peter Clifton wrote:
> 
> >> If you want a workaround for now, just access the member as
> >> GSEAL(member_name).  I told them the GSEAL macro should use __line__, they
> >> didn't listen :P.
> > 
> > Ok - didn't know I could do that. I had presumed the sealed members we
> > not available for prodding outside GTK's codebase.
> 
> It's a bad hack.  I'm sure the GTK3 guys will find me and hunt me for letting
> this out.
> 
> 
> > (BTW.. what would __line__ do exactly?)
> 
> It expands to the line number.  If the GSEAL macro used that to include the
> line number in the mangled name you couldn't use this trick.
> 
> 
> > If this lets me work around the problem, perhaps I can help prepare a
> > more complete fix for GTK 3.0, whilst not being stuck in limbo waiting
> > for users to move onto some as-yet unreleased GTK version. I'm not event
> > sure whether all the fixes can even be made without breaking ABI. (GTK
> > 3.0 will break ABI right?)
> 
> Correct.  But the idea is to make transition as straightforward as possible.
> 
> > I presume accessing members with GSEAL(member_name) carries a big
> > "Caveat Emptor", that you're now relying on implementation details.
> 
> Well, one is not supposed to use the GSEAL'ed members.  But given your
> situation, well, why not...

Turns out about 20% of our source files don't compile with
-DGSEAL_ENABLE anyway, so looks like we've got some work to do before
GTK3.0 comes out ;). Oh.. and a fair number of these bugs were in my
"stolen and modified from GTK sources" GtkAction and GtkAccelLabel
subclasses.

Please do help enlighten me though.. I'm going mad trying to figure this
one out... how does actually GSEAL work? (I've not found anything using
Google).

I can't grep a single reference defining the GSEAL macro
in /usr/include, nor _g_seal__. Yet magically -DGSEAL_ENABLE makes the
code compilation break by hiding those members.

Am I being dumb...? What black magic is going on here?


-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]