コード例 #1
0
        static NSNotificationCenter()
        {
            IntPtr nsncClass = Class.Get("NSNotificationCenter");

            Handle = Cocoa.SendIntPtr(nsncClass, sel_default_center);

            WINDOW_DID_ENTER_FULL_SCREEN = Cocoa.GetStringConstant(Cocoa.AppKitLibrary, "NSWindowDidEnterFullScreenNotification");
            WINDOW_DID_EXIT_FULL_SCREEN  = Cocoa.GetStringConstant(Cocoa.AppKitLibrary, "NSWindowDidExitFullScreenNotification");
        }
コード例 #2
0
ファイル: NSData.cs プロジェクト: gagahpangeran/osu-framework
        internal static unsafe NSData FromBytes(byte[] bytes)
        {
            fixed(byte *ptr = bytes)
            {
                var handle = Cocoa.SendIntPtr(class_pointer, sel_data_with_bytes, (IntPtr)ptr, (ulong)bytes.LongLength);

                return(new NSData(handle));
            }
        }
コード例 #3
0
ファイル: NSData.cs プロジェクト: gagahpangeran/osu-framework
        internal byte[] ToBytes()
        {
            var pointer = Cocoa.SendIntPtr(Handle, sel_bytes);
            int size    = Cocoa.SendInt(Handle, sel_length);

            byte[] bytes = new byte[size];
            Marshal.Copy(pointer, bytes, 0, size);
            return(bytes);
        }
コード例 #4
0
        internal static NSArray ArrayWithObjects(IntPtr[] objs)
        {
            var mutableArray = Cocoa.SendIntPtr(mutable_class_pointer, sel_array);

            foreach (IntPtr obj in objs)
            {
                Cocoa.SendVoid(mutableArray, sel_add_object, obj);
            }
            return(new NSArray(mutableArray));
        }
コード例 #5
0
        internal NSArray?ReadObjectsForClasses(NSArray classArray, NSDictionary?optionDict)
        {
            var result = Cocoa.SendIntPtr(Handle, sel_read_objects_for_classes, classArray.Handle, optionDict?.Handle ?? IntPtr.Zero);

            return(result == IntPtr.Zero ? (NSArray?)null : new NSArray(result));
        }
コード例 #6
0
 internal static NSPasteboard GeneralPasteboard() => new NSPasteboard(Cocoa.SendIntPtr(class_pointer, sel_general_pasteboard));
コード例 #7
0
 internal IntPtr ObjectAtIndex(int index) => Cocoa.SendIntPtr(Handle, sel_object_at_index, index);
コード例 #8
0
 internal static NSArray ArrayWithObject(IntPtr obj) => new NSArray(Cocoa.SendIntPtr(class_pointer, sel_array_with_object, obj));
コード例 #9
0
        static NSApplication()
        {
            IntPtr nsappClass = Class.Get("NSApplication");

            Handle = Cocoa.SendIntPtr(nsappClass, sel_shared_application);
        }