rust_macios/appkit/
ns_image.rs

1use objc::{msg_send, sel, sel_impl};
2
3use super::{interface_impl, NSImageName};
4
5use crate::{object, objective_c_runtime::traits::PNSObject};
6
7object! {
8    /// A high-level interface for manipulating image data.
9    unsafe pub struct NSImage;
10}
11
12#[interface_impl(NSObject)]
13impl NSImage {
14    /* Creating Images by Name
15     */
16
17    /// Returns the image object associated with the specified name.
18    #[method]
19    pub fn image_named(name: NSImageName) -> NSImage {
20        unsafe { msg_send![NSImage::m_class(), imageNamed: name] }
21    }
22}