保持传统 Carbon 代码的活力
Apple 已经取消了 64 位应用程序的 Carbon。我有一堆针对碳 UI 小部件的遗留代码,我想将它们保留一段时间。其中大部分都是插件和捆绑包的形式,必须与主机平台同步为 64 位。
苹果似乎做出的选择是扔掉所有遗留代码 并使用 Cocoa 重写。短期内这不会发生,因为 相同的遗留代码也与 PC 绑定相关联。
我正在考虑 3 个选项
(1) 深入研究 cocoa,创建一个支持小子集的兼容性包 我真正需要的碳。
(2)使用Cocoatron作为新靶材。从短期来看,将carbon 与cocotron 连接起来,从长远来看,可能会转换为mac 和pc 原生的cocoatron。 (ref: http://cocotron.org/)
(3) 使用QT作为新目标。参见选项(2)。 (参考:http://qt.nokia.com/)
我真正更喜欢的是第四种选择,例如 64 位的盗版副本 Apple 取消的 Carbon beta 版,或者明确打算的兼容性包 来模拟碳。
Apple has killed Carbon for 64 bit applications. I've got a pile of legacy code that targets carbon UI widgets that I'd like to keep alive for a while. Most of it is in the form of plugins and bundles that will have to go 64-bit in sync with their host platform.
The choice that Apple seems to be assuming is to throw all the legacy code away
and rewrite using Cocoa. It's not going to happen in the short run, if only because
the same legacy code is tied to a PC binding as well.
I'm considering 3 Options
(1) Dive into cocoa, create a compatibility package that supports the small subset
of carbon that I actually need.
(2) use Cocoatron as the new target. In the short run bridge carbon-to-cocotron, and maybe in the longer run convert to cocoatron native for both mac and pc. (ref: http://cocotron.org/)
(3) use QT as the new target. See option (2). (ref: http://qt.nokia.com/)
What I would really prefer is a fourth option, such as a bootleg copy of the 64 bit
Carbon beta that Apple killed, or a compatibility package explicitly intended just
to emulate carbon.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您选择选项 1。为您的代码创建 Cocoa UI 包装器可能不会像您想象的那么复杂。创建跨平台应用程序的一种常见方法是使用跨平台 C++ 创建应用程序的大部分内容,并针对 Mac UI 使用 Cocoa/Objective-C++,针对 Windows UI 使用 Windows API 之一。
此选项还有一个优点,即得到 Apple 的完全支持,并且 API 稳定且成熟。
Cocotron 是一个好主意,但到目前为止,它还不够成熟(在我看来),无法提供强大的跨平台解决方案。我知道它已经取得了成功,但样本量很小。
Qt 是一种选择。然而,它的用户界面与 Mac 非常不一样。在 Mac 上使用 Qt 应用程序总是感觉像是一个快速移植而不是一个本机应用程序,而且这一点不太可能改变。
“盗版 Carbon 运行时”只是一个幻想,根本没有办法让它可靠地工作,也绝对没有机会分发它。您将需要找到另一种方法。
I would recommend you choose option 1. Creating a Cocoa UI wrapper for your code will likely not be as complex as you think. A common way to create a cross-platform app is to create the bulk of the app in cross-platform C++ and use Cocoa/Objective-C++ for the Mac UI and one of the Windows APIs for the Windows UI.
This option also has the advantage that it is fully supported by Apple and the APIs are stable and mature.
Cocotron is a nice idea but as of now it's not mature enough (in my opinion) to provide a robust cross-platform solution. I know there are successes with it but the sample size is small.
Qt is an option. However, it suffers from a very un-Mac-like UI. Using a Qt app on the Mac always feels like a quick port rather than a native app, and this is unlikely to ever change.
The "bootleg Carbon runtime" is just a fantasy, there is simply no way to get that working reliably and absolutely no chance to distribute it. You will need to find another way.