| 109 | globalThis.GPUCanvasContext = GPUCanvasContext; |
| 110 | |
| 111 | class WinitWindow { |
| 112 | #rid; |
| 113 | #id; |
| 114 | |
| 115 | constructor([id, rid]) { |
| 116 | this.#id = id; |
| 117 | this.#rid = rid; |
| 118 | } |
| 119 | |
| 120 | get rid() { |
| 121 | return this.#rid; |
| 122 | } |
| 123 | |
| 124 | get id() { |
| 125 | return this.#id; |
| 126 | } |
| 127 | |
| 128 | get width() { |
| 129 | return this.getSize().width; |
| 130 | } |
| 131 | |
| 132 | get height() { |
| 133 | return this.getSize().height; |
| 134 | } |
| 135 | |
| 136 | requestRedraw() { |
| 137 | Deno.core.opSync("op_window_request_redraw", this.#rid); |
| 138 | } |
| 139 | |
| 140 | requestUserAttention(type) { |
| 141 | Deno.core.opSync("op_window_request_user_attention", [this.#rid, type ?? null]); |
| 142 | } |
| 143 | |
| 144 | getFullscreen() { |
| 145 | return Deno.core.opSync("op_window_fullscreen", this.#rid); |
| 146 | } |
| 147 | |
| 148 | getInnerPosition() { |
| 149 | return Deno.core.opSync("op_window_inner_position", this.#rid); |
| 150 | } |
| 151 | |
| 152 | getSize() { |
| 153 | return Deno.core.opSync("op_window_inner_size", this.#rid); |
| 154 | } |
| 155 | |
| 156 | getOuterSize() { |
| 157 | return Deno.core.opSync("op_window_outer_size", this.#rid); |
| 158 | } |
| 159 | |
| 160 | getScaleFactor() { |
| 161 | return Deno.core.opSync("op_window_scale_factor", this.#rid); |
| 162 | } |
| 163 | |
| 164 | setAlwaysOnTop(value) { |
| 165 | Deno.core.opSync("op_window_set_always_on_top", [this.#rid, value]); |
| 166 | } |
| 167 | |
| 168 | setCursorGrab(value) { |
nothing calls this directly
no outgoing calls
no test coverage detected