objc2-gl-kit 0.3.2

Bindings to the GLKit 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-open-gl")]
#[cfg(target_os = "macos")]
use objc2_open_gl::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/glkit/glktexturetarget?language=objc)
// NS_ENUM
#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GLKTextureTarget(pub GLenum);
#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
impl GLKTextureTarget {
    #[doc(alias = "GLKTextureTarget2D")]
    pub const Target2D: Self = Self(3553);
    #[doc(alias = "GLKTextureTargetCubeMap")]
    pub const TargetCubeMap: Self = Self(34067);
    #[doc(alias = "GLKTextureTargetCt")]
    pub const TargetCt: Self = Self(2);
}

#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
unsafe impl Encode for GLKTextureTarget {
    const ENCODING: Encoding = GLenum::ENCODING;
}

#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
unsafe impl RefEncode for GLKTextureTarget {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/glkit/glktextureenvmode?language=objc)
// NS_ENUM
#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GLKTextureEnvMode(pub GLint);
#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
impl GLKTextureEnvMode {
    #[doc(alias = "GLKTextureEnvModeReplace")]
    pub const Replace: Self = Self(0);
    #[doc(alias = "GLKTextureEnvModeModulate")]
    pub const Modulate: Self = Self(1);
    #[doc(alias = "GLKTextureEnvModeDecal")]
    pub const Decal: Self = Self(2);
}

#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
unsafe impl Encode for GLKTextureEnvMode {
    const ENCODING: Encoding = GLint::ENCODING;
}

#[cfg(feature = "objc2-open-gl")]
#[cfg(target_os = "macos")]
unsafe impl RefEncode for GLKTextureEnvMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

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

#[cfg(feature = "GLKEffectProperty")]
impl GLKEffectPropertyTexture {
    extern_methods!(
        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        #[unsafe(method(enabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn enabled(&self) -> GLboolean;

        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        /// Setter for [`enabled`][Self::enabled].
        #[unsafe(method(setEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEnabled(&self, enabled: GLboolean);

        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> GLuint;

        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        /// Setter for [`name`][Self::name].
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setName(&self, name: GLuint);

        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        #[unsafe(method(target))]
        #[unsafe(method_family = none)]
        pub unsafe fn target(&self) -> GLKTextureTarget;

        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        /// Setter for [`target`][Self::target].
        #[unsafe(method(setTarget:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTarget(&self, target: GLKTextureTarget);

        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        #[unsafe(method(envMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn envMode(&self) -> GLKTextureEnvMode;

        #[cfg(feature = "objc2-open-gl")]
        #[cfg(target_os = "macos")]
        /// Setter for [`envMode`][Self::envMode].
        #[unsafe(method(setEnvMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEnvMode(&self, env_mode: GLKTextureEnvMode);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "GLKEffectProperty")]
impl GLKEffectPropertyTexture {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}