Skip to content

Commit

Permalink
Merge pull request #186 from gjsify/re-export-cairo
Browse files Browse the repository at this point in the history
Add basic cairo overrides
  • Loading branch information
JumpLink authored Jul 24, 2024
2 parents 8b3ec80 + 31839fc commit b76e8b5
Show file tree
Hide file tree
Showing 45 changed files with 885 additions and 52 deletions.
37 changes: 31 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ Run the client:
yarn start:client
```

## Gtk-3.0 Browser
## Gtk3 Browser
![gtk-3-browser](gtk-3-browser/preview.png)

A simple browser using Gtk-3.0 and WebKit-2.0
A simple browser using Gtk3 and WebKit-2.0

Source: [gtk-3-browser](gtk-3-browser)
Bundler: Webpack
Expand All @@ -71,7 +71,7 @@ cd /examples/gtk-3-browser
yarn start
```

## Gtk-3.0 Builder
## Gtk3 Builder
![gtk-3-builder](gtk-3-builder/preview.png)

Source: [gtk-3-builder](gtk-3-builder)
Expand All @@ -83,7 +83,32 @@ cd /examples/gtk-3-builder
yarn start
```

## Gtk-3.0 Editor
## Gtk3 Calc
![gtk-3-calc](gtk-3-calc/preview.png)

Source: [gtk-3-calc](gtk-3-calc)
Bundler: Esbuild

Build and run:
```bash
cd /examples/gtk-3-calc
yarn start
```

## Gtk3 Clutter (TSC)
![gtk-3-clutter](gtk-3-clutter-tsc/preview.png)

Source: [gtk-3-clutter](gtk-3-clutter-tsc)
Bundler: TSC

Build and run:
```bash
cd /examples/gtk-3-clutter-tsc
yarn start
```


## Gtk3 Editor
![gtk-3-editor](gtk-3-editor/preview.png)

Source: [gtk-3-editor](gtk-3-editor)
Expand All @@ -95,7 +120,7 @@ cd /examples/gtk-3-editor
yarn start
```

## Gtk-3.0 Hello Gtk
## Gtk3 Hello Gtk
![gtk-3-hello](gtk-3-hello/preview.png)

Source: [gtk-3-hello](gtk-3-hello)
Expand All @@ -107,7 +132,7 @@ cd /examples/gtk-3-hello
yarn start
```

## Gtk-4.0 ListStore
## Gtk4 ListStore
![gtk-4-list-store](gtk-4-list-store/preview.png)

GJS example showing how to build Gtk4 applications using `Gtk.TreeView` and `Gtk.ListStore`
Expand Down
2 changes: 1 addition & 1 deletion examples/adw-1-hello/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/adw-1-hello-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"description": "Simple GJS Typescript hello-world example using Libadwaita",
"type": "module",
"private": true,
Expand Down
11 changes: 11 additions & 0 deletions examples/cairo-surfaces-tsc/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Cairo from 'cairo';

const imageSurface = new Cairo.ImageSurface(Cairo.Format.ARGB32, 10, 10);

const pngSurface = Cairo.ImageSurface.createFromPNG('filename.png');

const pdfSurface = new Cairo.PDFSurface('filename.pdf', 32, 32);

const psSurface = new Cairo.PSSurface('filename.ps', 32, 32);

const svgSurface = new Cairo.SVGSurface('filename.svg', 32, 32);
26 changes: 26 additions & 0 deletions examples/cairo-surfaces-tsc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@ts-for-gir-example/cairo-surfaces-tsc",
"version": "4.0.0-beta.12",
"description": "Simple cairo-surfaces GJS example",
"type": "module",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build:app": "tsc",
"build": "yarn build:app",
"start:app": "gjs -m dist/main.js",
"debug:app": "GTK_DEBUG=interactive yarn start:app",
"start": "yarn build && yarn start:app",
"validate": "yarn validate:types",
"validate:types": "tsc --noEmit",
"clear": "rm -rf dist @types"
},
"author": "Pascal Garber <[email protected]>",
"license": "MIT",
"devDependencies": {
"typescript": "^5.5.3"
},
"dependencies": {
"@girs/gjs": "workspace:^"
}
}
Binary file added examples/cairo-surfaces-tsc/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions examples/cairo-surfaces-tsc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": ["@girs/gjs", "@girs/gjs/dom"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"outDir": "./dist"
},
"files": [
"main.ts",
]
}
2 changes: 1 addition & 1 deletion examples/gio-2-cat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/gio-2-cat-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"description": "Simple GJS Gtk 3 example app that shows how to use Gio-2.0 to read a file from the local file system",
"main": "index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion examples/gio-2-dbus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/gio-2-dbus-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"description": "GJS example showing how to build a DBus server/client",
"main": "index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion examples/gio-2-list-model/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/gio-2-list-model-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"description": "An example of implementing the GListModel interface in GJS",
"main": "index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion examples/glib-2-spawn-command/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/glib-2-spawn-command-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"description": "",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/glib-2-variant/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/glib-2-variant-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"description": "ts-for-gir GVariant example based on https://gjs.guide/guides/glib/gvariant.html",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/gtk-3-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/gtk-3-browser-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"type": "module",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/gtk-3-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/gtk-3-builder-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"type": "module",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/gtk-3-calc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-for-gir-example/gtk-3-calc-example",
"version": "4.0.0-beta.10",
"version": "4.0.0-beta.12",
"description": "Simple GJS Gtk 3 calculator example app",
"type": "module",
"private": true,
Expand Down
Loading

0 comments on commit b76e8b5

Please sign in to comment.