Delphi XE2:是否可以在没有 FireMonkey 的情况下创建 Mac GUI 应用程序? [英] Delphi XE2: Is it possible to create Mac GUI applications without FireMonkey?

查看:28
本文介绍了Delphi XE2:是否可以在没有 FireMonkey 的情况下创建 Mac GUI 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Delphi XE2,是否可以在不使用 FireMonkey 的情况下创建 Mac GUI 应用程序?如果是这样,可以使用什么以及如何去做?

Using Delphi XE2, is it possible to create a Mac GUI application without using FireMonkey for the GUI? If so, what could be used and how would one go about it?

推荐答案

原则上是可以的.但是您需要翻译 Apple 公开的 Objective-C 头文件和类.这是一项艰巨的任务,其中一部分已经由 FreePascal 人员或 Objective-Pascal 人员完成.

In principle, it is possible. But you'd need to translate the Objective-C headers and classes exposed by Apple. That is a huge task, part of which has already been done by the FreePascal people or the Objective-Pascal people.

但是没有什么可以阻止您自己翻译(丢失的)标题.您可以使用 Objective-C 运行时中的纯 C 函数调用类的方法并执行其他功能 本页描述.这只是大量工作,因为类库很大.您可以从 Core Foundation 开始,然后是一般的 Foudnation,然后是 Cocoa、Quartz 等.这取决于您.您可能还想为类编写包装器.

But nothing prevents you from translating the (missing) headers yourself. You can call methods of a class and perform other functions using the pure C functions in the Objective-C runtime described on this page. It is just a lot of work, as the class library is huge. You could start with the Core Foundation, then the general Foudnation and then Cocoa, Quartz, etc. That is up to you. You'd probably also want to write wrappers for the classes.

目前,开箱即用,没有简单的方法可以做您想做的事.

但我计划编写一个简单的应用程序来证明它是可能的.不过,这可能需要一些时间.

But I plan to write a simple app as proof of concept that it is possible. That might take some time, though.

您还可以在 Macapi 命名空间中使用由 Embarcadero 翻译的 CoreFoundation 标头(即所有以 Macapi 开头的单元,例如 Macapi.ObjectiveC.pasMacapi.ObjcRuntime.pasMacapi.CocoaTypes.pas 等),以及 System.Mac.CFUtils.在那里您将找到(一些)主要的 CoreFoundation 类以及从 Delphi 使用它们的简单方法.不过,我不确定这些是否已正确记录,因此您必须自己了解如何使用它们.代码中的注释或许能帮到你.

You can also use the CoreFoundation headers translated by Embarcadero, in the Macapi namespace (i.e. all units that start with Macapi, like Macapi.ObjectiveC.pas, Macapi.ObjcRuntime.pas, Macapi.CocoaTypes.pas, etc), as well as System.Mac.CFUtils. There you'll find (some of) the major CoreFoundation classes and easy ways to use them from Delphi. I am not sure if these are properly documented, though, so you'll have to find out yourself how to use them. The comments in code might be able to help you.

可以在在 docwiki 中找到有关此的更多信息.请注意,控制台应用程序也可以具有 GUI.

A little more about this can be found in the docwiki. Note that a console app can also have a GUI.

是的,绝对有可能.请参阅 http://rvelthuis.de/zips/sampleniblessapp.7z.请注意,最重要的 Macapi 单元是 Macapi.AppKit.

Yes, it is definitely possible. See http://rvelthuis.de/zips/sampleniblessapp.7z . Note that the most important Macapi unit turned out to be Macapi.AppKit.

这篇关于Delphi XE2:是否可以在没有 FireMonkey 的情况下创建 Mac GUI 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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