Adobe 如何使 Photoshop 跨平台?
我只是想知道 Adobe 如何使 Photoshop 跨平台?我知道 Photoshop 完全是用 C++ 编写的,但是 GUI 呢? Adobe 使用 GUI 工具包吗?
I want just know how Adobe makes Photoshop cross-platform? I know Photoshop is written completely in C++, but what about the GUI? Does Adobe use GUI toolkits?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于任何本机编译的跨平台项目,解决方案通常是专门为特定平台编写一小部分称为“包装器”的代码。这些包装器直接与平台进行所有对话。
这使得像 Photoshop 这样的应用程序具有多平台性,但它不一定构建在 Adobe 尚未为其编写包装器的平台上。
For any natively compiled, cross-platform project, the solution is typically to have small portions of the code called "wrappers" written exclusively for specific platforms. These wrappers do all the talking directly to the platform.
This makes an app like Photoshop multi-platform, but it wouldn't necessarily build on a platform that Adobe hasn't written wrappers for.
编写跨平台软件很乏味,但这里有一些简单的规则。
通常,您需要使用底层操作系统/环境的抽象,以便您的代码依赖于该抽象而不是操作系统本身。这称为桥接模式。重要的是要了解,为程序和操作系统之间的桥梁添加的功能越多,移植软件就越困难。就 Adobe 而言,他们使用操作系统的相对较小部分(小桥),因为他们有自己的 UI 和文本处理,因此他们只需要捕获鼠标/键盘输入并能够在窗口中绘图。
Writing cross platform software is tedious but here are the simple rules.
Generally you need to work with an abstraction of the underlying OS / environment, so that your code depends on this abstraction instead of the OS itself. This is called a bridge pattern. It is important to understand the more features you add to the bridge between your program and the OS the more difficult it will be to port the software. In the case of Adobe they use a relatively small part of the OS (tiny bridge) as they have their own UI and text processing so they just need to capture mouse/keyboard input and be able to draw in a window.