protected override void OnHandleCreated(EventArgs e) { IntPtr on_draw = Marshal.GetFunctionPointerForDelegate(on_draw_handler); skia_window = libxobotos_window_new(Handle, on_draw, false); XobotActivityManager.Invoke((window) => window.OnAttachedToWindow()); base.OnHandleCreated(e); }
void OnDraw(System.IntPtr native_canvas) { using (Canvas canvas = new Canvas(native_canvas)) { canvas.drawColor(Color.BLACK); /* * Do not call Control.Invalidate() while we're drawing; * Winforms would simply discard it. */ do { invalidate_requested = false; drawing = true; XobotActivityManager.Invoke((window) => window.OnDraw(canvas)); drawing = false; } while (invalidate_requested); } }
void SendMotionEvent(int action, MouseEventArgs e) { long time = android.os.SystemClock.uptimeMillis(); if (action == MotionEvent.ACTION_DOWN) { mouse_down = time; } else if (mouse_down == 0) { return; } using (MotionEvent me = MotionEvent.obtain(mouse_down, time, action, e.X, e.Y, 0)) XobotActivityManager.Invoke((window) => window.SendMotionEvent(me)); if (action == MotionEvent.ACTION_UP) { mouse_down = 0; } }
public ViewParent invalidateChildInParent(int[] location, Rect r) { XobotActivityManager.RequestInvalidate(this); return(null); }
public void invalidateChild(View child, Rect r) { XobotActivityManager.RequestInvalidate(this); }
public void requestLayout() { XobotActivityManager.RequestLayout(this); }
void SendKeyEvent(KeyEvent e) { XobotActivityManager.Invoke((window) => window.SendKeyEvent(e)); }
protected override void OnVisibleChanged(EventArgs e) { XobotActivityManager.Invoke((window) => window.OnVisibilityChanged(Visible)); base.OnVisibleChanged(e); }
protected override void OnLayout(LayoutEventArgs levent) { XobotActivityManager.Invoke((window) => window.PerformLayout(Left, Top, Right, Bottom)); base.OnLayout(levent); }
protected override void OnLostFocus(EventArgs e) { XobotActivityManager.Invoke((window) => window.OnFocusChanged(false)); base.OnLostFocus(e); }