Window
Static methods
function hxnAdopt(hxnRaw:Handle):WindowAn object for a value the library returned.
function open(attributes:WindowAttributes):WindowA new window; one whose valid is false when the platform refuses.
function listenDeviceEvents(when:DeviceEvents):VoidWhen raw device events come, for every window: by default only while one of the program's windows has focus.
function clipboardText():OptionalTextThe 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):VoidPuts text on the clipboard; nothing happens with no window open.
function clipboardTypeCount():IntHow 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):Stringfunction clipboardData(mimeType:String):OptionalBytesThe 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():BoolWake 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:HandleMethods
function valid():Boolfunction poll():EventThe 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):EventThe 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):VoidCoalesce 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():EventDisable 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():VoidClose the window; its handle names nothing after.
function width():IntThe content's width in physical pixels; setSize takes logical ones, this over scaleFactor.
function height():Intfunction outerWidth():Intfunction outerHeight():Intfunction x():IntWhere the window's frame is, in physical pixels; setPosition takes logical ones, this over scaleFactor.
function y():Intfunction innerX():IntWhere the window's content is, without its frame.
function innerY():Intfunction scaleFactor():Floatfunction title():Stringfunction hasFocus():Boolfunction isVisible():Boolfunction isMinimized():Boolfunction isMaximized():Boolfunction isFullscreen():Boolfunction isResizable():Boolfunction isDecorated():Boolfunction theme():Themefunction platform():IntThe 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):Int64function setTitle(title:String):Voidfunction setSize(width:Int, height:Int):VoidThe content's size in logical pixels: width and height over scaleFactor.
function setMinSize(width:Int, height:Int):VoidA size of zero by zero removes the limit.
function setMaxSize(width:Int, height:Int):Voidfunction setPosition(x:Int, y:Int):VoidMove the window's frame to logical pixels: x and y over scaleFactor.
function setResizable(resizable:Bool):Voidfunction setMinimized(minimized:Bool):Voidfunction setMaximized(maximized:Bool):Voidfunction setFullscreen(fullscreen:Bool):Voidfunction setDecorations(decorations:Bool):Voidfunction setVisible(visible:Bool):Voidfunction setWindowLevel(level:WindowLevel):Voidfunction setTransparent(transparent:Bool):Voidfunction setBlur(blur:Bool):Voidfunction setHasShadow(hasShadow:Bool):VoidThe system's shadow behind the window, on macOS and, for an undecorated window, Windows; elsewhere nothing.
function setBlurRadius(radius:Int):VoidHow 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):Voidfunction setScaleSizing(sizing:ScaleSizing):Voidfunction setTheme(theme:Null<Theme>):VoidA theme, or none to follow the system's.
function setIcon(rgba:Bytes, width:Int, height:Int):VoidRGBA pixels, width by height; an empty buffer removes the icon.
function setResizeIncrements(width:Int, height:Int):VoidThe steps a user resizes the window by; zero by zero removes them.
function setEnabledButtons(close:Bool, minimize:Bool, maximize:Bool):Voidfunction setExclusiveFullscreen(mode:VideoMode):VoidFullscreen in a video mode of one of the window's monitors.
function dragWindow():BoolMove 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):Boolfunction showWindowMenu(x:Float, y:Float):VoidThe system's window menu, at a logical position in the window.
function requestRedraw():Voidfunction prePresentNotify():VoidCall 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():Voidfunction requestAttention(attention:Attention):Voidfunction setCursorIcon(icon:CursorIcon):Voidfunction setCursorImage(rgba:Bytes, width:Int, height:Int, hotX:Int, hotY:Int):VoidA cursor of width by height RGBA pixels, its hot spot at hotX, hotY.
function setCursorVisible(visible:Bool):Voidfunction setCursorGrab(grab:CursorGrab):BoolWhether the platform took the grab.
function setCursorHittest(hittest:Bool):BoolWhether pointer input reaches the window rather than passing through it; whether the platform took the setting.
function setCursorPosition(x:Float, y:Float):BoolWhether the platform moved the cursor.
function setImeAllowed(allowed:Bool):Voidfunction setImePurpose(purpose:ImePurpose):Voidfunction setImeCursorArea(x:Float, y:Float, width:Float, height:Float):Voidfunction requestActivationToken():Int64A request's serial, which its ActivationTokenDone carries; zero where the platform has no activation tokens.
function currentMonitor():MonitorA monitor whose valid is false when there is none.
function primaryMonitor():Monitorfunction monitorCount():Intfunction monitor(index:Int):Monitor