Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cocoa wrappers #4

Open
JayKickliter opened this issue Jul 11, 2015 · 5 comments
Open

Add Cocoa wrappers #4

JayKickliter opened this issue Jul 11, 2015 · 5 comments

Comments

@JayKickliter
Copy link

This commented out line is breaking the Cocoa functionality of the package.

Was it because nsrect isn't working? I had to definition to this to get it to work:

nsrect(x, y, w, h) =
  ccall((:nsmakerect, "cocoa"), Ptr{Void}, (Cfloat, Cfloat, Cfloat, Cfloat),
        x, y, w, h)
@MikeInnes
Copy link
Collaborator

Honestly, I can't remember – it's been a while since I worked on this.

If you want to patch up these issues through a PR you'd be very welcome – otherwise I probably won't get round to it for a while.

@JayKickliter
Copy link
Author

Ok. I'll see what I can do. Same with the other issue.

@vtjnash
Copy link

vtjnash commented Jul 12, 2015

fwiw, julia v0.4 can call NSMakeRect directly by mirroring the struct layout into julia types, and thus no longer requires the .m shim:

immutable NSPoint
x::Cfloat
y::Cfloat
end
immutable NSSize
width::Cfloat
height::Cfloat
end
immutable NSRect
origin::NSPoint
size::NSSize
end
ccall((:NSMakeRect, "Foundation"), NSRect, (Cfloat, Cfloat, Cfloat, Cfloat), x, y, w, h)

@MikeInnes
Copy link
Collaborator

Awesome, this will help us get rid of the last bits of Objective-C code – thanks for providing the example.

One tricky part is that currently method signatures are loaded dynamically. Presumably we'll have to either generate the corresponding types dynamically too, or force type hints for structs. (Perhaps tuples will work in place of immutable types?)

@maleadt maleadt changed the title Export Cocoa Add Cocoa wrappers Mar 8, 2023
@maleadt
Copy link
Member

maleadt commented Mar 8, 2023

As part of #11 I removed the Cocoa wrappers entirely, so if anybody is interested in bringing them back: have a look at the state of the package at commit https://github.com/JuliaInterop/ObjectiveC.jl/tree/22118319da1fb7601d2a3ecefb671ffbb5e57012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants