use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSScrubberLayoutAttributes;
unsafe impl ClassType for NSScrubberLayoutAttributes {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSScrubberLayoutAttributes {
#[method(itemIndex)]
pub unsafe fn itemIndex(&self) -> NSInteger;
#[method(setItemIndex:)]
pub unsafe fn setItemIndex(&self, itemIndex: NSInteger);
#[method(frame)]
pub unsafe fn frame(&self) -> NSRect;
#[method(setFrame:)]
pub unsafe fn setFrame(&self, frame: NSRect);
#[method(alpha)]
pub unsafe fn alpha(&self) -> CGFloat;
#[method(setAlpha:)]
pub unsafe fn setAlpha(&self, alpha: CGFloat);
#[method_id(@__retain_semantics Other layoutAttributesForItemAtIndex:)]
pub unsafe fn layoutAttributesForItemAtIndex(index: NSInteger) -> Id<Self, Shared>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSScrubberLayout;
unsafe impl ClassType for NSScrubberLayout {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSScrubberLayout {
#[method(layoutAttributesClass)]
pub unsafe fn layoutAttributesClass() -> &'static Class;
#[method_id(@__retain_semantics Other scrubber)]
pub unsafe fn scrubber(&self) -> Option<Id<NSScrubber, Shared>>;
#[method(visibleRect)]
pub unsafe fn visibleRect(&self) -> NSRect;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Option<Allocated<Self>>,
coder: &NSCoder,
) -> Id<Self, Shared>;
#[method(invalidateLayout)]
pub unsafe fn invalidateLayout(&self);
#[method(prepareLayout)]
pub unsafe fn prepareLayout(&self);
#[method(scrubberContentSize)]
pub unsafe fn scrubberContentSize(&self) -> NSSize;
#[method_id(@__retain_semantics Other layoutAttributesForItemAtIndex:)]
pub unsafe fn layoutAttributesForItemAtIndex(
&self,
index: NSInteger,
) -> Option<Id<NSScrubberLayoutAttributes, Shared>>;
#[method_id(@__retain_semantics Other layoutAttributesForItemsInRect:)]
pub unsafe fn layoutAttributesForItemsInRect(
&self,
rect: NSRect,
) -> Id<NSSet<NSScrubberLayoutAttributes>, Shared>;
#[method(shouldInvalidateLayoutForSelectionChange)]
pub unsafe fn shouldInvalidateLayoutForSelectionChange(&self) -> bool;
#[method(shouldInvalidateLayoutForHighlightChange)]
pub unsafe fn shouldInvalidateLayoutForHighlightChange(&self) -> bool;
#[method(shouldInvalidateLayoutForChangeFromVisibleRect:toVisibleRect:)]
pub unsafe fn shouldInvalidateLayoutForChangeFromVisibleRect_toVisibleRect(
&self,
fromVisibleRect: NSRect,
toVisibleRect: NSRect,
) -> bool;
#[method(automaticallyMirrorsInRightToLeftLayout)]
pub unsafe fn automaticallyMirrorsInRightToLeftLayout(&self) -> bool;
}
);
extern_protocol!(
pub struct NSScrubberFlowLayoutDelegate;
unsafe impl ProtocolType for NSScrubberFlowLayoutDelegate {
#[optional]
#[method(scrubber:layout:sizeForItemAtIndex:)]
pub unsafe fn scrubber_layout_sizeForItemAtIndex(
&self,
scrubber: &NSScrubber,
layout: &NSScrubberFlowLayout,
itemIndex: NSInteger,
) -> NSSize;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSScrubberFlowLayout;
unsafe impl ClassType for NSScrubberFlowLayout {
#[inherits(NSObject)]
type Super = NSScrubberLayout;
}
);
extern_methods!(
unsafe impl NSScrubberFlowLayout {
#[method(itemSpacing)]
pub unsafe fn itemSpacing(&self) -> CGFloat;
#[method(setItemSpacing:)]
pub unsafe fn setItemSpacing(&self, itemSpacing: CGFloat);
#[method(itemSize)]
pub unsafe fn itemSize(&self) -> NSSize;
#[method(setItemSize:)]
pub unsafe fn setItemSize(&self, itemSize: NSSize);
#[method(invalidateLayoutForItemsAtIndexes:)]
pub unsafe fn invalidateLayoutForItemsAtIndexes(&self, invalidItemIndexes: &NSIndexSet);
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSScrubberProportionalLayout;
unsafe impl ClassType for NSScrubberProportionalLayout {
#[inherits(NSObject)]
type Super = NSScrubberLayout;
}
);
extern_methods!(
unsafe impl NSScrubberProportionalLayout {
#[method(numberOfVisibleItems)]
pub unsafe fn numberOfVisibleItems(&self) -> NSInteger;
#[method(setNumberOfVisibleItems:)]
pub unsafe fn setNumberOfVisibleItems(&self, numberOfVisibleItems: NSInteger);
#[method_id(@__retain_semantics Init initWithNumberOfVisibleItems:)]
pub unsafe fn initWithNumberOfVisibleItems(
this: Option<Allocated<Self>>,
numberOfVisibleItems: NSInteger,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Option<Allocated<Self>>,
coder: &NSCoder,
) -> Id<Self, Shared>;
}
);