Commit 9970cf8b authored by Emanuele Aina's avatar Emanuele Aina

web-runtime: Describe GObject-Introspection mappings

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
Differential Revision: https://phabricator.apertis.org/D4835
parent 867e96aa
......@@ -365,7 +365,49 @@ Window implements ApertisImportsObject;
The `GObjectIntrospection` interface will then export
the GObject-Introspection modules whitelisted by the application
(for example `imports.gi.Folks`).
(for example `imports.gi.Gio`).
Modules export object constructors as JavaScript constructors
that can take a map of construction time properties:
```
const Gio = imports.gi.Gio;
let settings = new Gio.Settings({'schema': 'com.example.AddressBook'});
```
If multiple, incompatible API versions of a module exist,
a specific version can be requested using the `imports.gi.versions` map:
```
imports.gi.versions['Folks'] = '0.6';
const Folks = imports.gi.Folks;
```
GObject methods are called just like JavaScript object methods:
```
settings.apply();
```
Signals can be handled using the `connect()` method:
```
settings.connect('changed', function(key) { print(key); });
```
GObject properties may be retrieved and set
using JavaScript property-style access:
```
print(settings.schema_id);
```
Both enumerations and flags appear as entries under the namespace,
with associated member properties:
```
print(Gio.SettingsBindFlags.DEFAULT);
```
### Hardkey integration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment