Re: libseed-list handling gpointer args/returns



For the first hack - strings into gio stuff, That should all be fixed in the new GIR (although it needs support in seed now)

The second one I can not remember the exact reason. I know the resulting code from experimenting with it was
  menu.el.popup(null, null,Gtk.StatusIcon.position_menu , this.el , 1, Gtk.get_current_event_time());

I suspect that the above code actually callbacs via the Seed API, rather than just binding a pointer to the C function call 

The ideal fix for that is to determine if a Callback is a native function - if so, pass that, rather than passing a closure... - 
not sure how simple it is to do though...


Regards
Alan
 --- On 29/Jul/2010, Jonatan Liljedahl wrote: 
> This quick'n'dirty patch actually seems to work. I only tested it with 
> async_queue_push() and _pop().
> 
> I uncommented these strange hacks in seed_gi_make_argument:
> 
> //        GObject *gobject;
> //        if (JSValueIsString (ctx, value))
> //          {
>            /*
>              things like gio.outputstream.write use void pointers
>              might need a few other types here..
>              not very well memory managed. - should be solved by 
> bytearrays when
>              introspection implements it.
>            */
> //          arg->v_string = seed_value_to_string (ctx, value, exception);
> //          break;
> //        }
>          /* gtk_statusicon_position_menu / gtk_menu_popup use the 
> userdata for the Gobject */
> //        gobject = seed_value_to_object (ctx, value, exception);
> //        if (!gobject)
> //          return FALSE;
> 
> //        arg->v_pointer = gobject;
> 
> Are they really needed?
> Why put a string or gobject in the value when the tag says void-pointer?
> 
> /J
> 
> On 07/28/2010 09:02 PM, Jonatan Liljedahl wrote:
> > many functions in GLib take gpointer as args or return values, for
> > example GLib.async_queue_push(queue, data).
> >
> > but this doesn't work currently, it gives errors like "ArgumentError
> > Unable to make argument 2 for function: async_queue_push."
> >
> > There is a hack in seed_gi_make_argument() that allows strings to be
> > passed, but this doesn't seem to work either (async_queue_pop() don't
> > seem to return a pushed string, but undefined)
> >
> > it should be possible and perhaps even simple to just wrap seed
> > objects/values in these cases.
> >
> > what function does the gvalue-to-seed conversion of the return value?
> >
> > /Jonatan
> > _______________________________________________
> > libseed-list mailing list
> > libseed-list gnome org
> > http://mail.gnome.org/mailman/listinfo/libseed-list



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