attachmentBoundsForTextContainer method

CGRect attachmentBoundsForTextContainer(
  1. NSTextContainer? textContainer, {
  2. required CGRect proposedLineFragment,
  3. required CGPoint glyphPosition,
  4. required DartNSUInteger characterIndex,
})

attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex:

Implementation

objc.CGRect attachmentBoundsForTextContainer(
  NSTextContainer? textContainer, {
  required objc.CGRect proposedLineFragment,
  required objc.CGPoint glyphPosition,
  required DartNSUInteger characterIndex,
}) {
  objc.checkOsVersionInternal(
    'NSTextAttachment.attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex:',
    iOS: (false, (7, 0, 0)),
    macOS: (false, (10, 11, 0)),
  );
  final _ptr = pkg_ffi.calloc<objc.CGRect>();
  objc.useMsgSendVariants
      ? _objc_msgSend_1ownkxhStret(
          _ptr,
          this.ref.pointer,
          _sel_attachmentBoundsForTextContainer_proposedLineFragment_glyphPosition_characterIndex_,
          textContainer?.ref.pointer ?? ffi.nullptr,
          proposedLineFragment,
          glyphPosition,
          characterIndex,
        )
      : _ptr.ref = _objc_msgSend_1ownkxh(
          this.ref.pointer,
          _sel_attachmentBoundsForTextContainer_proposedLineFragment_glyphPosition_characterIndex_,
          textContainer?.ref.pointer ?? ffi.nullptr,
          proposedLineFragment,
          glyphPosition,
          characterIndex,
        );
  final _finalizable = _ptr.cast<ffi.Uint8>().asTypedList(
    ffi.sizeOf<objc.CGRect>(),
    finalizer: pkg_ffi.calloc.nativeFree,
  );
  return ffi.Struct.create<objc.CGRect>(_finalizable);
}