Search found 867 matches

by trevordevore
Tue Jul 10, 2018 4:00 am
Forum: LiveCode Builder
Topic: Specifying supported platforms in Inclusions entry for LCB extension?
Replies: 0
Views: 192

Specifying supported platforms in Inclusions entry for LCB extension?

I have some extensions that use FFI and are specific to a single platform. In the Standalone Builder > Inclusions tab I want the supported platform icons to represent the supported platform. Looking at revsblibrary.livecodescript I can see that extensions are hard coded to be supported on all platfo...
by trevordevore
Wed Jun 20, 2018 3:07 am
Forum: LiveCode Builder
Topic: Sparkle macOS App Updater extension for LC 9 [First Pass]
Replies: 0
Views: 362

Sparkle macOS App Updater extension for LC 9 [First Pass]

Hi all, I've been doing quite a bit of work with the Foreign Function Interface (FFI) in LiveCode Builder (LCB) lately. As I make the shift to a 64-bit app on macOS I want to convert most of the custom externals I use to LCB. I think they will be easier to improve going forward. Today I finished a f...
by trevordevore
Fri Jun 15, 2018 4:20 pm
Forum: LiveCode Builder
Topic: Help with macOS system status bar menu
Replies: 9
Views: 642

Re: Help with macOS system status bar menu

I now have the code to the point where no crashing occurs. I'm not exactly sure how I got there. It seems I had to store some ObjcObjects in a handler local variable and then assign that variable to a script local. That seems odd but I'll figure that out later. I still can't get an icon to appear in...
by trevordevore
Fri Jun 15, 2018 2:36 pm
Forum: LiveCode Builder
Topic: CGWindowListCopyWindowInfo, CFArrayRef, NSArray, and __bridge
Replies: 6
Views: 464

Re: CGWindowListCopyWindowInfo, CFArrayRef, NSArray, and __bridge

For anyone interested, you can see the final implementation of CGWindowListCopyWindowInfo in the `NSWindowGetInfoForOpenWindows` handler in the following code:

https://github.com/trevordevore/lc-maco ... window.lcb
by trevordevore
Fri Jun 15, 2018 1:20 pm
Forum: LiveCode Builder
Topic: [Solved] Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]
Replies: 4
Views: 311

Re: Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]

@LCMark - Thanks, that fixed it! I had a similar problem with a handler I wrote early on in my experiments. I had defined a parameter in a foreign handler as Integer instead of CUInt. Nothing crashed but the handler didn't work. Once I noticed the problem everything magically fell into place.
by trevordevore
Thu Jun 14, 2018 6:48 pm
Forum: LiveCode Builder
Topic: [Solved] Crash when trying to access [NSCursor hotpot] and [NSImage size]
Replies: 3
Views: 175

Re: Crash when trying to access [NSCursor hotpot] and [NSImage size]

@LCMark - I forgot to update this thread after Monte helped me last night on Gitter. In the code I have working locally I am using qq. That works in 64-bit. It will crash if the engine is running in 32-bit mode. NN won’t crash in 32-but mode but it won’t return correct values. I added a note about t...
by trevordevore
Wed Jun 13, 2018 11:01 pm
Forum: LiveCode Builder
Topic: [Solved] Crash when trying to access [NSCursor hotpot] and [NSImage size]
Replies: 3
Views: 175

[Solved] Crash when trying to access [NSCursor hotpot] and [NSImage size]

I'm working with [NSCursor] and I'm trying to get hotspot and image size information. I've successfully extracted PNG image data of the cursor and return that to LCS. I am getting crashes when I try to access the [NSCursor hotSpot] and [NSImage size]. No crash report is generated so there isn't much...
by trevordevore
Wed Jun 13, 2018 5:15 pm
Forum: LiveCode Builder
Topic: [Solved] Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]
Replies: 4
Views: 311

Re: Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]

I've been unable to figure out what is causing the crash when calling [NSRunningApplication -activateWithOptions:]. I've confirmed that I am getting an object with class NSRunningApplication by extracting the object returned in an array by [NSRunningApplication +runningApplicationsWithBundleIdentifi...
by trevordevore
Wed May 16, 2018 6:53 pm
Forum: LiveCode Builder
Topic: [Solved] Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]
Replies: 4
Views: 311

Re: Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]

I've determined that you don't need to pass an ObjcId to runningApplicationWithProcessIdentifier as it is a class property. The following code returns a valid reference to a running application: private foreign handler ObjC_NSRunningApplicationRunningApplicationWithProcessIdentifier(in pId as CInt) ...
by trevordevore
Tue May 15, 2018 2:32 pm
Forum: LiveCode Builder
Topic: Returning pointers to LCS
Replies: 2
Views: 307

Returning pointers to LCS

I was wrapping the Windows API call GetActiveWindow() today and wanted to return the value to LCS. GetActiveWindow() returns a HWND which is a pointer. I couldn't find a way to return the integer value (the windowId property of a stack) by working with a Pointer. I then found IntPtr which works for ...
by trevordevore
Tue May 15, 2018 3:22 am
Forum: LiveCode Builder
Topic: CGWindowListCopyWindowInfo, CFArrayRef, NSArray, and __bridge
Replies: 6
Views: 464

Re: CGWindowListCopyWindowInfo, CFArrayRef, NSArray, and __bridge

Monte helped me figure this out. Here is the correct FFI syntax:

Code: Select all

private foreign handler CGWindowListCopyWindowInfo(in pListOptions as Integer, in pRelativeToWindow as CUint) returns ObjcRetainedId binds to "c:CoreGraphics.framework>CGWindowListCopyWindowInfo"
by trevordevore
Mon May 14, 2018 9:50 pm
Forum: LiveCode Builder
Topic: [Solved] Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]
Replies: 4
Views: 311

[Solved] Help wrapping `[NSRunningApplication runningApplicationWithProcessIdentifier: pid]

I'm struggling to wrap `[NSRunningApplication runningApplicationWithProcessIdentifier: t_psn]. Here are the docs: https://developer.apple.com/documentation/appkit/nsrunningapplication/1530730-runningapplicationwithprocesside?language=objc You can find the full source code that will compile in LC 9 h...
by trevordevore
Sat May 12, 2018 7:22 pm
Forum: LiveCode Builder
Topic: CGWindowListCopyWindowInfo, CFArrayRef, NSArray, and __bridge
Replies: 6
Views: 464

Re: CGWindowListCopyWindowInfo, CFArrayRef, NSArray, and __bridge

@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 ...

Go to advanced search