use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;
ns_options!(
#[underlying(NSUInteger)]
pub enum NSGradientDrawingOptions {
NSGradientDrawsBeforeStartingLocation = 1 << 0,
NSGradientDrawsAfterEndingLocation = 1 << 1,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSGradient;
unsafe impl ClassType for NSGradient {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSGradient {
#[method_id(@__retain_semantics Init initWithStartingColor:endingColor:)]
pub unsafe fn initWithStartingColor_endingColor(
this: Option<Allocated<Self>>,
startingColor: &NSColor,
endingColor: &NSColor,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Init initWithColors:)]
pub unsafe fn initWithColors(
this: Option<Allocated<Self>>,
colorArray: &NSArray<NSColor>,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Init initWithColors:atLocations:colorSpace:)]
pub unsafe fn initWithColors_atLocations_colorSpace(
this: Option<Allocated<Self>>,
colorArray: &NSArray<NSColor>,
locations: *mut CGFloat,
colorSpace: &NSColorSpace,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Option<Allocated<Self>>,
coder: &NSCoder,
) -> Id<Self, Shared>;
#[method(drawFromPoint:toPoint:options:)]
pub unsafe fn drawFromPoint_toPoint_options(
&self,
startingPoint: NSPoint,
endingPoint: NSPoint,
options: NSGradientDrawingOptions,
);
#[method(drawInRect:angle:)]
pub unsafe fn drawInRect_angle(&self, rect: NSRect, angle: CGFloat);
#[method(drawInBezierPath:angle:)]
pub unsafe fn drawInBezierPath_angle(&self, path: &NSBezierPath, angle: CGFloat);
#[method(drawFromCenter:radius:toCenter:radius:options:)]
pub unsafe fn drawFromCenter_radius_toCenter_radius_options(
&self,
startCenter: NSPoint,
startRadius: CGFloat,
endCenter: NSPoint,
endRadius: CGFloat,
options: NSGradientDrawingOptions,
);
#[method(drawInRect:relativeCenterPosition:)]
pub unsafe fn drawInRect_relativeCenterPosition(
&self,
rect: NSRect,
relativeCenterPosition: NSPoint,
);
#[method(drawInBezierPath:relativeCenterPosition:)]
pub unsafe fn drawInBezierPath_relativeCenterPosition(
&self,
path: &NSBezierPath,
relativeCenterPosition: NSPoint,
);
#[method_id(@__retain_semantics Other colorSpace)]
pub unsafe fn colorSpace(&self) -> Id<NSColorSpace, Shared>;
#[method(numberOfColorStops)]
pub unsafe fn numberOfColorStops(&self) -> NSInteger;
#[method(getColor:location:atIndex:)]
pub unsafe fn getColor_location_atIndex(
&self,
color: *mut NonNull<NSColor>,
location: *mut CGFloat,
index: NSInteger,
);
#[method_id(@__retain_semantics Other interpolatedColorAtLocation:)]
pub unsafe fn interpolatedColorAtLocation(&self, location: CGFloat) -> Id<NSColor, Shared>;
}
);