use objc2::{extern_class, extern_methods, msg_send, rc::Retained, runtime::NSObject};
use objc2_foundation::NSString;
use crate::{
MTLDataType, MTLTextureType,
argument::{MTLArgumentType, MTLBindingAccess, MTLPointerType, MTLStructType},
};
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLArgument;
);
impl MTLArgument {
extern_methods!(
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub fn argument_type(&self) -> MTLArgumentType;
#[unsafe(method(access))]
#[unsafe(method_family = none)]
pub fn access(&self) -> MTLBindingAccess;
#[unsafe(method(index))]
#[unsafe(method_family = none)]
pub fn index(&self) -> usize;
#[unsafe(method(isActive))]
#[unsafe(method_family = none)]
pub fn is_active(&self) -> bool;
#[unsafe(method(bufferAlignment))]
#[unsafe(method_family = none)]
pub fn buffer_alignment(&self) -> usize;
#[unsafe(method(bufferDataSize))]
#[unsafe(method_family = none)]
pub fn buffer_data_size(&self) -> usize;
#[unsafe(method(bufferDataType))]
#[unsafe(method_family = none)]
pub fn buffer_data_type(&self) -> MTLDataType;
#[unsafe(method(bufferStructType))]
#[unsafe(method_family = none)]
pub fn buffer_struct_type(&self) -> Option<Retained<MTLStructType>>;
#[unsafe(method(bufferPointerType))]
#[unsafe(method_family = none)]
pub fn buffer_pointer_type(&self) -> Option<Retained<MTLPointerType>>;
#[unsafe(method(threadgroupMemoryAlignment))]
#[unsafe(method_family = none)]
pub fn threadgroup_memory_alignment(&self) -> usize;
#[unsafe(method(threadgroupMemoryDataSize))]
#[unsafe(method_family = none)]
pub fn threadgroup_memory_data_size(&self) -> usize;
#[unsafe(method(textureType))]
#[unsafe(method_family = none)]
pub fn texture_type(&self) -> MTLTextureType;
#[unsafe(method(textureDataType))]
#[unsafe(method_family = none)]
pub fn texture_data_type(&self) -> MTLDataType;
#[unsafe(method(isDepthTexture))]
#[unsafe(method_family = none)]
pub fn is_depth_texture(&self) -> bool;
#[unsafe(method(arrayLength))]
#[unsafe(method_family = none)]
pub fn array_length(&self) -> usize;
);
pub fn name(&self) -> String {
let ns: Retained<NSString> = unsafe { msg_send![self, name] };
ns.to_string()
}
}