@gjsify/terminal-native 0.22.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -1
- package/meson.build +31 -2
- package/package.json +12 -4
- package/prebuilds/darwin-arm64/GjsifyTerminal-1.0.gir +118 -0
- package/prebuilds/darwin-arm64/GjsifyTerminal-1.0.typelib +0 -0
- package/prebuilds/darwin-arm64/libgjsifyterminal.dylib +0 -0
- package/prebuilds/linux-arm64/GjsifyTerminal-1.0.typelib +0 -0
- package/prebuilds/linux-arm64/libgjsifyterminal.so +0 -0
- package/prebuilds/linux-ppc64/GjsifyTerminal-1.0.gir +118 -0
- package/prebuilds/linux-ppc64/GjsifyTerminal-1.0.typelib +0 -0
- package/prebuilds/linux-ppc64/libgjsifyterminal.so +0 -0
- package/prebuilds/linux-riscv64/GjsifyTerminal-1.0.gir +117 -0
- package/prebuilds/linux-riscv64/libgjsifyterminal.so +0 -0
- package/prebuilds/linux-s390x/GjsifyTerminal-1.0.gir +118 -0
- package/prebuilds/linux-s390x/GjsifyTerminal-1.0.typelib +0 -0
- package/prebuilds/linux-s390x/libgjsifyterminal.so +0 -0
- package/prebuilds/linux-x64/GjsifyTerminal-1.0.gir +118 -0
- package/prebuilds/linux-x64/GjsifyTerminal-1.0.typelib +0 -0
- package/prebuilds/{linux-x86_64 → linux-x64}/libgjsifyterminal.so +0 -0
- package/src/vala/terminal-compat.vapi +55 -0
- package/src/vala/terminal.vala +10 -6
- /package/prebuilds/{linux-x86_64 → linux-arm64}/GjsifyTerminal-1.0.gir +0 -0
- /package/prebuilds/{linux-x86_64 → linux-riscv64}/GjsifyTerminal-1.0.typelib +0 -0
package/README.md
CHANGED
|
@@ -31,7 +31,34 @@ if (hasNativeTerminal()) {
|
|
|
31
31
|
}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
See [Platform coverage](#platform-coverage) for the prebuilt platforms.
|
|
35
|
+
|
|
36
|
+
## Platform coverage
|
|
37
|
+
|
|
38
|
+
| Platform | Prebuild | Built by |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `linux-x64` | ✅ `.so` + `.gir` + `.typelib` | native runner |
|
|
41
|
+
| `linux-arm64` | ✅ | native runner |
|
|
42
|
+
| `linux-ppc64`, `linux-s390x`, `linux-riscv64` | ✅ | QEMU emulation |
|
|
43
|
+
| `darwin-arm64` (macOS, Apple silicon) | ✅ `.dylib` + `.gir` + `.typelib` | `macos-latest` runner |
|
|
44
|
+
| `darwin-x64` (macOS, Intel) | ❌ | — no runner leg yet |
|
|
45
|
+
| Windows | ❌ | — the bridge is POSIX-only (termios, `ioctl`, `SIGWINCH`) |
|
|
46
|
+
|
|
47
|
+
All prebuilds are produced by [`.github/workflows/prebuilds.yml`](../../../.github/workflows/prebuilds.yml)
|
|
48
|
+
and committed back to the repository.
|
|
49
|
+
|
|
50
|
+
Despite the historic wording, nothing here is Linux-specific: `isatty(3)`, `termios` and the
|
|
51
|
+
`TIOCGWINSZ` `ioctl` are POSIX/BSD, and GLib supports `SIGWINCH` via `g_unix_signal_add()` on
|
|
52
|
+
every UNIX platform. The one Linux dependency — Vala's bundled `linux.vapi`, used only for
|
|
53
|
+
`Linux.winsize` and `Linux.Termios.TIOCGWINSZ` — has been replaced by the portable sibling
|
|
54
|
+
[`src/vala/terminal-compat.vapi`](src/vala/terminal-compat.vapi), which declares both against
|
|
55
|
+
`<sys/ioctl.h>` + `<termios.h>` so the include set is correct on Linux, macOS and the BSDs alike.
|
|
56
|
+
|
|
57
|
+
**Known gap — a `darwin-arm64` prebuild is built and shipped, but the CLI does not
|
|
58
|
+
load it yet.** `detectNativePackages()` (`packages/infra/cli/src/utils/detect-native-packages.ts`)
|
|
59
|
+
hardcodes a `linux-` directory prefix, and `buildNativeEnv()` exports `LD_LIBRARY_PATH`,
|
|
60
|
+
which macOS `dyld` ignores in favour of `DYLD_LIBRARY_PATH`. Until those CLI-side fixes land,
|
|
61
|
+
`@gjsify/tty` and `@gjsify/process` keep using their env/GLib fallbacks on macOS.
|
|
35
62
|
|
|
36
63
|
## License
|
|
37
64
|
|
package/meson.build
CHANGED
|
@@ -11,20 +11,49 @@ sources = files(
|
|
|
11
11
|
'src/vala/terminal.vala',
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
+
# `--pkg=linux` is deliberately NOT used: the only two symbols this bridge
|
|
15
|
+
# needed from Vala's Linux-specific `linux.vapi` (`struct winsize`,
|
|
16
|
+
# `TIOCGWINSZ`) are declared portably in the sibling `terminal-compat.vapi`.
|
|
17
|
+
# Everything else is POSIX.1 (isatty / termios) plus GLib. See that vapi's
|
|
18
|
+
# header comment.
|
|
14
19
|
libGjsifyTerminal = library('gjsifyterminal', sources,
|
|
15
20
|
dependencies: dependencies,
|
|
16
|
-
vala_args: [
|
|
21
|
+
vala_args: [
|
|
22
|
+
'--pkg=posix',
|
|
23
|
+
'--vapidir=' + meson.current_source_dir() / 'src/vala',
|
|
24
|
+
'--pkg=terminal-compat',
|
|
25
|
+
],
|
|
17
26
|
vala_gir: meson.project_name() + '-1.0.gir',
|
|
18
27
|
install: true,
|
|
19
28
|
install_dir: [true, true, true, true],
|
|
20
29
|
)
|
|
21
30
|
|
|
31
|
+
# ----------------------------------------------------------------------------
|
|
32
|
+
# Host-dependent shared-library leaf name.
|
|
33
|
+
#
|
|
34
|
+
# The typelib records the exact filename gjs' g_module_open() resolves at load
|
|
35
|
+
# time, and meson names the shared library per host convention: lib<name>.so on
|
|
36
|
+
# ELF hosts, lib<name>.dylib on macOS. Recording the wrong leaf yields a typelib
|
|
37
|
+
# that IS found via GI_TYPELIB_PATH but whose library never loads — a silent,
|
|
38
|
+
# confusing failure. Mirrors the branch in packages/napi/napi/meson.build.
|
|
39
|
+
#
|
|
40
|
+
# Windows is deliberately absent: this bridge has had no Windows portability
|
|
41
|
+
# work, so `else` (ELF naming) is the honest fallback rather than a .dll branch
|
|
42
|
+
# that would imply support which does not exist.
|
|
43
|
+
# ----------------------------------------------------------------------------
|
|
44
|
+
host_system = host_machine.system()
|
|
45
|
+
if host_system == 'darwin'
|
|
46
|
+
shared_lib_name = 'libgjsifyterminal.dylib'
|
|
47
|
+
else
|
|
48
|
+
shared_lib_name = 'libgjsifyterminal.so'
|
|
49
|
+
endif
|
|
50
|
+
|
|
22
51
|
g_ir_compiler = find_program('g-ir-compiler')
|
|
23
52
|
|
|
24
53
|
custom_target(meson.project_name() + '-1.0.typelib',
|
|
25
54
|
command: [
|
|
26
55
|
g_ir_compiler,
|
|
27
|
-
'--shared-library',
|
|
56
|
+
'--shared-library', shared_lib_name,
|
|
28
57
|
'--output', '@OUTPUT@',
|
|
29
58
|
meson.current_build_dir() / meson.project_name() + '-1.0.gir',
|
|
30
59
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/terminal-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"description": "Optional Vala/GObject bridge providing Posix.isatty(), ioctl(TIOCGWINSZ), termios raw-mode and SIGWINCH for GJS. Enhances @gjsify/tty and @gjsify/process with correct terminal behaviour when installed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
"src/vala"
|
|
20
20
|
],
|
|
21
21
|
"gjsify": {
|
|
22
|
+
"platforms": [
|
|
23
|
+
"linux-x64",
|
|
24
|
+
"linux-arm64",
|
|
25
|
+
"linux-ppc64",
|
|
26
|
+
"linux-s390x",
|
|
27
|
+
"linux-riscv64",
|
|
28
|
+
"darwin-arm64"
|
|
29
|
+
],
|
|
22
30
|
"prebuilds": "prebuilds",
|
|
23
31
|
"runtimes": {
|
|
24
32
|
"gjs": "polyfill",
|
|
@@ -49,15 +57,15 @@
|
|
|
49
57
|
"init:meson": "meson setup build .",
|
|
50
58
|
"init:meson:wipe": "gjsify run init:meson --wipe",
|
|
51
59
|
"build:meson": "gjsify run init:meson && meson compile -C build",
|
|
52
|
-
"build:prebuilds": "gjsify run build:meson &&
|
|
53
|
-
"build:gir-types": "ts-for-gir generate --externalDeps --allowMissingDeps --girDirectories=./prebuilds/linux-
|
|
60
|
+
"build:prebuilds": "gjsify run build:meson && node ../../../scripts/stage-prebuild.mjs .",
|
|
61
|
+
"build:gir-types": "ts-for-gir generate --externalDeps --allowMissingDeps --girDirectories=./prebuilds/linux-x64 --girDirectories=/usr/share/gir-1.0 --modules=GjsifyTerminal-1.0 --outdir=src/ts --npmScope=@girs --package=false --ignoreVersionConflicts=true"
|
|
54
62
|
},
|
|
55
63
|
"dependencies": {
|
|
56
64
|
"@girs/glib-2.0": "^4.1.0",
|
|
57
65
|
"@girs/gobject-2.0": "^4.1.0"
|
|
58
66
|
},
|
|
59
67
|
"devDependencies": {
|
|
60
|
-
"@gjsify/cli": "^0.
|
|
68
|
+
"@gjsify/cli": "^0.24.1",
|
|
61
69
|
"@ts-for-gir/cli": "^4.1.0",
|
|
62
70
|
"@types/node": "^25.9.2",
|
|
63
71
|
"typescript": "^6.0.3"
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!-- GjsifyTerminal-1.0.gir generated by valac 0.56.19, do not modify. -->
|
|
3
|
+
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:doc="http://www.gtk.org/introspection/doc/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
|
|
4
|
+
<include name="GObject" version="2.0"/>
|
|
5
|
+
<package name="gjsifyterminal"/>
|
|
6
|
+
<c:include name="sys/ioctl.h"/>
|
|
7
|
+
<c:include name="termios.h"/>
|
|
8
|
+
<c:include name="gjsifyterminal.h"/>
|
|
9
|
+
<doc:format name="unknown"/>
|
|
10
|
+
<namespace name="GjsifyTerminal" version="1.0" shared-library="libgjsifyterminal.dylib" c:prefix="GjsifyTerminal" c:identifier-prefixes="GjsifyTerminal" c:symbol-prefixes="gjsify_terminal">
|
|
11
|
+
<class name="Terminal" c:type="GjsifyTerminalTerminal" c:symbol-prefix="terminal" glib:type-name="GjsifyTerminalTerminal" glib:get-type="gjsify_terminal_terminal_get_type" glib:type-struct="TerminalClass" parent="GObject.Object">
|
|
12
|
+
<field name="parent_instance" readable="0" private="1">
|
|
13
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
14
|
+
</field>
|
|
15
|
+
<field name="priv" readable="0" private="1">
|
|
16
|
+
<type name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate*"/>
|
|
17
|
+
</field>
|
|
18
|
+
<function name="is_tty" c:identifier="gjsify_terminal_terminal_is_tty">
|
|
19
|
+
<return-value transfer-ownership="full">
|
|
20
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
21
|
+
</return-value>
|
|
22
|
+
<parameters>
|
|
23
|
+
<parameter name="fd" transfer-ownership="none">
|
|
24
|
+
<type name="gint" c:type="gint"/>
|
|
25
|
+
</parameter>
|
|
26
|
+
</parameters>
|
|
27
|
+
</function>
|
|
28
|
+
<function name="get_size" c:identifier="gjsify_terminal_terminal_get_size">
|
|
29
|
+
<return-value transfer-ownership="full">
|
|
30
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
31
|
+
</return-value>
|
|
32
|
+
<parameters>
|
|
33
|
+
<parameter name="fd" transfer-ownership="none">
|
|
34
|
+
<type name="gint" c:type="gint"/>
|
|
35
|
+
</parameter>
|
|
36
|
+
<parameter name="rows" direction="out" transfer-ownership="full">
|
|
37
|
+
<type name="gint" c:type="gint*"/>
|
|
38
|
+
</parameter>
|
|
39
|
+
<parameter name="cols" direction="out" transfer-ownership="full">
|
|
40
|
+
<type name="gint" c:type="gint*"/>
|
|
41
|
+
</parameter>
|
|
42
|
+
<parameter name="xpixel" direction="out" transfer-ownership="full">
|
|
43
|
+
<type name="gint" c:type="gint*"/>
|
|
44
|
+
</parameter>
|
|
45
|
+
<parameter name="ypixel" direction="out" transfer-ownership="full">
|
|
46
|
+
<type name="gint" c:type="gint*"/>
|
|
47
|
+
</parameter>
|
|
48
|
+
</parameters>
|
|
49
|
+
</function>
|
|
50
|
+
<function name="set_raw_mode" c:identifier="gjsify_terminal_terminal_set_raw_mode">
|
|
51
|
+
<return-value transfer-ownership="full">
|
|
52
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
53
|
+
</return-value>
|
|
54
|
+
<parameters>
|
|
55
|
+
<parameter name="fd" transfer-ownership="none">
|
|
56
|
+
<type name="gint" c:type="gint"/>
|
|
57
|
+
</parameter>
|
|
58
|
+
<parameter name="enable" transfer-ownership="none">
|
|
59
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
60
|
+
</parameter>
|
|
61
|
+
</parameters>
|
|
62
|
+
</function>
|
|
63
|
+
<constructor name="new" c:identifier="gjsify_terminal_terminal_new">
|
|
64
|
+
<return-value transfer-ownership="full">
|
|
65
|
+
<type name="GjsifyTerminal.Terminal" c:type="GjsifyTerminalTerminal*"/>
|
|
66
|
+
</return-value>
|
|
67
|
+
</constructor>
|
|
68
|
+
</class>
|
|
69
|
+
<record name="TerminalClass" c:type="GjsifyTerminalTerminalClass" glib:is-gtype-struct-for="Terminal">
|
|
70
|
+
<field name="parent_class" readable="0" private="1">
|
|
71
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
72
|
+
</field>
|
|
73
|
+
</record>
|
|
74
|
+
<record name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate" disguised="1"/>
|
|
75
|
+
<class name="ResizeWatcher" c:type="GjsifyTerminalResizeWatcher" c:symbol-prefix="resize_watcher" glib:type-name="GjsifyTerminalResizeWatcher" glib:get-type="gjsify_terminal_resize_watcher_get_type" glib:type-struct="ResizeWatcherClass" parent="GObject.Object">
|
|
76
|
+
<field name="parent_instance" readable="0" private="1">
|
|
77
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
78
|
+
</field>
|
|
79
|
+
<field name="priv" readable="0" private="1">
|
|
80
|
+
<type name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate*"/>
|
|
81
|
+
</field>
|
|
82
|
+
<method name="start" c:identifier="gjsify_terminal_resize_watcher_start">
|
|
83
|
+
<return-value transfer-ownership="full">
|
|
84
|
+
<type name="none" c:type="void"/>
|
|
85
|
+
</return-value>
|
|
86
|
+
<parameters>
|
|
87
|
+
<instance-parameter name="self" transfer-ownership="none">
|
|
88
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
89
|
+
</instance-parameter>
|
|
90
|
+
</parameters>
|
|
91
|
+
</method>
|
|
92
|
+
<constructor name="new" c:identifier="gjsify_terminal_resize_watcher_new">
|
|
93
|
+
<return-value transfer-ownership="full">
|
|
94
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
95
|
+
</return-value>
|
|
96
|
+
</constructor>
|
|
97
|
+
<glib:signal name="resized">
|
|
98
|
+
<return-value transfer-ownership="full">
|
|
99
|
+
<type name="none" c:type="void"/>
|
|
100
|
+
</return-value>
|
|
101
|
+
<parameters>
|
|
102
|
+
<parameter name="rows" transfer-ownership="none">
|
|
103
|
+
<type name="gint" c:type="gint"/>
|
|
104
|
+
</parameter>
|
|
105
|
+
<parameter name="cols" transfer-ownership="none">
|
|
106
|
+
<type name="gint" c:type="gint"/>
|
|
107
|
+
</parameter>
|
|
108
|
+
</parameters>
|
|
109
|
+
</glib:signal>
|
|
110
|
+
</class>
|
|
111
|
+
<record name="ResizeWatcherClass" c:type="GjsifyTerminalResizeWatcherClass" glib:is-gtype-struct-for="ResizeWatcher">
|
|
112
|
+
<field name="parent_class" readable="0" private="1">
|
|
113
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
114
|
+
</field>
|
|
115
|
+
</record>
|
|
116
|
+
<record name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate" disguised="1"/>
|
|
117
|
+
</namespace>
|
|
118
|
+
</repository>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!-- GjsifyTerminal-1.0.gir generated by valac 0.56.19, do not modify. -->
|
|
3
|
+
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:doc="http://www.gtk.org/introspection/doc/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
|
|
4
|
+
<include name="GObject" version="2.0"/>
|
|
5
|
+
<package name="gjsifyterminal"/>
|
|
6
|
+
<c:include name="sys/ioctl.h"/>
|
|
7
|
+
<c:include name="termios.h"/>
|
|
8
|
+
<c:include name="gjsifyterminal.h"/>
|
|
9
|
+
<doc:format name="unknown"/>
|
|
10
|
+
<namespace name="GjsifyTerminal" version="1.0" shared-library="libgjsifyterminal.so" c:prefix="GjsifyTerminal" c:identifier-prefixes="GjsifyTerminal" c:symbol-prefixes="gjsify_terminal">
|
|
11
|
+
<class name="Terminal" c:type="GjsifyTerminalTerminal" c:symbol-prefix="terminal" glib:type-name="GjsifyTerminalTerminal" glib:get-type="gjsify_terminal_terminal_get_type" glib:type-struct="TerminalClass" parent="GObject.Object">
|
|
12
|
+
<field name="parent_instance" readable="0" private="1">
|
|
13
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
14
|
+
</field>
|
|
15
|
+
<field name="priv" readable="0" private="1">
|
|
16
|
+
<type name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate*"/>
|
|
17
|
+
</field>
|
|
18
|
+
<function name="is_tty" c:identifier="gjsify_terminal_terminal_is_tty">
|
|
19
|
+
<return-value transfer-ownership="full">
|
|
20
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
21
|
+
</return-value>
|
|
22
|
+
<parameters>
|
|
23
|
+
<parameter name="fd" transfer-ownership="none">
|
|
24
|
+
<type name="gint" c:type="gint"/>
|
|
25
|
+
</parameter>
|
|
26
|
+
</parameters>
|
|
27
|
+
</function>
|
|
28
|
+
<function name="get_size" c:identifier="gjsify_terminal_terminal_get_size">
|
|
29
|
+
<return-value transfer-ownership="full">
|
|
30
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
31
|
+
</return-value>
|
|
32
|
+
<parameters>
|
|
33
|
+
<parameter name="fd" transfer-ownership="none">
|
|
34
|
+
<type name="gint" c:type="gint"/>
|
|
35
|
+
</parameter>
|
|
36
|
+
<parameter name="rows" direction="out" transfer-ownership="full">
|
|
37
|
+
<type name="gint" c:type="gint*"/>
|
|
38
|
+
</parameter>
|
|
39
|
+
<parameter name="cols" direction="out" transfer-ownership="full">
|
|
40
|
+
<type name="gint" c:type="gint*"/>
|
|
41
|
+
</parameter>
|
|
42
|
+
<parameter name="xpixel" direction="out" transfer-ownership="full">
|
|
43
|
+
<type name="gint" c:type="gint*"/>
|
|
44
|
+
</parameter>
|
|
45
|
+
<parameter name="ypixel" direction="out" transfer-ownership="full">
|
|
46
|
+
<type name="gint" c:type="gint*"/>
|
|
47
|
+
</parameter>
|
|
48
|
+
</parameters>
|
|
49
|
+
</function>
|
|
50
|
+
<function name="set_raw_mode" c:identifier="gjsify_terminal_terminal_set_raw_mode">
|
|
51
|
+
<return-value transfer-ownership="full">
|
|
52
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
53
|
+
</return-value>
|
|
54
|
+
<parameters>
|
|
55
|
+
<parameter name="fd" transfer-ownership="none">
|
|
56
|
+
<type name="gint" c:type="gint"/>
|
|
57
|
+
</parameter>
|
|
58
|
+
<parameter name="enable" transfer-ownership="none">
|
|
59
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
60
|
+
</parameter>
|
|
61
|
+
</parameters>
|
|
62
|
+
</function>
|
|
63
|
+
<constructor name="new" c:identifier="gjsify_terminal_terminal_new">
|
|
64
|
+
<return-value transfer-ownership="full">
|
|
65
|
+
<type name="GjsifyTerminal.Terminal" c:type="GjsifyTerminalTerminal*"/>
|
|
66
|
+
</return-value>
|
|
67
|
+
</constructor>
|
|
68
|
+
</class>
|
|
69
|
+
<record name="TerminalClass" c:type="GjsifyTerminalTerminalClass" glib:is-gtype-struct-for="Terminal">
|
|
70
|
+
<field name="parent_class" readable="0" private="1">
|
|
71
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
72
|
+
</field>
|
|
73
|
+
</record>
|
|
74
|
+
<record name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate" disguised="1"/>
|
|
75
|
+
<class name="ResizeWatcher" c:type="GjsifyTerminalResizeWatcher" c:symbol-prefix="resize_watcher" glib:type-name="GjsifyTerminalResizeWatcher" glib:get-type="gjsify_terminal_resize_watcher_get_type" glib:type-struct="ResizeWatcherClass" parent="GObject.Object">
|
|
76
|
+
<field name="parent_instance" readable="0" private="1">
|
|
77
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
78
|
+
</field>
|
|
79
|
+
<field name="priv" readable="0" private="1">
|
|
80
|
+
<type name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate*"/>
|
|
81
|
+
</field>
|
|
82
|
+
<method name="start" c:identifier="gjsify_terminal_resize_watcher_start">
|
|
83
|
+
<return-value transfer-ownership="full">
|
|
84
|
+
<type name="none" c:type="void"/>
|
|
85
|
+
</return-value>
|
|
86
|
+
<parameters>
|
|
87
|
+
<instance-parameter name="self" transfer-ownership="none">
|
|
88
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
89
|
+
</instance-parameter>
|
|
90
|
+
</parameters>
|
|
91
|
+
</method>
|
|
92
|
+
<constructor name="new" c:identifier="gjsify_terminal_resize_watcher_new">
|
|
93
|
+
<return-value transfer-ownership="full">
|
|
94
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
95
|
+
</return-value>
|
|
96
|
+
</constructor>
|
|
97
|
+
<glib:signal name="resized">
|
|
98
|
+
<return-value transfer-ownership="full">
|
|
99
|
+
<type name="none" c:type="void"/>
|
|
100
|
+
</return-value>
|
|
101
|
+
<parameters>
|
|
102
|
+
<parameter name="rows" transfer-ownership="none">
|
|
103
|
+
<type name="gint" c:type="gint"/>
|
|
104
|
+
</parameter>
|
|
105
|
+
<parameter name="cols" transfer-ownership="none">
|
|
106
|
+
<type name="gint" c:type="gint"/>
|
|
107
|
+
</parameter>
|
|
108
|
+
</parameters>
|
|
109
|
+
</glib:signal>
|
|
110
|
+
</class>
|
|
111
|
+
<record name="ResizeWatcherClass" c:type="GjsifyTerminalResizeWatcherClass" glib:is-gtype-struct-for="ResizeWatcher">
|
|
112
|
+
<field name="parent_class" readable="0" private="1">
|
|
113
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
114
|
+
</field>
|
|
115
|
+
</record>
|
|
116
|
+
<record name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate" disguised="1"/>
|
|
117
|
+
</namespace>
|
|
118
|
+
</repository>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!-- GjsifyTerminal-1.0.gir generated by valac 0.56.18, do not modify. -->
|
|
3
|
+
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
|
|
4
|
+
<include name="GObject" version="2.0"/>
|
|
5
|
+
<package name="gjsifyterminal"/>
|
|
6
|
+
<c:include name="sys/ioctl.h"/>
|
|
7
|
+
<c:include name="termios.h"/>
|
|
8
|
+
<c:include name="gjsifyterminal.h"/>
|
|
9
|
+
<namespace name="GjsifyTerminal" version="1.0" shared-library="libgjsifyterminal.so" c:prefix="GjsifyTerminal" c:identifier-prefixes="GjsifyTerminal" c:symbol-prefixes="gjsify_terminal">
|
|
10
|
+
<class name="Terminal" c:type="GjsifyTerminalTerminal" c:symbol-prefix="terminal" glib:type-name="GjsifyTerminalTerminal" glib:get-type="gjsify_terminal_terminal_get_type" glib:type-struct="TerminalClass" parent="GObject.Object">
|
|
11
|
+
<field name="parent_instance" readable="0" private="1">
|
|
12
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
13
|
+
</field>
|
|
14
|
+
<field name="priv" readable="0" private="1">
|
|
15
|
+
<type name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate*"/>
|
|
16
|
+
</field>
|
|
17
|
+
<function name="is_tty" c:identifier="gjsify_terminal_terminal_is_tty">
|
|
18
|
+
<return-value transfer-ownership="full">
|
|
19
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
20
|
+
</return-value>
|
|
21
|
+
<parameters>
|
|
22
|
+
<parameter name="fd" transfer-ownership="none">
|
|
23
|
+
<type name="gint" c:type="gint"/>
|
|
24
|
+
</parameter>
|
|
25
|
+
</parameters>
|
|
26
|
+
</function>
|
|
27
|
+
<function name="get_size" c:identifier="gjsify_terminal_terminal_get_size">
|
|
28
|
+
<return-value transfer-ownership="full">
|
|
29
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
30
|
+
</return-value>
|
|
31
|
+
<parameters>
|
|
32
|
+
<parameter name="fd" transfer-ownership="none">
|
|
33
|
+
<type name="gint" c:type="gint"/>
|
|
34
|
+
</parameter>
|
|
35
|
+
<parameter name="rows" direction="out" transfer-ownership="full">
|
|
36
|
+
<type name="gint" c:type="gint*"/>
|
|
37
|
+
</parameter>
|
|
38
|
+
<parameter name="cols" direction="out" transfer-ownership="full">
|
|
39
|
+
<type name="gint" c:type="gint*"/>
|
|
40
|
+
</parameter>
|
|
41
|
+
<parameter name="xpixel" direction="out" transfer-ownership="full">
|
|
42
|
+
<type name="gint" c:type="gint*"/>
|
|
43
|
+
</parameter>
|
|
44
|
+
<parameter name="ypixel" direction="out" transfer-ownership="full">
|
|
45
|
+
<type name="gint" c:type="gint*"/>
|
|
46
|
+
</parameter>
|
|
47
|
+
</parameters>
|
|
48
|
+
</function>
|
|
49
|
+
<function name="set_raw_mode" c:identifier="gjsify_terminal_terminal_set_raw_mode">
|
|
50
|
+
<return-value transfer-ownership="full">
|
|
51
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
52
|
+
</return-value>
|
|
53
|
+
<parameters>
|
|
54
|
+
<parameter name="fd" transfer-ownership="none">
|
|
55
|
+
<type name="gint" c:type="gint"/>
|
|
56
|
+
</parameter>
|
|
57
|
+
<parameter name="enable" transfer-ownership="none">
|
|
58
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
59
|
+
</parameter>
|
|
60
|
+
</parameters>
|
|
61
|
+
</function>
|
|
62
|
+
<constructor name="new" c:identifier="gjsify_terminal_terminal_new">
|
|
63
|
+
<return-value transfer-ownership="full">
|
|
64
|
+
<type name="GjsifyTerminal.Terminal" c:type="GjsifyTerminalTerminal*"/>
|
|
65
|
+
</return-value>
|
|
66
|
+
</constructor>
|
|
67
|
+
</class>
|
|
68
|
+
<record name="TerminalClass" c:type="GjsifyTerminalTerminalClass" glib:is-gtype-struct-for="Terminal">
|
|
69
|
+
<field name="parent_class" readable="0" private="1">
|
|
70
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
71
|
+
</field>
|
|
72
|
+
</record>
|
|
73
|
+
<record name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate" disguised="1"/>
|
|
74
|
+
<class name="ResizeWatcher" c:type="GjsifyTerminalResizeWatcher" c:symbol-prefix="resize_watcher" glib:type-name="GjsifyTerminalResizeWatcher" glib:get-type="gjsify_terminal_resize_watcher_get_type" glib:type-struct="ResizeWatcherClass" parent="GObject.Object">
|
|
75
|
+
<field name="parent_instance" readable="0" private="1">
|
|
76
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
77
|
+
</field>
|
|
78
|
+
<field name="priv" readable="0" private="1">
|
|
79
|
+
<type name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate*"/>
|
|
80
|
+
</field>
|
|
81
|
+
<method name="start" c:identifier="gjsify_terminal_resize_watcher_start">
|
|
82
|
+
<return-value transfer-ownership="full">
|
|
83
|
+
<type name="none" c:type="void"/>
|
|
84
|
+
</return-value>
|
|
85
|
+
<parameters>
|
|
86
|
+
<instance-parameter name="self" transfer-ownership="none">
|
|
87
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
88
|
+
</instance-parameter>
|
|
89
|
+
</parameters>
|
|
90
|
+
</method>
|
|
91
|
+
<constructor name="new" c:identifier="gjsify_terminal_resize_watcher_new">
|
|
92
|
+
<return-value transfer-ownership="full">
|
|
93
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
94
|
+
</return-value>
|
|
95
|
+
</constructor>
|
|
96
|
+
<glib:signal name="resized">
|
|
97
|
+
<return-value transfer-ownership="full">
|
|
98
|
+
<type name="none" c:type="void"/>
|
|
99
|
+
</return-value>
|
|
100
|
+
<parameters>
|
|
101
|
+
<parameter name="rows" transfer-ownership="none">
|
|
102
|
+
<type name="gint" c:type="gint"/>
|
|
103
|
+
</parameter>
|
|
104
|
+
<parameter name="cols" transfer-ownership="none">
|
|
105
|
+
<type name="gint" c:type="gint"/>
|
|
106
|
+
</parameter>
|
|
107
|
+
</parameters>
|
|
108
|
+
</glib:signal>
|
|
109
|
+
</class>
|
|
110
|
+
<record name="ResizeWatcherClass" c:type="GjsifyTerminalResizeWatcherClass" glib:is-gtype-struct-for="ResizeWatcher">
|
|
111
|
+
<field name="parent_class" readable="0" private="1">
|
|
112
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
113
|
+
</field>
|
|
114
|
+
</record>
|
|
115
|
+
<record name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate" disguised="1"/>
|
|
116
|
+
</namespace>
|
|
117
|
+
</repository>
|
|
Binary file
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!-- GjsifyTerminal-1.0.gir generated by valac 0.56.19, do not modify. -->
|
|
3
|
+
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:doc="http://www.gtk.org/introspection/doc/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
|
|
4
|
+
<include name="GObject" version="2.0"/>
|
|
5
|
+
<package name="gjsifyterminal"/>
|
|
6
|
+
<c:include name="sys/ioctl.h"/>
|
|
7
|
+
<c:include name="termios.h"/>
|
|
8
|
+
<c:include name="gjsifyterminal.h"/>
|
|
9
|
+
<doc:format name="unknown"/>
|
|
10
|
+
<namespace name="GjsifyTerminal" version="1.0" shared-library="libgjsifyterminal.so" c:prefix="GjsifyTerminal" c:identifier-prefixes="GjsifyTerminal" c:symbol-prefixes="gjsify_terminal">
|
|
11
|
+
<class name="Terminal" c:type="GjsifyTerminalTerminal" c:symbol-prefix="terminal" glib:type-name="GjsifyTerminalTerminal" glib:get-type="gjsify_terminal_terminal_get_type" glib:type-struct="TerminalClass" parent="GObject.Object">
|
|
12
|
+
<field name="parent_instance" readable="0" private="1">
|
|
13
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
14
|
+
</field>
|
|
15
|
+
<field name="priv" readable="0" private="1">
|
|
16
|
+
<type name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate*"/>
|
|
17
|
+
</field>
|
|
18
|
+
<function name="is_tty" c:identifier="gjsify_terminal_terminal_is_tty">
|
|
19
|
+
<return-value transfer-ownership="full">
|
|
20
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
21
|
+
</return-value>
|
|
22
|
+
<parameters>
|
|
23
|
+
<parameter name="fd" transfer-ownership="none">
|
|
24
|
+
<type name="gint" c:type="gint"/>
|
|
25
|
+
</parameter>
|
|
26
|
+
</parameters>
|
|
27
|
+
</function>
|
|
28
|
+
<function name="get_size" c:identifier="gjsify_terminal_terminal_get_size">
|
|
29
|
+
<return-value transfer-ownership="full">
|
|
30
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
31
|
+
</return-value>
|
|
32
|
+
<parameters>
|
|
33
|
+
<parameter name="fd" transfer-ownership="none">
|
|
34
|
+
<type name="gint" c:type="gint"/>
|
|
35
|
+
</parameter>
|
|
36
|
+
<parameter name="rows" direction="out" transfer-ownership="full">
|
|
37
|
+
<type name="gint" c:type="gint*"/>
|
|
38
|
+
</parameter>
|
|
39
|
+
<parameter name="cols" direction="out" transfer-ownership="full">
|
|
40
|
+
<type name="gint" c:type="gint*"/>
|
|
41
|
+
</parameter>
|
|
42
|
+
<parameter name="xpixel" direction="out" transfer-ownership="full">
|
|
43
|
+
<type name="gint" c:type="gint*"/>
|
|
44
|
+
</parameter>
|
|
45
|
+
<parameter name="ypixel" direction="out" transfer-ownership="full">
|
|
46
|
+
<type name="gint" c:type="gint*"/>
|
|
47
|
+
</parameter>
|
|
48
|
+
</parameters>
|
|
49
|
+
</function>
|
|
50
|
+
<function name="set_raw_mode" c:identifier="gjsify_terminal_terminal_set_raw_mode">
|
|
51
|
+
<return-value transfer-ownership="full">
|
|
52
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
53
|
+
</return-value>
|
|
54
|
+
<parameters>
|
|
55
|
+
<parameter name="fd" transfer-ownership="none">
|
|
56
|
+
<type name="gint" c:type="gint"/>
|
|
57
|
+
</parameter>
|
|
58
|
+
<parameter name="enable" transfer-ownership="none">
|
|
59
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
60
|
+
</parameter>
|
|
61
|
+
</parameters>
|
|
62
|
+
</function>
|
|
63
|
+
<constructor name="new" c:identifier="gjsify_terminal_terminal_new">
|
|
64
|
+
<return-value transfer-ownership="full">
|
|
65
|
+
<type name="GjsifyTerminal.Terminal" c:type="GjsifyTerminalTerminal*"/>
|
|
66
|
+
</return-value>
|
|
67
|
+
</constructor>
|
|
68
|
+
</class>
|
|
69
|
+
<record name="TerminalClass" c:type="GjsifyTerminalTerminalClass" glib:is-gtype-struct-for="Terminal">
|
|
70
|
+
<field name="parent_class" readable="0" private="1">
|
|
71
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
72
|
+
</field>
|
|
73
|
+
</record>
|
|
74
|
+
<record name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate" disguised="1"/>
|
|
75
|
+
<class name="ResizeWatcher" c:type="GjsifyTerminalResizeWatcher" c:symbol-prefix="resize_watcher" glib:type-name="GjsifyTerminalResizeWatcher" glib:get-type="gjsify_terminal_resize_watcher_get_type" glib:type-struct="ResizeWatcherClass" parent="GObject.Object">
|
|
76
|
+
<field name="parent_instance" readable="0" private="1">
|
|
77
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
78
|
+
</field>
|
|
79
|
+
<field name="priv" readable="0" private="1">
|
|
80
|
+
<type name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate*"/>
|
|
81
|
+
</field>
|
|
82
|
+
<method name="start" c:identifier="gjsify_terminal_resize_watcher_start">
|
|
83
|
+
<return-value transfer-ownership="full">
|
|
84
|
+
<type name="none" c:type="void"/>
|
|
85
|
+
</return-value>
|
|
86
|
+
<parameters>
|
|
87
|
+
<instance-parameter name="self" transfer-ownership="none">
|
|
88
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
89
|
+
</instance-parameter>
|
|
90
|
+
</parameters>
|
|
91
|
+
</method>
|
|
92
|
+
<constructor name="new" c:identifier="gjsify_terminal_resize_watcher_new">
|
|
93
|
+
<return-value transfer-ownership="full">
|
|
94
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
95
|
+
</return-value>
|
|
96
|
+
</constructor>
|
|
97
|
+
<glib:signal name="resized">
|
|
98
|
+
<return-value transfer-ownership="full">
|
|
99
|
+
<type name="none" c:type="void"/>
|
|
100
|
+
</return-value>
|
|
101
|
+
<parameters>
|
|
102
|
+
<parameter name="rows" transfer-ownership="none">
|
|
103
|
+
<type name="gint" c:type="gint"/>
|
|
104
|
+
</parameter>
|
|
105
|
+
<parameter name="cols" transfer-ownership="none">
|
|
106
|
+
<type name="gint" c:type="gint"/>
|
|
107
|
+
</parameter>
|
|
108
|
+
</parameters>
|
|
109
|
+
</glib:signal>
|
|
110
|
+
</class>
|
|
111
|
+
<record name="ResizeWatcherClass" c:type="GjsifyTerminalResizeWatcherClass" glib:is-gtype-struct-for="ResizeWatcher">
|
|
112
|
+
<field name="parent_class" readable="0" private="1">
|
|
113
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
114
|
+
</field>
|
|
115
|
+
</record>
|
|
116
|
+
<record name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate" disguised="1"/>
|
|
117
|
+
</namespace>
|
|
118
|
+
</repository>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!-- GjsifyTerminal-1.0.gir generated by valac 0.56.19, do not modify. -->
|
|
3
|
+
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:doc="http://www.gtk.org/introspection/doc/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
|
|
4
|
+
<include name="GObject" version="2.0"/>
|
|
5
|
+
<package name="gjsifyterminal"/>
|
|
6
|
+
<c:include name="sys/ioctl.h"/>
|
|
7
|
+
<c:include name="termios.h"/>
|
|
8
|
+
<c:include name="gjsifyterminal.h"/>
|
|
9
|
+
<doc:format name="unknown"/>
|
|
10
|
+
<namespace name="GjsifyTerminal" version="1.0" shared-library="libgjsifyterminal.so" c:prefix="GjsifyTerminal" c:identifier-prefixes="GjsifyTerminal" c:symbol-prefixes="gjsify_terminal">
|
|
11
|
+
<class name="Terminal" c:type="GjsifyTerminalTerminal" c:symbol-prefix="terminal" glib:type-name="GjsifyTerminalTerminal" glib:get-type="gjsify_terminal_terminal_get_type" glib:type-struct="TerminalClass" parent="GObject.Object">
|
|
12
|
+
<field name="parent_instance" readable="0" private="1">
|
|
13
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
14
|
+
</field>
|
|
15
|
+
<field name="priv" readable="0" private="1">
|
|
16
|
+
<type name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate*"/>
|
|
17
|
+
</field>
|
|
18
|
+
<function name="is_tty" c:identifier="gjsify_terminal_terminal_is_tty">
|
|
19
|
+
<return-value transfer-ownership="full">
|
|
20
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
21
|
+
</return-value>
|
|
22
|
+
<parameters>
|
|
23
|
+
<parameter name="fd" transfer-ownership="none">
|
|
24
|
+
<type name="gint" c:type="gint"/>
|
|
25
|
+
</parameter>
|
|
26
|
+
</parameters>
|
|
27
|
+
</function>
|
|
28
|
+
<function name="get_size" c:identifier="gjsify_terminal_terminal_get_size">
|
|
29
|
+
<return-value transfer-ownership="full">
|
|
30
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
31
|
+
</return-value>
|
|
32
|
+
<parameters>
|
|
33
|
+
<parameter name="fd" transfer-ownership="none">
|
|
34
|
+
<type name="gint" c:type="gint"/>
|
|
35
|
+
</parameter>
|
|
36
|
+
<parameter name="rows" direction="out" transfer-ownership="full">
|
|
37
|
+
<type name="gint" c:type="gint*"/>
|
|
38
|
+
</parameter>
|
|
39
|
+
<parameter name="cols" direction="out" transfer-ownership="full">
|
|
40
|
+
<type name="gint" c:type="gint*"/>
|
|
41
|
+
</parameter>
|
|
42
|
+
<parameter name="xpixel" direction="out" transfer-ownership="full">
|
|
43
|
+
<type name="gint" c:type="gint*"/>
|
|
44
|
+
</parameter>
|
|
45
|
+
<parameter name="ypixel" direction="out" transfer-ownership="full">
|
|
46
|
+
<type name="gint" c:type="gint*"/>
|
|
47
|
+
</parameter>
|
|
48
|
+
</parameters>
|
|
49
|
+
</function>
|
|
50
|
+
<function name="set_raw_mode" c:identifier="gjsify_terminal_terminal_set_raw_mode">
|
|
51
|
+
<return-value transfer-ownership="full">
|
|
52
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
53
|
+
</return-value>
|
|
54
|
+
<parameters>
|
|
55
|
+
<parameter name="fd" transfer-ownership="none">
|
|
56
|
+
<type name="gint" c:type="gint"/>
|
|
57
|
+
</parameter>
|
|
58
|
+
<parameter name="enable" transfer-ownership="none">
|
|
59
|
+
<type name="gboolean" c:type="gboolean"/>
|
|
60
|
+
</parameter>
|
|
61
|
+
</parameters>
|
|
62
|
+
</function>
|
|
63
|
+
<constructor name="new" c:identifier="gjsify_terminal_terminal_new">
|
|
64
|
+
<return-value transfer-ownership="full">
|
|
65
|
+
<type name="GjsifyTerminal.Terminal" c:type="GjsifyTerminalTerminal*"/>
|
|
66
|
+
</return-value>
|
|
67
|
+
</constructor>
|
|
68
|
+
</class>
|
|
69
|
+
<record name="TerminalClass" c:type="GjsifyTerminalTerminalClass" glib:is-gtype-struct-for="Terminal">
|
|
70
|
+
<field name="parent_class" readable="0" private="1">
|
|
71
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
72
|
+
</field>
|
|
73
|
+
</record>
|
|
74
|
+
<record name="TerminalPrivate" c:type="GjsifyTerminalTerminalPrivate" disguised="1"/>
|
|
75
|
+
<class name="ResizeWatcher" c:type="GjsifyTerminalResizeWatcher" c:symbol-prefix="resize_watcher" glib:type-name="GjsifyTerminalResizeWatcher" glib:get-type="gjsify_terminal_resize_watcher_get_type" glib:type-struct="ResizeWatcherClass" parent="GObject.Object">
|
|
76
|
+
<field name="parent_instance" readable="0" private="1">
|
|
77
|
+
<type name="GObject.Object" c:type="GObject"/>
|
|
78
|
+
</field>
|
|
79
|
+
<field name="priv" readable="0" private="1">
|
|
80
|
+
<type name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate*"/>
|
|
81
|
+
</field>
|
|
82
|
+
<method name="start" c:identifier="gjsify_terminal_resize_watcher_start">
|
|
83
|
+
<return-value transfer-ownership="full">
|
|
84
|
+
<type name="none" c:type="void"/>
|
|
85
|
+
</return-value>
|
|
86
|
+
<parameters>
|
|
87
|
+
<instance-parameter name="self" transfer-ownership="none">
|
|
88
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
89
|
+
</instance-parameter>
|
|
90
|
+
</parameters>
|
|
91
|
+
</method>
|
|
92
|
+
<constructor name="new" c:identifier="gjsify_terminal_resize_watcher_new">
|
|
93
|
+
<return-value transfer-ownership="full">
|
|
94
|
+
<type name="GjsifyTerminal.ResizeWatcher" c:type="GjsifyTerminalResizeWatcher*"/>
|
|
95
|
+
</return-value>
|
|
96
|
+
</constructor>
|
|
97
|
+
<glib:signal name="resized">
|
|
98
|
+
<return-value transfer-ownership="full">
|
|
99
|
+
<type name="none" c:type="void"/>
|
|
100
|
+
</return-value>
|
|
101
|
+
<parameters>
|
|
102
|
+
<parameter name="rows" transfer-ownership="none">
|
|
103
|
+
<type name="gint" c:type="gint"/>
|
|
104
|
+
</parameter>
|
|
105
|
+
<parameter name="cols" transfer-ownership="none">
|
|
106
|
+
<type name="gint" c:type="gint"/>
|
|
107
|
+
</parameter>
|
|
108
|
+
</parameters>
|
|
109
|
+
</glib:signal>
|
|
110
|
+
</class>
|
|
111
|
+
<record name="ResizeWatcherClass" c:type="GjsifyTerminalResizeWatcherClass" glib:is-gtype-struct-for="ResizeWatcher">
|
|
112
|
+
<field name="parent_class" readable="0" private="1">
|
|
113
|
+
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
|
|
114
|
+
</field>
|
|
115
|
+
</record>
|
|
116
|
+
<record name="ResizeWatcherPrivate" c:type="GjsifyTerminalResizeWatcherPrivate" disguised="1"/>
|
|
117
|
+
</namespace>
|
|
118
|
+
</repository>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* terminal-compat.vapi — portable declarations for the two symbols
|
|
3
|
+
* @gjsify/terminal-native used to take from Vala's bundled `linux.vapi`.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS FILE EXISTS
|
|
6
|
+
* ────────────────────
|
|
7
|
+
* `terminal.vala` needs exactly two things beyond POSIX: `struct winsize` and
|
|
8
|
+
* the `TIOCGWINSZ` ioctl request. Both are declared in Vala's `linux.vapi`
|
|
9
|
+
* (`Linux.winsize`, `Linux.Termios.TIOCGWINSZ`), which pulled a package named
|
|
10
|
+
* after — and maintained for — Linux into a bridge that is otherwise plain
|
|
11
|
+
* POSIX (isatty / termios / ioctl). That made the package look Linux-bound
|
|
12
|
+
* when it is not, and made the build depend on which header `linux.vapi`
|
|
13
|
+
* happens to attribute each symbol to (it attributes `struct winsize` to
|
|
14
|
+
* <termios.h>, which on Linux defines it but on macOS does not — there it
|
|
15
|
+
* lives in <sys/ttycom.h>, reachable via <sys/ioctl.h>).
|
|
16
|
+
*
|
|
17
|
+
* Declaring both symbols here against BOTH <sys/ioctl.h> and <termios.h> makes
|
|
18
|
+
* the include set explicit and correct on every POSIX host, and lets
|
|
19
|
+
* meson.build drop `--pkg=linux` entirely. Nothing else in this bridge is
|
|
20
|
+
* Linux-specific:
|
|
21
|
+
* • Posix.isatty / termios / tcgetattr / tcsetattr — POSIX.1
|
|
22
|
+
* • TIOCGWINSZ — BSD-derived, on Linux,
|
|
23
|
+
* macOS and the BSDs
|
|
24
|
+
* • GLib.Unix.signal_add (SIGWINCH) — supported by GLib on
|
|
25
|
+
* every UNIX platform
|
|
26
|
+
*
|
|
27
|
+
* `TIOCGWINSZ` is spelled `ulong` to match the `request` parameter of the
|
|
28
|
+
* `_ioctl_winsize` binding in terminal.vala: glibc declares ioctl(2)'s request
|
|
29
|
+
* as `unsigned long`, and on macOS the constant itself is an `_IOR(...)`
|
|
30
|
+
* expression that is unsigned. Using the same width on both sides avoids an
|
|
31
|
+
* implicit narrowing conversion in the generated C.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
[CCode (cheader_filename = "sys/ioctl.h,termios.h")]
|
|
35
|
+
namespace GjsifyTerminalCompat {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* winsize: terminal dimensions as returned by ioctl(TIOCGWINSZ).
|
|
39
|
+
*
|
|
40
|
+
* Defined by <sys/ioctl.h> (via <sys/ttycom.h>) on macOS/BSD and by
|
|
41
|
+
* <termios.h> on Linux; both headers are requested above so the struct is
|
|
42
|
+
* visible either way.
|
|
43
|
+
*/
|
|
44
|
+
[CCode (cname = "struct winsize", has_type_id = false, destroy_function = "")]
|
|
45
|
+
public struct Winsize {
|
|
46
|
+
public ushort ws_row;
|
|
47
|
+
public ushort ws_col;
|
|
48
|
+
public ushort ws_xpixel;
|
|
49
|
+
public ushort ws_ypixel;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** ioctl(2) request code that fills a `struct winsize`. */
|
|
53
|
+
[CCode (cname = "TIOCGWINSZ")]
|
|
54
|
+
public const ulong TIOCGWINSZ;
|
|
55
|
+
}
|
package/src/vala/terminal.vala
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* GjsifyTerminal —
|
|
2
|
+
* GjsifyTerminal — POSIX terminal primitives for GJS.
|
|
3
3
|
*
|
|
4
|
-
* Exposes
|
|
4
|
+
* Exposes POSIX syscalls that have no GLib equivalent:
|
|
5
5
|
* • Posix.isatty() — reliable TTY detection
|
|
6
6
|
* • ioctl(TIOCGWINSZ) — actual terminal dimensions
|
|
7
7
|
* • termios raw mode — keypress-level input for interactive prompts
|
|
8
8
|
* • SIGWINCH watcher — notify on terminal resize (GLib.Unix.signal_add)
|
|
9
9
|
*
|
|
10
|
-
* No dependencies beyond glib-2.0 / gobject-2.0.
|
|
10
|
+
* No dependencies beyond glib-2.0 / gobject-2.0. Portable across POSIX hosts
|
|
11
|
+
* (Linux, macOS, the BSDs): `struct winsize` + `TIOCGWINSZ` come from the
|
|
12
|
+
* sibling `terminal-compat.vapi` rather than Vala's Linux-specific
|
|
13
|
+
* `linux.vapi` — see that file for why.
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
16
|
using GLib;
|
|
@@ -16,7 +19,8 @@ namespace GjsifyTerminal {
|
|
|
16
19
|
|
|
17
20
|
// Specific ioctl binding for TIOCGWINSZ — avoids variadic ambiguity.
|
|
18
21
|
[CCode (cname = "ioctl", cheader_filename = "sys/ioctl.h,termios.h")]
|
|
19
|
-
private static extern int _ioctl_winsize (int fd, ulong request,
|
|
22
|
+
private static extern int _ioctl_winsize (int fd, ulong request,
|
|
23
|
+
ref GjsifyTerminalCompat.Winsize ws);
|
|
20
24
|
|
|
21
25
|
// Explicit tcgetattr / tcsetattr with ref to match C pointer semantics.
|
|
22
26
|
[CCode (cname = "tcgetattr", cheader_filename = "termios.h")]
|
|
@@ -55,8 +59,8 @@ namespace GjsifyTerminal {
|
|
|
55
59
|
public static bool get_size (int fd, out int rows, out int cols,
|
|
56
60
|
out int xpixel, out int ypixel) {
|
|
57
61
|
rows = 0; cols = 0; xpixel = 0; ypixel = 0;
|
|
58
|
-
var ws =
|
|
59
|
-
if (_ioctl_winsize (fd,
|
|
62
|
+
var ws = GjsifyTerminalCompat.Winsize ();
|
|
63
|
+
if (_ioctl_winsize (fd, GjsifyTerminalCompat.TIOCGWINSZ, ref ws) != 0) {
|
|
60
64
|
return false;
|
|
61
65
|
}
|
|
62
66
|
rows = (int) ws.ws_row;
|
|
File without changes
|
|
File without changes
|