diff --git a/src/appkit/app/delegate.rs b/src/appkit/app/delegate.rs index d9aca960..85a10be5 100644 --- a/src/appkit/app/delegate.rs +++ b/src/appkit/app/delegate.rs @@ -26,7 +26,7 @@ use crate::cloudkit::share::CKShareMetaData; /// standard `utils` version as this doesn't require `RefCell` backing. fn app(this: &Object) -> &T { unsafe { - let app_ptr: usize = *this.get_ivar(APP_PTR); + let app_ptr: usize = *this.ivar(APP_PTR); let app = app_ptr as *const T; &*app } diff --git a/src/appkit/app/mod.rs b/src/appkit/app/mod.rs index 7ec9a2a7..981cda65 100644 --- a/src/appkit/app/mod.rs +++ b/src/appkit/app/mod.rs @@ -193,7 +193,7 @@ where queue.exec_async(move || unsafe { let app: id = msg_send![register_app_class(), sharedApplication]; let app_delegate: id = msg_send![app, delegate]; - let delegate_ptr: usize = *(*app_delegate).get_ivar(APP_PTR); + let delegate_ptr: usize = *(*app_delegate).ivar(APP_PTR); let delegate = delegate_ptr as *const T; (&*delegate).on_ui_message(message); }); @@ -207,7 +207,7 @@ where queue.exec_async(move || unsafe { let app: id = msg_send![register_app_class(), sharedApplication]; let app_delegate: id = msg_send![app, delegate]; - let delegate_ptr: usize = *(*app_delegate).get_ivar(APP_PTR); + let delegate_ptr: usize = *(*app_delegate).ivar(APP_PTR); let delegate = delegate_ptr as *const T; (&*delegate).on_background_message(message); }); diff --git a/src/appkit/menu/item.rs b/src/appkit/menu/item.rs index aa871114..bda01ed5 100644 --- a/src/appkit/menu/item.rs +++ b/src/appkit/menu/item.rs @@ -293,7 +293,7 @@ impl MenuItem { /// need to do some extra logic to ensure release calls are properly sent. extern "C" fn dealloc_cacao_menuitem(this: &Object, _: Sel) { unsafe { - let ptr: usize = *this.get_ivar(BLOCK_PTR); + let ptr: usize = *this.ivar(BLOCK_PTR); let obj = ptr as *mut Action; if !obj.is_null() { diff --git a/src/color/appkit_dynamic_color.rs b/src/color/appkit_dynamic_color.rs index 1a0ee80c..eff259b2 100644 --- a/src/color/appkit_dynamic_color.rs +++ b/src/color/appkit_dynamic_color.rs @@ -64,21 +64,21 @@ fn get_effective_color(this: &Object) -> id { let style: id = msg_send![appearance, bestMatchFromAppearancesWithNames:&*names]; if style == NSAppearanceNameDarkAqua { - return *this.get_ivar(AQUA_DARK_COLOR_NORMAL_CONTRAST); + return *this.ivar(AQUA_DARK_COLOR_NORMAL_CONTRAST); } if style == NSAppearanceNameAccessibilityHighContrastAqua { - return *this.get_ivar(AQUA_LIGHT_COLOR_HIGH_CONTRAST); + return *this.ivar(AQUA_LIGHT_COLOR_HIGH_CONTRAST); } if style == NSAppearanceNameAccessibilityHighContrastDarkAqua { - return *this.get_ivar(AQUA_DARK_COLOR_HIGH_CONTRAST); + return *this.ivar(AQUA_DARK_COLOR_HIGH_CONTRAST); } } } unsafe { - return *this.get_ivar(AQUA_LIGHT_COLOR_NORMAL_CONTRAST); + return *this.ivar(AQUA_LIGHT_COLOR_NORMAL_CONTRAST); } } diff --git a/src/listview/row/appkit.rs b/src/listview/row/appkit.rs index 45603823..4b28f92a 100644 --- a/src/listview/row/appkit.rs +++ b/src/listview/row/appkit.rs @@ -72,7 +72,7 @@ extern "C" fn dragging_exited(this: &mut Object, _: Sel, info: /// Called for layer updates. extern "C" fn update_layer(this: &Object, _: Sel) { unsafe { - let background_color: id = *this.get_ivar(BACKGROUND_COLOR); + let background_color: id = *this.ivar(BACKGROUND_COLOR); if background_color != nil { let layer: id = msg_send![this, layer]; @@ -89,7 +89,7 @@ extern "C" fn update_layer(this: &Object, _: Sel) { extern "C" fn dealloc(this: &Object, _: Sel) { // Load the Box pointer here, and just let it drop normally. unsafe { - let ptr: usize = *(&*this).get_ivar(LISTVIEW_ROW_DELEGATE_PTR); + let ptr: usize = *(&*this).ivar(LISTVIEW_ROW_DELEGATE_PTR); let obj = ptr as *mut T; let _x = Box::from_raw(obj); diff --git a/src/listview/row/mod.rs b/src/listview/row/mod.rs index c5c73826..5c96cc66 100644 --- a/src/listview/row/mod.rs +++ b/src/listview/row/mod.rs @@ -218,7 +218,7 @@ where pub(crate) fn from_cached(view: id) -> ListViewRow { // @TODO: Make this better. let delegate = unsafe { - let ptr: usize = *(&*view).get_ivar(LISTVIEW_ROW_DELEGATE_PTR); + let ptr: usize = *(&*view).ivar(LISTVIEW_ROW_DELEGATE_PTR); let obj = ptr as *mut T; Box::from_raw(obj) //&*obj diff --git a/src/uikit/app/delegate.rs b/src/uikit/app/delegate.rs index f172a302..bfc5eeaa 100644 --- a/src/uikit/app/delegate.rs +++ b/src/uikit/app/delegate.rs @@ -28,7 +28,7 @@ use crate::cloudkit::share::CKShareMetaData; /// standard `utils` version as this doesn't require `RefCell` backing. fn app(this: &Object) -> &T { unsafe { - //let app_ptr: usize = *this.get_ivar(APP_DELEGATE); + //let app_ptr: usize = *this.ivar(APP_DELEGATE); let app = APP_DELEGATE as *const T; &*app } diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 257b0518..23583a18 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -44,7 +44,7 @@ pub trait Controller { /// checking. pub fn load<'a, T>(this: &'a Object, ptr_name: &str) -> &'a T { unsafe { - let ptr: usize = *this.get_ivar(ptr_name); + let ptr: usize = *this.ivar(ptr_name); let obj = ptr as *const T; &*obj } diff --git a/src/view/appkit.rs b/src/view/appkit.rs index e1fe4e8a..c31568b2 100644 --- a/src/view/appkit.rs +++ b/src/view/appkit.rs @@ -72,7 +72,7 @@ extern "C" fn dragging_exited(this: &mut Object, _: Sel, info: /// Called for layer updates. extern "C" fn update_layer(this: &Object, _: Sel) { unsafe { - let background_color: id = *this.get_ivar(BACKGROUND_COLOR); + let background_color: id = *this.ivar(BACKGROUND_COLOR); if background_color != nil { let layer: id = msg_send![this, layer]; diff --git a/src/webview/class.rs b/src/webview/class.rs index 816088e9..80d804fb 100644 --- a/src/webview/class.rs +++ b/src/webview/class.rs @@ -31,7 +31,7 @@ extern "C" fn alert(_: &Object, _: Sel, _: id, _: id, _: id, } /*unsafe { - let ptr: usize = *this.get_ivar(WEBVIEW_DELEGATE_PTR); + let ptr: usize = *this.ivar(WEBVIEW_DELEGATE_PTR); let delegate = ptr as *const T; (*webview).alert(alert); }*/