Re: libseed-list handling gpointer args/returns



Also, something similar should be done in seed_handle_closure(). Right now, no callbacks that take void pointers seem to work (userdata, etc..) Some callbacks only take void pointers and are thus unusable, like the GFunc of GThreadPool.

BTW, i'm not sure about the JSValueProtect() calls, they will probably introduce a memory leak unless Unprotect is called after the invokation?

/J

On 07/28/2010 09:33 PM, 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]