DEV Community

Cover image for A new cross-platform GUI framework
setoutsoft
setoutsoft

Posted on

A new cross-platform GUI framework

I'm going to introduce my work to you here. After 8 monthes hard work, the project SwinX can be run perfectly now, you can treat it as a minimal Wine. I published it to github (https://github.com/soui4/swinx). SwinX means simple windows APIs for cross platforms. Most windows APIs which are commonly used in a GUI program were implemented in SwinX, including HWND relevent APIs, message APIs, gdi APIs and kenerl objects (event, mutex, semaphore etc.). The other GUI project SOUI that also owned by me was used to verify SwinX. SOUI is an GUI open source project (repo: https://github.com/soui4/soui) used for windows.
After few of modifications, by linked to SwinX, almost all of functions implemented in SOUI can work for Linux now, including Ubuntu, Debian, Centos, Fedora.

For now, we had very few options when one want to develop a cross platform GUI program. except for Qt, GTK and Electron. However, if one need transplant an existed project that built for Windows to Linux, we almost has no option (Wine may be an option, but it can't work for large scale project at most time.)

To build the project, I suggest you starting from cloning SOUI from github (using the master branch). SOUI references SwinX using git submodule. As I'm an Chinese, the submodule reference by SOUI is owned by Gitee that is commonly used in China. If you can't visit Gitee, you can change the submodule to Github manually. SwinX depends on including XCB, cairo and other packages. You can find build.md in SwinX repo. After install the necessary packages, you can build SOUI on Linux and run all of demos.
Any questions or suggestions you can ask me here or send me mail: setoutsoft@qq.com.
Thank you very much!

Top comments (1)

Collapse
 
setoutsoft profile image
setoutsoft

To building a cross-platform PC app, amost the only option is to use Qt. However, Qt is much expensive, and people must rewrite their code if they had build a program for windows. With Swinx, the question will not a question.