Starting an application

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

Publishing a start command to the PPS object

After opening the /pps/services/launcher/control object for publishing, call write() to modify the object's attributes. Use the appropriate message format with the 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,
                   sizeof(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 application.
  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

For information about Application Launcher and the PPS control object it uses, see launcher in the System Services Reference and /pps/services/launcher/control in the PPS Objects Reference.