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
| { | |
| "build-runtime": true, | |
| "id": "name.ptomato.Sdk", | |
| "id-platform": "name.ptomato.Platform", | |
| "branch": "master", | |
| "runtime": "org.freedesktop.Platform", | |
| "sdk": "org.freedesktop.Sdk", | |
| "runtime-version": "1.6", | |
| "modules": [ | |
| { |
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. | |
| } |
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
| @GObject.Class('MyNamespaceMyClass') | |
| @GObject.implements([Gio.Initable, MyCustomInterface]) | |
| @GObject.signal('signal', { /* etc. */ }) | |
| class MyClass extends GObject.Object { | |
| constructor(props={}) { | |
| super(props); | |
| // etc. | |
| } | |
| @GObject.property.int('Short name', 'Blurb', GObject.ParamFlags.READABLE, 42) |
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
| class MyClass extends GObject.Object { | |
| static get GTypeName { return 'MyNamespaceMyClass'; } | |
| static get Implements { return [Gio.Initable, MyCustomInterface]; } | |
| static get Properties { | |
| return { | |
| 'prop': GObject.ParamSpec.int( /* etc., etc. */ ), | |
| }; | |
| } | |
| static get Signals { | |
| return { |
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
| const MyClass = new Lang.Class({ | |
| Name: 'MyClass', | |
| GTypeName: 'MyNamespaceMyClass', | |
| Extends: GObject.Object, | |
| Implements: [Gio.Initable, MyCustomInterface], | |
| Properties: { | |
| 'prop': GObject.ParamSpec.int( /* etc., etc. */ ), | |
| }, | |
| Signals: { | |
| 'signal': { param_types: [ /* etc., etc. */ ] }, |
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
| /* g++ -g -Wno-invalid-offsetof -DDEBUG -std=c++11 -o lexical `pkg-config --cflags --libs mozjs-45` lexical.cpp */ | |
| #include <iostream> | |
| #include "js-config.h" | |
| #include "jsapi.h" | |
| #include "js/Initialization.h" | |
| #include "jsfriendapi.h" | |
| static JSClass global_class = { |
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
| const Gio = imports.gi.Gio; | |
| function* leafnodes(file) { | |
| let enumerator = file.enumerate_children('standard::*', 0, null); | |
| let info; | |
| while ((info = enumerator.next_file(null))) { | |
| let child = enumerator.get_child(info); | |
| if (info.get_file_type() === Gio.FileType.DIRECTORY) | |
| yield* leafnodes(child); | |
| else |
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
| const GLib = imports.gi.GLib; | |
| const Gio = imports.gi.Gio; | |
| function wrapPromise(obj, cancellable, asyncName, finishName, ...inArgs) { | |
| return new Promise((resolve, reject) => { | |
| let callerStack = new Error().stack | |
| .split('\n') | |
| .filter(line => !line.match(/<Promise>|wrapPromise/)) | |
| .join('\n'); | |
| obj[asyncName](...inArgs, cancellable, (obj, res) => { |
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
| /* gcc -o undrflow undrflow.c `pkg-config --cflags --libs gobject-2.0` */ | |
| #include <glib-object.h> | |
| #define PROP_FOO 1 | |
| #define TEST_TYPE_FOO test_foo_get_type () | |
| G_DECLARE_FINAL_TYPE (TestFoo, test_foo, TEST, FOO, GObject); | |
| struct _TestFoo | |
| { |
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
| .headerView { | |
| background-color: lightgray; | |
| } | |
| .headline { | |
| font-size: 30pt; | |
| background-color: yellow; /* So we can see the sizing */ | |
| } | |
| .byline { |