Created
July 14, 2017 03:32
-
-
Save ptomato/f4609abbfe6ab4bcce790c0b2bde8d09 to your computer and use it in GitHub Desktop.
Inventing GObject ES6 Classes (4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyClass = GObject.registerClass({ | |
GTypeName: 'MyNamespaceMyClass', | |
Implements: [Gio.Initable, MyInterface], | |
Properties: { 'prop': GObject.ParamSpec.int( /* etc. */ ) }, | |
Signals: { 'signal': { /* etc. */ } }, | |
}, class MyClass extends GObject.Object { | |
constructor(props={}) { | |
super(props); | |
// etc. | |
} | |
get prop() { /* ... */ } | |
method(arg) { /* ... */ } | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyInterface = GObject.registerInterface({ | |
GTypeName: 'MyNamespaceMyInterface', | |
Requires: [Gio.Initable], | |
Properties: { 'prop': GObject.ParamSpec.int( /* etc. */ ) }, | |
Signals: { 'signal': { /* etc. */ } }, | |
}, class MyInterface { | |
get prop() { /* ... */ } | |
method(arg) { /* ... */ } | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment