@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.
Files changed (77) hide show
  1. package/dist/generated/adw/constants.d.ts +2 -2
  2. package/dist/generated/adw/constants.js +2 -2
  3. package/dist/generated/gdkwayland/index.d.ts +9 -0
  4. package/dist/generated/gdkwayland/index.d.ts.map +1 -0
  5. package/dist/generated/gdkwayland/index.js +9 -0
  6. package/dist/generated/gdkwayland/index.js.map +1 -0
  7. package/dist/generated/gdkwayland/wayland-device.d.ts +29 -0
  8. package/dist/generated/gdkwayland/wayland-device.d.ts.map +1 -0
  9. package/dist/generated/gdkwayland/wayland-device.js +81 -0
  10. package/dist/generated/gdkwayland/wayland-device.js.map +1 -0
  11. package/dist/generated/gdkwayland/wayland-display.d.ts +44 -0
  12. package/dist/generated/gdkwayland/wayland-display.d.ts.map +1 -0
  13. package/dist/generated/gdkwayland/wayland-display.js +161 -0
  14. package/dist/generated/gdkwayland/wayland-display.js.map +1 -0
  15. package/dist/generated/gdkwayland/wayland-gl-context.d.ts +8 -0
  16. package/dist/generated/gdkwayland/wayland-gl-context.d.ts.map +1 -0
  17. package/dist/generated/gdkwayland/wayland-gl-context.js +33 -0
  18. package/dist/generated/gdkwayland/wayland-gl-context.js.map +1 -0
  19. package/dist/generated/gdkwayland/wayland-monitor.d.ts +14 -0
  20. package/dist/generated/gdkwayland/wayland-monitor.d.ts.map +1 -0
  21. package/dist/generated/gdkwayland/wayland-monitor.js +39 -0
  22. package/dist/generated/gdkwayland/wayland-monitor.js.map +1 -0
  23. package/dist/generated/gdkwayland/wayland-popup.d.ts +49 -0
  24. package/dist/generated/gdkwayland/wayland-popup.d.ts.map +1 -0
  25. package/dist/generated/gdkwayland/wayland-popup.js +199 -0
  26. package/dist/generated/gdkwayland/wayland-popup.js.map +1 -0
  27. package/dist/generated/gdkwayland/wayland-seat.d.ts +14 -0
  28. package/dist/generated/gdkwayland/wayland-seat.d.ts.map +1 -0
  29. package/dist/generated/gdkwayland/wayland-seat.js +39 -0
  30. package/dist/generated/gdkwayland/wayland-seat.js.map +1 -0
  31. package/dist/generated/gdkwayland/wayland-surface.d.ts +16 -0
  32. package/dist/generated/gdkwayland/wayland-surface.d.ts.map +1 -0
  33. package/dist/generated/gdkwayland/wayland-surface.js +53 -0
  34. package/dist/generated/gdkwayland/wayland-surface.js.map +1 -0
  35. package/dist/generated/gdkwayland/wayland-toplevel.d.ts +252 -0
  36. package/dist/generated/gdkwayland/wayland-toplevel.d.ts.map +1 -0
  37. package/dist/generated/gdkwayland/wayland-toplevel.js +1022 -0
  38. package/dist/generated/gdkwayland/wayland-toplevel.js.map +1 -0
  39. package/dist/generated/gst/constants.d.ts +1 -1
  40. package/dist/generated/gst/constants.d.ts.map +1 -1
  41. package/dist/generated/gst/constants.js +1 -1
  42. package/dist/generated/gst/constants.js.map +1 -1
  43. package/dist/generated/gtk4layershell/functions.d.ts +18 -7
  44. package/dist/generated/gtk4layershell/functions.d.ts.map +1 -1
  45. package/dist/generated/gtk4layershell/functions.js +50 -5
  46. package/dist/generated/gtk4layershell/functions.js.map +1 -1
  47. package/dist/generated/gtk4sessionlock/functions.d.ts +3 -0
  48. package/dist/generated/gtk4sessionlock/functions.d.ts.map +1 -0
  49. package/dist/generated/gtk4sessionlock/functions.js +8 -0
  50. package/dist/generated/gtk4sessionlock/functions.js.map +1 -0
  51. package/dist/generated/gtk4sessionlock/index.d.ts +3 -0
  52. package/dist/generated/gtk4sessionlock/index.d.ts.map +1 -0
  53. package/dist/generated/gtk4sessionlock/index.js +3 -0
  54. package/dist/generated/gtk4sessionlock/index.js.map +1 -0
  55. package/dist/generated/gtk4sessionlock/instance.d.ts +36 -0
  56. package/dist/generated/gtk4sessionlock/instance.d.ts.map +1 -0
  57. package/dist/generated/gtk4sessionlock/instance.js +215 -0
  58. package/dist/generated/gtk4sessionlock/instance.js.map +1 -0
  59. package/dist/generated/vte/constants.d.ts +1 -1
  60. package/dist/generated/vte/constants.js +1 -1
  61. package/package.json +3 -3
  62. package/src/generated/adw/constants.ts +2 -2
  63. package/src/generated/gdkwayland/index.ts +8 -0
  64. package/src/generated/gdkwayland/wayland-device.ts +99 -0
  65. package/src/generated/gdkwayland/wayland-display.ts +197 -0
  66. package/src/generated/gdkwayland/wayland-gl-context.ts +39 -0
  67. package/src/generated/gdkwayland/wayland-monitor.ts +45 -0
  68. package/src/generated/gdkwayland/wayland-popup.ts +247 -0
  69. package/src/generated/gdkwayland/wayland-seat.ts +45 -0
  70. package/src/generated/gdkwayland/wayland-surface.ts +65 -0
  71. package/src/generated/gdkwayland/wayland-toplevel.ts +1260 -0
  72. package/src/generated/gst/constants.ts +1 -1
  73. package/src/generated/gtk4layershell/functions.ts +62 -8
  74. package/src/generated/gtk4sessionlock/functions.ts +8 -0
  75. package/src/generated/gtk4sessionlock/index.ts +2 -0
  76. package/src/generated/gtk4sessionlock/instance.ts +271 -0
  77. package/src/generated/vte/constants.ts +1 -1
@@ -0,0 +1,247 @@
1
+ import { isInstantiating, setInstantiating } from "../../lifecycle.js";
2
+ import { NativeHandle } from "../../object.js";
3
+ import { call } from "../../native.js";
4
+ import { getNativeObject, registerNativeClass, registerNativeObject } from "../../registry.js";
5
+ import { WaylandSurface } from "./wayland-surface.js";
6
+ import * as Gdk from "../gdk/index.js";
7
+
8
+ /** The Wayland implementation of `GdkPopup`. */
9
+ export class WaylandPopup extends WaylandSurface {
10
+ static override readonly glibTypeName: string = "GdkWaylandPopup";
11
+ static override readonly objectType = "gobject" as const;
12
+
13
+ constructor() {
14
+ if (!isInstantiating) {
15
+ setInstantiating(true);
16
+ // @ts-ignore
17
+ super();
18
+ setInstantiating(false);
19
+ const gtype = call("libgtk-4.so.1", "gdk_wayland_popup_get_type", [], {
20
+ type: "int",
21
+ size: 64,
22
+ unsigned: true,
23
+ });
24
+ this.handle = call(
25
+ "libgobject-2.0.so.0",
26
+ "g_object_new",
27
+ [
28
+ { type: { type: "int", size: 64, unsigned: true }, value: gtype, optional: false },
29
+ { type: { type: "null" }, value: null, optional: false },
30
+ ],
31
+ { type: "gobject", ownership: "full" },
32
+ ) as NativeHandle;
33
+ registerNativeObject(this);
34
+ } else {
35
+ // @ts-ignore
36
+ super();
37
+ }
38
+ }
39
+
40
+ /** Returns whether this popup is set to hide on outside clicks. */
41
+ getAutohide(): boolean {
42
+ return call(
43
+ "libgtk-4.so.1",
44
+ "gdk_popup_get_autohide",
45
+ [
46
+ {
47
+ type: {
48
+ type: "gobject",
49
+ ownership: "borrowed",
50
+ },
51
+ value: this.handle,
52
+ },
53
+ ],
54
+ {
55
+ type: "boolean",
56
+ },
57
+ ) as boolean;
58
+ }
59
+
60
+ /** Returns the parent surface of a popup. */
61
+ getParent(): Gdk.Surface | null {
62
+ const ptr = call(
63
+ "libgtk-4.so.1",
64
+ "gdk_popup_get_parent",
65
+ [
66
+ {
67
+ type: {
68
+ type: "gobject",
69
+ ownership: "borrowed",
70
+ },
71
+ value: this.handle,
72
+ },
73
+ ],
74
+ {
75
+ type: "gobject",
76
+ ownership: "borrowed",
77
+ },
78
+ );
79
+ if (ptr === null) return null;
80
+ return getNativeObject(ptr as NativeHandle) as Gdk.Surface;
81
+ }
82
+
83
+ /** Obtains the position of the popup relative to its parent. */
84
+ getPositionX(): number {
85
+ return call(
86
+ "libgtk-4.so.1",
87
+ "gdk_popup_get_position_x",
88
+ [
89
+ {
90
+ type: {
91
+ type: "gobject",
92
+ ownership: "borrowed",
93
+ },
94
+ value: this.handle,
95
+ },
96
+ ],
97
+ {
98
+ type: "int",
99
+ size: 32,
100
+ unsigned: false,
101
+ },
102
+ ) as number;
103
+ }
104
+
105
+ /** Obtains the position of the popup relative to its parent. */
106
+ getPositionY(): number {
107
+ return call(
108
+ "libgtk-4.so.1",
109
+ "gdk_popup_get_position_y",
110
+ [
111
+ {
112
+ type: {
113
+ type: "gobject",
114
+ ownership: "borrowed",
115
+ },
116
+ value: this.handle,
117
+ },
118
+ ],
119
+ {
120
+ type: "int",
121
+ size: 32,
122
+ unsigned: false,
123
+ },
124
+ ) as number;
125
+ }
126
+
127
+ /**
128
+ * Gets the current popup rectangle anchor.
129
+ *
130
+ * The value returned may change after calling {@link Gdk.Popup.present},
131
+ * or after the {@link Gdk.Surface.:layout} signal is emitted.
132
+ */
133
+ getRectAnchor(): Gdk.Gravity {
134
+ return call(
135
+ "libgtk-4.so.1",
136
+ "gdk_popup_get_rect_anchor",
137
+ [
138
+ {
139
+ type: {
140
+ type: "gobject",
141
+ ownership: "borrowed",
142
+ },
143
+ value: this.handle,
144
+ },
145
+ ],
146
+ {
147
+ type: "int",
148
+ size: 32,
149
+ unsigned: false,
150
+ library: "libgtk-4.so.1",
151
+ getTypeFn: "gdk_gravity_get_type",
152
+ },
153
+ ) as Gdk.Gravity;
154
+ }
155
+
156
+ /**
157
+ * Gets the current popup surface anchor.
158
+ *
159
+ * The value returned may change after calling {@link Gdk.Popup.present},
160
+ * or after the {@link Gdk.Surface.:layout} signal is emitted.
161
+ */
162
+ getSurfaceAnchor(): Gdk.Gravity {
163
+ return call(
164
+ "libgtk-4.so.1",
165
+ "gdk_popup_get_surface_anchor",
166
+ [
167
+ {
168
+ type: {
169
+ type: "gobject",
170
+ ownership: "borrowed",
171
+ },
172
+ value: this.handle,
173
+ },
174
+ ],
175
+ {
176
+ type: "int",
177
+ size: 32,
178
+ unsigned: false,
179
+ library: "libgtk-4.so.1",
180
+ getTypeFn: "gdk_gravity_get_type",
181
+ },
182
+ ) as Gdk.Gravity;
183
+ }
184
+
185
+ /**
186
+ * Present `popup` after having processed the `GdkPopupLayout` rules.
187
+ *
188
+ * If the popup was previously not showing, it will be shown,
189
+ * otherwise it will change position according to `layout`.
190
+ *
191
+ * After calling this function, the result should be handled in response
192
+ * to the {@link Gdk.Surface.:layout} signal being emitted. The resulting
193
+ * popup position can be queried using {@link Gdk.Popup.get_position_x},
194
+ * {@link Gdk.Popup.get_position_y}, and the resulting size will be sent as
195
+ * parameters in the layout signal. Use {@link Gdk.Popup.get_rect_anchor}
196
+ * and {@link Gdk.Popup.get_surface_anchor} to get the resulting anchors.
197
+ *
198
+ * Presenting may fail, for example if the `popup` is set to autohide
199
+ * and is immediately hidden upon being presented. If presenting failed,
200
+ * the {@link Gdk.Surface.:layout} signal will not me emitted.
201
+ */
202
+ present(width: number, height: number, layout: Gdk.PopupLayout): boolean {
203
+ return call(
204
+ "libgtk-4.so.1",
205
+ "gdk_popup_present",
206
+ [
207
+ {
208
+ type: {
209
+ type: "gobject",
210
+ ownership: "borrowed",
211
+ },
212
+ value: this.handle,
213
+ },
214
+ {
215
+ type: {
216
+ type: "int",
217
+ size: 32,
218
+ unsigned: false,
219
+ },
220
+ value: width,
221
+ },
222
+ {
223
+ type: {
224
+ type: "int",
225
+ size: 32,
226
+ unsigned: false,
227
+ },
228
+ value: height,
229
+ },
230
+ {
231
+ type: {
232
+ type: "boxed",
233
+ ownership: "borrowed",
234
+ innerType: "GdkPopupLayout",
235
+ library: "libgtk-4.so.1",
236
+ getTypeFn: "gdk_popup_layout_get_type",
237
+ },
238
+ value: layout.handle,
239
+ },
240
+ ],
241
+ {
242
+ type: "boolean",
243
+ },
244
+ ) as boolean;
245
+ }
246
+ }
247
+ registerNativeClass(WaylandPopup);
@@ -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 `GdkSeat`.
9
+ *
10
+ * Beyond the regular {@link Gdk.Seat} API, the Wayland implementation
11
+ * provides access to the Wayland `wl_seat` object with
12
+ * {@link GdkWayland.WaylandSeat.get_wl_seat}.
13
+ */
14
+ export class WaylandSeat extends Gdk.Seat {
15
+ static override readonly glibTypeName: string = "GdkWaylandSeat";
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_seat_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(WaylandSeat);
@@ -0,0 +1,65 @@
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 `GdkSurface`.
9
+ *
10
+ * Beyond the {@link Gdk.Surface} API, the Wayland implementation offers
11
+ * access to the Wayland `wl_surface` object with
12
+ * {@link GdkWayland.WaylandSurface.get_wl_surface}.
13
+ */
14
+ export class WaylandSurface extends Gdk.Surface {
15
+ static override readonly glibTypeName: string = "GdkWaylandSurface";
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_surface_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
+ /** Forces next commit. */
46
+ forceNextCommit() {
47
+ call(
48
+ "libgtk-4.so.1",
49
+ "gdk_wayland_surface_force_next_commit",
50
+ [
51
+ {
52
+ type: {
53
+ type: "gobject",
54
+ ownership: "borrowed",
55
+ },
56
+ value: this.handle,
57
+ },
58
+ ],
59
+ {
60
+ type: "undefined",
61
+ },
62
+ );
63
+ }
64
+ }
65
+ registerNativeClass(WaylandSurface);