Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core-graphics/src/event_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ impl CGEventSource {
}
}
}

pub unsafe fn get_location(&self) -> CGPoint {
CGEventSourceGetLocation(self.as_ptr() as *mut _)
}
}

#[cfg_attr(feature = "link", link(name = "CoreGraphics", kind = "framework"))]
Expand All @@ -45,4 +49,6 @@ extern "C" {

/// Return a Quartz event source created with a specified source state.
fn CGEventSourceCreate(stateID: CGEventSourceStateID) -> crate::sys::CGEventSourceRef;

fn CGEventSourceGetLocation(source: *mut sys::CGEventSource) -> CGPoint;
}