A screen management protocol


Zoxc

Still Fresh
Joined
Sep 13, 2008
Messages
73
I would like Pandora to have a standardized screen management protocol. The reason is that a screen manager would have much less memory overhead and practically no CPU overhead. It will also allow the application to do whatever it wants with the screen (pure framebuffer, DirectFB, Gtk+ on framebuffer, Qt Extended/Qt for Embedded Linux, etc...). It can also have limited support for unsupported applications.

Most applications will need adapting for the Pandora anyway, running Ubuntu (for example) makes it pretty useless since nothing is optimized for a 4.3" touchscreen.

The protocol will pretty much be simple IPC object which the application may pass on to third parties for uses like open/save dialog.

Code:
class Application
{
    bool Active; // This should be checked for every drawn frame, if it's false stop drawing to screen and call Release
    void (*Activate)() // This is called whenever Active is set to true. It will be called when your application is maximized.
    void (*Deactivate)() // This is called whenever Active is set to false. It's an alternative too pulling

    void Release() // This should be called when Active is false or Deactivate is called. If it's not called within a timeframe the application may be paused.
    void Minimize() // This one should be obvious. Nothing should be drawn to the screen after this is called
    void Terminate() // This should be called once the application is done with the screen. The object will not be accessible after this call.

    void SetTitle(char* NewTitle) // This will change the title of the application
    void SetIcon(Icon NewIcon) // This will change the icon of the application
}

To get this object the process will request it from the manager via IPC with Title and Icon parameters. A process may choose to request multiple objects, but then it will need to manage the screen itself. This might be useful for a X11 wrapper.

If an application doesn't call Release() after Active is false or Deactivate is called within a specified timeframe the manager may choose to pause the application and store a screenshot, which may be compressed. When the application is activated again, the screenshot is writen to the screen and the program is resumed. This kind of switching will be the default for not-supported processes.

I have already started on a menu/GUI which has a light framework which has the ability to load/unload nearly all resources used dynamicly for less memory overhead. It could be used for a simple picture viewer, music player, file browser and video player.

You can checkout it from here or download a precompiled build:

Here is a screenshot of Scale:
scaleiw8.png
 
As >90% of programs on Pandora will be ports or simply recompiled versions of other software, you would have really hard time pushing something like this.
 
Well it's not meant as a replacement of X, just as an simple/fast alternative. You could start kdrive from the menu to run all the slow ports, then return back when you are done with X. You could also start applications from the "simple mode" in X11 via X wrapper. That might be slow for high performance games and emulators, but will work fine for music players and such. The protocol should also have simple 2D functions so an X11 wrapper is possible without too much performance loss.
 
You can get a list of X windows open even from SDL via Xlib. But I don't think SDL itself can grab input from the root window and become thus a proper window manager.

I think the new X protocol library is libxcb, and it is supposed to be better than Xlib but I haven't tried it much yet. It might be possible to use xcb and imlib to create a real Unix desktop for the Pandora with that technology. That would be perfect and what I am hoping for, otherwise I'll probably just use evilwm.

Most applications already handle minimize and un/focus events via SDL (wrapped around Xlib) so perhaps this could be made to work with those existing applications.
 
the_darkside_986 said:
otherwise I'll probably just use evilwm.
Heck, I'll use it with or without alternatives. It's the perfect WM for these devices (as experienced on the Zaurus). Total keyboard control (of the WM; applications may vary), no wasted space whatsoever, and a low memory footprint for the win!

Of course, the screenshots above look much prettier, but "pretty" isn't my bag.

My opinions aside, they DO look very nice. Keep up the good work!
 
Back
Top