(&self)
| 71 | |
| 72 | impl Cursor { |
| 73 | pub fn load(&self) -> Retained<NSCursor> { |
| 74 | match self { |
| 75 | Cursor::Native(loader) => loader(), |
| 76 | Cursor::Undocumented(sel) => { |
| 77 | let class = NSCursor::class(); |
| 78 | |
| 79 | // NOTE: class.responds_to does not yield the same result (probably because NSCursor overrides respondsToSelector) |
| 80 | let responds_to: bool = unsafe { msg_send![class, respondsToSelector: *sel] }; |
| 81 | |
| 82 | if !responds_to { |
| 83 | return NSCursor::arrowCursor(); |
| 84 | } |
| 85 | |
| 86 | let raw: *mut NSCursor = unsafe { class.send_message(*sel, ()) }; |
| 87 | let cursor = unsafe { Retained::retain(raw) }; |
| 88 | |
| 89 | cursor.unwrap_or_else(NSCursor::arrowCursor) |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | } |
no outgoing calls
no test coverage detected