Esempio n. 1
0
        internal static NSPoint EventGetLocation(CGEventRef @event)
        {
            NSPoint r = new NSPoint();

            unsafe {
                if (IntPtr.Size == 4)
                {
                    NSPointF pf = EventGetLocationF(@event);
                    r.X.Value = *(IntPtr *)&pf.X;
                    r.Y.Value = *(IntPtr *)&pf.Y;
                }
                else
                {
                    NSPointD pd = EventGetLocationD(@event);
                    r.X.Value = *(IntPtr *)&pd.X;
                    r.Y.Value = *(IntPtr *)&pd.Y;
                }
            }

            return(r);
        }
Esempio n. 2
0
        public static NSPoint SendPoint(IntPtr receiver, IntPtr selector)
        {
            NSPoint r = new NSPoint();

            unsafe
            {
                if (IntPtr.Size == 4)
                {
                    NSPointF pf = SendPointF(receiver, selector);
                    r.X.Value = *(IntPtr *)&pf.X;
                    r.Y.Value = *(IntPtr *)&pf.Y;
                }
                else
                {
                    NSPointD pd = SendPointD(receiver, selector);
                    r.X.Value = *(IntPtr *)&pd.X;
                    r.Y.Value = *(IntPtr *)&pd.Y;
                }
            }

            return(r);
        }