Thursday, March 4, 2021

Look ma, no graphics!

Here's HelenOS calculator, viewed side-by-side in text mode and in graphics mode (note that this is still work in progress):

From the beginning of my UI rewrite project, one of the main goals was to create a single UI library that can handle both graphics mode and text mode (pseudo-graphics, actually). While the original goal was to be able to use the same library to write either graphics-mode applications (e.g. calculator) and text-mode applications (e.g. text editor, file manager), an 'unplanned' side effect is that it is possible to make the same application work in either mode (with relatively little effort).

With all the prior work done, putting the final pieces together and making it work was almost .. shockingly .. easy. I think this is a pretty cool and unique feature. There is still lot of work ahead, though. It is not possible currently to set the foreground and background colors individually (hence the strange text background colors) and doing that properly will require supporting different pixel formats in GFX. Also more customization needs to be done for text mode (perhaps a separate color palette) to make it look really good.

You can try it today in HelenOS master, just run "calculator -d cons@" in the terminal window.

No comments:

Post a Comment