Data Structures | |
struct | ctk_separator |
struct | ctk_button |
struct | ctk_label |
struct | ctk_hyperlink |
struct | ctk_textentry |
struct | ctk_icon |
struct | ctk_bitmap |
struct | ctk_textmap |
struct | ctk_widget_button |
struct | ctk_widget_label |
struct | ctk_widget_hyperlink |
struct | ctk_widget_textentry |
struct | ctk_widget_icon |
struct | ctk_widget_bitmap |
Defines | |
#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. | |
#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. | |
#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. | |
#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. | |
#define | CTK_TEXTENTRY_NORMAL 0 |
#define | CTK_TEXTENTRY_EDIT 1 |
#define | CTK_TEXTENTRY_CLEAR(e) |
Clears a text entry widget and sets the cursor to the start of the text line. | |
#define | CTK_TEXTENTRY(x, y, w, h, text, len) |
Instantiating macro for the ctk_textentry widget. | |
#define | CTK_TEXTENTRY_INPUT(x, y, w, h, text, len, input) |
#define | CTK_ICON_BITMAP(bitmap) NULL |
#define | CTK_ICON_TEXTMAP(textmap) NULL |
#define | CTK_ICON(title, bitmap, textmap) |
Instantiating macro for the ctk_icon widget. | |
#define | CTK_BITMAP(x, y, w, h, bitmap, bitmap_width, bitmap_height) |
#define | CTK_TEXTMAP_NORMAL 0 |
#define | CTK_TEXTMAP_ACTIVE 1 |
#define | CTK_TEXTMAP(x, y, w, h, textmap) NULL, NULL, x, y, CTK_WIDGET_LABEL, w, h, CTK_WIDGET_FLAG_INITIALIZER(0) text, CTK_TEXTMAP_NORMAL |
#define | CTK_ICON_ADD(icon, p) ctk_icon_add((struct ctk_widget *)icon, p) |
Add an icon to the desktop. | |
#define | CTK_WIDGET_ADD(win, widg) ctk_widget_add(win, (struct ctk_widget *)widg) |
Add a widget to a window. | |
#define | CTK_WIDGET_FOCUS(win, widg) (win)->focused = (struct ctk_widget *)(widg) |
Set focus to a widget. | |
#define | CTK_WIDGET_REDRAW(widg) ctk_widget_redraw((struct ctk_widget *)widg) |
Add a widget to the redraw queue. | |
#define | CTK_WIDGET_TYPE(w) ((w)->type) |
Obtain the type of a widget. | |
#define | CTK_WIDGET_SET_WIDTH(widget, width) |
Sets the width of a widget. | |
#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. | |
#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. | |
#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. | |
#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. | |
#define | ctk_label_set_height(w, height) (w)->widget.label.h = (height) |
Set the height of a label. | |
#define | ctk_label_set_text(l, t) (l)->text = (t) |
Set the text of a label. | |
#define | ctk_button_set_text(b, t) (b)->text = (t) |
Set the text of a button. | |
#define | ctk_bitmap_set_bitmap(b, m) (b)->bitmap = (m) |
#define | CTK_BUTTON_NEW(widg, xpos, ypos, width, buttontext) |
#define | CTK_LABEL_NEW(widg, xpos, ypos, width, height, labeltext) |
#define | CTK_BITMAP_NEW(widg, xpos, ypos, width, height, bmap) |
#define | CTK_TEXTENTRY_NEW(widg, xxpos, yypos, width, height, textptr, textlen) |
#define | CTK_TEXTENTRY_INPUT_NEW(widg, xxpos, yypos, width, height, textptr, textlen, iinput) |
#define | CTK_HYPERLINK_NEW(widg, xpos, ypos, width, linktext, linkurl) |
#define | UP 0 |
#define | DOWN 1 |
#define | LEFT 2 |
#define | RIGHT 3 |
Typedefs | |
typedef unsigned char(* | ctk_textentry_input )(ctk_arch_key_t c, struct ctk_textentry *t) |
Functions | |
void | ctk_widget_redraw (struct ctk_widget *widget) |
Redraws a widget. | |
void | ctk_desktop_redraw (struct ctk_desktop *d) |
Redraw the entire desktop. | |
unsigned char | ctk_desktop_width (struct ctk_desktop *d) |
Gets the width of the desktop. | |
unsigned char | ctk_desktop_height (struct ctk_desktop *d) |
Gets the height of the desktop. | |
void | ctk_mode_set (unsigned char m) |
Sets the current CTK mode. | |
unsigned char | ctk_mode_get (void) |
Retrieves the current CTK mode. | |
void | ctk_icon_add (CC_REGISTER_ARG struct ctk_widget *icon, struct process *p) |
Add an icon to the desktop. | |
void | ctk_dialog_open (struct ctk_window *d) |
Open a dialog box. | |
void | ctk_dialog_close (void) |
Close the dialog box, if one is open. | |
void | ctk_window_open (CC_REGISTER_ARG struct ctk_window *w) |
Open a window, or bring window to front if already open. | |
void | ctk_window_close (struct ctk_window *w) |
Close a window if it is open. | |
void | ctk_window_clear (struct ctk_window *w) |
Remove all widgets from a window. | |
void | ctk_menu_add (struct ctk_menu *menu) |
Add a menu to the menu bar. | |
void | ctk_menu_remove (struct ctk_menu *menu) |
Remove a menu from the menu bar. | |
void | ctk_window_redraw (struct ctk_window *w) |
Redraw a window. | |
void | ctk_window_new (struct ctk_window *window, unsigned char w, unsigned char h, char *title) |
Create a new window. | |
void | ctk_dialog_new (CC_REGISTER_ARG struct ctk_window *dialog, unsigned char w, unsigned char h) |
Creates a new dialog. | |
void | ctk_menu_new (CC_REGISTER_ARG struct ctk_menu *menu, char *title) |
Creates a new menu. | |
unsigned char | ctk_menuitem_add (CC_REGISTER_ARG struct ctk_menu *menu, char *name) |
Adds a menu item to a menu. | |
void CC_FASTCALL | ctk_widget_add (CC_REGISTER_ARG struct ctk_window *window, CC_REGISTER_ARG struct ctk_widget *widget) |
Adds a widget to a window. | |
PROCESS_THREAD (ctk_process, ev, data) | |
Variables | |
process_event_t | ctk_signal_keypress |
Emitted for every key being pressed. | |
process_event_t | ctk_signal_widget_activate |
Emitted when a widget is activated (pressed). | |
process_event_t | ctk_signal_widget_select |
Emitted when a widget is selected. | |
process_event_t | ctk_signal_menu_activate |
Emitted when a menu item is activated. | |
process_event_t | ctk_signal_window_close |
Emitted when a window is closed. | |
process_event_t | ctk_signal_pointer_move |
Emitted when the mouse pointer is moved. | |
process_event_t | ctk_signal_pointer_button |
Emitted when a mouse button is pressed. | |
process_event_t | ctk_signal_button_activate |
Same as ctk_signal_widget_activate. | |
process_event_t | ctk_signal_button_hover |
Same as ctk_signal_widget_select. | |
process_event_t | ctk_signal_hyperlink_activate |
Emitted when a hyperlink is activated. | |
process_event_t | ctk_signal_hyperlink_hover |
Same as ctk_signal_widget_select. |
|
Instantiating macro for the ctk_button widget. This macro is used when instantiating a ctk_button widget and is intended to be used together with a struct assignment like this: struct ctk_button but = {CTK_BUTTON(0, 0, 2, "Ok")};
|
|
Set the text of a button.
|
|
Instantiating macro for the ctk_hyperlink widget. This macro is used when instantiating a ctk_hyperlink widget and is intended to be used together with a struct assignment like this: struct ctk_hyperlink hlink = {CTK_HYPERLINK(0, 0, 7, "Contiki", "http://dunkels.com/adam/contiki/")};
|
|
Value: NULL, NULL, 0, 0, CTK_WIDGET_ICON, 2, 4, CTK_WIDGET_FLAG_INITIALIZER(0) \ title, PROCESS_NONE, \ CTK_ICON_BITMAP(bitmap), CTK_ICON_TEXTMAP(textmap) This macro is used when instantiating a ctk_icon widget and is intended to be used together with a struct assignment like this:
|
|
Add an icon to the desktop.
Definition at line 716 of file ctk.h. Referenced by program_handler_add(). |
|
Instantiating macro for the ctk_label widget. This macro is used when instantiating a ctk_label widget and is intended to be used together with a struct assignment like this:
|
|
Set the height of a label.
|
|
Set the text of a label.
Definition at line 824 of file ctk.h. Referenced by PROCESS_THREAD(), and program_handler_load(). |
|
Instantiating macro for the ctk_separator widget. This macro is used when instantiating a ctk_separator widget and is intended to be used together with a struct assignment like this: struct ctk_separator sep = {CTK_SEPARATOR(0, 0, 23)};
|
|
Value: NULL, NULL, x, y, CTK_WIDGET_TEXTENTRY, w, 1, CTK_WIDGET_FLAG_INITIALIZER(0) text, len, \ CTK_TEXTENTRY_NORMAL, 0, 0, NULL This macro is used when instantiating a ctk_textentry widget and is intended to be used together with a struct assignment like this: struct ctk_textentry tentry = {CTK_TEXTENTRY(0, 0, 30, 1, textbuffer, 50)};
|
|
Value: Clears a text entry widget and sets the cursor to the start of the text line.
|
|
Add a widget to a window.
Definition at line 727 of file ctk.h. Referenced by ctk_textedit_add(). |
|
Set focus to a widget.
Definition at line 738 of file ctk.h. Referenced by ctk_textedit_eventhandler(), and PROCESS_THREAD(). |
|
Add a widget to the redraw queue.
Definition at line 746 of file ctk.h. Referenced by ctk_textedit_eventhandler(). |
|
Value: do { \ ((struct ctk_widget *)(widget))->w = (width); } while(0)
|
|
Sets the x position of a widget, relative to the window in which the widget is contained.
|
|
Sets the y position of a widget, relative to the window in which the widget is contained.
|
|
Obtain the type of a widget.
|
|
Retrieves the x position of a widget, relative to the window in which the widget is contained.
|
|
Retrieves the y position of a widget, relative to the window in which the widget is contained.
|
|
Gets the height of the desktop.
|
|
Redraw the entire desktop.
Definition at line 602 of file ctk.c. References CTK_MODE_NORMAL, CTK_MODE_WINDOWMOVE, PROCESS_CURRENT, and REDRAW_ALL. |
|
Gets the width of the desktop.
|
|
Creates a new dialog. This function only sets up the internal structure of the ctk_window struct but does not open the dialog. The dialog must be explicitly opened by calling the ctk_dialog_open() function.
Definition at line 729 of file ctk.c. References NULL. |
|
Open a dialog box.
Definition at line 313 of file ctk.c. References REDRAW_FOCUS. Referenced by PROCESS_THREAD(), and program_handler_load(). |
|
Add an icon to the desktop.
|
|
Add a menu to the menu bar.
Definition at line 488 of file ctk.c. References ctk_menus::menus, ctk_menu::next, NULL, and REDRAW_MENUPART. Referenced by PROCESS_THREAD(). |
|
Creates a new menu. This function sets up the internal structure of the menu, but does not add it to the menubar. Use the function ctk_menu_add() for that purpose.
Definition at line 747 of file ctk.c. References NULL. |
|
Remove a menu from the menu bar.
Definition at line 516 of file ctk.c. References ctk_menus::menus, ctk_menu::next, NULL, and REDRAW_MENUPART. |
|
Adds a menu item to a menu. In CTK, each menu item is identified by a number which is unique within each menu. When a menu item is selected, a ctk_menuitem_activated signal is emitted and the menu item number is passed as signal data with the signal.
|
|
Retrieves the current CTK mode.
|
|
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.
|
|
Adds a widget to a window. This function adds a widget to a window. The order of which the widgets are added is important, as it sets the order to which widgets are cycled with the widget selection keys.
Definition at line 896 of file ctk.c. References CTK_WIDGET_LABEL, and CTK_WIDGET_SEPARATOR. |
|
Redraws a widget. This function will set a flag which causes the widget to be redrawn next time the CTK process is scheduled.
Definition at line 873 of file ctk.c. References CTK_MODE_NORMAL, and NULL. |
|
Remove all widgets from a window.
Definition at line 471 of file ctk.c. References ctk_window::active, ctk_window::focused, ctk_window::inactive, and NULL. |
|
Close a window if it is open. If the window is not open, this function does nothing.
Definition at line 387 of file ctk.c. References ctk_window::next, NULL, ctk_window::prev, and REDRAW_ALL. Referenced by PROCESS_THREAD(). |
|
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.
|
|
Open a window, or bring window to front if already open.
Definition at line 338 of file ctk.c. References ctk_window::next, NULL, ctk_window::prev, and REDRAW_ALL. |
|
Redraw a window. This function redraws the window, but only if it is the foremost one on the desktop.
Definition at line 628 of file ctk.c. References ctk_draw_dialog(), ctk_draw_window(), CTK_FOCUS_WINDOW, CTK_MODE_NORMAL, NULL, and ctk_menus::open. Referenced by PROCESS_THREAD(). |
|
Emitted when a hyperlink is activated. The signal is broadcast to all listeners. Definition at line 115 of file ctk.c. Referenced by PROCESS_THREAD(). |
|
Emitted for every key being pressed. The key is passed as signal data. Definition at line 115 of file ctk.c. Referenced by ctk_textedit_eventhandler(), and PROCESS_THREAD(). |
|
Emitted when a menu item is activated. The number of the menu item is passed as signal data. Definition at line 115 of file ctk.c. Referenced by PROCESS_THREAD(). |
|
Emitted when a mouse button is pressed. The button is passed as signal data to the listening process. Definition at line 115 of file ctk.c. Referenced by PROCESS_THREAD(). |
|
Emitted when the mouse pointer is moved. A NULL pointer is passed as signal data and it is up to the listening process to check the position of the mouse using the CTK mouse API. Definition at line 115 of file ctk.c. Referenced by PROCESS_THREAD(). |
|
Emitted when a widget is activated (pressed). A pointer to the widget is passed as signal data. Definition at line 115 of file ctk.c. Referenced by ctk_textedit_eventhandler(), and PROCESS_THREAD(). |
|
Emitted when a widget is selected. A pointer to the widget is passed as signal data. Definition at line 115 of file ctk.c. Referenced by PROCESS_THREAD(). |
|
Emitted when a window is closed. A pointer to the window is passed as signal data. Definition at line 115 of file ctk.c. Referenced by PROCESS_THREAD(). |