LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.
A CFArrayRef can be bridge toll-free to NSArray but I'm guessing that I can't return an ObjcId for a CFArrayRef and have it work properly. In the Objective-C version of the code the bridge as handled as follows:
@trevordevore: The CF types and the corresponding NS types are all compatible at the pointer level - the only thing which differs is that the CF APIs never returned autoreleased objects - so in this case it would return an ObjcRetainedId. Once put into an ObjcObject you can use it like you would the NS object..
@LCMark - how does one go about wrapping up CoreGraphics handlers? I see on Windows we use the `userlib>` syntax and parameters are passed directly to the function. In `objc:` we define the property names that are set in the "binds" syntax. My guess is that it behaves like Windows but either of the following syntax just gives me a crash.
private foreign handler CGWindowListCopyWindowInfo(in pListOptions as Integer, in pRelativeToWindow as optional CUint) returns ObjcRetainedId binds to "CGWindowListCopyWindowInfo"
private foreign handler CGWindowListCopyWindowInfo(in pListOptions as Integer, in pRelativeToWindow as optional CUint) returns ObjcRetainedId binds to "CoreGraphics>CGWindowListCopyWindowInfo"
private foreign handler CGWindowListCopyWindowInfo(in pListOptions as Integer, in pRelativeToWindow as CUint) returns ObjcRetainedId binds to "c:CoreGraphics.framework>CGWindowListCopyWindowInfo"
private foreign handler CGWindowListCopyWindowInfo(in pListOptions as Integer, in pRelativeToWindow as CUint) returns ObjcRetainedId binds to "c:CoreGraphics.framework>CGWindowListCopyWindowInfo"
So for CF CoreFoundation / C APIs that are part of the macOS system the binding string formula is c:FrameWorkBundleName.framework>functionName. This answers one of my questions too, thanks for the update!
For anyone interested, you can see the final implementation of CGWindowListCopyWindowInfo in the `NSWindowGetInfoForOpenWindows` handler in the following code: