electrobun 0.3.1-beta.0 → 0.4.0-beta.0
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.
|
@@ -69,13 +69,13 @@ export const native = (() => {
|
|
|
69
69
|
args: [
|
|
70
70
|
FFIType.u32, // windowId
|
|
71
71
|
FFIType.f64, FFIType.f64, // x, y
|
|
72
|
-
FFIType.f64, FFIType.f64, // width, height
|
|
73
|
-
FFIType.u32, // styleMask
|
|
72
|
+
FFIType.f64, FFIType.f64, // width, height
|
|
73
|
+
FFIType.u32, // styleMask
|
|
74
74
|
FFIType.cstring, // titleBarStyle
|
|
75
75
|
FFIType.function, // closeHandler
|
|
76
76
|
FFIType.function, // moveHandler
|
|
77
|
-
FFIType.function // resizeHandler
|
|
78
|
-
|
|
77
|
+
FFIType.function, // resizeHandler
|
|
78
|
+
FFIType.function // focusHandler
|
|
79
79
|
],
|
|
80
80
|
returns: FFIType.ptr
|
|
81
81
|
},
|
|
@@ -388,16 +388,17 @@ export const ffi = {
|
|
|
388
388
|
)
|
|
389
389
|
|
|
390
390
|
const windowPtr = native.symbols.createWindowWithFrameAndStyleFromWorker(
|
|
391
|
-
id,
|
|
391
|
+
id,
|
|
392
392
|
// frame
|
|
393
|
-
x, y, width, height,
|
|
393
|
+
x, y, width, height,
|
|
394
394
|
styleMask,
|
|
395
395
|
// style
|
|
396
396
|
toCString(titleBarStyle),
|
|
397
397
|
// callbacks
|
|
398
398
|
windowCloseCallback,
|
|
399
399
|
windowMoveCallback,
|
|
400
|
-
windowResizeCallback,
|
|
400
|
+
windowResizeCallback,
|
|
401
|
+
windowFocusCallback,
|
|
401
402
|
);
|
|
402
403
|
|
|
403
404
|
|
|
@@ -930,6 +931,26 @@ const windowResizeCallback = new JSCallback(
|
|
|
930
931
|
}
|
|
931
932
|
);
|
|
932
933
|
|
|
934
|
+
const windowFocusCallback = new JSCallback(
|
|
935
|
+
(id) => {
|
|
936
|
+
const handler = electrobunEventEmitter.events.window.focus;
|
|
937
|
+
const event = handler({
|
|
938
|
+
id,
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
let result;
|
|
942
|
+
// global event
|
|
943
|
+
result = electrobunEventEmitter.emitEvent(event);
|
|
944
|
+
|
|
945
|
+
result = electrobunEventEmitter.emitEvent(event, id);
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
args: ["u32"],
|
|
949
|
+
returns: "void",
|
|
950
|
+
threadsafe: true,
|
|
951
|
+
}
|
|
952
|
+
);
|
|
953
|
+
|
|
933
954
|
const getMimeType = new JSCallback((filePath) => {
|
|
934
955
|
const _filePath = new CString(filePath).toString();
|
|
935
956
|
const mimeType = Bun.file(_filePath).type;// || "application/octet-stream";
|
package/package.json
CHANGED