MCPcopy Create free account
hub / github.com/HumbleUI/Skija / handleUserEvent

Method handleUserEvent

examples/kwinit/src_java/Main.java:227–254  ·  view source on GitHub ↗
(int cookie)

Source from the content-addressed store, hash-verified

225 }
226
227 public void handleUserEvent(int cookie) {
228 switch (cookie) {
229 case 0:
230 var windowAttrs = ("{'inner_size':{'width': " + width + ".0, 'height': " + height + ".0},"
231 + "'position':{'x':100.0,'y':100.0},"
232 + "'title':'Skija KWinit Example'}").replaceAll("'", "\"");
233 window = ExternalAPI.createWindow(windowAttrs);
234 // ExternalAPI.fireUserEvent(3);
235 Stats.enabled = true;
236 context = DirectContext.makeGL();
237 scale = (float) ExternalAPI.getScaleFactor(window);
238 mouseX = width / 2f;
239 mouseY = height / 2f;
240 onResize(width, height);
241 break;
242 case 1:
243 ExternalAPI.requestRedraw(window);
244 break;
245 case 2:
246 ExternalAPI.setOuterPosition(window, outerX, outerY);
247 break;
248 case 3:
249 ExternalAPI.macosMoveStandardWindowButtons(window, 46, 26);
250 break;
251 default:
252 log("Unknown user event", cookie);
253 }
254 }
255}

Callers 1

runMethod · 0.95

Calls 8

createWindowMethod · 0.95
makeGLMethod · 0.95
getScaleFactorMethod · 0.95
onResizeMethod · 0.95
requestRedrawMethod · 0.95
setOuterPositionMethod · 0.95
logMethod · 0.95

Tested by

no test coverage detected