A game framework written with osu! in mind.
at master 21 lines 1.1 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using System; 5 6namespace osu.Framework.Platform.MacOS.Native 7{ 8 internal static class NSNotificationCenter 9 { 10 private static readonly IntPtr sel_default_center = Selector.Get("defaultCenter"); 11 private static readonly IntPtr sel_add_observer = Selector.Get("addObserver:selector:name:object:"); 12 13 internal static IntPtr Handle = Cocoa.SendIntPtr(Class.Get("NSNotificationCenter"), sel_default_center); 14 15 internal static readonly IntPtr WINDOW_DID_ENTER_FULL_SCREEN = Cocoa.GetStringConstant(Cocoa.AppKitLibrary, "NSWindowDidEnterFullScreenNotification"); 16 internal static readonly IntPtr WINDOW_DID_EXIT_FULL_SCREEN = Cocoa.GetStringConstant(Cocoa.AppKitLibrary, "NSWindowDidExitFullScreenNotification"); 17 18 internal static void AddObserver(IntPtr target, IntPtr selector, IntPtr name, IntPtr obj) => 19 Cocoa.SendVoid(Handle, sel_add_observer, target, selector, name, obj); 20 } 21}