Contiki 2.5
Data Structures | Macros | Functions | Variables
ctk.h File Reference

CTK header file. More...

#include "contiki-conf.h"
#include "contiki.h"

Go to the source code of this file.

Data Structures

struct  ctk_widget_button
 Instantiating macro for the ctk_icon widget. More...
 
struct  ctk_widget
 The generic CTK widget structure that contains all other widget structures. More...
 
struct  ctk_window
 Representation of a CTK window. More...
 
struct  ctk_menuitem
 Representation of an individual menu item. More...
 
struct  ctk_menu
 Representation of an individual menu. More...
 
struct  ctk_menus
 Representation of the menu bar. More...
 

Macros

#define CTK_WIDGET_SEPARATOR   1
 Widget number: The CTK separator widget. More...
 
#define CTK_WIDGET_LABEL   2
 Widget number: The CTK label widget. More...
 
#define CTK_WIDGET_BUTTON   3
 Widget number: The CTK button widget. More...
 
#define CTK_WIDGET_HYPERLINK   4
 Widget number: The CTK hyperlink widget. More...
 
#define CTK_WIDGET_TEXTENTRY   5
 Widget number: The CTK textentry widget. More...
 
#define CTK_WIDGET_BITMAP   6
 Widget number: The CTK bitmap widget. More...
 
#define CTK_WIDGET_ICON   7
 Widget number: The CTK icon widget. More...
 
#define CTK_SEPARATOR(x, y, w)   NULL, NULL, x, y, CTK_WIDGET_SEPARATOR, w, 1, CTK_WIDGET_FLAG_INITIALIZER(0)
 Instantiating macro for the ctk_separator widget. More...
 
#define CTK_BUTTON(x, y, w, text)   NULL, NULL, x, y, CTK_WIDGET_BUTTON, w, 1, CTK_WIDGET_FLAG_INITIALIZER(0) text
 Instantiating macro for the ctk_button widget. More...
 
#define CTK_LABEL(x, y, w, h, text)   NULL, NULL, x, y, CTK_WIDGET_LABEL, w, h, CTK_WIDGET_FLAG_INITIALIZER(0) text,
 Instantiating macro for the ctk_label widget. More...
 
#define CTK_HYPERLINK(x, y, w, text, url)   NULL, NULL, x, y, CTK_WIDGET_HYPERLINK, w, 1, CTK_WIDGET_FLAG_INITIALIZER(0) text, url
 Instantiating macro for the ctk_hyperlink widget. More...
 
#define CTK_TEXTENTRY_CLEAR(e)
 Clears a text entry widget and sets the cursor to the start of the text line. More...
 
#define CTK_TEXTENTRY(x, y, w, h, text, len)
 Instantiating macro for the ctk_textentry widget. More...
 
#define CTK_ICON_ADD(icon, p)   ctk_icon_add((struct ctk_widget *)icon, p)
 Add an icon to the desktop. More...
 
#define CTK_WIDGET_ADD(win, widg)   ctk_widget_add(win, (struct ctk_widget *)widg)
 Add a widget to a window. More...
 
#define CTK_WIDGET_FOCUS(win, widg)   (win)->focused = (struct ctk_widget *)(widg)
 Set focus to a widget. More...
 
#define CTK_WIDGET_REDRAW(widg)   ctk_widget_redraw((struct ctk_widget *)widg)
 Add a widget to the redraw queue. More...
 
#define CTK_WIDGET_TYPE(w)   ((w)->type)
 Obtain the type of a widget. More...
 
#define CTK_WIDGET_SET_WIDTH(widget, width)
 Sets the width of a widget. More...
 
#define CTK_WIDGET_XPOS(w)   (((struct ctk_widget *)(w))->x)
 Retrieves the x position of a widget, relative to the window in which the widget is contained. More...
 
#define CTK_WIDGET_SET_XPOS(w, xpos)   ((struct ctk_widget *)(w))->x = (xpos)
 Sets the x position of a widget, relative to the window in which the widget is contained. More...
 
#define CTK_WIDGET_YPOS(w)   (((struct ctk_widget *)(w))->y)
 Retrieves the y position of a widget, relative to the window in which the widget is contained. More...
 
#define CTK_WIDGET_SET_YPOS(w, ypos)   ((struct ctk_widget *)(w))->y = (ypos)
 Sets the y position of a widget, relative to the window in which the widget is contained. More...
 
#define ctk_label_set_height(w, height)   (w)->widget.label.h = (height)
 Set the height of a label. More...
 
#define ctk_label_set_text(l, t)   (l)->text = (t)
 Set the text of a label. More...
 
#define ctk_button_set_text(b, t)   (b)->text = (t)
 Set the text of a button. More...
 
#define CTK_FOCUS_NONE   0
 Widget focus flag: no focus. More...
 
#define CTK_FOCUS_WIDGET   1
 Widget focus flag: widget has focus. More...
 
#define CTK_FOCUS_WINDOW   2
 Widget focus flag: widget's window is the foremost one. More...
 
#define CTK_FOCUS_DIALOG   4
 Widget focus flag: widget is in a dialog. More...
 

Functions

void ctk_mode_set (unsigned char mode)
 Sets the current CTK mode. More...
 
unsigned char ctk_mode_get (void)
 Retrieves the current CTK mode. More...
 
CCIF void ctk_window_new (struct ctk_window *window, unsigned char w, unsigned char h, char *title)
 Create a new window. More...
 
CCIF void ctk_window_clear (struct ctk_window *w)
 Remove all widgets from a window. More...
 
CCIF void ctk_window_close (struct ctk_window *w)
 Close a window if it is open. More...
 
CCIF void ctk_window_redraw (struct ctk_window *w)
 Redraw a window. More...
 
CCIF void ctk_menu_add (struct ctk_menu *menu)
 Add a menu to the menu bar. More...
 
CCIF void ctk_menu_remove (struct ctk_menu *menu)
 Remove a menu from the menu bar. More...
 
void ctk_widget_redraw (struct ctk_widget *widget)
 Redraws a widget. More...
 
unsigned char ctk_desktop_width (struct ctk_desktop *d)
 Gets the width of the desktop. More...
 
unsigned char ctk_desktop_height (struct ctk_desktop *d)
 Gets the height of the desktop. More...
 

Variables

CCIF process_event_t ctk_signal_keypress
 Emitted for every key being pressed. More...
 
CCIF process_event_t ctk_signal_widget_activate
 Emitted when a widget is activated (pressed). More...
 
CCIF process_event_t ctk_signal_widget_select
 Emitted when a widget is selected. More...
 
CCIF process_event_t ctk_signal_menu_activate
 Emitted when a menu item is activated. More...
 
CCIF process_event_t ctk_signal_window_close
 Emitted when a window is closed. More...
 
CCIF process_event_t ctk_signal_button_activate
 Same as ctk_signal_widget_activate. More...
 
CCIF process_event_t ctk_signal_button_hover
 Same as ctk_signal_widget_select. More...
 
CCIF process_event_t ctk_signal_hyperlink_activate
 Emitted when a hyperlink is activated. More...
 
CCIF process_event_t ctk_signal_hyperlink_hover
 Same as ctk_signal_widget_select. More...
 

Detailed Description

CTK header file.

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

The CTK header file contains functioin declarations and definitions of CTK structures and macros.

Definition in file ctk.h.