diff --git a/src/appkit/app/delegate.rs b/src/appkit/app/delegate.rs index 4f4fce31..963e50ac 100644 --- a/src/appkit/app/delegate.rs +++ b/src/appkit/app/delegate.rs @@ -21,7 +21,7 @@ use crate::user_activity::UserActivity; /// 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 ea058d3e..4129607b 100644 --- a/src/appkit/app/mod.rs +++ b/src/appkit/app/mod.rs @@ -195,7 +195,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); }); @@ -209,7 +209,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 7ea6c09b..678d626e 100644 --- a/src/appkit/menu/item.rs +++ b/src/appkit/menu/item.rs @@ -294,7 +294,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 37eaeca2..eca7d032 100644 --- a/src/color/appkit_dynamic_color.rs +++ b/src/color/appkit_dynamic_color.rs @@ -59,21 +59,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 76f97fb3..e989d681 100644 --- a/src/listview/row/appkit.rs +++ b/src/listview/row/appkit.rs @@ -69,7 +69,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]; @@ -86,7 +86,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 88210e64..78954fd0 100644 --- a/src/listview/row/mod.rs +++ b/src/listview/row/mod.rs @@ -221,7 +221,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 8c736675..fa236f22 100644 --- a/src/uikit/app/delegate.rs +++ b/src/uikit/app/delegate.rs @@ -21,7 +21,7 @@ use crate::uikit::scene::{SceneConnectionOptions, SceneSession}; /// 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 e962e9c1..2c9f019f 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -40,7 +40,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 d41440cc..ded30df0 100644 --- a/src/view/appkit.rs +++ b/src/view/appkit.rs @@ -69,7 +69,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 a50a9af9..a4bf4a69 100644 --- a/src/webview/class.rs +++ b/src/webview/class.rs @@ -30,7 +30,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); }*/