GNOME Bugzilla – Bug 742494
Can g-i bind hb_blob_create()?
Last modified: 2015-02-07 16:48:36 UTC
Excuse me for filing a bug. I'm doing so such that we keep the discussion in one place, instead of IRC logs... I'm trying to bind HarfBuzz and have had great luck so far. I'm trying to get callbacks working properly though. If I get this function bound correctly I think I can manage the rest. Here it is: hb_blob_t * hb_blob_create (const char *data, unsigned int length, hb_memory_mode_t mode, void *user_data, hb_destroy_func_t destroy) The semantics is that data is input to the function, with length=length. And when data won't be needed anymore, destroy will be called with user_data passed as callback. Now, I don't seem to be able to find any way to express this. I would think I'd need something like this: * @data: (array length=length) (element-type uint8_t) (destroy destroy) (scope notified): Pointer to blob data. * @length: Length of @data in bytes. * @mode: Memory mode for @data. * @user_data: (nullable): Data parameter to pass to @destroy. * @destroy: (nullable) (closure user_data): Callback to call when @data is not needed anymore. That is, I want data (not a callback) be scoped notified. And then the binding should take care of passing the right callback to destroy, and feel free to use user_data as it sees fit. Several things seem wrong with this though. For one, looks like scope annotation only applies to callbacks, not data parameters. So, is there any way to express the semantics I want? Thanks, behdad
Jasper suggested that I add new API that takes a GBytes *, and rename that to hb_blob_create(). Works for me. Thanks Jasper!
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]