Neuros OSD 1.0 (TORFU):widget-window-manager-desktop-brief

From The Neuros Technology Wiki

Jump to: navigation, search
Circle.jpg
NOTE: THIS PAGE IS OBSOLETE. IT MAY HAVE HISTORICAL SIGNIFICANCE, BUT IS OUT OF DATE OR NO LONGER PERTINENT.

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.


Contents

Concepts

Window manager

A special application that knows which GUI application should have active focus and how applicatoin top level container shall be decorated.

Desktop

Default application when system is idle, who also manages to bring up new applications, shows what application is running etc.

Shortcut button

Button that are exclusively registered to Window Manager to carry out special functionalities, such as minimize/close top active application etc.

Widget

Well defined GUI component that is used to build up the GUI application.

Container

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.

Form

Top level container whose focus can be manually manipulated by GUI application itself.

Layout

Layout determines the size and position of the components within a container.

Theme

User configurable widget decoration properties. Change is done at a system level, in other words, it is not application specific.

Design brief

  • 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.

Focus management

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.

Layout management

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

Launch application

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.

Stop application

  • 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.

Caveats

Neux is designed to be simple, thus the following is not supported (at least for now)

  • Mouse based focus change support
Personal tools