Starting an application

To start an application from your window manager, you need to publish (using a write() call) a start command to the PPS launcher control object.

Publish start command to the PPS object

After having opened the /pps/services/launcher/control object for publishing, call write() to modify the object's attributes. Use the appropriate message format with the valid start command.

#define CMD_START        "start"
int msgsize;
char msgbuf[4096];
int ret = 0;
char *id = strdup("101");
char *data = strdup("HelloWebWorks.testDev_lloWebWorks1fa80f60");
msgsize = snprintf(msgbuf,
                   "msg::%s\ndat::%s\nid::%s", CMD_START, data, id);
ret = write(pps_fd, msgbuf, (unsigned)msgsize);

The figure below shows the basic steps for launching an application:

  1. The device driver writes an event letting Screen know that someone has tried to launch an applicaiton.
  2. Window manager learns about the event through the Screen API.
  3. Window manager publishes to a PPS object so that interested components can know about the request to launch an application.
  4. The launcher reads the PPS object and begins launch procedures.
  5. The launcher asks the authorization manager to check permissions to launch the application.
  6. When it receives authorization, the launcher completes the application launch.
  7. The application uses the Screen API to tell Screen that it is present and ready to be displayed.
Figure 1. Step-by-step view of how window manager launches an application