Package limn.backend.spi
Interface BackendPeer
- All Superinterfaces:
AutoCloseable,Backend
- All Known Implementing Classes:
HeadlessBackend,LwjglBackend
What the toolkit asks of a backend below the application's view of it: the modal stack, and
windows it can reach as peers. Every
Backend is one, so the toolkit reaches this with
of(Backend); a backend implements it.
Incubating, as the rest of this package: it may change in a minor release.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceHandle to an in-scene modal (seepushSceneModal(limn.backend.NativeWindow, boolean));BackendPeer.SceneModalHandle.release()it on close. -
Method Summary
Modifier and TypeMethodDescriptiondefault TrayPeercreateTray(String id, TrayHost host) Makes the peer of a tray icon.createWindow(WindowConfig config) Creates (but does not necessarily show) a native window, as its peer.static BackendPeervoidpopModal(NativeWindow modal) Removesmodalfrom the modal stack, releasing what it locked.voidpushModal(NativeWindow modal, @Nullable NativeWindow parent) Registersmodalas an active modal window and pushes it on the modal stack.pushSceneModal(NativeWindow owner, boolean toolkitScope) Registers an in-scene (overlay) modal hosted byowner.voidGives the modal-blocked feedback (the alert sound plus a re-raise of the top modal) for an interaction the active modal ignores.default @Nullable SystemMenuBarThe menu bar the system keeps outside the windows, where it keeps one and the application may have it.Methods inherited from interface limn.backend.Backend
close, compositorShadowsPopups, displays, graphicsInfo, loopLifetime, primaryDisplay, render3DStats, renderStats, requestQuit, runEventLoop, setApplicationName, setLoopLifetime, setQuitHandler, stop, uiRuntime
-
Method Details
-
of
- Parameters:
backend- any backend- Returns:
- the same backend as a peer; every backend is one, since
Backendpermits no other implementation
-
createWindow
Creates (but does not necessarily show) a native window, as its peer. UI thread only.- Specified by:
createWindowin interfaceBackend
-
pushModal
Registersmodalas an active modal window and pushes it on the modal stack. Only the topmost modal receives input; every window it locks ignores input until it closes.Modality scope: a non-null
parentmakes it window-modal, so it locks onlyparent(andparent's owned popups), leaving unrelated windows interactive. Anullparent makes it toolkit-modal, so it locks every other window. Modals stack: with several open, only the top one is usable and the non-modal windows are released only after the whole modal stack closes. UI thread only. -
popModal
Removesmodalfrom the modal stack, releasing what it locked. UI thread only. -
pushSceneModal
Registers an in-scene (overlay) modal hosted byowner. UnlikepushModal(limn.backend.NativeWindow, limn.backend.NativeWindow), there is no separate modal window: the overlay blocksowner's own content, soownerstays interactive, while this call blocks the same sibling windows a native modal would.toolkitScopetruelocks every other window;falselocks onlyowner's owned popups. Release the returned handle when the overlay closes. UI thread only. -
signalModalBlocked
void signalModalBlocked()Gives the modal-blocked feedback (the alert sound plus a re-raise of the top modal) for an interaction the active modal ignores. The backend already does this for clicks on blocked native windows; call it for an in-scene modal's scrim so internal and native modals feel identical. UI thread only. -
createTray
Makes the peer of a tray icon. Nothing is shown until its firstTrayPeer.update(limn.backend.spi.TrayState). UI thread only.The default is the answer of a backend with no desktop under it: a peer that shows nothing and is never available.
- Parameters:
id- the application's identifier for this icon: ASCII letters, digits, a dot, a hyphen and an underscore, already checked, and no other tray of this backend has ithost- what the peer asks the menu of and tells of a click- Returns:
- the peer
-
systemMenuBar
The menu bar the system keeps outside the windows, where it keeps one and the application may have it.The default is the answer of every system but one:
null, and a menu bar is drawn in its window.
-