polyhorn_ios_sys/polykit/
layout_event.rs1use objc::runtime::*;
2use objc::*;
3
4use crate::coregraphics::CGRect;
5use crate::Raw;
6
7pub struct PLYLayoutEvent {
11 object: *mut Object,
12}
13
14impl PLYLayoutEvent {
15 pub fn frame(&self) -> CGRect {
17 unsafe { msg_send![self.object, frame] }
18 }
19}
20
21impl Raw for PLYLayoutEvent {
22 unsafe fn from_raw(object: *mut Object) -> Self {
23 PLYLayoutEvent { object }
24 }
25
26 unsafe fn as_raw(&self) -> *mut Object {
27 self.object
28 }
29}
30
31impl Drop for PLYLayoutEvent {
32 fn drop(&mut self) {
33 unsafe { objc_release(self.object) }
34 }
35}