*NIX GUI /desktop development

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
alex2maui2

*NIX GUI /desktop development

Post by alex2maui2 »

Hello,
Is it possible to take a LINUX, UNIX, or preferably Darwin distribution and start, basically, from a clean slate with the GUI, etc.?

In short, I want to attempt to write my own desktop environment, including window manager and all.

If it is possible, how easy or difficult is it to do? What I really want is relatively simple: the ability to set graphics settings(resolution and colors), the ability to draw to the screen(pixel by pixel or with more advanced graphics functions), the ability to set or override functions to handle mouse and keyboard events (preferably only a few functions: mousemove, mouseup, mousedown, keyup, keydown, etc), and... that's pretty much it.

I would like FreeType 1 or 2 and libjpeg and libpng for images and fonts.

Where exactly do I start?
OZ

Re:*NIX GUI /desktop development

Post by OZ »

Hi,
hard to say as it all depends, the only thing one can say for sure is it's not easy. But depending on what you intend to do it might be easier than implementing a gui all yourself in a homebrew os.

For Linux for example you have the possibility to write a window manager using the X server. Therefore you would have to take a look at the Xlib which provides you with basic functions for setting the resolution or plotting pixels (don't know if it also provides primitives). Then you would have to implement the window manager which enables you to have serveral windows displayed, as the x server natively only shows one application.

As you don't have functions to show 'dialog elements' (don't know the english word) like buttons/slider/checkboxes/etc. you would have to write libraries for them yourself using the x server's pixel functions. To ease things up you could reuse one of the gui toolkits like qt (base of kde) or gtk/2 (base of gnome) and just write the manager using these libraries.

If you don't intend to use the X server, then you could use the linux framebuffer device to provide a gui like it's done for embedded systems. There you have to do even more, as you would have to access the mouse via the device file (with x server it should be done by ipc with the server afaik).
Resolution switching should be a problem too, as linux just sets it during the boot process and got no way to change it when it's running (plz correct me if im wrong) - although you might extend the kernel functionality to your need here.
It's the same for the gui here, though gtk was ported to the fb already you could ease things a bit up here too.
Take a look at this! http://directfb.org/

Well it all depends on what you want to archieve.
Hope it helps
Post Reply