Contiki 3.x
Macros | Functions
program-handler.c File Reference

The program handler, used for loading programs and starting the screensaver. More...

#include <string.h>
#include <stdlib.h>
#include "contiki.h"
#include "ctk/ctk.h"
#include "ctk/ctk-draw.h"
#include "sys/log.h"
#include "program-handler.h"

Go to the source code of this file.

Macros

#define NUM_PNARGS   6
 Initializes the program handler. More...
 

Functions

void program_handler_add (struct dsc *dsc, char *menuname, unsigned char desktop)
 Add a program to the program handler. More...
 
void program_handler_load (char *name, char *arg)
 Loads a program and displays a dialog telling the user about it. More...
 

Detailed Description

The program handler, used for loading programs and starting the screensaver.

Author
Adam Dunkels adam@.nosp@m.dunk.nosp@m.els.c.nosp@m.om

The Contiki program handler is responsible for the Contiki menu and the desktop icons, as well as for loading programs and displaying a dialog with a message telling which program that is loading.

The program handler also is responsible for starting the screensaver when the CTK detects that it should be started.

Definition in file program-handler.c.

Macro Definition Documentation

#define NUM_PNARGS   6

Initializes the program handler.

Is called by the initialization before any programs have been added with program_handler_add().

Definition at line 184 of file program-handler.c.

Function Documentation

void program_handler_add ( struct dsc dsc,
char *  menuname,
unsigned char  desktop 
)

Add a program to the program handler.

Parameters
dscThe DSC description structure for the program to be added.
menunameThe name that the program should have in the Contiki menu.
desktopFlag which specifies if the program should show up as an icon on the desktop or not.

Definition at line 163 of file program-handler.c.

References CTK_ICON_ADD, and ctk_menuitem_add().

void program_handler_load ( char *  name,
char *  arg 
)

Loads a program and displays a dialog telling the user about it.

Parameters
nameThe name of the program to be loaded.
argAn argument which is passed to the new process when it is loaded.

Definition at line 227 of file program-handler.c.

References ctk_label_set_text, NULL, and process_post().