Re: "no need for these functions" ?



On Mon, 2006-02-13 at 12:56 -0500, Paul Davis wrote:
> On Mon, 2006-02-13 at 18:42 +0100, Murray Cumming wrote:
> > On Mon, 2006-02-13 at 10:37 -0500, Paul Davis wrote:
> > > This from gc.h in gtkmm 2.6:
> > > 
> > >   // Custom wrap these?, maybe with a Gdk::GC::Value class. Need to do
> > > take care of refcounts of GdkGCValue's fields.
> > >   // Actually, I don't see the need for these methods. murrayc.
> > 
> > I don't actually remember writing that. So I must guess what I meant.
> > 
> > >   //_WRAP_METHOD(void get_values(GdkGCValues& values) const,
> > > gdk_gc_get_values)
> > >   //_WRAP_METHOD(void set_values(const GdkGCValues& values, GCValuesMask
> > > values_mask), gdk_gc_set_values)
> > >   //__IGNORE(gdk_gc_get_values, gdk_gc_set_values)
> > > 
> > > the reason these methods are useful is when you want to modify a GC and
> > > then reset it back to whatever values it had before (eg. a clip mask).
> > 
> > Even after seeing the C documentation:
> > http://developer.gnome.org/doc/API/2.0/gdk/gdk-Graphics-Contexts.html#GdkGCValues
> > 
> > I'm still not quite sure what a GdkGCValues does. Is it just for saving
> > the whole state of a GdkGC, or is it often used to set individual
> > details.
> 
> the canonical use, i think, is in a situation where you want to modify
> one aspect of the GC (particular settings like the clip mask/origin),
> and then restore that single value.

For a single value, I'd expect just to store that single value. I wonder
why this kind of change set is necessary for a GC but not for other
classes.

Is this based on an old Xlibs API?

>  you use GdkGCValues to save all the
> values, then just restore the ones you know you modified. much cheaper
> than copying the GC to get started.

I'd probably accept a patch. But I'm very hesitant about wrapping
obscure parts of the API without really understanding them.

> > For now, of course, you can use gobj() and use the original C functions.
> 
> yes, implemented and working in our code.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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