@geastack/apple 0.2.32 → 0.2.34

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.
@@ -0,0 +1,46 @@
1
+ #pragma once
2
+
3
+ #ifdef __OBJC__
4
+ #import <Cocoa/Cocoa.h>
5
+
6
+ @class GeaContentView;
7
+ @class GeaSplitShell;
8
+
9
+ // `<window>` on macOS: every `<window>` element mounted in the tree is shown as
10
+ // its own titled, resizable NSWindow in this process, its subtree laid out at
11
+ // that window's content size and rendered into it. See core index.d.ts
12
+ // `NativeWindowProps` for the element's contract.
13
+ //
14
+ // The app delegate drives it from its frame:
15
+ // [GeaWindows reconcile] opens windows for new elements, closes the ones
16
+ // whose element left the tree, applies attributes.
17
+ // [GeaWindows hasWindows] while true, the delegate lays out and syncs every
18
+ // root (its own and each window's) through
19
+ // -layoutAndSyncMainView:..., which renders them in
20
+ // one MacosRenderer::syncRoots pass.
21
+ @interface GeaWindows : NSObject
22
+ + (void)reconcile;
23
+ + (BOOL)hasWindows;
24
+ // A window is on screen (the menu bar timer and the main window's display link
25
+ // then leave frames to its display link).
26
+ + (BOOL)anyVisible;
27
+ + (void)layoutAndSyncMainView:(NSView *)mainView mainShell:(GeaSplitShell *)mainShell mainRoot:(int)mainRoot;
28
+ // Bring every window forward (a Dock icon click).
29
+ + (void)showAll;
30
+ // The replay harness: the window whose title is `title` (or whose 0-based
31
+ // index in opening order is `title`'s integer value).
32
+ + (NSWindow *)windowNamed:(NSString *)title;
33
+ // The replay harness: what a click on `node` in `window` does to the window
34
+ // itself -- a `data-window-action` close/minimize/zoom (YES when one ran) --
35
+ // and the `data-window-drag` element a mouse-down there would drag by (-1).
36
+ + (BOOL)performWindowActionForNode:(int)node window:(NSWindow *)window;
37
+ + (int)windowDragElementForNode:(int)node window:(NSWindow *)window;
38
+ // That window's `<window>` node, or -1.
39
+ + (int)nodeForWindow:(NSWindow *)window;
40
+ // Every open window, for the replay log: title, windowNumber, size, visible, key, shell, chrome.
41
+ + (NSArray<NSDictionary *> *)describe;
42
+ @end
43
+ #endif
44
+
45
+ // el.focus() on a `<window>` (macos_renderer.mm requestFocusNode).
46
+ extern "C" bool gea_macos_focus_hosted_window(int nodeId);