Re: Cocoa window messages in app being ported from Carbon
Re: Cocoa window messages in app being ported from Carbon
- Subject: Re: Cocoa window messages in app being ported from Carbon
- From: "Glenn L. Austin via Cocoa-dev" <email@hidden>
- Date: Sat, 10 Aug 2019 15:09:07 -0700
> On Aug 10, 2019, at 2:02 PM, Kurt Bigler via Cocoa-dev
> <email@hidden> wrote:
>
> On 8/10/19 2:16:41 AM, Uli Kusterer wrote:
>> The Cocoa event handling code uses CarbonEvents under the hood. AFAIR, you
>> can switch to the Cocoa event loop right away, and Carbon windows will just
>> keep working.
>
> You're saying some interesting things. Given the demise of 32-bit, if this
> is still true, maybe the rumored internal 64-bit Carbon implementation might
> be deployed behind the scenes to support any portions of Cocoa that still
> depend on Carbon. None of that matters for now since obviously I'm doing the
> port on an older macOS.
"Carbon" seems to have split pretty early-on in the transition to Cocoa-only
into what I personally called "Core" and "HIToolbox." Most of the
underpinnings, such as CF, events, and menus, were brought up to 64-bit as a
part of "Core," it was the main parts of HIToolbox around windows, controls,
and views that directly "competed" with AppKit and never made the full
transition to 64-bit. I *suspect* that underlying the Cocoa window system sat
on top of the Carbon window system until the Metal version was available.
If you send a CarbonEvent that corresponds to a Cocoa event, the Cocoa event
"engine" will accept and handle it - vice versa with Cocoa events and
CarbonEvents. NSRunLoop is sitting on top of CFRunLoop - so if your Carbon
event code ever calls CFRunLoopStop, your entire event engine will just stop.
Never call CFRunLoopStop unless you want to quit - or you've nested the runloop
inside of another - like for modal dialogs.
I did much of the porting of a major application to a mixed Carbon and Cocoa
application and spent a lot of time working on getting events, menus, views,
and windows to "just work." They did, but there was a *lot* of code to
implement work-arounds for the most egregious of Carbon/Cocoa interaction
issues.
--
Glenn L. Austin, Computer Wizard and Race Car Driver <><
<http://www.austinsoft.com>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden