Re: misc fixes



Hi,

On Tue, 2005-10-04 at 10:47 +0200, Marc Lehmann wrote:
On Tue, Oct 04, 2005 at 01:24:50AM -0400, muppet <scott asofyet org> wrote:
On Oct 3, 2005, at 11:27 PM, gtk-perl schmorp de wrote:

Allowing NULL in a structure can be even harder for a perl- 
only user to track down, because the resulting breakage may not occur  
for quite some time.

Which resulting breakage do you talk about? The breakage is already there,
in Gtk2, and consists of not allowing undef where it is valid. It's easy
to track down, too: the program will barf immediately.

You assume that any of the binding developers have actually tested
*each* C function of gtk, gdk, gdk-pixbuf, and any other libraries that
has Perl bindings.

It does not work this way - otherwise we wouldn't have bindings *at
all*.

Once you hit a corner case, you change the underlying XS wrapper code;
that's it.  The more people hits corner cases, the few corner case we
get; we could say that - if the API would remain the same - over time
the corner cases count would approach zero.  If you did find such corner
cases at *this* point in time and not before, it means that this
approach worked best than actually testing everything beforehand - and
remember that some parts of Gtk can't actually be tested in a "vacuum",
but actually need a complete test program.

You found a corner case on a function that is rarely used: that's great.
You submtted a patch: that's even better.

Now, bitching because the gtk2-perl developers thought that a more
conservative approach ("we don't know if passing NULL is safe, so we
never pass NULL unless we discover that it's safe") worked best is
something that I personally consider ungrateful at least, and plain
stupid at most.

Also bitching because your patch - without test cases - didn't make it
through a stable release, with known restrictions on API/ABI changes
coming from the modules following the Gnome policy on libraries and
bindings, is also that I find ungrateful; this is all work made by
volunteers - with limited time and resources.

The real fix is to have better upstream documentation of the lifetime
and value constraints of structure members.

That makes no sense at all. Changing upstream _documentation_ will not
magically fix the Gtk2 module. Wether documented or not, the code needs
change.

Changing upstream documentation would make the life of binding writers
easier - we would know if passing NULL arguments would not result in a
segfault.

On why it isn't documented I can only guess, but in the cases I've seen
it's simply obvious that you can pass NULL once you _use_ those functions
(in all those cases I did assume that undef would work).

Fine.

Then we need someone who uses those functions.  If this someone isn't
one of the bindings developers then it must be one of the bindings
users.

+ source code to find out what to do, and in some of those "fringe"  
cases, it doesn't seem worth it --- for example, gdk_gc_set_clip_mask 
() and gdk_gc_set_clip_region() haven't been touched since before the  
code was in sourceforge's CVS!

I can't follow that either - do you hint that not too many people use those
functions so it isn't worth to fix them?

How on earth you did infer this from the period above is unknown to me.

It means that no-one, since the cvs import, did actually use or test
those functions passing NULL/undef.

In any case, if those fixes are deemed unworthy, then I can stop wasting
my time with bugfixes in the future.

Please, grow up - now.

I am sure tha majority of users use Gtk2 the same way they would use Tk. But
the greatness of Gtk2 was that it wasns't just a primitive toolbox but an
interface to gtk+. There are not many gtk+ programs that don't create their
own widgets, and for that to work you need to be able to modify your GC at
times.

I did create many widgets - by subclassing or by creating my own draw
functions - and I never really had a case where I needed those
functions.

Should this mean that I did magically made them work by sacrifying
fourty virgins to Samhaine?  I don't think so.

In my case, I am writing a simple image viewer, and to properly implement
the refresh I have to set the clipping region on redraws otherwise I get
bugs.

Ah, now you explain - you are writing something that is not really a
common use case.

The changes to get_time() look all right.  To pass undef, you'll have  
to call it like "Gtk2::Gdk::Event::get_time(undef)", correct?

Probably. I'd probably do it differently, but the Gtk2 API policies of
making everything a method never made sense to me.

It's called object-orientation, you know...

Ciao,
 Emmanuele.

-- 
Emmanuele Bassi - <ebassi gmail com>
Log: http://log.emmanuelebassi.net




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