Contiki 2.6

CTK graphical user interface

The Contiki Toolkit (CTK) provides the graphical user interface for the Contiki system. More...

Modules

 CTK device driver functions
 

The CTK device driver functions are divided into two modules, the ctk-draw module and the ctk-arch module.


 CTK events
 CTK application functions
 

The CTK functions used by an application program.


Files

file  ctk-draw.h
 

CTK screen drawing module interface, ctk-draw.


file  ctk.c
 

The Contiki Toolkit CTK, the Contiki GUI.


file  ctk.h
 

CTK header file.


Functions

unsigned char ctk_arch_keyavail (void)
 Checks the key press input queue to see if there are pending keys.
ctk_arch_key_t ctk_arch_getkey (void)
 Retrieves key presses from the VNC client.
void ctk_mode_set (unsigned char mode)
 Sets the current CTK mode.
unsigned char ctk_mode_get (void)
 Retrieves the current CTK mode.
CCIF void ctk_window_new (struct ctk_window *window, unsigned char w, unsigned char h, char *title)
 Create a new window.
CCIF void ctk_window_clear (struct ctk_window *w)
 Remove all widgets from a window.
CCIF void ctk_window_close (struct ctk_window *w)
 Close a window if it is open.
CCIF void ctk_window_redraw (struct ctk_window *w)
 Redraw a window.
CCIF void ctk_menu_add (struct ctk_menu *menu)
 Add a menu to the menu bar.
CCIF void ctk_menu_remove (struct ctk_menu *menu)
 Remove a menu from the menu bar.

Detailed Description

The Contiki Toolkit (CTK) provides the graphical user interface for the Contiki system.


Function Documentation

ctk_arch_key_t ctk_arch_getkey ( void  )

Retrieves key presses from the VNC client.

Called by the CTK module.

Returns:
The next key in the input queue.

Definition at line 1040 of file ctk-vncserver.c.

unsigned char ctk_arch_keyavail ( void  )

Checks the key press input queue to see if there are pending keys.

Called by the CTK module.

Returns:
Zero if no key presses are in buffer, non-zero if there are key presses in input buffer.

Definition at line 1027 of file ctk-vncserver.c.

CCIF void ctk_menu_add ( struct ctk_menu menu)

Add a menu to the menu bar.

Parameters:
menuThe menu to be added.
Note:
Do not call this function multiple times for the same menu, as no check is made to see if the menu already is in the menu bar.

Definition at line 505 of file ctk.c.

References ctk_menu::next, and NULL.

CCIF void ctk_menu_remove ( struct ctk_menu menu)

Remove a menu from the menu bar.

Parameters:
menuThe menu to be removed.

Definition at line 533 of file ctk.c.

References ctk_menu::next, and NULL.

unsigned char ctk_mode_get ( void  )

Retrieves the current CTK mode.

Returns:
The current CTK mode.

Definition at line 292 of file ctk.c.

void ctk_mode_set ( unsigned char  m)

Sets the current CTK mode.

The CTK mode can be either CTK_MODE_NORMAL, CTK_MODE_SCREENSAVER or CTK_MODE_EXTERNAL. CTK_MODE_NORMAL is the normal mode, in which keypresses and mouse pointer movements are processed and the screen is redrawn. In CTK_MODE_SCREENSAVER, no screen redraws are performed and the first key press or pointer movement will cause the ctk_signal_screensaver_stop to be emitted. In the CTK_MODE_EXTERNAL mode, key presses and pointer movements are ignored and no screen redraws are made.

Parameters:
mThe mode.

Definition at line 281 of file ctk.c.

CCIF void ctk_window_clear ( struct ctk_window w)

Remove all widgets from a window.

Parameters:
wThe window to be cleared.

Definition at line 486 of file ctk.c.

References ctk_window::active, ctk_window::focused, ctk_window::inactive, and NULL.

CCIF void ctk_window_close ( struct ctk_window w)

Close a window if it is open.

If the window is not open, this function does nothing.

Parameters:
wThe window to be closed.

Definition at line 401 of file ctk.c.

References ctk_window::next, NULL, ctk_window::prev, and ctk_window::w.

CCIF void ctk_window_new ( struct ctk_window window,
unsigned char  w,
unsigned char  h,
char *  title 
)

Create a new window.

Creates a new window. The memory for the window structure must already be allocated by the caller, and is usually done with a static declaration.

This function sets up the internal structure of the ctk_window struct and creates the move and close buttons, but it does not open the window. The window must be explicitly opened by calling the ctk_window_open() function.

Parameters:
windowThe window to be created.
wThe width of the new window.
hThe height of the new window.
titleThe title of the new window.

Definition at line 733 of file ctk.c.

CCIF void ctk_window_redraw ( struct ctk_window w)

Redraw a window.

This function redraws the window, but only if it is the foremost one on the desktop.

Parameters:
wThe window to be redrawn.

Definition at line 653 of file ctk.c.

References ctk_draw_dialog(), ctk_draw_window(), CTK_FOCUS_WINDOW, and NULL.