Neuros OSD 1.0 (TORFU):widget-window-manager-desktop-brief
From The Neuros Technology Wiki
Neux and Nano-X have been replaced by Qtopia4 or Qt-Embedded 4.4.0 on the Neuros Platforms.
This is a high level explanation of Neux, a Neuros GUI toolkit based off Nano-X. The general concepts and design logic are briefly covered below.
Please feel free to edit, however please discuss in length on line at Google Groups Neuros before you commit drastic change here.
A special application that knows which GUI application should have active focus and how applicatoin top level container shall be decorated.
Default application when system is idle, who also manages to bring up new applications, shows what application is running etc.
Button that are exclusively registered to Window Manager to carry out special functionalities, such as minimize/close top active application etc.
Well defined GUI component that is used to build up the GUI application.
A special widget used to group other widgets and manage focus for its direct child widgets. Grouped widgets can be hidden/shown or moved(if supported) at the same time.
Top level container whose focus can be manually manipulated by GUI application itself.
Layout determines the size and position of the components within a container.
User configurable widget decoration properties. Change is done at a system level, in other words, it is not application specific.
- Desktop is integrated with Window Manager, which sits in parallel with GUI application.
- All that Neux exposes is a set of Widget APIs.
- Theme Management is done through theme plugins while Theme Manager exposes API to application layer (usually the Desktop) to config/choose active config.
+----------------+ | Window Manager | +-------------+ | Desktop | | Application | +-------++-------+ +------++-----+ || || ||====================>|| || || +-------\/------+ +------\/------+ | Theme Manager |<======| Widgets | +-------++------+ +------++------+ || || +-------\/------+ +------\/------+ | Theme Plugins | | Nano-X Server| +---------------+ +--------------+
WM and Desktop
To minimize IPC, WM and Desktop are combined into one process. In fact, WM/Desktop is just a regular GUI application built from Neux widgets, the only thing that is special about WM/Desktop is, it registers to listen to GR_CHLD_UPDATE_EVENT thus it 'senses' all other GUI application's creation/exiting etc and 'responds' accordingly.
Application/Form level focus
Whenever WM/Desktop starts new or activates running process, WM/Desktop sends focus to active Form of the active application/process.
In this case, focus is managed in a loose-stack way, when a form gets focus, its order gets raised to the top. When a focused form volunteerly loses visibility (unmapped, destroyed etc), focus goes to the form on the top of the stack.
Widget level focus
Form or container usually will re-route focus to its child widget, in this case, focus will be managed in user pre-defined order, until focus manual intervened by application or WM/desktop. This will prevent user application from managing focus for each individual widget.
Container can optionally have a layout manager, which is user configurable. When layout manager is available, it has the final say on the size and position of the components within the container.
How Desktop works
Desktop starts to assign focus to itself, thus button can be used to browse through a list of applications to choose from, then,
- if application is not running, run it. Focus will then go to application itself.
- if application is already running, retrieve application active form ID, show and assign focus to it.
- if application is not running, do nothing.
- if application is running, retrieve application ID, destroy it and all its child forms.
Determine whether application is running
- when application is created, a registration with its name/pid is automatically created, which is then be used to track if application is running or not.
Go back to Desktop
- when shortcut button is pressed, WM/Desktop responds to this message and sets focus to Desktop.
- when application is closed and active application on top of stack is Desktop itself.
How Theme Works
All decoration is done at widget level, WM is further simplified by removing the decoration function there. Theme manager will load and look at a theme description file to determine decoration style. Theme description file will be a simple key-value text file like the following
- Theme description file (*.ntheme)
ThemeName = neuros-default BackgroundImageName = neuros-bgd-img.jpg FormTitleBarBackgroundColor = BLUE FormTitleBar3D = TRUE FormBorder = TRUE ...
To be done
XIM DB support.
Neux is designed to be simple, thus the following is not supported (at least for now)
- Mouse based focus change support