hxn

Window

Static methods

function hxnAdopt(hxnRaw:Handle):Window

An object for a value the library returned.

function open(attributes:WindowAttributes):Window

A new window; one whose valid is false when the platform refuses.

function listenDeviceEvents(when:DeviceEvents):Void

When raw device events come, for every window: by default only while one of the program's windows has focus.

function clipboardText():OptionalText

The clipboard's text: none when it holds no text, no window is open, or the platform has no clipboard to read, as a page cannot.

function setClipboardText(text:String):Void

Puts text on the clipboard; nothing happens with no window open.

function clipboardTypeCount():Int

How many types the clipboard holds now; clipboardType names each, best first, as a MIME type. text/plain is UTF-8 text and text/uri-list a list of files.

function clipboardType(index:Int):String
function clipboardData(mimeType:String):OptionalBytes

The clipboard's bytes for a MIME type, or none when it does not hold it, no window is open, or the platform cannot read it.

function wake():Bool

Wake the current or next wait for application work, from any thread. Several calls coalesce; no synthetic window event is produced. False if no event loop is available.

Properties

var hxnRaw:Handle

Methods

function valid():Bool
function poll():Event

The next event, without waiting. It asks the platform for more only when the window has none queued and has answered none since the platform was last asked, so draining with polls asks once.

function wait(timeout:Float):Event

The next event, waiting up to timeout seconds for one; a negative timeout waits as long as it takes.

function coalesceCursorMoves(left:Float, top:Float, right:Float, bottom:Float):Void

Coalesce cursor moves inside a caller-guaranteed quiet rectangle in physical pixels (left/top inclusive, right/bottom exclusive). No move is queued there; only its latest position is retained. Crossing the rectangle or receiving another window event resumes ordinary delivery. Empty or non-finite bounds disable coalescing. Raw device events are unaffected; applications using only window input can disable those.

function takeCursorMove():Event

Disable coalescing and take the latest retained CursorMoved, or None. Call before changing hit geometry or processing application work. Other window events automatically deliver that position first.

function close():Void

Close the window; its handle names nothing after.

function width():Int

The content's width in physical pixels; setSize takes logical ones, this over scaleFactor.

function height():Int
function outerWidth():Int
function outerHeight():Int
function x():Int

Where the window's frame is, in physical pixels; setPosition takes logical ones, this over scaleFactor.

function y():Int
function innerX():Int

Where the window's content is, without its frame.

function innerY():Int
function scaleFactor():Float
function title():String
function hasFocus():Bool
function isVisible():Bool
function isMinimized():Bool
function isMaximized():Bool
function isFullscreen():Bool
function isResizable():Bool
function isDecorated():Bool
function theme():Theme
function platform():Int

The window for a GPU surface: a platform code, and with raw the four integers xgpu's GpuInstance.surface takes after it. See xwindow-core's raw for the table.

function raw(which:Int):Int64
function setTitle(title:String):Void
function setSize(width:Int, height:Int):Void

The content's size in logical pixels: width and height over scaleFactor.

function setMinSize(width:Int, height:Int):Void

A size of zero by zero removes the limit.

function setMaxSize(width:Int, height:Int):Void
function setPosition(x:Int, y:Int):Void

Move the window's frame to logical pixels: x and y over scaleFactor.

function setResizable(resizable:Bool):Void
function setMinimized(minimized:Bool):Void
function setMaximized(maximized:Bool):Void
function setFullscreen(fullscreen:Bool):Void
function setDecorations(decorations:Bool):Void
function setVisible(visible:Bool):Void
function setWindowLevel(level:WindowLevel):Void
function setTransparent(transparent:Bool):Void
function setBlur(blur:Bool):Void
function setHasShadow(hasShadow:Bool):Void

The system's shadow behind the window, on macOS and, for an undecorated window, Windows; elsewhere nothing.

function setBlurRadius(radius:Int):Void

How far the background behind a transparent window is blurred, 0 for none: a radius on macOS, where setBlur means a radius of 80, and the platform's blur on or off elsewhere.

function setContentProtected(protected:Bool):Void
function setScaleSizing(sizing:ScaleSizing):Void
function setTheme(theme:Null<Theme>):Void

A theme, or none to follow the system's.

function setIcon(rgba:Bytes, width:Int, height:Int):Void

RGBA pixels, width by height; an empty buffer removes the icon.

function setResizeIncrements(width:Int, height:Int):Void

The steps a user resizes the window by; zero by zero removes them.

function setEnabledButtons(close:Bool, minimize:Bool, maximize:Bool):Void
function setExclusiveFullscreen(mode:VideoMode):Void

Fullscreen in a video mode of one of the window's monitors.

function dragWindow():Bool

Move the window with the pointer while a button is held, as from an undecorated window's title bar; whether the platform started it.

function dragResizeWindow(direction:ResizeDirection):Bool
function showWindowMenu(x:Float, y:Float):Void

The system's window menu, at a logical position in the window.

function requestRedraw():Void
function prePresentNotify():Void

Call just before presenting a frame. On Wayland the next RedrawRequested then waits for the compositor's frame callback for that frame, which paces drawing to the display; elsewhere it does nothing.

function focus():Void
function requestAttention(attention:Attention):Void
function setCursorIcon(icon:CursorIcon):Void
function setCursorImage(rgba:Bytes, width:Int, height:Int, hotX:Int, hotY:Int):Void

A cursor of width by height RGBA pixels, its hot spot at hotX, hotY.

function setCursorVisible(visible:Bool):Void
function setCursorGrab(grab:CursorGrab):Bool

Whether the platform took the grab.

function setCursorHittest(hittest:Bool):Bool

Whether pointer input reaches the window rather than passing through it; whether the platform took the setting.

function setCursorPosition(x:Float, y:Float):Bool

Whether the platform moved the cursor.

function setImeAllowed(allowed:Bool):Void
function setImePurpose(purpose:ImePurpose):Void
function setImeCursorArea(x:Float, y:Float, width:Float, height:Float):Void
function requestActivationToken():Int64

A request's serial, which its ActivationTokenDone carries; zero where the platform has no activation tokens.

function currentMonitor():Monitor

A monitor whose valid is false when there is none.

function primaryMonitor():Monitor
function monitorCount():Int
function monitor(index:Int):Monitor