contentRectForFrameRect static method

NSRect contentRectForFrameRect(
  1. NSRect fRect, {
  2. required NSWindowStyleMask styleMask,
})

contentRectForFrameRect:styleMask:

Implementation

static NSRect contentRectForFrameRect(
  NSRect fRect, {
  required NSWindowStyleMask styleMask,
}) {
  objc.checkOsVersionInternal(
    'NSWindow.contentRectForFrameRect:styleMask:',
    iOS: (true, null),
  );
  final _ptr = pkg_ffi.calloc<NSRect>();
  objc.useMsgSendVariants
      ? _objc_msgSend_11qsrbrStret(
          _ptr,
          _class_NSWindow,
          _sel_contentRectForFrameRect_styleMask_,
          fRect,
          styleMask.value,
        )
      : _ptr.ref = _objc_msgSend_11qsrbr(
          _class_NSWindow,
          _sel_contentRectForFrameRect_styleMask_,
          fRect,
          styleMask.value,
        );
  final _finalizable = _ptr.cast<ffi.Uint8>().asTypedList(
    ffi.sizeOf<NSRect>(),
    finalizer: pkg_ffi.calloc.nativeFree,
  );
  return ffi.Struct.create<NSRect>(_finalizable);
}