-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
164 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Yarn https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
!@types/ | ||
@types/gio-2.0/* | ||
!@types/gio-2.0/package.json | ||
@types/gjs/* | ||
!@types/gjs/package.json | ||
@types/glib-2.0/* | ||
!@types/glib-2.0/package.json | ||
@types/gobject-2.0/* | ||
!@types/gobject-2.0/package.json |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { build } from "esbuild"; | ||
|
||
await build({ | ||
entryPoints: ['main.ts'], | ||
outdir: 'dist', | ||
bundle: true, | ||
// target: "firefox60", // Since GJS 1.53.90 | ||
// target: "firefox68", // Since GJS 1.63.90 | ||
// target: "firefox78", // Since GJS 1.65.90 | ||
target: "firefox91", // Since GJS 1.71.1 | ||
// target: firefox102 // Since GJS 1.73.2 | ||
format: 'esm', | ||
// platform: 'node', | ||
external: ['node-gtk', 'gi://*', 'resource://*', 'gettext', 'system', 'cairo'], | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later | ||
// SPDX-FileCopyrightText: 2009 Red Hat, Inc. | ||
// Based on https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/gio-cat.js | ||
|
||
/* | ||
* Make sure you have a non english locale installed, for example fr_FR and run | ||
* LANGUAGE=fr_FR gjs gettext.js | ||
* the label should show a translation of 'Print help' | ||
*/ | ||
|
||
import '@girs/gjs'; | ||
import '@girs/gjs/dom'; | ||
import '@girs/gio-2.0'; | ||
import '@girs/gtk-4.0'; | ||
import '@girs/adw-1'; | ||
|
||
// import Adw from "gi://Adw"; | ||
// import GLib from "gi://GLib"; | ||
import Gio from "gi://Gio"; | ||
// import Gtk from "gi://Gtk?version=4.0"; | ||
|
||
// const mainLoop = new GLib.MainLoop(null, false); | ||
// mainLoop.runAsync().then(() => { | ||
// log(`Exited main loop`); | ||
// }).catch((error) => { | ||
// logError(error); | ||
// }); | ||
|
||
const gioApp = new Gio.Application(); | ||
gioApp.runAsync(ARGV).then((exitStatus: number) => { | ||
log(`Exited with status: ${exitStatus}`); | ||
}).catch((error) => { | ||
logError(error); | ||
}); | ||
|
||
// const gtkApp = new Gtk.Application(); | ||
// gtkApp.runAsync(ARGV).then((exitStatus: number) => { | ||
// log(`Exited with status: ${exitStatus}`); | ||
// }).catch((error) => { | ||
// logError(error); | ||
// }); | ||
|
||
// const adwApp = new Adw.Application(); | ||
// adwApp.runAsync(ARGV).then((exitStatus: number) => { | ||
// log(`Exited with status: ${exitStatus}`); | ||
// }).catch((error) => { | ||
// logError(error); | ||
// }); | ||
|
||
setTimeout(() => { | ||
// mainLoop.quit(); | ||
gioApp.quit(); | ||
// gtkApp.quit(); | ||
// adwApp.quit(); | ||
}, 1000); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "ts-for-gir-run-async-example", | ||
"version": "3.2.5", | ||
"description": "Simple GJS Gtk 3 example app that shows how you can translate strings with gettext", | ||
"main": "index.js", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build:app": "yarn node esbuild.js", | ||
"build": "yarn build:app", | ||
"start:app": "gjs -m dist/main.js main.ts", | ||
"debug:app": "GTK_DEBUG=interactive yarn start:app", | ||
"start": "yarn clear && yarn build && yarn start:app", | ||
"validate": "yarn validate:app", | ||
"validate:app": "tsc --noEmit", | ||
"clear": "rm -rf dist @types" | ||
}, | ||
"author": "Pascal Garber <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"esbuild": "^0.19.5", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"lib": ["ESNext"], | ||
"types": [], | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
"moduleResolution": "node" | ||
}, | ||
"include": ["@girs/gjs", "@girs/gjs/ambient"], | ||
"files": [ | ||
"main.ts", | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"noEmit": true | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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