- C 90.5%
- CMake 9.5%
| src | ||
| .editorconfig | ||
| .gitignore | ||
| CMakeLists.txt | ||
| COPYING | ||
| cross-mingw-toolchain.cmake | ||
| README.md | ||
DoorPad
An open source alternative to the good and old Microsoft Notepad.
This is very much a toy project of mine for trying to create something (I hope) small and concise. I don't think I would normally torture myself with using the Win32 C API.
It strives to be small, minimalist, lightweight, fast, and no more than what it needs to be.
Why?
I was curious about trying to make an app that is lightweight as possible, so a Notepad clone in plain C didn't seem that impossible.
Who needs all of those fancy new libraries that are easy to use and a text editor with so many features anyway? /s
But most importantly it's because it's fun. I learn a lot while doing it.
Build
We can generate and build the project entirely with CMake.
cmake -B build -S .
cmake --build build
And the binary executable will be ready to use inside the build directory!
Building on Linux
Wait, you can build and run a Win32 program on Linux? Yes, of course you can!
You'll only need to have MinGW (for cross-compiling) and Wine (to run the executable) installed.
Then we can generate with one extra flag:
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=cross-mingw-toolchain.cmake
cmake --build build
If MinGW is not installed on /usr/x86_64-w64-mingw32, you'll need to use -DCMAKE_FIND_ROOT_PATH=/path/to/mingw/install.
Done that, the binary executable will be runnable using Wine:
wine build/doorpad.exe
Please note that Wine isn't perfect, not even with a simple API as Win32's. Wine has a bug on its RichEdit zoom implementation. It simply doesn't work or it messes up the font. I don't know how to fix it. Maybe that's a possible contribution to the project, some day.
If the Windows aren't open, use the door!
Projects thanks/acknowledgements
Some code tricks and snippets were taken from metapad¹, licensed under GPL 3.0.
Thank you. The Win32 API can, a lot of times, be pretty confusing and dauting!
License
DoorPad is licensed under GPL 3.0 or later. You may freely copy, distribute and modify it. Any modifications must also be distributed under GPL. You can read the COPYING file for more information.