objc2-watch-kit 0.3.2

Bindings to the WatchKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-scene-kit")]
use objc2_scene_kit::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkinterfacescnscene?language=objc)
    #[unsafe(super(WKInterfaceObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "WKInterfaceObject")]
    pub struct WKInterfaceSCNScene;
);

#[cfg(feature = "WKInterfaceObject")]
extern_conformance!(
    unsafe impl NSObjectProtocol for WKInterfaceSCNScene {}
);

#[cfg(all(feature = "WKInterfaceObject", feature = "objc2-scene-kit"))]
extern_conformance!(
    unsafe impl SCNSceneRenderer for WKInterfaceSCNScene {}
);

#[cfg(feature = "WKInterfaceObject")]
impl WKInterfaceSCNScene {
    extern_methods!(
        #[deprecated = "Use SceneKit.SceneView instead."]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "objc2-scene-kit")]
        /// Specifies the scene of the receiver
        #[unsafe(method(scene))]
        #[unsafe(method_family = none)]
        pub unsafe fn scene(&self) -> Option<Retained<SCNScene>>;

        #[cfg(feature = "objc2-scene-kit")]
        /// Setter for [`scene`][Self::scene].
        #[unsafe(method(setScene:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScene(&self, scene: Option<&SCNScene>);

        #[cfg(feature = "objc2-ui-kit")]
        /// Draws the contents of the view and returns them as a new image object
        ///
        /// This method is thread-safe and may be called at any time.
        #[unsafe(method(snapshot))]
        #[unsafe(method_family = none)]
        pub unsafe fn snapshot(&self) -> Retained<UIImage>;

        /// The rate you want the view to redraw its contents.
        ///
        /// When your application sets its preferred frame rate, the view chooses a frame rate as close to that as possible based on the capabilities of the screen the view is displayed on. The actual frame rate chosen is usually a factor of the maximum refresh rate of the screen to provide a consistent frame rate. For example, if the maximum refresh rate of the screen is 60 frames per second, that is also the highest frame rate the view sets as the actual frame rate. However, if you ask for a lower frame rate, it might choose 30, 20, 15 or some other factor to be the actual frame rate. Your application should choose a frame rate that it can consistently maintain.
        /// The default value is 0 which means the display link will fire at the native cadence of the display hardware.
        #[unsafe(method(preferredFramesPerSecond))]
        #[unsafe(method_family = none)]
        pub unsafe fn preferredFramesPerSecond(&self) -> NSInteger;

        /// Setter for [`preferredFramesPerSecond`][Self::preferredFramesPerSecond].
        #[unsafe(method(setPreferredFramesPerSecond:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPreferredFramesPerSecond(&self, preferred_frames_per_second: NSInteger);

        #[cfg(feature = "objc2-scene-kit")]
        /// Defaults to SCNAntialiasingModeNone.
        #[unsafe(method(antialiasingMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn antialiasingMode(&self) -> SCNAntialiasingMode;

        #[cfg(feature = "objc2-scene-kit")]
        /// Setter for [`antialiasingMode`][Self::antialiasingMode].
        #[unsafe(method(setAntialiasingMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAntialiasingMode(&self, antialiasing_mode: SCNAntialiasingMode);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "WKInterfaceObject")]
impl WKInterfaceSCNScene {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}