Example #1
0
        static ABPersonSocialProfile()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                URLKey            = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileURLKey");
                ServiceKey        = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceKey");
                UsernameKey       = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileUsernameKey");
                UserIdentifierKey = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileUserIdentifierKey");
            } finally {
                Dlfcn.dlclose(handle);
            }
        }
        internal static void Init()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try
            {
                Anniversary = Dlfcn.GetStringConstant(handle, "kABPersonAnniversaryLabel");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
        static CTTextTabOptionKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try
            {
                ColumnTerminators = Dlfcn.GetStringConstant(handle, "kCTTabColumnTerminatorsAttributeName");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
Example #4
0
        internal static void Init()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Home  = Dlfcn.GetStringConstant(handle, "kABHomeLabel");
                Other = Dlfcn.GetStringConstant(handle, "kABOtherLabel");
                Work  = Dlfcn.GetStringConstant(handle, "kABWorkLabel");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #5
0
        static ABAddressBook()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try
            {
                ErrorDomain = Dlfcn.GetStringConstant(handle, "ABAddressBookErrorDomain");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
Example #6
0
            static Selectors()
            {
                var handle = Dlfcn.dlopen(Constants.CoreMediaLibrary, 0);

                if (handle == IntPtr.Zero)
                {
                    return;
                }
                try {
                    NotSync                        = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_NotSync");
                    PartialSync                    = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_PartialSync");
                    HasRedundantCoding             = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_HasRedundantCoding");
                    IsDependedOnByOthers           = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_IsDependedOnByOthers");
                    DependsOnOthers                = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_DependsOnOthers");
                    EarlierDisplayTimesAllowed     = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_EarlierDisplayTimesAllowed");
                    DisplayImmediately             = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_DisplayImmediately");
                    DoNotDisplay                   = Dlfcn.GetStringConstant(handle, "kCMSampleAttachmentKey_DoNotDisplay");
                    ResetDecoderBeforeDecoding     = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding");
                    DrainAfterDecoding             = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_DrainAfterDecoding");
                    PostNotificationWhenConsumed   = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed");
                    ResumeOutput                   = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_ResumeOutput");
                    TransitionID                   = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_TransitionID");
                    TrimDurationAtStart            = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_TrimDurationAtStart");
                    TrimDurationAtEnd              = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_TrimDurationAtEnd");
                    SpeedMultiplier                = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_SpeedMultiplier");
                    Reverse                        = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_Reverse");
                    FillDiscontinuitiesWithSilence = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_FillDiscontinuitiesWithSilence");
                    EmptyMedia                     = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_EmptyMedia");
                    PermanentEmptyMedia            = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_PermanentEmptyMedia");

                    DisplayEmptyMediaImmediately = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_DisplayEmptyMediaImmediately");
                    EndsPreviousSampleDuration   = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_EndsPreviousSampleDuration");
                    SampleReferenceURL           = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_SampleReferenceURL");
                    SampleReferenceByteOffset    = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_SampleReferenceByteOffset");
                    GradualDecoderRefresh        = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_GradualDecoderRefresh");
#if !MONOMAC
                    var version = new Version(UIDevice.CurrentDevice.SystemVersion);
                    if (version.Major >= 6)
                    {
                        DroppedFrameReason = Dlfcn.GetStringConstant(handle, "kCMSampleBufferAttachmentKey_DroppedFrameReason");
                    }
#endif
                } finally {
                    Dlfcn.dlclose(handle);
                }
            }
        static CTFontCollectionOptionKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try
            {
                RemoveDuplicates = Dlfcn.GetStringConstant(handle, "kCTFontCollectionRemoveDuplicatesOption");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
        static CVPixelFormatDescription()
        {
            var handle = Dlfcn.dlopen(Constants.CoreVideoLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                NameKey                         = Dlfcn.GetStringConstant(handle, "kCVPixelFormatName");
                ConstantKey                     = Dlfcn.GetStringConstant(handle, "kCVPixelFormatConstant");
                CodecTypeKey                    = Dlfcn.GetStringConstant(handle, "kCVPixelFormatCodecType");
                FourCCKey                       = Dlfcn.GetStringConstant(handle, "kCVPixelFormatFourCC");
                PlanesKey                       = Dlfcn.GetStringConstant(handle, "kCVPixelFormatPlanes");
                BlockWidthKey                   = Dlfcn.GetStringConstant(handle, "kCVPixelFormatBlockWidth");
                BlockHeightKey                  = Dlfcn.GetStringConstant(handle, "kCVPixelFormatBlockHeight");
                BitsPerBlockKey                 = Dlfcn.GetStringConstant(handle, "kCVPixelFormatBitsPerBlock");
                BlockHorizontalAlignmentKey     = Dlfcn.GetStringConstant(handle, "kCVPixelFormatBlockHorizontalAlignment");
                BlockVerticalAlignmentKey       = Dlfcn.GetStringConstant(handle, "kCVPixelFormatBlockVerticalAlignment");
                BlackBlockKey                   = Dlfcn.GetStringConstant(handle, "kCVPixelFormatBlackBlock");
                HorizontalSubsamplingKey        = Dlfcn.GetStringConstant(handle, "kCVPixelFormatHorizontalSubsampling");
                VerticalSubsamplingKey          = Dlfcn.GetStringConstant(handle, "kCVPixelFormatVerticalSubsampling");
                OpenGLFormatKey                 = Dlfcn.GetStringConstant(handle, "kCVPixelFormatOpenGLFormat");
                OpenGLTypeKey                   = Dlfcn.GetStringConstant(handle, "kCVPixelFormatOpenGLType");
                OpenGLInternalFormatKey         = Dlfcn.GetStringConstant(handle, "kCVPixelFormatOpenGLInternalFormat");
                CGBitmapInfoKey                 = Dlfcn.GetStringConstant(handle, "kCVPixelFormatCGBitmapInfo");
                QDCompatibilityKey              = Dlfcn.GetStringConstant(handle, "kCVPixelFormatQDCompatibility");
                CGBitmapContextCompatibilityKey = Dlfcn.GetStringConstant(handle, "kCVPixelFormatCGBitmapContextCompatibility");
                CGImageCompatibilityKey         = Dlfcn.GetStringConstant(handle, "kCVPixelFormatCGImageCompatibility");
                OpenGLCompatibilityKey          = Dlfcn.GetStringConstant(handle, "kCVPixelFormatOpenGLCompatibility");
                FillExtendedPixelsCallbackKey   = Dlfcn.GetStringConstant(handle, "kCVPixelFormatFillExtendedPixelsCallback");

                //iOS8 only
                ContainsRgb   = Dlfcn.GetStringConstant(handle, "kCVPixelFormatContainsRGB");
                ContainsYCbCr = Dlfcn.GetStringConstant(handle, "kCVPixelFormatContainsYCbCr");

                //iOS9 only
                ComponentRangeKey           = Dlfcn.GetStringConstant(handle, "kCVPixelFormatComponentRange");
                ComponentRangeFullRangeKey  = Dlfcn.GetStringConstant(handle, "kCVPixelFormatComponentRange_FullRange");
                ComponentRangeVideoRangeKey = Dlfcn.GetStringConstant(handle, "kCVPixelFormatComponentRange_VideoRange");
                ComponentRangeWideRangeKey  = Dlfcn.GetStringConstant(handle, "kCVPixelFormatComponentRange_WideRange");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #9
0
        public static void Initialize(CFRunLoop runLoop, string runMode)
        {
            CFString s = runMode == null ? null : new CFString(runMode);
            int      k = AudioSessionInitialize(runLoop == null ? IntPtr.Zero : runLoop.Handle, s == null ? IntPtr.Zero : s.Handle, Interruption, IntPtr.Zero);

            if (k != 0 && k != (int)AudioSessionErrors.AlreadyInitialized)
            {
                throw new AudioSessionException(k);
            }

            if (initialized)
            {
                return;
            }

            IntPtr lib = Libraries.AudioToolbox.Handle;

            AudioRouteKey_Inputs  = Dlfcn.GetStringConstant(lib, "kAudioSession_AudioRouteKey_Inputs");
            AudioRouteKey_Outputs = Dlfcn.GetStringConstant(lib, "kAudioSession_AudioRouteKey_Outputs");
            AudioRouteKey_Type    = Dlfcn.GetStringConstant(lib, "kAudioSession_AudioRouteKey_Type");

            InputRoute_LineIn       = Dlfcn.GetStringConstant(lib, "kAudioSessionInputRoute_LineIn");
            InputRoute_BuiltInMic   = Dlfcn.GetStringConstant(lib, "kAudioSessionInputRoute_BuiltInMic");
            InputRoute_HeadsetMic   = Dlfcn.GetStringConstant(lib, "kAudioSessionInputRoute_HeadsetMic");
            InputRoute_BluetoothHFP = Dlfcn.GetStringConstant(lib, "kAudioSessionInputRoute_BluetoothHFP");
            InputRoute_USBAudio     = Dlfcn.GetStringConstant(lib, "kAudioSessionInputRoute_USBAudio");

            OutputRoute_LineOut         = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_LineOut");
            OutputRoute_Headphones      = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_Headphones");
            OutputRoute_BluetoothHFP    = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_BluetoothHFP");
            OutputRoute_BluetoothA2DP   = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_BluetoothA2DP");
            OutputRoute_BuiltInReceiver = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_BuiltInReceiver");
            OutputRoute_BuiltInSpeaker  = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_BuiltInSpeaker");
            OutputRoute_USBAudio        = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_USBAudio");
            OutputRoute_HDMI            = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_HDMI");
            OutputRoute_AirPlay         = Dlfcn.GetStringConstant(lib, "kAudioSessionOutputRoute_AirPlay");

            InputSourceKey_ID          = Dlfcn.GetStringConstant(lib, "kAudioSession_InputSourceKey_ID");
            InputSourceKey_Description = Dlfcn.GetStringConstant(lib, "kAudioSession_InputSourceKey_Description");

            OutputDestinationKey_ID          = Dlfcn.GetStringConstant(lib, "kAudioSession_OutputDestinationKey_ID");
            OutputDestinationKey_Description = Dlfcn.GetStringConstant(lib, "kAudioSession_OutputDestinationKey_Description");

            initialized = true;
        }
Example #10
0
        void UpdateAudioLevels(NSTimer timer)
        {
            // Get the mean audio level from the movie file output's audio connections
            float totalDecibels = 0f;

            QTCaptureConnection connection = null;
            int i = 0;
            int numberOfPowerLevels = 0;                // Keep track of the total number of power levels in order to take the mean

            // TODO: https://bugzilla.xamarin.com/show_bug.cgi?id=27702
            IntPtr   library   = Dlfcn.dlopen("/System/Library/Frameworks/QTKit.framework/QTKit", 0);
            NSString soundType = Dlfcn.GetStringConstant(library, "QTMediaTypeSound");

            var connections = movieFileOutput.Connections;

            for (i = 0; i < connections.Length; i++)
            {
                connection = connections [i];

                if (connection.MediaType == soundType)
                {
                    // TODO: https://bugzilla.xamarin.com/show_bug.cgi?id=27708 Use typed property
                    NSArray    powerLevelsNative = (NSArray)connection.GetAttribute(QTCaptureConnection.AudioAveragePowerLevelsAttribute);
                    NSNumber[] powerLevels       = NSArray.FromArray <NSNumber> (powerLevelsNative);

                    int j = 0;
                    int powerLevelCount = powerLevels.Length;

                    for (j = 0; j < powerLevelCount; j++)
                    {
                        totalDecibels += powerLevels [j].FloatValue;
                        numberOfPowerLevels++;
                    }
                }
            }

            if (numberOfPowerLevels > 0)
            {
                audioLevelIndicator.FloatValue = 20 * (float)Math.Pow(10, 0.05 * (totalDecibels / numberOfPowerLevels));
            }
            else
            {
                audioLevelIndicator.FloatValue = 0;
            }
        }
        internal static void Init()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try
            {
                Service  = Dlfcn.GetStringConstant(handle, "kABPersonInstantMessageServiceKey");
                Username = Dlfcn.GetStringConstant(handle, "kABPersonInstantMessageUsernameKey");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
        static CVPixelBufferPool()
        {
            var handle = Dlfcn.dlopen(Constants.CoreVideoLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try
            {
                MinimumBufferCountKey = Dlfcn.GetStringConstant(handle, "kCVPixelBufferPoolMinimumBufferCountKey");
                MaximumBufferAgeKey   = Dlfcn.GetStringConstant(handle, "kCVPixelBufferPoolMaximumBufferAgeKey");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
        static CTFontTraitKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Symbolic = Dlfcn.GetStringConstant(handle, "kCTFontSymbolicTrait");
                Weight   = Dlfcn.GetStringConstant(handle, "kCTFontWeightTrait");
                Width    = Dlfcn.GetStringConstant(handle, "kCTFontWidthTrait");
                Slant    = Dlfcn.GetStringConstant(handle, "kCTFontSlantTrait");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
        static FingerprintService()
        {
            var securityLibrary = Dlfcn.dlopen(Constants.SecurityLibrary, 0);

            kSecAttrApplicationTag = Dlfcn.GetStringConstant(securityLibrary, "kSecAttrApplicationTag");
            kSecAttrIsPermanent    = Dlfcn.GetStringConstant(securityLibrary, "kSecAttrIsPermanent");
            kSecAttrKeyClass       = Dlfcn.GetStringConstant(securityLibrary, "kSecAttrKeyClass");
            kSecAttrKeyType        = Dlfcn.GetStringConstant(securityLibrary, "kSecAttrKeyType");
            kSecAttrLabel          = Dlfcn.GetStringConstant(securityLibrary, "kSecAttrLabel");
            kSecClass      = Dlfcn.GetStringConstant(securityLibrary, "kSecClass");
            kSecReturnData = Dlfcn.GetStringConstant(securityLibrary, "kSecReturnData");
            kSecValueRef   = Dlfcn.GetStringConstant(securityLibrary, "kSecValueRef");

            kSecPrivateKeyAttrs = Dlfcn.GetStringConstant(securityLibrary, "kSecPrivateKeyAttrs");
            kSecPublicKeyAttrs  = Dlfcn.GetStringConstant(securityLibrary, "kSecPublicKeyAttrs");

            Dlfcn.dlclose(securityLibrary);
        }
Example #15
0
        static CTFontFeatureSelectorKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Identifier = Dlfcn.GetStringConstant(handle, "kCTFontFeatureSelectorIdentifierKey");
                Name       = Dlfcn.GetStringConstant(handle, "kCTFontFeatureSelectorNameKey");
                Default    = Dlfcn.GetStringConstant(handle, "kCTFontFeatureSelectorDefaultKey");
                Setting    = Dlfcn.GetStringConstant(handle, "kCTFontFeatureSelectorSettingKey");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #16
0
        static CTFontFeatureKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Identifier = Dlfcn.GetStringConstant(handle, "kCTFontFeatureTypeIdentifierKey");
                Name       = Dlfcn.GetStringConstant(handle, "kCTFontFeatureTypeNameKey");
                Exclusive  = Dlfcn.GetStringConstant(handle, "kCTFontFeatureTypeExclusiveKey");
                Selectors  = Dlfcn.GetStringConstant(handle, "kCTFontFeatureTypeSelectorsKey");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
        static EAGLDrawableProperty()
        {
            var handle = Dlfcn.dlopen(Constants.OpenGLESLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                ColorFormat = Dlfcn.GetStringConstant(handle,
                                                      "kEAGLDrawablePropertyColorFormat");
                RetainedBacking = Dlfcn.GetStringConstant(handle,
                                                          "kEAGLDrawablePropertyRetainedBacking");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #18
0
        static CTFontManager()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
#if !XAMCORE_3_0
                ErrorDomain = Dlfcn.GetStringConstant(handle, "kCTFontManagerErrorDomain");
#endif
                ErrorFontUrlsKey = Dlfcn.GetStringConstant(handle, "kCTFontManagerErrorFontURLsKey");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
        static CTTypesetterOptionKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try
            {
                DisableBidiProcessing = Dlfcn.GetStringConstant(handle, "kCTTypesetterOptionDisableBidiProcessing");
                ForceEmbeddingLevel   = Dlfcn.GetStringConstant(handle, "kCTTypesetterOptionForcedEmbeddingLevel");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
Example #20
0
        static CFErrorDomain()
        {
            var handle = Dlfcn.dlopen(Constants.CoreFoundationLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Cocoa    = Dlfcn.GetStringConstant(handle, "kCFErrorDomainCocoa");
                Mach     = Dlfcn.GetStringConstant(handle, "kCFErrorDomainMach");
                OSStatus = Dlfcn.GetStringConstant(handle, "kCFErrorDomainOSStatus");
                Posix    = Dlfcn.GetStringConstant(handle, "kCFErrorDomainPosix");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #21
0
        static CTFrameAttributeKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Progression      = Dlfcn.GetStringConstant(handle, "kCTFrameProgressionAttributeName");
                PathFillRule     = Dlfcn.GetStringConstant(handle, "kCTFramePathFillRuleAttributeName");
                PathWidth        = Dlfcn.GetStringConstant(handle, "kCTFramePathWidthAttributeName");
                ClippingPaths    = Dlfcn.GetStringConstant(handle, "kCTFrameClippingPathsAttributeName");
                PathClippingPath = Dlfcn.GetStringConstant(handle, "kCTFramePathClippingPathAttributeName");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #22
0
        static CVBuffer()
        {
            var hlib = Dlfcn.dlopen(Constants.CoreVideoLibrary, 0);

            if (hlib == IntPtr.Zero)
            {
                return;
            }
            try {
                MovieTimeKey                = Dlfcn.GetStringConstant(hlib, "kCVBufferMovieTimeKey");
                TimeValueKey                = Dlfcn.GetStringConstant(hlib, "kCVBufferTimeValueKey");
                TimeScaleKey                = Dlfcn.GetStringConstant(hlib, "kCVBufferTimeScaleKey");
                PropagatedAttachmentsKey    = Dlfcn.GetStringConstant(hlib, "kCVBufferPropagatedAttachmentsKey");
                NonPropagatedAttachmentsKey = Dlfcn.GetStringConstant(hlib, "kCVBufferNonPropagatedAttachmentsKey");
            }
            finally {
                Dlfcn.dlclose(hlib);
            }
        }
Example #23
0
        static CTFontVariationAxisKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Identifier   = Dlfcn.GetStringConstant(handle, "kCTFontVariationAxisIdentifierKey");
                MinimumValue = Dlfcn.GetStringConstant(handle, "kCTFontVariationAxisMinimumValueKey");
                MaximumValue = Dlfcn.GetStringConstant(handle, "kCTFontVariationAxisMaximumValueKey");
                DefaultValue = Dlfcn.GetStringConstant(handle, "kCTFontVariationAxisDefaultValueKey");
                Name         = Dlfcn.GetStringConstant(handle, "kCTFontVariationAxisNameKey");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #24
0
        internal static void Init()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Aim    = Dlfcn.GetStringConstant(handle, "kABPersonInstantMessageServiceAIM");
                Icq    = Dlfcn.GetStringConstant(handle, "kABPersonInstantMessageServiceICQ");
                Jabber = Dlfcn.GetStringConstant(handle, "kABPersonInstantMessageServiceJabber");
                Msn    = Dlfcn.GetStringConstant(handle, "kABPersonInstantMessageServiceMSN");
                Yahoo  = Dlfcn.GetStringConstant(handle, "kABPersonInstantMessageServiceYahoo");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
        static NSHttpCookieStorage()
        {
            var handle = Dlfcn.dlopen(Constants.FoundationLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }

            try
            {
                CookiesChangedNotification      = Dlfcn.GetStringConstant(handle, "NSHTTPCookieManagerAcceptPolicyChangedNotification");
                AcceptPolicyChangedNotification = Dlfcn.GetStringConstant(handle, "NSHTTPCookieManagerCookiesChangedNotification");
            }
            finally
            {
                Dlfcn.dlclose(handle);
            }
        }
        static CTBaselineClassID()
        {
            var handle = Dlfcn.dlopen(Constants.CoreTextLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Roman = Dlfcn.GetStringConstant(handle, "kCTBaselineClassRoman");
                IdeographicCentered = Dlfcn.GetStringConstant(handle, "kCTBaselineClassIdeographicCentered");
                IdeographicLow      = Dlfcn.GetStringConstant(handle, "kCTBaselineClassIdeographicLow");
                IdeographicHigh     = Dlfcn.GetStringConstant(handle, "kCTBaselineClassIdeographicHigh");
                Hanging             = Dlfcn.GetStringConstant(handle, "kCTBaselineClassHanging");
                Math = Dlfcn.GetStringConstant(handle, "kCTBaselineClassMath");
            } finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #27
0
        static CFExceptionDataKey()
        {
            var handle = Dlfcn.dlopen(Constants.CoreFoundationLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Description                 = Dlfcn.GetStringConstant(handle, "kCFErrorDescriptionKey");
                LocalizedDescription        = Dlfcn.GetStringConstant(handle, "kCFErrorLocalizedDescriptionKey");
                LocalizedFailureReason      = Dlfcn.GetStringConstant(handle, "kCFErrorLocalizedFailureReasonKey");
                LocalizedRecoverySuggestion = Dlfcn.GetStringConstant(handle, "kCFErrorLocalizedRecoverySuggestionKey");
                UnderlyingError             = Dlfcn.GetStringConstant(handle, "kCFErrorUnderlyingErrorKey");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #28
0
        static ABPersonSocialProfileService()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                Twitter    = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceTwitter");
                GameCenter = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceGameCenter");
                Facebook   = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceFacebook");
                Myspace    = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceMyspace");
                LinkedIn   = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceLinkedIn");
                Flickr     = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceFlickr");
                SinaWeibo  = Dlfcn.GetStringConstant(handle, "kABPersonSocialProfileServiceSinaWeibo");
            } finally {
                Dlfcn.dlclose(handle);
            }
        }
        static MACaptionAppearance()
        {
            var handle = Dlfcn.dlopen(Constants.MediaAccessibilityLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }

            try {
                SettingsChangedNotification = Dlfcn.GetStringConstant(handle, "kMACaptionAppearanceSettingsChangedNotification");

                MediaCharacteristicDescribesMusicAndSoundForAccessibility = Dlfcn.GetStringConstant(handle,
                                                                                                    "MAMediaCharacteristicDescribesMusicAndSoundForAccessibility");
                MediaCharacteristicTranscribesSpokenDialogForAccessibility = Dlfcn.GetStringConstant(handle,
                                                                                                     "MAMediaCharacteristicTranscribesSpokenDialogForAccessibility");
            } finally {
                Dlfcn.dlclose(handle);
            }
        }
Example #30
0
        internal static void Init()
        {
            var handle = Dlfcn.dlopen(Constants.AddressBookLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                City        = Dlfcn.GetStringConstant(handle, "kABPersonAddressCityKey");
                Country     = Dlfcn.GetStringConstant(handle, "kABPersonAddressCountryKey");
                CountryCode = Dlfcn.GetStringConstant(handle, "kABPersonAddressCountryCodeKey");
                State       = Dlfcn.GetStringConstant(handle, "kABPersonAddressStateKey");
                Street      = Dlfcn.GetStringConstant(handle, "kABPersonAddressStreetKey");
                Zip         = Dlfcn.GetStringConstant(handle, "kABPersonAddressZIPKey");
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }