Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Examples

program-handler.c File Reference


Detailed Description

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

Author:
Adam Dunkels <adam@dunkels.com>
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.

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

Go to the source code of this file.

Defines

#define MAX_NUMDSCS   10
#define LOADER_EVENT_LOAD   1
#define LOADER_EVENT_DISPLAY_NAME   2
#define NUM_PNARGS   6
 Initializes the program handler.
#define NAMELEN   32
#define RUN(prg, name, arg)   program_handler_load(prg, arg)

Functions

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


Define 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 158 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:
dsc The DSC description structure for the program to be added.
menuname The name that the program should have in the Contiki menu.
desktop Flag which specifies if the program should show up as an icon on the desktop or not.

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

References CTK_ICON_ADD, and dsc::icon.

void program_handler_load char *  name,
char *  arg
 

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

Parameters:
name The name of the program to be loaded.
arg An argument which is passed to the new process when it is loaded.

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

References ctk_dialog_open(), ctk_label_set_text, LOADER_EVENT_DISPLAY_NAME, NULL, and process_post().

Referenced by PROCESS_THREAD().


Generated on Thu Jun 22 17:45:43 2006 for Contiki 2.x by  doxygen 1.4.4