Computing screen

From LinuxMCE
Revision as of 23:11, 24 May 2008 by Perspectoff (Talk | contribs) (Programming details)

Jump to: navigation, search

Introduction

The Computing screen allows you to use external applications, like Mozilla Firefox or MythTV Setup. There are two columns on the screen -- one for installed programs and one for web bookmarks.

How to add "installed programs"

The "Computing" button on the Orbiter menu brings up a list of "installed programs" and "Web bookmarks."

(I have no idea how to add programs to this menu. If you know how, please add the info here.)

How to use

For OnScreen Orbiters

The on-screen Orbiter menu is used by a Media Director.

On the on-screen Orbiter main menu, click the "Computing" button. This will bring up a screen displaying "Installed programs" and "Web bookmarks".

If you click on a web bookmark, Firefox be used to start the webpage in fullscreen mode (except the "Home" and "Stop" buttons, which will be displayed at the bottom of the screen). The keyboard and mouse will control Firefox; events and orbiter will ignore the keyboard until Firefox is closed.

If you click on an Installed Program, the "Application Desktop" will appear, running the installed program. Below the "Desktop" button will be a label that indicates the name of the external application running. To close the external application, press the "Exit" button. (If no external application is running, the label, "Desktop" and "Exit" buttons will be hidden.)

Whenever you then click the home button, the main menu will reappear.

For other Orbiters

For Orbiters that do not use the on-screen Orbiter menu (such as webpads, mobile phones, and PDAs), the procedure is similar.

  • If xine or another media player is running while using hte Computing features, the xine window won't be visible.
  • If an external application is running and you wish play a movie, xine will be visible instead of the Orbiter menu.

Programming details

To encapsulate the logic for the Computing screen, a Screen Handler is used. The ScreenHandler is overridden by the SCREEN_Computing method.

SCREEN_Computing method

  • Callbacks for cbObjectSelected and cbDataGridSelected events are registered.
  • Decide if this Orbiter is an on-screen OSD orbiter (in which case we will know the status of any external application that might be started) or not (in which case we will use 'Get Active Application' to get the info from the Orbiter in use
  • If there is an external application running, show the "Desktop" and "Exit" buttons and the associated label; if not, these objects will be hidden.

Computing_ObjectSelected callback method

If the user presses "Exit" button, Orbiter will send a "kill application" command to App_Server and returns to the main menu display. Any information related to an external application running is reset.

If the user presses "Remote" button, the controlled Orbiter is sent to the "Application Desktop" screen and an "Activate Window" (using the window class of the external application as a parameter) is sent to controlled Orbiter. The Orbiter already should have the information about the external application.

Computing_DatagridSelected callback method

Once a cell is clicked in the Computing screen menu, this callback method is invoked. The cell has embedded in its value variable a comma delimited list with parameters about the application to run (window class, description, etc.). A "Spawn Application" command is sent to App_Server and the controlled Orbiter will be notified so that a "Active Window" command about the external application is started.

Activate Window command

This command is implemented in the overridden version of OrbiterLinux. In here, a small module called "Windows List Manager" is notified about the application to activate. When Orbiter goes to the "Application Desktop" screen, RenderDesktop is called and OrbiterLinux will know that it's time to find the external application's window and to activate it and set its position.