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

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

问题描述

使用Delphi XE2,是否可以在不使用FireMonkey进行GUI的情况下创建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函数调用类的方法并执行其他函数。它只是很多工作,因为类库是巨大的。你可以从核心基金会,然后一般的Foudnation,然后可可,石英等开始,这取决于你。您可能还想为课程写封包。

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.

目前,开箱即用,没有简单的方法来做你想要的。 / strong>

Currently, out of the box, there is no easy way to do what you want.

但是我打算写一个简单的应用程序作为可能的概念证明。这可能需要一些时间。

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

您还可以使用Embarcadero翻译的CoreFoundation标题,在Macapi 命名空间(即以Mac开头的所有单位),例如Macapi.ObjectiveC.pas ,Macapi.ObjcRuntime.pas ,Macapi.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天全站免登陆