After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 581695 - Support GHash wrapped as GValue
Support GHash wrapped as GValue
Status: RESOLVED WONTFIX
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on: 581686
Blocks:
 
 
Reported: 2009-05-07 04:25 UTC by C. Scott Ananian
Modified: 2017-04-02 20:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add-support-for-converting-GHashTable-out-params.patch (5.47 KB, patch)
2009-05-07 04:25 UTC, C. Scott Ananian
committed Details | Review
Support-GHashTable-in-parameters.patch (9.94 KB, patch)
2009-05-07 04:26 UTC, C. Scott Ananian
committed Details | Review
Support-GHashTable-in-GValue-objects-via-g-o-i-ext.patch (4.40 KB, patch)
2009-05-07 04:26 UTC, C. Scott Ananian
none Details | Review
Support-GHashTable-in-GValue-objects-via-g-o-i-ext.patch (4.60 KB, patch)
2009-05-18 19:47 UTC, C. Scott Ananian
none Details | Review

Description C. Scott Ananian 2009-05-07 04:25:05 UTC
The first two patches add support for GHashTable out/in parameters (respectively).  We convert aJSON-style object to a GHashTable.  Also fix memory management of (transfer full) and (transfer container) in parameters of GList/GSList/GHash types.  Test cases show how GHash in/out parameters work.

g-object-introspection's "extra type" mechanism allows us to associate
unique GType names (such as those created by dbus-gtype-specialized) with
appropriate introspection information for parameterized types, such as GList,
GSList, and GHash (see bug 581686).  This allows us (in the third patch) to convert native GValues wrapping these objects into appropriate javascript objects, recursively converting the components of the hash or list collection.
Comment 1 C. Scott Ananian 2009-05-07 04:25:51 UTC
Created attachment 134167 [details] [review]
Add-support-for-converting-GHashTable-out-params.patch
Comment 2 C. Scott Ananian 2009-05-07 04:26:11 UTC
Created attachment 134168 [details] [review]
Support-GHashTable-in-parameters.patch
Comment 3 C. Scott Ananian 2009-05-07 04:26:34 UTC
Created attachment 134169 [details] [review]
Support-GHashTable-in-GValue-objects-via-g-o-i-ext.patch
Comment 4 Johan Bilien 2009-05-12 16:21:18 UTC
(In reply to comment #1)
> Created an attachment (id=134167) [edit]
> Add-support-for-converting-GHashTable-out-params.patch
> 


The patch looks good but the test seems to depend on function in Everything which you did not include in bug# 581682?

test_ghash_nested_everything_return
Comment 5 Johan Bilien 2009-05-12 16:39:11 UTC
(In reply to comment #2)
> Created an attachment (id=134168) [edit]
> Support-GHashTable-in-parameters.patch
> 

Shouldn't the code check that the elements are strings?

Looks good otherwise
Comment 6 Havoc Pennington 2009-05-13 23:22:12 UTC
Committed the first two, with the test temporarily commented out.
Comment 7 C. Scott Ananian 2009-05-18 17:21:46 UTC
The test is part of bug 581685, which adds the gobject-introspection support necessary to properly annotate the type of the test functions.  I added a note there to re-enable the test.  We're still waiting for 581686 before approving/pushing the last part, I guess?
Comment 8 C. Scott Ananian 2009-05-18 19:47:39 UTC
Created attachment 134894 [details] [review]
Support-GHashTable-in-GValue-objects-via-g-o-i-ext.patch

Update to git HEAD, to match 4a84c965b59941c8f8ce00309d4451a2dfa89d74.
Comment 9 C. Scott Ananian 2009-06-12 17:10:33 UTC
Re-enabled tests, now that bug 581685 has been closed.  The remaining piece of this patch supports GHashtables encapsulated in GValues, using the "extra types" mechanism of bug 581686.  Retitling bug to match.
Comment 10 Philip Chimento 2017-04-02 20:53:10 UTC
It seems that in the intervening time, the GIR format has crystallized around not having "extra types". Closing this, in the absence of a compelling use case.