use crate::common::*;
use crate::Foundation::*;
pub type NSPointPointer = *mut NSPoint;
pub type NSPointArray = *mut NSPoint;
pub type NSSizePointer = *mut NSSize;
pub type NSSizeArray = *mut NSSize;
pub type NSRectPointer = *mut NSRect;
pub type NSRectArray = *mut NSRect;
extern_struct!(
pub struct NSEdgeInsets {
pub top: CGFloat,
pub left: CGFloat,
pub bottom: CGFloat,
pub right: CGFloat,
}
);
unsafe impl Send for NSEdgeInsets {}
unsafe impl Sync for NSEdgeInsets {}
ns_options!(
#[underlying(c_ulonglong)]
pub enum NSAlignmentOptions {
NSAlignMinXInward = 1 << 0,
NSAlignMinYInward = 1 << 1,
NSAlignMaxXInward = 1 << 2,
NSAlignMaxYInward = 1 << 3,
NSAlignWidthInward = 1 << 4,
NSAlignHeightInward = 1 << 5,
NSAlignMinXOutward = 1 << 8,
NSAlignMinYOutward = 1 << 9,
NSAlignMaxXOutward = 1 << 10,
NSAlignMaxYOutward = 1 << 11,
NSAlignWidthOutward = 1 << 12,
NSAlignHeightOutward = 1 << 13,
NSAlignMinXNearest = 1 << 16,
NSAlignMinYNearest = 1 << 17,
NSAlignMaxXNearest = 1 << 18,
NSAlignMaxYNearest = 1 << 19,
NSAlignWidthNearest = 1 << 20,
NSAlignHeightNearest = 1 << 21,
NSAlignRectFlipped = 1 << 63,
NSAlignAllEdgesInward =
NSAlignMinXInward | NSAlignMaxXInward | NSAlignMinYInward | NSAlignMaxYInward,
NSAlignAllEdgesOutward =
NSAlignMinXOutward | NSAlignMaxXOutward | NSAlignMinYOutward | NSAlignMaxYOutward,
NSAlignAllEdgesNearest =
NSAlignMinXNearest | NSAlignMaxXNearest | NSAlignMinYNearest | NSAlignMaxYNearest,
}
);
extern_static!(NSZeroPoint: NSPoint);
extern_static!(NSZeroSize: NSSize);
extern_static!(NSZeroRect: NSRect);
extern_static!(NSEdgeInsetsZero: NSEdgeInsets);
inline_fn!(
pub unsafe fn NSMakePoint(x: CGFloat, y: CGFloat) -> NSPoint {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMakeSize(w: CGFloat, h: CGFloat) -> NSSize {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMakeRect(x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat) -> NSRect {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMaxX(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMaxY(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMidX(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMidY(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMinX(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSMinY(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSWidth(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSHeight(a_rect: NSRect) -> CGFloat {
todo!()
}
);
inline_fn!(
pub unsafe fn NSRectFromCGRect(cgrect: CGRect) -> NSRect {
todo!()
}
);
inline_fn!(
pub unsafe fn NSRectToCGRect(nsrect: NSRect) -> CGRect {
todo!()
}
);
inline_fn!(
pub unsafe fn NSPointFromCGPoint(cgpoint: CGPoint) -> NSPoint {
todo!()
}
);
inline_fn!(
pub unsafe fn NSPointToCGPoint(nspoint: NSPoint) -> CGPoint {
todo!()
}
);
inline_fn!(
pub unsafe fn NSSizeFromCGSize(cgsize: CGSize) -> NSSize {
todo!()
}
);
inline_fn!(
pub unsafe fn NSSizeToCGSize(nssize: NSSize) -> CGSize {
todo!()
}
);
inline_fn!(
pub unsafe fn NSEdgeInsetsMake(
top: CGFloat,
left: CGFloat,
bottom: CGFloat,
right: CGFloat,
) -> NSEdgeInsets {
todo!()
}
);
extern_fn!(
pub unsafe fn NSEqualPoints(a_point: NSPoint, b_point: NSPoint) -> Bool;
);
extern_fn!(
pub unsafe fn NSEqualSizes(a_size: NSSize, b_size: NSSize) -> Bool;
);
extern_fn!(
pub unsafe fn NSEqualRects(a_rect: NSRect, b_rect: NSRect) -> Bool;
);
extern_fn!(
pub unsafe fn NSIsEmptyRect(a_rect: NSRect) -> Bool;
);
extern_fn!(
pub unsafe fn NSEdgeInsetsEqual(a_insets: NSEdgeInsets, b_insets: NSEdgeInsets) -> Bool;
);
extern_fn!(
pub unsafe fn NSInsetRect(a_rect: NSRect, d_x: CGFloat, d_y: CGFloat) -> NSRect;
);
extern_fn!(
pub unsafe fn NSIntegralRect(a_rect: NSRect) -> NSRect;
);
extern_fn!(
pub unsafe fn NSIntegralRectWithOptions(a_rect: NSRect, opts: NSAlignmentOptions) -> NSRect;
);
extern_fn!(
pub unsafe fn NSUnionRect(a_rect: NSRect, b_rect: NSRect) -> NSRect;
);
extern_fn!(
pub unsafe fn NSIntersectionRect(a_rect: NSRect, b_rect: NSRect) -> NSRect;
);
extern_fn!(
pub unsafe fn NSOffsetRect(a_rect: NSRect, d_x: CGFloat, d_y: CGFloat) -> NSRect;
);
extern_fn!(
pub unsafe fn NSDivideRect(
in_rect: NSRect,
slice: NonNull<NSRect>,
rem: NonNull<NSRect>,
amount: CGFloat,
edge: NSRectEdge,
);
);
extern_fn!(
pub unsafe fn NSPointInRect(a_point: NSPoint, a_rect: NSRect) -> Bool;
);
extern_fn!(
pub unsafe fn NSMouseInRect(a_point: NSPoint, a_rect: NSRect, flipped: Bool) -> Bool;
);
extern_fn!(
pub unsafe fn NSContainsRect(a_rect: NSRect, b_rect: NSRect) -> Bool;
);
extern_fn!(
pub unsafe fn NSIntersectsRect(a_rect: NSRect, b_rect: NSRect) -> Bool;
);
extern_fn!(
#[cfg(feature = "Foundation_NSString")]
pub unsafe fn NSStringFromPoint(a_point: NSPoint) -> NonNull<NSString>;
);
extern_fn!(
#[cfg(feature = "Foundation_NSString")]
pub unsafe fn NSStringFromSize(a_size: NSSize) -> NonNull<NSString>;
);
extern_fn!(
#[cfg(feature = "Foundation_NSString")]
pub unsafe fn NSStringFromRect(a_rect: NSRect) -> NonNull<NSString>;
);
extern_fn!(
#[cfg(feature = "Foundation_NSString")]
pub unsafe fn NSPointFromString(a_string: &NSString) -> NSPoint;
);
extern_fn!(
#[cfg(feature = "Foundation_NSString")]
pub unsafe fn NSSizeFromString(a_string: &NSString) -> NSSize;
);
extern_fn!(
#[cfg(feature = "Foundation_NSString")]
pub unsafe fn NSRectFromString(a_string: &NSString) -> NSRect;
);
extern_methods!(
#[cfg(feature = "Foundation_NSValue")]
unsafe impl NSValue {
#[method_id(@__retain_semantics Other valueWithPoint:)]
pub unsafe fn valueWithPoint(point: NSPoint) -> Id<NSValue>;
#[method_id(@__retain_semantics Other valueWithSize:)]
pub unsafe fn valueWithSize(size: NSSize) -> Id<NSValue>;
#[method_id(@__retain_semantics Other valueWithRect:)]
pub unsafe fn valueWithRect(rect: NSRect) -> Id<NSValue>;
#[method_id(@__retain_semantics Other valueWithEdgeInsets:)]
pub unsafe fn valueWithEdgeInsets(insets: NSEdgeInsets) -> Id<NSValue>;
#[method(pointValue)]
pub unsafe fn pointValue(&self) -> NSPoint;
#[method(sizeValue)]
pub unsafe fn sizeValue(&self) -> NSSize;
#[method(rectValue)]
pub unsafe fn rectValue(&self) -> NSRect;
#[method(edgeInsetsValue)]
pub unsafe fn edgeInsetsValue(&self) -> NSEdgeInsets;
}
);
extern_methods!(
#[cfg(feature = "Foundation_NSCoder")]
unsafe impl NSCoder {
#[method(encodePoint:)]
pub unsafe fn encodePoint(&self, point: NSPoint);
#[method(decodePoint)]
pub unsafe fn decodePoint(&self) -> NSPoint;
#[method(encodeSize:)]
pub unsafe fn encodeSize(&self, size: NSSize);
#[method(decodeSize)]
pub unsafe fn decodeSize(&self) -> NSSize;
#[method(encodeRect:)]
pub unsafe fn encodeRect(&self, rect: NSRect);
#[method(decodeRect)]
pub unsafe fn decodeRect(&self) -> NSRect;
}
);
extern_methods!(
#[cfg(feature = "Foundation_NSCoder")]
unsafe impl NSCoder {
#[cfg(feature = "Foundation_NSString")]
#[method(encodePoint:forKey:)]
pub unsafe fn encodePoint_forKey(&self, point: NSPoint, key: &NSString);
#[cfg(feature = "Foundation_NSString")]
#[method(encodeSize:forKey:)]
pub unsafe fn encodeSize_forKey(&self, size: NSSize, key: &NSString);
#[cfg(feature = "Foundation_NSString")]
#[method(encodeRect:forKey:)]
pub unsafe fn encodeRect_forKey(&self, rect: NSRect, key: &NSString);
#[cfg(feature = "Foundation_NSString")]
#[method(decodePointForKey:)]
pub unsafe fn decodePointForKey(&self, key: &NSString) -> NSPoint;
#[cfg(feature = "Foundation_NSString")]
#[method(decodeSizeForKey:)]
pub unsafe fn decodeSizeForKey(&self, key: &NSString) -> NSSize;
#[cfg(feature = "Foundation_NSString")]
#[method(decodeRectForKey:)]
pub unsafe fn decodeRectForKey(&self, key: &NSString) -> NSRect;
}
);