是否有允许使用 C++ 类对 Carbon 应用程序进行编程的库/框架? [英] Is there a library / framework that allows to program a Carbon application using C++ classes?

查看:57
本文介绍了是否有允许使用 C++ 类对 Carbon 应用程序进行编程的库/框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有允许使用 C++ 类创建 Carbon 应用程序的库?

Is there any library that allows to create a Carbon application using C++ classes?

推荐答案

曾经有一个名为 PowerPlant 的 C++ 框架,与 Metrowerks 捆绑在一起.它现已开源:Open PowerPlant.啊,那些日子...

There was once a C++ framework called PowerPlant, bundled with Metrowerks. It's now open sourced: Open PowerPlant. Ah, those were the days...

还有一个叫做 MacApp,最初由苹果自己维护.但它在过渡到 OS X 的过程中被放弃了.一些铁杆支持者似乎在维护一个分支,显然:ClubMacApp.

There was also something called MacApp, originally maintained by Apple itself. But it was abandoned during its transition to OS X. Some hardcore supporters seem to maintain a fork, apparently: ClubMacApp.

您可以使用 Qt,这是一个受人尊敬的跨平台 C++ GUI 库.它建立在 Carbon 之上,但现在却建立在 Cocoa 之上.

You can use Qt which is a respectable cross-platform C++ GUI library. It was built on top of Carbon, but it's now on top of Cocoa.

wxWidgets 也是一个跨平台的 C++ GUI 库.它再次从基于碳的过渡到基于可可的.

wxWidgets is also a cross platform C++ GUI library. Again it is in transition from Carbon-based to Cocoa-based.

Carbon 本身,自 OS X 10.2 Tiger 起,有一个名为 HIToolbox 的对象系统,由 C 接口公开,参见 Apple 指南,但它是为了解较旧的经典 Toolbox 的人编写的.有一个围绕它的 C++ 框架,包含在 Apple 的示例代码中,称为 HIFramework.

Carbon itself, since OS X 10.2 Tiger, has an object system called HIToolbox, exposed by a C-interface, see Apple's guide, but it's written for people who knew the older, classic Toolbox. There's a C++ framework around it, included in Apple's sample codes, called HIFramework.

也就是说,强烈建议学习Objective-C并使用Cocoa.原因是多方面的:

  1. Apple 有效地停止向 Carbon 框架的 GUI 部分添加功能.它不适用于 64 位等.

  1. Apple effectively stopped adding features to the GUI portion of Carbon framework. It's not available in 64 bit, etc.

如果您已经了解 C++ 并因此具有指针等方面的工作知识,那么学习 Objective-C 非常容易.这实际上需要一天,仅此而已.有关 Objective-C 和 C++ 的比较,请参阅这篇总结得很好的文档由 P. Chatelier.对于那些已经了解 C++ 的人来说,这真的非常非常好.

If you already know C++ and thus have a working knowledge of pointers etc, it's very easy to learn Objective-C. It takes literally a day and that's it. For a comparison of Objective-C and C++, see this nicely summarized document by P. Chatelier. It is really, really good for those who know C++ already.

在任何情况下,真正困难的部分是习惯框架本身,无论是 Carbon 还是 Cocoa,它在很大程度上独立于语言.不幸的是,'Net 上的 Carbon 资源非常贫乏,而且它们也相当陈旧.(我只知道 CarbonDev 和可敬的 Macintosh C Carbon.)在过渡到 OS X 后,Apple 为 Carbon 做了许多不错的补充,但除了Apple 自己的简洁文档.只需比较 SO 上标记为 carboncocoa 的问题数量即可.您有更多关于可可的信息.

In any case the really hard part is getting used to the framework itself, be it Carbon or Cocoa, which is largely independent of the language. Unfortunately the resource on Carbon is very meagre on 'Net, and they are also rather dated. (The only things I know are CarbonDev and the venerable Macintosh C Carbon.) Apple made many nice additions to Carbon after they transitioned to OS X, but there is very few info on them except Apple's own terse documentation. Just compare the number of questions tagged carbon and cocoa on SO. You have so much more available about Cocoa.

这篇关于是否有允许使用 C++ 类对 Carbon 应用程序进行编程的库/框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆