Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit 86c8d5f

Browse files
committed
Merge pull request #92 from SSheldon/core_graphics
Add core-graphics dependency
2 parents 10df8a7 + 297a2bf commit 86c8d5f

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ crate-type = ["rlib"]
1414
[dependencies]
1515
bitflags = "0.1"
1616
libc = "*"
17+
core-graphics = "*"
1718
objc = "0.1"

src/appkit.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,20 @@ use foundation::{NSInteger, NSUInteger, NSTimeInterval,
1414
NSPoint, NSSize, NSRect, NSRectEdge};
1515
use libc;
1616

17+
pub use core_graphics::base::CGFloat;
18+
pub use core_graphics::geometry::CGPoint;
19+
1720
pub use self::NSApplicationActivationPolicy::*;
1821
pub use self::NSWindowMask::*;
1922
pub use self::NSBackingStoreType::*;
2023
pub use self::NSOpenGLPixelFormatAttribute::*;
2124
pub use self::NSOpenGLPFAOpenGLProfiles::*;
2225
pub use self::NSEventType::*;
2326

24-
#[cfg(target_pointer_width = "32")]
25-
pub type CGFloat = f32;
26-
#[cfg(target_pointer_width = "64")]
27-
pub type CGFloat = f64;
28-
2927
pub type CGLContextObj = *mut libc::c_void;
3028

3129
pub type GLint = libc::int32_t;
3230

33-
#[repr(C)]
34-
pub struct CGPoint {
35-
pub x: CGFloat,
36-
pub y: CGFloat,
37-
}
38-
3931
#[link(name = "AppKit", kind = "framework")]
4032
extern {
4133
pub static NSAppKitVersionNumber: f64;

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#[macro_use]
1616
extern crate bitflags;
1717
extern crate libc;
18+
extern crate core_graphics;
1819
#[macro_use]
1920
extern crate objc;
2021

0 commit comments

Comments
 (0)