Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
 public ViewParent invalidateChildInParent(int[] location, Rect r)
 {
     XobotActivityManager.RequestInvalidate(this);
     return(null);
 }
Exemplo n.º 5
0
 public void invalidateChild(View child, Rect r)
 {
     XobotActivityManager.RequestInvalidate(this);
 }
Exemplo n.º 6
0
 public void requestLayout()
 {
     XobotActivityManager.RequestLayout(this);
 }
Exemplo n.º 7
0
 void SendKeyEvent(KeyEvent e)
 {
     XobotActivityManager.Invoke((window) => window.SendKeyEvent(e));
 }
Exemplo n.º 8
0
 protected override void OnVisibleChanged(EventArgs e)
 {
     XobotActivityManager.Invoke((window) => window.OnVisibilityChanged(Visible));
     base.OnVisibleChanged(e);
 }
Exemplo n.º 9
0
 protected override void OnLayout(LayoutEventArgs levent)
 {
     XobotActivityManager.Invoke((window) => window.PerformLayout(Left, Top, Right, Bottom));
     base.OnLayout(levent);
 }
Exemplo n.º 10
0
 protected override void OnLostFocus(EventArgs e)
 {
     XobotActivityManager.Invoke((window) => window.OnFocusChanged(false));
     base.OnLostFocus(e);
 }