Re: GtkArg changes



On 14 Dec 2000, Havoc Pennington wrote:

> Tim Janik <timj gtk org> writes: 

> > yes, i'm aware, i mailed havoc about those, as i don't actually know
> > what his tabs are about.
> 
> Tabs are PangoTabArray, should be a boxed type. (Probably should be a
> boxed type registered by Pango, but for now I'll just put it in
> gtktypebuiltins.)

why don't you put that stuff into pango right away, kludging
gtktypebuiltins now, just means we have to do cleanups later on.

> > for the font description however, BOXED or POINTER is a pretty bad choice,
> > instead, he should take something like STRING and then internally use
> > pango_font_description_from_string()/pango_font_description_to_string().
> 
> The "font" arg takes a string, and "font_desc" takes a font
> description struct. You may want to use the struct if you are
> e.g. deriving the font programmatically, for example say you are
> creating 10 fonts in a range of sizes from 10 to 100 points, you don't
> want to sprintf the sizes into strings.
> 
> Currently the text widget just segfaults all over the place because
> insert_text on the buffer doesn't work, which is why I haven't fixed
> this. I may revert insert_text to use GTK_TYPE_POINTER for now to get
> past the segfaults (I know this won't help you James).

i see, but using G_TYPE_POINTER for arguments should really be avoided:

2000-12-14  Havoc Pennington  <hp redhat com>

        * gtk/gtkobject.c (gtk_object_add_arg_type): add G_TYPE_POINTER
        here until boxed is working (and maybe after that - we should
        really not gratuitously break old code)

about the only argument that justifiably used G_TYPE_POINTER,
was GtkObject.user_data, and that doesn't use the old gtk_object_add_arg_type()
interface anymore. your text widget doesn't count as "old code", newly
implemented properties should go through g_object_class_install_property() and
the assorted set_property() and get_property(). currently CVS contains sample
code for those for GtkObject and GObject. once we resolved your hassles,
G_TYPE_POINTER should be backed out from the GtkArg compat code.

as for G_PARAM_SPEC_VALUE_TYPE(), i'll make that per-instance, i'm just not
sure whether to use a real instance member for this or just per-pspec qdata,
since it's only going to be different from class->value_type for G_TYPE_OBJECT,
G_TYPE_BOXED and G_TYPE_PARAM.

> 
> Havoc
> 

---
ciaoTJ





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