icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::Foundation::*;
use crate::GameKit::*;

ns_enum!(
    #[underlying(NSInteger)]
    pub enum GKAccessPointLocation {
        GKAccessPointLocationTopLeading = 0,
        GKAccessPointLocationTopTrailing = 1,
        GKAccessPointLocationBottomLeading = 2,
        GKAccessPointLocationBottomTrailing = 3,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "GameKit_GKAccessPoint")]
    pub struct GKAccessPoint;

    #[cfg(feature = "GameKit_GKAccessPoint")]
    unsafe impl ClassType for GKAccessPoint {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "GameKit_GKAccessPoint")]
unsafe impl NSObjectProtocol for GKAccessPoint {}

extern_methods!(
    #[cfg(feature = "GameKit_GKAccessPoint")]
    unsafe impl GKAccessPoint {
        #[method_id(@__retain_semantics Other shared)]
        pub unsafe fn shared() -> Id<GKAccessPoint>;

        #[method(isActive)]
        pub unsafe fn isActive(&self) -> bool;

        #[method(setActive:)]
        pub unsafe fn setActive(&self, active: bool);

        #[method(isFocused)]
        pub unsafe fn isFocused(&self) -> bool;

        #[method(setFocused:)]
        pub unsafe fn setFocused(&self, focused: bool);

        #[method(isVisible)]
        pub unsafe fn isVisible(&self) -> bool;

        #[method(isPresentingGameCenter)]
        pub unsafe fn isPresentingGameCenter(&self) -> bool;

        #[method(showHighlights)]
        pub unsafe fn showHighlights(&self) -> bool;

        #[method(setShowHighlights:)]
        pub unsafe fn setShowHighlights(&self, show_highlights: bool);

        #[method(location)]
        pub unsafe fn location(&self) -> GKAccessPointLocation;

        #[method(setLocation:)]
        pub unsafe fn setLocation(&self, location: GKAccessPointLocation);

        #[method(frameInScreenCoordinates)]
        pub unsafe fn frameInScreenCoordinates(&self) -> NSRect;

        #[cfg(feature = "AppKit_NSWindow")]
        #[method_id(@__retain_semantics Other parentWindow)]
        pub unsafe fn parentWindow(&self, mtm: MainThreadMarker) -> Option<Id<NSWindow>>;

        #[cfg(feature = "AppKit_NSWindow")]
        #[method(setParentWindow:)]
        pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);

        #[method(triggerAccessPointWithHandler:)]
        pub unsafe fn triggerAccessPointWithHandler(&self, handler: &Block<(), ()>);

        #[method(triggerAccessPointWithState:handler:)]
        pub unsafe fn triggerAccessPointWithState_handler(
            &self,
            state: GKGameCenterViewControllerState,
            handler: &Block<(), ()>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "GameKit_GKAccessPoint")]
    unsafe impl GKAccessPoint {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);