Wednesday, September 14, 2005

Peixes on win32

Peixes is a multilingual text editor that I'm currently working on. It is built upon the IMLI library. The UI is done using the FLTK toolkit. Since my company uses a mix of Linux, Win32 and Mac OS X, portability is a key requirement for peixes.

For the win32 port, I decided to use the MingW's port of the GCC compiler. I use KDevelop and Emacs under Linux. Under Windows, I narrowed my choice to Dev-C++ and Code::Blocks .

Both are good IDEs that come with a decent project manager, a class browser, intellisense for C/C++ and an integrated visual debugger. The other good thing is they support multiple compiler toolsets including GCC, DigitalMars, OpenWatcom and Borland's free command line compiler.

Code::Blocks can also import Dev-Cpp's project files. Code::Blocks supports project workspaces which can be of great help when working on multiple related projects. However I settled for Dev-Cpp because it is somewhat faster and snappier on my old PIII + 128M of RAM and Code::Blocks was sluggish and used more resources.

Dev-Cpp is written in Delphi and is Win32 only at the moment. Code::Blocks uses wxWidgets and aims to be cross-platform.

All that said, automatic code indenting is poor in both the IDEs when you compare with Emacs's. Code::Blocks's is atleast ok but Dev-Cpp's is pretty basic. I chose Dev-Cpp purely because of its responsiveness. Is worse better ?

A major plus for Dev-Cpp is its DevPak package manager. A DevPak is basically a tarball containing headers, libraries, templates etc that can be installed into the toolset. Installation is painless and fully automatic. DevPaks for popular libraries are already available. Following Dejan Lekic's instructions, I was able to build a DevPak for the latest FLTK-1.1.x sources in 10 minutes !

Would be an interesting exercise to do a side-by-side comparison of KDevelop, Code::Blocks and Dev-Cpp.

Compiling peixes itself was straightforward as it does not use anything system specific (except for Printing where it uses lpr and friends).

Since there is no filesystem standard under Win32, the application and the library needs to be fully relocatable and should not assume anything related to installation path. Therefore IMLI library required some minor modifications such as using the registry for storing path to data files etc.

The next step was to bundle everything using an installer. This time my choices were Inno Setup and NSIS. I chose NSIS because of its better compression ('LZMA /solid ' is really a heavy hitter) and simpler scripting.

Tools - I love them !

btw, Peixes is under GPL and will be hosted along with IMLI. The plan is to release version 1.0 of peixes for Linux and Win32 by mid october.

1 comments:

a non programmer said...

after reading this blog i thought since you are looking for a description how about ... strictly for programmers