Ejemplo n.º 1
0
        public void SetAttributes(NSDictionary attributes, NSRange range)
        {
            if (attributes == null)
                throw new ArgumentNullException ("attributes");

            LowLevelSetAttributes (attributes.Handle, range);
        }
Ejemplo n.º 2
0
 public unsafe nuint[] GetIndexes(NSRange range)
 {
     var ret = new nuint [range.Length];
     fixed (nuint *ptr = ret)
         _GetIndexes ((IntPtr) ptr, range);
     return ret;
 }
Ejemplo n.º 3
0
 public unsafe CLLocationCoordinate2D[] GetCoordinates(int first, int count)
 {
     var range = new NSRange (first, count);
     var target = new CLLocationCoordinate2D [count];
     fixed (CLLocationCoordinate2D *firstE = &target [0]){
         GetCoords ((IntPtr) firstE, range);
     }
     return target;
 }
Ejemplo n.º 4
0
        public CGRect[] GetRectArray(NSRange glyphRange, NSRange selectedGlyphRange, NSTextContainer textContainer)
        {
            if (textContainer == null)
                throw new ArgumentNullException ("textContainer");

            nuint rectCount;
            var retHandle = GetRectArray (glyphRange, selectedGlyphRange, textContainer.Handle, out rectCount);
            var returnArray = new CGRect [rectCount];

            unsafe {
                float *ptr = (float*) retHandle;
                for (nuint i = 0; i < rectCount; ++i) {
                    returnArray [i] = new CGRect (ptr [0], ptr [1], ptr [2], ptr [3]);
                    ptr += 4;
                }
            }
            return returnArray;
        }
Ejemplo n.º 5
0
		public unsafe nuint GetGlyphs (
			NSRange glyphRange, 
			short[] /* CGGlyph* = CGFontIndex* = unsigned short* */ glyphBuffer,
			NSGlyphProperty[] /* NSGlyphProperty* = nint* */ props,
			nuint[] /* NSUInteger */ charIndexBuffer,
			byte[] /* (unsigned char *) */ bidiLevelBuffer)
		{
			if (glyphBuffer != null && glyphBuffer.Length < glyphRange.Length)
				throw new ArgumentOutOfRangeException (string.Format ("glyphBuffer must have at least {0} elements", glyphRange.Length));

			if (props != null && props.Length < glyphRange.Length)
				throw new ArgumentOutOfRangeException (string.Format ("props must have at least {0} elements", glyphRange.Length));
			
			if (charIndexBuffer != null && charIndexBuffer.Length < glyphRange.Length)
				throw new ArgumentOutOfRangeException (string.Format ("props must have at least {0} elements", glyphRange.Length));

			if (bidiLevelBuffer != null && bidiLevelBuffer.Length < glyphRange.Length)
				throw new ArgumentOutOfRangeException (string.Format ("bidiLevelBuffer must have at least {0} elements", glyphRange.Length));

			fixed (short* glyphs = glyphBuffer) {
				nuint rv;
#if XAMCORE_2_0 && ARCH_32
				// Unified/32: the output array is not the correct size, it needs to be int[], and it's an array of NSGlyphProperty (which is long)
				var tmpArray = new nint [props.Length];
				fixed (nint *properties = tmpArray) {
#else
				// Unified/64 + Classic: the input array is the correct size
				fixed (NSGlyphProperty *properties = props) {
#endif
					fixed (nuint* charIBuffer = charIndexBuffer) {
						fixed (byte* bidi = bidiLevelBuffer) {
							rv = GetGlyphsInternal (glyphRange, (IntPtr) glyphs, (IntPtr) properties, (IntPtr) charIBuffer, (IntPtr) bidi);
						}
					}
				}
#if XAMCORE_2_0 && ARCH_32
				// Marshal back from the tmpArray.
				for (int i = 0; i < props.Length; i++)
					props [i] = (NSGlyphProperty) (long) tmpArray [i];
#endif

				return rv;
			}
		}
Ejemplo n.º 6
0
 public void GetLineOrigins(NSRange range, CGPoint[] origins)
 {
     if (origins == null)
         throw new ArgumentNullException ("origins");
     if (range.Length != 0 && origins.Length < range.Length)
         throw new ArgumentException ("origins must contain at least range.Length elements.", "origins");
     else if (origins.Length < CFArray.GetCount (CTFrameGetLines (handle)))
         throw new ArgumentException ("origins must contain at least GetLines().Length elements.", "origins");
     CTFrameGetLineOrigins (handle, range, origins);
 }
Ejemplo n.º 7
0
 public CTFrame GetFrame(NSRange stringRange, CGPath path, CTFrameAttributes frameAttributes)
 {
     if (path == null)
         throw new ArgumentNullException ("path");
     var frame = CTFramesetterCreateFrame (handle, stringRange, path.Handle,
             frameAttributes == null ? IntPtr.Zero : frameAttributes.Dictionary.Handle);
     if (frame == IntPtr.Zero)
         return null;
     return new CTFrame (frame, true);
 }
Ejemplo n.º 8
0
 static extern CGSize CTFramesetterSuggestFrameSizeWithConstraints(
     IntPtr framesetter, NSRange stringRange, IntPtr frameAttributes, CGSize constraints, out NSRange fitRange);
Ejemplo n.º 9
0
 static extern IntPtr CTFramesetterCreateFrame(IntPtr framesetter, NSRange stringRange, IntPtr path, IntPtr frameAttributes);
Ejemplo n.º 10
0
 public UIStringAttributes GetUIKitAttributes(nint location, out NSRange effectiveRange)
 {
     var attr = GetAttributes (location, out effectiveRange);
     return attr == null ? null : new UIStringAttributes (attr);
 }
Ejemplo n.º 11
0
 public CTStringAttributes GetCoreTextAttributes(nint location, out NSRange effectiveRange)
 {
     var attr = GetAttributes (location, out effectiveRange);
     return attr == null ? null : new CTStringAttributes (attr);
 }
Ejemplo n.º 12
0
 public static extern void void_objc_msgSend_stret_rnsrange(ref NSRange stret, IntPtr receiver, IntPtr selector);
Ejemplo n.º 13
0
 public bool ApplyTransform(NSStringTransform transform, bool reverse, NSRange range, out NSRange resultingRange)
 {
     return ApplyTransform (NSString.NSStringTransformToCode (transform), reverse, range, out resultingRange);
 }
Ejemplo n.º 14
0
 public void SetAttributes(CTStringAttributes attrs, NSRange range)
 {
     SetAttributes (attrs == null ? null : attrs.Dictionary, range);
 }
Ejemplo n.º 15
0
 public void InsertCompletionforPartialWord(string word, NSRange charRange, int movement, bool isFinal)
 {
     InsertCompletion (word, charRange, movement, isFinal);
 }
Ejemplo n.º 16
0
 public void SetAlignmentrange(NSTextAlignment alignment, NSRange range)
 {
     SetAlignmentRange (alignment, range);
 }
Ejemplo n.º 17
0
 public bool ShouldChangeTextInRangereplacementString(NSRange affectedCharRange, string replacementString)
 {
     return ShouldChangeText (affectedCharRange, replacementString);
 }
Ejemplo n.º 18
0
 public void SetSpellingStaterange(int value, NSRange charRange)
 {
     SetSpellingState (value, charRange);
 }
Ejemplo n.º 19
0
 public void SetSelectedRangeaffinitystillSelecting(NSRange charRange, NSSelectionAffinity affinity, bool stillSelectingFlag)
 {
     SetSelectedRange (charRange, affinity, stillSelectingFlag);
 }
Ejemplo n.º 20
0
 public void SetBaseWritingDirectionrange(NSWritingDirection writingDirection, NSRange range)
 {
     SetBaseWritingDirection (writingDirection, range);
 }
Ejemplo n.º 21
0
 public static extern void void_objc_msgSend_nsrange(IntPtr receiver, IntPtr selector, NSRange arg1);
Ejemplo n.º 22
0
 static extern void CTFrameGetLineOrigins(IntPtr handle, NSRange range, [Out] CGPoint[] origins);
Ejemplo n.º 23
0
 public void AddAttributes(UIStringAttributes attrs, NSRange range)
 {
     AddAttributes (attrs == null ? null : attrs.Dictionary, range);
 }
Ejemplo n.º 24
0
        public CTLine GetLine(NSRange stringRange)
        {
            var h = CTTypesetterCreateLine (handle, stringRange);

            if (h == IntPtr.Zero)
                return null;

            return new CTLine (h, true);
        }
Ejemplo n.º 25
0
 // check helpers to avoid native exceptions
 void Check(NSRange range)
 {
     if (range.Location + range.Length > Length)
         throw new ArgumentOutOfRangeException ("range");
 }
Ejemplo n.º 26
0
 static extern IntPtr CTTypesetterCreateLine(IntPtr typesetter, NSRange stringRange);
Ejemplo n.º 27
0
 public NSDictionary GetAttributes(nint location, out NSRange effectiveRange)
 {
     return Runtime.GetNSObject<NSDictionary> (LowLevelGetAttributes (location, out effectiveRange));
 }
Ejemplo n.º 28
0
 static extern IntPtr CTTypesetterCreateLineWithOffset(IntPtr typesetter, NSRange stringRange, double offset);
Ejemplo n.º 29
0
 public CTStringAttributes GetCoreTextAttributes(nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
 {
     var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit);
     return attr == null ? null : new CTStringAttributes (attr);
 }
Ejemplo n.º 30
0
 public CGSize SuggestFrameSize(NSRange stringRange, CTFrameAttributes frameAttributes, CGSize constraints, out NSRange fitRange)
 {
     return CTFramesetterSuggestFrameSizeWithConstraints (
             handle, stringRange,
             frameAttributes == null ? IntPtr.Zero : frameAttributes.Dictionary.Handle,
             constraints, out fitRange);
 }