@gtkx/ffi 0.18.5 → 0.18.6
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/dist/generated/adw/constants.d.ts +2 -2
- package/dist/generated/adw/constants.js +2 -2
- package/dist/generated/gdkwayland/index.d.ts +9 -0
- package/dist/generated/gdkwayland/index.d.ts.map +1 -0
- package/dist/generated/gdkwayland/index.js +9 -0
- package/dist/generated/gdkwayland/index.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-device.d.ts +29 -0
- package/dist/generated/gdkwayland/wayland-device.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-device.js +81 -0
- package/dist/generated/gdkwayland/wayland-device.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-display.d.ts +44 -0
- package/dist/generated/gdkwayland/wayland-display.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-display.js +161 -0
- package/dist/generated/gdkwayland/wayland-display.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-gl-context.d.ts +8 -0
- package/dist/generated/gdkwayland/wayland-gl-context.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-gl-context.js +33 -0
- package/dist/generated/gdkwayland/wayland-gl-context.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-monitor.d.ts +14 -0
- package/dist/generated/gdkwayland/wayland-monitor.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-monitor.js +39 -0
- package/dist/generated/gdkwayland/wayland-monitor.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-popup.d.ts +49 -0
- package/dist/generated/gdkwayland/wayland-popup.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-popup.js +199 -0
- package/dist/generated/gdkwayland/wayland-popup.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-seat.d.ts +14 -0
- package/dist/generated/gdkwayland/wayland-seat.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-seat.js +39 -0
- package/dist/generated/gdkwayland/wayland-seat.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-surface.d.ts +16 -0
- package/dist/generated/gdkwayland/wayland-surface.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-surface.js +53 -0
- package/dist/generated/gdkwayland/wayland-surface.js.map +1 -0
- package/dist/generated/gdkwayland/wayland-toplevel.d.ts +252 -0
- package/dist/generated/gdkwayland/wayland-toplevel.d.ts.map +1 -0
- package/dist/generated/gdkwayland/wayland-toplevel.js +1022 -0
- package/dist/generated/gdkwayland/wayland-toplevel.js.map +1 -0
- package/dist/generated/gst/constants.d.ts +1 -1
- package/dist/generated/gst/constants.d.ts.map +1 -1
- package/dist/generated/gst/constants.js +1 -1
- package/dist/generated/gst/constants.js.map +1 -1
- package/dist/generated/gtk4layershell/functions.d.ts +18 -7
- package/dist/generated/gtk4layershell/functions.d.ts.map +1 -1
- package/dist/generated/gtk4layershell/functions.js +50 -5
- package/dist/generated/gtk4layershell/functions.js.map +1 -1
- package/dist/generated/gtk4sessionlock/functions.d.ts +3 -0
- package/dist/generated/gtk4sessionlock/functions.d.ts.map +1 -0
- package/dist/generated/gtk4sessionlock/functions.js +8 -0
- package/dist/generated/gtk4sessionlock/functions.js.map +1 -0
- package/dist/generated/gtk4sessionlock/index.d.ts +3 -0
- package/dist/generated/gtk4sessionlock/index.d.ts.map +1 -0
- package/dist/generated/gtk4sessionlock/index.js +3 -0
- package/dist/generated/gtk4sessionlock/index.js.map +1 -0
- package/dist/generated/gtk4sessionlock/instance.d.ts +36 -0
- package/dist/generated/gtk4sessionlock/instance.d.ts.map +1 -0
- package/dist/generated/gtk4sessionlock/instance.js +215 -0
- package/dist/generated/gtk4sessionlock/instance.js.map +1 -0
- package/dist/generated/vte/constants.d.ts +1 -1
- package/dist/generated/vte/constants.js +1 -1
- package/package.json +3 -3
- package/src/generated/adw/constants.ts +2 -2
- package/src/generated/gdkwayland/index.ts +8 -0
- package/src/generated/gdkwayland/wayland-device.ts +99 -0
- package/src/generated/gdkwayland/wayland-display.ts +197 -0
- package/src/generated/gdkwayland/wayland-gl-context.ts +39 -0
- package/src/generated/gdkwayland/wayland-monitor.ts +45 -0
- package/src/generated/gdkwayland/wayland-popup.ts +247 -0
- package/src/generated/gdkwayland/wayland-seat.ts +45 -0
- package/src/generated/gdkwayland/wayland-surface.ts +65 -0
- package/src/generated/gdkwayland/wayland-toplevel.ts +1260 -0
- package/src/generated/gst/constants.ts +1 -1
- package/src/generated/gtk4layershell/functions.ts +62 -8
- package/src/generated/gtk4sessionlock/functions.ts +8 -0
- package/src/generated/gtk4sessionlock/index.ts +2 -0
- package/src/generated/gtk4sessionlock/instance.ts +271 -0
- package/src/generated/vte/constants.ts +1 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { isInstantiating, setInstantiating } from "../../lifecycle.js";
|
|
2
|
+
import { call } from "../../native.js";
|
|
3
|
+
import { getNativeObject, registerNativeClass, registerNativeObject } from "../../registry.js";
|
|
4
|
+
import * as GObject from "../gobject/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* An instance of the object used to control locking the screen.
|
|
7
|
+
* Multiple instances can exist at once, but only one can be locked at a time.
|
|
8
|
+
*/
|
|
9
|
+
export class Instance extends GObject.Object {
|
|
10
|
+
static glibTypeName = "GtkSessionLockInstance";
|
|
11
|
+
static objectType = "gobject";
|
|
12
|
+
constructor() {
|
|
13
|
+
if (!isInstantiating) {
|
|
14
|
+
setInstantiating(true);
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
super();
|
|
17
|
+
setInstantiating(false);
|
|
18
|
+
this.handle = call("libgtk4-layer-shell.so.0", "gtk_session_lock_instance_new", [], {
|
|
19
|
+
type: "gobject",
|
|
20
|
+
ownership: "full",
|
|
21
|
+
});
|
|
22
|
+
registerNativeObject(this);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
super();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This must be called with a different unrealized window once for each monitor immediately after calling
|
|
31
|
+
* gtk_session_lock_lock(). Hiding a window that is active on a monitor or not letting a window be resized by the
|
|
32
|
+
* library is not allowed (may result in a Wayland protocol error). The window will be unmapped and gtk_window_destroy()
|
|
33
|
+
* called on it when the current lock ends.
|
|
34
|
+
*/
|
|
35
|
+
assignWindowToMonitor(window, monitor) {
|
|
36
|
+
call("libgtk4-layer-shell.so.0", "gtk_session_lock_instance_assign_window_to_monitor", [
|
|
37
|
+
{
|
|
38
|
+
type: {
|
|
39
|
+
type: "gobject",
|
|
40
|
+
ownership: "borrowed",
|
|
41
|
+
},
|
|
42
|
+
value: this.handle,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: {
|
|
46
|
+
type: "gobject",
|
|
47
|
+
ownership: "borrowed",
|
|
48
|
+
},
|
|
49
|
+
value: window.handle,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: {
|
|
53
|
+
type: "gobject",
|
|
54
|
+
ownership: "borrowed",
|
|
55
|
+
},
|
|
56
|
+
value: monitor.handle,
|
|
57
|
+
},
|
|
58
|
+
], {
|
|
59
|
+
type: "undefined",
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** Returns if this instance currently holds a lock. */
|
|
63
|
+
isLocked() {
|
|
64
|
+
return call("libgtk4-layer-shell.so.0", "gtk_session_lock_instance_is_locked", [
|
|
65
|
+
{
|
|
66
|
+
type: {
|
|
67
|
+
type: "gobject",
|
|
68
|
+
ownership: "borrowed",
|
|
69
|
+
},
|
|
70
|
+
value: this.handle,
|
|
71
|
+
},
|
|
72
|
+
], {
|
|
73
|
+
type: "boolean",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Lock the screen. This should be called before assigning any windows to monitors. If this function fails the ::failed
|
|
78
|
+
* signal is emitted, if it succeeds the ::locked signal is emitted. The ::failed signal may be emitted before the
|
|
79
|
+
* function returns (for example, if another #GtkSessionLockInstance holds a lock) or later (if another process holds a
|
|
80
|
+
* lock). The only case where neither signal is triggered is if the instance is already locked.
|
|
81
|
+
*/
|
|
82
|
+
lock() {
|
|
83
|
+
return call("libgtk4-layer-shell.so.0", "gtk_session_lock_instance_lock", [
|
|
84
|
+
{
|
|
85
|
+
type: {
|
|
86
|
+
type: "gobject",
|
|
87
|
+
ownership: "borrowed",
|
|
88
|
+
},
|
|
89
|
+
value: this.handle,
|
|
90
|
+
},
|
|
91
|
+
], {
|
|
92
|
+
type: "boolean",
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/** If the screen is locked by this instance unlocks it and fires ::unlocked. Otherwise has no effect */
|
|
96
|
+
unlock() {
|
|
97
|
+
call("libgtk4-layer-shell.so.0", "gtk_session_lock_instance_unlock", [
|
|
98
|
+
{
|
|
99
|
+
type: {
|
|
100
|
+
type: "gobject",
|
|
101
|
+
ownership: "borrowed",
|
|
102
|
+
},
|
|
103
|
+
value: this.handle,
|
|
104
|
+
},
|
|
105
|
+
], {
|
|
106
|
+
type: "undefined",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Connects a handler to a signal on this Instance.
|
|
111
|
+
*
|
|
112
|
+
* @param signal - The signal name to connect to
|
|
113
|
+
* @param handler - Callback function invoked when signal is emitted
|
|
114
|
+
* @param after - If true, handler is called after default handler
|
|
115
|
+
* @returns Connection ID for disconnecting
|
|
116
|
+
*/
|
|
117
|
+
connect(signal, handler, after = false) {
|
|
118
|
+
switch (signal) {
|
|
119
|
+
case "failed": {
|
|
120
|
+
const wrappedHandler = (...args) => {
|
|
121
|
+
return handler(getNativeObject(args[0]));
|
|
122
|
+
};
|
|
123
|
+
return call("libgtk4-layer-shell.so.0", "g_signal_connect_closure", [
|
|
124
|
+
{ type: { type: "gobject", ownership: "borrowed" }, value: this.handle },
|
|
125
|
+
{ type: { type: "string", ownership: "borrowed" }, value: signal },
|
|
126
|
+
{
|
|
127
|
+
type: {
|
|
128
|
+
type: "callback",
|
|
129
|
+
argTypes: [{ type: "gobject", ownership: "borrowed" }],
|
|
130
|
+
returnType: {
|
|
131
|
+
type: "undefined",
|
|
132
|
+
},
|
|
133
|
+
kind: "closure",
|
|
134
|
+
},
|
|
135
|
+
value: wrappedHandler,
|
|
136
|
+
},
|
|
137
|
+
{ type: { type: "boolean" }, value: after },
|
|
138
|
+
], { type: "int", size: 64, unsigned: true });
|
|
139
|
+
}
|
|
140
|
+
case "locked": {
|
|
141
|
+
const wrappedHandler = (...args) => {
|
|
142
|
+
return handler(getNativeObject(args[0]));
|
|
143
|
+
};
|
|
144
|
+
return call("libgtk4-layer-shell.so.0", "g_signal_connect_closure", [
|
|
145
|
+
{ type: { type: "gobject", ownership: "borrowed" }, value: this.handle },
|
|
146
|
+
{ type: { type: "string", ownership: "borrowed" }, value: signal },
|
|
147
|
+
{
|
|
148
|
+
type: {
|
|
149
|
+
type: "callback",
|
|
150
|
+
argTypes: [{ type: "gobject", ownership: "borrowed" }],
|
|
151
|
+
returnType: {
|
|
152
|
+
type: "undefined",
|
|
153
|
+
},
|
|
154
|
+
kind: "closure",
|
|
155
|
+
},
|
|
156
|
+
value: wrappedHandler,
|
|
157
|
+
},
|
|
158
|
+
{ type: { type: "boolean" }, value: after },
|
|
159
|
+
], { type: "int", size: 64, unsigned: true });
|
|
160
|
+
}
|
|
161
|
+
case "monitor": {
|
|
162
|
+
const wrappedHandler = (...args) => {
|
|
163
|
+
return handler(getNativeObject(args[0]), getNativeObject(args[1]));
|
|
164
|
+
};
|
|
165
|
+
return call("libgtk4-layer-shell.so.0", "g_signal_connect_closure", [
|
|
166
|
+
{ type: { type: "gobject", ownership: "borrowed" }, value: this.handle },
|
|
167
|
+
{ type: { type: "string", ownership: "borrowed" }, value: signal },
|
|
168
|
+
{
|
|
169
|
+
type: {
|
|
170
|
+
type: "callback",
|
|
171
|
+
argTypes: [
|
|
172
|
+
{ type: "gobject", ownership: "borrowed" },
|
|
173
|
+
{
|
|
174
|
+
type: "gobject",
|
|
175
|
+
ownership: "borrowed",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
returnType: {
|
|
179
|
+
type: "undefined",
|
|
180
|
+
},
|
|
181
|
+
kind: "closure",
|
|
182
|
+
},
|
|
183
|
+
value: wrappedHandler,
|
|
184
|
+
},
|
|
185
|
+
{ type: { type: "boolean" }, value: after },
|
|
186
|
+
], { type: "int", size: 64, unsigned: true });
|
|
187
|
+
}
|
|
188
|
+
case "unlocked": {
|
|
189
|
+
const wrappedHandler = (...args) => {
|
|
190
|
+
return handler(getNativeObject(args[0]));
|
|
191
|
+
};
|
|
192
|
+
return call("libgtk4-layer-shell.so.0", "g_signal_connect_closure", [
|
|
193
|
+
{ type: { type: "gobject", ownership: "borrowed" }, value: this.handle },
|
|
194
|
+
{ type: { type: "string", ownership: "borrowed" }, value: signal },
|
|
195
|
+
{
|
|
196
|
+
type: {
|
|
197
|
+
type: "callback",
|
|
198
|
+
argTypes: [{ type: "gobject", ownership: "borrowed" }],
|
|
199
|
+
returnType: {
|
|
200
|
+
type: "undefined",
|
|
201
|
+
},
|
|
202
|
+
kind: "closure",
|
|
203
|
+
},
|
|
204
|
+
value: wrappedHandler,
|
|
205
|
+
},
|
|
206
|
+
{ type: { type: "boolean" }, value: after },
|
|
207
|
+
], { type: "int", size: 64, unsigned: true });
|
|
208
|
+
}
|
|
209
|
+
default:
|
|
210
|
+
return super.connect(signal, handler, after);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
registerNativeClass(Instance);
|
|
215
|
+
//# sourceMappingURL=instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../../src/generated/gtk4sessionlock/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,mBA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 this is 4).
|
|
9
9
|
*/
|
|
10
|
-
export declare const MICRO_VERSION =
|
|
10
|
+
export declare const MICRO_VERSION = 3;
|
|
11
11
|
/**
|
|
12
12
|
* The minor version number of the VTE library
|
|
13
13
|
* (e.g. in version 3.1.4 this is 1).
|
|
@@ -7,7 +7,7 @@ export const MAJOR_VERSION = 0;
|
|
|
7
7
|
* The micro version number of the VTE library
|
|
8
8
|
* (e.g. in version 3.1.4 this is 4).
|
|
9
9
|
*/
|
|
10
|
-
export const MICRO_VERSION =
|
|
10
|
+
export const MICRO_VERSION = 3;
|
|
11
11
|
/**
|
|
12
12
|
* The minor version number of the VTE library
|
|
13
13
|
* (e.g. in version 3.1.4 this is 1).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/ffi",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "Generated TypeScript FFI bindings for GTKX",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"src"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@gtkx/native": "0.18.
|
|
55
|
+
"@gtkx/native": "0.18.6"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@gtkx/vitest": "0.18.
|
|
58
|
+
"@gtkx/vitest": "0.18.6"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsc -b && cp ../../README.md .",
|
|
@@ -7,11 +7,11 @@ export const DURATION_INFINITE = 4294967295;
|
|
|
7
7
|
/** Adwaita major version component (e.g. 1 if the version is 1.2.3). */
|
|
8
8
|
export const MAJOR_VERSION = 1;
|
|
9
9
|
/** Adwaita micro version component (e.g. 3 if the version is 1.2.3). */
|
|
10
|
-
export const MICRO_VERSION =
|
|
10
|
+
export const MICRO_VERSION = 3;
|
|
11
11
|
/** Adwaita minor version component (e.g. 2 if the version is 1.2.3). */
|
|
12
12
|
export const MINOR_VERSION = 8;
|
|
13
13
|
/**
|
|
14
14
|
* Adwaita version, encoded as a string, useful for printing and
|
|
15
15
|
* concatenation.
|
|
16
16
|
*/
|
|
17
|
-
export const VERSION_S = "1.8.
|
|
17
|
+
export const VERSION_S = "1.8.3";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./wayland-device.js";
|
|
2
|
+
export * from "./wayland-display.js";
|
|
3
|
+
export * from "./wayland-gl-context.js";
|
|
4
|
+
export * from "./wayland-monitor.js";
|
|
5
|
+
export * from "./wayland-popup.js";
|
|
6
|
+
export * from "./wayland-seat.js";
|
|
7
|
+
export * from "./wayland-surface.js";
|
|
8
|
+
export * from "./wayland-toplevel.js";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { isInstantiating, setInstantiating } from "../../lifecycle.js";
|
|
2
|
+
import { NativeHandle } from "../../object.js";
|
|
3
|
+
import { call } from "../../native.js";
|
|
4
|
+
import { registerNativeClass, registerNativeObject } from "../../registry.js";
|
|
5
|
+
import * as Gdk from "../gdk/index.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Wayland implementation of `GdkDevice`.
|
|
9
|
+
*
|
|
10
|
+
* Beyond the regular {@link Gdk.Device} API, the Wayland implementation
|
|
11
|
+
* provides access to Wayland objects such as the `wl_seat` with
|
|
12
|
+
* {@link GdkWayland.WaylandDevice.get_wl_seat}, the `wl_keyboard` with
|
|
13
|
+
* {@link GdkWayland.WaylandDevice.get_wl_keyboard} and the `wl_pointer` with
|
|
14
|
+
* {@link GdkWayland.WaylandDevice.get_wl_pointer}.
|
|
15
|
+
*/
|
|
16
|
+
export class WaylandDevice extends Gdk.Device {
|
|
17
|
+
static override readonly glibTypeName: string = "GdkWaylandDevice";
|
|
18
|
+
static override readonly objectType = "gobject" as const;
|
|
19
|
+
|
|
20
|
+
constructor() {
|
|
21
|
+
if (!isInstantiating) {
|
|
22
|
+
setInstantiating(true);
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
super();
|
|
25
|
+
setInstantiating(false);
|
|
26
|
+
const gtype = call("libgtk-4.so.1", "gdk_wayland_device_get_type", [], {
|
|
27
|
+
type: "int",
|
|
28
|
+
size: 64,
|
|
29
|
+
unsigned: true,
|
|
30
|
+
});
|
|
31
|
+
this.handle = call(
|
|
32
|
+
"libgobject-2.0.so.0",
|
|
33
|
+
"g_object_new",
|
|
34
|
+
[
|
|
35
|
+
{ type: { type: "int", size: 64, unsigned: true }, value: gtype, optional: false },
|
|
36
|
+
{ type: { type: "null" }, value: null, optional: false },
|
|
37
|
+
],
|
|
38
|
+
{ type: "gobject", ownership: "full" },
|
|
39
|
+
) as NativeHandle;
|
|
40
|
+
registerNativeObject(this);
|
|
41
|
+
} else {
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
super();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns the `/dev/input/event*` path of this device.
|
|
49
|
+
*
|
|
50
|
+
* For `GdkDevice`s that possibly coalesce multiple hardware
|
|
51
|
+
* devices (eg. mouse, keyboard, touch,...), this function
|
|
52
|
+
* will return %NULL.
|
|
53
|
+
*
|
|
54
|
+
* This is most notably implemented for devices of type
|
|
55
|
+
* %GDK_SOURCE_PEN, %GDK_SOURCE_TABLET_PAD.
|
|
56
|
+
*/
|
|
57
|
+
getNodePath(): string | null {
|
|
58
|
+
return call(
|
|
59
|
+
"libgtk-4.so.1",
|
|
60
|
+
"gdk_wayland_device_get_node_path",
|
|
61
|
+
[
|
|
62
|
+
{
|
|
63
|
+
type: {
|
|
64
|
+
type: "gobject",
|
|
65
|
+
ownership: "borrowed",
|
|
66
|
+
},
|
|
67
|
+
value: this.handle,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
{
|
|
71
|
+
type: "string",
|
|
72
|
+
ownership: "borrowed",
|
|
73
|
+
},
|
|
74
|
+
) as string | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Returns the `xkb_keymap` of a `GdkDevice`. */
|
|
78
|
+
getXkbKeymap(): number | null {
|
|
79
|
+
return call(
|
|
80
|
+
"libgtk-4.so.1",
|
|
81
|
+
"gdk_wayland_device_get_xkb_keymap",
|
|
82
|
+
[
|
|
83
|
+
{
|
|
84
|
+
type: {
|
|
85
|
+
type: "gobject",
|
|
86
|
+
ownership: "borrowed",
|
|
87
|
+
},
|
|
88
|
+
value: this.handle,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
{
|
|
92
|
+
type: "int",
|
|
93
|
+
size: 64,
|
|
94
|
+
unsigned: true,
|
|
95
|
+
},
|
|
96
|
+
) as number | null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
registerNativeClass(WaylandDevice);
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { isInstantiating, setInstantiating } from "../../lifecycle.js";
|
|
2
|
+
import { NativeHandle } from "../../object.js";
|
|
3
|
+
import { call } from "../../native.js";
|
|
4
|
+
import { registerNativeClass, registerNativeObject } from "../../registry.js";
|
|
5
|
+
import * as Gdk from "../gdk/index.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Wayland implementation of `GdkDisplay`.
|
|
9
|
+
*
|
|
10
|
+
* Beyond the regular {@link Gdk.Display} API, the Wayland implementation
|
|
11
|
+
* provides access to Wayland objects such as the `wl_display` with
|
|
12
|
+
* {@link GdkWayland.WaylandDisplay.get_wl_display}, the `wl_compositor` with
|
|
13
|
+
* {@link GdkWayland.WaylandDisplay.get_wl_compositor}.
|
|
14
|
+
*
|
|
15
|
+
* You can find out what Wayland globals are supported by a display
|
|
16
|
+
* with {@link GdkWayland.WaylandDisplay.query_registry}.
|
|
17
|
+
*/
|
|
18
|
+
export class WaylandDisplay extends Gdk.Display {
|
|
19
|
+
static override readonly glibTypeName: string = "GdkWaylandDisplay";
|
|
20
|
+
static override readonly objectType = "gobject" as const;
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
if (!isInstantiating) {
|
|
24
|
+
setInstantiating(true);
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
super();
|
|
27
|
+
setInstantiating(false);
|
|
28
|
+
const gtype = call("libgtk-4.so.1", "gdk_wayland_display_get_type", [], {
|
|
29
|
+
type: "int",
|
|
30
|
+
size: 64,
|
|
31
|
+
unsigned: true,
|
|
32
|
+
});
|
|
33
|
+
this.handle = call(
|
|
34
|
+
"libgobject-2.0.so.0",
|
|
35
|
+
"g_object_new",
|
|
36
|
+
[
|
|
37
|
+
{ type: { type: "int", size: 64, unsigned: true }, value: gtype, optional: false },
|
|
38
|
+
{ type: { type: "null" }, value: null, optional: false },
|
|
39
|
+
],
|
|
40
|
+
{ type: "gobject", ownership: "full" },
|
|
41
|
+
) as NativeHandle;
|
|
42
|
+
registerNativeObject(this);
|
|
43
|
+
} else {
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
super();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Retrieves the EGL display connection object for the given GDK display. */
|
|
50
|
+
getEglDisplay(): number | null {
|
|
51
|
+
return call(
|
|
52
|
+
"libgtk-4.so.1",
|
|
53
|
+
"gdk_wayland_display_get_egl_display",
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
type: {
|
|
57
|
+
type: "gobject",
|
|
58
|
+
ownership: "borrowed",
|
|
59
|
+
},
|
|
60
|
+
value: this.handle,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
{
|
|
64
|
+
type: "int",
|
|
65
|
+
size: 64,
|
|
66
|
+
unsigned: true,
|
|
67
|
+
},
|
|
68
|
+
) as number | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Gets the startup notification ID for a Wayland display, or `NULL`
|
|
73
|
+
* if no ID has been defined.
|
|
74
|
+
*/
|
|
75
|
+
waylandDisplayGetStartupNotificationId(): string | null {
|
|
76
|
+
return call(
|
|
77
|
+
"libgtk-4.so.1",
|
|
78
|
+
"gdk_wayland_display_get_startup_notification_id",
|
|
79
|
+
[
|
|
80
|
+
{
|
|
81
|
+
type: {
|
|
82
|
+
type: "gobject",
|
|
83
|
+
ownership: "borrowed",
|
|
84
|
+
},
|
|
85
|
+
value: this.handle,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
{
|
|
89
|
+
type: "string",
|
|
90
|
+
ownership: "borrowed",
|
|
91
|
+
},
|
|
92
|
+
) as string | null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Returns true if the interface was found in the display
|
|
97
|
+
* `wl_registry.global` handler.
|
|
98
|
+
*/
|
|
99
|
+
queryRegistry(global: string): boolean {
|
|
100
|
+
return call(
|
|
101
|
+
"libgtk-4.so.1",
|
|
102
|
+
"gdk_wayland_display_query_registry",
|
|
103
|
+
[
|
|
104
|
+
{
|
|
105
|
+
type: {
|
|
106
|
+
type: "gobject",
|
|
107
|
+
ownership: "borrowed",
|
|
108
|
+
},
|
|
109
|
+
value: this.handle,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: {
|
|
113
|
+
type: "string",
|
|
114
|
+
ownership: "borrowed",
|
|
115
|
+
},
|
|
116
|
+
value: global,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
{
|
|
120
|
+
type: "boolean",
|
|
121
|
+
},
|
|
122
|
+
) as boolean;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Sets the cursor theme for the given `display`. */
|
|
126
|
+
setCursorTheme(name: string, size: number) {
|
|
127
|
+
call(
|
|
128
|
+
"libgtk-4.so.1",
|
|
129
|
+
"gdk_wayland_display_set_cursor_theme",
|
|
130
|
+
[
|
|
131
|
+
{
|
|
132
|
+
type: {
|
|
133
|
+
type: "gobject",
|
|
134
|
+
ownership: "borrowed",
|
|
135
|
+
},
|
|
136
|
+
value: this.handle,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: {
|
|
140
|
+
type: "string",
|
|
141
|
+
ownership: "borrowed",
|
|
142
|
+
},
|
|
143
|
+
value: name,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: {
|
|
147
|
+
type: "int",
|
|
148
|
+
size: 32,
|
|
149
|
+
unsigned: false,
|
|
150
|
+
},
|
|
151
|
+
value: size,
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
{
|
|
155
|
+
type: "undefined",
|
|
156
|
+
},
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Sets the startup notification ID for a display.
|
|
162
|
+
*
|
|
163
|
+
* This is usually taken from the value of the `DESKTOP_STARTUP_ID`
|
|
164
|
+
* environment variable, but in some cases (such as the application not
|
|
165
|
+
* being launched using exec()) it can come from other sources.
|
|
166
|
+
*
|
|
167
|
+
* The startup ID is also what is used to signal that the startup is
|
|
168
|
+
* complete (for example, when opening a window or when calling
|
|
169
|
+
* {@link Gdk.Display.notify_startup_complete}).
|
|
170
|
+
*/
|
|
171
|
+
setStartupNotificationId(startupId: string) {
|
|
172
|
+
call(
|
|
173
|
+
"libgtk-4.so.1",
|
|
174
|
+
"gdk_wayland_display_set_startup_notification_id",
|
|
175
|
+
[
|
|
176
|
+
{
|
|
177
|
+
type: {
|
|
178
|
+
type: "gobject",
|
|
179
|
+
ownership: "borrowed",
|
|
180
|
+
},
|
|
181
|
+
value: this.handle,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: {
|
|
185
|
+
type: "string",
|
|
186
|
+
ownership: "borrowed",
|
|
187
|
+
},
|
|
188
|
+
value: startupId,
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
{
|
|
192
|
+
type: "undefined",
|
|
193
|
+
},
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
registerNativeClass(WaylandDisplay);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isInstantiating, setInstantiating } from "../../lifecycle.js";
|
|
2
|
+
import { NativeHandle } from "../../object.js";
|
|
3
|
+
import { call } from "../../native.js";
|
|
4
|
+
import { registerNativeClass, registerNativeObject } from "../../registry.js";
|
|
5
|
+
import * as Gdk from "../gdk/index.js";
|
|
6
|
+
|
|
7
|
+
/** The Wayland implementation of `GdkGLContext`. */
|
|
8
|
+
export class WaylandGLContext extends Gdk.GLContext {
|
|
9
|
+
static override readonly glibTypeName: string = "GdkWaylandGLContext";
|
|
10
|
+
static override readonly objectType = "gobject" as const;
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
if (!isInstantiating) {
|
|
14
|
+
setInstantiating(true);
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
super();
|
|
17
|
+
setInstantiating(false);
|
|
18
|
+
const gtype = call("libgtk-4.so.1", "gdk_wayland_gl_context_get_type", [], {
|
|
19
|
+
type: "int",
|
|
20
|
+
size: 64,
|
|
21
|
+
unsigned: true,
|
|
22
|
+
});
|
|
23
|
+
this.handle = call(
|
|
24
|
+
"libgobject-2.0.so.0",
|
|
25
|
+
"g_object_new",
|
|
26
|
+
[
|
|
27
|
+
{ type: { type: "int", size: 64, unsigned: true }, value: gtype, optional: false },
|
|
28
|
+
{ type: { type: "null" }, value: null, optional: false },
|
|
29
|
+
],
|
|
30
|
+
{ type: "gobject", ownership: "full" },
|
|
31
|
+
) as NativeHandle;
|
|
32
|
+
registerNativeObject(this);
|
|
33
|
+
} else {
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
super();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
registerNativeClass(WaylandGLContext);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isInstantiating, setInstantiating } from "../../lifecycle.js";
|
|
2
|
+
import { NativeHandle } from "../../object.js";
|
|
3
|
+
import { call } from "../../native.js";
|
|
4
|
+
import { registerNativeClass, registerNativeObject } from "../../registry.js";
|
|
5
|
+
import * as Gdk from "../gdk/index.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Wayland implementation of `GdkMonitor`.
|
|
9
|
+
*
|
|
10
|
+
* Beyond the {@link Gdk.Monitor} API, the Wayland implementation
|
|
11
|
+
* offers access to the Wayland `wl_output` object with
|
|
12
|
+
* {@link GdkWayland.WaylandMonitor.get_wl_output}.
|
|
13
|
+
*/
|
|
14
|
+
export class WaylandMonitor extends Gdk.Monitor {
|
|
15
|
+
static override readonly glibTypeName: string = "GdkWaylandMonitor";
|
|
16
|
+
static override readonly objectType = "gobject" as const;
|
|
17
|
+
|
|
18
|
+
constructor() {
|
|
19
|
+
if (!isInstantiating) {
|
|
20
|
+
setInstantiating(true);
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
super();
|
|
23
|
+
setInstantiating(false);
|
|
24
|
+
const gtype = call("libgtk-4.so.1", "gdk_wayland_monitor_get_type", [], {
|
|
25
|
+
type: "int",
|
|
26
|
+
size: 64,
|
|
27
|
+
unsigned: true,
|
|
28
|
+
});
|
|
29
|
+
this.handle = call(
|
|
30
|
+
"libgobject-2.0.so.0",
|
|
31
|
+
"g_object_new",
|
|
32
|
+
[
|
|
33
|
+
{ type: { type: "int", size: 64, unsigned: true }, value: gtype, optional: false },
|
|
34
|
+
{ type: { type: "null" }, value: null, optional: false },
|
|
35
|
+
],
|
|
36
|
+
{ type: "gobject", ownership: "full" },
|
|
37
|
+
) as NativeHandle;
|
|
38
|
+
registerNativeObject(this);
|
|
39
|
+
} else {
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
super();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
registerNativeClass(WaylandMonitor);
|