@gtkx/ffi 0.12.0 → 0.12.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/dist/generated/gtk4layershell/enums.d.ts +46 -0
- package/dist/generated/gtk4layershell/enums.js +49 -0
- package/dist/generated/gtk4layershell/functions.d.ts +99 -0
- package/dist/generated/gtk4layershell/functions.js +451 -0
- package/dist/generated/gtk4layershell/index.d.ts +2 -0
- package/dist/generated/gtk4layershell/index.js +2 -0
- package/dist/generated/javascriptcore/constants.d.ts +1 -1
- package/dist/generated/javascriptcore/constants.js +1 -1
- package/dist/generated/webkit/constants.d.ts +1 -1
- package/dist/generated/webkit/constants.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare enum Edge {
|
|
2
|
+
/** The left edge of the screen. */
|
|
3
|
+
LEFT = 0,
|
|
4
|
+
/** The right edge of the screen. */
|
|
5
|
+
RIGHT = 1,
|
|
6
|
+
/** The top edge of the screen. */
|
|
7
|
+
TOP = 2,
|
|
8
|
+
/** The bottom edge of the screen. */
|
|
9
|
+
BOTTOM = 3,
|
|
10
|
+
/**
|
|
11
|
+
* Should not be used except to get the number of entries. (NOTE: may change in
|
|
12
|
+
* future releases as more entries are added)
|
|
13
|
+
*/
|
|
14
|
+
ENTRY_NUMBER = 4
|
|
15
|
+
}
|
|
16
|
+
export declare enum KeyboardMode {
|
|
17
|
+
/** This window should not receive keyboard events. */
|
|
18
|
+
NONE = 0,
|
|
19
|
+
/** This window should have exclusive focus if it is on the top or overlay layer. */
|
|
20
|
+
EXCLUSIVE = 1,
|
|
21
|
+
/**
|
|
22
|
+
* The user should be able to focus and unfocues this window in an implementation
|
|
23
|
+
* defined way. Not supported for protocol version < 4.
|
|
24
|
+
*/
|
|
25
|
+
ON_DEMAND = 2,
|
|
26
|
+
/**
|
|
27
|
+
* Should not be used except to get the number of entries. (NOTE: may change in
|
|
28
|
+
* future releases as more entries are added)
|
|
29
|
+
*/
|
|
30
|
+
ENTRY_NUMBER = 3
|
|
31
|
+
}
|
|
32
|
+
export declare enum Layer {
|
|
33
|
+
/** The background layer. */
|
|
34
|
+
BACKGROUND = 0,
|
|
35
|
+
/** The bottom layer. */
|
|
36
|
+
BOTTOM = 1,
|
|
37
|
+
/** The top layer. */
|
|
38
|
+
TOP = 2,
|
|
39
|
+
/** The overlay layer. */
|
|
40
|
+
OVERLAY = 3,
|
|
41
|
+
/**
|
|
42
|
+
* Should not be used except to get the number of entries. (NOTE: may change in
|
|
43
|
+
* future releases as more entries are added)
|
|
44
|
+
*/
|
|
45
|
+
ENTRY_NUMBER = 4
|
|
46
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export var Edge;
|
|
2
|
+
(function (Edge) {
|
|
3
|
+
/** The left edge of the screen. */
|
|
4
|
+
Edge[Edge["LEFT"] = 0] = "LEFT";
|
|
5
|
+
/** The right edge of the screen. */
|
|
6
|
+
Edge[Edge["RIGHT"] = 1] = "RIGHT";
|
|
7
|
+
/** The top edge of the screen. */
|
|
8
|
+
Edge[Edge["TOP"] = 2] = "TOP";
|
|
9
|
+
/** The bottom edge of the screen. */
|
|
10
|
+
Edge[Edge["BOTTOM"] = 3] = "BOTTOM";
|
|
11
|
+
/**
|
|
12
|
+
* Should not be used except to get the number of entries. (NOTE: may change in
|
|
13
|
+
* future releases as more entries are added)
|
|
14
|
+
*/
|
|
15
|
+
Edge[Edge["ENTRY_NUMBER"] = 4] = "ENTRY_NUMBER";
|
|
16
|
+
})(Edge || (Edge = {}));
|
|
17
|
+
export var KeyboardMode;
|
|
18
|
+
(function (KeyboardMode) {
|
|
19
|
+
/** This window should not receive keyboard events. */
|
|
20
|
+
KeyboardMode[KeyboardMode["NONE"] = 0] = "NONE";
|
|
21
|
+
/** This window should have exclusive focus if it is on the top or overlay layer. */
|
|
22
|
+
KeyboardMode[KeyboardMode["EXCLUSIVE"] = 1] = "EXCLUSIVE";
|
|
23
|
+
/**
|
|
24
|
+
* The user should be able to focus and unfocues this window in an implementation
|
|
25
|
+
* defined way. Not supported for protocol version < 4.
|
|
26
|
+
*/
|
|
27
|
+
KeyboardMode[KeyboardMode["ON_DEMAND"] = 2] = "ON_DEMAND";
|
|
28
|
+
/**
|
|
29
|
+
* Should not be used except to get the number of entries. (NOTE: may change in
|
|
30
|
+
* future releases as more entries are added)
|
|
31
|
+
*/
|
|
32
|
+
KeyboardMode[KeyboardMode["ENTRY_NUMBER"] = 3] = "ENTRY_NUMBER";
|
|
33
|
+
})(KeyboardMode || (KeyboardMode = {}));
|
|
34
|
+
export var Layer;
|
|
35
|
+
(function (Layer) {
|
|
36
|
+
/** The background layer. */
|
|
37
|
+
Layer[Layer["BACKGROUND"] = 0] = "BACKGROUND";
|
|
38
|
+
/** The bottom layer. */
|
|
39
|
+
Layer[Layer["BOTTOM"] = 1] = "BOTTOM";
|
|
40
|
+
/** The top layer. */
|
|
41
|
+
Layer[Layer["TOP"] = 2] = "TOP";
|
|
42
|
+
/** The overlay layer. */
|
|
43
|
+
Layer[Layer["OVERLAY"] = 3] = "OVERLAY";
|
|
44
|
+
/**
|
|
45
|
+
* Should not be used except to get the number of entries. (NOTE: may change in
|
|
46
|
+
* future releases as more entries are added)
|
|
47
|
+
*/
|
|
48
|
+
Layer[Layer["ENTRY_NUMBER"] = 4] = "ENTRY_NUMBER";
|
|
49
|
+
})(Layer || (Layer = {}));
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Edge, KeyboardMode, Layer } from "./enums.js";
|
|
2
|
+
import * as Gdk from "../gdk/index.js";
|
|
3
|
+
import * as Gtk from "../gtk/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* When auto exclusive zone is enabled, exclusive zone is automatically set to the
|
|
6
|
+
* size of the `window` + relevant margin. To disable auto exclusive zone, just set the
|
|
7
|
+
* exclusive zone to 0 or any other fixed value.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored
|
|
10
|
+
* edge. This behavior is specific to gtk4-layer-shell and not part of the underlying protocol
|
|
11
|
+
*/
|
|
12
|
+
export declare const autoExclusiveZoneEnable: (window: Gtk.Window) => void;
|
|
13
|
+
export declare const autoExclusiveZoneIsEnabled: (window: Gtk.Window) => boolean;
|
|
14
|
+
export declare const getAnchor: (window: Gtk.Window, edge: Edge) => boolean;
|
|
15
|
+
export declare const getExclusiveZone: (window: Gtk.Window) => number;
|
|
16
|
+
export declare const getKeyboardMode: (window: Gtk.Window) => KeyboardMode;
|
|
17
|
+
export declare const getLayer: (window: Gtk.Window) => Layer;
|
|
18
|
+
export declare const getMajorVersion: () => number;
|
|
19
|
+
export declare const getMargin: (window: Gtk.Window, edge: Edge) => number;
|
|
20
|
+
export declare const getMicroVersion: () => number;
|
|
21
|
+
export declare const getMinorVersion: () => number;
|
|
22
|
+
/**
|
|
23
|
+
* NOTE: To get which monitor the surface is actually on, use
|
|
24
|
+
* gdk_display_get_monitor_at_window().
|
|
25
|
+
*/
|
|
26
|
+
export declare const getMonitor: (window: Gtk.Window) => Gdk.Monitor;
|
|
27
|
+
/**
|
|
28
|
+
* NOTE: this function does not return ownership of the string. Do not free the returned string.
|
|
29
|
+
* Future calls into the library may invalidate the returned string.
|
|
30
|
+
*/
|
|
31
|
+
export declare const getNamespace: (window: Gtk.Window) => string;
|
|
32
|
+
/** May block for a Wayland roundtrip the first time it's called. */
|
|
33
|
+
export declare const getProtocolVersion: () => number;
|
|
34
|
+
export declare const getZwlrLayerSurfaceV1: (window: Gtk.Window) => number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Set the `window` up to be a layer surface once it is mapped. this must be called before
|
|
37
|
+
* the `window` is realized.
|
|
38
|
+
*/
|
|
39
|
+
export declare const initForWindow: (window: Gtk.Window) => void;
|
|
40
|
+
export declare const isLayerWindow: (window: Gtk.Window) => boolean;
|
|
41
|
+
/** May block for a Wayland roundtrip the first time it's called. */
|
|
42
|
+
export declare const isSupported: () => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Set whether `window` should be anchored to `edge`.
|
|
45
|
+
* - If two perpendicular edges are anchored, the surface with be anchored to that corner
|
|
46
|
+
* - If two opposite edges are anchored, the window will be stretched across the screen in that direction
|
|
47
|
+
*
|
|
48
|
+
* Default is %FALSE for each #GtkLayerShellEdge
|
|
49
|
+
*/
|
|
50
|
+
export declare const setAnchor: (window: Gtk.Window, edge: Edge, anchorToEdge: boolean) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Has no effect unless the surface is anchored to an edge. Requests that the compositor
|
|
53
|
+
* does not place other surfaces within the given exclusive zone of the anchored edge.
|
|
54
|
+
* For example, a panel can request to not be covered by maximized windows. See
|
|
55
|
+
* wlr-layer-shell-unstable-v1.xml for details.
|
|
56
|
+
*
|
|
57
|
+
* Default is 0
|
|
58
|
+
*/
|
|
59
|
+
export declare const setExclusiveZone: (window: Gtk.Window, exclusiveZone: number) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Sets if/when `window` should receive keyboard events from the compositor, see
|
|
62
|
+
* GtkLayerShellKeyboardMode for details.
|
|
63
|
+
*
|
|
64
|
+
* Default is %GTK_LAYER_SHELL_KEYBOARD_MODE_NONE
|
|
65
|
+
*/
|
|
66
|
+
export declare const setKeyboardMode: (window: Gtk.Window, mode: KeyboardMode) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Set the "layer" on which the surface appears (controls if it is over top of or below other surfaces). The layer may
|
|
69
|
+
* be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an
|
|
70
|
+
* older version the `window` is remapped so the change can take effect.
|
|
71
|
+
*
|
|
72
|
+
* Default is %GTK_LAYER_SHELL_LAYER_TOP
|
|
73
|
+
*/
|
|
74
|
+
export declare const setLayer: (window: Gtk.Window, layer: Layer) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Set the margin for a specific `edge` of a `window`. Effects both surface's distance from
|
|
77
|
+
* the edge and its exclusive zone size (if auto exclusive zone enabled).
|
|
78
|
+
*
|
|
79
|
+
* Default is 0 for each #GtkLayerShellEdge
|
|
80
|
+
*/
|
|
81
|
+
export declare const setMargin: (window: Gtk.Window, edge: Edge, marginSize: number) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Set the output for the window to be placed on, or %NULL to let the compositor choose.
|
|
84
|
+
* If the window is currently mapped, it will get remapped so the change can take effect.
|
|
85
|
+
*
|
|
86
|
+
* Default is %NULL
|
|
87
|
+
*/
|
|
88
|
+
export declare const setMonitor: (window: Gtk.Window, monitor: Gdk.Monitor) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Set the "namespace" of the surface.
|
|
91
|
+
*
|
|
92
|
+
* No one is quite sure what this is for, but it probably should be something generic
|
|
93
|
+
* ("panel", "osk", etc). The `name_space` string is copied, and caller maintains
|
|
94
|
+
* ownership of original. If the window is currently mapped, it will get remapped so
|
|
95
|
+
* the change can take effect.
|
|
96
|
+
*
|
|
97
|
+
* Default is "gtk4-layer-shell" (which will be used if set to %NULL)
|
|
98
|
+
*/
|
|
99
|
+
export declare const setNamespace: (window: Gtk.Window, nameSpace: string) => void;
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { call } from "../../batch.js";
|
|
2
|
+
import { getNativeObject } from "../../native/object.js";
|
|
3
|
+
/**
|
|
4
|
+
* When auto exclusive zone is enabled, exclusive zone is automatically set to the
|
|
5
|
+
* size of the `window` + relevant margin. To disable auto exclusive zone, just set the
|
|
6
|
+
* exclusive zone to 0 or any other fixed value.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored
|
|
9
|
+
* edge. This behavior is specific to gtk4-layer-shell and not part of the underlying protocol
|
|
10
|
+
*/
|
|
11
|
+
export const autoExclusiveZoneEnable = (window) => {
|
|
12
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_auto_exclusive_zone_enable", [
|
|
13
|
+
{
|
|
14
|
+
type: {
|
|
15
|
+
type: "gobject",
|
|
16
|
+
ownership: "borrowed",
|
|
17
|
+
},
|
|
18
|
+
value: window.handle,
|
|
19
|
+
},
|
|
20
|
+
], {
|
|
21
|
+
type: "undefined",
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
export const autoExclusiveZoneIsEnabled = (window) => {
|
|
25
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_auto_exclusive_zone_is_enabled", [
|
|
26
|
+
{
|
|
27
|
+
type: {
|
|
28
|
+
type: "gobject",
|
|
29
|
+
ownership: "borrowed",
|
|
30
|
+
},
|
|
31
|
+
value: window.handle,
|
|
32
|
+
},
|
|
33
|
+
], {
|
|
34
|
+
type: "boolean",
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export const getAnchor = (window, edge) => {
|
|
38
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_anchor", [
|
|
39
|
+
{
|
|
40
|
+
type: {
|
|
41
|
+
type: "gobject",
|
|
42
|
+
ownership: "borrowed",
|
|
43
|
+
},
|
|
44
|
+
value: window.handle,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: {
|
|
48
|
+
type: "int",
|
|
49
|
+
size: 32,
|
|
50
|
+
unsigned: false,
|
|
51
|
+
},
|
|
52
|
+
value: edge,
|
|
53
|
+
},
|
|
54
|
+
], {
|
|
55
|
+
type: "boolean",
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
export const getExclusiveZone = (window) => {
|
|
59
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_exclusive_zone", [
|
|
60
|
+
{
|
|
61
|
+
type: {
|
|
62
|
+
type: "gobject",
|
|
63
|
+
ownership: "borrowed",
|
|
64
|
+
},
|
|
65
|
+
value: window.handle,
|
|
66
|
+
},
|
|
67
|
+
], {
|
|
68
|
+
type: "int",
|
|
69
|
+
size: 32,
|
|
70
|
+
unsigned: false,
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
export const getKeyboardMode = (window) => {
|
|
74
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_keyboard_mode", [
|
|
75
|
+
{
|
|
76
|
+
type: {
|
|
77
|
+
type: "gobject",
|
|
78
|
+
ownership: "borrowed",
|
|
79
|
+
},
|
|
80
|
+
value: window.handle,
|
|
81
|
+
},
|
|
82
|
+
], {
|
|
83
|
+
type: "int",
|
|
84
|
+
size: 32,
|
|
85
|
+
unsigned: false,
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
export const getLayer = (window) => {
|
|
89
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_layer", [
|
|
90
|
+
{
|
|
91
|
+
type: {
|
|
92
|
+
type: "gobject",
|
|
93
|
+
ownership: "borrowed",
|
|
94
|
+
},
|
|
95
|
+
value: window.handle,
|
|
96
|
+
},
|
|
97
|
+
], {
|
|
98
|
+
type: "int",
|
|
99
|
+
size: 32,
|
|
100
|
+
unsigned: false,
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
export const getMajorVersion = () => {
|
|
104
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_major_version", [], {
|
|
105
|
+
type: "int",
|
|
106
|
+
size: 32,
|
|
107
|
+
unsigned: true,
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
export const getMargin = (window, edge) => {
|
|
111
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_margin", [
|
|
112
|
+
{
|
|
113
|
+
type: {
|
|
114
|
+
type: "gobject",
|
|
115
|
+
ownership: "borrowed",
|
|
116
|
+
},
|
|
117
|
+
value: window.handle,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: {
|
|
121
|
+
type: "int",
|
|
122
|
+
size: 32,
|
|
123
|
+
unsigned: false,
|
|
124
|
+
},
|
|
125
|
+
value: edge,
|
|
126
|
+
},
|
|
127
|
+
], {
|
|
128
|
+
type: "int",
|
|
129
|
+
size: 32,
|
|
130
|
+
unsigned: false,
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
export const getMicroVersion = () => {
|
|
134
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_micro_version", [], {
|
|
135
|
+
type: "int",
|
|
136
|
+
size: 32,
|
|
137
|
+
unsigned: true,
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
export const getMinorVersion = () => {
|
|
141
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_minor_version", [], {
|
|
142
|
+
type: "int",
|
|
143
|
+
size: 32,
|
|
144
|
+
unsigned: true,
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* NOTE: To get which monitor the surface is actually on, use
|
|
149
|
+
* gdk_display_get_monitor_at_window().
|
|
150
|
+
*/
|
|
151
|
+
export const getMonitor = (window) => {
|
|
152
|
+
const ptr = call("libgtk4-layer-shell.so.0", "gtk_layer_get_monitor", [
|
|
153
|
+
{
|
|
154
|
+
type: {
|
|
155
|
+
type: "gobject",
|
|
156
|
+
ownership: "borrowed",
|
|
157
|
+
},
|
|
158
|
+
value: window.handle,
|
|
159
|
+
},
|
|
160
|
+
], {
|
|
161
|
+
type: "gobject",
|
|
162
|
+
ownership: "borrowed",
|
|
163
|
+
});
|
|
164
|
+
return getNativeObject(ptr);
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* NOTE: this function does not return ownership of the string. Do not free the returned string.
|
|
168
|
+
* Future calls into the library may invalidate the returned string.
|
|
169
|
+
*/
|
|
170
|
+
export const getNamespace = (window) => {
|
|
171
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_namespace", [
|
|
172
|
+
{
|
|
173
|
+
type: {
|
|
174
|
+
type: "gobject",
|
|
175
|
+
ownership: "borrowed",
|
|
176
|
+
},
|
|
177
|
+
value: window.handle,
|
|
178
|
+
},
|
|
179
|
+
], {
|
|
180
|
+
type: "string",
|
|
181
|
+
ownership: "borrowed",
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
/** May block for a Wayland roundtrip the first time it's called. */
|
|
185
|
+
export const getProtocolVersion = () => {
|
|
186
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_protocol_version", [], {
|
|
187
|
+
type: "int",
|
|
188
|
+
size: 32,
|
|
189
|
+
unsigned: true,
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
export const getZwlrLayerSurfaceV1 = (window) => {
|
|
193
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_get_zwlr_layer_surface_v1", [
|
|
194
|
+
{
|
|
195
|
+
type: {
|
|
196
|
+
type: "gobject",
|
|
197
|
+
ownership: "borrowed",
|
|
198
|
+
},
|
|
199
|
+
value: window.handle,
|
|
200
|
+
},
|
|
201
|
+
], {
|
|
202
|
+
type: "int",
|
|
203
|
+
size: 64,
|
|
204
|
+
unsigned: true,
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Set the `window` up to be a layer surface once it is mapped. this must be called before
|
|
209
|
+
* the `window` is realized.
|
|
210
|
+
*/
|
|
211
|
+
export const initForWindow = (window) => {
|
|
212
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_init_for_window", [
|
|
213
|
+
{
|
|
214
|
+
type: {
|
|
215
|
+
type: "gobject",
|
|
216
|
+
ownership: "borrowed",
|
|
217
|
+
},
|
|
218
|
+
value: window.handle,
|
|
219
|
+
},
|
|
220
|
+
], {
|
|
221
|
+
type: "undefined",
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
export const isLayerWindow = (window) => {
|
|
225
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_is_layer_window", [
|
|
226
|
+
{
|
|
227
|
+
type: {
|
|
228
|
+
type: "gobject",
|
|
229
|
+
ownership: "borrowed",
|
|
230
|
+
},
|
|
231
|
+
value: window.handle,
|
|
232
|
+
},
|
|
233
|
+
], {
|
|
234
|
+
type: "boolean",
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
/** May block for a Wayland roundtrip the first time it's called. */
|
|
238
|
+
export const isSupported = () => {
|
|
239
|
+
return call("libgtk4-layer-shell.so.0", "gtk_layer_is_supported", [], {
|
|
240
|
+
type: "boolean",
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Set whether `window` should be anchored to `edge`.
|
|
245
|
+
* - If two perpendicular edges are anchored, the surface with be anchored to that corner
|
|
246
|
+
* - If two opposite edges are anchored, the window will be stretched across the screen in that direction
|
|
247
|
+
*
|
|
248
|
+
* Default is %FALSE for each #GtkLayerShellEdge
|
|
249
|
+
*/
|
|
250
|
+
export const setAnchor = (window, edge, anchorToEdge) => {
|
|
251
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_set_anchor", [
|
|
252
|
+
{
|
|
253
|
+
type: {
|
|
254
|
+
type: "gobject",
|
|
255
|
+
ownership: "borrowed",
|
|
256
|
+
},
|
|
257
|
+
value: window.handle,
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
type: {
|
|
261
|
+
type: "int",
|
|
262
|
+
size: 32,
|
|
263
|
+
unsigned: false,
|
|
264
|
+
},
|
|
265
|
+
value: edge,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: {
|
|
269
|
+
type: "boolean",
|
|
270
|
+
},
|
|
271
|
+
value: anchorToEdge,
|
|
272
|
+
},
|
|
273
|
+
], {
|
|
274
|
+
type: "undefined",
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Has no effect unless the surface is anchored to an edge. Requests that the compositor
|
|
279
|
+
* does not place other surfaces within the given exclusive zone of the anchored edge.
|
|
280
|
+
* For example, a panel can request to not be covered by maximized windows. See
|
|
281
|
+
* wlr-layer-shell-unstable-v1.xml for details.
|
|
282
|
+
*
|
|
283
|
+
* Default is 0
|
|
284
|
+
*/
|
|
285
|
+
export const setExclusiveZone = (window, exclusiveZone) => {
|
|
286
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_set_exclusive_zone", [
|
|
287
|
+
{
|
|
288
|
+
type: {
|
|
289
|
+
type: "gobject",
|
|
290
|
+
ownership: "borrowed",
|
|
291
|
+
},
|
|
292
|
+
value: window.handle,
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: {
|
|
296
|
+
type: "int",
|
|
297
|
+
size: 32,
|
|
298
|
+
unsigned: false,
|
|
299
|
+
},
|
|
300
|
+
value: exclusiveZone,
|
|
301
|
+
},
|
|
302
|
+
], {
|
|
303
|
+
type: "undefined",
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Sets if/when `window` should receive keyboard events from the compositor, see
|
|
308
|
+
* GtkLayerShellKeyboardMode for details.
|
|
309
|
+
*
|
|
310
|
+
* Default is %GTK_LAYER_SHELL_KEYBOARD_MODE_NONE
|
|
311
|
+
*/
|
|
312
|
+
export const setKeyboardMode = (window, mode) => {
|
|
313
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_set_keyboard_mode", [
|
|
314
|
+
{
|
|
315
|
+
type: {
|
|
316
|
+
type: "gobject",
|
|
317
|
+
ownership: "borrowed",
|
|
318
|
+
},
|
|
319
|
+
value: window.handle,
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
type: {
|
|
323
|
+
type: "int",
|
|
324
|
+
size: 32,
|
|
325
|
+
unsigned: false,
|
|
326
|
+
},
|
|
327
|
+
value: mode,
|
|
328
|
+
},
|
|
329
|
+
], {
|
|
330
|
+
type: "undefined",
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* Set the "layer" on which the surface appears (controls if it is over top of or below other surfaces). The layer may
|
|
335
|
+
* be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an
|
|
336
|
+
* older version the `window` is remapped so the change can take effect.
|
|
337
|
+
*
|
|
338
|
+
* Default is %GTK_LAYER_SHELL_LAYER_TOP
|
|
339
|
+
*/
|
|
340
|
+
export const setLayer = (window, layer) => {
|
|
341
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_set_layer", [
|
|
342
|
+
{
|
|
343
|
+
type: {
|
|
344
|
+
type: "gobject",
|
|
345
|
+
ownership: "borrowed",
|
|
346
|
+
},
|
|
347
|
+
value: window.handle,
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
type: {
|
|
351
|
+
type: "int",
|
|
352
|
+
size: 32,
|
|
353
|
+
unsigned: false,
|
|
354
|
+
},
|
|
355
|
+
value: layer,
|
|
356
|
+
},
|
|
357
|
+
], {
|
|
358
|
+
type: "undefined",
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* Set the margin for a specific `edge` of a `window`. Effects both surface's distance from
|
|
363
|
+
* the edge and its exclusive zone size (if auto exclusive zone enabled).
|
|
364
|
+
*
|
|
365
|
+
* Default is 0 for each #GtkLayerShellEdge
|
|
366
|
+
*/
|
|
367
|
+
export const setMargin = (window, edge, marginSize) => {
|
|
368
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_set_margin", [
|
|
369
|
+
{
|
|
370
|
+
type: {
|
|
371
|
+
type: "gobject",
|
|
372
|
+
ownership: "borrowed",
|
|
373
|
+
},
|
|
374
|
+
value: window.handle,
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
type: {
|
|
378
|
+
type: "int",
|
|
379
|
+
size: 32,
|
|
380
|
+
unsigned: false,
|
|
381
|
+
},
|
|
382
|
+
value: edge,
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
type: {
|
|
386
|
+
type: "int",
|
|
387
|
+
size: 32,
|
|
388
|
+
unsigned: false,
|
|
389
|
+
},
|
|
390
|
+
value: marginSize,
|
|
391
|
+
},
|
|
392
|
+
], {
|
|
393
|
+
type: "undefined",
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Set the output for the window to be placed on, or %NULL to let the compositor choose.
|
|
398
|
+
* If the window is currently mapped, it will get remapped so the change can take effect.
|
|
399
|
+
*
|
|
400
|
+
* Default is %NULL
|
|
401
|
+
*/
|
|
402
|
+
export const setMonitor = (window, monitor) => {
|
|
403
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_set_monitor", [
|
|
404
|
+
{
|
|
405
|
+
type: {
|
|
406
|
+
type: "gobject",
|
|
407
|
+
ownership: "borrowed",
|
|
408
|
+
},
|
|
409
|
+
value: window.handle,
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
type: {
|
|
413
|
+
type: "gobject",
|
|
414
|
+
ownership: "borrowed",
|
|
415
|
+
},
|
|
416
|
+
value: monitor.handle,
|
|
417
|
+
},
|
|
418
|
+
], {
|
|
419
|
+
type: "undefined",
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Set the "namespace" of the surface.
|
|
424
|
+
*
|
|
425
|
+
* No one is quite sure what this is for, but it probably should be something generic
|
|
426
|
+
* ("panel", "osk", etc). The `name_space` string is copied, and caller maintains
|
|
427
|
+
* ownership of original. If the window is currently mapped, it will get remapped so
|
|
428
|
+
* the change can take effect.
|
|
429
|
+
*
|
|
430
|
+
* Default is "gtk4-layer-shell" (which will be used if set to %NULL)
|
|
431
|
+
*/
|
|
432
|
+
export const setNamespace = (window, nameSpace) => {
|
|
433
|
+
call("libgtk4-layer-shell.so.0", "gtk_layer_set_namespace", [
|
|
434
|
+
{
|
|
435
|
+
type: {
|
|
436
|
+
type: "gobject",
|
|
437
|
+
ownership: "borrowed",
|
|
438
|
+
},
|
|
439
|
+
value: window.handle,
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
type: {
|
|
443
|
+
type: "string",
|
|
444
|
+
ownership: "borrowed",
|
|
445
|
+
},
|
|
446
|
+
value: nameSpace,
|
|
447
|
+
},
|
|
448
|
+
], {
|
|
449
|
+
type: "undefined",
|
|
450
|
+
});
|
|
451
|
+
};
|
|
@@ -9,7 +9,7 @@ export declare const MAJOR_VERSION = 2;
|
|
|
9
9
|
* application compile time, rather than from the library linked
|
|
10
10
|
* against at application run time.
|
|
11
11
|
*/
|
|
12
|
-
export declare const MICRO_VERSION =
|
|
12
|
+
export declare const MICRO_VERSION = 4;
|
|
13
13
|
/**
|
|
14
14
|
* Like jsc_get_minor_version(), but from the headers used at
|
|
15
15
|
* application compile time, rather than from the library linked
|
|
@@ -9,7 +9,7 @@ export const MAJOR_VERSION = 2;
|
|
|
9
9
|
* application compile time, rather than from the library linked
|
|
10
10
|
* against at application run time.
|
|
11
11
|
*/
|
|
12
|
-
export const MICRO_VERSION =
|
|
12
|
+
export const MICRO_VERSION = 4;
|
|
13
13
|
/**
|
|
14
14
|
* Like jsc_get_minor_version(), but from the headers used at
|
|
15
15
|
* application compile time, rather than from the library linked
|
|
@@ -83,7 +83,7 @@ export declare const MAJOR_VERSION = 2;
|
|
|
83
83
|
* application compile time, rather than from the library linked
|
|
84
84
|
* against at application run time.
|
|
85
85
|
*/
|
|
86
|
-
export declare const MICRO_VERSION =
|
|
86
|
+
export declare const MICRO_VERSION = 4;
|
|
87
87
|
/**
|
|
88
88
|
* Like webkit_get_minor_version(), but from the headers used at
|
|
89
89
|
* application compile time, rather than from the library linked
|
|
@@ -83,7 +83,7 @@ export const MAJOR_VERSION = 2;
|
|
|
83
83
|
* application compile time, rather than from the library linked
|
|
84
84
|
* against at application run time.
|
|
85
85
|
*/
|
|
86
|
-
export const MICRO_VERSION =
|
|
86
|
+
export const MICRO_VERSION = 4;
|
|
87
87
|
/**
|
|
88
88
|
* Like webkit_get_minor_version(), but from the headers used at
|
|
89
89
|
* application compile time, rather than from the library linked
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/ffi",
|
|
3
|
-
"version": "0.12.
|
|
4
|
-
"description": "Generated TypeScript FFI bindings for
|
|
3
|
+
"version": "0.12.1",
|
|
4
|
+
"description": "Generated TypeScript FFI bindings for GTKX",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
7
7
|
"gtk",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"dist"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@gtkx/native": "0.12.
|
|
50
|
+
"@gtkx/native": "0.12.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@gtkx/vitest": "0.12.
|
|
53
|
+
"@gtkx/vitest": "0.12.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsc -b && cp ../../README.md .",
|