是否有类似于Windows WINAPI的Core Linux API,特别是用于创建GUI应用程序的API? [英] Is there a Core Linux API analogous to Windows WINAPI, in particular for creating GUI applications?

查看:173
本文介绍了是否有类似于Windows WINAPI的Core Linux API,特别是用于创建GUI应用程序的API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Windows编程(我指的是使用Windows API的Windows编程)转向Linux编程.

对于Windows编程,我们拥有的选项是Win32API(MFC只是一个相同的C ++包装器).

我想知道是否有像Linux API这样的东西(相当于WINAPI)直接暴露给程序员?在哪里可以找到参考?

在我对POSIX库不甚了解的情况下,我发现它环绕部分 Linux API.但是如何创建GUI应用程序??POSIX不提供这种功能.我知道有大量的第三方Widget工具包,例如gtk,Qt等.但是我不想使用封装Linux API的库.我想学习使用"Core Linux API".

如果我应该知道一些事情,请告知.熟悉Windows和Windows XP的任何程序员. Linux编程,请映射Linux世界的术语,以便我快速前进.

任何资源(书籍,教程,参考文献)均受到高度赞赏.

解决方案

我认为您正在寻找的东西并不完全存在.与Win32 API不同,没有用于执行GUI应用程序的"Linux API".您可以得到的最接近的是 X协议本身,这是做GUI的相当低级的方法(例如,它比Win32 GDI更为详细和古老).这就是为什么存在诸如GTK和Qt之类的包装程序来隐藏X协议的细节的原因.

使用 XLib 的C程序可以使用X协议. /p>

I'm moving from windows programming (By windows programming I mean using Windows API) to Linux Programming.

For programming Windows, the option we have is Win32API (MFC is just a C++ wrapper for the same).

I want to know if there is something like Linux API (equivalent to WINAPI) that is exposed directly to the programmer? Where can I find the reference?

With my little knowledge of POSIX library I see that it wraps around part of Linux API. But what about creating GUI applications? POSIX doesn't offer that. I know there are tons of 3rd party Widget toolkits like gtk, Qt etc. But I don't want to use the libraries that encapsulates Linux API. I want to learn using the "Core Linux API".

If there are somethings that I should know, please inform. Any programmer who is familiar with both Windows & Linux programming, please map the terminologies of Linux world so that I can quickly move on.

Any resources (books,tutorials,references) are highly appreciated.

解决方案

I think you're looking for something that doesn't exactly exist. Unlike the Win32 API, there is no "Linux API" for doing GUI applications. The closest you can get is the X protocol itself, which is a pretty low level way of doing GUI (it's much more detailed and archaic than Win32 GDI, for example). This is why there exist wrappers such as GTK and Qt that hide the details of the X protocol.

The X protocol is available to C programs using XLib.

这篇关于是否有类似于Windows WINAPI的Core Linux API,特别是用于创建GUI应用程序的API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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