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