private static void OnEvent(ref Toolkit.utEvent e) { switch (e.what) { case Toolkit.utEventKind.UT_EVENT_WINDOW_CLOSE: case Toolkit.utEventKind.UT_EVENT_WINDOW_REDRAW: case Toolkit.utEventKind.UT_EVENT_WINDOW_RESIZE: PlatformWindow.HandleEvent(ref e); break; default: if (Input != null) { InputEventArgs args = InputEventArgs.FromEvent(e); Input(args); } break; } }
internal static InputEventArgs FromEvent(Toolkit.utEvent e) { InputEventArgs args = new InputEventArgs(); args.Kind = (InputKind)e.what; args.Index = e.arg1; args.Value = e.arg2; return args; }
internal static void HandleEvent(ref Toolkit.utEvent e) { PlatformWindow wnd = (PlatformWindow)_windows[e.window]; switch (e.what) { case Toolkit.utEventKind.UT_EVENT_WINDOW_CLOSE: wnd.Dispose(); break; case Toolkit.utEventKind.UT_EVENT_WINDOW_RESIZE: wnd.Size = new Size(e.arg0, e.arg1); break; } }