Re: [gtk-list] Re: Callback Argument Marshalling



On 10 Aug 1998, Marius Vollmer wrote:

> Yeah, um, I think so.  Have a look for yourself.  I just did a grep in
> a one-week-old (shame, shame) Gtk source tree:
> 
> % grep -n GTK_TYPE_POINTER *.c
> gtkargcollector.c:95:    case GTK_TYPE_POINTER:
> gtkctree.c:282:             GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_INT);
> gtkctree.c:289:             GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_INT);
> gtkctree.c:296:             GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
> gtkctree.c:303:             GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
> gtkctree.c:310:             GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, GTK_TYPE_POINTER, 
> gtkctree.c:311:             GTK_TYPE_POINTER);
> gtkeditable.c:151:                  GTK_TYPE_POINTER);
> gtknotebook.c:231:                  GTK_TYPE_POINTER,
> gtkobject.c:167:                           GTK_TYPE_POINTER,
> gtktypebuiltins_evals.c:361:  { GTK_TYPE_POINTER, "GTK_TYPE_POINTER", "pointer" },
> gtktypeutils.c:705:    { GTK_TYPE_POINTER,              "gpointer" },
> gtkwidget.c:322:                    GTK_TYPE_POINTER);
> gtkwidget.c:344:                    GTK_TYPE_POINTER);
> gtkwidget.c:352:                    GTK_TYPE_POINTER);
> gtkwindow.c:149:                    GTK_TYPE_POINTER);
> 
> I quickly looked up some of these places and it looks like there is no
> obvious cure for these GTK_TYPE_POINTERS.  For example, the CTree
> widget uses them for GList nodes and the Widget for GdkRectangle.

Well, the solution for the Widget calls is simply: GTK_GDK_RECTANGLE (or
whatever the appropriate naming convention is). I'm not at all sure about
the GList items, come to mention it.

Furthermore, these pointers don't give any hint whether the data is
incoming or outgoing through those pointers. Maybe a set of flags (READ,
WRITE, and LIST) to go along with the type would take care of details. 

-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)




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