IWindowBridge
interface IWindowBridge
Extends: IBridge
Known subtypes: Lwjgl2WindowBridge, GlfwWindowBridge, SnapshotWindowBridge
Package: dev.joid.lib.bridge.window · Module: core · Source: IWindowBridge.java
The bridge that reads the drawable size, the mouse, the held keys and the clipboard of the window, in screen pixels.
Description
Section titled “Description”It never creates a window: the backend or the host owns it.
The input events do not go through it; the backend forwards them to BridgeHandler.UI.
Window bridge shows one that reads everything from the engine that owns the window.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
int | getWidth() abstract | Returns the width of the drawable surface, in screen pixels; 0 while the window is minimized. |
int | getHeight() abstract | Returns the height of the drawable surface, in screen pixels; 0 while the window is minimized. |
double | getMouseX() abstract | Returns the horizontal position of the mouse, in screen pixels from the left edge. |
double | getMouseY() abstract | Returns the vertical position of the mouse, in screen pixels from the top edge. |
boolean | isMouseGrabbed() abstract | If true, the host hides and locks the cursor, for a camera for example, and JOID leaves the cursor alone. |
boolean | isKeyDown(Key physicalKey) abstract | If true, the key at that physical position is held, whatever the keyboard layout. |
String | getClipboard() abstract | Returns the text of the system clipboard, or an empty string when it holds no text; never throws. |
void | setClipboard(String text) abstract | Puts the text in the system clipboard; never throws. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | setCursor(Cursor cursor) hook default | Shows that system cursor over the window; does nothing by default. |
void | setTextInputArea(BoundingBox area) hook default | Receives the area of the cursor of the focused text field, in screen pixels, or null once no field has the focus; does nothing by default. |
Method details
Section titled “Method details”getWidth
Section titled “getWidth”int getWidth() abstract
Returns the width of the drawable surface, in screen pixels; 0 while the window is minimized.
getHeight
Section titled “getHeight”int getHeight() abstract
Returns the height of the drawable surface, in screen pixels; 0 while the window is minimized.
getMouseX
Section titled “getMouseX”double getMouseX() abstract
Returns the horizontal position of the mouse, in screen pixels from the left edge.
getMouseY
Section titled “getMouseY”double getMouseY() abstract
Returns the vertical position of the mouse, in screen pixels from the top edge.
isMouseGrabbed
Section titled “isMouseGrabbed”boolean isMouseGrabbed() abstract
If true, the host hides and locks the cursor, for a camera for example, and JOID leaves the cursor alone.
isKeyDown
Section titled “isKeyDown”boolean isKeyDown(Key physicalKey) abstract
If true, the key at that physical position is held, whatever the keyboard layout.
getClipboard
Section titled “getClipboard”String getClipboard() abstract
Returns the text of the system clipboard, or an empty string when it holds no text; never throws.
setClipboard
Section titled “setClipboard”void setClipboard(String text) abstract
Puts the text in the system clipboard; never throws.
setCursor
Section titled “setCursor”void setCursor(Cursor cursor) hook default
Shows that system cursor over the window; does nothing by default.
JOID calls it once per change, never while isMouseGrabbed() returns true.
setTextInputArea
Section titled “setTextInputArea”void setTextInputArea(BoundingBox area) hook default
Receives the area of the cursor of the focused text field, in screen pixels, or null once no field has the focus; does nothing by default.
JOID calls it once per change: a host whose text input must be switched on, or whose input method places its window near the text, starts it on an area and stops it on null.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
